[Libreoffice-commits] core.git: 4 commits - cui/source dbaccess/source hwpfilter/source jvmfwk/plugins reportdesign/source rsc/source sal/osl sal/qa sd/inc sd/source starmath/inc starmath/source sw/source vcl/headless vcl/inc vcl/unx

Caolán McNamara caolanm at redhat.com
Mon Mar 2 06:22:34 PST 2015


 cui/source/dialogs/about.cxx                     |    2 +-
 dbaccess/source/ui/inc/UITools.hxx               |    2 +-
 dbaccess/source/ui/misc/UITools.cxx              |    2 +-
 hwpfilter/source/hwpreader.cxx                   |   10 +++++-----
 jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx |    2 +-
 reportdesign/source/ui/inc/SectionWindow.hxx     |    4 ++--
 reportdesign/source/ui/report/SectionWindow.cxx  |    4 ++--
 rsc/source/rscpp/cpp3.c                          |    2 +-
 sal/osl/w32/profile.cxx                          |    4 ++--
 sal/osl/w32/security.c                           |   15 +++++++--------
 sal/qa/OStringBuffer/rtl_OStringBuffer.cxx       |    2 +-
 sd/inc/sdabstdlg.hxx                             |    2 +-
 sd/source/ui/dlg/sddlgfact.cxx                   |    2 +-
 sd/source/ui/dlg/sddlgfact.hxx                   |    2 +-
 starmath/inc/visitors.hxx                        |    2 +-
 starmath/source/visitors.cxx                     |    6 +++---
 sw/source/filter/ww8/attributeoutputbase.hxx     |    2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx     |    2 +-
 sw/source/filter/ww8/docxattributeoutput.hxx     |    2 +-
 sw/source/filter/ww8/rtfattributeoutput.cxx      |    2 +-
 sw/source/filter/ww8/rtfattributeoutput.hxx      |    2 +-
 sw/source/filter/ww8/wrtw8sty.cxx                |    2 +-
 sw/source/filter/ww8/ww8attributeoutput.hxx      |    2 +-
 sw/source/filter/ww8/ww8par.hxx                  |    2 +-
 sw/source/filter/ww8/ww8par5.cxx                 |    4 ++--
 vcl/headless/svptextrender.cxx                   |   10 ++--------
 vcl/inc/cairotextrender.hxx                      |    2 +-
 vcl/unx/generic/gdi/cairotextrender.cxx          |   14 ++++++--------
 vcl/unx/generic/gdi/openglx11cairotextrender.cxx |    8 ++++++--
 vcl/unx/generic/gdi/openglx11cairotextrender.hxx |    2 +-
 vcl/unx/generic/gdi/x11cairotextrender.cxx       |    9 +++++++--
 vcl/unx/generic/gdi/x11cairotextrender.hxx       |    2 +-
 32 files changed, 65 insertions(+), 65 deletions(-)

New commits:
commit d5da8959c607d11d257187ef15f7d89fa8420ba1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 2 14:00:20 2015 +0000

    simplify this
    
    Change-Id: I7ede799978f29e7708bf3386199de73049427d06

diff --git a/vcl/headless/svptextrender.cxx b/vcl/headless/svptextrender.cxx
index d28de18..334c341 100644
--- a/vcl/headless/svptextrender.cxx
+++ b/vcl/headless/svptextrender.cxx
@@ -85,20 +85,14 @@ namespace
             m_pSvpGlyphPeer = new SvpGlyphPeer();
             m_pSvpGlyphCache = new SvpGlyphCache( *m_pSvpGlyphPeer );
         }
-        void release()
-        {
-            delete m_pSvpGlyphCache;
-            delete m_pSvpGlyphPeer;
-            m_pSvpGlyphCache = NULL;
-            m_pSvpGlyphPeer = NULL;
-        }
         SvpGlyphCache& getGlyphCache()
         {
             return *m_pSvpGlyphCache;
         }
         ~GlyphCacheHolder()
         {
-            release();
+            delete m_pSvpGlyphCache;
+            delete m_pSvpGlyphPeer;
         }
     };
 
