summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-19 12:24:29 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-19 12:24:29 +0200
commitbf1508f84daea84105fe622c1033da5ba1a02e75 (patch)
treee3a1309fcfcb29c473cfdcacb43163534f264c88 /vbahelper
parentc0afdcf645e29a0c422ffa940d732af4e2c1d36a (diff)
parentd8968a8ea16670fde2faaddce9544a8858aac6b5 (diff)
Merge branch 'master' into feature/gnumake4
Conflicts: connectivity/source/cpool/Zregistration.cxx connectivity/source/drivers/evoab/LCatalog.cxx connectivity/source/drivers/evoab/LColumnAlias.cxx connectivity/source/drivers/evoab/LColumnAlias.hxx connectivity/source/drivers/evoab/LColumns.cxx connectivity/source/drivers/evoab/LColumns.hxx connectivity/source/drivers/evoab/LConfigAccess.cxx connectivity/source/drivers/evoab/LConfigAccess.hxx connectivity/source/drivers/evoab/LConnection.cxx connectivity/source/drivers/evoab/LConnection.hxx connectivity/source/drivers/evoab/LDatabaseMetaData.cxx connectivity/source/drivers/evoab/LDatabaseMetaData.hxx connectivity/source/drivers/evoab/LDriver.cxx connectivity/source/drivers/evoab/LDriver.hxx connectivity/source/drivers/evoab/LFolderList.cxx connectivity/source/drivers/evoab/LFolderList.hxx connectivity/source/drivers/evoab/LNoException.cxx connectivity/source/drivers/evoab/LPreparedStatement.cxx connectivity/source/drivers/evoab/LPreparedStatement.hxx connectivity/source/drivers/evoab/LResultSet.cxx connectivity/source/drivers/evoab/LResultSet.hxx connectivity/source/drivers/evoab/LServices.cxx connectivity/source/drivers/evoab/LStatement.cxx connectivity/source/drivers/evoab/LStatement.hxx connectivity/source/drivers/evoab/LTable.cxx connectivity/source/drivers/evoab/LTable.hxx connectivity/source/drivers/evoab/LTables.cxx connectivity/source/drivers/evoab/LTables.hxx connectivity/source/drivers/evoab/evoab.xml connectivity/source/drivers/evoab/makefile.mk editeng/Library_editeng.mk framework/Library_fwe.mk framework/test/test.cxx idl/prj/d.lst idl/util/idlpch.cxx linguistic/Makefile linguistic/Module_linguistic.mk linguistic/inc/linguistic/lngdllapi.h linguistic/inc/linguistic/lngprophelp.hxx linguistic/inc/linguistic/misc.hxx linguistic/prj/build.lst linguistic/prj/d.lst linguistic/qa/unoapi/Test.java linguistic/source/grammarchecker.cxx linguistic/source/grammarchecker.hxx linguistic/source/hyphdta.cxx linguistic/source/lngprophelp.cxx linguistic/source/makefile.mk linguistic/source/spelldta.cxx sfx2/Library_qstart.mk sfx2/Library_sfx.mk sfx2/inc/sfx2/qswin32.h sfx2/prj/build.lst sfx2/qa/cppunit/makefile.mk xmlscript/inc/xmlscript/xcrdllapi.h xmlscript/prj/d.lst xmlscript/util/makefile.mk
Diffstat (limited to 'vbahelper')
-rwxr-xr-xvbahelper/Library_msforms.mk1
-rwxr-xr-xvbahelper/Library_vbahelper.mk1
-rwxr-xr-xvbahelper/inc/vbahelper/collectionbase.hxx4
-rw-r--r--vbahelper/inc/vbahelper/helperdecl.hxx3
-rw-r--r--vbahelper/inc/vbahelper/vbaaccesshelper.hxx14
-rw-r--r--vbahelper/inc/vbahelper/vbaapplicationbase.hxx5
-rw-r--r--vbahelper/inc/vbahelper/vbacollectionimpl.hxx26
-rw-r--r--vbahelper/inc/vbahelper/vbadialogbase.hxx5
-rw-r--r--vbahelper/inc/vbahelper/vbadialogsbase.hxx3
-rwxr-xr-x[-rw-r--r--]vbahelper/inc/vbahelper/vbadllapi.h2
-rw-r--r--vbahelper/inc/vbahelper/vbadocumentbase.hxx5
-rw-r--r--vbahelper/inc/vbahelper/vbadocumentsbase.hxx3
-rw-r--r--[-rwxr-xr-x]vbahelper/inc/vbahelper/vbaeventshelperbase.hxx11
-rw-r--r--vbahelper/inc/vbahelper/vbafontbase.hxx2
-rw-r--r--vbahelper/inc/vbahelper/vbaglobalbase.hxx3
-rw-r--r--vbahelper/inc/vbahelper/vbahelper.hxx40
-rw-r--r--vbahelper/inc/vbahelper/vbahelperinterface.hxx3
-rw-r--r--vbahelper/inc/vbahelper/vbapagesetupbase.hxx3
-rw-r--r--vbahelper/inc/vbahelper/vbapropvalue.hxx5
-rw-r--r--vbahelper/inc/vbahelper/vbashape.hxx4
-rw-r--r--vbahelper/inc/vbahelper/vbashaperange.hxx6
-rw-r--r--vbahelper/inc/vbahelper/vbashapes.hxx3
-rw-r--r--vbahelper/inc/vbahelper/vbatextframe.hxx3
-rw-r--r--vbahelper/inc/vbahelper/vbawindowbase.hxx3
-rwxr-xr-xvbahelper/inc/vbahelper/weakreference.hxx2
-rw-r--r--vbahelper/prj/build.lst2
-rw-r--r--vbahelper/prj/d.lst1
-rwxr-xr-xvbahelper/source/msforms/makefile.mk78
-rw-r--r--vbahelper/source/msforms/service.cxx3
-rw-r--r--vbahelper/source/msforms/vbabutton.cxx3
-rw-r--r--vbahelper/source/msforms/vbabutton.hxx3
-rw-r--r--vbahelper/source/msforms/vbacheckbox.cxx8
-rw-r--r--vbahelper/source/msforms/vbacheckbox.hxx5
-rw-r--r--vbahelper/source/msforms/vbacombobox.cxx36
-rw-r--r--vbahelper/source/msforms/vbacombobox.hxx5
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx158
-rw-r--r--vbahelper/source/msforms/vbacontrol.hxx16
-rw-r--r--vbahelper/source/msforms/vbacontrols.cxx22
-rw-r--r--vbahelper/source/msforms/vbacontrols.hxx2
-rw-r--r--vbahelper/source/msforms/vbaframe.cxx15
-rw-r--r--vbahelper/source/msforms/vbaframe.hxx8
-rw-r--r--vbahelper/source/msforms/vbaimage.cxx3
-rw-r--r--vbahelper/source/msforms/vbaimage.hxx3
-rw-r--r--vbahelper/source/msforms/vbalabel.cxx33
-rw-r--r--vbahelper/source/msforms/vbalabel.hxx7
-rw-r--r--vbahelper/source/msforms/vbalistbox.cxx87
-rw-r--r--vbahelper/source/msforms/vbalistbox.hxx9
-rw-r--r--vbahelper/source/msforms/vbalistcontrolhelper.cxx111
-rw-r--r--vbahelper/source/msforms/vbalistcontrolhelper.hxx3
-rw-r--r--vbahelper/source/msforms/vbamultipage.cxx31
-rw-r--r--vbahelper/source/msforms/vbamultipage.hxx6
-rwxr-xr-xvbahelper/source/msforms/vbanewfont.cxx2
-rwxr-xr-xvbahelper/source/msforms/vbanewfont.hxx2
-rw-r--r--vbahelper/source/msforms/vbapages.cxx3
-rw-r--r--vbahelper/source/msforms/vbapages.hxx3
-rw-r--r--vbahelper/source/msforms/vbaprogressbar.cxx3
-rw-r--r--vbahelper/source/msforms/vbaprogressbar.hxx5
-rw-r--r--vbahelper/source/msforms/vbaradiobutton.cxx15
-rw-r--r--vbahelper/source/msforms/vbaradiobutton.hxx5
-rw-r--r--vbahelper/source/msforms/vbascrollbar.cxx3
-rw-r--r--vbahelper/source/msforms/vbascrollbar.hxx3
-rw-r--r--vbahelper/source/msforms/vbaspinbutton.cxx3
-rw-r--r--vbahelper/source/msforms/vbaspinbutton.hxx3
-rw-r--r--[-rwxr-xr-x]vbahelper/source/msforms/vbasystemaxcontrol.cxx2
-rw-r--r--[-rwxr-xr-x]vbahelper/source/msforms/vbasystemaxcontrol.hxx3
-rw-r--r--vbahelper/source/msforms/vbatextbox.cxx19
-rw-r--r--vbahelper/source/msforms/vbatextbox.hxx5
-rw-r--r--vbahelper/source/msforms/vbatogglebutton.cxx22
-rw-r--r--vbahelper/source/msforms/vbatogglebutton.hxx5
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx104
-rw-r--r--vbahelper/source/msforms/vbauserform.hxx8
-rwxr-xr-xvbahelper/source/vbahelper/makefile.mk77
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx22
-rw-r--r--vbahelper/source/vbahelper/vbacolorformat.cxx18
-rw-r--r--vbahelper/source/vbahelper/vbacolorformat.hxx3
-rw-r--r--vbahelper/source/vbahelper/vbacommandbar.cxx13
-rw-r--r--vbahelper/source/vbahelper/vbacommandbar.hxx5
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrol.cxx13
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrol.hxx3
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrols.cxx33
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrols.hxx3
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.cxx19
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.hxx13
-rw-r--r--vbahelper/source/vbahelper/vbacommandbars.cxx18
-rw-r--r--vbahelper/source/vbahelper/vbacommandbars.hxx3
-rw-r--r--vbahelper/source/vbahelper/vbadialogbase.cxx32
-rw-r--r--vbahelper/source/vbahelper/vbadialogsbase.cxx2
-rw-r--r--vbahelper/source/vbahelper/vbadocumentbase.cxx71
-rw-r--r--vbahelper/source/vbahelper/vbadocumentsbase.cxx29
-rw-r--r--[-rwxr-xr-x]vbahelper/source/vbahelper/vbaeventshelperbase.cxx3
-rw-r--r--vbahelper/source/vbahelper/vbafillformat.cxx18
-rw-r--r--vbahelper/source/vbahelper/vbafillformat.hxx3
-rw-r--r--vbahelper/source/vbahelper/vbafontbase.cxx2
-rw-r--r--vbahelper/source/vbahelper/vbaglobalbase.cxx7
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx586
-rw-r--r--vbahelper/source/vbahelper/vbalineformat.cxx104
-rw-r--r--vbahelper/source/vbahelper/vbalineformat.hxx5
-rw-r--r--vbahelper/source/vbahelper/vbapagesetupbase.cxx2
-rw-r--r--vbahelper/source/vbahelper/vbapictureformat.cxx24
-rw-r--r--vbahelper/source/vbahelper/vbapictureformat.hxx3
-rw-r--r--vbahelper/source/vbahelper/vbapropvalue.cxx3
-rw-r--r--vbahelper/source/vbahelper/vbashape.cxx279
-rw-r--r--vbahelper/source/vbahelper/vbashaperange.cxx36
-rw-r--r--vbahelper/source/vbahelper/vbashapes.cxx62
-rw-r--r--vbahelper/source/vbahelper/vbatextframe.cxx26
-rw-r--r--vbahelper/source/vbahelper/vbawindowbase.cxx3
-rwxr-xr-xvbahelper/util/makefile.mk100
-rwxr-xr-x[-rw-r--r--]vbahelper/util/msforms.component0
108 files changed, 1788 insertions, 891 deletions
diff --git a/vbahelper/Library_msforms.mk b/vbahelper/Library_msforms.mk
index 58a90a7ccd..e1b00c7264 100755
--- a/vbahelper/Library_msforms.mk
+++ b/vbahelper/Library_msforms.mk
@@ -56,7 +56,6 @@ $(eval $(call gb_Library_add_linked_libs,msforms,\
svl \
svt \
svx \
- stl \
tk \
tl \
vbahelper \
diff --git a/vbahelper/Library_vbahelper.mk b/vbahelper/Library_vbahelper.mk
index 380b0d0bc5..45691f8066 100755
--- a/vbahelper/Library_vbahelper.mk
+++ b/vbahelper/Library_vbahelper.mk
@@ -56,7 +56,6 @@ $(eval $(call gb_Library_add_linked_libs,vbahelper,\
sal \
sb \
sfx \
- stl \
svl \
svt \
svxcore \
diff --git a/vbahelper/inc/vbahelper/collectionbase.hxx b/vbahelper/inc/vbahelper/collectionbase.hxx
index 2b4ec42bf2..ebb5bf8f2b 100755
--- a/vbahelper/inc/vbahelper/collectionbase.hxx
+++ b/vbahelper/inc/vbahelper/collectionbase.hxx
@@ -73,7 +73,7 @@ public:
};
// ------------------------------------------------------------------------
-
+
CollectionBase( const css::uno::Type& rElementType );
// ------------------------------------------------------------------------
@@ -145,7 +145,7 @@ public:
@param rElement
The container element the VBA implementation object is based on.
-
+
@param rIndex
The index or name that has been used to access the item.
*/
diff --git a/vbahelper/inc/vbahelper/helperdecl.hxx b/vbahelper/inc/vbahelper/helperdecl.hxx
index f6614add6b..8419be6a35 100644
--- a/vbahelper/inc/vbahelper/helperdecl.hxx
+++ b/vbahelper/inc/vbahelper/helperdecl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,5 @@ struct vba_service_class_ : public serviceimpl_base< detail::OwnServiceImpl<Impl
} // namespace service_decl
} // namespace comphelper
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbaaccesshelper.hxx b/vbahelper/inc/vbahelper/vbaaccesshelper.hxx
index 6c42b0b8d8..578213edd5 100644
--- a/vbahelper/inc/vbahelper/vbaaccesshelper.hxx
+++ b/vbahelper/inc/vbahelper/vbaaccesshelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: vbahelper.hxx,v $
- * $Revision: 1.5.32.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -53,7 +51,7 @@ namespace ooo
return xVBAFactory;
}
- VBAHELPER_DLLPUBLIC inline css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const css::uno::Sequence< css::uno::Any >& aArgs ) throw (css::uno::RuntimeException)
+ VBAHELPER_DLLPRIVATE inline css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const css::uno::Sequence< css::uno::Any >& aArgs ) throw (css::uno::RuntimeException)
{
OSL_PRECOND( pShell, "createVBAUnoAPIService: no shell!" );
::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
@@ -70,10 +68,14 @@ namespace ooo
bRes = ( pFilt->GetMimeType().CompareToAscii( pMimeType ) == 0 );
return bRes;
}
- VBAHELPER_DLLPUBLIC inline bool isAlienExcelDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-excel" ); }
- VBAHELPER_DLLPUBLIC inline bool isAlienWordDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-word" ); }
+ VBAHELPER_DLLPRIVATE inline bool isAlienExcelDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-excel" ); }
+ //VBAHELPER_DLLPRIVATE inline bool isAlienWordDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-word" ); }
+ // word seems to return an erroneous mime type :-/ "application/msword" not consistent with the excel one
+ VBAHELPER_DLLPRIVATE inline bool isAlienWordDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/msword" ); }
} // openoffice
} // org
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
index c8ad9d1f99..68b8110768 100644
--- a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
+++ b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,7 +62,7 @@ public:
virtual ::rtl::OUString SAL_CALL getVersion() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getVBE() throw (css::uno::RuntimeException);
- virtual void SAL_CALL Run( const ::rtl::OUString& MacroName, const css::uno::Any& varg1, const css::uno::Any& varg2, const css::uno::Any& varg3, const css::uno::Any& varg4, const css::uno::Any& varg5, const css::uno::Any& varg6, const css::uno::Any& varg7, const css::uno::Any& varg8, const css::uno::Any& varg9, const css::uno::Any& varg10, const css::uno::Any& varg11, const css::uno::Any& varg12, const css::uno::Any& varg13, const css::uno::Any& varg14, const css::uno::Any& varg15, const css::uno::Any& varg16, const css::uno::Any& varg17, const css::uno::Any& varg18, const css::uno::Any& varg19, const css::uno::Any& varg20, const css::uno::Any& varg21, const css::uno::Any& varg22, const css::uno::Any& varg23, const css::uno::Any& varg24, const css::uno::Any& varg25, const css::uno::Any& varg26, const css::uno::Any& varg27, const css::uno::Any& varg28, const css::uno::Any& varg29, const css::uno::Any& varg30 ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Run( const ::rtl::OUString& MacroName, const css::uno::Any& varg1, const css::uno::Any& varg2, const css::uno::Any& varg3, const css::uno::Any& varg4, const css::uno::Any& varg5, const css::uno::Any& varg6, const css::uno::Any& varg7, const css::uno::Any& varg8, const css::uno::Any& varg9, const css::uno::Any& varg10, const css::uno::Any& varg11, const css::uno::Any& varg12, const css::uno::Any& varg13, const css::uno::Any& varg14, const css::uno::Any& varg15, const css::uno::Any& varg16, const css::uno::Any& varg17, const css::uno::Any& varg18, const css::uno::Any& varg19, const css::uno::Any& varg20, const css::uno::Any& varg21, const css::uno::Any& varg22, const css::uno::Any& varg23, const css::uno::Any& varg24, const css::uno::Any& varg25, const css::uno::Any& varg26, const css::uno::Any& varg27, const css::uno::Any& varg28, const css::uno::Any& varg29, const css::uno::Any& varg30 ) throw (css::uno::RuntimeException);
virtual void SAL_CALL OnTime( const css::uno::Any& aEarliestTime, const ::rtl::OUString& aFunction, const css::uno::Any& aLatestTime, const css::uno::Any& aSchedule ) throw (css::uno::RuntimeException);
virtual float SAL_CALL CentimetersToPoints( float _Centimeters ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Undo() throw (css::uno::RuntimeException);
@@ -72,3 +73,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbacollectionimpl.hxx b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx
index 1214587b92..cf8a200dda 100644
--- a/vbahelper/inc/vbahelper/vbacollectionimpl.hxx
+++ b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -243,12 +244,25 @@ typedef InheritedHelperInterfaceImpl< Ifc1 > BaseColBase;
protected:
css::uno::Reference< css::container::XIndexAccess > m_xIndexAccess;
css::uno::Reference< css::container::XNameAccess > m_xNameAccess;
+ sal_Bool mbIgnoreCase;
virtual css::uno::Any getItemByStringIndex( const rtl::OUString& sIndex ) throw (css::uno::RuntimeException)
{
if ( !m_xNameAccess.is() )
throw css::uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScVbaCollectionBase string index access not supported by this object") ), css::uno::Reference< css::uno::XInterface >() );
-
+
+ if( mbIgnoreCase )
+ {
+ css::uno::Sequence< rtl::OUString > sElementNames = m_xNameAccess->getElementNames();
+ for( sal_Int32 i = 0; i < sElementNames.getLength(); i++ )
+ {
+ rtl::OUString aName = sElementNames[i];
+ if( aName.equalsIgnoreAsciiCase( sIndex ) )
+ {
+ return createCollectionObject( m_xNameAccess->getByName( aName ) );
+ }
+ }
+ }
return createCollectionObject( m_xNameAccess->getByName( sIndex ) );
}
@@ -275,7 +289,7 @@ protected:
}
public:
- ScVbaCollectionBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) : BaseColBase( xParent, xContext ), m_xIndexAccess( xIndexAccess ){ m_xNameAccess.set(m_xIndexAccess, css::uno::UNO_QUERY); }
+ ScVbaCollectionBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, sal_Bool bIgnoreCase = sal_False ) : BaseColBase( xParent, xContext ), m_xIndexAccess( xIndexAccess ), mbIgnoreCase( bIgnoreCase ) { m_xNameAccess.set(m_xIndexAccess, css::uno::UNO_QUERY); }
//XCollection
virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException)
{
@@ -291,8 +305,8 @@ public:
if ( ( Index1 >>= nIndex ) != sal_True )
{
rtl::OUString message;
- message = rtl::OUString::createFromAscii(
- "Couldn't convert index to Int32");
+ message = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Couldn't convert index to Int32"));
throw css::lang::IndexOutOfBoundsException( message,
css::uno::Reference< css::uno::XInterface >() );
}
@@ -340,8 +354,10 @@ class CollTestImplHelper : public ScVbaCollectionBase< ::cppu::WeakImplHelper1<
typedef ScVbaCollectionBase< ::cppu::WeakImplHelper1< Ifc > > ImplBase1;
public:
- CollTestImplHelper( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) throw( css::uno::RuntimeException ) : ImplBase1( xParent, xContext, xIndexAccess ) {}
+ CollTestImplHelper( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, sal_Bool bIgnoreCase = sal_False ) throw( css::uno::RuntimeException ) : ImplBase1( xParent, xContext, xIndexAccess, bIgnoreCase ) {}
};
#endif //SC_VBA_COLLECTION_IMPL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbadialogbase.hxx b/vbahelper/inc/vbahelper/vbadialogbase.hxx
index 70bd565656..6353df3d01 100644
--- a/vbahelper/inc/vbahelper/vbadialogbase.hxx
+++ b/vbahelper/inc/vbahelper/vbadialogbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,8 +45,10 @@ public:
virtual ~VbaDialogBase() {}
// Methods
- virtual void SAL_CALL Show() throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL Show() throw (css::uno::RuntimeException);
virtual rtl::OUString mapIndexToName( sal_Int32 nIndex ) = 0;
};
#endif /* VBA_DIALOG_BASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbadialogsbase.hxx b/vbahelper/inc/vbahelper/vbadialogsbase.hxx
index 63aff5bac6..36c4df6ab9 100644
--- a/vbahelper/inc/vbahelper/vbadialogsbase.hxx
+++ b/vbahelper/inc/vbahelper/vbadialogsbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,5 @@ public:
};
#endif /* VBA_DIALOGS_BASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbadllapi.h b/vbahelper/inc/vbahelper/vbadllapi.h
index dfdf6ae6fd..0db6078e0c 100644..100755
--- a/vbahelper/inc/vbahelper/vbadllapi.h
+++ b/vbahelper/inc/vbahelper/vbadllapi.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,3 +40,4 @@
#endif /* INCLUDED_SVLDLLAPI_H */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbadocumentbase.hxx b/vbahelper/inc/vbahelper/vbadocumentbase.hxx
index 99955e2345..7f1d3b5ad3 100644
--- a/vbahelper/inc/vbahelper/vbadocumentbase.hxx
+++ b/vbahelper/inc/vbahelper/vbadocumentbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,7 +60,7 @@ public:
virtual void SAL_CALL Close( const css::uno::Any &bSaveChanges,
const css::uno::Any &aFileName,
const css::uno::Any &bRouteWorkbook ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL Protect( const css::uno::Any & aPassword ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Protect( const css::uno::Any &aPassword ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Unprotect( const css::uno::Any &aPassword ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Save() throw (css::uno::RuntimeException);
virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
@@ -70,3 +71,5 @@ public:
};
#endif /* VBA_DOCUMENTBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbadocumentsbase.hxx b/vbahelper/inc/vbahelper/vbadocumentsbase.hxx
index 3a5c0f48f0..f617728237 100644
--- a/vbahelper/inc/vbahelper/vbadocumentsbase.hxx
+++ b/vbahelper/inc/vbahelper/vbadocumentsbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,5 @@ protected:
};
#endif /* SC_VBA_WORKBOOKS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
index 012eb782b9..99c17e5c75 100755..100644
--- a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
+++ b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,8 +30,8 @@
#define VBAHELPER_VBAEVENTSHELPERBASE_HXX
#include <deque>
-#include <hash_map>
#include <map>
+#include <boost/unordered_map.hpp>
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
#include <com/sun/star/util/XChangesListener.hpp>
@@ -134,7 +135,7 @@ protected:
const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException) = 0;
/** Derived classes may do additional postprocessing. Called even if the
- event handler does not exist, or if an error occured during execution. */
+ event handler does not exist, or if an error occurred during execution. */
virtual void implPostProcessEvent(
EventQueue& rEventQueue,
const EventHandlerInfo& rInfo,
@@ -169,14 +170,14 @@ private:
/** Updates the map containing paths to event handlers for a Basic module. */
ModulePathMap& updateModulePathMap( const ::rtl::OUString& rModuleName ) throw (css::uno::RuntimeException);
-
+
protected:
css::uno::Reference< css::frame::XModel > mxModel;
SfxObjectShell* mpShell;
private:
typedef ::std::map< sal_Int32, EventHandlerInfo > EventHandlerInfoMap;
- typedef ::std::hash_map< ::rtl::OUString, ModulePathMap, ::rtl::OUStringHash > EventHandlerPathMap;
+ typedef boost::unordered_map< ::rtl::OUString, ModulePathMap, ::rtl::OUStringHash > EventHandlerPathMap;
EventHandlerInfoMap maEventInfos;
EventHandlerPathMap maEventPaths;
@@ -188,3 +189,5 @@ private:
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbafontbase.hxx b/vbahelper/inc/vbahelper/vbafontbase.hxx
index c49be459d5..e2fe222b12 100644
--- a/vbahelper/inc/vbahelper/vbafontbase.hxx
+++ b/vbahelper/inc/vbahelper/vbafontbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101,3 +102,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbaglobalbase.hxx b/vbahelper/inc/vbahelper/vbaglobalbase.hxx
index 1394a7c749..491f8d5d24 100644
--- a/vbahelper/inc/vbahelper/vbaglobalbase.hxx
+++ b/vbahelper/inc/vbahelper/vbaglobalbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@ public:
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw (css::uno::RuntimeException);
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx
index 04c05e3f78..cfcc71c06b 100644
--- a/vbahelper/inc/vbahelper/vbahelper.hxx
+++ b/vbahelper/inc/vbahelper/vbahelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,10 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XDevice.hpp>
+#include <com/sun/star/frame/XDispatchResultListener.hpp>
+#include <com/sun/star/frame/DispatchResultEvent.hpp>
+#include <com/sun/star/frame/DispatchResultState.hpp>
+#include <com/sun/star/lang/EventObject.hpp>
#include <com/sun/star/awt/XUnitConversion.hpp>
#include <basic/basmgr.hxx>
#include <basic/sberrors.hxx>
@@ -65,7 +70,7 @@ namespace ooo
}
class XHelperInterface;
-
+
/** Returns the VBA document implementation object representing the passed UNO document model. */
VBAHELPER_DLLPUBLIC css::uno::Reference< XHelperInterface > getVBADocument( const css::uno::Reference< css::frame::XModel >& xModel );
VBAHELPER_DLLPUBLIC css::uno::Reference< XHelperInterface > getUnoDocModule( const String& aModName, SfxObjectShell* pShell );
@@ -82,7 +87,7 @@ namespace ooo
VBAHELPER_DLLPUBLIC css::uno::Reference< css::script::XTypeConverter > getTypeConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
VBAHELPER_DLLPUBLIC void dispatchRequests( const css::uno::Reference< css::frame::XModel>& xModel, const rtl::OUString& aUrl );
- VBAHELPER_DLLPUBLIC void dispatchRequests( const css::uno::Reference< css::frame::XModel>& xModel, const rtl::OUString& aUrl, const css::uno::Sequence< css::beans::PropertyValue >& sProps );
+ VBAHELPER_DLLPUBLIC void dispatchRequests (const css::uno::Reference< css::frame::XModel>& xModel, const rtl::OUString & aUrl, const css::uno::Sequence< css::beans::PropertyValue >& sProps, const css::uno::Reference< css::frame::XDispatchResultListener >& rListener = css::uno::Reference< css::frame::XDispatchResultListener >(), const sal_Bool bSilent = sal_True );
VBAHELPER_DLLPUBLIC void dispatchExecute(SfxViewShell* pView, sal_uInt16 nSlot, SfxCallMode nCall = SFX_CALLMODE_SYNCHRON );
VBAHELPER_DLLPUBLIC sal_Int32 OORGBToXLRGB( sal_Int32 );
VBAHELPER_DLLPUBLIC sal_Int32 XLRGBToOORGB( sal_Int32 );
@@ -126,8 +131,10 @@ namespace ooo
VBAHELPER_DLLPUBLIC sal_Int32 getPointerStyle( const css::uno::Reference< css::frame::XModel >& );
VBAHELPER_DLLPUBLIC void setCursorHelper( const css::uno::Reference< css::frame::XModel >& xModel, const Pointer& rPointer, sal_Bool bOverWrite );
VBAHELPER_DLLPUBLIC void setDefaultPropByIntrospection( const css::uno::Any& aObj, const css::uno::Any& aValue ) throw ( css::uno::RuntimeException );
+ VBAHELPER_DLLPUBLIC css::uno::Any getDefaultPropByIntrospection( const css::uno::Any& aObj ) throw ( css::uno::RuntimeException );
VBAHELPER_DLLPUBLIC css::uno::Any getPropertyValue( const css::uno::Sequence< css::beans::PropertyValue >& aProp, const rtl::OUString& aName );
VBAHELPER_DLLPUBLIC sal_Bool setPropertyValue( css::uno::Sequence< css::beans::PropertyValue >& aProp, const rtl::OUString& aName, const css::uno::Any& aValue );
+ VBAHELPER_DLLPUBLIC void setOrAppendPropertyValue( css::uno::Sequence< css::beans::PropertyValue >& aProp, const rtl::OUString& aName, const css::uno::Any& aValue );
class VBAHELPER_DLLPUBLIC Millimeter
{
@@ -267,19 +274,32 @@ public:
static void exception( int err, const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException );
- static void exception( css::uno::Exception& ex ) throw( css::script::BasicErrorException );
+ static void exception( const css::uno::Exception& ex ) throw( css::script::BasicErrorException );
};
+
+class VBAHELPER_DLLPUBLIC VBADispatchListener : public cppu::WeakImplHelper1< css::frame::XDispatchResultListener >
+{
+private:
+ css::uno::Any m_Result;
+ sal_Bool m_State;
+
+public:
+ VBADispatchListener();
+ ~VBADispatchListener();
+
+ css::uno::Any getResult() { return m_Result; }
+ sal_Bool getState() { return m_State; }
+
+ // XDispatchResultListener
+ virtual void SAL_CALL dispatchFinished( const css::frame::DispatchResultEvent& aEvent ) throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw ( css::uno::RuntimeException );
+};
+
} // vba
} // ooo
namespace ov = ooo::vba;
-#ifdef DEBUG
-# define SC_VBA_FIXME(a) OSL_TRACE( a )
-# define SC_VBA_STUB() SC_VBA_FIXME(( "%s - stubbed\n", __FUNCTION__ ))
-#else
-# define SC_VBA_FIXME(a)
-# define SC_VBA_STUB()
#endif
-#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbahelperinterface.hxx b/vbahelper/inc/vbahelper/vbahelperinterface.hxx
index 7f84ba52c8..657a6b7cfa 100644
--- a/vbahelper/inc/vbahelper/vbahelperinterface.hxx
+++ b/vbahelper/inc/vbahelper/vbahelperinterface.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -191,3 +192,5 @@ VBAHELPER_IMPL_GETSERVICENAMES( classname, servicename )
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbapagesetupbase.hxx b/vbahelper/inc/vbahelper/vbapagesetupbase.hxx
index f602f51200..4454343049 100644
--- a/vbahelper/inc/vbahelper/vbapagesetupbase.hxx
+++ b/vbahelper/inc/vbahelper/vbapagesetupbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,5 @@ public:
virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (css::uno::RuntimeException);
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbapropvalue.hxx b/vbahelper/inc/vbahelper/vbapropvalue.hxx
index 29c8e38123..5068f3235d 100644
--- a/vbahelper/inc/vbahelper/vbapropvalue.hxx
+++ b/vbahelper/inc/vbahelper/vbapropvalue.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,9 @@ public:
virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
- rtl::OUString SAL_CALL getDefaultPropertyName() throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ rtl::OUString SAL_CALL getDefaultPropertyName() throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
};
#endif //SC_VBA_PROPVALULE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbashape.hxx b/vbahelper/inc/vbahelper/vbashape.hxx
index 8fc259046d..9bc507190b 100644
--- a/vbahelper/inc/vbahelper/vbashape.hxx
+++ b/vbahelper/inc/vbahelper/vbashape.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,7 +110,10 @@ public:
// Replace??
virtual void SAL_CALL Select( const css::uno::Any& Replace ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL ShapeRange( const css::uno::Any& index ) throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL Copy( ) throw (css::uno::RuntimeException);
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& rEventObject ) throw( css::uno::RuntimeException );
};
#endif//SC_VBA_SHAPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbashaperange.hxx b/vbahelper/inc/vbahelper/vbashaperange.hxx
index d1bc1e576e..1aad3bd9f7 100644
--- a/vbahelper/inc/vbahelper/vbashaperange.hxx
+++ b/vbahelper/inc/vbahelper/vbashaperange.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,6 +57,8 @@ public:
virtual void SAL_CALL IncrementRotation( double Increment ) throw (css::uno::RuntimeException);
virtual void SAL_CALL IncrementLeft( double Increment ) throw (css::uno::RuntimeException) ;
virtual void SAL_CALL IncrementTop( double Increment ) throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setName( const rtl::OUString& _name ) throw (css::uno::RuntimeException);
virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException);
virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException);
virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException);
@@ -76,6 +79,7 @@ public:
virtual void SAL_CALL setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL SAL_CALL TextFrame( ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL SAL_CALL WrapFormat( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ZOrder( sal_Int32 ZOrderCmd ) throw (css::uno::RuntimeException);
//XEnumerationAccess
virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
@@ -84,3 +88,5 @@ public:
};
#endif//SC_VBA_SHAPERANGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbashapes.hxx b/vbahelper/inc/vbahelper/vbashapes.hxx
index 80c99592f8..212810b907 100644
--- a/vbahelper/inc/vbahelper/vbashapes.hxx
+++ b/vbahelper/inc/vbahelper/vbashapes.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,5 @@ public:
};
#endif//SC_VBA_SHAPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbatextframe.hxx b/vbahelper/inc/vbahelper/vbatextframe.hxx
index 75b3c97186..d08902096f 100644
--- a/vbahelper/inc/vbahelper/vbatextframe.hxx
+++ b/vbahelper/inc/vbahelper/vbatextframe.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,5 @@ public:
};
#endif//SC_VBA_TEXTFRAME_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/vbawindowbase.hxx b/vbahelper/inc/vbahelper/vbawindowbase.hxx
index a41a9443c5..9534fe8f85 100644
--- a/vbahelper/inc/vbahelper/vbawindowbase.hxx
+++ b/vbahelper/inc/vbahelper/vbawindowbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,3 +81,5 @@ private:
};
#endif //VBA_WINDOWBASE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/inc/vbahelper/weakreference.hxx b/vbahelper/inc/vbahelper/weakreference.hxx
index 94757ffcff..661f3bc5d7 100755
--- a/vbahelper/inc/vbahelper/weakreference.hxx
+++ b/vbahelper/inc/vbahelper/weakreference.hxx
@@ -38,7 +38,7 @@ namespace vbahelper {
/** A weak reference holding any UNO implementation object.
The held object must implement the ::com::sun::star::uno::XWeak interface.
-
+
In difference to the ::com::sun::star::uno::WeakReference<> implementation
from cppuhelper/weakref.hxx, the class type of this weak reference is not
restricted to UNO interface types, but can be used for any C++ class type
diff --git a/vbahelper/prj/build.lst b/vbahelper/prj/build.lst
index be2e516de3..8c411d422e 100644
--- a/vbahelper/prj/build.lst
+++ b/vbahelper/prj/build.lst
@@ -1,3 +1,3 @@
-vba vbahelper : oovbaapi offuh basic sfx2 svx filter cppuhelper vcl comphelper svtools tools sal unotools LIBXSLT:libxslt NULL
+vba vbahelper : offuh oox basic sfx2 svx filter cppuhelper vcl comphelper svtools tools sal LIBXSLT:libxslt NULL
vba vbahelper usr1 - all vba_mkout NULL
vba vbahelper\prj nmake - all vba_prj NULL
diff --git a/vbahelper/prj/d.lst b/vbahelper/prj/d.lst
index e69de29bb2..470676b2e9 100644
--- a/vbahelper/prj/d.lst
+++ b/vbahelper/prj/d.lst
@@ -0,0 +1 @@
+..\inc\vbahelper\vbaeventshelperbase.hxx %_DEST%\inc\vbahelper\vbaeventshelperbase.hxx
diff --git a/vbahelper/source/msforms/makefile.mk b/vbahelper/source/msforms/makefile.mk
new file mode 100755
index 0000000000..30ce22139c
--- /dev/null
+++ b/vbahelper/source/msforms/makefile.mk
@@ -0,0 +1,78 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..
+PRJNAME=vbahelper
+TARGET=msforms
+
+ENABLE_EXCEPTIONS=TRUE
+VISIBILITY_HIDDEN=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+CDEFS+=-DVBA_OOBUILD_HACK
+
+SLOFILES=\
+ $(SLO)$/vbacontrol.obj \
+ $(SLO)$/vbacontrols.obj \
+ $(SLO)$/vbabutton.obj \
+ $(SLO)$/vbacombobox.obj \
+ $(SLO)$/vbalabel.obj \
+ $(SLO)$/vbatextbox.obj \
+ $(SLO)$/vbaradiobutton.obj \
+ $(SLO)$/vbalistbox.obj \
+ $(SLO)$/vbatogglebutton.obj \
+ $(SLO)$/vbacheckbox.obj \
+ $(SLO)$/vbaframe.obj \
+ $(SLO)$/vbascrollbar.obj \
+ $(SLO)$/vbaprogressbar.obj \
+ $(SLO)$/vbamultipage.obj \
+ $(SLO)$/vbalistcontrolhelper.obj \
+ $(SLO)$/vbaspinbutton.obj \
+ $(SLO)$/vbasystemaxcontrol.obj \
+ $(SLO)$/vbaimage.obj \
+ $(SLO)$/vbapages.obj \
+ $(SLO)$/vbauserform.obj \
+ $(SLO)$/service.obj \
+
+# #FIXME vbapropvalue needs to move to vbahelper
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+ALLTAR : \
+ $(MISC)$/$(TARGET).don \
+
+$(SLOFILES) : $(MISC)$/$(TARGET).don
+
+$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+ +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
+ echo $@
+
diff --git a/vbahelper/source/msforms/service.cxx b/vbahelper/source/msforms/service.cxx
index 01e6014a37..3388051eae 100644
--- a/vbahelper/source/msforms/service.cxx
+++ b/vbahelper/source/msforms/service.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,3 +69,5 @@ extern "C"
return pRet;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbabutton.cxx b/vbahelper/source/msforms/vbabutton.cxx
index 0932346e7b..9b3e870466 100644
--- a/vbahelper/source/msforms/vbabutton.cxx
+++ b/vbahelper/source/msforms/vbabutton.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -120,3 +121,5 @@ ScVbaButton::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbabutton.hxx b/vbahelper/source/msforms/vbabutton.hxx
index a415b43318..24c127b906 100644
--- a/vbahelper/source/msforms/vbabutton.hxx
+++ b/vbahelper/source/msforms/vbabutton.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,3 +58,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif //SC_VBA_BUTTON_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbacheckbox.cxx b/vbahelper/source/msforms/vbacheckbox.cxx
index 6c643695c1..93d54fd13a 100644
--- a/vbahelper/source/msforms/vbacheckbox.cxx
+++ b/vbahelper/source/msforms/vbacheckbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#include "vbacheckbox.hxx"
#include "vbanewfont.hxx"
#include <vbahelper/helperdecl.hxx>
@@ -71,6 +72,8 @@ void SAL_CALL
ScVbaCheckbox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException)
{
sal_Int16 nValue = 0;
+ sal_Int16 nOldValue = 0;
+ m_xProps->getPropertyValue( STATE ) >>= nOldValue;
sal_Bool bValue = false;
if( _value >>= nValue )
{
@@ -83,6 +86,8 @@ ScVbaCheckbox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeExcept
nValue = 1;
}
m_xProps->setPropertyValue( STATE, uno::makeAny( nValue ) );
+ if ( nValue != nOldValue )
+ fireClickEvent();
}
uno::Reference< msforms::XNewFont > SAL_CALL ScVbaCheckbox::getFont() throw (uno::RuntimeException)
@@ -109,3 +114,4 @@ ScVbaCheckbox::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbacheckbox.hxx b/vbahelper/source/msforms/vbacheckbox.hxx
index af8739dcd2..3d76210afa 100644
--- a/vbahelper/source/msforms/vbacheckbox.hxx
+++ b/vbahelper/source/msforms/vbacheckbox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,10 +46,12 @@ public:
virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ov::msforms::XNewFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
// XDefaultProperty
- rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
//XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif //SC_VBA_CHECKBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbacombobox.cxx b/vbahelper/source/msforms/vbacombobox.cxx
index bb90bb63de..67136d6706 100644
--- a/vbahelper/source/msforms/vbacombobox.cxx
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,6 +27,10 @@
************************************************************************/
#include "vbacombobox.hxx"
+#include <vector>
+#include <filter/msfilter/msvbahelper.hxx>
+#include <basic/sbstar.hxx>
+#include <basic/sbmod.hxx>
#include "vbanewfont.hxx"
#include <ooo/vba/msforms/fmStyle.hpp>
#include <ooo/vba/msforms/fmDropButtonStyle.hpp>
@@ -78,12 +83,18 @@ ScVbaComboBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeExcepti
sal_Int16 nIndex = 0;
if( _value >>= nIndex )
{
+ sal_Int32 nOldIndex = -1;
+ getListIndex() >>= nOldIndex;
uno::Sequence< rtl::OUString > sItems;
m_xProps->getPropertyValue( ITEMS ) >>= sItems;
if( ( nIndex >= 0 ) && ( sItems.getLength() > nIndex ) )
{
rtl::OUString sText = sItems[ nIndex ];
m_xProps->setPropertyValue( TEXT, uno::makeAny( sText ) );
+
+ // fire the _Change event
+ if( nOldIndex != nIndex )
+ fireClickEvent();
}
}
}
@@ -118,8 +129,29 @@ ScVbaComboBox::getListIndex() throw (uno::RuntimeException)
void SAL_CALL
ScVbaComboBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
{
+ rtl::OUString sOldValue, sNewValue;
+ // booleans are converted to uppercase strings
+ sOldValue = extractStringFromAny( getValue(), ::rtl::OUString(), true );
// booleans are converted to uppercase strings
- m_xProps->setPropertyValue( sSourceName, uno::Any( extractStringFromAny( _value, ::rtl::OUString(), true ) ) );
+ sNewValue = extractStringFromAny( _value, ::rtl::OUString(), true );
+
+ m_xProps->setPropertyValue( sSourceName, uno::Any( sNewValue ) );
+
+ if ( sNewValue != sOldValue )
+ {
+ // If the new value is in current list, we should fire click event, otherwise fire the change event.
+ sal_Int32 nListIndex = -1;
+ getListIndex() >>= nListIndex;
+ sal_Bool bIsInList = ( nListIndex >= 0 );
+ if ( bIsInList )
+ {
+ fireClickEvent();
+ }
+ else
+ {
+ fireChangeEvent();
+ }
+ }
}
// see Value
@@ -258,3 +290,5 @@ ScVbaComboBox::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbacombobox.hxx b/vbahelper/source/msforms/vbacombobox.hxx
index e36e7c2c56..cc66c40dae 100644
--- a/vbahelper/source/msforms/vbacombobox.hxx
+++ b/vbahelper/source/msforms/vbacombobox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,10 +83,12 @@ public:
virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
// XDefaultProperty
- ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
//XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif //
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 7135ae04c9..143db79e9c 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -1,7 +1,8 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -28,6 +29,7 @@
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
+#include <com/sun/star/awt/XActionListener.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
@@ -39,6 +41,9 @@
#include <com/sun/star/form/binding/XListEntrySink.hpp>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
+#include <com/sun/star/script/XScriptListener.hpp>
+#include <com/sun/star/document/XCodeNameQuery.hpp>
+#include <com/sun/star/form/XChangeListener.hpp>
#include <ooo/vba/XControlProvider.hpp>
#ifdef VBA_OOBUILD_HACK
#include <svtools/bindablecontrolhelper.hxx>
@@ -65,15 +70,15 @@
using namespace com::sun::star;
using namespace ooo::vba;
-uno::Reference< css::awt::XWindowPeer >
+uno::Reference< css::awt::XWindowPeer >
ScVbaControl::getWindowPeer() throw (uno::RuntimeException)
{
uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
uno::Reference< awt::XControlModel > xControlModel;
uno::Reference< css::awt::XWindowPeer > xWinPeer;
- if ( !xControlShape.is() )
- {
+ if ( !xControlShape.is() )
+ {
// would seem to be a Userform control
uno::Reference< awt::XControl > xControl( m_xControl, uno::UNO_QUERY_THROW );
xWinPeer = xControl->getPeer();
@@ -90,7 +95,7 @@ ScVbaControl::getWindowPeer() throw (uno::RuntimeException)
}
catch( uno::Exception )
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "The Control does not exsit" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The Control does not exsit")),
uno::Reference< uno::XInterface >() );
}
return xWinPeer;
@@ -127,21 +132,30 @@ ScVbaControlListener::disposing( const lang::EventObject& ) throw( uno::RuntimeE
//ScVbaControl
-ScVbaControl::ScVbaControl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ControlImpl_BASE( xParent, xContext ), m_xControl( xControl ), m_xModel( xModel )
+ScVbaControl::ScVbaControl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ControlImpl_BASE( xParent, xContext ), bIsDialog(false), m_xControl( xControl ), m_xModel( xModel )
{
//add listener
m_xEventListener.set( new ScVbaControlListener( this ) );
setGeometryHelper( pGeomHelper );
uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
xComponent->addEventListener( m_xEventListener );
-
+
//init m_xProps
uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY ) ;
uno::Reference< awt::XControl> xUserFormControl( m_xControl, uno::UNO_QUERY ) ;
if ( xControlShape.is() ) // form control
+ {
m_xProps.set( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+ rtl::OUString sDefaultControl;
+ m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultControl") ) ) >>= sDefaultControl;
+ uno::Reference< lang::XMultiComponentFactory > xMFac( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
+ m_xEmptyFormControl.set( xMFac->createInstanceWithContext( sDefaultControl, mxContext ), uno::UNO_QUERY_THROW );
+ }
else if ( xUserFormControl.is() ) // userform control
+ {
m_xProps.set( xUserFormControl->getModel(), uno::UNO_QUERY_THROW );
+ bIsDialog = true;
+ }
}
ScVbaControl::~ScVbaControl()
@@ -153,7 +167,7 @@ ScVbaControl::~ScVbaControl()
}
}
-void
+void
ScVbaControl::setGeometryHelper( AbstractGeometryAttributes* pHelper )
{
mpGeometryHelper.reset( pHelper );
@@ -248,7 +262,7 @@ ScVbaControl::getObject() throw (uno::RuntimeException)
return xRet;
}
-void SAL_CALL ScVbaControl::SetFocus() throw (uno::RuntimeException)
+void SAL_CALL ScVbaControl::SetFocus() throw (uno::RuntimeException)
{
uno::Reference< awt::XWindow > xWin( m_xControl, uno::UNO_QUERY_THROW );
xWin->setFocus();
@@ -270,7 +284,7 @@ void SAL_CALL ScVbaControl::Move( double Left, double Top, const uno::Any& Width
setHeight( nHeight );
}
-rtl::OUString SAL_CALL
+rtl::OUString SAL_CALL
ScVbaControl::getControlSource() throw (uno::RuntimeException)
{
// #FIXME I *hate* having these upstream differences
@@ -293,7 +307,7 @@ ScVbaControl::getControlSource() throw (uno::RuntimeException)
}
catch( uno::Exception& )
{
- }
+ }
}
return sControlSource;
#else
@@ -301,7 +315,7 @@ ScVbaControl::getControlSource() throw (uno::RuntimeException)
#endif
}
-void SAL_CALL
+void SAL_CALL
ScVbaControl::setControlSource( const rtl::OUString& _controlsource ) throw (uno::RuntimeException)
{
#ifdef VBA_OOBUILD_HACK
@@ -333,7 +347,7 @@ ScVbaControl::getRowSource() throw (uno::RuntimeException)
}
catch( uno::Exception& )
{
- }
+ }
}
return sRowSource;
#else
@@ -341,7 +355,7 @@ ScVbaControl::getRowSource() throw (uno::RuntimeException)
#endif
}
-void SAL_CALL
+void SAL_CALL
ScVbaControl::setRowSource( const rtl::OUString& _rowsource ) throw (uno::RuntimeException)
{
#ifdef VBA_OOBUILD_HACK
@@ -352,7 +366,7 @@ ScVbaControl::setRowSource( const rtl::OUString& _rowsource ) throw (uno::Runtim
#endif
}
-rtl::OUString SAL_CALL
+rtl::OUString SAL_CALL
ScVbaControl::getName() throw (uno::RuntimeException)
{
rtl::OUString sName;
@@ -369,7 +383,7 @@ ScVbaControl::setName( const rtl::OUString& _name ) throw (uno::RuntimeException
(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ), uno::makeAny( _name ) );
}
-rtl::OUString SAL_CALL
+rtl::OUString SAL_CALL
ScVbaControl::getControlTipText() throw (css::uno::RuntimeException)
{
rtl::OUString sName;
@@ -378,7 +392,7 @@ ScVbaControl::getControlTipText() throw (css::uno::RuntimeException)
return sName;
}
-void SAL_CALL
+void SAL_CALL
ScVbaControl::setControlTipText( const rtl::OUString& rsToolTip ) throw (css::uno::RuntimeException)
{
m_xProps->setPropertyValue
@@ -397,6 +411,86 @@ void SAL_CALL ScVbaControl::setTag( const ::rtl::OUString& aTag )
m_aControlTag = aTag;
}
+::sal_Int32 SAL_CALL ScVbaControl::getForeColor() throw (::com::sun::star::uno::RuntimeException)
+{
+ sal_Int32 nForeColor = -1;
+ m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextColor" ) ) ) >>= nForeColor;
+ return OORGBToXLRGB( nForeColor );
+}
+
+void SAL_CALL ScVbaControl::setForeColor( ::sal_Int32 _forecolor ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextColor" ) ), uno::makeAny( XLRGBToOORGB( _forecolor ) ) );
+}
+
+void ScVbaControl::fireEvent( script::ScriptEvent& evt )
+{
+ uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
+ uno::Reference< script::XScriptListener > xScriptListener( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.EventListener" ) ), mxContext ), uno::UNO_QUERY_THROW );
+
+ uno::Reference< beans::XPropertySet > xProps( xScriptListener, uno::UNO_QUERY_THROW );
+ xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ), uno::makeAny( m_xModel ) );
+
+ // handling for sheet control
+ uno::Reference< msforms::XControl > xThisControl( this );
+ try
+ {
+ evt.Arguments.realloc( 1 );
+ lang::EventObject aEvt;
+
+ uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY ) ;
+ uno::Reference< awt::XControl > xControl( m_xControl, uno::UNO_QUERY ) ;
+
+ if ( xControlShape.is() )
+ {
+ evt.Source = xControlShape;
+ aEvt.Source = m_xEmptyFormControl;
+ // Set up proper scriptcode
+ uno::Reference< lang::XMultiServiceFactory > xDocFac( m_xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< document::XCodeNameQuery > xNameQuery( xDocFac->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooo.vba.VBACodeNameProvider")) ), uno::UNO_QUERY_THROW );
+ uno::Reference< uno::XInterface > xIf( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+ evt.ScriptCode = xNameQuery->getCodeNameForObject( xIf );
+ evt.Arguments[ 0 ] = uno::makeAny( aEvt );
+ xScriptListener->firing( evt );
+ }
+ else
+ {
+ if ( xControl.is() ) // normal control ( from dialog/userform )
+ {
+ // #FIXME We should probably store a reference to the
+ // parent dialog/userform here ( other wise the name of
+ // dialog could be changed and we won't be aware of it.
+ // ( OTOH this is probably an unlikely scenario )
+ evt.Source = xThisControl;
+ aEvt.Source = xControl;
+ evt.ScriptCode = m_sLibraryAndCodeName;
+ evt.Arguments[ 0 ] = uno::makeAny( aEvt );
+ xScriptListener->firing( evt );
+ }
+ }
+ }
+ catch( uno::Exception& e )
+ {
+ }
+}
+void ScVbaControl::fireChangeEvent()
+{
+ script::ScriptEvent evt;
+ evt.ScriptType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VBAInterop") );
+ evt.ListenerType = form::XChangeListener::static_type(0);
+ evt.MethodName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("changed") );
+ fireEvent( evt );
+}
+
+void ScVbaControl::fireClickEvent()
+{
+ script::ScriptEvent evt;
+ evt.ScriptType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VBAInterop") );
+ evt.ListenerType = awt::XActionListener::static_type(0);
+ evt.MethodName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("actionPerformed") );
+ fireEvent( evt );
+}
+
sal_Int32 SAL_CALL ScVbaControl::getTabIndex() throw (uno::RuntimeException)
{
return 1;
@@ -420,7 +514,6 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R
uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess
uno::Reference< drawing::XShape > xShape( xControlShape, uno::UNO_QUERY_THROW );
::std::auto_ptr< ConcreteXShapeGeometryAttributes > xGeoHelper( new ConcreteXShapeGeometryAttributes( xContext, xShape ) );
-
switch( nClassId )
{
case form::FormComponentType::COMBOBOX:
@@ -431,6 +524,8 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R
return new ScVbaLabel( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() );
case form::FormComponentType::TEXTFIELD:
return new ScVbaTextBox( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() );
+ case form::FormComponentType::CHECKBOX:
+ return new ScVbaCheckbox( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() );
case form::FormComponentType::RADIOBUTTON:
return new ScVbaRadioButton( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() );
case form::FormComponentType::LISTBOX:
@@ -440,7 +535,7 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R
case form::FormComponentType::IMAGECONTROL:
return new ScVbaImage( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() );
}
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Unsupported control." ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unsupported control.")), uno::Reference< uno::XInterface >() );
}
/*static*/ uno::Reference< msforms::XControl > ScVbaControlFactory::createUserformControl(
@@ -491,20 +586,28 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R
xVBAControl.set( new ScVbaSpinButton( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) );
else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.custom.awt.UnoControlSystemAXContainerModel") ) ) )
xVBAControl.set( new VbaSystemAXControl( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) );
-
+ // #FIXME implement a page control
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoPageModel") ) ) )
+ xVBAControl.set( new ScVbaControl( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoFrameModel") ) ) )
+ xVBAControl.set( new ScVbaFrame( xVbaParent, xContext, xControl, xModel, xGeoHelper.release(), xDialog ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) )
+ xVBAControl.set( new ScVbaSpinButton( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.custom.awt.UnoControlSystemAXContainerModel") ) ) )
+ xVBAControl.set( new VbaSystemAXControl( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) );
if( xVBAControl.is() )
return xVBAControl;
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Unsupported control." ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unsupported control.")), uno::Reference< uno::XInterface >() );
}
-rtl::OUString&
+rtl::OUString&
ScVbaControl::getServiceImplName()
{
static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaControl") );
return sImplName;
}
-uno::Sequence< rtl::OUString >
+uno::Sequence< rtl::OUString >
ScVbaControl::getServiceNames()
{
static uno::Sequence< rtl::OUString > aServiceNames;
@@ -516,8 +619,6 @@ ScVbaControl::getServiceNames()
return aServiceNames;
}
-
-
typedef cppu::WeakImplHelper1< XControlProvider > ControlProvider_BASE;
class ControlProviderImpl : public ControlProvider_BASE
{
@@ -527,14 +628,14 @@ public:
virtual uno::Reference< msforms::XControl > SAL_CALL createControl( const uno::Reference< drawing::XControlShape >& xControl, const uno::Reference< frame::XModel >& xDocOwner ) throw (uno::RuntimeException);
};
-uno::Reference< msforms::XControl > SAL_CALL
+uno::Reference< msforms::XControl > SAL_CALL
ControlProviderImpl::createControl( const uno::Reference< drawing::XControlShape >& xControlShape, const uno::Reference< frame::XModel >& xDocOwner ) throw (uno::RuntimeException)
{
uno::Reference< msforms::XControl > xControlToReturn;
- if ( xControlShape.is() )
+ if ( xControlShape.is() )
xControlToReturn = ScVbaControlFactory::createShapeControl( m_xCtx, xControlShape, xDocOwner );
return xControlToReturn;
-
+
}
namespace controlprovider
@@ -548,3 +649,4 @@ extern sdecl::ServiceDecl const serviceDecl(
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbacontrol.hxx b/vbahelper/source/msforms/vbacontrol.hxx
index 3f4cd5447a..8eba8c5714 100644
--- a/vbahelper/source/msforms/vbacontrol.hxx
+++ b/vbahelper/source/msforms/vbacontrol.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/script/ScriptEvent.hpp>
#include <ooo/vba/msforms/XControl.hpp>
#include <vbahelper/vbahelper.hxx>
@@ -48,17 +50,23 @@ class ScVbaControl : public ControlImpl_BASE
{
private:
com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > m_xEventListener;
+ com::sun::star::uno::Reference< com::sun::star::awt::XControl > m_xEmptyFormControl;
protected:
// awt control has nothing similar to Tag property of Mso controls,
// whether it is necessary is another question
::rtl::OUString m_aControlTag;
+ bool bIsDialog;
+ rtl::OUString m_sLibraryAndCodeName;
std::auto_ptr< ov::AbstractGeometryAttributes > mpGeometryHelper;
css::uno::Reference< css::beans::XPropertySet > m_xProps;
css::uno::Reference< css::uno::XInterface > m_xControl;
css::uno::Reference< css::frame::XModel > m_xModel;
virtual css::uno::Reference< css::awt::XWindowPeer > getWindowPeer() throw (css::uno::RuntimeException);
+ void fireChangeEvent();
+ void fireClickEvent();
+ void fireEvent( css::script::ScriptEvent& evt );
public:
ScVbaControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pHelper );
@@ -66,6 +74,10 @@ public:
// This class will own the helper, so make sure it is allocated from
// the heap
void setGeometryHelper( ov::AbstractGeometryAttributes* pHelper );
+ // sets the name of the associated library ( used for UserForm controls )
+ void setLibraryAndCodeName( const rtl::OUString& sLibCodeName ) { m_sLibraryAndCodeName = sLibCodeName; }
+ rtl::OUString getLibraryAndCodeName() const { return m_sLibraryAndCodeName; }
+
// XControl
virtual sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
virtual void SAL_CALL setEnabled( sal_Bool _enabled ) throw (css::uno::RuntimeException);
@@ -97,6 +109,8 @@ public:
virtual void SAL_CALL setTabIndex( sal_Int32 nTabIndex ) throw (css::uno::RuntimeException);
//remove resouce because ooo.vba.excel.XControl is a wrapper of com.sun.star.drawing.XControlShape
virtual void removeResouce() throw( css::uno::RuntimeException );
+ virtual ::sal_Int32 SAL_CALL getForeColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setForeColor( ::sal_Int32 _forecolor ) throw (::com::sun::star::uno::RuntimeException);
//XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
@@ -124,3 +138,5 @@ private:
};
#endif//SC_VBA_CONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbacontrols.cxx b/vbahelper/source/msforms/vbacontrols.cxx
index 523a2a9e4b..be5d05e7f3 100644
--- a/vbahelper/source/msforms/vbacontrols.cxx
+++ b/vbahelper/source/msforms/vbacontrols.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,8 +39,8 @@
#include "vbacontrols.hxx"
#include "vbacontrol.hxx"
#include <cppuhelper/implbase2.hxx>
-#include <ooo/vba/XControlProvider.hpp>
-#include <hash_map>
+#include <ooo/vba//XControlProvider.hpp>
+#include <boost/unordered_map.hpp>
using namespace com::sun::star;
using namespace ooo::vba;
@@ -47,7 +48,7 @@ using namespace ooo::vba;
typedef ::cppu::WeakImplHelper2< container::XNameAccess, container::XIndexAccess > ArrayWrapImpl;
-typedef std::hash_map< rtl::OUString, sal_Int32, ::rtl::OUStringHash,
+typedef boost::unordered_map< rtl::OUString, sal_Int32, ::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > ControlIndexMap;
typedef std::vector< uno::Reference< awt::XControl > > ControlVec;
@@ -75,7 +76,19 @@ private:
mIndices[ msNames[ nIndex ] ] = nIndex;
}
}
-
+ void getNestedControls( ControlVec& vControls, uno::Reference< awt::XControlContainer >& xContainer )
+ {
+ uno::Sequence< uno::Reference< awt::XControl > > aControls = xContainer->getControls();
+ const uno::Reference< awt::XControl >* pCtrl = aControls.getConstArray();
+ const uno::Reference< awt::XControl >* pCtrlsEnd = pCtrl + aControls.getLength();
+ for ( ; pCtrl < pCtrlsEnd; ++pCtrl )
+ {
+ uno::Reference< awt::XControlContainer > xC( *pCtrl, uno::UNO_QUERY );
+ vControls.push_back( *pCtrl );
+ if ( xC.is() )
+ getNestedControls( vControls, xC );
+ }
+ }
public:
ControlArrayWrapper( const uno::Reference< awt::XControl >& xDialog )
{
@@ -498,3 +511,4 @@ ScVbaControls::getElementType() throw (uno::RuntimeException)
}
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaControls, "ooo.vba.msforms.Controls" )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbacontrols.hxx b/vbahelper/source/msforms/vbacontrols.hxx
index 72f72510c4..4745e7b901 100644
--- a/vbahelper/source/msforms/vbacontrols.hxx
+++ b/vbahelper/source/msforms/vbacontrols.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,3 +70,4 @@ private:
#endif //SC_VBA_OLEOBJECTS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbaframe.cxx b/vbahelper/source/msforms/vbaframe.cxx
index 6e7cb7dbd5..7c5f102603 100644
--- a/vbahelper/source/msforms/vbaframe.cxx
+++ b/vbahelper/source/msforms/vbaframe.cxx
@@ -1,7 +1,8 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -68,6 +69,17 @@ sal_Int32 SAL_CALL ScVbaFrame::getSpecialEffect() throw (uno::RuntimeException)
return msforms::fmSpecialEffect::fmSpecialEffectEtched;
}
+::sal_Int32 SAL_CALL ScVbaFrame::getForeColor() throw (::com::sun::star::uno::RuntimeException)
+{
+ return 0;
+}
+
+void SAL_CALL ScVbaFrame::setForeColor( ::sal_Int32 /*_forecolor*/ ) throw (::com::sun::star::uno::RuntimeException)
+{
+ return;
+}
+
+
void SAL_CALL ScVbaFrame::setSpecialEffect( sal_Int32 /*nSpecialEffect*/ ) throw (uno::RuntimeException)
{
}
@@ -104,3 +116,4 @@ uno::Any SAL_CALL ScVbaFrame::Controls( const uno::Any& rIndex ) throw (uno::Run
// XHelperInterface
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaFrame, "ooo.vba.msforms.Frame" )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbaframe.hxx b/vbahelper/source/msforms/vbaframe.hxx
index eab81d6a8a..bb5b198335 100644
--- a/vbahelper/source/msforms/vbaframe.hxx
+++ b/vbahelper/source/msforms/vbaframe.hxx
@@ -1,7 +1,8 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -48,6 +49,9 @@ public:
// XFrame attributes
virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+
+ virtual ::sal_Int32 SAL_CALL getForeColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setForeColor( ::sal_Int32 _forecolor ) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getSpecialEffect() throw (css::uno::RuntimeException);
virtual void SAL_CALL setSpecialEffect( sal_Int32 nSpecialEffect ) throw (css::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getBorderStyle() throw (css::uno::RuntimeException);
@@ -63,3 +67,5 @@ private:
css::uno::Reference< css::awt::XControl > mxDialog;
};
#endif //SC_VBA_LABEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbaimage.cxx b/vbahelper/source/msforms/vbaimage.cxx
index bb49ad7b3d..fbe0d10e1b 100644
--- a/vbahelper/source/msforms/vbaimage.cxx
+++ b/vbahelper/source/msforms/vbaimage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,3 +55,5 @@ ScVbaImage::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbaimage.hxx b/vbahelper/source/msforms/vbaimage.hxx
index c51b85dfdc..c1098fdd8b 100644
--- a/vbahelper/source/msforms/vbaimage.hxx
+++ b/vbahelper/source/msforms/vbaimage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif //SC_VBA_IMAGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbalabel.cxx b/vbahelper/source/msforms/vbalabel.cxx
index 799279c89c..4795a25be7 100644
--- a/vbahelper/source/msforms/vbalabel.cxx
+++ b/vbahelper/source/msforms/vbalabel.cxx
@@ -1,7 +1,8 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,7 +39,7 @@ ScVbaLabel::ScVbaLabel( const css::uno::Reference< XHelperInterface >& xParent,
}
// Attributes
-rtl::OUString SAL_CALL
+rtl::OUString SAL_CALL
ScVbaLabel::getCaption() throw (css::uno::RuntimeException)
{
rtl::OUString Label;
@@ -46,23 +47,36 @@ ScVbaLabel::getCaption() throw (css::uno::RuntimeException)
return Label;
}
-void SAL_CALL
+void SAL_CALL
ScVbaLabel::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
{
m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
}
-uno::Any SAL_CALL
+uno::Any SAL_CALL
ScVbaLabel::getValue() throw (css::uno::RuntimeException)
{
return uno::makeAny( getCaption() );
}
-void SAL_CALL
+void SAL_CALL
ScVbaLabel::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
{
rtl::OUString sCaption;
_value >>= sCaption;
- setCaption( sCaption );
+ setCaption( sCaption );
+}
+
+rtl::OUString SAL_CALL
+ScVbaLabel::getAccelerator() throw (css::uno::RuntimeException)
+{
+ //FIXME: seems not support?
+ return rtl::OUString();
+}
+
+void SAL_CALL
+ScVbaLabel::setAccelerator( const rtl::OUString& /*_accelerator*/ ) throw (::com::sun::star::uno::RuntimeException)
+{
+ //FIXME: seems not support?
}
uno::Reference< msforms::XNewFont > SAL_CALL ScVbaLabel::getFont() throw (uno::RuntimeException)
@@ -70,14 +84,13 @@ uno::Reference< msforms::XNewFont > SAL_CALL ScVbaLabel::getFont() throw (uno::R
return new VbaNewFont( this, mxContext, m_xProps );
}
-rtl::OUString&
-ScVbaLabel::getServiceImplName()
+rtl::OUString& ScVbaLabel::getServiceImplName()
{
static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaLabel") );
return sImplName;
}
-uno::Sequence< rtl::OUString >
+uno::Sequence< rtl::OUString >
ScVbaLabel::getServiceNames()
{
static uno::Sequence< rtl::OUString > aServiceNames;
@@ -88,3 +101,5 @@ ScVbaLabel::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbalabel.hxx b/vbahelper/source/msforms/vbalabel.hxx
index 874c0f9bc1..47c5c949a1 100644
--- a/vbahelper/source/msforms/vbalabel.hxx
+++ b/vbahelper/source/msforms/vbalabel.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,11 +45,15 @@ public:
virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getAccelerator() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAccelerator( const rtl::OUString& _accelerator ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ov::msforms::XNewFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
//XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
// XDefaultProperty
- rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
};
#endif //SC_VBA_LABEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx
index 77de209782..f008fef9d5 100644
--- a/vbahelper/source/msforms/vbalistbox.cxx
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -1,7 +1,8 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -45,16 +46,16 @@ ScVbaListBox::ScVbaListBox( const uno::Reference< XHelperInterface >& xParent, c
}
// Attributes
-void SAL_CALL
+void SAL_CALL
ScVbaListBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException)
{
sal_Int32 nIndex = 0;
_value >>= nIndex;
uno::Reference< XPropValue > xPropVal( Selected( nIndex ), uno::UNO_QUERY_THROW );
- xPropVal->setValue( uno::makeAny( sal_True ) );
+ xPropVal->setValue( uno::makeAny( sal_True ) );
}
-uno::Any SAL_CALL
+uno::Any SAL_CALL
ScVbaListBox::getListIndex() throw (uno::RuntimeException)
{
uno::Sequence< sal_Int16 > sSelection;
@@ -64,7 +65,7 @@ ScVbaListBox::getListIndex() throw (uno::RuntimeException)
return uno::Any( sSelection[ 0 ] );
}
-uno::Any SAL_CALL
+uno::Any SAL_CALL
ScVbaListBox::getValue() throw (uno::RuntimeException)
{
uno::Sequence< sal_Int16 > sSelection;
@@ -72,21 +73,21 @@ ScVbaListBox::getValue() throw (uno::RuntimeException)
m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection;
m_xProps->getPropertyValue( ITEMS ) >>= sItems;
if( getMultiSelect() )
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Attribute use invalid." )), uno::Reference< uno::XInterface >() );
uno::Any aRet;
if ( sSelection.getLength() )
- aRet = uno::makeAny( sItems[ sSelection[ 0 ] ] );
+ aRet = uno::makeAny( sItems[ sSelection[ 0 ] ] );
return aRet;
}
-void SAL_CALL
+void SAL_CALL
ScVbaListBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
{
if( getMultiSelect() )
- {
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
+ {
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Attribute use invalid." )), uno::Reference< uno::XInterface >() );
}
rtl::OUString sValue = getAnyAsString( _value );
uno::Sequence< rtl::OUString > sList;
@@ -99,21 +100,25 @@ ScVbaListBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
{
if( sList[i].equals( sValue ) )
{
- nValue = i;
+ nValue = i;
break;
}
}
if( nValue == -1 )
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Attribute use invalid." )), uno::Reference< uno::XInterface >() );
uno::Sequence< sal_Int16 > nSelectedIndices(1);
+ uno::Sequence< sal_Int16 > nOldSelectedIndices;
+ m_xProps->getPropertyValue( SELECTEDITEMS ) >>= nOldSelectedIndices;
nSelectedIndices[ 0 ] = nValue;
- m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nSelectedIndices ) );
- m_xProps->setPropertyValue( TEXT, uno::makeAny( sValue ) );
+ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nSelectedIndices ) );
+ if ( nSelectedIndices != nOldSelectedIndices )
+ fireClickEvent();
+ //m_xProps->setPropertyValue( TEXT, uno::makeAny( sValue ) );
}
-::rtl::OUString SAL_CALL
+::rtl::OUString SAL_CALL
ScVbaListBox::getText() throw (uno::RuntimeException)
{
rtl::OUString result;
@@ -121,56 +126,58 @@ ScVbaListBox::getText() throw (uno::RuntimeException)
return result;
}
-void SAL_CALL
+void SAL_CALL
ScVbaListBox::setText( const ::rtl::OUString& _text ) throw (uno::RuntimeException)
{
setValue( uno::makeAny( _text ) ); // seems the same
}
-sal_Bool SAL_CALL
+sal_Int32 SAL_CALL
ScVbaListBox::getMultiSelect() throw (css::uno::RuntimeException)
{
sal_Bool bMultiSelect = sal_False;
m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ) ) >>= bMultiSelect;
- return bMultiSelect;
+ return bMultiSelect ? 1 : 0 ;
}
-void SAL_CALL
-ScVbaListBox::setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException)
+void SAL_CALL
+ScVbaListBox::setMultiSelect( sal_Int32 _multiselect ) throw (css::uno::RuntimeException)
{
- m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ), uno::makeAny( _multiselect ) );
+ sal_Bool bMultiSelect = _multiselect == 1 ? 1 : 0;
+ m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ), uno::makeAny( bMultiSelect ) );
}
-css::uno::Any SAL_CALL
+
+css::uno::Any SAL_CALL
ScVbaListBox::Selected( sal_Int32 index ) throw (css::uno::RuntimeException)
{
uno::Sequence< rtl::OUString > sList;
m_xProps->getPropertyValue( ITEMS ) >>= sList;
sal_Int16 nLength = static_cast< sal_Int16 >( sList.getLength() );
// no choice but to do a horror cast as internally
- // the indices are but sal_Int16
+ // the indices are but sal_Int16
sal_Int16 nIndex = static_cast< sal_Int16 >( index );
if( nIndex < 0 || nIndex >= nLength )
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "Error Number." ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Error Number." )), uno::Reference< uno::XInterface >() );
m_nIndex = nIndex;
return uno::makeAny( uno::Reference< XPropValue > ( new ScVbaPropValue( this ) ) );
}
// Methods
-void SAL_CALL
+void SAL_CALL
ScVbaListBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException)
{
mpListHelper->AddItem( pvargItem, pvargIndex );
}
-void SAL_CALL
+void SAL_CALL
ScVbaListBox::removeItem( const uno::Any& index ) throw (uno::RuntimeException)
{
mpListHelper->removeItem( index );
}
-void SAL_CALL
+void SAL_CALL
ScVbaListBox::Clear( ) throw (uno::RuntimeException)
{
mpListHelper->Clear();
@@ -180,13 +187,13 @@ ScVbaListBox::Clear( ) throw (uno::RuntimeException)
// to set the selected state of particular entries in the Listbox
// ListBox1.Selected( 3 ) = false
//PropListener
-void
+void
ScVbaListBox::setValueEvent( const uno::Any& value )
{
sal_Bool bValue = sal_False;
if( !(value >>= bValue) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "Invalid type\n. need boolean." ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Invalid type\n. need boolean." )), uno::Reference< uno::XInterface >() );
uno::Sequence< sal_Int16 > nList;
m_xProps->getPropertyValue( SELECTEDITEMS ) >>= nList;
sal_Int16 nLength = static_cast<sal_Int16>( nList.getLength() );
@@ -205,6 +212,7 @@ ScVbaListBox::setValueEvent( const uno::Any& value )
}
nList.realloc( nLength - 1 );
//m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
+ fireClickEvent();
m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nList ) );
return;
}
@@ -223,6 +231,7 @@ ScVbaListBox::setValueEvent( const uno::Any& value )
nList[0] = nIndex;
}
//m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
+ fireClickEvent();
m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nList ) );
}
}
@@ -231,14 +240,14 @@ ScVbaListBox::setValueEvent( const uno::Any& value )
// to determine the selected state of particular entries in the Listbox
// msgbox ListBox1.Selected( 3 )
-css::uno::Any
+css::uno::Any
ScVbaListBox::getValueEvent()
{
uno::Sequence< sal_Int16 > nList;
m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) ) ) >>= nList;
sal_Int32 nLength = nList.getLength();
sal_Int32 nIndex = m_nIndex;
-
+
for( sal_Int32 i = 0; i < nLength; i++ )
{
if( nList[i] == nIndex )
@@ -261,7 +270,7 @@ ScVbaListBox::getListCount() throw (uno::RuntimeException)
return mpListHelper->getListCount();
}
-uno::Any SAL_CALL
+uno::Any SAL_CALL
ScVbaListBox::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException)
{
return mpListHelper->List( pvargIndex, pvarColumn );
@@ -279,7 +288,7 @@ ScVbaListBox::getServiceImplName()
return sImplName;
}
-uno::Sequence< rtl::OUString >
+uno::Sequence< rtl::OUString >
ScVbaListBox::getServiceNames()
{
static uno::Sequence< rtl::OUString > aServiceNames;
@@ -290,3 +299,5 @@ ScVbaListBox::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbalistbox.hxx b/vbahelper/source/msforms/vbalistbox.hxx
index 8626ca85c4..3c1bb28d4a 100644
--- a/vbahelper/source/msforms/vbalistbox.hxx
+++ b/vbahelper/source/msforms/vbalistbox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,8 +59,8 @@ public:
virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getMultiSelect() throw (css::uno::RuntimeException);
- virtual void SAL_CALL setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMultiSelect() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMultiSelect( ::sal_Int32 _multiselect ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ov::msforms::XNewFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
// Methods
@@ -72,7 +73,7 @@ public:
virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
// XDefaultProperty
- rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
//XHelperInterface
virtual rtl::OUString& getServiceImplName();
@@ -86,3 +87,5 @@ public:
};
#endif //
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.cxx b/vbahelper/source/msforms/vbalistcontrolhelper.cxx
index 36683ae6f7..696b52bfb4 100644
--- a/vbahelper/source/msforms/vbalistcontrolhelper.cxx
+++ b/vbahelper/source/msforms/vbalistcontrolhelper.cxx
@@ -1,12 +1,71 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <vbalistcontrolhelper.hxx>
#include <vector>
+#include <vbahelper/vbapropvalue.hxx>
using namespace com::sun::star;
using namespace ooo::vba;
const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") );
-void SAL_CALL
+class ListPropListener : public PropListener
+{
+private:
+ uno::Reference< beans::XPropertySet > m_xProps;
+ uno::Any m_pvargIndex;
+ uno::Any m_pvarColumn;
+
+public:
+ ListPropListener( const uno::Reference< beans::XPropertySet >& xProps, const uno::Any& pvargIndex, const uno::Any& pvarColumn );
+ virtual void setValueEvent( const css::uno::Any& value );
+ virtual css::uno::Any getValueEvent();
+};
+
+ListPropListener::ListPropListener( const uno::Reference< beans::XPropertySet >& xProps, const uno::Any& pvargIndex, const uno::Any& pvarColumn ) : m_xProps( xProps ), m_pvargIndex( pvargIndex ), m_pvarColumn( pvarColumn )
+{
+}
+
+void ListPropListener::setValueEvent( const uno::Any& value )
+{
+ if( m_pvargIndex.hasValue() || m_pvarColumn.hasValue() )
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Bad argument" )), uno::Reference< uno::XInterface >() );
+
+ m_xProps->setPropertyValue( ITEMS, value );
+}
+
+uno::Any ListPropListener::getValueEvent()
+{
+ uno::Sequence< rtl::OUString > sList;
+ m_xProps->getPropertyValue( ITEMS ) >>= sList;
+ sal_Int16 nLength = static_cast< sal_Int16 >( sList.getLength() );
+ uno::Any aRet;
+ if ( m_pvargIndex.hasValue() )
+ {
+ sal_Int16 nIndex = -1;
+ m_pvargIndex >>= nIndex;
+ if( nIndex < 0 || nIndex >= nLength )
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Bad row Index" )), uno::Reference< uno::XInterface >() );
+ aRet <<= sList[ nIndex ];
+ }
+ else if ( m_pvarColumn.hasValue() ) // pvarColumn on its own would be bad
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Bad column Index" )), uno::Reference< uno::XInterface >() );
+ else // List() ( e.g. no args )
+ {
+ uno::Sequence< uno::Sequence< rtl::OUString > > sReturnArray( nLength );
+ for ( sal_Int32 i = 0; i < nLength; ++i )
+ {
+ sReturnArray[ i ].realloc( 10 );
+ sReturnArray[ i ][ 0 ] = sList[ i ];
+ }
+ aRet = uno::makeAny( sReturnArray );
+ }
+ return aRet;
+}
+
+void SAL_CALL
ListControlHelper::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException)
{
if ( pvargItem.hasValue() )
@@ -21,13 +80,13 @@ ListControlHelper::AddItem( const uno::Any& pvargItem, const uno::Any& pvargInde
rtl::OUString sString = getAnyAsString( pvargItem );
- // if no index specified or item is to be appended to end of
+ // if no index specified or item is to be appended to end of
// list just realloc the array and set the last item
if ( nIndex == sList.getLength() )
{
sal_Int32 nOldSize = sList.getLength();
sList.realloc( nOldSize + 1 );
- sList[ nOldSize ] = sString;
+ sList[ nOldSize ] = sString;
}
else
{
@@ -41,10 +100,10 @@ ListControlHelper::AddItem( const uno::Any& pvargItem, const uno::Any& pvargInde
const rtl::OUString* pEndString = sList.getArray() + sList.getLength();
// insert the new element
sVec.push_back( sString );
- // copy elements
+ // copy elements
for ( ; pString != pEndString; ++pString )
sVec.push_back( *pString );
-
+
sList.realloc( sList.getLength() + 1 );
// point at first element to be overwritten
@@ -52,16 +111,16 @@ ListControlHelper::AddItem( const uno::Any& pvargItem, const uno::Any& pvargInde
pEndString = sList.getArray() + sList.getLength();
std::vector< rtl::OUString >::iterator it = sVec.begin();
for ( ; pString != pEndString; ++pString, ++it)
- *pString = *it;
+ *pString = *it;
//
}
m_xProps->setPropertyValue( ITEMS, uno::makeAny( sList ) );
-
+
}
}
-void SAL_CALL
+void SAL_CALL
ListControlHelper::removeItem( const uno::Any& index ) throw (uno::RuntimeException)
{
sal_Int32 nIndex = 0;
@@ -71,7 +130,7 @@ ListControlHelper::removeItem( const uno::Any& index ) throw (uno::RuntimeExcept
uno::Sequence< rtl::OUString > sList;
m_xProps->getPropertyValue( ITEMS ) >>= sList;
if( nIndex < 0 || nIndex > ( sList.getLength() - 1 ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid index" ), uno::Reference< uno::XInterface > () );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid index")), uno::Reference< uno::XInterface > () );
if( sList.hasElements() )
{
if( sList.getLength() == 1 )
@@ -90,7 +149,7 @@ ListControlHelper::removeItem( const uno::Any& index ) throw (uno::RuntimeExcept
}
}
-void SAL_CALL
+void SAL_CALL
ListControlHelper::Clear( ) throw (uno::RuntimeException)
{
// urk, setValue doesn't seem to work !!
@@ -113,34 +172,10 @@ ListControlHelper::getListCount() throw (uno::RuntimeException)
return sList.getLength();
}
-uno::Any SAL_CALL
+uno::Any SAL_CALL
ListControlHelper::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException)
{
- uno::Sequence< rtl::OUString > sList;
- m_xProps->getPropertyValue( ITEMS ) >>= sList;
- sal_Int16 nLength = static_cast< sal_Int16 >( sList.getLength() );
- uno::Any aRet;
- if ( pvargIndex.hasValue() )
- {
- sal_Int16 nIndex = -1;
- pvargIndex >>= nIndex;
- if( nIndex < 0 || nIndex >= nLength )
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "Bad row Index" ), uno::Reference< uno::XInterface >() );
- aRet <<= sList[ nIndex ];
- }
- else if ( pvarColumn.hasValue() ) // pvarColumn on its own would be bad
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "Bad column Index" ), uno::Reference< uno::XInterface >() );
- else // List() ( e.g. no args )
- {
- uno::Sequence< uno::Sequence< rtl::OUString > > sReturnArray( nLength );
- for ( sal_Int32 i = 0; i < nLength; ++i )
- {
- sReturnArray[ i ].realloc( 10 );
- sReturnArray[ i ][ 0 ] = sList[ i ];
- }
- aRet = uno::makeAny( sReturnArray );
- }
- return aRet;
+ return uno::makeAny( uno::Reference< XPropValue > ( new ScVbaPropValue( new ListPropListener( m_xProps, pvargIndex, pvarColumn ) ) ) );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.hxx b/vbahelper/source/msforms/vbalistcontrolhelper.hxx
index 6b332ab9d8..82ac338765 100644
--- a/vbahelper/source/msforms/vbalistcontrolhelper.hxx
+++ b/vbahelper/source/msforms/vbalistcontrolhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef SC_VBA_LISTCONTROLHELPER
#define SC_VBA_LISTCONTROLHELPER
@@ -18,3 +19,5 @@ public:
virtual void SAL_CALL Clear( ) throw (css::uno::RuntimeException);
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbamultipage.cxx b/vbahelper/source/msforms/vbamultipage.cxx
index 45b6dd1bb4..6d3756ea0f 100644
--- a/vbahelper/source/msforms/vbamultipage.cxx
+++ b/vbahelper/source/msforms/vbamultipage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,14 +29,12 @@
#include <ooo/vba/XCollection.hpp>
#include "vbapages.hxx"
#include <vector>
+#include <com/sun/star/container/XNameContainer.hpp>
using namespace com::sun::star;
using namespace ooo::vba;
-// uno servicename com.sun.star.awt.UnoControlProgressBarMode
-const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") );
-const rtl::OUString SVALUEMAX( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") );
-const rtl::OUString SSTEP( RTL_CONSTASCII_USTRINGPARAM("Step") );
+const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("MultiPageValue") );
typedef cppu::WeakImplHelper1< container::XIndexAccess > PagesImpl_Base;
class PagesImpl : public PagesImpl_Base
@@ -77,9 +76,7 @@ ScVbaMultiPage::ScVbaMultiPage(
const uno::Reference< awt::XControl >& xDialog ) :
MultiPageImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
{
- mxDialogProps.set( xDialog->getModel(), uno::UNO_QUERY_THROW );
- // set dialog step to value of multipage pseudo model
- setValue(getValue());
+ mxDialogProps.set( xDialog, uno::UNO_QUERY_THROW );
}
// Attributes
@@ -88,15 +85,19 @@ ScVbaMultiPage::getValue() throw (css::uno::RuntimeException)
{
sal_Int32 nValue = 0;
m_xProps->getPropertyValue( SVALUE ) >>= nValue;
- return nValue;
+ // VBA 0 based tab index
+ return nValue - 1;
}
void SAL_CALL
ScVbaMultiPage::setValue( const sal_Int32 _value ) throw (::com::sun::star::uno::RuntimeException)
{
- // track change in dialog ( dialog value is 1 based, 0 is a special value )
- m_xProps->setPropertyValue( SVALUE, uno::makeAny( _value ) );
- mxDialogProps->setPropertyValue( SSTEP, uno::makeAny( _value + 1) );
+ // Openoffice 1 based tab index
+ sal_Int32 nVal = _value + 1;
+ sal_Int32 nOldVal = getValue();
+ m_xProps->setPropertyValue( SVALUE, uno::makeAny( nVal ) );
+ if ( nVal != nOldVal )
+ fireChangeEvent();
}
@@ -110,9 +111,9 @@ ScVbaMultiPage::getServiceImplName()
uno::Any SAL_CALL
ScVbaMultiPage::Pages( const uno::Any& index ) throw (uno::RuntimeException)
{
- sal_Int32 nValue = 0;
- m_xProps->getPropertyValue( SVALUEMAX ) >>= nValue;
- uno::Reference< XCollection > xColl( new ScVbaPages( this, mxContext, getPages( nValue ) ) );
+ // get the container model
+ uno::Reference< container::XNameContainer > xContainer( m_xProps, uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xColl( new ScVbaPages( this, mxContext, getPages( xContainer->getElementNames().getLength() ) ) );
if ( !index.hasValue() )
return uno::makeAny( xColl );
return xColl->Item( uno::makeAny( index ), uno::Any() );
@@ -129,3 +130,5 @@ ScVbaMultiPage::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbamultipage.hxx b/vbahelper/source/msforms/vbamultipage.hxx
index 96821bb28c..3c24b748f9 100644
--- a/vbahelper/source/msforms/vbamultipage.hxx
+++ b/vbahelper/source/msforms/vbamultipage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include "vbacontrol.hxx"
#include <vbahelper/vbahelper.hxx>
-//#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase1.hxx>
typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XMultiPage > MultiPageImpl_BASE;
@@ -59,6 +59,8 @@ public:
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
// XDefaultProperty
- rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
};
#endif //SC_VBA_LABEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbanewfont.cxx b/vbahelper/source/msforms/vbanewfont.cxx
index eae2bb3185..f487b4e691 100755
--- a/vbahelper/source/msforms/vbanewfont.cxx
+++ b/vbahelper/source/msforms/vbanewfont.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/vbahelper/source/msforms/vbanewfont.hxx b/vbahelper/source/msforms/vbanewfont.hxx
index 48f5b8d25e..d59d5caa13 100755
--- a/vbahelper/source/msforms/vbanewfont.hxx
+++ b/vbahelper/source/msforms/vbanewfont.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/vbahelper/source/msforms/vbapages.cxx b/vbahelper/source/msforms/vbapages.cxx
index 95e2e715b4..7f6b2d5be8 100644
--- a/vbahelper/source/msforms/vbapages.cxx
+++ b/vbahelper/source/msforms/vbapages.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,3 +71,5 @@ ScVbaPages::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbapages.hxx b/vbahelper/source/msforms/vbapages.hxx
index 7914f5bd6f..f19c6120f4 100644
--- a/vbahelper/source/msforms/vbapages.hxx
+++ b/vbahelper/source/msforms/vbapages.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,3 +55,5 @@ public:
};
#endif//SC_VBA_SHAPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbaprogressbar.cxx b/vbahelper/source/msforms/vbaprogressbar.cxx
index 3ffe96d5c6..80b05467ce 100644
--- a/vbahelper/source/msforms/vbaprogressbar.cxx
+++ b/vbahelper/source/msforms/vbaprogressbar.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,3 +69,5 @@ ScVbaProgressBar::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbaprogressbar.hxx b/vbahelper/source/msforms/vbaprogressbar.hxx
index a4d4270f96..e022bd9f52 100644
--- a/vbahelper/source/msforms/vbaprogressbar.hxx
+++ b/vbahelper/source/msforms/vbaprogressbar.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,6 +47,8 @@ public:
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
// XDefaultProperty
- rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
};
#endif //SC_VBA_LABEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbaradiobutton.cxx b/vbahelper/source/msforms/vbaradiobutton.cxx
index 6484ae57e3..99d1f613ec 100644
--- a/vbahelper/source/msforms/vbaradiobutton.cxx
+++ b/vbahelper/source/msforms/vbaradiobutton.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,6 +72,9 @@ void SAL_CALL
ScVbaRadioButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
{
sal_Int16 nValue = 0;
+ sal_Int16 nOldValue = 0;
+ m_xProps->getPropertyValue( STATE ) >>= nOldValue;
+
sal_Bool bValue = sal_False;
if( _value >>= nValue )
{
@@ -83,6 +87,15 @@ ScVbaRadioButton::setValue( const uno::Any& _value ) throw (uno::RuntimeExceptio
nValue = 1;
}
m_xProps->setPropertyValue( STATE, uno::makeAny( nValue ) );
+ if ( nValue != nOldValue )
+ {
+ fireChangeEvent();
+ // In Excel, only when the radio button is checked, the click event is fired.
+ if ( nValue != 0 )
+ {
+ fireClickEvent();
+ }
+ }
}
uno::Reference< msforms::XNewFont > SAL_CALL ScVbaRadioButton::getFont() throw (uno::RuntimeException)
@@ -108,3 +121,5 @@ ScVbaRadioButton::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbaradiobutton.hxx b/vbahelper/source/msforms/vbaradiobutton.hxx
index 36c1966ff3..48d1040b75 100644
--- a/vbahelper/source/msforms/vbaradiobutton.hxx
+++ b/vbahelper/source/msforms/vbaradiobutton.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,9 @@ public:
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
// XDefaultProperty
- rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
};
#endif //SC_VBA_RADIOBUTTON_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbascrollbar.cxx b/vbahelper/source/msforms/vbascrollbar.cxx
index 1c37e61bb9..0cf4e6c963 100644
--- a/vbahelper/source/msforms/vbascrollbar.cxx
+++ b/vbahelper/source/msforms/vbascrollbar.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -129,3 +130,5 @@ ScVbaScrollBar::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbascrollbar.hxx b/vbahelper/source/msforms/vbascrollbar.hxx
index 8543fe081b..de36b51398 100644
--- a/vbahelper/source/msforms/vbascrollbar.hxx
+++ b/vbahelper/source/msforms/vbascrollbar.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif //SC_VBA_LABEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbaspinbutton.cxx b/vbahelper/source/msforms/vbaspinbutton.cxx
index fbb7961aaf..42f025a45f 100644
--- a/vbahelper/source/msforms/vbaspinbutton.cxx
+++ b/vbahelper/source/msforms/vbaspinbutton.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,3 +100,5 @@ ScVbaSpinButton::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbaspinbutton.hxx b/vbahelper/source/msforms/vbaspinbutton.hxx
index cd6aaf7ce2..66d2b906ef 100644
--- a/vbahelper/source/msforms/vbaspinbutton.hxx
+++ b/vbahelper/source/msforms/vbaspinbutton.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif //SC_VBA_SPINBUTTON_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbasystemaxcontrol.cxx b/vbahelper/source/msforms/vbasystemaxcontrol.cxx
index 227338d7f6..171986ac6c 100755..100644
--- a/vbahelper/source/msforms/vbasystemaxcontrol.cxx
+++ b/vbahelper/source/msforms/vbasystemaxcontrol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,3 +100,4 @@ VbaSystemAXControl::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbasystemaxcontrol.hxx b/vbahelper/source/msforms/vbasystemaxcontrol.hxx
index 5bc23f44b2..45bcb3a630 100755..100644
--- a/vbahelper/source/msforms/vbasystemaxcontrol.hxx
+++ b/vbahelper/source/msforms/vbasystemaxcontrol.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbatextbox.cxx b/vbahelper/source/msforms/vbatextbox.cxx
index b3b6d8cf62..6fa93fcbae 100644
--- a/vbahelper/source/msforms/vbatextbox.cxx
+++ b/vbahelper/source/msforms/vbatextbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,13 +69,20 @@ ScVbaTextBox::getText() throw (css::uno::RuntimeException)
void SAL_CALL
ScVbaTextBox::setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException)
{
+ rtl::OUString sOldText = getText();
+
if ( !mbDialog )
{
- uno::Reference< text::XTextRange > xTextRange( m_xProps, uno::UNO_QUERY_THROW );
- xTextRange->setString( _text );
-}
+ uno::Reference< text::XTextRange > xTextRange( m_xProps, uno::UNO_QUERY_THROW );
+ xTextRange->setString( _text );
+ }
else
m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), uno::makeAny( _text ) );
+
+ if ( _text != sOldText )
+ {
+ fireChangeEvent();
+ }
}
sal_Int32 SAL_CALL
@@ -91,7 +99,8 @@ ScVbaTextBox::getMaxLength() throw (css::uno::RuntimeException)
void SAL_CALL
ScVbaTextBox::setMaxLength( sal_Int32 _maxlength ) throw (css::uno::RuntimeException)
{
- uno::Any aValue( _maxlength );
+ sal_Int16 _maxlength16 = static_cast<sal_Int16> (_maxlength);
+ uno::Any aValue( _maxlength16 );
m_xProps->setPropertyValue
(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) ), aValue);
}
@@ -161,3 +170,5 @@ ScVbaTextBox::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbatextbox.hxx b/vbahelper/source/msforms/vbatextbox.hxx
index 6e02e8a074..dea33bb3af 100644
--- a/vbahelper/source/msforms/vbatextbox.hxx
+++ b/vbahelper/source/msforms/vbatextbox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,9 +55,11 @@ public:
virtual sal_Int32 SAL_CALL getTextLength() throw (css::uno::RuntimeException);
virtual css::uno::Reference< ov::msforms::XNewFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
// XDefaultProperty
- rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
//XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif //SC_VBA_TEXTBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbatogglebutton.cxx b/vbahelper/source/msforms/vbatogglebutton.cxx
index f85e61cee9..28b4d511d9 100644
--- a/vbahelper/source/msforms/vbatogglebutton.cxx
+++ b/vbahelper/source/msforms/vbatogglebutton.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,14 +70,30 @@ ScVbaToggleButton::getValue() throw (uno::RuntimeException)
return uno::makeAny( nState ? sal_Int16( -1 ) : sal_Int16( 0 ) );
}
+
void SAL_CALL
ScVbaToggleButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
{
sal_Int16 nState = 0;
- _value >>= nState;
+ if (_value.getValueTypeClass() == uno::TypeClass_BOOLEAN)
+ {
+ sal_Bool bValue;
+ _value >>= bValue;
+ nState = static_cast< sal_Int16 >(bValue);
+ }
+ else if (_value.getValueTypeClass() == uno::TypeClass_BYTE)
+ {
+ sal_Int8 nValue;
+ _value >>= nValue;
+ nState = ( nValue == 1) ? 1 : 0;
+ }
+ else
+ {
+ _value >>= nState;
OSL_TRACE( "nState - %d", nState );
- nState = ( nState == -1 ) ? 1 : 0;
+ nState = ( nState == -1 ) ? 1 : 0;
OSL_TRACE( "nState - %d", nState );
+ }
m_xProps->setPropertyValue( STATE, uno::makeAny( nState ) );
}
@@ -149,3 +166,4 @@ ScVbaToggleButton::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbatogglebutton.hxx b/vbahelper/source/msforms/vbatogglebutton.hxx
index 3aa490f3a9..40e480ee5b 100644
--- a/vbahelper/source/msforms/vbatogglebutton.hxx
+++ b/vbahelper/source/msforms/vbatogglebutton.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,6 +61,8 @@ public:
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
// XDefaultProperty
- rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
};
#endif //SC_VBA_TOGGLEBUTTON_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index 80120e408f..26912388ad 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -1,7 +1,8 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -28,8 +29,10 @@
#include "vbauserform.hxx"
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/beans/PropertyConcept.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
#include <basic/sbx.hxx>
#include <basic/sbstar.hxx>
@@ -42,7 +45,7 @@ using namespace ::com::sun::star;
// some little notes
// XDialog implementation has the following interesting bits
// a Controls property ( which is an array of the container controls )
-// each item in the controls array is a XControl, where the model is
+// each item in the controls array is a XControl, where the model is
// basically a property bag
// additionally the XDialog instance has itself a model
// this model has a ControlModels ( array of models ) property
@@ -61,7 +64,7 @@ ScVbaUserForm::~ScVbaUserForm()
{
}
-void SAL_CALL
+void SAL_CALL
ScVbaUserForm::Show( ) throw (uno::RuntimeException)
{
OSL_TRACE("ScVbaUserForm::Show( )");
@@ -80,7 +83,7 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException)
uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
uno::Reference< awt::XWindow > xControlWindow( xControl->getPeer(), uno::UNO_QUERY_THROW );
- xControlWindow->setPosSize( (aPosSize.Width - getWidth()) / 2.0, (aPosSize.Height - getHeight()) / 2.0, 0, 0, awt::PosSize::POS );
+ xControlWindow->setPosSize(static_cast<sal_Int32>((aPosSize.Width - getWidth()) / 2.0), static_cast<sal_Int32>((aPosSize.Height - getHeight()) / 2.0), 0, 0, awt::PosSize::POS );
}
catch( uno::Exception& )
{
@@ -96,7 +99,7 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException)
uno::Reference< lang::XComponent > xComp( m_xDialog, uno::UNO_QUERY_THROW );
m_xDialog = NULL;
xComp->dispose();
- mbDispose = false;
+ mbDispose = false;
}
catch( uno::Exception& )
{
@@ -104,7 +107,7 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException)
}
}
-rtl::OUString SAL_CALL
+rtl::OUString SAL_CALL
ScVbaUserForm::getCaption() throw (uno::RuntimeException)
{
rtl::OUString sCaption;
@@ -145,13 +148,31 @@ ScVbaUserForm::Hide( ) throw (uno::RuntimeException)
m_xDialog->endExecute();
}
-void SAL_CALL
+sal_Bool SAL_CALL ScVbaUserForm::getVisible() throw (uno::RuntimeException)
+{
+ uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW );
+ return xWindow2->isVisible();
+}
+
+void SAL_CALL ScVbaUserForm::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
+{
+ if ( bVisible )
+ {
+ Show();
+ }
+ else
+ {
+ Hide();
+ }
+}
+
+void SAL_CALL
ScVbaUserForm::RePaint( ) throw (uno::RuntimeException)
{
// do nothing
}
-void SAL_CALL
+void SAL_CALL
ScVbaUserForm::UnloadObject( ) throw (uno::RuntimeException)
{
mbDispose = true;
@@ -159,14 +180,14 @@ ScVbaUserForm::UnloadObject( ) throw (uno::RuntimeException)
m_xDialog->endExecute();
}
-rtl::OUString&
+rtl::OUString&
ScVbaUserForm::getServiceImplName()
{
static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaUserForm") );
return sImplName;
}
-uno::Sequence< rtl::OUString >
+uno::Sequence< rtl::OUString >
ScVbaUserForm::getServiceNames()
{
static uno::Sequence< rtl::OUString > aServiceNames;
@@ -178,19 +199,19 @@ ScVbaUserForm::getServiceNames()
return aServiceNames;
}
-uno::Reference< beans::XIntrospectionAccess > SAL_CALL
+uno::Reference< beans::XIntrospectionAccess > SAL_CALL
ScVbaUserForm::getIntrospection( ) throw (uno::RuntimeException)
{
return uno::Reference< beans::XIntrospectionAccess >();
}
-uno::Any SAL_CALL
+uno::Any SAL_CALL
ScVbaUserForm::invoke( const ::rtl::OUString& /*aFunctionName*/, const uno::Sequence< uno::Any >& /*aParams*/, uno::Sequence< ::sal_Int16 >& /*aOutParamIndex*/, uno::Sequence< uno::Any >& /*aOutParam*/ ) throw (lang::IllegalArgumentException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
{
throw uno::RuntimeException(); // unsupported operation
}
-void SAL_CALL
+void SAL_CALL
ScVbaUserForm::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
{
uno::Any aObject = getValue( aPropertyName );
@@ -210,7 +231,31 @@ ScVbaUserForm::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& a
}
}
-uno::Any SAL_CALL
+uno::Reference< awt::XControl >
+ScVbaUserForm::nestedSearch( const rtl::OUString& aPropertyName, uno::Reference< awt::XControlContainer >& xContainer )
+{
+ uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
+ if ( !xControl.is() )
+ {
+ uno::Sequence< uno::Reference< awt::XControl > > aControls = xContainer->getControls();
+ const uno::Reference< awt::XControl >* pCtrl = aControls.getConstArray();
+ const uno::Reference< awt::XControl >* pCtrlsEnd = pCtrl + aControls.getLength();
+
+ for ( ; pCtrl < pCtrlsEnd; ++pCtrl )
+ {
+ uno::Reference< awt::XControlContainer > xC( *pCtrl, uno::UNO_QUERY );
+ if ( xC.is() )
+ {
+ xControl.set( nestedSearch( aPropertyName, xC ) );
+ if ( xControl.is() )
+ break;
+ }
+ }
+ }
+ return xControl;
+}
+
+uno::Any SAL_CALL
ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
{
uno::Any aResult;
@@ -220,20 +265,27 @@ ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::Un
{
uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW );
- uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
+ uno::Reference< awt::XControl > xControl = nestedSearch( aPropertyName, xContainer );
+ xContainer->getControl( aPropertyName );
if ( xControl.is() )
- aResult <<= ScVbaControlFactory::createUserformControl( mxContext, xControl, xDialogControl, m_xModel, mpGeometryHelper->getOffsetX(), mpGeometryHelper->getOffsetY() );
+ {
+ uno::Reference< msforms::XControl > xVBAControl = ScVbaControlFactory::createUserformControl( mxContext, xControl, xDialogControl, m_xModel, mpGeometryHelper->getOffsetX(), mpGeometryHelper->getOffsetY() );
+ ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
+ if ( m_sLibName.getLength() )
+ pControl->setLibraryAndCodeName( m_sLibName.concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ).concat( getName() ) );
+ aResult = uno::makeAny( xVBAControl );
+ }
}
return aResult;
}
-::sal_Bool SAL_CALL
+::sal_Bool SAL_CALL
ScVbaUserForm::hasMethod( const ::rtl::OUString& /*aName*/ ) throw (uno::RuntimeException)
{
return sal_False;
}
-uno::Any SAL_CALL
+uno::Any SAL_CALL
ScVbaUserForm::Controls( const uno::Any& index ) throw (uno::RuntimeException)
{
// if the dialog already closed we should do nothing, but the VBA will call methods of the Controls objects
@@ -245,17 +297,22 @@ ScVbaUserForm::Controls( const uno::Any& index ) throw (uno::RuntimeException)
return uno::makeAny( xControls );
}
-::sal_Bool SAL_CALL
+::sal_Bool SAL_CALL
ScVbaUserForm::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
{
uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY );
+
OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is() );
if ( xControl.is() )
{
- uno::Reference< container::XNameAccess > xNameAccess( xControl->getModel(), uno::UNO_QUERY_THROW );
- sal_Bool bRes = xNameAccess->hasByName( aName );
- OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d ---> %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is(), bRes );
- return bRes;
+ uno::Reference< beans::XPropertySet > xDlgProps( xControl->getModel(), uno::UNO_QUERY );
+ if ( xDlgProps.is() )
+ {
+ uno::Reference< container::XNameContainer > xAllChildren( xDlgProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllDialogChildren")) ), uno::UNO_QUERY_THROW );
+ sal_Bool bRes = xAllChildren->hasByName( aName );
+ OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d ---> %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xAllChildren.is(), bRes );
+ return bRes;
+ }
}
return sal_False;
}
@@ -270,3 +327,4 @@ extern sdecl::ServiceDecl const serviceDecl(
"ooo.vba.msforms.UserForm" );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbauserform.hxx b/vbahelper/source/msforms/vbauserform.hxx
index 36f7ba44a6..c62fcf2fb8 100644
--- a/vbahelper/source/msforms/vbauserform.hxx
+++ b/vbahelper/source/msforms/vbauserform.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,7 @@
#include <cppuhelper/implbase1.hxx>
#include <ooo/vba/msforms/XUserForm.hpp>
#include <com/sun/star/awt/XDialog.hpp>
+#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <vbahelper/vbahelperinterface.hxx>
@@ -43,10 +45,14 @@ class ScVbaUserForm : public ScVbaUserForm_BASE
private:
css::uno::Reference< css::awt::XDialog > m_xDialog;
bool mbDispose;
+ rtl::OUString m_sLibName;
protected:
public:
ScVbaUserForm( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException );
virtual ~ScVbaUserForm();
+ static css::uno::Reference< css::awt::XControl > nestedSearch( const rtl::OUString& aPropertyName, css::uno::Reference< css::awt::XControlContainer >& xContainer );
+ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
// XUserForm
virtual void SAL_CALL RePaint( ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Show( ) throw (css::uno::RuntimeException);
@@ -71,3 +77,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/makefile.mk b/vbahelper/source/vbahelper/makefile.mk
new file mode 100755
index 0000000000..31fefa8430
--- /dev/null
+++ b/vbahelper/source/vbahelper/makefile.mk
@@ -0,0 +1,77 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/../
+PRJNAME=vbahelper
+TARGET=vbahelperbits
+
+ENABLE_EXCEPTIONS := TRUE
+VISIBILITY_HIDDEN=TRUE
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+SLOFILES=\
+ $(SLO)$/vbahelper.obj \
+ $(SLO)$/vbapropvalue.obj \
+ $(SLO)$/vbacommandbars.obj \
+ $(SLO)$/vbacommandbar.obj \
+ $(SLO)$/vbacommandbarcontrols.obj \
+ $(SLO)$/vbacommandbarcontrol.obj \
+ $(SLO)$/vbacommandbarhelper.obj \
+ $(SLO)$/vbaapplicationbase.obj \
+ $(SLO)$/vbawindowbase.obj \
+ $(SLO)$/vbadocumentbase.obj \
+ $(SLO)$/vbadocumentsbase.obj \
+ $(SLO)$/vbaglobalbase.obj \
+ $(SLO)$/vbafontbase.obj \
+ $(SLO)$/vbadialogbase.obj \
+ $(SLO)$/vbadialogsbase.obj \
+ $(SLO)$/vbashape.obj \
+ $(SLO)$/vbacolorformat.obj \
+ $(SLO)$/vbashapes.obj \
+ $(SLO)$/vbalineformat.obj \
+ $(SLO)$/vbafillformat.obj \
+ $(SLO)$/vbapictureformat.obj \
+ $(SLO)$/vbashaperange.obj \
+ $(SLO)$/vbatextframe.obj \
+ $(SLO)$/vbapagesetupbase.obj \
+ $(SLO)$/vbaeventshelperbase.obj
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+ALLTAR : \
+ $(MISC)$/$(TARGET).don \
+
+$(SLOFILES) : $(MISC)$/$(TARGET).don
+
+$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+ +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
+ echo $@
+
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index a3b2d84d0c..ae6b73e6f8 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,6 +27,7 @@
************************************************************************/
#include "vbahelper/vbaapplicationbase.hxx"
+#include <sal/macros.h>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -41,7 +43,7 @@
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <filter/msfilter/msvbahelper.hxx>
#include <tools/datetime.hxx>
@@ -88,7 +90,7 @@ public:
Time aTimeNow;
Date aRefDate( 1,1,1900 );
long nDiffDays = (long)(aDateNow - aRefDate);
- nDiffDays += 2; // Anpassung VisualBasic: 1.Jan.1900 == 2
+ nDiffDays += 2; // Change VisualBasic: 1.Jan.1900 == 2
long nDiffSeconds = aTimeNow.GetHour() * 3600 + aTimeNow.GetMin() * 60 + aTimeNow.GetSec();
return (double)nDiffDays + ((double)nDiffSeconds)/(double)(24*3600);
@@ -155,7 +157,7 @@ struct VbaTimerInfoHash
};
// ====VbaTimerHashMap==================================
-typedef ::std::hash_map< VbaTimerInfo, VbaTimer*, VbaTimerInfoHash, ::std::equal_to< VbaTimerInfo > > VbaTimerHashMap;
+typedef ::boost::unordered_map< VbaTimerInfo, VbaTimer*, VbaTimerInfoHash, ::std::equal_to< VbaTimerInfo > > VbaTimerHashMap;
// ====VbaApplicationBase_Impl==================================
struct VbaApplicationBase_Impl
@@ -290,8 +292,10 @@ VbaApplicationBase::getVersion() throw (uno::RuntimeException)
return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(OFFICEVERSION));
}
-void SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const uno::Any& varg1, const uno::Any& varg2, const uno::Any& varg3, const uno::Any& varg4, const uno::Any& varg5, const uno::Any& varg6, const uno::Any& varg7, const uno::Any& varg8, const uno::Any& varg9, const uno::Any& varg10, const uno::Any& varg11, const uno::Any& varg12, const uno::Any& varg13, const uno::Any& varg14, const uno::Any& varg15, const uno::Any& varg16, const uno::Any& varg17, const uno::Any& varg18, const uno::Any& varg19, const uno::Any& varg20, const uno::Any& varg21, const uno::Any& varg22, const uno::Any& varg23, const uno::Any& varg24, const uno::Any& varg25, const uno::Any& varg26, const uno::Any& varg27, const uno::Any& varg28, const uno::Any& varg29, const uno::Any& varg30 ) throw (uno::RuntimeException)
+uno::Any SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const uno::Any& varg1, const uno::Any& varg2, const uno::Any& varg3, const uno::Any& varg4, const uno::Any& varg5, const uno::Any& varg6, const uno::Any& varg7, const uno::Any& varg8, const uno::Any& varg9, const uno::Any& varg10, const uno::Any& varg11, const uno::Any& varg12, const uno::Any& varg13, const uno::Any& varg14, const uno::Any& varg15, const uno::Any& varg16, const uno::Any& varg17, const uno::Any& varg18, const uno::Any& varg19, const uno::Any& varg20, const uno::Any& varg21, const uno::Any& varg22, const uno::Any& varg23, const uno::Any& varg24, const uno::Any& varg25, const uno::Any& varg26, const uno::Any& varg27, const uno::Any& varg28, const uno::Any& varg29, const uno::Any& varg30 ) throw (uno::RuntimeException)
{
+ ::rtl::OUString sSeparator(RTL_CONSTASCII_USTRINGPARAM("/"));
+ ::rtl::OUString sMacroSeparator(RTL_CONSTASCII_USTRINGPARAM("!"));
::rtl::OUString aMacroName = MacroName.trim();
if (0 == aMacroName.indexOf('!'))
aMacroName = aMacroName.copy(1).trim();
@@ -314,21 +318,16 @@ void SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const u
// handle the arguments
const uno::Any* aArgsPtrArray[] = { &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13, &varg14, &varg15, &varg16, &varg17, &varg18, &varg19, &varg20, &varg21, &varg22, &varg23, &varg24, &varg25, &varg26, &varg27, &varg28, &varg29, &varg30 };
- int nArg = sizeof( aArgsPtrArray ) / sizeof( aArgsPtrArray[0] );
+ int nArg = SAL_N_ELEMENTS( aArgsPtrArray );
uno::Sequence< uno::Any > aArgs( nArg );
const uno::Any** pArg = aArgsPtrArray;
const uno::Any** pArgEnd = ( aArgsPtrArray + nArg );
- sal_Int32 nLastArgWithValue = 0;
sal_Int32 nArgProcessed = 0;
for ( ; pArg != pArgEnd; ++pArg, ++nArgProcessed )
- {
aArgs[ nArgProcessed ] = **pArg;
- if( (*pArg)->hasValue() )
- nLastArgWithValue = nArgProcessed;
- }
// resize array to position of last param with value
aArgs.realloc( nArgProcessed + 1 );
@@ -336,6 +335,8 @@ void SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const u
uno::Any aRet;
uno::Any aDummyCaller;
executeMacro( aMacroInfo.mpDocContext, aMacroInfo.msResolvedMacro, aArgs, aRet, aDummyCaller );
+
+ return aRet;
}
else
{
@@ -443,3 +444,4 @@ void VbaApplicationBase::Quit() throw (uno::RuntimeException)
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacolorformat.cxx b/vbahelper/source/vbahelper/vbacolorformat.cxx
index 99c25b1365..0df920e0b2 100644
--- a/vbahelper/source/vbahelper/vbacolorformat.cxx
+++ b/vbahelper/source/vbahelper/vbacolorformat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,7 +57,7 @@ ScVbaColorFormat::ScVbaColorFormat( const uno::Reference< XHelperInterface >& xP
{
uno::Reference< ov::msforms::XFillFormat > xFillFormat( xInternalParent, uno::UNO_QUERY_THROW );
m_pFillFormat = ( ScVbaFillFormat* )( xFillFormat.get() );
- }catch ( uno::RuntimeException e )
+ }catch ( uno::RuntimeException& )
{
m_pFillFormat = NULL;
}
@@ -76,20 +77,20 @@ ScVbaColorFormat::getRGB() throw (uno::RuntimeException)
switch( m_nColorFormatType )
{
case ColorFormatType::LINEFORMAT_FORECOLOR:
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("LineColor") ) >>= nRGB;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineColor")) ) >>= nRGB;
break;
case ColorFormatType::LINEFORMAT_BACKCOLOR:
//TODO BackColor not supported
- // m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("Color"), uno::makeAny( nRGB ) );
+ // m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Color")), uno::makeAny( nRGB ) );
break;
case ColorFormatType::FILLFORMAT_FORECOLOR:
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("FillColor") ) >>= nRGB;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")) ) >>= nRGB;
break;
case ColorFormatType::FILLFORMAT_BACKCOLOR:
nRGB = m_nFillFormatBackColor;
break;
default:
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Second parameter of ColorFormat is wrong.")), uno::Reference< uno::XInterface >() );
}
nRGB = OORGBToXLRGB( nRGB );
return nRGB;
@@ -102,13 +103,13 @@ ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException)
switch( m_nColorFormatType )
{
case ColorFormatType::LINEFORMAT_FORECOLOR:
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineColor" ), uno::makeAny( nRGB ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineColor")), uno::makeAny( nRGB ) );
break;
case ColorFormatType::LINEFORMAT_BACKCOLOR:
// TODO BackColor not supported
break;
case ColorFormatType::FILLFORMAT_FORECOLOR:
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillColor" ), uno::makeAny( nRGB ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")), uno::makeAny( nRGB ) );
if( m_pFillFormat )
{
m_pFillFormat->setForeColorAndInternalStyle(nRGB);
@@ -122,7 +123,7 @@ ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException)
}
break;
default:
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Second parameter of ColorFormat is wrong.")), uno::Reference< uno::XInterface >() );
}
}
@@ -185,3 +186,4 @@ ScVbaColorFormat::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacolorformat.hxx b/vbahelper/source/vbahelper/vbacolorformat.hxx
index d7771dd73a..e29ea90cb9 100644
--- a/vbahelper/source/vbahelper/vbacolorformat.hxx
+++ b/vbahelper/source/vbahelper/vbacolorformat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -123,3 +124,5 @@ public:
};
#endif//SC_VBA_XCOLORFORMAT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacommandbar.cxx b/vbahelper/source/vbahelper/vbacommandbar.cxx
index 28068f61b9..cf71425190 100644
--- a/vbahelper/source/vbahelper/vbacommandbar.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbar.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException )
{
// This will get a "NULL length string" when Name is not set.
uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
- uno::Any aName = xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("UIName") );
+ uno::Any aName = xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIName")) );
rtl::OUString sName;
aName >>= sName;
if( sName.getLength() < 1 )
@@ -55,9 +56,9 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException )
{
if( m_sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) )
{
- if( pCBarHelper->getModuleId().equalsAscii("com.sun.star.sheet.SpreadsheetDocument") )
+ if( pCBarHelper->getModuleId().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.sheet.SpreadsheetDocument")) )
sName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Worksheet Menu Bar") );
- else if( pCBarHelper->getModuleId().equalsAscii("com.sun.star.text.TextDocument") )
+ else if( pCBarHelper->getModuleId().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument")) )
sName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Menu Bar") );
return sName;
}
@@ -77,7 +78,7 @@ void SAL_CALL
ScVbaCommandBar::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
- xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("UIName"), uno::makeAny( _name ) );
+ xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIName")), uno::makeAny( _name ) );
pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
}
@@ -121,7 +122,7 @@ ScVbaCommandBar::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException)
xLayoutManager->destroyElement( m_sResourceUrl );
}
}
- catch( uno::Exception e )
+ catch( uno::Exception& )
{
OSL_TRACE( "SetVisible get an exception\n" );
}
@@ -277,3 +278,5 @@ uno::Sequence< rtl::OUString > VbaDummyCommandBar::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacommandbar.hxx b/vbahelper/source/vbahelper/vbacommandbar.hxx
index 30599517b7..a8fd71a164 100644
--- a/vbahelper/source/vbahelper/vbacommandbar.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbar.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,7 @@ private:
public:
ScVbaCommandBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Bool bIsMenu, sal_Bool bTemporary = sal_True ) throw( css::uno::RuntimeException );
- sal_Bool IsMenu() { return m_bIsMenu; }
+ sal_Bool IsMenu() const { return m_bIsMenu; }
// Attributes
virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
@@ -107,3 +108,5 @@ private:
};
#endif//SC_VBA_COMMANDBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
index 7b9eb58bb6..728723296e 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,7 +54,7 @@ ScVbaCommandBarControl::getCaption() throw ( uno::RuntimeException )
{
// "Label" always empty
rtl::OUString sCaption;
- getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("Label") ) >>= sCaption;
+ getPropertyValue( m_aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ) >>= sCaption;
return sCaption;
}
@@ -61,7 +62,7 @@ void SAL_CALL
ScVbaCommandBarControl::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException)
{
rtl::OUString sCaption = _caption.replace('&','~');
- setPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("Label"), uno::makeAny( sCaption ) );
+ setPropertyValue( m_aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")), uno::makeAny( sCaption ) );
ApplyChange();
}
@@ -69,7 +70,7 @@ ScVbaCommandBarControl::setCaption( const ::rtl::OUString& _caption ) throw (uno
ScVbaCommandBarControl::getOnAction() throw (uno::RuntimeException)
{
rtl::OUString sCommandURL;
- getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("CommandURL") ) >>= sCommandURL;
+ getPropertyValue( m_aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CommandURL")) ) >>= sCommandURL;
return sCommandURL;
}
@@ -83,7 +84,7 @@ ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (u
{
rtl::OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.msResolvedMacro );
OSL_TRACE(" ScVbaCommandBarControl::setOnAction: %s", rtl::OUStringToOString( aCommandURL, RTL_TEXTENCODING_UTF8 ).getStr() );
- setPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("CommandURL"), uno::makeAny( aCommandURL ) );
+ setPropertyValue( m_aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CommandURL")), uno::makeAny( aCommandURL ) );
ApplyChange();
}
}
@@ -175,7 +176,7 @@ ScVbaCommandBarControl::Controls( const uno::Any& aIndex ) throw (script::BasicE
{
// only Popup Menu has controls
uno::Reference< container::XIndexAccess > xSubMenu;
- getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_CONTAINER ) ) >>= xSubMenu;
+ getPropertyValue( m_aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER )) ) >>= xSubMenu;
if( !xSubMenu.is() )
throw uno::RuntimeException();
@@ -257,3 +258,5 @@ ScVbaCommandBarButton::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
index bbcd0642e8..aaec78e0b6 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113,3 +114,5 @@ public:
};
#endif//SC_VBA_COMMANDBARCONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 130fdec258..d646ce1202 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,15 +71,15 @@ uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemDat
{
uno::Sequence< beans::PropertyValue > aProps(7);
- aProps[0].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_COMMANDURL );
+ aProps[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ));
aProps[0].Value <<= sCommandURL;
- aProps[1].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_HELPURL );
+ aProps[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ));
aProps[1].Value <<= sHelpURL;
- aProps[2].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_LABEL );
+ aProps[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ));
aProps[2].Value <<= sLabel;
- aProps[3].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_TYPE );
+ aProps[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ));
aProps[3].Value <<= nType;
- aProps[4].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_CONTAINER );
+ aProps[4].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ));
aProps[4].Value = aSubMenu;
aProps[5].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ISVISIBLE );
aProps[5].Value <<= isVisible;
@@ -92,19 +93,19 @@ uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateToolbarItem
{
uno::Sequence< beans::PropertyValue > aProps(7);
- aProps[0].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_COMMANDURL );
+ aProps[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ));
aProps[0].Value <<= sCommandURL;
- aProps[1].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_HELPURL );
+ aProps[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ));
aProps[1].Value <<= sHelpURL;
- aProps[2].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_LABEL );
+ aProps[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ));
aProps[2].Value <<= sLabel;
- aProps[3].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_TYPE );
+ aProps[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ));
aProps[3].Value <<= nType;
- aProps[4].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_CONTAINER );
+ aProps[4].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ));
aProps[4].Value = aSubMenu;
- aProps[5].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ISVISIBLE );
+ aProps[5].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_ISVISIBLE ));
aProps[5].Value <<= isVisible;
- aProps[6].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_STYLE );
+ aProps[6].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_STYLE ));
aProps[6].Value <<= nStyle;
return aProps;
@@ -131,7 +132,7 @@ ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource )
uno::Sequence< beans::PropertyValue > aProps;
m_xIndexAccess->getByIndex( nPosition ) >>= aProps;
uno::Reference< container::XIndexAccess > xSubMenu;
- getPropertyValue( aProps, rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_CONTAINER ) ) >>= xSubMenu;
+ getPropertyValue( aProps, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER )) ) >>= xSubMenu;
ScVbaCommandBarControl* pNewCommandBarControl = NULL;
if( xSubMenu.is() )
pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, sal_True );
@@ -170,8 +171,8 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
{
// Parameter is not supported
// the following name needs to be individually created;
- rtl::OUString sLabel( rtl::OUString::createFromAscii("Custom") );
- rtl::OUString sCommandUrl = rtl::OUString::createFromAscii( CUSTOM_MENU_STR ) + sLabel;
+ rtl::OUString sLabel(RTL_CONSTASCII_USTRINGPARAM("Custom"));
+ rtl::OUString sCommandUrl(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CUSTOM_MENU_STR)) + sLabel);
sal_Int32 nType = office::MsoControlType::msoControlButton;
sal_Int32 nPosition = 0;
sal_Bool bTemporary = sal_True;
@@ -327,3 +328,5 @@ uno::Sequence<rtl::OUString> VbaDummyCommandBarControls::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
index 1e63d47603..7c6cff9494 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,3 +91,5 @@ public:
};
#endif//SC_VBA_COMMANDBARCONTROLS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index 9b73bb6f59..a78ed0cc37 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,7 @@
using namespace com::sun::star;
using namespace ooo::vba;
-#define CREATEOUSTRING(asciistr) rtl::OUString::createFromAscii(asciistr)
+#define CREATEOUSTRING(asciistr) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(asciistr))
typedef std::map< rtl::OUString, rtl::OUString > MSO2OOCommandbarMap;
@@ -80,7 +81,7 @@ public:
rtl::OUString findBuildinToolbar( const rtl::OUString& sToolbarName )
{
MSO2OOCommandbarMap::iterator it = maBuildinToolbarMap.begin();
- for(; it != maBuildinToolbarMap.end(); it++ )
+ for(; it != maBuildinToolbarMap.end(); ++it )
{
rtl::OUString sName = it->first;
if( sName.equalsIgnoreAsciiCase( sToolbarName ) )
@@ -184,7 +185,7 @@ uno::Reference< frame::XLayoutManager > VbaCommandBarHelper::getLayoutManager()
{
uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xPropertySet( xFrame, uno::UNO_QUERY_THROW );
- uno::Reference< frame::XLayoutManager > xLayoutManager( xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("LayoutManager") ), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XLayoutManager > xLayoutManager( xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ), uno::UNO_QUERY_THROW );
return xLayoutManager;
}
@@ -194,7 +195,7 @@ sal_Bool VbaCommandBarHelper::hasToolbar( const rtl::OUString& sResourceUrl, con
{
rtl::OUString sUIName;
uno::Reference< beans::XPropertySet > xPropertySet( m_xDocCfgMgr->getSettings( sResourceUrl, sal_False ), uno::UNO_QUERY_THROW );
- xPropertySet->getPropertyValue( rtl::OUString::createFromAscii(ITEM_DESCRIPTOR_UINAME) ) >>= sUIName;
+ xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ITEM_DESCRIPTOR_UINAME)) ) >>= sUIName;
if( sName.equalsIgnoreAsciiCase( sUIName ) )
return sal_True;
}
@@ -215,7 +216,7 @@ rtl::OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference<
for( sal_Int32 i = 0; i < allNames.getLength(); i++ )
{
sResourceUrl = allNames[i];
- if(sResourceUrl.indexOf( rtl::OUString::createFromAscii( ITEM_TOOLBAR_URL ) ) == 0 )
+ if(sResourceUrl.indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_TOOLBAR_URL )) ) == 0 )
{
if( hasToolbar( sResourceUrl, sName ) )
return sResourceUrl;
@@ -240,7 +241,7 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css
{
rtl::OUString sLabel;
xIndexAccess->getByIndex( i ) >>= aProps;
- getPropertyValue( aProps, rtl::OUString::createFromAscii(ITEM_DESCRIPTOR_LABEL) ) >>= sLabel;
+ getPropertyValue( aProps, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ITEM_DESCRIPTOR_LABEL)) ) >>= sLabel;
// handle the hotkey marker '~' (remove in toolbars (?), replace by '&' in menus)
::rtl::OUStringBuffer aBuffer;
sal_Int32 index = sLabel.indexOf( sal_Unicode('~') );
@@ -267,11 +268,13 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css
rtl::OUString VbaCommandBarHelper::generateCustomURL()
{
- rtl::OUString url = rtl::OUString::createFromAscii( ITEM_TOOLBAR_URL );
- url += rtl::OUString::createFromAscii( CUSTOM_TOOLBAR_STR );
+ rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM( ITEM_TOOLBAR_URL ));
+ url += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CUSTOM_TOOLBAR_STR ));
// use a random number to minimize possible clash with existing custom toolbars
srand( unsigned( time( NULL ) ));
url += rtl::OUString::valueOf( sal_Int64( rand() ), 16 );
return url;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
index 9977dc678c..8f1726af2d 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,17 +74,17 @@ private:
public:
VbaCommandBarHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ) throw( css::uno::RuntimeException );
- css::uno::Reference< css::frame::XModel > getModel() { return mxModel; }
+ css::uno::Reference< css::frame::XModel > getModel() const { return mxModel; }
- css::uno::Reference< css::ui::XUIConfigurationManager > getDocCfgManager() throw (css::uno::RuntimeException)
+ css::uno::Reference< css::ui::XUIConfigurationManager > getDocCfgManager() const throw (css::uno::RuntimeException)
{
return m_xDocCfgMgr;
}
- css::uno::Reference< css::ui::XUIConfigurationManager > getAppCfgManager() throw (css::uno::RuntimeException)
+ css::uno::Reference< css::ui::XUIConfigurationManager > getAppCfgManager() const throw (css::uno::RuntimeException)
{
return m_xAppCfgMgr;
}
- css::uno::Reference< css::container::XNameAccess > getPersistentWindowState() throw (css::uno::RuntimeException)
+ css::uno::Reference< css::container::XNameAccess > getPersistentWindowState() const throw (css::uno::RuntimeException)
{
return m_xWindowState;
}
@@ -94,10 +95,12 @@ public:
css::uno::Reference< css::frame::XLayoutManager > getLayoutManager() throw (css::uno::RuntimeException);
- const rtl::OUString getModuleId(){ return maModuleId; }
+ const rtl::OUString getModuleId() const { return maModuleId; }
rtl::OUString findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException);
static sal_Int32 findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const rtl::OUString& sName, bool bMenu = false ) throw (css::uno::RuntimeException);
static rtl::OUString generateCustomURL();
};
#endif //VBA_COMMANDBARHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacommandbars.cxx b/vbahelper/source/vbahelper/vbacommandbars.cxx
index db077be164..cc1cbb2284 100644
--- a/vbahelper/source/vbahelper/vbacommandbars.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbars.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,7 +68,7 @@ public:
if( hasMoreElements() )
{
rtl::OUString sResourceUrl( m_sNames[ m_nCurrentPosition++ ] );
- if( sResourceUrl.indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 )
+ if( sResourceUrl.indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/")) ) != -1 )
{
uno::Reference< container::XIndexAccess > xCBarSetting = m_pCBarHelper->getSettings( sResourceUrl );
uno::Reference< XCommandBar > xCommandBar( new ScVbaCommandBar( m_xParent, m_xContext, m_pCBarHelper, xCBarSetting, sResourceUrl, sal_False, sal_False ) );
@@ -122,7 +123,7 @@ ScVbaCommandBars::createCollectionObject( const uno::Any& aSource )
if( sBarName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("Worksheet Menu Bar") ) )
{
// spreadsheet menu bar
- sResourceUrl = rtl::OUString::createFromAscii( ITEM_MENUBAR_URL );
+ sResourceUrl = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_MENUBAR_URL ));
bMenu = sal_True;
}
else if( sBarName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("Cell") ) )
@@ -136,7 +137,7 @@ ScVbaCommandBars::createCollectionObject( const uno::Any& aSource )
if( sBarName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("Menu Bar") ) )
{
// text processor menu bar
- sResourceUrl = rtl::OUString::createFromAscii( ITEM_MENUBAR_URL );
+ sResourceUrl = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_MENUBAR_URL ));
bMenu = sal_True;
}
}
@@ -202,7 +203,7 @@ ScVbaCommandBars::getCount() throw(css::uno::RuntimeException)
uno::Sequence< ::rtl::OUString > allNames = m_xNameAccess->getElementNames();
for( sal_Int32 i = 0; i < allNames.getLength(); i++ )
{
- if(allNames[i].indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 )
+ if(allNames[i].indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/")) ) != -1 )
{
nCount++;
}
@@ -225,10 +226,10 @@ ScVbaCommandBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) th
if( nIndex == 1 )
{
uno::Any aSource;
- if( m_pCBarHelper->getModuleId().equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" ) )
- aSource <<= rtl::OUString::createFromAscii( "Worksheet Menu Bar" );
- else if( m_pCBarHelper->getModuleId().equalsAscii("com.sun.star.text.TextDocument") )
- aSource <<= rtl::OUString::createFromAscii( "Menu Bar" );
+ if( m_pCBarHelper->getModuleId().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ) ) )
+ aSource <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Worksheet Menu Bar"));
+ else if( m_pCBarHelper->getModuleId().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument")) )
+ aSource <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Menu Bar"));
if( aSource.hasValue() )
return createCollectionObject( aSource );
}
@@ -254,3 +255,4 @@ ScVbaCommandBars::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbacommandbars.hxx b/vbahelper/source/vbahelper/vbacommandbars.hxx
index 5709fd354e..27af1dbd10 100644
--- a/vbahelper/source/vbahelper/vbacommandbars.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbars.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,5 @@ public:
};
#endif//SC_VBA_COMMANDBARS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbadialogbase.cxx b/vbahelper/source/vbahelper/vbadialogbase.cxx
index ec7ecae9f4..302a565cf4 100644
--- a/vbahelper/source/vbahelper/vbadialogbase.cxx
+++ b/vbahelper/source/vbahelper/vbadialogbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,11 +31,10 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-// fails silently
-void
-VbaDialogBase::Show() throw(uno::RuntimeException)
+sal_Bool SAL_CALL VbaDialogBase::Show() throw ( uno::RuntimeException )
{
rtl::OUString aURL;
+ sal_Bool bSuccess = sal_False;
if ( m_xModel.is() )
{
aURL = mapIndexToName( mnIndex );
@@ -42,7 +42,27 @@ VbaDialogBase::Show() throw(uno::RuntimeException)
throw uno::RuntimeException(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " Unable to open the specified dialog " ) ),
uno::Reference< XInterface > () );
- dispatchRequests( m_xModel, aURL );
- }
-}
+ uno::Sequence< beans::PropertyValue > dispatchProps(0);
+ if ( aURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:PrinterSetup")) )
+ {
+ dispatchProps.realloc(1);
+ dispatchProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBADialogResultRequest" ) );
+ dispatchProps[0].Value <<= (sal_Bool) sal_True;
+ }
+
+ VBADispatchListener *pNotificationListener = new VBADispatchListener();
+ uno::Reference< frame::XDispatchResultListener > rListener = pNotificationListener;
+ dispatchRequests( m_xModel, aURL, dispatchProps, rListener, sal_False );
+
+ bSuccess = pNotificationListener->getState();
+ uno::Any aResult = pNotificationListener->getResult();
+ if ( bSuccess )
+ {
+ if ( aResult.getValueTypeClass() == uno::TypeClass_BOOLEAN )
+ aResult >>= bSuccess;
+ }
+ }
+ return bSuccess;
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbadialogsbase.cxx b/vbahelper/source/vbahelper/vbadialogsbase.cxx
index f595d9e991..e60d3f5be5 100644
--- a/vbahelper/source/vbahelper/vbadialogsbase.cxx
+++ b/vbahelper/source/vbahelper/vbadialogsbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,4 @@ VbaDialogsBase::Item( const uno::Any& /* &aItem */) throw (uno::RuntimeException
return uno::Any();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx
index c0a2a35998..4ccdb94ba3 100644
--- a/vbahelper/source/vbahelper/vbadocumentbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx
@@ -1,7 +1,8 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -24,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#include "vbahelper/vbadocumentbase.hxx"
#include "vbahelper/helperdecl.hxx"
@@ -36,6 +37,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XTitle.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp> //Michael E. Bohn
#include <com/sun/star/beans/XPropertySet.hpp>
#include <ooo/vba/XApplicationBase.hpp>
@@ -52,12 +54,12 @@ VbaDocumentBase::VbaDocumentBase( const uno::Reference< ov::XHelperInterface >&
{
}
-VbaDocumentBase::VbaDocumentBase( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< frame::XModel > xModel ) : VbaDocumentBase_BASE( xParent, xContext ), mxModel( xModel )
-{
+VbaDocumentBase::VbaDocumentBase( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< frame::XModel > xModel ) : VbaDocumentBase_BASE( xParent, xContext ), mxModel( xModel )
+{
}
VbaDocumentBase::VbaDocumentBase( uno::Sequence< uno::Any> const & args,
- uno::Reference< uno::XComponentContext> const & xContext ) : VbaDocumentBase_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext ), mxModel( getXSomethingFromArgs< frame::XModel >( args, 1 ) )
+ uno::Reference< uno::XComponentContext> const & xContext ) : VbaDocumentBase_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext ), mxModel( getXSomethingFromArgs< frame::XModel >( args, 1 ) )
{
}
@@ -73,13 +75,8 @@ VbaDocumentBase::getName() throw (uno::RuntimeException)
}
else
{
- const static rtl::OUString sTitle( RTL_CONSTASCII_USTRINGPARAM("Title" ) );
- // process "UntitledX - $(PRODUCTNAME)"
- uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW );
- xProps->getPropertyValue(sTitle ) >>= sName;
- sal_Int32 pos = 0;
- sName = sName.getToken(0,'-',pos);
+ uno::Reference< frame::XTitle > xTitle( getModel(), uno::UNO_QUERY_THROW );
+ sName = xTitle->getTitle();
sName = sName.trim();
}
return sName;
@@ -123,18 +120,18 @@ VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg,
if( bSaveChanges )
{
if( xStorable->isReadonly() )
- {
- throw uno::RuntimeException(::rtl::OUString(
+ {
+ throw uno::RuntimeException(::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "Unable to save to a read only file ") ),
uno::Reference< XInterface >() );
}
if( bFileName )
- xStorable->storeAsURL( aFileName, uno::Sequence< beans::PropertyValue >(0) );
+ xStorable->storeAsURL( aFileName, uno::Sequence< beans::PropertyValue >(0) );
else
xStorable->store();
- }
+ }
else
- xModifiable->setModified( false );
+ xModifiable->setModified( false );
// first try to close the document using UI dispatch functionality
sal_Bool bUIClose = sal_False;
@@ -175,16 +172,31 @@ VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg,
// The boolean parameter DeliverOwnership tells objects vetoing the close process that they may
// assume ownership if they object the closure by throwing a CloseVetoException
// Here we give up ownership. To be on the safe side, catch possible veto exception anyway.
- xCloseable->close(sal_True);
+ try{
+ xCloseable->close(sal_True);
+ }
+ catch( util::CloseVetoException )
+ {
+ //close is cancelled, nothing to do
+ }
}
+ // If close is not supported by this model - try to dispose it.
+ // But if the model disagree with a reset request for the modify state
+ // we shouldn't do so. Otherwhise some strange things can happen.
else
{
- // If close is not supported by this model - try to dispose it.
- // But if the model disagree with a reset request for the modify state
- // we shouldn't do so. Otherwhise some strange things can happen.
uno::Reference< lang::XComponent > xDisposable ( getModel(), uno::UNO_QUERY );
if ( xDisposable.is() )
- xDisposable->dispose();
+ {
+ // To be on the safe side, catch possible veto exception anyway.
+ try
+ {
+ xDisposable->dispose();
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
}
}
}
@@ -194,14 +206,14 @@ VbaDocumentBase::Protect( const uno::Any &aPassword ) throw (uno::RuntimeExcepti
{
rtl::OUString rPassword;
uno::Reference< util::XProtectable > xProt( getModel(), uno::UNO_QUERY_THROW );
- SC_VBA_FIXME(("Workbook::Protect stub"));
+ OSL_TRACE("Workbook::Protect stub");
if( aPassword >>= rPassword )
xProt->protect( rPassword );
else
xProt->protect( rtl::OUString() );
}
-void
+void
VbaDocumentBase::Unprotect( const uno::Any &aPassword ) throw (uno::RuntimeException)
{
rtl::OUString rPassword;
@@ -218,8 +230,8 @@ VbaDocumentBase::Unprotect( const uno::Any &aPassword ) throw (uno::RuntimeExcep
xProt->unprotect( rtl::OUString() );
}
}
-
-void
+
+void
VbaDocumentBase::setSaved( sal_Bool bSave ) throw (uno::RuntimeException)
{
uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY_THROW );
@@ -256,12 +268,12 @@ VbaDocumentBase::Save() throw (uno::RuntimeException)
dispatchRequests(xModel,url);
}
-void
+void
VbaDocumentBase::Activate() throw (uno::RuntimeException)
{
uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
xFrame->activate();
-}
+}
uno::Any SAL_CALL
VbaDocumentBase::getVBProject() throw (uno::RuntimeException)
@@ -290,7 +302,7 @@ VbaDocumentBase::getServiceImplName()
return sImplName;
}
-uno::Sequence< rtl::OUString >
+uno::Sequence< rtl::OUString >
VbaDocumentBase::getServiceNames()
{
static uno::Sequence< rtl::OUString > aServiceNames;
@@ -302,3 +314,4 @@ VbaDocumentBase::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
index 675f06a308..0e5782d632 100644
--- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,6 +38,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XTitle.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/frame/XStorable.hpp>
@@ -51,7 +53,8 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <sfx2/objsh.hxx>
#include <tools/urlobj.hxx>
-#include <hash_map>
+#include <vbahelper/vbadocumentbase.hxx>
+#include <boost/unordered_map.hpp>
#include <osl/file.hxx>
#include "vbahelper/vbahelper.hxx"
@@ -60,10 +63,10 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-static const rtl::OUString sSpreadsheetDocument( rtl::OUString::createFromAscii( "com.sun.star.sheet.SpreadsheetDocument" ) );
-static const rtl::OUString sTextDocument( rtl::OUString::createFromAscii( "com.sun.star.text.TextDocument" ) );
+static const rtl::OUString sSpreadsheetDocument( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument") );
+static const rtl::OUString sTextDocument( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument") );
-typedef std::hash_map< rtl::OUString,
+typedef boost::unordered_map< rtl::OUString,
sal_Int32, ::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > NameIndexHash;
@@ -91,7 +94,7 @@ public:
m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
uno::Reference< frame::XDesktop > xDesktop
- (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), m_xContext), uno::UNO_QUERY_THROW );
+ (xSMgr->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")), m_xContext), uno::UNO_QUERY_THROW );
uno::Reference< container::XEnumeration > mxComponents = xDesktop->getComponents()->createEnumeration();
while( mxComponents->hasMoreElements() )
{
@@ -148,8 +151,13 @@ public:
{
uno::Reference< frame::XModel > xModel( xServiceInfo, uno::UNO_QUERY_THROW ); // that the spreadsheetdocument is a xmodel is a given
m_documents.push_back( xModel );
- INetURLObject aURL( xModel->getURL() );
- namesToIndices[ aURL.GetLastName() ] = nIndex++;
+ rtl::OUString sName;
+ uno::Reference< ::ooo::vba::XDocumentBase > xVbaDocument = new VbaDocumentBase( uno::Reference< XHelperInterface >(), xContext, xModel );
+ if ( xVbaDocument.is() )
+ {
+ sName = xVbaDocument->getName();
+ }
+ namesToIndices[ sName ] = nIndex++;
}
}
@@ -255,7 +263,7 @@ uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException)
uno::Reference< frame::XComponentLoader > xLoader(
xSMgr->createInstanceWithContext(
- ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")),
mxContext), uno::UNO_QUERY_THROW );
rtl::OUString sURL;
if( meDocType == WORD_DOCUMENT )
@@ -315,11 +323,11 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u
uno::Reference< lang::XMultiComponentFactory > xSMgr(
mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
uno::Reference< frame::XDesktop > xDesktop
- (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop") , mxContext),
+ (xSMgr->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) , mxContext),
uno::UNO_QUERY_THROW );
uno::Reference< frame::XComponentLoader > xLoader(
xSMgr->createInstanceWithContext(
- ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")),
mxContext),
uno::UNO_QUERY_THROW );
@@ -350,3 +358,4 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u
return uno::makeAny( xComponent );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
index d837e8b421..a9e0376d0d 100755..100644
--- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
+++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -348,3 +349,5 @@ VbaEventsHelperBase::ModulePathMap& VbaEventsHelperBase::updateModulePathMap( co
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbafillformat.cxx b/vbahelper/source/vbahelper/vbafillformat.cxx
index db2ceba788..23a6e469dd 100644
--- a/vbahelper/source/vbahelper/vbafillformat.cxx
+++ b/vbahelper/source/vbahelper/vbafillformat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,7 +50,7 @@ ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::Runti
m_nFillStyle = nFillStyle;
if( m_nFillStyle == drawing::FillStyle_GRADIENT )
{
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillStyle"), uno::makeAny( drawing::FillStyle_GRADIENT ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")), uno::makeAny( drawing::FillStyle_GRADIENT ) );
awt::Gradient aGradient;
// AXIAL
// RADIAL
@@ -66,11 +67,11 @@ ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::Runti
aGradient.StartIntensity = 100;
aGradient.EndIntensity = 100;
aGradient.StepCount = 1;
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillGradient"), uno::makeAny( aGradient ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillGradient")), uno::makeAny( aGradient ) );
}
else if( m_nFillStyle == drawing::FillStyle_SOLID )
{
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillStyle"), uno::makeAny(drawing::FillStyle_SOLID) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")), uno::makeAny(drawing::FillStyle_SOLID) );
}
}
@@ -86,7 +87,7 @@ sal_Bool SAL_CALL
ScVbaFillFormat::getVisible() throw (uno::RuntimeException)
{
drawing::FillStyle nFillStyle;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("FillStyle") ) >>= nFillStyle;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")) ) >>= nFillStyle;
if( nFillStyle == drawing::FillStyle_NONE )
return sal_False;
return sal_True;
@@ -96,10 +97,10 @@ void SAL_CALL
ScVbaFillFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException)
{
drawing::FillStyle aFillStyle;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("FillStyle") ) >>= aFillStyle;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")) ) >>= aFillStyle;
if( !_visible )
{
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillStyle"), uno::makeAny( drawing::FillStyle_NONE ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")), uno::makeAny( drawing::FillStyle_NONE ) );
}
else
{
@@ -115,7 +116,7 @@ ScVbaFillFormat::getTransparency() throw (uno::RuntimeException)
{
sal_Int16 nTransparence = 0;
double dTransparence = 0;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "FillTransparence" ) ) >>= nTransparence;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillTransparence")) ) >>= nTransparence;
dTransparence = static_cast<double>( nTransparence );
dTransparence /= 100;
return dTransparence;
@@ -125,7 +126,7 @@ void SAL_CALL
ScVbaFillFormat::setTransparency( double _transparency ) throw (uno::RuntimeException)
{
sal_Int16 nTransparence = static_cast< sal_Int16 >( _transparency * 100 );
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillTransparence" ), uno::makeAny( nTransparence ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillTransparence")), uno::makeAny( nTransparence ) );
}
@@ -197,3 +198,4 @@ ScVbaFillFormat::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbafillformat.hxx b/vbahelper/source/vbahelper/vbafillformat.hxx
index cff28053b6..c2db69f525 100644
--- a/vbahelper/source/vbahelper/vbafillformat.hxx
+++ b/vbahelper/source/vbahelper/vbafillformat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,3 +70,5 @@ public:
};
#endif//SC_VBA_XFILLFORMAT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbafontbase.cxx b/vbahelper/source/vbahelper/vbafontbase.cxx
index 9b931a5462..e807a1842c 100644
--- a/vbahelper/source/vbahelper/vbafontbase.cxx
+++ b/vbahelper/source/vbahelper/vbafontbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -337,3 +338,4 @@ VbaFontBase::getUnderline() throw ( uno::RuntimeException )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx
index 0388d145f2..fd85d99a95 100644
--- a/vbahelper/source/vbahelper/vbaglobalbase.cxx
+++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,6 +26,7 @@
*
************************************************************************/
#include "vbahelper/vbaglobalbase.hxx"
+#include <sal/macros.h>
#include <cppuhelper/component_context.hxx>
#include <comphelper/processfactory.hxx>
@@ -59,7 +61,7 @@ const uno::Reference< uno::XComponentContext >& xContext, const rtl::OUString& s
};
// don't pass a delegate, this seems to introduce yet another cyclic dependency ( and
// some strange behavior
- mxContext = ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), NULL );
+ mxContext = ::cppu::createComponentContext( aHandlerContextInfo, SAL_N_ELEMENTS( aHandlerContextInfo ), NULL );
}
VbaGlobalsBase::~VbaGlobalsBase()
@@ -136,7 +138,7 @@ VbaGlobalsBase::getAvailableServiceNames( ) throw (uno::RuntimeException)
// common
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.msforms.UserForm" ) ),
};
- static uno::Sequence< rtl::OUString > serviceNames( names, sizeof( names )/ sizeof( names[0] ) );
+ static uno::Sequence< rtl::OUString > serviceNames( names, SAL_N_ELEMENTS( names ) );
return serviceNames;
}
@@ -154,3 +156,4 @@ VbaGlobalsBase::hasServiceName( const rtl::OUString& serviceName )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index d4003e18a2..9b19012af0 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -1,7 +1,8 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -32,6 +33,7 @@
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XModel2.hpp>
+#include <com/sun/star/frame/XNotifyingDispatch.hpp>
#include <com/sun/star/script/XDefaultProperty.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
@@ -76,13 +78,10 @@
#ifndef OOVBA_DLLIMPLEMENTATION
#define OOVBA_DLLIMPLEMENTATION
-#endif
+#endif
#include <vbahelper/vbahelper.hxx>
#include <sfx2/app.hxx>
-// #FIXME needs service
-//#include "vbashape.hxx"
-//#include "unonames.hxx"
using namespace ::com::sun::star;
using namespace ::ooo::vba;
@@ -120,158 +119,6 @@ nViewNo && !pView->GetObjectShell()->IsInPlaceActive() )
}
return false;
}
-#if 0
-namespace excel // all in this namespace probably can be moved to sc
-{
-
-
-const ::rtl::OUString REPLACE_CELLS_WARNING( RTL_CONSTASCII_USTRINGPARAM( "ReplaceCellsWarning"));
-class PasteCellsWarningReseter
-{
-private:
- bool bInitialWarningState;
- static uno::Reference< beans::XPropertySet > getGlobalSheetSettings() throw ( uno::RuntimeException )
- {
- static uno::Reference< beans::XPropertySet > xTmpProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
- static uno::Reference<uno::XComponentContext > xContext( xTmpProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
- static uno::Reference<lang::XMultiComponentFactory > xServiceManager(
- xContext->getServiceManager(), uno::UNO_QUERY_THROW );
- static uno::Reference< beans::XPropertySet > xProps( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.GlobalSheetSettings" ) ) ,xContext ), uno::UNO_QUERY_THROW );
- return xProps;
- }
-
- bool getReplaceCellsWarning() throw ( uno::RuntimeException )
- {
- sal_Bool res = sal_False;
- getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res;
- return ( res == sal_True );
- }
-
- void setReplaceCellsWarning( bool bState ) throw ( uno::RuntimeException )
- {
- getGlobalSheetSettings()->setPropertyValue( REPLACE_CELLS_WARNING, uno::makeAny( bState ) );
- }
-public:
- PasteCellsWarningReseter() throw ( uno::RuntimeException )
- {
- bInitialWarningState = getReplaceCellsWarning();
- if ( bInitialWarningState )
- setReplaceCellsWarning( false );
- }
- ~PasteCellsWarningReseter()
- {
- if ( bInitialWarningState )
- {
- // don't allow dtor to throw
- try
- {
- setReplaceCellsWarning( true );
- }
- catch ( uno::Exception& /*e*/ ){}
- }
- }
-};
-
-void
-implnPaste()
-{
- PasteCellsWarningReseter resetWarningBox;
- ScTabViewShell* pViewShell = getCurrentBestViewShell();
- if ( pViewShell )
- {
- pViewShell->PasteFromSystem();
- pViewShell->CellContentChanged();
- }
-}
-
-
-void
-implnCopy()
-{
- ScTabViewShell* pViewShell = getCurrentBestViewShell();
- if ( pViewShell )
- pViewShell->CopyToClip(NULL,false,false,true);
-}
-
-void
-implnCut()
-{
- ScTabViewShell* pViewShell = getCurrentBestViewShell();
- if ( pViewShell )
- pViewShell->CutToClip( NULL, sal_True );
-}
-void implnPasteSpecial(SfxViewShell* pViewShell, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose)
-{
- PasteCellsWarningReseter resetWarningBox;
- sal_Bool bAsLink(sal_False), bOtherDoc(sal_False);
- InsCellCmd eMoveMode = INS_NONE;
-
- if ( !pTabViewShell )
- // none active, try next best
- pTabViewShell = getCurrentBestViewShell();
- if ( pTabViewShell )
- {
- ScViewData* pView = pTabViewShell->GetViewData();
- Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL;
- if ( pView && pWin )
- {
- if ( bAsLink && bOtherDoc )
- pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK
- else
- {
- ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
- ScDocument* pDoc = NULL;
- if ( pOwnClip )
- pDoc = pOwnClip->GetDocument();
- pTabViewShell->PasteFromClip( nFlags, pDoc,
- nFunction, bSkipEmpty, bTranspose, bAsLink,
- eMoveMode, IDF_NONE, sal_True );
- pTabViewShell->CellContentChanged();
- }
- }
- }
-
-}
-
-ScDocShell*
-getDocShell( css::uno::Reference< css::frame::XModel>& xModel )
-{
- uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW );
- ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() );
- ScDocShell* pDocShell = NULL;
- if ( pModel )
- pDocShell = (ScDocShell*)pModel->GetEmbeddedObject();
- return pDocShell;
-
-}
-
-ScTabViewShell*
-getBestViewShell( css::uno::Reference< css::frame::XModel>& xModel )
-{
- ScDocShell* pDocShell = getDocShell( xModel );
- if ( pDocShell )
- return pDocShell->GetBestViewShell();
- return NULL;
-}
-
-ScTabViewShell*
-getCurrentBestViewShell()
-{
- uno::Reference< frame::XModel > xModel = getCurrentDocument();
- return getBestViewShell( xModel );
-}
-
-SfxViewFrame*
-getCurrentViewFrame()
-{
- ScTabViewShell* pViewShell = getCurrentBestViewShell();
- if ( pViewShell )
- return pViewShell->GetViewFrame();
- return NULL;
-}
-};
-
-#endif
uno::Reference< beans::XIntrospectionAccess >
getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
@@ -280,7 +127,7 @@ getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
if( !xIntrospection.is() )
{
uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
- xIntrospection.set( xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.beans.Introspection") ), uno::UNO_QUERY_THROW );
+ xIntrospection.set( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.Introspection")) ), uno::UNO_QUERY_THROW );
}
return xIntrospection->inspect( aObject );
}
@@ -310,11 +157,11 @@ void dispatchExecute(SfxViewShell* pViewShell, sal_uInt16 nSlot, SfxCallMode nCa
{
pDispatcher->Execute( nSlot , nCall );
}
- }
+ }
}
-
+
void
-dispatchRequests( const uno::Reference< frame::XModel>& xModel, const rtl::OUString& aUrl, const uno::Sequence< beans::PropertyValue >& sProps )
+dispatchRequests (const uno::Reference< frame::XModel>& xModel, const rtl::OUString & aUrl, const uno::Sequence< beans::PropertyValue >& sProps, const uno::Reference< frame::XDispatchResultListener >& rListener, const sal_Bool bSilent )
{
util::URL url;
url.Complete = aUrl;
@@ -332,7 +179,7 @@ dispatchRequests( const uno::Reference< frame::XModel>& xModel, const rtl::OUStr
uno::Reference<lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
if ( !xServiceManager.is() )
return;
-
+
uno::Reference<util::XURLTransformer> xParser( xServiceManager->createInstanceWithContext(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) ), xContext),
uno::UNO_QUERY_THROW );
@@ -346,6 +193,7 @@ dispatchRequests( const uno::Reference< frame::XModel>& xModel, const rtl::OUStr
}
uno::Reference<frame::XDispatch> xDispatcher = xDispatchProvider->queryDispatch(url,emptyString,0);
+ uno::Reference< frame::XNotifyingDispatch > xNotifyingDispatcher( xDispatcher, uno::UNO_QUERY );
uno::Sequence<beans::PropertyValue> dispatchProps(1);
@@ -361,11 +209,20 @@ dispatchRequests( const uno::Reference< frame::XModel>& xModel, const rtl::OUStr
*pDest = *pSrc;
}
- (*pDest).Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Silent" ));
- (*pDest).Value <<= (sal_Bool)sal_True;
+ if ( bSilent )
+ {
+ (*pDest).Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Silent" ));
+ (*pDest).Value <<= (sal_Bool)sal_True;
+ }
- if (xDispatcher.is())
+ if ( !rListener.is() && xDispatcher.is() )
+ {
xDispatcher->dispatch( url, dispatchProps );
+ }
+ else if ( rListener.is() && xNotifyingDispatcher.is() )
+ {
+ xNotifyingDispatcher->dispatchWithNotification( url, dispatchProps, rListener );
+ }
}
void
@@ -385,7 +242,7 @@ getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException)
{
OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" );
return xModel;
- }
+ }
SbxObject* p = pBasic;
SbxObject* pParent = p->GetParent();
SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL;
@@ -400,7 +257,7 @@ getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException)
}
- uno::Any aModel;
+ uno::Any aModel;
SbxVariable *pCompVar = basicChosen->Find( sKey, SbxCLASS_OBJECT );
if ( pCompVar )
@@ -409,7 +266,7 @@ getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException)
if ( sal_False == ( aModel >>= xModel ) ||
!xModel.is() )
{
- throw uno::RuntimeException(
+ throw uno::RuntimeException(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't extract model from basic ( its obviously not set yet ) therefore don't know the current documet context") ), uno::Reference< uno::XInterface >() );
}
else
@@ -422,8 +279,8 @@ getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException)
else
{
OSL_TRACE("Failed to get %s", rtl::OUStringToOString( sKey, RTL_TEXTENCODING_UTF8 ).getStr() );
- throw uno::RuntimeException(
- rtl::OUString(
+ throw uno::RuntimeException(
+ rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"Can't determine the currently selected document") ),
uno::Reference< uno::XInterface >() );
@@ -431,7 +288,7 @@ getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException)
return xModel;
}
- uno::Reference< frame::XModel >
+ uno::Reference< frame::XModel >
getCurrentDocCtx( const rtl::OUString& ctxName, const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
{
uno::Reference< frame::XModel > xModel;
@@ -469,14 +326,14 @@ getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) t
return xModel;
}
- uno::Reference< frame::XModel >
+ uno::Reference< frame::XModel >
getCurrentWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
{
static const rtl::OUString sThisWordDoc( RTL_CONSTASCII_USTRINGPARAM("ThisWordDoc" ) );
uno::Reference< frame::XModel > xModel;
try
{
- xModel = getCurrentDoc( sThisWordDoc );
+ xModel = getCurrentDoc( sThisWordDoc );
}
catch( uno::Exception& e )
{
@@ -501,7 +358,7 @@ OORGBToXLRGB( sal_Int32 nCol )
sal_Int32 nRGB = ( nAutoBits | (nBlue << 16) | (nGreen << 8) | nRed );
return nRGB;
}
-sal_Int32
+sal_Int32
XLRGBToOORGB( sal_Int32 nCol )
{
sal_Int32 nAutoBits = nCol;
@@ -518,7 +375,7 @@ XLRGBToOORGB( sal_Int32 nCol )
sal_Int32 nRGB = ( nAutoBits | (nRed << 16) | (nGreen << 8) | nBlue );
return nRGB;
}
-uno::Any
+uno::Any
OORGBToXLRGB( const uno::Any& aCol )
{
sal_Int32 nCol(0);
@@ -526,7 +383,7 @@ OORGBToXLRGB( const uno::Any& aCol )
nCol = OORGBToXLRGB( nCol );
return uno::makeAny( nCol );
}
-uno::Any
+uno::Any
XLRGBToOORGB( const uno::Any& aCol )
{
sal_Int32 nCol(0);
@@ -552,7 +409,7 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
rtl::OUString sRange( RTL_CONSTASCII_USTRINGPARAM( "-" ) );
rtl::OUString sFileName;
-
+
if (( nFrom || nTo ) )
{
if ( nFrom )
@@ -571,7 +428,7 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
if ( pViewFrame )
{
SfxAllItemSet aArgs( SFX_APP()->GetPool() );
-
+
SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate );
aArgs.Put( sfxCollate, sfxCollate.Which() );
SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies );
@@ -580,7 +437,7 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
{
SfxStringItem sfxFileName( SID_FILE_NAME, sFileName);
aArgs.Put( sfxFileName, sfxFileName.Which() );
-
+
}
if ( sRange.getLength() )
{
@@ -597,7 +454,7 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
{
if ( bPreview )
{
- if ( !pViewFrame->GetFrame().IsInPlace() )
+ if ( !pViewFrame->GetFrame().IsInPlace() )
{
// #TODO is this necessary ( calc specific )
// SC_MOD()->InputEnterHandler();
@@ -609,12 +466,12 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
else
pDispatcher->Execute( (sal_uInt16)SID_PRINTDOC, (SfxCallMode)SFX_CALLMODE_SYNCHRON, aArgs );
}
-
+
}
-
+
// #FIXME #TODO
// 1 ActivePrinter ( how/can we switch a printer via API? )
- // 2 PrintToFile ( ms behaviour if this option is specified but no
+ // 2 PrintToFile ( ms behaviour if this option is specified but no
// filename supplied 'PrToFileName' then the user will be prompted )
// 3 Need to check behaviour of Selected sheets with range ( e.g. From & To
// values ) in oOO these options are mutually exclusive
@@ -712,13 +569,13 @@ rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeEx
}
-rtl::OUString
+rtl::OUString
ContainerUtilities::getUniqueName( const uno::Sequence< ::rtl::OUString >& _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator)
{
return getUniqueName(_slist, _sElementName, _sSuffixSeparator, sal_Int32(2));
}
-rtl::OUString
+rtl::OUString
ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix)
{
sal_Int32 a = _nStartSuffix;
@@ -728,7 +585,7 @@ ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist,
if ( nLen == 0 )
return _sElementName;
- while (bElementexists == true)
+ while (bElementexists == true)
{
for (sal_Int32 i = 0; i < nLen; i++)
{
@@ -742,17 +599,17 @@ ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist,
return rtl::OUString();
}
-sal_Int32
+sal_Int32
ContainerUtilities::FieldInList( const uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString )
{
sal_Int32 FieldLen = SearchList.getLength();
sal_Int32 retvalue = -1;
- for (sal_Int32 i = 0; i < FieldLen; i++)
+ for (sal_Int32 i = 0; i < FieldLen; i++)
{
// I wonder why comparing lexicographically is done
// when its a match is whats interesting?
- //if (SearchList[i].compareTo(SearchString) == 0)
- if ( SearchList[i].equals( SearchString ) )
+ //if (SearchList[i].compareTo(SearchString) == 0)
+ if ( SearchList[i].equals( SearchString ) )
{
retvalue = i;
break;
@@ -777,7 +634,7 @@ rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike )
if ( bForLike )
sResult.append(static_cast<sal_Unicode>('^'));
- while (start < end)
+ while (start < end)
{
switch (*start)
{
@@ -854,7 +711,7 @@ double getPixelTo100thMillimeterConversionFactor( const css::uno::Reference< css
}
else
{
- fConvertFactor = xDevice->getInfo().PixelPerMeterX/100000;
+ fConvertFactor = xDevice->getInfo().PixelPerMeterX/100000;
}
return fConvertFactor;
}
@@ -867,7 +724,7 @@ double PointsToPixels( const css::uno::Reference< css::awt::XDevice >& xDevice,
double PixelsToPoints( const css::uno::Reference< css::awt::XDevice >& xDevice, double fPixels, sal_Bool bVertical)
{
double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
- return HmmToPoints( fPixels/fConvertFactor );
+ return HmmToPoints(static_cast<sal_Int32>(fPixels/fConvertFactor));
}
sal_Int32 PointsToHmm( double fPoints )
@@ -890,7 +747,7 @@ ConcreteXShapeGeometryAttributes::~ConcreteXShapeGeometryAttributes()
sal_Int32 getPointerStyle( const uno::Reference< frame::XModel >& xModel )
{
-
+
sal_Int32 nPointerStyle( POINTER_ARROW );
try
{
@@ -910,7 +767,7 @@ sal_Int32 getPointerStyle( const uno::Reference< frame::XModel >& xModel )
}
// #FIXME this method looks wrong, shouldn't it just affect calc *or* writer
-// document/frame/window(s) but not both ( and depending on what api called
+// document/frame/window(s) but not both ( and depending on what api called
// this )
void setCursorHelper( const uno::Reference< frame::XModel >& xModel, const Pointer& rPointer, sal_Bool bOverWrite )
{
@@ -957,19 +814,36 @@ void setDefaultPropByIntrospection( const uno::Any& aObj, const uno::Any& aValue
{
uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObj ) );
- // #MAYBE #FIXME sort of a bit of a hack,
+ // #MAYBE #FIXME sort of a bit of a hack,
uno::Reference< script::XDefaultProperty > xDflt( aObj, uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xPropSet;
if ( xUnoAccess.is() )
xPropSet.set( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY);
-
+
if ( xPropSet.is() )
xPropSet->setPropertyValue( xDflt->getDefaultPropertyName(), aValue );
else
throw uno::RuntimeException();
}
+uno::Any getDefaultPropByIntrospection( const uno::Any& aObj ) throw ( uno::RuntimeException )
+{
+ uno::Any aValue;
+ uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObj ) );
+ uno::Reference< script::XDefaultProperty > xDefaultProperty( aObj, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xPropSet;
+
+ if ( xUnoAccess.is() )
+ xPropSet.set( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY );
+
+ if ( xPropSet.is() )
+ aValue = xPropSet->getPropertyValue( xDefaultProperty->getDefaultPropertyName() );
+ else
+ throw uno::RuntimeException();
+ return aValue;
+}
+
uno::Any getPropertyValue( const uno::Sequence< beans::PropertyValue >& aProp, const rtl::OUString& aName )
{
uno::Any result;
@@ -997,6 +871,18 @@ sal_Bool setPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, const r
return sal_False;
}
+void setOrAppendPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, const rtl::OUString& aName, const uno::Any& aValue )
+{
+ if( setPropertyValue( aProp, aName, aValue ) )
+ return;
+
+ // append the property
+ sal_Int32 nLength = aProp.getLength();
+ aProp.realloc( nLength + 1 );
+ aProp[ nLength ].Name = aName;
+ aProp[ nLength ].Value = aValue;
+}
+
// ====UserFormGeomentryHelper====
//---------------------------------------------
UserFormGeometryHelper::UserFormGeometryHelper(
@@ -1168,169 +1054,189 @@ void UserFormGeometryHelper::implSetSize( double fSize, bool bHeight, bool bOute
// ============================================================================
- double ConcreteXShapeGeometryAttributes::getLeft() const
- {
- return m_pShapeHelper->getLeft();
- }
- void ConcreteXShapeGeometryAttributes::setLeft( double nLeft )
- {
- m_pShapeHelper->setLeft( nLeft );
- }
- double ConcreteXShapeGeometryAttributes::getTop() const
- {
- return m_pShapeHelper->getTop();
- }
- void ConcreteXShapeGeometryAttributes::setTop( double nTop )
- {
- m_pShapeHelper->setTop( nTop );
+double ConcreteXShapeGeometryAttributes::getLeft() const
+{
+ return m_pShapeHelper->getLeft();
+}
+void ConcreteXShapeGeometryAttributes::setLeft( double nLeft )
+{
+ m_pShapeHelper->setLeft( nLeft );
+}
+double ConcreteXShapeGeometryAttributes::getTop() const
+{
+ return m_pShapeHelper->getTop();
+}
+void ConcreteXShapeGeometryAttributes::setTop( double nTop )
+{
+ m_pShapeHelper->setTop( nTop );
+}
+
+double ConcreteXShapeGeometryAttributes::getHeight() const
+{
+ return m_pShapeHelper->getHeight();
+}
+void ConcreteXShapeGeometryAttributes::setHeight( double nHeight )
+{
+ m_pShapeHelper->setHeight( nHeight );
+}
+double ConcreteXShapeGeometryAttributes::getWidth() const
+{
+ return m_pShapeHelper->getWidth();
+}
+void ConcreteXShapeGeometryAttributes::setWidth( double nWidth)
+{
+ m_pShapeHelper->setWidth( nWidth );
+}
+
+
+ShapeHelper::ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException ) : xShape( _xShape )
+{
+ if( !xShape.is() )
+ throw css::uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No valid shape for helper")), css::uno::Reference< css::uno::XInterface >() );
+}
+
+double ShapeHelper::getHeight() const
+{
+ return Millimeter::getInPoints(xShape->getSize().Height);
}
- double ConcreteXShapeGeometryAttributes::getHeight() const
+
+ void ShapeHelper::setHeight(double _fheight) throw ( css::script::BasicErrorException )
+{
+ try
{
- return m_pShapeHelper->getHeight();
+ css::awt::Size aSize = xShape->getSize();
+ aSize.Height = Millimeter::getInHundredthsOfOneMillimeter(_fheight);
+ xShape->setSize(aSize);
}
- void ConcreteXShapeGeometryAttributes::setHeight( double nHeight )
+ catch ( css::uno::Exception& /*e*/)
{
- m_pShapeHelper->setHeight( nHeight );
+ throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
+ }
+}
+double ShapeHelper::getWidth() const
+{
+ return Millimeter::getInPoints(xShape->getSize().Width);
}
- double ConcreteXShapeGeometryAttributes::getWidth() const
+
+void ShapeHelper::setWidth(double _fWidth) throw ( css::script::BasicErrorException )
+{
+ try
{
- return m_pShapeHelper->getWidth();
+ css::awt::Size aSize = xShape->getSize();
+ aSize.Width = Millimeter::getInHundredthsOfOneMillimeter(_fWidth);
+ xShape->setSize(aSize);
}
- void ConcreteXShapeGeometryAttributes::setWidth( double nWidth)
+ catch (css::uno::Exception& /*e*/)
{
- m_pShapeHelper->setWidth( nWidth );
+ throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
}
+}
- ShapeHelper::ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException ) : xShape( _xShape )
- {
- if( !xShape.is() )
- throw css::uno::RuntimeException( rtl::OUString::createFromAscii("No valid shape for helper"), css::uno::Reference< css::uno::XInterface >() );
- }
-
- double ShapeHelper::getHeight() const
- {
- return Millimeter::getInPoints(xShape->getSize().Height);
- }
+double ShapeHelper::getLeft() const
+{
+ return Millimeter::getInPoints(xShape->getPosition().X);
+}
- void ShapeHelper::setHeight(double _fheight) throw ( css::script::BasicErrorException )
- {
- try
- {
- css::awt::Size aSize = xShape->getSize();
- aSize.Height = Millimeter::getInHundredthsOfOneMillimeter(_fheight);
- xShape->setSize(aSize);
- }
- catch ( css::uno::Exception& /*e*/)
- {
- throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
- }
- }
-
-
- double ShapeHelper::getWidth() const
- {
- return Millimeter::getInPoints(xShape->getSize().Width);
- }
+void ShapeHelper::setLeft(double _fLeft)
+{
+ css::awt::Point aPoint = xShape->getPosition();
+ aPoint.X = Millimeter::getInHundredthsOfOneMillimeter(_fLeft);
+ xShape->setPosition(aPoint);
+}
- void ShapeHelper::setWidth(double _fWidth) throw ( css::script::BasicErrorException )
- {
- try
- {
- css::awt::Size aSize = xShape->getSize();
- aSize.Width = Millimeter::getInHundredthsOfOneMillimeter(_fWidth);
- xShape->setSize(aSize);
- }
- catch (css::uno::Exception& /*e*/)
- {
- throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
- }
- }
-
-
- double ShapeHelper::getLeft() const
- {
- return Millimeter::getInPoints(xShape->getPosition().X);
- }
-
- void ShapeHelper::setLeft(double _fLeft)
- {
- css::awt::Point aPoint = xShape->getPosition();
- aPoint.X = Millimeter::getInHundredthsOfOneMillimeter(_fLeft);
- xShape->setPosition(aPoint);
- }
-
+double ShapeHelper::getTop() const
+{
+ return Millimeter::getInPoints(xShape->getPosition().Y);
+}
- double ShapeHelper::getTop() const
- {
- return Millimeter::getInPoints(xShape->getPosition().Y);
- }
-
- void ShapeHelper::setTop(double _fTop)
- {
- css::awt::Point aPoint = xShape->getPosition();
- aPoint.Y = Millimeter::getInHundredthsOfOneMillimeter(_fTop);
- xShape->setPosition(aPoint);
- }
-
- void DebugHelper::exception( const rtl::OUString& DetailedMessage, const css::uno::Exception& ex, int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException )
- {
- // #TODO #FIXME ( do we want to support additionalArg here )
- throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString::createFromAscii(" ") ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() );
- }
+void ShapeHelper::setTop(double _fTop)
+{
+ css::awt::Point aPoint = xShape->getPosition();
+ aPoint.Y = Millimeter::getInHundredthsOfOneMillimeter(_fTop);
+ xShape->setPosition(aPoint);
+}
- void DebugHelper::exception( int err, const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException )
- {
- exception( rtl::OUString(), css::uno::Exception(), err, additionalArgument );
- }
- void DebugHelper::exception( css::uno::Exception& ex ) throw( css::script::BasicErrorException )
- {
- exception( rtl::OUString(), ex, SbERR_INTERNAL_ERROR, rtl::OUString() );
- }
+void DebugHelper::exception( const rtl::OUString& DetailedMessage, const css::uno::Exception& ex, int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException )
+{
+ // #TODO #FIXME ( do we want to support additionalArg here )
+ throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() );
+}
- Millimeter::Millimeter():m_nMillimeter(0) {}
-
- Millimeter::Millimeter(double mm):m_nMillimeter(mm) {}
-
- void Millimeter::set(double mm) { m_nMillimeter = mm; }
- void Millimeter::setInPoints(double points)
- {
- m_nMillimeter = points * factor / 100.0;
- }
-
- void Millimeter::setInHundredthsOfOneMillimeter(double hmm)
- {
- m_nMillimeter = hmm / 100;
- }
-
- double Millimeter::get()
- {
- return m_nMillimeter;
- }
- double Millimeter::getInHundredthsOfOneMillimeter()
- {
- return m_nMillimeter * 100;
- }
- double Millimeter::getInPoints()
- {
- return m_nMillimeter / factor * 100.0;
- }
+void DebugHelper::exception( int err, const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException )
+{
+ exception( rtl::OUString(), css::uno::Exception(), err, additionalArgument );
+}
+void DebugHelper::exception( const css::uno::Exception& ex ) throw( css::script::BasicErrorException )
+{
+ exception( rtl::OUString(), ex, SbERR_INTERNAL_ERROR, rtl::OUString() );
+}
- sal_Int32 Millimeter::getInHundredthsOfOneMillimeter(double points)
- {
- sal_Int32 mm = static_cast<sal_Int32>(points * factor);
- return mm;
- }
-
- double Millimeter::getInPoints(int _hmm)
- {
- double points = double( static_cast<double>(_hmm) / factor);
- return points;
- }
+Millimeter::Millimeter():m_nMillimeter(0) {}
+
+Millimeter::Millimeter(double mm):m_nMillimeter(mm) {}
+
+void Millimeter::set(double mm) { m_nMillimeter = mm; }
+void Millimeter::setInPoints(double points)
+{
+ m_nMillimeter = points * factor / 100.0;
+}
+
+void Millimeter::setInHundredthsOfOneMillimeter(double hmm)
+{
+ m_nMillimeter = hmm / 100;
+}
+
+double Millimeter::get()
+{
+ return m_nMillimeter;
+}
+double Millimeter::getInHundredthsOfOneMillimeter()
+{
+ return m_nMillimeter * 100;
+}
+double Millimeter::getInPoints()
+{
+ return m_nMillimeter / factor * 100.0;
+}
+
+sal_Int32 Millimeter::getInHundredthsOfOneMillimeter(double points)
+{
+ sal_Int32 mm = static_cast<sal_Int32>(points * factor);
+ return mm;
+}
+
+double Millimeter::getInPoints(int _hmm)
+{
+ double points = double( static_cast<double>(_hmm) / factor);
+ return points;
+}
+
+// Listener for XNotifyingDispatch
+VBADispatchListener::VBADispatchListener() : m_State( sal_False )
+{
+}
+
+// Listener for XNotifyingDispatch
+VBADispatchListener::~VBADispatchListener()
+{
+}
+
+// Listener for XNotifyingDispatch
+void SAL_CALL VBADispatchListener::dispatchFinished( const frame::DispatchResultEvent& aEvent ) throw ( uno::RuntimeException )
+{
+ m_Result = aEvent.Result;
+ m_State = ( aEvent.State == frame::DispatchResultState::SUCCESS ) ? sal_True : sal_False;
+}
+
+// Listener for XNotifyingDispatch
+void SAL_CALL VBADispatchListener::disposing( const lang::EventObject& /*aEvent*/ ) throw( uno::RuntimeException )
+{
+}
uno::Reference< XHelperInterface > getVBADocument( const uno::Reference< frame::XModel >& xModel )
{
@@ -1379,3 +1285,5 @@ SfxObjectShell* getSfxObjShell( const uno::Reference< frame::XModel >& xModel )
} // openoffice
} //org
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbalineformat.cxx b/vbahelper/source/vbahelper/vbalineformat.cxx
index 6ca952fd59..1953804085 100644
--- a/vbahelper/source/vbahelper/vbalineformat.cxx
+++ b/vbahelper/source/vbahelper/vbalineformat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,7 +45,7 @@ ScVbaLineFormat::ScVbaLineFormat( const uno::Reference< ov::XHelperInterface >&
}
sal_Int32
-ScVbaLineFormat::calculateArrowheadSize()
+ScVbaLineFormat::calculateArrowheadSize() const
{
return 0;
}
@@ -53,39 +54,39 @@ sal_Int32
ScVbaLineFormat::convertLineStartEndNameToArrowheadStyle( rtl::OUString sLineName )
{
sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone;
- if (sLineName.equals(rtl::OUString::createFromAscii("Small Arrow")) ||
- sLineName.equals(rtl::OUString::createFromAscii("Arrow")) ||
- sLineName.equals(rtl::OUString::createFromAscii("msArrowEnd")) ||
- sLineName.equals(rtl::OUString::createFromAscii("Double Arrow")))
+ if (sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Small Arrow"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Arrow"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("msArrowEnd"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Double Arrow"))))
{
// msoArrowheadTriangle
nLineType = office::MsoArrowheadStyle::msoArrowheadTriangle;
}
- else if (sLineName.equals(rtl::OUString::createFromAscii("Square 45")) ||
- sLineName.equals(rtl::OUString::createFromAscii("Square")) ||
- sLineName.equals(rtl::OUString::createFromAscii("msArrowDiamondEnd")))
+ else if (sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Square 45"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Square"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("msArrowDiamondEnd"))))
{
// msoArrowheadDiamond
nLineType = office::MsoArrowheadStyle::msoArrowheadDiamond;
}
- else if (sLineName.equals(rtl::OUString::createFromAscii("Circle")) ||
- sLineName.equals(rtl::OUString::createFromAscii("msArrowOvalEnd")) ||
- sLineName.equals(rtl::OUString::createFromAscii("Dimension Lines")) )
+ else if (sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Circle"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("msArrowOvalEnd"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dimension Lines"))) )
{
// msoArrowheadOval
nLineType = office::MsoArrowheadStyle::msoArrowheadOval;
}
- else if (sLineName.equals(rtl::OUString::createFromAscii("Arrow concave")) ||
- sLineName.equals(rtl::OUString::createFromAscii("msArrowStealthEnd")))
+ else if (sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Arrow concave"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("msArrowStealthEnd"))))
{
// msoArrowheadStealth
nLineType = office::MsoArrowheadStyle::msoArrowheadStealth;
}
- else if (sLineName.equals(rtl::OUString::createFromAscii("Rounded short Arrow")) ||
- sLineName.equals(rtl::OUString::createFromAscii("Rounded large Arrow")) ||
- sLineName.equals(rtl::OUString::createFromAscii("Symmetric Arrow")) ||
- sLineName.equals(rtl::OUString::createFromAscii("msArrowOpenEnd")) ||
- sLineName.equals(rtl::OUString::createFromAscii("Line Arrow")))
+ else if (sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rounded short Arrow"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rounded large Arrow"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Symmetric Arrow"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("msArrowOpenEnd"))) ||
+ sLineName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Line Arrow"))))
{
// msoArrowheadOpen
nLineType = office::MsoArrowheadStyle::msoArrowheadOpen;
@@ -104,19 +105,19 @@ ScVbaLineFormat::convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadSt
switch( nArrowheadStyle )
{
case office::MsoArrowheadStyle::msoArrowheadNone:
- return rtl::OUString(rtl::OUString::createFromAscii( "" ) );
+ return rtl::OUString();
case office::MsoArrowheadStyle::msoArrowheadStealth:
- return rtl::OUString::createFromAscii( "Arrow concave" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Arrow concave"));
case office::MsoArrowheadStyle::msoArrowheadOpen:
- return rtl::OUString::createFromAscii("Line Arrow" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Line Arrow"));
case office::MsoArrowheadStyle::msoArrowheadOval:
- return rtl::OUString::createFromAscii("Circle" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Circle"));
case office::MsoArrowheadStyle::msoArrowheadDiamond:
- return rtl::OUString::createFromAscii( "Square 45" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Square 45"));
case office::MsoArrowheadStyle::msoArrowheadTriangle:
- return rtl::OUString::createFromAscii( "Arrow" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Arrow"));
default:
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Invalid Arrow Style!"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid Arrow Style!")), uno::Reference< uno::XInterface >() );
}
}
@@ -126,10 +127,10 @@ ScVbaLineFormat::getBeginArrowheadStyle() throw (uno::RuntimeException)
{
sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone;
rtl::OUString sLineName;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStartName" ) ) >>= sLineName;
- if( ( sLineName.getLength() > 7 ) && ( sLineName.indexOf( rtl::OUString::createFromAscii( "msArray" ) ) ) != -1 )
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStartName")) ) >>= sLineName;
+ if( ( sLineName.getLength() > 7 ) && ( sLineName.indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("msArray")) ) ) != -1 )
{
- sal_Int32 nIndex = sLineName.indexOf( rtl::OUString::createFromAscii(" ") );
+ sal_Int32 nIndex = sLineName.indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) );
rtl::OUString sName = sLineName.copy( 0, nIndex );
//sal_Int32 nSize = sLineName.copy( nIndex + 1 ).toInt32();
nLineType = convertLineStartEndNameToArrowheadStyle( sName );
@@ -145,31 +146,31 @@ void SAL_CALL
ScVbaLineFormat::setBeginArrowheadStyle( sal_Int32 _beginarrowheadstyle ) throw (uno::RuntimeException)
{
rtl::OUString sArrayName = convertArrowheadStyleToLineStartEndName( _beginarrowheadstyle );
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStartName" ), uno::makeAny( sArrayName ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStartName")), uno::makeAny( sArrayName ) );
}
sal_Int32 SAL_CALL
ScVbaLineFormat::getBeginArrowheadLength() throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() );
}
void SAL_CALL
ScVbaLineFormat::setBeginArrowheadLength( sal_Int32 /*_beginarrowheadlength*/ ) throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() );
}
sal_Int32 SAL_CALL
ScVbaLineFormat::getBeginArrowheadWidth() throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() );
}
void SAL_CALL
ScVbaLineFormat::setBeginArrowheadWidth( sal_Int32 /*_beginarrowheadwidth*/ ) throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() );
}
sal_Int32 SAL_CALL
@@ -186,32 +187,32 @@ ScVbaLineFormat::setEndArrowheadStylel( sal_Int32 /*_endarrowheadstylel*/ ) thro
sal_Int32 SAL_CALL
ScVbaLineFormat::getEndArrowheadLength() throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() );
}
void SAL_CALL
ScVbaLineFormat::setEndArrowheadLength( sal_Int32 /*_endarrowheadlength*/ ) throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() );
}
sal_Int32 SAL_CALL
ScVbaLineFormat::getEndArrowheadWidth() throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() );
}
void SAL_CALL
ScVbaLineFormat::setEndArrowheadWidth( sal_Int32 /*_endarrowheadwidth*/ ) throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() );
}
double SAL_CALL
ScVbaLineFormat::getWeight() throw (uno::RuntimeException)
{
sal_Int32 nLineWidth=0;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineWidth") ) >>= nLineWidth;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineWidth")) ) >>= nLineWidth;
double dLineWidth = Millimeter::getInPoints( nLineWidth );
return dLineWidth;
}
@@ -220,7 +221,7 @@ void SAL_CALL
ScVbaLineFormat::setWeight( double _weight ) throw (uno::RuntimeException)
{
if( _weight < 0 )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Parameter: Must be positv."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parameter: Must be positive.")), uno::Reference< uno::XInterface >() );
if( _weight == 0 )
_weight = 0.5;
m_nLineWeight = _weight;
@@ -228,7 +229,7 @@ ScVbaLineFormat::setWeight( double _weight ) throw (uno::RuntimeException)
aMillimeter.setInPoints( _weight );
sal_Int32 nLineWidth = static_cast<sal_Int32>( aMillimeter.getInHundredthsOfOneMillimeter() );
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineWidth" ), uno::makeAny( nLineWidth ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineWidth")), uno::makeAny( nLineWidth ) );
setDashStyle( m_nLineDashStyle );
}
@@ -236,7 +237,7 @@ sal_Bool SAL_CALL
ScVbaLineFormat::getVisible() throw (uno::RuntimeException)
{
drawing::LineStyle aLineStyle;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ) ) >>= aLineStyle;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")) ) >>= aLineStyle;
if( aLineStyle == drawing::LineStyle_NONE )
{
return sal_False;
@@ -248,11 +249,11 @@ void SAL_CALL
ScVbaLineFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException)
{
drawing::LineStyle aLineStyle;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ) ) >>= aLineStyle;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")) ) >>= aLineStyle;
if( !_visible )
{
aLineStyle = drawing::LineStyle_NONE;
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( aLineStyle ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")), uno::makeAny( aLineStyle ) );
}
else
{
@@ -267,7 +268,7 @@ double SAL_CALL
ScVbaLineFormat::getTransparency() throw (uno::RuntimeException)
{
sal_Int16 nTransparency = 0;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineTransparence" ) ) >>= nTransparency;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineTransparence")) ) >>= nTransparency;
double fTransparency = static_cast<double>( nTransparency );
return fTransparency / 100;
}
@@ -276,7 +277,7 @@ void SAL_CALL
ScVbaLineFormat::setTransparency( double _transparency ) throw (uno::RuntimeException)
{
sal_Int16 nTransparency = static_cast<sal_Int16>( _transparency * 100 );
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineTransparence" ), uno::makeAny( nTransparency ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineTransparence")), uno::makeAny( nTransparency ) );
}
sal_Int16 SAL_CALL
@@ -301,13 +302,13 @@ ScVbaLineFormat::getDashStyle() throw (uno::RuntimeException)
{
drawing::LineStyle eLineStyle;
//LineStyle integer in Xray
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ) ) >>= eLineStyle;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")) ) >>= eLineStyle;
if( eLineStyle == drawing::LineStyle_SOLID )
m_nLineDashStyle = office::MsoLineDashStyle::msoLineSolid;
else
{
drawing::LineDash aLineDash;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineDash" ) ) >>= aLineDash;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineDash")) ) >>= aLineDash;
if( aLineDash.Dots == 0 )
{
//LineDash
@@ -353,11 +354,11 @@ ScVbaLineFormat::setDashStyle( sal_Int32 _dashstyle ) throw (uno::RuntimeExcepti
m_nLineDashStyle = _dashstyle;
if( _dashstyle == office::MsoLineDashStyle::msoLineSolid )
{
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( drawing::LineStyle_SOLID ));
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")), uno::makeAny( drawing::LineStyle_SOLID ));
}
else
{
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( drawing::LineStyle_DASH ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")), uno::makeAny( drawing::LineStyle_DASH ) );
drawing::LineDash pLineDash;
Millimeter aMillimeter( m_nLineWeight );
sal_Int32 nPixel = static_cast< sal_Int32 >( aMillimeter.getInHundredthsOfOneMillimeter() );
@@ -413,9 +414,9 @@ ScVbaLineFormat::setDashStyle( sal_Int32 _dashstyle ) throw (uno::RuntimeExcepti
pLineDash.Distance = nPixel;
break;
default:
- throw uno::RuntimeException( rtl::OUString::createFromAscii("this MsoLineDashStyle is not supported."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this MsoLineDashStyle is not supported.")), uno::Reference< uno::XInterface >() );
}
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineDash" ), uno::makeAny( pLineDash ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineDash")), uno::makeAny( pLineDash ) );
}
}
@@ -453,3 +454,4 @@ ScVbaLineFormat::getServiceNames()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbalineformat.hxx b/vbahelper/source/vbahelper/vbalineformat.hxx
index 948a7d368f..d4eaadb1de 100644
--- a/vbahelper/source/vbahelper/vbalineformat.hxx
+++ b/vbahelper/source/vbahelper/vbalineformat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ protected:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
sal_Int32 convertLineStartEndNameToArrowheadStyle( rtl::OUString sLineName );
rtl::OUString convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (css::uno::RuntimeException);
- sal_Int32 calculateArrowheadSize();
+ sal_Int32 calculateArrowheadSize() const;
public:
ScVbaLineFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape );
@@ -80,3 +81,5 @@ public:
};
#endif//SC_VBA_XLINEFORMAT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbapagesetupbase.cxx b/vbahelper/source/vbahelper/vbapagesetupbase.cxx
index ff48f47464..7b509f9288 100644
--- a/vbahelper/source/vbahelper/vbapagesetupbase.cxx
+++ b/vbahelper/source/vbahelper/vbapagesetupbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -320,3 +321,4 @@ void SAL_CALL VbaPageSetupBase::setOrientation( sal_Int32 orientation ) throw (c
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbapictureformat.cxx b/vbahelper/source/vbahelper/vbapictureformat.cxx
index bcdf83a88c..34d3cf736d 100644
--- a/vbahelper/source/vbahelper/vbapictureformat.cxx
+++ b/vbahelper/source/vbahelper/vbapictureformat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,11 +43,11 @@ ScVbaPictureFormat::checkParameterRangeInDouble( double nRange, double nMin, dou
{
if( nRange < nMin )
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Parameter out of range, value is too small.") , uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parameter out of range, value is too small.")) , uno::Reference< uno::XInterface >() );
}
if( nRange > nMax )
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Parameter out of range, value is too high.") , uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parameter out of range, value is too high.")) , uno::Reference< uno::XInterface >() );
}
}
@@ -55,7 +56,7 @@ double SAL_CALL
ScVbaPictureFormat::getBrightness() throw (uno::RuntimeException)
{
sal_Int16 nLuminance = 0;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("AdjustLuminance") ) >>= nLuminance;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AdjustLuminance")) ) >>= nLuminance;
double fBrightness = static_cast< double >( nLuminance );
fBrightness = ( fBrightness +100 ) / 200;
return fBrightness;
@@ -67,14 +68,14 @@ ScVbaPictureFormat::setBrightness( double _brightness ) throw (uno::RuntimeExcep
checkParameterRangeInDouble( _brightness, 0.0, 1.0 );
double fLuminance = _brightness * 200 - 100;
sal_Int16 nLuminance = static_cast< sal_Int16 >( fLuminance );
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("AdjustLuminance"), uno::makeAny( nLuminance ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AdjustLuminance")), uno::makeAny( nLuminance ) );
}
double SAL_CALL
ScVbaPictureFormat::getContrast() throw (uno::RuntimeException)
{
sal_Int16 nContrast = 0;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("AdjustContrast") ) >>= nContrast;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AdjustContrast")) ) >>= nContrast;
double fContrast = static_cast< double >( nContrast );
fContrast = ( fContrast + 100 ) / 200;
return fContrast;
@@ -86,7 +87,7 @@ ScVbaPictureFormat::setContrast( double _contrast ) throw (uno::RuntimeException
checkParameterRangeInDouble( _contrast, 0.0, 1.0 );
double fContrast = _contrast * 200 - 100;
sal_Int16 nContrast = static_cast< sal_Int16 >( fContrast );
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("AdjustContrast"), uno::makeAny( nContrast ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AdjustContrast")), uno::makeAny( nContrast ) );
}
@@ -112,13 +113,14 @@ ScVbaPictureFormat::IncrementContrast( double increment ) throw (uno::RuntimeExc
{
double nContrast = getContrast();
nContrast += increment;
- if( increment < 0 )
+ //VBA, minz@cn.ibm.com.
+ if( nContrast < 0 )
{
- increment = 0.0;
+ nContrast = 0.0;
}
- if( increment > 1 )
+ if( nContrast > 1 )
{
- increment = 1.0;
+ nContrast = 1.0;
}
setContrast( nContrast );
}
@@ -142,3 +144,5 @@ ScVbaPictureFormat::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbapictureformat.hxx b/vbahelper/source/vbahelper/vbapictureformat.hxx
index 49245869ad..d11d8aecee 100644
--- a/vbahelper/source/vbahelper/vbapictureformat.hxx
+++ b/vbahelper/source/vbahelper/vbapictureformat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,5 @@ public:
};
#endif//SC_VBA_PICTUREFORMAT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbapropvalue.cxx b/vbahelper/source/vbahelper/vbapropvalue.cxx
index 22c87e9a6d..e75a7a45dd 100644
--- a/vbahelper/source/vbahelper/vbapropvalue.cxx
+++ b/vbahelper/source/vbahelper/vbapropvalue.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,5 @@ ScVbaPropValue::setValue( const css::uno::Any& _value ) throw (css::uno::Runtime
{
m_pListener->setValueEvent( _value );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx
index e0ec739f23..ca368e4471 100644
--- a/vbahelper/source/vbahelper/vbashape.cxx
+++ b/vbahelper/source/vbahelper/vbashape.cxx
@@ -1,7 +1,8 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,11 +36,12 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
#include <ooo/vba/word/WdRelativeHorizontalPosition.hpp>
#include <ooo/vba/word/WdRelativeVerticalPosition.hpp>
#include <comphelper/processfactory.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <svx/unopage.hxx>
#include <svx/unoshape.hxx>
@@ -53,7 +55,6 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-using namespace ::vos;
ScVbaShape::ScVbaShape( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< drawing::XShapes >& xShapes, const uno::Reference< frame::XModel >& xModel, sal_Int32 nType ) throw( lang::IllegalArgumentException ) : ScVbaShape_BASE( xParent, xContext ), m_xShape( xShape ), m_xShapes( xShapes ), m_nType( nType ), m_xModel( xModel )
{
@@ -69,7 +70,7 @@ ScVbaShape::ScVbaShape( const uno::Reference< uno::XComponentContext >& xContext
}
ScVbaShape::~ScVbaShape()
-{
+{
// dtor must never ever throw
/*try
{
@@ -78,10 +79,10 @@ ScVbaShape::~ScVbaShape()
}
catch( uno::Exception& )
{
- }*/
+ }*/
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::disposing( const lang::EventObject& rEventObject ) throw( uno::RuntimeException )
{
try
@@ -92,7 +93,7 @@ ScVbaShape::disposing( const lang::EventObject& rEventObject ) throw( uno::Runti
removeShapesListener();
if ( xShape.is() )
removeShapeListener();
- }
+ }
catch( uno::Exception& )
{
}
@@ -133,7 +134,7 @@ ScVbaShape::removeShapesListener() throw( uno::RuntimeException )
m_xShapes = NULL;
}
-sal_Int32
+sal_Int32
ScVbaShape::getType( const css::uno::Reference< drawing::XShape > xShape ) throw (uno::RuntimeException)
{
rtl::OUString sShapeType;
@@ -141,42 +142,42 @@ ScVbaShape::getType( const css::uno::Reference< drawing::XShape > xShape ) throw
sShapeType = xShapeDescriptor->getShapeType();
OSL_TRACE("ScVbaShape::getType: %s", rtl::OUStringToOString( sShapeType, RTL_TEXTENCODING_UTF8 ).getStr() );
// office::MsoShapeType::msoDiagram to "com.sun.star.drawing.GroupShape"
- if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.GroupShape" ) ) )
+ if( sShapeType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GroupShape")) ) )
return office::MsoShapeType::msoGroup;
- else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.GraphicObjectShape" ) ) )
+ else if( sShapeType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicObjectShape")) ) )
return office::MsoShapeType::msoPicture;
- else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.ControlShape" ) ) ||
- sShapeType.equals( rtl::OUString::createFromAscii( "FrameShape" ) ) )
+ else if( sShapeType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape")) ) ||
+ sShapeType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameShape")) ) )
return office::MsoShapeType::msoOLEControlObject;
// OOo don't support office::MsoShapeType::msoComment as a Shape.
- else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.OLE2Shape" ) ) )
+ else if( sShapeType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")) ) )
return office::MsoShapeType::msoChart;
// Art characters office::MsoShapeType::msoTextEffect, in OOo corresponding to "com.sun.star.drawing.CustomShape"
- else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.ConnectorShape" ) ) )
+ else if( sShapeType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ConnectorShape")) ) )
{
enum drawing::ConnectorType connectorType;
uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW );
- xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("EdgeKind")) >>= connectorType;
+ xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EdgeKind"))) >>= connectorType;
if( connectorType == drawing::ConnectorType_CURVE )
return office::MsoShapeType::msoFreeform;
else if( connectorType == drawing::ConnectorType_LINE )
return office::MsoShapeType::msoLine;
- else
+ else
return office::MsoShapeType::msoAutoShape;
}
- else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.LineShape" ) ) )
+ else if( sShapeType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.LineShape")) ) )
return office::MsoShapeType::msoLine;
- else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.CustomShape" ) ) ||
- sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.RectangleShape") ) )
+ else if( sShapeType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")) ) ||
+ sShapeType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.RectangleShape")) ) )
return office::MsoShapeType::msoAutoShape;
- else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.TextShape" ) ) )
+ else if( sShapeType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TextShape")) ) )
return office::MsoShapeType::msoTextBox;
else
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "the shape type do not be supported: " ) + sShapeType, uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("the shape type do not be supported: ")) + sShapeType, uno::Reference< uno::XInterface >() );
}
// Attributes
-rtl::OUString SAL_CALL
+rtl::OUString SAL_CALL
ScVbaShape::getName() throw (uno::RuntimeException)
{
rtl::OUString sName;
@@ -185,107 +186,148 @@ ScVbaShape::getName() throw (uno::RuntimeException)
return sName;
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setName( const rtl::OUString& _name ) throw (uno::RuntimeException)
{
uno::Reference< container::XNamed > xNamed( m_xShape, uno::UNO_QUERY_THROW );
xNamed->setName( _name );
}
-double SAL_CALL
+double SAL_CALL
ScVbaShape::getHeight() throw (uno::RuntimeException)
{
return m_pShapeHelper->getHeight();
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setHeight( double _height ) throw (uno::RuntimeException)
{
m_pShapeHelper->setHeight( _height );
}
-double SAL_CALL
+double SAL_CALL
ScVbaShape::getWidth() throw (uno::RuntimeException)
{
return m_pShapeHelper->getWidth();
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setWidth( double _width ) throw (uno::RuntimeException)
{
m_pShapeHelper->setWidth( _width );
}
-double SAL_CALL
+double SAL_CALL
ScVbaShape::getLeft() throw (uno::RuntimeException)
{
- return m_pShapeHelper->getLeft();
+ double left = 0;
+ try
+ {
+ left = m_pShapeHelper->getLeft();
+ }
+ catch( uno::Exception& )
+ {
+ // fail to get position by using XShape::getPosition()
+ sal_Int32 nLeft = 0;
+ m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition") ) ) >>= nLeft;
+ left = Millimeter::getInPoints( nLeft );
+ }
+ return left;
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setLeft( double _left ) throw (uno::RuntimeException)
{
- m_pShapeHelper->setLeft( _left );
+ try
+ {
+ m_pShapeHelper->setLeft( _left );
+ }
+ catch( uno::Exception& )
+ {
+ sal_Int32 nLeft = 0;
+ nLeft = Millimeter::getInHundredthsOfOneMillimeter( _left );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition")), uno::makeAny( nLeft ) );
+ }
}
-double SAL_CALL
+double SAL_CALL
ScVbaShape::getTop() throw (uno::RuntimeException)
{
- return m_pShapeHelper->getTop();
+ double top = 0;
+ try
+ {
+ top = m_pShapeHelper->getTop();
+ }
+ catch( uno::Exception& )
+ {
+ sal_Int32 nTop = 0;
+ m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition") ) ) >>= nTop;
+ top = Millimeter::getInPoints( nTop );
+ }
+ return top;
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setTop( double _top ) throw (uno::RuntimeException)
{
- return m_pShapeHelper->setTop( _top );
+ try
+ {
+ m_pShapeHelper->setTop( _top );
+ }
+ catch( uno::Exception& )
+ {
+ sal_Int32 nTop = 0;
+ nTop = Millimeter::getInHundredthsOfOneMillimeter( _top );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition")), uno::makeAny( nTop ) );
+ }
}
-sal_Bool SAL_CALL
+sal_Bool SAL_CALL
ScVbaShape::getVisible() throw (uno::RuntimeException)
{
//UNO Shapes are always visible
return sal_True;
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setVisible( sal_Bool /*_visible*/ ) throw (uno::RuntimeException)
{
//UNO Shapes are always visible
}
-sal_Int32 SAL_CALL
+sal_Int32 SAL_CALL
ScVbaShape::getZOrderPosition() throw (uno::RuntimeException)
{
sal_Int32 nZOrderPosition = 0;
- uno::Any aZOrderPosition = m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ) );
+ uno::Any aZOrderPosition = m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")) );
aZOrderPosition >>= nZOrderPosition;
return nZOrderPosition + 1;
}
-sal_Int32 SAL_CALL
+sal_Int32 SAL_CALL
ScVbaShape::getType() throw (uno::RuntimeException)
{
return m_nType;
}
-double SAL_CALL
+double SAL_CALL
ScVbaShape::getRotation() throw (uno::RuntimeException)
{
double dRotation = 0;
sal_Int32 nRotation = 0;
- m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "RotateAngle" ) ) >>= nRotation;
+ m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RotateAngle")) ) >>= nRotation;
dRotation = static_cast< double >( nRotation /100 );
return dRotation;
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setRotation( double _rotation ) throw (uno::RuntimeException)
{
sal_Int32 nRotation = static_cast < sal_Int32 > ( _rotation * 100 );
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "RotateAngle" ), uno::makeAny( nRotation ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RotateAngle")), uno::makeAny( nRotation ) );
}
-uno::Reference< msforms::XLineFormat > SAL_CALL
+uno::Reference< msforms::XLineFormat > SAL_CALL
ScVbaShape::getLine() throw (uno::RuntimeException)
{
// TODO should ongly return line
@@ -305,7 +347,7 @@ ScVbaShape::getPictureFormat() throw (uno::RuntimeException)
}
// Methods
-uno::Any SAL_CALL
+uno::Any SAL_CALL
ScVbaShape::TextFrame() throw (uno::RuntimeException)
{
uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW );
@@ -322,48 +364,48 @@ ScVbaShape::TextFrame() throw (uno::RuntimeException)
return uno::makeAny( uno::Reference< msforms::XTextFrame >( new VbaTextFrame( this, mxContext, m_xShape ) ) );
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::Delete() throw (uno::RuntimeException)
{
- OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_xShapes->remove( m_xShape );
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::ZOrder( sal_Int32 ZOrderCmd ) throw (uno::RuntimeException)
{
sal_Int32 nOrderPositon;
- uno::Any aOrderPostion = m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ) );
+ uno::Any aOrderPostion = m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")) );
aOrderPostion >>= nOrderPositon;
switch( ZOrderCmd )
{
case office::MsoZOrderCmd::msoBringToFront:
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( SAL_MAX_INT32 ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")), uno::makeAny( SAL_MAX_INT32 ) );
break;
case office::MsoZOrderCmd::msoSendToBack:
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( (sal_Int32)0 ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")), uno::makeAny( (sal_Int32)0 ) );
break;
case office::MsoZOrderCmd::msoBringForward:
nOrderPositon += 1;
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( nOrderPositon ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")), uno::makeAny( nOrderPositon ) );
break;
case office::MsoZOrderCmd::msoSendBackward:
if( nOrderPositon > 0 )
{
nOrderPositon -= 1;
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( nOrderPositon ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")), uno::makeAny( nOrderPositon ) );
}
break;
// below two commands use with Writer for text and image object.
case office::MsoZOrderCmd::msoBringInFrontOfText:
case office::MsoZOrderCmd::msoSendBehindText:
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "This ZOrderCmd is not implemented, it is use with writer." ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("This ZOrderCmd is not implemented, it is use with writer.")), uno::Reference< uno::XInterface >() );
default:
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Parameter." ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid Parameter.")), uno::Reference< uno::XInterface >() );
}
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::IncrementRotation( double Increment ) throw (uno::RuntimeException)
{
double nCurrentRotation = getRotation();
@@ -371,7 +413,7 @@ ScVbaShape::IncrementRotation( double Increment ) throw (uno::RuntimeException)
setRotation(nCurrentRotation);
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::IncrementLeft( double Increment ) throw (uno::RuntimeException)
{
double nCurrentLeft = getLeft();
@@ -379,7 +421,7 @@ ScVbaShape::IncrementLeft( double Increment ) throw (uno::RuntimeException)
setLeft(nCurrentLeft);
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::IncrementTop( double Increment ) throw (uno::RuntimeException)
{
double nCurrentTop = getTop();
@@ -387,7 +429,7 @@ ScVbaShape::IncrementTop( double Increment ) throw (uno::RuntimeException)
setTop(nCurrentTop);
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::ScaleHeight( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal_Int32 Scale ) throw (uno::RuntimeException)
{
double nHeight = getHeight();
@@ -412,11 +454,11 @@ ScVbaShape::ScaleHeight( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal
}
else
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "ScaleHeight.Scale wrong value is given." ) , uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScaleHeight.Scale wrong value is given.")) , uno::Reference< uno::XInterface >() );
}
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::ScaleWidth( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal_Int32 Scale ) throw (uno::RuntimeException)
{
double nWidth = getWidth();
@@ -441,7 +483,7 @@ ScVbaShape::ScaleWidth( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal_
}
else
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "ScaleHeight.Scale wrong value is given." ) , uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScaleHeight.Scale wrong value is given.")) , uno::Reference< uno::XInterface >() );
}
}
@@ -453,20 +495,20 @@ ScVbaShape::Select( const uno::Any& /*Replace*/ ) throw ( uno::RuntimeException
}
// This method should not be part of Shape, what we reall need to do is...
-// dynamically create the appropriate objects e.g. TextBox, Oval, Picture etc.
+// dynamically create the appropriate objects e.g. TextBox, Oval, Picture etc.
// ( e.g. the ones that really do have ShapeRange as an attribute )
-uno::Any SAL_CALL
+uno::Any SAL_CALL
ScVbaShape::ShapeRange( const uno::Any& index ) throw ( uno::RuntimeException )
{
- // perhaps we should store a reference to the Shapes Collection
+ // perhaps we should store a reference to the Shapes Collection
// in this class
// but anyway this method should not even be in this class
// #TODO not sure what the parent of the Shapes collection should be
-
+
XNamedObjectCollectionHelper< drawing::XShape >::XNamedVec aVec;
aVec.push_back( m_xShape );
uno::Reference< container::XIndexAccess > xIndexAccess( new XNamedObjectCollectionHelper< drawing::XShape >( aVec ) );
- uno::Reference< container::XChild > xChild( m_xShape, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XChild > xChild( m_xShape, uno::UNO_QUERY_THROW );
// #FIXME for want of a better parent, setting this
uno::Reference< msforms::XShapeRange > xShapeRange( new ScVbaShapeRange( mxParent, mxContext, xIndexAccess, uno::Reference< drawing::XDrawPage >( xChild->getParent(), uno::UNO_QUERY_THROW ), m_xModel ) );
if ( index.hasValue() )
@@ -474,90 +516,104 @@ ScVbaShape::ShapeRange( const uno::Any& index ) throw ( uno::RuntimeException )
return uno::makeAny( xShapeRange );
}
-sal_Bool SAL_CALL
+void SAL_CALL ScVbaShape::Copy() throw (uno::RuntimeException)
+{
+ if ( m_xModel.is() )
+ {
+ Select( uno::Any() );
+ // Copy this Shape.
+ rtl::OUString sUrl = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Copy") );
+ dispatchRequests( m_xModel, sUrl );
+ }
+}
+
+sal_Bool SAL_CALL
ScVbaShape::getLockAspectRatio() throw (uno::RuntimeException)
{
// FIXME:
return sal_False;
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setLockAspectRatio( sal_Bool /*_lockaspectratio*/ ) throw (uno::RuntimeException)
{
// FIXME:
}
-sal_Bool SAL_CALL
+sal_Bool SAL_CALL
ScVbaShape::getLockAnchor() throw (uno::RuntimeException)
{
// FIXME:
return sal_True;
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setLockAnchor( sal_Bool /*_lockanchor*/ ) throw (uno::RuntimeException)
{
// FIXME:
}
-sal_Int32 SAL_CALL
+sal_Int32 SAL_CALL
ScVbaShape::getRelativeHorizontalPosition() throw (uno::RuntimeException)
{
sal_Int32 nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionMargin;
- text::TextContentAnchorType eType = text::TextContentAnchorType_AT_PARAGRAPH;
- m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ) ) >>= eType;
-
- switch( eType )
+ sal_Int16 nType = text::RelOrientation::PAGE_LEFT;
+ m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrientRelation") ) ) >>= nType;
+
+ switch( nType )
{
- case text::TextContentAnchorType_AT_PARAGRAPH:
+ case text::RelOrientation::FRAME:
{
nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionColumn;
break;
}
- case text::TextContentAnchorType_AT_PAGE:
+ case text::RelOrientation::PAGE_FRAME:
{
nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionPage;
break;
}
- case text::TextContentAnchorType_AT_CHARACTER:
+ case text::RelOrientation::CHAR:
{
nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionCharacter;
break;
}
- case text::TextContentAnchorType_AT_FRAME:
- case text::TextContentAnchorType_AS_CHARACTER:
+ case text::RelOrientation::PAGE_PRINT_AREA:
{
nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionMargin;
break;
}
default:
{
- nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionMargin;
+ throw uno::RuntimeException( rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Shape::RelativeHorizontalPosition: not implemented" ) ), uno::Reference< uno::XInterface >() );
}
}
return nRelativeHorizontalPosition;
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalposition ) throw (uno::RuntimeException)
{
- text::TextContentAnchorType eType = text::TextContentAnchorType_AT_PARAGRAPH;
+ sal_Int16 nType = text::RelOrientation::PAGE_FRAME;
switch( _relativehorizontalposition )
{
case word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionCharacter:
{
- eType = text::TextContentAnchorType_AT_CHARACTER;
+ nType = text::RelOrientation::CHAR;
break;
}
case word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionColumn:
+ {
+ nType = text::RelOrientation::PAGE_FRAME;
+ break;
+ }
case word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionMargin:
{
- eType = text::TextContentAnchorType_AT_PARAGRAPH;
+ nType = text::RelOrientation::PAGE_PRINT_AREA;
break;
}
case word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionPage:
{
- eType = text::TextContentAnchorType_AT_PAGE;
+ nType = text::RelOrientation::PAGE_FRAME;
break;
}
default:
@@ -565,67 +621,70 @@ ScVbaShape::setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalpositi
DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString());
}
}
- m_xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ), uno::makeAny( eType ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrientRelation") ), uno::makeAny( nType ) );
}
-sal_Int32 SAL_CALL
+sal_Int32 SAL_CALL
ScVbaShape::getRelativeVerticalPosition() throw (uno::RuntimeException)
{
sal_Int32 nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionMargin;
- text::TextContentAnchorType eType = text::TextContentAnchorType_AT_PARAGRAPH;
- m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ) ) >>= eType;
-
- switch( eType )
+ sal_Int16 nType = text::RelOrientation::PAGE_FRAME;
+ m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VertOrientRelation") ) ) >>= nType;
+
+ switch( nType )
{
- case text::TextContentAnchorType_AT_PARAGRAPH:
+ case text::RelOrientation::FRAME:
{
nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionParagraph;
break;
}
- case text::TextContentAnchorType_AT_PAGE:
+ case text::RelOrientation::PAGE_FRAME:
{
nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionPage;
break;
}
- case text::TextContentAnchorType_AT_CHARACTER:
+ case text::RelOrientation::TEXT_LINE:
{
nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionLine;
break;
}
- case text::TextContentAnchorType_AT_FRAME:
- case text::TextContentAnchorType_AS_CHARACTER:
+ case text::RelOrientation::PAGE_PRINT_AREA:
{
nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionMargin;
break;
}
default:
{
- nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionMargin;
+ throw uno::RuntimeException( rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Shape::RelativeVerticalPosition: not implemented" ) ), uno::Reference< uno::XInterface >() );
}
}
return nRelativeVerticalPosition;
}
-void SAL_CALL
+void SAL_CALL
ScVbaShape::setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) throw (uno::RuntimeException)
{
- text::TextContentAnchorType eType = text::TextContentAnchorType_AT_PARAGRAPH;
+ sal_Int16 nType = text::RelOrientation::PAGE_FRAME;
switch( _relativeverticalposition )
{
case word::WdRelativeVerticalPosition::wdRelativeVerticalPositionLine:
{
- eType = text::TextContentAnchorType_AT_CHARACTER;
+ nType = text::RelOrientation::TEXT_LINE;
break;
}
case word::WdRelativeVerticalPosition::wdRelativeVerticalPositionParagraph:
+ {
+ nType = text::RelOrientation::FRAME;
+ break;
+ }
case word::WdRelativeVerticalPosition::wdRelativeVerticalPositionMargin:
{
- eType = text::TextContentAnchorType_AT_PARAGRAPH;
+ nType = text::RelOrientation::PAGE_PRINT_AREA;
break;
}
case word::WdRelativeVerticalPosition::wdRelativeVerticalPositionPage:
{
- eType = text::TextContentAnchorType_AT_PAGE;
+ nType = text::RelOrientation::PAGE_FRAME;
break;
}
default:
@@ -633,10 +692,10 @@ ScVbaShape::setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition )
DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString());
}
}
- m_xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ), uno::makeAny( eType ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VertOrientRelation") ), uno::makeAny( nType ) );
}
-uno::Any SAL_CALL
+uno::Any SAL_CALL
ScVbaShape::WrapFormat() throw (uno::RuntimeException)
{
uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW );
@@ -653,14 +712,14 @@ ScVbaShape::WrapFormat() throw (uno::RuntimeException)
}
-rtl::OUString&
+rtl::OUString&
ScVbaShape::getServiceImplName()
{
static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaShape") );
return sImplName;
}
-uno::Sequence< rtl::OUString >
+uno::Sequence< rtl::OUString >
ScVbaShape::getServiceNames()
{
static uno::Sequence< rtl::OUString > aServiceNames;
@@ -671,3 +730,5 @@ ScVbaShape::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx
index f6dc8ad72c..ec15b5fe5e 100644
--- a/vbahelper/source/vbahelper/vbashaperange.cxx
+++ b/vbahelper/source/vbahelper/vbashaperange.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,7 +83,7 @@ ScVbaShapeRange::getShapes() throw (uno::RuntimeException)
if ( !m_xShapes.is() )
{
uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
- m_xShapes.set( xMSF->createInstance( rtl::OUString::createFromAscii( "com.sun.star.drawing.ShapeCollection" ) ), uno::UNO_QUERY_THROW );
+ m_xShapes.set( xMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ShapeCollection")) ), uno::UNO_QUERY_THROW );
sal_Int32 nLen = m_xIndexAccess->getCount();
for ( sal_Int32 index = 0; index < nLen; ++index )
m_xShapes->add( uno::Reference< drawing::XShape >( m_xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ) );
@@ -125,6 +126,27 @@ ScVbaShapeRange::IncrementTop( double Increment ) throw (uno::RuntimeException)
}
}
+rtl::OUString SAL_CALL ScVbaShapeRange::getName() throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getName( );
+ }
+ throw uno::RuntimeException();
+}
+
+void SAL_CALL ScVbaShapeRange::setName( const rtl::OUString& _name ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->setName( _name );
+ }
+}
+
double SAL_CALL ScVbaShapeRange::getHeight() throw (uno::RuntimeException)
{
sal_Int32 nLen = getCount();
@@ -337,6 +359,16 @@ uno::Any SAL_CALL ScVbaShapeRange::WrapFormat( ) throw (css::uno::RuntimeExcept
throw uno::RuntimeException();
}
+void SAL_CALL ScVbaShapeRange::ZOrder( sal_Int32 ZOrderCmd ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->ZOrder( ZOrderCmd );
+ }
+}
+
uno::Type SAL_CALL
ScVbaShapeRange::getElementType() throw (uno::RuntimeException)
{
@@ -377,3 +409,5 @@ ScVbaShapeRange::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx
index f64b4aafd0..570e4030b3 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,7 +87,7 @@ void ScVbaShapes::initBaseCollection()
m_xNameAccess.set( xShapes, uno::UNO_QUERY );
}
-ScVbaShapes::ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess > xShapes, const uno::Reference< frame::XModel>& xModel ): ScVbaShapes_BASE( xParent, xContext, xShapes ), m_nNewShapeCount(0), m_xModel( xModel )
+ScVbaShapes::ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess > xShapes, const uno::Reference< frame::XModel>& xModel ): ScVbaShapes_BASE( xParent, xContext, xShapes, sal_True ), m_nNewShapeCount(0), m_xModel( xModel )
{
m_xShapes.set( xShapes, uno::UNO_QUERY_THROW );
m_xDrawPage.set( xShapes, uno::UNO_QUERY_THROW );
@@ -235,7 +236,7 @@ ScVbaShapes::createShape( rtl::OUString service ) throw (css::uno::RuntimeExcept
uno::Any
ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, uno::Any aRange ) throw (css::uno::RuntimeException)
{
- rtl::OUString sCreateShapeName( rtl::OUString::createFromAscii( "com.sun.star.drawing.RectangleShape" ) );
+ rtl::OUString sCreateShapeName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.RectangleShape")) );
sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX );
sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY );
sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
@@ -244,7 +245,7 @@ ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWi
uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
m_xShapes->add( xShape );
- rtl::OUString sName = createName( rtl::OUString::createFromAscii( "Rectangle" ) );
+ rtl::OUString sName(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rectangle")) ));
setDefaultShapeProperties( xShape );
setShape_NameProperty( xShape, sName );
@@ -267,7 +268,7 @@ ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWi
uno::Any
ScVbaShapes::AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, uno::Any aRange ) throw (css::uno::RuntimeException)
{
- rtl::OUString sCreateShapeName( rtl::OUString::createFromAscii( "com.sun.star.drawing.EllipseShape" ) );
+ rtl::OUString sCreateShapeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.EllipseShape") );
sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX );
sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY );
sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
@@ -289,7 +290,7 @@ ScVbaShapes::AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidt
setShape_AnchorTypeAndRangeProperty(xShape, _aRange);
*/
- rtl::OUString name = createName( rtl::OUString::createFromAscii( "Oval" ));
+ rtl::OUString name(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Oval"))));
setDefaultShapeProperties(xShape);
setShape_NameProperty(xShape, name);
@@ -320,12 +321,12 @@ ScVbaShapes::AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_In
sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( StartX );
sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( StartY );
- uno::Reference< drawing::XShape > xShape( createShape( rtl::OUString::createFromAscii("com.sun.star.drawing.LineShape") ), uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XShape > xShape( createShape( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.LineShape")) ), uno::UNO_QUERY_THROW );
m_xShapes->add( xShape );
awt::Point aMovePositionIfRange( 0, 0 );
- rtl::OUString name = createName( rtl::OUString::createFromAscii( "Line" ) );
+ rtl::OUString name(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Line")) ));
setDefaultShapeProperties(xShape);
setShape_NameProperty(xShape, name);
@@ -372,7 +373,7 @@ ScVbaShapes::AddTextbox( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _n
uno::Any
ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException)
{
- rtl::OUString sCreateShapeName( rtl::OUString::createFromAscii( "com.sun.star.drawing.TextShape" ) );
+ rtl::OUString sCreateShapeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TextShape") );
sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( _nLeft );
sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( _nTop );
sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( _nWidth );
@@ -383,7 +384,7 @@ ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft,
setDefaultShapeProperties(xShape);
- rtl::OUString sName = createName( rtl::OUString::createFromAscii( "Text Box") );
+ rtl::OUString sName(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text Box")) ));
setShape_NameProperty( xShape, sName );
awt::Size size;
@@ -392,23 +393,23 @@ ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft,
xShape->setSize(size);
uno::Reference< beans::XPropertySet > xShapeProps( xShape, uno::UNO_QUERY_THROW );
- xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "AnchorType" ), uno::makeAny( text::TextContentAnchorType_AT_PAGE ) );
- xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "HoriOrientRelation" ), uno::makeAny( text::RelOrientation::PAGE_LEFT ) );
- xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "HoriOrient" ), uno::makeAny( text::HoriOrientation::NONE ) );
- xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "HoriOrientPosition" ), uno::makeAny( nXPos ) );
+ xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorType")), uno::makeAny( text::TextContentAnchorType_AT_PAGE ) );
+ xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrientRelation")), uno::makeAny( text::RelOrientation::PAGE_LEFT ) );
+ xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrient")), uno::makeAny( text::HoriOrientation::NONE ) );
+ xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition")), uno::makeAny( nXPos ) );
- xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "VertOrientRelation" ), uno::makeAny( text::RelOrientation::PAGE_FRAME ) );
- xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "VertOrient" ), uno::makeAny( text::VertOrientation::NONE ) );
- xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "VertOrientPosition" ), uno::makeAny( nYPos ) );
+ xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientRelation")), uno::makeAny( text::RelOrientation::PAGE_FRAME ) );
+ xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrient")), uno::makeAny( text::VertOrientation::NONE ) );
+ xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition")), uno::makeAny( nYPos ) );
// set to visible
drawing::LineStyle aLineStyle = drawing::LineStyle_SOLID;
- xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( aLineStyle ) );
+ xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")), uno::makeAny( aLineStyle ) );
// set to font
sal_Int16 nLayerId = 1;
- rtl::OUString sLayerName = rtl::OUString::createFromAscii("Heaven");
- xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "LayerID" ), uno::makeAny( nLayerId ) );
- xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "LayerName" ), uno::makeAny( sLayerName ) );
+ rtl::OUString sLayerName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Heaven"));
+ xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayerID")), uno::makeAny( nLayerId ) );
+ xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayerName")), uno::makeAny( sLayerName ) );
ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
@@ -447,11 +448,11 @@ void
ScVbaShapes::setDefaultShapeProperties( uno::Reference< drawing::XShape > xShape ) throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW );
- xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillStyle" ), uno::makeAny( rtl::OUString::createFromAscii( "SOLID" ) ) );
- xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillColor"), uno::makeAny( sal_Int32(0xFFFFFF) ) );
- xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextWordWrap"), uno::makeAny( text::WrapTextMode_THROUGHT ) );
+ xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")), uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SOLID")) ) );
+ xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")), uno::makeAny( sal_Int32(0xFFFFFF) ) );
+ xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextWordWrap")), uno::makeAny( text::WrapTextMode_THROUGHT ) );
//not find in OOo2.3
- //xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "Opaque"), uno::makeAny( sal_True ) );
+ //xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Opaque")), uno::makeAny( sal_True ) );
}
void
@@ -460,7 +461,7 @@ ScVbaShapes::setShape_NameProperty( uno::Reference< css::drawing::XShape > xShap
uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW );
try
{
- xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "Name" ), uno::makeAny( sName ) );
+ xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), uno::makeAny( sName ) );
}
catch( script::BasicErrorException e )
{
@@ -476,13 +477,4 @@ ScVbaShapes::createName( rtl::OUString sName )
return sName;
}
-#if 0
-//TODO helperapi using a writer document
-awt::Point
-calculateTopLeftMargin( uno::Reference< XHelperInterface > xDocument )
-{
- awt::Point aPoint( 0, 0 );
- uno::Reference< frame::XModel > xModel( xDocument, uno::UNO_QUERY_THROW );
- return awt::Point();
-}
-#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbatextframe.cxx b/vbahelper/source/vbahelper/vbatextframe.cxx
index 18aef99e00..e215416a59 100644
--- a/vbahelper/source/vbahelper/vbatextframe.cxx
+++ b/vbahelper/source/vbahelper/vbatextframe.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,8 +44,8 @@ VbaTextFrame::setAsMSObehavior()
//set property TextWordWrap default as False.
// TextFitToSize control the text content. it seems we should set the default as False.
// com.sun.star.drawing.TextFitToSizeType.NONE
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextWordWrap" ), uno::makeAny( sal_False ) );
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextFitToSize" ), uno::makeAny( drawing::TextFitToSizeType_NONE ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextWordWrap")), uno::makeAny( sal_False ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextFitToSize")), uno::makeAny( drawing::TextFitToSizeType_NONE ) );
}
sal_Int32 VbaTextFrame::getMargin( rtl::OUString sMarginType )
@@ -69,7 +70,7 @@ VbaTextFrame::getAutoSize() throw (uno::RuntimeException)
// TextFitToSize control the text content.
// and in mso, there isnot option TextWordWrap which means auto wrap. the default is False.
sal_Bool bAutosize = sal_False;
- uno::Any aTextAutoGrowHeight = m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "TextAutoGrowHeight" ) );
+ uno::Any aTextAutoGrowHeight = m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextAutoGrowHeight")) );
aTextAutoGrowHeight >>= bAutosize;
return bAutosize;
}
@@ -78,13 +79,13 @@ void SAL_CALL
VbaTextFrame::setAutoSize( sal_Bool _autosize ) throw (uno::RuntimeException)
{
setAsMSObehavior();
- m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextAutoGrowHeight" ), uno::makeAny( _autosize ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextAutoGrowHeight")), uno::makeAny( _autosize ) );
}
float SAL_CALL
VbaTextFrame::getMarginBottom() throw (uno::RuntimeException)
{
- sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextLowerDistance" ) );
+ sal_Int32 nMargin = getMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextLowerDistance")) );
float fMargin = (float)Millimeter::getInPoints( nMargin );
return fMargin;
}
@@ -92,13 +93,13 @@ VbaTextFrame::getMarginBottom() throw (uno::RuntimeException)
void SAL_CALL
VbaTextFrame::setMarginBottom( float _marginbottom ) throw (uno::RuntimeException)
{
- setMargin( rtl::OUString::createFromAscii( "TextLowerDistance" ), _marginbottom );
+ setMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextLowerDistance")), _marginbottom );
}
float SAL_CALL
VbaTextFrame::getMarginTop() throw (uno::RuntimeException)
{
- sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextUpperDistance" ) );
+ sal_Int32 nMargin = getMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextUpperDistance")) );
float fMargin = (float)Millimeter::getInPoints( nMargin );
return fMargin;
}
@@ -106,13 +107,13 @@ VbaTextFrame::getMarginTop() throw (uno::RuntimeException)
void SAL_CALL
VbaTextFrame::setMarginTop( float _margintop ) throw (uno::RuntimeException)
{
- setMargin( rtl::OUString::createFromAscii( "TextUpperDistance" ), _margintop );
+ setMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextUpperDistance")), _margintop );
}
float SAL_CALL
VbaTextFrame::getMarginLeft() throw (uno::RuntimeException)
{
- sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextLeftDistance" ) );
+ sal_Int32 nMargin = getMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextLeftDistance")) );
float fMargin = (float)Millimeter::getInPoints( nMargin );
return fMargin;
}
@@ -120,13 +121,13 @@ VbaTextFrame::getMarginLeft() throw (uno::RuntimeException)
void SAL_CALL
VbaTextFrame::setMarginLeft( float _marginleft ) throw (uno::RuntimeException)
{
- setMargin( rtl::OUString::createFromAscii( "TextLeftDistance" ), _marginleft );
+ setMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextLeftDistance")), _marginleft );
}
float SAL_CALL
VbaTextFrame::getMarginRight() throw (uno::RuntimeException)
{
- sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextRightDistance" ) );
+ sal_Int32 nMargin = getMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextRightDistance")) );
float fMargin = (float)Millimeter::getInPoints( nMargin );
return fMargin;
}
@@ -134,7 +135,7 @@ VbaTextFrame::getMarginRight() throw (uno::RuntimeException)
void SAL_CALL
VbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException)
{
- setMargin( rtl::OUString::createFromAscii( "TextRightDistance" ), _marginright );
+ setMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextRightDistance")), _marginright );
}
@@ -164,3 +165,4 @@ VbaTextFrame::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbawindowbase.cxx b/vbahelper/source/vbahelper/vbawindowbase.cxx
index 3bff05ba15..e605e39b89 100644
--- a/vbahelper/source/vbahelper/vbawindowbase.cxx
+++ b/vbahelper/source/vbahelper/vbawindowbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -175,3 +176,5 @@ void VbaWindowBase::construct( const uno::Reference< frame::XController >& xCont
m_xController = xController;
m_xWindow = xWindow;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/util/makefile.mk b/vbahelper/util/makefile.mk
new file mode 100755
index 0000000000..48f4f9346e
--- /dev/null
+++ b/vbahelper/util/makefile.mk
@@ -0,0 +1,100 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..
+
+PRJNAME=vbahelper
+TARGET=vbahelper
+
+# --- Settings ---------------------------------------------------
+
+.INCLUDE : settings.mk
+
+TARGET_HELPER=vbahelper
+
+LIB1TARGET= $(SLB)$/$(TARGET).lib
+LIB1FILES=$(SLB)$/$(TARGET)bits.lib
+
+SHL1TARGET= $(TARGET_HELPER)$(DLLPOSTFIX)
+
+
+# dynamic libraries
+SHL1STDLIBS= \
+ $(CPPULIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(BASICLIB) \
+ $(TOOLSLIB) \
+ $(SALLIB)\
+ $(SFXLIB) \
+ $(SVTOOLLIB) \
+ $(SVLLIB) \
+ $(VCLLIB) \
+ $(SVTOOLLIB) \
+ $(MSFILTERLIB) \
+ $(TKLIB)
+
+SHL1DEPN=
+SHL1IMPLIB= i$(TARGET_HELPER)
+SHL1USE_EXPORTS=name
+SHL1LIBS=$(LIB1TARGET)
+
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME=$(SHL1TARGET)
+DEFLIB1NAME=$(TARGET)
+
+TARGET_MSFORMS=msforms
+SHL2TARGET=$(TARGET_MSFORMS)$(DLLPOSTFIX).uno
+SHL2IMPLIB= i$(TARGET_MSFORMS)
+
+SHL2VERSIONMAP=$(SOLARENV)/src/component.map
+SHL2DEF=$(MISC)$/$(SHL2TARGET).def
+DEF2NAME=$(SHL2TARGET)
+SHL2STDLIBS= \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(COMPHELPERLIB) \
+ $(SVLIB) \
+ $(TOOLSLIB) \
+ $(SALLIB)\
+ $(VBAHELPERLIB) \
+ $(SFXLIB) \
+ $(SVXLIB) \
+ $(SVTOOLLIB) \
+ $(SVLLIB) \
+ $(VCLLIB) \
+ $(TKLIB) \
+ $(BASICLIB) \
+ $(SVXMSFILTERLIB) \
+
+SHL2DEPN=$(SHL1TARGETN)
+SHL2LIBS=$(SLB)$/$(TARGET_MSFORMS).lib
+
+# --- Targets -----------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/vbahelper/util/msforms.component b/vbahelper/util/msforms.component
index 98ce4a8451..98ce4a8451 100644..100755
--- a/vbahelper/util/msforms.component
+++ b/vbahelper/util/msforms.component