[Libreoffice-commits] core.git: include/xmloff xmloff/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Oct 24 11:36:14 UTC 2016


 include/xmloff/txtparae.hxx                   |    6 ------
 include/xmloff/xmlimp.hxx                     |    2 --
 include/xmloff/xmlnumfe.hxx                   |    1 -
 xmloff/source/chart/SchXMLPlotAreaContext.cxx |   11 ++---------
 xmloff/source/chart/SchXMLPlotAreaContext.hxx |    3 ---
 xmloff/source/core/xmlimp.cxx                 |   11 +++--------
 xmloff/source/draw/sdxmlexp.cxx               |   12 +++---------
 xmloff/source/draw/sdxmlexp_impl.hxx          |    2 --
 xmloff/source/style/xmlnumfe.cxx              |   13 ++++---------
 xmloff/source/text/XMLTextNumRuleInfo.cxx     |    2 +-
 xmloff/source/text/XMLTextNumRuleInfo.hxx     |    5 -----
 xmloff/source/text/txtparae.cxx               |    4 ++--
 xmloff/source/transform/MutableAttrList.cxx   |   10 ++--------
 xmloff/source/transform/MutableAttrList.hxx   |    2 --
 xmloff/source/transform/OOo2Oasis.cxx         |    9 ++-------
 xmloff/source/transform/OOo2Oasis.hxx         |    2 --
 xmloff/source/transform/Oasis2OOo.cxx         |    9 ++-------
 xmloff/source/transform/Oasis2OOo.hxx         |    2 --
 18 files changed, 21 insertions(+), 85 deletions(-)

New commits:
commit a41ecf922771904cdebf17b29066389441716b2c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Oct 24 13:35:09 2016 +0200

    loplugin:expandablemethods in xmloff
    
    Change-Id: I995a4167ac4df5ca35d963dcf68ae802a997e1e1

diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index 1c46342..7855fde 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -546,12 +546,6 @@ public:
     {
         exportPageFrames( bIsProgress );
     }
-    void exportFramesBoundToFrame(
-            const css::uno::Reference< css::text::XTextFrame >& rParentTxtFrame,
-            bool bIsProgress )
-    {
-        exportFrameFrames( false, bIsProgress, &rParentTxtFrame );
-    }
     inline const XMLTextListAutoStylePool& GetListAutoStylePool() const;
 
     void SetBlockMode( bool bSet ) { bBlock = bSet; }
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 8ba9695..84e1713 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -256,8 +256,6 @@ public:
 
     virtual ~SvXMLImport() throw() override;
 