commit f040c43a62b01ad3a3094abdf22153e93e2caef7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 2 11:42:31 2015 +0000

    tweak to return a cairo_context instead of a cairo_surface
    
    Change-Id: Ifd5c9b1c2cc1561d9ca5dfd70ab7c3c74a1af216

diff --git a/vcl/inc/cairotextrender.hxx b/vcl/inc/cairotextrender.hxx
index fce14aa..ff4f7e4 100644
--- a/vcl/inc/cairotextrender.hxx
+++ b/vcl/inc/cairotextrender.hxx
@@ -79,7 +79,7 @@ class CairoTextRender : public TextRenderImpl
 
 protected:
     virtual GlyphCache&         getPlatformGlyphCache() = 0;
-    virtual cairo_surface_t*    getCairoSurface() = 0;
+    virtual cairo_t*            getCairoContext() = 0;
     virtual void                getSurfaceOffset(double& nDX, double& nDY) = 0;
     virtual void                drawSurface(cairo_t* cr) = 0;
 
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index edc0c02..0445771 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -199,20 +199,18 @@ void CairoTextRender::DrawServerFontLayout( const ServerFontLayout& rLayout )
     if (cairo_glyphs.empty())
         return;
 
-    cairo_surface_t *surface = getCairoSurface();
-
-    DBG_ASSERT( surface!=NULL, "no cairo surface for text" );
-    if( !surface )
-        return;
-
     /*
      * It might be ideal to cache surface and cairo context between calls and
      * only destroy it when the drawable changes, but to do that we need to at
      * least change the SalFrame etc impls to dtor the SalGraphics *before* the
      * destruction of the windows they reference
     */
-    cairo_t *cr = cairo_create(surface);
-    cairo_surface_destroy(surface);
+    cairo_t *cr = getCairoContext();
+    if (!cr)
+    {
+        SAL_WARN("vcl", "no cairo context for text");
+        return;
+    }
 
     if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions())
         cairo_set_font_options(cr, static_cast<const cairo_font_options_t*>(pOptions));
diff --git a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx
index 57cae49..8edeba8 100644
--- a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx
@@ -20,7 +20,7 @@ OpenGLX11CairoTextRender::OpenGLX11CairoTextRender(X11SalGraphics& rParent)
 {
 }
 
-cairo_surface_t* OpenGLX11CairoTextRender::getCairoSurface()
+cairo_t* OpenGLX11CairoTextRender::getCairoContext()
 {
     // static size_t id = 0;
     // OString aFileName = OString("/tmp/libo_logs/text_rendering") + OString::number(id++) + OString(".svg");
@@ -37,7 +37,11 @@ cairo_surface_t* OpenGLX11CairoTextRender::getCairoSurface()
         }
         surface = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, aClipRect.GetWidth(), aClipRect.GetHeight() );
     }
-    return surface;
+    if (!surface)
+        return NULL;
+    cairo_t *cr = cairo_create(surface);
+    cairo_surface_destroy(surface);
+    return cr;
 }
 
 void OpenGLX11CairoTextRender::getSurfaceOffset( double& nDX, double& nDY )
diff --git a/vcl/unx/generic/gdi/openglx11cairotextrender.hxx b/vcl/unx/generic/gdi/openglx11cairotextrender.hxx
index 7336021..ed2b79c 100644
--- a/vcl/unx/generic/gdi/openglx11cairotextrender.hxx
+++ b/vcl/unx/generic/gdi/openglx11cairotextrender.hxx
@@ -17,7 +17,7 @@ class OpenGLX11CairoTextRender : public X11CairoTextRender
 public:
     OpenGLX11CairoTextRender(X11SalGraphics& rParent);
 
-    virtual cairo_surface_t* getCairoSurface() SAL_OVERRIDE;
+    virtual cairo_t* getCairoContext() SAL_OVERRIDE;
     virtual void getSurfaceOffset(double& nDX, double& nDY) SAL_OVERRIDE;
     virtual void drawSurface(cairo_t* cr) SAL_OVERRIDE;
 };
