[Libreoffice-commits] core.git: basctl/source connectivity/source dbaccess/source forms/source include/rtl oox/source sal/qa sc/source sw/source

Stephan Bergmann sbergman at redhat.com
Thu Jan 5 12:52:53 UTC 2017


 basctl/source/basicide/baside2b.cxx               |    4 ++--
 connectivity/source/commontools/filtermanager.cxx |    4 ++--
 dbaccess/source/core/inc/composertools.hxx        |    2 +-
 forms/source/xforms/model_ui.cxx                  |    2 +-
 include/rtl/strbuf.hxx                            |    2 +-
 include/rtl/ustrbuf.hxx                           |    2 +-
 oox/source/export/vmlexport.cxx                   |    2 +-
 sal/qa/OStringBuffer/rtl_OStringBuffer.cxx        |    2 +-
 sc/source/filter/html/htmlpars.cxx                |    2 +-
 sw/source/filter/ww8/rtfsdrexport.cxx             |    2 +-
 10 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit c03d803a723e3325b210346126115457e914f605
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jan 5 13:52:17 2017 +0100

    Replace side-effect--only uses of makeStringAndClear() with setLength(0)
    
    Change-Id: Iaf8011f1bd6a10b324653899b7f51458f7d0b68a

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index a8c6d9f..0468e12 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -2736,7 +2736,7 @@ void CodeCompleteListBox::KeyInput( const KeyEvent& rKeyEvt )
 
                     if( !aTabInsertedStr.isEmpty() && aTabInsertedStr != aFuncBuffer.toString() )
                     {
-                        aFuncBuffer.makeStringAndClear();
+                        aFuncBuffer.setLength(0);
                         aFuncBuffer = aFuncBuffer.append(aTabInsertedStr);
                     }
                     aFuncBuffer = aFuncBuffer.remove(aFuncBuffer.getLength()-1, 1);
@@ -2799,7 +2799,7 @@ void CodeCompleteWindow::InsertEntry( const OUString& aStr )
 void CodeCompleteWindow::ClearListBox()
 {
     pListBox->Clear();
-    pListBox->aFuncBuffer.makeStringAndClear();
+    pListBox->aFuncBuffer.setLength(0);
 }
 
 void CodeCompleteWindow::SetTextSelection( const TextSelection& aSel )
diff --git a/connectivity/source/commontools/filtermanager.cxx b/connectivity/source/commontools/filtermanager.cxx
index 6296e2c..63fe39c 100644
--- a/connectivity/source/commontools/filtermanager.cxx
+++ b/connectivity/source/commontools/filtermanager.cxx
@@ -130,13 +130,13 @@ namespace dbtools
             else if (!m_aLinkFilterComponent.isEmpty())
                 o_singleComponent = m_aLinkFilterComponent;
             else
-                o_singleComponent.makeStringAndClear();
+                o_singleComponent.setLength(0);
             return true;
         }
         else
         {
             if (m_aLinkFilterComponent.isEmpty())
-                o_singleComponent.makeStringAndClear();
+                o_singleComponent.setLength(0);
             else
                 o_singleComponent = m_aLinkFilterComponent;
             return true;
diff --git a/dbaccess/source/core/inc/composertools.hxx b/dbaccess/source/core/inc/composertools.hxx
index 9b1a4de..b118783 100644
--- a/dbaccess/source/core/inc/composertools.hxx
+++ b/dbaccess/source/core/inc/composertools.hxx
@@ -53,7 +53,7 @@ namespace dbaccess
             #ifdef DBG_UTIL
             m_bUsed = false;
             #endif
-            m_aBuffer.makeStringAndClear();
+            m_aBuffer.setLength(0);
         }
 
     public:
diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx
index f8f5784c..5b75be5 100644
--- a/forms/source/xforms/model_ui.cxx
+++ b/forms/source/xforms/model_ui.cxx
@@ -242,7 +242,7 @@ OUString Model::getDefaultBindingExpressionForNode(
             // unknown type? fail!
             OSL_FAIL( "unknown node type!" );
             xCurrent.set( nullptr );
-            aBuffer.makeStringAndClear();
+            aBuffer.setLength(0);
             // we'll remove the slash below
             aBuffer.insert( 0, '/' );
             break;
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index 90bf41b..8c9148b 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -301,7 +301,7 @@ public:
 
         @return the string previously contained in the buffer.
      */
-    OString makeStringAndClear()
+    SAL_WARN_UNUSED_RESULT OString makeStringAndClear()
     {
         OString aRet( pData );
         rtl_string_new(&pData);
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 7a9448d..4665d20 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -336,7 +336,7 @@ public:
 
         @return the string previously contained in the buffer.
      */
-    OUString makeStringAndClear()
+    SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
     {
         return OUString(
                   rtl_uStringBuffer_makeStringAndClear( &pData, &nCapacity ),
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 11035f2..c284b55 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -101,7 +101,7 @@ void VMLExport::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance )
         m_pShapeAttrList = FastSerializerHelper::createAttrList();
 
         if ( !m_pShapeStyle->isEmpty() )
-            m_pShapeStyle->makeStringAndClear();
+            m_pShapeStyle->setLength(0);
 
         m_pShapeStyle->ensureCapacity( 200 );
 
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
index 1706763..216730f 100644
--- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
+++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
@@ -132,7 +132,7 @@ namespace rtl_OStringBuffer
 
         void ctor_005() {
             rtl::OStringBuffer b1;
-            b1.makeStringAndClear();
+            (void)b1.makeStringAndClear();
             rtl::OStringBuffer b2(b1);
             (void)b2;
         }
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index ec6ef25..6b46e14 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -3031,7 +3031,7 @@ void ScHTMLQueryParser::MetaOn( const ImportInfo& rInfo )
 void ScHTMLQueryParser::TitleOn( const ImportInfo& /*rInfo*/ )
 {
     mbTitleOn = true;
-    maTitle.makeStringAndClear();
+    maTitle.setLength(0);
 }
 
 void ScHTMLQueryParser::TitleOff( const ImportInfo& rInfo )
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 838591a..4397dff 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -61,7 +61,7 @@ void RtfSdrExport::OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance)
     {
         m_nShapeType = ESCHER_ShpInst_Nil;
         if (!m_aShapeStyle.isEmpty())
-            m_aShapeStyle.makeStringAndClear();
+            m_aShapeStyle.setLength(0);
         m_aShapeStyle.ensureCapacity(200);
         m_aShapeProps.clear();
     }


More information about the Libreoffice-commits mailing list