Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi,

There was a lot of WW8Bytes( SV_DECL_VARARR ) which was partly replaced
with ww::bytes. This set of patches totally migrates code to ww::bytes.

Cheers,
        Maciej
From 586152ea3b6c39065496a7d7511aa0279a5cfbab Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski <maciej.rumianowski@gmail.com>
Date: Sun, 2 Oct 2011 19:22:10 +0200
Subject: [PATCH 1/4] 1 Part of Replace WW8Bytes with ww::bytes

Change WW8Export::pO to ww::bytes and other related
---
 sw/source/filter/ww8/wrtw8esh.cxx |   16 +-
 sw/source/filter/ww8/wrtw8nds.cxx |   53 ++++----
 sw/source/filter/ww8/wrtw8num.cxx |   20 ++--
 sw/source/filter/ww8/wrtw8sty.cxx |  101 +++++++-------
 sw/source/filter/ww8/wrtww8.cxx   |   96 ++++++-------
 sw/source/filter/ww8/wrtww8.hxx   |   14 +-
 sw/source/filter/ww8/wrtww8gr.cxx |   10 +-
 sw/source/filter/ww8/ww8atr.cxx   |  274 ++++++++++++++++++-------------------
 8 files changed, 283 insertions(+), 301 deletions(-)

diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 7695670..a0f7ca2 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1181,7 +1181,7 @@ void WW8Export::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 
nTyp
 
         rtl_TextEncoding eChrSet = aAttrIter.GetNodeCharSet();
 
-        OSL_ENSURE( !pO->Count(), " pO ist am Zeilenanfang nicht leer" );
+        OSL_ENSURE( pO->empty(), " pO ist am Zeilenanfang nicht leer" );
 
         String aStr( rEditObj.GetText( n ));
         xub_StrLen nAktPos = 0;
@@ -1206,8 +1206,8 @@ void WW8Export::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 
nTyp
                                             // Ausgabe der Zeichenattribute
             aAttrIter.OutAttr( nAktPos );   // nAktPos - 1 ??
             pChpPlc->AppendFkpEntry( Strm().Tell(),
-                                            pO->Count(), pO->GetData() );
-            pO->Remove( 0, pO->Count() );                   // leeren
+                                            pO->size(), &(*pO)[0] );
+            pO->clear();
 
                         // Ausnahme: Fussnoten am Zeilenende
             if( nNextAttr == nEnd && bTxtAtr )
@@ -1218,17 +1218,17 @@ void WW8Export::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 
nTyp
         }
         while( nAktPos < nEnd );
 
-        OSL_ENSURE( !pO->Count(), " pO ist am ZeilenEnde nicht leer" );
+        OSL_ENSURE( pO->empty(), " pO ist am ZeilenEnde nicht leer" );
 
-        pO->Insert( bNul, pO->Count() );        // Style # as short
-        pO->Insert( bNul, pO->Count() );
+        pO->push_back( bNul );        // Style # as short
+        pO->push_back( bNul );
 
         aAttrIter.OutParaAttr(false);
 
         sal_uLong nPos = Strm().Tell();
         pPapPlc->AppendFkpEntry( Strm().Tell(),
-                                        pO->Count(), pO->GetData() );
-        pO->Remove( 0, pO->Count() );                       // leeren
+                                        pO->size(), &(*pO)[0] );
+        pO->clear();
         pChpPlc->AppendFkpEntry( nPos );
     }
 
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 23af249..2b06b30 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -629,7 +629,7 @@ const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const
 
 void WW8Export::GetCurrentItems(WW8Bytes& rItems) const
 {
-    sal_uInt16 nEnd = pO ? pO->Count() : 0;
+    sal_uInt16 nEnd = pO ? pO->size() : 0;
     for (sal_uInt16 nI = 0; nI < nEnd; ++nI)
         rItems.Insert((*pO)[nI], rItems.Count());
 }
@@ -1512,15 +1512,15 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const 
SwFmtDrop &rS
 
     SVBT16 nSty;
     ShortToSVBT16( nStyle, nSty );
-    m_rWW8Export.pO->Insert( (sal_uInt8*)&nSty, 2, m_rWW8Export.pO->Count() );     // Style #
+    m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nSty, (sal_uInt8*)&nSty+2 );     
// Style #
 
     if ( m_rWW8Export.bWrtWW8 )
     {
         m_rWW8Export.InsUInt16( NS_sprm::LN_PPc );            // Alignment (sprmPPc)
-        m_rWW8Export.pO->Insert( 0x20, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 0x20 );
 
         m_rWW8Export.InsUInt16( NS_sprm::LN_PWr );            // Wrapping (sprmPWr)
-        m_rWW8Export.pO->Insert( 0x02, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 0x02 );
 
         m_rWW8Export.InsUInt16( NS_sprm::LN_PDcs );            // Dropcap (sprmPDcs)
         int nDCS = ( nDropLines << 3 ) | 0x01;
@@ -1538,22 +1538,22 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const 
SwFmtDrop &rS
     }
     else
     {
-        m_rWW8Export.pO->Insert( 29, m_rWW8Export.pO->Count() );    // Alignment (sprmPPc)
-        m_rWW8Export.pO->Insert( 0x20, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 29 );    // Alignment (sprmPPc)
+        m_rWW8Export.pO->push_back( 0x20 );
 
-        m_rWW8Export.pO->Insert( 37, m_rWW8Export.pO->Count() );    // Wrapping (sprmPWr)
-        m_rWW8Export.pO->Insert( 0x02, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 37 );    // Wrapping (sprmPWr)
+        m_rWW8Export.pO->push_back( 0x02 );
 
-        m_rWW8Export.pO->Insert( 46, m_rWW8Export.pO->Count() );    // Dropcap (sprmPDcs)
+        m_rWW8Export.pO->push_back( 46 );    // Dropcap (sprmPDcs)
         int nDCS = ( nDropLines << 3 ) | 0x01;
         m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( nDCS ) );
 
-        m_rWW8Export.pO->Insert( 49, m_rWW8Export.pO->Count() );      // Distance from text 
(sprmPDxaFromText)
+        m_rWW8Export.pO->push_back( 49 );      // Distance from text (sprmPDxaFromText)
         m_rWW8Export.InsUInt16( nDistance );
 
         if (rNode.GetDropSize(rFontHeight, rDropHeight, rDropDescent))
         {
-            m_rWW8Export.pO->Insert( 20, m_rWW8Export.pO->Count() );  // Line spacing
+            m_rWW8Export.pO->push_back( 20 );  // Line spacing
             m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( -rDropHeight ) );
             m_rWW8Export.InsUInt16( 0 );
         }
@@ -1570,8 +1570,8 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop 
&rS
         TableInfoCell( pTextNodeInfoInner );
     }
 
-    m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->Count(), 
m_rWW8Export.pO->GetData() );
-    m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->size(), 
&(*m_rWW8Export.pO)[0] );
+    m_rWW8Export.pO->clear();
 
     if ( rNode.GetDropSize( rFontHeight, rDropHeight, rDropDescent ) )
     {
@@ -1599,16 +1599,16 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const 
SwFmtDrop &rS
                 m_rWW8Export.InsUInt16( m_rWW8Export.GetId( *pSwCharFmt ) );
             }
 
-            m_rWW8Export.pO->Insert( 101, m_rWW8Export.pO->Count() );      // Lower the chars
+            m_rWW8Export.pO->push_back( 101 );      // Lower the chars
             m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( -((nDropLines - 1)*rDropDescent) / 
10 ) );
 
-            m_rWW8Export.pO->Insert( 99, m_rWW8Export.pO->Count() );      // Font Size
+            m_rWW8Export.pO->push_back( 99 );      // Font Size
             m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( rFontHeight / 10 ) );
         }
     }
 
-    m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->Count(), 
m_rWW8Export.pO->GetData() );
-    m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->size(), 
&(*m_rWW8Export.pO)[0] );
+    m_rWW8Export.pO->clear();
 }
 
 xub_StrLen MSWordExportBase::GetNextPos( SwWW8AttrIter* aAttrIter, const SwTxtNode& rNode, 
xub_StrLen nAktPos  )
@@ -2370,11 +2370,10 @@ void WW8AttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t 
pNodeIn
         {
             TableRowEnd( pInner->getDepth() );
 
-            m_rWW8Export.pO->Insert( (sal_uInt8*)&nSty, 2, m_rWW8Export.pO->Count() );     // 
Style #
+            m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nSty, 
(sal_uInt8*)&nSty+2);     // Style #
             TableInfoRow( pInner );
-            m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), 
m_rWW8Export.pO->Count(),
-                                     m_rWW8Export.pO->GetData() );
-            m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );                       // leeren
+            m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), 
m_rWW8Export.pO->size(), &(*m_rWW8Export.pO)[0]);
+            m_rWW8Export.pO->clear();
         }
 
         if ( pInner->isEndOfLine() )
@@ -2704,8 +2703,8 @@ void WW8AttributeOutput::Redline( const SwRedlineData* pRedline )
         if( m_rWW8Export.bWrtWW8 )
         {
             m_rWW8Export.InsUInt16( NS_sprm::LN_CPropRMark );
-            m_rWW8Export.pO->Insert( 7, m_rWW8Export.pO->Count() );       // len
-            m_rWW8Export.pO->Insert( 1, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 7 );       // len
+            m_rWW8Export.pO->push_back( 1 );
             m_rWW8Export.InsUInt16( m_rWW8Export.AddRedlineAuthor( pRedline->GetAuthor() ) );
             m_rWW8Export.InsUInt32( sw::ms::DateTime2DTTM( pRedline->GetTimeStamp() ));
         }
@@ -2723,19 +2722,19 @@ void WW8AttributeOutput::Redline( const SwRedlineData* pRedline )
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( pSprmIds[0] );
         else
-            m_rWW8Export.pO->Insert( msword_cast<sal_uInt8>(pSprmIds[0]), m_rWW8Export.pO->Count() 
);
-        m_rWW8Export.pO->Insert( 1, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( msword_cast<sal_uInt8>(pSprmIds[0]) );
+        m_rWW8Export.pO->push_back( 1 );
 
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( pSprmIds[1] );
         else
-            m_rWW8Export.pO->Insert( msword_cast<sal_uInt8>(pSprmIds[1]), m_rWW8Export.pO->Count() 
);
+            m_rWW8Export.pO->push_back( msword_cast<sal_uInt8>(pSprmIds[1]) );
         m_rWW8Export.InsUInt16( m_rWW8Export.AddRedlineAuthor( pRedline->GetAuthor() ) );
 
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( pSprmIds[2] );
         else
-            m_rWW8Export.pO->Insert( msword_cast<sal_uInt8>(pSprmIds[2]), m_rWW8Export.pO->Count() 
);
+            m_rWW8Export.pO->push_back( msword_cast<sal_uInt8>(pSprmIds[2]) );
         m_rWW8Export.InsUInt32( sw::ms::DateTime2DTTM( pRedline->GetTimeStamp() ));
     }
 }
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index 5be0369..e7d476e 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -244,10 +244,10 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/,
     SwWW8Writer::WriteLong( *m_rWW8Export.pTableStrm, 0 );
 
     // cbGrpprlChpx
-    WW8Bytes aCharAtrs;
+    ww::bytes aCharAtrs;
     if ( pOutSet )
     {
-        WW8Bytes* pOldpO = m_rWW8Export.pO;
+        ww::bytes* pOldpO = m_rWW8Export.pO;
         m_rWW8Export.pO = &aCharAtrs;
         if ( pFont )
         {
@@ -260,7 +260,7 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/,
                 m_rWW8Export.InsUInt16( NS_sprm::LN_CRgFtc2 );
             }
             else
-                m_rWW8Export.pO->Insert( 93, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( 93 );
             m_rWW8Export.InsUInt16( nFontID );
         }
 
@@ -268,7 +268,7 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/,
 
         m_rWW8Export.pO = pOldpO;
     }
-    *m_rWW8Export.pTableStrm << sal_uInt8( aCharAtrs.Count() );
+    *m_rWW8Export.pTableStrm << sal_uInt8( aCharAtrs.size() );
 
     // cbGrpprlPapx
     sal_uInt8 aPapSprms [] = {
@@ -292,8 +292,8 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/,
     m_rWW8Export.pTableStrm->Write( aPapSprms, sizeof( aPapSprms ));
 
     // write Chpx
-    if( aCharAtrs.Count() )
-        m_rWW8Export.pTableStrm->Write( aCharAtrs.GetData(), aCharAtrs.Count() );
+    if( !aCharAtrs.empty() )
+        m_rWW8Export.pTableStrm->Write( &aCharAtrs[0], aCharAtrs.size() );
 
     // write the num string
     SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, rNumberingString.Len() );
@@ -567,7 +567,7 @@ void WW8Export::OutputOlst( const SwNumRule& rRule )
 
     static sal_uInt8 aSprmOlstHdr[] = { 133, 212 };
 
-    pO->Insert( aSprmOlstHdr, sizeof( aSprmOlstHdr ), pO->Count() );
+    pO->insert( pO->end(), aSprmOlstHdr, aSprmOlstHdr+sizeof( aSprmOlstHdr ) );
     WW8_OLST aOlst;
     memset( &aOlst, 0, sizeof(aOlst) );
     sal_uInt8* pC = aOlst.rgch;
@@ -584,14 +584,14 @@ void WW8Export::OutputOlst( const SwNumRule& rRule )
                             *pFmt, (sal_uInt8)j );
     }
 