diff --git a/vcl/unx/generic/gdi/x11cairotextrender.cxx b/vcl/unx/generic/gdi/x11cairotextrender.cxx
index 30549ba..b6187c8 100644
--- a/vcl/unx/generic/gdi/x11cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/x11cairotextrender.cxx
@@ -52,7 +52,7 @@ GlyphCache& X11CairoTextRender::getPlatformGlyphCache()
     return X11GlyphCache::GetInstance();
 }
 
-cairo_surface_t* X11CairoTextRender::getCairoSurface()
+cairo_t* X11CairoTextRender::getCairoContext()
 {
     // find a XRenderPictFormat compatible with the Drawable
     XRenderPictFormat* pVisualFormat = mrParent.GetXRenderFormat();
@@ -73,7 +73,12 @@ cairo_surface_t* X11CairoTextRender::getCairoSurface()
             mrParent.GetVisual().visual, SAL_MAX_INT16, SAL_MAX_INT16);
     }
 
-    return surface;
+    if (!surface)
+        return NULL;
+
+    cairo_t *cr = cairo_create(surface);
+    cairo_surface_destroy(surface);
+    return cr;
 }
 
 void X11CairoTextRender::getSurfaceOffset( double& nDX, double& nDY )
diff --git a/vcl/unx/generic/gdi/x11cairotextrender.hxx b/vcl/unx/generic/gdi/x11cairotextrender.hxx
index 28470c39..b029702 100644
--- a/vcl/unx/generic/gdi/x11cairotextrender.hxx
+++ b/vcl/unx/generic/gdi/x11cairotextrender.hxx
@@ -40,7 +40,7 @@ public:
     X11CairoTextRender(X11SalGraphics& rParent);
 
     virtual GlyphCache& getPlatformGlyphCache() SAL_OVERRIDE;
-    virtual cairo_surface_t* getCairoSurface() SAL_OVERRIDE;
+    virtual cairo_t* getCairoContext() SAL_OVERRIDE;
     virtual void getSurfaceOffset(double& nDX, double& nDY) SAL_OVERRIDE;
     virtual void clipRegion(cairo_t* cr) SAL_OVERRIDE;
     virtual void drawSurface(cairo_t* cr) SAL_OVERRIDE;
commit 95493cd49f4a80624220c2be6a787b7531f60b8e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 2 11:27:49 2015 +0000

    V813: Decreased performance
    
    Change-Id: I6a988077a3a2e2adf33a2c00a84b929e8133133f

diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx
index b828f20..8180847 100644
--- a/dbaccess/source/ui/inc/UITools.hxx
+++ b/dbaccess/source/ui/inc/UITools.hxx
@@ -222,7 +222,7 @@ namespace dbaui
     */
     void notifySystemWindow(vcl::Window* _pWindow,
                             vcl::Window* _pToRegister,
-                            ::comphelper::mem_fun1_t<TaskPaneList,vcl::Window*> _rMemFunc);
+                            const ::comphelper::mem_fun1_t<TaskPaneList,vcl::Window*>& _rMemFunc);
 
     /** adjustToolBoxSize checks if the size of the ToolBox is still valid. If not it will be resized.
         @param  _pToolBox
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index f83050c..b51ae0b 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -956,7 +956,7 @@ bool appendToFilter(const Reference<XConnection>& _xConnection,
     return bRet;
 }
 
-void notifySystemWindow(vcl::Window* _pWindow, vcl::Window* _pToRegister, ::comphelper::mem_fun1_t<TaskPaneList,vcl::Window*> _rMemFunc)
+void notifySystemWindow(vcl::Window* _pWindow, vcl::Window* _pToRegister, const ::comphelper::mem_fun1_t<TaskPaneList,vcl::Window*>& _rMemFunc)
 {
     OSL_ENSURE(_pWindow,"Window can not be null!");
     SystemWindow* pSystemWindow = _pWindow ? _pWindow->GetSystemWindow() : NULL;
diff --git a/reportdesign/source/ui/inc/SectionWindow.hxx b/reportdesign/source/ui/inc/SectionWindow.hxx
index 78890d5..79e184c 100644
--- a/reportdesign/source/ui/inc/SectionWindow.hxx
+++ b/reportdesign/source/ui/inc/SectionWindow.hxx
@@ -67,7 +67,7 @@ namespace rptui
         * \param _pIsSectionOn
         * @return sal_True when title was set otherwise FALSE
         */