-    static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
-
     // css::xml::sax::XDocumentHandler
     virtual void SAL_CALL startDocument()
         throw (css::xml::sax::SAXException,
diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx
index c04b8e4..da27110 100644
--- a/include/xmloff/xmlnumfe.hxx
+++ b/include/xmloff/xmlnumfe.hxx
@@ -56,7 +56,6 @@ private:
 
     SAL_DLLPRIVATE void AddCalendarAttr_Impl( const OUString& rCalendar );
     SAL_DLLPRIVATE void AddStyleAttr_Impl( bool bLong );
-    SAL_DLLPRIVATE void AddTextualAttr_Impl( bool bText );
     SAL_DLLPRIVATE void AddLanguageAttr_Impl( sal_Int32 nLang );
 
     SAL_DLLPRIVATE void AddToTextElement_Impl( const OUString& rString );
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index fe33c1b..48a5a9a 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -666,18 +666,11 @@ SchXMLPositionAttributesHelper::~SchXMLPositionAttributesHelper()
 {
 }
 
-bool SchXMLPositionAttributesHelper::hasSize() const
-{
-    return m_bHasSizeWidth && m_bHasSizeHeight;
-}
-bool SchXMLPositionAttributesHelper::hasPosition() const
-{
-    return m_bHasPositionX && m_bHasPositionY;
-}
 bool SchXMLPositionAttributesHelper::hasPosSize() const
 {
-    return hasPosition() && hasSize();
+    return (m_bHasPositionX && m_bHasPositionY) && (m_bHasSizeWidth && m_bHasSizeHeight);
 }
+
 bool SchXMLPositionAttributesHelper::isAutomatic() const
 {
     return m_bAutoSize || m_bAutoPosition;
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
index 17e1a64..612bdbb 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
@@ -65,9 +65,6 @@ public:
     css::awt::Rectangle getRectangle() const { return css::awt::Rectangle( m_aPosition.X, m_aPosition.Y, m_aSize.Width, m_aSize.Height );}
 
 private:
-    bool hasSize() const;
-    bool hasPosition() const;
-
     SvXMLImport& m_rImport;
 
     css::awt::Point m_aPosition;
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 638b519..efce026 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -456,18 +456,13 @@ namespace
     class theSvXMLImportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSvXMLImportUnoTunnelId> {};
 }
 
-// XUnoTunnel & co
-const uno::Sequence< sal_Int8 > & SvXMLImport::getUnoTunnelId() throw()
-{
-    return theSvXMLImportUnoTunnelId::get().getSeq();
-}
-
 // XUnoTunnel
 sal_Int64 SAL_CALL SvXMLImport::getSomething( const uno::Sequence< sal_Int8 >& rId )
     throw( uno::RuntimeException, std::exception )
 {
-    if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
-                                                         rId.getConstArray(), 16 ) )
+    if( rId.getLength() == 16 &&
+        0 == memcmp( theSvXMLImportUnoTunnelId::get().getSeq().getConstArray(),
+                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
     }
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 1a1726b..c884c84 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -1704,14 +1704,6 @@ void SdXMLExport::ImpWritePresentationStyles()
     }
 }
 
-void SdXMLExport::SetProgress(sal_Int32 nProg)
-{
-    // set progress view
-    if(GetStatusIndicator().is())
-        GetStatusIndicator()->setValue(nProg);
-}
-
-
 void SdXMLExport::ExportMeta_()
 {
     uno::Sequence<beans::NamedValue> stats { { "ObjectCount", uno::makeAny(mnObjectCount) } };
@@ -1745,7 +1737,9 @@ void SdXMLExport::ExportContent_()
     {
         uno::Reference<drawing::XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), uno::UNO_QUERY );
 
-        SetProgress(((nPageInd + 1) * 100) / mnDocDrawPageCount);
+        // set progress view
+        if(GetStatusIndicator().is())
+            GetStatusIndicator()->setValue(((nPageInd + 1) * 100) / mnDocDrawPageCount);
 
         if(xDrawPage.is())
         {
diff --git a/xmloff/source/draw/sdxmlexp_impl.hxx b/xmloff/source/draw/sdxmlexp_impl.hxx
index b4c3ea0..6e13b5c 100644
--- a/xmloff/source/draw/sdxmlexp_impl.hxx
+++ b/xmloff/source/draw/sdxmlexp_impl.hxx
@@ -165,8 +165,6 @@ public:
         bool bIsDraw, SvXMLExportFlags nExportFlags );
     virtual ~SdXMLExport() override;
 
-    void SetProgress(sal_Int32 nProg);
-
     // XExporter
     virtual void SAL_CALL setSourceDocument( const css::uno::Reference< css::lang::XComponent >& xDoc ) throw(css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override;
 
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 3790e79..98b5c46 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -320,14 +320,6 @@ void SvXMLNumFmtExport::AddCalendarAttr_Impl( const OUString& rCalendar )
     }
 }
 