-    pO->Insert( (sal_uInt8*)&aOlst, sizeof( aOlst ), pO->Count() );
+    pO->insert( pO->end(), (sal_uInt8*)&aOlst, (sal_uInt8*)&aOlst+sizeof( aOlst ) );
 }
 
 
 void WW8Export::Out_WwNumLvl( sal_uInt8 nWwLevel )
 {
-    pO->Insert( 13, pO->Count() );
-    pO->Insert( nWwLevel, pO->Count() );
+    pO->push_back( 13 );
+    pO->push_back( nWwLevel );
 }
 
 void WW8Export::Out_SwNumLvl( sal_uInt8 nSwLevel )
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 56251ae..311dba2 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -294,24 +294,24 @@ void MSWordStyles::BuildStylesTable()
 }
 
 /// For WW8 only - extend pO so that the size of pTableStrm is even.
-static void impl_SkipOdd( WW8Bytes* pO, sal_Size nTableStrmTell )
+static void impl_SkipOdd( ww::bytes* pO, sal_Size nTableStrmTell )
 {
-    if ( ( nTableStrmTell + pO->Count() ) & 1 )     // Start auf gerader
-        pO->Insert( (sal_uInt8)0, pO->Count() );         // Adresse
+    if ( ( nTableStrmTell + pO->size() ) & 1 )     // Start auf gerader
+        pO->push_back( (sal_uInt8)0 );         // Adresse
 }
 
 void WW8AttributeOutput::EndStyle()
 {
     impl_SkipOdd( m_rWW8Export.pO, m_rWW8Export.pTableStrm->Tell() );
 
-    short nLen = m_rWW8Export.pO->Count() - 2;            // Laenge des Styles
-    sal_uInt8* p = (sal_uInt8*)m_rWW8Export.pO->GetData() + nPOPosStdLen1;
+    short nLen = m_rWW8Export.pO->size() - 2;            // Laenge des Styles
+    sal_uInt8* p = &(*m_rWW8Export.pO)[0] + nPOPosStdLen1;
     ShortToSVBT16( nLen, p );               // nachtragen
-    p = (sal_uInt8*)m_rWW8Export.pO->GetData() + nPOPosStdLen2;
+    p = &(*m_rWW8Export.pO)[0] + nPOPosStdLen2;
     ShortToSVBT16( nLen, p );               // dito
 
-    m_rWW8Export.pTableStrm->Write( m_rWW8Export.pO->GetData(), m_rWW8Export.pO->Count() );      
// ins File damit
-    m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );                   // leeren fuer 
naechsten
+    m_rWW8Export.pTableStrm->Write( &(*m_rWW8Export.pO)[0], m_rWW8Export.pO->size() );      // ins 
File damit
+    m_rWW8Export.pO->clear();
 }
 
 void WW8AttributeOutput::StartStyle( const String& rName, bool bPapFmt, sal_uInt16 nWwBase,
@@ -349,26 +349,25 @@ void WW8AttributeOutput::StartStyle( const String& rName, bool bPapFmt, 
sal_uInt
     sal_uInt16 nLen = static_cast< sal_uInt16 >( ( pData - aWW8_STD ) + 1 +
                 ((m_rWW8Export.bWrtWW8 ? 2 : 1 ) * (rName.Len() + 1)) );  // vorlaeufig
 
-    WW8Bytes* pO = m_rWW8Export.pO;
-    nPOPosStdLen1 = pO->Count();        // Adr1 zum nachtragen der Laenge
+    nPOPosStdLen1 = m_rWW8Export.pO->size();        // Adr1 zum nachtragen der Laenge
 
-    SwWW8Writer::InsUInt16( *pO, nLen );
-    pO->Insert( aWW8_STD, static_cast< sal_uInt16 >( pData - aWW8_STD ), pO->Count() );
+    SwWW8Writer::InsUInt16( *m_rWW8Export.pO, nLen );
+    m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), aWW8_STD, pData );
 
     nPOPosStdLen2 = nPOPosStdLen1 + 8;  // Adr2 zum nachtragen von "end of upx"
 
     // Namen schreiben
     if( m_rWW8Export.bWrtWW8 )
     {
-        SwWW8Writer::InsUInt16( *pO, rName.Len() ); // Laenge
-        SwWW8Writer::InsAsString16( *pO, rName );
+        SwWW8Writer::InsUInt16( *m_rWW8Export.pO, rName.Len() ); // Laenge
+        SwWW8Writer::InsAsString16( *m_rWW8Export.pO, rName );
     }
     else
     {
-        pO->Insert( (sal_uInt8)rName.Len(), pO->Count() );       // Laenge
-        SwWW8Writer::InsAsString8( *pO, rName, RTL_TEXTENCODING_MS_1252 );
+        m_rWW8Export.pO->push_back( (sal_uInt8)rName.Len() );       // Laenge
+        SwWW8Writer::InsAsString8( *m_rWW8Export.pO, rName, RTL_TEXTENCODING_MS_1252 );
     }
-    pO->Insert( (sal_uInt8)0, pO->Count() );             // Trotz P-String 0 am Ende!
+    m_rWW8Export.pO->push_back( (sal_uInt8)0 );             // Trotz P-String 0 am Ende!
 }
 
 void MSWordStyles::SetStyleDefaults( const SwFmt& rFmt, bool bPap )
@@ -425,21 +424,19 @@ void MSWordStyles::SetStyleDefaults( const SwFmt& rFmt, bool bPap )
 
 void WW8AttributeOutput::StartStyleProperties( bool bParProp, sal_uInt16 nStyle )
 {
-    WW8Bytes* pO = m_rWW8Export.pO;
-
-    impl_SkipOdd( pO, m_rWW8Export.pTableStrm->Tell() );
+    impl_SkipOdd( m_rWW8Export.pO, m_rWW8Export.pTableStrm->Tell() );
 
     sal_uInt16 nLen = ( bParProp ) ? 2 : 0;             // Default-Laenge
-    m_nStyleLenPos = pO->Count();               // Laenge zum Nachtragen
+    m_nStyleLenPos = m_rWW8Export.pO->size();               // Laenge zum Nachtragen
                                     // Keinen Pointer merken, da sich bei
                                     // _grow der Pointer aendert !
 
-    SwWW8Writer::InsUInt16( *pO, nLen );        // Style-Len
+    SwWW8Writer::InsUInt16( *m_rWW8Export.pO, nLen );        // Style-Len
 
-    m_nStyleStartSize = pO->Count();
+    m_nStyleStartSize = m_rWW8Export.pO->size();
 
     if ( bParProp )
-        SwWW8Writer::InsUInt16( *pO, nStyle );     // Style-Nummer
+        SwWW8Writer::InsUInt16( *m_rWW8Export.pO, nStyle );     // Style-Nummer
 }
 
 void MSWordStyles::WriteProperties( const SwFmt* pFmt, bool bParProp, sal_uInt16 nPos,
@@ -464,10 +461,8 @@ void MSWordStyles::WriteProperties( const SwFmt* pFmt, bool bParProp, 
sal_uInt16
 
 void WW8AttributeOutput::EndStyleProperties( bool /*bParProp*/ )
 {
-    WW8Bytes* pO = m_rWW8Export.pO;
-
-    sal_uInt16 nLen = pO->Count() - m_nStyleStartSize;
-    sal_uInt8* pUpxLen = (sal_uInt8*)pO->GetData() + m_nStyleLenPos; // Laenge zum Nachtragen
+    sal_uInt16 nLen = m_rWW8Export.pO->size() - m_nStyleStartSize;
+    sal_uInt8* pUpxLen = &(*m_rWW8Export.pO)[0] + m_nStyleLenPos; // Laenge zum Nachtragen
     ShortToSVBT16( nLen, pUpxLen );                 // Default-Laenge eintragen
 }
 
@@ -1289,7 +1284,7 @@ int MSWordSections::HasBorderItem( const SwFmt& rFmt )
 
 void WW8AttributeOutput::StartSection()
 {
-    m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );       // leeren
+    m_rWW8Export.pO->clear();
 }
 
 void WW8AttributeOutput::SectionFormProtection( bool bProtected )
@@ -1301,8 +1296,8 @@ void WW8AttributeOutput::SectionFormProtection( bool bProtected )
         if ( m_rWW8Export.bWrtWW8 )
             SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SFProtected );
         else
-            m_rWW8Export.pO->Insert( 139, m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( 1 , m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 139 );
+        m_rWW8Export.pO->push_back( 1 );
     }
 }
 
@@ -1312,14 +1307,14 @@ void WW8AttributeOutput::SectionLineNumbering( sal_uLong nRestartNo, const 
SwLin
     if ( m_rWW8Export.bWrtWW8 )
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SNLnnMod );
     else
-        m_rWW8Export.pO->Insert( 154, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 154 );
     SwWW8Writer::InsUInt16( *m_rWW8Export.pO, (sal_uInt16)rLnNumInfo.GetCountBy() );
 
     // sprmSDxaLnn - xPosition of Line Number
     if ( m_rWW8Export.bWrtWW8 )
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SDxaLnn );
     else
-        m_rWW8Export.pO->Insert( 155, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 155 );
     SwWW8Writer::InsUInt16( *m_rWW8Export.pO, (sal_uInt16)rLnNumInfo.GetPosFromLeft() );
 
     // sprmSLnc - restart number: 0 per page, 1 per section, 2 never restart
@@ -1328,8 +1323,8 @@ void WW8AttributeOutput::SectionLineNumbering( sal_uLong nRestartNo, const 
SwLin
         if ( m_rWW8Export.bWrtWW8 )
             SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SLnc );
         else
-            m_rWW8Export.pO->Insert( 152, m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( nRestartNo ? 1 : 2, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 152 );
+        m_rWW8Export.pO->push_back( nRestartNo ? 1 : 2 );
     }
 
     // sprmSLnnMin - Restart the Line Number with given value
@@ -1338,7 +1333,7 @@ void WW8AttributeOutput::SectionLineNumbering( sal_uLong nRestartNo, const 
SwLin
         if ( m_rWW8Export.bWrtWW8 )
             SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SLnnMin );
         else
-            m_rWW8Export.pO->Insert( 160, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 160 );
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, (sal_uInt16)nRestartNo - 1 );
     }
 }
@@ -1349,8 +1344,8 @@ void WW8AttributeOutput::SectionTitlePage()
     if ( m_rWW8Export.bWrtWW8 )
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SFTitlePage );
     else
-        m_rWW8Export.pO->Insert( 143, m_rWW8Export.pO->Count() );
-    m_rWW8Export.pO->Insert( 1, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 143 );
+    m_rWW8Export.pO->push_back( 1 );
 }
 
 void WW8AttributeOutput::SectionPageBorders( const SwFrmFmt* pPdFmt, const SwFrmFmt* pPdFirstPgFmt 
)
@@ -1389,7 +1384,7 @@ void WW8AttributeOutput::SectionBiDi( bool bBiDi )
     if ( m_rWW8Export.bWrtWW8 )
     {
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SFBiDi );
-        m_rWW8Export.pO->Insert( bBiDi? 1: 0, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( bBiDi? 1: 0 );
     }
 }
 
@@ -1400,8 +1395,8 @@ void WW8AttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, 
sal_uInt16 n
     if ( m_rWW8Export.bWrtWW8 )
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SNfcPgn );
     else
-        m_rWW8Export.pO->Insert( 147, m_rWW8Export.pO->Count() );
-    m_rWW8Export.pO->Insert( nb, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 147 );
+    m_rWW8Export.pO->push_back( nb );
 
     if ( nPageRestartNumber )
     {
@@ -1409,14 +1404,14 @@ void WW8AttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, 
sal_uInt16 n
         if ( m_rWW8Export.bWrtWW8 )
             SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SFPgnRestart );
         else
-            m_rWW8Export.pO->Insert( 150, m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( 1, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 150 );
+        m_rWW8Export.pO->push_back( 1 );
 
         // sprmSPgnStart
         if ( m_rWW8Export.bWrtWW8 )
             SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SPgnStart );
         else
-            m_rWW8Export.pO->Insert( 161, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 161 );
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, nPageRestartNumber );
     }
 }
@@ -1428,8 +1423,8 @@ void WW8AttributeOutput::SectionType( sal_uInt8 nBreakCode )
         if ( m_rWW8Export.bWrtWW8 )
             SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_SBkc );
         else
-            m_rWW8Export.pO->Insert( 142, m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( nBreakCode, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 142 );
+        m_rWW8Export.pO->push_back( nBreakCode );
     }
 }
 
@@ -1448,8 +1443,8 @@ void WW8AttributeOutput::SectionWW6HeaderFooterFlags( sal_uInt8 
nHeadFootFlags )
         }
 
         // sprmSGprfIhdt, wird nur noch im WW95 benoetigt
-        m_rWW8Export.pO->Insert( 153, m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( nTmpFlags, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 153 );
+        m_rWW8Export.pO->push_back( nTmpFlags );
     }
 }
 
@@ -1458,12 +1453,12 @@ void WW8Export::SetupSectionPositions( WW8_PdAttrDesc* pA )
     if ( !pA )
         return;
 
