[Libreoffice-commits] core.git: filter/source forms/source formula/source fpicker/source framework/source

2021-12-21 Thread Noel Grandin (via logerrit)
 filter/source/msfilter/escherex.cxx |  102 +-
 filter/source/msfilter/msdffimp.cxx |   73 +-
 filter/source/msfilter/rtfutil.cxx  |   82 +-
 filter/source/svg/svgexport.cxx |   60 -
 filter/source/svg/svgfilter.cxx |   45 -
 filter/source/svg/svgwriter.cxx |  422 +---
 forms/source/component/CheckBox.cxx |   58 -
 forms/source/component/ComboBox.cxx |   40 -
 forms/source/component/DatabaseForm.cxx |   96 +-
 forms/source/component/Date.cxx |   52 -
 forms/source/component/Filter.cxx   |   43 -
 forms/source/component/FormattedField.cxx   |   48 -
 forms/source/component/Pattern.cxx  |   44 -
 forms/source/component/Time.cxx |   58 -
 forms/source/misc/limitedformats.cxx|  106 +--
 forms/source/runtime/formoperations.cxx |   37 -
 formula/source/core/api/token.cxx   |  164 ++--
 formula/source/ui/dlg/structpg.cxx  |   28 
 fpicker/source/office/PlacesListBox.cxx |   35 
 fpicker/source/office/iodlg.cxx |   68 -
 framework/source/helper/dockingareadefaultacceptor.cxx  |   48 -
 framework/source/layoutmanager/layoutmanager.cxx|  214 +++---
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |  250 +++
 framework/source/services/urltransformer.cxx|   52 -
 framework/source/uiconfiguration/globalsettings.cxx |   40 -
 framework/source/uiconfiguration/imagemanagerimpl.cxx   |  128 +--
 framework/source/uielement/imagebuttontoolbarcontroller.cxx |   34 
 framework/source/uielement/menubarmanager.cxx   |  336 -
 framework/source/uifactory/factoryconfiguration.cxx |   32 
 framework/source/uifactory/uielementfactorymanager.cxx  |   32 
 30 files changed, 1404 insertions(+), 1423 deletions(-)

New commits:
commit 489bce598626390d9c0aa5e5b8514e26070add61
Author: Noel Grandin 
AuthorDate: Tue Dec 21 15:22:06 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Dec 21 17:14:14 2021 +0100

loplugin:flatten in filter..framework

Change-Id: I15a577b3c6da03001bbbf2c2b43b29b41c4007c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127234
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index c85c51e41c95..b7ffd449cb22 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1997,47 +1997,45 @@ bool EscherPropertyContainer::CreatePolygonProperties(
 }
 }
 
-if(0 != nTotalPoints && aSegments.size() >= 6 && aVertices.size() >= 6)
-{
-// Little endian
-aVertices[0] = static_cast(nTotalPoints);
-aVertices[1] = static_cast(nTotalPoints >> 8);
-aVertices[2] = static_cast(nTotalPoints);
-aVertices[3] = static_cast(nTotalPoints >> 8);
-
-aSegments.push_back(static_cast(0));
-aSegments.push_back(static_cast(0x80));
-
-const sal_uInt32 nSegmentBufSize(aSegments.size() - 6);
-aSegments[0] = static_cast(nSegmentBufSize >> 1);
-aSegments[1] = static_cast(nSegmentBufSize >> 9);
-aSegments[2] = static_cast(nSegmentBufSize >> 1);
-aSegments[3] = static_cast(nSegmentBufSize >> 9);
-
-AddOpt(
-ESCHER_Prop_geoRight,
-rGeoRect.Width);
-AddOpt(
-ESCHER_Prop_geoBottom,
-rGeoRect.Height);
-AddOpt(
-ESCHER_Prop_shapePath,
-ESCHER_ShapeComplex);
-AddOpt(
-ESCHER_Prop_pVertices,
-true,
-aVertices.size() - 6,
-aVertices);
-AddOpt(
-ESCHER_Prop_pSegmentInfo,
-true,
-aSegments.size(),
-aSegments);
+if(0 == nTotalPoints || aSegments.size() < 6 || aVertices.size() < 6)
+return false;
 
-return true;
-}
+// Little endian
+aVertices[0] = static_cast(nTotalPoints);
+aVertices[1] = static_cast(nTotalPoints >> 8);
+aVertices[2] = static_cast(nTotalPoints);
+aVertices[3] = static_cast(nTotalPoints >> 8);
+
+aSegments.push_back(static_cast(0));
+aSegments.push_back(static_cast(0x80));
+
+const sal_uInt32 nSegmentBufSize(aSegments.size() - 6);
+aSegments[0] = static_cast(nSegmentBufSize >> 1);
+aSegments[1] = static_cast(nSegmentBufSize >> 9);
+aSegments[2] = static_cast(nSegmentBufSize >> 1);
+aSegments[3] = static_cast(nSegmentBufSize >> 9);
+
+AddOpt(
+ESCHER_Prop_geoRight,
+rGeoRect.Width);
+AddOpt(
+

[Libreoffice-commits] core.git: filter/source forms/source framework/inc framework/source

2020-05-08 Thread Noel Grandin (via logerrit)
 filter/source/config/cache/typedetection.hxx|4 ++--
 filter/source/graphic/GraphicExportFilter.hxx   |4 ++--
 filter/source/msfilter/eschesdo.hxx |4 ++--
 filter/source/xmlfilterdetect/filterdetect.hxx  |4 ++--
 filter/source/xsltdialog/typedetectionimport.hxx|6 +++---
 forms/source/component/DatabaseForm.hxx |4 +---
 forms/source/component/imgprod.hxx  |5 +
 forms/source/inc/InterfaceContainer.hxx |4 +---
 forms/source/xforms/binding.hxx |4 ++--
 forms/source/xforms/computedexpression.hxx  |4 ++--
 forms/source/xforms/convert.hxx |4 ++--
 forms/source/xforms/enumeration.hxx |4 ++--
 forms/source/xforms/model.hxx   |8 
 forms/source/xforms/pathexpression.hxx  |8 
 forms/source/xforms/propertysetbase.hxx |4 ++--
 forms/source/xforms/submission.hxx  |4 ++--
 forms/source/xforms/unohelper.hxx   |4 ++--
 forms/source/xforms/xmlhelper.hxx   |6 +++---
 framework/inc/helper/wakeupthread.hxx   |4 ++--
 framework/source/inc/dispatch/windowcommanddispatch.hxx |4 ++--
 20 files changed, 43 insertions(+), 50 deletions(-)

New commits:
commit eecf74d417800138e39304857901bf69c0b756de
Author: Noel Grandin 
AuthorDate: Fri May 8 14:34:29 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri May 8 21:13:05 2020 +0200

compact namespace in filter..framework

Change-Id: Id3c2d9b1fdf9d617adea0fa1ab2fa9a2de12ef50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93727
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/config/cache/typedetection.hxx 
b/filter/source/config/cache/typedetection.hxx
index 34995191e978..e8ce727cfe12 100644
--- a/filter/source/config/cache/typedetection.hxx
+++ b/filter/source/config/cache/typedetection.hxx
@@ -27,7 +27,7 @@
 #include 
 #include 
 
-namespace filter{ namespace config {
+namespace filter::config {
 
 class TerminateDetection;
 
@@ -400,7 +400,7 @@ public:
 }
 };
 
-}}
+}
 
 #endif // INCLUDED_FILTER_SOURCE_CONFIG_CACHE_TYPEDETECTION_HXX
 
diff --git a/filter/source/graphic/GraphicExportFilter.hxx 
b/filter/source/graphic/GraphicExportFilter.hxx
index 17c18af332f2..e35404250d13 100644
--- a/filter/source/graphic/GraphicExportFilter.hxx
+++ b/filter/source/graphic/GraphicExportFilter.hxx
@@ -28,12 +28,12 @@
 
 #include 
 
-namespace com { namespace sun { namespace star {
+namespace com::sun::star {
 namespace drawing {
 class XShapes;
 class XShape;
 }
-}}}
+}
 
 class GraphicExportFilter :
 public cppu::WeakImplHelper < css::document::XFilter, 
css::document::XExporter, css::lang::XInitialization >
diff --git a/filter/source/msfilter/eschesdo.hxx 
b/filter/source/msfilter/eschesdo.hxx
index 52bd852146d8..3461a253c2f8 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -89,7 +89,7 @@ public:
 // fractions of the Draw PPTWriter
 
 class EscherEx;