-void SvXMLNumFmtExport::AddTextualAttr_Impl( bool bText )
-{
-    if ( bText )            // non-textual
-    {
-        rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_TEXTUAL, XML_TRUE );
-    }
-}
-
 void SvXMLNumFmtExport::AddStyleAttr_Impl( bool bLong )
 {
     if ( bLong )            // short is default
@@ -436,7 +428,10 @@ void SvXMLNumFmtExport::WriteMonthElement_Impl( const OUString& rCalendar, bool
 
     AddCalendarAttr_Impl( rCalendar ); // adds to pAttrList
     AddStyleAttr_Impl( bLong );     // adds to pAttrList
-    AddTextualAttr_Impl( bText );   // adds to pAttrList
+    if ( bText )
+    {
+        rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_TEXTUAL, XML_TRUE );
+    }
 
     SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_MONTH,
                               true, false );
diff --git a/xmloff/source/text/XMLTextNumRuleInfo.cxx b/xmloff/source/text/XMLTextNumRuleInfo.cxx
index e5503ae..3e4836f 100644
--- a/xmloff/source/text/XMLTextNumRuleInfo.cxx
+++ b/xmloff/source/text/XMLTextNumRuleInfo.cxx
@@ -226,7 +226,7 @@ bool XMLTextNumRuleInfo::BelongsToSameList( const XMLTextNumRuleInfo& rCmp ) con
     }
     else
     {
-        bRet = HasSameNumRules( rCmp );
+        bRet = rCmp.msNumRulesName == msNumRulesName;
     }
 
     return bRet;
diff --git a/xmloff/source/text/XMLTextNumRuleInfo.hxx b/xmloff/source/text/XMLTextNumRuleInfo.hxx
index b898bb9..ff5b907 100644
--- a/xmloff/source/text/XMLTextNumRuleInfo.hxx
+++ b/xmloff/source/text/XMLTextNumRuleInfo.hxx
@@ -120,11 +120,6 @@ public:
 
     bool BelongsToSameList( const XMLTextNumRuleInfo& rCmp ) const;
 
-    inline bool HasSameNumRules( const XMLTextNumRuleInfo& rCmp ) const
-    {
-        return rCmp.msNumRulesName == msNumRulesName;
-    }
-
     inline bool IsContinueingPreviousSubTree() const
     {
         return mbContinueingPreviousSubTree;
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 12538b1..e7e1a11 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2925,8 +2925,8 @@ void XMLTextParagraphExport::_exportTextFrame(
         SvXMLElementExport aElement( GetExport(), XML_NAMESPACE_DRAW,
                                   XML_TEXT_BOX, true, true );
 
-        // frame bound frames
-        exportFramesBoundToFrame( xTxtFrame, bIsProgress );
+        // frames bound to frame
+        exportFrameFrames( false, bIsProgress, &xTxtFrame );
 
         exportText( xTxt, false, bIsProgress, true );
     }
diff --git a/xmloff/source/transform/MutableAttrList.cxx b/xmloff/source/transform/MutableAttrList.cxx
index d6b9829..a020147 100644
--- a/xmloff/source/transform/MutableAttrList.cxx
+++ b/xmloff/source/transform/MutableAttrList.cxx
@@ -68,20 +68,14 @@ namespace
     class theXMLMutableAttributeListUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theXMLMutableAttributeListUnoTunnelId> {};
 }
 
-// XUnoTunnel & co
-const Sequence< sal_Int8 > & XMLMutableAttributeList::getUnoTunnelId() throw()
-{
-    return theXMLMutableAttributeListUnoTunnelId::get().getSeq();
-}
-
 // XUnoTunnel
 sal_Int64 SAL_CALL XMLMutableAttributeList::getSomething(
         const Sequence< sal_Int8 >& rId )
     throw( RuntimeException, std::exception )
 {
     if( rId.getLength() == 16 &&
-        0 == memcmp( getUnoTunnelId().getConstArray(),
-                                rId.getConstArray(), 16 ) )
+        0 == memcmp( theXMLMutableAttributeListUnoTunnelId::get().getSeq().getConstArray(),
+                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
     }
diff --git a/xmloff/source/transform/MutableAttrList.hxx b/xmloff/source/transform/MutableAttrList.hxx
index 93046c4..f5df316 100644
--- a/xmloff/source/transform/MutableAttrList.hxx
+++ b/xmloff/source/transform/MutableAttrList.hxx
@@ -46,8 +46,6 @@ public:
            bool bClone=false );
     virtual ~XMLMutableAttributeList() override;
 