-    if ( pO->Count() )
+    if ( !pO->empty() )
     {                   // waren Attrs vorhanden ?
-        pA->nLen = pO->Count();
-        pA->pData = new sal_uInt8 [pO->Count()];
-        memcpy( pA->pData, pO->GetData(), pO->Count() );    // -> merken
-        pO->Remove( 0, pO->Count() );       // leeren fuer HdFt-Text
+        pA->nLen = pO->size();
+        pA->pData = new sal_uInt8 [pO->size()];
+        memcpy( pA->pData, &(*pO)[0], pO->size() );    // -> merken
+        pO->clear();       // leeren fuer HdFt-Text
     }
     else
     {                               // keine Attrs da
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 676ac87..6c3670e 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1821,10 +1821,10 @@ void WW8Export::SaveData( sal_uLong nStt, sal_uLong nEnd )
 
     MSWordSaveData &rData = maSaveData.top();
 
-    if ( pO->Count() )
+    if ( !pO->empty() )
     {
         rData.pOOld = pO;
-        pO = new WW8Bytes( 128, 128 );
+        pO = new ww::bytes();
     }
     else
         rData.pOOld = 0; // reuse pO
@@ -1844,7 +1844,7 @@ void WW8Export::RestoreData()
 
     GetWriter().bWriteAll = rData.bOldWriteAll;
 
-    OSL_ENSURE( !pO->Count(), "pO is not empty in WW8Export::RestoreData()" );
+    OSL_ENSURE( pO->empty(), "pO is not empty in WW8Export::RestoreData()" );
     if ( rData.pOOld )
     {
         delete pO;
@@ -1868,14 +1868,14 @@ void WW8AttributeOutput::TableInfoCell( 
ww8::WW8TableNodeInfoInner::Pointer_t pT
     {
         /* Cell */
         m_rWW8Export.InsUInt16( NS_sprm::LN_PFInTable );
-        m_rWW8Export.pO->Insert( (sal_uInt8)0x1, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( (sal_uInt8)0x1 );
         m_rWW8Export.InsUInt16( NS_sprm::LN_PTableDepth );
         m_rWW8Export.InsUInt32( nDepth );
 
         if ( nDepth > 1 && pTableTextNodeInfoInner->isEndOfCell() )
         {
             m_rWW8Export.InsUInt16( NS_sprm::LN_PCell );
-            m_rWW8Export.pO->Insert( (sal_uInt8)0x1, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( (sal_uInt8)0x1 );
         }
     }
 }
@@ -1890,12 +1890,12 @@ void WW8AttributeOutput::TableInfoRow( 
ww8::WW8TableNodeInfoInner::Pointer_t pTa
         if ( pTableTextNodeInfoInner->isEndOfLine() )
         {
             m_rWW8Export.InsUInt16( NS_sprm::LN_PFInTable );
-            m_rWW8Export.pO->Insert( (sal_uInt8)0x1, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( (sal_uInt8)0x1 );
 
             if ( nDepth == 1 )
             {
                 m_rWW8Export.InsUInt16( NS_sprm::LN_PFTtp );
-                m_rWW8Export.pO->Insert( (sal_uInt8)0x1, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( (sal_uInt8)0x1 );
             }
 
             m_rWW8Export.InsUInt16( NS_sprm::LN_PTableDepth );
@@ -1904,9 +1904,9 @@ void WW8AttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t 
pTa
             if ( nDepth > 1 )
             {
                 m_rWW8Export.InsUInt16( NS_sprm::LN_PCell );
-                m_rWW8Export.pO->Insert( (sal_uInt8)0x1, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( (sal_uInt8)0x1 );
                 m_rWW8Export.InsUInt16( NS_sprm::LN_PRow );
-                m_rWW8Export.pO->Insert( (sal_uInt8)0x1, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( (sal_uInt8)0x1 );
             }
 
             TableDefinition( pTableTextNodeInfoInner );
@@ -1965,8 +1965,8 @@ void WW8AttributeOutput::TableVerticalCell( 
ww8::WW8TableNodeInfoInner::Pointer_
         if ( FRMDIR_VERT_TOP_RIGHT == m_rWW8Export.TrueFrameDirection( *pFrmFmt ) )
         {
             m_rWW8Export.InsUInt16( NS_sprm::LN_TTextFlow );
-            m_rWW8Export.pO->Insert( sal_uInt8(n), m_rWW8Export.pO->Count() );        //start range
-            m_rWW8Export.pO->Insert( sal_uInt8(n + 1), m_rWW8Export.pO->Count() );    //end range
+            m_rWW8Export.pO->push_back( sal_uInt8(n) );        //start range
+            m_rWW8Export.pO->push_back( sal_uInt8(n + 1) );    //end range
             m_rWW8Export.InsUInt16( 5 ); //Equals vertical writing
         }
     }
@@ -1989,14 +1989,14 @@ void WW8AttributeOutput::TableCanSplit( 
ww8::WW8TableNodeInfoInner::Pointer_t pT
     if ( m_rWW8Export.bWrtWW8 )
     {
         m_rWW8Export.InsUInt16( NS_sprm::LN_TFCantSplit );
-        m_rWW8Export.pO->Insert( nCantSplit, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( nCantSplit );
         m_rWW8Export.InsUInt16( NS_sprm::LN_TFCantSplit90 ); // also write fCantSplit90
     }
     else
     {
-        m_rWW8Export.pO->Insert( 185, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 185 );
     }
-    m_rWW8Export.pO->Insert( nCantSplit, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( nCantSplit );
 }
 
 void WW8AttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
@@ -2036,7 +2036,7 @@ void WW8AttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t 
pTab
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_TDyaRowHeight );
         else
-            m_rWW8Export.pO->Insert( 189, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 189 );
         m_rWW8Export.InsUInt16( (sal_uInt16)nHeight );
     }
 
@@ -2070,7 +2070,7 @@ void WW8AttributeOutput::TableOrientation( 
ww8::WW8TableNodeInfoInner::Pointer_t
                 if ( m_rWW8Export.bWrtWW8 )
                     m_rWW8Export.InsUInt16( NS_sprm::LN_TJc );
                 else
-                    m_rWW8Export.pO->Insert( 182, m_rWW8Export.pO->Count() );
+                    m_rWW8Export.pO->push_back( 182 );
                 m_rWW8Export.InsUInt16( text::HoriOrientation::RIGHT == eHOri ? 2 : 1 );
                 break;
             default:
@@ -2097,7 +2097,7 @@ void WW8AttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t 
pTab
             sal_uInt8 nTPc = (nPadding << 4) | (nPcVert << 2) | nPcHorz;
 
             m_rWW8Export.InsUInt16(NS_sprm::LN_TPc);
-            m_rWW8Export.pO->Insert( nTPc, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( nTPc );
 
             m_rWW8Export.InsUInt16(NS_sprm::LN_TDyaAbs);
             m_rWW8Export.InsUInt16(rUL.GetUpper());
@@ -2123,8 +2123,8 @@ void WW8AttributeOutput::TableDefinition( 
ww8::WW8TableNodeInfoInner::Pointer_t
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_TTableHeader );
         else
-            m_rWW8Export.pO->Insert( 186, m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( 1, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 186 );
+        m_rWW8Export.pO->push_back( 1 );
     }
 
     ww8::TableBoxVectorPtr pTableBoxes =
@@ -2140,7 +2140,7 @@ void WW8AttributeOutput::TableDefinition( 
ww8::WW8TableNodeInfoInner::Pointer_t
     m_rWW8Export.InsUInt16( nSprmSize ); // length
 
     // number of boxes
-    m_rWW8Export.pO->Insert( static_cast<sal_uInt8>(nBoxes), m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( static_cast<sal_uInt8>(nBoxes) );
 
     /* cellxs */
     /*
@@ -2208,7 +2208,7 @@ void WW8AttributeOutput::TableDefinition( 
ww8::WW8TableNodeInfoInner::Pointer_t
     for( aIt = pTableBoxes->begin(); aIt != aItEnd; ++aIt, ++aItRowSpans)
     {
 #if OSL_DEBUG_LEVEL > 1
-        sal_uInt16 npOCount = m_rWW8Export.pO->Count();
+        sal_uInt16 npOCount = m_rWW8Export.pO->size();
 #endif
 
         const SwTableBox * pTabBox1 = *aIt;
@@ -2225,7 +2225,7 @@ void WW8AttributeOutput::TableDefinition( 
ww8::WW8TableNodeInfoInner::Pointer_t
 
         static sal_uInt8 aNullBytes[] = { 0x0, 0x0 };
 
-        m_rWW8Export.pO->Insert( aNullBytes, 2, m_rWW8Export.pO->Count() );   // dummy
+        m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), aNullBytes, aNullBytes+2 );   // dummy
         if (pBoxFmt != NULL)
         {
             const SvxBoxItem & rBoxItem = pBoxFmt->GetBox();
@@ -2236,7 +2236,7 @@ void WW8AttributeOutput::TableDefinition( 
ww8::WW8TableNodeInfoInner::Pointer_t
             m_rWW8Export.Out_SwFmtTableBox( *m_rWW8Export.pO, NULL); // 8/16 Byte
 
 #if OSL_DEBUG_LEVEL > 1
-        ::std::clog << "<tclength>" << m_rWW8Export.pO->Count() - npOCount << "</tclength>"
+        ::std::clog << "<tclength>" << m_rWW8Export.pO->size() - npOCount << "</tclength>"
                     << ::std::endl;
 #endif
     }
@@ -2331,11 +2331,11 @@ void WW8AttributeOutput::TableDefaultBorders( 
ww8::WW8TableNodeInfoInner::Pointe
     for ( int i = 0; i < 4; ++i )
     {
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, 0xD634 );
-        m_rWW8Export.pO->Insert( sal_uInt8(6), m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( sal_uInt8(0), m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( sal_uInt8(1), m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( sal_uInt8(1 << i), m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( sal_uInt8(3), m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( sal_uInt8(6) );
+        m_rWW8Export.pO->push_back( sal_uInt8(0) );
+        m_rWW8Export.pO->push_back( sal_uInt8(1) );
+        m_rWW8Export.pO->push_back( sal_uInt8(1 << i) );
+        m_rWW8Export.pO->push_back( sal_uInt8(3) );
 
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO,
                 pFrmFmt->GetBox().GetDistance( aBorders[i] ) );
@@ -2352,8 +2352,8 @@ void WW8AttributeOutput::TableBackgrounds( 
ww8::WW8TableNodeInfoInner::Pointer_t
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_TDefTableShd );
     else
-        m_rWW8Export.pO->Insert( (sal_uInt8)191, m_rWW8Export.pO->Count() );
-    m_rWW8Export.pO->Insert( (sal_uInt8)(nBoxes * 2), m_rWW8Export.pO->Count() );  // Len
+        m_rWW8Export.pO->push_back( (sal_uInt8)191 );
+    m_rWW8Export.pO->push_back( (sal_uInt8)(nBoxes * 2) );  // Len
 
     for ( sal_uInt8 n = 0; n < nBoxes; n++ )
     {
@@ -2384,8 +2384,7 @@ void WW8AttributeOutput::TableBackgrounds( 
ww8::WW8TableNodeInfoInner::Pointer_t
         for (sal_uInt32 m = 0; m < 2; m++)
         {
             m_rWW8Export.InsUInt16( aSprmIds[m] );
-            m_rWW8Export.pO->Insert( static_cast<sal_uInt8>(nBoxes0 * 10),
-                                     m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( static_cast<sal_uInt8>(nBoxes0 * 10) );
 
         for ( sal_uInt8 n = 0; n < nBoxes0; n++ )
         {
@@ -3070,7 +3069,7 @@ void WW8Export::ExportDocument_Impl()
 
     pPapPlc = new WW8_WrPlcPn( *this, PAP, pFib->fcMin );
     pChpPlc = new WW8_WrPlcPn( *this, CHP, pFib->fcMin );
-    pO = new WW8Bytes( 128, 128 );
+    pO = new ww::bytes();
     pStyles = new MSWordStyles( *this );
     pFldMain = new WW8_WrPlcFld( 2, TXT_MAINTEXT );
     pFldHdFt = new WW8_WrPlcFld( 2, TXT_HDFT );
@@ -3698,7 +3697,7 @@ void WW8AttributeOutput::TableNodeInfoInner( 
ww8::WW8TableNodeInfoInner::Pointer
     ::std::clog << "<OutWW8_TableNodeInfoInner>" << pNodeInfoInner->toString();
 #endif
 
-    m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );                       // leeren
+    m_rWW8Export.pO->clear();
 
     sal_uInt32 nShadowsBefore = pNodeInfoInner->getShadowsBefore();
     if (nShadowsBefore > 0)
@@ -3713,14 +3712,12 @@ void WW8AttributeOutput::TableNodeInfoInner( 
ww8::WW8TableNodeInfoInner::Pointer
         {
             m_rWW8Export.WriteCR(pTmpNodeInfoInner);
 
-            m_rWW8Export.pO->Insert( (sal_uInt8*)&nStyle, 2,
-                                     m_rWW8Export.pO->Count() );     // Style #
+            m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nStyle, 
(sal_uInt8*)&nStyle+2 );     // Style #
             TableInfoCell(pTmpNodeInfoInner);
             m_rWW8Export.pPapPlc->AppendFkpEntry
-                ( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->Count(),
-                  m_rWW8Export.pO->GetData() );
+                ( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->size(), &(*m_rWW8Export.pO)[0] );
 
-            m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );                       // leeren
+            m_rWW8Export.pO->clear();
         }
     }
 
@@ -3731,12 +3728,11 @@ void WW8AttributeOutput::TableNodeInfoInner( 
ww8::WW8TableNodeInfoInner::Pointer
 #endif
         m_rWW8Export.WriteCR(pNodeInfoInner);
 
-        m_rWW8Export.pO->Insert( (sal_uInt8*)&nStyle, 2, m_rWW8Export.pO->Count() );     // Style #
+        m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nStyle, 
(sal_uInt8*)&nStyle+2 );     // Style #
         TableInfoCell(pNodeInfoInner);
-        m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->Count(),
-                                m_rWW8Export.pO->GetData() );
+        m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->size(), 
&(*m_rWW8Export.pO)[0] );
 
-        m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );                       // leeren
+        m_rWW8Export.pO->clear();
     }
 
     sal_uInt32 nShadowsAfter = pNodeInfoInner->getShadowsAfter();
@@ -3752,12 +3748,11 @@ void WW8AttributeOutput::TableNodeInfoInner( 
ww8::WW8TableNodeInfoInner::Pointer
         {
             m_rWW8Export.WriteCR(pTmpNodeInfoInner);
 
-            m_rWW8Export.pO->Insert( (sal_uInt8*)&nStyle, 2, m_rWW8Export.pO->Count() );     // 
Style #
+            m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nStyle, 
(sal_uInt8*)&nStyle+2 );     // Style #
             TableInfoCell(pTmpNodeInfoInner);
-            m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), 
m_rWW8Export.pO->Count(),
-                                                  m_rWW8Export.pO->GetData() );
+            m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), 
m_rWW8Export.pO->size(), &(*m_rWW8Export.pO)[0] );
 
-            m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );                       // leeren
+            m_rWW8Export.pO->clear();
         }
     }
 
@@ -3769,12 +3764,11 @@ void WW8AttributeOutput::TableNodeInfoInner( 
ww8::WW8TableNodeInfoInner::Pointer
         TableRowEnd(pNodeInfoInner->getDepth());
 
         ShortToSVBT16(0, nStyle);
-        m_rWW8Export.pO->Insert( (sal_uInt8*)&nStyle, 2, m_rWW8Export.pO->Count() );     // Style #
+        m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nStyle, 
(sal_uInt8*)&nStyle+2 );     // Style #
         TableInfoRow(pNodeInfoInner);
-        m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->Count(),
-                                m_rWW8Export.pO->GetData() );
+        m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->size(), 
&(*m_rWW8Export.pO)[0] );
 
-        m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );                       // leeren
+        m_rWW8Export.pO->clear();
     }
 #if OSL_DEBUG_LEVEL > 1
     ::std::clog << "</OutWW8_TableNodeInfoInner>" << ::std::endl;
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index e2d7aea..47ddc56 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -428,7 +428,7 @@ struct MSWordSaveData
 {
     Point* pOldFlyOffset;
     RndStdIds eOldAnchorType;
-    WW8Bytes* pOOld;                ///< WW8Export only
+    ww::bytes* pOOld;                ///< WW8Export only
     WW8Bytes* mpTableAtOld;         ///< WW8Export only: Additional buffer for the output of the 
tables
     sal_uInt16 mnTableStdAtLenOld;  ///< WW8Export only: Standard length of mpTableAt
     SwPaM* pOldPam, *pOldEnd;
@@ -912,7 +912,7 @@ private:
 class WW8Export : public MSWordExportBase
 {
 public:
-    WW8Bytes* pO;                       ///< Buffer
+    ww::bytes* pO;                       ///< Buffer
     WW8Bytes* mpTableAt;                ///< Additional buffer for the output of the tables
     sal_uInt16 mnTableStdAtLen;         ///< Standard length of mpTableAt
 
@@ -954,7 +954,7 @@ private:
     static void BuildAnlvBase( WW8_ANLV& rAnlv, sal_uInt8*& rpCh, sal_uInt16& rCharLen,
                    const SwNumRule& rRul, const SwNumFmt& rFmt, sal_uInt8 nSwLevel );
 
-    void Out_BorderLine(WW8Bytes& rO, const ::editeng::SvxBorderLine* pLine,
+    void Out_BorderLine(ww::bytes& rO, const ::editeng::SvxBorderLine* pLine,
         sal_uInt16 nDist, sal_uInt16 nSprmNo, bool bShadow);
 
     /// Output the numbering table.
@@ -989,8 +989,8 @@ public:
 
     sal_uInt16 AddRedlineAuthor( sal_uInt16 nId );
 
-    void WriteFtnBegin( const SwFmtFtn& rFtn, WW8Bytes* pO = 0 );
-    void WritePostItBegin( WW8Bytes* pO = 0 );
+    void WriteFtnBegin( const SwFmtFtn& rFtn, ww::bytes* pO = 0 );
+    void WritePostItBegin( ww::bytes* pO = 0 );
     const SvxBrushItem* GetCurrentPageBgBrush() const;
     SvxBrushItem TrueFrameBgBrush(const SwFrmFmt &rFlyFmt) const;
 
@@ -1037,7 +1037,7 @@ public:
             // einige z.T. static halb-interne Funktions-Deklarationen
 
     void OutSprmBytes( sal_uInt8* pBytes, sal_uInt16 nSiz )
-                                { pO->Insert( pBytes, nSiz, pO->Count() ); }
+                                { pO->insert( pO->end(), pBytes, pBytes+nSiz ); }
 
     inline bool IsUnicode() const           { return pPiece->IsUnicode(); }
 
@@ -1051,7 +1051,7 @@ public:
                                      const SwPageDesc* pNewPgDesc = 0 );
 
     void Out_SwFmtBox(const SvxBoxItem& rBox, bool bShadow);
-    void Out_SwFmtTableBox( WW8Bytes& rO, const SvxBoxItem * rBox );
+    void Out_SwFmtTableBox( ww::bytes& rO, const SvxBoxItem * rBox );
     sal_uInt8 TransCol( const Color& rCol );
     bool TransBrush(const Color& rCol, WW8_SHD& rShd);
     WW8_BRC TranslateBorderLine(const ::editeng::SvxBorderLine& pLine,
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 60383c6..2c54d5b 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -403,8 +403,8 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
     // GrfNode fuer spaeteres rausschreiben der Grafik merken
     pGrf->Insert(rFrame);
 
-    pChpPlc->AppendFkpEntry( Strm().Tell(), pO->Count(), pO->GetData() );
-    pO->Remove( 0, pO->Count() );                   // leeren
+    pChpPlc->AppendFkpEntry( Strm().Tell(), pO->size(), &(*pO)[0] );
+    pO->clear();
 
     // #i29408#
     // linked, as-character anchored graphics have to be exported as fields.
@@ -502,15 +502,15 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
         WriteChar( (char)0x0d ); // umgebenden Rahmen mit CR abschliessen
 
         static sal_uInt8 nSty[2] = { 0, 0 };
-        pO->Insert( nSty, 2, pO->Count() );     // Style #0
+        pO->insert( pO->end(), nSty, nSty+2 );     // Style #0
         bool bOldGrf = bOutGrf;
         bOutGrf = true;
 
         OutputFormat( rFrame.GetFrmFmt(), false, false, true ); // Fly-Attrs
 
         bOutGrf = bOldGrf;
-        pPapPlc->AppendFkpEntry( Strm().Tell(), pO->Count(), pO->GetData() );
-        pO->Remove( 0, pO->Count() );                   // leeren
+        pPapPlc->AppendFkpEntry( Strm().Tell(), pO->size(), &(*pO)[0] );
+        pO->clear();
     }
     // #i29408#
     // linked, as-character anchored graphics have to be exported as fields.
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 873f642..ddca1a8 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -683,9 +683,9 @@ void WW8AttributeOutput::OutlineNumbering( sal_uInt8 nLvl, const SwNumFmt &rNFmt
     {
         // write sprmPOutLvl sprmPIlvl and sprmPIlfo
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_POutLvl );
-        m_rWW8Export.pO->Insert( nLvl, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( nLvl );
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_PIlvl );
-        m_rWW8Export.pO->Insert( nLvl, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( nLvl );
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_PIlfo );
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO,
                 1 + m_rWW8Export.GetId( *m_rWW8Export.pDoc->GetOutlineNumRule() ) );
@@ -732,7 +732,7 @@ bool WW8Export::DisallowInheritingOutlineNumbering(const SwFmt &rFmt)
                 if (bWrtWW8)
                 {
                     SwWW8Writer::InsUInt16(*pO, NS_sprm::LN_POutLvl);
-                    pO->Insert(sal_uInt8(9), pO->Count());
+                    pO->push_back(sal_uInt8(9));
                     SwWW8Writer::InsUInt16(*pO, NS_sprm::LN_PIlfo);
                     SwWW8Writer::InsUInt16(*pO, 0);
 
@@ -934,22 +934,22 @@ void WW8AttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript )
     if ( m_rWW8Export.bWrtWW8 && bIsRTL )
     {
         m_rWW8Export.InsUInt16( NS_sprm::LN_CFBiDi );
-        m_rWW8Export.pO->Insert( (sal_uInt8)1, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( (sal_uInt8)1 );
     }
 
     // #i46087# patch from james_clark; complex texts needs the undocumented SPRM CComplexScript 
with param 0x81.
     if ( m_rWW8Export.bWrtWW8 && nScript == i18n::ScriptType::COMPLEX && !bIsRTL )
     {
         m_rWW8Export.InsUInt16( NS_sprm::LN_CComplexScript );
-        m_rWW8Export.pO->Insert( (sal_uInt8)0x81, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( (sal_uInt8)0x81 );
         m_rWW8Export.pDop->bUseThaiLineBreakingRules = true;
     }
 }
 
 void WW8AttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner )
 {
-    m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->Count(), 
m_rWW8Export.pO->GetData() );
-    m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); // delete
+    m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->size(), 
&(*m_rWW8Export.pO)[0] );
+    m_rWW8Export.pO->clear();
 
     if ( pTextNodeInfoInner.get() != NULL )
     {
@@ -959,11 +959,10 @@ void WW8AttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t 
pTe
 
             SVBT16 nSty;
             ShortToSVBT16( 0, nSty );
-            m_rWW8Export.pO->Insert( (sal_uInt8*)&nSty, 2, m_rWW8Export.pO->Count() );     // 
Style #
+            m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nSty, 
(sal_uInt8*)&nSty+2 );     // Style #
             TableInfoRow( pTextNodeInfoInner );
-            m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), 
m_rWW8Export.pO->Count(),
-                    m_rWW8Export.pO->GetData() );
-            m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); // delete
+            m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), 
m_rWW8Export.pO->size(), &(*m_rWW8Export.pO)[0]);
+            m_rWW8Export.pO->clear();
         }
     }
 }
@@ -1008,9 +1007,9 @@ void WW8AttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData )
     if ( !bExportedFieldResult )
     {
         m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(),
-                m_rWW8Export.pO->Count(), m_rWW8Export.pO->GetData() );
+                m_rWW8Export.pO->size(), &(*m_rWW8Export.pO)[0] );
     }
-    m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); // delete
+    m_rWW8Export.pO->clear();
 }
 
 void WW8AttributeOutput::RunText( const String& rText, rtl_TextEncoding eCharSet )
@@ -1025,21 +1024,21 @@ void WW8AttributeOutput::RawText( const String& rText, bool bForceUnicode, 
rtl_T
 
 void WW8AttributeOutput::OutputFKP()
 {
-    if ( m_rWW8Export.pO->Count() )
+    if ( !m_rWW8Export.pO->empty() )
     {
         m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(),
-                m_rWW8Export.pO->Count(), m_rWW8Export.pO->GetData() );
-        m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); // delete
+                m_rWW8Export.pO->size(), &(*m_rWW8Export.pO)[0] );
+        m_rWW8Export.pO->clear();
     }
 }
 
 void WW8AttributeOutput::ParagraphStyle( sal_uInt16 nStyle )
 {
-    OSL_ENSURE( !m_rWW8Export.pO->Count(), " pO ist am ZeilenEnde nicht leer" );
+    OSL_ENSURE( m_rWW8Export.pO->empty(), " pO ist am ZeilenEnde nicht leer" );
 
     SVBT16 nSty;
     ShortToSVBT16( nStyle, nSty );
-    m_rWW8Export.pO->Insert( (sal_uInt8*)&nSty, 2, m_rWW8Export.pO->Count() );     // Style #
+    m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nSty, (sal_uInt8*)&nSty+2 );     
// Style #
 }
 
 void WW8AttributeOutput::OutputWW8Attribute( sal_uInt8 nId, bool bVal )
@@ -1049,9 +1048,9 @@ void WW8AttributeOutput::OutputWW8Attribute( sal_uInt8 nId, bool bVal )
     else if (8 == nId )
         return; // no such attribute in WW6
     else
-        m_rWW8Export.pO->Insert( 85 + nId, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 85 + nId );
 
-    m_rWW8Export.pO->Insert( bVal ? 1 : 0, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( bVal ? 1 : 0 );
 }
 
 void WW8AttributeOutput::OutputWW8AttributeCTL( sal_uInt8 nId, bool bVal )
@@ -1061,7 +1060,7 @@ void WW8AttributeOutput::OutputWW8AttributeCTL( sal_uInt8 nId, bool bVal )
         return;
 
     m_rWW8Export.InsUInt16( NS_sprm::LN_CFBoldBi + nId );
-    m_rWW8Export.pO->Insert( bVal ? 1 : 0, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( bVal ? 1 : 0 );
 }
 
 void WW8AttributeOutput::CharFont( const SvxFontItem& rFont )
@@ -1075,7 +1074,7 @@ void WW8AttributeOutput::CharFont( const SvxFontItem& rFont )
         m_rWW8Export.InsUInt16( NS_sprm::LN_CRgFtc2 );
     }
     else
-        m_rWW8Export.pO->Insert( 93, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 93 );
 
     m_rWW8Export.InsUInt16( nFontID );
 }
@@ -1088,7 +1087,7 @@ void WW8AttributeOutput::CharFontCTL( const SvxFontItem& rFont )
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_CFtcBi );
     else
-        m_rWW8Export.pO->Insert( 93, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 93 );
     m_rWW8Export.InsUInt16( nFontID );
 }
 
@@ -1100,7 +1099,7 @@ void WW8AttributeOutput::CharFontCJK( const SvxFontItem& rFont )
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_CRgFtc1 );
     else
-        m_rWW8Export.pO->Insert( 93, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 93 );
     m_rWW8Export.InsUInt16( nFontID );
 }
 
@@ -1158,7 +1157,7 @@ void WW8AttributeOutput::CharKerning( const SvxKerningItem& rKerning )
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_CDxaSpace );
     else
-        m_rWW8Export.pO->Insert( 96, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 96 );
 
     m_rWW8Export.InsUInt16( rKerning.GetValue() );
 }
@@ -1168,7 +1167,7 @@ void WW8AttributeOutput::CharAutoKern( const SvxAutoKernItem& rAutoKern )
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_CHpsKern );
     else
-        m_rWW8Export.pO->Insert( 107, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 107 );
 
     m_rWW8Export.InsUInt16( rAutoKern.GetValue() ? 1 : 0 );
 }
@@ -1234,7 +1233,7 @@ void WW8AttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline )
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_CKul );
     else
-        m_rWW8Export.pO->Insert( 94, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 94 );
 
     const SfxPoolItem* pItem = m_rWW8Export.HasItem( RES_CHRATR_WORDLINEMODE );
     bool bWord = false;
@@ -1306,7 +1305,7 @@ void WW8AttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline )
             break;
     }
 
-    m_rWW8Export.pO->Insert( b, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( b );
 }
 
 void WW8AttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage )
@@ -1335,7 +1334,7 @@ void WW8AttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage )
         if ( m_rWW8Export.bWrtWW8 ) // use sprmCRgLid0_80 rather than sprmCLid
             m_rWW8Export.InsUInt16( nId );
         else
-            m_rWW8Export.pO->Insert( (sal_uInt8)nId, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( static_cast<sal_uInt8>(nId) );
         m_rWW8Export.InsUInt16( rLanguage.GetLanguage() );
 
         // Word 2000 and above apparently require both old and new versions of
@@ -1376,9 +1375,9 @@ void WW8AttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement 
)
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_CIss );
         else
-            m_rWW8Export.pO->Insert( 104, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 104 );
 
-        m_rWW8Export.pO->Insert( b, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( b );
     }
 
     if ( 0 == b || 0xFF == b )
@@ -1388,7 +1387,7 @@ void WW8AttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement 
)
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_CHpsPos );
         else
-            m_rWW8Export.pO->Insert( 101, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 101 );
 
         m_rWW8Export.InsUInt16( (short)(( nHeight * nEsc + 500 ) / 1000 ));
 
@@ -1397,7 +1396,7 @@ void WW8AttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement 
)
             if( m_rWW8Export.bWrtWW8 )
                 m_rWW8Export.InsUInt16( NS_sprm::LN_CHps );
             else
-                m_rWW8Export.pO->Insert( 99, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( 99 );
 
             m_rWW8Export.InsUInt16(
                 msword_cast<sal_uInt16>((nHeight * nProp + 500 ) / 1000));
@@ -1429,7 +1428,7 @@ void WW8AttributeOutput::CharFontSize( const SvxFontHeightItem& rHeight )
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( nId );
         else
-            m_rWW8Export.pO->Insert( (sal_uInt8)nId, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( static_cast<sal_uInt8>(nId) );
 
         m_rWW8Export.InsUInt16( (sal_uInt16)(( rHeight.GetHeight() + 5 ) / 10 ) );
     }
@@ -1459,15 +1458,15 @@ void WW8AttributeOutput::CharRelief( const SvxCharReliefItem& rRelief )
         if( nId )
         {
             m_rWW8Export.InsUInt16( nId );
-            m_rWW8Export.pO->Insert( (sal_uInt8)0x81, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( (sal_uInt8)0x81 );
         }
         else
         {
             // switch both flags off
             m_rWW8Export.InsUInt16( NS_sprm::LN_CFEmboss );
-            m_rWW8Export.pO->Insert( (sal_uInt8)0x0, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( (sal_uInt8)0x0 );
             m_rWW8Export.InsUInt16( NS_sprm::LN_CFImprint );
-            m_rWW8Export.pO->Insert( (sal_uInt8)0x0, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( (sal_uInt8)0x0 );
         }
     }
 }
@@ -1485,12 +1484,12 @@ void WW8AttributeOutput::CharRotate( const SvxCharRotateItem& rRotate )
         // here corrupts the table, hence !m_rWW8Export.bIsInTable
 
         m_rWW8Export.InsUInt16( NS_sprm::LN_CEastAsianLayout );
-        m_rWW8Export.pO->Insert( (sal_uInt8)0x06, m_rWW8Export.pO->Count() ); //len 6
-        m_rWW8Export.pO->Insert( (sal_uInt8)0x01, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( (sal_uInt8)0x06 ); //len 6
+        m_rWW8Export.pO->push_back( (sal_uInt8)0x01 );
 
         m_rWW8Export.InsUInt16( rRotate.IsFitToLine() ? 1 : 0 );
         static const sal_uInt8 aZeroArr[ 3 ] = { 0, 0, 0 };
-        m_rWW8Export.pO->Insert( aZeroArr, 3, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), aZeroArr, aZeroArr+3);
     }
 }
 
@@ -1510,7 +1509,7 @@ void WW8AttributeOutput::CharEmphasisMark( const SvxEmphasisMarkItem& 
rEmphasisM
         }
 
         m_rWW8Export.InsUInt16( NS_sprm::LN_CKcd );
-        m_rWW8Export.pO->Insert( nVal, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( nVal );
     }
 }
 
@@ -1593,10 +1592,10 @@ void WW8AttributeOutput::CharColor( const SvxColorItem& rColor )
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_CIco );
     else
-        m_rWW8Export.pO->Insert( 98, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 98 );
 
     sal_uInt8 nColor = m_rWW8Export.TransCol( rColor.GetValue() );
-    m_rWW8Export.pO->Insert( nColor, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( nColor );
 
     if ( m_rWW8Export.bWrtWW8 && nColor )
     {
@@ -1619,7 +1618,7 @@ void WW8AttributeOutput::CharBackground( const SvxBrushItem& rBrush )
         //Quite a few unknowns, some might be transparency or something
         //of that nature...
         m_rWW8Export.InsUInt16( 0xCA71 );
-        m_rWW8Export.pO->Insert( 10, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 10 );
         m_rWW8Export.InsUInt32( 0xFF000000 );
         m_rWW8Export.InsUInt32( SuitableBGColor( rBrush.GetColor().GetColor() ) );
         m_rWW8Export.InsUInt16( 0x0000);
@@ -1644,7 +1643,7 @@ void WW8AttributeOutput::TextINetFormat( const SwFmtINetFmt& rINet )
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_CIstd );
         else
-            m_rWW8Export.pO->Insert( 80, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 80 );
 
         m_rWW8Export.InsUInt16( m_rWW8Export.GetId( *pFmt ) );
     }
@@ -2392,7 +2391,7 @@ void AttributeOutputBase::GetNumberPara( String& rStr, const SwField& rFld )
     }
 }
 
-void WW8Export::WritePostItBegin( WW8Bytes* pOut )
+void WW8Export::WritePostItBegin( ww::bytes* pOut )
 {
     sal_uInt8 aArr[ 3 ];
     sal_uInt8* pArr = aArr;
@@ -2408,7 +2407,7 @@ void WW8Export::WritePostItBegin( WW8Bytes* pOut )
     WriteChar( 0x05 );              // Annotation reference
 
     if( pOut )
-        pOut->Insert( aArr, static_cast< sal_uInt16 >(pArr - aArr), pOut->Count() );
+        pOut->insert( pOut->end(), aArr, pArr );
     else
         pChpPlc->AppendFkpEntry( Strm().Tell(), static_cast< short >(pArr - aArr), aArr );
 }
@@ -3003,9 +3002,9 @@ void WW8AttributeOutput::ParaHyphenZone( const SvxHyphenZoneItem& rHyphenZone 
)
     if( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_PFNoAutoHyph );
     else
-        m_rWW8Export.pO->Insert( 44, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 44 );
 
-    m_rWW8Export.pO->Insert( rHyphenZone.IsHyphen() ? 0 : 1, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( rHyphenZone.IsHyphen() ? 0 : 1 );
 }
 
 void WW8AttributeOutput::ParaScriptSpace( const SfxBoolItem& rScriptSpace )
@@ -3024,10 +3023,9 @@ void WW8AttributeOutput::ParaScriptSpace( const SfxBoolItem& rScriptSpace )
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( nId );
         else
-            m_rWW8Export.pO->Insert( (sal_uInt8)nId, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( (sal_uInt8)nId );
 
-        m_rWW8Export.pO->Insert( rScriptSpace.GetValue() ? 1 : 0,
-                            m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( rScriptSpace.GetValue() ? 1 : 0 );
     }
 }
 
@@ -3039,7 +3037,7 @@ void WW8AttributeOutput::ParaSnapToGrid( const SvxParaGridItem& rGrid )
         return;
 
     m_rWW8Export.InsUInt16( NS_sprm::LN_PFUsePgsuSettings );
-    m_rWW8Export.pO->Insert( rGrid.GetValue(), m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( rGrid.GetValue() );
 }
 
 void WW8AttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& rAlign )
@@ -3083,9 +3081,9 @@ void WW8AttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& 
rAlign )
 
 // RefMark, NoLineBreakHere  fehlen noch
 
-void WW8Export::WriteFtnBegin( const SwFmtFtn& rFtn, WW8Bytes* pOutArr )
+void WW8Export::WriteFtnBegin( const SwFmtFtn& rFtn, ww::bytes* pOutArr )
 {
-    WW8Bytes aAttrArr;
+    ww::bytes aAttrArr;
     bool bAutoNum = !rFtn.GetNumStr().Len();    // Auto-Nummer
     if( bAutoNum )
     {
@@ -3097,7 +3095,7 @@ void WW8Export::WriteFtnBegin( const SwFmtFtn& rFtn, WW8Bytes* pOutArr )
                 0x55, 0x08, 1           // sprmCFSpec
             };
 
-            aAttrArr.Insert(aSpec, sizeof(aSpec), aAttrArr.Count());
+            aAttrArr.insert(aAttrArr.end(), aSpec, aSpec+sizeof(aSpec));
         }
         else
         {
@@ -3107,7 +3105,7 @@ void WW8Export::WriteFtnBegin( const SwFmtFtn& rFtn, WW8Bytes* pOutArr )
                 68, 4, 0, 0, 0, 0               // sprmCObjLocation
             };
 
-            aAttrArr.Insert(aSpec, sizeof(aSpec), aAttrArr.Count());
+            aAttrArr.insert(aAttrArr.end(), aSpec, aSpec+sizeof(aSpec));
         }
     }
 
@@ -3123,7 +3121,7 @@ void WW8Export::WriteFtnBegin( const SwFmtFtn& rFtn, WW8Bytes* pOutArr )
     if( bWrtWW8 )
         SwWW8Writer::InsUInt16( aAttrArr, NS_sprm::LN_CIstd );
     else
-        aAttrArr.Insert( 80, aAttrArr.Count() );
+        aAttrArr.push_back( 80 );
     SwWW8Writer::InsUInt16( aAttrArr, GetId( *pCFmt ) );
 
                                                 // fSpec-Attribut true
@@ -3141,21 +3139,21 @@ void WW8Export::WriteFtnBegin( const SwFmtFtn& rFtn, WW8Bytes* pOutArr )
     {
         // insert at start of array, so the "hard" attribute overrule the
         // attributes of the character template
-        pOutArr->Insert( &aAttrArr, 0 );
+        pOutArr->insert( pOutArr->begin(), aAttrArr.begin(), aAttrArr.end() );
     }
     else
     {
-        WW8Bytes aOutArr;
+        ww::bytes aOutArr;
 
         // insert at start of array, so the "hard" attribute overrule the
         // attributes of the character template
-        aOutArr.Insert( &aAttrArr, 0 );
+        aOutArr.insert( aOutArr.begin(), aAttrArr.begin(), aAttrArr.end() );
 
         // write for the ftn number in the content, the font of the anchor
         const SwTxtFtn* pTxtFtn = rFtn.GetTxtFtn();
         if( pTxtFtn )
         {
-            WW8Bytes* pOld = pO;
+            ww::bytes* pOld = pO;
             pO = &aOutArr;
             SfxItemSet aSet( pDoc->GetAttrPool(), RES_CHRATR_FONT,
                                                   RES_CHRATR_FONT );
@@ -3168,8 +3166,8 @@ void WW8Export::WriteFtnBegin( const SwFmtFtn& rFtn, WW8Bytes* pOutArr )
             m_pAttrOutput->OutputItem( aSet.Get( RES_CHRATR_FONT ) );
             pO = pOld;
         }
-        pChpPlc->AppendFkpEntry( Strm().Tell(), aOutArr.Count(),
-                                                aOutArr.GetData() );
+        pChpPlc->AppendFkpEntry( Strm().Tell(), aOutArr.size(),
+                                                &aOutArr[0] );
     }
 }
 
@@ -3245,7 +3243,7 @@ void WW8AttributeOutput::TextCharFormat( const SwFmtCharFmt& rCharFmt )
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_CIstd );
         else
-            m_rWW8Export.pO->Insert( 80, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 80 );
 
         m_rWW8Export.InsUInt16( m_rWW8Export.GetId( *rCharFmt.GetCharFmt() ) );
     }
@@ -3264,8 +3262,8 @@ void WW8AttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines )
             return;
 
         m_rWW8Export.InsUInt16( NS_sprm::LN_CEastAsianLayout );
-        m_rWW8Export.pO->Insert( (sal_uInt8)0x06, m_rWW8Export.pO->Count() ); //len 6
-        m_rWW8Export.pO->Insert( (sal_uInt8)0x02, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( (sal_uInt8)0x06 ); //len 6
+        m_rWW8Export.pO->push_back( (sal_uInt8)0x02 );
 
         sal_Unicode cStart = rTwoLines.GetStartBracket();
         sal_Unicode cEnd = rTwoLines.GetEndBracket();
@@ -3297,7 +3295,7 @@ void WW8AttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines )
             nType = 1;
         m_rWW8Export.InsUInt16( nType );
         static const sal_uInt8 aZeroArr[ 3 ] = { 0, 0, 0 };
-        m_rWW8Export.pO->Insert( aZeroArr, 3, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), aZeroArr, aZeroArr+3);
     }
 }
 
@@ -3369,7 +3367,7 @@ void WW8AttributeOutput::ParaNumRule_Impl( const SwTxtNode* pTxtNd, sal_Int32 
nL
     {
         // write sprmPIlvl and sprmPIlfo
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_PIlvl );
-        m_rWW8Export.pO->Insert( ::sal::static_int_cast<sal_uInt8>(nLvl), m_rWW8Export.pO->Count() 
);
+        m_rWW8Export.pO->push_back( ::sal::static_int_cast<sal_uInt8>(nLvl) );
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::LN_PIlfo );
         SwWW8Writer::InsUInt16( *m_rWW8Export.pO, ::sal::static_int_cast<sal_uInt16>(nNumId) );
     }
@@ -3393,7 +3391,7 @@ void WW8AttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize )
             if( m_rWW8Export.bWrtWW8 )
                 m_rWW8Export.InsUInt16( NS_sprm::LN_PDxaWidth );
             else
-                m_rWW8Export.pO->Insert( 28, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( 28 );
             m_rWW8Export.InsUInt16( (sal_uInt16)rSize.GetWidth() );
         }
 
@@ -3403,7 +3401,7 @@ void WW8AttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize )
             if( m_rWW8Export.bWrtWW8 )
                 m_rWW8Export.InsUInt16( NS_sprm::LN_PWHeightAbs );
             else
-                m_rWW8Export.pO->Insert( 45, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( 45 );
 
             sal_uInt16 nH = 0;
             switch ( rSize.GetHeightSizeType() )
@@ -3423,15 +3421,15 @@ void WW8AttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize )
             if( m_rWW8Export.bWrtWW8 )
                 m_rWW8Export.InsUInt16( NS_sprm::LN_SBOrientation );
             else
-                m_rWW8Export.pO->Insert( 162, m_rWW8Export.pO->Count() );
-            m_rWW8Export.pO->Insert( 2, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( 162 );
+            m_rWW8Export.pO->push_back( 2 );
         }
 
         /*sprmSXaPage*/
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_SXaPage );
         else
-            m_rWW8Export.pO->Insert( 164, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 164 );
         m_rWW8Export.InsUInt16(
             msword_cast<sal_uInt16>(SvxPaperInfo::GetSloppyPaperDimension(rSize.GetWidth())));
 
@@ -3439,7 +3437,7 @@ void WW8AttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize )
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_SYaPage );
         else
-            m_rWW8Export.pO->Insert( 165, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 165 );
         m_rWW8Export.InsUInt16(
             msword_cast<sal_uInt16>(SvxPaperInfo::GetSloppyPaperDimension(rSize.GetHeight())));
     }
@@ -3554,9 +3552,9 @@ void WW8AttributeOutput::PageBreakBefore( bool bBreak )
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_PFPageBreakBefore );
     else
-        m_rWW8Export.pO->Insert( 9, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 9 );
 
-    m_rWW8Export.pO->Insert( bBreak ? 1 : 0, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( bBreak ? 1 : 0 );
 }
 
 // Breaks schreiben nichts in das Ausgabe-Feld rWrt.pO,
@@ -3732,7 +3730,7 @@ void WW8AttributeOutput::FormatPaperBin( const SvxPaperBinItem& rPaperBin )
             if( m_rWW8Export.bWrtWW8 )
                 m_rWW8Export.InsUInt16( m_rWW8Export.bOutFirstPage? NS_sprm::LN_SDmBinFirst: 
NS_sprm::LN_SDmBinOther );
             else
-                m_rWW8Export.pO->Insert( m_rWW8Export.bOutFirstPage? 140: 141, 
m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( m_rWW8Export.bOutFirstPage? 140: 141 );
 
             m_rWW8Export.InsUInt16( nVal );
         }
@@ -3749,7 +3747,7 @@ void WW8AttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLR )
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_PDxaFromText10 );
         else
-            m_rWW8Export.pO->Insert( 49, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 49 );
         // Mittelwert nehmen, da WW nur 1 Wert kennt
         m_rWW8Export.InsUInt16( (sal_uInt16) ( ( rLR.GetLeft() + rLR.GetRight() ) / 2 ) );
     }
@@ -3771,14 +3769,14 @@ void WW8AttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLR )
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_SDxaLeft );
         else
-            m_rWW8Export.pO->Insert( 166, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 166 );
         m_rWW8Export.InsUInt16( nLDist );
 
         // sprmSDxaRight
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_SDxaRight );
         else
-            m_rWW8Export.pO->Insert( 167, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 167 );
         m_rWW8Export.InsUInt16( nRDist );
     }
     else
@@ -3791,7 +3789,7 @@ void WW8AttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLR )
         }
         else
         {
-            m_rWW8Export.pO->Insert( 17, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 17 );
             m_rWW8Export.InsUInt16( (sal_uInt16)rLR.GetTxtLeft() );
         }
 
