[PATCH] fix for unused return value.

2013-06-03 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/4140

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/40/4140/1

fix for unused return value.

This code was introduced by:
   commit d09dd8986436f17717443823ef18bd8552fdf408
   Author: Frank Schoenheit [fs] frank.schoenh...@sun.com
   Date:   Wed Sep 15 13:55:34 2010 +0200
   dba34a: export/import min-/max-/default-/value for date/time as
   XML-Schema conformant strings
It looks like it intended to use determineDefaultServiceName(), but
neglected to store the return value.

Change-Id: I1607f39cf771b594389492785c7e72478d44843a
---
M xmloff/source/forms/elementimport.cxx
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/xmloff/source/forms/elementimport.cxx 
b/xmloff/source/forms/elementimport.cxx
index 9d180b0..443209f 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -184,7 +184,7 @@
 }
 
 if ( m_sServiceName.isEmpty() )
-determineDefaultServiceName();
+m_sServiceName = determineDefaultServiceName();
 
 // create the object *now*. This allows setting properties in the 
various handleAttribute methods.
 // (Though currently not all code is migrated to this pattern, most 
attributes are still handled

-- 
To view, visit https://gerrit.libreoffice.org/4140
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1607f39cf771b594389492785c7e72478d44843a
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] fix awt::UnoControlModelDialog crash

2013-05-23 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/4013

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/13/4013/1

fix awt::UnoControlModelDialog crash

...in commit 6c61b20a8d4a6dcac28801cde82a211fb7e30654,
Convert awt::UnoControlDialogModel to new style
I added an attribute ResourceResolver because some of the client
code was setting it using the property interface.

It turns out that this was a bad idea because the ResourceResolver
property is doing some very interesting stuff, so revert that part
of the change.

Change-Id: I62b890e60164e005867ced49c3e407a49ed09441
---
M include/toolkit/controls/dialogcontrol.hxx
M offapi/com/sun/star/awt/XUnoControlDialogModel.idl
M offapi/com/sun/star/resource/XStringResourceManager.idl
M offapi/com/sun/star/resource/XStringResourceResolver.idl
M scripting/source/dlgprov/dlgprov.cxx
M toolkit/source/controls/dialogcontrol.cxx
6 files changed, 7 insertions(+), 17 deletions(-)



diff --git a/include/toolkit/controls/dialogcontrol.hxx 
b/include/toolkit/controls/dialogcontrol.hxx
index f92652a..a749c24 100644
--- a/include/toolkit/controls/dialogcontrol.hxx
+++ b/include/toolkit/controls/dialogcontrol.hxx
@@ -166,9 +166,6 @@
{ return getPropertyString(ImageURL); }
 virtual void SAL_CALL setImageURL(const rtl::OUString p1) 
throw(::com::sun::star::uno::RuntimeException)
{ setPropertyString(ImageURL, p1); }
-virtual 
com::sun::star::uno::Referencecom::sun::star::resource::XStringResourceManager
 SAL_CALL getResourceResolver() throw(::com::sun::star::uno::RuntimeException);
-virtual void SAL_CALL setResourceResolver(const 
com::sun::star::uno::Referencecom::sun::star::resource::XStringResourceManager
 p1) throw(::com::sun::star::uno::RuntimeException)
-{ setPropertyValue( ResourceResolver, css::uno::Any(p1) ); }
 virtual com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptor() 
throw(::com::sun::star::uno::RuntimeException);
 virtual void SAL_CALL setFontDescriptor(const 
com::sun::star::awt::FontDescriptor p1) 
throw(::com::sun::star::uno::RuntimeException)
 { setPropertyValue( FontDescriptor, css::uno::Any(p1) ); }
diff --git a/offapi/com/sun/star/awt/XUnoControlDialogModel.idl 
b/offapi/com/sun/star/awt/XUnoControlDialogModel.idl
index 81cd2b1..9032a37 100644
--- a/offapi/com/sun/star/awt/XUnoControlDialogModel.idl
+++ b/offapi/com/sun/star/awt/XUnoControlDialogModel.idl
@@ -28,7 +28,6 @@
 #include com/sun/star/lang/XMultiServiceFactory.idl
 #include com/sun/star/util/Color.idl
 #include com/sun/star/graphic/XGraphic.idl
