summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/baside2.cxx2
-rw-r--r--basctl/source/basicide/basobj2.cxx18
-rw-r--r--basctl/source/basicide/macrodlg.cxx16
-rw-r--r--basic/inc/basic/sbmod.hxx4
-rw-r--r--basic/inc/basic/sbxvar.hxx12
-rwxr-xr-xbasic/source/classes/sb.cxx130
-rwxr-xr-xbasic/source/classes/sbunoobj.cxx23
-rw-r--r--basic/source/comp/codegen.cxx12
-rw-r--r--basic/source/comp/dim.cxx70
-rw-r--r--basic/source/comp/exprgen.cxx73
-rw-r--r--basic/source/comp/exprtree.cxx10
-rw-r--r--basic/source/comp/makefile.mk33
-rwxr-xr-xbasic/source/comp/sbcomp.cxx2
-rw-r--r--basic/source/inc/expr.hxx3
-rw-r--r--basic/source/inc/parser.hxx5
-rw-r--r--basic/source/inc/sbintern.hxx6
-rw-r--r--basic/source/inc/sbunoobj.hxx1
-rw-r--r--basic/source/inc/symtbl.hxx3
-rw-r--r--basic/source/runtime/methods1.cxx14
-rw-r--r--basic/source/runtime/step0.cxx223
-rw-r--r--basic/source/sbx/sbxbool.cxx18
-rw-r--r--basic/source/sbx/sbxbyte.cxx10
-rw-r--r--basic/source/sbx/sbxchar.cxx15
-rw-r--r--basic/source/sbx/sbxconv.hxx16
-rw-r--r--basic/source/sbx/sbxcurr.cxx26
-rw-r--r--basic/source/sbx/sbxdate.cxx12
-rw-r--r--basic/source/sbx/sbxdbl.cxx10
-rw-r--r--basic/source/sbx/sbxdec.cxx20
-rw-r--r--basic/source/sbx/sbxdec.hxx4
-rw-r--r--basic/source/sbx/sbxint.cxx38
-rw-r--r--basic/source/sbx/sbxlng.cxx10
-rw-r--r--basic/source/sbx/sbxres.cxx2
-rw-r--r--basic/source/sbx/sbxres.hxx2
-rw-r--r--basic/source/sbx/sbxscan.cxx37
-rw-r--r--basic/source/sbx/sbxsng.cxx10
-rw-r--r--basic/source/sbx/sbxstr.cxx50
-rw-r--r--basic/source/sbx/sbxuint.cxx10
-rw-r--r--basic/source/sbx/sbxulng.cxx10
-rw-r--r--basic/source/sbx/sbxvalue.cxx105
-rw-r--r--basic/source/sbx/sbxvar.cxx40
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx12
-rwxr-xr-xchart2/source/model/main/ChartModel.cxx1
-rw-r--r--configmgr/source/xcsparser.cxx10
-rw-r--r--desktop/inc/app.hxx3
-rw-r--r--desktop/source/app/app.cxx20
-rw-r--r--desktop/source/app/appfirststart.cxx102
-rw-r--r--desktop/win32/source/officeloader/officeloader.cxx1
-rw-r--r--editeng/source/editeng/eehtml.cxx12
-rwxr-xr-xediteng/source/editeng/impedit.hxx3
-rwxr-xr-xediteng/source/editeng/impedit4.cxx369
-rw-r--r--editeng/source/misc/svxacorr.cxx24
-rw-r--r--extensions/source/plugin/unx/npnapi.cxx31
-rw-r--r--extensions/source/plugin/unx/nppapi.cxx31
-rw-r--r--extras/source/autotext/lang/fr/acor_fr-FR.datbin31897 -> 4650 bytes
-rw-r--r--extras/source/autotext/lang/pt-BR/acor_pt-BR.datbin469488 -> 40513 bytes
-rw-r--r--filter/source/config/fragments/filters/MathML_XML__Math_.xcu2
-rw-r--r--filter/source/pdf/pdfexport.cxx14
-rw-r--r--framework/source/loadenv/loadenv.cxx3
-rw-r--r--i18npool/source/transliteration/transliterationImpl.cxx1
-rwxr-xr-xi18npool/source/transliteration/transliteration_body.cxx273
-rw-r--r--l10ntools/java/jpropex/java/JPropEx.java7
-rw-r--r--l10ntools/scripts/localize.pl2
-rw-r--r--l10ntools/scripts/tool/sdf.py11
-rw-r--r--l10ntools/scripts/tool/xtxex.py3
-rwxr-xr-xl10ntools/scripts/xhtex13
-rwxr-xr-xl10ntools/scripts/xtxex12
-rw-r--r--officecfg/registry/schema/org/openoffice/Setup.xcs9
-rw-r--r--oovbaapi/ooo/vba/excel/XGlobals.idl7
-rw-r--r--oovbaapi/ooo/vba/excel/XWorksheet.idl2
-rw-r--r--oox/prj/d.lst1
-rw-r--r--sal/textenc/convertadobe.tab2
-rw-r--r--sc/inc/scmatrix.hxx11
-rw-r--r--sc/source/core/tool/interpr1.cxx27
-rw-r--r--sc/source/core/tool/interpr4.cxx13
-rw-r--r--sc/source/core/tool/interpr5.cxx19
-rw-r--r--sc/source/core/tool/scmatrix.cxx5
-rw-r--r--sc/source/ui/vba/makefile.mk92
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx610
-rw-r--r--sc/source/ui/vba/vbaglobals.cxx28
-rw-r--r--sc/source/ui/vba/vbaglobals.hxx3
-rw-r--r--sc/source/ui/vba/vbanames.cxx5
-rwxr-xr-xsc/source/ui/vba/vbarange.cxx48
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx19
-rw-r--r--sc/source/ui/vba/vbaworkbooks.cxx2
-rw-r--r--sc/source/ui/vba/vbaworksheet.cxx45
-rw-r--r--sc/source/ui/vba/vbaworksheet.hxx6
-rw-r--r--sc/source/ui/vba/vbaworksheets.cxx2
-rw-r--r--scripting/source/basprov/basmodnode.cxx14
-rw-r--r--scripting/source/basprov/basprov.cxx2
-rw-r--r--setup_native/source/packinfo/spellchecker_selection.txt1
-rw-r--r--sfx2/inc/sfx2/docfile.hxx1
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx25
-rw-r--r--sfx2/source/doc/docfile.cxx47
-rw-r--r--sfx2/source/doc/doctemplates.cxx2
-rwxr-xr-xsfx2/source/doc/objmisc.cxx2
-rw-r--r--sfx2/source/doc/objstor.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx3
-rw-r--r--solenv/bin/transform_description.pl4
-rw-r--r--solenv/inc/minor.mk6
-rw-r--r--solenv/inc/tg_help.mk10
-rwxr-xr-xsolenv/inc/tg_xmerge.mk17
-rw-r--r--sot/source/sdstor/stgio.cxx2
-rw-r--r--sw/inc/undobj.hxx6
-rw-r--r--sw/source/core/doc/docedt.cxx33
-rw-r--r--sw/source/core/txtnode/txtedt.cxx271
-rw-r--r--sw/source/core/undo/makefile.mk1
-rw-r--r--sw/source/core/undo/unovwr.cxx136
-rwxr-xr-xtestautomation/dbaccess/optional/includes/db_Mozilla.inc34
-rwxr-xr-xtestautomation/framework/required/includes/window_functions.inc3
-rw-r--r--testautomation/graphics/required/includes/impress/im_003_.inc3
-rw-r--r--testautomation/graphics/required/includes/impress/im_004_.inc1
-rw-r--r--testautomation/writer/optional/includes/loadsave/w_loadsave.inc7
-rw-r--r--toolkit/source/awt/vclxwindows.cxx10
-rw-r--r--toolkit/source/helper/unowrapper.cxx15
-rw-r--r--unotools/inc/unotools/ucbhelper.hxx1
-rw-r--r--unotools/source/ucbhelper/ucbhelper.cxx49
-rw-r--r--vbahelper/inc/vbahelper/vbahelper.hxx7
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx47
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx24
-rwxr-xr-xvcl/source/gdi/print3.cxx22
-rw-r--r--vcl/source/window/seleng.cxx19
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx2
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx64
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkframe.hxx4
-rw-r--r--vcl/unx/source/app/wmadaptor.cxx9
125 files changed, 2429 insertions, 1498 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 9f97e1766c3b..d0a8ca1a6ddb 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -365,7 +365,7 @@ BOOL ModulWindow::BasicExecute()
break;
}
}
- else if ( !pMethod || ( nStart < nCurMethodStart ) )
+ else if ( !pMethod || ( nStart < nCurMethodStart && !pM->IsHidden() ) )
{
pMethod = pM;
nCurMethodStart = nStart;
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 3604866b4202..9604a8bd9933 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -364,13 +364,23 @@ Sequence< ::rtl::OUString > GetMethodNames( const ScriptDocument& rDocument, con
SbModuleRef xModule = new SbModule( rModName );
xModule->SetSource32( aOUSource );
USHORT nCount = xModule->GetMethods()->Count();
- aSeqMethods.realloc( nCount );
-
+ USHORT nRealCount = nCount;
for ( USHORT i = 0; i < nCount; i++ )
{
SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i );
+ if( pMethod->IsHidden() )
+ --nRealCount;
+ }
+ aSeqMethods.realloc( nRealCount );
+
+ USHORT iTarget = 0;
+ for ( USHORT i = 0 ; i < nCount; ++i )
+ {
+ SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i );
+ if( pMethod->IsHidden() )
+ continue;
DBG_ASSERT( pMethod, "Method not found! (NULL)" );
- aSeqMethods.getArray()[ i ] = pMethod->GetName();
+ aSeqMethods.getArray()[ iTarget++ ] = pMethod->GetName();
}
}
@@ -392,7 +402,7 @@ BOOL HasMethod( const ScriptDocument& rDocument, const String& rLibName, const S
if ( pMethods )
{
SbMethod* pMethod = (SbMethod*)pMethods->Find( rMethName, SbxCLASS_METHOD );
- if ( pMethod )
+ if ( pMethod && !pMethod->IsHidden() )
bHasMethod = TRUE;
}
}
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index 41a5fa488950..24bc5beacb30 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -554,11 +554,15 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox )
// Die Macros sollen in der Reihenfolge angezeigt werden,
// wie sie im Modul stehen.
MacroList aMacros;
- USHORT nMacros = pModule->GetMethods()->Count();
- USHORT nMethod;
- for ( nMethod = 0; nMethod < nMacros; nMethod++ )
+ USHORT nMacroCount = pModule->GetMethods()->Count();
+ USHORT nRealMacroCount = 0;
+ USHORT iMeth;
+ for ( iMeth = 0; iMeth < nMacroCount; iMeth++ )
{
- SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod );
+ SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( iMeth );
+ if( pMethod->IsHidden() )
+ continue;
+ ++nRealMacroCount;
DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" );
ULONG nPos = LIST_APPEND;
// Eventuell weiter vorne ?
@@ -580,8 +584,8 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox )
}
aMacroBox.SetUpdateMode( FALSE );
- for ( nMethod = 0; nMethod < nMacros; nMethod++ )
- aMacroBox.InsertEntry( aMacros.GetObject( nMethod )->GetName() );
+ for ( iMeth = 0; iMeth < nRealMacroCount; iMeth++ )
+ aMacroBox.InsertEntry( aMacros.GetObject( iMeth )->GetName() );
aMacroBox.SetUpdateMode( TRUE );
if ( aMacroBox.GetEntryCount() )
diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx
index bccf8212f10e..abb482f7bfe5 100644
--- a/basic/inc/basic/sbmod.hxx
+++ b/basic/inc/basic/sbmod.hxx
@@ -44,6 +44,7 @@ class SbProcedureProperty;
class SbIfaceMapperMethod;
class SbClassModuleObject;
+struct ClassModuleRunInitItem;
struct SbClassData;
class SbModuleImpl;
@@ -71,6 +72,7 @@ protected:
SbxObjectRef pDocObject; // an impl object ( used by Document Modules )
bool bIsProxyModule;
+ static void implProcessModuleRunInit( ClassModuleRunInitItem& rItem );
void StartDefinitions();
SbMethod* GetMethod( const String&, SbxDataType );
SbProperty* GetProperty( const String&, SbxDataType );
@@ -134,7 +136,7 @@ public:
void SetVBACompat( BOOL bCompat );
INT32 GetModuleType() { return mnType; }
void SetModuleType( INT32 nType ) { mnType = nType; }
- bool GetIsProxyModule() { return bIsProxyModule; }
+ bool isProxyModule() { return bIsProxyModule; }
void AddVarName( const String& aName );
void RemoveVars();
::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule();
diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx
index 4d9d19b52a59..0cddcbdf8d17 100644
--- a/basic/inc/basic/sbxvar.hxx
+++ b/basic/inc/basic/sbxvar.hxx
@@ -178,7 +178,7 @@ struct SbxValues
sal_uInt64 uInt64;
int nInt;
unsigned int nUInt;
- String* pString;
+ ::rtl::OUString* pOUString;
SbxDecimal* pDecimal;
SbxBase* pObj;
@@ -212,7 +212,7 @@ struct SbxValues
SbxValues( double _nDouble ): nDouble( _nDouble ), eType(SbxDOUBLE) {}
SbxValues( int _nInt ): nInt( _nInt ), eType(SbxINT) {}
SbxValues( unsigned int _nUInt ): nUInt( _nUInt ), eType(SbxUINT) {}
- SbxValues( const String* _pString ): pString( (String*) _pString ), eType(SbxSTRING) {}
+ SbxValues( const ::rtl::OUString* _pString ): pOUString( (::rtl::OUString*)_pString ), eType(SbxSTRING) {}
SbxValues( SbxBase* _pObj ): pObj( _pObj ), eType(SbxOBJECT) {}
SbxValues( sal_Unicode* _pChar ): pChar( _pChar ), eType(SbxLPSTR) {}
SbxValues( void* _pData ): pData( _pData ), eType(SbxPOINTER) {}
@@ -237,7 +237,8 @@ class SbxValue : public SbxBase
SbxValue* TheRealValue() const;
protected:
SbxValues aData; // Data
- String aPic; // Picture-String
+ ::rtl::OUString aPic; // Picture-String
+ String aToolString; // tool string copy
virtual void Broadcast( ULONG ); // Broadcast-Call
virtual ~SbxValue();
@@ -303,6 +304,7 @@ public:
UINT16 GetErr() const;
const String& GetString() const;
const String& GetCoreString() const;
+ ::rtl::OUString GetOUString() const;
SbxDecimal* GetDecimal() const;
SbxBase* GetObject() const;
BOOL HasObject() const;
@@ -325,8 +327,8 @@ public:
BOOL PutDate( double );
BOOL PutBool( BOOL );
BOOL PutErr( USHORT );
- BOOL PutStringExt( const String& ); // with extended analysis (International, "TRUE"/"FALSE")
- BOOL PutString( const String& );
+ BOOL PutStringExt( const ::rtl::OUString& ); // with extended analysis (International, "TRUE"/"FALSE")
+ BOOL PutString( const ::rtl::OUString& );
BOOL PutString( const sal_Unicode* ); // Type = SbxSTRING
BOOL PutpChar( const sal_Unicode* ); // Type = SbxLPSTR
BOOL PutDecimal( SbxDecimal* pDecimal );
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index e28b0a304f28..056c2ea38c4c 100755
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -57,6 +57,7 @@
#include <vos/mutex.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "errobject.hxx"
+#include <hash_map>
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/script/ModuleInfo.hpp>
@@ -552,6 +553,39 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
USHORT nFlags_ = pProp->GetFlags();
pProp->SetFlag( SBX_NO_BROADCAST );
SbxProperty* pNewProp = new SbxProperty( *pProp );
+
+ // Special handling for modules instances and collections, they need
+ // to be instantiated, otherwise all refer to the same base object
+ SbxDataType eVarType = pProp->GetType();
+ if( eVarType == SbxOBJECT )
+ {
+ SbxBase* pObjBase = pProp->GetObject();
+ SbxObject* pObj = PTR_CAST(SbxObject,pObjBase);
+ if( pObj != NULL )
+ {
+ String aObjClass = pObj->GetClassName();
+ (void)aObjClass;
+
+ SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase);
+ if( pClassModuleObj != NULL )
+ {
+ SbModule* pLclClassModule = pClassModuleObj->getClassModule();
+ SbClassModuleObject* pNewObj = new SbClassModuleObject( pLclClassModule );
+ pNewObj->SetName( pProp->GetName() );
+ pNewObj->SetParent( pLclClassModule->pParent );
+ pNewProp->PutObject( pNewObj );
+ }
+ else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) )
+ {
+ String aCollectionName( RTL_CONSTASCII_USTRINGPARAM("Collection") );
+ BasicCollection* pNewCollection = new BasicCollection( aCollectionName );
+ pNewCollection->SetName( pProp->GetName() );
+ pNewCollection->SetParent( pClassModule->pParent );
+ pNewProp->PutObject( pNewCollection );
+ }
+ }
+ }
+
pNewProp->ResetFlag( SBX_NO_BROADCAST );
pNewProp->SetParent( this );
pProps->PutDirect( pNewProp, i );
@@ -726,6 +760,7 @@ SbClassData::SbClassData( void )
void SbClassData::clear( void )
{
mxIfaces->Clear();
+ maRequiredTypes.clear();
}
SbClassFactory::SbClassFactory( void )
@@ -981,6 +1016,72 @@ SbModule* StarBASIC::FindModule( const String& rName )
return NULL;
}
+
+struct ClassModuleRunInitItem
+{
+ SbModule* m_pModule;
+ bool m_bProcessing;
+ bool m_bRunInitDone;
+ //ModuleVector m_vModulesDependingOnThisModule;
+
+ ClassModuleRunInitItem( void )
+ : m_pModule( NULL )
+ , m_bProcessing( false )
+ , m_bRunInitDone( false )
+ {}
+ ClassModuleRunInitItem( SbModule* pModule )
+ : m_pModule( pModule )
+ , m_bProcessing( false )
+ , m_bRunInitDone( false )
+ {}
+};
+
+typedef std::hash_map< ::rtl::OUString, ClassModuleRunInitItem,
+ ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInitDependencyMap;
+
+static ModuleInitDependencyMap* GpMIDMap = NULL;
+
+void SbModule::implProcessModuleRunInit( ClassModuleRunInitItem& rItem )
+{
+ ModuleInitDependencyMap& rMIDMap = *GpMIDMap;
+
+ rItem.m_bProcessing = true;
+
+ //bool bAnyDependencies = true;
+ SbModule* pModule = rItem.m_pModule;
+ if( pModule->pClassData != NULL )
+ {
+ StringVector& rReqTypes = pModule->pClassData->maRequiredTypes;
+ if( rReqTypes.size() > 0 )
+ {
+ for( StringVector::iterator it = rReqTypes.begin() ; it != rReqTypes.end() ; ++it )
+ {
+ String& rStr = *it;
+
+ // Is required type a class module?
+ ModuleInitDependencyMap::iterator itFind = rMIDMap.find( rStr );
+ if( itFind != rMIDMap.end() )
+ {
+ ClassModuleRunInitItem& rParentItem = itFind->second;
+ if( rParentItem.m_bProcessing )
+ {
+ // TODO: raise error?
+ DBG_ERROR( "Cyclic module dependency detected" );
+ continue;
+ }
+
+ if( !rParentItem.m_bRunInitDone )
+ implProcessModuleRunInit( rParentItem );
+ }
+ }
+ }
+ }
+
+ pModule->RunInit();
+ rItem.m_bRunInitDone = true;
+ rItem.m_bProcessing = false;
+}
+
// Run Init-Code of all modules (including inserted libraries)
void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit )
{
@@ -994,10 +1095,33 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit )
// compile modules first then RunInit ( otherwise there is
// can be order dependency, e.g. classmodule A has a member
// of of type classmodule B and classmodule B hasn't been compiled yet )
+
+ // Consider required types to init in right order. Class modules
+ // that are required by other modules have to be initialized first.
+ ModuleInitDependencyMap aMIDMap;
+ GpMIDMap = &aMIDMap;
for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ )
{
SbModule* pModule = (SbModule*)pModules->Get( nMod );
- pModule->RunInit();
+ String aModuleName = pModule->GetName();
+ if( pModule->isProxyModule() )
+ aMIDMap[aModuleName] = ClassModuleRunInitItem( pModule );
+ }
+
+ ModuleInitDependencyMap::iterator it;
+ for( it = aMIDMap.begin() ; it != aMIDMap.end(); ++it )
+ {
+ ClassModuleRunInitItem& rItem = it->second;
+ SbModule::implProcessModuleRunInit( rItem );
+ }
+ GpMIDMap = NULL;
+
+ // Call RunInit on standard modules
+ for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ )
+ {
+ SbModule* pModule = (SbModule*)pModules->Get( nMod );
+ if( !pModule->isProxyModule() )
+ pModule->RunInit();
}
// Check all objects if they are BASIC,
@@ -1962,7 +2086,7 @@ void BasicCollection::CollItem( SbxArray* pPar_ )
if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() )
pRes = xItemArray->Get32( nIndex );
if( !pRes )
- SetError( SbxERR_BAD_INDEX );
+ SetError( SbERR_BAD_ARGUMENT );
else
*(pPar_->Get(0)) = *pRes;
}
@@ -1980,6 +2104,6 @@ void BasicCollection::CollRemove( SbxArray* pPar_ )
if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() )
xItemArray->Remove32( nIndex );
else
- SetError( SbxERR_BAD_INDEX );
+ SetError( SbERR_BAD_ARGUMENT );
}
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index df13bc7ec571..c9123b06341b 100755
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -71,6 +71,7 @@
#include <com/sun/star/bridge/oleautomation/Date.hpp>
#include <com/sun/star/bridge/oleautomation/Decimal.hpp>
#include <com/sun/star/bridge/oleautomation/Currency.hpp>
+#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
using com::sun::star::uno::Reference;
@@ -300,7 +301,12 @@ SbUnoObject* createOLEObject_Impl( const String& aType )
SbUnoObject* pUnoObj = NULL;
if( xOLEFactory.is() )
{
- Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aType );
+ // some type names available in VBA can not be directly used in COM
+ ::rtl::OUString aOLEType = aType;
+ if ( aOLEType.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SAXXMLReader30" ) ) ) )
+ aOLEType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Msxml2.SAXXMLReader.3.0" ) );
+
+ Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aOLEType );
if( xOLEObject.is() )
{
Any aAny;
@@ -1460,7 +1466,7 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
aRetVal.setValue( &c , getCharCppuType() );
break;
}
- case TypeClass_STRING: aRetVal <<= ::rtl::OUString( pVar->GetString() ); break;
+ case TypeClass_STRING: aRetVal <<= pVar->GetOUString(); break;
case TypeClass_FLOAT: aRetVal <<= pVar->GetSingle(); break;
case TypeClass_DOUBLE: aRetVal <<= pVar->GetDouble(); break;
//case TypeClass_OCTET: break;
@@ -2265,6 +2271,7 @@ Reference< XInvocation > createDynamicInvocationFor( const Any& aAny );
SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ )
: SbxObject( aName_ )
, bNeedIntrospection( TRUE )
+ , bIgnoreNativeCOMObjectMembers( FALSE )
{
static Reference< XIntrospection > xIntrospection;
@@ -2310,6 +2317,12 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ )
bNeedIntrospection = FALSE;
return;
}
+
+ // Ignore introspection based members for COM objects to avoid
+ // hiding of equally named COM symbols, e.g. XInvocation::getValue
+ Reference< oleautomation::XAutomationObject > xAutomationObject( aUnoObj_, UNO_QUERY );
+ if( xAutomationObject.is() )
+ bIgnoreNativeCOMObjectMembers = TRUE;
}
maTmpUnoObj = aUnoObj_;
@@ -2553,7 +2566,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t )
if( !pRes )
{
::rtl::OUString aUName( rName );
- if( mxUnoAccess.is() )
+ if( mxUnoAccess.is() && !bIgnoreNativeCOMObjectMembers )
{
if( mxExactName.is() )
{
@@ -2713,10 +2726,12 @@ void SbUnoObject::implCreateAll( void )
// Instrospection besorgen
Reference< XIntrospectionAccess > xAccess = mxUnoAccess;
- if( !xAccess.is() )
+ if( !xAccess.is() || bIgnoreNativeCOMObjectMembers )
{
if( mxInvocation.is() )
xAccess = mxInvocation->getIntrospection();
+ else if( bIgnoreNativeCOMObjectMembers )
+ return;
}
if( !xAccess.is() )
return;
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index 46f829b382e8..93fb18baf86e 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -138,11 +138,10 @@ void SbiCodeGen::Save()
pCLASSFAC->AddClassModule( &rMod );
nIfaceCount = pParser->aIfaceVector.size();
+ if( !rMod.pClassData )
+ rMod.pClassData = new SbClassData;
if( nIfaceCount )
{
- if( !rMod.pClassData )
- rMod.pClassData = new SbClassData;
-
for( int i = 0 ; i < nIfaceCount ; i++ )
{
const String& rIfaceName = pParser->aIfaceVector[i];
@@ -152,6 +151,8 @@ void SbiCodeGen::Save()
pIfaces->Insert( pIfaceVar, pIfaces->Count() );
}
}
+
+ rMod.pClassData->maRequiredTypes = pParser->aRequiredTypes;
}
else
{
@@ -161,6 +162,7 @@ void SbiCodeGen::Save()
rMod.mnType = com::sun::star::script::ModuleType::NORMAL;
rMod.bIsProxyModule = false;
}
+
if( pParser->bText )
p->SetFlag( SBIMG_COMPARETEXT );
// GlobalCode-Flag
@@ -257,6 +259,10 @@ void SbiCodeGen::Save()
if( !pProc->IsPublic() )
pMeth->SetFlag( SBX_PRIVATE );
+ // Declare? -> Hidden
+ if( pProc->GetLib().Len() > 0 )
+ pMeth->SetFlag( SBX_HIDDEN );
+
pMeth->nStart = pProc->GetAddr();
pMeth->nLine1 = pProc->GetLine1();
pMeth->nLine2 = pProc->GetLine2();
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index bff3d22dd9b0..59d77e3f3757 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -161,6 +161,9 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, BOOL bAsNewAlreadyParsed )
// In den String-Pool uebernehmen
rDef.SetTypeId( aGblStrings.Add( aCompleteName ) );
+
+ if( rDef.IsNew() && pProc == NULL )
+ aRequiredTypes.push_back( aCompleteName );
}
eType = SbxOBJECT;
break;
@@ -874,7 +877,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl )
}
if( bCompatible && Peek() == PARAMARRAY )
{
- if( bByVal || bByVal || bOptional )
+ if( bByVal || bOptional )
Error( SbERR_UNEXPECTED, PARAMARRAY );
Next();
bParamArray = TRUE;
@@ -946,6 +949,8 @@ void SbiParser::DefDeclare( BOOL bPrivate )
Error( SbERR_UNEXPECTED, eCurTok );
else
{
+ bool bFunction = (eCurTok == FUNCTION);
+
SbiProcDef* pDef = ProcDecl( TRUE );
if( pDef )
{
@@ -970,7 +975,70 @@ void SbiParser::DefDeclare( BOOL bPrivate )
aPublics.Add( pDef );
if ( pDef )
+ {
pDef->SetPublic( !bPrivate );
+
+ // New declare handling
+ if( pDef->GetLib().Len() > 0 )
+ {
+ if( bNewGblDefs && nGblChain == 0 )
+ {
+ nGblChain = aGen.Gen( _JUMP, 0 );
+ bNewGblDefs = FALSE;
+ }
+
+ USHORT nSavLine = nLine;
+ aGen.Statement();
+ pDef->Define();
+ pDef->SetLine1( nSavLine );
+ pDef->SetLine2( nSavLine );
+
+ SbiSymPool& rPool = pDef->GetParams();
+ USHORT nParCount = rPool.GetSize();
+
+ SbxDataType eType = pDef->GetType();
+ if( bFunction )
+ aGen.Gen( _PARAM, 0, sal::static_int_cast< UINT16 >( eType ) );
+
+ if( nParCount > 1 )
+ {
+ aGen.Gen( _ARGC );
+
+ for( USHORT i = 1 ; i < nParCount ; ++i )
+ {
+ SbiSymDef* pParDef = rPool.Get( i );
+ SbxDataType eParType = pParDef->GetType();
+
+ aGen.Gen( _PARAM, i, sal::static_int_cast< UINT16 >( eParType ) );
+ aGen.Gen( _ARGV );
+
+ USHORT nTyp = sal::static_int_cast< USHORT >( pParDef->GetType() );
+ if( pParDef->IsByVal() )
+ {
+ // Reset to avoid additional byval in call to wrapper function
+ pParDef->SetByVal( FALSE );
+ nTyp |= 0x8000;
+ }
+ aGen.Gen( _ARGTYP, nTyp );
+ }
+ }
+
+ aGen.Gen( _LIB, aGblStrings.Add( pDef->GetLib() ) );
+
+ SbiOpcode eOp = pDef->IsCdecl() ? _CALLC : _CALL;
+ USHORT nId = pDef->GetId();
+ if( pDef->GetAlias().Len() )
+ nId = ( nId & 0x8000 ) | aGblStrings.Add( pDef->GetAlias() );
+ if( nParCount > 1 )
+ nId |= 0x8000;
+ aGen.Gen( eOp, nId, sal::static_int_cast< UINT16 >( eType ) );
+
+ if( bFunction )
+ aGen.Gen( _PUT );
+
+ aGen.Gen( _LEAVE );
+ }
+ }
}
}
}
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
index 60869307aecf..3e034af204f5 100644
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -115,13 +115,8 @@ void SbiExprNode::Gen( RecursiveMode eRecMode )
}
else
{
- SbiProcDef* pProc = aVar.pDef->GetProcDef();
- // per DECLARE definiert?
- if( pProc && pProc->GetLib().Len() )
- eOp = pProc->IsCdecl() ? _CALLC : _CALL;
- else
- eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL :
- (aVar.pDef->IsGlobal() ? _FIND_G : _FIND);
+ eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL :
+ (aVar.pDef->IsGlobal() ? _FIND_G : _FIND);
}
if( eOp == _FIND )
@@ -187,17 +182,6 @@ void SbiExprNode::GenElement( SbiOpcode eOp )
aVar.pPar->Gen();
}
- SbiProcDef* pProc = aVar.pDef->GetProcDef();
- // per DECLARE definiert?
- if( pProc )
- {
- // Dann evtl. einen LIB-Befehl erzeugen
- if( pProc->GetLib().Len() )
- pGen->Gen( _LIB, pGen->GetParser()->aGblStrings.Add( pProc->GetLib() ) );
- // und den Aliasnamen nehmen
- if( pProc->GetAlias().Len() )
- nId = ( nId & 0x8000 ) | pGen->GetParser()->aGblStrings.Add( pProc->GetAlias() );
- }
pGen->Gen( eOp, nId, sal::static_int_cast< UINT16 >( GetType() ) );
if( aVar.pvMorePar )
@@ -223,13 +207,8 @@ void SbiExprList::Gen()
{
pParser->aGen.Gen( _ARGC );
// AB 10.1.96: Typ-Anpassung bei DECLARE
- USHORT nCount = 1, nParAnz = 0;
- SbiSymPool* pPool = NULL;
- if( pProc )
- {
- pPool = &pProc->GetParams();
- nParAnz = pPool->GetSize();
- }
+ USHORT nCount = 1 /*, nParAnz = 0*/;
+// SbiSymPool* pPool = NULL;
for( SbiExpression* pExpr = pFirst; pExpr; pExpr = pExpr->pNext,nCount++ )
{
pExpr->Gen();
@@ -239,6 +218,7 @@ void SbiExprList::Gen()
USHORT nSid = pParser->aGblStrings.Add( pExpr->GetName() );
pParser->aGen.Gen( _ARGN, nSid );
+ /* TODO: Check after Declare concept change
// AB 10.1.96: Typanpassung bei named -> passenden Parameter suchen
if( pProc )
{
@@ -246,39 +226,26 @@ void SbiExprList::Gen()
pParser->Error( SbERR_NO_NAMED_ARGS );
// Spaeter, wenn Named Args bei DECLARE moeglich
- /*
- for( USHORT i = 1 ; i < nParAnz ; i++ )
- {
- SbiSymDef* pDef = pPool->Get( i );
- const String& rName = pDef->GetName();
- if( rName.Len() )
- {
- if( pExpr->GetName().ICompare( rName )
- == COMPARE_EQUAL )
- {
- pParser->aGen.Gen( _ARGTYP, pDef->GetType() );
- break;
- }
- }
- }
- */
+ //for( USHORT i = 1 ; i < nParAnz ; i++ )
+ //{
+ // SbiSymDef* pDef = pPool->Get( i );
+ // const String& rName = pDef->GetName();
+ // if( rName.Len() )
+ // {
+ // if( pExpr->GetName().ICompare( rName )
+ // == COMPARE_EQUAL )
+ // {
+ // pParser->aGen.Gen( _ARGTYP, pDef->GetType() );
+ // break;
+ // }
+ // }
+ //}
}
+ */
}
else
{
pParser->aGen.Gen( _ARGV );
-
- // Funktion mit DECLARE -> Typ-Anpassung
- if( pProc && nCount < nParAnz )
- {
- SbiSymDef* pDef = pPool->Get( nCount );
- USHORT nTyp = sal::static_int_cast< USHORT >(
- pDef->GetType() );
- // Zustzliches Flag fr BYVAL einbauen
- if( pDef->IsByVal() )
- nTyp |= 0x8000;
- pParser->aGen.Gen( _ARGTYP, nTyp );
- }
}
}
}
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 42969b98d0d8..7a4ea5965558 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -338,15 +338,6 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
// damit erwischen wir n% = 5 : print n
eType = eDefType;
}
- // Funktion?
- if( pDef->GetProcDef() )
- {
- SbiProcDef* pProc = pDef->GetProcDef();
- if( pPar && pProc->GetLib().Len() ) // DECLARE benutzt?
- pPar->SetProc( pProc );
- // Wenn keine Pars, vorerst nichts machen
- // Pruefung auf Typ-Anzahl waere denkbar
- }
// Typcheck bei Variablen:
// ist explizit im Scanner etwas anderes angegeben?
// Bei Methoden ist dies OK!
@@ -868,7 +859,6 @@ SbiExprList::SbiExprList( SbiParser* p )
{
pParser = p;
pFirst = NULL;
- pProc = NULL;
nExpr =
nDim = 0;
bError =
diff --git a/basic/source/comp/makefile.mk b/basic/source/comp/makefile.mk
index bd3c750df355..d65f6a431e43 100644
--- a/basic/source/comp/makefile.mk
+++ b/basic/source/comp/makefile.mk
@@ -34,39 +34,26 @@ TARGET=comp
.INCLUDE : settings.mk
-CXXFILES= \
- sbcomp.cxx \
- dim.cxx \
- exprtree.cxx \
- exprnode.cxx \
- exprgen.cxx \
- codegen.cxx \
- io.cxx \
- loops.cxx \
- parser.cxx \
- scanner.cxx \
- token.cxx \
- symtbl.cxx \
- buffer.cxx
-
SLOFILES= \
- $(SLO)$/sbcomp.obj \
+ $(SLO)$/buffer.obj \
+ $(SLO)$/codegen.obj \
$(SLO)$/dim.obj \
- $(SLO)$/exprtree.obj \
- $(SLO)$/exprnode.obj \
$(SLO)$/exprgen.obj \
- $(SLO)$/codegen.obj \
+ $(SLO)$/exprnode.obj \
+ $(SLO)$/exprtree.obj \
$(SLO)$/io.obj \
$(SLO)$/loops.obj \
$(SLO)$/parser.obj \
+ $(SLO)$/sbcomp.obj \
$(SLO)$/scanner.obj \
- $(SLO)$/token.obj \
$(SLO)$/symtbl.obj \
- $(SLO)$/buffer.obj
+ $(SLO)$/token.obj
EXCEPTIONSFILES= \
- $(SLO)$/parser.obj \
- $(SLO)$/exprtree.obj
+ $(SLO)$/codegen.obj \
+ $(SLO)$/dim.obj \
+ $(SLO)$/exprtree.obj \
+ $(SLO)$/parser.obj
# --- Targets --------------------------------------------------------------
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index e6fe73177dd2..5b7e5c70591d 100755
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -261,7 +261,7 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl,
{
aStr.AppendAscii( "Entering " );
}
- String aModuleName = pModule->GetName();
+ String aModuleName = pTraceMod->GetName();
aStr += aModuleName;
if( pMethod != NULL )
{
diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx
index 9b8f51d09dea..851d0d6f1fe5 100644
--- a/basic/source/inc/expr.hxx
+++ b/basic/source/inc/expr.hxx
@@ -234,7 +234,6 @@ class SbiExprList { // Basisklasse fuer Parameter und Dims
protected:
SbiParser* pParser; // Parser
SbiExpression* pFirst; // Expressions
- SbiProcDef* pProc; // DECLARE-Funktion (Parameter-Anpassung)
short nExpr; // Anzahl Expressions
short nDim; // Anzahl Dimensionen
BOOL bError; // TRUE: Fehler
@@ -249,8 +248,6 @@ public:
SbiExpression* Get( short );
BOOL Test( const SbiProcDef& ); // Parameter-Checks
void Gen(); // Code-Erzeugung
- // Setzen einer Funktionsdefinition zum Abgleich der Parameter
- void SetProc( SbiProcDef* p ) { pProc = p; }
void addExpression( SbiExpression* pExpr );
};
diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx
index 1161c4ed259d..733a65db7f61 100644
--- a/basic/source/inc/parser.hxx
+++ b/basic/source/inc/parser.hxx
@@ -34,7 +34,7 @@
#include <vector>
-typedef ::std::vector< String > IfaceVector;
+typedef ::std::vector< String > StringVector;
struct SbiParseStack;
@@ -81,7 +81,8 @@ public:
BOOL bText; // OPTION COMPARE TEXT
BOOL bExplicit; // TRUE: OPTION EXPLICIT
BOOL bClassModule; // TRUE: OPTION ClassModule
- IfaceVector aIfaceVector; // Holds all interfaces implemented by a class module
+ StringVector aIfaceVector; // Holds all interfaces implemented by a class module
+ StringVector aRequiredTypes; // Types used in Dim As New <type> outside subs
SbxDataType eDefTypes[26]; // DEFxxx-Datentypen
SbiParser( StarBASIC*, SbModule* );
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index 59cfe21d25a8..4c54e2301bd5 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -50,10 +50,16 @@ public:
virtual SbxObject* CreateObject( const String& );
};
+typedef ::std::vector< String > StringVector;
+
struct SbClassData
{
SbxArrayRef mxIfaces;
+ // types this module depends on because of use in Dim As New <type>
+ // needed for initialization order of class modules
+ StringVector maRequiredTypes;
+
SbClassData( void );
~SbClassData( void )
{ clear(); }
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index 2d9836e3530e..78afa9783ca8 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -52,6 +52,7 @@ class SbUnoObject: public SbxObject
::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactName;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactNameInvocation;
BOOL bNeedIntrospection;
+ BOOL bIgnoreNativeCOMObjectMembers;
::com::sun::star::uno::Any maTmpUnoObj; // Only to save obj for doIntrospection!
// Hilfs-Methode zum Anlegen der dbg_-Properties
diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx
index 9bd8cfd49754..f2fbaa0ac1f1 100644
--- a/basic/source/inc/symtbl.hxx
+++ b/basic/source/inc/symtbl.hxx
@@ -159,7 +159,8 @@ public:
void SetOptional() { bOpt = TRUE; }
void SetParamArray() { bParamArray = TRUE; }
void SetWithEvents() { bWithEvents = TRUE; }
- void SetByVal() { bByVal = TRUE; }
+ void SetByVal( BOOL bByVal_ = TRUE )
+ { bByVal = bByVal_; }
void SetStatic( BOOL bAsStatic = TRUE ) { bStatic = bAsStatic; }
void SetNew() { bNew = TRUE; }
void SetDefinedAs() { bAs = TRUE; }
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 8c7da2403705..62e9c388f5c5 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -528,11 +528,13 @@ RTLFUNC(DoEvents)
(void)pBasic;
(void)bWrite;
(void)rPar;
- Timer aTimer;
- aTimer.SetTimeout( 1 );
- aTimer.Start();
- while ( aTimer.IsActive() )
- Application::Yield();
+ // Dummy implementation as the following code leads
+ // to performance problems for unknown reasons
+ //Timer aTimer;
+ //aTimer.SetTimeout( 1 );
+ //aTimer.Start();
+ //while ( aTimer.IsActive() )
+ // Application::Reschedule();
}
RTLFUNC(GetGUIVersion)
@@ -1586,8 +1588,6 @@ RTLFUNC(Join)
}
-typedef ::std::vector< String > StringVector;
-
RTLFUNC(Split)
{
(void)pBasic;
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 29965c7e9da5..06a8bb19af00 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -431,144 +431,143 @@ void SbiRuntime::StepPUT()
void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bHandleDefaultProp )
{
// #67733 Typen mit Array-Flag sind auch ok
- SbxDataType eValType = refVal->GetType();
+
+ // Check var, !object is no error for sure if, only if type is fixed
SbxDataType eVarType = refVar->GetType();
- if( (eValType != SbxOBJECT
- && eValType != SbxEMPTY
-// seems like when using the default method its possible for objects
-// to be empty ( no broadcast has taken place yet ) or the actual value is
-
- && !bHandleDefaultProp
- && !(eValType & SbxARRAY)) ||
- (eVarType != SbxOBJECT
- && eVarType != SbxEMPTY
- && !bHandleDefaultProp
- && !(eVarType & SbxARRAY) ) )
+ if( !bHandleDefaultProp && eVarType != SbxOBJECT && !(eVarType & SbxARRAY) && refVar->IsFixed() )
{
Error( SbERR_INVALID_USAGE_OBJECT );
+ return;
}
- else
+
+ // Check value, !object is no error for sure if, only if type is fixed
+ SbxDataType eValType = refVal->GetType();
+// bool bGetValObject = false;
+ if( !bHandleDefaultProp && eValType != SbxOBJECT && !(eValType & SbxARRAY) && refVal->IsFixed() )
{
- // Getting in here causes problems with objects with default properties
- // if they are SbxEMPTY I guess
- if ( !bHandleDefaultProp || ( bHandleDefaultProp && refVal->GetType() == SbxOBJECT ) )
+ Error( SbERR_INVALID_USAGE_OBJECT );
+ return;
+ }
+
+ // Getting in here causes problems with objects with default properties
+ // if they are SbxEMPTY I guess
+ if ( !bHandleDefaultProp || ( bHandleDefaultProp && eValType == SbxOBJECT ) )
+ {
+ // Auf refVal GetObject fuer Collections ausloesen
+ SbxBase* pObjVarObj = refVal->GetObject();
+ if( pObjVarObj )
{
- // Auf refVal GetObject fuer Collections ausloesen
- SbxBase* pObjVarObj = refVal->GetObject();
- if( pObjVarObj )
- {
- SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj);
+ SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj);
- // #67733 Typen mit Array-Flag sind auch ok
- if( refObjVal )
- refVal = refObjVal;
- else if( !(eValType & SbxARRAY) )
- refVal = NULL;
- }
+ // #67733 Typen mit Array-Flag sind auch ok
+ if( refObjVal )
+ refVal = refObjVal;
+ else if( !(eValType & SbxARRAY) )
+ refVal = NULL;
}
+ }
- // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als
- // Object deklarierten Variable zugewiesen werden, kann hier
- // refVal ungueltig sein!
- if( !refVal )
+ // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als
+ // Object deklarierten Variable zugewiesen werden, kann hier
+ // refVal ungueltig sein!
+ if( !refVal )
+ {
+ Error( SbERR_INVALID_USAGE_OBJECT );
+ }
+ else
+ {
+ // Store auf die eigene Methode (innerhalb einer Function)?
+ BOOL bFlagsChanged = FALSE;
+ USHORT n = 0;
+ if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
{
- Error( SbERR_INVALID_USAGE_OBJECT );
+ bFlagsChanged = TRUE;
+ n = refVar->GetFlags();
+ refVar->SetFlag( SBX_WRITE );
}
- else
- {
- // Store auf die eigene Methode (innerhalb einer Function)?
- BOOL bFlagsChanged = FALSE;
- USHORT n = 0;
- if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
- {
- bFlagsChanged = TRUE;
- n = refVar->GetFlags();
- refVar->SetFlag( SBX_WRITE );
- }
- SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar);
- if( pProcProperty )
- pProcProperty->setSet( true );
+ SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar);
+ if( pProcProperty )
+ pProcProperty->setSet( true );
- if ( bHandleDefaultProp )
+ if ( bHandleDefaultProp )
+ {
+ // get default properties for lhs & rhs where necessary
+ // SbxVariable* defaultProp = NULL; unused variable
+ bool bLHSHasDefaultProp = false;
+ // LHS try determine if a default prop exists
+ if ( refVar->GetType() == SbxOBJECT )
{
- // get default properties for lhs & rhs where necessary
- // SbxVariable* defaultProp = NULL; unused variable
- bool bLHSHasDefaultProp = false;
- // LHS try determine if a default prop exists
- if ( refVar->GetType() == SbxOBJECT )
+ SbxVariable* pDflt = getDefaultProp( refVar );
+ if ( pDflt )
{
- SbxVariable* pDflt = getDefaultProp( refVar );
- if ( pDflt )
- {
- refVar = pDflt;
- bLHSHasDefaultProp = true;
- }
+ refVar = pDflt;
+ bLHSHasDefaultProp = true;
}
- // RHS only get a default prop is the rhs has one
- if ( refVal->GetType() == SbxOBJECT )
- {
- // check if lhs is a null object
- // if it is then use the object not the default property
- SbxObject* pObj = NULL;
+ }
+ // RHS only get a default prop is the rhs has one
+ if ( refVal->GetType() == SbxOBJECT )
+ {
+ // check if lhs is a null object
+ // if it is then use the object not the default property
+ SbxObject* pObj = NULL;
- pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar);
+ pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar);
- // calling GetObject on a SbxEMPTY variable raises
- // object not set errors, make sure its an Object
- if ( !pObj && refVar->GetType() == SbxOBJECT )
- {
- SbxBase* pObjVarObj = refVar->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
- }
- SbxVariable* pDflt = NULL;
- if ( pObj || bLHSHasDefaultProp )
- // lhs is either a valid object || or has a defaultProp
- pDflt = getDefaultProp( refVal );
- if ( pDflt )
- refVal = pDflt;
+ // calling GetObject on a SbxEMPTY variable raises
+ // object not set errors, make sure its an Object
+ if ( !pObj && refVar->GetType() == SbxOBJECT )
+ {
+ SbxBase* pObjVarObj = refVar->GetObject();
+ pObj = PTR_CAST(SbxObject,pObjVarObj);
}
+ SbxVariable* pDflt = NULL;
+ if ( pObj || bLHSHasDefaultProp )
+ // lhs is either a valid object || or has a defaultProp
+ pDflt = getDefaultProp( refVal );
+ if ( pDflt )
+ refVal = pDflt;
}
+ }
- // Handle withevents
- BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS );
- if ( bWithEvents )
- {
- Reference< XInterface > xComListener;
-
- SbxBase* pObj = refVal->GetObject();
- SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL;
- if( pUnoObj != NULL )
- {
- Any aControlAny = pUnoObj->getUnoAny();
- String aDeclareClassName = refVar->GetDeclareClassName();
- ::rtl::OUString aVBAType = aDeclareClassName;
- ::rtl::OUString aPrefix = refVar->GetName();
- SbxObjectRef xScopeObj = refVar->GetParent();
- xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj );
-
- refVal->SetDeclareClassName( aDeclareClassName );
- refVal->SetComListener( xComListener ); // Hold reference
- }
+ // Handle withevents
+ BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS );
+ if ( bWithEvents )
+ {
+ Reference< XInterface > xComListener;
- *refVar = *refVal;
- }
- else
+ SbxBase* pObj = refVal->GetObject();
+ SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL;
+ if( pUnoObj != NULL )
{
- *refVar = *refVal;
+ Any aControlAny = pUnoObj->getUnoAny();
+ String aDeclareClassName = refVar->GetDeclareClassName();
+ ::rtl::OUString aVBAType = aDeclareClassName;
+ ::rtl::OUString aPrefix = refVar->GetName();
+ SbxObjectRef xScopeObj = refVar->GetParent();
+ xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj );
+
+ refVal->SetDeclareClassName( aDeclareClassName );
+ refVal->SetComListener( xComListener ); // Hold reference
}
- // lhs is a property who's value is currently (Empty e.g. no broadcast yet)
- // in this case if there is a default prop involved the value of the
- // default property may infact be void so the type will also be SbxEMPTY
- // in this case we do not want to call checkUnoStructCopy 'cause that will
- // cause an error also
- if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) )
- // #67607 Uno-Structs kopieren
- checkUnoStructCopy( refVal, refVar );
- if( bFlagsChanged )
- refVar->SetFlags( n );
+ *refVar = *refVal;
}
+ else
+ {
+ *refVar = *refVal;
+ }
+
+ // lhs is a property who's value is currently (Empty e.g. no broadcast yet)
+ // in this case if there is a default prop involved the value of the
+ // default property may infact be void so the type will also be SbxEMPTY
+ // in this case we do not want to call checkUnoStructCopy 'cause that will
+ // cause an error also
+ if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) )
+ // #67607 Uno-Structs kopieren
+ checkUnoStructCopy( refVal, refVar );
+ if( bFlagsChanged )
+ refVar->SetFlags( n );
}
}
diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx
index 728b8e1472b0..3216e401b707 100644
--- a/basic/source/sbx/sbxbool.cxx
+++ b/basic/source/sbx/sbxbool.cxx
@@ -87,21 +87,20 @@ enum SbxBOOL ImpGetBool( const SbxValues* p )
case SbxSTRING:
case SbxLPSTR:
nRes = SbxFALSE;
- if( p->pString )
+ if ( p->pOUString )
{
- if( p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_TRUE ) ) )
+ if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_TRUE ) ) )
nRes = SbxTRUE;
- else if( !p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_FALSE ) ) )
+ else if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) )
{
// Jetzt kann es noch in eine Zahl konvertierbar sein
BOOL bError = TRUE;
double n;
SbxDataType t;
USHORT nLen = 0;
- String s( *p->pString );
- if( ImpScan( s, n, t, &nLen ) == SbxERR_OK )
+ if( ImpScan( *p->pOUString, n, t, &nLen ) == SbxERR_OK )
{
- if( nLen == s.Len() )
+ if( nLen == p->pOUString->getLength() )
{
bError = FALSE;
if( n != 0.0 )
@@ -202,9 +201,10 @@ void ImpPutBool( SbxValues* p, INT16 n )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- *p->pString = SbxRes( n ? STRING_TRUE : STRING_FALSE );
+ if ( !p->pOUString )
+ p->pOUString = new ::rtl::OUString( SbxRes( n ? STRING_TRUE : STRING_FALSE ) );
+ else
+ *p->pOUString = SbxRes( n ? STRING_TRUE : STRING_FALSE );
break;
case SbxOBJECT:
diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx
index 8485b7105e21..e13c63967fc3 100644
--- a/basic/source/sbx/sbxbyte.cxx
+++ b/basic/source/sbx/sbxbyte.cxx
@@ -165,13 +165,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXBYTE )
{
@@ -279,9 +279,9 @@ void ImpPutByte( SbxValues* p, BYTE n )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx
index f9bca67a28d9..bd4ce91f451b 100644
--- a/basic/source/sbx/sbxchar.cxx
+++ b/basic/source/sbx/sbxchar.cxx
@@ -39,7 +39,7 @@ using namespace rtl;
xub_Unicode ImpGetChar( const SbxValues* p )
{
SbxValues aTmp;
- xub_Unicode nRes;
+ xub_Unicode nRes = 0;
start:
switch( +p->eType )
{
@@ -156,13 +156,11 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- nRes = 0;
- else
+ if ( p->pOUString )
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXCHAR )
{
@@ -274,9 +272,10 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- *p->pString = n;
+ if ( !p->pOUString )
+ p->pOUString = new ::rtl::OUString( n );
+ else
+ *p->pOUString = ::rtl::OUString( n );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx
index c1ada75286ab..16fec542cded 100644
--- a/basic/source/sbx/sbxconv.hxx
+++ b/basic/source/sbx/sbxconv.hxx
@@ -33,13 +33,13 @@
class SbxArray;
// SBXSCAN.CXX
-extern void ImpCvtNum( double nNum, short nPrec, String& rRes, BOOL bCoreString=FALSE );
+extern void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString=FALSE );
extern SbxError ImpScan
- ( const String& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen,
+ ( const ::rtl::OUString& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen,
BOOL bAllowIntntl=FALSE, BOOL bOnlyIntntl=FALSE );
// mit erweiterter Auswertung (International, "TRUE"/"FALSE")
-extern BOOL ImpConvStringExt( String& rSrc, SbxDataType eTargetType );
+extern BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType );
// SBXINT.CXX
@@ -116,9 +116,9 @@ void ImpPutDate( SbxValues*, double );
// SBXSTR.CXX
-String ImpGetString( const SbxValues* );
-String ImpGetCoreString( const SbxValues* );
-void ImpPutString( SbxValues*, const String* );
+::rtl::OUString ImpGetString( const SbxValues* );
+::rtl::OUString ImpGetCoreString( const SbxValues* );
+void ImpPutString( SbxValues*, const ::rtl::OUString* );
// SBXCHAR.CXX
@@ -145,7 +145,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* );
void ImpPutBool( SbxValues*, INT16 );
// ByteArry <--> String
-SbxArray* StringToByteArray(const String& rStr);
-String ByteArrayToString(SbxArray* pArr);
+SbxArray* StringToByteArray(const ::rtl::OUString& rStr);
+::rtl::OUString ByteArrayToString(SbxArray* pArr);
#endif
diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index 74380f84a75f..e27b11d5166c 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -37,8 +37,8 @@
#include <basic/sbxvar.hxx>
#include "sbxconv.hxx"
-static String ImpCurrencyToString( const SbxINT64& );
-static SbxINT64 ImpStringToCurrency( const String& );
+static ::rtl::OUString ImpCurrencyToString( const SbxINT64& );
+static SbxINT64 ImpStringToCurrency( const ::rtl::OUString& );
SbxINT64 ImpGetCurrency( const SbxValues* p )
{
@@ -121,10 +121,10 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes.SetNull();
else
- nRes = ImpStringToCurrency( *p->pString );
+ nRes = ImpStringToCurrency( *p->pOUString );
break;
case SbxOBJECT:
{
@@ -224,10 +224,10 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
- *p->pString = ImpCurrencyToString( r );
+ *p->pOUString = ImpCurrencyToString( r );
break;
case SbxOBJECT:
{
@@ -319,7 +319,7 @@ start:
// Hilfs-Funktionen zur Wandlung
-static String ImpCurrencyToString( const SbxINT64 &r )
+static ::rtl::OUString ImpCurrencyToString( const SbxINT64 &r )
{
BigInt a10000 = 10000;
@@ -331,20 +331,20 @@ static String ImpCurrencyToString( const SbxINT64 &r )
aFrac %= a10000;
aFrac += a10000;
- String aString;
+ ::rtl::OUString aString;
if( r.nHigh < 0 )
- aString = '-';
+ aString = ::rtl::OUString( (sal_Unicode)'-' );
aString += aInt.GetString();
- aString += '.';
+ aString += ::rtl::OUString( (sal_Unicode)'.' );
aString += aFrac.GetString().GetBuffer()+1;
return aString;
}
-static SbxINT64 ImpStringToCurrency( const String &r )
+static SbxINT64 ImpStringToCurrency( const ::rtl::OUString &r )
{
int nDec = 4;
String aStr;
- const sal_Unicode* p = r.GetBuffer();
+ const sal_Unicode* p = r.getStr();
if( *p == '-' )
aStr += *p++;
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index ce532fed0482..3a0636e4e7fc 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -86,7 +86,7 @@ double ImpGetDate( const SbxValues* p )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
@@ -126,7 +126,7 @@ double ImpGetDate( const SbxValues* p )
pFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
nIndex, LANGUAGE_GERMAN, eLangType );
- BOOL bSuccess = pFormatter->IsNumberFormat( *p->pString, nIndex, nRes );
+ BOOL bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes );
if ( bSuccess )
{
short nType_ = pFormatter->GetType( nIndex );
@@ -248,8 +248,8 @@ start:
case SbxLPSTR:
#ifndef DOS
{
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
Color* pColor;
LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
@@ -299,7 +299,9 @@ start:
nIndex,
LANGUAGE_GERMAN,
eLangType );
- pFormatter->GetOutputString( n, nIndex, *p->pString, &pColor );
+ String aTmpString;
+ pFormatter->GetOutputString( n, nIndex, aTmpString, &pColor );
+ *p->pOUString = aTmpString;
delete pFormatter;
#endif
break;
diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx
index 460f331c59b8..be55d3409131 100644
--- a/basic/source/sbx/sbxdbl.cxx
+++ b/basic/source/sbx/sbxdbl.cxx
@@ -76,7 +76,7 @@ double ImpGetDouble( const SbxValues* p )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
{
nRes = 0;
if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour
@@ -86,7 +86,7 @@ double ImpGetDouble( const SbxValues* p )
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
{
nRes = 0;
if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour
@@ -188,9 +188,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 14, *p->pString, bCoreString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 14, *p->pOUString, bCoreString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx
index 319b0aac366c..2191d91c8d82 100644
--- a/basic/source/sbx/sbxdec.cxx
+++ b/basic/source/sbx/sbxdec.cxx
@@ -211,7 +211,7 @@ void SbxDecimal::setUInt( unsigned int val )
// sbxscan.cxx
void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep );
-bool SbxDecimal::setString( String* pString )
+bool SbxDecimal::setString( ::rtl::OUString* pOUString )
{
static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US );
@@ -224,11 +224,11 @@ bool SbxDecimal::setString( String* pString )
HRESULT hResult;
if( cDecimalSep != '.' || cThousandSep != ',' )
{
- int nLen = pString->Len();
+ int nLen = pOUString->getLength();
sal_Unicode* pBuffer = new sal_Unicode[nLen + 1];
pBuffer[nLen] = 0;
- const sal_Unicode* pSrc = pString->GetBuffer();
+ const sal_Unicode* pSrc = pOUString->getStr();
int i;
for( i = 0 ; i < nLen ; ++i )
pBuffer[i] = pSrc[i];
@@ -248,7 +248,7 @@ bool SbxDecimal::setString( String* pString )
}
else
{
- hResult = VarDecFromStr( (OLECHAR*)pString->GetBuffer(), nLANGID, 0, &maDec );
+ hResult = VarDecFromStr( (OLECHAR*)pOUString->getStr(), nLANGID, 0, &maDec );
}
bRet = ( hResult == S_OK );
return bRet;
@@ -373,7 +373,7 @@ bool SbxDecimal::setSingle( float val ) { (void)val; return false; }
bool SbxDecimal::setDouble( double val ) { (void)val; return false; }
void SbxDecimal::setInt( int val ) { (void)val; }
void SbxDecimal::setUInt( unsigned int val ) { (void)val; }
-bool SbxDecimal::setString( String* pString ) { (void)pString; return false; }
+bool SbxDecimal::setString( ::rtl::OUString* pOUString ) { (void)pOUString; return false; }
bool SbxDecimal::getChar( sal_Unicode& rVal ) { (void)rVal; return false; }
bool SbxDecimal::getByte( BYTE& rVal ) { (void)rVal; return false; }
@@ -388,7 +388,7 @@ bool SbxDecimal::getUInt( unsigned int& rVal ) { (void)rVal; return false; }
#endif
-bool SbxDecimal::getString( String& rString )
+bool SbxDecimal::getString( ::rtl::OUString& rString )
{
#ifdef WIN32
static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US );
@@ -528,7 +528,7 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- pnDecRes->setString( p->pString ); break;
+ pnDecRes->setString( p->pOUString ); break;
case SbxOBJECT:
{
SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
@@ -670,10 +670,10 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
// ImpCvtNum( (double) n, 0, *p->pString );
- pDec->getString( *p->pString );
+ pDec->getString( *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxdec.hxx b/basic/source/sbx/sbxdec.hxx
index 03f97bec5992..cd80bbad282e 100644
--- a/basic/source/sbx/sbxdec.hxx
+++ b/basic/source/sbx/sbxdec.hxx
@@ -85,7 +85,7 @@ public:
bool setDouble( double val );
void setInt( int val );
void setUInt( unsigned int val );
- bool setString( String* pString );
+ bool setString( ::rtl::OUString* pOUString );
void setDecimal( SbxDecimal* pDecimal )
{
#ifdef WIN32
@@ -106,7 +106,7 @@ public:
bool getDouble( double& rVal );
bool getInt( int& rVal );
bool getUInt( unsigned int& rVal );
- bool getString( String& rString );
+ bool getString( ::rtl::OUString& rString );
bool operator -= ( const SbxDecimal &r );
bool operator += ( const SbxDecimal &r );
diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx
index 406b8599e568..47c38aecb1c2 100644
--- a/basic/source/sbx/sbxint.cxx
+++ b/basic/source/sbx/sbxint.cxx
@@ -154,13 +154,13 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXINT )
{
@@ -275,9 +275,9 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
@@ -456,20 +456,19 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
- ::rtl::OUString aOUStr( *p->pString );
::rtl::OString aOStr = ::rtl::OUStringToOString
- ( aOUStr, RTL_TEXTENCODING_ASCII_US );
+ ( *p->pOUString, RTL_TEXTENCODING_ASCII_US );
nRes = aOStr.toInt64();
if( nRes == 0 )
{
// Check if really 0 or invalid conversion
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else
nRes = ImpDoubleToSalInt64( d );
@@ -575,13 +574,12 @@ start:
case SbxSTRING:
case SbxLPSTR:
{
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
::rtl::OString aOStr = ::rtl::OString::valueOf( n );
- ::rtl::OUString aOUStr = ::rtl::OStringToOUString
+ (*p->pOUString) = ::rtl::OStringToOUString
( aOStr, RTL_TEXTENCODING_ASCII_US );
- (*p->pString) = aOUStr;
break;
}
case SbxOBJECT:
@@ -745,20 +743,19 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
- ::rtl::OUString aOUStr( *p->pString );
::rtl::OString aOStr = ::rtl::OUStringToOString
- ( aOUStr, RTL_TEXTENCODING_ASCII_US );
+ ( *p->pOUString, RTL_TEXTENCODING_ASCII_US );
sal_Int64 n64 = aOStr.toInt64();
if( n64 == 0 )
{
// Check if really 0 or invalid conversion
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXSALUINT64 )
{
@@ -879,16 +876,15 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
if( n > SbxMAXSALINT64 )
SbxBase::SetError( SbxERR_CONVERSION );
else
{
::rtl::OString aOStr = ::rtl::OString::valueOf( (sal_Int64)n );
- ::rtl::OUString aOUStr = ::rtl::OStringToOUString
+ (*p->pOUString) = ::rtl::OStringToOUString
( aOStr, RTL_TEXTENCODING_ASCII_US );
- (*p->pString) = aOUStr;
}
break;
case SbxOBJECT:
diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx
index c84b087dfc33..1cf2d84061f9 100644
--- a/basic/source/sbx/sbxlng.cxx
+++ b/basic/source/sbx/sbxlng.cxx
@@ -119,13 +119,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXLNG )
{
@@ -240,9 +240,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxres.cxx b/basic/source/sbx/sbxres.cxx
index f42c400afd91..369349e72069 100644
--- a/basic/source/sbx/sbxres.cxx
+++ b/basic/source/sbx/sbxres.cxx
@@ -86,6 +86,6 @@ const char* GetSbxRes( USHORT nId )
}
SbxRes::SbxRes( USHORT nId )
- : XubString( String::CreateFromAscii( GetSbxRes( nId ) ) )
+ : ::rtl::OUString( ::rtl::OUString::createFromAscii( GetSbxRes( nId ) ) )
{}
diff --git a/basic/source/sbx/sbxres.hxx b/basic/source/sbx/sbxres.hxx
index 8cd0ad26e951..8ed3c7054278 100644
--- a/basic/source/sbx/sbxres.hxx
+++ b/basic/source/sbx/sbxres.hxx
@@ -75,7 +75,7 @@
#define SBXRES_MAX 44
-class SbxRes : public String
+class SbxRes : public ::rtl::OUString
{
public:
SbxRes( USHORT );
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 3d45818e6401..b8aad9bbf2e4 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -71,10 +71,10 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep )
// Das ganze gibt auch noch einen Konversionsfehler, wenn der Datentyp
// Fixed ist und das ganze nicht hineinpasst!
-SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType,
+SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType,
USHORT* pLen, BOOL bAllowIntntl, BOOL bOnlyIntntl )
{
- ByteString aBStr( rWSrc, RTL_TEXTENCODING_ASCII_US );
+ ::rtl::OString aBStr( ::rtl::OUStringToOString( rWSrc, RTL_TEXTENCODING_ASCII_US ) );
// Bei International Komma besorgen
char cIntntlComma, cIntntl1000;
@@ -100,7 +100,7 @@ SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType,
cIntntl1000 = (char)cThousandSep;
}
- const char* pStart = aBStr.GetBuffer();
+ const char* pStart = aBStr.getStr();
const char* p = pStart;
char buf[ 80 ], *q = buf;
BOOL bRes = TRUE;
@@ -391,7 +391,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth,
#pragma warning(disable: 4748) // "... because optimizations are disabled ..."
#endif
-void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString )
+void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString )
{
char *q;
char cBuf[ 40 ], *p = cBuf;
@@ -415,18 +415,18 @@ void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString )
if( *p == cDecimalSep ) p--;
while( *q ) *++p = *q++;
*++p = 0;
- rRes = String::CreateFromAscii( cBuf );
+ rRes = ::rtl::OUString::createFromAscii( cBuf );
}
#ifdef _MSC_VER
#pragma optimize( "", on )
#endif
-BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
+BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType )
{
// Merken, ob ueberhaupt was geaendert wurde
BOOL bChanged = FALSE;
- String aNewString;
+ ::rtl::OUString aNewString;
// Nur Spezial-Flle behandeln, als Default tun wir nichts
switch( eTargetType )
@@ -436,7 +436,7 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
case SbxDOUBLE:
case SbxCURRENCY:
{
- ByteString aBStr( rSrc, RTL_TEXTENCODING_ASCII_US );
+ ::rtl::OString aBStr( ::rtl::OUStringToOString( rSrc, RTL_TEXTENCODING_ASCII_US ) );
// Komma besorgen
sal_Unicode cDecimalSep, cThousandSep;
@@ -446,10 +446,11 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
// Ersetzen, wenn DecimalSep kein '.' (nur den ersten)
if( cDecimalSep != (sal_Unicode)'.' )
{
- USHORT nPos = aNewString.Search( cDecimalSep );
- if( nPos != STRING_NOTFOUND )
+ sal_Int32 nPos = aNewString.indexOf( cDecimalSep );
+ if( nPos != -1 )
{
- aNewString.SetChar( nPos, '.' );
+ sal_Unicode* pStr = (sal_Unicode*)aNewString.getStr();
+ pStr[nPos] = (sal_Unicode)'.';
bChanged = TRUE;
}
}
@@ -459,15 +460,15 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
// Bei BOOL TRUE und FALSE als String pruefen
case SbxBOOL:
{
- if( rSrc.EqualsIgnoreCaseAscii( "true" ) )
+ if( rSrc.equalsIgnoreAsciiCaseAscii( "true" ) )
{
- aNewString = String::CreateFromInt32(SbxTRUE);
+ aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxTRUE );
bChanged = TRUE;
}
else
- if( rSrc.EqualsIgnoreCaseAscii( "false" ) )
+ if( rSrc.equalsIgnoreAsciiCaseAscii( "false" ) )
{
- aNewString = String::CreateFromInt32(SbxFALSE);
+ aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxFALSE );
bChanged = TRUE;
}
break;
@@ -935,7 +936,11 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
//old: printfmtnum( GetDouble(), rRes, *pFmt );
}
else
- ImpCvtNum( GetDouble(), nComma, rRes );
+ {
+ ::rtl::OUString aTmpString( rRes );
+ ImpCvtNum( GetDouble(), nComma, aTmpString );
+ rRes = aTmpString;
+ }
break;
case SbxSTRING:
if( pFmt )
diff --git a/basic/source/sbx/sbxsng.cxx b/basic/source/sbx/sbxsng.cxx
index 82507dbe15e9..70ef1653666b 100644
--- a/basic/source/sbx/sbxsng.cxx
+++ b/basic/source/sbx/sbxsng.cxx
@@ -112,13 +112,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXSNG )
{
@@ -237,9 +237,9 @@ start:
case SbxSTRING:
case SbxLPSTR:
{
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 6, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 6, *p->pOUString );
break;
}
case SbxOBJECT:
diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx
index 6deb2da29ba1..b4156a116ddc 100644
--- a/basic/source/sbx/sbxstr.cxx
+++ b/basic/source/sbx/sbxstr.cxx
@@ -44,12 +44,12 @@ using namespace rtl;
// Die Konversion eines Items auf String wird ueber die Put-Methoden
// der einzelnen Datentypen abgewickelt, um doppelten Code zu vermeiden.
-XubString ImpGetString( const SbxValues* p )
+::rtl::OUString ImpGetString( const SbxValues* p )
{
SbxValues aTmp;
- XubString aRes;
+ ::rtl::OUString aRes;
aTmp.eType = SbxSTRING;
- aTmp.pString = &aRes;
+ aTmp.pOUString = &aRes;
switch( +p->eType )
{
case SbxNULL:
@@ -86,8 +86,8 @@ XubString ImpGetString( const SbxValues* p )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( p->pString )
- aRes = *p->pString;
+ if ( p->pOUString )
+ *aTmp.pOUString = *p->pOUString;
break;
case SbxOBJECT:
{
@@ -109,7 +109,7 @@ XubString ImpGetString( const SbxValues* p )
case SbxERROR:
// Hier wird der String "Error n" erzeugt
aRes = SbxRes( STRING_ERRORMSG );
- aRes += p->nUShort; break;
+ aRes += ::rtl::OUString( p->nUShort ); break;
case SbxDATE:
ImpPutDate( &aTmp, p->nDouble ); break;
@@ -145,7 +145,7 @@ XubString ImpGetString( const SbxValues* p )
}
// AB 10.4.97, neue Funktion fuer SbxValue::GetCoreString()
-XubString ImpGetCoreString( const SbxValues* p )
+::rtl::OUString ImpGetCoreString( const SbxValues* p )
{
// Vorerst nur fuer double
if( ( p->eType & (~SbxBYREF) ) == SbxDOUBLE )
@@ -153,7 +153,6 @@ XubString ImpGetCoreString( const SbxValues* p )
SbxValues aTmp;
XubString aRes;
aTmp.eType = SbxSTRING;
- aTmp.pString = &aRes;
if( p->eType == SbxDOUBLE )
ImpPutDouble( &aTmp, p->nDouble, /*bCoreString=*/TRUE );
else
@@ -164,15 +163,15 @@ XubString ImpGetCoreString( const SbxValues* p )
return ImpGetString( p );
}
-void ImpPutString( SbxValues* p, const XubString* n )
+void ImpPutString( SbxValues* p, const ::rtl::OUString* n )
{
SbxValues aTmp;
aTmp.eType = SbxSTRING;
- XubString* pTmp = NULL;
+ ::rtl::OUString* pTmp = NULL;
// Sicherheitshalber, falls ein NULL-Ptr kommt
if( !n )
- n = pTmp = new XubString;
- aTmp.pString = (XubString*) n;
+ n = pTmp = new ::rtl::OUString;
+ aTmp.pOUString = (::rtl::OUString*)n;
switch( +p->eType )
{
case SbxCHAR:
@@ -209,14 +208,15 @@ void ImpPutString( SbxValues* p, const XubString* n )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( n->Len() )
+ if( n->getLength() )
{
- if( !p->pString )
- p->pString = new XubString;
- *p->pString = *n;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString( *n );
+ else
+ *p->pOUString = *n;
}
else
- delete p->pString, p->pString = NULL;
+ delete p->pOUString, p->pOUString = NULL;
break;
case SbxOBJECT:
{
@@ -258,18 +258,18 @@ void ImpPutString( SbxValues* p, const XubString* n )
}
// Convert string to an array of bytes, preserving unicode (2bytes per character)
-SbxArray* StringToByteArray(const String& rStr)
+SbxArray* StringToByteArray(const ::rtl::OUString& rStr)
{
- USHORT nArraySize = rStr.Len() * 2;
- const sal_Unicode* pSrc = rStr.GetBuffer();
+ sal_Int32 nArraySize = rStr.getLength() * 2;
+ const sal_Unicode* pSrc = rStr.getStr();
SbxDimArray* pArray = new SbxDimArray(SbxBYTE);
bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
if( nArraySize )
{
if( bIncIndex )
- pArray->AddDim( 1, nArraySize );
+ pArray->AddDim32( 1, nArraySize );
else
- pArray->AddDim( 0, nArraySize-1 );
+ pArray->AddDim32( 0, nArraySize-1 );
}
else
{
@@ -290,7 +290,7 @@ SbxArray* StringToByteArray(const String& rStr)
}
// Convert an array of bytes to string (2bytes per character)
-String ByteArrayToString(SbxArray* pArr)
+::rtl::OUString ByteArrayToString(SbxArray* pArr)
{
USHORT nCount = pArr->Count();
OUStringBuffer aStrBuf;
@@ -315,7 +315,5 @@ String ByteArrayToString(SbxArray* pArr)
aStrBuf.append(aChar);
}
- String aStr(aStrBuf.makeStringAndClear());
-
- return aStr;
+ return aStrBuf.makeStringAndClear();
}
diff --git a/basic/source/sbx/sbxuint.cxx b/basic/source/sbx/sbxuint.cxx
index ce0aea70b062..5b75a24d6d26 100644
--- a/basic/source/sbx/sbxuint.cxx
+++ b/basic/source/sbx/sbxuint.cxx
@@ -151,13 +151,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXUINT )
{
@@ -272,9 +272,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxulng.cxx b/basic/source/sbx/sbxulng.cxx
index 3dd81b8c616d..e0f6f3fa421d 100644
--- a/basic/source/sbx/sbxulng.cxx
+++ b/basic/source/sbx/sbxulng.cxx
@@ -127,13 +127,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXULNG )
{
@@ -246,9 +246,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 7ee31af70556..4ea4836b701b 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -236,7 +236,7 @@ SbxValue::SbxValue( SbxDataType t, void* p ) : SbxBase()
case SbxSINGLE: n |= SbxBYREF; aData.pSingle = (float*) p; break;
case SbxDATE:
case SbxDOUBLE: n |= SbxBYREF; aData.pDouble = (double*) p; break;
- case SbxSTRING: n |= SbxBYREF; aData.pString = (XubString*) p; break;
+ case SbxSTRING: n |= SbxBYREF; aData.pOUString = (::rtl::OUString*) p; break;
case SbxERROR:
case SbxUSHORT:
case SbxBOOL: n |= SbxBYREF; aData.pUShort = (UINT16*) p; break;
@@ -280,8 +280,8 @@ SbxValue::SbxValue( const SbxValue& r )
switch( aData.eType )
{
case SbxSTRING:
- if( aData.pString )
- aData.pString = new XubString( *aData.pString );
+ if( aData.pOUString )
+ aData.pOUString = new ::rtl::OUString( *aData.pOUString );
break;
case SbxOBJECT:
if( aData.pObj )
@@ -309,7 +309,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r )
&& aData.pObj && ( aData.pObj->GetType() == (SbxARRAY | SbxBYTE) )
&& (r.aData.eType == SbxSTRING) )
{
- String aStr = r.GetString();
+ ::rtl::OUString aStr = r.GetString();
SbxArray* pArr = StringToByteArray(aStr);
PutObject(pArr);
return *this;
@@ -323,7 +323,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r )
SbxArray* pArr = PTR_CAST(SbxArray, pObj);
if( pArr )
{
- String aStr = ByteArrayToString( pArr );
+ ::rtl::OUString aStr = ByteArrayToString( pArr );
PutString(aStr);
return *this;
}
@@ -385,7 +385,7 @@ void SbxValue::Clear()
case SbxVOID:
break;
case SbxSTRING:
- delete aData.pString; aData.pString = NULL;
+ delete aData.pOUString; aData.pOUString = NULL;
break;
case SbxOBJECT:
if( aData.pObj )
@@ -551,9 +551,9 @@ BOOL SbxValue::Get( SbxValues& rRes ) const
case SbxULONG: rRes.nULong = ImpGetULong( &p->aData ); break;
case SbxLPSTR:
case SbxSTRING: p->aPic = ImpGetString( &p->aData );
- rRes.pString = &p->aPic; break;
+ rRes.pOUString = &p->aPic; break;
case SbxCoreSTRING: p->aPic = ImpGetCoreString( &p->aData );
- rRes.pString = &p->aPic; break;
+ rRes.pOUString = &p->aPic; break;
case SbxINT:
#if SAL_TYPES_SIZEOFINT == 2
rRes.nInt = (int) ImpGetInteger( &p->aData );
@@ -618,13 +618,11 @@ const XubString& SbxValue::GetString() const
SbxValues aRes;
aRes.eType = SbxSTRING;
if( Get( aRes ) )
- // Geht in Ordnung, da Ptr eine Kopie ist
- return *aRes.pString;
+ ((SbxValue*) this)->aToolString = *aRes.pOUString;
else
- {
- ((SbxValue*) this)->aPic.Erase();
- return aPic;
- }
+ ((SbxValue*) this)->aToolString.Erase();
+
+ return aToolString;
}
const XubString& SbxValue::GetCoreString() const
@@ -632,13 +630,22 @@ const XubString& SbxValue::GetCoreString() const
SbxValues aRes;
aRes.eType = SbxCoreSTRING;
if( Get( aRes ) )
- // Geht in Ordnung, da Ptr eine Kopie ist
- return *aRes.pString;
+ ((SbxValue*) this)->aToolString = *aRes.pOUString;
else
- {
- ((SbxValue*) this)->aPic.Erase();
- return aPic;
- }
+ ((SbxValue*) this)->aToolString.Erase();
+
+ return aToolString;
+}
+
+::rtl::OUString SbxValue::GetOUString() const
+{
+ ::rtl::OUString aResult;
+ SbxValues aRes;
+ aRes.eType = SbxSTRING;
+ if( Get( aRes ) )
+ aResult = *aRes.pOUString;
+
+ return aResult;
}
BOOL SbxValue::HasObject() const
@@ -727,7 +734,7 @@ BOOL SbxValue::Put( const SbxValues& rVal )
case SbxUSHORT: ImpPutUShort( &p->aData, rVal.nUShort ); break;
case SbxULONG: ImpPutULong( &p->aData, rVal.nULong ); break;
case SbxLPSTR:
- case SbxSTRING: ImpPutString( &p->aData, rVal.pString ); break;
+ case SbxSTRING: ImpPutString( &p->aData, rVal.pOUString ); break;
case SbxINT:
#if SAL_TYPES_SIZEOFINT == 2
ImpPutInteger( &p->aData, (INT16) rVal.nInt );
@@ -803,10 +810,10 @@ BOOL SbxValue::Put( const SbxValues& rVal )
// werden koennen, wenn Floats mit ',' als Dezimaltrenner oder BOOLs
// explizit mit "TRUE" oder "FALSE" angegeben werden.
// Implementierung in ImpConvStringExt (SBXSCAN.CXX)
-BOOL SbxValue::PutStringExt( const XubString& r )
+BOOL SbxValue::PutStringExt( const ::rtl::OUString& r )
{
// Kopieren, bei Unicode gleich konvertieren
- String aStr( r );
+ ::rtl::OUString aStr( r );
// Eigenen Typ bestimmen (nicht wie in Put() mit TheRealValue(),
// Objekte werden sowieso nicht behandelt)
@@ -820,9 +827,9 @@ BOOL SbxValue::PutStringExt( const XubString& r )
// sonst Original (Unicode bleibt erhalten)
BOOL bRet;
if( ImpConvStringExt( aStr, eTargetType ) )
- aRes.pString = (XubString*)&aStr;
+ aRes.pOUString = (::rtl::OUString*)&aStr;
else
- aRes.pString = (XubString*)&r;
+ aRes.pOUString = (::rtl::OUString*)&r;
// #34939: Bei Strings. die eine Zahl enthalten und wenn this einen
// Num-Typ hat, Fixed-Flag setzen, damit der Typ nicht veraendert wird
@@ -851,10 +858,10 @@ BOOL SbxValue::PutStringExt( const XubString& r )
BOOL SbxValue::PutString( const xub_Unicode* p )
{
- XubString aVal( p );
+ ::rtl::OUString aVal( p );
SbxValues aRes;
aRes.eType = SbxSTRING;
- aRes.pString = &aVal;
+ aRes.pOUString = &aVal;
Put( aRes );
return BOOL( !IsError() );
}
@@ -909,19 +916,19 @@ BOOL SbxValue::fillAutomationDecimal
BOOL SbxValue::PutpChar( const xub_Unicode* p )
{
- XubString aVal( p );
+ ::rtl::OUString aVal( p );
SbxValues aRes;
aRes.eType = SbxLPSTR;
- aRes.pString = &aVal;
+ aRes.pOUString = &aVal;
Put( aRes );
return BOOL( !IsError() );
}
-BOOL SbxValue::PutString( const XubString& r )
+BOOL SbxValue::PutString( const ::rtl::OUString& r )
{
SbxValues aRes;
aRes.eType = SbxSTRING;
- aRes.pString = (XubString*) &r;
+ aRes.pOUString = (::rtl::OUString*) &r;
Put( aRes );
return BOOL( !IsError() );
}
@@ -986,14 +993,14 @@ BOOL SbxValue::ImpIsNumeric( BOOL bOnlyIntntl ) const
SbxDataType t = GetType();
if( t == SbxSTRING )
{
- if( aData.pString )
+ if( aData.pOUString )
{
- XubString s( *aData.pString );
+ ::rtl::OUString s( *aData.pOUString );
double n;
SbxDataType t2;
USHORT nLen = 0;
if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/FALSE, bOnlyIntntl ) == SbxERR_OK )
- return BOOL( nLen == s.Len() );
+ return BOOL( nLen == s.getLength() );
}
return FALSE;
}
@@ -1046,7 +1053,7 @@ BOOL SbxValue::SetType( SbxDataType t )
switch( aData.eType )
{
case SbxSTRING:
- delete aData.pString;
+ delete aData.pOUString;
break;
case SbxOBJECT:
if( aData.pObj && aData.pObj != this )
@@ -1163,14 +1170,14 @@ BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp )
Get( aL );
// #30576: Erstmal testen, ob Wandlung geklappt hat
- if( aL.pString != NULL && aR.pString != NULL )
+ if( aL.pOUString != NULL && aR.pOUString != NULL )
{
- *aL.pString += *aR.pString;
+ *aL.pOUString += *aR.pOUString;
}
// Nicht einmal Left OK?
- else if( aL.pString == NULL )
+ else if( aL.pOUString == NULL )
{
- aL.pString = new String();
+ aL.pOUString = new ::rtl::OUString();
}
Put( aL );
}
@@ -1493,17 +1500,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
if( Get( aL ) && rOp.Get( aR ) ) switch( eOp )
{
case SbxEQ:
- bRes = BOOL( *aL.pString == *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString == *aR.pOUString ); break;
case SbxNE:
- bRes = BOOL( *aL.pString != *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString != *aR.pOUString ); break;
case SbxLT:
- bRes = BOOL( *aL.pString < *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString < *aR.pOUString ); break;
case SbxGT:
- bRes = BOOL( *aL.pString > *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString > *aR.pOUString ); break;
case SbxLE:
- bRes = BOOL( *aL.pString <= *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString <= *aR.pOUString ); break;
case SbxGE:
- bRes = BOOL( *aL.pString >= *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString >= *aR.pOUString ); break;
default:
SetError( SbxERR_NOTIMP );
}
@@ -1668,9 +1675,9 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT )
XubString aVal;
r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
if( aVal.Len() )
- aData.pString = new XubString( aVal );
+ aData.pOUString = new ::rtl::OUString( aVal );
else
- aData.pString = NULL; // JSM 22.09.1995
+ aData.pOUString = NULL; // JSM 22.09.1995
break;
}
case SbxERROR:
@@ -1781,9 +1788,9 @@ BOOL SbxValue::StoreData( SvStream& r ) const
break;
}
case SbxSTRING:
- if( aData.pString )
+ if( aData.pOUString )
{
- r.WriteByteString( *aData.pString, RTL_TEXTENCODING_ASCII_US );
+ r.WriteByteString( *aData.pOUString, RTL_TEXTENCODING_ASCII_US );
}
else
{
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 20060f1f7493..58e3c1ae92c2 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -239,9 +239,9 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
if( i )
aTmp += ',';
if( q->nFlags & SBX_OPTIONAL )
- aTmp += SbxRes( STRING_OPTIONAL );
+ aTmp += String( SbxRes( STRING_OPTIONAL ) );
if( q->eType & SbxBYREF )
- aTmp += SbxRes( STRING_BYREF );
+ aTmp += String( SbxRes( STRING_BYREF ) );
aTmp += q->aName;
cType = ' ';
// Kurzer Typ? Dann holen, evtl. ist dieser 0.
@@ -263,12 +263,12 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
// langer Typ?
if( t != SbxNAME_SHORT )
{
- aTmp += SbxRes( STRING_AS );
+ aTmp += String( SbxRes( STRING_AS ) );
if( nt < 32 )
- aTmp += SbxRes(
- sal::static_int_cast< USHORT >( STRING_TYPES + nt ) );
+ aTmp += String( SbxRes(
+ sal::static_int_cast< USHORT >( STRING_TYPES + nt ) ) );
else
- aTmp += SbxRes( STRING_ANY );
+ aTmp += String( SbxRes( STRING_ANY ) );
}
}
}
@@ -276,15 +276,15 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
// Langer Typ? Dann holen
if( t == SbxNAME_LONG_TYPES && et != SbxEMPTY )
{
- aTmp += SbxRes( STRING_AS );
+ aTmp += String( SbxRes( STRING_AS ) );
if( et < 32 )
- aTmp += SbxRes(
- sal::static_int_cast< USHORT >( STRING_TYPES + et ) );
+ aTmp += String( SbxRes(
+ sal::static_int_cast< USHORT >( STRING_TYPES + et ) ) );
else
- aTmp += SbxRes( STRING_ANY );
+ aTmp += String( SbxRes( STRING_ANY ) );
}
- ((SbxVariable*) this)->aPic = aTmp;
- return aPic;
+ ((SbxVariable*) this)->aToolString = aTmp;
+ return aToolString;
}
// Einen simplen Hashcode erzeugen: Es werden die ersten 6 Zeichen gewertet.
@@ -431,9 +431,10 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
if( nType == SbxNULL && GetClass() == SbxCLASS_METHOD )
nType = SbxEMPTY;
SbxValues aTmp;
- XubString aVal;
+ String aTmpString;
+ ::rtl::OUString aVal;
aTmp.eType = aData.eType = (SbxDataType) nType;
- aTmp.pString = &aVal;
+ aTmp.pOUString = &aVal;
switch( nType )
{
case SbxBOOL:
@@ -445,10 +446,10 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
case SbxSINGLE:
{
// Floats als ASCII
- rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
double d;
SbxDataType t;
- if( ImpScan( aVal, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE )
+ if( ImpScan( aTmpString, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE )
{
aTmp.nSingle = 0;
return FALSE;
@@ -460,9 +461,9 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
case SbxDOUBLE:
{
// Floats als ASCII
- rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
SbxDataType t;
- if( ImpScan( aVal, aTmp.nDouble, t, NULL ) != SbxERR_OK )
+ if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK )
{
aTmp.nDouble = 0;
return FALSE;
@@ -470,7 +471,8 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
break;
}
case SbxSTRING:
- rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
+ aVal = aTmpString;
break;
case SbxEMPTY:
case SbxNULL:
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index ffe752f43a7a..779e3c32f1e7 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -827,16 +827,14 @@ bool ChartController::executeDispatch_Delete()
else
{
//remove additional shape
- uno::Reference< drawing::XShape > xShape( m_aSelection.getSelectedAdditionalShape() );
- if( xShape.is() )
+ impl_ClearSelection();
{
- impl_ClearSelection();
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ if ( m_pDrawViewWrapper )
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
- if( m_pDrawViewWrapper )
- m_pDrawViewWrapper->UnmarkAll();
+ m_pDrawViewWrapper->DeleteMarked();
+ bReturn = true;
}
- bReturn = DrawModelWrapper::removeShape( xShape );
}
}
return bReturn;
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 950169395c95..5a30d97118c5 100755
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -1043,6 +1043,7 @@ void SAL_CALL ChartModel::setVisualAreaSize( ::sal_Int64 nAspect, const awt::Siz
{
if( nAspect == embed::Aspects::MSOLE_CONTENT )
{
+ ControllerLockGuard aLockGuard( this );
bool bChanged =
(m_aVisualAreaSize.Width != aSize.Width ||
m_aVisualAreaSize.Height != aSize.Height);
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index 79e122759fc8..37b46494c6a7 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -321,15 +321,19 @@ void XcsParser::endElement(XmlReader const & reader) {
} else {
switch (state_) {
case STATE_COMPONENT_SCHEMA:
+ // To support old, broken extensions with .xcs files that contain
+ // empty <component-schema> elements:
+ state_ = STATE_COMPONENT_DONE;
+ break;
+ case STATE_TEMPLATES:
+ state_ = STATE_TEMPLATES_DONE;
+ break;
case STATE_TEMPLATES_DONE:
throw css::uno::RuntimeException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("no component element in ")) +
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
- case STATE_TEMPLATES:
- state_ = STATE_TEMPLATES_DONE;
- break;
case STATE_COMPONENT_DONE:
break;
default:
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 8867a940a6ad..fa7550812bbe 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -134,6 +134,9 @@ class Desktop : public Application
static sal_Bool IsFirstStartWizardNeeded();
static sal_Bool CheckExtensionDependencies();
+ static void DoRestartActionsIfNecessary( sal_Bool bQuickStart );
+ static void SetRestartState();
+
void SynchronizeExtensionRepositories();
void SetSplashScreenText( const ::rtl::OUString& rText );
void SetSplashScreenProgress( sal_Int32 );
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index ace2149036c9..f5d6979bc4b1 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1558,6 +1558,7 @@ void Desktop::Main()
std::auto_ptr<SvtLanguageOptions> pLanguageOptions;
std::auto_ptr<SvtPathOptions> pPathOptions;
+ Reference< ::com::sun::star::task::XRestartManager > xRestartManager;
sal_Bool bRestartRequested( sal_False );
sal_Bool bUseSystemFileDialog(sal_True);
int nAcquireCount( 0 );
@@ -1761,7 +1762,6 @@ void Desktop::Main()
impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} impl_checkRecoveryState" );
- Reference< ::com::sun::star::task::XRestartManager > xRestartManager;
{
::comphelper::ComponentContext aContext( xSMgr );
xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY );
@@ -1922,6 +1922,10 @@ void Desktop::Main()
// The configuration error handler currently is only for startup
aConfigErrHandler.deactivate();
+ // Acquire solar mutex just before we enter our message loop
+ if ( nAcquireCount )
+ Application::AcquireSolarMutex( nAcquireCount );
+
// call Application::Execute to process messages in vcl message loop
RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" );
@@ -1932,7 +1936,16 @@ void Desktop::Main()
com::sun::star::uno::ContextLayer layer2(
new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) );
- Execute();
+ // check whether the shutdown is caused by restart just before entering the Execute
+ bRestartRequested = bRestartRequested || ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
+
+ if ( !bRestartRequested )
+ {
+ // if this run of the office is triggered by restart, some additional actions should be done
+ DoRestartActionsIfNecessary( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() );
+
+ Execute();
+ }
}
catch(const com::sun::star::document::CorruptedFilterConfigurationException& exFilterCfg)
{
@@ -1946,6 +1959,9 @@ void Desktop::Main()
}
}
+ if ( bRestartRequested )
+ SetRestartState();
+
if (xGlobalBroadcaster.is())
{
css::document::EventObject aEvent;
diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx
index 2f0d4ab9e538..c06d94fd0812 100644
--- a/desktop/source/app/appfirststart.cxx
+++ b/desktop/source/app/appfirststart.cxx
@@ -36,12 +36,14 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/util/XChangesBatch.hpp>
#include "app.hxx"
-using rtl::OUString;
-using namespace desktop;
-using namespace com::sun::star::beans;
+using ::rtl::OUString;
+using namespace ::desktop;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::beans;
static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) );
static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) );
@@ -128,24 +130,29 @@ sal_Bool Desktop::LicenseNeedsAcceptance()
*/
}
-/* Local function - was the wizard completed already? */
-static sal_Bool impl_isFirstStart()
+/* Local function - get access to the configuration */
+static Reference< XPropertySet > impl_getConfigurationAccess( const OUString& rPath )
{
- try {
- Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
- // get configuration provider
- Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
- xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
+ // get configuration provider
+ Reference< XMultiServiceFactory > xConfigProvider = Reference< XMultiServiceFactory >(
+ xFactory->createInstance( sConfigSrvc ), UNO_QUERY_THROW );
- Sequence< Any > theArgs(1);
- NamedValue v(OUString::createFromAscii("NodePath"), makeAny(OUString::createFromAscii("org.openoffice.Setup/Office")));
- theArgs[0] <<= v;
+ Sequence< Any > aArgs( 1 );
+ NamedValue aValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NodePath" ) ), makeAny( rPath ) );
+ aArgs[0] <<= aValue;
+ return Reference< XPropertySet >(
+ xConfigProvider->createInstanceWithArguments( sAccessSrvc, aArgs ), UNO_QUERY_THROW );
+}
- Reference< XPropertySet > pset = Reference< XPropertySet >(
- theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
+/* Local function - was the wizard completed already? */
+static sal_Bool impl_isFirstStart()
+{
+ try {
+ Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
- Any result = pset->getPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted"));
+ Any result = xPSet->getPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted"));
sal_Bool bCompleted = sal_False;
if ((result >>= bCompleted) && bCompleted)
return sal_False; // wizard was already completed
@@ -219,20 +226,9 @@ static sal_Bool impl_isLicenseAccepted()
try
{
- Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
-
- // get configuration provider
- Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
- xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
+ Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
- Sequence< Any > theArgs(1);
- NamedValue v(OUString::createFromAscii("NodePath"),
- makeAny(OUString::createFromAscii("org.openoffice.Setup/Office")));
- theArgs[0] <<= v;
- Reference< XPropertySet > pset = Reference< XPropertySet >(
- theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
-
- Any result = pset->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate"));
+ Any result = xPSet->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate"));
OUString aAcceptDate;
if (result >>= aAcceptDate)
@@ -272,3 +268,51 @@ sal_Bool Desktop::IsFirstStartWizardNeeded()
return impl_isFirstStart() || !impl_isLicenseAccepted();
}
+void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart )
+{
+ if ( bQuickStart )
+ {
+ try
+ {
+ Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
+
+ OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) );
+ Any aRestart = xPSet->getPropertyValue( sPropName );
+ sal_Bool bRestart = sal_False;
+ if ( ( aRestart >>= bRestart ) && bRestart )
+ {
+ xPSet->setPropertyValue( sPropName, makeAny( sal_False ) );
+ Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges();
+
+ Sequence< Any > aSeq( 2 );
+ aSeq[0] <<= sal_True;
+ aSeq[1] <<= sal_True;
+
+ Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Quickstart" ) ) ),UNO_QUERY_THROW );
+ xQuickstart->initialize( aSeq );
+ }
+ }
+ catch( uno::Exception& )
+ {
+ // this is no critical operation so it should not prevent office from starting
+ }
+ }
+}
+
+void Desktop::SetRestartState()
+{
+ try
+ {
+ Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
+ OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) );
+ xPSet->setPropertyValue( sPropName, makeAny( sal_True ) );
+ Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges();
+ }
+ catch( uno::Exception& )
+ {
+ // this is no critical operation, ignore the exception
+ }
+
+}
+
diff --git a/desktop/win32/source/officeloader/officeloader.cxx b/desktop/win32/source/officeloader/officeloader.cxx
index 7c2dafc79bbb..b85a72555935 100644
--- a/desktop/win32/source/officeloader/officeloader.cxx
+++ b/desktop/win32/source/officeloader/officeloader.cxx
@@ -339,6 +339,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
p = desktop_win32::commandLineAppend(p, argv[i]);
}
}
+
p = desktop_win32::commandLineAppend(
p, MY_STRING(L"\" \"-env:OOO_CWD="));
if (cwdLen == 0) {
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index 569b80639b6b..e8a2aaad22e2 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -43,7 +43,7 @@
#include <editeng/wghtitem.hxx>
#include <svtools/htmltokn.h>
#include <svtools/htmlkywd.hxx>
-
+#include <tools/tenccvt.hxx>
#define ACTION_INSERTTEXT 1
#define ACTION_INSERTPARABRK 2
@@ -66,6 +66,16 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValu
nNumberingLevel = 0;
bFieldsInserted = FALSE;
+ DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW == GetSrcEncoding( ), "EditHTMLParser::EditHTMLParser: Where does the encoding come from?" );
+ DBG_ASSERT( !IsSwitchToUCS2(), "EditHTMLParser::::EditHTMLParser: Switch to UCS2?" );
+
+ // Altough the real default encoding is ISO8859-1, we use MS-1252
+ // als default encoding.
+ SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) );
+
+ // If the file starts with a BOM, switch to UCS2.
+ SetSwitchToUCS2( TRUE );
+
if ( pHTTPHeaderAttrs )
SetEncodingByHTTPHeader( pHTTPHeaderAttrs );
}
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index ede5acacc698..c8f5e2948665 100755
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -51,6 +51,7 @@
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
#include <i18npool/lang.h>
#include <vos/ref.hxx>
@@ -1002,6 +1003,8 @@ public:
void SetAutoCompleteText( const String& rStr, sal_Bool bUpdateTipWindow );
EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode );
+ short ReplaceTextOnly( ContentNode* pNode, USHORT nCurrentStart, xub_StrLen nLen, const String& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rOffsets );
+
void SetAsianCompressionMode( USHORT n );
USHORT GetAsianCompressionMode() const { return nAsianCompressionMode; }
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 5a54c054016b..46a0668394f2 100755
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -76,6 +76,9 @@
#include <com/sun/star/linguistic2/XThesaurus.hpp>
#include <com/sun/star/linguistic2/XMeaning.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
+#include <com/sun/star/i18n/WordType.hpp>
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <unotools/transliterationwrapper.hxx>
#include <unotools/textsearch.hxx>
#include <comphelper/processfactory.hxx>
@@ -83,6 +86,8 @@
#include <svtools/rtfkeywd.hxx>
#include <editeng/edtdlg.hxx>
+#include <vector>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
@@ -2811,8 +2816,23 @@ void ImpEditEngine::SetAutoCompleteText( const String& rStr, sal_Bool bClearTipW
#endif // !SVX_LIGHT
}
+
+struct TransliterationChgData
+{
+ USHORT nStart;
+ xub_StrLen nLen;
+ EditSelection aSelection;
+ String aNewText;
+ uno::Sequence< sal_Int32 > aOffsets;
+};
+
+
EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode )
{
+ uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() );
+ if (!_xBI.is())
+ return rSelection;
+
EditSelection aSel( rSelection );
aSel.Adjust( aEditDoc );
@@ -2821,8 +2841,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
EditSelection aNewSel( aSel );
- USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
- USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
+ const USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
+ const USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
BOOL bChanges = FALSE;
BOOL bLenChanged = FALSE;
@@ -2845,83 +2865,266 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
USHORT nCurrentEnd = nEndPos;
sal_uInt16 nLanguage = LANGUAGE_SYSTEM;
- do
- {
- if ( bConsiderLanguage )
+ // since we don't use Hiragana/Katakana or half-width/full-width transliterations here
+ // it is fine to use ANYWORD_IGNOREWHITESPACES. (ANY_WORD btw is broken and will
+ // occasionaly miss words in consecutive sentences). Also with ANYWORD_IGNOREWHITESPACES
+ // text like 'just-in-time' will be converted to 'Just-In-Time' which seems to be the
+ // proper thing to do.
+ const sal_Int16 nWordType = i18n::WordType::ANYWORD_IGNOREWHITESPACES;
+
+ //! In order to have less trouble with changing text size, e.g. because
+ //! of ligatures or � (German small sz) being resolved, we need to process
+ //! the text replacements from end to start.
+ //! This way the offsets for the yet to be changed words will be
+ //! left unchanged by the already replaced text.
+ //! For this we temporarily save the changes to be done in this vector
+ std::vector< TransliterationChgData > aChanges;
+ TransliterationChgData aChgData;
+
+ if (nTransliterationMode == i18n::TransliterationModulesExtra::TITLE_CASE)
+ {
+ // for 'capitalize every word' we need to iterate over each word
+
+ i18n::Boundary aSttBndry;
+ i18n::Boundary aEndBndry;
+ aSttBndry = _xBI->getWordBoundary(
+ *pNode, nStartPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ),
+ nWordType, TRUE /*prefer forward direction*/);
+ aEndBndry = _xBI->getWordBoundary(
+ *pNode, nEndPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ),
+ nWordType, FALSE /*prefer backward direction*/);
+
+ // prevent backtracking to the previous word if selection is at word boundary
+ if (aSttBndry.endPos <= nStartPos)
+ {
+ aSttBndry = _xBI->nextWord(
+ *pNode, aSttBndry.endPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, aSttBndry.endPos + 1 ) ) ),
+ nWordType);
+ }
+ // prevent advancing to the next word if selection is at word boundary
+ if (aEndBndry.startPos >= nEndPos)
{
- nLanguage = GetLanguage( EditPaM( pNode, nCurrentStart+1 ), &nCurrentEnd );
- if ( nCurrentEnd > nEndPos )
- nCurrentEnd = nEndPos;
+ aEndBndry = _xBI->previousWord(
+ *pNode, aEndBndry.startPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, aEndBndry.startPos + 1 ) ) ),
+ nWordType);
}
- xub_StrLen nLen = nCurrentEnd - nCurrentStart;
+ i18n::Boundary aCurWordBndry( aSttBndry );
+ while (aCurWordBndry.startPos <= aEndBndry.startPos)
+ {
+ nCurrentStart = (xub_StrLen)aCurWordBndry.startPos;
+ nCurrentEnd = (xub_StrLen)aCurWordBndry.endPos;
+ sal_Int32 nLen = nCurrentEnd - nCurrentStart;
+ DBG_ASSERT( nLen > 0, "invalid word length of 0" );
+#if OSL_DEBUG_LEVEL > 1
+ String aText( pNode->Copy( nCurrentStart, nLen ) );
+#endif
+
+ Sequence< sal_Int32 > aOffsets;
+ String aNewText( aTranslitarationWrapper.transliterate( *pNode,
+ GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ),
+ nCurrentStart, nLen, &aOffsets ));
+
+ if (!pNode->Equals( aNewText, nCurrentStart, nLen ))
+ {
+ aChgData.nStart = nCurrentStart;
+ aChgData.nLen = nLen;
+ aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) );
+ aChgData.aNewText = aNewText;
+ aChgData.aOffsets = aOffsets;
+ aChanges.push_back( aChgData );
+ }
+#if OSL_DEBUG_LEVEL > 1
+ String aSelTxt ( GetSelected( aChgData.aSelection ) );
+ (void) aSelTxt;
+#endif
+
+ aCurWordBndry = _xBI->nextWord( *pNode, nCurrentEnd,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ),
+ nWordType);
+ }
+ DBG_ASSERT( nCurrentEnd >= aEndBndry.endPos, "failed to reach end of transliteration" );
+ }
+ else if (nTransliterationMode == i18n::TransliterationModulesExtra::SENTENCE_CASE)
+ {
+ // for 'sentence case' we need to iterate sentence by sentence
+
+ sal_Int32 nLastStart = _xBI->beginOfSentence(
+ *pNode, nEndPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ) );
+ sal_Int32 nLastEnd = _xBI->endOfSentence(
+ *pNode, nLastStart,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ) );
- Sequence <sal_Int32> aOffsets;
- String aNewText( aTranslitarationWrapper.transliterate( *pNode, nLanguage, nCurrentStart, nLen, &aOffsets ) );
+ // extend nCurrentStart, nCurrentEnd to the current sentence boundaries
+ nCurrentStart = _xBI->beginOfSentence(
+ *pNode, nStartPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ) );
+ nCurrentEnd = _xBI->endOfSentence(
+ *pNode, nCurrentStart,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) );
- if( ( nLen != aNewText.Len() ) || !pNode->Equals( aNewText, nCurrentStart, nLen ) )
+ // prevent backtracking to the previous sentence if selection starts at end of a sentence
+ if (nCurrentEnd <= nStartPos)
{
- bChanges = TRUE;
- if ( nLen != aNewText.Len() )
- bLenChanged = TRUE;
+ // now nCurrentStart is probably located on a non-letter word. (unless we
+ // are in Asian text with no spaces...)
+ // Thus to get the real sentence start we should locate the next real word,
+ // that is one found by DICTIONARY_WORD
+ i18n::Boundary aBndry = _xBI->nextWord( *pNode, nCurrentEnd,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ),
+ i18n::WordType::DICTIONARY_WORD);
+
+ // now get new current sentence boundaries
+ nCurrentStart = _xBI->beginOfSentence(
+ *pNode, aBndry.startPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, aBndry.startPos + 1 ) ) ) );
+ nCurrentEnd = _xBI->endOfSentence(
+ *pNode, nCurrentStart,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) );
+ }
+ // prevent advancing to the next sentence if selection ends at start of a sentence
+ if (nLastStart >= nEndPos)
+ {
+ // now nCurrentStart is probably located on a non-letter word. (unless we
+ // are in Asian text with no spaces...)
+ // Thus to get the real sentence start we should locate the previous real word,
+ // that is one found by DICTIONARY_WORD
+ i18n::Boundary aBndry = _xBI->previousWord( *pNode, nLastStart,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ),
+ i18n::WordType::DICTIONARY_WORD);
+ nLastEnd = _xBI->endOfSentence(
+ *pNode, aBndry.startPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, aBndry.startPos + 1 ) ) ) );
+ if (nCurrentEnd > nLastEnd)
+ nCurrentEnd = nLastEnd;
+ }
-#ifndef SVX_LIGHT
- // Create UndoAction on Demand....
- if ( !pUndo && IsUndoEnabled() && !IsInUndo() )
- {
- ESelection aESel( CreateESel( aSel ) );
- pUndo = new EditUndoTransliteration( this, aESel, nTransliterationMode );
+ while (nCurrentStart < nLastEnd)
+ {
+ sal_Int32 nLen = nCurrentEnd - nCurrentStart;
+ DBG_ASSERT( nLen > 0, "invalid word length of 0" );
+#if OSL_DEBUG_LEVEL > 1
+ String aText( pNode->Copy( nCurrentStart, nLen ) );
+#endif
- if ( ( nStartNode == nEndNode ) && !aSel.Min().GetNode()->GetCharAttribs().HasAttrib( aSel.Min().GetIndex(), aSel.Max().GetIndex() ) )
- pUndo->SetText( aSel.Min().GetNode()->Copy( aSel.Min().GetIndex(), aSel.Max().GetIndex()-aSel.Min().GetIndex() ) );
- else
- pUndo->SetText( CreateBinTextObject( aSel, NULL ) );
+ Sequence< sal_Int32 > aOffsets;
+ String aNewText( aTranslitarationWrapper.transliterate( *pNode,
+ GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ),
+ nCurrentStart, nLen, &aOffsets ));
+
+ if (!pNode->Equals( aNewText, nCurrentStart, nLen ))
+ {
+ aChgData.nStart = nCurrentStart;
+ aChgData.nLen = nLen;
+ aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) );
+ aChgData.aNewText = aNewText;
+ aChgData.aOffsets = aOffsets;
+ aChanges.push_back( aChgData );
}
-#endif
- // Change text without loosing the attributes
- USHORT nCharsAfterTransliteration =
- sal::static_int_cast< USHORT >(aOffsets.getLength());
- const sal_Int32* pOffsets = aOffsets.getConstArray();
- short nDiffs = 0;
- for ( USHORT n = 0; n < nCharsAfterTransliteration; n++ )
+ i18n::Boundary aFirstWordBndry;
+ aFirstWordBndry = _xBI->nextWord(
+ *pNode, nCurrentEnd,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ),
+ nWordType);
+ nCurrentStart = aFirstWordBndry.startPos;
+ nCurrentEnd = _xBI->endOfSentence(
+ *pNode, nCurrentStart,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) );
+ }
+ DBG_ASSERT( nCurrentEnd >= nLastEnd, "failed to reach end of transliteration" );
+ }
+ else
+ {
+ do
+ {
+ if ( bConsiderLanguage )
{
- USHORT nCurrentPos = nCurrentStart+n;
- sal_Int32 nDiff = (nCurrentPos-nDiffs) - pOffsets[n];
+ nLanguage = GetLanguage( EditPaM( pNode, nCurrentStart+1 ), &nCurrentEnd );
+ if ( nCurrentEnd > nEndPos )
+ nCurrentEnd = nEndPos;
+ }
- if ( !nDiff )
- {
- DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" );
- pNode->SetChar( nCurrentPos, aNewText.GetChar(n) );
- }
- else if ( nDiff < 0 )
- {
- // Replace first char, delete the rest...
- DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" );
- pNode->SetChar( nCurrentPos, aNewText.GetChar(n) );
+ xub_StrLen nLen = nCurrentEnd - nCurrentStart;
- DBG_ASSERT( (nCurrentPos+1) < pNode->Len(), "TransliterateText - String smaller than expected!" );
- GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), sal::static_int_cast< USHORT >(-nDiff) );
- }
- else
- {
- DBG_ASSERT( nDiff == 1, "TransliterateText - Diff other than expected! But should work..." );
- GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), aNewText.GetChar(n) );
+ Sequence< sal_Int32 > aOffsets;
+ String aNewText( aTranslitarationWrapper.transliterate( *pNode, nLanguage, nCurrentStart, nLen, &aOffsets ) );
- }
- nDiffs = sal::static_int_cast< short >(nDiffs + nDiff);
+ if (!pNode->Equals( aNewText, nCurrentStart, nLen ))
+ {
+ aChgData.nStart = nCurrentStart;
+ aChgData.nLen = nLen;
+ aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) );
+ aChgData.aNewText = aNewText;
+ aChgData.aOffsets = aOffsets;
+ aChanges.push_back( aChgData );
}
- if ( nNode == nEndNode )
- aNewSel.Max().GetIndex() =
- aNewSel.Max().GetIndex() + nDiffs;
+ nCurrentStart = nCurrentEnd;
+ } while( nCurrentEnd < nEndPos );
+ }
+
+ if (aChanges.size() > 0)
+ {
+#ifndef SVX_LIGHT
+ // Create a single UndoAction on Demand for all the changes ...
+ if ( !pUndo && IsUndoEnabled() && !IsInUndo() )
+ {
+ // adjust selection to include all changes
+ for (size_t i = 0; i < aChanges.size(); ++i)
+ {
+ const EditSelection &rSel = aChanges[i].aSelection;
+ if (aSel.Min().GetNode() == rSel.Min().GetNode() &&
+ aSel.Min().GetIndex() > rSel.Min().GetIndex())
+ aSel.Min().SetIndex( rSel.Min().GetIndex() );
+ if (aSel.Max().GetNode() == rSel.Max().GetNode() &&
+ aSel.Max().GetIndex() < rSel.Max().GetIndex())
+ aSel.Max().SetIndex( rSel.Max().GetIndex() );
+ }
+ aNewSel = aSel;
+
+ ESelection aESel( CreateESel( aSel ) );
+ pUndo = new EditUndoTransliteration( this, aESel, nTransliterationMode );
+
+ const bool bSingleNode = aSel.Min().GetNode()== aSel.Max().GetNode();
+ const bool bHasAttribs = aSel.Min().GetNode()->GetCharAttribs().HasAttrib( aSel.Min().GetIndex(), aSel.Max().GetIndex() );
+ if (bSingleNode && !bHasAttribs)
+ pUndo->SetText( aSel.Min().GetNode()->Copy( aSel.Min().GetIndex(), aSel.Max().GetIndex()-aSel.Min().GetIndex() ) );
+ else
+ pUndo->SetText( CreateBinTextObject( aSel, NULL ) );
+ }
+#endif
+
+ // now apply the changes from end to start to leave the offsets of the
+ // yet unchanged text parts remain the same.
+ for (size_t i = 0; i < aChanges.size(); ++i)
+ {
+ const TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ];
- ParaPortion* pParaPortion = GetParaPortions()[nNode];
- pParaPortion->MarkSelectionInvalid( nCurrentStart, std::max< USHORT >( nCurrentStart+nLen, nCurrentStart+aNewText.Len() ) );
+ bChanges = TRUE;
+ if (rData.nLen != rData.aNewText.Len())
+ bLenChanged = TRUE;
+ // Change text without loosing the attributes
+ USHORT nDiffs = ReplaceTextOnly( rData.aSelection.Min().GetNode(),
+ rData.nStart, rData.nLen, rData.aNewText, rData.aOffsets );
+
+ // adjust selection in end node to possibly changed size
+ if (aSel.Max().GetNode() == rData.aSelection.Max().GetNode())
+ aNewSel.Max().GetIndex() = aNewSel.Max().GetIndex() + nDiffs;
+
+ USHORT nSelNode = aEditDoc.GetPos( rData.aSelection.Min().GetNode() );
+ ParaPortion* pParaPortion = GetParaPortions()[nSelNode];
+ pParaPortion->MarkSelectionInvalid( rData.nStart,
+ std::max< USHORT >( rData.nStart + rData.nLen,
+ rData.nStart + rData.aNewText.Len() ) );
}
- nCurrentStart = nCurrentEnd;
- } while( nCurrentEnd < nEndPos );
+ } // if (aChanges.size() > 0)
}
#ifndef SVX_LIGHT
@@ -2945,6 +3148,52 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
return aNewSel;
}
+
+short ImpEditEngine::ReplaceTextOnly(
+ ContentNode* pNode,
+ USHORT nCurrentStart, xub_StrLen nLen,
+ const String& rNewText,
+ const uno::Sequence< sal_Int32 >& rOffsets )
+{
+ (void) nLen;
+
+ // Change text without loosing the attributes
+ USHORT nCharsAfterTransliteration =
+ sal::static_int_cast< USHORT >(rOffsets.getLength());
+ const sal_Int32* pOffsets = rOffsets.getConstArray();
+ short nDiffs = 0;
+ for ( USHORT n = 0; n < nCharsAfterTransliteration; n++ )
+ {
+ USHORT nCurrentPos = nCurrentStart+n;
+ sal_Int32 nDiff = (nCurrentPos-nDiffs) - pOffsets[n];
+
+ if ( !nDiff )
+ {
+ DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" );
+ pNode->SetChar( nCurrentPos, rNewText.GetChar(n) );
+ }
+ else if ( nDiff < 0 )
+ {
+ // Replace first char, delete the rest...
+ DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" );
+ pNode->SetChar( nCurrentPos, rNewText.GetChar(n) );
+
+ DBG_ASSERT( (nCurrentPos+1) < pNode->Len(), "TransliterateText - String smaller than expected!" );
+ GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), sal::static_int_cast< USHORT >(-nDiff) );
+ }
+ else
+ {
+ DBG_ASSERT( nDiff == 1, "TransliterateText - Diff other than expected! But should work..." );
+ GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), rNewText.GetChar(n) );
+
+ }
+ nDiffs = sal::static_int_cast< short >(nDiffs + nDiff);
+ }
+
+ return nDiffs;
+}
+
+
void ImpEditEngine::SetAsianCompressionMode( USHORT n )
{
if ( n != nAsianCompressionMode )
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 64343517c69f..f969a8033f08 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1243,27 +1243,25 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
else if ( bIsNextRun && !IsAutoCorrectChar( cChar ) )
{
// Remove the NBSP if it wasn't an autocorrection
- if ( NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) &&
+ if ( nInsPos != 0 && NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) &&
cChar != ' ' && cChar != '\t' && cChar != CHAR_HARDBLANK )
{
// Look for the last HARD_SPACE
xub_StrLen nPos = nInsPos - 1;
- bool bFound = false;
- while ( nPos != STRING_NOTFOUND && !bFound )
+ bool bContinue = true;
+ while ( bContinue )
{
- sal_Unicode cTmpChar = rTxt.GetChar( nPos );
+ const sal_Unicode cTmpChar = rTxt.GetChar( nPos );
if ( cTmpChar == CHAR_HARDBLANK )
- bFound = true;
- else if ( !NeedsHardspaceAutocorr( cTmpChar ) )
- nPos = STRING_NOTFOUND;
+ {
+ rDoc.Delete( nPos, nPos + 1 );
+ nRet = AddNonBrkSpace;
+ bContinue = false;
+ }
+ else if ( !NeedsHardspaceAutocorr( cTmpChar ) || nPos == 0 )
+ bContinue = false;
nPos--;
}
-
- if ( bFound && nPos != STRING_NOTFOUND )
- {
- rDoc.Delete( nPos + 1, nPos + 2 );
- nRet = AddNonBrkSpace;
- }
}
}
}
diff --git a/extensions/source/plugin/unx/npnapi.cxx b/extensions/source/plugin/unx/npnapi.cxx
index 003b4d0943a5..4a88577c5b71 100644
--- a/extensions/source/plugin/unx/npnapi.cxx
+++ b/extensions/source/plugin/unx/npnapi.cxx
@@ -1,10 +1,29 @@
/*************************************************************************
-
- Source Code Control System - Header
-
- $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/extensions/source/plugin/unx/npnapi.cxx,v 1.11 2008-01-14 14:53:25 ihi Exp $
-
-*************************************************************************/
+ *
+ * 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.
+ *
+ ************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_extensions.hxx"
diff --git a/extensions/source/plugin/unx/nppapi.cxx b/extensions/source/plugin/unx/nppapi.cxx
index 6dc1b7a30407..5e5c2dba1cf5 100644
--- a/extensions/source/plugin/unx/nppapi.cxx
+++ b/extensions/source/plugin/unx/nppapi.cxx
@@ -1,10 +1,29 @@
/*************************************************************************
-
- Source Code Control System - Header
-
- $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/extensions/source/plugin/unx/nppapi.cxx,v 1.7 2008-01-14 14:53:38 ihi Exp $
-
-*************************************************************************/
+ *
+ * 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.
+ *
+ ************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_extensions.hxx"
diff --git a/extras/source/autotext/lang/fr/acor_fr-FR.dat b/extras/source/autotext/lang/fr/acor_fr-FR.dat
index 0179749c780e..c2277b6e0d54 100644
--- a/extras/source/autotext/lang/fr/acor_fr-FR.dat
+++ b/extras/source/autotext/lang/fr/acor_fr-FR.dat
Binary files differ
diff --git a/extras/source/autotext/lang/pt-BR/acor_pt-BR.dat b/extras/source/autotext/lang/pt-BR/acor_pt-BR.dat
index ddfc5f8fae45..8ff201c2c3c7 100644
--- a/extras/source/autotext/lang/pt-BR/acor_pt-BR.dat
+++ b/extras/source/autotext/lang/pt-BR/acor_pt-BR.dat
Binary files differ
diff --git a/filter/source/config/fragments/filters/MathML_XML__Math_.xcu b/filter/source/config/fragments/filters/MathML_XML__Math_.xcu
index b6ab09ac89cd..7c80e41f6030 100644
--- a/filter/source/config/fragments/filters/MathML_XML__Math_.xcu
+++ b/filter/source/config/fragments/filters/MathML_XML__Math_.xcu
@@ -1,5 +1,5 @@
<node oor:name="MathML XML (Math)" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE ENCRYPTION</value></prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"/>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 8115f36d76f8..43f6f1faf2f1 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -791,7 +791,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
pPDFExtOutDevData->SetIsReduceImageResolution( mbReduceImageResolution );
pPDFExtOutDevData->SetIsExportNamedDestinations( mbExportBmkToDest );
- Sequence< PropertyValue > aRenderOptions( 6 );
+ Sequence< PropertyValue > aRenderOptions( 5 );
aRenderOptions[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) );
aRenderOptions[ 0 ].Value <<= Reference< awt::XDevice >( pXDevice );
aRenderOptions[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) );
@@ -801,10 +801,14 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
aRenderOptions[ 2 ].Value <<= sal_True;
aRenderOptions[ 3 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsLastPage" ) );
aRenderOptions[ 3 ].Value <<= sal_False;
- aRenderOptions[ 4 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) );
- aRenderOptions[ 4 ].Value <<= aPageRange;
- aRenderOptions[ 5 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) );
- aRenderOptions[ 5 ].Value <<= mbSkipEmptyPages;
+ aRenderOptions[ 4 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) );
+ aRenderOptions[ 4 ].Value <<= mbSkipEmptyPages;
+ #if 0
+ // #i113919# writer has to begun "PageRange" for itself changing its renderer count
+ // we should unify this behavior but not for OOo 3.3
+ aRenderOptions[ 5 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) );
+ aRenderOptions[ 5 ].Value <<= aPageRange;
+ #endif
if( aPageRange.getLength() || !aSelection.hasValue() )
{
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 99dd3107f162..75bcc4c4587f 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -103,6 +103,7 @@
#include <unotools/moduleoptions.hxx>
#include <svtools/sfxecode.hxx>
#include <unotools/processfactory.hxx>
+#include <unotools/ucbhelper.hxx>
#include <comphelper/configurationhelper.hxx>
#include <rtl/ustrbuf.hxx>
#include <vcl/svapp.hxx>
@@ -1407,7 +1408,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded()
// don't check the complete URL here.
// use its main part - ignore optional jumpmarks!
const ::rtl::OUString sURL = xModel->getURL();
- if (!m_aURL.Main.equals(sURL))
+ if (!::utl::UCBContentHelper::EqualURLs( m_aURL.Main, sURL ))
{
xTask.clear ();
continue;
diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx
index dfadecfd5eb7..2109c310b233 100644
--- a/i18npool/source/transliteration/transliterationImpl.cxx
+++ b/i18npool/source/transliteration/transliterationImpl.cxx
@@ -295,7 +295,6 @@ OUString SAL_CALL
TransliterationImpl::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
Sequence< sal_Int32 >& offset ) throw(RuntimeException)
{
-
if (numCascade == 0)
return inStr;
diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx
index b58347826470..43222b7a41eb 100755
--- a/i18npool/source/transliteration/transliteration_body.cxx
+++ b/i18npool/source/transliteration/transliteration_body.cxx
@@ -35,6 +35,7 @@
#include <comphelper/processfactory.hxx>
#include <osl/diagnose.h>
+#include <string.h>
#include "characterclassificationImpl.hxx"
#include "breakiteratorImpl.hxx"
@@ -96,7 +97,7 @@ static sal_uInt8 lcl_getMappingTypeForToggleCase( sal_uInt8 nMappingType, sal_Un
nRes = MappingTypeLowerToUpper;
else
{
- OSL_ENSURE( nType & 0x01 /* upper case */, "uppercase character expected! 'Toggle case' failed?" );
+ // should also work properly for non-upper characters like white spacs, numbers, ...
nRes = MappingTypeUpperToLower;
}
}
@@ -330,185 +331,143 @@ Transliteration_titlecase::Transliteration_titlecase()
implementationName = "com.sun.star.i18n.Transliteration.Transliteration_titlecase";
}
-rtl::OUString SAL_CALL Transliteration_titlecase::transliterate(
- const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
- Sequence< sal_Int32 >& /*offset*/ )
- throw(RuntimeException)
+#if 0
+struct LigatureData
{
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- CharacterClassificationImpl aCharClassImpl( xMSF );
-
- // possible problem: the locale is not exactly specific for each word in the text...
- OUString aRes( aCharClassImpl.toTitle( inStr, startPos, nCount, aLocale ) );
- return aRes;
+ sal_uInt32 cChar;
+ sal_Char * pUtf8Text;
+};
+
+// available Unicode ligatures:
+// http://www.unicode.org/charts
+// http://www.unicode.org/charts/PDF/UFB00.pdf
+static LigatureData aLigatures[] =
+{
+ { 0x0FB00, "ff" },
+ { 0x0FB01, "fi" },
+ { 0x0FB02, "fl" },
+ { 0x0FB03, "ffi" },
+ { 0x0FB04, "ffl" },
+ { 0x0FB05, "ft" },
+ { 0x0FB06, "st" },
+
+ { 0x0FB13, "\xD5\xB4\xD5\xB6" }, // Armenian small men now
+ { 0x0FB14, "\xD5\xB4\xD5\xA5" }, // Armenian small men ech
+ { 0x0FB15, "\xD5\xB4\xD5\xAB" }, // Armenian small men ini
+ { 0x0FB16, "\xD5\xBE\xD5\xB6" }, // Armenian small vew now
+ { 0x0FB17, "\xD5\xB4\xD5\xAD" }, // Armenian small men xeh
+ { 0x00000, "" }
+};
+
+static inline bool lcl_IsLigature( sal_uInt32 cChar )
+{
+ return (0x0FB00 <= cChar && cChar <= 0x0FB06) || (0x0FB13 <= cChar && cChar <= 0x0FB17);
}
-Transliteration_sentencecase::Transliteration_sentencecase()
+static rtl::OUString lcl_ResolveLigature( sal_uInt32 cChar )
{
- nMappingType = MappingTypeToTitle; // though only to be applied to the first word...
- transliterationName = "sentence(generic)";
- implementationName = "com.sun.star.i18n.Transliteration.Transliteration_sentencecase";
+ rtl::OUString aRes;
+ if (lcl_IsLigature( cChar ))
+ {
+ LigatureData *pFound = NULL;
+ LigatureData *pData = aLigatures;
+ while (!pFound && pData->cChar != 0)
+ {
+ if (pData->cChar == cChar)
+ pFound = pData;
+ ++pData;
+ }
+ if (pFound)
+ aRes = rtl::OUString( pFound->pUtf8Text, strlen( pFound->pUtf8Text ), RTL_TEXTENCODING_UTF8 );
+ }
+ else
+ aRes = rtl::OUString( &cChar, 1 );
+ return aRes;
}
+#endif // if 0
-rtl::OUString SAL_CALL Transliteration_sentencecase::transliterate(
+static rtl::OUString transliterate_titlecase_Impl(
const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
+ const Locale &rLocale,
Sequence< sal_Int32 >& offset )
throw(RuntimeException)
{
- // inspired from Transliteration_body::transliterate
- sal_Int32 nOffCount = 0, i;
- bool bPoint = true;
- if (useOffset)
- {
- for( i = 0; i < nCount; ++i ) {
- sal_Unicode c = inStr.getStr()[ i + startPos ];
- if( sal_Unicode('.') == c || sal_Unicode('!') == c || sal_Unicode('?') == c ) {
- bPoint = true;
- nOffCount++;
- }
- else if( unicode::isAlpha( c ) || unicode::isDigit( c ) )
- {
- const Mapping* map = 0;
- if( bPoint && unicode::isLower( c ))
- {
- map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeLowerToUpper);
- bPoint = false;
- }
- else if (!bPoint && unicode::isUpper( c ))
- {
- map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeUpperToLower);
- }
-
- if(map == 0)
- {
- nOffCount++;
- }
- else
- {
- nOffCount += map->nmap;
- }
- }
- else
- {
- nOffCount++;
- }
- }
- }
-
- bPoint = true;
- rtl::OUStringBuffer result;
+ const OUString aText( inStr.copy( startPos, nCount ) );
- if (useOffset)
+ OUString aRes;
+ if (aText.getLength() > 0)
{
- result.ensureCapacity(nOffCount);
- if ( nOffCount != offset.getLength() )
- offset.realloc( nOffCount );
- }
-
-
- sal_Int32 j = 0;
- sal_Int32 * pArr = offset.getArray();
- for( i = 0; i < nCount; ++i ) {
- sal_Unicode c = inStr.getStr()[ i + startPos ];
- if( sal_Unicode('.') == c || sal_Unicode('!') == c || sal_Unicode('?') == c ) {
- bPoint = true;
- result.append(c);
- pArr[j++] = i + startPos;
- }
- else if( unicode::isAlpha( c ) || unicode::isDigit( c ) )
- {
- const Mapping* map = 0;
- if( bPoint && unicode::isLower( c ))
- {
- map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeLowerToUpper);
- }
- else if (!bPoint && unicode::isUpper( c ))
- {
- map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeUpperToLower);
- }
-
- if(map == 0)
- {
- result.append( c );
- pArr[j++] = i + startPos;
- }
- else
- {
- for (sal_Int32 k = 0; k < map->nmap; k++)
- {
- result.append( map->map[k] );
- pArr[j++] = i + startPos;
- }
- }
- bPoint = false;
- }
- else
+ Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ CharacterClassificationImpl aCharClassImpl( xMSF );
+
+ // because aCharClassImpl.toTitle does not handle ligatures or but will raise
+ // an exception we need to handle the first chara manually...
+
+ // we don't want to change surrogates by accident, thuse we use proper code point iteration
+ sal_Int32 nPos = 0;
+ sal_uInt32 cFirstChar = aText.iterateCodePoints( &nPos );
+ OUString aResolvedLigature( &cFirstChar, 1 ); //lcl_ResolveLigature( cFirstChar ) );
+ // toUpper can be used to properly resolve ligatures and characters like
+ aResolvedLigature = aCharClassImpl.toUpper( aResolvedLigature, 0, aResolvedLigature.getLength(), rLocale );
+ // since toTitle will leave all-uppercase text unchanged we first need to
+ // use toLower to bring possible 2nd and following charas in lowercase
+ aResolvedLigature = aCharClassImpl.toLower( aResolvedLigature, 0, aResolvedLigature.getLength(), rLocale );
+ sal_Int32 nResolvedLen = aResolvedLigature.getLength();
+
+ // now we can properly use toTitle to get the expected result for the resolved string.
+ // The rest of the text should just become lowercase.
+ aRes = aCharClassImpl.toTitle( aResolvedLigature, 0, nResolvedLen, rLocale );
+ aRes += aCharClassImpl.toLower( aText, 1, aText.getLength() - 1, rLocale );
+ offset.realloc( aRes.getLength() );
+
+ sal_Int32 *pOffset = offset.getArray();
+ sal_Int32 nLen = offset.getLength();
+ for (sal_Int32 i = 0; i < nLen; ++i)
{
- result.append( c );
- pArr[j++] = i + startPos;
+ sal_Int32 nIdx = 0;
+ if (i >= nResolvedLen)
+ nIdx = i - nResolvedLen + 1;
+ pOffset[i] = nIdx;
}
}
- return result.makeStringAndClear();
+#if OSL_DEBUG_LEVEL > 1
+ const sal_Int32 *pCOffset = offset.getConstArray();
+ (void) pCOffset;
+#endif
+
+ return aRes;
}
-#if 0
-// TL: alternative implemntation try. But breakiterator has its problem too since
-// beginOfSentence does not work as expected with '.'. See comment below.
-// For the time being I will leave this code here as a from-scratch sample if the
-// breakiterator works better at some point...
-rtl::OUString SAL_CALL Transliteration_sentencecase::transliterate(
- const OUString& inStr, sal_Int32 nStartPos, sal_Int32 nCount,
- Sequence< sal_Int32 >& /*offset*/ )
+
+// this function expects to be called on a word-by-word basis,
+// namely that startPos points to the first char of the word
+rtl::OUString SAL_CALL Transliteration_titlecase::transliterate(
+ const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
+ Sequence< sal_Int32 >& offset )
throw(RuntimeException)
{
- OUString aRes( inStr.copy( nStartPos, nCount ) );
+ return transliterate_titlecase_Impl( inStr, startPos, nCount, aLocale, offset );
+}
- if (nStartPos >= 0 && nStartPos < inStr.getLength() && nCount > 0)
- {
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- BreakIteratorImpl brk( xMSF );
- sal_Int32 nSentenceStart = -1, nOldSentenceStart = -1;
- sal_Int32 nPos = nStartPos + nCount - 1;
- while (nPos >= nStartPos && nPos != -1)
- {
- // possible problem: the locale is not exactly specific for each sentence in the text,
- // but it is the only one we have...
- nOldSentenceStart = nSentenceStart;
- nSentenceStart = brk.beginOfSentence( inStr, nPos, aLocale );
-
- // since the breakiterator completely ignores '.' characvters as end-of-sentence when
- // the next word is lower case we need to take care of that ourself. The drawback:
- // la mid-sentence abbreviation like e.g. will now be identified as end-of-sentence. :-(
- // Well, at least the other product does it in the same way...
- sal_Int32 nFullStopPos = inStr.lastIndexOf( (sal_Unicode)'.', nPos );
- nPos = nSentenceStart;
- if (nFullStopPos > 0 && nFullStopPos > nSentenceStart)
- {
- Boundary aBd2 = brk.nextWord( inStr, nFullStopPos, aLocale, WordType::DICTIONARY_WORD );
- nSentenceStart = aBd2.startPos;
- nPos = nFullStopPos;
- }
+Transliteration_sentencecase::Transliteration_sentencecase()
+{
+ nMappingType = MappingTypeToTitle; // though only to be applied to the first word...
+ transliterationName = "sentence(generic)";
+ implementationName = "com.sun.star.i18n.Transliteration.Transliteration_sentencecase";
+}
- if (nSentenceStart < nOldSentenceStart || nOldSentenceStart == -1)
- {
- // the sentence start might be a quotation mark or some kind of bracket, thus
- // we need the first dictionary word starting or following this position
- // Boundary aBd1 = brk.nextWord( inStr, nSentenceStart, aLocale, WordType::DICTIONARY_WORD );
- Boundary aBd2 = brk.getWordBoundary( inStr, nSentenceStart, aLocale, WordType::DICTIONARY_WORD, true );
- // OUString aWord1( inStr.copy( aBd1.startPos, aBd1.endPos - aBd1.startPos + 1 ) );
- OUString aWord2( inStr.copy( aBd2.startPos, aBd2.endPos - aBd2.startPos + 1 ) );
- }
- else
- break; // prevent endless loop
- // continue with previous sentence
- if (nPos != -1)
- --nPos;
- }
- }
- return aRes;
+// this function expects to be called on a sentence-by-sentence basis,
+// namely that startPos points to the first word (NOT first char!) in the sentence
+rtl::OUString SAL_CALL Transliteration_sentencecase::transliterate(
+ const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
+ Sequence< sal_Int32 >& offset )
+ throw(RuntimeException)
+{
+ return transliterate_titlecase_Impl( inStr, startPos, nCount, aLocale, offset );
}
-#endif
+
} } } }
+
diff --git a/l10ntools/java/jpropex/java/JPropEx.java b/l10ntools/java/jpropex/java/JPropEx.java
index be59d7f29479..ceeeb5083982 100644
--- a/l10ntools/java/jpropex/java/JPropEx.java
+++ b/l10ntools/java/jpropex/java/JPropEx.java
@@ -145,8 +145,11 @@ public class JPropEx
//String path = makeAbs( inputFileArg );
path = path.replace( rootArg + "/" , "" );
path = path.replace("/","\\");
- return new SdfEntity( projectArg , path , "" /* dummy1 */ , resourceType , "", "" , "" , "" , "" /* dummy2 */ ,
- sourceLanguage , "", "" , "" , "" , "2002-02-02 02:02:02" );
+ // TODO: Make this static
+ java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String date = dateformat.format( new Date() );
+ return new SdfEntity( projectArg , path , "0" /* dummy1 */ , resourceType , "", "" , "" , "" , "0" /* dummy2 */ ,
+ sourceLanguage , "", "" , "" , "" , date );
}
private void merge()
diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl
index 4b7040d6583d..7a9d8beb6f15 100644
--- a/l10ntools/scripts/localize.pl
+++ b/l10ntools/scripts/localize.pl
@@ -492,7 +492,7 @@ sub collectfiles{
# -e
# if ( -x $command ){
if( $command ){
- if( !$bVerbose ){ $args .= " -QQ "; }
+ if( !$bVerbose ){ $args .= " "; }
$args .= " -e -f $localizeSDF -l ";
my $bFlag="";
if( $bAll ) {$args .= " en-US";}
diff --git a/l10ntools/scripts/tool/sdf.py b/l10ntools/scripts/tool/sdf.py
index 2afcbaf4bb1f..96afbed1452c 100644
--- a/l10ntools/scripts/tool/sdf.py
+++ b/l10ntools/scripts/tool/sdf.py
@@ -26,6 +26,7 @@
#*************************************************************************
from pseudo import PseudoSet,PseudoOrderedDict
+from time import gmtime, strftime
class SdfData:
_filename = "";
@@ -113,8 +114,8 @@ class SdfEntity:
const._TITLE_POS = 13
const._DATE_POS = 14
- def __init__(self, project="", source_file="", dummy1="", resource_type="", gid="", lid="", helpid="", platform="", dummy2="", langid="",
- text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"):
+ def __init__(self, project="", source_file="", dummy1="0", resource_type="", gid="", lid="", helpid="", platform="", dummy2="0", langid="",
+ text="", helptext="", quickhelptext="", title="", date=""):
self.project = project;
self.source_file = source_file;
self.dummy1 = dummy1;
@@ -129,7 +130,11 @@ class SdfEntity:
self.helptext = helptext;
self.quickhelptext = quickhelptext;
self.title = title;
- self.date = date;
+ if date != "":
+ self.date = date;
+ else:
+ self.date = strftime("%Y-%m-%d %H:%M:%S",gmtime())
+
def set_properties(self, line):
splitted = line.split("\t")
diff --git a/l10ntools/scripts/tool/xtxex.py b/l10ntools/scripts/tool/xtxex.py
index 2c5f132530a6..96912754b7df 100644
--- a/l10ntools/scripts/tool/xtxex.py
+++ b/l10ntools/scripts/tool/xtxex.py
@@ -39,7 +39,8 @@ class Xtxex(AbstractL10nTool):
def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata):
# Special handling for en-US files
if lang == "en-US":
- mod_outputfilename = outputfilename.replace("_en-US",'')
+ mod_outputfilename = outputfilename
+ # mod here if needed
self.copy_file(inputfilename, mod_outputfilename)
return
# merge usual lang
diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex
index 659cd06e16d4..ca307cf2d4a4 100755
--- a/l10ntools/scripts/xhtex
+++ b/l10ntools/scripts/xhtex
@@ -31,9 +31,16 @@ if [ x${SOLARENV}x = xx ]; then
exit 1
fi
+if [ ${GUI} = "WNT" ]; then
if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
- exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
+ exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
else
- exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@"
+ exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@"
+fi
+else
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
+ exec python -B $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
+else
+ exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@"
+fi
fi
-
diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex
index 28529506e3a2..fb54c1aee36c 100755
--- a/l10ntools/scripts/xtxex
+++ b/l10ntools/scripts/xtxex
@@ -31,9 +31,17 @@ if [ x${SOLARENV}x = xx ]; then
exit 1
fi
+if [ ${GUI} = "WNT" ]; then
if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
- exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
+ exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
else
- exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@"
+ exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@"
+fi
+else
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
+ exec python -B $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
+else
+ exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@"
+fi
fi
diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs
index 76c4bb17782b..62d3fdcce85d 100644
--- a/officecfg/registry/schema/org/openoffice/Setup.xcs
+++ b/officecfg/registry/schema/org/openoffice/Setup.xcs
@@ -395,7 +395,14 @@
<author>AS</author>
<desc>Contains all of the document factories that were installed during setup.</desc>
</info>
- </set>
+ </set>
+ <prop oor:name="OfficeRestartInProgress" oor:type="xs:boolean">
+ <info>
+ <author>MAV</author>
+ <desc>The entry specifies that we are in restart process</desc>
+ </info>
+ <value>false</value>
+ </prop>
</group>
<group oor:name="L10N">
<info>
diff --git a/oovbaapi/ooo/vba/excel/XGlobals.idl b/oovbaapi/ooo/vba/excel/XGlobals.idl
index 6ed51b2aa4c4..d79196b00927 100644
--- a/oovbaapi/ooo/vba/excel/XGlobals.idl
+++ b/oovbaapi/ooo/vba/excel/XGlobals.idl
@@ -42,6 +42,10 @@
#ifndef __ooo_vba_XAssistant_idl__
#include <ooo/vba/XAssistant.idl>
#endif
+#ifndef __ooo_vba_excel_XApplication_idl__
+#include <ooo/vba/excel/XApplication.idl>
+#endif
+
module ooo { module vba { module excel {
interface XRange;
@@ -55,6 +59,9 @@ interface XGlobals: com::sun::star::uno::XInterface
[attribute, readonly] ooo::vba::XAssistant Assistant;
[attribute, readonly] any Selection;
[attribute, readonly] XWorkbook ThisWorkbook;
+ [attribute, readonly] ooo::vba::excel::XApplication Excel;
+ [attribute, readonly] any Debug;
+
void Calculate() raises(com::sun::star::script::BasicErrorException);
XRange Cells([in] any RowIndex, [in] any ColumnIndex);
diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl
index fb6261bc06c0..3eb8337798d6 100644
--- a/oovbaapi/ooo/vba/excel/XWorksheet.idl
+++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl
@@ -66,12 +66,14 @@ interface XWorksheet
[attribute, readonly] boolean ProtectionMode;
[attribute, readonly] boolean ProtectContents;
[attribute, readonly] boolean ProtectDrawingObjects;
+ [attribute, readonly] boolean ProtectScenarios;
[attribute, readonly] XRange UsedRange;
[attribute, readonly] XWorksheet Next;
[attribute, readonly] XWorksheet Previous;
[attribute, readonly] string CodeName;
[attribute, readonly] short Index;
[attribute] long EnableSelection;
+ [attribute] boolean AutoFilterMode;
void Activate();
void Calculate( );
diff --git a/oox/prj/d.lst b/oox/prj/d.lst
index 482a270926a3..f20db064d7b2 100644
--- a/oox/prj/d.lst
+++ b/oox/prj/d.lst
@@ -36,7 +36,6 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls
..\inc\oox\ole\vbaproject.hxx %_DEST%\inc%_EXT%\oox\ole\vbaproject.hxx
..\inc\oox\vml\vmldrawing.hxx %_DEST%\inc%_EXT%\oox\vml\vmldrawing.hxx
..\inc\oox\vml\vmlshape.hxx %_DEST%\inc%_EXT%\oox\vml\vmlshape.hxx
-..\inc\oox\xls\excelvbaproject.hxx %_DEST%\inc%_EXT%\oox\xls\excelvbaproject.hxx
dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; fi"
diff --git a/sal/textenc/convertadobe.tab b/sal/textenc/convertadobe.tab
index b657256d7bfe..31ec3305933b 100644
--- a/sal/textenc/convertadobe.tab
+++ b/sal/textenc/convertadobe.tab
@@ -185,6 +185,7 @@ rtl::textenc::BmpUnicodeToSingleByteRange const unicodeToAdobeSymbolEncoding[]
{ 0x23D0, 0x23D0 - 0x23D0, 0xBE }, { 0x25CA, 0x25CA - 0x25CA, 0xE0 },
{ 0x2660, 0x2660 - 0x2660, 0xAA }, { 0x2663, 0x2663 - 0x2663, 0xA7 },
{ 0x2665, 0x2665 - 0x2665, 0xA9 }, { 0x2666, 0x2666 - 0x2666, 0xA8 },
+ { 0xF000, 0xF0FF - 0xF000, 0x00 }, // symbol aliasing U+F0XX->S+00XX
{ 0xF6D9, 0xF6D9 - 0xF6D9, 0xD3 }, { 0xF6DA, 0xF6DA - 0xF6DA, 0xD2 },
{ 0xF6DB, 0xF6DB - 0xF6DB, 0xD4 }, { 0xF8E5, 0xF8E5 - 0xF8E5, 0x60 },
{ 0xF8E8, 0xF8EA - 0xF8E8, 0xE2 } };
@@ -251,6 +252,7 @@ rtl::textenc::BmpUnicodeToSingleByteRange const unicodeToAdobeDingbatsEncoding[]
{ 0x2756, 0x2756 - 0x2756, 0x76 }, { 0x2758, 0x275E - 0x2758, 0x78 },
{ 0x2761, 0x2767 - 0x2761, 0xA1 }, { 0x2776, 0x2794 - 0x2776, 0xB6 },
{ 0x2798, 0x27AF - 0x2798, 0xD8 }, { 0x27B1, 0x27BE - 0x27B1, 0xF1 },
+ { 0xF000, 0xF0FF - 0xF000, 0x00 }, // symbol aliasing U+F0XX->S+00XX
{ 0xF8D7, 0xF8E4 - 0xF8D7, 0x80 }};
rtl::textenc::BmpUnicodeToSingleByteConverterData const
diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx
index 9857d675b7ab..b788672aa715 100644
--- a/sc/inc/scmatrix.hxx
+++ b/sc/inc/scmatrix.hxx
@@ -99,6 +99,7 @@ class SC_DLLPUBLIC ScMatrix
mutable ULONG nRefCnt; // reference count
SCSIZE nColCount;
SCSIZE nRowCount;
+ bool mbCloneIfConst; // Whether the matrix is cloned with a CloneIfConst() call.
void ResetIsString();
void DeleteIsString();
@@ -171,11 +172,19 @@ public:
/** If nC*nR results in more than GetElementsMax() entries, a 1x1 matrix is
created instead and a double error value (errStackOverflow) is set.
Compare nC and nR with a GetDimensions() call to check. */
- ScMatrix( SCSIZE nC, SCSIZE nR) : nRefCnt(0) { CreateMatrix( nC, nR); }
+ ScMatrix( SCSIZE nC, SCSIZE nR) : nRefCnt(0), mbCloneIfConst(true) { CreateMatrix( nC, nR); }
/** Clone the matrix. */
ScMatrix* Clone() const;
+ /** Clone the matrix if mbCloneIfConst (immutable) is set, otherwise
+ return _this_ matrix, to be assigned to a ScMatrixRef. */
+ ScMatrix* CloneIfConst();
+
+ /** Set the matrix to (im)mutable for CloneIfConst(), only the interpreter
+ should do this and know the consequences. */
+ inline void SetImmutable( bool bVal ) { mbCloneIfConst = bVal; }
+
/**
* Resize the matrix to specified new dimension. Note that this operation
* clears all stored values.
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 35c63f52a92b..1e4c02967152 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2481,22 +2481,13 @@ void ScInterpreter::ScN()
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScN" );
USHORT nErr = nGlobalError;
nGlobalError = 0;
- double fVal;
- if ( GetRawStackType() == svString )
- {
- fVal = 0.0;
- Pop();
- }
- else
- {
- // Temporarily override the ConvertStringToValue() error for
- // GetCellValue() / GetCellValueOrZero()
- USHORT nSErr = mnStringNoValueError;
- mnStringNoValueError = errCellNoValue;
- fVal = GetDouble();
- mnStringNoValueError = nSErr;
- }
- if ( nGlobalError == NOTAVAILABLE || nGlobalError == errIllegalArgument )
+ // Temporarily override the ConvertStringToValue() error for
+ // GetCellValue() / GetCellValueOrZero()
+ USHORT nSErr = mnStringNoValueError;
+ mnStringNoValueError = errCellNoValue;
+ double fVal = GetDouble();
+ mnStringNoValueError = nSErr;
+ if ( nGlobalError == NOTAVAILABLE || nGlobalError == errCellNoValue )
nGlobalError = 0; // N(#NA) and N("text") are ok
if ( !nGlobalError && nErr != NOTAVAILABLE )
nGlobalError = nErr;
@@ -7108,10 +7099,6 @@ void ScInterpreter::ScText()
case svDouble:
fVal = PopDouble();
break;
- case svString:
- aStr = PopString();
- bString = true;
- break;
default:
{
FormulaTokenRef xTok( PopToken());
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 5c326001ff02..47cde7186067 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -231,6 +231,12 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ConvertStringToValue" );
double fValue = 0.0;
+ if (mnStringNoValueError == errCellNoValue)
+ {
+ // Requested that all strings result in 0, error handled by caller.
+ SetError( mnStringNoValueError);
+ return fValue;
+ }
::rtl::OUString aStr( rStr);
rtl_math_ConversionStatus eStatus;
sal_Int32 nParseEnd;
@@ -3964,5 +3970,10 @@ StackVar ScInterpreter::Interpret()
while( maxsp-- )
(*p++)->DecRef();
- return xResult->GetType();
+ StackVar eType = xResult->GetType();
+ if (eType == svMatrix)
+ // Results are immutable in case they would be reused as input for new
+ // interpreters.
+ static_cast<ScToken*>(xResult.operator->())->GetMatrix()->SetImmutable( true);
+ return eType;
}
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index ba4322a3281a..73794cf15b2d 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -310,6 +310,9 @@ ScMatrixRef ScInterpreter::GetNewMat(SCSIZE nC, SCSIZE nR)
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetNewMat" );
ScMatrix* pMat = new ScMatrix( nC, nR);
pMat->SetErrorInterpreter( this);
+ // A temporary matrix is mutable and ScMatrix::CloneIfConst() returns the
+ // very matrix.
+ pMat->SetImmutable( false);
SCSIZE nCols, nRows;
pMat->GetDimensions( nCols, nRows);
if ( nCols != nC || nRows != nR )
@@ -2069,23 +2072,25 @@ bool ScInterpreter::CheckMatrix(BOOL _bLOG,BOOL _bTrendGrowth,BYTE& nCase,SCSIZE
{
PushIllegalArgument();
return false;
- } // if (!pMatY->IsValue(i))
- } // for ( SCSIZE i = 0; i < nCountY; i++ )
+ }
+ }
+
if ( _bLOG )
{
+ ScMatrixRef pNewY = pMatY->CloneIfConst();
for (SCSIZE nElem = 0; nElem < nCountY; nElem++)
{
- const double fVal = pMatY->GetDouble(nElem);
+ const double fVal = pNewY->GetDouble(nElem);
if (fVal <= 0.0)
{
PushIllegalArgument();
return false;
}
else
- pMatY->PutDouble(log(fVal), nElem);
- } // for (nElem = 0; nElem < nCountY; nElem++)
- } // if ( _bRKP )
-
+ pNewY->PutDouble(log(fVal), nElem);
+ }
+ pMatY = pNewY;
+ }
if (pMatX)
{
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index fbb859b64ebf..2ecc20f53405 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -81,6 +81,11 @@ ScMatrix* ScMatrix::Clone() const
return pScMat;
}
+ScMatrix* ScMatrix::CloneIfConst()
+{
+ return (mbCloneIfConst || IsEternalRef()) ? Clone() : this;
+}
+
void ScMatrix::Resize( SCSIZE nC, SCSIZE nR)
{
Clear();
diff --git a/sc/source/ui/vba/makefile.mk b/sc/source/ui/vba/makefile.mk
index 4cb7e3eb064b..92bb3fd39db0 100644
--- a/sc/source/ui/vba/makefile.mk
+++ b/sc/source/ui/vba/makefile.mk
@@ -47,63 +47,63 @@ INCPRE=$(INCCOM)$/$(TARGET)
# ------------------------------------------------------------------
SLOFILES= \
- $(SLO)$/vbaglobals.obj \
- $(SLO)$/vbaworkbook.obj \
- $(SLO)$/vbaworksheets.obj \
+ $(SLO)$/excelvbahelper.obj \
+ $(SLO)$/service.obj \
$(SLO)$/vbaapplication.obj \
- $(SLO)$/vbarange.obj \
- $(SLO)$/vbaname.obj \
- $(SLO)$/vbanames.obj \
- $(SLO)$/vbacomment.obj \
- $(SLO)$/vbacomments.obj \
- $(SLO)$/vbaworkbooks.obj \
- $(SLO)$/vbaworksheet.obj \
- $(SLO)$/vbaoutline.obj \
- $(SLO)$/vbafont.obj\
- $(SLO)$/excelvbahelper.obj\
- $(SLO)$/vbainterior.obj\
- $(SLO)$/vbawsfunction.obj\
- $(SLO)$/vbawindow.obj\
- $(SLO)$/vbachart.obj\
- $(SLO)$/vbachartobject.obj\
- $(SLO)$/vbachartobjects.obj\
- $(SLO)$/vbaseriescollection.obj\
- $(SLO)$/vbadialogs.obj \
- $(SLO)$/vbadialog.obj \
- $(SLO)$/vbapivottable.obj \
- $(SLO)$/vbapivotcache.obj \
- $(SLO)$/vbapivottables.obj \
- $(SLO)$/vbawindows.obj \
- $(SLO)$/vbapalette.obj \
+ $(SLO)$/vbaassistant.obj \
+ $(SLO)$/vbaaxes.obj \
+ $(SLO)$/vbaaxis.obj \
+ $(SLO)$/vbaaxistitle.obj \
$(SLO)$/vbaborders.obj \
$(SLO)$/vbacharacters.obj \
- $(SLO)$/vbavalidation.obj \
- $(SLO)$/vbasheetobject.obj \
- $(SLO)$/vbasheetobjects.obj \
- $(SLO)$/vbaoleobject.obj \
- $(SLO)$/vbaoleobjects.obj \
- $(SLO)$/vbatextboxshape.obj \
- $(SLO)$/vbapane.obj \
- $(SLO)$/vbatextframe.obj \
- $(SLO)$/vbacharttitle.obj \
+ $(SLO)$/vbachart.obj \
+ $(SLO)$/vbachartobject.obj \
+ $(SLO)$/vbachartobjects.obj \
$(SLO)$/vbacharts.obj \
- $(SLO)$/vbaaxistitle.obj \
- $(SLO)$/vbaaxes.obj \
- $(SLO)$/vbaaxis.obj \
- $(SLO)$/vbaformat.obj \
+ $(SLO)$/vbacharttitle.obj \
+ $(SLO)$/vbacomment.obj \
+ $(SLO)$/vbacomments.obj \
$(SLO)$/vbacondition.obj \
+ $(SLO)$/vbadialog.obj \
+ $(SLO)$/vbadialogs.obj \
+ $(SLO)$/vbaeventshelper.obj \
+ $(SLO)$/vbafont.obj \
+ $(SLO)$/vbaformat.obj \
$(SLO)$/vbaformatcondition.obj \
$(SLO)$/vbaformatconditions.obj \
- $(SLO)$/vbastyle.obj \
- $(SLO)$/vbastyles.obj \
- $(SLO)$/vbaassistant.obj \
+ $(SLO)$/vbaglobals.obj \
$(SLO)$/vbahyperlink.obj \
$(SLO)$/vbahyperlinks.obj \
- $(SLO)$/vbapagesetup.obj \
+ $(SLO)$/vbainterior.obj \
+ $(SLO)$/vbaname.obj \
+ $(SLO)$/vbanames.obj \
+ $(SLO)$/vbaoleobject.obj \
+ $(SLO)$/vbaoleobjects.obj \
+ $(SLO)$/vbaoutline.obj \
$(SLO)$/vbapagebreak.obj \
$(SLO)$/vbapagebreaks.obj \
- $(SLO)$/vbaeventshelper.obj \
- $(SLO)$/service.obj
+ $(SLO)$/vbapagesetup.obj \
+ $(SLO)$/vbapalette.obj \
+ $(SLO)$/vbapane.obj \
+ $(SLO)$/vbapivotcache.obj \
+ $(SLO)$/vbapivottable.obj \
+ $(SLO)$/vbapivottables.obj \
+ $(SLO)$/vbarange.obj \
+ $(SLO)$/vbaseriescollection.obj \
+ $(SLO)$/vbasheetobject.obj \
+ $(SLO)$/vbasheetobjects.obj \
+ $(SLO)$/vbastyle.obj \
+ $(SLO)$/vbastyles.obj \
+ $(SLO)$/vbatextboxshape.obj \
+ $(SLO)$/vbatextframe.obj \
+ $(SLO)$/vbavalidation.obj \
+ $(SLO)$/vbawindow.obj \
+ $(SLO)$/vbawindows.obj \
+ $(SLO)$/vbaworkbook.obj \
+ $(SLO)$/vbaworkbooks.obj \
+ $(SLO)$/vbaworksheet.obj \
+ $(SLO)$/vbaworksheets.obj \
+ $(SLO)$/vbawsfunction.obj
.ENDIF
# --- Targets ------------------------------------------------------
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 8f5aba5c4acb..f3965393e919 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -88,12 +88,6 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-// Enable our own join detection for Intersection and Union
-// should be more efficient than using ScRangeList::Join ( because
-// we already are testing the same things )
-
-#define OWN_JOIN 1
-
// #TODO is this defined somewhere else?
#if ( defined UNX ) || ( defined OS2 ) //unix
#define FILE_PATH_SEPERATOR "/"
@@ -302,7 +296,8 @@ ScVbaApplication::getActiveCell() throw (uno::RuntimeException )
sal_Int32 nCursorX = pTabView->GetCurX();
sal_Int32 nCursorY = pTabView->GetCurY();
- return new ScVbaRange( this, mxContext, xRange->getCellRangeByPosition( nCursorX, nCursorY, nCursorX, nCursorY ) );
+ uno::Reference< XHelperInterface > xParent( excel::getUnoSheetModuleObj( xRange ), uno::UNO_QUERY_THROW );
+ return new ScVbaRange( xParent, mxContext, xRange->getCellRangeByPosition( nCursorX, nCursorY, nCursorX, nCursorY ) );
}
uno::Any SAL_CALL
@@ -805,412 +800,289 @@ ScVbaApplication::PathSeparator( ) throw (script::BasicErrorException, uno::Run
return sPathSep;
}
-typedef std::list< ScRange > Ranges;
-typedef std::list< ScRangeList > RangesList;
+// ----------------------------------------------------------------------------
+// Helpers for Intersect and Union
+
+namespace {
+
+typedef ::std::list< ScRange > ListOfScRange;
-void lcl_addRangesToVec( RangesList& vRanges, const uno::Any& aArg ) throw ( script::BasicErrorException, uno::RuntimeException )
+/** Appends all ranges of a VBA Range object in the passed Any to the list of ranges. */
+void lclAddToListOfScRange( ListOfScRange& rList, const uno::Any& rArg )
+ throw (script::BasicErrorException, uno::RuntimeException)
{
- ScRangeList theRanges;
- uno::Reference< excel::XRange > xRange( aArg, uno::UNO_QUERY_THROW );
- uno::Reference< XCollection > xCol( xRange->Areas( uno::Any() ), uno::UNO_QUERY_THROW );
- sal_Int32 nCount = xCol->getCount();
- for( sal_Int32 i = 1; i <= nCount; ++i )
+ if( rArg.hasValue() )
{
- uno::Reference< excel::XRange > xAreaRange( xCol->Item( uno::makeAny( sal_Int32(i) ), uno::Any() ), uno::UNO_QUERY_THROW );
- uno::Reference< sheet::XCellRangeAddressable > xAddressable( xAreaRange->getCellRange(), uno::UNO_QUERY_THROW );
- table::CellRangeAddress addr = xAddressable->getRangeAddress();
- ScRange refRange;
- ScUnoConversion::FillScRange( refRange, addr );
- theRanges.Append( refRange );
+ uno::Reference< excel::XRange > xRange( rArg, uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xCol( xRange->Areas( uno::Any() ), uno::UNO_QUERY_THROW );
+ for( sal_Int32 nIdx = 1, nCount = xCol->getCount(); nIdx <= nCount; ++nIdx )
+ {
+ uno::Reference< excel::XRange > xAreaRange( xCol->Item( uno::Any( nIdx ), uno::Any() ), uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XCellRangeAddressable > xAddressable( xAreaRange->getCellRange(), uno::UNO_QUERY_THROW );
+ ScRange aScRange;
+ ScUnoConversion::FillScRange( aScRange, xAddressable->getRangeAddress() );
+ rList.push_back( aScRange );
+ }
}
- vRanges.push_back( theRanges );
}
-void lcl_addRangeToVec( Ranges& vRanges, const uno::Any& aArg ) throw ( script::BasicErrorException, uno::RuntimeException )
+/** Returns true, if the passed ranges can be expressed by a single range. The
+ new range will be contained in r1 then, the range r2 can be removed. */
+bool lclTryJoin( ScRange& r1, const ScRange& r2 )
{
- uno::Reference< excel::XRange > xRange( aArg, uno::UNO_QUERY_THROW );
- uno::Reference< XCollection > xCol( xRange->Areas( uno::Any() ), uno::UNO_QUERY_THROW );
- sal_Int32 nCount = xCol->getCount();
- for( sal_Int32 i = 1; i <= nCount; ++i )
+ // 1) r2 is completely inside r1
+ if( r1.In( r2 ) )
+ return true;
+
+ // 2) r1 is completely inside r2
+ if( r2.In( r1 ) )
{
- uno::Reference< excel::XRange > xAreaRange( xCol->Item( uno::makeAny( sal_Int32(i) ), uno::Any() ), uno::UNO_QUERY_THROW );
- uno::Reference< sheet::XCellRangeAddressable > xAddressable( xAreaRange->getCellRange(), uno::UNO_QUERY_THROW );
- table::CellRangeAddress addr = xAddressable->getRangeAddress();
- ScRange refRange;
- ScUnoConversion::FillScRange( refRange, addr );
- vRanges.push_back( refRange );
+ r1 = r2;
+ return true;
}
-}
-bool lcl_canJoin( ScRange& r1, ScRange& r2 )
-{
- bool bCanJoin = false;
- SCCOL startEndColDiff = r2.aStart.Col() - r1.aEnd.Col();
- SCROW startEndRowDiff = r2.aStart.Row() - r1.aEnd.Row();
- SCCOL startColDiff = r2.aStart.Col() - r1.aStart.Col();
- SCCOL endColDiff = r2.aEnd.Col() - r1.aEnd.Col();
- SCROW startRowDiff = r2.aStart.Row() - r1.aStart.Row();
- SCROW endRowDiff = r2.aEnd.Row() - r1.aEnd.Row();
- if ( ( startRowDiff == endRowDiff ) && startRowDiff == 0 && startColDiff >=0 && endColDiff > 0 && ( startEndColDiff <= 1 && startEndColDiff >= -r1.aEnd.Col() ) )
- bCanJoin = true;
- else if ( ( startColDiff == endColDiff ) && startColDiff == 0 && startRowDiff >= 0 && endRowDiff > 0 && ( startEndRowDiff <= 1 && startEndRowDiff >= -r1.aEnd.Row() ) )
- bCanJoin = true;
-#ifdef DEBUG
- String sr1;
- String sr2;
- r1.Format( sr1, SCA_VALID ) ;
- r2.Format( sr2, SCA_VALID ) ;
- OSL_TRACE(" canJoin address %s with %s %s ( startRowDiff(%d), endRowDiff(%d), startColDiff(%d) endColDiff(%d) startEndRowDiff(%d), startEndColDiff(%d) ",
- rtl::OUStringToOString( sr1, RTL_TEXTENCODING_UTF8 ).getStr(),
- rtl::OUStringToOString( sr2, RTL_TEXTENCODING_UTF8 ).getStr(), bCanJoin ? "true" : "false", startRowDiff, endRowDiff, startColDiff, endColDiff, startEndRowDiff, startEndColDiff );
-#endif
- return bCanJoin;
-}
-// strips out ranges that contain other ranges, also
-// if the borders of the intersecting ranges are alligned
-// then the the range is extended to the larger
-// e.g. Range("A4:D10"), Range("B4:E10") would be combined
-// to Range("A4:E10")
-void lcl_strip_containedRanges( Ranges& vRanges )
-{
- // get rid of ranges that are surrounded by other ranges
- Ranges::iterator it_outer = vRanges.begin();
- while( it_outer != vRanges.end() )
+ SCCOL n1L = r1.aStart.Col();
+ SCCOL n1R = r1.aEnd.Col();
+ SCROW n1T = r1.aStart.Row();
+ SCROW n1B = r1.aEnd.Row();
+ SCCOL n2L = r2.aStart.Col();
+ SCCOL n2R = r2.aEnd.Col();
+ SCROW n2T = r2.aStart.Row();
+ SCROW n2B = r2.aEnd.Row();
+
+ // 3) r1 and r2 have equal upper and lower border
+ if( (n1T == n2T) && (n1B == n2B) )
{
- bool it_outer_erased = false; // true = it_outer erased from vRanges
- Ranges::iterator it_inner = vRanges.begin();
- /* Exit the inner loop if outer iterator has been erased in its last
- iteration (this means it has been joined to last it_inner, or that
- the it_inner contains it completely). The inner loop will restart
- with next element of the outer loop, and all elements (from the
- beginning of the list) will be checked against that new element. */
- while( !it_outer_erased && (it_inner != vRanges.end()) )
+ // check that r1 overlaps or touches r2
+ if( ((n1L < n2L) && (n2L - 1 <= n1R)) || ((n2L < n1L) && (n1L - 1 <= n2R)) )
{
- bool it_inner_erased = false; // true = it_inner erased from vRanges
- if ( it_outer != it_inner )
- {
-#ifdef DEBUG
- String r1;
- String r2;
- it_outer->Format( r1, SCA_VALID ) ;
- it_inner->Format( r2, SCA_VALID ) ;
- OSL_TRACE( "try strip/join address %s with %s ",
- rtl::OUStringToOString( r1, RTL_TEXTENCODING_UTF8 ).getStr(),
- rtl::OUStringToOString( r2, RTL_TEXTENCODING_UTF8 ).getStr() );
-#endif
- if ( it_outer->In( *it_inner ) )
- {
- it_inner = vRanges.erase( it_inner );
- it_inner_erased = true;
- }
- else if ( it_inner->In( *it_outer ) )
- {
- it_outer = vRanges.erase( it_outer );
- it_outer_erased = true;
- }
-#ifndef OWN_JOIN
- else if ( (*it_inner).aStart.Row() == (*it_outer).aStart.Row()
- && (*it_inner).aEnd.Row() == (*it_outer).aEnd.Row() )
- {
- it_outer->ExtendTo( *it_inner );
- it_inner = vRanges.erase( it_inner );
- it_inner_erased = true;
- }
-#else
- else if ( lcl_canJoin( *it_outer, *it_inner ) )
- {
- it_outer->ExtendTo( *it_inner );
- it_inner = vRanges.erase( it_inner );
- it_inner_erased = true;
- }
- else if ( lcl_canJoin( *it_inner, *it_outer) )
- {
- it_inner->ExtendTo( *it_outer );
- it_outer = vRanges.erase( it_outer );
- it_outer_erased = true;
- }
-#endif
- }
- /* If it_inner has not been erased from vRanges, continue inner
- loop with next element. Otherwise, it_inner already points to
- the next element (return value of list::erase()). */
- if( !it_inner_erased )
- ++it_inner;
+ r1.aStart.SetCol( ::std::min( n1L, n2L ) );
+ r1.aEnd.SetCol( ::std::max( n1R, n2R ) );
+ return true;
}
- /* If it_outer has not been erased from vRanges, continue outer loop
- with next element. Otherwise, it_outer already points to the next
- element (return value of list::erase()). */
- if( !it_outer_erased )
- ++it_outer;
+ return false;
}
+ // 4) r1 and r2 have equal left and right border
+ if( (n1L == n2L) && (n1R == n2R) )
+ {
+ // check that r1 overlaps or touches r2
+ if( ((n1T < n2T) && (n2T + 1 <= n1B)) || ((n2T < n1T) && (n1T + 1 <= n2B)) )
+ {
+ r1.aStart.SetRow( ::std::min( n1T, n2T ) );
+ r1.aEnd.SetRow( ::std::max( n1B, n2B ) );
+ return true;
+ }
+ return false;
+ }
+
+ // 5) cannot join these ranges
+ return false;
}
-Ranges
-lcl_intersectionImpl( ScRangeList& rl1, ScRangeList& rl2 )
+/** Strips out ranges that are contained by other ranges, joins ranges that can be joined
+ together (aligned borders, e.g. A4:D10 and B4:E10 would be combined to A4:E10. */
+void lclJoinRanges( ListOfScRange& rList )
{
- Ranges intersections;
- for ( USHORT x = 0 ; x < rl1.Count(); ++x )
+ ListOfScRange::iterator aOuterIt = rList.begin();
+ while( aOuterIt != rList.end() )
{
- for ( USHORT y = 0 ; y < rl2.Count(); ++y )
+ bool bAnyErased = false; // true = any range erased from rList
+ ListOfScRange::iterator aInnerIt = rList.begin();
+ while( aInnerIt != rList.end() )
{
-#ifdef DEBUG
- String r1;
- String r2;
- rl1.GetObject( x )->Format( r1, SCA_VALID ) ;
- rl2.GetObject( y )->Format( r2, SCA_VALID ) ;
- OSL_TRACE( "comparing address %s with %s ",
- rtl::OUStringToOString( r1, RTL_TEXTENCODING_UTF8 ).getStr(),
- rtl::OUStringToOString( r2, RTL_TEXTENCODING_UTF8 ).getStr() );
-#endif
- if( rl1.GetObject( x )->Intersects( *rl2.GetObject( y ) ) )
+ bool bInnerErased = false; // true = aInnerIt erased from rList
+ // do not compare a range with itself
+ if( (aOuterIt != aInnerIt) && lclTryJoin( *aOuterIt, *aInnerIt ) )
{
- ScRange aIntersection = ScRange( Max( rl1.GetObject( x )->aStart.Col(), rl2.GetObject( y )->aStart.Col() ),
- Max( rl1.GetObject( x )->aStart.Row(), rl2.GetObject( y )->aStart.Row() ),
- Max( rl1.GetObject( x )->aStart.Tab(), rl2.GetObject( y )->aStart.Tab() ),
- Min( rl1.GetObject( x )->aEnd.Col(), rl2.GetObject( y )->aEnd.Col() ),
- Min( rl1.GetObject( x )->aEnd.Row(), rl2.GetObject( y )->aEnd.Row() ),
- Min( rl1.GetObject( x )->aEnd.Tab(), rl2.GetObject( y )->aEnd.Tab() ) );
- intersections.push_back( aIntersection );
+ // aOuterIt points to joined range, aInnerIt will be removed
+ aInnerIt = rList.erase( aInnerIt );
+ bInnerErased = bAnyErased = true;
}
+ /* If aInnerIt has been erased from rList, it already points to
+ the next element (return value of list::erase()). */
+ if( !bInnerErased )
+ ++aInnerIt;
}
+ // if any range has been erased, repeat outer loop with the same range
+ if( !bAnyErased )
+ ++aOuterIt;
}
- lcl_strip_containedRanges( intersections );
- return intersections;
}
-// Intersection of a set of ranges ( where each range is represented by a ScRangeList e.g.
-// any range can be a multi-area range )
-// An intersection is performed between each range in the set of ranges.
-// The resulting set of intersections is then processed to strip out any
-// intersections that contain other intersections ( and also ranges that directly line up
-// are joined ) ( see lcl_strip_containedRanges )
-RangesList lcl_intersections( RangesList& vRanges )
+/** Intersects the passed list with all ranges of a VBA Range object in the passed Any. */
+void lclIntersectRanges( ListOfScRange& rList, const uno::Any& rArg )
+ throw (script::BasicErrorException, uno::RuntimeException)
{
- RangesList intersections;
- RangesList::iterator it = vRanges.begin();
- while( it != vRanges.end() )
+ // extract the ranges from the passed argument, will throw on invalid data
+ ListOfScRange aList2;
+ lclAddToListOfScRange( aList2, rArg );
+ // do nothing, if the passed list is already empty
+ if( !rList.empty() && !aList2.empty() )
{
- Ranges intermediateList;
- for( RangesList::iterator it_inner = vRanges.begin(); it_inner != vRanges.end(); ++it_inner )
+ // save original list in a local
+ ListOfScRange aList1;
+ aList1.swap( rList );
+ // join ranges from passed argument
+ lclJoinRanges( aList2 );
+ // calculate intersection of the ranges in both lists
+ for( ListOfScRange::const_iterator aOuterIt = aList1.begin(), aOuterEnd = aList1.end(); aOuterIt != aOuterEnd; ++aOuterIt )
{
- if ( it != it_inner )
+ for( ListOfScRange::const_iterator aInnerIt = aList2.begin(), aInnerEnd = aList2.end(); aInnerIt != aInnerEnd; ++aInnerIt )
{
- Ranges ranges = lcl_intersectionImpl( *it, *it_inner );
- for ( Ranges::iterator range_it = ranges.begin(); range_it != ranges.end(); ++range_it )
- intermediateList.push_back( *range_it );
+ if( aOuterIt->Intersects( *aInnerIt ) )
+ {
+ ScRange aIsectRange(
+ Max( aOuterIt->aStart.Col(), aInnerIt->aStart.Col() ),
+ Max( aOuterIt->aStart.Row(), aInnerIt->aStart.Row() ),
+ Max( aOuterIt->aStart.Tab(), aInnerIt->aStart.Tab() ),
+ Min( aOuterIt->aEnd.Col(), aInnerIt->aEnd.Col() ),
+ Min( aOuterIt->aEnd.Row(), aInnerIt->aEnd.Row() ),
+ Min( aOuterIt->aEnd.Tab(), aInnerIt->aEnd.Tab() ) );
+ rList.push_back( aIsectRange );
+ }
}
}
- it = vRanges.erase( it ); // remove it so we don't include it in the next pass.
- // 'it' is removed uncontidionally from vRanges, so the while loop will terminate
-
- ScRangeList argIntersect;
- lcl_strip_containedRanges( intermediateList );
-
- for( Ranges::iterator it_inter = intermediateList.begin(); it_inter != intermediateList.end(); ++it_inter )
-#ifndef OWN_JOIN
- argIntersect.Join( *it_inter );
-#else
- argIntersect.Append( *it_inter );
-#endif
-
- intersections.push_back( argIntersect );
- }
- return intersections;
-}
-
-uno::Reference< excel::XRange > SAL_CALL
-ScVbaApplication::Intersect( const uno::Reference< excel::XRange >& Arg1, const uno::Reference< excel::XRange >& Arg2, const uno::Any& Arg3, const uno::Any& Arg4, const uno::Any& Arg5, const uno::Any& Arg6, const uno::Any& Arg7, const uno::Any& Arg8, const uno::Any& Arg9, const uno::Any& Arg10, const uno::Any& Arg11, const uno::Any& Arg12, const uno::Any& Arg13, const uno::Any& Arg14, const uno::Any& Arg15, const uno::Any& Arg16, const uno::Any& Arg17, const uno::Any& Arg18, const uno::Any& Arg19, const uno::Any& Arg20, const uno::Any& Arg21, const uno::Any& Arg22, const uno::Any& Arg23, const uno::Any& Arg24, const uno::Any& Arg25, const uno::Any& Arg26, const uno::Any& Arg27, const uno::Any& Arg28, const uno::Any& Arg29, const uno::Any& Arg30 ) throw (script::BasicErrorException, uno::RuntimeException)
-{
- if ( !Arg1.is() || !Arg2.is() )
- DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
-
- RangesList vRanges;
- lcl_addRangesToVec( vRanges, uno::makeAny( Arg1 ) );
- lcl_addRangesToVec( vRanges, uno::makeAny( Arg2 ) );
-
- if ( Arg3.hasValue() )
- lcl_addRangesToVec( vRanges, Arg3 );
- if ( Arg4.hasValue() )
- lcl_addRangesToVec( vRanges, Arg4 );
- if ( Arg5.hasValue() )
- lcl_addRangesToVec( vRanges, Arg5 );
- if ( Arg6.hasValue() )
- lcl_addRangesToVec( vRanges, Arg6 );
- if ( Arg7.hasValue() )
- lcl_addRangesToVec( vRanges, Arg7 );
- if ( Arg8.hasValue() )
- lcl_addRangesToVec( vRanges, Arg8 );
- if ( Arg9.hasValue() )
- lcl_addRangesToVec( vRanges, Arg9 );
- if ( Arg10.hasValue() )
- lcl_addRangesToVec( vRanges, Arg10 );
- if ( Arg11.hasValue() )
- lcl_addRangesToVec( vRanges, Arg11 );
- if ( Arg12.hasValue() )
- lcl_addRangesToVec( vRanges, Arg12 );
- if ( Arg13.hasValue() )
- lcl_addRangesToVec( vRanges, Arg13 );
- if ( Arg14.hasValue() )
- lcl_addRangesToVec( vRanges, Arg14 );
- if ( Arg15.hasValue() )
- lcl_addRangesToVec( vRanges, Arg15 );
- if ( Arg16.hasValue() )
- lcl_addRangesToVec( vRanges, Arg16 );
- if ( Arg17.hasValue() )
- lcl_addRangesToVec( vRanges, Arg17 );
- if ( Arg18.hasValue() )
- lcl_addRangesToVec( vRanges, Arg18 );
- if ( Arg19.hasValue() )
- lcl_addRangesToVec( vRanges, Arg19 );
- if ( Arg20.hasValue() )
- lcl_addRangesToVec( vRanges, Arg20 );
- if ( Arg21.hasValue() )
- lcl_addRangesToVec( vRanges, Arg21 );
- if ( Arg22.hasValue() )
- lcl_addRangesToVec( vRanges, Arg22 );
- if ( Arg23.hasValue() )
- lcl_addRangesToVec( vRanges, Arg23 );
- if ( Arg24.hasValue() )
- lcl_addRangesToVec( vRanges, Arg24 );
- if ( Arg25.hasValue() )
- lcl_addRangesToVec( vRanges, Arg25 );
- if ( Arg26.hasValue() )
- lcl_addRangesToVec( vRanges, Arg26 );
- if ( Arg27.hasValue() )
- lcl_addRangesToVec( vRanges, Arg27 );
- if ( Arg28.hasValue() )
- lcl_addRangesToVec( vRanges, Arg28 );
- if ( Arg29.hasValue() )
- lcl_addRangesToVec( vRanges, Arg29 );
- if ( Arg30.hasValue() )
- lcl_addRangesToVec( vRanges, Arg30 );
-
- uno::Reference< excel::XRange > xRefRange;
-
- ScRangeList aCellRanges;
- // first pass - gets the set of all possible interections of Arg1..ArgN
- RangesList intersections = lcl_intersections( vRanges );
- // second pass - gets the intersections of the intersections ( don't ask, but this
- // is what seems to happen )
- if ( intersections.size() > 1)
- intersections = lcl_intersections( intersections );
- for( RangesList::iterator it = intersections.begin(); it != intersections.end(); ++it )
- {
- for ( USHORT x = 0 ; x < it->Count(); ++x )
-#ifndef OWN_JOIN
- aCellRanges.Join( *it->GetObject(x) );
-#else
- aCellRanges.Append( *it->GetObject(x) );
-#endif
+ // again, join the result ranges
+ lclJoinRanges( rList );
}
-
- uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
- ScDocShell* pDocShell = excel::getDocShell( xModel );
- if ( aCellRanges.Count() == 1 )
- {
- uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pDocShell, *aCellRanges.First() ));
- xRefRange = new ScVbaRange( excel::getUnoSheetModuleObj( xRange ), mxContext, xRange );
- }
- else if ( aCellRanges.Count() > 1 )
- {
- uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pDocShell, aCellRanges ) );
- xRefRange = new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ) , mxContext, xRanges );
-
- }
- return xRefRange;
}
-uno::Reference< excel::XRange > SAL_CALL
-ScVbaApplication::Union( const uno::Reference< excel::XRange >& Arg1, const uno::Reference< excel::XRange >& Arg2, const uno::Any& Arg3, const uno::Any& Arg4, const uno::Any& Arg5, const uno::Any& Arg6, const uno::Any& Arg7, const uno::Any& Arg8, const uno::Any& Arg9, const uno::Any& Arg10, const uno::Any& Arg11, const uno::Any& Arg12, const uno::Any& Arg13, const uno::Any& Arg14, const uno::Any& Arg15, const uno::Any& Arg16, const uno::Any& Arg17, const uno::Any& Arg18, const uno::Any& Arg19, const uno::Any& Arg20, const uno::Any& Arg21, const uno::Any& Arg22, const uno::Any& Arg23, const uno::Any& Arg24, const uno::Any& Arg25, const uno::Any& Arg26, const uno::Any& Arg27, const uno::Any& Arg28, const uno::Any& Arg29, const uno::Any& Arg30 ) throw (script::BasicErrorException, uno::RuntimeException)
+/** Creates a VBA Range object from the passed list of ranges. */
+uno::Reference< excel::XRange > lclCreateVbaRange(
+ const uno::Reference< uno::XComponentContext >& rxContext,
+ const uno::Reference< frame::XModel >& rxModel,
+ const ListOfScRange& rList ) throw (uno::RuntimeException)
{
- if ( !Arg1.is() || !Arg2.is() )
- DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
-
- uno::Reference< excel::XRange > xRange;
- Ranges vRanges;
- lcl_addRangeToVec( vRanges, uno::makeAny( Arg1 ) );
- lcl_addRangeToVec( vRanges, uno::makeAny( Arg2 ) );
-
- if ( Arg3.hasValue() )
- lcl_addRangeToVec( vRanges, Arg3 );
- if ( Arg4.hasValue() )
- lcl_addRangeToVec( vRanges, Arg4 );
- if ( Arg5.hasValue() )
- lcl_addRangeToVec( vRanges, Arg5 );
- if ( Arg6.hasValue() )
- lcl_addRangeToVec( vRanges, Arg6 );
- if ( Arg7.hasValue() )
- lcl_addRangeToVec( vRanges, Arg7 );
- if ( Arg8.hasValue() )
- lcl_addRangeToVec( vRanges, Arg8 );
- if ( Arg9.hasValue() )
- lcl_addRangeToVec( vRanges, Arg9 );
- if ( Arg10.hasValue() )
- lcl_addRangeToVec( vRanges, Arg10 );
- if ( Arg11.hasValue() )
- lcl_addRangeToVec( vRanges, Arg11 );
- if ( Arg12.hasValue() )
- lcl_addRangeToVec( vRanges, Arg12 );
- if ( Arg13.hasValue() )
- lcl_addRangeToVec( vRanges, Arg13 );
- if ( Arg14.hasValue() )
- lcl_addRangeToVec( vRanges, Arg14 );
- if ( Arg15.hasValue() )
- lcl_addRangeToVec( vRanges, Arg15 );
- if ( Arg16.hasValue() )
- lcl_addRangeToVec( vRanges, Arg16 );
- if ( Arg17.hasValue() )
- lcl_addRangeToVec( vRanges, Arg17 );
- if ( Arg18.hasValue() )
- lcl_addRangeToVec( vRanges, Arg18 );
- if ( Arg19.hasValue() )
- lcl_addRangeToVec( vRanges, Arg19 );
- if ( Arg20.hasValue() )
- lcl_addRangeToVec( vRanges, Arg20 );
- if ( Arg21.hasValue() )
- lcl_addRangeToVec( vRanges, Arg21 );
- if ( Arg22.hasValue() )
- lcl_addRangeToVec( vRanges, Arg22 );
- if ( Arg23.hasValue() )
- lcl_addRangeToVec( vRanges, Arg23 );
- if ( Arg24.hasValue() )
- lcl_addRangeToVec( vRanges, Arg24 );
- if ( Arg25.hasValue() )
- lcl_addRangeToVec( vRanges, Arg25 );
- if ( Arg26.hasValue() )
- lcl_addRangeToVec( vRanges, Arg26 );
- if ( Arg27.hasValue() )
- lcl_addRangeToVec( vRanges, Arg27 );
- if ( Arg28.hasValue() )
- lcl_addRangeToVec( vRanges, Arg28 );
- if ( Arg29.hasValue() )
- lcl_addRangeToVec( vRanges, Arg29 );
- if ( Arg30.hasValue() )
- lcl_addRangeToVec( vRanges, Arg30 );
+ ScDocShell* pDocShell = excel::getDocShell( rxModel );
+ if( !pDocShell ) throw uno::RuntimeException();
ScRangeList aCellRanges;
- lcl_strip_containedRanges( vRanges );
+ for( ListOfScRange::const_iterator aIt = rList.begin(), aEnd = rList.end(); aIt != aEnd; ++aIt )
+ aCellRanges.Append( *aIt );
- for( Ranges::iterator it = vRanges.begin(); it != vRanges.end(); ++it )
- aCellRanges.Append( *it );
-
- uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
- ScDocShell* pDocShell = excel::getDocShell( xModel );
- if ( aCellRanges.Count() == 1 )
+ if( aCellRanges.Count() == 1 )
{
- // normal range
- uno::Reference< table::XCellRange > xCalcRange( new ScCellRangeObj( pDocShell, *aCellRanges.First() ) );
- xRange = new ScVbaRange( excel::getUnoSheetModuleObj( xCalcRange ), mxContext, xCalcRange );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pDocShell, *aCellRanges.First() ) );
+ return new ScVbaRange( excel::getUnoSheetModuleObj( xRange ), rxContext, xRange );
}
- else if ( aCellRanges.Count() > 1 ) // Multi-Area
+ if( aCellRanges.Count() > 1 )
{
uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pDocShell, aCellRanges ) );
- xRange = new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), mxContext, xRanges );
+ return new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), rxContext, xRanges );
}
-
- // #FIXME need proper (WorkSheet) parent
- return xRange;
+ return 0;
+}
+
+} // namespace
+
+// ----------------------------------------------------------------------------
+
+uno::Reference< excel::XRange > SAL_CALL ScVbaApplication::Intersect(
+ const uno::Reference< excel::XRange >& rArg1, const uno::Reference< excel::XRange >& rArg2,
+ const uno::Any& rArg3, const uno::Any& rArg4, const uno::Any& rArg5, const uno::Any& rArg6,
+ const uno::Any& rArg7, const uno::Any& rArg8, const uno::Any& rArg9, const uno::Any& rArg10,
+ const uno::Any& rArg11, const uno::Any& rArg12, const uno::Any& rArg13, const uno::Any& rArg14,
+ const uno::Any& rArg15, const uno::Any& rArg16, const uno::Any& rArg17, const uno::Any& rArg18,
+ const uno::Any& rArg19, const uno::Any& rArg20, const uno::Any& rArg21, const uno::Any& rArg22,
+ const uno::Any& rArg23, const uno::Any& rArg24, const uno::Any& rArg25, const uno::Any& rArg26,
+ const uno::Any& rArg27, const uno::Any& rArg28, const uno::Any& rArg29, const uno::Any& rArg30 )
+ throw (script::BasicErrorException, uno::RuntimeException)
+{
+ if( !rArg1.is() || !rArg2.is() )
+ DebugHelper::exception( SbERR_BAD_PARAMETER, rtl::OUString() );
+
+ // initialize the result list with 1st parameter, join its ranges together
+ ListOfScRange aList;
+ lclAddToListOfScRange( aList, uno::Any( rArg1 ) );
+ lclJoinRanges( aList );
+
+ // process all other parameters, this updates the list with intersection
+ lclIntersectRanges( aList, uno::Any( rArg2 ) );
+ lclIntersectRanges( aList, rArg3 );
+ lclIntersectRanges( aList, rArg4 );
+ lclIntersectRanges( aList, rArg5 );
+ lclIntersectRanges( aList, rArg6 );
+ lclIntersectRanges( aList, rArg7 );
+ lclIntersectRanges( aList, rArg8 );
+ lclIntersectRanges( aList, rArg9 );
+ lclIntersectRanges( aList, rArg10 );
+ lclIntersectRanges( aList, rArg11 );
+ lclIntersectRanges( aList, rArg12 );
+ lclIntersectRanges( aList, rArg13 );
+ lclIntersectRanges( aList, rArg14 );
+ lclIntersectRanges( aList, rArg15 );
+ lclIntersectRanges( aList, rArg16 );
+ lclIntersectRanges( aList, rArg17 );
+ lclIntersectRanges( aList, rArg18 );
+ lclIntersectRanges( aList, rArg19 );
+ lclIntersectRanges( aList, rArg20 );
+ lclIntersectRanges( aList, rArg21 );
+ lclIntersectRanges( aList, rArg22 );
+ lclIntersectRanges( aList, rArg23 );
+ lclIntersectRanges( aList, rArg24 );
+ lclIntersectRanges( aList, rArg25 );
+ lclIntersectRanges( aList, rArg26 );
+ lclIntersectRanges( aList, rArg27 );
+ lclIntersectRanges( aList, rArg28 );
+ lclIntersectRanges( aList, rArg29 );
+ lclIntersectRanges( aList, rArg30 );
+
+ // create the VBA Range object
+ return lclCreateVbaRange( mxContext, getCurrentDocument(), aList );
+}
+
+uno::Reference< excel::XRange > SAL_CALL ScVbaApplication::Union(
+ const uno::Reference< excel::XRange >& rArg1, const uno::Reference< excel::XRange >& rArg2,
+ const uno::Any& rArg3, const uno::Any& rArg4, const uno::Any& rArg5, const uno::Any& rArg6,
+ const uno::Any& rArg7, const uno::Any& rArg8, const uno::Any& rArg9, const uno::Any& rArg10,
+ const uno::Any& rArg11, const uno::Any& rArg12, const uno::Any& rArg13, const uno::Any& rArg14,
+ const uno::Any& rArg15, const uno::Any& rArg16, const uno::Any& rArg17, const uno::Any& rArg18,
+ const uno::Any& rArg19, const uno::Any& rArg20, const uno::Any& rArg21, const uno::Any& rArg22,
+ const uno::Any& rArg23, const uno::Any& rArg24, const uno::Any& rArg25, const uno::Any& rArg26,
+ const uno::Any& rArg27, const uno::Any& rArg28, const uno::Any& rArg29, const uno::Any& rArg30 )
+ throw (script::BasicErrorException, uno::RuntimeException)
+{
+ if( !rArg1.is() || !rArg2.is() )
+ DebugHelper::exception( SbERR_BAD_PARAMETER, rtl::OUString() );
+
+ ListOfScRange aList;
+ lclAddToListOfScRange( aList, uno::Any( rArg1 ) );
+ lclAddToListOfScRange( aList, uno::Any( rArg2 ) );
+ lclAddToListOfScRange( aList, rArg3 );
+ lclAddToListOfScRange( aList, rArg4 );
+ lclAddToListOfScRange( aList, rArg5 );
+ lclAddToListOfScRange( aList, rArg6 );
+ lclAddToListOfScRange( aList, rArg7 );
+ lclAddToListOfScRange( aList, rArg8 );
+ lclAddToListOfScRange( aList, rArg9 );
+ lclAddToListOfScRange( aList, rArg10 );
+ lclAddToListOfScRange( aList, rArg11 );
+ lclAddToListOfScRange( aList, rArg12 );
+ lclAddToListOfScRange( aList, rArg13 );
+ lclAddToListOfScRange( aList, rArg14 );
+ lclAddToListOfScRange( aList, rArg15 );
+ lclAddToListOfScRange( aList, rArg16 );
+ lclAddToListOfScRange( aList, rArg17 );
+ lclAddToListOfScRange( aList, rArg18 );
+ lclAddToListOfScRange( aList, rArg19 );
+ lclAddToListOfScRange( aList, rArg20 );
+ lclAddToListOfScRange( aList, rArg21 );
+ lclAddToListOfScRange( aList, rArg22 );
+ lclAddToListOfScRange( aList, rArg23 );
+ lclAddToListOfScRange( aList, rArg24 );
+ lclAddToListOfScRange( aList, rArg25 );
+ lclAddToListOfScRange( aList, rArg26 );
+ lclAddToListOfScRange( aList, rArg27 );
+ lclAddToListOfScRange( aList, rArg28 );
+ lclAddToListOfScRange( aList, rArg29 );
+ lclAddToListOfScRange( aList, rArg30 );
+
+ // simply join together all ranges as much as possible, strip out covered ranges etc.
+ lclJoinRanges( aList );
+
+ // create the VBA Range object
+ return lclCreateVbaRange( mxContext, getCurrentDocument(), aList );
}
void
diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx
index 03f3ecd3c50c..c70a7f83726d 100644
--- a/sc/source/ui/vba/vbaglobals.cxx
+++ b/sc/source/ui/vba/vbaglobals.cxx
@@ -80,6 +80,15 @@ ScVbaGlobals::getApplication() throw (uno::RuntimeException)
return mxApplication;
}
+
+uno::Reference<excel::XApplication > SAL_CALL
+ScVbaGlobals::getExcel() throw (uno::RuntimeException)
+{
+ return getApplication();
+}
+
+
+
uno::Reference< excel::XWorkbook > SAL_CALL
ScVbaGlobals::getActiveWorkbook() throw (uno::RuntimeException)
{
@@ -219,6 +228,25 @@ ScVbaGlobals::Rows( const uno::Any& aIndex ) throw (uno::RuntimeException)
}
+
+uno::Any SAL_CALL
+ScVbaGlobals::getDebug() throw (uno::RuntimeException)
+{
+ try // return empty object on error
+ {
+ uno::Sequence< uno::Any > aArgs( 1 );
+ aArgs[ 0 ] <<= uno::Reference< XHelperInterface >( this );
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW );
+ uno::Reference< uno::XInterface > xVBADebug = xServiceManager->createInstanceWithArgumentsAndContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.Debug" ) ), aArgs, mxContext );
+ return uno::Any( xVBADebug );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ return uno::Any();
+}
+
uno::Sequence< ::rtl::OUString > SAL_CALL
ScVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException)
{
diff --git a/sc/source/ui/vba/vbaglobals.hxx b/sc/source/ui/vba/vbaglobals.hxx
index ae34d710240f..f22e5b19faa4 100644
--- a/sc/source/ui/vba/vbaglobals.hxx
+++ b/sc/source/ui/vba/vbaglobals.hxx
@@ -82,7 +82,8 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc
virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw ( css::uno::RuntimeException );
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
-
+ virtual css::uno::Reference< ov::excel::XApplication > SAL_CALL getExcel() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getDebug() throw (css::uno::RuntimeException);
// XMultiServiceFactory
diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx
index 2304874bdb1b..9fd22bf89f7a 100644
--- a/sc/source/ui/vba/vbanames.cxx
+++ b/sc/source/ui/vba/vbanames.cxx
@@ -173,11 +173,6 @@ ScVbaNames::getElementType() throw( css::uno::RuntimeException )
uno::Reference< container::XEnumeration >
ScVbaNames::createEnumeration() throw (uno::RuntimeException)
{
- if ( mxNames.is() )
- {
- uno::Reference< container::XEnumerationAccess > xAccess( m_xIndexAccess, uno::UNO_QUERY_THROW );
- return xAccess->createEnumeration();
- }
uno::Reference< container::XEnumerationAccess > xEnumAccess( mxNames, uno::UNO_QUERY_THROW );
return new NamesEnumeration( this, mxContext, xEnumAccess->createEnumeration(), mxModel , mxNames );
}
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index b50199f025d0..455af075306c 100755
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -1206,6 +1206,14 @@ inline table::CellRangeAddress lclGetRangeAddress( const uno::Reference< RangeTy
return uno::Reference< sheet::XCellRangeAddressable >( rxCellRange, uno::UNO_QUERY_THROW )->getRangeAddress();
}
+void lclClearRange( const uno::Reference< table::XCellRange >& rxCellRange ) throw (uno::RuntimeException)
+{
+ using namespace ::com::sun::star::sheet::CellFlags;
+ sal_Int32 nFlags = VALUE | DATETIME | STRING | ANNOTATION | FORMULA | HARDATTR | STYLES | EDITATTR | FORMATTED;
+ uno::Reference< sheet::XSheetOperation > xSheetOperation( rxCellRange, uno::UNO_QUERY_THROW );
+ xSheetOperation->clearContents( nFlags );
+}
+
uno::Reference< sheet::XSheetCellRange > lclExpandToMerged( const uno::Reference< table::XCellRange >& rxCellRange, bool bRecursive ) throw (uno::RuntimeException)
{
uno::Reference< sheet::XSheetCellRange > xNewCellRange( rxCellRange, uno::UNO_QUERY_THROW );
@@ -1251,15 +1259,27 @@ void lclExpandAndMerge( const uno::Reference< table::XCellRange >& rxCellRange,
// Calc cannot merge over merged ranges, always unmerge first
xMerge->merge( sal_False );
if( bMerge )
+ {
+ // clear all contents of the covered cells (not the top-left cell)
+ table::CellRangeAddress aRangeAddr = lclGetRangeAddress( rxCellRange );
+ sal_Int32 nLastColIdx = aRangeAddr.EndColumn - aRangeAddr.StartColumn;
+ sal_Int32 nLastRowIdx = aRangeAddr.EndRow - aRangeAddr.StartRow;
+ // clear cells of top row, right of top-left cell
+ if( nLastColIdx > 0 )
+ lclClearRange( rxCellRange->getCellRangeByPosition( 1, 0, nLastColIdx, 0 ) );
+ // clear all rows below top row
+ if( nLastRowIdx > 0 )
+ lclClearRange( rxCellRange->getCellRangeByPosition( 0, 1, nLastColIdx, nLastRowIdx ) );
+ // merge the range
xMerge->merge( sal_True );
- // FIXME need to check whether all the cell contents are retained or lost by popping up a dialog
+ }
}
util::TriState lclGetMergedState( const uno::Reference< table::XCellRange >& rxCellRange ) throw (uno::RuntimeException)
{
/* 1) Check if range is completely inside one single merged range. To do
this, try to extend from top-left cell only (not from entire range).
- This will excude cases where this range consists of several merged
+ This will exclude cases where this range consists of several merged
ranges (or parts of them). */
table::CellRangeAddress aRangeAddr = lclGetRangeAddress( rxCellRange );
uno::Reference< table::XCellRange > xTopLeft( rxCellRange->getCellRangeByPosition( 0, 0, 0, 0 ), uno::UNO_SET_THROW );
@@ -1508,7 +1528,8 @@ ScVbaRange::setValue( const uno::Any &aValue ) throw (uno::RuntimeException)
void
ScVbaRange::Clear() throw (uno::RuntimeException)
{
- sal_Int32 nFlags = sheet::CellFlags::VALUE | sheet::CellFlags::STRING | sheet::CellFlags::HARDATTR | sheet::CellFlags::FORMATTED | sheet::CellFlags::EDITATTR | sheet::CellFlags::FORMULA;
+ using namespace ::com::sun::star::sheet::CellFlags;
+ sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | EDITATTR | FORMATTED;
ClearContents( nFlags );
}
@@ -2294,8 +2315,7 @@ ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException)
void
ScVbaRange::setMergeCells( const uno::Any& aIsMerged ) throw (script::BasicErrorException, uno::RuntimeException)
{
- bool bMerge = false;
- aIsMerged >>= bMerge;
+ bool bMerge = extractBoolFromAny( aIsMerged );
if( mxRanges.is() )
{
@@ -2496,7 +2516,8 @@ ScVbaRange::setWrapText( const uno::Any& aIsWrapped ) throw (script::BasicErrorE
}
uno::Reference< beans::XPropertySet > xProps(mxRange, ::uno::UNO_QUERY_THROW );
- xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTextWrapped" ) ), aIsWrapped );
+ bool bIsWrapped = extractBoolFromAny( aIsWrapped );
+ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTextWrapped" ) ), uno::Any( bIsWrapped ) );
}
uno::Any
@@ -2875,13 +2896,11 @@ ScVbaRange::setHidden( const uno::Any& _hidden ) throw (uno::RuntimeException)
return;
}
- sal_Bool bHidden = sal_False;
- _hidden >>= bHidden;
-
+ bool bHidden = extractBoolFromAny( _hidden );
try
{
uno::Reference< beans::XPropertySet > xProps = getRowOrColumnProps( mxRange, mbIsRows );
- xProps->setPropertyValue( ISVISIBLE, uno::makeAny( !bHidden ) );
+ xProps->setPropertyValue( ISVISIBLE, uno::Any( !bHidden ) );
}
catch( uno::Exception& e )
{
@@ -2978,7 +2997,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
// return a Range object that represents the first cell where that information is found.
rtl::OUString sWhat;
sal_Int32 nWhat = 0;
- float fWhat = 0.0;
+ double fWhat = 0.0;
// string.
if( What >>= sWhat )
@@ -3010,6 +3029,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
{
uno::Reference< util::XSearchDescriptor > xDescriptor = xSearch->createSearchDescriptor();
xDescriptor->setSearchString( sSearch );
+ xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHREGEXP ) ), uno::Any( true ) );
uno::Reference< excel::XRange > xAfterRange;
uno::Reference< table::XCellRange > xStartCell;
@@ -3115,8 +3135,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
ScGlobal::SetSearchItem( newOptions );
- uno::Reference< util::XSearchDescriptor > xSearchDescriptor( xDescriptor, uno::UNO_QUERY );
- uno::Reference< uno::XInterface > xInterface = xStartCell.is() ? xSearch->findNext( xStartCell, xSearchDescriptor) : xSearch->findFirst( xSearchDescriptor );
+ uno::Reference< uno::XInterface > xInterface = xStartCell.is() ? xSearch->findNext( xStartCell, xDescriptor) : xSearch->findFirst( xDescriptor );
uno::Reference< table::XCellRange > xCellRange( xInterface, uno::UNO_QUERY );
if ( xCellRange.is() )
{
@@ -4910,8 +4929,7 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( css::uno::Ru
if( m_Areas->getCount() > 1 )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Can not set Range.ShowDetail attribute ")), uno::Reference< uno::XInterface >() );
- sal_Bool bShowDetail = sal_False;
- aShowDetail >>= bShowDetail;
+ bool bShowDetail = extractBoolFromAny( aShowDetail );
RangeHelper helper( mxRange );
uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = helper.getSheetCellCursor();
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 365c8b35a00c..28469c4685a2 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -50,6 +50,7 @@
#include "vbanames.hxx" // Amelia Wang
#include "nameuno.hxx"
#include "docoptio.hxx"
+#include "unonames.hxx"
// Much of the impl. for the equivalend UNO module is
// sc/source/ui/unoobj/docuno.cxx, viewuno.cxx
@@ -208,7 +209,6 @@ ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface
ScVbaWorkbook::ScVbaWorkbook( uno::Sequence< uno::Any> const & args,
uno::Reference< uno::XComponentContext> const & xContext ) : ScVbaWorkbook_BASE( args, xContext )
-
{
init();
}
@@ -216,21 +216,24 @@ ScVbaWorkbook::ScVbaWorkbook( uno::Sequence< uno::Any> const & args,
uno::Reference< excel::XWorksheet >
ScVbaWorkbook::getActiveSheet() throw (uno::RuntimeException)
{
- uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ) );
- uno::Reference< sheet::XSpreadsheet > xSheet;
+ uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ), uno::UNO_SET_THROW );
uno::Reference< sheet::XSpreadsheetView > xView( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
- if ( xView.is() )
- xSheet = xView->getActiveSheet();
- return new ScVbaWorksheet( this, mxContext, xSheet, xModel );
+ uno::Reference< beans::XPropertySet > xSheetProps( xView->getActiveSheet(), uno::UNO_QUERY_THROW );
+ // #162503# return the original document module wrapper object, instead of a new instance
+ ::rtl::OUString aCodeName;
+ xSheetProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_CODENAME ) ) ) >>= aCodeName;
+ ScDocShell* pShell = excel::getDocShell( xModel );
+ if( !pShell )
+ throw uno::RuntimeException();
+ return uno::Reference< excel::XWorksheet >( getUnoDocModule( aCodeName, pShell ), uno::UNO_QUERY_THROW );
}
+
uno::Any SAL_CALL
ScVbaWorkbook::Sheets( const uno::Any& aIndex ) throw (uno::RuntimeException)
{
return Worksheets( aIndex );
}
-
-
uno::Any SAL_CALL
ScVbaWorkbook::Worksheets( const uno::Any& aIndex ) throw (uno::RuntimeException)
{
diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index 5298f60e0943..7efee1505dcb 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -76,7 +76,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
uno::Reference<script::XLibraryContainer> xLibContainer = pShell->GetBasicContainer();
uno::Reference<script::vba::XVBACompatibility> xVBACompat( xLibContainer, uno::UNO_QUERY_THROW );
xVBACompat->setVBACompatibilityMode( sal_True );
- String aPrjName( RTL_CONSTASCII_USTRINGPARAM( "VBAProject" ) );
+ String aPrjName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
pShell->GetBasicManager()->SetName( aPrjName );
if( xLibContainer.is() )
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index 4eab79813474..6ee6fa1f6b19 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XCalculatable.hpp>
#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
+#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
#include <com/sun/star/sheet/XSheetCellRange.hpp>
#include <com/sun/star/sheet/XSheetCellCursor.hpp>
#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
@@ -319,6 +320,40 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection ) throw (uno::RuntimeEx
}
+uno::Reference< beans::XPropertySet > ScVbaWorksheet::getFirstDBRangeProperties() throw (uno::RuntimeException)
+{
+ uno::Reference< beans::XPropertySet > xModelProps( mxModel, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xDBRangesIA( xModelProps->getPropertyValue(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DatabaseRanges" ) ) ), uno::UNO_QUERY_THROW );
+
+ for( sal_Int32 nIndex = 0, nCount = xDBRangesIA->getCount(); nIndex < nCount; ++nIndex )
+ {
+ uno::Reference< sheet::XCellRangeReferrer > xDBRange( xDBRangesIA->getByIndex( nIndex ), uno::UNO_QUERY_THROW );
+ // check if the database area is on this sheet
+ uno::Reference< sheet::XCellRangeAddressable > xRangeAddr( xDBRange->getReferredCells(), uno::UNO_QUERY_THROW );
+ if( getSheetID() == xRangeAddr->getRangeAddress().Sheet )
+ return uno::Reference< beans::XPropertySet >( xDBRange, uno::UNO_QUERY_THROW );
+ }
+ return uno::Reference< beans::XPropertySet >();
+}
+
+sal_Bool SAL_CALL ScVbaWorksheet::getAutoFilterMode() throw (uno::RuntimeException)
+{
+ uno::Reference< beans::XPropertySet > xDBRangeProps = getFirstDBRangeProperties();
+ sal_Bool bAutoFilterMode = sal_False;
+ return
+ xDBRangeProps.is() &&
+ (xDBRangeProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoFilter" ) ) ) >>= bAutoFilterMode) &&
+ bAutoFilterMode;
+}
+
+void SAL_CALL ScVbaWorksheet::setAutoFilterMode( sal_Bool bAutoFilterMode ) throw (uno::RuntimeException)
+{
+ uno::Reference< beans::XPropertySet > xDBRangeProps = getFirstDBRangeProperties();
+ if( xDBRangeProps.is() )
+ xDBRangeProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoFilter" ) ), uno::Any( bAutoFilterMode ) );
+}
+
uno::Reference< excel::XRange >
ScVbaWorksheet::getUsedRange() throw (uno::RuntimeException)
{
@@ -379,7 +414,7 @@ ScVbaWorksheet::getStandardHeight() throw (uno::RuntimeException)
sal_Bool
ScVbaWorksheet::getProtectionMode() throw (uno::RuntimeException)
{
- return false;
+ return sal_False;
}
sal_Bool
@@ -392,7 +427,13 @@ ScVbaWorksheet::getProtectContents()throw (uno::RuntimeException)
sal_Bool
ScVbaWorksheet::getProtectDrawingObjects() throw (uno::RuntimeException)
{
- return false;
+ return sal_False;
+}
+
+sal_Bool
+ScVbaWorksheet::getProtectScenarios() throw (uno::RuntimeException)
+{
+ return sal_False;
}
void
diff --git a/sc/source/ui/vba/vbaworksheet.hxx b/sc/source/ui/vba/vbaworksheet.hxx
index 196a195258d7..78bcc2503a49 100644
--- a/sc/source/ui/vba/vbaworksheet.hxx
+++ b/sc/source/ui/vba/vbaworksheet.hxx
@@ -68,6 +68,9 @@ class ScVbaWorksheet : public WorksheetImpl_BASE
css::uno::Reference< css::container::XNameAccess > getFormControls();
css::uno::Any getControlShape( const rtl::OUString& sName );
+
+ css::uno::Reference< css::beans::XPropertySet > getFirstDBRangeProperties() throw (css::uno::RuntimeException);
+
protected:
ScVbaWorksheet( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext );
@@ -95,6 +98,7 @@ public:
virtual ::sal_Bool SAL_CALL getProtectionMode() throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getProtectContents() throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getProtectDrawingObjects() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getProtectScenarios() throw (css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getUsedRange() throw (css::uno::RuntimeException) ;
virtual css::uno::Any SAL_CALL ChartObjects( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline( ) throw (css::uno::RuntimeException);
@@ -106,6 +110,8 @@ public:
virtual sal_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getEnableSelection() throw (css::uno::RuntimeException);
virtual void SAL_CALL setEnableSelection( sal_Int32 nSelection ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getAutoFilterMode() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAutoFilterMode( sal_Bool bAutoFilterMode ) throw (css::uno::RuntimeException);
// Methods
virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index 5344e6b3a9be..7fa5196a6b04 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -52,7 +52,7 @@
#include "vbaglobals.hxx"
#include "vbaworksheet.hxx"
#include "vbaworkbook.hxx"
-#include <unonames.hxx>
+#include "unonames.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
diff --git a/scripting/source/basprov/basmodnode.cxx b/scripting/source/basprov/basmodnode.cxx
index 22f9e40571a4..fe6ed69fccab 100644
--- a/scripting/source/basprov/basmodnode.cxx
+++ b/scripting/source/basprov/basmodnode.cxx
@@ -97,14 +97,22 @@ namespace basprov
if ( pMethods )
{
sal_Int32 nCount = pMethods->Count();
- aChildNodes.realloc( nCount );
+ sal_Int32 nRealCount = 0;
+ for ( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< USHORT >( i ) ) );
+ if ( pMethod && !pMethod->IsHidden() )
+ ++nRealCount;
+ }
+ aChildNodes.realloc( nRealCount );
Reference< browse::XBrowseNode >* pChildNodes = aChildNodes.getArray();
+ sal_Int32 iTarget = 0;
for ( sal_Int32 i = 0; i < nCount; ++i )
{
SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< USHORT >( i ) ) );
- if ( pMethod )
- pChildNodes[i] = static_cast< browse::XBrowseNode* >( new BasicMethodNodeImpl( m_xContext, m_sScriptingContext, pMethod, m_bIsAppScript ) );
+ if ( pMethod && !pMethod->IsHidden() )
+ pChildNodes[iTarget++] = static_cast< browse::XBrowseNode* >( new BasicMethodNodeImpl( m_xContext, m_sScriptingContext, pMethod, m_bIsAppScript ) );
}
}
}
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx
index abd61f6c1285..69cc6f40cd3d 100644
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov/basprov.cxx
@@ -412,7 +412,7 @@ namespace basprov
if ( pMethods )
{
SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Find( aMethod, SbxCLASS_METHOD ) );
- if ( pMethod )
+ if ( pMethod && !pMethod->IsHidden() )
{
if ( m_pDocBasicManager == pBasicMgr )
xScript = new BasicScriptImpl( aDescription, pMethod, *m_pDocBasicManager, m_xInvocationContext );
diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt
index 8d5cb0fc83b8..5853a97b141e 100644
--- a/setup_native/source/packinfo/spellchecker_selection.txt
+++ b/setup_native/source/packinfo/spellchecker_selection.txt
@@ -44,6 +44,7 @@ sr = "sr,en-US"
sh = "sr,en-US"
sw = "sw,en-US"
th = "th,en-US"
+uk = "ru,en-US"
vi = "vi,en-US,fr"
zh-TW = "EMPTY,en-US"
zh-CN = "EMPTY,en-US"
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index e4d3ff023b3b..24885fc27363 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -323,7 +323,6 @@ public:
static com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag > GetVersionList(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
- static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL );
static ::rtl::OUString CreateTempCopyWithExt( const ::rtl::OUString& aURL );
static sal_Bool CallApproveHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler, ::com::sun::star::uno::Any aRequest, sal_Bool bAllowAbort );
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 9625ea958830..df0781be8877 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -45,6 +45,8 @@
#include <rtl/uuid.h>
#include <rtl/ustrbuf.hxx>
+#include <rtl/uri.hxx>
+#include <rtl/bootstrap.hxx>
#include <comphelper/interaction.hxx>
#include <comphelper/makesequence.hxx>
@@ -136,6 +138,24 @@ uno::Reference<rdf::XURI> createBaseURI(
throw uno::RuntimeException();
}
+ // #i108078# workaround non-hierarchical vnd.sun.star.expand URIs
+ // this really should be done somewhere else, not here.
+ ::rtl::OUString pkgURI(i_rPkgURI);
+ if (pkgURI.matchIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:")))
+ {
+ // expand it here (makeAbsolute requires hierarchical URI)
+ pkgURI = pkgURI.copy( RTL_CONSTASCII_LENGTH("vnd.sun.star.expand:") );
+ if (pkgURI.getLength() != 0) {
+ pkgURI = ::rtl::Uri::decode(
+ pkgURI, rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8);
+ if (pkgURI.getLength() == 0) {
+ throw uno::RuntimeException();
+ }
+ ::rtl::Bootstrap::expandMacros(pkgURI);
+ }
+ }
+
const uno::Reference<lang::XMultiComponentFactory> xServiceFactory(
i_xContext->getServiceManager(), uno::UNO_SET_THROW);
const uno::Reference<uri::XUriReferenceFactory> xUriFactory(
@@ -146,11 +166,12 @@ uno::Reference<rdf::XURI> createBaseURI(
uno::Reference< uri::XUriReference > xBaseURI;
const uno::Reference< uri::XUriReference > xPkgURI(
- xUriFactory->parse(i_rPkgURI), uno::UNO_SET_THROW );
+ xUriFactory->parse(pkgURI), uno::UNO_SET_THROW );
xPkgURI->clearFragment();
+
// need to know whether the storage is a FileSystemStorage
// XServiceInfo would be better, but it is not implemented
-// if ( i_rPkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(i_rPkgURI) )
+// if ( pkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(pkgURI) )
if (true) {
xBaseURI.set( xPkgURI, uno::UNO_SET_THROW );
#if 0
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 1dea202e0d0e..29081e8e8418 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3717,53 +3717,6 @@ void SfxMedium::SetCachedSignatureState_Impl( sal_uInt16 nState )
pImp->m_nSignatureState = nState;
}
-//----------------------------------------------------------------
-sal_Bool SfxMedium::EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL )
-{
- sal_Bool bResult = sal_False;
-
- if ( aFirstURL.getLength() && aSecondURL.getLength() )
- {
- INetURLObject aFirst( aFirstURL );
- INetURLObject aSecond( aSecondURL );
-
- if ( aFirst.GetProtocol() != INET_PROT_NOT_VALID && aSecond.GetProtocol() != INET_PROT_NOT_VALID )
- {
- try
- {
- ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
- if ( !pBroker )
- throw uno::RuntimeException();
-
- uno::Reference< ::com::sun::star::ucb::XContentIdentifierFactory > xIdFac
- = pBroker->getContentIdentifierFactoryInterface();
- if ( !xIdFac.is() )
- throw uno::RuntimeException();
-
- uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdFirst
- = xIdFac->createContentIdentifier( aFirst.GetMainURL( INetURLObject::NO_DECODE ) );
- uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdSecond
- = xIdFac->createContentIdentifier( aSecond.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if ( xIdFirst.is() && xIdSecond.is() )
- {
- uno::Reference< ::com::sun::star::ucb::XContentProvider > xProvider =
- pBroker->getContentProviderInterface();
- if ( !xProvider.is() )
- throw uno::RuntimeException();
- bResult = !xProvider->compareContentIds( xIdFirst, xIdSecond );
- }
- }
- catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Can't compare URL's, treat as different!\n" );
- }
- }
- }
-
- return bResult;
-}
-
BOOL SfxMedium::HasStorage_Impl() const
{
return pImp->xStorage.is();
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index b921f2d97f1f..71f3683c0006 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1919,7 +1919,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
aStoreArgs[1].Value <<= rTemplateName;
::rtl::OUString aCurrentDocumentURL = rStorable->getLocation();
- if( !SfxMedium::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() ))
+ if( !::utl::UCBContentHelper::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() ))
rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs );
else
rStorable->store();
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index addb648ef2e9..e386b2382acf 100755
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -732,7 +732,7 @@ void SfxObjectShell::FreeSharedFile( const ::rtl::OUString& aTempFileURL )
SetSharedXMLFlag( sal_False );
if ( IsDocShared() && aTempFileURL.getLength()
- && !SfxMedium::EqualURLs( aTempFileURL, GetSharedFileURL() ) )
+ && !::utl::UCBContentHelper::EqualURLs( aTempFileURL, GetSharedFileURL() ) )
{
if ( pImp->m_bAllowShareControlFileClean )
{
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 6c4bdf56ba26..e3b04f72caf7 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1189,7 +1189,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if ( pMedium
&& pMedium->GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL
&& rMedium.GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL
- && SfxMedium::EqualURLs( pMedium->GetName(), rMedium.GetName() ) )
+ && ::utl::UCBContentHelper::EqualURLs( pMedium->GetName(), rMedium.GetName() ) )
{
bStoreToSameLocation = sal_True;
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) );
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 7ef9fe0d2f19..fe4ffa50f67d 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -95,6 +95,7 @@
#include <framework/titlehelper.hxx>
#include <comphelper/numberedcollection.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <unotools/ucbhelper.hxx>
//________________________________________________________________________________________________________
// includes of my own project
@@ -2648,7 +2649,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
sal_Bool bSaved = sal_False;
if ( !bSaveTo && m_pData->m_pObjectShell && sURL.getLength()
&& sURL.compareToAscii( "private:stream", 14 ) != COMPARE_EQUAL
- && SfxMedium::EqualURLs( getLocation(), sURL ) )
+ && ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) )
{
// this is the same file URL as the current document location, try to use storeOwn if possible
diff --git a/solenv/bin/transform_description.pl b/solenv/bin/transform_description.pl
index 0d6ab34583b3..87dcb21deb53 100644
--- a/solenv/bin/transform_description.pl
+++ b/solenv/bin/transform_description.pl
@@ -55,9 +55,9 @@ sub parse_args
# check which languages to use
my $languages = $ENV{WITH_LANG};
- if ( ! defined $languages )
+ if ( ( ! defined $languages ) || ( "$languages" eq "" ) )
{
- print STDERR "$0: WITH_LANG not set, defaulting to 'en-US'\n";
+ print STDERR "$0: WITH_LANG not set or empty, defaulting to 'en-US'\n";
$languages = "en-US";
}
@languages = split ( ' ', $languages );
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index a6e3941d89af..11e864f0c0ba 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,5 +1,5 @@
RSCVERSION=330
-RSCREVISION=330m5(Build:9521)
-BUILD=9521
-LAST_MINOR=m5
+RSCREVISION=330m6(Build:9524)
+BUILD=9524
+LAST_MINOR=m6
SOURCEVERSION=OOO330
diff --git a/solenv/inc/tg_help.mk b/solenv/inc/tg_help.mk
index 89f1ebabec6c..bfd5a0dad5c1 100644
--- a/solenv/inc/tg_help.mk
+++ b/solenv/inc/tg_help.mk
@@ -31,13 +31,15 @@
aux_alllangiso*:=$(alllangiso)
SHELL_PACKAGE:=$(subst,/,$/ $(PACKAGE))
-HLANGXHPFILES:=$(foreach,i,$(XHPFILES) $(foreach,j,$(aux_alllangiso) $(COMMONMISC)$/$j$/$(SHELL_PACKAGE)$/$(i:f)))
+XHPDEST*:=$(COMMONMISC)
+
+HLANGXHPFILES:=$(foreach,i,$(XHPFILES) $(foreach,j,$(aux_alllangiso) $(XHPDEST)$/$j$/$(SHELL_PACKAGE)$/$(i:f)))
ALLTAR : $(COMMONMISC)$/$(TARGET).done $(COMMONMISC)$/xhp_changed.flag optix
$(HLANGXHPFILES) : $$(@:d)thisdir.created
-$(COMMONMISC)$/{$(aux_alllangiso)}$/$(SHELL_PACKAGE)$/%.xhp :| %.xhp
+$(XHPDEST)$/{$(aux_alllangiso)}$/$(SHELL_PACKAGE)$/%.xhp :| %.xhp
@$(TOUCH) $@
# internal dependencies not sufficient to trigger merge?
# @$(NULL)
@@ -45,9 +47,9 @@ $(COMMONMISC)$/{$(aux_alllangiso)}$/$(SHELL_PACKAGE)$/%.xhp :| %.xhp
$(COMMONMISC)$/$(TARGET).done : $(HLANGXHPFILES)
.IF "$(WITH_LANG)"!=""
- $(AUGMENT_LIBRARY_PATH) $(HELPEX) -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(COMMONMISC) -y $(SHELL_PACKAGE) -l all -lf $(aux_alllangiso:t",") -m $(LOCALIZESDF) && $(TOUCH) $@
+ $(AUGMENT_LIBRARY_PATH) $(HELPEX) -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(XHPDEST) -y $(SHELL_PACKAGE) -l all -lf $(aux_alllangiso:t",") -m $(LOCALIZESDF) && $(TOUCH) $@
.ELSE # "$(WITH_LANG)"!=""
- cp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES)))) $(COMMONMISC)$/en-US$/$(SHELL_PACKAGE) && $(TOUCH) $@
+ cp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES)))) $(XHPDEST)$/en-US$/$(SHELL_PACKAGE) && $(TOUCH) $@
.ENDIF # "$(WITH_LANG)"!=""
.IF "$(OS)"=="SOLARIS"
@$(ECHONL) " "
diff --git a/solenv/inc/tg_xmerge.mk b/solenv/inc/tg_xmerge.mk
index fa3e2297184f..6ff412bb022f 100755
--- a/solenv/inc/tg_xmerge.mk
+++ b/solenv/inc/tg_xmerge.mk
@@ -27,33 +27,32 @@
.IF "$(XTXFILES)"!=""
-ALLTAR : $(MISC)/$(TARGET).xtx.pmerge.mk $(XTXFILES)
+L10NEXT*=.txt
+XTX_TARGET_PATH*=$(MISC)/$(TARGET)
-.IF "$(L10NEXT)"==""
-L10NEXT:=.txt
-.ENDIF
+ALLTAR : $(XTX_TARGET_PATH).xtx.pmerge.mk $(XTXFILES)
-$(MISC)/$(TARGET).xtx.pmerge.mk : $(XTXFILES)
+$(XTX_TARGET_PATH).xtx.pmerge.mk : $(XTXFILES)
$(XTXFILES) : $(LOCALIZESDF)
-.INCLUDE .IGNORE : $(MISC)/$(TARGET).xtx.pmerge.mk
+.INCLUDE .IGNORE : $(XTX_TARGET_PATH).xtx.pmerge.mk
.IF "$(alllangiso)"!="$(last_merge)"
XTXMERGEPHONY:=.PHONY
.ENDIF # "$(alllangiso)" != "$(last_merge)"
-$(MISC)/$(TARGET)/%$(L10NEXT) $(XTXMERGEPHONY) : %.xtx
+$(XTX_TARGET_PATH)/%$(L10NEXT) $(XTXMERGEPHONY) : %.xtx
@@-$(MKDIRHIER) $(@:d)
.IF "$(WITH_LANG)"==""
- $(COMMAND_ECHO)$(COPY) $< $@
+ $(COMMAND_ECHO)$(COPY) $< $(@:d)$(@:b)_en-US$(L10NEXT)
.ELSE # "$(WITH_LANG)"==""
@@-$(RM) $@
$(COMMAND_ECHO)@noop $(assign XTXMERGELIST+:=$(<:f))
$(COMMAND_ECHO)@noop $(assign XTXDESTDIR:=$(@:d))
.ENDIF # "$(WITH_LANG)"==""
-$(MISC)/$(TARGET).xtx.pmerge.mk : $(XTXMERGELIST)
+$(XTX_TARGET_PATH).xtx.pmerge.mk : $(XTXMERGELIST)
.IF "$(WITH_LANG)"!=""
# xtxex command file requirements:
# - one file per line
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx
index 00dd454233e2..2c18429b9d64 100644
--- a/sot/source/sdstor/stgio.cxx
+++ b/sot/source/sdstor/stgio.cxx
@@ -158,7 +158,7 @@ class EasyFat
public:
EasyFat( StgIo & rIo, StgStrm *pFatStream, INT32 nPSize );
- ~EasyFat() { delete pFat; delete pFree; }
+ ~EasyFat() { delete[] pFat; delete[] pFree; }
INT32 GetPageSize() { return nPageSize; }
INT32 Count() { return nPages; }
INT32 operator[]( INT32 nOffset ) { return pFat[ nOffset ]; }
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index cf92a707e40f..7f16e4e4d44c 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -27,9 +27,7 @@
#ifndef SW_UNDOBJ_HXX
#define SW_UNDOBJ_HXX
-// --> OD 2006-11-01 #130889#
#include <vector>
-// <--
#include <memory>
#include <boost/shared_ptr.hpp>
@@ -1718,7 +1716,7 @@ public:
struct _UndoTransliterate_Data;
class SwUndoTransliterate : public SwUndo, public SwUndRng
{
- _UndoTransliterate_Data *pData, *pLastData;
+ std::vector< _UndoTransliterate_Data * > aChanges;
sal_uInt32 nType;
public:
@@ -1732,7 +1730,7 @@ public:
void AddChanges( SwTxtNode& rTNd, xub_StrLen nStart, xub_StrLen nLen,
::com::sun::star::uno::Sequence <sal_Int32>& rOffsets );
- BOOL HasData() const {return 0 != pData; }
+ BOOL HasData() const { return aChanges.size() > 0; }
};
//--------------------------------------------------------------------
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 31484ac303dd..bdcf8caaff7b 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -38,6 +38,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/i18n/WordType.hdl>
#include <unotools/charclass.hxx>
+#include <unotools/transliterationwrapper.hxx>
#include <fmtanchr.hxx>
#include <fmtcntnt.hxx>
#include <fmtpdsc.hxx>
@@ -72,6 +73,8 @@
#include <unoflatpara.hxx>
#include <SwGrammarMarkUp.hxx>
+#include <vector>
+
using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::linguistic2;
@@ -2653,8 +2656,9 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
}
-void SwDoc::TransliterateText( const SwPaM& rPaM,
- utl::TransliterationWrapper& rTrans )
+void SwDoc::TransliterateText(
+ const SwPaM& rPaM,
+ utl::TransliterationWrapper& rTrans )
{
SwUndoTransliterate* pUndo;
if( DoesUndo() )
@@ -2663,15 +2667,17 @@ void SwDoc::TransliterateText( const SwPaM& rPaM,
pUndo = 0;
const SwPosition* pStt = rPaM.Start(),
- * pEnd = pStt == rPaM.GetPoint() ? rPaM.GetMark()
- : rPaM.GetPoint();
- ULONG nSttNd = pStt->nNode.GetIndex(), nEndNd = pEnd->nNode.GetIndex();
+ * pEnd = rPaM.End();
+ ULONG nSttNd = pStt->nNode.GetIndex(),
+ nEndNd = pEnd->nNode.GetIndex();
xub_StrLen nSttCnt = pStt->nContent.GetIndex(),
nEndCnt = pEnd->nContent.GetIndex();
SwTxtNode* pTNd = pStt->nNode.GetNode().GetTxtNode();
- if( pStt == pEnd && pTNd ) // no region ?
+ if( pStt == pEnd && pTNd ) // no selection?
{
+ // set current word as 'area of effect'
+
Boundary aBndry;
if( pBreakIt->GetBreakIter().is() )
aBndry = pBreakIt->GetBreakIter()->getWordBoundary(
@@ -2687,21 +2693,24 @@ void SwDoc::TransliterateText( const SwPaM& rPaM,
}
}
- if( nSttNd != nEndNd )
+ if( nSttNd != nEndNd ) // is more than one text node involved?
{
+ // iterate over all effected text nodes, the first and the last one
+ // may be incomplete because the selection starts and/or ends there
+
SwNodeIndex aIdx( pStt->nNode );
if( nSttCnt )
{
aIdx++;
if( pTNd )
- pTNd->TransliterateText( rTrans, nSttCnt,
- pTNd->GetTxt().Len(), pUndo );
+ pTNd->TransliterateText( rTrans, nSttCnt, pTNd->GetTxt().Len(), pUndo );
}
for( ; aIdx.GetIndex() < nEndNd; aIdx++ )
+ {
if( 0 != ( pTNd = aIdx.GetNode().GetTxtNode() ))
- pTNd->TransliterateText( rTrans, 0, pTNd->GetTxt().Len(),
- pUndo );
+ pTNd->TransliterateText( rTrans, 0, pTNd->GetTxt().Len(), pUndo );
+ }
if( nEndCnt && 0 != ( pTNd = pEnd->nNode.GetNode().GetTxtNode() ))
pTNd->TransliterateText( rTrans, 0, nEndCnt, pUndo );
@@ -2721,6 +2730,8 @@ void SwDoc::TransliterateText( const SwPaM& rPaM,
}
SetModified();
}
+
+
#define MAX_REDLINE_COUNT 250
// -----------------------------------------------------------------------------
void SwDoc::checkRedlining(RedlineMode_t& _rReadlineMode)
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 944eb70b2c3d..0630dbd722b6 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -36,6 +36,7 @@
#include <time.h> // clock()
#include <tools/stream.hxx>
#endif
+
#include <hintids.hxx>
#include <vcl/svapp.hxx>
#include <svl/itemiter.hxx>
@@ -46,9 +47,6 @@
#include <editeng/hangulhanja.hxx>
#include <SwSmartTagMgr.hxx>
#include <linguistic/lngprops.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/i18n/WordType.hdl>
-#include <com/sun/star/i18n/ScriptType.hdl>
#include <unotools/transliterationwrapper.hxx>
#include <unotools/charclass.hxx>
#include <dlelstnr.hxx>
@@ -86,6 +84,15 @@
#include <unomid.h>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/i18n/WordType.hdl>
+#include <com/sun/star/i18n/ScriptType.hdl>
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
+
+#include <vector>
+
+
using rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
@@ -1578,49 +1585,247 @@ void SwLinguStatistik::Flush()
#endif
+
+struct TransliterationChgData
+{
+ xub_StrLen nStart;
+ xub_StrLen nLen;
+ String sChanged;
+ Sequence< sal_Int32 > aOffsets;
+};
+
// change text to Upper/Lower/Hiragana/Katagana/...
-void SwTxtNode::TransliterateText( utl::TransliterationWrapper& rTrans,
- xub_StrLen nStt, xub_StrLen nEnd, SwUndoTransliterate* pUndo )
+void SwTxtNode::TransliterateText(
+ utl::TransliterationWrapper& rTrans,
+ xub_StrLen nStt, xub_StrLen nEnd,
+ SwUndoTransliterate* pUndo )
{
- if( nStt < nEnd )
+ if (nStt < nEnd && pBreakIt->GetBreakIter().is())
{
- SwLanguageIterator* pIter;
- if( rTrans.needLanguageForTheMode() )
- pIter = new SwLanguageIterator( *this, nStt );
- else
- pIter = 0;
+ // since we don't use Hiragana/Katakana or half-width/full-width transliterations here
+ // it is fine to use ANYWORD_IGNOREWHITESPACES. (ANY_WORD btw is broken and will
+ // occasionaly miss words in consecutive sentences). Also with ANYWORD_IGNOREWHITESPACES
+ // text like 'just-in-time' will be converted to 'Just-In-Time' which seems to be the
+ // proper thing to do.
+ const sal_Int16 nWordType = WordType::ANYWORD_IGNOREWHITESPACES;
+
+ //! In order to have less trouble with changing text size, e.g. because
+ //! of ligatures or � (German small sz) being resolved, we need to process
+ //! the text replacements from end to start.
+ //! This way the offsets for the yet to be changed words will be
+ //! left unchanged by the already replaced text.
+ //! For this we temporarily save the changes to be done in this vector
+ std::vector< TransliterationChgData > aChanges;
+ TransliterationChgData aChgData;
+
+ if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::TITLE_CASE)
+ {
+ // for 'capitalize every word' we need to iterate over each word
+
+ Boundary aSttBndry;
+ Boundary aEndBndry;
+ aSttBndry = pBreakIt->GetBreakIter()->getWordBoundary(
+ GetTxt(), nStt,
+ pBreakIt->GetLocale( GetLang( nStt ) ),
+ nWordType,
+ TRUE /*prefer forward direction*/);
+ aEndBndry = pBreakIt->GetBreakIter()->getWordBoundary(
+ GetTxt(), nEnd,
+ pBreakIt->GetLocale( GetLang( nEnd ) ),
+ nWordType,
+ FALSE /*prefer backward direction*/);
+
+ // prevent backtracking to the previous word if selection is at word boundary
+ if (aSttBndry.endPos <= nStt)
+ {
+ aSttBndry = pBreakIt->GetBreakIter()->nextWord(
+ GetTxt(), aSttBndry.endPos,
+ pBreakIt->GetLocale( GetLang( aSttBndry.endPos ) ),
+ nWordType);
+ }
+ // prevent advancing to the next word if selection is at word boundary
+ if (aEndBndry.startPos >= nEnd)
+ {
+ aEndBndry = pBreakIt->GetBreakIter()->previousWord(
+ GetTxt(), aEndBndry.startPos,
+ pBreakIt->GetLocale( GetLang( aEndBndry.startPos ) ),
+ nWordType);
+ }
- xub_StrLen nEndPos;
- sal_uInt16 nLang;
- do {
- if( pIter )
+ Boundary aCurWordBndry( aSttBndry );
+ while (aCurWordBndry.startPos <= aEndBndry.startPos)
{
- nLang = pIter->GetLanguage();
- nEndPos = pIter->GetChgPos();
- if( nEndPos > nEnd )
- nEndPos = nEnd;
+ nStt = (xub_StrLen)aCurWordBndry.startPos;
+ nEnd = (xub_StrLen)aCurWordBndry.endPos;
+ sal_Int32 nLen = nEnd - nStt;
+ DBG_ASSERT( nLen > 0, "invalid word length of 0" );
+#if OSL_DEBUG_LEVEL > 1
+ String aText( GetTxt().Copy( nStt, nLen ) );
+#endif
+
+ Sequence <sal_Int32> aOffsets;
+ String sChgd( rTrans.transliterate( GetTxt(), GetLang( nStt ), nStt, nLen, &aOffsets ));
+
+ if (!m_Text.Equals( sChgd, nStt, nLen ))
+ {
+ aChgData.nStart = nStt;
+ aChgData.nLen = nLen;
+ aChgData.sChanged = sChgd;
+ aChgData.aOffsets = aOffsets;
+ aChanges.push_back( aChgData );
+ }
+
+ aCurWordBndry = pBreakIt->GetBreakIter()->nextWord(
+ GetTxt(), nEnd,
+ pBreakIt->GetLocale( GetLang( nEnd ) ),
+ nWordType);
}
- else
+ }
+ else if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::SENTENCE_CASE)
+ {
+ // for 'sentence case' we need to iterate sentence by sentence
+
+ sal_Int32 nLastStart = pBreakIt->GetBreakIter()->beginOfSentence(
+ GetTxt(), nEnd,
+ pBreakIt->GetLocale( GetLang( nEnd ) ) );
+ sal_Int32 nLastEnd = pBreakIt->GetBreakIter()->endOfSentence(
+ GetTxt(), nLastStart,
+ pBreakIt->GetLocale( GetLang( nLastStart ) ) );
+
+ // extend nStt, nEnd to the current sentence boundaries
+ sal_Int32 nCurrentStart = pBreakIt->GetBreakIter()->beginOfSentence(
+ GetTxt(), nStt,
+ pBreakIt->GetLocale( GetLang( nStt ) ) );
+ sal_Int32 nCurrentEnd = pBreakIt->GetBreakIter()->endOfSentence(
+ GetTxt(), nCurrentStart,
+ pBreakIt->GetLocale( GetLang( nCurrentStart ) ) );
+
+ // prevent backtracking to the previous sentence if selection starts at end of a sentence
+ if (nCurrentEnd <= nStt)
+ {
+ // now nCurrentStart is probably located on a non-letter word. (unless we
+ // are in Asian text with no spaces...)
+ // Thus to get the real sentence start we should locate the next real word,
+ // that is one found by DICTIONARY_WORD
+ i18n::Boundary aBndry = pBreakIt->GetBreakIter()->nextWord(
+ GetTxt(), nCurrentEnd,
+ pBreakIt->GetLocale( GetLang( nCurrentEnd ) ),
+ i18n::WordType::DICTIONARY_WORD);
+
+ // now get new current sentence boundaries
+ nCurrentStart = pBreakIt->GetBreakIter()->beginOfSentence(
+ GetTxt(), aBndry.startPos,
+ pBreakIt->GetLocale( GetLang( aBndry.startPos) ) );
+ nCurrentEnd = pBreakIt->GetBreakIter()->endOfSentence(
+ GetTxt(), nCurrentStart,
+ pBreakIt->GetLocale( GetLang( nCurrentStart) ) );
+ }
+ // prevent advancing to the next sentence if selection ends at start of a sentence
+ if (nLastStart >= nEnd)
{
- nLang = LANGUAGE_SYSTEM;
- nEndPos = nEnd;
+ // now nCurrentStart is probably located on a non-letter word. (unless we
+ // are in Asian text with no spaces...)
+ // Thus to get the real sentence start we should locate the previous real word,
+ // that is one found by DICTIONARY_WORD
+ i18n::Boundary aBndry = pBreakIt->GetBreakIter()->previousWord(
+ GetTxt(), nLastStart,
+ pBreakIt->GetLocale( GetLang( nLastStart) ),
+ i18n::WordType::DICTIONARY_WORD);
+ nLastEnd = pBreakIt->GetBreakIter()->endOfSentence(
+ GetTxt(), aBndry.startPos,
+ pBreakIt->GetLocale( GetLang( aBndry.startPos) ) );
+ if (nCurrentEnd > nLastEnd)
+ nCurrentEnd = nLastEnd;
}
- xub_StrLen nLen = nEndPos - nStt;
- Sequence <sal_Int32> aOffsets;
- String sChgd( rTrans.transliterate( m_Text, nLang, nStt, nLen,
- &aOffsets ));
- if( !m_Text.Equals( sChgd, nStt, nLen ) )
+ while (nCurrentStart < nLastEnd)
{
- if ( pUndo )
+ sal_Int32 nLen = nCurrentEnd - nCurrentStart;
+ DBG_ASSERT( nLen > 0, "invalid word length of 0" );
+#if OSL_DEBUG_LEVEL > 1
+ String aText( GetTxt().Copy( nCurrentStart, nLen ) );
+#endif
+
+ Sequence <sal_Int32> aOffsets;
+ String sChgd( rTrans.transliterate( GetTxt(),
+ GetLang( nCurrentStart ), nCurrentStart, nLen, &aOffsets ));
+
+ if (!m_Text.Equals( sChgd, nStt, nLen ))
{
- pUndo->AddChanges( *this, nStt, nLen, aOffsets );
+ aChgData.nStart = nCurrentStart;
+ aChgData.nLen = nLen;
+ aChgData.sChanged = sChgd;
+ aChgData.aOffsets = aOffsets;
+ aChanges.push_back( aChgData );
}
- ReplaceTextOnly( nStt, nLen, sChgd, aOffsets );
+
+ Boundary aFirstWordBndry;
+ aFirstWordBndry = pBreakIt->GetBreakIter()->nextWord(
+ GetTxt(), nCurrentEnd,
+ pBreakIt->GetLocale( GetLang( nCurrentEnd ) ),
+ nWordType);
+ nCurrentStart = aFirstWordBndry.startPos;
+ nCurrentEnd = pBreakIt->GetBreakIter()->endOfSentence(
+ GetTxt(), nCurrentStart,
+ pBreakIt->GetLocale( GetLang( nCurrentStart ) ) );
}
- nStt = nEndPos;
- } while( nEndPos < nEnd && pIter && pIter->Next() );
- delete pIter;
+ }
+ else
+ {
+ // here we may transliterate over complete language portions...
+
+ SwLanguageIterator* pIter;
+ if( rTrans.needLanguageForTheMode() )
+ pIter = new SwLanguageIterator( *this, nStt );
+ else
+ pIter = 0;
+
+ xub_StrLen nEndPos;
+ sal_uInt16 nLang;
+ do {
+ if( pIter )
+ {
+ nLang = pIter->GetLanguage();
+ nEndPos = pIter->GetChgPos();
+ if( nEndPos > nEnd )
+ nEndPos = nEnd;
+ }
+ else
+ {
+ nLang = LANGUAGE_SYSTEM;
+ nEndPos = nEnd;
+ }
+ xub_StrLen nLen = nEndPos - nStt;
+
+ Sequence <sal_Int32> aOffsets;
+ String sChgd( rTrans.transliterate( m_Text, nLang, nStt, nLen, &aOffsets ));
+
+ if (!m_Text.Equals( sChgd, nStt, nLen ))
+ {
+ aChgData.nStart = nStt;
+ aChgData.nLen = nLen;
+ aChgData.sChanged = sChgd;
+ aChgData.aOffsets = aOffsets;
+ aChanges.push_back( aChgData );
+ }
+
+ nStt = nEndPos;
+ } while( nEndPos < nEnd && pIter && pIter->Next() );
+ delete pIter;
+ }
+
+ if (aChanges.size() > 0)
+ {
+ // now apply the changes from end to start to leave the offsets of the
+ // yet unchanged text parts remain the same.
+ for (size_t i = 0; i < aChanges.size(); ++i)
+ {
+ TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ];
+ if (pUndo)
+ pUndo->AddChanges( *this, rData.nStart, rData.nLen, rData.aOffsets );
+ ReplaceTextOnly( rData.nStart, rData.nLen, rData.sChanged, rData.aOffsets );
+ }
+ }
}
}
diff --git a/sw/source/core/undo/makefile.mk b/sw/source/core/undo/makefile.mk
index d6e6766a0fd4..c381761adba1 100644
--- a/sw/source/core/undo/makefile.mk
+++ b/sw/source/core/undo/makefile.mk
@@ -49,6 +49,7 @@ EXCEPTIONSFILES = \
$(SLO)$/unattr.obj \
$(SLO)$/undobj.obj \
$(SLO)$/undraw.obj \
+ $(SLO)$/unovwr.obj \
$(SLO)$/untbl.obj
SLOFILES = \
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 8254d431b079..91549c84a57e 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -352,16 +352,14 @@ SwRewriter SwUndoOverwrite::GetRewriter() const
struct _UndoTransliterate_Data
{
- String sText;
- _UndoTransliterate_Data* pNext;
- SwHistory* pHistory;
- Sequence <sal_Int32>* pOffsets;
- ULONG nNdIdx;
- xub_StrLen nStart, nLen;
-
- _UndoTransliterate_Data( ULONG nNd, xub_StrLen nStt, xub_StrLen nStrLen,
- const String& rTxt )
- : sText( rTxt ), pNext( 0 ), pHistory( 0 ), pOffsets( 0 ),
+ String sText;
+ SwHistory* pHistory;
+ Sequence< sal_Int32 >* pOffsets;
+ ULONG nNdIdx;
+ xub_StrLen nStart, nLen;
+
+ _UndoTransliterate_Data( ULONG nNd, xub_StrLen nStt, xub_StrLen nStrLen, const String& rTxt )
+ : sText( rTxt ), pHistory( 0 ), pOffsets( 0 ),
nNdIdx( nNd ), nStart( nStt ), nLen( nStrLen )
{}
~_UndoTransliterate_Data() { delete pOffsets; delete pHistory; }
@@ -369,22 +367,17 @@ struct _UndoTransliterate_Data
void SetChangeAtNode( SwDoc& rDoc );
};
-SwUndoTransliterate::SwUndoTransliterate( const SwPaM& rPam,
- const utl::TransliterationWrapper& rTrans )
- : SwUndo( UNDO_TRANSLITERATE ), SwUndRng( rPam ),
- pData( 0 ), pLastData( 0 ), nType( rTrans.getType() )
+SwUndoTransliterate::SwUndoTransliterate(
+ const SwPaM& rPam,
+ const utl::TransliterationWrapper& rTrans )
+ : SwUndo( UNDO_TRANSLITERATE ), SwUndRng( rPam ), nType( rTrans.getType() )
{
}
SwUndoTransliterate::~SwUndoTransliterate()
{
- _UndoTransliterate_Data* pD = pData;
- while( pD )
- {
- pData = pD;
- pD = pD->pNext;
- delete pData;
- }
+ for (size_t i = 0; i < aChanges.size(); ++i)
+ delete aChanges[i];
}
void SwUndoTransliterate::Undo( SwUndoIter& rUndoIter )
@@ -393,8 +386,12 @@ void SwUndoTransliterate::Undo( SwUndoIter& rUndoIter )
BOOL bUndo = rDoc.DoesUndo();
rDoc.DoUndo( FALSE );
- for( _UndoTransliterate_Data* pD = pData; pD; pD = pD->pNext )
- pD->SetChangeAtNode( rDoc );
+ // since the changes were added to the vector from the end of the string/node towards
+ // the start, we need to revert them from the start towards the end now to keep the
+ // offset information of the undo data in sync with the changing text.
+ // Thus we need to iterate from the end of the vector to the start
+ for (sal_Int32 i = aChanges.size() - 1; i >= 0; --i)
+ aChanges[i]->SetChangeAtNode( rDoc );
rDoc.DoUndo( bUndo );
SetPaM( rUndoIter, TRUE );
@@ -413,8 +410,7 @@ void SwUndoTransliterate::Repeat( SwUndoIter& rUndoIter )
SwPaM& rPam = *rUndoIter.pAktPam;
SwDoc& rDoc = rUndoIter.GetDoc();
- utl::TransliterationWrapper aTrans(
- ::comphelper::getProcessServiceFactory(), nType );
+ utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType );
rDoc.TransliterateText( rPam, aTrans );
rUndoIter.pLastUndoObj = this;
@@ -428,67 +424,63 @@ void SwUndoTransliterate::AddChanges( SwTxtNode& rTNd,
_UndoTransliterate_Data* pNew = new _UndoTransliterate_Data(
rTNd.GetIndex(), nStart, (xub_StrLen)nOffsLen,
rTNd.GetTxt().Copy( nStart, nLen ));
- if( pData )
- pLastData->pNext = pNew;
- else
- pData = pNew;
- pLastData = pNew;
+
+ aChanges.push_back( pNew );
const sal_Int32* pOffsets = rOffsets.getConstArray();
// where did we need less memory ?
const sal_Int32* p = pOffsets;
for( long n = 0; n < nOffsLen; ++n, ++p )
- if( *p != ( nStart + n ))
+ if( *p != ( nStart + n ))
+ {
+ // create the Offset array
+ pNew->pOffsets = new Sequence <sal_Int32> ( nLen );
+ sal_Int32* pIdx = pNew->pOffsets->getArray();
+ p = pOffsets;
+ long nMyOff, nNewVal = nStart;
+ for( n = 0, nMyOff = nStart; n < nOffsLen; ++p, ++n, ++nMyOff )
{
- // create the Offset array
- pNew->pOffsets = new Sequence <sal_Int32> ( nLen );
- sal_Int32* pIdx = pNew->pOffsets->getArray();
- p = pOffsets;
- long nMyOff, nNewVal = nStart;
- for( n = 0, nMyOff = nStart; n < nOffsLen; ++p, ++n, ++nMyOff )
+ if( *p < nMyOff )
{
- if( *p < nMyOff )
- {
- // something is deleted
- nMyOff = *p;
- *(pIdx-1) = nNewVal++;
- }
- else if( *p > nMyOff )
- {
- for( ; *p > nMyOff; ++nMyOff )
- *pIdx++ = nNewVal;
- --nMyOff;
- --n;
- --p;
- }
- else
- *pIdx++ = nNewVal++;
+ // something is deleted
+ nMyOff = *p;
+ *(pIdx-1) = nNewVal++;
}
-
- // and then we need to save the attributes/bookmarks
- // but this data must moved every time to the last in the chain!
- _UndoTransliterate_Data* pD = pData;
- while( pD != pNew )
+ else if( *p > nMyOff )
{
- if( pD->nNdIdx == pNew->nNdIdx && pD->pHistory )
- {
- // same node and have a history?
- pNew->pHistory = pD->pHistory;
- pD->pHistory = 0;
- break; // more can't exist
- }
- pD = pD->pNext;
+ for( ; *p > nMyOff; ++nMyOff )
+ *pIdx++ = nNewVal;
+ --nMyOff;
+ --n;
+ --p;
}
+ else
+ *pIdx++ = nNewVal++;
+ }
- if( !pNew->pHistory )
+ // and then we need to save the attributes/bookmarks
+ // but this data must moved every time to the last in the chain!
+ for (size_t i = 0; i + 1 < aChanges.size(); ++i) // check all changes but not the current one
+ {
+ _UndoTransliterate_Data* pD = aChanges[i];
+ if( pD->nNdIdx == pNew->nNdIdx && pD->pHistory )
{
- pNew->pHistory = new SwHistory;
- SwRegHistory aRHst( rTNd, pNew->pHistory );
- pNew->pHistory->CopyAttr( rTNd.GetpSwpHints(),
- pNew->nNdIdx, 0, rTNd.GetTxt().Len(), false );
+ // same node and have a history?
+ pNew->pHistory = pD->pHistory;
+ pD->pHistory = 0;
+ break; // more can't exist
}
- break;
}
+
+ if( !pNew->pHistory )
+ {
+ pNew->pHistory = new SwHistory;
+ SwRegHistory aRHst( rTNd, pNew->pHistory );
+ pNew->pHistory->CopyAttr( rTNd.GetpSwpHints(),
+ pNew->nNdIdx, 0, rTNd.GetTxt().Len(), false );
+ }
+ break;
+ }
}
void _UndoTransliterate_Data::SetChangeAtNode( SwDoc& rDoc )
diff --git a/testautomation/dbaccess/optional/includes/db_Mozilla.inc b/testautomation/dbaccess/optional/includes/db_Mozilla.inc
index 45cf9456d290..236b6a5e79ed 100755
--- a/testautomation/dbaccess/optional/includes/db_Mozilla.inc
+++ b/testautomation/dbaccess/optional/includes/db_Mozilla.inc
@@ -32,22 +32,35 @@
'\***********************************************************************
sub db_Mozilla
- ' Information for this test under
- ' http://wiki.services.openoffice.org/wiki/Database_Automatic_Testing#Testing_the_mozilla_Address_book
-
- if fCreateMozillaAddressbookDatasource(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb")) then
-
- tQueryAddressbook(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb"))
- tSortAddressbook(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb"))
- else
+ if(gPlatform = "osx") then
+ ' on Mac platform the Mozilla address book is not available
+ ' so I call only the testcases to satisfied the database
tQueryAddressbook("")
tSortAddressbook("")
+ else
+
+ ' Information for this test under
+ ' http://wiki.services.openoffice.org/wiki/Database_Automatic_Testing#Testing_the_mozilla_Address_book
+
+ if fCreateMozillaAddressbookDatasource(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb")) then
+
+ tQueryAddressbook(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb"))
+ tSortAddressbook(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb"))
+ else
+ tQueryAddressbook("")
+ tSortAddressbook("")
+ endif
endif
end sub
'-------------------------------------------------------------------------
testcase tQueryAddressbook( sFileName )
+ if(gPlatform = "osx") then
+ printlog "mozilla address book not available on Mac"
+ goto endsub
+ endif
+
if ( not fOpenDatabase(sFileName) ) then
warnlog "Database can't be open"
printlog "May be you find a solution under http://wiki.services.openoffice.org/wiki/Database_Automatic_Testing#Testing_the_mozilla_Address_book"
@@ -86,6 +99,11 @@ endcase
'-------------------------------------------------------------------------
testcase tSortAddressbook( sFileName )
+ if(gPlatform = "osx") then
+ printlog "mozilla address book not available on Mac"
+ goto endsub
+ endif
+
Dim sRecordCount as String
'/// open the database file created in the bas file
diff --git a/testautomation/framework/required/includes/window_functions.inc b/testautomation/framework/required/includes/window_functions.inc
index 6917639d30f8..008248a1c57d 100755
--- a/testautomation/framework/required/includes/window_functions.inc
+++ b/testautomation/framework/required/includes/window_functions.inc
@@ -196,9 +196,6 @@ end sub
testcase tCheckWindowTitle( sApplication as string, sReference as string )
- if ( sApplication = "soffice" ) then
-
-
printlog( "Update test for the office window titles" )
' This is a Testtool-only problem that the product name is not displayed
diff --git a/testautomation/graphics/required/includes/impress/im_003_.inc b/testautomation/graphics/required/includes/impress/im_003_.inc
index 685a9d7e69cd..0eec59322e25 100644
--- a/testautomation/graphics/required/includes/impress/im_003_.inc
+++ b/testautomation/graphics/required/includes/impress/im_003_.inc
@@ -216,6 +216,9 @@ testcase tiViewToolbar_1
printlog "open application "
Call hNewDocument
+
+ printlog "use the empty layout"
+ call sSelectEmptyLayout
printlog "Insert->Graphic... : global\input\graf_inp\desp.bmp "
hUseAsyncSlot( "InsertGraphicsFromFile" )
diff --git a/testautomation/graphics/required/includes/impress/im_004_.inc b/testautomation/graphics/required/includes/impress/im_004_.inc
index 02587ea83df9..2c55bc4c2f13 100644
--- a/testautomation/graphics/required/includes/impress/im_004_.inc
+++ b/testautomation/graphics/required/includes/impress/im_004_.inc
@@ -49,6 +49,7 @@ testcase tiInsertSlideExpandSummary
Kontext "DocumentImpressOutlineView"
printlog "Type 2 rows "
DocumentImpressOutlineView.TypeKeys "Herbert<Return>Rudi"
+ sleep(1)
printlog "View->Master View->Drawing View "
ViewWorkspaceDrawingView
WaitSlot()
diff --git a/testautomation/writer/optional/includes/loadsave/w_loadsave.inc b/testautomation/writer/optional/includes/loadsave/w_loadsave.inc
index 7454f733665d..e4871e78f400 100644
--- a/testautomation/writer/optional/includes/loadsave/w_loadsave.inc
+++ b/testautomation/writer/optional/includes/loadsave/w_loadsave.inc
@@ -52,6 +52,7 @@ testcase tExportAllReadableFormatsIntoODF
Dim SavedCorrectly as Boolean
Dim sExportFilter as string
Dim sExportFile as string
+ Dim sExceptionFile as string
Dim i as Integer
WorkDirectory = ( ConvertPath ( gOfficePath + "user\work\" + gPlatgroup + "\export\"))
@@ -77,8 +78,12 @@ testcase tExportAllReadableFormatsIntoODF
For i = 1 to listCount(ImportFileList())
printlog "- " & i & ". load: " & ImportFileList(i)
sExportFile = ImportFileList(i)
+ sExceptionFile = DateiExtract ( sExportFile )
+ printlog sExceptionFile
if GetExtention ( sExportFile ) = "psw" then
- QAErrorlog "#i102221#Pocket Word filter puts General I/O Error"
+ QAErrorlog "#i102221#Pocket Word filter puts General I/O Error"
+ elseif LCase( sExceptionFile ) = "swdos.txt" then
+ QAErrorlog "#i114062#General I/O error loading StarWriter DOS file"
else
Call hFileOpen ( ImportFileList(i) )
printlog "- done"
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 4a68b4c80e3f..68f09abfdb78 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2363,15 +2363,23 @@ sal_Int16 VCLXDialog::execute() throw(::com::sun::star::uno::RuntimeException)
Dialog* pDlg = (Dialog*) GetWindow();
Window* pParent = pDlg->GetWindow( WINDOW_PARENTOVERLAP );
Window* pOldParent = NULL;
+ Window* pSetParent = NULL;
if ( pParent && !pParent->IsReallyVisible() )
{
pOldParent = pDlg->GetParent();
Window* pFrame = pDlg->GetWindow( WINDOW_FRAME );
if( pFrame != pDlg )
+ {
pDlg->SetParent( pFrame );
+ pSetParent = pFrame;
+ }
}
+
nRet = pDlg->Execute();
- if ( pOldParent )
+
+ // set the parent back only in case no new parent was set from outside
+ // in other words, revert only own changes
+ if ( pOldParent && pDlg->GetParent() == pSetParent )
pDlg->SetParent( pOldParent );
}
return nRet;
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx
index d7cec7c17354..c36ae29d4531 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -318,12 +318,17 @@ void UnoWrapper::WindowDestroyed( Window* pWindow )
Window* pTopWindowChild = pWindow->GetWindow( WINDOW_FIRSTTOPWINDOWCHILD );
while ( pTopWindowChild )
{
- OSL_ENSURE( pTopWindowChild->GetParent() == pWindow, "UnoWrapper::WindowDestroyed: inconsistency in the SystemWindow relationship!" );
+ OSL_ENSURE( pTopWindowChild->GetParent() == pWindow,
+ "UnoWrapper::WindowDestroyed: inconsistency in the SystemWindow relationship!" );
- uno::Reference< lang::XComponent > xComp( pTopWindowChild->GetComponentInterface( FALSE ), uno::UNO_QUERY );
- pTopWindowChild = pTopWindowChild->GetWindow( WINDOW_NEXTTOPWINDOWSIBLING );
- if ( xComp.is() )
- xComp->dispose();
+ Window* pNextTopChild = pTopWindowChild->GetWindow( WINDOW_NEXTTOPWINDOWSIBLING );
+
+ //the window still could be on the stack, so we have to
+ // use lazy delete ( it will automatically
+ // disconnect from the currently destroyed parent window )
+ pTopWindowChild->doLazyDelete();
+
+ pTopWindowChild = pNextTopChild;
}
}
}
diff --git a/unotools/inc/unotools/ucbhelper.hxx b/unotools/inc/unotools/ucbhelper.hxx
index 687868adbdb4..38b355439c2b 100644
--- a/unotools/inc/unotools/ucbhelper.hxx
+++ b/unotools/inc/unotools/ucbhelper.hxx
@@ -80,6 +80,7 @@ namespace utl
static sal_Bool FindInPath( const String& rPath, const String& rName, String& rFile, char cDelim = ';', BOOL bAllowWildCards = TRUE );
static sal_Bool Find( const String& rFolder, const String& rName, String& rFile, BOOL bAllowWildCards = FALSE );
static sal_Bool IsSubPath( const ::rtl::OUString& rPath, const ::rtl::OUString& rChildCandidate, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider >& xContentProvider = ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider >() );
+ static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL );
};
}
diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx
index 4160f2f2f443..8befb8a0f209 100644
--- a/unotools/source/ucbhelper/ucbhelper.cxx
+++ b/unotools/source/ucbhelper/ucbhelper.cxx
@@ -872,5 +872,54 @@ sal_Bool UCBContentHelper::IsSubPath( const ::rtl::OUString& rPath, const ::rtl:
return bResult;
}
+// -----------------------------------------------------------------------
+sal_Bool UCBContentHelper::EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL )
+{
+ sal_Bool bResult = sal_False;
+
+ if ( aFirstURL.getLength() && aSecondURL.getLength() )
+ {
+ INetURLObject aFirst( aFirstURL );
+ INetURLObject aSecond( aSecondURL );
+
+ if ( aFirst.GetProtocol() != INET_PROT_NOT_VALID && aSecond.GetProtocol() != INET_PROT_NOT_VALID )
+ {
+ try
+ {
+ ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
+ if ( !pBroker )
+ throw uno::RuntimeException();
+
+ uno::Reference< ::com::sun::star::ucb::XContentIdentifierFactory > xIdFac
+ = pBroker->getContentIdentifierFactoryInterface();
+ if ( !xIdFac.is() )
+ throw uno::RuntimeException();
+
+ uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdFirst
+ = xIdFac->createContentIdentifier( aFirst.GetMainURL( INetURLObject::NO_DECODE ) );
+ uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdSecond
+ = xIdFac->createContentIdentifier( aSecond.GetMainURL( INetURLObject::NO_DECODE ) );
+
+ if ( xIdFirst.is() && xIdSecond.is() )
+ {
+ uno::Reference< ::com::sun::star::ucb::XContentProvider > xProvider =
+ pBroker->getContentProviderInterface();
+ if ( !xProvider.is() )
+ throw uno::RuntimeException();
+ bResult = !xProvider->compareContentIds( xIdFirst, xIdSecond );
+ }
+ }
+ catch( uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "Can't compare URL's, treat as different!\n" );
+ }
+ }
+ }
+
+ return bResult;
+}
+
+
+
} // namespace utl
diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx
index a1eca84bbdf8..ccabb9114f2d 100644
--- a/vbahelper/inc/vbahelper/vbahelper.hxx
+++ b/vbahelper/inc/vbahelper/vbahelper.hxx
@@ -90,6 +90,13 @@ namespace ooo
VBAHELPER_DLLPUBLIC void PrintOutHelper( SfxViewShell* pViewShell, const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, sal_Bool bSelection );
VBAHELPER_DLLPUBLIC void PrintPreviewHelper( const css::uno::Any& EnableChanges, SfxViewShell* );
+ /** Extracts a boolean value from the passed Any, which may contain sal_Bool or an integer or floating-point value.
+ Returns false, if the Any is empty or contains an incompatible type. */
+ VBAHELPER_DLLPUBLIC bool extractBoolFromAny( bool& rbValue, const css::uno::Any& rAny );
+ /** Extracts a boolean value from the passed Any, which may contain sal_Bool or an integer or floating-point value.
+ Throws, if the Any is empty or contains an incompatible type. */
+ VBAHELPER_DLLPUBLIC bool extractBoolFromAny( const css::uno::Any& rAny ) throw (css::uno::RuntimeException);
+
VBAHELPER_DLLPUBLIC rtl::OUString getAnyAsString( const css::uno::Any& pvargItem ) throw ( css::uno::RuntimeException );
VBAHELPER_DLLPUBLIC rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike = false); // needs to be in an uno service ( already this code is duplicated in basic )
VBAHELPER_DLLPUBLIC double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical);
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index 2a4cecfc2338..a1333e0a655b 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -153,28 +153,41 @@ 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 );
- // The Object *must* support XDefaultProperty here because getValue will
- // only return properties that are Objects ( e.g. controls )
- // e.g. Userform1.aControl = something
- // 'aControl' has to support XDefaultProperty to make sense here
- uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW );
- rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName();
- uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) );
- uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW );
- xPropSet->setPropertyValue( aDfltPropName, aValue );
+
+ // in case the dialog is already closed the VBA implementation should not throw exceptions
+ if ( aObject.hasValue() )
+ {
+ // The Object *must* support XDefaultProperty here because getValue will
+ // only return properties that are Objects ( e.g. controls )
+ // e.g. Userform1.aControl = something
+ // 'aControl' has to support XDefaultProperty to make sense here
+ uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW );
+ rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName();
+ uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) );
+ uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW );
+ xPropSet->setPropertyValue( aDfltPropName, aValue );
+ }
}
uno::Any SAL_CALL
ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- 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 );
- ScVbaControlFactory aFac( mxContext, xControl, m_xModel );
- uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) );
- ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
- pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) );
- return uno::makeAny( xVBAControl );
+ uno::Any aResult;
+
+ // in case the dialog is already closed the VBA implementation should not throw exceptions
+ if ( m_xDialog.is() )
+ {
+ 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 );
+ ScVbaControlFactory aFac( mxContext, xControl, m_xModel );
+ uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) );
+ ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
+ pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) );
+ aResult = uno::makeAny( xVBAControl );
+ }
+
+ return aResult;
}
::sal_Bool SAL_CALL
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index 7cd82dff9536..14f4e3ff1363 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -625,6 +625,30 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
dispatchExecute( pViewShell, SID_VIEWSHELL1 );
}
+bool extractBoolFromAny( bool& rbValue, const uno::Any& rAny )
+{
+ if( rAny >>= rbValue ) return true;
+
+ sal_Int64 nSigned = 0;
+ if( rAny >>= nSigned ) { rbValue = nSigned != 0; return true; }
+
+ sal_uInt64 nUnsigned = 0;
+ if( rAny >>= nUnsigned ) { rbValue = nUnsigned > 0; return true; }
+
+ double fDouble = 0.0;
+ if( rAny >>= fDouble ) { rbValue = fDouble != 0.0; return true; }
+
+ return false;
+}
+
+bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException)
+{
+ bool bValue = false;
+ if( extractBoolFromAny( bValue, rAny ) )
+ return bValue;
+ throw uno::RuntimeException();
+}
+
rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException )
{
uno::Type aType = pvargItem.getValueType();
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 375c570f1a16..51f33ed17f6c 100755
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -173,6 +173,7 @@ public:
// if set, pages are centered and trimmed onto the fixed page
Size maFixedPageSize;
sal_Int32 mnDefaultPaperBin;
+ sal_Int32 mnFixedPaperBin;
ImplPrinterControllerData() :
mbFirstPage( sal_True ),
@@ -180,7 +181,8 @@ public:
mbReversePageOrder( sal_False ),
meJobState( view::PrintableState_JOB_STARTED ),
mpProgress( NULL ),
- mnDefaultPaperBin( -1 )
+ mnDefaultPaperBin( -1 ),
+ mnFixedPaperBin( -1 )
{}
~ImplPrinterControllerData() { delete mpProgress; }
@@ -726,6 +728,7 @@ void PrinterController::setPrinter( const boost::shared_ptr<Printer>& i_rPrinter
setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ),
makeAny( rtl::OUString( i_rPrinter->GetName() ) ) );
mpImplData->mnDefaultPaperBin = mpImplData->mpPrinter->GetPaperBin();
+ mpImplData->mnFixedPaperBin = -1;
}
bool PrinterController::setupPrinter( Window* i_pParent )
@@ -733,15 +736,20 @@ bool PrinterController::setupPrinter( Window* i_pParent )
bool bRet = false;
if( mpImplData->mpPrinter.get() )
{
+ // get old data
Size aPaperSize( mpImplData->mpPrinter->PixelToLogic(
mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
+ USHORT nPaperBin = mpImplData->mpPrinter->GetPaperBin();
+
+ // call driver setup
bRet = mpImplData->mpPrinter->Setup( i_pParent );
if( bRet )
{
- // was the papersize overridden ? if so we need to take action
+ // was papersize or bin overridden ? if so we need to take action
Size aNewPaperSize( mpImplData->mpPrinter->PixelToLogic(
mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
- if( aNewPaperSize != aPaperSize )
+ USHORT nNewPaperBin = mpImplData->mpPrinter->GetPaperBin();
+ if( aNewPaperSize != aPaperSize || nNewPaperBin != nPaperBin )
{
mpImplData->maFixedPageSize = aNewPaperSize;
mpImplData->maPageCache.invalidate();
@@ -750,6 +758,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
aOverrideSize.Height = aNewPaperSize.Height();
setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OverridePageSize" ) ),
makeAny( aOverrideSize ) );
+ mpImplData->mnFixedPaperBin = nNewPaperBin;
}
}
}
@@ -1147,8 +1156,13 @@ void PrinterController::printFilteredPage( int i_nPage )
mpImplData->mpPrinter->SetMapMode( MAP_100TH_MM );
// aPageSize was filtered through mpImplData->getRealPaperSize already by getFilteredPageFile()
mpImplData->mpPrinter->SetPaperSizeUser( aPageSize.aSize, ! mpImplData->isFixedPageSize() );
+ if( mpImplData->mnFixedPaperBin != -1 &&
+ mpImplData->mpPrinter->GetPaperBin() != mpImplData->mnFixedPaperBin )
+ {
+ mpImplData->mpPrinter->SetPaperBin( mpImplData->mnFixedPaperBin );
+ }
- // if full paper are is meant, move the output to accomodate for pageoffset
+ // if full paper is meant to be used, move the output to accomodate for pageoffset
if( aPageSize.bFullPaper )
{
Point aPageOffset( mpImplData->mpPrinter->GetPageOffset() );
diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index d4ee01c26d61..322b2937b5c9 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -218,8 +218,15 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
Point aPos = rMEvt.GetPosPixel();
aLastMove = rMEvt;
- pWin->CaptureMouse();
- nFlags |= SELENG_IN_SEL;
+ if( !rMEvt.IsRight() )
+ {
+ pWin->CaptureMouse();
+ nFlags |= SELENG_IN_SEL;
+ }
+ else
+ {
+ nModifier = 0;
+ }
switch ( nModifier )
{
@@ -327,7 +334,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
|*
*************************************************************************/
-BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& /* rMEvt */ )
+BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
{
aWTimer.Stop();
//DbgOut("Up");
@@ -336,7 +343,11 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& /* rMEvt */ )
nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL);
return FALSE;
}
- pWin->ReleaseMouse();
+
+ if( !rMEvt.IsRight() )
+ {
+ pWin->ReleaseMouse();
+ }
if( (nFlags & SELENG_WAIT_UPEVT) && !(nFlags & SELENG_CMDEVT) &&
eSelMode != SINGLE_SELECTION)
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index 13492f3d4a5c..51297109ca43 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -92,7 +92,7 @@ atk_wrapper_focus_idle_handler (gpointer data)
// also emit state-changed:focused event under the same condition.
{
AtkObjectWrapper* wrapper_obj = ATK_OBJECT_WRAPPER (atk_obj);
- if( !wrapper_obj->mpText && wrapper_obj->mpContext )
+ if( wrapper_obj && !wrapper_obj->mpText && wrapper_obj->mpContext )
{
uno::Any any = wrapper_obj->mpContext->queryInterface( accessibility::XAccessibleText::static_type(NULL) );
if ( typelib_TypeClass_INTERFACE == any.pType->eTypeClass &&
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index c6ff16f8395b..e8b55ebfa895 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1452,12 +1452,6 @@ void GtkSalFrame::setMinMaxSize()
aHints |= GDK_HINT_MAX_SIZE;
}
}
- if( m_bFullscreen )
- {
- aGeo.max_width = m_aMaxSize.Width();
- aGeo.max_height = m_aMaxSize.Height();
- aHints |= GDK_HINT_MAX_SIZE;
- }
if( aHints )
gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow),
NULL,
@@ -1832,7 +1826,11 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
// workaround different legacy version window managers have different opinions about
// _NET_WM_STATE_FULLSCREEN (Metacity <-> KWin)
if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
+ {
+ if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
+ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) );
+ }
if( bVisible )
Show( TRUE );
}
@@ -1863,11 +1861,8 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
{
if( bFullScreen )
{
- if( getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
- {
- if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
- gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
- }
+ if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
+ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
gtk_window_fullscreen( GTK_WINDOW(m_pWindow) );
moveToScreen( nScreen );
Size aScreenSize = pDisp->GetScreenSize( m_nScreen );
@@ -1879,11 +1874,8 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
else
{
gtk_window_unfullscreen( GTK_WINDOW(m_pWindow) );
- if( getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
- {
- if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
- gtk_window_set_resizable( GTK_WINDOW(m_pWindow), FALSE );
- }
+ if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
+ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), FALSE );
moveToScreen( nScreen );
}
}
@@ -2849,12 +2841,52 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
return FALSE;
}
+IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG )
+{
+ Atom nStateAtom = getDisplay()->getWMAdaptor()->getAtom(vcl_sal::WMAdaptor::NET_WM_STATE);
+ Atom nFSAtom = getDisplay()->getWMAdaptor()->getAtom(vcl_sal::WMAdaptor::NET_WM_STATE_FULLSCREEN );
+ if( nStateAtom && nFSAtom )
+ {
+ /* #i110881# workaround a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8)
+ gtk_window_fullscreen can fail due to a race condition, request an additional status change
+ to fullscreen to be safe
+ */
+ XEvent aEvent;
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = getDisplay()->GetDisplay();
+ aEvent.xclient.window = GDK_WINDOW_XWINDOW(m_pWindow->window);
+ aEvent.xclient.message_type = nStateAtom;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = 1;
+ aEvent.xclient.data.l[1] = nFSAtom;
+ aEvent.xclient.data.l[2] = 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
+ XSendEvent( getDisplay()->GetDisplay(),
+ getDisplay()->GetRootWindow( m_nScreen ),
+ False,
+ SubstructureNotifyMask | SubstructureRedirectMask,
+ &aEvent
+ );
+ }
+
+ return 0;
+}
+
gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame )
{
GtkSalFrame* pThis = (GtkSalFrame*)frame;
GTK_YIELD_GRAB();
+ if( pThis->m_bFullscreen )
+ {
+ /* #i110881# workaorund a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8)
+ gtk_window_fullscreen can run into a race condition with the window's showstate
+ */
+ Application::PostUserEvent( LINK( pThis, GtkSalFrame, ImplDelayedFullScreenHdl ) );
+ }
+
bool bSetFocus = pThis->m_bSetFocusOnMap;
pThis->m_bSetFocusOnMap = false;
if( ImplGetSVData()->mbIsTestTool )
diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
index 18dd476fc2c4..d47e5fb50fca 100644
--- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
@@ -38,6 +38,8 @@
#include <vcl/salframe.hxx>
#include <vcl/sysdata.hxx>
+#include "tools/link.hxx"
+
#include <list>
#include <vector>
@@ -265,6 +267,8 @@ class GtkSalFrame : public SalFrame
void setMinMaxSize();
void createNewWindow( XLIB_Window aParent, bool bXEmbed, int nScreen );
void askForXEmbedFocus( sal_Int32 nTimecode );
+
+ DECL_LINK( ImplDelayedFullScreenHdl, void* );
public:
GtkSalFrame( SalFrame* pParent, ULONG nStyle );
GtkSalFrame( SystemParentData* pSysData );
diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx
index 1a116fcbe8d6..aa2e4c84ef24 100644
--- a/vcl/unx/source/app/wmadaptor.cxx
+++ b/vcl/unx/source/app/wmadaptor.cxx
@@ -2180,6 +2180,15 @@ void NetWMAdaptor::showFullScreen( X11SalFrame* pFrame, bool bFullScreen ) const
if( m_aWMAtoms[ NET_WM_STATE_FULLSCREEN ] )
{
pFrame->mbFullScreen = bFullScreen;
+ if( bFullScreen )
+ {
+ if( m_aWMAtoms[ MOTIF_WM_HINTS ] )
+ {
+ XDeleteProperty( m_pDisplay,
+ pFrame->GetShellWindow(),
+ m_aWMAtoms[ MOTIF_WM_HINTS ] );
+ }
+ }
if( pFrame->bMapped_ )
{
// window already mapped, send WM a message