@@ -3803,7 +3801,7 @@ void WW8AttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLR )
         }
         else
         {
-            m_rWW8Export.pO->Insert( 16, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 16 );
             m_rWW8Export.InsUInt16( (sal_uInt16)rLR.GetRight() );
         }
 
@@ -3815,7 +3813,7 @@ void WW8AttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLR )
         }
         else
         {
-            m_rWW8Export.pO->Insert( 19, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 19 );
             m_rWW8Export.InsUInt16( rLR.GetTxtFirstLineOfst() );
         }
     }
@@ -3831,7 +3829,7 @@ void WW8AttributeOutput::FormatULSpace( const SvxULSpaceItem& rUL )
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_PDyaFromText );
         else
-            m_rWW8Export.pO->Insert( 48, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 48 );
         // Mittelwert nehmen, da WW nur 1 Wert kennt
         m_rWW8Export.InsUInt16( (sal_uInt16) ( ( rUL.GetUpper() + rUL.GetLower() ) / 2 ) );
     }
@@ -3849,7 +3847,7 @@ void WW8AttributeOutput::FormatULSpace( const SvxULSpaceItem& rUL )
             if ( m_rWW8Export.bWrtWW8 )
                 m_rWW8Export.InsUInt16( NS_sprm::LN_SDyaHdrTop );
             else
-                m_rWW8Export.pO->Insert( 156, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( 156 );
             m_rWW8Export.InsUInt16( aDistances.dyaHdrTop );
         }
 
@@ -3857,7 +3855,7 @@ void WW8AttributeOutput::FormatULSpace( const SvxULSpaceItem& rUL )
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_SDyaTop );
         else
-            m_rWW8Export.pO->Insert( 168, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 168 );
         m_rWW8Export.InsUInt16( aDistances.dyaTop );
 
         if ( aDistances.HasFooter() )
@@ -3866,7 +3864,7 @@ void WW8AttributeOutput::FormatULSpace( const SvxULSpaceItem& rUL )
             if ( m_rWW8Export.bWrtWW8 )
                 m_rWW8Export.InsUInt16( NS_sprm::LN_SDyaHdrBottom );
             else
-                m_rWW8Export.pO->Insert( 157, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( 157 );
             m_rWW8Export.InsUInt16( aDistances.dyaHdrBottom );
         }
 
@@ -3874,7 +3872,7 @@ void WW8AttributeOutput::FormatULSpace( const SvxULSpaceItem& rUL )
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_SDyaBottom );
         else
-            m_rWW8Export.pO->Insert( 169, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 169 );
         m_rWW8Export.InsUInt16( aDistances.dyaBottom );
     }
     else