-#include com/sun/star/resource/XStringResourceManager.idl
 
 
 module com {  module sun {  module star {  module awt {
@@ -66,8 +65,6 @@
 [attribute] long Height;
 
 [attribute] string DialogSourceURL;
-
-[attribute] com::sun::star::resource::XStringResourceManager 
ResourceResolver;
 
 /** specifies the text that is displayed in the caption bar of the dialog.
  */
diff --git a/offapi/com/sun/star/resource/XStringResourceManager.idl 
b/offapi/com/sun/star/resource/XStringResourceManager.idl
index 423bedf..ad9a8f3 100644
--- a/offapi/com/sun/star/resource/XStringResourceManager.idl
+++ b/offapi/com/sun/star/resource/XStringResourceManager.idl
@@ -44,7 +44,7 @@
 localized dialogs.
 
 */
-published interface XStringResourceManager: 
com::sun::star::resource::XStringResourceResolver
+interface XStringResourceManager: 
com::sun::star::resource::XStringResourceResolver
 {
 /**
 Returns the resource's read only state
diff --git a/offapi/com/sun/star/resource/XStringResourceResolver.idl 
b/offapi/com/sun/star/resource/XStringResourceResolver.idl
index 49bd841..d236f0d 100644
--- a/offapi/com/sun/star/resource/XStringResourceResolver.idl
+++ b/offapi/com/sun/star/resource/XStringResourceResolver.idl
@@ -42,7 +42,7 @@
 But also changing the locale at runtime can be supported in this way.
 
 */
-published interface XStringResourceResolver: 
com::sun::star::util::XModifyBroadcaster
+interface XStringResourceResolver: com::sun::star::util::XModifyBroadcaster
 {
 /**
 Resolves the passed ResoureID for the current locale. This
diff --git a/scripting/source/dlgprov/dlgprov.cxx 
b/scripting/source/dlgprov/dlgprov.cxx
index 8722a47..8c645a3 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -88,6 +88,8 @@
 {
 //.
 
+static OUString aResourceResolverPropName(ResourceResolver);
+
 Reference resource::XStringResourceManager  
lcl_getStringResourceManager(const Reference XComponentContext  
i_xContext,const OUString i_sURL)
 {
 INetURLObject aInetObj( i_sURL );
@@ -147,7 +149,9 @@
 // Set resource property
 if( xStringResourceManager.is() )
 {
-xDialogModel-setResourceResolver( xStringResourceManager );
+Any 

[PATCH] Use the new type-checking Reference constructor to reduce co...

2013-05-22 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/4001

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/01/4001/1

Use the new type-checking Reference constructor to reduce code noise

Also create a Clang compiler plugin to detect such cases.

Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752
---
M basctl/source/basicide/baside3.cxx
M basctl/source/basicide/moduldl2.cxx
M basic/source/basmgr/basicmanagerrepository.cxx
M basic/source/uno/dlgcont.cxx
M basic/source/uno/namecont.cxx
M comphelper/source/processfactory/processfactory.cxx
A compilerplugins/clang/store/referencecasting.cxx
A compilerplugins/clang/store/referencecasting.hxx
M cui/source/dialogs/hangulhanjadlg.cxx
M cui/source/options/optdict.cxx
M dbaccess/source/core/dataaccess/ModelImpl.cxx
M dbaccess/source/core/dataaccess/connection.cxx
M dbaccess/source/core/dataaccess/datasource.cxx
M dbaccess/source/core/dataaccess/documentdefinition.cxx
M dbaccess/source/core/recovery/subcomponentloader.cxx
M dbaccess/source/ext/macromigration/migrationengine.cxx
M dbaccess/source/ui/app/subcomponentmanager.cxx
M dbaccess/source/ui/browser/exsrcbrw.cxx
M dbaccess/source/ui/dlg/dbwizsetup.cxx
M desktop/source/app/app.cxx
M extensions/source/abpilot/datasourcehandling.cxx
M extensions/source/bibliography/datman.cxx
M extensions/source/propctrlr/formcomponenthandler.cxx
M extensions/source/propctrlr/formgeometryhandler.cxx
M extensions/source/propctrlr/formlinkdialog.cxx
M filter/source/msfilter/svdfppt.cxx
M filter/source/svg/svgexport.cxx
M filter/source/svg/svgwriter.cxx
M filter/source/xsltdialog/xmlfiltertestdialog.cxx
M forms/source/component/FormattedField.cxx
M forms/source/component/navigationbar.cxx
M forms/source/component/scrollbar.cxx
M forms/source/component/spinbutton.cxx
M forms/source/misc/InterfaceContainer.cxx
M forms/source/xforms/model.cxx
M forms/source/xforms/model_ui.cxx
M forms/source/xforms/submission.cxx
M forms/source/xforms/submission/replace.cxx
M framework/source/fwe/helper/actiontriggerhelper.cxx
M framework/source/fwe/helper/documentundoguard.cxx
M framework/source/fwe/xml/menuconfiguration.cxx
M framework/source/fwe/xml/statusbarconfiguration.cxx
M framework/source/layoutmanager/layoutmanager.cxx
M framework/source/services/backingwindow.cxx
M framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
M framework/source/uiconfiguration/uiconfigurationmanager.cxx
M framework/source/uielement/toolbarmanager.cxx
M framework/source/uifactory/menubarfactory.cxx
M framework/source/uifactory/uielementfactorymanager.cxx
M framework/source/xml/imagesconfiguration.cxx
M oox/source/drawingml/chart/converterbase.cxx
M oox/source/drawingml/textfield.cxx
M oox/source/drawingml/textparagraph.cxx
M oox/source/drawingml/textrun.cxx
M oox/source/export/drawingml.cxx
M oox/source/export/shapes.cxx
M oox/source/helper/containerhelper.cxx
M package/source/manifest/ManifestWriter.cxx
M sc/source/filter/excel/xecontent.cxx
M sc/source/filter/excel/xichart.cxx
M sc/source/filter/oox/stylesbuffer.cxx
M sc/source/filter/oox/viewsettings.cxx
M sc/source/filter/oox/workbookhelper.cxx
M sc/source/filter/oox/worksheetbuffer.cxx
M scripting/source/dlgprov/dlgprov.cxx
M scripting/source/provider/BrowseNodeFactoryImpl.cxx
M scripting/source/stringresource/stringresource.cxx
M sd/source/core/CustomAnimationEffect.cxx
M sd/source/core/sdpage2.cxx
M sd/source/core/stlpool.cxx
M sd/source/filter/eppt/pptexanimations.cxx
M sd/source/ui/animations/CustomAnimationPane.cxx
M sd/source/ui/framework/factories/BasicViewFactory.cxx
M sd/source/ui/view/ViewShellBase.cxx
M sdext/source/minimizer/graphiccollector.cxx
M sdext/source/presenter/PresenterViewFactory.cxx
M sfx2/source/appl/newhelp.cxx
M sfx2/source/dialog/taskpane.cxx
M sfx2/source/view/frame2.cxx
M sfx2/source/view/viewfrm.cxx
M svtools/source/contnr/templwin.cxx
M svx/source/dialog/rubydialog.cxx
M svx/source/form/filtnav.cxx
M svx/source/form/fmobj.cxx
M svx/source/form/fmpgeimp.cxx
M svx/source/form/fmshimp.cxx
M svx/source/form/fmtools.cxx
M svx/source/form/fmundo.cxx
M svx/source/form/fmvwimp.cxx
M svx/source/form/formcontroller.cxx
M svx/source/form/formcontrolling.cxx
M svx/source/form/navigatortree.cxx
M svx/source/form/navigatortreemodel.cxx
M sw/source/filter/xml/xmlexp.cxx
M sw/source/filter/xml/xmltbli.cxx
M sw/source/ui/dbui/dbmgr.cxx
M sw/source/ui/dbui/dbtree.cxx
M toolkit/source/controls/controlmodelcontainerbase.cxx
M toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
M toolkit/source/controls/tabpagecontainer.cxx
M ucb/source/cacher/dynamicresultsetwrapper.cxx
M ucb/source/ucp/file/bc.cxx
M ucb/source/ucp/file/filglob.cxx
M ucb/source/ucp/ftp/ftpcontent.cxx
M unotools/source/config/configitem.cxx
M unoxml/source/dom/attr.cxx
M unoxml/source/dom/characterdata.cxx
M unoxml/source/dom/document.cxx
M unoxml/source/dom/element.cxx
M unoxml/source/dom/node.cxx
M unoxml/source/dom/node.hxx
M 

[PUSHED] Use the new type-checking Reference constructor to reduce co...

2013-05-22 Thread Noel Grandin (via Code Review)
Hi,

Thank you for your patch!  It has been merged to LibreOffice.

If you are interested in details, please visit

https://gerrit.libreoffice.org/4001

Approvals:
  Noel Grandin: Verified; Looks good to me, approved
  LibreOffice gerrit bot: Verified


-- 
To view, visit https://gerrit.libreoffice.org/4001
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752
Gerrit-PatchSet: 2
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com
Gerrit-Reviewer: LibreOffice gerrit bot ger...@libreoffice.org
Gerrit-Reviewer: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] move DBG_UNHANDLED_EXCEPTION out of line

2013-05-21 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3988

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/88/3988/1

move DBG_UNHANDLED_EXCEPTION out of line

makes it easier to set a breakpoint on it.
Plus it's getting a little big to be a macro.

Change-Id: I2827aa3618ba966fbc85a4a56e0e794a55630730
---
M include/tools/diagnose_ex.h
M tools/source/debug/debug.cxx
2 files changed, 54 insertions(+), 39 deletions(-)



diff --git a/include/tools/diagnose_ex.h b/include/tools/diagnose_ex.h
index 261c0ae..a38b2d4 100644
--- a/include/tools/diagnose_ex.h
+++ b/include/tools/diagnose_ex.h
@@ -30,6 +30,8 @@
 #define OSL_UNUSED( expression ) \
 (void)(expression)
 
+
+
 #if OSL_DEBUG_LEVEL  0
 #include com/sun/star/configuration/CorruptedConfigurationException.hpp
 #include com/sun/star/task/ErrorCodeIOException.hpp
@@ -39,51 +41,15 @@
 #include boost/current_function.hpp
 #include typeinfo
 
+void DbgUnhandledException(const ::com::sun::star::uno::Any 
caughtException, const char* currentFunction);
+
 /** reports a caught UNO exception via OSL diagnostics
 
 Note that whenever you use this, it might be an indicator that your 
error
 handling is not correct 
 */
 #define DBG_UNHANDLED_EXCEPTION()   \
-::com::sun::star::uno::Any caught( ::cppu::getCaughtException() ); \
-OString sMessage( caught an exception! ); \
-sMessage += \nin function:; \
-sMessage += BOOST_CURRENT_FUNCTION; \
-sMessage += \ntype: ; \
-sMessage += OUStringToOString( caught.getValueTypeName(), 
osl_getThreadTextEncoding() ); \
-::com::sun::star::uno::Exception exception; \
-caught = exception; \
-if ( !exception.Message.isEmpty() ) \
-{ \
-sMessage += \nmessage: ; \
-sMessage += OUStringToOString( exception.Message, 
osl_getThreadTextEncoding() ); \
-} \
-if ( exception.Context.is() ) \
-{ \
-const char* pContext = typeid( *exception.Context.get() ).name(); \
-sMessage += \ncontext: ; \
-sMessage += pContext; \
-} \
-{ \
-::com::sun::star::configuration::CorruptedConfigurationException \
-specialized; \
-if ( caught = specialized ) \
-{ \
-sMessage += \ndetails: ; \
-sMessage += OUStringToOString( \
-specialized.Details, osl_getThreadTextEncoding() ); \
-} \
-} \
-{ \
-::com::sun::star::task::ErrorCodeIOException specialized; \
-if ( caught = specialized ) \
-{ \
-sMessage += \ndetails: ; \
-sMessage += OString::valueOf( specialized.ErrCode ); \
-} \
-} \
-sMessage += \n; \
-OSL_ENSURE( false, sMessage.getStr() )
+DbgUnhandledException( ::cppu::getCaughtException(), 
BOOST_CURRENT_FUNCTION);
 
 #else   // OSL_DEBUG_LEVEL
 #define DBG_UNHANDLED_EXCEPTION()
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index 104353b..eec15eb 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -42,6 +42,7 @@
 #include vector
 
 #include osl/diagnose.h
+#include tools/diagnose_ex.h
 
 #ifdef DBG_UTIL
 
@@ -1585,4 +1586,52 @@
 
 #endif
 
+
+#if OSL_DEBUG_LEVEL  0
+
+void DbgUnhandledException(const css::uno::Any  caught, const char* 
currentFunction)
+{
+OString sMessage( caught an exception! );
+sMessage += \nin function:;
+sMessage += currentFunction;
+sMessage += \ntype: ;
+sMessage += OUStringToOString( caught.getValueTypeName(), 
osl_getThreadTextEncoding() );
+::com::sun::star::uno::Exception exception;
+caught = exception;
+if ( !exception.Message.isEmpty() )
+{
+sMessage += \nmessage: ;
+sMessage += OUStringToOString( exception.Message, 
osl_getThreadTextEncoding() );
+}
+if ( exception.Context.is() )
+{
+const char* pContext = typeid( *exception.Context.get() ).name();
+sMessage += \ncontext: ;
+sMessage += pContext;
+}
+{
+::com::sun::star::configuration::CorruptedConfigurationException
+specialized;
+if ( caught = specialized )
+{
+sMessage += \ndetails: ;
+sMessage += OUStringToOString(
+specialized.Details, osl_getThreadTextEncoding() );
+}
+}
+{
+::com::sun::star::task::ErrorCodeIOException specialized;
+if ( caught = specialized )
+{
+sMessage += \ndetails: ;
+sMessage += OString::valueOf( specialized.ErrCode );
+}
+}
+sMessage += \n;
+OSL_ENSURE( 

[PATCH] Remove code associated with psprint::CompatMetricOverride se...

2013-05-08 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3824

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/24/3824/1

Remove code associated with psprint::CompatMetricOverride service

We don't actually have any implementations of this service.

This service was introduced by
   commit 01cf48436df2cc3f01d1c57cc4348fc037ef
   Author: Kurt Zenker k...@openoffice.org
   Date:   Wed Jun 20 09:07:44 2007 +
   INTEGRATION: CWS compmetric (1.77.2); FILE MERGED
   2007/05/09 16:27:46 pl 1.77.2.2: #146890# algorithm is needed
   2007/05/09 12:13:59 pl 1.77.2.1: #146890# backwards compatibility 
service for metrics

Michael Stahl seems to think it was a Sun-internal hack introduced
for a specific customer.

Change-Id: I1b27778f827504c2adb0e27e8d7c0f0dedcaf940
---
M include/vcl/fontmanager.hxx
M include/vcl/print.hxx
M padmin/source/prtsetup.cxx
M sw/inc/IDocumentSettingAccess.hxx
M sw/source/core/doc/doc.cxx
M sw/source/filter/xml/xmlimp.cxx
M sw/source/ui/uno/SwXDocumentSettings.cxx
M vcl/generic/fontmanager/fontmanager.cxx
M vcl/generic/print/genpspgraphics.cxx
M vcl/inc/salprn.hxx
M vcl/source/gdi/print.cxx
11 files changed, 17 insertions(+), 265 deletions(-)



diff --git a/include/vcl/fontmanager.hxx b/include/vcl/fontmanager.hxx
index 05955f9..41cf2e2 100644
--- a/include/vcl/fontmanager.hxx
+++ b/include/vcl/fontmanager.hxx
@@ -284,8 +284,6 @@
 
 mutable FontCache*
m_pFontCache;
 
-mutable std::vector fontIDm_aOverrideFonts;
-
 OString getAfmFile( PrintFont* pFont ) const;
 OString getFontFile( PrintFont* pFont ) const;
 
@@ -343,8 +341,6 @@
 */
 bool addFontconfigDir(const OString rDirectory);
 
-bool readOverrideMetrics();
-
 std::setOString m_aPreviousLangSupportRequests;
 std::vectorOString m_aCurrentRequests;
 Timer m_aFontInstallerTimer;
@@ -371,9 +367,9 @@
 // returns the ids of all managed fonts. on pParser != NULL
 // all fonttype::Builtin type fonts are not listed
 // which do not occur in the PPD of pParser
-void getFontList( std::list fontID  rFontIDs, const PPDParser* pParser 
= NULL, bool bUseOverrideMetrics = false );
+void getFontList( std::list fontID  rFontIDs, const PPDParser* pParser 
= NULL );
 // get the font list and fast font info. see getFontList for pParser
-void getFontListWithFastInfo( std::list FastPrintFontInfo  rFonts, 
const PPDParser* pParser = NULL, bool bUseOverrideMetrics = false );
+void getFontListWithFastInfo( std::list FastPrintFontInfo  rFonts, 
const PPDParser* pParser = NULL );
 
 // get font info for a specific font
 bool getFontInfo( fontID nFontID, PrintFontInfo rInfo ) const;
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index c40e8bc..c0cb364 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -357,8 +357,6 @@
 voidSetErrorHdl( const Link rLink ) { maErrorHdl 
= rLink; }
 const Link GetErrorHdl() const { return maErrorHdl; }
 
-voidCompat_OldPrinterMetrics( bool bSet );
-
 /** checks the printer list and updates it necessary
 *
 *   sends a DataChanged event of type DATACHANGED_PRINTER
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index 53d09ce..15c5fc5 100644
--- a/padmin/source/prtsetup.cxx
+++ b/padmin/source/prtsetup.cxx
@@ -650,7 +650,7 @@
 // fill to box
 PrintFontManager rFontManager = PrintFontManager::get();
 ::std::list FastPrintFontInfo  aFonts;
-rFontManager.getFontListWithFastInfo( aFonts, 
m_pParent-m_aJobData.m_pParser, false );
+rFontManager.getFontListWithFastInfo( aFonts, 
m_pParent-m_aJobData.m_pParser );
 ::std::list FastPrintFontInfo ::const_iterator it;
 ::boost::unordered_map OUString, int, OUStringHash  aToMap, aFromMap;
 for( it = aFonts.begin(); it != aFonts.end(); ++it )
diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index 8214f1a..1203915 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -65,7 +65,6 @@
  CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME,
 
  UNIX_FORCE_ZERO_EXT_LEADING,
- USE_OLD_PRINTER_METRICS,
  TABS_RELATIVE_TO_INDENT,
  PROTECT_FORM,
  // #i89181#
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index c8e6c90..db23e35 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -181,7 +181,6 @@
 // #i68949#
 case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME: return 
mbClipAsCharacterAnchoredWriterFlyFrames;
 case UNIX_FORCE_ZERO_EXT_LEADING: return mbUnixForceZeroExtLeading;
-case USE_OLD_PRINTER_METRICS: return mbOldPrinterMetrics;
 case TABS_RELATIVE_TO_INDENT : return mbTabRelativeToIndent;
 case PROTECT_FORM: 

[PATCH] Clang cleanup, unaligned if statement

2013-04-29 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3677

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/77/3677/1

Clang cleanup, unaligned if statement

The extra semi-colons were confusing clang. Just remove the macro,
it's not adding any real value.

Change-Id: I7f7c312d2c0167a17e31624e197ae75b77fa0c2f
---
M cppcanvas/source/mtfrenderer/emfplus.cxx
1 file changed, 3 insertions(+), 7 deletions(-)



diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx 
b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 2a3d9de..52fc36b 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -870,10 +870,6 @@
  (x  8)  0xff, \
  x  0xff), \
 
rCanvas-getUNOCanvas()-getDevice()-getDeviceColorSpace());
-#define SET_FILL_COLOR(x) \
-rState.fillColor = COLOR(x);
-#define SET_TEXT_COLOR(x) \
-rState.textColor = COLOR(x);
 
 void ImplRenderer::EMFPPlusFillPolygon (::basegfx::B2DPolyPolygon 
polygon, const ActionFactoryParameters rParms,
 OutDevState rState, const 
CanvasSharedPtr rCanvas, bool isColor, sal_uInt32 brushIndexOrColor)
@@ -891,7 +887,7 @@
 rState.isFillColorSet = true;
 rState.isLineColorSet = false;
 
-SET_FILL_COLOR(brushIndexOrColor);
+rState.fillColor = COLOR(brushIndexOrColor);
 
 pPolyAction = ActionSharedPtr ( 
internal::PolyPolyActionFactory::createPolyPolyAction( localPolygon, 
rParms.mrCanvas, rState ) );
 
@@ -1641,7 +1637,7 @@
 OUString text = read_uInt16s_ToOUString(rMF, 
stringLength);
 
 double cellSize = setFont (flags  0xff, 
rFactoryParms, rState);
-SET_TEXT_COLOR( brushId );
+rState.textColor = COLOR( brushId );
 
 ActionSharedPtr pTextAction(
 TextActionFactory::createTextAction(
@@ -1881,7 +1877,7 @@
 setFont (flags  0xff, rFactoryParms, rState);
 
 if( flags  0x8000 )
-SET_TEXT_COLOR(brushIndexOrColor);
+rState.textColor = COLOR( brushIndexOrColor );
 
 ActionSharedPtr pTextAction(
 TextActionFactory::createTextAction(

-- 
To view, visit https://gerrit.libreoffice.org/3677
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f7c312d2c0167a17e31624e197ae75b77fa0c2f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Clang cleanup, unused mutex variables

2013-04-29 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3678

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/78/3678/1

Clang cleanup, unused mutex variables

Some of these were doing nothing useful at all. I removed those.
A couple were protecting static data, and I fixed those to use Mutex
and MutexGuard properly.

Change-Id: I444d13f8b6c50e526cce8d69d09aeaf240e5c6ca
---
M drawinglayer/source/geometry/viewinformation2d.cxx
M drawinglayer/source/geometry/viewinformation3d.cxx
M drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
M drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
M drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
M svx/source/sdr/primitive2d/sdrprimitivetools.cxx
6 files changed, 5 insertions(+), 16 deletions(-)



diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx 
b/drawinglayer/source/geometry/viewinformation2d.cxx
index f7d0de8..8d7bc4c 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -20,7 +20,6 @@
 #include drawinglayer/geometry/viewinformation2d.hxx
 #include basegfx/matrix/b2dhommatrix.hxx
 #include basegfx/range/b2drange.hxx
-#include osl/mutex.hxx
 #include basegfx/tools/canvastools.hxx
 #include com/sun/star/geometry/AffineMatrix2D.hpp
 #include com/sun/star/geometry/RealRectangle2D.hpp
@@ -322,8 +321,6 @@
 
 const basegfx::B2DRange getDiscreteViewport() const
 {
-::osl::Mutex m_mutex;
-
 if(maDiscreteViewport.isEmpty()  !maViewport.isEmpty())
 {
 basegfx::B2DRange aDiscreteViewport(maViewport);
@@ -336,8 +333,6 @@
 
 const basegfx::B2DHomMatrix getObjectToViewTransformation() const
 {
-::osl::Mutex m_mutex;
-
 if(maObjectToViewTransformation.isIdentity() 
 (!maObjectTransformation.isIdentity() || 
!maViewTransformation.isIdentity()))
 {
@@ -350,8 +345,6 @@
 
 const basegfx::B2DHomMatrix 
getInverseObjectToViewTransformation() const
 {
-::osl::Mutex m_mutex;
-
 if(maInverseObjectToViewTransformation.isIdentity() 
 (!maObjectTransformation.isIdentity() || 
!maViewTransformation.isIdentity()))
 {
diff --git a/drawinglayer/source/geometry/viewinformation3d.cxx 
b/drawinglayer/source/geometry/viewinformation3d.cxx
index 7593dc0..4707be1 100644
--- a/drawinglayer/source/geometry/viewinformation3d.cxx
+++ b/drawinglayer/source/geometry/viewinformation3d.cxx
@@ -392,7 +392,6 @@
 const basegfx::B3DHomMatrix getObjectToView() const
 {
 // on demand WorldToView creation
-::osl::Mutex m_mutex;
 
 if(maObjectToView.isIdentity())
 {
@@ -404,8 +403,6 @@
 
 const uno::Sequence beans::PropertyValue  
getViewInformationSequence() const
 {
-::osl::Mutex m_mutex;
-
 if(!mxViewInformation.hasElements())
 {
 const_cast ImpViewInformation3D* 
(this)-impFillViewInformationFromContent();
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx 
b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index 77487db..495c06f 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -42,9 +42,10 @@
 static Primitive3DSequence aLineTubeList;
 static sal_uInt32 nLineTubeSegments(0L);
 static attribute::MaterialAttribute3D aLineMaterial;
+static ::osl::Mutex aMutex;
 
 // may exclusively change static data, use mutex
-::osl::Mutex m_mutex;
+::osl::MutexGuard aGuard(aMutex);
 
 if(nSegments != nLineTubeSegments || !(rMaterial == 
aLineMaterial))
 {
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx 
b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index a488ad0..1987102 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -377,7 +377,6 @@
 // again when no longer geometry is needed for non-visible 3D 
objects as it is now for chart
 if(getPolyPolygon().count()  !maSlices.size())
 {
-::osl::Mutex m_mutex;
 const_cast SdrExtrudePrimitive3D (*this).impCreateSlices();
 }
 
@@ -493,7 +492,6 @@
 {
 // conditions of last local decomposition with reduced 
lines have changed. Remember
 // new one and clear current decompositiopn
-::osl::Mutex m_mutex;
 

[PATCH] fdo#46808, Convert some XMultiServiceFactory to XComponentCo...

2013-04-29 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3681

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/81/3681/1

fdo#46808, Convert some XMultiServiceFactory to XComponentContext

The new constructor is not happy with forward declarations of types
so I need to updates lots of files to include the necessary headers.

Change-Id: I1dcfee9fa0fdc4457754396ffb52cc8462f3906a
---
M accessibility/source/extended/accessibletabbar.cxx
M accessibility/source/standard/accessiblemenucomponent.cxx
M basctl/source/basicide/baside2b.cxx
M canvas/source/tools/canvastools.cxx
M chart2/source/controller/dialogs/tp_DataSource.cxx
M connectivity/source/commontools/dbtools2.cxx
M dbaccess/source/ui/control/sqledit.cxx
M dbaccess/source/ui/dlg/UserAdmin.cxx
M dbaccess/source/ui/dlg/adminpages.cxx
M desktop/source/deployment/registry/dp_backend.cxx
M extensions/source/propctrlr/formlinkdialog.cxx
M filter/source/msfilter/msocximex.cxx
M forms/source/runtime/formoperations.cxx
M fpicker/source/generic/fpicker.cxx
M include/com/sun/star/uno/Reference.h
M oox/source/core/xmlfilterbase.cxx
M oox/source/drawingml/chart/converterbase.cxx
M oox/source/drawingml/chart/objectformatter.cxx
M oox/source/drawingml/chart/typegroupconverter.cxx
M oox/source/vml/vmltextbox.cxx
M reportdesign/inc/RptDef.hxx
M reportdesign/source/core/api/FormattedField.cxx
M reportdesign/source/core/sdr/RptObject.cxx
M reportdesign/source/filter/xml/xmlExport.cxx
M sc/source/core/tool/chartlock.cxx
M sc/source/filter/inc/workbookhelper.hxx
M sc/source/filter/inc/xlchart.hxx
M sc/source/filter/oox/excelchartconverter.cxx
M sc/source/filter/xcl97/xcl97esc.cxx
M sc/source/filter/xml/xmlstyle.cxx
M sc/source/ui/vba/vbasheetobjects.hxx
M sd/source/core/CustomAnimationEffect.cxx
M sd/source/ui/framework/factories/Pane.cxx
M sd/source/ui/toolpanel/ToolPanel.cxx
M sfx2/source/control/templatelocalview.cxx
M sfx2/source/doc/Metadatable.cxx
M sfx2/source/doc/iframe.cxx
M sfx2/source/view/sfxbasecontroller.cxx
M slideshow/source/engine/rehearsetimingsactivity.cxx
M svtools/source/brwbox/brwimpl.hxx
M svtools/source/uno/wizard/unowizard.cxx
M svx/source/form/fmmodel.cxx
M sw/source/ui/docvw/srcedtw.cxx
M writerfilter/source/ooxml/OOXMLStreamImpl.cxx
M xmloff/source/text/XMLTextNumRuleInfo.cxx
M xmloff/source/xforms/xformsapi.cxx
46 files changed, 72 insertions(+), 11 deletions(-)



diff --git a/accessibility/source/extended/accessibletabbar.cxx 
b/accessibility/source/extended/accessibletabbar.cxx
index 8e1730b..8c318f5 100644
--- a/accessibility/source/extended/accessibletabbar.cxx
+++ b/accessibility/source/extended/accessibletabbar.cxx
@@ -23,6 +23,7 @@
 #include com/sun/star/accessibility/AccessibleEventId.hpp
 #include com/sun/star/accessibility/AccessibleRole.hpp
 #include com/sun/star/accessibility/AccessibleStateType.hpp
+#include com/sun/star/awt/XWindowPeer.hpp
 #include cppuhelper/supportsservice.hxx
 #include unotools/accessiblestatesethelper.hxx
 #include unotools/accessiblerelationsethelper.hxx
diff --git a/accessibility/source/standard/accessiblemenucomponent.cxx 
b/accessibility/source/standard/accessiblemenucomponent.cxx
index 3bf4d15..c7e12a6 100644
--- a/accessibility/source/standard/accessiblemenucomponent.cxx
+++ b/accessibility/source/standard/accessiblemenucomponent.cxx
@@ -25,6 +25,7 @@
 #include com/sun/star/accessibility/AccessibleEventId.hpp
 #include com/sun/star/accessibility/AccessibleRole.hpp
 #include com/sun/star/accessibility/AccessibleStateType.hpp
+#include com/sun/star/awt/XWindowPeer.hpp
 
 #include unotools/accessiblestatesethelper.hxx
 #include unotools/accessiblerelationsethelper.hxx
diff --git a/basctl/source/basicide/baside2b.cxx 
b/basctl/source/basicide/baside2b.cxx
index 7b7e3c7..e4579aa 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -31,6 +31,7 @@
 #include com/sun/star/script/XLibraryContainer2.hpp
 #include com/sun/star/beans/XMultiPropertySet.hpp
 #include com/sun/star/beans/XPropertiesChangeListener.hpp
+#include com/sun/star/container/XHierarchicalNameAccess.hpp
 #include comphelper/processfactory.hxx
 #include comphelper/string.hxx
 #include officecfg/Office/Common.hxx
diff --git a/canvas/source/tools/canvastools.cxx 
b/canvas/source/tools/canvastools.cxx
index 26775be..cba537b 100644
--- a/canvas/source/tools/canvastools.cxx
+++ b/canvas/source/tools/canvastools.cxx
@@ -24,6 +24,7 @@
 #include com/sun/star/geometry/AffineMatrix2D.hpp
 #include com/sun/star/geometry/Matrix2D.hpp
 #include com/sun/star/awt/Rectangle.hpp
+#include com/sun/star/awt/XWindow2.hpp
 #include com/sun/star/util/Endianness.hpp
 #include com/sun/star/rendering/XIntegerBitmapColorSpace.hpp
 #include com/sun/star/rendering/IntegerBitmapLayout.hpp
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx 
b/chart2/source/controller/dialogs/tp_DataSource.cxx
index 13a2fe4..d11ee84 100644
--- 

[ABANDONED] fdo#46808, Convert some XMultiServiceFactory to XComponentCo...

2013-04-29 Thread Noel Grandin (via Code Review)
Noel Grandin has abandoned this change.

Change subject: fdo#46808, Convert some XMultiServiceFactory to 
XComponentContext
..


Patch Set 1: Abandoned

This got somehow mixed up with another change.

-- 
To view, visit https://gerrit.libreoffice.org/3681
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I1dcfee9fa0fdc4457754396ffb52cc8462f3906a
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Create conversion constructor for Reference

2013-04-26 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3613

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/13/3613/1

Create conversion constructor for Reference

makes UNO code less noisy.

Change-Id: Ib501f462e232ad7eda57e2a74634ea0646877e0f
---
M include/com/sun/star/uno/Reference.h
M sd/source/core/CustomAnimationEffect.cxx
2 files changed, 12 insertions(+), 1 deletion(-)



diff --git a/include/com/sun/star/uno/Reference.h 
b/include/com/sun/star/uno/Reference.h
index 94551a0..3297abc 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -248,6 +248,17 @@
 @param rRef another reference
 */
 inline Reference( const Reference interface_type   rRef ) SAL_THROW(());
+
+/** Up-casting conversion constructor: Copies interface reference.
+
+@param rRef another reference
+*/
+template class derived_interface_type 
+inline Reference( const Reference derived_interface_type   rRef )
+{
+_pInterface = iquery( static_cast interface_type* (rRef.get()) );
+}
+
 /** Constructor: Sets given interface pointer.
 
 @param pInterface an interface pointer
diff --git a/sd/source/core/CustomAnimationEffect.cxx 
b/sd/source/core/CustomAnimationEffect.cxx
index 21a098f..827bed2 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -1022,7 +1022,7 @@
 xAnimate-setFill( AnimationFill::HOLD );
 xAnimate-setTarget( maTarget );
 
-return Reference XAnimationNode ( xAnimate, UNO_QUERY_THROW );
+return xAnimate;
 }
 
 // 

-- 
To view, visit https://gerrit.libreoffice.org/3613
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib501f462e232ad7eda57e2a74634ea0646877e0f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Fix compilation of Spreadsheet odk example

2013-04-23 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3565

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/65/3565/1

Fix compilation of Spreadsheet odk example

because of change to XDataPilotsResults IDL in
commit ac569ed4cf5064248b9952f182f6572f20dc9bcb
fdo#60300: Work-in-progress change to rework pivot table core

Change-Id: I730e15226f4dfe3e6baa5d54e987da1016f6b15b
---
M odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java
1 file changed, 7 insertions(+), 0 deletions(-)



diff --git 
a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java 
b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java
index c94f205..f7220f0 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java
@@ -1,3 +1,5 @@
+import com.sun.star.sheet.DataPilotFieldFilter;
+
 /*
  *
  *  The Contents of this file are made available subject to the terms of
@@ -864,6 +866,11 @@
 return aResults;
 }
 
+public double[] getFilteredResults(DataPilotFieldFilter[] aFilters) {
+// FIXME
+return new double[0];
+}
+
 //  XDimensionsSupplier
 
 public com.sun.star.container.XNameAccess getDimensions()

-- 
To view, visit https://gerrit.libreoffice.org/3565
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I730e15226f4dfe3e6baa5d54e987da1016f6b15b
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Java cleanup - reduce use of global fields

2013-04-23 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3567

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/67/3567/1

Java cleanup - reduce use of global fields

This field does not need to be global, it is returned from the relevant
methods

Change-Id: Ic53eec4a699d6acc4410e71dde385e6a49ded745
---
M qadevOOo/runner/util/AccessibilityTools.java
M qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java
M qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java
M qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java
M qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
M qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java
M qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java
M qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java
M qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java
M qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java
M sw/qa/complex/accessibility/AccessibleRelationSet.java
22 files changed, 46 insertions(+), 91 deletions(-)



diff --git a/qadevOOo/runner/util/AccessibilityTools.java 
b/qadevOOo/runner/util/AccessibilityTools.java
index e6f345b..85cd442 100644
--- a/qadevOOo/runner/util/AccessibilityTools.java
+++ b/qadevOOo/runner/util/AccessibilityTools.java
@@ -32,13 +32,11 @@
 
 
 public class AccessibilityTools {
-public static XAccessibleContext SearchedContext = null;
 public static XAccessible SearchedAccessible = null;
 private static boolean debug = false;
 
 public AccessibilityTools() {
 //done = false;
-SearchedContext = null;
 }
 
 public static XAccessible getAccessibleObject(XInterface xObject) {
@@ -93,35 +91,29 @@
 
 public static XAccessibleContext getAccessibleObjectForRole(XAccessible 
xacc,
 short role) {
-SearchedContext = null;
 SearchedAccessible = null;
-getAccessibleObjectForRole_(xacc, role);
-
-return SearchedContext;
+return getAccessibleObjectForRole_(xacc, role);
 }
 
 public static XAccessibleContext getAccessibleObjectForRole(XAccessible 
xacc,
 short role,
 boolean ignoreShowing) {
-SearchedContext = null;
 SearchedAccessible = null;
 
 if (ignoreShowing) {
-getAccessibleObjectForRoleIgnoreShowing_(xacc, role);
+return getAccessibleObjectForRoleIgnoreShowing_(xacc, role);
 } else {
-getAccessibleObjectForRole_(xacc, role);
+return getAccessibleObjectForRole_(xacc, role);
 }
-
-return SearchedContext;
 }
 
-public static void getAccessibleObjectForRoleIgnoreShowing_(XAccessible 
xacc,
+public static XAccessibleContext 
getAccessibleObjectForRoleIgnoreShowing_(XAccessible xacc,
 short role) {
 XAccessibleContext ac = xacc.getAccessibleContext();
 
 if (ac.getAccessibleRole() == role) {
-SearchedContext = ac;
 SearchedAccessible = xacc;
+return ac;
 } else {
 int k = ac.getAccessibleChildCount();
 
@@ -131,28 +123,29 @@
 
 for (int i = 0; i  k; i++) {
 try {
-getAccessibleObjectForRoleIgnoreShowing_(
+XAccessibleContext ac2 = 
getAccessibleObjectForRoleIgnoreShowing_(
 ac.getAccessibleChild(i), role);
 
-if (SearchedContext != null) {
-return;
+if (ac2 != null) {
+return ac2;
 }
 } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
 System.out.println(Couldn't get Child);
 }
 }
+return null;
 }
 }
 
-public static void getAccessibleObjectForRole_(XAccessible xacc,
+public static XAccessibleContext getAccessibleObjectForRole_(XAccessible 
xacc,
 short role) {
 XAccessibleContext ac = xacc.getAccessibleContext();
 boolean isShowing = ac.getAccessibleStateSet()
 .contains(com.sun.star.accessibility.AccessibleStateType.SHOWING);
 
 if ((ac.getAccessibleRole() == role)  isShowing) {
-SearchedContext = ac;
 SearchedAccessible = xacc;
+return ac;
 

[PATCH] Java cleanup - use generics to reduce casting

2013-04-23 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3568

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/68/3568/1

Java cleanup - use generics to reduce casting

More queryInterface related cleanup.

Change-Id: I97d064c425389e687c6f0fbc3a962080f46dd511
---
M odk/examples/DevelopersGuide/Forms/ButtonOperator.java
M odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
M odk/examples/DevelopersGuide/Forms/FLTools.java
M odk/examples/DevelopersGuide/Forms/SalesFilter.java
M odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java
5 files changed, 16 insertions(+), 16 deletions(-)



diff --git a/odk/examples/DevelopersGuide/Forms/ButtonOperator.java 
b/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
index 113b704..a447381 100644
--- a/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
+++ b/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
@@ -148,7 +148,7 @@
 public void actionPerformed( ActionEvent aEvent ) throws 
com.sun.star.uno.RuntimeException
 {
 // get the model's name
-XPropertySet buttonModel = (XPropertySet)FLTools.getModel( 
aEvent.Source, XPropertySet.class );
+XPropertySet buttonModel = FLTools.getModel( aEvent.Source, 
XPropertySet.class );
 try
 {
 short formFeature = getAssociatedFormFeature( buttonModel );
diff --git a/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java 
b/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
index 25308ea..09befbe 100644
--- a/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
+++ b/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
@@ -69,7 +69,7 @@
 @param aInterfaceClass
 the class of the interface which shall be returned
 */
-public Object get( Class aInterfaceClass )
+public T T get( ClassT aInterfaceClass )
 {
 return UnoRuntime.queryInterface( aInterfaceClass, m_controller );
 }
@@ -88,7 +88,7 @@
 XDispatch xReturn = null;
 
 // go get the current view
-XController xController = (XController)get( XController.class );
+XController xController = get( XController.class );
 // go get the dispatch provider of it's frame
 XDispatchProvider xProvider = UnoRuntime.queryInterface(
 XDispatchProvider.class, xController.getFrame() );
@@ -119,7 +119,7 @@
  */
 public XFormController getFormController( Object _form )
 {
-XFormLayerAccess formLayer = (XFormLayerAccess)get( 
XFormLayerAccess.class );
+XFormLayerAccess formLayer = get( XFormLayerAccess.class );
 return formLayer.getFormController( UnoRuntime.queryInterface( 
XForm.class, _form ) );
 }
 
@@ -133,7 +133,7 @@
 public XControl getFormControl( XControlModel xModel ) throws 
com.sun.star.uno.Exception
 {
 // the current view of the document
-XControlAccess xCtrlAcc = (XControlAccess)get( XControlAccess.class );
+XControlAccess xCtrlAcc = get( XControlAccess.class );
 // delegate the task of looking for the control
 return xCtrlAcc.getControl( xModel );
 }
@@ -146,7 +146,7 @@
 }
 
 /* -- */
-public Object getFormControl( Object aModel, Class aInterfaceClass ) 
throws com.sun.star.uno.Exception
+public T T getFormControl( Object aModel, ClassT aInterfaceClass ) 
throws com.sun.star.uno.Exception
 {
 XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class, 
aModel );
 return UnoRuntime.queryInterface( aInterfaceClass, getFormControl( 
xModel ) );
diff --git a/odk/examples/DevelopersGuide/Forms/FLTools.java 
b/odk/examples/DevelopersGuide/Forms/FLTools.java
index 1438166..36d4fb3 100644
--- a/odk/examples/DevelopersGuide/Forms/FLTools.java
+++ b/odk/examples/DevelopersGuide/Forms/FLTools.java
@@ -159,7 +159,7 @@
 /* -- */
 /** retrieves the parent of the given object
 */
-static Object getParent( Object aComponent, Class aInterfaceClass )
+static T T getParent( Object aComponent, ClassT aInterfaceClass )
 {
 XChild xAsChild = UnoRuntime.queryInterface( XChild.class, aComponent 
);
 
@@ -171,7 +171,7 @@
 */
 static XPropertySet getParent( Object aComponent )
 {
-return (XPropertySet)getParent( aComponent, XPropertySet.class );
+return getParent( aComponent, XPropertySet.class );
 }
 
 /* -- */
@@ -188,7 +188,7 @@
 /* -- */
 /** get's the XControlModel for a control
 */
-static public Object getModel( Object aControl, Class aInterfaceClass )
+static public T T getModel( Object aControl, ClassT aInterfaceClass )
 {
 

[PATCH] Java cleanup, use generic containers where possible

2013-04-23 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3569

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/69/3569/1

Java cleanup, use generic containers where possible

Change-Id: Icd830004de3e121f5b96393e7d7b447775833419
---
M bridges/test/java_uno/equals/TestEquals.java
M extensions/qa/integration/extensions/MethodHandler.java
M forms/qa/integration/forms/TableCellTextBinding.java
M 
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java
M odk/examples/DevelopersGuide/Text/TextDocuments.java
M scripting/workben/ifc/scripting/_XScriptInvocation.java
M scripting/workben/ifc/scripting/_XScriptNameResolver.java
M scripting/workben/mod/_scripting/TestDataLoader.java
8 files changed, 179 insertions(+), 189 deletions(-)



diff --git a/bridges/test/java_uno/equals/TestEquals.java 
b/bridges/test/java_uno/equals/TestEquals.java
index bc79835..515c8e4 100644
--- a/bridges/test/java_uno/equals/TestEquals.java
+++ b/bridges/test/java_uno/equals/TestEquals.java
@@ -115,7 +115,7 @@
 }
 }
 
-private final HashMap map = new HashMap();
+private final HashMapString,Object map = new 
HashMapString,Object();
 }
 
 private final class Done implements XDone {
@@ -160,7 +160,7 @@
 UnoRuntime.queryInterface(
 XDerived.class, test2Aa);
 
-Hashtable params = new Hashtable();
+HashtableString,String params = new 
HashtableString,String();
 params.put(UNO_TYPES, unoTypes);
 params.put(UNO_SERVICES, unoServices);
 XComponentContext context = Bootstrap.
diff --git a/extensions/qa/integration/extensions/MethodHandler.java 
b/extensions/qa/integration/extensions/MethodHandler.java
index 8508dca..b6259e9 100644
--- a/extensions/qa/integration/extensions/MethodHandler.java
+++ b/extensions/qa/integration/extensions/MethodHandler.java
@@ -31,13 +31,13 @@
 private XIntrospectionAccessm_introspectionAccess;
 private XIdlClass   m_idlClass;
 private XIdlMethod[]m_methods;
-private java.util.HashMap   m_methodsHash;
+private java.util.HashMapString,XIdlMethod   m_methodsHash;
 
 /** Creates a new instance of MethodHandler */
 public MethodHandler( XComponentContext _context )
 {
 m_context = _context;
-m_methodsHash = new java.util.HashMap();
+m_methodsHash = new java.util.HashMapString,XIdlMethod();
 
 try
 {
@@ -169,7 +169,7 @@
 
 m_introspectionAccess = null;
 m_methods = null;
-m_methodsHash = new java.util.HashMap();
+m_methodsHash = new java.util.HashMapString,XIdlMethod();
 
 m_introspectionAccess = m_introspection.inspect( _component );
 if ( m_introspectionAccess == null )
@@ -217,7 +217,7 @@
  */
 private XIdlMethod impl_getMethod( String _methodName ) throws 
UnknownPropertyException
 {
-XIdlMethod method = (XIdlMethod)m_methodsHash.get( _methodName );
+XIdlMethod method = m_methodsHash.get( _methodName );
 if ( method == null )
 throw new com.sun.star.beans.UnknownPropertyException();
 
diff --git a/forms/qa/integration/forms/TableCellTextBinding.java 
b/forms/qa/integration/forms/TableCellTextBinding.java
index 40a5d69..8a1d1fb 100644
--- a/forms/qa/integration/forms/TableCellTextBinding.java
+++ b/forms/qa/integration/forms/TableCellTextBinding.java
@@ -48,7 +48,7 @@
 private String  m_newCellText;
 private String  m_lastKnownCellText;
 private boolean m_haveNewCellText;
-private java.util.List  m_listeners;
+private java.util.Listcom.sun.star.util.XModifyListener  m_listeners;
 
 /** Creates a new instance of TableCellTextBinding */
 public TableCellTextBinding( XCell cell )
@@ -56,7 +56,7 @@
 m_cellText = UnoRuntime.queryInterface( XTextRange.class, cell );
 
 m_newCellText = new String();
-m_listeners = new java.util.LinkedList();
+m_listeners = new 
java.util.LinkedListcom.sun.star.util.XModifyListener();
 
 start();
 }
diff --git 
a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java
 
b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java
index 7ca0e29..80d1f97 100644
--- 
a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java
+++ 
b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java
@@ -1,149 +1,148 @@
-/**
- * Description: operations for the a text string.
- *
- * @ AuthorCreate/Modi Note
- * Xiaofeng XieFeb 22, 2001
- * Xiaofeng XieMay 12, 2004
- *
- * This 

[PATCH] Java cleanup - static fields that should not be static

2013-04-22 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3555

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/55/3555/1

Java cleanup - static fields that should not be static

Somebody appears to have been confused about the purpose of static
in Java.
These are instance fields and should therefore not be static.

Also reduce the visibility of some methods and fields.

Change-Id: I0b5875b6cbd91ee89823e2058b87c1087dc5c92e
---
M qadevOOo/runner/lib/TestCase.java
M qadevOOo/runner/lib/TestEnvironment.java
M qadevOOo/tests/java/mod/_forms/GenericModelTest.java
3 files changed, 31 insertions(+), 48 deletions(-)



diff --git a/qadevOOo/runner/lib/TestCase.java 
b/qadevOOo/runner/lib/TestCase.java
index 0477ebe..a4895f1 100644
--- a/qadevOOo/runner/lib/TestCase.java
+++ b/qadevOOo/runner/lib/TestCase.java
@@ -19,8 +19,8 @@
 package lib;
 
 import java.io.PrintWriter;
-
 import lib.TestParameters;
+
 /**
  * codeTestCase/code represent a factory for codeTestEnvironment/codes
  * creation and disposing for a given implementation object. The
@@ -49,9 +49,7 @@
 /**
  * Specifies the PrintWriter to log information.
  */
-public PrintWriter log;
-
-//public static TestCase tCase;
+protected PrintWriter log;
 
 /**
  * Sets the log to write information during testing.
@@ -66,7 +64,7 @@
  *
  * @param tParam test parameters.
  */
-public void initializeTestCase( TestParameters tParam ) {
+public final void initializeTestCase( TestParameters tParam ) {
 initialize( tParam, log );
 }
 
@@ -89,7 +87,7 @@
  *
  * @param tParam test parameters
  */
-public void cleanupTestCase( TestParameters tParam ) {
+public final void cleanupTestCase( TestParameters tParam ) {
 cleanup( tParam, log );
 }
 
diff --git a/qadevOOo/runner/lib/TestEnvironment.java 
b/qadevOOo/runner/lib/TestEnvironment.java
index 7c9b3d7..ba00770 100644
--- a/qadevOOo/runner/lib/TestEnvironment.java
+++ b/qadevOOo/runner/lib/TestEnvironment.java
@@ -98,18 +98,6 @@
 }
 
 /**
- * Checks if an auxiliary object has been registered with name
- *
- * @param name a name referencing an auxiliarx object
- *
- * @return tttrue/tt if the object has been associated, ttfalse/tt
- * otherwise.
- */
-public boolean hasObjRelation(String name) {
-return (relations.get(name) != null) ;
-}
-
-/**
  * Sets the codeTestCase/code that created the environment.
  */
 public void setTestCase( TestCase tCase) {
diff --git a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java 
b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java
index 2bf33f6..92bdf1d 100644
--- a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java
+++ b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java
@@ -124,26 +124,26 @@
 * @see ifc.container._XChild
 */
 public class GenericModelTest extends TestCase {
-private static XTextDocument m_xTextDoc;
-private static Object m_dbSrc = null;
-private static DBTools.DataSourceInfo m_srcInf = null;
+private XTextDocument m_xTextDoc;
+private Object m_dbSrc = null;
+private DBTools.DataSourceInfo m_srcInf = null;
 /**
  * This is the name of the Data Base which the test uses: APITestDatabase
  */
-protected final static String m_dbSourceName = APITestDatabase;
-protected final static String m_TestDB = TestDB;
+private final static String m_dbSourceName = APITestDatabase;
+private final static String m_TestDB = TestDB;
 private DBTools m_dbTools = null;
 
-private static boolean m_ConnectionColsed = false;
+private boolean m_ConnectionColsed = false;
 
 /**
- * descibes the kind of the shape which should be created.
+ * describes the kind of the shape which should be created.
  * Example: m_kindOfshape=DateFiled
  */
-public static String m_kindOfControl = null;
+protected String m_kindOfControl = null;
 
 /**
- * If your object needs some special propery values you can specify them 
with this
+ * If your object needs some special property values you can specify them 
with this
  * CODEArrayList/CODE. You have to add a CODENamedValue/CODE to 
this list.
  * Example:
  * NamedValue myProp = new NamedValue();
@@ -151,7 +151,7 @@
  * myProp.Value = My special Value;
  * m_propertiesToSet.add(myProp);
  */
-public static ArrayListNamedValue m_propertiesToSet = new 
ArrayListNamedValue();
+protected ArrayListNamedValue m_propertiesToSet = new 
ArrayListNamedValue();
 
 /**
  * This variable contains the name of the property which should be changed 
while
@@ -161,56 +161,53 @@
  * @see ifc.form._XUpdateBroadcaster.UpdateChecker
  * @see ifc.form._XUpdateBroadcaster
  */
-public static String m_ChangePropertyName = null;
+protected String m_ChangePropertyName = null;
 /**
  * This 

[PATCH] Java cleanup in mediawiki extension

2013-04-17 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3430

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/30/3430/1

Java cleanup in mediawiki extension

- remove unnecessary casts
- convert Hashtable-Map and Vector-ArrayList
- remove dead fields

Change-Id: Id85abee74857325a113133bf61474b962256489c
---
M swext/mediawiki/src/com/sun/star/wiki/EditPageParser.java
M swext/mediawiki/src/com/sun/star/wiki/Helper.java
M swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
M swext/mediawiki/src/com/sun/star/wiki/Settings.java
M swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
M swext/mediawiki/src/com/sun/star/wiki/WikiDialog.java
M swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java
M swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
M swext/mediawiki/src/com/sun/star/wiki/WikiOptionsEventHandlerImpl.java
M swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java
10 files changed, 168 insertions(+), 192 deletions(-)



diff --git a/swext/mediawiki/src/com/sun/star/wiki/EditPageParser.java 
b/swext/mediawiki/src/com/sun/star/wiki/EditPageParser.java
index 3967710..7500be6 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/EditPageParser.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/EditPageParser.java
@@ -29,7 +29,6 @@
 protected String m_sLoginToken = ;
 protected String m_sMainURL = ;
 
-private int m_nWikiArticleHash = 0;
 private boolean m_bHTMLStartFound = false;
 private boolean m_bInHead = false;
 
@@ -138,7 +137,6 @@
 {
 if ( sName.equalsIgnoreCase( wpTextbox1 ) )
 {
-m_nWikiArticleHash = t.hashCode();
 m_nWikiArticleStart = pos;
 }
 }
diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java 
b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
index 9601579..345be2c 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
@@ -55,8 +55,6 @@
 import com.sun.star.util.XChangesBatch;
 import java.net.*;
 import java.io.*;
-import java.util.Hashtable;
-import java.util.Random;
 import javax.net.ssl.SSLException;
 import javax.swing.text.html.HTMLEditorKit;
 
@@ -149,11 +147,9 @@
 private static final String sHTMLHeader = HTMLHEADmeta 
http-equiv=\Content-Type\ content=\text/html; charset=utf-8\ 
/TITLE/TITLE/HEADBODY;
 private static final String sHTMLFooter = /BODY/HTML;
 
-private static Random m_aRandom;
 private static MultiThreadedHttpConnectionManager m_aConnectionManager;
 private static HttpClient m_aClient;
 private static boolean m_bAllowConnection = true;
-private static Hashtable m_aAcceptedUnknownCerts;
 
 private static Boolean m_bShowInBrowser = null;
 
@@ -245,7 +241,7 @@
 
 XPropertySet xProps = Helper.GetConfigProps( xContext, 
org.openoffice.Office.Custom.WikiExtension/Settings );
 xProps.setPropertyValue( PreselectShowBrowser, new Boolean( 
bValue ) );
-XChangesBatch xBatch = ( XChangesBatch ) 
UnoRuntime.queryInterface( XChangesBatch.class, xProps );
+XChangesBatch xBatch = UnoRuntime.queryInterface( 
XChangesBatch.class, xProps );
 if ( xBatch != null )
 xBatch.commitChanges();
 }
@@ -262,7 +258,7 @@
 {
 XMultiComponentFactory xFactory = xContext.getServiceManager();
 if ( xFactory != null )
-m_xPasswordContainer = 
(XPasswordContainer)UnoRuntime.queryInterface(
+m_xPasswordContainer = UnoRuntime.queryInterface(
 XPasswordContainer.class,
 xFactory.createInstanceWithContext( 
com.sun.star.task.PasswordContainer, xContext ) );
 }
@@ -280,7 +276,7 @@
 {
 XMultiComponentFactory xFactory = xContext.getServiceManager();
 if ( xFactory != null )
-m_xInteractionHandler = ( XInteractionHandler 
)UnoRuntime.queryInterface(
+m_xInteractionHandler = UnoRuntime.queryInterface(
 XInteractionHandler.class,
 xFactory.createInstanceWithContext( 
com.sun.star.task.InteractionHandler, xContext ) );
 }
@@ -384,8 +380,8 @@
 try
 {
 Object oTempFile = 
xContext.getServiceManager().createInstanceWithContext( 
com.sun.star.io.TempFile, xContext );
-XStream xStream = ( XStream ) UnoRuntime.queryInterface( 
XStream.class, oTempFile );
-XSeekable xSeekable = ( XSeekable ) UnoRuntime.queryInterface( 
XSeekable.class, oTempFile );
+XStream xStream = UnoRuntime.queryInterface( XStream.class, 
oTempFile );
+XSeekable xSeekable = UnoRuntime.queryInterface( 
XSeekable.class, oTempFile );

[PATCH] Java cleanup, remove unnecessary casts

2013-04-17 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3431

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/31/3431/1

Java cleanup, remove unnecessary casts

Change-Id: Id12089bc7df16631737e6acaee0973fb91dd953f
---
M bridges/test/java_uno/acquire/TestAcquire.java
M bridges/test/testclient.java
M chart2/qa/TestCaseOldAPI.java
M connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageAccess.java
M dbaccess/qa/complex/dbaccess/PropertyBag.java
M dbaccess/qa/complex/dbaccess/UISettings.java
M 
desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java
M extensions/qa/integration/extensions/ConsoleWait.java
M extensions/qa/integration/extensions/Frame.java
M extensions/qa/integration/extensions/MethodHandler.java
M extensions/qa/integration/extensions/ObjectInspector.java
M extensions/qa/integration/extensions/ServicesHandler.java
M extensions/test/pgp/TestPGP.java
M forms/qa/integration/forms/CellBinding.java
M forms/qa/integration/forms/ControlValidation.java
M forms/qa/integration/forms/DocumentHelper.java
M forms/qa/integration/forms/DocumentViewHelper.java
M forms/qa/integration/forms/FormComponent.java
M forms/qa/integration/forms/FormControlTest.java
M forms/qa/integration/forms/FormLayer.java
M forms/qa/integration/forms/ListSelection.java
M forms/qa/integration/forms/RadioButtons.java
M forms/qa/integration/forms/SingleControlValidation.java
M forms/qa/integration/forms/SpreadsheetDocument.java
M forms/qa/integration/forms/SpreadsheetView.java
M forms/qa/integration/forms/TableCellTextBinding.java
M forms/qa/integration/forms/ValueBinding.java
M forms/qa/integration/forms/XMLFormSettings.java
M forms/qa/org/openoffice/complex/forms/tools/ResultSet.java
M forms/qa/org/openoffice/xforms/Model.java
M forms/qa/org/openoffice/xforms/XMLDocument.java
M nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
M nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/ResourceManager.java
M nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java
M 
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java
M 
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/BaseControl.java
M nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/Button.java
M 
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/ProgressBar.java
M odk/examples/DevelopersGuide/Charts/CalcHelper.java
M odk/examples/DevelopersGuide/Charts/ChartHelper.java
M odk/examples/DevelopersGuide/Charts/ChartInCalc.java
M odk/examples/DevelopersGuide/Charts/ChartInDraw.java
M odk/examples/DevelopersGuide/Charts/ChartInWriter.java
M odk/examples/DevelopersGuide/Charts/Helper.java
M odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java
M odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java
M odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
M odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java
48 files changed, 373 insertions(+), 379 deletions(-)




-- 
To view, visit https://gerrit.libreoffice.org/3431
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id12089bc7df16631737e6acaee0973fb91dd953f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Java cleanup, remove the rest of the unnecessary casts

2013-04-17 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3432

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/32/3432/1

Java cleanup, remove the rest of the unnecessary casts

Change-Id: Ia61d250f6b3711abc29569c5ece38a6f87e38daa
---
M 
odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
M odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java
M odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
M odk/examples/DevelopersGuide/Config/ConfigExamples.java
M odk/examples/DevelopersGuide/Database/CodeSamples.java
M odk/examples/DevelopersGuide/Database/OpenQuery.java
M odk/examples/DevelopersGuide/Database/RowSet.java
M odk/examples/DevelopersGuide/Database/Sales.java
M odk/examples/DevelopersGuide/Database/SalesMan.java
M odk/examples/DevelopersGuide/Database/sdbcx.java
M odk/examples/DevelopersGuide/Drawing/ChangeOrderDemo.java
M odk/examples/DevelopersGuide/Drawing/ControlAndSelectDemo.java
M odk/examples/DevelopersGuide/Drawing/CustomShowDemo.java
M odk/examples/DevelopersGuide/Drawing/DrawViewDemo.java
M odk/examples/DevelopersGuide/Drawing/DrawingDemo.java
M odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.java
M odk/examples/DevelopersGuide/Drawing/GluePointDemo.java
M odk/examples/DevelopersGuide/Drawing/GraphicExportDemo.java
M odk/examples/DevelopersGuide/Drawing/Helper.java
M odk/examples/DevelopersGuide/Drawing/LayerDemo.java
M odk/examples/DevelopersGuide/Drawing/ObjectTransformationDemo.java
M odk/examples/DevelopersGuide/Drawing/Organigram.java
M odk/examples/DevelopersGuide/Drawing/PageHelper.java
M odk/examples/DevelopersGuide/Drawing/PresentationDemo.java
M odk/examples/DevelopersGuide/Drawing/ShapeHelper.java
M odk/examples/DevelopersGuide/Drawing/StyleDemo.java
M odk/examples/DevelopersGuide/Drawing/TextDemo.java
M odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java
M odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java
M odk/examples/DevelopersGuide/GUI/DialogDocument.java
M odk/examples/DevelopersGuide/GUI/ImageControlSample.java
M odk/examples/DevelopersGuide/GUI/MessageBox.java
M odk/examples/DevelopersGuide/GUI/RoadmapItemStateChangeListener.java
M odk/examples/DevelopersGuide/GUI/SystemDialog.java
M odk/examples/DevelopersGuide/GUI/UnoDialogSample.java
M odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java
M odk/examples/DevelopersGuide/GUI/UnoMenu.java
M odk/examples/DevelopersGuide/GUI/UnoMenu2.java
M odk/examples/DevelopersGuide/OfficeDev/Clipboard/Clipboard.java
M odk/examples/DevelopersGuide/OfficeDev/ContextMenuInterceptor.java
M 
odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java
M 
odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
M 
odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java
M 
odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
M odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java
M odk/examples/DevelopersGuide/OfficeDev/Linguistic/OneInstanceFactory.java
M odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper.java
M odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java
M odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java
M odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java
M odk/examples/DevelopersGuide/OfficeDev/MenuElement.java
M odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java
M odk/examples/DevelopersGuide/OfficeDev/PathSettings/PathSettingsTest.java
M 
odk/examples/DevelopersGuide/OfficeDev/PathSubstitution/PathSubstitutionTest.java
M odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminationTest.java
M 
odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/ConnectionAwareClient.java
M odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/UrlResolver.java
M 
odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_java/SimpleBootstrap_java.java
M 
odk/examples/DevelopersGuide/ScriptingFramework/SayHello/SayHello/SayHello.java
M 
odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/ScriptSelector/ScriptSelector.java
M odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java
M odk/examples/DevelopersGuide/Spreadsheet/GeneralTableSample.java
M odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java
M odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java
M odk/examples/DevelopersGuide/Spreadsheet/ViewSample.java
M odk/examples/DevelopersGuide/Text/TextDocuments.java
M odk/examples/java/ConverterServlet/ConverterServlet.java
M odk/examples/java/DocumentHandling/DocumentConverter.java
M odk/examples/java/DocumentHandling/DocumentLoader.java
M odk/examples/java/DocumentHandling/DocumentPrinter.java
M odk/examples/java/DocumentHandling/DocumentSaver.java
M 

[PATCH] Java cleanup, use generics in calls to UnoRuntime#queryInter...

2013-04-17 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3433

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/33/3433/1

Java cleanup, use generics in calls to UnoRuntime#queryInterface

A handful of places wrap the call to queryInterface. With a little
generics love, we can reduce the casting required.

Change-Id: I9efca2afb1b23fad2359af24e1c273aea96e45fe
---
M forms/qa/integration/forms/DocumentHelper.java
M forms/qa/integration/forms/DocumentViewHelper.java
M forms/qa/integration/forms/FormComponent.java
M forms/qa/integration/forms/ListSelection.java
M forms/qa/integration/forms/MasterDetailForms.java
M forms/qa/integration/forms/TestCase.java
M odk/examples/DevelopersGuide/OfficeDev/ContextMenuInterceptor.java
M odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java
8 files changed, 20 insertions(+), 20 deletions(-)



diff --git a/forms/qa/integration/forms/DocumentHelper.java 
b/forms/qa/integration/forms/DocumentHelper.java
index a26434b..a5a44be 100644
--- a/forms/qa/integration/forms/DocumentHelper.java
+++ b/forms/qa/integration/forms/DocumentHelper.java
@@ -133,12 +133,12 @@
 /* -- */
 public boolean isModified()
 {
-XModifiable modify = (XModifiable)query( XModifiable.class );
+XModifiable modify = query( XModifiable.class );
 return modify.isModified();
 }
 
 /* -- */
-public Object query( Class aInterfaceClass )
+public T T query( ClassT aInterfaceClass )
 {
 return UnoRuntime.queryInterface( aInterfaceClass, m_documentComponent 
);
 }
diff --git a/forms/qa/integration/forms/DocumentViewHelper.java 
b/forms/qa/integration/forms/DocumentViewHelper.java
index 66d8f0b..76a03d0 100644
--- a/forms/qa/integration/forms/DocumentViewHelper.java
+++ b/forms/qa/integration/forms/DocumentViewHelper.java
@@ -73,7 +73,7 @@
 @param aInterfaceClass
 the class of the interface which shall be returned
 */
-public Object query( Class aInterfaceClass )
+public T T query( ClassT aInterfaceClass )
 {
 return UnoRuntime.queryInterface( aInterfaceClass, m_controller );
 }
@@ -92,7 +92,7 @@
 XDispatch xReturn = null;
 
 // go get the current view
-XController xController = (XController)query( XController.class );
+XController xController = query( XController.class );
 // go get the dispatch provider of it's frame
 XDispatchProvider xProvider = UnoRuntime.queryInterface(
 XDispatchProvider.class, xController.getFrame() );
@@ -147,7 +147,7 @@
 public XControl getControl( XControlModel xModel ) throws 
com.sun.star.uno.Exception
 {
 // the current view of the document
-XControlAccess xCtrlAcc = (XControlAccess)query( XControlAccess.class 
);
+XControlAccess xCtrlAcc = query( XControlAccess.class );
 // delegate the task of looking for the control
 return xCtrlAcc.getControl( xModel );
 }
@@ -160,7 +160,7 @@
 }
 
 /* -- */
-public Object getControl( Object aModel, Class aInterfaceClass ) throws 
com.sun.star.uno.Exception
+public T T getControl( Object aModel, ClassT aInterfaceClass ) throws 
com.sun.star.uno.Exception
 {
 XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class, 
aModel );
 return UnoRuntime.queryInterface( aInterfaceClass, getControl( xModel 
) );
@@ -171,7 +171,7 @@
  */
 public XFormController getFormController( XForm _form )
 {
-XFormLayerAccess formLayerAccess = (XFormLayerAccess)query( 
XFormLayerAccess.class );
+XFormLayerAccess formLayerAccess = query( XFormLayerAccess.class );
 return formLayerAccess.getFormController( _form );
 }
 
diff --git a/forms/qa/integration/forms/FormComponent.java 
b/forms/qa/integration/forms/FormComponent.java
index f19ceea..d6ea10d 100644
--- a/forms/qa/integration/forms/FormComponent.java
+++ b/forms/qa/integration/forms/FormComponent.java
@@ -79,7 +79,7 @@
 @param aInterfaceClass
 the class of the interface which shall be returned
 */
-public Object query( Class aInterfaceClass )
+public T T query( ClassT aInterfaceClass )
 {
 return UnoRuntime.queryInterface( aInterfaceClass, m_component );
 }
diff --git a/forms/qa/integration/forms/ListSelection.java 
b/forms/qa/integration/forms/ListSelection.java
index 5d080cb..64fef48 100644
--- a/forms/qa/integration/forms/ListSelection.java
+++ b/forms/qa/integration/forms/ListSelection.java
@@ -96,7 +96,7 @@
 for ( int i = 0; i  runs; ++i )
 {
 // obtain the active sheet
-XSpreadsheetView view = 

[PATCH] Convert SwDrawTextInfo.pText from XubString to OUString

2013-04-16 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3417

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/17/3417/1

Convert SwDrawTextInfo.pText from XubString to OUString

Change-Id: Ie567feb315a018a1f5bd794a4d12435865e67ec4
---
M sw/source/core/inc/drawfont.hxx
M sw/source/core/text/txtfly.cxx
M sw/source/core/txtnode/fntcache.cxx
M sw/source/core/txtnode/fntcap.cxx
M sw/source/core/txtnode/swfont.cxx
5 files changed, 46 insertions(+), 46 deletions(-)



diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx
index a577fa0..204a1a7 100644
--- a/sw/source/core/inc/drawfont.hxx
+++ b/sw/source/core/inc/drawfont.hxx
@@ -22,6 +22,7 @@
 
 #include tools/solar.h
 #include tools/string.hxx
+#include tools/debug.hxx
 
 class SwTxtFrm;
 class OutputDevice;
@@ -42,7 +43,7 @@
 ViewShell* pSh;
 const SwScriptInfo* pScriptInfo;
 const Point* pPos;
-const XubString* pText;
+const OUString* pText;
 const SwWrongList* pWrong;
 const SwWrongList* pGrammarCheck;
 const SwWrongList* pSmartTags;
@@ -103,7 +104,7 @@
 #endif
 
 SwDrawTextInfo( ViewShell *pS, OutputDevice rO, const SwScriptInfo* pSI,
-const XubString rSt, xub_StrLen nI, xub_StrLen nL,
+const OUString rSt, xub_StrLen nI, xub_StrLen nL,
 sal_uInt16 nW = 0, sal_Bool bB = sal_False )
 {
 pFrm = NULL;
@@ -202,7 +203,7 @@
 return pHyphPos;
 }
 
-const XubString GetText() const
+const OUString GetText() const
 {
 return *pText;
 }
@@ -415,7 +416,7 @@
 #endif
 }
 
-void SetText( const XubString rNew )
+void SetText( const OUString rNew )
 {
 pText = rNew;
 }
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index e38086a..3735e52 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -482,7 +482,7 @@
 SwRect aRect( rInf.GetPos(), rInf.GetSize() );
 if( rInf.GetSpace() )
 {
-xub_StrLen nTmpLen = STRING_LEN == rInf.GetLen() ? 
rInf.GetText().Len() :
+xub_StrLen nTmpLen = STRING_LEN == rInf.GetLen() ? 
rInf.GetText().getLength() :
   rInf.GetLen();
 if( rInf.GetSpace()  0 )
 {
@@ -490,7 +490,7 @@
 const xub_StrLen nEndPos = rInf.GetIdx() + nTmpLen;
 for( xub_StrLen nPos = rInf.GetIdx(); nPos  nEndPos; ++nPos )
 {
-if( CH_BLANK == rInf.GetText().GetChar( nPos ) )
+if( CH_BLANK == rInf.GetText()[ nPos ] )
 ++nSpaceCnt;
 }
 if( nSpaceCnt )
diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index 40369b0..84d18b9 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -219,7 +219,7 @@
const long nTmpSpaceAdd = rData.rInf.GetSpace() / SPACING_PRECISION_FACTOR;
 
if ( nEnd  rData.nCnt
-CH_BLANK == rData.rInf.GetText().GetChar( rData.rInf.GetIdx() + nEnd 
) )
+CH_BLANK == rData.rInf.GetText()[ rData.rInf.GetIdx() + nEnd ] )
{
if( nEnd + 1 == rData.nCnt )
nBlank -= nTmpSpaceAdd;
@@ -933,7 +933,7 @@
 pTmpFont-SetColor( aOldColor );
 
 if ( STRING_LEN == rInf.GetLen() )
-rInf.SetLen( rInf.GetText().Len() );
+rInf.SetLen( rInf.GetText().getLength() );
 
 
 //
@@ -974,7 +974,7 @@
 long nNextFix;
 
 // punctuation characters are not centered
-sal_Unicode cChar = rInf.GetText().GetChar( rInf.GetIdx() );
+sal_Unicode cChar = rInf.GetText()[ rInf.GetIdx() ];
 sal_uInt8 nType = lcl_WhichPunctuation( cChar );
 switch ( nType )
 {
@@ -997,7 +997,7 @@
 nNextFix += nWidthPerChar;
 
 // punctuation characters are not centered
-cChar = rInf.GetText().GetChar( rInf.GetIdx() + j );
+cChar = rInf.GetText()[ rInf.GetIdx() + j ];
 nType = lcl_WhichPunctuation( cChar );
 switch ( nType )
 {
@@ -1099,14 +1099,14 @@
 {
 for( xub_StrLen i = 0; i  rInf.GetLen(); i++, 
nKernSum += rInf.GetKern() )
 {
-if ( CH_BLANK == 
rInf.GetText().GetChar(rInf.GetIdx()+i) )
+if ( CH_BLANK == rInf.GetText()[ rInf.GetIdx()+i ] 
)
 nKernSum += nSpaceAdd;
 pKernArray[i] += nKernSum;
 }
 ///With through/uderstr. Grouped style requires a 
blank at the end
 ///of a text edition special measures:
 if( bPaintBlank  rInf.GetLen()  (CH_BLANK ==
-

[PATCH] Convert SfxChildList_Impl from SfxPtrArr to std::vector

2013-04-15 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3388

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/88/3388/1

Convert SfxChildList_Impl from SfxPtrArr to std::vector

and simplify use site

Change-Id: I287c280e1206f72dfaff4f38c24c8997e726887a
---
M sfx2/source/appl/workwin.cxx
M sfx2/source/inc/workwin.hxx
2 files changed, 38 insertions(+), 46 deletions(-)



diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 2f43e60..d9aa77c 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -524,14 +524,14 @@
 void SfxWorkWindow::Sort_Impl()
 {
 aSortedList.clear();
-for (sal_uInt16 i=0; ipChildren-Count(); i++)
+for (sal_uInt16 i = 0; i  aChildren.size(); ++i)
 {
-SfxChild_Impl *pCli = (*pChildren)[i];
+SfxChild_Impl *pCli = aChildren[i];
 if (pCli)
 {
 sal_uInt16 k;
 for (k=0; kaSortedList.size(); k++)
-if (ChildAlignValue((*pChildren)[aSortedList[k]]-eAlign) 
+if (ChildAlignValue( aChildren[aSortedList[k]]-eAlign ) 
 ChildAlignValue(pCli-eAlign))
 break;
 aSortedList.insert( aSortedList.begin() + k, i );
@@ -614,13 +614,10 @@
 pBindings-SetWorkWindow_Impl( this );
 
 pChildWins = new SfxChildWindows_Impl;
-pChildren = new SfxChildList_Impl;
 
 // For the ObjectBars a integral place in the Childlist is reserved,
 // so that they always come in a defined order.
-SfxChild_Impl* pChild=0;
-for (sal_uInt16 n=0; n  SFX_OBJECTBAR_MAX; ++n)
-pChildren-Insert(0,pChild);
+aChildren.insert( aChildren.begin(), SFX_OBJECTBAR_MAX, NULL );
 
 // create and initialize layout manager listener
 Reference com::sun::star::frame::XFrame  xFrame = GetFrameInterface();
@@ -648,8 +645,7 @@
 }
 
 // Delete help structure for Child-Windows
-DBG_ASSERT( pChildren-Count() == 0, dangling children );
-delete pChildren;
+DBG_ASSERT( aChildren.empty(), dangling children );
 delete pChildWins;
 
 if ( m_xLayoutManagerListener.is() )
@@ -744,7 +740,7 @@
 // Delete StatusBar
 ResetStatusBar_Impl();
 
-// Delete ObjectBars (this is done last, so that pChildren does not
+// Delete ObjectBars (this is done last, so that aChildren does not
 // receive dead Pointers)
 for ( sal_uInt16 i = 0; i  aObjBarList.size(); i++ )
 {
@@ -757,7 +753,7 @@
 
 // ObjectBars are all released at once, since they occupy a
 // fixed contiguous area in the array pChild
-pChildren-Remove(0, SFX_OBJECTBAR_MAX);
+aChildren.clear();
 bSorted = sal_False;
 
 nChildren = 0;
@@ -839,7 +835,7 @@
 
 for ( sal_uInt16 n=0; naSortedList.size(); ++n )
 {
-SfxChild_Impl* pCli = (*pChildren)[aSortedList[n]];
+SfxChild_Impl* pCli = aChildren[aSortedList[n]];
 if ( !pCli-pWin )
 continue;
 
@@ -981,7 +977,7 @@
 SfxChildAlignment eAlign, sal_Bool bCanGetFocus )
 {
 DBG_CHKTHIS(SfxWorkWindow, 0);
-DBG_ASSERT( pChildren-Count()  255, too many children );
+DBG_ASSERT( aChildren.size()  255, too many children );
 DBG_ASSERT( SfxChildAlignValid(eAlign), invalid align );
 DBG_ASSERT( !FindChild_Impl(rWindow), child registered more than once );
 
@@ -993,10 +989,10 @@
 eAlign, rWindow.IsVisible());
 pChild-bCanGetFocus = bCanGetFocus;
 
-pChildren-Insert(pChildren-Count(), pChild);
+aChildren.push_back(pChild);
 bSorted = sal_False;
 nChildren++;
-return (*pChildren)[pChildren-Count()-1];
+return aChildren.back();
 }
 
 //
@@ -1007,19 +1003,18 @@
 
 SfxChild_Impl *pChild = 0;
 sal_uInt16 nPos;
-for ( nPos = 0; nPos  pChildren-Count(); ++nPos )
+for ( nPos = 0; nPos  aChildren.size(); ++nPos )
 {
-pChild = (*pChildren)[nPos];
-if ( pChild )
-  if ( pChild-pWin == rWindow )
+pChild = aChildren[nPos];
+if ( pChild  pChild-pWin == rWindow )
 break;
 }
 
-if ( nPos  pChildren-Count() )
+if ( nPos  aChildren.size() )
 {
 bSorted = sal_False;
 nChildren--;
-pChildren-Remove(nPos);
+aChildren.erase(aChildren.begin() + nPos);
 delete pChild;
 }
 else {
@@ -1034,12 +1029,11 @@
 DBG_CHKTHIS(SfxWorkWindow, 0);
 
 SfxChild_Impl *pChild = 0;
-sal_uInt16 nCount = pChildren-Count();
+sal_uInt16 nCount = aChildren.size();
 for ( sal_uInt16 nPos = 0; nPos  nCount; ++nPos )
 {
-pChild = (*pChildren)[nPos];
-if ( pChild )
-  if ( pChild-pWin == rWindow )
+pChild = aChildren[nPos];
+if ( pChild  pChild-pWin == rWindow )
 return pChild;
 }
 
@@ -1054,11 +1048,10 

[PATCH] Convert SfxChildWindows_Impl from SfxPtrArr to std::vector

2013-04-15 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3390

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/90/3390/1

Convert SfxChildWindows_Impl from SfxPtrArr to std::vector

- also remove dead struct SfxSplitWin_Impl

Change-Id: I408bd994b206963b5ac115f4d47fc79c6687e051
---
M sfx2/source/appl/workwin.cxx
M sfx2/source/inc/workwin.hxx
2 files changed, 63 insertions(+), 72 deletions(-)



diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index d9aa77c..435bddd 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -613,8 +613,6 @@
 
 pBindings-SetWorkWindow_Impl( this );
 
-pChildWins = new SfxChildWindows_Impl;
-
 // For the ObjectBars a integral place in the Childlist is reserved,
 // so that they always come in a defined order.
 aChildren.insert( aChildren.begin(), SFX_OBJECTBAR_MAX, NULL );
@@ -646,7 +644,6 @@
 
 // Delete help structure for Child-Windows
 DBG_ASSERT( aChildren.empty(), dangling children );
-delete pChildWins;
 
 if ( m_xLayoutManagerListener.is() )
 m_xLayoutManagerListener-dispose();
@@ -689,11 +686,11 @@
 }
 
 // Delete Child-Windows
-for ( n=0; npChildWins-Count(); )
+for ( n=0; naChildWins.size(); )
 {
-SfxChildWin_Impl* pCW = (*pChildWins)[n];
-pChildWins-Remove(n);
-   SfxChildWindow *pChild = pCW-pWin;
+SfxChildWin_Impl* pCW = aChildWins[n];
+aChildWins.erase(aChildWins.begin());
+SfxChildWindow *pChild = pCW-pWin;
 if (pChild)
 {
 pChild-Hide();
@@ -960,9 +957,9 @@
 
 sal_Bool SfxWorkWindow::PrepareClose_Impl()
 {
-for (sal_uInt16 n=0; npChildWins-Count(); n++)
+for (sal_uInt16 n=0; naChildWins.size(); n++)
 {
-SfxChildWin_Impl *pCW  = (*pChildWins)[n];
+SfxChildWin_Impl *pCW  = aChildWins[n];
 SfxChildWindow *pChild = pCW-pWin;
 if ( pChild  !pChild-QueryClose() )
 return sal_False;
@@ -1057,9 +1054,9 @@
 {
 // We have to find the SfxChildWin_Impl to retrieve the
 // SFX_CHILDWIN flags that can influence visibility.
-for (sal_uInt16 n=0; npChildWins-Count(); n++)
+for (sal_uInt16 n=0; naChildWins.size(); n++)
 {
-SfxChildWin_Impl* pCWin = (*pChildWins)[n];
+SfxChildWin_Impl* pCWin = aChildWins[n];
 SfxChild_Impl*pChild  = pCWin-pCli;
 if ( pChild == pCli )
 {
@@ -1142,8 +1139,8 @@
 for ( n = 0; n  aObjBarList.size(); n++ )
 aObjBarList[n].bDestroy = sal_True;
 
-for ( n = 0; n  pChildWins-Count(); ++n )
-(*pChildWins)[n]-nId = 0;
+for ( n = 0; n  aChildWins.size(); ++n )
+aChildWins[n]-nId = 0;
 }
 
 //
@@ -1435,9 +1432,9 @@
 void SfxWorkWindow::UpdateChildWindows_Impl()
 {
 // any current or in the context available Childwindows
-for ( sal_uInt16 n=0; npChildWins-Count(); n++ )
+for ( sal_uInt16 n=0; naChildWins.size(); n++ )
 {
-SfxChildWin_Impl *pCW = (*pChildWins)[n];
+SfxChildWin_Impl *pCW = aChildWins[n];
 SfxChildWindow *pChildWin = pCW-pWin;
 sal_Bool bCreate = sal_False;
 if ( pCW-nId  !pCW-bDisabled   (pCW-aInfo.nFlags  
SFX_CHILDWIN_ALWAYSAVAILABLE || IsVisible_Impl( pCW-nVisibility ) ) )
@@ -1680,9 +1677,9 @@
 //
 void SfxWorkWindow::HidePopups_Impl(sal_Bool bHide, sal_Bool bParent, 
sal_uInt16 nId )
 {
-for ( sal_uInt16 n = 0; n  pChildWins-Count(); ++n )
+for ( sal_uInt16 n = 0; n  aChildWins.size(); ++n )
 {
-SfxChildWindow *pCW = (*pChildWins)[n]-pWin;
+SfxChildWindow *pCW = aChildWins[n]-pWin;
 if (pCW  pCW-GetAlignment() == SFX_ALIGN_NOALIGNMENT  
pCW-GetType() != nId)
 {
 Window *pWin = pCW-GetWindow();
@@ -1722,9 +1719,9 @@
 else
 {
 // configure direct childwindow
-for (sal_uInt16 n=0; npChildWins-Count(); n++)
+for (sal_uInt16 n=0; naChildWins.size(); n++)
 {
-pCW = (*pChildWins)[n];
+pCW = aChildWins[n];
 SfxChildWindow *pChild = pCW-pWin;
 if ( pChild )
 {
@@ -1983,11 +1980,11 @@
 if ( pWork )
 {
 // The Parent already known?
-sal_uInt16 nCount = pWork-pChildWins-Count();
+sal_uInt16 nCount = pWork-aChildWins.size();
 for (sal_uInt16 n=0; nnCount; n++)
-if ((*pWork-pChildWins)[n]-nSaveId == nId)
+if (pWork-aChildWins[n]-nSaveId == nId)
 {
-pCW = (*pWork-pChildWins)[n];
+pCW = pWork-aChildWins[n];
 break;
 }
 }
@@ -1995,11 +1992,11 @@
 if ( !pCW )
 {
 // If 

[PATCH] remove dead class SfxResourceManager

2013-04-15 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3393

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/93/3393/1

remove dead class SfxResourceManager

Change-Id: I33590e7907c593d821e2eafda0e04c76c8b99879
---
D sfx2/inc/resmgr.hxx
M sfx2/inc/sfx2/app.hxx
M sfx2/source/appl/appdata.cxx
M sfx2/source/inc/appdata.hxx
4 files changed, 0 insertions(+), 69 deletions(-)



diff --git a/sfx2/inc/resmgr.hxx b/sfx2/inc/resmgr.hxx
deleted file mode 100644
index 7e6f837..000
--- a/sfx2/inc/resmgr.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the License); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _SFX_RESMGR_HXX
-#define _SFX_RESMGR_HXX
-
-#include sfx2/minarray.hxx
-
-class SfxMessageDescription;
-class SfxMessageTable;
-class Bitmap;
-class ResMgr;
-
-DECL_PTRARRAY(SfxResMgrArr, ResMgr *, 1, 1);
-
-// INCLUDE ---
-
-class SfxResourceManager
-{
-SfxResMgrArraResMgrArr;
-SfxResMgrArraResMgrBmpArr;
-sal_uInt16  nEnterCount;
-SfxMessageTable*pMessageTable;
-
-private:
-voidClearMsgTable_Impl();
-SfxMessageDescription*  MakeDesc_Impl(sal_uInt16);
-
-public:
-SfxResourceManager();
-~SfxResourceManager();
-
-sal_uInt16  RegisterResource( const char *pFileName);
-voidReleaseResource( sal_uInt16 nRegisterId );
-
-sal_uInt16  RegisterBitmap(const char *pMono, const 
char *pColor);
-
-sal_uInt16  RegisterBitmap( const char *pSingleFile );
-voidReleaseBitmap( sal_uInt16 nRegisterId );
-
-Bitmap  GetAllBitmap( sal_uInt16 nBmpsPerRow );
-
-voidEnter();
-voidLeave();
-SfxMessageDescription*  CreateDescription( sal_uInt16 nId );
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index 2f81d6d..858140d 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -65,7 +65,6 @@
 class SfxObjectShell;
 class SfxObjectShellArr_Impl;
 class SfxProgress;
-class SfxResourceManager;
 class SfxSlotPool;
 class SfxStbCtrlFactArr_Impl;
 class SfxTbxCtrlFactArr_Impl;
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 2988d8b..a2c79ca 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -112,7 +112,6 @@
 , pBasMgrListener( new SfxBasicManagerCreationListener( *this ) )
 , pViewFrame( 0 )
 , pSlotPool( 0 )
-, pResMgr( 0 )
 , pAppDispat( 0 )
 , pInterfaces( 0 )
 , nDocNo(0)
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 786528a..3e92ccd8 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -56,7 +56,6 @@
 class ResMgr;
 class SfxViewFrame;
 class SfxSlotPool;
-class SfxResourceManager;
 class SfxDispatcher;
 class SfxInterface;
 class BasicManager;
@@ -129,7 +128,6 @@
 pBasMgrListener;
 SfxViewFrame*   pViewFrame;
 SfxSlotPool*pSlotPool;
-SfxResourceManager* pResMgr;
 SfxDispatcher*  pAppDispat; // Dispatcher if no document
 SfxInterface**  pInterfaces;
 

-- 
To view, visit https://gerrit.libreoffice.org/3393
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33590e7907c593d821e2eafda0e04c76c8b99879
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Convert SfxShellStack_Impl from SfxPtrArr to std::vector

2013-04-15 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3394

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/94/3394/1

Convert SfxShellStack_Impl from SfxPtrArr to std::vector

Change-Id: I1ffd615a505029242a87337c9ef42c8156c42d70
---
M sfx2/inc/sfx2/dispatch.hxx
M sfx2/source/control/dispatch.cxx
2 files changed, 49 insertions(+), 54 deletions(-)



diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx
index c7aaae3..2b02a5e 100644
--- a/sfx2/inc/sfx2/dispatch.hxx
+++ b/sfx2/inc/sfx2/dispatch.hxx
@@ -28,11 +28,11 @@
 #include sfx2/bindings.hxx
 #include sfx2/viewfrm.hxx
 #include map
+#include vector
 
 class SfxSlotServer;
 class SfxShell;
 class SfxRequest;
-class SfxShellStack_Impl;
 class SfxHintPoster;
 class SfxViewFrame;
 class SfxBindings;
@@ -41,6 +41,8 @@
 class SfxModule;
 struct SfxDispatcher_Impl;
 
+typedef std::vectorSfxShell* SfxShellStack_Impl;
+
 namespace com
 {
 namespace sun
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 16a83a1..26fd6f0 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -30,6 +30,7 @@
 #include stdio.h
 #include stdarg.h
 #include stdlib.h  // due to bsearch
+#include algorithm
 
 #include svtools/helpopt.hxx
 
@@ -37,7 +38,6 @@
 #include appdata.hxx
 #include sfx2/sfxhelp.hxx
 #include sfx2/dispatch.hxx
-#include sfx2/minstack.hxx
 #include sfx2/msg.hxx
 #include sfx2/objface.hxx
 #include sfx2/bindings.hxx
@@ -66,8 +66,6 @@
 DBG_NAME(SfxDispatcherFillState)
 
 typedef std::vectorSfxRequest* SfxRequestPtrArray;
-
-DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 );
 
 struct SfxToDo_Impl
 {
@@ -552,14 +550,15 @@
 for(std::dequeSfxToDo_Impl::reverse_iterator i = 
pImp-aToDoStack.rbegin(); i != pImp-aToDoStack.rend(); ++i)
 {
 if(i-bPush)
-aStack.Push(i-pCluster);
+aStack.push_back(i-pCluster);
 else
 {
 SfxShell* pPopped(NULL);
 do
 {
-DBG_ASSERT( aStack.Count(), popping from empty stack );
-pPopped = aStack.Pop();
+DBG_ASSERT( !aStack.empty(), popping from empty stack );
+pPopped = aStack.back();
+aStack.pop_back();
 }
 while(i-bUntil  pPopped != i-pCluster);
 DBG_ASSERT(pPopped == i-pCluster, popping unpushed 
SfxInterface);
@@ -568,9 +567,9 @@
 
 sal_Bool bReturn;
 if ( bDeep )
-bReturn = aStack.Contains(rShell);
+bReturn = std::find(aStack.begin(), aStack.end(), rShell) != 
aStack.end();
 else
-bReturn = aStack.Top() == rShell;
+bReturn = aStack.back() == rShell;
 return bReturn;
 }
 
@@ -596,15 +595,15 @@
 SFX_STACK(SfxDispatcher::GetShellLevel);
 Flush();
 
-for ( sal_uInt16 n = 0; n  pImp-aStack.Count(); ++n )
-if ( pImp-aStack.Top( n ) == rShell )
+for ( sal_uInt16 n = 0; n  pImp-aStack.size(); ++n )
+if ( *( pImp-aStack.rbegin() + n ) == rShell )
 return n;
 if ( pImp-pParent )
 {
 sal_uInt16 nRet = pImp-pParent-GetShellLevel(rShell);
 if ( nRet == USHRT_MAX )
 return nRet;
-return  nRet + pImp-aStack.Count();
+return  nRet + pImp-aStack.size();
 }
 
 return USHRT_MAX;
@@ -624,9 +623,9 @@
 */
 
 {
-sal_uInt16 nShellCount = pImp-aStack.Count();
+sal_uInt16 nShellCount = pImp-aStack.size();
 if ( nIdx  nShellCount )
-return pImp-aStack.Top(nIdx);
+return *(pImp-aStack.rbegin() + nIdx);
 else if ( pImp-pParent )
 return pImp-pParent-GetShell( nIdx - nShellCount );
 return 0;
@@ -717,8 +716,8 @@
 if ( IsAppDispatcher() )
 return;
 
-for ( int i = int(pImp-aStack.Count()) - 1; i = 0; --i )
-pImp-aStack.Top( (sal_uInt16) i )-DoActivate_Impl(pImp-pFrame, 
bMDI);
+for ( int i = int(pImp-aStack.size()) - 1; i = 0; --i )
+(*(pImp-aStack.rbegin() + i ))-DoActivate_Impl(pImp-pFrame, bMDI);
 
 if ( bMDI  pImp-pFrame )
 {
@@ -743,8 +742,8 @@
 
 void SfxDispatcher::DoParentActivate_Impl()
 {
-for ( int i = int(pImp-aStack.Count()) - 1; i = 0; --i )
-pImp-aStack.Top( (sal_uInt16) i )-ParentActivate();
+for ( int i = int(pImp-aStack.size()) - 1; i = 0; --i )
+(*(pImp-aStack.rbegin() + i ))-ParentActivate();
 }
 
 //
@@ -798,8 +797,8 @@
 if ( IsAppDispatcher()  !pSfxApp-IsDowning() )
 return;
 
-for ( sal_uInt16 i = 0; i  pImp-aStack.Count(); ++i )
-pImp-aStack.Top(i)-DoDeactivate_Impl(pImp-pFrame, bMDI);
+for ( sal_uInt16 i = 0; i  pImp-aStack.size(); ++i )
+(*(pImp-aStack.rbegin() + i))-DoDeactivate_Impl(pImp-pFrame, bMDI);
 
 sal_Bool bHidePopups = bMDI  pImp-pFrame;
 if ( pNew  pImp-pFrame )
@@ -831,8 +830,8 @@
 
 void 

[PATCH] remove dead code minstack.hxx

2013-04-15 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3397

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/97/3397/1

remove dead code minstack.hxx

Change-Id: I67a7a4c51188187c1ab234f8e9d2634eb018badf
---
M sfx2/Package_inc.mk
D sfx2/inc/sfx2/minstack.hxx
M sfx2/source/menu/mnumgr.cxx
3 files changed, 0 insertions(+), 58 deletions(-)



diff --git a/sfx2/Package_inc.mk b/sfx2/Package_inc.mk
index 228cc62..4c08af5 100644
--- a/sfx2/Package_inc.mk
+++ b/sfx2/Package_inc.mk
@@ -74,7 +74,6 @@
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/mieclip.hxx,sfx2/mieclip.hxx))
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/minarray.hxx,sfx2/minarray.hxx))
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/minfitem.hxx,sfx2/minfitem.hxx))
-$(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/minstack.hxx,sfx2/minstack.hxx))
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/mnuitem.hxx,sfx2/mnuitem.hxx))
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/mnumgr.hxx,sfx2/mnumgr.hxx))
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/module.hxx,sfx2/module.hxx))
diff --git a/sfx2/inc/sfx2/minstack.hxx b/sfx2/inc/sfx2/minstack.hxx
deleted file mode 100644
index d4de0da..000
--- a/sfx2/inc/sfx2/minstack.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the License); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _SFXMINSTACK_HXX
-#define _SFXMINSTACK_HXX
-
-#include sfx2/minarray.hxx
-
-#define DECL_PTRSTACK( ARR, T, nI, nG ) \
-DECL_PTRARRAY( ARR##arr_, T, nI, nG ) \
-class ARR: private ARR##arr_ \
-{ \
-public: \
-ARR( sal_uInt8 nInitSize = nI, sal_uInt8 nGrowSize = nG ): \
-ARR##arr_( nInitSize, nGrowSize ) \
-{} \
-\
-ARR( const ARR rOrig ): \
-ARR##arr_( rOrig ) \
-{} \
-\
-sal_uInt16  Count() const { return ARR##arr_::Count(); } \
-voidPush( T rElem ) { Append( rElem ); } \
-T   Top( sal_uInt16 nLevel = 0 ) const \
-{ return (*this)[Count()-nLevel-1]; } \
-T   Bottom() const { return (*this)[0]; } \
-T   Pop() \
-{   T aRet = (*this)[Count()-1]; \
-Remove( Count()-1, 1 ); \
-return aRet; \
-} \
-T*   operator*() \
-{ return (*this)[Count()-1]; } \
-voidClear() { ARR##arr_::Clear(); } \
-sal_BoolContains( const T pItem ) const \
-{ return ARR##arr_::Contains( pItem ); } \
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index a83e975..0a2f0ca 100644
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -52,7 +52,6 @@
 #include virtmenu.hxx
 #include sfx2/msg.hxx
 #include sfx2/dispatch.hxx
-#include sfx2/minstack.hxx
 #include sfx2/app.hxx
 #include sfxtypes.hxx
 #include sfx2/bindings.hxx

-- 
To view, visit https://gerrit.libreoffice.org/3397
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I67a7a4c51188187c1ab234f8e9d2634eb018badf
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Convert SmFontPickList from SfxPtrArr to std::vector

2013-04-15 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3398

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/98/3398/1

Convert SmFontPickList from SfxPtrArr to std::vector

- removing SmPickList in the process, since it's only used
  as a base class for SmFontPickList
- and remove dynamic allocation, since we're always making our
  own copy, just store the data inline in the vector

Change-Id: Idedff240456788c473ac49bdaa3f6d27a217e3d6
---
M starmath/inc/utility.hxx
M starmath/source/utility.cxx
2 files changed, 71 insertions(+), 197 deletions(-)



diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx
index 0f4a748..01a41cd 100644
--- a/starmath/inc/utility.hxx
+++ b/starmath/inc/utility.hxx
@@ -19,12 +19,12 @@
 #ifndef UTILITY_HXX
 #define UTILITY_HXX
 
-#include sfx2/minarray.hxx
 #include vcl/font.hxx
 #include vcl/fixed.hxx
 #include vcl/combobox.hxx
 #include vcl/lstbox.hxx
 #include tools/fract.hxx
+#include deque
 
 
 inline long SmPtsTo100th_mm(long nNumPts)
@@ -114,114 +114,38 @@
 
 
 //
-// SmPickList
-//
-
-class SmPickList : public SfxPtrArr
-{
-protected:
-sal_uInt16  nSize;
-
-virtual void   *CreateItem(const void *pItem) = 0;
-virtual voidDestroyItem(void *pItem) = 0;
-
-virtual boolCompareItem(const void *pFirstItem, const void 
*pSecondItem) const = 0;
-
-virtual OUString GetStringItem(void *pItem) = 0;
-
-void   *GetPtr(sal_uInt16 nPos) const { return 
SfxPtrArr::GetObject(nPos); }
-void  *GetPtr(sal_uInt16 nPos) { return SfxPtrArr::GetObject(nPos); }
-voidInsertPtr(sal_uInt16 nPos, void *pItem) { 
SfxPtrArr::Insert(nPos, pItem); }
-voidRemovePtr(sal_uInt16 nPos, sal_uInt16 nCount = 1) { 
SfxPtrArr::Remove(nPos, nCount); }
-
-public:
-SmPickList(sal_uInt16 nInitSize = 0, sal_uInt16 nMaxSize = 5);
-virtual ~SmPickList();
-
-SmPickList   operator = (const SmPickList rList);
-
-void   *Get(sal_uInt16 nPos = 0) const { return GetPtr(nPos); }
-using   SfxPtrArr::Insert;
-voidInsert(const void* pItem);
-voidUpdate(const void* pItem, const void *pNewItem);
-using   SfxPtrArr::Remove;
-voidRemove(const void* pItem);
-
-using   SfxPtrArr::operator [];
-void   *operator [] (sal_uInt16 nPos) const { return GetPtr(nPos); }
-
-sal_uInt16  GetSize() const { return nSize; }
-sal_uInt16  Count() const { return SfxPtrArr::Count(); }
-
-voidClear();
-};
-
-
-
-//
 // SmFontPickList
 //
 
 class SmFontDialog;
 
-class SmFontPickList : public SmPickList
+class SmFontPickList
 {
 protected:
-virtual void   *CreateItem(const void *pItem);
-virtual voidDestroyItem(void *pItem);
+sal_uInt16 nMaxItems;
+std::dequeFont aFontVec;
 
-virtual boolCompareItem(const void *pFirstItem, const void 
*pSecondItem) const;
-
-virtual OUString GetStringItem(void *pItem);
+bool CompareItem(const Font  rFirstFont, const Font  rSecondFont) 
const;
+OUString GetStringItem(const Font rItem);
 
 public:
-SmFontPickList()
-: SmPickList(0, 5) {}
-SmFontPickList(sal_uInt16 nInitSize, sal_uInt16 nMaxSize)
-: SmPickList(nInitSize, nMaxSize) {}
-SmFontPickList(const SmPickList rOrig )
-: SmPickList(rOrig) {}
+SmFontPickList(sal_uInt16 nMax = 5) : nMaxItems(nMax) {}
 virtual ~SmFontPickList() { Clear(); }
 
-using   SfxPtrArr::Insert;
 virtual voidInsert(const Font rFont);
-using   SmPickList::Update;
 virtual voidUpdate(const Font rFont, const Font rNewFont);
-using   SfxPtrArr::Remove;
 virtual voidRemove(const Font rFont);
 
-using   SmPickList::Contains;
-inline bool Contains(const Font rFont) const;
-inline Font Get(sal_uInt16 nPos = 0) const;
+void Clear();
+bool Contains(const Font rFont) const;
+Font Get(sal_uInt16 nPos = 0) const;
 
-inline SmFontPickList  operator = (const SmFontPickList rList);
-using   SfxPtrArr::operator [];
-inline Font operator [] (sal_uInt16 nPos) const;
+SmFontPickList  operator = (const SmFontPickList rList);
+Font operator [] (sal_uInt16 nPos) const;
 
 voidReadFrom(const SmFontDialog rDialog);
 voidWriteTo(SmFontDialog rDialog) const;
 };
-
-inline SmFontPickList SmFontPickList::operator = (const SmFontPickList rList)
-{
-*(SmPickList *)this = *(SmPickList *)rList; return *this;
-}
-
-inline Font SmFontPickList::operator [] (sal_uInt16 nPos) const
-{
-return *((Font *)SmPickList::operator[](nPos));
-}
-
-inline Font SmFontPickList::Get(sal_uInt16 nPos) const
-{
-return nPos  Count() ? *((Font *)SmPickList::Get(nPos)) : Font();
-}
-
-inline bool SmFontPickList::Contains(const Font rFont) 

[PATCH] remove dead class SfxPtrAr and it's header sfx/inc/sfx2/mina...

2013-04-15 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3399

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/99/3399/1

remove dead class SfxPtrAr and it's header sfx/inc/sfx2/minarray.hxx

Change-Id: I23c9f905e6f679299f95baa6d8d4bafa97a3f19a
---
M cui/source/inc/acccfg.hxx
M cui/source/inc/cfg.hxx
M cui/source/inc/selector.hxx
M sfx2/Library_sfx.mk
M sfx2/Package_inc.mk
M sfx2/inc/arrdecl.hxx
M sfx2/inc/sfx2/bindings.hxx
D sfx2/inc/sfx2/minarray.hxx
D sfx2/source/bastyp/minarray.cxx
M sfx2/source/control/msgpool.cxx
M sfx2/source/control/objface.cxx
M sfx2/source/dialog/tabdlg.cxx
M sfx2/source/inc/workwin.hxx
13 files changed, 0 insertions(+), 351 deletions(-)



diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx
index 19eba29..2354998 100644
--- a/cui/source/inc/acccfg.hxx
+++ b/cui/source/inc/acccfg.hxx
@@ -43,7 +43,6 @@
 #include svtools/treelistbox.hxx
 #include sfx2/tabdlg.hxx
 #include sfx2/basedlgs.hxx
-#include sfx2/minarray.hxx
 #include cfgutil.hxx
 
 class SfxMacroInfoItem;
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 84ecf04..62686df 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -40,7 +40,6 @@
 #include com/sun/star/uno/XComponentContext.hpp
 #include com/sun/star/lang/XSingleComponentFactory.hpp
 
-#include sfx2/minarray.hxx
 #include sfx2/tabdlg.hxx
 #include vector
 #include vcl/msgbox.hxx
diff --git a/cui/source/inc/selector.hxx b/cui/source/inc/selector.hxx
index 4c14e99..40c8a64 100644
--- a/cui/source/inc/selector.hxx
+++ b/cui/source/inc/selector.hxx
@@ -30,7 +30,6 @@
 #include com/sun/star/container/XNameAccess.hpp
 #include com/sun/star/script/browse/XBrowseNode.hpp
 
-#include sfx2/minarray.hxx
 #include boost/ptr_container/ptr_vector.hpp
 
 #define SVX_CFGGROUP_FUNCTION 1
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 98adaa9..cf0ed52 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -122,7 +122,6 @@
 sfx2/source/bastyp/frmhtmlw \
 sfx2/source/bastyp/helper \
 sfx2/source/bastyp/mieclip \
-sfx2/source/bastyp/minarray \
 sfx2/source/bastyp/progress \
 sfx2/source/bastyp/sfxhtml \
 sfx2/source/bastyp/sfxresid \
diff --git a/sfx2/Package_inc.mk b/sfx2/Package_inc.mk
index 4c08af5..0b49d4b 100644
--- a/sfx2/Package_inc.mk
+++ b/sfx2/Package_inc.mk
@@ -72,7 +72,6 @@
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/mailmodelapi.hxx,sfx2/mailmodelapi.hxx))
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/mgetempl.hxx,sfx2/mgetempl.hxx))
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/mieclip.hxx,sfx2/mieclip.hxx))
-$(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/minarray.hxx,sfx2/minarray.hxx))
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/minfitem.hxx,sfx2/minfitem.hxx))
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/mnuitem.hxx,sfx2/mnuitem.hxx))
 $(eval $(call 
gb_Package_add_file,sfx2_inc,inc/sfx2/mnumgr.hxx,sfx2/mnumgr.hxx))
diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx
index 04ea256..0cfdf60 100644
--- a/sfx2/inc/arrdecl.hxx
+++ b/sfx2/inc/arrdecl.hxx
@@ -19,7 +19,6 @@
 #ifndef _SFX_ARRDECL_HXX
 #define _SFX_ARRDECL_HXX
 
-#include sfx2/minarray.hxx
 #include vector
 
 class SfxObjectShell;
diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx
index 9479e8f..664673c 100644
--- a/sfx2/inc/sfx2/bindings.hxx
+++ b/sfx2/inc/sfx2/bindings.hxx
@@ -34,7 +34,6 @@
 //  some other includes
 
//
 
-#include sfx2/minarray.hxx
 #include sfx2/viewfrm.hxx
 
 
//
diff --git a/sfx2/inc/sfx2/minarray.hxx b/sfx2/inc/sfx2/minarray.hxx
deleted file mode 100644
index 48ea05b..000
--- a/sfx2/inc/sfx2/minarray.hxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the License); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _SFXVARARR_HXX
-#define _SFXVARARR_HXX
-
-#include sal/config.h
-#include sfx2/dllapi.h
-

[PATCH] Convert usage of SfxPtrArray to std::vector

2013-04-12 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3356

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/56/3356/1

Convert usage of SfxPtrArray to std::vector

Change-Id: I38664f59e4cfa7354196437901175c9ef9aa9006
---
M sfx2/inc/sfx2/bindings.hxx
M sfx2/source/control/bindings.cxx
2 files changed, 52 insertions(+), 46 deletions(-)



diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx
index 73ac3dc..9479e8f 100644
--- a/sfx2/inc/sfx2/bindings.hxx
+++ b/sfx2/inc/sfx2/bindings.hxx
@@ -121,6 +121,7 @@
 const SfxFoundCache_Impl* pFound,
 const SfxPoolItem *pItem,
 SfxItemState eItemState );
+SAL_DLLPRIVATE SfxStateCache* GetStateCache( sal_uInt16 nId, sal_uInt16 
*pPos);
 DECL_DLLPRIVATE_LINK( NextJob_Impl, Timer * );
 
 public:
@@ -149,7 +150,7 @@
 sal_Bool IsBound( sal_uInt16 nMsgId, sal_uInt16 nStartSearchAt = 0 
);
 
 const SfxSlot*   GetSlot( sal_uInt16 nMsgId );
-SfxStateCache*   GetStateCache( sal_uInt16 nId, sal_uInt16 *pPos = 0 );
+SfxStateCache*   GetStateCache( sal_uInt16 nId);
 SAL_DLLPRIVATE SfxStateCache* GetAnyStateCache_Impl( sal_uInt16 nId );
 /**
  * @param rpState the caller has to delete the pointer
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index d2981d4..5df40c1 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -93,7 +93,7 @@
 
 //
 
-DECL_PTRARRAY(SfxStateCacheArr_Impl, SfxStateCache*, 32, 16)
+typedef std::vectorSfxStateCache* SfxStateCacheArr_Impl;
 
 //
 
@@ -264,9 +264,8 @@
 DeleteControllers_Impl();
 
 // Delete Caches
-sal_uInt16 nCount = pImp-pCaches-Count();
-for ( sal_uInt16 nCache = 0; nCache  nCount; ++nCache )
-delete pImp-pCaches-GetObject(nCache);
+for(SfxStateCacheArr_Impl::const_iterator it = pImp-pCaches-begin(); it 
!= pImp-pCaches-end(); ++it)
+delete *it;
 
 DELETEZ( pImp-pWorkWin );
 
@@ -279,34 +278,34 @@
 void SfxBindings::DeleteControllers_Impl()
 {
 // in the first round delete SfxPopupWindows
-sal_uInt16 nCount = pImp-pCaches-Count();
+sal_uInt16 nCount = pImp-pCaches-size();
 sal_uInt16 nCache;
 for ( nCache = 0; nCache  nCount; ++nCache )
 {
 // Remember were you are
-SfxStateCache *pCache = pImp-pCaches-GetObject(nCache);
+SfxStateCache *pCache = (*pImp-pCaches)[nCache];
 sal_uInt16 nSlotId = pCache-GetId();
 
 // Delete SfxPopupWindow
 pCache-DeleteFloatingWindows();
 
 // Re-align, because the cache may have been reduced
-sal_uInt16 nNewCount = pImp-pCaches-Count();
+sal_uInt16 nNewCount = pImp-pCaches-size();
 if ( nNewCount  nCount )
 {
 nCache = GetSlotPos(nSlotId);
 if ( nCache = nNewCount ||
- nSlotId != pImp-pCaches-GetObject(nCache)-GetId() )
+ nSlotId != (*pImp-pCaches)[nCache]-GetId() )
 --nCache;
 nCount = nNewCount;
 }
 }
 
 // Delete all Caches
-for ( nCache = pImp-pCaches-Count(); nCache  0; --nCache )
+for ( nCache = pImp-pCaches-size(); nCache  0; --nCache )
 {
 // Get Cache via ::com::sun::star::sdbcx::Index
-SfxStateCache *pCache = pImp-pCaches-GetObject(nCache-1);
+SfxStateCache *pCache = (*pImp-pCaches)[ nCache-1 ];
 
 // unbind all controllers in the cache
 SfxControllerItem *pNext;
@@ -321,9 +320,9 @@
 pCache-GetInternalController()-UnBind();
 
 // Delete Cache
-if( nCache-1  pImp-pCaches-Count() )
+if( nCache-1  (sal_uInt16) pImp-pCaches-size() )
 delete (*pImp-pCaches)[nCache-1];
-pImp-pCaches-Remove(nCache-1, 1);
+pImp-pCaches-erase(pImp-pCaches-begin()+ nCache - 1);
 }
 
 if( pImp-pUnoCtrlArr )
@@ -372,8 +371,8 @@
 pImp-ePopupAction = SFX_POPUP_SHOW;
 }
 
-for ( sal_uInt16 nCache = 0; nCache  pImp-pCaches-Count(); ++nCache )
-pImp-pCaches-GetObject(nCache)-DeleteFloatingWindows();
+for(SfxStateCacheArr_Impl::const_iterator it = pImp-pCaches-begin(); it 
!= pImp-pCaches-end(); ++it)
+(*it)-DeleteFloatingWindows();
 pImp-ePopupAction = SFX_POPUP_DELETE;
 }
 
@@ -639,6 +638,14 @@
 
 SfxStateCache* SfxBindings::GetStateCache
 (
+sal_uInt16   nId   /*  Slot-Id, which SfxStatusCache is to be found */
+)
+{
+return GetStateCache(nId, 0);
+}
+
+SfxStateCache* SfxBindings::GetStateCache
+(
 sal_uInt16   nId,   /*  Slot-Id, which SfxStatusCache is to be found */
 sal_uInt16*  pPos   /*  NULL for instance the position from which the
bindings are to be searched binary. 

[PATCH] Convert SfxPtrArray to std::vector in SfxTabDialogItem

2013-04-12 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3358

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/58/3358/1

Convert SfxPtrArray to std::vector in SfxTabDialogItem

Also simplify the use-site, we don't need to new it.

Change-Id: I310f2027fb777380b8bddb73b169021f5448a6f6
---
M sfx2/source/dialog/tabdlg.cxx
1 file changed, 32 insertions(+), 40 deletions(-)



diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index ac88e91..cefa164 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -156,14 +156,14 @@
 pDialog-Hide();
 }
 
-DECL_PTRARRAY(SfxTabDlgData_Impl, Data_Impl *, 4,4)
+typedef std::vectorData_Impl* SfxTabDlgData_Impl;
 
 struct TabDlg_Impl
 {
-sal_BoolbModified   : 1,
+sal_BoolbModified   : 1,
 bModal  : 1,
 bHideResetBtn   : 1;
-SfxTabDlgData_Impl* pData;
+SfxTabDlgData_Impl  aData;
 
 SfxTabDialogController* pController;
 
@@ -172,21 +172,20 @@
 bModified   ( sal_False ),
 bModal  ( sal_True ),
 bHideResetBtn   ( sal_False ),
-pData   ( new SfxTabDlgData_Impl( nCnt ) ),
 pController ( NULL )
-{}
+{
+aData.reserve( nCnt );
+}
 ~TabDlg_Impl()
 {
 delete pController;
-delete pData;
 }
 };
 
-Data_Impl* Find( SfxTabDlgData_Impl rArr, sal_uInt16 nId, sal_uInt16* pPos = 
0 );
 
-Data_Impl* Find( SfxTabDlgData_Impl rArr, sal_uInt16 nId, sal_uInt16* pPos )
+static Data_Impl* Find( const SfxTabDlgData_Impl rArr, sal_uInt16 nId, 
sal_uInt16* pPos = 0)
 {
-const sal_uInt16 nCount = rArr.Count();
+const sal_uInt16 nCount = rArr.size();
 
 for ( sal_uInt16 i = 0; i  nCount; ++i )
 {
@@ -511,10 +510,9 @@
 {
 SavePosAndId();
 
-const sal_uInt16 nCount = pImpl-pData-Count();
-for ( sal_uInt16 i = 0; i  nCount; ++i )
+for ( SfxTabDlgData_Impl::const_iterator it = pImpl-aData.begin(); it != 
pImpl-aData.end(); ++it )
 {
-Data_Impl* pDataObject = pImpl-pData-GetObject(i);
+Data_Impl* pDataObject = *it;
 
 if ( pDataObject-pTabPage )
 {
@@ -778,7 +776,7 @@
 
 void SfxTabDialog::Start_Impl()
 {
-DBG_ASSERT( pImpl-pData-Count() == m_pTabCtrl-GetPageCount(), not all 
pages registered );
+DBG_ASSERT( pImpl-aData.size() == m_pTabCtrl-GetPageCount(), not all 
pages registered );
 sal_uInt16 nActPage = m_pTabCtrl-GetPageId( 0 );
 
 // load old settings, when exists
@@ -847,7 +845,7 @@
// requested when created
 )
 {
-pImpl-pData-Append(
+pImpl-aData.push_back(
 new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) );
 }
 
@@ -867,7 +865,7 @@
 )
 {
 sal_uInt16 nId = m_pTabCtrl-GetPageId(rName);
-pImpl-pData-Append(
+pImpl-aData.push_back(
 new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) );
 return nId;
 }
@@ -888,7 +886,7 @@
 assert(pCreateFunc);
 GetTabPageRanges pRangesFunc = pFact-GetTabPageRangesFunc(nPageCreateId);
 sal_uInt16 nPageId = m_pTabCtrl-GetPageId(rName);
-pImpl-pData-Append(new Data_Impl(nPageId, pCreateFunc, pRangesFunc, 
false));
+pImpl-aData.push_back(new Data_Impl(nPageId, pCreateFunc, pRangesFunc, 
false));
 return nPageId;
 }
 
@@ -914,7 +912,7 @@
 DBG_ASSERT( TAB_PAGE_NOTFOUND == m_pTabCtrl-GetPagePos( nId ),
 Double Page-Ids in the Tabpage );
 m_pTabCtrl-InsertPage( nId, rRiderText, nPos );
-pImpl-pData-Append(
+pImpl-aData.push_back(
 new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) );
 }
 
@@ -941,7 +939,7 @@
 DBG_ASSERT( TAB_PAGE_NOTFOUND == m_pTabCtrl-GetPagePos( nId ),
 Duplicate Page-Ids in the Tabpage );
 m_pTabCtrl-InsertPage( nId, rRiderBitmap, nPos );
-pImpl-pData-Append(
+pImpl-aData.push_back(
 new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) );
 }
 #endif
@@ -958,7 +956,7 @@
 {
 sal_uInt16 nPos = 0;
 m_pTabCtrl-RemovePage( nId );
-Data_Impl* pDataObject = Find( *pImpl-pData, nId, nPos );
+Data_Impl* pDataObject = Find( pImpl-aData, nId, nPos );
 
 if ( pDataObject )
 {
@@ -979,7 +977,7 @@
 }
 
 delete pDataObject;
-pImpl-pData-Remove( nPos );
+pImpl-aData.erase( pImpl-aData.begin() + nPos );
 }
 else
 {
@@ -1035,7 +1033,7 @@
 
 {
 sal_uInt16 nPos = 0;
-Data_Impl* pDataObject = Find( *pImpl-pData, nPageId, nPos );
+Data_Impl* pDataObject = Find( pImpl-aData, nPageId, nPos );
 
 if ( pDataObject )
 return pDataObject-pTabPage;
@@ -1083,11 +1081,9 @@
 }
 sal_Bool bModified = sal_False;
 
-const sal_uInt16 nCount = pImpl-pData-Count();
-
-for ( sal_uInt16 i = 0; i  nCount; ++i )
+for ( 

[PATCH] Convert SfxObjectUIArr_Impl from SfxPtrArr to std::vector

2013-04-12 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3359

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/59/3359/1

Convert SfxObjectUIArr_Impl from SfxPtrArr to std::vector

Also
- remove dead class definition SfxIFConfig_Impl, which was
  using SfxObjectUIArr_Impl
- simplify declaration sites, we don't need to dynamically allocate
  these arrays

Change-Id: I0f7110a324cc37f2eb2567cc066099ea4d86276c
---
M sfx2/inc/sfx2/objface.hxx
M sfx2/source/control/objface.cxx
2 files changed, 29 insertions(+), 51 deletions(-)



diff --git a/sfx2/inc/sfx2/objface.hxx b/sfx2/inc/sfx2/objface.hxx
index 90315d0..8e1f772 100644
--- a/sfx2/inc/sfx2/objface.hxx
+++ b/sfx2/inc/sfx2/objface.hxx
@@ -32,14 +32,11 @@
 struct SfxFormalArgument;
 struct SfxInterface_Impl;
 class  SfxConfigItem;
-class  SfxIFConfig_Impl;
-class  SfxObjectUIArr_Impl ;
 class  SfxModule;
 class  SvStream;
 
 class SFX2_DLLPUBLIC SfxInterface
 {
-friend class SfxIFConfig_Impl;
 friend class SfxSlotPool;
 
 const char* pName;  // Sfx-internal name of interface
@@ -122,20 +119,6 @@
 {
 return nPos  nCount? pSlots+nPos: 0;
 }
-
-class SfxIFConfig_Impl
-{
-friend class SfxInterface;
-sal_uInt16  nCount;
-SfxObjectUIArr_Impl*pObjectBars;
-
-public:
-SfxIFConfig_Impl();
-~SfxIFConfig_Impl();
-sal_BoolStore(SvStream);
-voidRegisterObjectBar( sal_uInt16, const ResId, sal_uInt32 
nFeature, const String* pST=0 );
-sal_uInt16  GetType();
-};
 
 #endif
 
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index 90be4b5..8b9e0f9 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -77,16 +77,16 @@
 }
 };
 
-DECL_PTRARRAY(SfxObjectUIArr_Impl, SfxObjectUI_Impl*, 2, 2)
+typedef std::vectorSfxObjectUI_Impl* SfxObjectUIArr_Impl;
 
 struct SfxInterface_Impl
 {
-SfxObjectUIArr_Impl*pObjectBars;// registered ObjectBars
-SfxObjectUIArr_Impl*pChildWindows;  // registered ChildWindows
+SfxObjectUIArr_Impl aObjectBars;// registered ObjectBars
+SfxObjectUIArr_Impl aChildWindows;  // registered ChildWindows
 ResId   aPopupRes;  // registered PopupMenu
 ResId   aStatBarRes;// registered StatusBar
 SfxModule*  pModule;
-sal_BoolbRegistered;
+sal_BoolbRegistered;
 
 SfxInterface_Impl() :
 aPopupRes(0,*SfxApplication::GetOrCreate()-GetSfxResManager()),
@@ -94,20 +94,15 @@
 , pModule(NULL)
 , bRegistered(sal_False)
 {
-pObjectBars   = new SfxObjectUIArr_Impl;
-pChildWindows = new SfxObjectUIArr_Impl;
 }
 
 ~SfxInterface_Impl()
 {
-sal_uInt16 n;
-for (n=0; npObjectBars-Count(); n++)
-delete (*pObjectBars)[n];
-delete pObjectBars;
+for (SfxObjectUIArr_Impl::const_iterator it = aObjectBars.begin(); it 
!= aObjectBars.end(); ++it)
+delete *it;
 
-for (n=0; npChildWindows-Count(); n++)
-delete (*pChildWindows)[n];
-delete pChildWindows;
+for (SfxObjectUIArr_Impl::const_iterator it = aChildWindows.begin(); 
it != aChildWindows.end(); ++it)
+delete *it;
 }
 };
 
@@ -404,7 +399,7 @@
 {
 SfxObjectUI_Impl* pUI = CreateObjectBarUI_Impl( nPos, rResId, nFeature, 
pStr );
 if ( pUI )
-pImpData-pObjectBars-Append(pUI);
+pImpData-aObjectBars.push_back(pUI);
 }
 
 SfxObjectUI_Impl* CreateObjectBarUI_Impl( sal_uInt16 nPos, const ResId 
rResId, sal_uInt32 nFeature, const String *pStr )
@@ -447,10 +442,10 @@
 }
 
 #ifdef DBG_UTIL
-sal_uInt16 nObjBarCount = pImpData-pObjectBars-Count();
+sal_uInt16 nObjBarCount = pImpData-aObjectBars.size();
 DBG_ASSERT( nNonObjBarCount,Objectbar is unknown! );
 #endif
-return (*pImpData-pObjectBars)[nNo]-aResId;
+return pImpData-aObjectBars[nNo]-aResId;
 }
 
 //
@@ -471,10 +466,10 @@
 }
 
 #ifdef DBG_UTIL
-sal_uInt16 nObjBarCount = pImpData-pObjectBars-Count();
+sal_uInt16 nObjBarCount = pImpData-aObjectBars.size();
 DBG_ASSERT( nNonObjBarCount,Objectbar is unknown! );
 #endif
-return (*pImpData-pObjectBars)[nNo]-nPos;
+return pImpData-aObjectBars[nNo]-nPos;
 }
 
 //
@@ -483,9 +478,9 @@
 sal_uInt16 SfxInterface::GetObjectBarCount() const
 {
 if (pGenoType  ! pGenoType-HasName())
-return pImpData-pObjectBars-Count() + pGenoType-GetObjectBarCount();
+return pImpData-aObjectBars.size() + pGenoType-GetObjectBarCount();
 else
-return pImpData-pObjectBars-Count();
+return pImpData-aObjectBars.size();
 }
 
 

[PATCH] Convert SfxViewFactoryArr_Impl from SfxPtrArray to std::vect...

2013-04-12 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3360

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/60/3360/1

Convert SfxViewFactoryArr_Impl from SfxPtrArray to std::vector

Change-Id: I25c8edc51f97af9de2563a8dba7387a2be9f4fd5
---
M sfx2/source/doc/docfac.cxx
1 file changed, 9 insertions(+), 10 deletions(-)



diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 25254aa..574bc54 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -57,7 +57,7 @@
 
 //
 
-DECL_PTRARRAY( SfxViewFactoryArr_Impl, SfxViewFactory*, 2, 2 )
+typedef std::vectorSfxViewFactory* SfxViewFactoryArr_Impl;
 
 //
 
@@ -147,9 +147,9 @@
 #if OSL_DEBUG_LEVEL  0
 {
 const String sViewName( rFactory.GetAPIViewName() );
-for ( sal_uInt16 i = 0; i  pImpl-aViewFactoryArr.Count(); ++i )
+for ( SfxViewFactoryArr_Impl::const_iterator it = 
pImpl-aViewFactoryArr.begin(); it != pImpl-aViewFactoryArr.end(); ++it )
 {
-if ( !pImpl-aViewFactoryArr[i]-GetAPIViewName().Equals( 
sViewName ) )
+if ( !(*it)-GetAPIViewName().Equals( sViewName ) )
 continue;
 OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
 SfxObjectFactory::RegisterViewFactory: duplicate view name 
'));
@@ -160,20 +160,19 @@
 }
 }
 #endif
-sal_uInt16 nPos;
-for ( nPos = 0;
-  nPos  pImpl-aViewFactoryArr.Count() 
-  pImpl-aViewFactoryArr[nPos]-GetOrdinal() = rFactory.GetOrdinal();
-  ++nPos )
+SfxViewFactoryArr_Impl::iterator it = pImpl-aViewFactoryArr.begin();
+for ( ; it != pImpl-aViewFactoryArr.end() 
+  (*it)-GetOrdinal() = rFactory.GetOrdinal();
+  ++it )
 /* empty loop */;
-pImpl-aViewFactoryArr.Insert(nPos, rFactory);
+pImpl-aViewFactoryArr.insert(it, rFactory);
 }
 
 //
 
 sal_uInt16 SfxObjectFactory::GetViewFactoryCount() const
 {
-return pImpl-aViewFactoryArr.Count();
+return pImpl-aViewFactoryArr.size();
 }
 
 //

-- 
To view, visit https://gerrit.libreoffice.org/3360
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25c8edc51f97af9de2563a8dba7387a2be9f4fd5
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] remove dead code

2013-04-12 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3361

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/61/3361/1

remove dead code

Change-Id: I18b203f9647e2fd5199a2d15f4be67c99f7def5d
---
D sfx2/source/inc/mnucfga.hxx
M sfx2/source/inc/virtmenu.hxx
M sfx2/source/menu/mnumgr.cxx
3 files changed, 0 insertions(+), 45 deletions(-)



diff --git a/sfx2/source/inc/mnucfga.hxx b/sfx2/source/inc/mnucfga.hxx
deleted file mode 100644
index 09cde20..000
--- a/sfx2/source/inc/mnucfga.hxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the License); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _SFXMNUCFGA_HXX
-#define _SFXMNUCFGA_HXX
-
-#include tools/string.hxx
-#include sfx2/minarray.hxx
-
-//==
-
-class SfxMenuCfgItemArr;
-
-struct SfxMenuCfgItem
-{
-sal_uInt16 nId;// id of the binding or 0 if none
-String aTitle; // title of the item
-String aHelpText;
-String  aCommand;
-SfxMenuCfgItemArr* pPopup; // pointer to a popup menu (if any)
-};
-
-DECL_PTRARRAY(SfxMenuCfgItemArr, SfxMenuCfgItem*, 4, 4 )
-
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx
index d85e119..10e971d 100644
--- a/sfx2/source/inc/virtmenu.hxx
+++ b/sfx2/source/inc/virtmenu.hxx
@@ -22,7 +22,6 @@
 #include boost/ptr_container/ptr_vector.hpp
 
 #include sfx2/mnuitem.hxx
-#include mnucfga.hxx
 
 class SfxBindings;
 class Timer;
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index db8c498..a83e975 100644
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -56,7 +56,6 @@
 #include sfx2/app.hxx
 #include sfxtypes.hxx
 #include sfx2/bindings.hxx
-#include mnucfga.hxx
 #include sfx2/sfxresid.hxx
 #include sfx2/msgpool.hxx
 #include sfx2/sfx.hrc

-- 
To view, visit https://gerrit.libreoffice.org/3361
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18b203f9647e2fd5199a2d15f4be67c99f7def5d
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] fdo#46808, convert sdb::QueryDesigner to new style

2013-03-25 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3031

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/31/3031/1

fdo#46808, convert sdb::QueryDesigner to new style

Change-Id: I694dd16920304d0f07369e97c87a4a97b92eadeb
---
M dbaccess/source/core/api/query.cxx
M dbaccess/source/core/api/querycontainer.cxx
M dbaccess/source/core/dataaccess/commandcontainer.cxx
M dbaccess/source/core/dataaccess/commanddefinition.cxx
M dbaccess/source/core/dataaccess/commanddefinition.hxx
M dbaccess/source/inc/stringconstants.hrc
M dbaccess/source/inc/stringconstants.inc
M offapi/UnoApi_offapi.mk
M offapi/com/sun/star/sdb/QueryDefinition.idl
A offapi/com/sun/star/sdb/XQueryDefinition.idl
M offapi/type_reference/types.rdb
11 files changed, 174 insertions(+), 59 deletions(-)



diff --git a/dbaccess/source/core/api/query.cxx 
b/dbaccess/source/core/api/query.cxx
index ed1f073..2d10f92 100644
--- a/dbaccess/source/core/api/query.cxx
+++ b/dbaccess/source/core/api/query.cxx
@@ -217,7 +217,7 @@
 }
 
 // XServiceInfo
-IMPLEMENT_SERVICE_INFO3(OQuery, com.sun.star.sdb.dbaccess.OQuery, 
SERVICE_SDB_DATASETTINGS.ascii, SERVICE_SDB_QUERY.ascii, 
SERVICE_SDB_QUERYDEFINITION.ascii)
+IMPLEMENT_SERVICE_INFO3(OQuery, com.sun.star.sdb.dbaccess.OQuery, 
SERVICE_SDB_DATASETTINGS.ascii, SERVICE_SDB_QUERY.ascii, 
com.sun.star.sdb.QueryDefinition)
 
 // ::com::sun::star::beans::XPropertyChangeListener
 void SAL_CALL OQuery::propertyChange( const PropertyChangeEvent _rSource ) 
throw(RuntimeException)
diff --git a/dbaccess/source/core/api/querycontainer.cxx 
b/dbaccess/source/core/api/querycontainer.cxx
index 6ffb474..984b9e8 100644
--- a/dbaccess/source/core/api/querycontainer.cxx
+++ b/dbaccess/source/core/api/querycontainer.cxx
@@ -27,8 +27,9 @@
 
 #include com/sun/star/beans/XPropertySet.hpp
 #include com/sun/star/container/XContainer.hpp
-#include com/sun/star/sdbc/XConnection.hpp
 #include com/sun/star/container/XContainerApproveBroadcaster.hpp
+#include com/sun/star/sdbc/XConnection.hpp
+#include com/sun/star/sdb/QueryDefinition.hpp
 
 #include connectivity/dbexception.hxx
 
@@ -154,10 +155,9 @@
 throw DisposedException( ::rtl::OUString(), *this );
 
 // first clone this object's CommandDefinition part
-Reference XPropertySet  xCommandDefinitionPart(
-   m_aContext-getServiceManager()-createInstanceWithContext( 
SERVICE_SDB_QUERYDEFINITION, m_aContext),
-   UNO_QUERY_THROW );
-::comphelper::copyProperties( _rxDesc, xCommandDefinitionPart );
+Reference css::sdb::XQueryDefinition  xCommandDefinitionPart = 
css::sdb::QueryDefinition::create(m_aContext);
+
+::comphelper::copyProperties( _rxDesc, 
ReferenceXPropertySet(xCommandDefinitionPart, UNO_QUERY_THROW) );
 // TODO : the columns part of the descriptor has to be copied
 
 // create a wrapper for the object (*before* inserting into our command 
definition container)
diff --git a/dbaccess/source/core/dataaccess/commandcontainer.cxx 
b/dbaccess/source/core/dataaccess/commandcontainer.cxx
index 5052af6..eb47000 100644
--- a/dbaccess/source/core/dataaccess/commandcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/commandcontainer.cxx
@@ -70,7 +70,8 @@
 const TContentPtr pElementContent( rDefinitions.find( _rName )-second );
 if ( m_bTables )
 return new OComponentDefinition( *this, _rName, m_aContext, 
pElementContent, m_bTables );
-return new OCommandDefinition( *this, _rName, m_aContext, pElementContent 
);
+else
+return static_cast css::sdb::XQueryDefinition *  ( new 
OCommandDefinition( *this, _rName, m_aContext, pElementContent ) );
 }
 
 Reference XInterface  SAL_CALL 
OCommandContainer::createInstanceWithArguments(const Sequence Any  
/*aArguments*/ ) throw (Exception, RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/commanddefinition.cxx 
b/dbaccess/source/core/dataaccess/commanddefinition.cxx
index 8278bff..ba0016b 100644
--- a/dbaccess/source/core/dataaccess/commanddefinition.cxx
+++ b/dbaccess/source/core/dataaccess/commanddefinition.cxx
@@ -72,6 +72,62 @@
 rCommandDefinition.m_aLayoutInformation, 
::getCppuType(rCommandDefinition.m_aLayoutInformation));
 }
 
+rtl::OUString OCommandDefinition::getName() throw( 
::com::sun::star::uno::RuntimeException )
+{
+return getDefinition().m_aProps.aTitle;
+}
+
+rtl::OUString OCommandDefinition::getCommand() throw( 
::com::sun::star::uno::RuntimeException )
+{
+return getCommandDefinition().m_sCommand;
+}
+
+void OCommandDefinition::setCommand(const rtl::OUString p1) throw( 
::com::sun::star::uno::RuntimeException )
+{
+setPropertyValue(PROPERTY_COMMAND, Any(p1) );
+}
+
+sal_Bool OCommandDefinition::getEscapeProcessing() throw( 
::com::sun::star::uno::RuntimeException )
+{
+return getCommandDefinition().m_bEscapeProcessing;
+}
+
+void OCommandDefinition::setEscapeProcessing(sal_Bool p1) throw( 
::com::sun::star::uno::RuntimeException )
+{
+

[PATCH] fix for fdo#61801

2013-03-05 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2553

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/53/2553/1

fix for fdo#61801

... crash on Tools - Options - LibreOffice - Personalization - Select 
Background Image

The root cause of this is my conversion of the UNO code to use the
new-style FilePicker service constructor in commit
4b51374a7021d52f7f1be1861e2ee6a011b30ecd

Unfortunately, the new-style service constructor will always call
initialize(SequenceAny), which the old code did not do.
And initialize does not like being called without any arguments.

The cleanest fix for this is to simply remove the createDefault()
service constructor method and make all the call sites explicitly
choose the style of FilePicker dialog they want.

As a bonus, this simplifies some of the call sites.

Change-Id: I75f5e03cff4e39abe22cd9650a079ec78ab636c4
---
M cui/source/options/personalization.cxx
M offapi/com/sun/star/ui/dialogs/FilePicker.idl
M sc/source/ui/xmlsource/xmlsourcedlg.cxx
M svtools/source/control/filectrl2.cxx
M vcl/win/source/gdi/salprn.cxx
5 files changed, 17 insertions(+), 23 deletions(-)



diff --git a/cui/source/options/personalization.cxx 
b/cui/source/options/personalization.cxx
index f1ba980..86e7fff 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -25,6 +25,7 @@
 #include com/sun/star/ui/dialogs/ExecutableDialogResults.hpp
 #include com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp
 #include com/sun/star/ui/dialogs/FilePicker.hpp
+#include com/sun/star/ui/dialogs/TemplateDescription.hpp
 #include com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp
 #include com/sun/star/ui/dialogs/XFilterManager.hpp
 
@@ -211,7 +212,7 @@
 {
 uno::Reference uno::XComponentContext  xContext( 
::comphelper::getProcessComponentContext() );
 
-uno::Reference ui::dialogs::XFilePicker3  xFilePicker = 
ui::dialogs::FilePicker::createDefault(xContext);
+uno::Reference ui::dialogs::XFilePicker3  xFilePicker = 
ui::dialogs::FilePicker::createWithMode(xContext, 
ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE);
 
 xFilePicker-setMultiSelectionMode( false );
 
diff --git a/offapi/com/sun/star/ui/dialogs/FilePicker.idl 
b/offapi/com/sun/star/ui/dialogs/FilePicker.idl
index 39cd6511..4636748 100644
--- a/offapi/com/sun/star/ui/dialogs/FilePicker.idl
+++ b/offapi/com/sun/star/ui/dialogs/FilePicker.idl
@@ -38,7 +38,6 @@
 
 published service FilePicker : XFilePicker3
 {
-createDefault();
 
 /** Provides the ability to choose between different custom templates that
 do extend the subset of common controls a FilePicker usually supports.
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx 
b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 9a366d7..838b7d1 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -27,6 +27,7 @@
 #include com/sun/star/lang/XMultiServiceFactory.hpp
 #include com/sun/star/ui/dialogs/FilePicker.hpp
 #include com/sun/star/ui/dialogs/ExecutableDialogResults.hpp
+#include com/sun/star/ui/dialogs/TemplateDescription.hpp
 
 using namespace com::sun::star;
 
@@ -177,7 +178,7 @@
 if (!xServiceMgr.is())
 return;
 
-uno::Referenceui::dialogs::XFilePicker3 xFilePicker = 
ui::dialogs::FilePicker::createDefault( 
comphelper::getComponentContext(xServiceMgr) );
+uno::Referenceui::dialogs::XFilePicker3 xFilePicker = 
ui::dialogs::FilePicker::createWithMode( 
comphelper::getComponentContext(xServiceMgr), 
ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE );
 
 if (maSrcPath.isEmpty())
 // Use default path.
diff --git a/svtools/source/control/filectrl2.cxx 
b/svtools/source/control/filectrl2.cxx
index cb48f42..bf69f32 100644
--- a/svtools/source/control/filectrl2.cxx
+++ b/svtools/source/control/filectrl2.cxx
@@ -21,6 +21,7 @@
 // this file contains code from filectrl.cxx which needs to be compiled with 
enabled exception hanling
 #include svtools/filectrl.hxx
 #include com/sun/star/ui/dialogs/FilePicker.hpp
+#include com/sun/star/ui/dialogs/TemplateDescription.hpp
 #include comphelper/processfactory.hxx
 #include tools/urlobj.hxx
 #include osl/file.h
@@ -37,7 +38,7 @@
 XubString aNewText;
 
 Reference XComponentContext  xContext = 
comphelper::getProcessComponentContext();
-Reference  dialogs::XFilePicker3  xFilePicker = 
dialogs::FilePicker::createDefault( xContext );
+Reference  dialogs::XFilePicker3  xFilePicker = 
dialogs::FilePicker::createWithMode( xContext, 
dialogs::TemplateDescription::FILEOPEN_SIMPLE );
 // transform the system notation text into a file URL
 ::rtl::OUString sSystemNotation = GetText(), sFileURL;
 oslFileError nError = osl_getFileURLFromSystemPath( 
sSystemNotation.pData, sFileURL.pData );
diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx
index 57440cd..d1904a7 100644
--- 

[PATCH] Create OUString::valueInt, valueBool and valueChar function ...

2013-01-09 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/1625

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/25/1625/1

Create OUString::valueInt, valueBool and valueChar function templates.

Cleans up the call sites by hiding the necessary casts.

Change-Id: Id3d150a6525eb0334e41e2ec6640bb06cd790b43
---
M sal/CppunitTest_sal_rtl_strings.mk
M sal/inc/rtl/ustring.hxx
A sal/qa/rtl/strings/test_oustring_valuex.cxx
3 files changed, 98 insertions(+), 0 deletions(-)



diff --git a/sal/CppunitTest_sal_rtl_strings.mk 
b/sal/CppunitTest_sal_rtl_strings.mk
index a30bf70..9ca6e7b 100644
--- a/sal/CppunitTest_sal_rtl_strings.mk
+++ b/sal/CppunitTest_sal_rtl_strings.mk
@@ -38,6 +38,7 @@
 sal/qa/rtl/strings/test_oustring_noadditional \
 sal/qa/rtl/strings/test_oustring_startswith \
 sal/qa/rtl/strings/test_oustring_stringliterals \
+sal/qa/rtl/strings/test_oustring_valuex \
 ))
 
 $(eval $(call gb_CppunitTest_use_libraries,sal_rtl_strings,\
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index c9fe25e..2a598d3 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -2088,6 +2088,36 @@
 }
 
 /**
+  Returns the string representation of the long argument.
+  This is here because when choosing
+  which conversion for overloaded functions is better, the standard treats 
all
+  integer conversions the same.
+
+  This function can't be used for language specific conversion.
+
+  @paramll  a int64.
+  @paramradix   the radix (between 2 and 36)
+  @return   a string with the string representation of the argument.
+*/
+template typename T 
+static OUString valueInt(T i, sal_Int16 radix = 10) SAL_THROW(())
+{
+return valueOf( static_castsal_Int32(i), radix );
+}
+
+template typename T 
+static OUString valueBool(T i) SAL_THROW(())
+{
+return valueOf( static_castsal_Bool(i) );
+}
+
+template typename T 
+static OUString valueChar(T i) SAL_THROW(())
+{
+return valueOf( static_castsal_Unicode(i) );
+}
+
+/**
   Returns the string representation of the float argument.
 
   This function can't be used for language specific conversion.
diff --git a/sal/qa/rtl/strings/test_oustring_valuex.cxx 
b/sal/qa/rtl/strings/test_oustring_valuex.cxx
new file mode 100644
index 000..e86f5e7
--- /dev/null
+++ b/sal/qa/rtl/strings/test_oustring_valuex.cxx
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include sal/types.h
+#include cppunit/TestFixture.h
+#include cppunit/extensions/HelperMacros.h
+#include rtl/ustring.hxx
+
+namespace test { namespace oustring {
+
+class valueX : public CppUnit::TestFixture {
+public:
+void testBool();
+void testChar();
+void testInt();
+
+CPPUNIT_TEST_SUITE(valueX);
+CPPUNIT_TEST(testBool);
+CPPUNIT_TEST(testChar);
+CPPUNIT_TEST(testInt);
+CPPUNIT_TEST_SUITE_END();
+};
+
+} }
+
+CPPUNIT_TEST_SUITE_REGISTRATION(test::oustring::valueX);
+
+void test::oustring::valueX::testBool() {
+rtl::OUString val1 = rtl::OUString::valueOf( sal_True );
+rtl::OUString val2 = rtl::OUString::valueBool( sal_True );
+CPPUNIT_ASSERT( val1 == val2 );
+val1 = rtl::OUString::valueOf( sal_False );
+val2 = rtl::OUString::valueBool( sal_False );
+CPPUNIT_ASSERT( val1 == val2 );
+val1 = rtl::OUString::valueOf( static_castsal_Bool(1) );
+val2 = rtl::OUString::valueBool( 1 );
+CPPUNIT_ASSERT( val1 == val2 );
+val1 = rtl::OUString::valueOf( static_castsal_Bool(0) );
+val2 = rtl::OUString::valueBool( 0 );
+CPPUNIT_ASSERT( val1 == val2 );
+val1 = rtl::OUString::valueOf( static_castsal_Bool('X') );
+val2 = rtl::OUString::valueBool( 'X' );
+CPPUNIT_ASSERT( val1 == val2 );
+val1 = rtl::OUString::valueOf( static_castsal_Bool(NULL) );
+val2 = rtl::OUString::valueBool( NULL );
+CPPUNIT_ASSERT( val1 == val2 );
+}
+
+void test::oustring::valueX::testChar() {
+rtl::OUString val1 = rtl::OUString::valueOf( static_castsal_Unicode('X') 
);
+rtl::OUString val2 = rtl::OUString::valueChar( 'X' );
+CPPUNIT_ASSERT( val1 == val2 );
+}
+
+void test::oustring::valueX::testInt() {
+rtl::OUString val1 = rtl::OUString::valueOf( 30039062 );
+rtl::OUString val2 = rtl::OUString::valueInt( 30039062 );
+CPPUNIT_ASSERT( val1 == val2 );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

-- 
To view, visit https://gerrit.libreoffice.org/1625
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

[PATCH] fix 'DEBUGCPPUNIT=TRUE make subsequenttest'

2013-01-02 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/1532

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/32/1532/1

fix 'DEBUGCPPUNIT=TRUE make subsequenttest'

When running a unit test under GDB, we do not want to prefix the
cppunittester executable with the LD_LIBRARY_PATH, because that has
already happened before the gdb --args part of the command line.

Change-Id: If3f81ba3fc3e5260142d7e9c2d4a78e9ca63382c
---
M solenv/gbuild/CppunitTest.mk
1 file changed, 7 insertions(+), 1 deletion(-)



diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 9c145b6..47c8687 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -53,7 +53,13 @@
 # DBGSV_ERROR_OUT = in non-product builds, ensure that tools-based assertions 
do not pop up as message box, but are routed to the shell
 ifneq ($(CROSS_COMPILING),YES)
 gb_CppunitTest_CPPTESTDEPS := $(call 
gb_Executable_get_runtime_dependencies,cppunit/cppunittester)
-gb_CppunitTest_CPPTESTCOMMAND := $(call 
gb_Executable_get_command,cppunit/cppunittester)
+ifeq ($(strip $(DEBUGCPPUNIT)),TRUE)
+gb_CppunitTest_CPPTESTCOMMAND := $(call 
gb_Executable_get_target_for_build,cppunit/cppunittester)
+else ifneq ($(strip $(GDBCPPUNITTRACE)),)
+gb_CppunitTest_CPPTESTCOMMAND := $(call 
gb_Executable_get_target_for_build,cppunit/cppunittester)
+else
+gb_CppunitTest_CPPTESTCOMMAND := $(gb_Helper_set_ld_path) $(call 
gb_Executable_get_target_for_build,cppunit/cppunittester)
+endif
 endif
 
 gb_CppunitTest__get_linktargetname = CppunitTest/$(call 
gb_CppunitTest_get_filename,$(1))

-- 
To view, visit https://gerrit.libreoffice.org/1532
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3f81ba3fc3e5260142d7e9c2d4a78e9ca63382c
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] String-OUString in SVL::SvNumberFormat calendar methods

2012-10-05 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/772

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/72/772/1

String-OUString in SVL::SvNumberFormat calendar methods

Change-Id: I6fe904d25a0675d881ee7c1d761e9af87e23a69d
---
M svl/inc/svl/zformat.hxx
M svl/source/numbers/zformat.cxx
2 files changed, 18 insertions(+), 18 deletions(-)


--
To view, visit https://gerrit.libreoffice.org/772
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6fe904d25a0675d881ee7c1d761e9af87e23a69d
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] String-OUString in svl::SvNumberFormat::GetMappedFormatstri...

2012-10-05 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/770

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/70/770/1

String-OUString in svl::SvNumberFormat::GetMappedFormatstring method

Change-Id: I80512acbcd639ee20f56f9ac95efc00bd3209b76
---
M svl/inc/svl/zformat.hxx
M svl/source/numbers/zformat.cxx
2 files changed, 25 insertions(+), 25 deletions(-)


--
To view, visit https://gerrit.libreoffice.org/770
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80512acbcd639ee20f56f9ac95efc00bd3209b76
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] String-OUString in svl::ImpSvNumFor::GetNewCurrencySymbol m...

2012-10-05 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/771

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/71/771/1

String-OUString in svl::ImpSvNumFor::GetNewCurrencySymbol method

Change-Id: Ie283a02903b0bf420291e1e4e1e29232cc7ff3a9
---
M svl/inc/svl/zformat.hxx
M svl/source/numbers/numfmuno.cxx
M svl/source/numbers/zforfind.cxx
M svl/source/numbers/zforlist.cxx
M svl/source/numbers/zformat.cxx
M svx/source/items/numfmtsh.cxx
6 files changed, 22 insertions(+), 21 deletions(-)


--
To view, visit https://gerrit.libreoffice.org/771
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie283a02903b0bf420291e1e4e1e29232cc7ff3a9
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] String-OUString in tools::ErrorContext

2012-10-05 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/769

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/69/769/1

String-OUString in tools::ErrorContext

Change-Id: Ibd0cd3e8d7281b5abde420df5cc1d51e9354069c
---
M sd/source/filter/html/htmlex.cxx
M sd/source/filter/html/htmlex.hxx
M svtools/inc/svtools/ehdl.hxx
M svtools/source/misc/ehdl.cxx
M test/source/bootstrapfixture.cxx
M tools/inc/tools/errinf.hxx
M tools/source/ref/errinf.cxx
M uui/source/iahndl-errorhandler.cxx
M uui/source/iahndl.cxx
9 files changed, 80 insertions(+), 79 deletions(-)


--
To view, visit https://gerrit.libreoffice.org/769
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd0cd3e8d7281b5abde420df5cc1d51e9354069c
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] sal_Bool - bool in comphelper

2012-10-04 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/762

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/62/762/1

sal_Bool - bool in comphelper

Change-Id: Id9f4aef6c7453cebd83dcaedf2ad7427e03cc960
---
M comphelper/inc/comphelper/propagg.hxx
M comphelper/source/property/propagg.cxx
2 files changed, 8 insertions(+), 8 deletions(-)


--
To view, visit https://gerrit.libreoffice.org/762
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9f4aef6c7453cebd83dcaedf2ad7427e03cc960
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] sal_Bool - bool in comphelper

2012-10-04 Thread Noel Grandin (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/763

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/63/763/1

sal_Bool - bool in comphelper

Change-Id: Ib7f2a10a4ff0227a5d5c137602c3c2f353334d24
---
M comphelper/source/container/embeddedobjectcontainer.cxx
1 file changed, 5 insertions(+), 5 deletions(-)


--
To view, visit https://gerrit.libreoffice.org/763
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7f2a10a4ff0227a5d5c137602c3c2f353334d24
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin noelgran...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice