[Libreoffice-commits] core.git: 6 commits - comphelper/source include/comphelper package/source sw/inc sw/source

Michael Stahl mstahl at redhat.com
Tue Sep 1 09:29:50 PDT 2015


 comphelper/source/xml/ofopxmlhelper.cxx |  111 ++++++++++++++++++++++++++------
 include/comphelper/ofopxmlhelper.hxx    |   62 ++---------------
 include/comphelper/seekableinput.hxx    |    9 ++
 package/source/xstor/xstorage.hxx       |    1 
 sw/inc/editsh.hxx                       |   34 +++++----
 sw/source/core/edit/editsh.cxx          |    3 
 sw/source/filter/xml/xmltbli.cxx        |   85 ++++++++++++------------
 sw/source/filter/xml/xmltbli.hxx        |    7 --
 8 files changed, 176 insertions(+), 136 deletions(-)

New commits:
commit 244c4571d3c317640538412915fa5cf514778c7b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 1 14:17:20 2015 +0200

    sw: remove a silly 16bit cast
    
    Change-Id: I20eb3379838c5255ff47882b6693908b5971653f

diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 8005137..518d8ee 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1932,7 +1932,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( SwTableLine *pUpper,
         {
             // Could the table be splitted behind the current row?
             bool bSplit = true;
-            SwXMLTableRow_Impl *pRow = (*m_pRows)[(sal_uInt16)i].get();
+            SwXMLTableRow_Impl *pRow = (*m_pRows)[i].get();
             for( sal_uInt32 j=nLeftCol; j<nRightCol; j++ )
             {
                 bSplit = ( 1UL == pRow->GetCell(j)->GetRowSpan() );
@@ -1990,7 +1990,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( SwTableLine *pUpper,
                     }
                 }
             }
-            // und jetzt nochmal von vorne ...
+            // and now start over again...
         }
     }
 
commit 89077c790eb18e37dd6ab7d5e156ae33492a11a3
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 1 14:13:04 2015 +0200

    sw: convert boost::ptr_vector to std::vector<std::unique_ptr>
    
    Change-Id: I846180641279b19f6bd4ac14c3e840e0bec4ded5

diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 67b5f6b..8005137 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1255,18 +1255,16 @@ public:
     }
 };
 
-typedef boost::ptr_vector<SwXMLTableRow_Impl> SwXMLTableRows_Impl;
-
 const SwXMLTableCell_Impl *SwXMLTableContext::GetCell( sal_uInt32 nRow,
                                                  sal_uInt32 nCol ) const
 {
-    return (*pRows)[nRow].GetCell( nCol );
+    return (*m_pRows)[nRow]->GetCell( nCol );
 }
 
 SwXMLTableCell_Impl *SwXMLTableContext::GetCell( sal_uInt32 nRow,
                                                  sal_uInt32 nCol )
 {
-    return (*pRows)[nRow].GetCell( nCol );
+    return (*m_pRows)[nRow]->GetCell( nCol );
 }
 
 TYPEINIT1( SwXMLTableContext, XMLTextTableContext );
@@ -1277,7 +1275,7 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport,
         const Reference< xml::sax::XAttributeList > & xAttrList ) :
     XMLTextTableContext( rImport, nPrfx, rLName ),
     pColumnDefaultCellStyleNames( 0 ),
-    pRows( new SwXMLTableRows_Impl ),
+    m_pRows( new SwXMLTableRows_Impl ),
     pTableNode( 0 ),
     pBox1( 0 ),
     pSttNd1( 0 ),
@@ -1417,7 +1415,7 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport,
         SwXMLTableContext *pTable ) :
     XMLTextTableContext( rImport, nPrfx, rLName ),
     pColumnDefaultCellStyleNames( 0 ),
-    pRows( new SwXMLTableRows_Impl ),
+    m_pRows( new SwXMLTableRows_Impl ),
     pTableNode( pTable->pTableNode ),
     pBox1( 0 ),
     pSttNd1( 0 ),