@@ -3883,13 +3881,13 @@ void WW8AttributeOutput::FormatULSpace( const SvxULSpaceItem& rUL )
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_PDyaBefore );
         else
-            m_rWW8Export.pO->Insert( 21, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 21 );
         m_rWW8Export.InsUInt16( rUL.GetUpper() );
         // sprmPDyaAfter
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_PDyaAfter );
         else
-            m_rWW8Export.pO->Insert( 22, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 22 );
         m_rWW8Export.InsUInt16( rUL.GetLower() );
     }
 }
@@ -3903,11 +3901,10 @@ void WW8AttributeOutput::FormatSurround( const SwFmtSurround& rSurround )
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_PWr );
         else
-            m_rWW8Export.pO->Insert( 37, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 37 );
 
-        m_rWW8Export.pO->Insert(
-                ( SURROUND_NONE != rSurround.GetSurround() ) ? 2 : 1,
-                m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back(
+                ( SURROUND_NONE != rSurround.GetSurround() ) ? 2 : 1 );
     }
 }
 
@@ -3942,7 +3939,7 @@ void WW8AttributeOutput::FormatVertOrientation( const SwFmtVertOrient& 
rFlyVert
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_PDyaAbs );
         else
-            m_rWW8Export.pO->Insert( 27, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 27 );
         m_rWW8Export.InsUInt16( nPos );
     }
 }
@@ -3984,7 +3981,7 @@ void WW8AttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& 
rFlyHori
         if( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_PDxaAbs );
         else
-            m_rWW8Export.pO->Insert( 26, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 26 );
         m_rWW8Export.InsUInt16( nPos );
     }
 }
@@ -4018,8 +4015,8 @@ void WW8AttributeOutput::FormatAnchor( const SwFmtAnchor& rAnchor )
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_PPc );
         else
-            m_rWW8Export.pO->Insert( 29, m_rWW8Export.pO->Count() );
-        m_rWW8Export.pO->Insert( nP, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 29 );
+        m_rWW8Export.pO->push_back( nP );
     }
 }
 
@@ -4035,7 +4032,7 @@ void WW8AttributeOutput::FormatBackground( const SvxBrushItem& rBrush )
         if ( m_rWW8Export.bWrtWW8 )
             m_rWW8Export.InsUInt16( NS_sprm::LN_PShd );
         else
-            m_rWW8Export.pO->Insert(47, m_rWW8Export.pO->Count());
+            m_rWW8Export.pO->push_back(47);
         m_rWW8Export.InsUInt16( aSHD.GetValue() );
 
         // Quite a few unknowns, some might be transparency or something