-        bool setGroupSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup,sal_uInt16 _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<bool, OGroupHelper> _pIsSectionOn);
+        bool setGroupSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup,sal_uInt16 _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> _pGetSection, const ::std::mem_fun_t<bool, OGroupHelper>& _pIsSectionOn);
 
         /** set the title of the (report/page) header or footer
         *
@@ -77,7 +77,7 @@ namespace rptui
         * \param _pIsSectionOn
         * @return sal_True when title was set otherwise FALSE
         */
-        bool setReportSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,sal_uInt16 _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t<bool, OReportHelper> _pIsSectionOn);
+        bool setReportSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,sal_uInt16 _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> _pGetSection, const ::std::mem_fun_t<bool, OReportHelper>& _pIsSectionOn);
         void ImplInitSettings();
 
         DECL_LINK(Collapsed,OColorListener*);
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index 9cfc174..b3c50f1 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -157,7 +157,7 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
     }
 }
 
-bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReportDefinition>& _xReport,sal_uInt16 _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t<bool,OReportHelper> _pIsSectionOn)
+bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReportDefinition>& _xReport,sal_uInt16 _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OReportHelper> _pGetSection, const ::std::mem_fun_t<bool,OReportHelper>& _pIsSectionOn)
 {
     OReportHelper aReportHelper(_xReport);
     const bool bRet = _pIsSectionOn(&aReportHelper) && _pGetSection(&aReportHelper) == m_aReportSection.getSection();
@@ -170,7 +170,7 @@ bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReport
     return bRet;
 }
 
-bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,sal_uInt16 _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<bool,OGroupHelper> _pIsSectionOn)
+bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,sal_uInt16 _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> _pGetSection, const ::std::mem_fun_t<bool,OGroupHelper>& _pIsSectionOn)
 {
     OGroupHelper aGroupHelper(_xGroup);
     const bool bRet = _pIsSectionOn(&aGroupHelper) && _pGetSection(&aGroupHelper) == m_aReportSection.getSection() ;
diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 2c7932c..a2391f7 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -189,7 +189,7 @@ public:
     virtual AbstractSdStartPresDlg*     CreateSdStartPresentationDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs,
                                                                      const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ) = 0;
     virtual VclAbstractDialog*          CreateRemoteDialog( vcl::Window* pWindow ) = 0;
-    virtual SfxAbstractTabDialog*       CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, SdResId DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool ) = 0;
+    virtual SfxAbstractTabDialog*       CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool ) = 0;
     virtual AbstractSdPresLayoutDlg*    CreateSdPresLayoutDlg( ::sd::DrawDocShell* pDocShell, vcl::Window* pWindow, const SfxItemSet& rInAttrs) = 0;
     virtual SfxAbstractTabDialog*       CreateSdTabTemplateDlg( vcl::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) = 0;
     virtual SfxAbstractDialog*          CreatSdActionDialog( vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView ) = 0;
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index b6103aec..8e5c87a 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -460,7 +460,7 @@ VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Windo
      return new SdVclAbstractDialog_Impl( new ::sd::RemoteDialog( pWindow ) );
 }
 