@@ -1440,7 +1438,7 @@ SwXMLTableContext::~SwXMLTableContext()
 {
     delete pColumnDefaultCellStyleNames;
     delete pSharedBoxFormats;
-    delete pRows;
+    delete m_pRows;
 
     // close redlines on table end nodes
     GetImport().GetTextImport()->RedlineAdjustStartNodeCursor(false);
@@ -1595,7 +1593,7 @@ void SwXMLTableContext::InsertCell( const OUString& rStyleName,
     // into the current row.
     if( nCurRow > 0UL && nColSpan > 1UL )
     {
-        SwXMLTableRow_Impl *pCurRow = &(*pRows)[nCurRow];
+        SwXMLTableRow_Impl *pCurRow = (*m_pRows)[nCurRow].get();
         sal_uInt32 nLastCol = GetColumnCount() < nColsReq ? GetColumnCount()
                                                      : nColsReq;
         for( sal_uInt32 i=nCurCol+1UL; i<nLastCol; ++i )
@@ -1626,21 +1624,22 @@ void SwXMLTableContext::InsertCell( const OUString& rStyleName,
             aColumnWidths.push_back( ColumnWidthInfo(MINLAY, true) );
         }
         // adjust columns in *all* rows, if columns must be inserted
-        for( size_t i=0; i<pRows->size(); ++i )
-            (*pRows)[i].Expand( nColsReq, i<nCurRow );
+        for (size_t i = 0; i < m_pRows->size(); ++i)
+            (*m_pRows)[i]->Expand( nColsReq, i<nCurRow );
     }
 
     // Add rows
-    if( pRows->size() < nRowsReq )
+    if (m_pRows->size() < nRowsReq)
     {
-        for( size_t i = pRows->size(); i < nRowsReq; ++i )
-            pRows->push_back( new SwXMLTableRow_Impl("", GetColumnCount()));
+        for (size_t i = m_pRows->size(); i < nRowsReq; ++i)
+            m_pRows->push_back(std::unique_ptr<SwXMLTableRow_Impl>(
+                        new SwXMLTableRow_Impl("", GetColumnCount())));
     }
 
     OUString sStyleName( rStyleName );
     if( sStyleName.isEmpty() )
     {
-        sStyleName = (*pRows)[nCurRow].GetDefaultCellStyleName();
+        sStyleName = (*m_pRows)[nCurRow]->GetDefaultCellStyleName();
         if( sStyleName.isEmpty() && HasColumnDefaultCellStyleNames() )
         {
             sStyleName = GetColumnDefaultCellStyleName( nCurCol );
@@ -1682,18 +1681,19 @@ void SwXMLTableContext::InsertRow( const OUString& rStyleName,
     if( 0==nCurRow && 0UL == GetColumnCount()  )
         InsertColumn( USHRT_MAX, true );
 
-    if( nCurRow < pRows->size() )
+    if (nCurRow < m_pRows->size())
     {
         // The current row has already been inserted because of a row span
         // of a previous row.
-        (*pRows)[nCurRow].Set(
+        (*m_pRows)[nCurRow]->Set(
             rStyleName, rDfltCellStyleName, i_rXmlId );
     }
     else
     {
         // add a new row
-        pRows->push_back( new SwXMLTableRow_Impl( rStyleName, GetColumnCount(),
-                                               &rDfltCellStyleName, i_rXmlId ) );
+        m_pRows->push_back(std::unique_ptr<SwXMLTableRow_Impl>(
+                new SwXMLTableRow_Impl(rStyleName, GetColumnCount(),
+                                       &rDfltCellStyleName, i_rXmlId)));
     }
 
     // We start at the first column ...
@@ -1709,7 +1709,7 @@ void SwXMLTableContext::InsertRow( const OUString& rStyleName,
 
 void SwXMLTableContext::InsertRepRows( sal_uInt32 nCount )
 {
-    const SwXMLTableRow_Impl *pSrcRow = &(*pRows)[nCurRow-1];
+    const SwXMLTableRow_Impl *pSrcRow = (*m_pRows)[nCurRow-1].get();
     while( nCount > 1 && IsInsertRowPossible() )
     {
         InsertRow( pSrcRow->GetStyleName(), pSrcRow->GetDefaultCellStyleName(),
@@ -1755,7 +1755,7 @@ const SwStartNode *SwXMLTableContext::GetPrevStartNode( sal_uInt32 nRow,
     if( GetColumnCount() == nCol )
     {
         // The last cell is the right one here.
-        pPrevCell = GetCell( pRows->size()-1U, GetColumnCount()-1UL );
+        pPrevCell = GetCell( m_pRows->size() - 1U, GetColumnCount() - 1UL );
     }
     else if( nCol > 0UL )
     {
@@ -1813,7 +1813,7 @@ void SwXMLTableContext::ReplaceWithEmptyCell( sal_uInt32 nRow, sal_uInt32 nCol,
 
     for( sal_uInt32 i=nRow; i<nLastRow; i++ )
     {
-        SwXMLTableRow_Impl *pRow = &(*pRows)[i];
+        SwXMLTableRow_Impl *pRow = (*m_pRows)[i].get();
         for( sal_uInt32 j=nCol; j<nLastCol; j++ )
             pRow->GetCell( j )->SetStartNode( pSttNd );
     }
@@ -1932,7 +1932,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( SwTableLine *pUpper,
         {
             // Could the table be splitted behind the current row?
             bool bSplit = true;
-            SwXMLTableRow_Impl *pRow = &(*pRows)[(sal_uInt16)i];
+            SwXMLTableRow_Impl *pRow = (*m_pRows)[(sal_uInt16)i].get();
             for( sal_uInt32 j=nLeftCol; j<nRightCol; j++ )
             {
                 bSplit = ( 1UL == pRow->GetCell(j)->GetRowSpan() );
@@ -1960,7 +1960,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( SwTableLine *pUpper,
             while( nStartRow < nBottomRow )
             {
                 sal_uInt32 nMaxRowSpan = 0UL;
-                SwXMLTableRow_Impl *pStartRow = &(*pRows)[nStartRow];
+                SwXMLTableRow_Impl *pStartRow = (*m_pRows)[nStartRow].get();
                 const SwXMLTableCell_Impl *pCell;
                 for( i=nLeftCol; i<nRightCol; i++ )
                     if( ( pCell=pStartRow->GetCell(i),
@@ -1970,7 +1970,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( SwTableLine *pUpper,
                 nStartRow += nMaxRowSpan;
                 if( nStartRow<nBottomRow )
                 {
-                    SwXMLTableRow_Impl *pPrevRow = &(*pRows)[nStartRow-1U];
+                    SwXMLTableRow_Impl *pPrevRow = (*m_pRows)[nStartRow - 1U].get();
                     i = nLeftCol;
                     while( i < nRightCol )
                     {
@@ -2194,7 +2194,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper,
     pFrameFormat->SetFormatAttr( aFillOrder );
 
     const SfxItemSet *pAutoItemSet = 0;
-    const OUString& rStyleName = (*pRows)[nTopRow].GetStyleName();
+    const OUString& rStyleName = (*m_pRows)[nTopRow]->GetStyleName();
     if( 1UL == (nBottomRow - nTopRow) &&
         !rStyleName.isEmpty() &&
         GetSwImport().FindAutomaticStyle(
@@ -2210,7 +2210,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper,
     while( nStartCol < nRightCol )
     {
         for( sal_uInt32 nRow=nTopRow; nRow<nBottomRow; nRow++ )
-            (*pRows)[nRow].SetSplitable( true );
+            (*m_pRows)[nRow]->SetSplitable( true );
 
         sal_uInt32 nCol = nStartCol;
         sal_uInt32 nSplitCol = nRightCol;
@@ -2234,10 +2234,10 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper,
                     SwXMLTableCell_Impl *pCell = GetCell(nRow,nCol);
                     // Could the table fragment be splitted horizontally behind
                     // the current line?
-                    bool bHoriSplit = (*pRows)[nRow].IsSplitable() &&
+                    bool bHoriSplit = (*m_pRows)[nRow]->IsSplitable() &&
                                       nRow+1UL < nBottomRow &&
                                       1UL == pCell->GetRowSpan();
-                    (*pRows)[nRow].SetSplitable( bHoriSplit );
+                    (*m_pRows)[nRow]->SetSplitable( bHoriSplit );
 
                     // Could the table fragment be splitted vertically behind the
                     // current column (uptp the current line?
@@ -2379,9 +2379,9 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
     // If there are empty rows (because of some row span of previous rows)
     // the have to be deleted. The previous rows have to be truncated.
 
-    if( pRows->size() > nCurRow )
+    if (m_pRows->size() > nCurRow)
     {
-        SwXMLTableRow_Impl *pPrevRow = &(*pRows)[nCurRow-1U];
+        SwXMLTableRow_Impl *pPrevRow = (*m_pRows)[nCurRow - 1U].get();
         const SwXMLTableCell_Impl *pCell;
         for( sal_uLong i = 0; i < aColumnWidths.size(); ++i )
         {
@@ -2390,11 +2390,11 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
                 FixRowSpan( nCurRow-1UL, i, 1UL );
             }
         }
-        for( sal_uLong i = pRows->size()-1UL; i>=nCurRow; --i )
-            pRows->pop_back();
+        for (sal_uLong i = m_pRows->size() - 1UL; i >= nCurRow; --i)
+            m_pRows->pop_back();
     }
 
-    if( pRows->empty() )
+    if (m_pRows->empty())
     {
         InsertCell( "", 1U, nCols, InsertTableSection() );
     }
@@ -2601,14 +2601,14 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
              : pTableNode->GetTable().GetTabLines();
 
     sal_uInt32 nStartRow = 0UL;
-    sal_uInt32 nRows = pRows->size();
+    sal_uInt32 nRows = m_pRows->size();
     for(sal_uInt32 i=0UL; i<nRows; ++i )
     {
         // Could we split the table behind the current line?
         bool bSplit = true;
         if ( bHasSubTables )
         {
-            SwXMLTableRow_Impl *pRow = &(*pRows)[i];
+            SwXMLTableRow_Impl *pRow = (*m_pRows)[i].get();
             for( sal_uInt32 j=0UL; j<nCols; j++ )
             {
                 bSplit = ( 1UL == pRow->GetCell(j)->GetRowSpan() );
@@ -2636,7 +2636,7 @@ void SwXMLTableContext::MakeTable()
     SolarMutexGuard aGuard;
 
     // #i97274# handle invalid tables
-    if (!pRows || pRows->empty() || !GetColumnCount())
+    if (!m_pRows || m_pRows->empty() || !GetColumnCount())
     {
         OSL_FAIL("invalid table: no cells; deleting...");
         pTableNode->GetDoc()->getIDocumentContentOperations().DeleteSection( pTableNode );
@@ -2778,8 +2778,8 @@ void SwXMLTableContext::MakeTable()
     pFrameFormat->SetFormatAttr( aSize );
     pFrameFormat->UnlockModify();
 
-    for( size_t i=0; i<pRows->size(); i++ )
-        (*pRows)[i].Dispose();
+    for (size_t i = 0; i < m_pRows->size(); i++)
+        (*m_pRows)[i]->Dispose();
 
     // now that table is complete, change into DDE table (if appropriate)
     if (NULL != pDDESource)
@@ -2819,8 +2819,11 @@ void SwXMLTableContext::MakeTable( SwTableBox *pBox, sal_Int32 nW )
 
     _MakeTable( pBox );
 
-    for (size_t i=0; i < pRows->size(); ++i) // i113600, to break the cyclic reference to SwXMLTableContext object
-        (*pRows)[i].Dispose();
+    for (size_t i = 0; i < m_pRows->size(); ++i)
+    {
+        // i#113600, to break the cyclic reference to SwXMLTableContext object
+        (*m_pRows)[i]->Dispose();
+    }
 }
 
 const SwStartNode *SwXMLTableContext::InsertTableSection(
diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx
index eb25273..7c743bc 100644
--- a/sw/source/filter/xml/xmltbli.hxx
+++ b/sw/source/filter/xml/xmltbli.hxx
@@ -22,8 +22,7 @@
 
 #include <xmloff/XMLTextTableContext.hxx>
 
-// STL include
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <memory>
 #include <unordered_map>
 #include <vector>
 
@@ -36,7 +35,7 @@ class SwTableBoxFormat;
 class SwTableLineFormat;
 class SwXMLTableCell_Impl;
 class SwXMLTableRow_Impl;
-typedef boost::ptr_vector<SwXMLTableRow_Impl> SwXMLTableRows_Impl;
+typedef std::vector<std::unique_ptr<SwXMLTableRow_Impl>> SwXMLTableRows_Impl;
 class SwXMLDDETableContext_Impl;
 class TableBoxIndexHasher;
 class TableBoxIndex;
@@ -65,7 +64,7 @@ class SwXMLTableContext : public XMLTextTableContext
     ::com::sun::star::uno::Reference <
         ::com::sun::star::text::XTextContent > xTextContent;
 
-    SwXMLTableRows_Impl *pRows;
+    SwXMLTableRows_Impl * m_pRows;
 
     SwTableNode         *pTableNode;
     SwTableBox          *pBox1;
commit d290ae119d773be95038ea779f4d432b65886fb6
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 1 13:57:49 2015 +0200

    sw: sort includes in editsh.hxx
    
    Change-Id: I74181ccf42e86bc6b65056199e6102bc05518a34

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index cf9740c..bdab357 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -19,28 +19,32 @@
 #ifndef INCLUDED_SW_INC_EDITSH_HXX
 #define INCLUDED_SW_INC_EDITSH_HXX
 
-#include <com/sun/star/text/HoriOrientation.hpp>
-#include <com/sun/star/embed/XEmbeddedObject.hpp>
-#include <vcl/font.hxx>
-#include <editeng/swafopt.hxx>
-#include "swdllapi.h"
 #include <crsrsh.hxx>
+
+#include <IMark.hxx>
+#include <charfmt.hxx>
+#include <fldupde.hxx>
+#include <frmfmt.hxx>
 #include <itabenum.hxx>
 #include <swdbdata.hxx>
-#include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
-#include <com/sun/star/linguistic2/ProofreadingResult.hpp>
-#include <fldupde.hxx>
+#include <swdllapi.h>
+#include <swundo.hxx>
 #include <tblenum.hxx>
-#include <IMark.hxx>
 #include <tox.hxx>
-#include <frmfmt.hxx>
-#include <charfmt.hxx>
+#include <svtools/embedhlp.hxx>
+
+#include <editeng/swafopt.hxx>
+
+#include <vcl/font.hxx>
+
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/linguistic2/ProofreadingResult.hpp>
+#include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
+#include <com/sun/star/text/HoriOrientation.hpp>
 
 #include <memory>
 #include <vector>
 #include <set>
-#include <swundo.hxx>
-#include <svtools/embedhlp.hxx>
 
 namespace tools { class PolyPolygon; }
 class SwDoc;
commit 121e73ec461553279db12b6fcfc18f593983d1a5
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 1 13:46:13 2015 +0200

    sw: replace boost::ptr_vector with std::vector
    
    Change-Id: Iad91811a0e674b3541d51f3e94a9a5770bfda0a1

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 98ed2dc..cf9740c 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -36,11 +36,11 @@
 #include <frmfmt.hxx>
 #include <charfmt.hxx>
 
+#include <memory>
 #include <vector>
 #include <set>
 #include <swundo.hxx>
 #include <svtools/embedhlp.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
 
 namespace tools { class PolyPolygon; }
 class SwDoc;
@@ -125,7 +125,7 @@ struct SwGetINetAttr
         : sText( rText ), rINetAttr( rAttr )
     {}
 };
-typedef boost::ptr_vector<SwGetINetAttr> SwGetINetAttrs;
+typedef std::vector<SwGetINetAttr> SwGetINetAttrs;
 
 // Types of forms of content.
 #define CNT_TXT 0x0001
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 8950e62..7e26933 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -682,8 +682,7 @@ void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
 
                 if( !sText.isEmpty() )
                 {
-                    SwGetINetAttr* pNew = new SwGetINetAttr( sText, rAttr );
-                    rArr.push_back( pNew );
+                    rArr.push_back(SwGetINetAttr(sText, rAttr));
                 }
             }
         }
commit 6fcaaca6cf6edce3c0af4d4b7976043f89a26ca1
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 1 17:53:14 2015 +0200

    comphelper: fix MSVC --enable-mergedlibs build, OFOPXMLHelper
    
    The OFOPXMLHelper class causes duplicate definition link errors
    due to its WeakImplHelper base class.
    
    It turns out that the OFOPXMLHelper class itself is only used by other
    exported functions in comphelper itself so just hide the
    implementation detail.
    
    Change-Id: I3ac8c561af703193cc2609e2c799b630a0d43127

diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx
index d110a48..ab81356 100644
--- a/comphelper/source/xml/ofopxmlhelper.cxx
+++ b/comphelper/source/xml/ofopxmlhelper.cxx
@@ -18,6 +18,11 @@
  */
 
 
+#include <comphelper/ofopxmlhelper.hxx>
+#include <comphelper/attributelist.hxx>
+
+#include <cppuhelper/implbase.hxx>
+
 #include <com/sun/star/beans/StringPair.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/io/XActiveDataSource.hpp>
@@ -26,9 +31,6 @@
 #include <com/sun/star/xml/sax/Writer.hpp>
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
 
-#include <comphelper/ofopxmlhelper.hxx>
-#include <comphelper/attributelist.hxx>
-
 #define RELATIONINFO_FORMAT 0
 #define CONTENTTYPE_FORMAT  1
 #define FORMAT_MAX_ID CONTENTTYPE_FORMAT
@@ -37,7 +39,62 @@ using namespace ::com::sun::star;
 
 namespace comphelper {
 
-uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadRelationsInfoSequence( const uno::Reference< io::XInputStream >& xInStream, const OUString & aStreamName, const uno::Reference< uno::XComponentContext >& rContext )
+// this helper class is designed to allow to parse ContentType- and Relationship-related information from OfficeOpenXML format
+class OFOPXMLHelper_Impl
+    : public cppu::WeakImplHelper< com::sun::star::xml::sax::XDocumentHandler >
+{
+    sal_uInt16 m_nFormat; // which format to parse
+
+    // Relations info related strings
+    OUString m_aRelListElement;
+    OUString m_aRelElement;
+    OUString m_aIDAttr;
+    OUString m_aTypeAttr;
+    OUString m_aTargetModeAttr;
+    OUString m_aTargetAttr;
+
+    // ContentType related strings
+    OUString m_aTypesElement;
+    OUString m_aDefaultElement;
+    OUString m_aOverrideElement;
+    OUString m_aExtensionAttr;
+    OUString m_aPartNameAttr;
+    OUString m_aContentTypeAttr;
+
+    ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aResultSeq;
+    ::com::sun::star::uno::Sequence< OUString > m_aElementsSeq; // stack of elements being parsed
+
+
+public:
+    ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetParsingResult();
+
+    OFOPXMLHelper_Impl( sal_uInt16 nFormat ); // must not be created directly
+    virtual ~OFOPXMLHelper_Impl();
+
+    // XDocumentHandler
+    virtual void SAL_CALL startDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+    virtual void SAL_CALL endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+    virtual void SAL_CALL startElement( const OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+    virtual void SAL_CALL endElement( const OUString& aName ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+    virtual void SAL_CALL characters( const OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+    virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+    virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+    virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+};
+
+
+namespace OFOPXMLHelper {
+
+static uno::Sequence<uno::Sequence< beans::StringPair>> ReadSequence_Impl(
+    const uno::Reference<io::XInputStream>& xInStream,
+    const OUString& aStringID, sal_uInt16 nFormat,
+    const uno::Reference<uno::XComponentContext>& xContext)
+throw (uno::Exception);
+
+uno::Sequence< uno::Sequence< beans::StringPair > > ReadRelationsInfoSequence(
+        const uno::Reference< io::XInputStream >& xInStream,
+        const OUString & aStreamName,
+        const uno::Reference< uno::XComponentContext >& rContext )
     throw( uno::Exception )
 {
     OUString aStringID = "_rels/";
@@ -46,7 +103,9 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::Read
 }
 
 
-uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadContentTypeSequence( const uno::Reference< io::XInputStream >& xInStream, const uno::Reference< uno::XComponentContext >& rContext )
+uno::Sequence< uno::Sequence< beans::StringPair > > ReadContentTypeSequence(
+        const uno::Reference< io::XInputStream >& xInStream,
+        const uno::Reference< uno::XComponentContext >& rContext )
     throw( uno::Exception )
 {
     OUString aStringID = "[Content_Types].xml";
@@ -54,7 +113,10 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::Read
 }
 
 
-void SAL_CALL OFOPXMLHelper::WriteRelationsInfoSequence( const uno::Reference< io::XOutputStream >& xOutStream, const uno::Sequence< uno::Sequence< beans::StringPair > >& aSequence, const uno::Reference< uno::XComponentContext >& rContext )
+void WriteRelationsInfoSequence(
+        const uno::Reference< io::XOutputStream >& xOutStream,
+        const uno::Sequence< uno::Sequence< beans::StringPair > >& aSequence,
+        const uno::Reference< uno::XComponentContext >& rContext )
     throw( uno::Exception )
 {
     if ( !xOutStream.is() )
@@ -115,7 +177,11 @@ void SAL_CALL OFOPXMLHelper::WriteRelationsInfoSequence( const uno::Reference< i
 }
 
 
-void SAL_CALL OFOPXMLHelper::WriteContentSequence( const uno::Reference< io::XOutputStream >& xOutStream, const uno::Sequence< beans::StringPair >& aDefaultsSequence, const uno::Sequence< beans::StringPair >& aOverridesSequence, const uno::Reference< uno::XComponentContext >& rContext )
+void WriteContentSequence(
+        const uno::Reference< io::XOutputStream >& xOutStream,
+        const uno::Sequence< beans::StringPair >& aDefaultsSequence,
+        const uno::Sequence< beans::StringPair >& aOverridesSequence,
+        const uno::Reference< uno::XComponentContext >& rContext )
     throw( uno::Exception )
 {
     if ( !xOutStream.is() )
@@ -175,7 +241,10 @@ void SAL_CALL OFOPXMLHelper::WriteContentSequence( const uno::Reference< io::XOu
 
 }
 
-uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadSequence_Impl( const uno::Reference< io::XInputStream >& xInStream, const OUString& aStringID, sal_uInt16 nFormat, const uno::Reference< uno::XComponentContext >& rContext )
+uno::Sequence< uno::Sequence< beans::StringPair > > ReadSequence_Impl(
+        const uno::Reference< io::XInputStream >& xInStream,
+        const OUString& aStringID, sal_uInt16 nFormat,
+        const uno::Reference< uno::XComponentContext >& rContext )
     throw( uno::Exception )
 {
     if ( !rContext.is() || !xInStream.is() || nFormat > FORMAT_MAX_ID )
@@ -183,7 +252,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::Read
 
     uno::Reference< xml::sax::XParser > xParser = xml::sax::Parser::create( rContext );
 
-    OFOPXMLHelper* pHelper = new OFOPXMLHelper( nFormat );
+    OFOPXMLHelper_Impl *const pHelper = new OFOPXMLHelper_Impl( nFormat );
     uno::Reference< xml::sax::XDocumentHandler > xHelper( static_cast< xml::sax::XDocumentHandler* >( pHelper ) );
     xml::sax::InputSource aParserInput;
     aParserInput.aInputStream = xInStream;
@@ -195,7 +264,9 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::Read
     return pHelper->GetParsingResult();
 }
 
-OFOPXMLHelper::OFOPXMLHelper( sal_uInt16 nFormat )
+} // namespace OFOPXMLHelper
+
+OFOPXMLHelper_Impl::OFOPXMLHelper_Impl( sal_uInt16 nFormat )
 : m_nFormat( nFormat )
 , m_aRelListElement( "Relationships" )
 , m_aRelElement( "Relationship" )
@@ -213,12 +284,12 @@ OFOPXMLHelper::OFOPXMLHelper( sal_uInt16 nFormat )
 }
 
 
-OFOPXMLHelper::~OFOPXMLHelper()
+OFOPXMLHelper_Impl::~OFOPXMLHelper_Impl()
 {
 }
 
 
-uno::Sequence< uno::Sequence< beans::StringPair > > OFOPXMLHelper::GetParsingResult()
+uno::Sequence< uno::Sequence< beans::StringPair > > OFOPXMLHelper_Impl::GetParsingResult()
 {
     if ( m_aElementsSeq.getLength() )
         throw uno::RuntimeException(); // the parsing has still not finished!
@@ -227,19 +298,19 @@ uno::Sequence< uno::Sequence< beans::StringPair > > OFOPXMLHelper::GetParsingRes
 }
 
 
-void SAL_CALL OFOPXMLHelper::startDocument()
+void SAL_CALL OFOPXMLHelper_Impl::startDocument()
         throw(xml::sax::SAXException, uno::RuntimeException, std::exception)
 {
 }
 
 
-void SAL_CALL OFOPXMLHelper::endDocument()
+void SAL_CALL OFOPXMLHelper_Impl::endDocument()
         throw(xml::sax::SAXException, uno::RuntimeException, std::exception)
 {
 }
 
 
-void SAL_CALL OFOPXMLHelper::startElement( const OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs )
+void SAL_CALL OFOPXMLHelper_Impl::startElement( const OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs )
         throw( xml::sax::SAXException, uno::RuntimeException, std::exception )
 {
     if ( m_nFormat == RELATIONINFO_FORMAT )
@@ -387,7 +458,7 @@ void SAL_CALL OFOPXMLHelper::startElement( const OUString& aName, const uno::Ref
 }
 
 
-void SAL_CALL OFOPXMLHelper::endElement( const OUString& aName )
+void SAL_CALL OFOPXMLHelper_Impl::endElement( const OUString& aName )
     throw( xml::sax::SAXException, uno::RuntimeException, std::exception )
 {
     if ( m_nFormat == RELATIONINFO_FORMAT || m_nFormat == CONTENTTYPE_FORMAT )
@@ -404,25 +475,25 @@ void SAL_CALL OFOPXMLHelper::endElement( const OUString& aName )
 }
 
 
-void SAL_CALL OFOPXMLHelper::characters( const OUString& /*aChars*/ )
+void SAL_CALL OFOPXMLHelper_Impl::characters( const OUString& /*aChars*/ )
         throw(xml::sax::SAXException, uno::RuntimeException, std::exception)
 {
 }
 
 
-void SAL_CALL OFOPXMLHelper::ignorableWhitespace( const OUString& /*aWhitespaces*/ )
+void SAL_CALL OFOPXMLHelper_Impl::ignorableWhitespace( const OUString& /*aWhitespaces*/ )
         throw(xml::sax::SAXException, uno::RuntimeException, std::exception)
 {
 }
 
 
-void SAL_CALL OFOPXMLHelper::processingInstruction( const OUString& /*aTarget*/, const OUString& /*aData*/ )
+void SAL_CALL OFOPXMLHelper_Impl::processingInstruction( const OUString& /*aTarget*/, const OUString& /*aData*/ )
         throw(xml::sax::SAXException, uno::RuntimeException, std::exception)
 {
 }
 
 
-void SAL_CALL OFOPXMLHelper::setDocumentLocator( const uno::Reference< xml::sax::XLocator >& /*xLocator*/ )
+void SAL_CALL OFOPXMLHelper_Impl::setDocumentLocator( const uno::Reference< xml::sax::XLocator >& /*xLocator*/ )
         throw(xml::sax::SAXException, uno::RuntimeException, std::exception)
 {
 }
diff --git a/include/comphelper/ofopxmlhelper.hxx b/include/comphelper/ofopxmlhelper.hxx
index 4c74953..7ab7e38 100644
--- a/include/comphelper/ofopxmlhelper.hxx
+++ b/include/comphelper/ofopxmlhelper.hxx
@@ -20,56 +20,24 @@
 #ifndef INCLUDED_COMPHELPER_OFOPXMLHELPER_HXX
 #define INCLUDED_COMPHELPER_OFOPXMLHELPER_HXX
 
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 #include <com/sun/star/beans/StringPair.hpp>
 #include <com/sun/star/io/XInputStream.hpp>
 #include <com/sun/star/io/XOutputStream.hpp>
-#include <cppuhelper/implbase.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
 #include <comphelper/comphelperdllapi.h>
 
 
 namespace comphelper
 {
 
-// this helper class is designed to allow to parse ContentType- and Relationship-related information from OfficeOpenXML format
-class COMPHELPER_DLLPUBLIC OFOPXMLHelper : public cppu::WeakImplHelper< com::sun::star::xml::sax::XDocumentHandler >
-{
-    sal_uInt16 m_nFormat; // which format to parse
-
-    // Relations info related strings
-    OUString m_aRelListElement;
-    OUString m_aRelElement;
-    OUString m_aIDAttr;
-    OUString m_aTypeAttr;
-    OUString m_aTargetModeAttr;
-    OUString m_aTargetAttr;
-
-    // ContentType related strings
-    OUString m_aTypesElement;
-    OUString m_aDefaultElement;
-    OUString m_aOverrideElement;
-    OUString m_aExtensionAttr;
-    OUString m_aPartNameAttr;
-    OUString m_aContentTypeAttr;
-
-    ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aResultSeq;
-    ::com::sun::star::uno::Sequence< OUString > m_aElementsSeq; // stack of elements being parsed
-
-    OFOPXMLHelper( sal_uInt16 nFormat ); // must not be created directly
-    ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetParsingResult();
-
-    static COMPHELPER_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL ReadSequence_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, const OUString& aStringID, sal_uInt16 nFormat, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rContext )
-    throw( ::com::sun::star::uno::Exception );
-
-public:
-    virtual ~OFOPXMLHelper();
+namespace OFOPXMLHelper {
 
     // returns sequence of elements, where each element is described by sequence of tags,
     // where each tag is described by StringPair ( First - name, Second - value )
     // the first tag of each element sequence must be "Id"
-    static
+    COMPHELPER_DLLPUBLIC
     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >
-    SAL_CALL
     ReadRelationsInfoSequence(
         const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream,
         const OUString & aStreamName,
@@ -81,9 +49,8 @@ public:
     // by StringPair object ( First - Extension, Second - ContentType )
     // the second sequence describes "Override" elements, where each element is described
     // by StringPair object ( First - PartName, Second - ContentType )
-    static
+    COMPHELPER_DLLPUBLIC
     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >
-    SAL_CALL
     ReadContentTypeSequence(
         const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream,
         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rContext )
@@ -92,8 +59,8 @@ public:
     // writes sequence of elements, where each element is described by sequence of tags,
     // where each tag is described by StringPair ( First - name, Second - value )
     // the first tag of each element sequence must be "Id"
-    static
-    void SAL_CALL WriteRelationsInfoSequence(
+    COMPHELPER_DLLPUBLIC
+    void WriteRelationsInfoSequence(
         const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutStream,
         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >& aSequence,
         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rContext )
@@ -104,24 +71,15 @@ public:
     // by StringPair object ( First - Extension, Second - ContentType )
     // the second sequence describes "Override" elements, where each element is described
     // by StringPair object ( First - PartName, Second - ContentType )
-    static
-    void SAL_CALL WriteContentSequence(
+    COMPHELPER_DLLPUBLIC
+    void WriteContentSequence(
         const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutStream,
         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aDefaultsSequence,
         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aOverridesSequence,
         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rContext )
             throw( ::com::sun::star::uno::Exception );
 
-    // XDocumentHandler
-    virtual void SAL_CALL startDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL startElement( const OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL endElement( const OUString& aName ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL characters( const OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-};
+} // namespace OFOPXMLHelper
 
 } // namespace comphelper
 
diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx
index c1371a3..0911473 100644
--- a/package/source/xstor/xstorage.hxx
+++ b/package/source/xstor/xstorage.hxx
@@ -45,6 +45,7 @@
 #include <com/sun/star/logging/XSimpleLogRing.hpp>
 
 #include <cppuhelper/weak.hxx>
+#include <cppuhelper/weakref.hxx>
 #include <cppuhelper/interfacecontainer.h>
 #include <comphelper/sequenceashashmap.hxx>
 
commit a01a0785e61d230cc8e2fb15cc1936f1fd29458a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 1 17:51:02 2015 +0200

    comphelper: fix MSVC --enable-mergedlibs build
    
    Try not to export the WeakImplHelper symbols as that causes duplicate
    definition errors with the class OSelfTerminateFileStream that
    has the same WeakImplHelper base.
    
    Change-Id: Id41bfed24617113de48c76ab6802b21a8892e66f

diff --git a/include/comphelper/seekableinput.hxx b/include/comphelper/seekableinput.hxx
index bec6ac7..e83c6f1 100644
--- a/include/comphelper/seekableinput.hxx
+++ b/include/comphelper/seekableinput.hxx
@@ -30,8 +30,13 @@
 namespace comphelper
 {
 
-class COMPHELPER_DLLPUBLIC OSeekableInputWrapper : public ::cppu::WeakImplHelper< ::com::sun::star::io::XInputStream,
-                                                                ::com::sun::star::io::XSeekable >
+class SAL_DLLPUBLIC_TEMPLATE OSeekableInputWrapper_BASE
+    : public ::cppu::WeakImplHelper< ::com::sun::star::io::XInputStream,
+                                     ::com::sun::star::io::XSeekable >
+{};
+
+class COMPHELPER_DLLPUBLIC OSeekableInputWrapper
+    : public OSeekableInputWrapper_BASE
 {
     ::osl::Mutex    m_aMutex;
 


More information about the Libreoffice-commits mailing list