@@ -4043,7 +4040,7 @@ void WW8AttributeOutput::FormatBackground( const SvxBrushItem& rBrush )
         if ( m_rWW8Export.bWrtWW8 )
         {
             m_rWW8Export.InsUInt16( 0xC64D );
-            m_rWW8Export.pO->Insert( 10, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 10 );
             m_rWW8Export.InsUInt32( 0xFF000000 );
             m_rWW8Export.InsUInt32( SuitableBGColor( rBrush.GetColor().GetColor() ) );
             m_rWW8Export.InsUInt16( 0x0000 );
@@ -4194,7 +4191,7 @@ WW8_BRC WW8Export::TranslateBorderLine(const SvxBorderLine& rLine,
 // auch fuer die Tabellen-Umrandungen zu benutzen.
 // Wenn nSprmNo == 0, dann wird der Opcode nicht ausgegeben.
 // bShadow darf bei Tabellenzellen *nicht* gesetzt sein !
-void WW8Export::Out_BorderLine(WW8Bytes& rO, const SvxBorderLine* pLine,
+void WW8Export::Out_BorderLine(ww::bytes& rO, const SvxBorderLine* pLine,
     sal_uInt16 nDist, sal_uInt16 nSprmNo, bool bShadow)
 {
     OSL_ENSURE( ( nSprmNo == 0 ) ||
@@ -4214,15 +4211,15 @@ void WW8Export::Out_BorderLine(WW8Bytes& rO, const SvxBorderLine* pLine,
         if ( nSprmNo != 0 )
             SwWW8Writer::InsUInt16( rO, nSprmNo );
 
-        rO.Insert( aBrc.aBits1, 2, rO.Count() );
-        rO.Insert( aBrc.aBits2, 2, rO.Count() );
+        rO.insert( rO.end(), aBrc.aBits1, aBrc.aBits1+2 );
+        rO.insert( rO.end(), aBrc.aBits2, aBrc.aBits2+2 );
     }
     else
     {
         // WW95-SprmIds
         if ( nSprmNo != 0 )
-            rO.Insert( (sal_uInt8)( nSprmNo ), rO.Count() );
-        rO.Insert( aBrc.aBits1, 2, rO.Count() );
+            rO.push_back( static_cast<sal_uInt8>( nSprmNo ) );
+        rO.insert( rO.end(), aBrc.aBits1, aBrc.aBits1+2 );
     }
 }
 
@@ -4273,7 +4270,7 @@ void WW8Export::Out_SwFmtBox(const SvxBoxItem& rBox, bool bShadow)
 // ( Tabellenumrandungen fransen sonst aus )
 // Ein WW8Bytes-Ptr wird als Ausgabe-Parameter uebergeben
 
-void WW8Export::Out_SwFmtTableBox( WW8Bytes& rO, const SvxBoxItem * pBox )
+void WW8Export::Out_SwFmtTableBox( ww::bytes& rO, const SvxBoxItem * pBox )
 {
     // moeglich und vielleicht besser waere 0xffff
     static const sal_uInt16 aBorders[] =
@@ -4332,23 +4329,22 @@ void WW8AttributeOutput::FormatColumns_Impl( sal_uInt16 nCols, const 
SwFmtCol &
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_SCcolumns );
     else
-        m_rWW8Export.pO->Insert( 144, m_rWW8Export.pO->Count(  ) );
+        m_rWW8Export.pO->push_back( 144 );
     m_rWW8Export.InsUInt16( nCols - 1 );
 
     // DxaColumns
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_SDxaColumns );
     else
-        m_rWW8Export.pO->Insert( 145, m_rWW8Export.pO->Count(  ) );
+        m_rWW8Export.pO->push_back( 145 );
     m_rWW8Export.InsUInt16( rCol.GetGutterWidth( true ) );
 
     // LBetween
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_SLBetween );
     else
-        m_rWW8Export.pO->Insert( 158, m_rWW8Export.pO->Count(  ) );
-    m_rWW8Export.pO->Insert( COLADJ_NONE == rCol.GetLineAdj(  )? 0 : 1,
-                             m_rWW8Export.pO->Count(  ) );
+        m_rWW8Export.pO->push_back( 158 );
+    m_rWW8Export.pO->push_back( COLADJ_NONE == rCol.GetLineAdj(  )? 0 : 1 );
 
     const SwColumns & rColumns = rCol.GetColumns(  );
 
@@ -4356,8 +4352,8 @@ void WW8AttributeOutput::FormatColumns_Impl( sal_uInt16 nCols, const SwFmtCol 
&
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_SFEvenlySpaced );
     else
-        m_rWW8Export.pO->Insert( 138, m_rWW8Export.pO->Count(  ) );
-    m_rWW8Export.pO->Insert( bEven ? 1 : 0, m_rWW8Export.pO->Count(  ) );
+        m_rWW8Export.pO->push_back( 138 );
+    m_rWW8Export.pO->push_back( bEven ? 1 : 0 );
 
     if ( !bEven )
     {
@@ -4367,8 +4363,8 @@ void WW8AttributeOutput::FormatColumns_Impl( sal_uInt16 nCols, const SwFmtCol 
&
             if ( m_rWW8Export.bWrtWW8 )
                 m_rWW8Export.InsUInt16( NS_sprm::LN_SDxaColWidth );
             else
-                m_rWW8Export.pO->Insert( 136, m_rWW8Export.pO->Count(  ) );
-            m_rWW8Export.pO->Insert( ( sal_uInt8 ) n, m_rWW8Export.pO->Count(  ) );
+                m_rWW8Export.pO->push_back( 136 );
+            m_rWW8Export.pO->push_back( static_cast<sal_uInt8>(n) );
             m_rWW8Export.InsUInt16( rCol.
                                     CalcPrtColWidth( n,
                                                      ( sal_uInt16 ) nPageSize ) );
@@ -4379,10 +4375,8 @@ void WW8AttributeOutput::FormatColumns_Impl( sal_uInt16 nCols, const 
SwFmtCol &
                 if ( m_rWW8Export.bWrtWW8 )
                     m_rWW8Export.InsUInt16( NS_sprm::LN_SDxaColSpacing );
                 else
-                    m_rWW8Export.pO->Insert( 137,
-                                             m_rWW8Export.pO->Count(  ) );
-                m_rWW8Export.pO->Insert( ( sal_uInt8 ) n,
-                                         m_rWW8Export.pO->Count(  ) );
+                    m_rWW8Export.pO->push_back( 137 );
+                m_rWW8Export.pO->push_back( static_cast<sal_uInt8>(n) );
                 m_rWW8Export.InsUInt16( rColumns[n]->GetRight(  ) +
                                         rColumns[n + 1]->GetLeft(  ) );
             }
@@ -4461,9 +4455,9 @@ void WW8AttributeOutput::FormatKeep( const SvxFmtKeepItem& rKeep )
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_PFKeepFollow );
     else
-        m_rWW8Export.pO->Insert( 8, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 8 );
 
-    m_rWW8Export.pO->Insert( rKeep.GetValue() ? 1 : 0, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( rKeep.GetValue() ? 1 : 0 );
 }
 
 // exclude a paragraph from Line Numbering
@@ -4473,9 +4467,9 @@ void WW8AttributeOutput::FormatLineNumbering( const SwFmtLineNumber& 
rNumbering
     if( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_PFNoLineNumb );
     else
-        m_rWW8Export.pO->Insert( 14, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 14 );
 
-    m_rWW8Export.pO->Insert( rNumbering.IsCount() ? 0 : 1, m_rWW8Export.pO->Count() );
+    m_rWW8Export.pO->push_back( rNumbering.IsCount() ? 0 : 1 );
 }
 
 
@@ -4487,7 +4481,7 @@ void WW8AttributeOutput::ParaLineSpacing_Impl( short nSpace, short nMulti )
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_PDyaLine );
     else
-        m_rWW8Export.pO->Insert( 20, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 20 );
 
     m_rWW8Export.InsUInt16( nSpace );
     m_rWW8Export.InsUInt16( nMulti );
@@ -4589,7 +4583,7 @@ void WW8AttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
         if ( m_rWW8Export.bWrtWW8 )
         {
             m_rWW8Export.InsUInt16( NS_sprm::LN_PJc );
-            m_rWW8Export.pO->Insert( nAdj, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( nAdj );
 
             /*
             Sadly for left to right paragraphs both these values are the same,
@@ -4622,14 +4616,14 @@ void WW8AttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
             }
 
             if ( bBiDiSwap )
-                m_rWW8Export.pO->Insert( nAdjBiDi, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( nAdjBiDi );
             else
-                m_rWW8Export.pO->Insert( nAdj, m_rWW8Export.pO->Count() );
+                m_rWW8Export.pO->push_back( nAdj );
         }
         else
         {
-            m_rWW8Export.pO->Insert( 5, m_rWW8Export.pO->Count() );
-            m_rWW8Export.pO->Insert( nAdj, m_rWW8Export.pO->Count() );
+            m_rWW8Export.pO->push_back( 5 );
+            m_rWW8Export.pO->push_back( nAdj );
         }
     }
 }
@@ -4692,12 +4686,12 @@ void WW8AttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& 
rDir
         m_rWW8Export.InsUInt16( NS_sprm::LN_STextFlow );
         m_rWW8Export.InsUInt16( nTextFlow );
         m_rWW8Export.InsUInt16( NS_sprm::LN_SFBiDi );
-        m_rWW8Export.pO->Insert( bBiDi, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( bBiDi );
     }
     else if ( !m_rWW8Export.bOutFlyFrmAttrs )  //paragraph/style
     {
         m_rWW8Export.InsUInt16( NS_sprm::LN_PFBiDi );
-        m_rWW8Export.pO->Insert( bBiDi, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( bBiDi );
     }
 }
 
@@ -4708,8 +4702,8 @@ void WW8AttributeOutput::ParaSplit( const SvxFmtSplitItem& rSplit )
     if ( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_PFKeep );
     else
-        m_rWW8Export.pO->Insert( 7, m_rWW8Export.pO->Count() );
-    m_rWW8Export.pO->Insert( rSplit.GetValue() ? 0 : 1, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 7 );
+    m_rWW8Export.pO->push_back( rSplit.GetValue() ? 0 : 1 );
 }
 
 //  Es wird nur das Item "SvxWidowItem" und nicht die Orphans uebersetzt,
@@ -4721,8 +4715,8 @@ void WW8AttributeOutput::ParaWidows( const SvxWidowsItem& rWidows )
     if( m_rWW8Export.bWrtWW8 )
         m_rWW8Export.InsUInt16( NS_sprm::LN_PFWidowControl );
     else
-        m_rWW8Export.pO->Insert( 51, m_rWW8Export.pO->Count() );
-    m_rWW8Export.pO->Insert( rWidows.GetValue() ? 1 : 0, m_rWW8Export.pO->Count() );
+        m_rWW8Export.pO->push_back( 51 );
+    m_rWW8Export.pO->push_back( rWidows.GetValue() ? 1 : 0 );
 }
 
 
@@ -4836,14 +4830,14 @@ void SwWW8WrTabu::PutAll(WW8Export& rWrt)
     if (rWrt.bWrtWW8)
         rWrt.InsUInt16(NS_sprm::LN_PChgTabsPapx);
     else
-        rWrt.pO->Insert(15, rWrt.pO->Count());
+        rWrt.pO->push_back(15);
     // cch eintragen
-    rWrt.pO->Insert(msword_cast<sal_uInt8>(nSiz), rWrt.pO->Count());
+    rWrt.pO->push_back(msword_cast<sal_uInt8>(nSiz));
     // DelArr schreiben
-    rWrt.pO->Insert(msword_cast<sal_uInt8>(nDel), rWrt.pO->Count());
+    rWrt.pO->push_back(msword_cast<sal_uInt8>(nDel));
     rWrt.OutSprmBytes(pDel, nDel * 2);
     // InsArr schreiben
-    rWrt.pO->Insert(msword_cast<sal_uInt8>(nAdd), rWrt.pO->Count());
+    rWrt.pO->push_back(msword_cast<sal_uInt8>(nAdd));
     rWrt.OutSprmBytes(pAddPos, 2 * nAdd);         // AddPosArray
     rWrt.OutSprmBytes(pAddTyp, nAdd);             // AddTypArray
 }
-- 
1.7.4.1

From 4fa9144cf6ec1a17061f2cdac5a18ed84419bf65 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski <maciej.rumianowski@gmail.com>
Date: Mon, 3 Oct 2011 22:50:47 +0200
Subject: [PATCH 2/4] Remove unused Variables in WW8Export

Variables were NULL or 0 saved and restored but nothing more.
---
 sw/source/filter/ww8/wrtww8.cxx |   15 ---------------
 sw/source/filter/ww8/wrtww8.hxx |    4 ----
 2 files changed, 0 insertions(+), 19 deletions(-)

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 6c3670e..e0a3074 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1755,8 +1755,6 @@ void MSWordExportBase::SaveData( sal_uLong nStt, sal_uLong nEnd )
 
     // WW8Export only stuff - zeroed here not to issue warnings
     aData.pOOld = NULL;
-    aData.mpTableAtOld = NULL;
-    aData.mnTableStdAtLenOld = 0;
 
     // Common stuff
     aData.pOldPam = pCurPam;
@@ -1829,11 +1827,6 @@ void WW8Export::SaveData( sal_uLong nStt, sal_uLong nEnd )
     else
         rData.pOOld = 0; // reuse pO
 
-    rData.mpTableAtOld = mpTableAt;
-    mpTableAt = NULL;
-    rData.mnTableStdAtLenOld = mnTableStdAtLen;
-    mnTableStdAtLen = 0;
-
     rData.bOldWriteAll = GetWriter().bWriteAll;
     GetWriter().bWriteAll = true;
 }
@@ -1851,12 +1844,6 @@ void WW8Export::RestoreData()
         pO = rData.pOOld;
     }
 
-    OSL_ENSURE( !mpTableAt || !mpTableAt->Count(), "mpTableAt is not empty in 
WW8Export::RestoreData()" );
-    if ( mpTableAt )
-        delete mpTableAt;
-    mpTableAt = rData.mpTableAtOld;
-    mnTableStdAtLen = rData.mnTableStdAtLenOld;
-
     MSWordExportBase::RestoreData();
 }
 
@@ -3361,8 +3348,6 @@ WW8Export::WW8Export( SwWW8Writer *pWriter,
         bool bIsWW8 )
     : MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ),
       pO( NULL ),
-      mpTableAt( NULL ),
-      mnTableStdAtLen( 0 ),
       pSepx( NULL ),
       bWrtWW8( bIsWW8 ),
       m_pWriter( pWriter ),
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 47ddc56..691c912 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -429,8 +429,6 @@ struct MSWordSaveData
     Point* pOldFlyOffset;
     RndStdIds eOldAnchorType;
     ww::bytes* pOOld;                ///< WW8Export only
-    WW8Bytes* mpTableAtOld;         ///< WW8Export only: Additional buffer for the output of the 
tables
-    sal_uInt16 mnTableStdAtLenOld;  ///< WW8Export only: Standard length of mpTableAt
     SwPaM* pOldPam, *pOldEnd;
     const sw::Frame* pOldFlyFmt;
     const SwPageDesc* pOldPageDesc;
@@ -913,8 +911,6 @@ class WW8Export : public MSWordExportBase
 {
 public:
     ww::bytes* pO;                       ///< Buffer
-    WW8Bytes* mpTableAt;                ///< Additional buffer for the output of the tables
-    sal_uInt16 mnTableStdAtLen;         ///< Standard length of mpTableAt
 
     SvStream *pTableStrm, *pDataStrm;   ///< Streams for WW97 Export
 
-- 
1.7.4.1

From cd938b6a402124ca813819635d4a78b8aab14dbf Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski <maciej.rumianowski@gmail.com>
Date: Wed, 5 Oct 2011 09:35:03 +0200
Subject: [PATCH 3/4] 2 Part of Replace WW8Bytes with ww::bytes

Use prefered methods from SwWW8Writer
---
 sw/source/filter/ww8/wrtw8esh.cxx |    6 ++--
 sw/source/filter/ww8/wrtw8nds.cxx |   28 +++++++++-----------
 sw/source/filter/ww8/wrtw8num.cxx |    6 ++--
 sw/source/filter/ww8/wrtww8.cxx   |   50 +++----------------------------------
 sw/source/filter/ww8/wrtww8.hxx   |   11 +-------
 sw/source/filter/ww8/wrtww8gr.cxx |   10 +++---
 sw/source/filter/ww8/ww8atr.cxx   |   18 ++++++-------
 7 files changed, 37 insertions(+), 92 deletions(-)

diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index a0f7ca2..da071fc 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1403,13 +1403,13 @@ sal_Int32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, 
sal_uInt32 nSh
         String sURL;
         pGrfNd->GetFileFilterNms( &sURL, 0 );
 
-        WW8Bytes aBuf;
+        ww::bytes aBuf;
         SwWW8Writer::InsAsString16( aBuf, sURL );
         SwWW8Writer::InsUInt16( aBuf, 0 );
 
-        sal_uInt16 nArrLen = aBuf.Count();
+        sal_uInt16 nArrLen = aBuf.size();
         sal_uInt8* pArr = new sal_uInt8[ nArrLen ];
-        memcpy( pArr, aBuf.GetData(), nArrLen );
+        std::copy( aBuf.begin(), aBuf.end(), pArr);
 
         aPropOpt.AddOpt(ESCHER_Prop_pibName, true, nArrLen, pArr, nArrLen);
         nFlags = ESCHER_BlipFlagLinkToFile | ESCHER_BlipFlagURL |
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 2b06b30..65250ca 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -627,11 +627,9 @@ const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const
     return pRet;
 }
 
-void WW8Export::GetCurrentItems(WW8Bytes& rItems) const
+void WW8Export::GetCurrentItems(ww::bytes &rItems) const
 {
-    sal_uInt16 nEnd = pO ? pO->size() : 0;
-    for (sal_uInt16 nI = 0; nI < nEnd; ++nI)
-        rItems.Insert((*pO)[nI], rItems.Count());
+    rItems.insert(rItems.end(), pO->begin(), pO->end());
 }
 
 const SfxPoolItem& SwWW8AttrIter::GetItem(sal_uInt16 nWhich) const
@@ -1047,35 +1045,35 @@ void SwWW8AttrIter::OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool)
 
 void WW8AttributeOutput::FieldVanish( const String& rTxt, ww::eField /*eType*/ )
 {
-    WW8Bytes aItems;
+    ww::bytes aItems;
     m_rWW8Export.GetCurrentItems( aItems );
 
     // sprmCFFldVanish
     if ( m_rWW8Export.bWrtWW8 )
         SwWW8Writer::InsUInt16( aItems, NS_sprm::LN_CFFldVanish );
     else
-        aItems.Insert( 67, aItems.Count() );
-    aItems.Insert( 1, aItems.Count() );
+        aItems.push_back( 67 );
+    aItems.push_back( 1 );
 
-    sal_uInt16 nStt_sprmCFSpec = aItems.Count();
+    sal_uInt16 nStt_sprmCFSpec = aItems.size();
 
     // sprmCFSpec --  fSpec-Attribut true
     if ( m_rWW8Export.bWrtWW8 )
         SwWW8Writer::InsUInt16( aItems, 0x855 );
     else
-        aItems.Insert( 117, aItems.Count() );
-    aItems.Insert( 1, aItems.Count() );
+        aItems.push_back( 117 );
+    aItems.push_back( 1 );
 
     m_rWW8Export.WriteChar( '\x13' );
-    m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), aItems.Count(),
-                                    aItems.GetData() );
+    m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), aItems.size(),
+                                    &aItems[0] );
     m_rWW8Export.OutSwString( rTxt, 0, rTxt.Len(), m_rWW8Export.IsUnicode(),
                         RTL_TEXTENCODING_MS_1252 );
     m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), nStt_sprmCFSpec,