-SfxAbstractTabDialog *  SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, SdResId DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool )
+SfxAbstractTabDialog *  SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool )
 {
     return new SdPresLayoutTemplateDlg_Impl( new SdPresLayoutTemplateDlg( pDocSh, pParent, DlgId, rStyleBase, ePO, pSSPool ) );
 }
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 2c599a0..38d6d1e 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -248,7 +248,7 @@ public:
     virtual AbstractSdStartPresDlg*     CreateSdStartPresentationDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs,
                                                                      const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ) SAL_OVERRIDE;
     virtual VclAbstractDialog*          CreateRemoteDialog( vcl::Window* pWindow ) SAL_OVERRIDE; // ad for RemoteDialog
-    virtual SfxAbstractTabDialog*       CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, SdResId DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool ) SAL_OVERRIDE;
+    virtual SfxAbstractTabDialog*       CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool ) SAL_OVERRIDE;
     virtual AbstractSdPresLayoutDlg*    CreateSdPresLayoutDlg( ::sd::DrawDocShell* pDocShell, vcl::Window* pWindow, const SfxItemSet& rInAttrs) SAL_OVERRIDE;
     virtual SfxAbstractTabDialog*       CreateSdTabTemplateDlg( vcl::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) SAL_OVERRIDE;
     virtual SfxAbstractDialog*          CreatSdActionDialog( vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView ) SAL_OVERRIDE;
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index cdb6595..5ae1277 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -397,7 +397,7 @@ private:
     /** The current area that is selected */
     Rectangle aSelectionArea;
     /** Extend the area that must be selected  */
-    void ExtendSelectionArea( Rectangle aArea );
+    void ExtendSelectionArea(const Rectangle& rArea);
     /** Default visiting method */
     void DefaultVisit( SmNode* pNode ) SAL_OVERRIDE;
     /** Visit the children of a given pNode */
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 40e3667..ed1cf97 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -1900,13 +1900,13 @@ SmSelectionDrawingVisitor::SmSelectionDrawingVisitor( OutputDevice& rDevice, SmN
     }
 }
 
-void SmSelectionDrawingVisitor::ExtendSelectionArea( Rectangle aArea )
+void SmSelectionDrawingVisitor::ExtendSelectionArea(const Rectangle& rArea)
 {
     if ( ! bHasSelectionArea ) {
-        aSelectionArea = aArea;
+        aSelectionArea = rArea;
         bHasSelectionArea = true;
     } else
-        aSelectionArea.Union( aArea );
+        aSelectionArea.Union(rArea);
 }
 
 void SmSelectionDrawingVisitor::DefaultVisit( SmNode* pNode )
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 1b3d555..5b8d268 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -329,7 +329,7 @@ public:
 
     /// The style of the page numbers.
     ///
-    virtual void SectionPageNumbering( sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber ) = 0;
+    virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::boost::optional<sal_uInt16>& oPageRestartNumber ) = 0;
 
     /// The type of breaking.
     virtual void SectionType( sal_uInt8 nBreakCode ) = 0;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index cdd9a69..36615b31 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5597,7 +5597,7 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut
 }
 
 
-void DocxAttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber )
+void DocxAttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, const ::boost::optional<sal_uInt16>& oPageRestartNumber )
 {
     // FIXME Not called properly with page styles like "First Page"
 
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index d0ddd2f..1b80c8f 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -315,7 +315,7 @@ public:
 
     /// The style of the page numbers.
     ///
-    virtual void SectionPageNumbering( sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber ) SAL_OVERRIDE;
+    virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::boost::optional<sal_uInt16>& oPageRestartNumber ) SAL_OVERRIDE;
 
     /// The type of breaking.
     virtual void SectionType( sal_uInt8 nBreakCode ) SAL_OVERRIDE;
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index d65c450..191bff0 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1163,7 +1163,7 @@ void RtfAttributeOutput::SectionBiDi(bool bBiDi)
     m_rExport.Strm().WriteCharPtr((bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT));
 }
 