-    static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
-
     // XUnoTunnel
     virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) throw(css::uno::RuntimeException, std::exception) override;
 
diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index 3ea21c5..b8703cd 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -1973,18 +1973,13 @@ namespace
     class theOOo2OasisTransformerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOOo2OasisTransformerUnoTunnelId> {};
 }
 
-const Sequence< sal_Int8 > & OOo2OasisTransformer::getUnoTunnelId() throw()
-{
-    return theOOo2OasisTransformerUnoTunnelId::get().getSeq();
-}
-
 // XUnoTunnel
 sal_Int64 SAL_CALL OOo2OasisTransformer::getSomething( const Sequence< sal_Int8 >& rId )
     throw(RuntimeException, std::exception)
 {
     if( rId.getLength() == 16
-        && 0 == memcmp( getUnoTunnelId().getConstArray(),
-                                        rId.getConstArray(), 16 ) )
+        && 0 == memcmp( theOOo2OasisTransformerUnoTunnelId::get().getSeq().getConstArray(),
+                        rId.getConstArray(), 16 ) )
     {
         return reinterpret_cast< sal_Int64 >( this );
     }
diff --git a/xmloff/source/transform/OOo2Oasis.hxx b/xmloff/source/transform/OOo2Oasis.hxx
index 1dbd82c..f355cac 100644
--- a/xmloff/source/transform/OOo2Oasis.hxx
+++ b/xmloff/source/transform/OOo2Oasis.hxx
@@ -51,8 +51,6 @@ public:
                           const sal_Char *pSubServiceName=nullptr ) throw();
     virtual ~OOo2OasisTransformer() throw() override;
 
-    static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
-
     // XInterface
 
     // (XInterface methods need to be implemented to disambigouate
diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx
index 87c898d..8e073c8 100644
--- a/xmloff/source/transform/Oasis2OOo.cxx
+++ b/xmloff/source/transform/Oasis2OOo.cxx
@@ -1954,18 +1954,13 @@ namespace
     class theOasis2OOoTransformerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOasis2OOoTransformerUnoTunnelId> {};
 }
 
-const Sequence< sal_Int8 > & Oasis2OOoTransformer::getUnoTunnelId() throw()
-{
-    return theOasis2OOoTransformerUnoTunnelId::get().getSeq();
-}
-
 // XUnoTunnel
 sal_Int64 SAL_CALL Oasis2OOoTransformer::getSomething( const Sequence< sal_Int8 >& rId )
     throw(RuntimeException, std::exception)
 {
     if( rId.getLength() == 16
-        && 0 == memcmp( getUnoTunnelId().getConstArray(),
-                                        rId.getConstArray(), 16 ) )
+        && 0 == memcmp( theOasis2OOoTransformerUnoTunnelId::get().getSeq().getConstArray(),
+                        rId.getConstArray(), 16 ) )
     {
         return reinterpret_cast< sal_Int64 >( this );
     }
diff --git a/xmloff/source/transform/Oasis2OOo.hxx b/xmloff/source/transform/Oasis2OOo.hxx
index 19adc51..2dd8802 100644
--- a/xmloff/source/transform/Oasis2OOo.hxx
+++ b/xmloff/source/transform/Oasis2OOo.hxx
@@ -44,8 +44,6 @@ public:
     Oasis2OOoTransformer () throw();
     virtual ~Oasis2OOoTransformer() throw() override;
 
-    static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
-
     // XServiceInfo
     virtual OUString SAL_CALL getImplementationName(  ) throw(css::uno::RuntimeException, std::exception) override;
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override;


More information about the Libreoffice-commits mailing list