-                                    aItems.GetData() );
+                                    &aItems[0] );
     m_rWW8Export.WriteChar( '\x15' );
-    m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), aItems.Count(),
-                                    aItems.GetData() );
+    m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), aItems.size(),
+                                    &aItems[0] );
 }
 
 void AttributeOutputBase::TOXMark( const SwTxtNode& rNode, const SwTOXMark& rAttr )
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index e7d476e..b7ee16c 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -745,14 +745,14 @@ static void SwWw8_InsertAnlText( const String& rStr, sal_uInt8*& rpCh,
                                  sal_uInt16& rCharLen, SVBT8& r8Len )
 {
     sal_uInt8 nb = 0;
-    WW8Bytes aO;
+    ww::bytes aO;
     SwWW8Writer::InsAsString8( aO, rStr, RTL_TEXTENCODING_MS_1252 );
 
-    sal_uInt16 nCnt = aO.Count();
+    sal_uInt16 nCnt = aO.size();
     if( nCnt && nCnt < rCharLen )
     {
         nb = (sal_uInt8)nCnt;
-        memcpy( rpCh, aO.GetData(), nCnt );
+        std::copy( aO.begin(), aO.end(), rpCh );
         rpCh += nCnt;
         rCharLen = rCharLen - nCnt;
     }
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index e0a3074..0461b5e 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1555,48 +1555,6 @@ void SwWW8Writer::InsAsString8(ww::bytes &rO, const String& rStr,
     std::copy(pStart, pEnd, std::inserter(rO, rO.end()));
 }
 
-#ifdef __WW8_NEEDS_COPY
-
-void SwWW8Writer::InsUInt16( WW8Bytes& rO, sal_uInt16 n )
-{
-    SVBT16 nL;
-    ShortToSVBT16( n, nL );
-    rO.Insert( nL, 2, rO.Count() );
-}
-void SwWW8Writer::InsUInt32( WW8Bytes& rO, sal_uInt32 n )
-{
-    SVBT32 nL;
-    UInt32ToSVBT32( n, nL );
-    rO.Insert( nL, 4, rO.Count() );
-}
-
-#else
-
-void SwWW8Writer::InsUInt16( WW8Bytes& rO, sal_uInt16 n )
-{
-    rO.Insert( (sal_uInt8*)&n, 2, rO.Count() );
-}
-void SwWW8Writer::InsUInt32( WW8Bytes& rO, sal_uInt32 n )
-{
-    rO.Insert( (sal_uInt8*)&n, 4, rO.Count() );
-}
-
-#endif // defined __WW8_NEEDS_COPY
-
-void SwWW8Writer::InsAsString16( WW8Bytes& rO, const String& rStr )
-{
-    const sal_Unicode* pStr = rStr.GetBuffer();
-    for( xub_StrLen n = 0, nLen = rStr.Len(); n < nLen; ++n, ++pStr )
-        SwWW8Writer::InsUInt16( rO, *pStr );
-}
-
-void SwWW8Writer::InsAsString8( WW8Bytes& rO, const String& rStr,
-                                rtl_TextEncoding eCodeSet )
-{
-    rtl::OString sTmp(rtl::OUStringToOString(rStr, eCodeSet));
-    rO.Insert((sal_uInt8*)sTmp.getStr(), sTmp.getLength(), rO.Count());
-}
-
 void SwWW8Writer::WriteString16(SvStream& rStrm, const String& rStr,
     bool bAddZero)
 {
@@ -1640,7 +1598,7 @@ void WW8Export::WriteStringAsPara( const String& rTxt, sal_uInt16 nStyleId )
         OutSwString( rTxt, 0, rTxt.Len(), IsUnicode(), RTL_TEXTENCODING_MS_1252 );
     WriteCR();              // CR danach
 
-    WW8Bytes aArr( 10, 10 );
+    ww::bytes aArr;
     SwWW8Writer::InsUInt16( aArr, nStyleId );
     if( bOutTable )
     {                                               // Tab-Attr
@@ -1648,12 +1606,12 @@ void WW8Export::WriteStringAsPara( const String& rTxt, sal_uInt16 nStyleId )
         if( bWrtWW8 )
             SwWW8Writer::InsUInt16( aArr, NS_sprm::LN_PFInTable );
         else
-            aArr.Insert( 24, aArr.Count() );
-        aArr.Insert( 1, aArr.Count() );
+            aArr.push_back( 24 );
+        aArr.push_back( 1 );
     }
 
     sal_uLong nPos = Strm().Tell();
-    pPapPlc->AppendFkpEntry( nPos, aArr.Count(), aArr.GetData() );
+    pPapPlc->AppendFkpEntry( nPos, aArr.size(), &aArr[0] );
     pChpPlc->AppendFkpEntry( nPos );
 }
 
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 691c912..2b8438d 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -863,20 +863,11 @@ public:
     using Writer::getIDocumentSettingAccess;
 
 public:
-#if 1
-    /// Prefer ww::bytes to WW8Bytes, migrate away from the other ones.
     static void InsUInt16(ww::bytes &rO, sal_uInt16 n);
     static void InsUInt32(ww::bytes &rO, sal_uInt32 n);
     static void InsAsString16(ww::bytes &rO, const String& rStr);
     static void InsAsString8(ww::bytes & O, const String& rStr,
         rtl_TextEncoding eCodeSet);
-#endif
-
-    static void InsUInt16( WW8Bytes& rO, sal_uInt16 );
-    static void InsUInt32( WW8Bytes& rO, sal_uInt32 );
-    static void InsAsString16( WW8Bytes& rO, const String& );
-    static void InsAsString8( WW8Bytes& rO, const String& rStr,
-                                rtl_TextEncoding eCodeSet );
 
     static sal_uLong FillUntil( SvStream& rStrm, sal_uLong nEndPos = 0 );
     static void FillCount( SvStream& rStrm, sal_uLong nCount );
@@ -1098,7 +1089,7 @@ public:
 
     virtual void DoFormText(const SwInputField * pFld);
 
-    void GetCurrentItems(WW8Bytes &rItems) const;
+    void GetCurrentItems(ww::bytes &rItems) const;
 
     /// Write the data of the form field
     virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark );
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 2c54d5b..c56c6a5 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -379,20 +379,20 @@ void WW8Export::OutputLinkedOLE( const rtl::OUString& rOleId )
             xOleDst->Commit();
 
             // Ouput the cPicLocation attribute
-            WW8Bytes* pBuf = new WW8Bytes( 128, 128 );
+            ww::bytes* pBuf = new ww::bytes();
             GetWriter().InsUInt16( *pBuf, NS_sprm::LN_CPicLocation );
             GetWriter().InsUInt32( *pBuf, rOleId.copy( 1 ).toInt32() );
 
             GetWriter().InsUInt16( *pBuf, NS_sprm::LN_CFOle2 );
-            pBuf->Insert( 1, pBuf->Count() );
+            pBuf->push_back( 1 );
 
             GetWriter().InsUInt16( *pBuf, NS_sprm::LN_CFSpec );
-            pBuf->Insert( 1, pBuf->Count() );
+            pBuf->push_back( 1 );
 
             GetWriter().InsUInt16( *pBuf, NS_sprm::LN_CFObj );
-            pBuf->Insert( 1, pBuf->Count() );
+            pBuf->push_back( 1 );
 
-            pChpPlc->AppendFkpEntry( Strm().Tell(), pBuf->Count(), pBuf->GetData() );
+            pChpPlc->AppendFkpEntry( Strm().Tell(), pBuf->size(), &(*pBuf)[0] );
             delete pBuf;
         }
     }
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index ddca1a8..36d0461 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1658,14 +1658,13 @@ static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 c,
                                String* pLinkStr = 0L,
                                bool bIncludeEmptyPicLocation = false )
 {
-    WW8Bytes aItems;
+    ww::bytes aItems;
     rWrt.GetCurrentItems(aItems);
 
     if (c == 0x13)
         rWrt.pChpPlc->AppendFkpEntry(rWrt.Strm().Tell());
     else
-        rWrt.pChpPlc->AppendFkpEntry(rWrt.Strm().Tell(), aItems.Count(),
-            aItems.GetData());
+        rWrt.pChpPlc->AppendFkpEntry(rWrt.Strm().Tell(), aItems.size(), &aItems[0]);
 
     rWrt.WriteChar(c);
 
@@ -1715,11 +1714,11 @@ static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 c,
 
         // write attributes of hyperlink character 0x01
         SwWW8Writer::InsUInt16( aItems, NS_sprm::LN_CFFldVanish );
-        aItems.Insert( (sal_uInt8)0x81, aItems.Count() );
+        aItems.push_back( (sal_uInt8)0x81 );
         SwWW8Writer::InsUInt16( aItems, NS_sprm::LN_CPicLocation );
         SwWW8Writer::InsUInt32( aItems, nLinkPosInDataStrm );
         SwWW8Writer::InsUInt16( aItems, NS_sprm::LN_CFData );
-        aItems.Insert( (sal_uInt8)0x01, aItems.Count() );
+        aItems.push_back( (sal_uInt8)0x01 );
     }
 
     //Technically we should probably Remove all attribs
@@ -1730,16 +1729,15 @@ static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 c,
     if( rWrt.bWrtWW8 )
     {
         SwWW8Writer::InsUInt16( aItems, NS_sprm::LN_CFSpec );
-        aItems.Insert( 1, aItems.Count() );
+        aItems.push_back( 1 );
     }
     else
     {
-        aItems.Insert( 117, aItems.Count() ); //sprmCFSpec
-        aItems.Insert( 1, aItems.Count() );
+        aItems.push_back( 117 ); //sprmCFSpec
+        aItems.push_back( 1 );
     }
 
-    rWrt.pChpPlc->AppendFkpEntry(rWrt.Strm().Tell(), aItems.Count(),
-        aItems.GetData());
+    rWrt.pChpPlc->AppendFkpEntry(rWrt.Strm().Tell(), aItems.size(), &aItems[0]);
 }
 
 String lcl_GetExpandedField(const SwField &rFld)
-- 
1.7.4.1

From be4b620c6d7dd558d137bb6ea4d503e622888a17 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski <maciej.rumianowski@gmail.com>
Date: Wed, 5 Oct 2011 09:35:49 +0200
Subject: [PATCH 4/4] Remove Declaration of WW8Bytes now not used

---
 sw/source/filter/ww8/wrtww8.cxx |    2 --
 sw/source/filter/ww8/wrtww8.hxx |    3 ---
 2 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 0461b5e..2a0f364 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -227,8 +227,6 @@ public:
 #define sMainStream CREATE_CONST_ASC("WordDocument")
 #define sCompObj CREATE_CONST_ASC("\1CompObj")
 
-
-SV_IMPL_VARARR( WW8Bytes, sal_uInt8 )
 SV_IMPL_PTRARR( WW8_WrFkpPtrs, WW8_FkpPtr )
 
 typedef WW8_WrPc* WW8_WrPcPtr;
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 2b8438d..761fc2a 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -99,7 +99,6 @@ class SwWW8WrGrf;
 class SwWW8Writer;
 class MSWordStyles;
 class WW8AttributeOutput;
-class WW8Bytes;
 class WW8Export;
 class MSWordAttrIter;
 class WW8_WrFkp;
@@ -149,8 +148,6 @@ enum TxtTypes  //enums for TextTypes
     TXT_EDN = 4, TXT_ATN = 5, TXT_TXTBOX = 6, TXT_HFTXTBOX= 7
 };
 
-SV_DECL_VARARR( WW8Bytes, sal_uInt8, 128, 128 )
-
 struct WW8_SepInfo
 {
     const SwPageDesc* pPageDesc;
-- 
1.7.4.1


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.