-void RtfAttributeOutput::SectionPageNumbering(sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber)
+void RtfAttributeOutput::SectionPageNumbering(sal_uInt16 nNumType, const ::boost::optional<sal_uInt16>& oPageRestartNumber)
 {
     if (oPageRestartNumber)
     {
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index a056849..67fca71 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -184,7 +184,7 @@ public:
 
     /// The style of the page numbers.
     ///
-    virtual void SectionPageNumbering(sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber) SAL_OVERRIDE;
+    virtual void SectionPageNumbering(sal_uInt16 nNumType, const ::boost::optional<sal_uInt16>& oPageRestartNumber) SAL_OVERRIDE;
 
     /// The type of breaking.
     virtual void SectionType(sal_uInt8 nBreakCode) SAL_OVERRIDE;
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index c54fd45..cad77ac 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1507,7 +1507,7 @@ void WW8AttributeOutput::SectionBiDi( bool bBiDi )
     }
 }
 
-void WW8AttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber )
+void WW8AttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, const ::boost::optional<sal_uInt16>& oPageRestartNumber )
 {
     // sprmSNfcPgn
     sal_uInt8 nb = WW8Export::GetNumId( nNumType );
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index 8e7041b..5b92a0f 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -173,7 +173,7 @@ public:
 
     /// The style of the page numbers.
     ///
-    virtual void SectionPageNumbering( sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber ) SAL_OVERRIDE;
+    virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::boost::optional<sal_uInt16>& oPageRestartNumber ) SAL_OVERRIDE;
 
     /// The type of breaking.
     virtual void SectionType( sal_uInt8 nBreakCode ) SAL_OVERRIDE;
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index af6301d..df39a7f 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -895,7 +895,7 @@ public:
     bool CurrentSectionIsProtected() const;
     void PrependedInlineNode(const SwPosition &rPos, const SwNode &rNode);
     sal_uInt16 CurrentSectionColCount() const;
-    bool WillHavePageDescHere(SwNodeIndex aIdx) const;
+    bool WillHavePageDescHere(const SwNodeIndex& rIdx) const;
     void CreateSep(const long nTxtPos, bool bMustHaveBreak);
     void InsertSegments();
     void JoinNode(const SwPosition &rPos, const SwNode &rNode);
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 9e028e2..ebd0949 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2786,13 +2786,13 @@ sal_uInt16 wwSectionManager::CurrentSectionColCount() const
 
 //Will there be a new pagebreak at this position (don't know what type
 //until later)
-bool wwSectionManager::WillHavePageDescHere(SwNodeIndex aIdx) const
+bool wwSectionManager::WillHavePageDescHere(const SwNodeIndex& rIdx) const
 {
     bool bRet = false;
     if (!maSegments.empty())
     {
         if (!maSegments.back().IsContinuous() &&
-            maSegments.back().maStart == aIdx)
+            maSegments.back().maStart == rIdx)
         {
             bRet = true;
         }
commit ab86a53623c9bf5d3abc7149aa85d0e0c8d7fd98
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 2 11:07:39 2015 +0000

    V805: Decreased performance
    
    Change-Id: I822c5ebc321ebda87c238a1781a31793c1623e34

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 45242d3..0134af7 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -273,7 +273,7 @@ OUString AboutDialog::GetVersionString()
         sVersion += m_sBuildStr.replaceAll("$BUILDID", sBuildId);
     }
 
-    if (strlen(EXTRA_BUILDID) > 0)
+    if (EXTRA_BUILDID[0] != '\0')
     {
         sVersion += "\n" EXTRA_BUILDID;
     }
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 484926e..c40110e 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -3703,13 +3703,13 @@ void HwpReader::makeHyperText(TxtBox * hbox)
     HyperText *hypert = hwpfile.GetHyperText();
      if( !hypert ) return;
 