-namespace com { namespace sun { namespace star {
+namespace com::sun::star {
 namespace drawing {
 class XDrawPage;
 class XShape;
@@ -97,7 +97,7 @@ namespace com { namespace sun { namespace star {
 namespace task {
 class XStatusIndicator;
 }
-}}}
+}
 class EscherExHostAppData;
 
 class ImplEESdrWriter
diff --git a/filter/source/xmlfilterdetect/filterdetect.hxx 
b/filter/source/xmlfilterdetect/filterdetect.hxx
index 77d716387f90..964f32419e31 100644
--- a/filter/source/xmlfilterdetect/filterdetect.hxx
+++ b/filter/source/xmlfilterdetect/filterdetect.hxx
@@ -25,9 +25,9 @@
 #include 
 #include 
 
-namespace com { namespace sun { namespace star { namespace uno {
+namespace com::sun::star::uno {
 class XComponentContext;
-} } } }
+}
 
 class FilterDetect final : public cppu::WeakImplHelper <
 css::document::XExtendedFilterDetection,
diff --git a/filter/source/xsltdialog/typedetectionimport.hxx 
b/filter/source/xsltdialog/typedetectionimport.hxx
index 672ea40e38af..1771eef77e5e 100644
--- a/filter/source/xsltdialog/typedetectionimport.hxx
+++ b/filter/source/xsltdialog/typedetectionimport.hxx
@@ -31,10 +31,10 @@
 #include 
 #include 
 
-namespace com { namespace sun { namespace star {
-namespace xml { namespace sax { class XAttributeList; } }
+namespace com::sun::star {
+namespace xml::sax { class XAttributeList; }
 namespace beans { struct PropertyValue; }
-} } }
+}
 
 enum ImportState
 {
diff --git a/forms/source/component/DatabaseForm.hxx 
b/forms/source/component/DatabaseForm.hxx
index 383d537b2efe..3d23e9aaac16 100644
--- a/forms/source/component/DatabaseForm.hxx
+++ b/forms/source/component/DatabaseForm.hxx
@@ -69,9 +69,7 @@
 #include 
 #include 
 

[Libreoffice-commits] core.git: filter/source forms/source framework/source include/svtools odk/examples offapi/com sc/source sd/qa sd/source sfx2/source smoketest/com sw/qa sw/source unotools/source

2019-08-12 Thread Andrea Gelmini (via logerrit)
 filter/source/config/cache/filtercache.cxx |2 
+-
 forms/source/component/GroupManager.cxx|2 
+-
 forms/source/component/ImageButton.cxx |2 
+-
 framework/source/services/taskcreatorsrv.cxx   |4 
++--
 include/svtools/acceleratorexecute.hxx |4 
++--
 include/svtools/optionsdrawinglayer.hxx|2 
+-
 odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java |4 
++--
 odk/examples/java/MinimalComponent/MinimalComponent.java   |4 
++--
 offapi/com/sun/star/drawing/GenericDrawingDocument.idl |2 
+-
 offapi/com/sun/star/frame/XTerminateListener2.idl  |2 
+-
 offapi/com/sun/star/text/GenericTextDocument.idl   |2 
+-
 sc/source/filter/xml/xmlimprt.cxx  |8 

 sc/source/ui/dbgui/validate.cxx|2 
+-
 sd/qa/unit/uimpress.cxx|2 
+-
 sd/source/filter/xml/sdxmlwrp.cxx  |8 

 sfx2/source/dialog/mgetempl.cxx|2 
+-
 smoketest/com/sun/star/comp/smoketest/TestExtension.java   |4 
++--
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx  |4 
++--
 sw/source/filter/docx/swdocxreader.cxx |4 
++--
 sw/source/filter/inc/msfilter.hxx  |4 
++--
 sw/source/filter/ww8/wrtww8gr.cxx  |2 
+-
 sw/source/filter/ww8/ww8par.cxx|4 
++--
 sw/source/filter/xml/xmlimp.cxx|8 

 unotools/source/misc/mediadescriptor.cxx   |6 
+++---
 vcl/source/control/button.cxx  |2 
+-
 25 files changed, 45 insertions(+), 45 deletions(-)

New commits:
commit f3261ba74815b30f1018954bfb9ecd332fa8f1d5
Author: Andrea Gelmini 
AuthorDate: Sat Aug 10 23:24:48 2019 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 12 09:46:21 2019 +0200

Fix typos

"its"

Change-Id: I02c660e46964270376a66210fdb5f1b1985ce5b6
Reviewed-on: https://gerrit.libreoffice.org/77255
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/filter/source/config/cache/filtercache.cxx 
b/filter/source/config/cache/filtercache.cxx
index 59ac271b8393..8b620cacf438 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -638,7 +638,7 @@ void FilterCache::impl_flushByList(const 
css::uno::Reference< css::container::XN
 // special case. no exception - but not a valid item => it 
must be finalized or mandatory!
 // Reject flush operation by throwing an exception. At least 
one item couldn't be flushed.
 if (!xItem.is())
-throw css::uno::Exception("Can not change item. Its 
finalized or mandatory!",
+throw css::uno::Exception("Can not change item. It's 
finalized or mandatory!",
   css::uno::Reference< 
css::uno::XInterface >());
 
 CacheItemList::const_iterator pItem = rCache.find(item);
diff --git a/forms/source/component/GroupManager.cxx 
b/forms/source/component/GroupManager.cxx
index a98cceb075d5..6b8ee7a8c04e 100644
--- a/forms/source/component/GroupManager.cxx
+++ b/forms/source/component/GroupManager.cxx
@@ -157,7 +157,7 @@ void OGroup::RemoveComponent( const 
Reference& rxElement )
 
 /*
  * By removing the GroupComp the insertion position has become 
invalid.
- * We do not to change it here, however, because its passed on 
continuously
+ * We do not to change it here, however, because it's passed on 
continuously
  * and ascending distinctively.
  */
 }
diff --git a/forms/source/component/ImageButton.cxx 
b/forms/source/component/ImageButton.cxx
index 63c627c93fe0..63cf27fca416 100644
--- a/forms/source/component/ImageButton.cxx
+++ b/forms/source/component/ImageButton.cxx
@@ -200,7 +200,7 @@ void OImageButtonControl::mousePressed(const 
awt::MouseEvent& e)
 else
 {
 // Or else don't; we must not notify the listeners in that case.
-// Even not if its added later on.
+// Even not if it's added later on.
 aGuard.clear();
 actionPerformed_Impl( false, e );
 }
diff --git a/framework/source/services/taskcreatorsrv.cxx 
b/framework/source/services/taskcreatorsrv.cxx
index 04d4f98fe776..43dd64c7d573 100644
--- a/framework/source/services/taskcreatorsrv.cxx
+++ 

[Libreoffice-commits] core.git: filter/source forms/source framework/source

2019-06-16 Thread Noel Grandin (via logerrit)
 filter/source/config/cache/filtercache.cxx|5 +++--
 filter/source/config/cache/typedetection.cxx  |6 +++---
 filter/source/msfilter/eschesdo.cxx   |5 +++--
 filter/source/pdf/impdialog.cxx   |5 +++--
 filter/source/svg/svgfilter.cxx   |5 +++--
 filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx   |   10 +-
 filter/source/xsltfilter/XSLTFilter.cxx   |6 +-
 forms/source/component/Edit.cxx   |6 +++---
 forms/source/xforms/submission/replace.cxx|5 +++--
 framework/source/dispatch/servicehandler.cxx  |5 +++--
 framework/source/fwi/jobs/configaccess.cxx|5 +++--
 framework/source/jobs/job.cxx |5 +++--
 framework/source/services/sessionlistener.cxx |   13 +++--
 framework/source/uielement/popuptoolbarcontroller.cxx |9 +
 14 files changed, 48 insertions(+), 42 deletions(-)

New commits:
commit 7508c1d1e701dba8cb67414be59193d9672b66ab
Author: Noel Grandin 
AuthorDate: Sat Jun 15 13:11:48 2019 +0200
Commit: Noel Grandin 
CommitDate: Sun Jun 16 08:55:07 2019 +0200

loplugin:logexceptionnicely in filter..framework

Change-Id: I8cf70ee278c641767e3fcfcfd151d99d791b3468
Reviewed-on: https://gerrit.libreoffice.org/74098
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/config/cache/filtercache.cxx 
b/filter/source/config/cache/filtercache.cxx
index a1ae51b1f04c..251695ca738a 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -19,6 +19,7 @@
 
 
 #include 
+#include 
 #include "filtercache.hxx"
 #include "constant.hxx"
 #include "cacheupdatelistener.hxx"
@@ -860,9 +861,9 @@ css::uno::Any FilterCache::impl_getDirectCFGValue(const 
OUString& sDirectKey)
 }
 catch(const css::uno::RuntimeException&)
 { throw; }
-catch(const css::uno::Exception& ex)
+catch(const css::uno::Exception&)
 {
-SAL_WARN( "filter.config", ex);
+TOOLS_WARN_EXCEPTION( "filter.config", "");
 aValue.clear();
 }
 
diff --git a/filter/source/config/cache/typedetection.cxx 
b/filter/source/config/cache/typedetection.cxx
index 60b68f4592c6..06aa7ae565f4 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -448,10 +449,9 @@ OUString SAL_CALL 
TypeDetection::queryTypeByDescriptor(css::uno::Sequence< css::
 {
 throw;
 }
-catch(const css::uno::Exception& e)
+catch(const css::uno::Exception&)
 {
-SAL_WARN("filter.config", "caught " << e
-<< " while querying type of " << sURL);
+TOOLS_WARN_EXCEPTION("filter.config", "caught exception while querying 
type of " << sURL);
 sType.clear();
 }
 
diff --git a/filter/source/msfilter/eschesdo.cxx 
b/filter/source/msfilter/eschesdo.cxx
index 9ed77a8b2280..365a620f5a4c 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1219,9 +1220,9 @@ sal_uInt32 ImplEESdrObject::ImplGetText()
 {
 mnTextSize = xXText->getString().getLength();
 }
-catch (const uno::RuntimeException& e)
+catch (const uno::RuntimeException&)
 {
-SAL_WARN("filter.ms", "ImplGetText: " << e);
+TOOLS_WARN_EXCEPTION("filter.ms", "ImplGetText");
 }
 }
 return mnTextSize;
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 52e22cf01a28..0eccc2da71ff 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1501,9 +1502,9 @@ IMPL_LINK_NOARG(ImpPDFTabSigningPage, 
ClickmaPbSignCertSelect, weld::Button&, vo
 }
 }
 }
-catch (const uno::Exception )
+catch (const uno::Exception &)
 {
-SAL_INFO("filter.pdf", "TSAURLsDialog::TSAURLsDialog(): " << e);
+TOOLS_INFO_EXCEPTION("filter.pdf", 
"TSAURLsDialog::TSAURLsDialog()");
 }
 
 // If more than only the "None" entry is there, enable the ListBox
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 252f13e89173..482c3ba7eb2f 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -822,9 +823,9 @@ OUString SAL_CALL 
SVGFilter::detect(Sequence& rDescriptor)
 }
 }
 }
-catch (css::io::IOException & e)
+catch (css::io::IOException &)
 

[Libreoffice-commits] core.git: filter/source forms/source fpicker/source framework/source i18nlangtag/source i18npool/source idlc/source l10ntools/source lotuswordpro/source

2019-02-17 Thread Libreoffice Gerrit user
 filter/source/graphicfilter/icgm/elements.cxx   |   10 
--
 filter/source/msfilter/escherex.cxx |   11 
--
 filter/source/msfilter/msdffimp.cxx |   39 
++---
 filter/source/msfilter/svdfppt.cxx  |   13 
+--
 filter/source/xsltdialog/typedetectionimport.cxx|9 
--
 forms/source/component/EventThread.cxx  |8 
-
 forms/source/misc/InterfaceContainer.cxx|   13 
+--
 forms/source/xforms/namedcollection.hxx |   19 
+---
 fpicker/source/office/OfficeFilePicker.cxx  |   12 
--
 fpicker/source/office/iodlg.cxx |7 
-
 fpicker/source/win32/FilterContainer.cxx|   12 
+-
 framework/source/accelerators/acceleratorconfiguration.cxx  |   16 
---
 framework/source/accelerators/presethandler.cxx |8 
-
 framework/source/dispatch/dispatchinformationprovider.cxx   |   12 
--
 framework/source/fwi/classes/protocolhandlercache.cxx   |   14 
+--
 framework/source/services/ContextChangeEventMultiplexer.cxx |   12 
--
 framework/source/services/autorecovery.cxx  |   23 
+
 framework/source/services/desktop.cxx   |6 
-
 framework/source/services/pathsettings.cxx  |   21 
+
 framework/source/uifactory/uielementfactorymanager.cxx  |7 
-
 i18nlangtag/source/languagetag/languagetag.cxx  |   37 
+++--
 i18npool/source/characterclassification/characterclassificationImpl.cxx |4 
 i18npool/source/localedata/localedata.cxx   |8 
-
 idlc/source/astenum.cxx |   13 
---
 idlc/source/astscope.cxx|   14 
---
 idlc/source/astservice.cxx  |   24 
+
 l10ntools/source/po.cxx |4 
 lotuswordpro/source/filter/lwpstory.cxx |   41 
++
 28 files changed, 124 insertions(+), 293 deletions(-)

New commits:
commit 44841a6778821be3e68ab15819b39064b20e968f
Author: Arkadiy Illarionov 
AuthorDate: Sat Feb 16 18:39:23 2019 +0300
Commit: Noel Grandin 
CommitDate: Mon Feb 18 07:41:05 2019 +0100

Simplify containers iterations in [f-l]*

Use range-based loop or replace with STL functions

Change-Id: Ib3fab47318d1bfbb4df8f886a8cd9596525a420f
Reviewed-on: https://gerrit.libreoffice.org/67914
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/filter/source/graphicfilter/icgm/elements.cxx 
b/filter/source/graphicfilter/icgm/elements.cxx
index 8d324b68340c..915edc363630 100644
--- a/filter/source/graphicfilter/icgm/elements.cxx
+++ b/filter/source/graphicfilter/icgm/elements.cxx
@@ -320,12 +320,10 @@ Bundle* CGMElements::InsertBundle( BundleList& rList, 
Bundle& rBundle )
 Bundle* pBundle = GetBundle( rList, rBundle.GetIndex() );
 if ( pBundle )
 {
-for ( BundleList::iterator it = rList.begin(); it != rList.end(); ++it 
) {
-if ( it->get() == pBundle ) {
-rList.erase( it );
-break;
-}
-}
+auto it = std::find_if(rList.begin(), rList.end(),
+[](const std::unique_ptr& rxBundle) { return 
rxBundle.get() == pBundle; });
+if (it != rList.end())
+rList.erase( it );
 }
 rList.push_back( rBundle.Clone() );
 return rList.back().get();
diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index 50e10a4af1fb..32756294d391 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -3794,13 +3794,10 @@ void EscherPersistTable::PtInsert( sal_uInt32 nID, 
sal_uInt32 nOfs )
 
 void EscherPersistTable::PtDelete( sal_uInt32 nID )
 {
-for(auto it = maPersistTable.begin(); it != maPersistTable.end() ; ++it)
-{
-if ( (*it)->mnID == nID ) {
-maPersistTable.erase( it );
-break;
-}
-}
+auto it = std::find_if(maPersistTable.begin(), maPersistTable.end(),
+[](const std::unique_ptr& rxEntry) { return 
rxEntry->mnID == nID; });
+if (it != maPersistTable.end())
+maPersistTable.erase( it );
 }
 
 sal_uInt32 EscherPersistTable::PtGetOffsetByID( sal_uInt32 nID )
diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 45c8836f9d10..df759c529693 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1176,30 +1176,22 @@ static void 

[Libreoffice-commits] core.git: filter/source forms/source formula/source fpicker/source framework/source include/filter

2018-09-08 Thread Libreoffice Gerrit user
 filter/source/flash/swfexporter.cxx   |1 -
 filter/source/flash/swfwriter.cxx |2 --
 filter/source/graphicfilter/egif/giflzwc.cxx  |2 +-
 filter/source/graphicfilter/eps/eps.cxx   |1 -
 filter/source/graphicfilter/etiff/etiff.cxx   |1 -
 filter/source/graphicfilter/icgm/bundles.cxx  |2 --
 filter/source/graphicfilter/icgm/cgm.cxx  |2 --
 filter/source/graphicfilter/idxf/dxfentrd.cxx |3 +--
 filter/source/graphicfilter/ipsd/ipsd.cxx |2 --
 filter/source/graphicfilter/itga/itga.cxx |4 
 filter/source/graphicfilter/itiff/ccidecom.cxx|2 --
 filter/source/msfilter/eschesdo.cxx   |1 -
 filter/source/msfilter/msdffimp.cxx   |9 
+
 filter/source/msfilter/svdfppt.cxx|8 

 filter/source/msfilter/viscache.hxx   |1 -
 filter/source/svg/svgwriter.cxx   |4 
 filter/source/xsltdialog/xmlfiltertestdialog.cxx  |1 -
 forms/source/component/DatabaseForm.cxx   |2 --
 forms/source/component/clickableimage.cxx |2 --
 forms/source/component/imgprod.cxx|3 +--
 forms/source/component/propertybaghelper.cxx  |1 -
 forms/source/richtext/richtextimplcontrol.cxx |1 -
 forms/source/richtext/richtextvclcontrol.cxx  |1 -
 forms/source/richtext/rtattributes.hxx|9 
+++--
 formula/source/core/api/token.cxx |1 -
 fpicker/source/office/RemoteFilesDialog.cxx   |1 -
 fpicker/source/office/fpsmartcontent.cxx  |6 ++
 fpicker/source/office/iodlgimp.cxx|1 -
 framework/source/fwe/classes/actiontriggerpropertyset.cxx |2 --
 framework/source/fwe/xml/menudocumenthandler.cxx  |2 --
 framework/source/fwe/xml/saxnamespacefilter.cxx   |1 -
 framework/source/layoutmanager/layoutmanager.cxx  |1 -
 framework/source/layoutmanager/toolbarlayoutmanager.cxx   |1 -
 framework/source/recording/dispatchrecordersupplier.cxx   |1 -
 framework/source/services/frame.cxx   |1 -
 framework/source/services/pathsettings.cxx|1 -
 framework/source/uiconfiguration/imagemanagerimpl.cxx |1 -
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |4 +---
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |3 +--
 include/filter/msfilter/svdfppt.hxx   |1 -
 40 files changed, 11 insertions(+), 82 deletions(-)

New commits:
commit 8dc6c96a8036f80c3ba016ea347ce2f83daa9726
Author: Noel Grandin 
AuthorDate: Sat Sep 8 14:52:40 2018 +0200
Commit: Noel Grandin 
CommitDate: Sat Sep 8 19:28:19 2018 +0200

loplugin:simplifyconstruct in filter..framework

Change-Id: Ida4307a92dfb1dbd14da5a30b6ee1f0fd6a9455e
Reviewed-on: https://gerrit.libreoffice.org/60194
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/flash/swfexporter.cxx 
b/filter/source/flash/swfexporter.cxx
index 643871e90608..344ea5214849 100644
--- a/filter/source/flash/swfexporter.cxx
+++ b/filter/source/flash/swfexporter.cxx
@@ -79,7 +79,6 @@ FlashExporter::FlashExporter(
 , mxSelectedDrawPage(rxSelectedDrawPage)
 , mbExportSelection(false)
 
-, mpWriter(nullptr)
 , mnDocWidth(0)
 , mnDocHeight(0)
 , mnJPEGcompressMode(nJPEGCompressMode)
diff --git a/filter/source/flash/swfwriter.cxx 
b/filter/source/flash/swfwriter.cxx
index 04b47a640e25..e2478ffd6b96 100644
--- a/filter/source/flash/swfwriter.cxx
+++ b/filter/source/flash/swfwriter.cxx
@@ -44,8 +44,6 @@ Writer::Writer( sal_Int32 nTWIPWidthOutput, sal_Int32 
nTWIPHeightOutput, sal_Int
 mnDocXScale( static_cast(nTWIPWidthOutput) / mnDocWidth ),
 mnDocYScale( static_cast(nTWIPHeightOutput) / mnDocHeight ),
 mpClipPolyPolygon( nullptr ),
-mpTag( nullptr ),
-mpSprite( nullptr ),
 mnNextId( 1 ),
 mnFrames( 0 ),
 mnGlobalTransparency(0),
diff --git a/filter/source/graphicfilter/egif/giflzwc.cxx 
b/filter/source/graphicfilter/egif/giflzwc.cxx
index 5a4601d38c9e..8b1950e526a2 100644
--- a/filter/source/graphicfilter/egif/giflzwc.cxx
+++ b/filter/source/graphicfilter/egif/giflzwc.cxx
@@ -111,7 +111,7 @@ struct GIFLZWCTreeNode
 
 
 GIFLZWCompressor::GIFLZWCompressor()
-: pIDOS(nullptr), pTable(nullptr), 

[Libreoffice-commits] core.git: filter/source forms/source formula/source fpicker/source framework/source

2018-02-14 Thread Noel Grandin
 filter/source/flash/swfwriter1.cxx  |   50 +++---
 filter/source/flash/swfwriter2.cxx  |4 -
 filter/source/graphicfilter/eps/eps.cxx |   12 +--
 filter/source/graphicfilter/idxf/dxf2mtf.cxx|8 +-
 filter/source/graphicfilter/idxf/dxfvec.cxx |4 -
 filter/source/graphicfilter/ios2met/ios2met.cxx |   20 ++---
 filter/source/msfilter/escherex.cxx |   12 +--
 filter/source/msfilter/eschesdo.cxx |   24 +++---
 filter/source/msfilter/msdffimp.cxx |   56 
 filter/source/msfilter/svdfppt.cxx  |   30 
 filter/source/svg/svgwriter.cxx |   37 +-
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx|6 -
 forms/source/richtext/richtextimplcontrol.cxx   |   16 ++--
 forms/source/solar/control/navtoolbar.cxx   |2 
 formula/source/ui/dlg/structpg.cxx  |2 
 fpicker/source/office/PlacesListBox.cxx |2 
 fpicker/source/office/RemoteFilesDialog.cxx |   10 +-
 fpicker/source/office/iodlg.cxx |   10 +-
 framework/source/layoutmanager/helpers.cxx  |8 +-
 framework/source/layoutmanager/layoutmanager.cxx|2 
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |   24 +++---
 framework/source/uiconfiguration/ImageList.cxx  |4 -
 framework/source/uielement/addonstoolbarwrapper.cxx |2 
 framework/source/uielement/toolbarmanager.cxx   |2 
 framework/source/uielement/toolbarwrapper.cxx   |4 -
 25 files changed, 176 insertions(+), 175 deletions(-)

New commits:
commit bf8a6cacd06d7c1961b5db8cc79ee4bbdb342e43
Author: Noel Grandin 
Date:   Wed Feb 14 09:22:30 2018 +0200

loplugin:changetoolsgen in filter..framework

Change-Id: I622da8a0c096c74efd97326451c4576b230f0483
Reviewed-on: https://gerrit.libreoffice.org/49701
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/filter/source/flash/swfwriter1.cxx 
b/filter/source/flash/swfwriter1.cxx
index 7f82c97e8491..4b627d50e4bc 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -57,8 +57,8 @@ Point Writer::map( const Point& rPoint ) const
 
 // AS: Produces a 'possible loss of data' warning that we can't fix without
 //  hurting code readability.
-retPoint.X() = static_cast( retPoint.X() * mnDocXScale );
-retPoint.Y() = static_cast( retPoint.Y() * mnDocYScale );
+retPoint.setX( static_cast( retPoint.X() * mnDocXScale ) );
+retPoint.setY( static_cast( retPoint.Y() * mnDocYScale ) );
 
 return retPoint;
 }
@@ -72,8 +72,8 @@ Size Writer::map( const Size& rSize ) const
 
 // AS: Produces a 'possible loss of data' warning that we can't fix without
 //  hurting code readability.
-retSize.Width() = static_cast( retSize.Width() * mnDocXScale );
-retSize.Height() = static_cast( retSize.Height() * mnDocYScale );
+retSize.setWidth( static_cast( retSize.Width() * mnDocXScale ) );
+retSize.setHeight( static_cast( retSize.Height() * mnDocYScale ) );
 
 return retSize;
 }
@@ -521,7 +521,7 @@ void Writer::Impl_writeText( const Point& rPos, const 
OUString& rText, const lon
 
 if( nLen > 1 )
 {
-aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( 
OUString(rText[nLen - 1]) );
+aNormSize.setWidth( pDX[ nLen - 2 ] + mpVDev->GetTextWidth( 
OUString(rText[nLen - 1]) ) );
 
 if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) 
)
 {
@@ -550,11 +550,11 @@ void Writer::Impl_writeText( const Point& rPos, const 
OUString& rText, const lon
 switch( aOldFont.GetAlignment() )
 {
 case ALIGN_TOP:
-aBaseLinePos.Y() += aMetric.GetAscent();
+aBaseLinePos.setY( aBaseLinePos.Y() + aMetric.GetAscent() );
 break;
 
 case ALIGN_BOTTOM:
-aBaseLinePos.Y() -= aMetric.GetDescent();
+aBaseLinePos.setY( aBaseLinePos.Y() - aMetric.GetDescent() );
 break;
 
 default:
@@ -664,14 +664,14 @@ void Writer::Impl_writeText( const Point& rPos, const 
OUString& rText, const lon
 
 if( aOldFont.GetStrikeout() != STRIKEOUT_NONE )
 {
-aPoly[ 0 ].X() = aBaseLinePos.X();
-aPoly[ 0 ].Y() = aBaseLinePos.Y() - FRound( 
aMetric.GetAscent() * 0.26 ) - nLineHeight;
-aPoly[ 1 ].X() = aPoly[ 0 ].X() + aNormSize.Width() - 1;
-aPoly[ 1 ].Y() = aPoly[ 0 ].Y();
-aPoly[ 2 ].X() = aPoly[ 1 ].X();
-aPoly[ 2 ].Y() = aPoly[ 1 ].Y() + nLineHeight - 1;
-aPoly[ 3 ].X() = 

[Libreoffice-commits] core.git: filter/source forms/source framework/source i18npool/source

2017-09-22 Thread Noel Grandin
 filter/source/xsltfilter/XSLTFilter.cxx   |   11 
 forms/source/xforms/submission.cxx|7 
 framework/source/fwe/xml/xmlnamespaces.cxx|   19 
 framework/source/fwi/uielement/constitemcontainer.cxx |5 
 framework/source/services/ContextChangeEventMultiplexer.cxx   |5 
 framework/source/services/substitutepathvars.cxx  |9 
 framework/source/uiconfiguration/graphicnameaccess.cxx|5 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |  301 
--
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |  112 +--
 i18npool/source/breakiterator/breakiterator_unicode.cxx   |7 
 i18npool/source/calendar/calendarImpl.cxx |  180 ++---
 i18npool/source/collator/collatorImpl.cxx |5 
 i18npool/source/indexentry/indexentrysupplier.cxx |   17 
 i18npool/source/localedata/localedata.cxx |5 
 14 files changed, 310 insertions(+), 378 deletions(-)

New commits:
commit 4af6c0948be47d7816eb1b6f2137b70aba639f0d
Author: Noel Grandin 
Date:   Thu Sep 21 11:53:59 2017 +0200

loplugin:flatten in filter..i18npool

Change-Id: I9024b8b614a4de83a4d927e1918f6d4904a7fccb
Reviewed-on: https://gerrit.libreoffice.org/42592
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/filter/source/xsltfilter/XSLTFilter.cxx 
b/filter/source/xsltfilter/XSLTFilter.cxx
index d4455f620a0a..5373db29aa73 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -527,15 +527,8 @@ namespace XSLT
 // wait for the transformer to finish
 m_cTransformed.wait();
 m_tcontrol->terminate();
-if (!m_bError && !m_bTerminated)
-{
-return;
-}
-else
-{
-throw RuntimeException();
-}
-
+if (m_bError || m_bTerminated)
+throw RuntimeException();
 }
 
 
diff --git a/forms/source/xforms/submission.cxx 
b/forms/source/xforms/submission.cxx
index a0cd6e9fcdba..3757378c663d 100644
--- a/forms/source/xforms/submission.cxx
+++ b/forms/source/xforms/submission.cxx
@@ -477,16 +477,13 @@ void SAL_CALL Submission::submitWithInteraction(
 *this, makeAny( e ) );
 }
 
-if( bResult )
-{
-mxModel->rebuild();
-}
-else
+if( !bResult )
 {
 // other failure: throw wrapped target exception, too.
 throw WrappedTargetException(
 lcl_message( sID, OUString() ), *this, Any() );
 }
+mxModel->rebuild();
 }
 
 void SAL_CALL Submission::submit( )
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx 
b/framework/source/fwe/xml/xmlnamespaces.cxx
index c13c0bbbf163..a505a2101094 100644
--- a/framework/source/fwe/xml/xmlnamespaces.cxx
+++ b/framework/source/fwe/xml/xmlnamespaces.cxx
@@ -98,16 +98,13 @@ OUString XMLNamespaces::applyNSToAttributeName( const 
OUString& aName ) const
 int index;
 if (( index = aName.indexOf( ':' )) > 0 )
 {
-if ( aName.getLength() > index+1 )
-{
-OUString aAttributeName = getNamespaceValue( aName.copy( 0, index 
)) + "^" + aName.copy( index+1);
-return aAttributeName;
-}
-else
+if ( aName.getLength() <= index+1 )
 {
 // attribute with namespace but without name "namespace:" is not 
allowed!!
 throw SAXException( "Attribute has no name only preceding 
namespace!", Reference< XInterface >(), Any() );
 }
+OUString aAttributeName = getNamespaceValue( aName.copy( 0, index )) + 
"^" + aName.copy( index+1);
+return aAttributeName;
 }
 
 return aName;
@@ -135,13 +132,12 @@ OUString XMLNamespaces::applyNSToElementName( const 
OUString& aName ) const
 
 if ( index > 0 )
 {
-if ( aName.getLength() > index+1 )
-aElementName += aName.copy( index+1 );
-else
+if ( aName.getLength() <= index+1 )
 {
 // attribute with namespace but without a name is not allowed 
(e.g. "cfg:" )
 throw SAXException( "Attribute has no name only preceding 
namespace!", Reference< XInterface >(), Any() );
 }
+aElementName += aName.copy( index+1 );
 }
 else
 aElementName += aName;
@@ -157,13 +153,12 @@ OUString XMLNamespaces::getNamespaceValue( const 
OUString& aNamespace ) const
 {
 NamespaceMap::const_iterator p;
 p = m_aNamespaceMap.find( aNamespace );
-if ( p != m_aNamespaceMap.end() )
-return p->second;
-else
+if ( p == m_aNamespaceMap.end() )
 {
 // namespace not defined => throw exception!
 throw SAXException( "XML 

[Libreoffice-commits] core.git: filter/source forms/source

2017-06-23 Thread Noel Grandin
 filter/source/flash/swfwriter2.cxx   |5 ---
 filter/source/graphicfilter/ieps/ieps.cxx|2 -
 filter/source/graphicfilter/itiff/itiff.cxx  |4 +-
 filter/source/msfilter/escherex.cxx  |   14 +++---
 filter/source/msfilter/mscodec.cxx   |2 -
 filter/source/msfilter/msdffimp.cxx  |   26 ++-
 filter/source/msfilter/svdfppt.cxx   |3 --
 filter/source/msfilter/util.cxx  |6 +---
 filter/source/pdf/pdfexport.cxx  |3 --
 filter/source/svg/svgexport.cxx  |3 --
 filter/source/svg/svgfilter.cxx  |4 +-
 filter/source/svg/svgimport.cxx  |4 +-
 filter/source/t602/t602filter.cxx|4 --
 filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx  |6 +---
 filter/source/xsltdialog/xmlfilterjar.cxx|9 ++
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx |9 ++
 filter/source/xsltdialog/xmlfiltertestdialog.cxx |6 +---
 forms/source/component/imgprod.cxx   |3 --
 forms/source/component/propertybaghelper.cxx |2 -
 forms/source/runtime/formoperations.cxx  |2 -
 forms/source/solar/control/navtoolbar.cxx|3 --
 forms/source/xforms/binding.cxx  |3 --
 forms/source/xforms/submission/submission_post.cxx   |3 --
 forms/source/xforms/xpathlib/xpathlib.cxx|2 -
 24 files changed, 46 insertions(+), 82 deletions(-)

New commits:
commit 8c6b84c2c5834ab877c3edd96fd243606cfefe39
Author: Noel Grandin 
Date:   Fri Jun 23 10:23:07 2017 +0200

loplugin:oncevar filter..forms

Change-Id: I70a8ed6dbfe08b22dbf7b7b86e9518d73c5e393a
Reviewed-on: https://gerrit.libreoffice.org/39154
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/filter/source/flash/swfwriter2.cxx 
b/filter/source/flash/swfwriter2.cxx
index 5d8acaed1150..dd8b3d158ac5 100644
--- a/filter/source/flash/swfwriter2.cxx
+++ b/filter/source/flash/swfwriter2.cxx
@@ -594,12 +594,9 @@ void FillStyle::Impl_addGradient( Tag* pTag ) const
 aGradientRecords.push_back( GradRecord( 0x00, 
maGradient.GetEndColor() ) );
 aGradientRecords.push_back( GradRecord( 0x80, 
maGradient.GetStartColor() ) );
 aGradientRecords.push_back( GradRecord( 0xff, 
maGradient.GetEndColor() ) );
-double tx = ( 32768.0 / 2.0 );
-double ty = ( 32768.0 / 2.0 );
 double scalex = (double)maBoundRect.GetWidth() / 32768.0;
 double scaley = (double)maBoundRect.GetHeight() / 32768.0;
-
-m.translate( tx, ty );
+m.translate( 32768.0 / 2.0, 32768.0 / 2.0 );
 m.scale( scalex, scaley );
 }
 break;
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx 
b/filter/source/graphicfilter/ieps/ieps.cxx
index 81841d8b0891..845b5ea854ff 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -435,7 +435,7 @@ void CreateMtfReplacementAction( GDIMetaFile& rMtf, 
SvStream& rStrm, sal_uInt32
 nSizeTIFF = aTIFFBuf.size();
 
 SvMemoryStream aReplacement( nSizeWMF + nSizeTIFF + 28 );
-sal_uInt32 nMagic = 0xc6d3d0c5;
+sal_uInt32 const nMagic = 0xc6d3d0c5;
 sal_uInt32 nPPos = 28 + nSizeWMF + nSizeTIFF;
 sal_uInt32 nWPos = nSizeWMF ? 28 : 0;
 sal_uInt32 nTPos = nSizeTIFF ? 28 + nSizeWMF : 0;
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx 
b/filter/source/graphicfilter/itiff/itiff.cxx
index af1707379a44..f785ab5a7666 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -373,7 +373,7 @@ void TIFFReader::ReadTagData( sal_uInt16 nTagType, 
sal_uInt32 nDataLen)
 nNumStripOffsets = 0;
 sal_uInt32 nOldNumSO = nNumStripOffsets;
 nDataLen += nOldNumSO;
-size_t nMaxAllocAllowed = SAL_MAX_UINT32 / sizeof(sal_uInt32);
+size_t const nMaxAllocAllowed = SAL_MAX_UINT32 / 
sizeof(sal_uInt32);
 size_t nMaxRecordsAvailable = pTIFF->remainingSize() / 
DataTypeSize();
 if (nDataLen > nOldNumSO && nDataLen < nMaxAllocAllowed &&
 (nDataLen - nOldNumSO) <= nMaxRecordsAvailable)
@@ -421,7 +421,7 @@ void TIFFReader::ReadTagData( sal_uInt16 nTagType, 
sal_uInt32 nDataLen)
 nNumStripByteCounts = 0; // to be on the safe side
 sal_uInt32 nOldNumSBC = nNumStripByteCounts;
 nDataLen += nOldNumSBC;
-size_t nMaxAllocAllowed = SAL_MAX_UINT32 / sizeof(sal_uInt32);
+size_t const nMaxAllocAllowed = SAL_MAX_UINT32 / 
sizeof(sal_uInt32);
 size_t nMaxRecordsAvailable = 

[Libreoffice-commits] core.git: filter/source forms/source fpicker/source

2017-03-25 Thread Andrea Gelmini
 filter/source/graphicfilter/etiff/etiff.cxx |2 +-
 filter/source/graphicfilter/ipict/ipict.cxx |2 +-
 filter/source/graphicfilter/ipict/shape.cxx |2 +-
 filter/source/msfilter/dffpropset.cxx   |2 +-
 filter/source/msfilter/svdfppt.cxx  |8 
 filter/source/msfilter/util.cxx |4 ++--
 forms/source/component/FormattedFieldWrapper.cxx|2 +-
 forms/source/misc/InterfaceContainer.cxx|4 ++--
 forms/source/runtime/formoperations.hxx |2 +-
 forms/source/xforms/binding.cxx |2 +-
 forms/source/xforms/binding.hxx |2 +-
 forms/source/xforms/submission.cxx  |2 +-
 fpicker/source/office/OfficeFilePicker.cxx  |2 +-
 fpicker/source/office/commonpicker.hxx  |2 +-
 fpicker/source/win32/filepicker/VistaFilePicker.hxx |2 +-
 fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx |2 +-
 fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx |8 
 17 files changed, 25 insertions(+), 25 deletions(-)

New commits:
commit e4af83972e6be8b94772e46741500225ac166774
Author: Andrea Gelmini 
Date:   Fri Mar 24 11:38:26 2017 +0100

Fix typos

Change-Id: Ifb779b6c96a009e6c770a8017bb2e2031a288f5f
Reviewed-on: https://gerrit.libreoffice.org/35630
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/filter/source/graphicfilter/etiff/etiff.cxx 
b/filter/source/graphicfilter/etiff/etiff.cxx
index 43b6730c5b3b..01520ae90949 100644
--- a/filter/source/graphicfilter/etiff/etiff.cxx
+++ b/filter/source/graphicfilter/etiff/etiff.cxx
@@ -253,7 +253,7 @@ bool TIFFWriter::ImplWriteHeader( bool bMultiPage )
 
 // (OFS8) TIFF image file directory (IFD)
 mnCurrentTagCountPos = m_rOStm.Tell();
-m_rOStm.WriteUInt16( 0 );   // the number of tagentrys is 
to insert later
+m_rOStm.WriteUInt16( 0 );   // the number of tangents to 
insert later
 
 sal_uInt32 nSubFileFlags = 0;
 if ( bMultiPage )
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx 
b/filter/source/graphicfilter/ipict/ipict.cxx
index dd5024df94e1..bcdbc3caa867 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -1231,7 +1231,7 @@ void PictReader::ReadHeader()
   if (st < 2) { confidence[st] = --actualConfid; continue; }
   IsVersion2 = false; return;
 }
-if (sBuf[0] != 0x00) continue; // unrecovable error
+if (sBuf[0] != 0x00) continue; // unrecoverable error
 int numZero = 0;
 do
   {
diff --git a/filter/source/graphicfilter/ipict/shape.cxx 
b/filter/source/graphicfilter/ipict/shape.cxx
index 99b8719ad623..5aba327f869d 100644
--- a/filter/source/graphicfilter/ipict/shape.cxx
+++ b/filter/source/graphicfilter/ipict/shape.cxx
@@ -122,7 +122,7 @@ namespace PictReaderShape {
   }
 
   //  draws a rectangle 
-  /* Note(checkme): contradically with the QuickDraw's reference 3-23, it 
seems better to consider
+  /* Note(checkme): contradictally with the QuickDraw's reference 3-23, it 
seems better to consider
  that the frame/content of a rectangle appears inside the given rectangle. 
Does a conversion
  appear between the pascal functions and the data stored in the file ? */
   void drawRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const 
, Size const ) {
diff --git a/filter/source/msfilter/dffpropset.cxx 
b/filter/source/msfilter/dffpropset.cxx
index 214eb4808e88..5490fee57366 100644
--- a/filter/source/msfilter/dffpropset.cxx
+++ b/filter/source/msfilter/dffpropset.cxx
@@ -1160,7 +1160,7 @@ void DffPropSet::ReadPropSet( SvStream& rIn, bool 
bSetUninitializedOnly )
 // normally nContent is the complete size of the complex 
property,
 // but this is not always true for IMsoArrays ( what the hell 
is a IMsoArray ? )
 
-// I love special threatments :-(
+// I love special treatments :-(
 if ( ( nRecType == DFF_Prop_pVertices ) || ( nRecType == 
DFF_Prop_pSegmentInfo )
 || ( nRecType == DFF_Prop_fillShadeColors ) || ( nRecType 
== DFF_Prop_lineDashStyle )
 || ( nRecType == DFF_Prop_pWrapPolygonVertices ) || ( 
nRecType == DFF_Prop_connectorPoints )
diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index cac4f5b44066..b7e76ca57d6d 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -277,7 +277,7 @@ SvStream& 

[Libreoffice-commits] core.git: filter/source forms/source

2016-10-19 Thread Noel Grandin
 filter/source/graphicfilter/idxf/dxfgrprd.cxx|7 +--
 filter/source/graphicfilter/idxf/dxfgrprd.hxx|5 -
 filter/source/graphicfilter/idxf/dxfreprd.cxx|2 +-
 filter/source/graphicfilter/idxf/dxfreprd.hxx|1 -
 filter/source/msfilter/msdffimp.cxx  |2 +-
 filter/source/msfilter/viscache.hxx  |1 -
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx |7 +--
 filter/source/xsltdialog/xmlfiltersettingsdialog.hxx |1 -
 filter/source/xsltdialog/xmlfiltertestdialog.cxx |7 +--
 filter/source/xsltdialog/xmlfiltertestdialog.hxx |1 -
 forms/source/component/EventThread.cxx   |   14 ++
 forms/source/component/EventThread.hxx   |3 ---
 forms/source/component/GroupManager.cxx  |2 +-
 forms/source/component/GroupManager.hxx  |1 -
 forms/source/runtime/formoperations.cxx  |2 +-
 forms/source/runtime/formoperations.hxx  |4 
 forms/source/xforms/NameContainer.hxx|8 +---
 forms/source/xforms/mip.cxx  |   15 +++
 forms/source/xforms/mip.hxx  |7 ---
 19 files changed, 17 insertions(+), 73 deletions(-)

New commits:
commit 0aa24916cbea2ab3a843217be2c3be6c32c42ad5
Author: Noel Grandin 
Date:   Tue Oct 18 14:30:22 2016 +0200

loplugin:expandablemethodds in filter..forms

Change-Id: Ic1f64f804acc10b1a48d82de9fc6a2b39af465a0
Reviewed-on: https://gerrit.libreoffice.org/30014
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.cxx 
b/filter/source/graphicfilter/idxf/dxfgrprd.cxx
index 44672ed..caa2c42 100644
--- a/filter/source/graphicfilter/idxf/dxfgrprd.cxx
+++ b/filter/source/graphicfilter/idxf/dxfgrprd.cxx
@@ -154,7 +154,7 @@ sal_uInt16 DXFGroupReader::Read()
 if ( !bStatus )
 {
 nG = 0;
-SetS();
+S = "EOF";
 if ( nGCount != 0x )
 {
 // InfoBox(NULL,String("Error in group # 
")+String(nGCount)).Execute();
@@ -165,11 +165,6 @@ sal_uInt16 DXFGroupReader::Read()
 return nG;
 }
 
-void DXFGroupReader::SetS()
-{
-S = "EOF";
-}
-
 long DXFGroupReader::ReadI()
 {
 OString s = DXFReadLine(rIS);
diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.hxx 
b/filter/source/graphicfilter/idxf/dxfgrprd.hxx
index 8228208..c936b33 100644
--- a/filter/source/graphicfilter/idxf/dxfgrprd.hxx
+++ b/filter/source/graphicfilter/idxf/dxfgrprd.hxx
@@ -59,11 +59,6 @@ public:
 // This read must have returned a group code for datatype String.
 // If not NULL is returend
 
-// The following methods can change the current values of group codes
-// (e.g. to set default values, before 'blindly' reading lots of groups)
-
-void SetS(); // (will be copied)
-
 private:
 
 long   ReadI();
diff --git a/filter/source/graphicfilter/idxf/dxfreprd.cxx 
b/filter/source/graphicfilter/idxf/dxfreprd.cxx
index 838e270..4373e51 100644
--- a/filter/source/graphicfilter/idxf/dxfreprd.cxx
+++ b/filter/source/graphicfilter/idxf/dxfreprd.cxx
@@ -252,7 +252,7 @@ void DXFRepresentation::ReadHeader(DXFGroupReader & rDGR)
 continue;
 
 // If we already use UTF8, then don't update encoding anymore
-if (isTextEncodingUTF8())
+if (mEnc == RTL_TEXTENCODING_UTF8)
 continue;
 // FIXME: we really need a whole table of
 // $DWGCODEPAGE to encodings mappings
diff --git a/filter/source/graphicfilter/idxf/dxfreprd.hxx 
b/filter/source/graphicfilter/idxf/dxfreprd.hxx
index 66cc747..a7e15b2 100644
--- a/filter/source/graphicfilter/idxf/dxfreprd.hxx
+++ b/filter/source/graphicfilter/idxf/dxfreprd.hxx
@@ -111,7 +111,6 @@ private:
  DXFBoundingBox & rBox);
 
 bool isTextEncodingSet() const { return mEnc != RTL_TEXTENCODING_DONTKNOW; 
}
-bool isTextEncodingUTF8() const { return mEnc == RTL_TEXTENCODING_UTF8; }
 };
 
 
diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 92e887d..6c67b1e 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -178,7 +178,7 @@ void Impl_OlePres::Write( SvStream & rStm )
 sal_uLong nPos = rStm.Tell();
 rStm.WriteInt32( 0 );
 
-if( GetFormat() == SotClipboardFormatId::GDIMETAFILE && pMtf )
+if( nFormat == SotClipboardFormatId::GDIMETAFILE && pMtf )
 {
 // Always to 1/100 mm, until Mtf-Solution found
 // Assumption (no scaling, no origin translation)
diff --git a/filter/source/msfilter/viscache.hxx 
b/filter/source/msfilter/viscache.hxx
index ee1767c..608ca8f 100644
--- a/filter/source/msfilter/viscache.hxx
+++ 

[Libreoffice-commits] core.git: filter/source forms/source fpicker/source framework/inc framework/qa framework/source

2016-10-03 Thread Andrea Gelmini
 filter/source/config/cache/basecontainer.cxx |4 ++--
 filter/source/config/cache/basecontainer.hxx |2 +-
 filter/source/config/cache/cacheupdatelistener.hxx   |2 +-
 filter/source/config/cache/configflush.cxx   |2 +-
 filter/source/config/cache/filtercache.cxx   |6 +++---
 filter/source/config/cache/filtercache.hxx   |   10 
+-
 filter/source/config/cache/querytokenizer.hxx|2 +-
 filter/source/config/cache/typedetection.cxx |2 +-
 filter/source/config/cache/typedetection.hxx |2 +-
 filter/source/config/tools/merge/pyAltFCFGMerge  |2 +-
 filter/source/xsltdialog/xmlfiltertestdialog.cxx |2 +-
 forms/source/xforms/model_ui.cxx |2 +-
 fpicker/source/win32/filepicker/asyncrequests.hxx|2 +-
 framework/inc/classes/taskcreator.hxx|2 +-
 framework/inc/dispatch/interceptionhelper.hxx|2 +-
 framework/inc/helper/ocomponentenumeration.hxx   |4 ++--
 framework/inc/helper/oframes.hxx |2 +-
 framework/inc/services/desktop.hxx   |4 ++--
 framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java |2 +-
 framework/source/accelerators/keymapping.cxx |2 +-
 20 files changed, 29 insertions(+), 29 deletions(-)

New commits:
commit f0249a88fc502df142d36f2f67c976618b7ba6b6
Author: Andrea Gelmini 
Date:   Sat Oct 1 13:08:29 2016 +0200

Fix typos

Change-Id: I6730c6c5eab9157533822e5045e9f86109062580
Reviewed-on: https://gerrit.libreoffice.org/29433
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/filter/source/config/cache/basecontainer.cxx 
b/filter/source/config/cache/basecontainer.cxx
index 2c193f3..1869e75 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -425,7 +425,7 @@ css::uno::Reference< css::container::XEnumeration > 
SAL_CALL BaseContainer::crea
 // It hold a reference to us ... and call our container interface directly.
 // be aware of some direct callbacks if it will be created :-)
 
-/* Note: Its not allowed to return NULL. Because an empty enumeration
+/* Note: It's not allowed to return NULL. Because an empty enumeration
  transport the same information but make no trouble outside.
  Further its easier to work directly with the return value
  instaed of checking of NULL returns! */
@@ -484,7 +484,7 @@ void SAL_CALL BaseContainer::flush()
 // notify listener outside the lock!
 // The used listener helper lives if we live
 // and is threadsafe by itself.
-// Further its not a good idea to hold the own lock
+// Further it's not a good idea to hold the own lock
 // if an outside object is called :-)
 css::lang::EventObject aSource(static_cast< 
css::util::XFlushable* >(this));
 ::cppu::OInterfaceContainerHelper* pContainer = 
m_lListener.getContainer(cppu::UnoType::get());
diff --git a/filter/source/config/cache/basecontainer.hxx 
b/filter/source/config/cache/basecontainer.hxx
index 2d5d459..f02146c 100644
--- a/filter/source/config/cache/basecontainer.hxx
+++ b/filter/source/config/cache/basecontainer.hxx
@@ -178,7 +178,7 @@ class BaseContainer : public BaseLock
 
 /** @short  returns a pointer to the current used cache member.
 
-@descr  Its a point to the FilterCache instance behind 
m_pFlushCache
+@descr  It's a point to the FilterCache instance behind 
m_pFlushCache
 or m_rCache.
 
 @note   The lifetime of this pointer is restricted to the time, 
where
diff --git a/filter/source/config/cache/cacheupdatelistener.hxx 
b/filter/source/config/cache/cacheupdatelistener.hxx
index 17e4db5..a5385f8 100644
--- a/filter/source/config/cache/cacheupdatelistener.hxx
+++ b/filter/source/config/cache/cacheupdatelistener.hxx
@@ -65,7 +65,7 @@ class CacheUpdateListener : public BaseLock // must be the 
first one to guarante
 
 /** @short  initialize new instance of this class.
 
-@descr  Listening wont be started here. It can be done
+@descr  Listening won't be started here. It can be done
 by calling startListening() on this instance.
 
 @seestartListening()
diff --git a/filter/source/config/cache/configflush.cxx 
b/filter/source/config/cache/configflush.cxx
index 5820841..fc220f2 100644
--- a/filter/source/config/cache/configflush.cxx
+++ b/filter/source/config/cache/configflush.cxx
@@ -61,7 +61,7 @@ void SAL_CALL ConfigFlush::refresh()
 // notify 

[Libreoffice-commits] core.git: filter/source forms/source formula/source fpicker/source framework/source

2016-04-27 Thread Noel Grandin
 filter/source/graphicfilter/icgm/bundles.cxx  |7 
 filter/source/graphicfilter/icgm/cgm.cxx  |4 
 filter/source/graphicfilter/icgm/elements.cxx |   13 -
 filter/source/graphicfilter/ipict/ipict.cxx   |6 
 filter/source/graphicfilter/itiff/itiff.cxx   |6 
 filter/source/msfilter/escherex.cxx   |   35 +--
 filter/source/msfilter/msdffimp.cxx   |4 
 filter/source/msfilter/msoleexp.cxx   |3 
 filter/source/msfilter/msvbahelper.cxx|4 
 filter/source/msfilter/svdfppt.cxx|   96 
--
 filter/source/msfilter/util.cxx   |8 
 filter/source/svg/svgexport.cxx   |   23 +-
 filter/source/svg/svgfilter.cxx   |4 
 filter/source/svg/svgreader.cxx   |   12 -
 forms/source/richtext/richtextvclcontrol.cxx  |   12 -
 formula/source/core/api/FormulaCompiler.cxx   |6 
 fpicker/source/office/RemoteFilesDialog.cxx   |8 
 framework/source/jobs/jobdispatch.cxx |4 
 framework/source/uiconfiguration/imagemanagerimpl.cxx |   12 -
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |   16 -
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |   12 -
 framework/source/uielement/controlmenucontroller.cxx  |4 
 framework/source/xml/imagesdocumenthandler.cxx|8 
 23 files changed, 143 insertions(+), 164 deletions(-)

New commits:
commit 5e4fc9540993ee5e10f1986918acdd868a1fcf1b
Author: Noel Grandin 
Date:   Tue Apr 26 15:43:28 2016 +0200

clang-tidy modernize-loop-convert in f*

Change-Id: Id866aa244378758e3bdb9e99d02cdd2ae6104e16

diff --git a/filter/source/graphicfilter/icgm/bundles.cxx 
b/filter/source/graphicfilter/icgm/bundles.cxx
index df877fe..a81f6db 100644
--- a/filter/source/graphicfilter/icgm/bundles.cxx
+++ b/filter/source/graphicfilter/icgm/bundles.cxx
@@ -114,9 +114,8 @@ CGMFList& CGMFList::operator=( CGMFList& rSource )
 nFontsAvailable = rSource.nFontsAvailable;
 nFontNameCount  = rSource.nFontNameCount;
 nCharSetCount   = rSource.nCharSetCount;
-for ( size_t i = 0, n = rSource.aFontEntryList.size(); i < n; ++i )
+for (FontEntry* pPtr : rSource.aFontEntryList)
 {
-FontEntry* pPtr = rSource.aFontEntryList[ i ];
 FontEntry* pCFontEntry = new FontEntry;
 if ( pPtr->pFontName )
 {
@@ -248,8 +247,8 @@ void CGMFList::InsertCharSet( CharSetType eCharSetType, 
sal_uInt8* pSource, sal_
 
 void CGMFList::ImplDeleteList()
 {
-for ( size_t i = 0, n = aFontEntryList.size(); i < n; ++i )
-delete aFontEntryList[ i ];
+for (FontEntry* i : aFontEntryList)
+delete i;
 aFontEntryList.clear();
 }
 
diff --git a/filter/source/graphicfilter/icgm/cgm.cxx 
b/filter/source/graphicfilter/icgm/cgm.cxx
index b71aa03..30804b0 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -81,8 +81,8 @@ CGM::~CGM()
 mpGDIMetaFile->SetPrefSize( Size( static_cast< long >( mnOutdx ), 
static_cast< long >( mnOutdy ) ) );
 *mpGraphic = Graphic( *mpGDIMetaFile );
 }
-for( size_t i = 0, n = maDefRepList.size(); i < n; ++i )
-delete [] maDefRepList[i];
+for(sal_uInt8* i : maDefRepList)
+delete [] i;
 maDefRepList.clear();
 maDefRepSizeList.clear();
 delete mpBitmapInUse;
diff --git a/filter/source/graphicfilter/icgm/elements.cxx 
b/filter/source/graphicfilter/icgm/elements.cxx
index 60e4c0f..b548d93 100644
--- a/filter/source/graphicfilter/icgm/elements.cxx
+++ b/filter/source/graphicfilter/icgm/elements.cxx
@@ -292,8 +292,8 @@ void CGMElements::ImplInsertHatch( sal_Int32 nKey, int 
nStyle, long nDistance, l
 
 void CGMElements::DeleteAllBundles( BundleList& rList )
 {
-for ( size_t i = 0, n = rList.size(); i < n; ++i ) {
-delete rList[ i ];
+for (Bundle* i : rList) {
+delete i;
 }
 rList.clear();
 };
@@ -303,9 +303,8 @@ void CGMElements::CopyAllBundles( BundleList& rSource, 
BundleList& rDest )
 {
 DeleteAllBundles( rDest );
 
-for ( size_t i = 0, n = rSource.size(); i < n; ++i )
+for (Bundle* pPtr : rSource)
 {
-Bundle* pPtr = rSource[ i ];
 Bundle* pTempBundle = pPtr->Clone();
 rDest.push_back( pTempBundle );
 }
@@ -324,9 +323,9 @@ Bundle* CGMElements::GetBundleIndex( long nIndex, 
BundleList& rList, Bundle& rBu
 
 Bundle* CGMElements::GetBundle( BundleList& rList, long nIndex )
 {
-for ( size_t i = 0, n = rList.size(); i < n; ++i ) {
-if ( rList[ i ]->GetIndex() == nIndex ) {

[Libreoffice-commits] core.git: filter/source forms/source fpicker/source

2015-11-01 Thread Noel Grandin
 filter/source/config/cache/filtercache.cxx  |8 +++---
 filter/source/config/cache/typedetection.cxx|2 -
 filter/source/flash/swffilter.cxx   |2 -
 filter/source/graphicfilter/icgm/actimpr.cxx|4 +--
 filter/source/msfilter/eschesdo.cxx |6 ++--
 filter/source/msfilter/msocximex.cxx|3 --
 filter/source/msfilter/svdfppt.cxx  |2 -
 filter/source/svg/svgexport.cxx |4 +--
 filter/source/svg/svgimport.cxx |4 +--
 filter/source/svg/test/svg2odf.cxx  |3 --
 filter/source/t602/t602filter.cxx   |2 -
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx|8 +++---
 filter/source/xsltdialog/xmlfiltertestdialog.cxx|4 +--
 forms/source/component/ComboBox.cxx |2 -
 forms/source/component/DatabaseForm.cxx |2 -
 forms/source/component/FormComponent.cxx|6 ++--
 forms/source/component/FormattedFieldWrapper.cxx|   16 ++--
 forms/source/component/ListBox.cxx  |2 -
 forms/source/runtime/formoperations.cxx |2 -
 forms/source/xforms/model.cxx   |6 +---
 forms/source/xforms/submission.cxx  |3 --
 forms/source/xforms/submission/replace.cxx  |6 ++--
 forms/source/xforms/submission/serialization_urlencoded.cxx |2 -
 forms/source/xforms/submission/submission_get.cxx   |2 -
 fpicker/source/office/fpinteraction.cxx |8 +++---
 fpicker/source/win32/filepicker/FilePicker.cxx  |6 ++--
 fpicker/source/win32/folderpicker/workbench/Test_fops.cxx   |5 ---
 27 files changed, 56 insertions(+), 64 deletions(-)

New commits:
commit 1b41208608f472df8dd5879c27dca45cc2ea7740
Author: Noel Grandin 
Date:   Mon Nov 2 07:38:44 2015 +0200

use uno::Reference::set method instead of assignment

Change-Id: I3d94c94a9829161663a7ed18421ace38ce95a659
Reviewed-on: https://gerrit.libreoffice.org/19733
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/filter/source/config/cache/filtercache.cxx 
b/filter/source/config/cache/filtercache.cxx
index 65cba52..f4b0874 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -497,14 +497,14 @@ void FilterCache::addStatePropsToItem(  EItemType 
   eType,
 {
 case E_TYPE :
 {
-xPackage = css::uno::Reference< css::container::XNameAccess 
>(impl_openConfig(E_PROVIDER_TYPES), css::uno::UNO_QUERY_THROW);
+xPackage.set(impl_openConfig(E_PROVIDER_TYPES), 
css::uno::UNO_QUERY_THROW);
 xPackage->getByName(CFGSET_TYPES) >>= xSet;
 }
 break;
 
 case E_FILTER :
 {
-xPackage = css::uno::Reference< css::container::XNameAccess 
>(impl_openConfig(E_PROVIDER_FILTERS), css::uno::UNO_QUERY_THROW);
+xPackage.set(impl_openConfig(E_PROVIDER_FILTERS), 
css::uno::UNO_QUERY_THROW);
 xPackage->getByName(CFGSET_FILTERS) >>= xSet;
 }
 break;
@@ -532,14 +532,14 @@ void FilterCache::addStatePropsToItem(  EItemType 
   eType,
 }
 /* <-- HACK */
 
-xPackage = css::uno::Reference< css::container::XNameAccess 
>(impl_openConfig(E_PROVIDER_OTHERS), css::uno::UNO_QUERY_THROW);
+xPackage.set(impl_openConfig(E_PROVIDER_OTHERS), 
css::uno::UNO_QUERY_THROW);
 xPackage->getByName(CFGSET_FRAMELOADERS) >>= xSet;
 }
 break;
 
 case E_CONTENTHANDLER :
 {
-xPackage = css::uno::Reference< css::container::XNameAccess 
>(impl_openConfig(E_PROVIDER_OTHERS), css::uno::UNO_QUERY_THROW);
+xPackage.set(impl_openConfig(E_PROVIDER_OTHERS), 
css::uno::UNO_QUERY_THROW);
 xPackage->getByName(CFGSET_CONTENTHANDLERS) >>= xSet;
 }
 break;
diff --git a/filter/source/config/cache/typedetection.cxx 
b/filter/source/config/cache/typedetection.cxx
index a637d08..b25f1be 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -1013,7 +1013,7 @@ OUString TypeDetection::impl_askDetectService(const 
OUString&   sDet
 // third party components here, which can make trouble anyway.  So we
 // should handle errors during creation of such services more
 // gracefully .-)
-xDetector = css::uno::Reference< 
css::document::XExtendedFilterDetection >(
+

[Libreoffice-commits] core.git: filter/source forms/source

2014-04-14 Thread Takeshi Abe
 filter/source/xsltfilter/LibXSLTTransformer.cxx |7 ---
 filter/source/xsltfilter/OleHandler.cxx |9 +
 forms/source/component/EventThread.cxx  |8 +++-
 forms/source/richtext/richtextengine.cxx|5 ++---
 4 files changed, 14 insertions(+), 15 deletions(-)

New commits:
commit fbf5599c071c6f3203f8992aba4560be9b3b5e42
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Mon Apr 14 21:28:02 2014 +0900

Avoid possible memory leaks in case of exceptions

Change-Id: Id71cb49d8aa241a17efd4cbe217a48f2d7c34e84

diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx 
b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index 949f383..82ac99f 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -47,6 +47,7 @@
 
 #include LibXSLTTransformer.hxx
 #include OleHandler.hxx
+#include boost/scoped_ptr.hpp
 
 using namespace ::rtl;
 using namespace ::cppu;
@@ -307,11 +308,11 @@ namespace XSLT
 xsltSetGenericDebugFunc(stderr, NULL);
 xsltDebugDumpExtensions(NULL);
 #endif
-OleHandler* oh = new OleHandler(m_transformer-getComponentContext());
+boost::scoped_ptrOleHandler oh(new 
OleHandler(m_transformer-getComponentContext()));
 if (styleSheet)
 {
 tcontext = xsltNewTransformContext(styleSheet, doc);
-tcontext-_private = static_castvoid * (oh);
+tcontext-_private = static_castvoid * (oh.get());
 xsltQuoteUserParams(tcontext, params[0]);
 result = xsltApplyStylesheetUser(styleSheet, doc, 0, 0, 0,
 tcontext);
@@ -340,7 +341,7 @@ namespace XSLT
 m_transformer-error(msg);
 }
 closeOutput();
-delete(oh);
+oh.reset();
 xsltFreeStylesheet(styleSheet);
 xsltFreeTransformContext(tcontext);
 xmlFreeDoc(doc);
diff --git a/filter/source/xsltfilter/OleHandler.cxx 
b/filter/source/xsltfilter/OleHandler.cxx
index 4610f76..1515174 100644
--- a/filter/source/xsltfilter/OleHandler.cxx
+++ b/filter/source/xsltfilter/OleHandler.cxx
@@ -41,6 +41,7 @@
 #include com/sun/star/embed/XTransactedObject.hpp
 
 #include OleHandler.hxx
+#include boost/scoped_ptr.hpp
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
@@ -128,12 +129,12 @@ namespace XSLT
 }
 
 // Decompress the bytes
-::ZipUtils::Inflater* decompresser = new ::ZipUtils::Inflater(false);
+boost::scoped_ptr ::ZipUtils::Inflater decompresser(new 
::ZipUtils::Inflater(false));
 decompresser-setInput(content);
 Sequencesal_Int8 result(oleLength);
 decompresser-doInflateSegment(result, 0, oleLength);
 decompresser-end();
-delete decompresser;
+decompresser.reset();
 //return the base64 string of the uncompressed data
 OUStringBuffer buf(oleLength);
 ::sax::Converter::encodeBase64(buf, result);
@@ -196,11 +197,11 @@ namespace XSLT
 
 // Compress the bytes
 Sequencesal_Int8 output(oledata.getLength());
-::ZipUtils::Deflater* compresser = new 
::ZipUtils::Deflater((sal_Int32) 3, false);
+boost::scoped_ptr ::ZipUtils::Deflater compresser(new 
::ZipUtils::Deflater((sal_Int32) 3, false));
 compresser-setInputSegment(oledata, 0, oledata.getLength());
 compresser-finish();
 int compressedDataLength = compresser-doDeflateSegment(output, 0, 
oledata.getLength());
-delete(compresser);
+compresser.reset();
 //realloc the data length
 Sequencesal_Int8 compressed(compressedDataLength);
 for (int i = 0; i  compressedDataLength; i++) {
diff --git a/forms/source/component/EventThread.cxx 
b/forms/source/component/EventThread.cxx
index 6a5b0a6..d385ee8 100644
--- a/forms/source/component/EventThread.cxx
+++ b/forms/source/component/EventThread.cxx
@@ -20,7 +20,7 @@
 #include EventThread.hxx
 #include comphelper/guarding.hxx
 #include tools/debug.hxx
-
+#include boost/scoped_ptr.hpp
 
 namespace frm
 {
@@ -176,7 +176,7 @@ void OComponentEventThread::run()
 ::cppu::OComponentHelper *pCompImpl = m_pCompImpl;
 
 ThreadEvents::iterator firstEvent( m_aEvents.begin() );
-EventObject* pEvt = *firstEvent;
+boost::scoped_ptrEventObject pEvt(*firstEvent);
 m_aEvents.erase( firstEvent );
 
 ThreadObjects::iterator firstControl( m_aControls.begin() );
@@ -196,10 +196,8 @@ void OComponentEventThread::run()
 query_interface(xControlAdapter-queryAdapted(), xControl);
 
 if( xComp.is() )
-processEvent( pCompImpl, pEvt, xControl, bFlag );
+processEvent( pCompImpl, pEvt.get(), xControl, bFlag );
 }
-
-delete pEvt;
 };
 
 // After a Dispose, we do not know the