-    if( strlen(reinterpret_cast<char *>(hypert->filename)) > 0 ){
-              ::std::string const tmp = hstr2ksstr(hypert->bookmark);
-              ::std::string const tmp2 = hstr2ksstr(kstr2hstr(
+    if (hypert->filename[0] != '\0') {
+          ::std::string const tmp = hstr2ksstr(hypert->bookmark);
+          ::std::string const tmp2 = hstr2ksstr(kstr2hstr(
 #ifdef _WIN32
-                  (uchar *) urltowin((char *)hypert->filename).c_str()).c_str());
+              (uchar *) urltowin((char *)hypert->filename).c_str()).c_str());
 #else
-                  reinterpret_cast<uchar const *>(urltounix(reinterpret_cast<char *>(hypert->filename)).c_str())).c_str());
+              reinterpret_cast<uchar const *>(urltounix(reinterpret_cast<char *>(hypert->filename)).c_str())).c_str());
 #endif
           padd("xlink:type", sXML_CDATA, "simple");
           if (tmp.size() > 0 && strcmp(tmp.c_str(), "[HTML]")) {
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index 208ff68..f2f2ae0 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -60,7 +60,7 @@ SunVersion::SunVersion(const char * szVer):
  */
 bool SunVersion::init(const char *szVersion)
 {
-    if ( ! szVersion || strlen(szVersion) == 0)
+    if (!szVersion || szVersion[0] == '\0')
         return false;
 
     //first get the major,minor,maintenance
diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c
index ab3eea1..9c4ae29 100644
--- a/rsc/source/rscpp/cpp3.c
+++ b/rsc/source/rscpp/cpp3.c
@@ -349,7 +349,7 @@ int readoptions(char* filename, char*** pfargv)
             else
             {
                 *poptbuff = EOS;
-                if (strlen(optbuff)>0)
+                if (optbuff[0] != '\0')
                 {
                     pfa[fargc + 1] = strdup(optbuff);
                     fargc++;
diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx
index 199b618..066aeed 100644
--- a/sal/osl/w32/profile.cxx
+++ b/sal/osl/w32/profile.cxx
@@ -2363,7 +2363,7 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
 
             WideCharToMultiByte(CP_ACP,0, ::osl::mingw_reinterpret_cast<LPCWSTR>(aPath), -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), NULL, NULL);
 
-            if ((access(aTmpPath, 0) < 0) && (strlen(Product) > 0))
+            if ((access(aTmpPath, 0) < 0) && (Product[0] != '\0'))
             {
                 rtl_uString * strSVFallback = NULL;
                 rtl_uString * strSVProfile  = NULL;
@@ -2409,7 +2409,7 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
                             osl_closeProfile(hProfile);
                         }
 
-                        if (strlen(Buffer) > 0)
+                        if (Buffer[0] != '\0')
                         {
                             dwPathLen = MultiByteToWideChar(
                                 CP_ACP, 0, Buffer, -1, ::osl::mingw_reinterpret_cast<LPWSTR>(aPath), aPath.getBufSizeInSymbols() );
diff --git a/sal/osl/w32/security.c b/sal/osl/w32/security.c
index cc4a1b0..7d19974 100644
--- a/sal/osl/w32/security.c
+++ b/sal/osl/w32/security.c
@@ -867,16 +867,15 @@ static sal_Bool SAL_CALL getUserNameImpl(oslSecurity Security, rtl_uString **str
                     free(pNameW);
                 return sal_True;
             }
-            else
-                if (wcslen(pSecImpl->m_User) > 0)
-                {
-                    rtl_uString_newFromStr( strName, pSecImpl->m_pNetResource->lpRemoteName);
+            else if (pSecImpl->m_User[0] != '\0')
+            {
+                rtl_uString_newFromStr(strName, pSecImpl->m_pNetResource->lpRemoteName);
 
-                    if (pNameW)
-                        free(pNameW);
+                if (pNameW)
+                    free(pNameW);
 
-                    return sal_True;
-                }
+                return sal_True;
+            }
 
             if (pNameW)
                 free(pNameW);
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
index 707cc07..c73fb88 100644
--- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
+++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
@@ -1516,7 +1516,7 @@ namespace rtl_OStringBuffer
             (
                 "test empty string",
                 pstr != 0 &&
-                strlen(pstr) == 0
+                pstr[0] == '\0'
             );
 
         }


More information about the Libreoffice-commits mailing list