summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/app/app.cxx9
-rw-r--r--basic/source/app/app.hxx1
-rw-r--r--basic/source/app/appwin.cxx8
-rw-r--r--basic/source/basmgr/basmgr.cxx2
-rw-r--r--[-rwxr-xr-x]basic/source/classes/sbxmod.cxx5
-rw-r--r--basic/source/inc/sbdiagnose.hxx34
-rw-r--r--basic/source/runtime/dllmgr.cxx17
-rw-r--r--basic/source/runtime/makefile.mk3
-rw-r--r--basic/source/runtime/rtlproto.hxx1
-rw-r--r--basic/source/runtime/sbdiagnose.cxx134
-rw-r--r--basic/source/runtime/stdobj.cxx2
-rwxr-xr-xbasic/source/runtime/step2.cxx2
-rw-r--r--connectivity/inc/connectivity/predicateinput.hxx8
-rw-r--r--connectivity/inc/connectivity/sqlnode.hxx2
-rw-r--r--connectivity/qa/connectivity/tools/CRMDatabase.java5
-rw-r--r--connectivity/source/commontools/FValue.cxx48
-rw-r--r--connectivity/source/commontools/predicateinput.cxx136
-rw-r--r--connectivity/source/drivers/ado/AColumn.cxx5
-rw-r--r--connectivity/source/drivers/ado/AConnection.cxx5
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx4
-rwxr-xr-xconnectivity/source/drivers/macab/MacabRecord.cxx2
-rw-r--r--connectivity/source/parse/PColumn.cxx16
-rw-r--r--connectivity/source/parse/sqlbison.y474
-rw-r--r--connectivity/source/parse/sqlflex.l27
-rw-r--r--connectivity/source/parse/sqliterator.cxx34
-rw-r--r--connectivity/source/parse/sqlnode.cxx2
-rw-r--r--desktop/os2/source/applauncher/makefile.mk6
-rw-r--r--desktop/os2/source/applauncher/os2quickstart.cxx (renamed from desktop/os2/source/applauncher/quickstart.cxx)0
-rw-r--r--desktop/prj/build.lst5
-rw-r--r--desktop/prj/d.lst7
-rw-r--r--desktop/source/app/app.cxx16
-rw-r--r--[-rwxr-xr-x]desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx2
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/manager/dp_manager.cxx22
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx26
-rw-r--r--[-rwxr-xr-x]desktop/source/deployment/registry/dp_backend.cxx59
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/dp_backenddb.cxx5
-rw-r--r--desktop/util/ooverinfo.rc2
-rw-r--r--[-rwxr-xr-x]desktop/util/ooverinfo2.rc2
-rw-r--r--[-rwxr-xr-x]desktop/util/verinfo.rc4
-rw-r--r--desktop/win32/source/QuickStart/OOQuickStart.rc (renamed from sysui/source/win32/QuickStart/OOQuickStart.rc)8
-rw-r--r--desktop/win32/source/QuickStart/QuickStart.cpp (renamed from sysui/source/win32/QuickStart/QuickStart.cpp)0
-rw-r--r--desktop/win32/source/QuickStart/QuickStart.h (renamed from sysui/source/win32/QuickStart/QuickStart.h)0
-rw-r--r--desktop/win32/source/QuickStart/StdAfx.h (renamed from sysui/source/win32/QuickStart/StdAfx.h)0
-rw-r--r--desktop/win32/source/QuickStart/makefile.mk (renamed from sysui/source/win32/QuickStart/makefile.mk)0
-rw-r--r--desktop/win32/source/QuickStart/resource.h (renamed from sysui/source/win32/QuickStart/resource.h)0
-rw-r--r--desktop/win32/source/QuickStart/so/QuickStart.rc (renamed from sysui/source/win32/QuickStart/so/QuickStart.rc)8
-rw-r--r--desktop/win32/source/QuickStart/so/makefile.mk (renamed from sysui/source/win32/QuickStart/so/makefile.mk)4
-rw-r--r--desktop/win32/source/applauncher/makefile.mk4
-rw-r--r--desktop/win32/source/guiloader/makefile.mk4
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx2
-rw-r--r--drawinglayer/source/attribute/fontattribute.cxx20
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx2
-rw-r--r--drawinglayer/source/processor2d/canvasprocessor.cxx5
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx2
-rwxr-xr-x[-rw-r--r--]editeng/inc/editeng/fontitem.hxx21
-rwxr-xr-x[-rw-r--r--]editeng/inc/editeng/svxacorr.hxx1
-rwxr-xr-x[-rw-r--r--]editeng/source/editeng/editobj.cxx4
-rw-r--r--editeng/source/editeng/edtspell.cxx7
-rwxr-xr-x[-rw-r--r--]editeng/source/editeng/edtspell.hxx1
-rwxr-xr-xediteng/source/editeng/impedit2.cxx22
-rwxr-xr-xediteng/source/editeng/impedit4.cxx10
-rwxr-xr-x[-rw-r--r--]editeng/source/editeng/textconv.cxx10
-rw-r--r--editeng/source/items/numitem.cxx2
-rwxr-xr-x[-rw-r--r--]editeng/source/items/textitem.cxx20
-rwxr-xr-x[-rw-r--r--]editeng/source/misc/svxacorr.cxx51
-rwxr-xr-x[-rw-r--r--]editeng/source/uno/unofdesc.cxx10
-rw-r--r--formula/inc/formula/compiler.hrc126
-rw-r--r--formula/inc/formula/opcode.hxx4
-rw-r--r--formula/source/core/resource/core_resource.src24
-rw-r--r--framework/inc/services/substitutepathvars.hxx205
-rwxr-xr-xframework/qa/complex/path_substitution/PathSubstitutionTest.java24
-rw-r--r--framework/qa/unoapi/makefile.mk48
-rwxr-xr-x[-rw-r--r--]framework/source/services/backingwindow.cxx57
-rwxr-xr-x[-rw-r--r--]framework/source/services/substitutepathvars.cxx335
-rwxr-xr-xofficecfg/registry/data/org/openoffice/Office/Canvas.xcu2
-rw-r--r--officecfg/registry/data/org/openoffice/Setup.xcu2
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java44
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java44
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java77
-rw-r--r--sfx2/inc/sfx2/module.hxx12
-rw-r--r--sfx2/qa/cppunit/makefile.mk86
-rw-r--r--sfx2/qa/unoapi/makefile.mk48
-rw-r--r--sfx2/source/appl/module.cxx34
-rw-r--r--sfx2/source/config/evntconf.cxx2
-rw-r--r--sfx2/source/control/unoctitm.cxx2
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx2
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx46
-rw-r--r--sfx2/source/doc/objxtor.cxx5
-rwxr-xr-x[-rw-r--r--]sfx2/source/view/viewprn.cxx83
-rw-r--r--svx/source/dialog/svxruler.cxx2
-rw-r--r--svx/source/fmcomp/gridctrl.cxx12
-rw-r--r--svx/source/form/fmobj.cxx4
-rw-r--r--svx/source/form/fmpage.cxx5
-rw-r--r--svx/source/form/fmpgeimp.cxx76
-rw-r--r--svx/source/form/fmshell.cxx6
-rw-r--r--svx/source/form/fmundo.cxx78
-rw-r--r--svx/source/inc/fmpgeimp.hxx4
-rwxr-xr-x[-rw-r--r--]svx/source/mnuctrls/fntctl.cxx2
-rwxr-xr-xsvx/source/sdr/contact/viewobjectcontactofunocontrol.cxx3
-rw-r--r--svx/source/stbctrls/pszctrl.cxx2
-rwxr-xr-x[-rw-r--r--]svx/source/svdraw/svdibrow.cxx6
-rwxr-xr-x[-rw-r--r--]svx/source/svdraw/svdmodel.cxx40
-rw-r--r--svx/source/svdraw/svdouno.cxx71
-rw-r--r--svx/source/tbxctrls/itemwin.cxx4
-rw-r--r--sysui/desktop/icons/makefile.mk63
-rw-r--r--sysui/desktop/icons/so7-base-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-calc-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-calc-tem.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-chart-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-draw-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-draw-tem.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-impress-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-impress-tem.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-master-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-math-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-writer-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so7-writer-tem.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-base-app.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-base-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-calc-app.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-calc-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-calc-tem.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-chart-doc.icobin10134 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-configuration.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-draw-app.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-draw-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-draw-tem.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-empty-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-empty-tem.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-image-doc.icobin10134 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-impress-app.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-impress-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-impress-tem.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-macro-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-main-app.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-master-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-math-app.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-math-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-open.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-printer.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-web-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-writer-app.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-writer-doc.icobin25214 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so8-writer-tem.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_base_app.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_base_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_calc_app.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_calc_doc.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_calc_tem.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_chart_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_draw_app.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_draw_doc.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_draw_tem.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_empty_doc.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_empty_tem.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_global_doc.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_html_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_impress_app.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_impress_doc.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_impress_tem.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_macro_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_main_app.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_math_app.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_math_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_open.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_writer_app.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_writer_doc.icobin295606 -> 0 bytes
-rw-r--r--sysui/desktop/icons/so9_writer_tem.icobin295606 -> 0 bytes
-rw-r--r--sysui/prj/build.lst6
-rw-r--r--sysui/prj/d.lst4
-rw-r--r--ucb/source/ucp/tdoc/tdoc_docmgr.cxx20
-rw-r--r--uui/source/iahndl-ssl.cxx67
-rw-r--r--xmlhelp/source/com/sun/star/help/HelpIndexer.java8
-rwxr-xr-x[-rw-r--r--]xmlhelp/source/cxxhelp/provider/databases.cxx52
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.hxx2
-rwxr-xr-x[-rw-r--r--]xmlhelp/source/cxxhelp/provider/db.cxx45
-rwxr-xr-x[-rw-r--r--]xmlhelp/source/cxxhelp/provider/db.hxx21
-rw-r--r--xmloff/inc/xmloff/PageMasterStyleMap.hxx17
-rw-r--r--xmloff/inc/xmloff/txtprmap.hxx8
-rw-r--r--xmloff/inc/xmloff/xmlmetai.hxx10
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx2
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx141
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx9
-rw-r--r--xmloff/source/chart/SchXMLTools.cxx2
-rw-r--r--xmloff/source/core/xmlexp.cxx9
-rw-r--r--xmloff/source/core/xmltoken.cxx2
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx21
-rw-r--r--xmloff/source/draw/shapeexport.cxx2
-rw-r--r--xmloff/source/meta/xmlmetai.cxx113
-rw-r--r--xmloff/source/style/PageMasterExportPropMapper.cxx46
-rw-r--r--xmloff/source/style/PageMasterImportPropMapper.cxx79
-rw-r--r--xmloff/source/style/PageMasterStyleMap.cxx28
-rw-r--r--xmloff/source/style/xmlnume.cxx24
-rw-r--r--xmloff/source/style/xmlnumi.cxx16
-rw-r--r--xmloff/source/text/XMLAutoTextEventExport.cxx3
-rw-r--r--xmloff/source/text/txtexppr.cxx123
-rw-r--r--xmloff/source/text/txtimppr.cxx78
-rw-r--r--xmloff/source/text/txtprhdl.cxx3
-rw-r--r--xmloff/source/text/txtprmap.cxx27
-rw-r--r--xmloff/source/transform/PropertyActionsOOo.cxx2
200 files changed, 2790 insertions, 1250 deletions
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index cd3e1dd0061f..34f9e5096fb1 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -857,6 +857,15 @@ void BasicFrame::Resize()
}
}
+Rectangle BasicFrame::GetInnerRect() const
+{
+ Rectangle aRect( Point(0,0), GetOutputSizePixel() );
+ aRect.Bottom() = pStatus->GetPosPixel().Y()-1;
+ if( aRect.Bottom() < 0 ) // sanity check
+ aRect.Bottom() = 0;
+ return aRect;
+}
+
void BasicFrame::Move()
{
Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
diff --git a/basic/source/app/app.hxx b/basic/source/app/app.hxx
index 5a501ec5efcf..47dd5056fb58 100644
--- a/basic/source/app/app.hxx
+++ b/basic/source/app/app.hxx
@@ -188,6 +188,7 @@ public:
void SetAppMode( const String &aNewMode ){ aAppMode = aNewMode; UpdateTitle(); }
String GenRealString( const String &aResString );
+ Rectangle GetInnerRect() const;
};
diff --git a/basic/source/app/appwin.cxx b/basic/source/app/appwin.cxx
index 4d0a5f95fca4..eb80a96f4183 100644
--- a/basic/source/app/appwin.cxx
+++ b/basic/source/app/appwin.cxx
@@ -121,14 +121,8 @@ void AppWin::Maximize()
pFrame->nMaximizedWindows++;
nWinState = TT_WIN_STATE_MAX;
}
- sal_Int32 nTitleHeight;
- {
- sal_Int32 nDummy1, nDummy2, nDummy3;
- pFrame->GetBorder( nDummy1, nTitleHeight, nDummy2, nDummy3 );
- }
- Size aSize = pFrame->GetOutputSizePixel();
- aSize.Height() -= nTitleHeight;
+ Size aSize = pFrame->GetInnerRect().GetSize();
aSize.Height() -= 2;
aSize.Width() -= 2;
SetSizePixel( aSize );
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index bb686c765f4c..a6a1fb5f23c0 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1975,7 +1975,7 @@ ErrCode BasicManager::ExecuteMacro( String const& i_fullyQualifiedName, String c
sCall += ']';
SbxVariable* pRet = pMethod->GetParent()->Execute( sCall );
- if ( pRet )
+ if ( pRet && ( pRet != pMethod ) )
*i_retValue = *pRet;
return SbxBase::GetError();
}
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 592d69c514a0..c722e680fd8c 100755..100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -36,6 +36,7 @@
#include <svl/brdcst.hxx>
#include <tools/shl.hxx>
#include <basic/sbx.hxx>
+#include "sbdiagnose.hxx"
#include "sb.hxx"
#include <sbjsmeth.hxx>
#include "sbjsmod.hxx"
@@ -1178,6 +1179,10 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
GlobalRunDeInit();
+#ifdef DBG_UTIL
+ ResetCapturedAssertions();
+#endif
+
// VBA always ensures screenupdating is enabled after completing
if ( mbVBACompat )
VBAUnlockDocuments( PTR_CAST( StarBASIC, GetParent() ) );
diff --git a/basic/source/inc/sbdiagnose.hxx b/basic/source/inc/sbdiagnose.hxx
new file mode 100644
index 000000000000..065efdb183e1
--- /dev/null
+++ b/basic/source/inc/sbdiagnose.hxx
@@ -0,0 +1,34 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2011 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.
+ *
+ ************************************************************************/
+
+#ifndef BASIC_SBDIAGNOSE_HXX
+#define BASIC_SBDIAGNOSE_HXX
+
+#ifdef DBG_UTIL
+void ResetCapturedAssertions();
+#endif
+
+#endif // BASIC_SBDIAGNOSE_HXX
diff --git a/basic/source/runtime/dllmgr.cxx b/basic/source/runtime/dllmgr.cxx
index 8cc6ce7edd82..8baf819372ba 100644
--- a/basic/source/runtime/dllmgr.cxx
+++ b/basic/source/runtime/dllmgr.cxx
@@ -36,6 +36,7 @@
#include "basic/sbx.hxx"
#include "basic/sbxvar.hxx"
+#include "runtime.hxx"
#include "osl/thread.h"
#include "rtl/ref.hxx"
#include "rtl/string.hxx"
@@ -266,9 +267,15 @@ SbError marshal(
std::vector< char > & blob, std::size_t offset, MarshalData & data)
{
OSL_ASSERT(variable != 0);
- if ((variable->GetFlags() & SBX_REFERENCE) == 0) {
- if ((variable->GetType() & SbxARRAY) == 0) {
- switch (variable->GetType()) {
+
+ SbxDataType eVarType = variable->GetType();
+ bool bByVal = (variable->GetFlags() & SBX_REFERENCE) == 0;
+ if( !bByVal && !SbiRuntime::isVBAEnabled() && eVarType == SbxSTRING )
+ bByVal = true;
+
+ if (bByVal) {
+ if ((eVarType & SbxARRAY) == 0) {
+ switch (eVarType) {
case SbxINTEGER:
add(blob, variable->GetInteger(), outer ? 4 : 2, offset);
break;
@@ -317,8 +324,8 @@ SbError marshal(
}
}
} else {
- if ((variable->GetType() & SbxARRAY) == 0) {
- switch (variable->GetType()) {
+ if ((eVarType & SbxARRAY) == 0) {
+ switch (eVarType) {
case SbxINTEGER:
case SbxLONG:
case SbxSINGLE:
diff --git a/basic/source/runtime/makefile.mk b/basic/source/runtime/makefile.mk
index 8ca052aaae1a..329448c67e75 100644
--- a/basic/source/runtime/makefile.mk
+++ b/basic/source/runtime/makefile.mk
@@ -54,7 +54,8 @@ SLOFILES= \
$(SLO)$/methods1.obj \
$(SLO)$/props.obj \
$(SLO)$/ddectrl.obj \
- $(SLO)$/dllmgr.obj
+ $(SLO)$/dllmgr.obj \
+ $(SLO)$/sbdiagnose.obj
.IF "$(GUI)$(COM)$(CPU)" == "WNTMSCI"
SLOFILES+= $(SLO)$/wnt.obj
diff --git a/basic/source/runtime/rtlproto.hxx b/basic/source/runtime/rtlproto.hxx
index bb8687ee0db6..bba1867d3591 100644
--- a/basic/source/runtime/rtlproto.hxx
+++ b/basic/source/runtime/rtlproto.hxx
@@ -344,6 +344,7 @@ extern RTLFUNC(CDateToIso);
extern RTLFUNC(CDateFromIso);
extern RTLFUNC(CompatibilityMode);
extern RTLFUNC(CDec);
+extern RTLFUNC(CaptureAssertions);
extern RTLFUNC(Partition); // Fong
diff --git a/basic/source/runtime/sbdiagnose.cxx b/basic/source/runtime/sbdiagnose.cxx
new file mode 100644
index 000000000000..97bfb0a00814
--- /dev/null
+++ b/basic/source/runtime/sbdiagnose.cxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2011 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.
+ *
+ ************************************************************************/
+
+#include "precompiled_basic.hxx"
+
+#include "rtlproto.hxx"
+#include "sbdiagnose.hxx"
+
+#include "basic/sbstar.hxx"
+
+#include <tools/debug.hxx>
+#include <comphelper/flagguard.hxx>
+
+#ifdef DBG_UTIL
+
+static DbgChannelId nRestoreChannelId = 0;
+static DbgChannelId nAssertionChannelId = 0;
+static StarBASICRef xAssertionChannelBasic;
+static String sCaptureFunctionName;
+static bool bReportingAssertion = false;
+
+void ResetCapturedAssertions()
+{
+ if ( nRestoreChannelId != 0 )
+ {
+ DBG_INSTOUTERROR( nRestoreChannelId );
+ }
+ nRestoreChannelId = 0;
+ xAssertionChannelBasic = NULL;
+ sCaptureFunctionName = String();
+ bReportingAssertion = false;
+}
+
+void DbgReportAssertion( const sal_Char* i_assertionMessage )
+{
+ if ( !xAssertionChannelBasic )
+ {
+ ResetCapturedAssertions();
+ return;
+ }
+
+ // prevent infinite recursion
+ if ( bReportingAssertion )
+ return;
+ ::comphelper::FlagRestorationGuard aGuard( bReportingAssertion, true );
+
+ SbxArrayRef const xArguments( new SbxArray( SbxVARIANT ) );
+ SbxVariableRef const xMessageText = new SbxVariable( SbxSTRING );
+ xMessageText->PutString( String::CreateFromAscii( i_assertionMessage ) );
+ xArguments->Put( xMessageText, 1 );
+
+ ErrCode const nError = xAssertionChannelBasic->Call( sCaptureFunctionName, xArguments );
+ if ( ( nError & SbERR_METHOD_NOT_FOUND ) != 0 )
+ ResetCapturedAssertions();
+}
+
+#endif
+
+/// capture assertions, route them to the given given Basic function
+RTLFUNC(CaptureAssertions)
+{
+ (void)bWrite;
+
+ // need exactly one argument
+ if ( rPar.Count() != 2 )
+ {
+ StarBASIC::Error( SbERR_BAD_ARGUMENT );
+ return;
+ }
+
+#ifdef DBG_UTIL
+ DBG_TESTSOLARMUTEX();
+
+ String const sFunctionName = rPar.Get(1)->GetString();
+ if ( sFunctionName.Len() == 0 )
+ {
+ ResetCapturedAssertions();
+ return;
+ }
+
+ if ( nAssertionChannelId == 0 )
+ {
+ // TODO: should we register a named channel at the VCL API, instead of an unnamed channel at the tools API?
+ // A named channel would mean it would appear in the nonpro-debug-options dialog
+ nAssertionChannelId = DbgRegisterUserChannel( &DbgReportAssertion );
+ }
+
+ DbgChannelId const nCurrentChannelId = (DbgChannelId)DbgGetErrorOut();
+ if ( nCurrentChannelId != nAssertionChannelId )
+ {
+ // remember the current channel
+ nRestoreChannelId = nCurrentChannelId;
+
+ // set the new channel
+ DBG_INSTOUTERROR( nAssertionChannelId );
+
+ // ensure OSL assertions are captured, too
+ DbgData aData( *DbgGetData() );
+ aData.bHookOSLAssert = sal_True;
+ DbgUpdateOslHook( &aData );
+ }
+
+ xAssertionChannelBasic = pBasic;
+ sCaptureFunctionName = sFunctionName;
+#else
+ (void)pBasic;
+ (void)rPar;
+ (void)bWrite;
+#endif
+}
+
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index ecc0dfb3321b..92d8152e60f4 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -147,6 +147,8 @@ static Methods aMethods[] = {
{ "number", SbxDOUBLE, 0,NULL,0 },
{ "CreateObject", SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateObject ),0 },
{ "class", SbxSTRING, 0,NULL,0 },
+{ "CaptureAssertions", SbxNULL, 1 | _FUNCTION, RTLNAME(CaptureAssertions), 0 },
+ { "methodName", SbxSTRING, 0, NULL, 0 },
{ "CreateUnoListener",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateUnoListener ),0 },
{ "prefix", SbxSTRING, 0,NULL,0 },
{ "typename", SbxSTRING, 0,NULL,0 },
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 02b22a35b732..bbb3668b5b69 100755
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -521,7 +521,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
pPar->Put( NULL, 0 );
}
// Index-Access bei UnoObjekten beruecksichtigen
- else if( pElem->GetType() == SbxOBJECT && (!pElem->ISA(SbxMethod) || !pElem->IsBroadcaster()) )
+ else if( pElem->GetType() == SbxOBJECT && (!pElem->ISA(SbxMethod) || (bVBAEnabled && !pElem->IsBroadcaster()) ) )
{
pPar = pElem->GetParameters();
if ( pPar )
diff --git a/connectivity/inc/connectivity/predicateinput.hxx b/connectivity/inc/connectivity/predicateinput.hxx
index 5041fd30c060..2f4dfbbd3146 100644
--- a/connectivity/inc/connectivity/predicateinput.hxx
+++ b/connectivity/inc/connectivity/predicateinput.hxx
@@ -104,6 +104,12 @@ namespace dbtools
::rtl::OUString* _pErrorMessage = NULL
) const;
+ ::rtl::OUString getPredicateValue(
+ const ::rtl::OUString& _sField
+ , const ::rtl::OUString& _rPredicateValue
+ , sal_Bool _bForStatementUse
+ , ::rtl::OUString* _pErrorMessage = NULL) const;
+
private:
::connectivity::OSQLParseNode* implPredicateTree(
::rtl::OUString& _rErrorMessage,
@@ -116,6 +122,8 @@ namespace dbtools
sal_Unicode& _rDecSep,
sal_Unicode& _rThdSep
) const;
+
+ ::rtl::OUString implParseNode(::connectivity::OSQLParseNode* pParseNode,sal_Bool _bForStatementUse) const;
};
//.........................................................................
diff --git a/connectivity/inc/connectivity/sqlnode.hxx b/connectivity/inc/connectivity/sqlnode.hxx
index 04ec8dc153df..2fe688574a0a 100644
--- a/connectivity/inc/connectivity/sqlnode.hxx
+++ b/connectivity/inc/connectivity/sqlnode.hxx
@@ -65,6 +65,8 @@ namespace rtl
{
class OUStringBuffer;
}
+#define ORDER_BY_CHILD_POS 5
+#define TABLE_EXPRESSION_CHILD_COUNT 9
namespace connectivity
{
diff --git a/connectivity/qa/connectivity/tools/CRMDatabase.java b/connectivity/qa/connectivity/tools/CRMDatabase.java
index a1b457884948..f9b6d52a8038 100644
--- a/connectivity/qa/connectivity/tools/CRMDatabase.java
+++ b/connectivity/qa/connectivity/tools/CRMDatabase.java
@@ -224,6 +224,7 @@ public class CRMDatabase
// --------------------------------------------------------------------------------------------------------
private void validateUnparseable()
{
+ /*
// The "unparseable" query should be indeed be unparseable by OOo (though a valid HSQL query)
XSingleSelectQueryComposer composer;
QueryDefinition unparseableQuery;
@@ -253,6 +254,7 @@ public class CRMDatabase
if ( !caughtExpected )
throw new RuntimeException( "Somebody improved the parser! This is bad :), since we need an unparsable query here!" );
+ */
}
// --------------------------------------------------------------------------------------------------------
@@ -284,9 +286,10 @@ public class CRMDatabase
m_database.getDataSource().createQuery( "parseable", "SELECT * FROM \"customers\"" );
m_database.getDataSource().createQuery( "parseable native", "SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VIEWS", false );
+/*
m_database.getDataSource().createQuery( "unparseable",
"SELECT {fn DAYOFMONTH ('2001-01-01')} AS \"ID_VARCHAR\" FROM \"products\"", false );
-
+*/
validateUnparseable();
}
}
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 95aabb821b1a..6f65547736d9 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -787,12 +787,30 @@ sal_Bool operator==(const DateTime& _rLH,const DateTime& _rRH)
bool ORowSetValue::operator==(const ORowSetValue& _rRH) const
{
- if(m_eTypeKind != _rRH.m_eTypeKind)
- return false;
- if ( m_bSigned != _rRH.m_bSigned )
- return false;
- if(m_bNull != _rRH.isNull())
+ if ( m_eTypeKind != _rRH.m_eTypeKind )
+ {
+ switch(m_eTypeKind)
+ {
+ case DataType::FLOAT:
+ case DataType::DOUBLE:
+ case DataType::REAL:
+ return getDouble() == _rRH.getDouble();
+ default:
+ switch(_rRH.m_eTypeKind)
+ {
+ case DataType::FLOAT:
+ case DataType::DOUBLE:
+ case DataType::REAL:
+ return getDouble() == _rRH.getDouble();
+ default:
+ break;
+ }
+ break;
+ }
return false;
+ }
+ if ( m_bNull != _rRH.isNull() )
+ return false;
if(m_bNull && _rRH.isNull())
return true;
@@ -802,16 +820,28 @@ bool ORowSetValue::operator==(const ORowSetValue& _rRH) const
{
case DataType::VARCHAR:
case DataType::CHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
case DataType::LONGVARCHAR:
{
::rtl::OUString aVal1(m_aValue.m_pString);
::rtl::OUString aVal2(_rRH.m_aValue.m_pString);
- bRet = aVal1 == aVal2;
- break;
+ return aVal1 == aVal2;
}
+ default:
+ if ( m_bSigned != _rRH.m_bSigned )
+ return false;
+ break;
+ }
+ switch(m_eTypeKind)
+ {
+ case DataType::DECIMAL:
+ case DataType::NUMERIC:
+ {
+ ::rtl::OUString aVal1(m_aValue.m_pString);
+ ::rtl::OUString aVal2(_rRH.m_aValue.m_pString);
+ bRet = aVal1 == aVal2;
+ }
+ break;
case DataType::FLOAT:
bRet = *(float*)m_aValue.m_pValue == *(float*)_rRH.m_aValue.m_pValue;
break;
diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx
index 8ffebb0cfbda..dbac44b72424 100644
--- a/connectivity/source/commontools/predicateinput.cxx
+++ b/connectivity/source/commontools/predicateinput.cxx
@@ -31,8 +31,10 @@
#include <comphelper/types.hxx>
#include <connectivity/dbtools.hxx>
#include <com/sun/star/sdbc/DataType.hpp>
+#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <osl/diagnose.h>
#include <connectivity/sqlnode.hxx>
+#include <connectivity/PColumn.hxx>
#include <comphelper/numbers.hxx>
//.........................................................................
@@ -325,63 +327,117 @@ namespace dbtools
::rtl::OUString sError;
OSQLParseNode* pParseNode = implPredicateTree( sError, sValue, _rxField );
- if ( _pErrorMessage ) *_pErrorMessage = sError;
+ if ( _pErrorMessage )
+ *_pErrorMessage = sError;
- if ( pParseNode )
+ sReturn = implParseNode(pParseNode,_bForStatementUse);
+ }
+
+ return sReturn;
+ }
+
+ ::rtl::OUString OPredicateInputController::getPredicateValue(
+ const ::rtl::OUString& _sField, const ::rtl::OUString& _rPredicateValue, sal_Bool _bForStatementUse, ::rtl::OUString* _pErrorMessage ) const
+ {
+ ::rtl::OUString sReturn = _rPredicateValue;
+ ::rtl::OUString sError;
+ ::rtl::OUString sField = _sField;
+ sal_Int32 nIndex = 0;
+ sField = sField.getToken(0,'(',nIndex);
+ if(nIndex == -1)
+ sField = _sField;
+ sal_Int32 nType = ::connectivity::OSQLParser::getFunctionReturnType(sField,&m_aParser.getContext());
+ if ( nType == DataType::OTHER || !sField.getLength() )
+ {
+ // first try the international version
+ ::rtl::OUString sSql;
+ sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT * "));
+ sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FROM x WHERE "));
+ sSql += sField;
+ sSql += _rPredicateValue;
+ ::std::auto_ptr<OSQLParseNode> pParseNode( const_cast< OSQLParser& >( m_aParser ).parseTree( sError, sSql, sal_True ) );
+ nType = DataType::DOUBLE;
+ if ( pParseNode.get() )
{
- OSQLParseNode* pOdbcSpec = pParseNode->getByRule( OSQLParseNode::odbc_fct_spec );
- if ( pOdbcSpec )
+ OSQLParseNode* pColumnRef = pParseNode->getByRule(OSQLParseNode::column_ref);
+ if ( pColumnRef )
{
- if ( !_bForStatementUse )
- {
- if ( ( pOdbcSpec->count() >= 2 )
- && ( SQL_NODE_STRING == pOdbcSpec->getChild(1)->getNodeType() )
- )
- {
+ }
+ }
+ }
- sReturn = pOdbcSpec->getChild(1)->getTokenValue();
- }
- else
- OSL_ENSURE( sal_False, "OPredicateInputController::getPredicateValue: unknown/invalid structure (odbc + param use)!" );
- }
- else
- {
- OSQLParseNode* pFuncSpecParent = pOdbcSpec->getParent();
- OSL_ENSURE( pFuncSpecParent, "OPredicateInputController::getPredicateValue: an ODBC func spec node without parent?" );
- if ( pFuncSpecParent )
- pFuncSpecParent->parseNodeToStr(
- sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True
- );
- }
+ Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
+ parse::OParseColumn* pColumn = new parse::OParseColumn( sField,
+ ::rtl::OUString(),
+ ::rtl::OUString(),
+ ::rtl::OUString(),
+ ColumnValue::NULLABLE_UNKNOWN,
+ 0,
+ 0,
+ nType,
+ sal_False,
+ sal_False,
+ xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers());
+ Reference<XPropertySet> xColumn = pColumn;
+ pColumn->setFunction(sal_True);
+ pColumn->setRealName(sField);
+
+ OSQLParseNode* pParseNode = implPredicateTree( sError, _rPredicateValue, xColumn );
+ if ( _pErrorMessage )
+ *_pErrorMessage = sError;
+ return pParseNode ? implParseNode(pParseNode,_bForStatementUse) : sReturn;
+ }
+
+ ::rtl::OUString OPredicateInputController::implParseNode(OSQLParseNode* pParseNode,sal_Bool _bForStatementUse) const
+ {
+ ::rtl::OUString sReturn;
+ if ( pParseNode )
+ {
+ ::std::auto_ptr<OSQLParseNode> pTemp(pParseNode);
+ OSQLParseNode* pOdbcSpec = pParseNode->getByRule( OSQLParseNode::odbc_fct_spec );
+ if ( pOdbcSpec )
+ {
+ if ( _bForStatementUse )
+ {
+ OSQLParseNode* pFuncSpecParent = pOdbcSpec->getParent();
+ OSL_ENSURE( pFuncSpecParent, "OPredicateInputController::getPredicateValue: an ODBC func spec node without parent?" );
+ if ( pFuncSpecParent )
+ pFuncSpecParent->parseNodeToStr(sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True);
}
else
{
- if ( pParseNode->count() >= 3 )
+ OSQLParseNode* pValueNode = pOdbcSpec->getChild(1);
+ if ( SQL_NODE_STRING == pValueNode->getNodeType() )
+ sReturn = pValueNode->getTokenValue();
+ else
+ pValueNode->parseNodeToStr(sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True);
+ // sReturn = pOdbcSpec->getChild(1)->getTokenValue();
+ }
+ }
+ else
+ {
+ if ( pParseNode->count() >= 3 )
+ {
+ OSQLParseNode* pValueNode = pParseNode->getChild(2);
+ OSL_ENSURE( pValueNode, "OPredicateInputController::getPredicateValue: invalid node child!" );
+ if ( !_bForStatementUse )
{
- OSQLParseNode* pValueNode = pParseNode->getChild(2);
- OSL_ENSURE( pValueNode, "OPredicateInputController::getPredicateValue: invalid node child!" );
- if ( !_bForStatementUse )
- {
- if ( SQL_NODE_STRING == pValueNode->getNodeType() )
- sReturn = pValueNode->getTokenValue();
- else
- pValueNode->parseNodeToStr(
- sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True
- );
- }
+ if ( SQL_NODE_STRING == pValueNode->getNodeType() )
+ sReturn = pValueNode->getTokenValue();
else
pValueNode->parseNodeToStr(
sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True
);
}
else
- OSL_ENSURE( sal_False, "OPredicateInputController::getPredicateValue: unknown/invalid structure (noodbc)!" );
+ pValueNode->parseNodeToStr(
+ sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True
+ );
}
-
- delete pParseNode;
+ else
+ OSL_ENSURE( sal_False, "OPredicateInputController::getPredicateValue: unknown/invalid structure (noodbc)!" );
}
}
-
return sReturn;
}
//.........................................................................
diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx
index aa287c185b26..510c2790e777 100644
--- a/connectivity/source/drivers/ado/AColumn.cxx
+++ b/connectivity/source/drivers/ado/AColumn.cxx
@@ -165,7 +165,8 @@ void OAdoColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& r
{
sal_Int32 nVal=0;
rValue >>= nVal;
- m_aColumn.put_NumericScale((sal_Int8)nVal);
+ if ( !m_IsCurrency )
+ m_aColumn.put_NumericScale((sal_Int8)nVal);
}
break;
case PROPERTY_ID_ISNULLABLE:
@@ -212,6 +213,8 @@ void OAdoColumn::fillPropertyValues()
DataTypeEnum eType = m_aColumn.get_Type();
m_IsCurrency = (eType == adCurrency);
+ if ( m_IsCurrency && !m_Scale)
+ m_Scale = 4;
m_Type = ADOS::MapADOType2Jdbc(eType);
sal_Bool bForceTo = sal_True;
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx
index a7e2ec4df490..6596b9b8d946 100644
--- a/connectivity/source/drivers/ado/AConnection.cxx
+++ b/connectivity/source/drivers/ado/AConnection.cxx
@@ -466,6 +466,11 @@ void OConnection::buildTypeInfo() throw( SQLException)
aInfo->aSimpleType.aLocalTypeName = ADOS::getField(pRecordset,nPos++).get_Value();
aInfo->aSimpleType.nMinimumScale = ADOS::getField(pRecordset,nPos++).get_Value();
aInfo->aSimpleType.nMaximumScale = ADOS::getField(pRecordset,nPos++).get_Value();
+ if ( adCurrency == aInfo->eType && !aInfo->aSimpleType.nMaximumScale)
+ {
+ aInfo->aSimpleType.nMinimumScale = 4;
+ aInfo->aSimpleType.nMaximumScale = 4;
+ }
aInfo->aSimpleType.nNumPrecRadix = ADOS::getField(pRecordset,nPos++).get_Value();
// Now that we have the type info, save it
// in the Hashtable if we don't already have an
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index 4ea918ef3e27..9a303d1f1d27 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -99,7 +99,7 @@ void OPredicateCompiler::start(OSQLParseNode* pSQLParseNode)
OSQLParseNode * pTableExp = pSQLParseNode->getChild(3);
DBG_ASSERT(pTableExp != NULL,"Fehler im Parse Tree");
DBG_ASSERT(SQL_ISRULE(pTableExp,table_exp)," Fehler im Parse Tree");
- DBG_ASSERT(pTableExp->count() == 5,"Fehler im Parse Tree");
+ DBG_ASSERT(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"Fehler im Parse Tree");
// check that we don't use anything other than count(*) as function
OSQLParseNode* pSelection = pSQLParseNode->getChild(2);
@@ -117,7 +117,7 @@ void OPredicateCompiler::start(OSQLParseNode* pSQLParseNode)
pWhereClause = pTableExp->getChild(1);
- pOrderbyClause = pTableExp->getChild(4);
+ pOrderbyClause = pTableExp->getChild(ORDER_BY_CHILD_POS);
}
else if (SQL_ISRULE(pSQLParseNode,update_statement_searched))
{
diff --git a/connectivity/source/drivers/macab/MacabRecord.cxx b/connectivity/source/drivers/macab/MacabRecord.cxx
index 35817526ff17..e161ece74522 100755
--- a/connectivity/source/drivers/macab/MacabRecord.cxx
+++ b/connectivity/source/drivers/macab/MacabRecord.cxx
@@ -202,7 +202,7 @@ sal_Int32 MacabRecord::compareFields(const macabfield *_field1, const macabfield
result = CFStringCompare(
(CFStringRef) _field1->value,
(CFStringRef) _field2->value,
- 0); // 0 = no options (like ignore case)
+ kCFCompareLocalized); // Specifies that the comparison should take into account differences related to locale, such as the thousands separator character.
break;
case kABDateProperty:
diff --git a/connectivity/source/parse/PColumn.cxx b/connectivity/source/parse/PColumn.cxx
index 10f4b5b4bdcf..8f3014908b10 100644
--- a/connectivity/source/parse/PColumn.cxx
+++ b/connectivity/source/parse/PColumn.cxx
@@ -155,13 +155,15 @@ OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSe
_rxResMetaData->isCurrency( _nColumnPos ),
_rxDBMetaData->supportsMixedCaseQuotedIdentifiers()
);
- pColumn->setTableName( ::dbtools::composeTableName( _rxDBMetaData,
- _rxResMetaData->getCatalogName( _nColumnPos ),
- _rxResMetaData->getSchemaName( _nColumnPos ),
- _rxResMetaData->getTableName( _nColumnPos ),
- sal_False,
- eComplete
- ) );
+ const ::rtl::OUString sTableName = _rxResMetaData->getTableName( _nColumnPos );
+ if ( sTableName.getLength() )
+ pColumn->setTableName( ::dbtools::composeTableName( _rxDBMetaData,
+ _rxResMetaData->getCatalogName( _nColumnPos ),
+ _rxResMetaData->getSchemaName( _nColumnPos ),
+ sTableName,
+ sal_False,
+ eComplete
+ ) );
pColumn->setIsSearchable( _rxResMetaData->isSearchable( _nColumnPos ) );
pColumn->setRealName(_rxResMetaData->getColumnName( _nColumnPos ));
pColumn->setLabel(sLabel);
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index 9709d33fdf76..ad271e855e20 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -217,6 +217,14 @@ using namespace connectivity;
%token <pParseNode> SQL_TOKEN_VALUE SQL_TOKEN_CURRENT_CATALOG SQL_TOKEN_CURRENT_DEFAULT_TRANSFORM_GROUP SQL_TOKEN_CURRENT_PATH SQL_TOKEN_CURRENT_ROLE SQL_TOKEN_CURRENT_SCHEMA SQL_TOKEN_CURRENT_USER
%token <pParseNode> SQL_TOKEN_SESSION_USER SQL_TOKEN_SYSTEM_USER SQL_TOKEN_VARCHAR SQL_TOKEN_VARBINARY SQL_TOKEN_VARYING SQL_TOKEN_OBJECT SQL_TOKEN_NCLOB SQL_TOKEN_NATIONAL
%token <pParseNode> SQL_TOKEN_LARGE SQL_TOKEN_CLOB SQL_TOKEN_BLOB SQL_TOKEN_BIGINT SQL_TOKEN_BINARY SQL_TOKEN_WITHOUT SQL_TOKEN_BOOLEAN SQL_TOKEN_INTERVAL
+// window function
+%token <pParseNode> SQL_TOKEN_OVER SQL_TOKEN_ROW_NUMBER SQL_TOKEN_NTILE SQL_TOKEN_LEAD SQL_TOKEN_LAG SQL_TOKEN_RESPECT SQL_TOKEN_IGNORE SQL_TOKEN_NULLS
+%token <pParseNode> SQL_TOKEN_FIRST_VALUE SQL_TOKEN_LAST_VALUE SQL_TOKEN_NTH_VALUE SQL_TOKEN_FIRST SQL_TOKEN_LAST
+%token <pParseNode> SQL_TOKEN_EXCLUDE SQL_TOKEN_OTHERS SQL_TOKEN_TIES SQL_TOKEN_FOLLOWING SQL_TOKEN_UNBOUNDED SQL_TOKEN_PRECEDING SQL_TOKEN_RANGE SQL_TOKEN_ROWS
+%token <pParseNode> SQL_TOKEN_PARTITION SQL_TOKEN_WINDOW SQL_TOKEN_NO
+// LIMIT and OFFSEt
+%token <pParseNode> SQL_TOKEN_LIMIT SQL_TOKEN_OFFSET SQL_TOKEN_NEXT SQL_TOKEN_ONLY
+
/* operators */
%left SQL_TOKEN_NAME
%left <pParseNode> SQL_TOKEN_OR
@@ -271,7 +279,7 @@ using namespace connectivity;
%type <pParseNode> form_conversion char_translation trim_fct trim_operands trim_spec bit_value_fct bit_substring_fct op_column_commalist
%type <pParseNode> /*bit_concatenation*/ bit_value_exp bit_factor bit_primary collate_clause char_value_fct unique_spec value_exp_commalist in_predicate_value unique_test update_source
%type <pParseNode> function_arg_commalist3 string_function_3Argument function_arg_commalist4 string_function_4Argument function_arg_commalist2 string_function_1Argument string_function_2Argument
-%type <pParseNode> date_function_0Argument date_function_1Argument function_name12 function_name23 function_name1 function_name2 function_name3 function_name0 numeric_function_0Argument numeric_function_1Argument numeric_function_2Argument date_function_3Argument
+%type <pParseNode> date_function_0Argument date_function_1Argument function_name12 function_name23 function_name1 function_name2 function_name3 function_name0 numeric_function_0Argument numeric_function_1Argument numeric_function_2Argument
%type <pParseNode> all query_primary sql_not for_length upper_lower comparison column_val cross_union /*opt_schema_element_list*/
%type <pParseNode> /*op_authorization op_schema*/ nil_fkt schema_element base_table_def base_table_element base_table_element_commalist
%type <pParseNode> column_def odbc_fct_spec odbc_call_spec odbc_fct_type op_parameter union_statement
@@ -286,6 +294,16 @@ using namespace connectivity;
%type <pParseNode> binary_string_type numeric_type boolean_type datetime_type interval_type opt_paren_precision paren_char_length opt_paren_char_large_length paren_character_large_object_length
%type <pParseNode> large_object_length opt_multiplier character_large_object_type national_character_large_object_type binary_large_object_string_type opt_with_or_without_time_zone
%type <pParseNode> approximate_numeric_type exact_numeric_type opt_paren_precision_scale
+/* window function rules */
+%type <pParseNode> window_function window_function_type ntile_function number_of_tiles lead_or_lag_function lead_or_lag lead_or_lag_extent offset default_expression null_treatment
+%type <pParseNode> first_or_last_value_function first_or_last_value nth_value_function nth_row from_first_or_last window_name_or_specification in_line_window_specification opt_lead_or_lag_function
+%type <pParseNode> opt_null_treatment opt_from_first_or_last simple_value_specification dynamic_parameter_specification window_name window_clause window_definition_list window_definition
+%type <pParseNode> new_window_name window_specification_details existing_window_name window_partition_clause window_partition_column_reference_list window_partition_column_reference window_frame_clause
+%type <pParseNode> window_frame_units window_frame_extent window_frame_start window_frame_preceding window_frame_between window_frame_bound_1 window_frame_bound_2 window_frame_bound window_frame_following window_frame_exclusion
+%type <pParseNode> opt_window_frame_clause opt_window_partition_clause opt_existing_window_name window_specification opt_window_frame_exclusion opt_window_clause opt_offset
+%type <pParseNode> opt_fetch_first_row_count fetch_first_clause offset_row_count fetch_first_row_count first_or_next row_or_rows opt_result_offset_clause result_offset_clause
+/* LIMIT and OFFSET */
+%type <pParseNode> opt_limit_offset_clause limit_offset_clause opt_fetch_first_clause
%%
/* Parse Tree an OSQLParser zurueckliefern
@@ -920,19 +938,89 @@ selection:
}
| scalar_exp_commalist
;
+opt_result_offset_clause:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | result_offset_clause
+ ;
+result_offset_clause:
+ SQL_TOKEN_OFFSET offset_row_count row_or_rows
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
+opt_fetch_first_row_count:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | fetch_first_row_count
+ ;
+first_or_next:
+ SQL_TOKEN_FIRST
+ | SQL_TOKEN_NEXT
+ ;
+row_or_rows:
+ SQL_TOKEN_ROW
+ | SQL_TOKEN_ROWS
+ ;
+opt_fetch_first_clause:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | fetch_first_clause
+ ;
+fetch_first_clause:
+ SQL_TOKEN_FETCH first_or_next opt_fetch_first_row_count row_or_rows SQL_TOKEN_ONLY
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ $$->append($5);
+ }
+ ;
+offset_row_count:
+ literal
+ ;
+fetch_first_row_count:
+ literal
+ ;
+opt_limit_offset_clause:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | limit_offset_clause
+ ;
+opt_offset:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | SQL_TOKEN_OFFSET SQL_TOKEN_INTNUM
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+limit_offset_clause:
+ SQL_TOKEN_LIMIT SQL_TOKEN_INTNUM opt_offset
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
table_exp:
- from_clause
- opt_where_clause
- opt_group_by_clause
- opt_having_clause
- opt_order_by_clause
- {$$ = SQL_NEW_RULE;
+ from_clause opt_where_clause opt_group_by_clause opt_having_clause opt_window_clause opt_order_by_clause opt_limit_offset_clause opt_result_offset_clause opt_fetch_first_clause
+ {
+ $$ = SQL_NEW_RULE;
$$->append($1);
$$->append($2);
$$->append($3);
$$->append($4);
- $$->append($5);}
+ $$->append($5);
+ $$->append($6);
+ $$->append($7);
+ $$->append($8);
+ $$->append($9);
+ }
;
from_clause:
@@ -1851,10 +1939,10 @@ function_name12:
;
function_name23:
SQL_TOKEN_LOCATE
+ | SQL_TOKEN_DATEDIFF
;
function_name3:
string_function_3Argument
- | date_function_3Argument
;
function_name:
string_function
@@ -1912,8 +2000,6 @@ date_function_1Argument:
| SQL_TOKEN_TIMEVALUE
| SQL_TOKEN_DATEVALUE
;
-date_function_3Argument:
- SQL_TOKEN_DATEDIFF
date_function:
SQL_TOKEN_TIMESTAMPADD
@@ -1951,6 +2037,362 @@ numeric_function:
SQL_TOKEN_RAND
| SQL_TOKEN_TRUNCATE
;
+
+window_function:
+ window_function_type SQL_TOKEN_OVER window_name_or_specification
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
+window_function_type :
+ rank_function_type '(' ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ | SQL_TOKEN_ROW_NUMBER '(' ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ | general_set_fct
+ | ntile_function
+ | lead_or_lag_function
+ | first_or_last_value_function
+ | nth_value_function
+;
+ntile_function :
+ SQL_TOKEN_NTILE '(' number_of_tiles ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ ;
+dynamic_parameter_specification:
+ parameter
+ ;
+simple_value_specification:
+ literal
+ ;
+number_of_tiles :
+ simple_value_specification
+ | dynamic_parameter_specification
+ ;
+opt_lead_or_lag_function:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | ',' offset
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode(",", SQL_NODE_PUNCTUATION));
+ $$->append($2);
+ }
+ | ',' offset ',' default_expression
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode(",", SQL_NODE_PUNCTUATION));
+ $$->append($2);
+ $$->append($3 = newNode(",", SQL_NODE_PUNCTUATION));
+ $$->append($4);
+ }
+ ;
+opt_null_treatment:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | null_treatment
+ ;
+
+lead_or_lag_function:
+ lead_or_lag '(' lead_or_lag_extent opt_lead_or_lag_function ')' opt_null_treatment
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4);
+ $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
+ $$->append($6);
+ }
+ ;
+lead_or_lag:
+ SQL_TOKEN_LEAD
+ | SQL_TOKEN_LAG
+ ;
+lead_or_lag_extent:
+ value_exp
+ ;
+offset:
+ SQL_TOKEN_INTNUM
+ ;
+default_expression:
+ value_exp
+ ;
+null_treatment:
+ SQL_TOKEN_RESPECT SQL_TOKEN_NULLS
+ | SQL_TOKEN_IGNORE SQL_TOKEN_NULLS
+ ;
+first_or_last_value_function:
+ first_or_last_value '(' value_exp ')' opt_null_treatment
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+ $$->append($5);
+ }
+ ;
+first_or_last_value :
+ SQL_TOKEN_FIRST_VALUE
+ | SQL_TOKEN_LAST_VALUE
+ ;
+opt_from_first_or_last:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | from_first_or_last
+ ;
+nth_value_function:
+ SQL_TOKEN_NTH_VALUE '(' value_exp ',' nth_row ')' opt_from_first_or_last opt_null_treatment
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4 = newNode(",", SQL_NODE_PUNCTUATION));
+ $$->append($5);
+ $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
+ $$->append($7);
+ $$->append($8);
+ }
+ ;
+nth_row:
+ simple_value_specification
+ | dynamic_parameter_specification
+ ;
+from_first_or_last:
+ SQL_TOKEN_FROM SQL_TOKEN_FIRST
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | SQL_TOKEN_FROM SQL_TOKEN_LAST
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+window_name:
+ SQL_TOKEN_NAME
+ ;
+window_name_or_specification:
+ window_name
+ | in_line_window_specification
+ ;
+in_line_window_specification:
+ window_specification
+ ;
+opt_window_clause:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | window_clause
+ ;
+window_clause:
+ SQL_TOKEN_WINDOW window_definition_list
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+window_definition_list:
+ window_definition_list ',' window_definition
+ {$1->append($3);
+ $$ = $1;}
+ | window_definition
+ {$$ = SQL_NEW_COMMALISTRULE;
+ $$->append($1);}
+ ;
+window_definition:
+ new_window_name SQL_TOKEN_AS window_specification
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
+new_window_name:
+ window_name
+ ;
+window_specification:
+ '(' window_specification_details ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
+ $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ ;
+opt_existing_window_name:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | existing_window_name
+ ;
+opt_window_partition_clause:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | window_partition_clause
+ ;
+opt_window_frame_clause:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | window_frame_clause
+ ;
+window_specification_details:
+ opt_existing_window_name
+ opt_window_partition_clause
+ opt_order_by_clause
+ opt_window_frame_clause
+ ;
+existing_window_name:
+ window_name
+ ;
+window_partition_clause:
+ SQL_TOKEN_PARTITION SQL_TOKEN_BY window_partition_column_reference_list
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
+window_partition_column_reference_list:
+ window_partition_column_reference_list ',' window_partition_column_reference
+ {$1->append($3);
+ $$ = $1;}
+ | window_partition_column_reference
+ {$$ = SQL_NEW_COMMALISTRULE;
+ $$->append($1);}
+ ;
+window_partition_column_reference:
+ column_ref opt_collate_clause
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+opt_window_frame_exclusion:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | window_frame_exclusion
+ ;
+window_frame_clause:
+ window_frame_units window_frame_extent opt_window_frame_exclusion
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
+window_frame_units:
+ SQL_TOKEN_ROWS
+ | SQL_TOKEN_RANGE
+ ;
+window_frame_extent:
+ window_frame_start
+ | window_frame_between
+ ;
+window_frame_start:
+ SQL_TOKEN_UNBOUNDED SQL_TOKEN_PRECEDING
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | window_frame_preceding
+ | SQL_TOKEN_CURRENT SQL_TOKEN_ROW
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+window_frame_preceding:
+ unsigned_value_spec SQL_TOKEN_PRECEDING
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+window_frame_between:
+ SQL_TOKEN_BETWEEN window_frame_bound_1 SQL_TOKEN_AND window_frame_bound_2
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ ;
+window_frame_bound_1:
+ window_frame_bound
+ ;
+window_frame_bound_2:
+ window_frame_bound
+ ;
+window_frame_bound:
+ window_frame_start
+ | SQL_TOKEN_UNBOUNDED SQL_TOKEN_FOLLOWING
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | window_frame_following
+ ;
+window_frame_following:
+ unsigned_value_spec SQL_TOKEN_FOLLOWING
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+window_frame_exclusion:
+ SQL_TOKEN_EXCLUDE SQL_TOKEN_CURRENT SQL_TOKEN_ROW
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ | SQL_TOKEN_EXCLUDE SQL_TOKEN_GROUP
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | SQL_TOKEN_EXCLUDE SQL_TOKEN_TIES
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | SQL_TOKEN_EXCLUDE SQL_TOKEN_NO SQL_TOKEN_OTHERS
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
op_parameter:
{$$ = SQL_NEW_RULE;}
| '?' SQL_EQUAL
@@ -2005,11 +2447,16 @@ odbc_fct_spec:
$$->append($1);
$$->append($2);
}
+ | SQL_TOKEN_FN set_fct_spec
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
;
odbc_fct_type:
- SQL_TOKEN_FN
- | SQL_TOKEN_D
+ SQL_TOKEN_D
| SQL_TOKEN_T
| SQL_TOKEN_TS
;
@@ -2315,6 +2762,7 @@ value_exp_primary:
| set_fct_spec
| scalar_subquery
| case_expression
+ | window_function
| '(' value_exp ')'
{
$$ = SQL_NEW_RULE;
diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
index c6723dfd6869..35a9278a8e49 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -212,15 +212,19 @@ END {SQL_NEW_KEYWORD(SQL_TOKEN_END); }
EVERY {SQL_NEW_KEYWORD(SQL_TOKEN_EVERY); }
ESCAPE {SQL_NEW_KEYWORD(SQL_TOKEN_ESCAPE); }
EXCEPT {SQL_NEW_KEYWORD(SQL_TOKEN_EXCEPT); }
+EXCLUDE {SQL_NEW_KEYWORD(SQL_TOKEN_EXCLUDE); }
EXISTS {SQL_NEW_KEYWORD(SQL_TOKEN_EXISTS); }
EXP {SQL_NEW_KEYWORD(SQL_TOKEN_EXP); }
EXTRACT {SQL_NEW_KEYWORD(SQL_TOKEN_EXTRACT); }
FALSE {SQL_NEW_KEYWORD(SQL_TOKEN_FALSE); }
FETCH {SQL_NEW_KEYWORD(SQL_TOKEN_FETCH); }
+FIRST {SQL_NEW_KEYWORD(SQL_TOKEN_FIRST); }
+FIRST_VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_FIRST_VALUE); }
FLOAT {SQL_NEW_KEYWORD(SQL_TOKEN_FLOAT); }
FLOOR {SQL_NEW_KEYWORD(SQL_TOKEN_FLOOR); }
FN {SQL_NEW_KEYWORD(SQL_TOKEN_FN); }
+FOLLOWING {SQL_NEW_KEYWORD(SQL_TOKEN_FOLLOWING); }
FOR {SQL_NEW_KEYWORD(SQL_TOKEN_FOR); }
FOREIGN {SQL_NEW_KEYWORD(SQL_TOKEN_FOREIGN); }
FOUND {SQL_NEW_KEYWORD(SQL_TOKEN_FOUND); }
@@ -234,6 +238,7 @@ GROUP {SQL_NEW_KEYWORD(SQL_TOKEN_GROUP); }
HAVING {SQL_NEW_KEYWORD(SQL_TOKEN_HAVING); }
HOUR {SQL_NEW_KEYWORD(SQL_TOKEN_HOUR); }
+IGNORE {SQL_NEW_KEYWORD(SQL_TOKEN_IGNORE); }
IN {SQL_NEW_KEYWORD(SQL_TOKEN_IN); }
INNER {SQL_NEW_KEYWORD(SQL_TOKEN_INNER); }
INSERT {SQL_NEW_KEYWORD(SQL_TOKEN_INSERT); }
@@ -249,12 +254,17 @@ JOIN {SQL_NEW_KEYWORD(SQL_TOKEN_JOIN); }
KEY {SQL_NEW_KEYWORD(SQL_TOKEN_KEY); }
+LAG {SQL_NEW_KEYWORD(SQL_TOKEN_LAG); }
LARGE {SQL_NEW_KEYWORD(SQL_TOKEN_LARGE); }
+LAST {SQL_NEW_KEYWORD(SQL_TOKEN_LAST); }
+LAST_VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_LAST_VALUE); }
LCASE {SQL_NEW_KEYWORD(SQL_TOKEN_LCASE); }
+LEAD {SQL_NEW_KEYWORD(SQL_TOKEN_LEAD); }
LEADING {SQL_NEW_KEYWORD(SQL_TOKEN_LEADING); }
LEFT {SQL_NEW_KEYWORD(SQL_TOKEN_LEFT); }
LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_LENGTH); }
LIKE {SQL_NEW_KEYWORD(SQL_TOKEN_LIKE); }
+LIMIT {SQL_NEW_KEYWORD(SQL_TOKEN_LIMIT); }
LN {SQL_NEW_KEYWORD(SQL_TOKEN_LN); }
LOCAL {SQL_NEW_KEYWORD(SQL_TOKEN_LOCAL); }
LOCATE {SQL_NEW_KEYWORD(SQL_TOKEN_LOCATE); }
@@ -276,29 +286,40 @@ NATURAL {SQL_NEW_KEYWORD(SQL_TOKEN_NATURAL); }
NCHAR {SQL_NEW_KEYWORD(SQL_TOKEN_NCHAR); }
NCLOB {SQL_NEW_KEYWORD(SQL_TOKEN_NCLOB); }
NEW {SQL_NEW_KEYWORD(SQL_TOKEN_NEW); }
+NEXT {SQL_NEW_KEYWORD(SQL_TOKEN_NEXT); }
+NO {SQL_NEW_KEYWORD(SQL_TOKEN_NO); }
NOT {SQL_NEW_KEYWORD(SQL_TOKEN_NOT); }
NOW {SQL_NEW_KEYWORD(SQL_TOKEN_NOW); }
+NTH_VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_NTH_VALUE); }
+NTILE {SQL_NEW_KEYWORD(SQL_TOKEN_NTILE); }
NULL {SQL_NEW_KEYWORD(SQL_TOKEN_NULL); }
NULLIF {SQL_NEW_KEYWORD(SQL_TOKEN_NULLIF); }
+NULLS {SQL_NEW_KEYWORD(SQL_TOKEN_NULLS); }
NUMERIC {SQL_NEW_KEYWORD(SQL_TOKEN_NUMERIC); }
OBJECT {SQL_NEW_KEYWORD(SQL_TOKEN_OBJECT); }
OCTET_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_OCTET_LENGTH); }
OF {SQL_NEW_KEYWORD(SQL_TOKEN_OF); }
+OFFSET {SQL_NEW_KEYWORD(SQL_TOKEN_OFFSET); }
OJ {SQL_NEW_KEYWORD(SQL_TOKEN_OJ); }
OLD {SQL_NEW_KEYWORD(SQL_TOKEN_OLD); }
ON {SQL_NEW_KEYWORD(SQL_TOKEN_ON); }
+ONLY {SQL_NEW_KEYWORD(SQL_TOKEN_ONLY); }
OPTION {SQL_NEW_KEYWORD(SQL_TOKEN_OPTION); }
OR {SQL_NEW_KEYWORD(SQL_TOKEN_OR); }
ORDER {SQL_NEW_KEYWORD(SQL_TOKEN_ORDER); }
+OTHERS {SQL_NEW_KEYWORD(SQL_TOKEN_OTHERS); }
OUTER {SQL_NEW_KEYWORD(SQL_TOKEN_OUTER); }
+OVER {SQL_NEW_KEYWORD(SQL_TOKEN_OVER); }
+PARTITION {SQL_NEW_KEYWORD(SQL_TOKEN_PARTITION); }
PERCENT_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENT_RANK); }
PERCENTILE_CONT {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENTILE_CONT); }
PERCENTILE_DISC {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENTILE_DISC); }
PI {SQL_NEW_KEYWORD(SQL_TOKEN_PI); }
POSITION {SQL_NEW_KEYWORD(SQL_TOKEN_POSITION); }
POWER {SQL_NEW_KEYWORD(SQL_TOKEN_POWER); }
+PRECEDING {SQL_NEW_KEYWORD(SQL_TOKEN_PRECEDING); }
PRECISION {SQL_NEW_KEYWORD(SQL_TOKEN_PRECISION); }
PRIMARY {SQL_NEW_KEYWORD(SQL_TOKEN_PRIMARY); }
PRIVILEGES {SQL_NEW_KEYWORD(SQL_TOKEN_PRIVILEGES); }
@@ -309,16 +330,20 @@ QUARTER {SQL_NEW_KEYWORD(SQL_TOKEN_QUARTER); }
RADIANS {SQL_NEW_KEYWORD(SQL_TOKEN_RADIANS); }
RAND {SQL_NEW_KEYWORD(SQL_TOKEN_RAND); }
+RANGE {SQL_NEW_KEYWORD(SQL_TOKEN_RANGE); }
RANK {SQL_NEW_KEYWORD(SQL_TOKEN_RANK); }
REAL {SQL_NEW_KEYWORD(SQL_TOKEN_REAL); }
REFERENCES {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCES); }
REFERENCING {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCING); }
REPEAT {SQL_NEW_KEYWORD(SQL_TOKEN_REPEAT); }
REPLACE {SQL_NEW_KEYWORD(SQL_TOKEN_REPLACE); }
+RESPECT {SQL_NEW_KEYWORD(SQL_TOKEN_RESPECT); }
ROLLBACK {SQL_NEW_KEYWORD(SQL_TOKEN_ROLLBACK); }
ROUND {SQL_NEW_KEYWORD(SQL_TOKEN_ROUND); }
ROUNDMAGIC {SQL_NEW_KEYWORD(SQL_TOKEN_ROUNDMAGIC); }
ROW {SQL_NEW_KEYWORD(SQL_TOKEN_ROW); }
+ROWS {SQL_NEW_KEYWORD(SQL_TOKEN_ROWS); }
+ROW_NUMBER {SQL_NEW_KEYWORD(SQL_TOKEN_ROW_NUMBER); }
RIGHT {SQL_NEW_KEYWORD(SQL_TOKEN_RIGHT); }
RTRIM {SQL_NEW_KEYWORD(SQL_TOKEN_RTRIM); }
@@ -345,6 +370,7 @@ SYSTEM_USER {SQL_NEW_KEYWORD(SQL_TOKEN_SYSTEM_USER); }
TABLE {SQL_NEW_KEYWORD(SQL_TOKEN_TABLE); }
TAN {SQL_NEW_KEYWORD(SQL_TOKEN_TAN); }
THEN {SQL_NEW_KEYWORD(SQL_TOKEN_THEN); }
+TIES {SQL_NEW_KEYWORD(SQL_TOKEN_TIES); }
TIME {SQL_NEW_KEYWORD(SQL_TOKEN_TIME); }
TIMESTAMP {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMP); }
TIMESTAMPADD {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPADD); }
@@ -363,6 +389,7 @@ TS {SQL_NEW_KEYWORD(SQL_TOKEN_TS); }
T {SQL_NEW_KEYWORD(SQL_TOKEN_T); }
UCASE {SQL_NEW_KEYWORD(SQL_TOKEN_UCASE); }
+UNBOUNDED {SQL_NEW_KEYWORD(SQL_TOKEN_UNBOUNDED); }
UNION {SQL_NEW_KEYWORD(SQL_TOKEN_UNION); }
UNIQUE {SQL_NEW_KEYWORD(SQL_TOKEN_UNIQUE); }
UNKNOWN {SQL_NEW_KEYWORD(SQL_TOKEN_UNKNOWN); }
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index 34ba49566383..e0ea97f1f7aa 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -1068,9 +1068,9 @@ void OSQLParseTreeIterator::traverseByColumnNames(const OSQLParseNode* pSelectNo
OSQLParseNode * pTableExp = pSelectNode->getChild(3);
OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator:table_exp error in parse tree!");
- OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: error in parse tree!");
+ OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
- sal_uInt32 nPos = ( _bOrder ? 4 : 2 );
+ sal_uInt32 nPos = ( _bOrder ? ORDER_BY_CHILD_POS : 2 );
OSQLParseNode * pOptByClause = pTableExp->getChild(nPos);
OSL_ENSURE(pOptByClause != NULL,"OSQLParseTreeIterator: error in parse tree!");
@@ -1233,7 +1233,7 @@ bool OSQLParseTreeIterator::traverseSelectionCriteria(const OSQLParseNode* pSele
OSQLParseNode * pTableExp = pSelectNode->getChild(3);
OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: error in parse tree!");
+ OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
pWhereClause = pTableExp->getChild(1);
} else if (SQL_ISRULE(pSelectNode,update_statement_searched)) {
@@ -1451,7 +1451,7 @@ void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition
}
//-----------------------------------------------------------------------------
void OSQLParseTreeIterator::traverseParameter(const OSQLParseNode* _pParseNode
- ,const OSQLParseNode* _pColumnRef
+ ,const OSQLParseNode* _pParentNode
,const ::rtl::OUString& _aColumnName
,const ::rtl::OUString& _aTableRange
,const ::rtl::OUString& _rColumnAlias)
@@ -1490,18 +1490,18 @@ void OSQLParseTreeIterator::traverseParameter(const OSQLParseNode* _pParseNode
}
// found a parameter
- if ( _pColumnRef && (SQL_ISRULE(_pColumnRef,general_set_fct) || SQL_ISRULE(_pColumnRef,set_fct_spec)) )
+ if ( _pParentNode && (SQL_ISRULE(_pParentNode,general_set_fct) || SQL_ISRULE(_pParentNode,set_fct_spec)) )
{// found a function as column_ref
::rtl::OUString sFunctionName;
- _pColumnRef->getChild(0)->parseNodeToStr( sFunctionName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- const sal_uInt32 nCount = _pColumnRef->count();
+ _pParentNode->getChild(0)->parseNodeToStr( sFunctionName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
+ const sal_uInt32 nCount = _pParentNode->count();
sal_uInt32 i = 0;
for(; i < nCount;++i)
{
- if ( _pColumnRef->getChild(i) == _pParseNode )
+ if ( _pParentNode->getChild(i) == _pParseNode )
break;
}
- sal_Int32 nType = ::connectivity::OSQLParser::getFunctionParameterType( _pColumnRef->getParent()->getChild(0)->getTokenID(), i+1);
+ sal_Int32 nType = ::connectivity::OSQLParser::getFunctionParameterType( _pParentNode->getChild(0)->getTokenID(), i-1);
OParseColumn* pColumn = new OParseColumn( sParameterName,
::rtl::OUString(),
@@ -1552,14 +1552,14 @@ void OSQLParseTreeIterator::traverseParameter(const OSQLParseNode* _pParseNode
if ( bNotFound )
{
sal_Int32 nType = DataType::VARCHAR;
- OSQLParseNode* pParent = _pColumnRef ? _pColumnRef->getParent() : NULL;
+ OSQLParseNode* pParent = _pParentNode ? _pParentNode->getParent() : NULL;
if ( pParent && (SQL_ISRULE(pParent,general_set_fct) || SQL_ISRULE(pParent,set_fct_spec)) )
{
- const sal_uInt32 nCount = _pColumnRef->count();
+ const sal_uInt32 nCount = _pParentNode->count();
sal_uInt32 i = 0;
for(; i < nCount;++i)
{
- if ( _pColumnRef->getChild(i) == _pParseNode )
+ if ( _pParentNode->getChild(i) == _pParseNode )
break;
}
nType = ::connectivity::OSQLParser::getFunctionParameterType( pParent->getChild(0)->getTokenID(), i+1);
@@ -1967,7 +1967,7 @@ const OSQLParseNode* OSQLParseTreeIterator::getWhereTree() const
OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: error in parse tree!");
+ OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
pWhereClause = pTableExp->getChild(1);
}
@@ -1997,9 +1997,9 @@ const OSQLParseNode* OSQLParseTreeIterator::getOrderTree() const
OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: error in parse tree!");
+ OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
- pOrderClause = pTableExp->getChild(4);
+ pOrderClause = pTableExp->getChild(ORDER_BY_CHILD_POS);
// Wenn es aber eine order_by ist, dann darf sie nicht leer sein:
if(pOrderClause->count() != 3)
pOrderClause = NULL;
@@ -2019,7 +2019,7 @@ const OSQLParseNode* OSQLParseTreeIterator::getGroupByTree() const
OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: error in parse tree!");
+ OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
pGroupClause = pTableExp->getChild(2);
// Wenn es aber eine order_by ist, dann darf sie nicht leer sein:
@@ -2040,7 +2040,7 @@ const OSQLParseNode* OSQLParseTreeIterator::getHavingTree() const
OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: error in parse tree!");
+ OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
pHavingClause = pTableExp->getChild(3);
// Wenn es aber eine order_by ist, dann darf sie nicht leer sein:
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 8f2b3d69812a..9a3abb0d4fc2 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -2468,7 +2468,7 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
if (rString.getLength())
rString.appendAscii(" ");
- const ::rtl::OString sT = OSQLParser::TokenIDToStr(m_nNodeID, &rParam.m_rContext);
+ const ::rtl::OString sT = OSQLParser::TokenIDToStr(m_nNodeID, rParam.bInternational ? &rParam.m_rContext : NULL);
rString.append(::rtl::OUString(sT,sT.getLength(),RTL_TEXTENCODING_UTF8));
} break;
case SQL_NODE_STRING:
diff --git a/desktop/os2/source/applauncher/makefile.mk b/desktop/os2/source/applauncher/makefile.mk
index bf71b57c2fdf..7eec8aee9c23 100644
--- a/desktop/os2/source/applauncher/makefile.mk
+++ b/desktop/os2/source/applauncher/makefile.mk
@@ -47,7 +47,7 @@ OBJFILES= \
$(OBJ)$/sbase.obj \
$(OBJ)$/smath.obj \
$(OBJ)$/officeloader.obj \
- $(OBJ)$/quickstart.obj
+ $(OBJ)$/os2quickstart.obj
APP1TARGET=swriter
APP1NOSAL=TRUE
@@ -106,13 +106,13 @@ APP7OBJS = \
$(OBJ)$/launcher.obj\
$(OBJ)$/officeloader.obj
-APP8TARGET=quickstart
+APP8TARGET=os2quickstart
APP8NOSAL=TRUE
APP8LINKRES=$(MISC)$/$(TARGET)8.res
APP8ICON=$(SOLARRESDIR)$/icons$/ooo-main-app.ico
APP8OBJS = \
$(OBJ)$/launcher.obj\
- $(OBJ)$/quickstart.obj
+ $(OBJ)$/os2quickstart.obj
# --- Targets ------------------------------------------------------
diff --git a/desktop/os2/source/applauncher/quickstart.cxx b/desktop/os2/source/applauncher/os2quickstart.cxx
index 63585434bb50..63585434bb50 100644
--- a/desktop/os2/source/applauncher/quickstart.cxx
+++ b/desktop/os2/source/applauncher/os2quickstart.cxx
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst
index fc782c35a71b..f1dee0761ccd 100644
--- a/desktop/prj/build.lst
+++ b/desktop/prj/build.lst
@@ -17,6 +17,9 @@ dt desktop\win32\source\guistdio nmake - w dt_guistdio dt_inc N
dt desktop\win32\source\applauncher nmake - w dt_applauncher dt_inc NULL
dt desktop\win32\source\applauncher\ooo nmake - w dt_applauncher_ooo dt_applauncher.w dt_inc NULL
dt desktop\win32\source\rebase nmake - w dt_rebase dt_inc NULL
+dt desktop\win32\source\QuickStart nmake - w dt_win32_quickstart NULL
+dt desktop\win32\source\QuickStart\so nmake - w dt_win32_quickstart_so dt_win32_quickstart.w NULL
+
dt desktop\os2\source\applauncher nmake - p dt_applauncher dt_inc NULL
dt desktop\unx\source\officeloader nmake - u dt_officeloader_unx dt_inc NULL
dt desktop\source\pagein nmake - u dt_pagein dt_inc NULL
@@ -35,7 +38,7 @@ dt desktop\source\deployment\registry\configuration nmake - all dt_dp_registry_c
dt desktop\source\deployment\registry\help nmake - all dt_dp_registry_help dt_inc NULL
dt desktop\source\deployment\registry\executable nmake - all dt_dp_registry_executable dt_inc NULL
dt desktop\scripts nmake - u dt_scripts dt_inc NULL
-dt desktop\util nmake - all dt_util dt_app dt_pagein.u dt_so_comp dt_spl dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr dt_rebase.w NULL
+dt desktop\util nmake - all dt_util dt_app dt_pagein.u dt_so_comp dt_spl dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr dt_rebase.w dt_win32_quickstart_so.w NULL
dt desktop\zipintro nmake - all dt_zipintro NULL
dt desktop\registry\data\org\openoffice\Office nmake - all sn_regconfig NULL
dt desktop\source\registration\com\sun\star\servicetag\resources get - all sn_svctagres NULL
diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst
index b6e14a5ce722..be7b77388763 100644
--- a/desktop/prj/d.lst
+++ b/desktop/prj/d.lst
@@ -31,7 +31,7 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms
..\%__SRC%\bin\swriter.exe %_DEST%\bin%_EXT%\swriter.exe
..\%__SRC%\bin\sbase.exe %_DEST%\bin%_EXT%\sbase.exe
..\%__SRC%\bin\sweb.exe %_DEST%\bin%_EXT%\sweb.exe
-..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe
+..\%__SRC%\bin\os2quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe
..\%__SRC%\bin\so\scalc.exe %_DEST%\bin%_EXT%\so\scalc.exe
..\%__SRC%\bin\so\sdraw.exe %_DEST%\bin%_EXT%\so\sdraw.exe
..\%__SRC%\bin\so\simpress.exe %_DEST%\bin%_EXT%\so\simpress.exe
@@ -40,6 +40,11 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms
..\%__SRC%\bin\so\sbase.exe %_DEST%\bin%_EXT%\so\sbase.exe
..\%__SRC%\bin\so\sweb.exe %_DEST%\bin%_EXT%\so\sweb.exe
+..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe
+..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\install_quickstart.exe
+..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\quickstart.exe
+..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\install_quickstart.exe
+
..\%__SRC%\misc\soffice.exe.manifest %_DEST%\bin%_EXT%\soffice.exe.manifest
..\%__SRC%\misc\soffice.bin.manifest %_DEST%\bin%_EXT%\soffice.bin.manifest
..\%__SRC%\bin\wrp*.dll %_DEST%\bin%_EXT%\wrp*.dll
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index a2f602082fe4..033a87cfaea2 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -633,7 +633,9 @@ throw()
else if( TypeToCopy == +1 ) // Folder
{
osl::Directory aDir( srcUnqPath );
- aDir.open();
+ err = aDir.open();
+ if ( err != osl::FileBase::E_None )
+ return err;
err = osl::Directory::create( dstUnqPath );
osl::FileBase::RC next = err;
@@ -1215,7 +1217,7 @@ void Desktop::retrieveCrashReporterState()
{
static const ::rtl::OUString CFG_PACKAGE_RECOVERY = ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery/");
static const ::rtl::OUString CFG_PATH_CRASHREPORTER = ::rtl::OUString::createFromAscii("CrashReporter" );
- static const ::rtl::OUString CFG_ENTRY_ENABLED = ::rtl::OUString::createFromAscii("Enabled" );
+ static const ::rtl::OUString CFG_ENTRY_ENABLED = ::rtl::OUString::createFromAscii("Enabled" );
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
@@ -1627,7 +1629,8 @@ void Desktop::Main()
// there is no other instance using our data files from a remote host
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" );
m_pLockfile = new Lockfile;
- if ( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning )) {
+ if ( !pCmdLineArgs->IsHeadless() && !pCmdLineArgs->IsInvisible() &&
+ !pCmdLineArgs->IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning )) {
// Lockfile exists, and user clicked 'no'
return;
}
@@ -1802,7 +1805,7 @@ void Desktop::Main()
if ( !pExecGlobals->bRestartRequested )
{
- if ((!pCmdLineArgs->WantsToLoadDocument() ) &&
+ if ((!pCmdLineArgs->WantsToLoadDocument() && !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsHeadless() ) &&
(SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) &&
(!bExistsRecoveryData ) &&
(!bExistsSessionData ) &&
@@ -2116,9 +2119,9 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
// unfortunately this broke the QUARTZ behavior which is to always run
// in quickstart mode since Mac applications do not usually quit
// when the last document closes
- //#ifndef QUARTZ
+ #ifndef QUARTZ
if ( bQuickstart )
- //#endif
+ #endif
{
Reference < XComponent > xQuickstart( rSMgr->createInstanceWithArguments(
DEFINE_CONST_UNICODE( "com.sun.star.office.Quickstart" ), aSeq ),
@@ -3203,6 +3206,7 @@ void Desktop::OpenSplashScreen()
sal_Bool bVisible = sal_False;
// Show intro only if this is normal start (e.g. no server, no quickstart, no printing )
if ( !pCmdLine->IsInvisible() &&
+ !pCmdLine->IsHeadless() &&
!pCmdLine->IsQuickstart() &&
!pCmdLine->IsMinimized() &&
!pCmdLine->IsNoLogo() &&
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 8bd8a6191201..a8a1025959f1 100755..100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -165,7 +165,7 @@ public:
m_bWarnUser( false )
{}
- Dialog * activeDialog() { return m_pDialogHelper->getWindow(); }
+ Dialog * activeDialog() { return m_pDialogHelper ? m_pDialogHelper->getWindow() : NULL; }
void setTitle( const OUString& rNewTitle ) { m_sTitle = rNewTitle; }
void startProgress();
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 2e2c5e2a2f53..89ab4d0b7199 100644..100755
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -63,6 +63,7 @@
#include "com/sun/star/ucb/UnsupportedCommandException.hpp"
#include "boost/bind.hpp"
#include "tools/urlobj.hxx"
+#include "unotools/tempfile.hxx"
#include "osl/file.hxx"
#include <vector>
@@ -636,21 +637,12 @@ OUString PackageManagerImpl::insertToActivationLayer(
::ucbhelper::Content sourceContent(sourceContent_);
Reference<XCommandEnvironment> xCmdEnv(
sourceContent.getCommandEnvironment() );
- OUString destFolder, tempEntry;
- if (::osl::File::createTempFile(
- m_activePackages_expanded.getLength() == 0
- ? 0 : &m_activePackages_expanded,
- 0, &tempEntry ) != ::osl::File::E_None)
- throw RuntimeException(
- OUSTR("::osl::File::createTempFile() failed!"), 0 );
- if (m_activePackages_expanded.getLength() == 0) {
- destFolder = tempEntry;
- }
- else {
- tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 );
- // tweak user|share to macrofied url:
- destFolder = makeURL( m_activePackages, tempEntry );
- }
+
+ String baseDir(m_activePackages_expanded);
+ ::utl::TempFile aTemp(&baseDir, sal_False);
+ OUString tempEntry = aTemp.GetURL();
+ tempEntry = tempEntry.copy(tempEntry.lastIndexOf('/') + 1);
+ OUString destFolder = makeURL( m_activePackages, tempEntry);
destFolder += OUSTR("_");
// prepare activation folder:
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index 650a7585d929..0035b67d8ef7 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -1779,17 +1779,23 @@ void BackendImpl::ComponentsPackageImpl::processPackage_(
if (doRegisterPackage) {
ComponentBackendDb::Data data;
data.javaTypeLibrary = false;
- std::vector< css::uno::Reference< css::uno::XInterface > > factories;
- css::uno::Reference< css::uno::XComponentContext > context(
- that->getObject(url), css::uno::UNO_QUERY);
- if (!context.is()) {
- context.set(
- that->insertObject(
- url,
- raise_uno_process(
- that->getComponentContext(), abortChannel)),
- css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::uno::XComponentContext > context;
+ if (startup) {
+ context = that->getComponentContext();
+ } else {
+ context.set(that->getObject(url), css::uno::UNO_QUERY);
+ if (!context.is()) {
+ context.set(
+ that->insertObject(
+ url,
+ raise_uno_process(
+ that->getComponentContext(), abortChannel)),
+ css::uno::UNO_QUERY_THROW);
+ }
}
+
+ std::vector< css::uno::Reference< css::uno::XInterface > > factories;
+
css::uno::Reference< css::registry::XSimpleRegistry > registry(
css::uno::Reference< css::lang::XMultiComponentFactory >(
that->getComponentContext()->getServiceManager(),
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 266d4406cfde..32413f3d11ba 100755..100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -45,6 +45,7 @@
#include "com/sun/star/beans/StringPair.hpp"
#include "com/sun/star/sdbc/XResultSet.hpp"
#include "com/sun/star/sdbc/XRow.hpp"
+#include "unotools/tempfile.hxx"
using namespace ::dp_misc;
@@ -225,42 +226,43 @@ OUString PackageRegistryBackend::createFolder(
OUString const & relUrl,
Reference<ucb::XCommandEnvironment> const & xCmdEnv)
{
- OUString sDataFolder = makeURL(getCachePath(), relUrl);
+ const OUString sDataFolder = makeURL(getCachePath(), relUrl);
//make sure the folder exist
ucbhelper::Content dataContent;
::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv);
- OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder);
-
- OUString tempEntry;
- if (::osl::File::createTempFile(
- &sDataFolderURL, 0, &tempEntry ) != ::osl::File::E_None)
- throw RuntimeException(
- OUSTR("::osl::File::createTempFile() failed!"), 0 );
- tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 );
- OUString destFolder= makeURL(sDataFolder, tempEntry) + OUSTR("_");
- ::ucbhelper::Content destFolderContent;
- dp_misc::create_folder( &destFolderContent, destFolder, xCmdEnv );
-
- return destFolder;
+ const OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder);
+ const String baseDir(sDataFolder);
+ const ::utl::TempFile aTemp(&baseDir, sal_True);
+ const OUString url = aTemp.GetURL();
+ return sDataFolder + url.copy(url.lastIndexOf('/'));
}
+//folderURL can have the extension .tmp or .tmp_
+//Before OOo 3.4 the created a tmp file with osl_createTempFile and
+//then created a Folder with a same name and a trailing '_'
+//If the folderURL has no '_' then there is no corresponding tmp file.
void PackageRegistryBackend::deleteTempFolder(
OUString const & folderUrl)
{
- OSL_ASSERT(folderUrl.getLength()
- && folderUrl[folderUrl.getLength() - 1] == '_');
- if (folderUrl.getLength()
- && folderUrl[folderUrl.getLength() - 1] == '_')
+ if (folderUrl.getLength())
{
- const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1);
erase_path( folderUrl, Reference<XCommandEnvironment>(),
false /* no throw: ignore errors */ );
- erase_path( tempFile, Reference<XCommandEnvironment>(),
- false /* no throw: ignore errors */ );
+
+ if (folderUrl[folderUrl.getLength() - 1] == '_')
+ {
+ const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1);
+ erase_path( tempFile, Reference<XCommandEnvironment>(),
+ false /* no throw: ignore errors */ );
+ }
}
}
+//usedFolders can contain folder names which have the extension .tmp or .tmp_
+//Before OOo 3.4 we created a tmp file with osl_createTempFile and
+//then created a Folder with a same name and a trailing '_'
+//If the folderURL has no '_' then there is no corresponding tmp file.
void PackageRegistryBackend::deleteUnusedFolders(
OUString const & relUrl,
::std::list< OUString> const & usedFolders)
@@ -273,12 +275,14 @@ void PackageRegistryBackend::deleteUnusedFolders(
Reference<sdbc::XResultSet> xResultSet(
tempFolder.createCursor(
Sequence<OUString>( &StrTitle::get(), 1 ),
- ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
+ ::ucbhelper::INCLUDE_FOLDERS_ONLY ) );
// get all temp directories:
::std::vector<OUString> tempEntries;
char tmp[] = ".tmp";
+ //Check for ".tmp_" can be removed after OOo 4.0
+ char tmp_[] = ".tmp_";
while (xResultSet->next())
{
OUString title(
@@ -286,21 +290,18 @@ void PackageRegistryBackend::deleteUnusedFolders(
xResultSet, UNO_QUERY_THROW )->getString(
1 /* Title */ ) );
- if (title.endsWithAsciiL(tmp, sizeof(tmp) - 1))
+ if (title.endsWithAsciiL(tmp, sizeof(tmp) - 1)
+ || title.endsWithAsciiL(tmp_, sizeof(tmp_) - 1))
tempEntries.push_back(
makeURLAppendSysPathSegment(sDataFolder, title));
}
for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos )
{
- //usedFolders contains the urls to the folders which have
- //a trailing underscore
- const OUString tempFolderName = tempEntries[ pos ] + OUSTR("_");
-
- if (::std::find( usedFolders.begin(), usedFolders.end(), tempFolderName ) ==
+ if (::std::find( usedFolders.begin(), usedFolders.end(), tempEntries[pos] ) ==
usedFolders.end())
{
- deleteTempFolder(tempFolderName);
+ deleteTempFolder(tempEntries[pos]);
}
}
}
diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx
index 9629855aaf11..44e11efdef0e 100644..100755
--- a/desktop/source/deployment/registry/dp_backenddb.cxx
+++ b/desktop/source/deployment/registry/dp_backenddb.cxx
@@ -91,7 +91,10 @@ css::uno::Reference<css::xml::dom::XDocument> BackendDb::getDocument()
::osl::File::RC err = ::osl::DirectoryItem::get(m_urlDb, item);
if (err == ::osl::File::E_None)
{
- m_doc = xDocBuilder->parseURI(m_urlDb);
+ ::ucbhelper::Content descContent(
+ m_urlDb, css::uno::Reference<css::ucb::XCommandEnvironment>());
+ Reference<css::io::XInputStream> xIn = descContent.openStream();
+ m_doc = xDocBuilder->parse(xIn);
}
else if (err == ::osl::File::E_NOENT)
{
diff --git a/desktop/util/ooverinfo.rc b/desktop/util/ooverinfo.rc
index 6d92e2a99500..3ddff6b66b02 100644
--- a/desktop/util/ooverinfo.rc
+++ b/desktop/util/ooverinfo.rc
@@ -112,7 +112,7 @@ VS_VERSION_INFO versioninfo
15 ICON "icons\\oasis-formula.ico"
16 ICON "icons\\oasis-web-template.ico"
17 ICON "icons\\empty-document.ico"
-18 ICON "icons\\ooo-configuration.ico"
+18 ICON "icons\\empty-document.ico"
19 ICON "icons\\ooo3_open.ico"
20 ICON "icons\\empty-document.ico"
21 ICON "icons\\ooo3_writer_app.ico"
diff --git a/desktop/util/ooverinfo2.rc b/desktop/util/ooverinfo2.rc
index 17af6818551e..caacb294122d 100755..100644
--- a/desktop/util/ooverinfo2.rc
+++ b/desktop/util/ooverinfo2.rc
@@ -50,7 +50,7 @@ ICON 14 "icons/oasis-database.ico"
ICON 15 "icons/oasis-formula.ico"
ICON 16 "icons/oasis-web-template.ico"
ICON 17 "icons/empty-document.ico"
-ICON 18 "icons/ooo-configuration.ico"
+ICON 18 "icons/empty-document.ico"
ICON 19 "icons/ooo-open.ico"
ICON 20 "icons/empty-document.ico"
ICON 21 "icons/ooo-writer-app.ico"
diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc
index 7d589956ec83..5a2b03769963 100755..100644
--- a/desktop/util/verinfo.rc
+++ b/desktop/util/verinfo.rc
@@ -117,8 +117,8 @@ VS_VERSION_INFO versioninfo
15 ICON "icons\\oasis-formula.ico"
16 ICON "icons\\oasis-web-template.ico"
17 ICON "icons\\empty-document.ico"
-18 ICON "icons\\so8-configuration.ico"
-19 ICON "icons\\so9_open.ico"
+18 ICON "icons\\empty-document.ico"
+19 ICON "icons\\so9_main_app.ico"
20 ICON "icons\\empty-document.ico"
21 ICON "icons\\so9_writer_app.ico"
22 ICON "icons\\so9_calc_app.ico"
diff --git a/sysui/source/win32/QuickStart/OOQuickStart.rc b/desktop/win32/source/QuickStart/OOQuickStart.rc
index 0dc4dab256b6..9baf7e864f5f 100644
--- a/sysui/source/win32/QuickStart/OOQuickStart.rc
+++ b/desktop/win32/source/QuickStart/OOQuickStart.rc
@@ -31,10 +31,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-ICON_ACTIVE ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
-IDI_QUICKSTART ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
-IDI_SMALL ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
-ICON_INACTIVE ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
+ICON_ACTIVE ICON DISCARDABLE "icons/ooo3_main_app.ico"
+IDI_QUICKSTART ICON DISCARDABLE "icons/ooo3_main_app.ico"
+IDI_SMALL ICON DISCARDABLE "icons/ooo3_main_app.ico"
+ICON_INACTIVE ICON DISCARDABLE "icons/ooo3_main_app.ico"
/////////////////////////////////////////////////////////////////////////////
diff --git a/sysui/source/win32/QuickStart/QuickStart.cpp b/desktop/win32/source/QuickStart/QuickStart.cpp
index 3467e35524f8..3467e35524f8 100644
--- a/sysui/source/win32/QuickStart/QuickStart.cpp
+++ b/desktop/win32/source/QuickStart/QuickStart.cpp
diff --git a/sysui/source/win32/QuickStart/QuickStart.h b/desktop/win32/source/QuickStart/QuickStart.h
index d0afd98ec430..d0afd98ec430 100644
--- a/sysui/source/win32/QuickStart/QuickStart.h
+++ b/desktop/win32/source/QuickStart/QuickStart.h
diff --git a/sysui/source/win32/QuickStart/StdAfx.h b/desktop/win32/source/QuickStart/StdAfx.h
index a4bdd66f630c..a4bdd66f630c 100644
--- a/sysui/source/win32/QuickStart/StdAfx.h
+++ b/desktop/win32/source/QuickStart/StdAfx.h
diff --git a/sysui/source/win32/QuickStart/makefile.mk b/desktop/win32/source/QuickStart/makefile.mk
index 41242d849dfb..41242d849dfb 100644
--- a/sysui/source/win32/QuickStart/makefile.mk
+++ b/desktop/win32/source/QuickStart/makefile.mk
diff --git a/sysui/source/win32/QuickStart/resource.h b/desktop/win32/source/QuickStart/resource.h
index d34beb00c5c9..d34beb00c5c9 100644
--- a/sysui/source/win32/QuickStart/resource.h
+++ b/desktop/win32/source/QuickStart/resource.h
diff --git a/sysui/source/win32/QuickStart/so/QuickStart.rc b/desktop/win32/source/QuickStart/so/QuickStart.rc
index c48dc2358d0d..732904dc745a 100644
--- a/sysui/source/win32/QuickStart/so/QuickStart.rc
+++ b/desktop/win32/source/QuickStart/so/QuickStart.rc
@@ -31,10 +31,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-ICON_ACTIVE ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
-IDI_QUICKSTART ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
-IDI_SMALL ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
-ICON_INACTIVE ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
+ICON_ACTIVE ICON DISCARDABLE "icons/so9_main_app.ico"
+IDI_QUICKSTART ICON DISCARDABLE "icons/so9_main_app.ico"
+IDI_SMALL ICON DISCARDABLE "icons/so9_main_app.ico"
+ICON_INACTIVE ICON DISCARDABLE "icons/so9_main_app.ico"
/////////////////////////////////////////////////////////////////////////////
diff --git a/sysui/source/win32/QuickStart/so/makefile.mk b/desktop/win32/source/QuickStart/so/makefile.mk
index 6c7897232576..50154c7d50b2 100644
--- a/sysui/source/win32/QuickStart/so/makefile.mk
+++ b/desktop/win32/source/QuickStart/so/makefile.mk
@@ -41,6 +41,8 @@ UWINAPILIB =
# --- Resources ----------------------------------------------------
+.IF "$(LINK_SO)"=="TRUE"
+
RCFILES=QuickStart.rc
INCPRE=..
@@ -68,6 +70,8 @@ APP1STDLIBS+=$(SHELL32LIB)\
APP1NOSVRES=$(RES)$/$(TARGET).res
+.ENDIF # "$(LINK_SO)"=="TRUE"
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/desktop/win32/source/applauncher/makefile.mk b/desktop/win32/source/applauncher/makefile.mk
index f0f5743f38a1..d08309bbed24 100644
--- a/desktop/win32/source/applauncher/makefile.mk
+++ b/desktop/win32/source/applauncher/makefile.mk
@@ -53,6 +53,7 @@ OBJFILES= \
$(OBJ)$/sweb.obj
# SO launcher
+.IF "$(LINK_SO)"=="TRUE"
.IF "$(BUILD_SPECIAL)"!=""
APP1DEPN= $(APP1RES) verinfo.rc
APP1TARGET=so$/swriter
@@ -139,7 +140,8 @@ APP7VERINFO=verinfo.rc
APP7PRODUCTDEF+=-DRES_APP_NAME=sweb
-.ENDIF # "$(BUILD_SPECIAL)"!=""
+.ENDIF # "$(BUILD_SPECIAL)"!=""
+.ENDIF # "$(LINK_SO)"=="TRUE"
# --- Targets ------------------------------------------------------
diff --git a/desktop/win32/source/guiloader/makefile.mk b/desktop/win32/source/guiloader/makefile.mk
index 5bb1c523ff19..7912471fba13 100644
--- a/desktop/win32/source/guiloader/makefile.mk
+++ b/desktop/win32/source/guiloader/makefile.mk
@@ -48,14 +48,16 @@ APP1OBJS=\
$(SOLARLIBDIR)$/pathutils-obj.obj
STDLIB1=$(SHLWAPILIB)
+.IF "$(LINK_SO)"=="TRUE"
APP2TARGET=so$/guiloader
APP2NOSAL=TRUE
-APP2ICON=$(SOLARRESDIR)$/icons/so8-main-app.ico
+APP2ICON=$(SOLARRESDIR)$/icons/so9_main_app.ico
APP2OBJS=\
$(OBJ)$/extendloaderenvironment.obj \
$(OBJ)$/genericloader.obj \
$(SOLARLIBDIR)$/pathutils-obj.obj
STDLIB2=$(SHLWAPILIB)
+.ENDIF # "$(LINK_SO)"=="TRUE"
# --- Targets ------------------------------------------------------
diff --git a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
index 6dffd80b332e..da7aedc6f983 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
@@ -65,6 +65,7 @@ namespace drawinglayer
bool bSymbol = false,
bool bVertical = false,
bool bItalic = false,
+ bool bMonospaced = false,
bool bOutline = false,
bool bRTL = false,
bool bBiDiStrong = false);
@@ -89,6 +90,7 @@ namespace drawinglayer
bool getOutline() const;
bool getRTL() const;
bool getBiDiStrong() const;
+ bool getMonospaced() const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
index 7d10d3a37384..d4246376d9ca 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -55,6 +55,7 @@ namespace drawinglayer
unsigned mbOutline : 1; // Outline Flag
unsigned mbRTL : 1; // RTL Flag
unsigned mbBiDiStrong : 1; // BiDi Flag
+ unsigned mbMonospaced : 1;
ImpFontAttribute(
const String& rFamilyName,
@@ -63,6 +64,7 @@ namespace drawinglayer
bool bSymbol,
bool bVertical,
bool bItalic,
+ bool bMonospaced,
bool bOutline,
bool bRTL,
bool bBiDiStrong)
@@ -75,7 +77,8 @@ namespace drawinglayer
mbItalic(bItalic),
mbOutline(bOutline),
mbRTL(bRTL),
- mbBiDiStrong(bBiDiStrong)
+ mbBiDiStrong(bBiDiStrong),
+ mbMonospaced(bMonospaced)
{
}
@@ -89,6 +92,7 @@ namespace drawinglayer
bool getOutline() const { return mbOutline; }
bool getRTL() const { return mbRTL; }
bool getBiDiStrong() const { return mbBiDiStrong; }
+ bool getMonospaced() const { return mbMonospaced; }
bool operator==(const ImpFontAttribute& rCompare) const
{
@@ -100,7 +104,8 @@ namespace drawinglayer
&& getItalic() == rCompare.getItalic()
&& getOutline() == rCompare.getOutline()
&& getRTL() == rCompare.getRTL()
- && getBiDiStrong() == rCompare.getBiDiStrong());
+ && getBiDiStrong() == rCompare.getBiDiStrong()
+ && getMonospaced() == rCompare.getMonospaced());
}
static ImpFontAttribute* get_global_default()
@@ -112,7 +117,7 @@ namespace drawinglayer
pDefault = new ImpFontAttribute(
String(), String(),
0,
- false, false, false, false, false, false);
+ false, false, false, false, false, false, false);
// never delete; start with RefCount 1, not 0
pDefault->mnRefCount++;
@@ -129,11 +134,12 @@ namespace drawinglayer
bool bSymbol,
bool bVertical,
bool bItalic,
+ bool bMonospaced,
bool bOutline,
bool bRTL,
bool bBiDiStrong)
: mpFontAttribute(new ImpFontAttribute(
- rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bOutline, bRTL, bBiDiStrong))
+ rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bMonospaced, bOutline, bRTL, bBiDiStrong))
{
}
@@ -246,6 +252,12 @@ namespace drawinglayer
return mpFontAttribute->getBiDiStrong();
}
+ bool FontAttribute::getMonospaced() const
+ {
+ return mpFontAttribute->getMonospaced();
+ }
+
+
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index c9774bea3f34..9aafd195a707 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -406,6 +406,7 @@ namespace drawinglayer
aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight()));
aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
aRetval.SetOutline(rFontAttribute.getOutline());
+ aRetval.SetPitch(rFontAttribute.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE);
aRetval.SetLanguage(MsLangId::convertLocaleToLanguage(rLocale));
#ifdef WIN32
@@ -445,6 +446,7 @@ namespace drawinglayer
RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(),
rFont.IsVertical(),
ITALIC_NONE != rFont.GetItalic(),
+ PITCH_FIXED == rFont.GetPitch(),
rFont.IsOutline(),
bRTL,
bBiDiStrong);
diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx
index e20f1a417dcc..23661fe3747b 100644
--- a/drawinglayer/source/processor2d/canvasprocessor.cxx
+++ b/drawinglayer/source/processor2d/canvasprocessor.cxx
@@ -57,6 +57,7 @@
#include <basegfx/tuple/b2i64tuple.hxx>
#include <basegfx/range/b2irange.hxx>
#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
+#include <com/sun/star/rendering/PanoseProportion.hpp>
#include <com/sun/star/rendering/CompositeOperation.hpp>
#include <com/sun/star/rendering/StrokeAttributes.hpp>
#include <com/sun/star/rendering/PathJoinType.hpp>
@@ -1517,6 +1518,10 @@ namespace drawinglayer
aFontRequest.FontDescription.IsVertical = rFontAttr.getVertical() ? util::TriState_YES : util::TriState_NO;
// TODO(F2): improve vclenum->panose conversion
aFontRequest.FontDescription.FontDescription.Weight = static_cast< sal_uInt8 >(rFontAttr.getWeight());
+ aFontRequest.FontDescription.FontDescription.Proportion =
+ rFontAttr.getMonospaced()
+ ? rendering::PanoseProportion::MONO_SPACED
+ : rendering::PanoseProportion::ANYTHING;
aFontRequest.FontDescription.FontDescription.Letterform = rFontAttr.getItalic() ? 9 : 0;
// init CellSize to 1.0, else a default font height will be used
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index b845ed189aad..c8899514d5a3 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -865,7 +865,7 @@ namespace drawinglayer
// I have now moved describePDFControl to toolkit, thus i can implement the PDF
// form control support now as follows
::std::auto_ptr< ::vcl::PDFWriter::AnyWidget > pPDFControl;
- ::toolkitform::describePDFControl(rXControl, pPDFControl);
+ ::toolkitform::describePDFControl( rXControl, pPDFControl, *mpPDFExtOutDevData );
if(pPDFControl.get())
{
diff --git a/editeng/inc/editeng/fontitem.hxx b/editeng/inc/editeng/fontitem.hxx
index 4ec96052769c..c64c8d99d9e4 100644..100755
--- a/editeng/inc/editeng/fontitem.hxx
+++ b/editeng/inc/editeng/fontitem.hxx
@@ -81,30 +81,23 @@ public:
String &rText, const IntlWrapper * = 0 ) const;
// ZugriffsMethoden:
- inline String &GetFamilyName() { return aFamilyName; }
+ void SetFamilyName( const String& rFamilyName ) { aFamilyName = rFamilyName; }
inline const String &GetFamilyName() const { return aFamilyName; }
- inline String &GetStyleName() { return aStyleName; }
+ void SetStyleName(const String &rStyleName ) { aStyleName = rStyleName; }
inline const String &GetStyleName() const { return aStyleName; }
- inline FontFamily &GetFamily() { return eFamily; }
+ void SetFamily( FontFamily _eFamily ) { eFamily = _eFamily; }
inline FontFamily GetFamily() const { return eFamily; }
- inline FontPitch &GetPitch() { return ePitch; }
+ void SetPitch(FontPitch _ePitch ) { ePitch = _ePitch; }
inline FontPitch GetPitch() const { return ePitch; }
- inline rtl_TextEncoding &GetCharSet() { return eTextEncoding; }
+ void SetCharSet(rtl_TextEncoding _eEncoding) { eTextEncoding = _eEncoding; }
+
inline rtl_TextEncoding GetCharSet() const { return eTextEncoding; }
- inline SvxFontItem& operator=(const SvxFontItem& rFont)
- {
- aFamilyName = rFont.GetFamilyName();
- aStyleName = rFont.GetStyleName();
- eFamily = rFont.GetFamily();
- ePitch = rFont.GetPitch();
- eTextEncoding = rFont.GetCharSet();
- return *this;
- }
+ SvxFontItem& operator=(const SvxFontItem& rFont);
static void EnableStoreUnicodeNames( sal_Bool bEnable );
diff --git a/editeng/inc/editeng/svxacorr.hxx b/editeng/inc/editeng/svxacorr.hxx
index f355a669a304..73dc7664562e 100644..100755
--- a/editeng/inc/editeng/svxacorr.hxx
+++ b/editeng/inc/editeng/svxacorr.hxx
@@ -79,6 +79,7 @@ public:
virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd ) = 0;
virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt ) = 0;
virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt ) = 0;
+ virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt ) = 0;
virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
SfxPoolItem& ) = 0;
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index cda87dea9f7d..cb042b721c4d 100644..100755
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1472,7 +1472,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream )
if ( hConv )
{
SvxFontItem aNewFontItem( rFontItem );
- aNewFontItem.GetFamilyName() = GetFontToSubsFontName( hConv );
+ aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) );
pC->GetAttribs().Remove( nAttr );
XEditAttribute* pNewAttr = CreateAttrib( aNewFontItem, pAttr->GetStart(), pAttr->GetEnd() );
@@ -1503,7 +1503,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream )
if ( hConv )
{
SvxFontItem aNewFontItem( rFontItem );
- aNewFontItem.GetFamilyName() = GetFontToSubsFontName( hConv );
+ aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) );
pC->GetParaAttribs().Put( aNewFontItem );
for ( sal_uInt16 nChar = 0; nChar < pC->GetText().Len(); nChar++ )
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index afc329040e29..5fc43f461cac 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -583,8 +583,13 @@ sal_Bool EdtAutoCorrDoc::Insert( sal_uInt16 nPos, const String& rTxt )
sal_Bool EdtAutoCorrDoc::Replace( sal_uInt16 nPos, const String& rTxt )
{
+ return ReplaceRange( nPos, rTxt.Len(), rTxt );
+}
+
+sal_Bool EdtAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt )
+{
// Eigentlich ein Replace einfuehren => Entspr. UNDO
- sal_uInt16 nEnd = nPos+rTxt.Len();
+ sal_uInt16 nEnd = nPos+nSourceLength;
if ( nEnd > pCurNode->Len() )
nEnd = pCurNode->Len();
diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx
index 3ed82ac367f1..49978cdd310d 100644..100755
--- a/editeng/source/editeng/edtspell.hxx
+++ b/editeng/source/editeng/edtspell.hxx
@@ -158,6 +158,7 @@ public:
virtual sal_Bool Delete( sal_uInt16 nStt, sal_uInt16 nEnd );
virtual sal_Bool Insert( sal_uInt16 nPos, const String& rTxt );
virtual sal_Bool Replace( sal_uInt16 nPos, const String& rTxt );
+ virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt );
virtual sal_Bool SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_uInt16 nSlotId, SfxPoolItem& );
virtual sal_Bool SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const String& rURL );
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index f2a94c2dd1a6..352ff91d2e9e 100755
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2756,7 +2756,10 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS
// get word boundaries in order to clear possible WrongList entries
// and invalidate all the necessary text (everything after and including the
// start of the word)
- EditSelection aCurWord( SelectWord( aCurPaM, i18n::WordType::DICTIONARY_WORD ) );
+ // #i107201# do the expensive SelectWord call only if online spelling is active
+ EditSelection aCurWord;
+ if ( GetStatus().DoOnlineSpelling() )
+ aCurWord = SelectWord( aCurPaM, i18n::WordType::DICTIONARY_WORD );
XubString aText( rStr );
aText.ConvertLineEnd( LINEEND_LF );
@@ -2813,12 +2816,17 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS
ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() );
DBG_ASSERT( pPortion, "Blinde Portion in InsertText" );
- // now remove the Wrongs (red spell check marks) from both words...
- WrongList *pWrongs = aCurPaM.GetNode()->GetWrongList();
- if (pWrongs && pWrongs->HasWrongs())
- pWrongs->ClearWrongs( aCurWord.Min().GetIndex(), aPaM.GetIndex(), aPaM.GetNode() );
- // ... and mark both words as 'to be checked again'
- pPortion->MarkInvalid( aCurWord.Min().GetIndex(), aLine.Len() );
+ if ( GetStatus().DoOnlineSpelling() )
+ {
+ // now remove the Wrongs (red spell check marks) from both words...
+ WrongList *pWrongs = aCurPaM.GetNode()->GetWrongList();
+ if (pWrongs && pWrongs->HasWrongs())
+ pWrongs->ClearWrongs( aCurWord.Min().GetIndex(), aPaM.GetIndex(), aPaM.GetNode() );
+ // ... and mark both words as 'to be checked again'
+ pPortion->MarkInvalid( aCurWord.Min().GetIndex(), aLine.Len() );
+ }
+ else
+ pPortion->MarkInvalid( aCurPaM.GetIndex(), aLine.Len() );
}
if ( nEnd < aText.Len() )
aPaM = ImpInsertParaBreak( aPaM );
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 4b4b5e4514a8..71caa4f176fa 100755
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1682,11 +1682,11 @@ void ImpEditEngine::SetLanguageAndFont(
{
// set new font attribute
SvxFontItem aFontItem = (SvxFontItem&) aNewSet.Get( nFontWhichId );
- aFontItem.GetFamilyName() = pFont->GetName();
- aFontItem.GetFamily() = pFont->GetFamily();
- aFontItem.GetStyleName() = pFont->GetStyleName();
- aFontItem.GetPitch() = pFont->GetPitch();
- aFontItem.GetCharSet() = pFont->GetCharSet();
+ aFontItem.SetFamilyName( pFont->GetName());
+ aFontItem.SetFamily( pFont->GetFamily());
+ aFontItem.SetStyleName( pFont->GetStyleName());
+ aFontItem.SetPitch( pFont->GetPitch());
+ aFontItem.SetCharSet( pFont->GetCharSet() );
aNewSet.Put( aFontItem );
}
diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx
index b92284eb60bf..d2dc1c8a846d 100644..100755
--- a/editeng/source/editeng/textconv.cxx
+++ b/editeng/source/editeng/textconv.cxx
@@ -302,11 +302,11 @@ void TextConvWrapper::SetLanguageAndFont( const ESelection &rESel,
{
// set new font attribute
SvxFontItem aFontItem = (SvxFontItem&) aNewSet.Get( nFontWhichId );
- aFontItem.GetFamilyName() = pFont->GetName();
- aFontItem.GetFamily() = pFont->GetFamily();
- aFontItem.GetStyleName() = pFont->GetStyleName();
- aFontItem.GetPitch() = pFont->GetPitch();
- aFontItem.GetCharSet() = pFont->GetCharSet();
+ aFontItem.SetFamilyName( pFont->GetName());
+ aFontItem.SetFamily( pFont->GetFamily());
+ aFontItem.SetStyleName( pFont->GetStyleName());
+ aFontItem.SetPitch( pFont->GetPitch());
+ aFontItem.SetCharSet(pFont->GetCharSet());
aNewSet.Put( aFontItem );
}
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 8c0e533a40f4..5f2dc3a2d803 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -406,6 +406,8 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
---------------------------------------------------------------------------*/
SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat )
{
+ if (& rFormat == this) { return *this; }
+
SetNumberingType(rFormat.GetNumberingType());
eNumAdjust = rFormat.eNumAdjust ;
nInclUpperLevels = rFormat.nInclUpperLevels ;
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index f1dc1f6c6f85..f0fa8cd02d8f 100644..100755
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -256,6 +256,16 @@ SvxFontItem::SvxFontItem( const FontFamily eFam, const XubString& aName,
}
// -----------------------------------------------------------------------
+SvxFontItem& SvxFontItem::operator=(const SvxFontItem& rFont)
+{
+ aFamilyName = rFont.GetFamilyName();
+ aStyleName = rFont.GetStyleName();
+ eFamily = rFont.GetFamily();
+ ePitch = rFont.GetPitch();
+ eTextEncoding = rFont.GetCharSet();
+ return *this;
+}
+// -----------------------------------------------------------------------
sal_Bool SvxFontItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
@@ -3806,11 +3816,11 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo
aOutTypeArr[ n ].nLanguage,
DEFAULTFONT_FLAGS_ONLYONE, 0 ) );
SvxFontItem* pItem = aItemArr[ n ];
- pItem->GetFamily() = aFont.GetFamily();
- pItem->GetFamilyName() = aFont.GetName();
- pItem->GetStyleName().Erase();
- pItem->GetPitch() = aFont.GetPitch();
- pItem->GetCharSet() = aFont.GetCharSet();
+ pItem->SetFamily( aFont.GetFamily() );
+ pItem->SetFamilyName( aFont.GetName() );
+ pItem->SetStyleName( String() );
+ pItem->SetPitch( aFont.GetPitch());
+ pItem->SetCharSet(aFont.GetCharSet());
}
}
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index e15e92200e0c..1eebd5349fe4 100644..100755
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -47,6 +47,7 @@
#include <com/sun/star/i18n/UnicodeType.hdl>
#include <unotools/collatorwrapper.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
+#include <com/sun/star/i18n/UnicodeScript.hpp>
#include <unotools/localedatawrapper.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -139,6 +140,41 @@ inline int IsUpperLetter( sal_Int32 nCharType )
0 == ( ::com::sun::star::i18n::KCharacterType::LOWER & nCharType);
}
+bool lcl_IsUnsupportedUnicodeChar( CharClass& rCC, const String& rTxt,
+ xub_StrLen nStt, xub_StrLen nEnd )
+{
+ for( ; nStt < nEnd; ++nStt )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ sal_Int32 nCharType;
+ sal_Int32 nChType;
+ nCharType = rCC.getCharacterType( rTxt, nStt );
+ nChType = rCC.getType( rTxt, nStt );
+#endif
+ short nScript = rCC.getScript( rTxt, nStt );
+ switch( nScript )
+ {
+ case ::com::sun::star::i18n::UnicodeScript_kCJKRadicalsSupplement:
+ case ::com::sun::star::i18n::UnicodeScript_kHangulJamo:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKSymbolPunctuation:
+ case ::com::sun::star::i18n::UnicodeScript_kHiragana:
+ case ::com::sun::star::i18n::UnicodeScript_kKatakana:
+ case ::com::sun::star::i18n::UnicodeScript_kHangulCompatibilityJamo:
+ case ::com::sun::star::i18n::UnicodeScript_kEnclosedCJKLetterMonth:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKCompatibility:
+ case ::com::sun::star::i18n::UnicodeScript_k_CJKUnifiedIdeographsExtensionA:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKUnifiedIdeograph:
+ case ::com::sun::star::i18n::UnicodeScript_kHangulSyllable:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKCompatibilityIdeograph:
+ case ::com::sun::star::i18n::UnicodeScript_kHalfwidthFullwidthForm:
+ return true;
+ default: ; //do nothing
+ }
+
+ }
+ return false;
+}
+
sal_Bool lcl_IsSymbolChar( CharClass& rCC, const String& rTxt,
xub_StrLen nStt, xub_StrLen nEnd )
{
@@ -456,7 +492,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt,
sal_Unicode cSave = rTxt.GetChar( nSttPos );
String sChar( cSave );
rCC.toLower( sChar );
- if( sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar ))
+ if( sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar ))
{
if( SaveWordWrdSttLst & nFlags )
rDoc.SaveCpltSttWord( CptlSttWrd, nSttPos, sWord, cSave );
@@ -888,7 +924,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
String sChar( *pWordStt );
rCC.toUpper( sChar );
return sChar != *pWordStt &&
- rDoc.Replace( xub_StrLen( pWordStt - pStart ), sChar );
+ rDoc.ReplaceRange( xub_StrLen( pWordStt - pStart ), 1, sChar );
}
aText = *pPrevPara;
@@ -1068,7 +1104,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.GetBuffer() );
String sChar( cSave );
rCC.toUpper( sChar );
- sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar );
+ sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar );
// das Wort will vielleicht jemand haben
if( bRet && SaveWordCplSttLst & nFlags )
@@ -1299,7 +1335,7 @@ sal_uLong SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
eLang = MsLangId::getSystemLanguage();
CharClass& rCC = GetCharClass( eLang );
- // Bug 19285: Symbolzeichen nicht anfassen
+ // no symbol characters
if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nInsPos ))
break;
@@ -1368,13 +1404,16 @@ sal_uLong SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
else
{
nRet = 0;
+ bool bUnsupported = lcl_IsUnsupportedUnicodeChar( rCC, rTxt, nCapLttrPos, nInsPos );
// Grossbuchstabe am Satz-Anfang ??
- if( IsAutoCorrFlag( CptlSttSntnc ) &&
+ if( !bUnsupported &&
+ IsAutoCorrFlag( CptlSttSntnc ) &&
FnCptlSttSntnc( rDoc, rTxt, sal_True, nCapLttrPos, nInsPos, eLang ) )
nRet |= CptlSttSntnc;
// Zwei Grossbuchstaben am Wort-Anfang ??
- if( IsAutoCorrFlag( CptlSttWrd ) &&
+ if( !bUnsupported &&
+ IsAutoCorrFlag( CptlSttWrd ) &&
FnCptlSttWrd( rDoc, rTxt, nCapLttrPos, nInsPos, eLang ) )
nRet |= CptlSttWrd;
diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx
index d81af6ccff0c..bc2245e7e6a9 100644..100755
--- a/editeng/source/uno/unofdesc.cxx
+++ b/editeng/source/uno/unofdesc.cxx
@@ -91,11 +91,11 @@ void SvxUnoFontDescriptor::FillItemSet( const awt::FontDescriptor& rDesc, SfxIte
{
SvxFontItem aFontItem( EE_CHAR_FONTINFO );
- aFontItem.GetFamilyName()= rDesc.Name;
- aFontItem.GetStyleName() = rDesc.StyleName;
- aFontItem.GetFamily() = (FontFamily)rDesc.Family;
- aFontItem.GetCharSet() = rDesc.CharSet;
- aFontItem.GetPitch() = (FontPitch)rDesc.Pitch;
+ aFontItem.SetFamilyName( rDesc.Name);
+ aFontItem.SetStyleName( rDesc.StyleName);
+ aFontItem.SetFamily( (FontFamily)rDesc.Family);
+ aFontItem.SetCharSet( rDesc.CharSet );
+ aFontItem.SetPitch( (FontPitch)rDesc.Pitch);
rSet.Put(aFontItem);
}
diff --git a/formula/inc/formula/compiler.hrc b/formula/inc/formula/compiler.hrc
index e4dc05aca4e9..5c58d9d3e068 100644
--- a/formula/inc/formula/compiler.hrc
+++ b/formula/inc/formula/compiler.hrc
@@ -130,67 +130,71 @@
#define SC_OPCODE_ARC_COS_HYP 95
#define SC_OPCODE_ARC_TAN_HYP 96
#define SC_OPCODE_ARC_COT_HYP 97
-#define SC_OPCODE_EXP 98
-#define SC_OPCODE_LN 99
-#define SC_OPCODE_SQRT 100
-#define SC_OPCODE_FACT 101
-#define SC_OPCODE_GET_YEAR 102 /* date and time */
-#define SC_OPCODE_GET_MONTH 103
-#define SC_OPCODE_GET_DAY 104
-#define SC_OPCODE_GET_HOUR 105
-#define SC_OPCODE_GET_MIN 106
-#define SC_OPCODE_GET_SEC 107
-#define SC_OPCODE_PLUS_MINUS 108 /* miscellaneous */
-#define SC_OPCODE_ABS 109
-#define SC_OPCODE_INT 110
-#define SC_OPCODE_PHI 111
-#define SC_OPCODE_GAUSS 112
-#define SC_OPCODE_IS_EMPTY 113 /* obtain type */
-#define SC_OPCODE_IS_STRING 114
-#define SC_OPCODE_IS_NON_STRING 115
-#define SC_OPCODE_IS_LOGICAL 116
-#define SC_OPCODE_TYPE 117
-#define SC_OPCODE_IS_REF 118
-#define SC_OPCODE_IS_VALUE 119
-#define SC_OPCODE_IS_FORMULA 120
-#define SC_OPCODE_IS_NV 121
-#define SC_OPCODE_IS_ERR 122
-#define SC_OPCODE_IS_ERROR 123
-#define SC_OPCODE_IS_EVEN 124
-#define SC_OPCODE_IS_ODD 125
-#define SC_OPCODE_N 126
-#define SC_OPCODE_GET_DATE_VALUE 127 /* string functions */
-#define SC_OPCODE_GET_TIME_VALUE 128
-#define SC_OPCODE_CODE 129
-#define SC_OPCODE_TRIM 130
-#define SC_OPCODE_UPPER 131
-#define SC_OPCODE_PROPPER 132
-#define SC_OPCODE_LOWER 133
-#define SC_OPCODE_LEN 134
-#define SC_OPCODE_T 135 /* miscellaneous, part 21 */
-#define SC_OPCODE_VALUE 136
-#define SC_OPCODE_CLEAN 137
-#define SC_OPCODE_CHAR 138
-#define SC_OPCODE_LOG10 139
-#define SC_OPCODE_EVEN 140
-#define SC_OPCODE_ODD 141
-#define SC_OPCODE_STD_NORM_DIST 142
-#define SC_OPCODE_FISHER 143
-#define SC_OPCODE_FISHER_INV 144
-#define SC_OPCODE_S_NORM_INV 145
-#define SC_OPCODE_GAMMA_LN 146
-#define SC_OPCODE_ERROR_TYPE 147
-#define SC_OPCODE_ERR_CELL 148
-#define SC_OPCODE_FORMULA 149
-#define SC_OPCODE_ARABIC 150
-#define SC_OPCODE_INFO 151
-#define SC_OPCODE_BAHTTEXT 152
-#define SC_OPCODE_JIS 153
-#define SC_OPCODE_ASC 154
-#define SC_OPCODE_UNICODE 155
-#define SC_OPCODE_UNICHAR 156
-#define SC_OPCODE_GAMMA 157
-#define SC_OPCODE_STOP_1_PAR 158
+#define SC_OPCODE_COSECANT 98
+#define SC_OPCODE_SECANT 99
+#define SC_OPCODE_COSECANT_HYP 100
+#define SC_OPCODE_SECANT_HYP 101
+#define SC_OPCODE_EXP 102
+#define SC_OPCODE_LN 103
+#define SC_OPCODE_SQRT 104
+#define SC_OPCODE_FACT 105
+#define SC_OPCODE_GET_YEAR 106 /* date and time */
+#define SC_OPCODE_GET_MONTH 107
+#define SC_OPCODE_GET_DAY 108
+#define SC_OPCODE_GET_HOUR 109
+#define SC_OPCODE_GET_MIN 110
+#define SC_OPCODE_GET_SEC 111
+#define SC_OPCODE_PLUS_MINUS 112 /* miscellaneous */
+#define SC_OPCODE_ABS 113
+#define SC_OPCODE_INT 114
+#define SC_OPCODE_PHI 115
+#define SC_OPCODE_GAUSS 116
+#define SC_OPCODE_IS_EMPTY 117 /* obtain type */
+#define SC_OPCODE_IS_STRING 118
+#define SC_OPCODE_IS_NON_STRING 119
+#define SC_OPCODE_IS_LOGICAL 120
+#define SC_OPCODE_TYPE 121
+#define SC_OPCODE_IS_REF 122
+#define SC_OPCODE_IS_VALUE 123
+#define SC_OPCODE_IS_FORMULA 124
+#define SC_OPCODE_IS_NV 125
+#define SC_OPCODE_IS_ERR 126
+#define SC_OPCODE_IS_ERROR 127
+#define SC_OPCODE_IS_EVEN 128
+#define SC_OPCODE_IS_ODD 129
+#define SC_OPCODE_N 130
+#define SC_OPCODE_GET_DATE_VALUE 131 /* string functions */
+#define SC_OPCODE_GET_TIME_VALUE 132
+#define SC_OPCODE_CODE 133
+#define SC_OPCODE_TRIM 134
+#define SC_OPCODE_UPPER 135
+#define SC_OPCODE_PROPPER 136
+#define SC_OPCODE_LOWER 137
+#define SC_OPCODE_LEN 138
+#define SC_OPCODE_T 139 /* miscellaneous, part 21 */
+#define SC_OPCODE_VALUE 140
+#define SC_OPCODE_CLEAN 141
+#define SC_OPCODE_CHAR 142
+#define SC_OPCODE_LOG10 143
+#define SC_OPCODE_EVEN 144
+#define SC_OPCODE_ODD 145
+#define SC_OPCODE_STD_NORM_DIST 146
+#define SC_OPCODE_FISHER 147
+#define SC_OPCODE_FISHER_INV 148
+#define SC_OPCODE_S_NORM_INV 149
+#define SC_OPCODE_GAMMA_LN 150
+#define SC_OPCODE_ERROR_TYPE 151
+#define SC_OPCODE_ERR_CELL 152
+#define SC_OPCODE_FORMULA 153
+#define SC_OPCODE_ARABIC 154
+#define SC_OPCODE_INFO 155
+#define SC_OPCODE_BAHTTEXT 156
+#define SC_OPCODE_JIS 157
+#define SC_OPCODE_ASC 158
+#define SC_OPCODE_UNICODE 159
+#define SC_OPCODE_UNICHAR 160
+#define SC_OPCODE_GAMMA 161
+#define SC_OPCODE_STOP_1_PAR 162
/*** Functions with more than one parameters ***/
#define SC_OPCODE_START_2_PAR 201
diff --git a/formula/inc/formula/opcode.hxx b/formula/inc/formula/opcode.hxx
index cfd3af767465..0e70ffc01e44 100644
--- a/formula/inc/formula/opcode.hxx
+++ b/formula/inc/formula/opcode.hxx
@@ -121,6 +121,10 @@ enum OpCodeEnum
ocArcCosHyp = SC_OPCODE_ARC_COS_HYP,
ocArcTanHyp = SC_OPCODE_ARC_TAN_HYP,
ocArcCotHyp = SC_OPCODE_ARC_COT_HYP,
+ ocCosecant = SC_OPCODE_COSECANT,
+ ocSecant = SC_OPCODE_SECANT,
+ ocCosecantHyp = SC_OPCODE_COSECANT_HYP,
+ ocSecantHyp = SC_OPCODE_SECANT_HYP,
ocExp = SC_OPCODE_EXP,
ocLn = SC_OPCODE_LN,
ocSqrt = SC_OPCODE_SQRT,
diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src
index d2996e78fba7..b8a5f1250941 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -88,6 +88,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
String SC_OPCODE_ARC_COS_HYP { Text = "ACOSH" ; };
String SC_OPCODE_ARC_TAN_HYP { Text = "ATANH" ; };
String SC_OPCODE_ARC_COT_HYP { Text = "ACOTH" ; };
+ String SC_OPCODE_COSECANT { Text = "CSC" ; };
+ String SC_OPCODE_SECANT { Text = "SEC" ; };
+ String SC_OPCODE_COSECANT_HYP { Text = "CSCH" ; };
+ String SC_OPCODE_SECANT_HYP { Text = "SECH" ; };
String SC_OPCODE_EXP { Text = "EXP" ; };
String SC_OPCODE_LN { Text = "LN" ; };
String SC_OPCODE_SQRT { Text = "SQRT" ; };
@@ -412,6 +416,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
String SC_OPCODE_ARC_COS_HYP { Text = "ACOSH" ; };
String SC_OPCODE_ARC_TAN_HYP { Text = "ATANH" ; };
String SC_OPCODE_ARC_COT_HYP { Text = "ACOTH" ; };
+ String SC_OPCODE_COSECANT { Text = "CSC" ; };
+ String SC_OPCODE_SECANT { Text = "SEC" ; };
+ String SC_OPCODE_COSECANT_HYP { Text = "CSCH" ; };
+ String SC_OPCODE_SECANT_HYP { Text = "SECH" ; };
String SC_OPCODE_EXP { Text = "EXP" ; };
String SC_OPCODE_LN { Text = "LN" ; };
String SC_OPCODE_SQRT { Text = "SQRT" ; };
@@ -830,6 +838,22 @@ Resource RID_STRLIST_FUNCTION_NAMES
{
Text [ en-US ] = "ACOTH" ;
};
+ String SC_OPCODE_COSECANT
+ {
+ Text = "CSC" ;
+ };
+ String SC_OPCODE_SECANT
+ {
+ Text = "SEC" ;
+ };
+ String SC_OPCODE_COSECANT_HYP
+ {
+ Text = "CSCH" ;
+ };
+ String SC_OPCODE_SECANT_HYP
+ {
+ Text = "SECH" ;
+ };
String SC_OPCODE_EXP
{
Text [ en-US ] = "EXP";
diff --git a/framework/inc/services/substitutepathvars.hxx b/framework/inc/services/substitutepathvars.hxx
index 9bf4b1ead43d..8825386d1b57 100644
--- a/framework/inc/services/substitutepathvars.hxx
+++ b/framework/inc/services/substitutepathvars.hxx
@@ -36,7 +36,7 @@
#include <hash_map>
//_________________________________________________________________________________________________________________
-// my own includes
+// my own includes
//_________________________________________________________________________________________________________________
#include <threadhelp/threadhelpbase.hxx>
#include <macros/generic.hxx>
@@ -46,7 +46,7 @@
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
-// interface includes
+// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
@@ -54,7 +54,7 @@
#include <com/sun/star/util/XStringSubstitution.hpp>
//_________________________________________________________________________________________________________________
-// other includes
+// other includes
//_________________________________________________________________________________________________________________
#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
@@ -68,24 +68,24 @@ namespace framework
// Must be zero value based
enum EnvironmentType
{
- ET_HOST = 0 ,
- ET_YPDOMAIN ,
- ET_DNSDOMAIN ,
- ET_NTDOMAIN ,
- ET_OS ,
- ET_UNKNOWN ,
- ET_COUNT
+ ET_HOST = 0 ,
+ ET_YPDOMAIN ,
+ ET_DNSDOMAIN ,
+ ET_NTDOMAIN ,
+ ET_OS ,
+ ET_UNKNOWN ,
+ ET_COUNT
};
// Must be zero value based
enum OperatingSystem
{
- OS_WINDOWS = 0,
- OS_UNIX ,
- OS_SOLARIS ,
- OS_LINUX ,
- OS_UNKNOWN ,
- OS_COUNT
+ OS_WINDOWS = 0,
+ OS_UNIX ,
+ OS_SOLARIS ,
+ OS_LINUX ,
+ OS_UNKNOWN ,
+ OS_COUNT
};
struct SubstituteRule
@@ -97,15 +97,16 @@ struct SubstituteRule
EnvironmentType aType ) :
aSubstVariable( aVarName ), aSubstValue( aValue ), aEnvValue( aVal ), aEnvType( aType ) {}
- rtl::OUString aSubstVariable;
- rtl::OUString aSubstValue;
- com::sun::star::uno::Any aEnvValue;
- EnvironmentType aEnvType;
+ rtl::OUString aSubstVariable;
+ rtl::OUString aSubstValue;
+ com::sun::star::uno::Any aEnvValue;
+ EnvironmentType aEnvType;
};
struct SubstitutePathNotify
{
SubstitutePathNotify() {};
+
const com::sun::star::uno::Sequence<rtl::OUString> aPropertyNames;
};
@@ -131,45 +132,45 @@ class SubstitutePathVariables_Impl : public utl::ConfigItem
static OperatingSystem GetOperatingSystemFromString( const rtl::OUString& );
static EnvironmentType GetEnvTypeFromString( const rtl::OUString& );
- void GetSharePointsRules( SubstituteVariables& aSubstVarMap );
+ void GetSharePointsRules( SubstituteVariables& aSubstVarMap );
/** is called from the ConfigManager before application ends or from the
PropertyChangeListener if the sub tree broadcasts changes. */
- virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
- virtual void Commit();
-
- private:
- // Wrapper methods for low-level functions
- OperatingSystem GetOperatingSystem();
- const rtl::OUString& GetYPDomainName();
- const rtl::OUString& GetDNSDomainName();
- const rtl::OUString& GetNTDomainName();
- const rtl::OUString& GetHostName();
-
- sal_Bool FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule );
-
- void ReadSharePointsFromConfiguration( com::sun::star::uno::Sequence< rtl::OUString >& aSharePointsSeq );
- void ReadSharePointRuleSetFromConfiguration( const rtl::OUString& aSharePointName,
- const rtl::OUString& aSharePointNodeName,
- SubstituteRuleVector& aRuleSet );
-
- // Stored values for domains and host
- sal_Bool m_bYPDomainRetrieved;
- rtl::OUString m_aYPDomain;
- sal_Bool m_bDNSDomainRetrieved;
- rtl::OUString m_aDNSDomain;
- sal_Bool m_bNTDomainRetrieved;
- rtl::OUString m_aNTDomain;
- sal_Bool m_bHostRetrieved;
- rtl::OUString m_aHost;
- sal_Bool m_bOSRetrieved;
- OperatingSystem m_eOSType;
-
- Link m_aListenerNotify;
- const rtl::OUString m_aSharePointsNodeName;
- const rtl::OUString m_aDirPropertyName;
- const rtl::OUString m_aEnvPropertyName;
- const rtl::OUString m_aLevelSep;
+ virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
+ virtual void Commit();
+
+ private:
+ // Wrapper methods for low-level functions
+ OperatingSystem GetOperatingSystem();
+ const rtl::OUString& GetYPDomainName();
+ const rtl::OUString& GetDNSDomainName();
+ const rtl::OUString& GetNTDomainName();
+ const rtl::OUString& GetHostName();
+
+ bool FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule );
+
+ void ReadSharePointsFromConfiguration( com::sun::star::uno::Sequence< rtl::OUString >& aSharePointsSeq );
+ void ReadSharePointRuleSetFromConfiguration( const rtl::OUString& aSharePointName,
+ const rtl::OUString& aSharePointNodeName,
+ SubstituteRuleVector& aRuleSet );
+
+ // Stored values for domains and host
+ bool m_bYPDomainRetrieved;
+ rtl::OUString m_aYPDomain;
+ bool m_bDNSDomainRetrieved;
+ rtl::OUString m_aDNSDomain;
+ bool m_bNTDomainRetrieved;
+ rtl::OUString m_aNTDomain;
+ bool m_bHostRetrieved;
+ rtl::OUString m_aHost;
+ bool m_bOSRetrieved;
+ OperatingSystem m_eOSType;
+
+ Link m_aListenerNotify;
+ const rtl::OUString m_aSharePointsNodeName;
+ const rtl::OUString m_aDirPropertyName;
+ const rtl::OUString m_aEnvPropertyName;
+ const rtl::OUString m_aLevelSep;
};
enum PreDefVariable
@@ -234,8 +235,8 @@ struct ReSubstUserVarOrder
typedef std::list< ReSubstFixedVarOrder > ReSubstFixedVarOrderVector;
typedef std::list< ReSubstUserVarOrder > ReSubstUserVarOrderVector;
-class SubstitutePathVariables : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringSubstitution, css::lang::XServiceInfo>
+class SubstitutePathVariables : private ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringSubstitution, css::lang::XServiceInfo >
{
friend class SubstitutePathVariables_Impl;
@@ -254,51 +255,51 @@ class SubstitutePathVariables : private ThreadHelpBase
virtual ::rtl::OUString SAL_CALL getSubstituteVariableValue( const ::rtl::OUString& variable )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- protected:
- DECL_LINK( implts_ConfigurationNotify, SubstitutePathNotify* );
-
- void SetPredefinedPathVariables( PredefinedPathVariables& );
- rtl::OUString ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const;
-
- // Special case (transient) values can change during runtime!
- // Don't store them in the pre defined struct
- rtl::OUString GetWorkPath() const;
- rtl::OUString GetWorkVariableValue() const;
- rtl::OUString GetPathVariableValue() const;
-
- rtl::OUString GetHomeVariableValue() const;
-
- // XStringSubstitution implementation methods
- rtl::OUString impl_substituteVariable( const ::rtl::OUString& aText, sal_Bool bSustRequired )
- throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- rtl::OUString impl_reSubstituteVariables( const ::rtl::OUString& aText )
- throw (::com::sun::star::uno::RuntimeException);
- ::rtl::OUString impl_getSubstituteVariableValue( const ::rtl::OUString& variable )
- throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
-
- private:
- class VarNameToIndexMap : public std::hash_map< ::rtl::OUString,
- PreDefVariable,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > >
- {
- inline void free()
+ protected:
+ DECL_LINK( implts_ConfigurationNotify, SubstitutePathNotify* );
+
+ void SetPredefinedPathVariables( PredefinedPathVariables& );
+ rtl::OUString ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const;
+
+ // Special case (transient) values can change during runtime!
+ // Don't store them in the pre defined struct
+ rtl::OUString GetWorkPath() const;
+ rtl::OUString GetWorkVariableValue() const;
+ rtl::OUString GetPathVariableValue() const;
+
+ rtl::OUString GetHomeVariableValue() const;
+
+ // XStringSubstitution implementation methods
+ rtl::OUString impl_substituteVariable( const ::rtl::OUString& aText, bool bSustRequired )
+ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ rtl::OUString impl_reSubstituteVariables( const ::rtl::OUString& aText )
+ throw (::com::sun::star::uno::RuntimeException);
+ ::rtl::OUString impl_getSubstituteVariableValue( const ::rtl::OUString& variable )
+ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+
+ private:
+ class VarNameToIndexMap : public std::hash_map< ::rtl::OUString,
+ PreDefVariable,
+ OUStringHashCode,
+ ::std::equal_to< ::rtl::OUString > >
{
- VarNameToIndexMap().swap( *this );
- }
- };
-
- // heavy used string
- const rtl::OUString m_aVarStart;
- const rtl::OUString m_aVarEnd;
-
- VarNameToIndexMap m_aPreDefVarMap; // Mapping from pre-def variable names to enum for array access
- SubstituteVariables m_aSubstVarMap; // Active rule set map indexed by variable name!
- PredefinedPathVariables m_aPreDefVars; // All predefined variables
- SubstitutePathVariables_Impl m_aImpl; // Implementation class that access the configuration
- ReSubstFixedVarOrderVector m_aReSubstFixedVarOrder; // To speed up resubstitution fixed variables (order for lookup)
- ReSubstUserVarOrderVector m_aReSubstUserVarOrder; // To speed up resubstitution user variables
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ inline void free()
+ {
+ VarNameToIndexMap().swap( *this );
+ }
+ };
+
+ // heavy used string
+ const rtl::OUString m_aVarStart;
+ const rtl::OUString m_aVarEnd;
+
+ VarNameToIndexMap m_aPreDefVarMap; // Mapping from pre-def variable names to enum for array access
+ SubstituteVariables m_aSubstVarMap; // Active rule set map indexed by variable name!
+ PredefinedPathVariables m_aPreDefVars; // All predefined variables
+ SubstitutePathVariables_Impl m_aImpl; // Implementation class that access the configuration
+ ReSubstFixedVarOrderVector m_aReSubstFixedVarOrder; // To speed up resubstitution fixed variables (order for lookup)
+ ReSubstUserVarOrderVector m_aReSubstUserVarOrder; // To speed up resubstitution user variables
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
};
}
diff --git a/framework/qa/complex/path_substitution/PathSubstitutionTest.java b/framework/qa/complex/path_substitution/PathSubstitutionTest.java
index aeea9907e6bc..e936fbf6ccad 100755
--- a/framework/qa/complex/path_substitution/PathSubstitutionTest.java
+++ b/framework/qa/complex/path_substitution/PathSubstitutionTest.java
@@ -63,20 +63,20 @@ public class PathSubstitutionTest
/**
* Create an array with all substitution variables
*/
- @Before private void initialize()
+ @Before public void initialize()
{
substVars = new VariableContainer();
- substVars.add("$(prog)", false, true);
- substVars.add("$(inst)", false, true);
- substVars.add("$(user)", false, true);
- substVars.add("$(work)", false, true);
- substVars.add("$(home)", false, true);
- substVars.add("$(temp)", false, true);
+ substVars.add("$(prog)", true, true);
+ substVars.add("$(inst)", true, true);
+ substVars.add("$(user)", true, true);
+ substVars.add("$(work)", true, true);
+ substVars.add("$(home)", true, true);
+ substVars.add("$(temp)", true, true);
substVars.add("$(lang)", false, false);
substVars.add("$(langid)", false, false);
substVars.add("$(vlang)", false, false);
// path won't resubstitute
- substVars.add("$(path)", false, false);
+ substVars.add("$(path)", true, false);
}
/**
@@ -106,8 +106,6 @@ public class PathSubstitutionTest
return;
}
-// initialize();
-
for (int i = 0; i < substVars.size(); i++)
{
String var = substVars.getVariable(i);
@@ -148,6 +146,12 @@ public class PathSubstitutionTest
//in middle of text works
substString = "file:///starting/" + var + "/path";
+ String sCanSubstAllPos;
+ if (substVars.onlySubstituteAtBegin(i))
+ sCanSubstAllPos = "NO";
+ else
+ sCanSubstAllPos = "YES";
+ System.out.println("Variable can substitute within string: "+sCanSubstAllPos);
System.out.println("Substitute '" + substString + "'");
newValue = oObj.substituteVariables(substString, false);
System.out.println("Return value '" + newValue + "'");
diff --git a/framework/qa/unoapi/makefile.mk b/framework/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..38a6cf7cced8
--- /dev/null
+++ b/framework/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# 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.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = framework
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/framework/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 1d1e877a5a86..780efb1f3c6d 100644..100755
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -400,7 +400,7 @@ void BackingWindow::prepareRecentFileMenu()
void BackingWindow::initBackground()
{
- SetBackground( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
+ SetBackground();
bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode();
if( bDark )
@@ -707,36 +707,39 @@ void BackingWindow::layoutButton(
void BackingWindow::Paint( const Rectangle& )
{
+ Wallpaper aBack( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
+ Region aClip( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
+ Rectangle aBmpRect(maControlRect);
+ aBmpRect.Left() -= nShadowLeft;
+ aBmpRect.Top() -= nShadowTop;
+ aBmpRect.Right() += nShadowRight;
+ aBmpRect.Bottom() += nShadowBottom;
+ aClip.Exclude( aBmpRect );
+ Push( PUSH_CLIPREGION );
+ IntersectClipRegion( aClip );
+ DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack );
+ Pop();
+
+ VirtualDevice aDev( *this );
+ aDev.EnableRTL( IsRTLEnabled() );
+ aDev.SetOutputSizePixel( aBmpRect.GetSize() );
+ Point aOffset( Point( 0, 0 ) - aBmpRect.TopLeft() );
+ aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack );
// draw bitmap
- if( GetSettings().GetLayoutRTL() )
+ Point aTL( 0, 0 );
+ aDev.DrawBitmapEx( aTL, maBackgroundLeft );
+ aTL.X() += maBackgroundLeft.GetSizePixel().Width();
+ if( !!maBackgroundMiddle )
{
- Point aTL( maControlRect.TopLeft() );
- aTL.X() -= nShadowRight;
- aTL.Y() -= nShadowTop;
- DrawBitmapEx( aTL, maBackgroundLeft );
- aTL.X() += maBackgroundLeft.GetSizePixel().Width();
- if( !!maBackgroundMiddle )
- {
- DrawBitmapEx( aTL, maBackgroundMiddle );
- aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
- }
- DrawBitmapEx( aTL, maBackgroundRight );
- }
- else
- {
- Point aTL( maControlRect.TopLeft() );
- aTL.X() -= nShadowLeft;
- aTL.Y() -= nShadowTop;
- DrawBitmapEx( aTL, maBackgroundLeft );
- aTL.X() += maBackgroundLeft.GetSizePixel().Width();
- if( !!maBackgroundMiddle )
- {
- DrawBitmapEx( aTL, maBackgroundMiddle );
- aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
- }
- DrawBitmapEx( aTL, maBackgroundRight );
+ aDev.DrawBitmapEx( aTL, maBackgroundMiddle );
+ aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
}
+ aDev.DrawBitmapEx( aTL, maBackgroundRight );
+
+ DrawOutDev( aBmpRect.TopLeft(), aBmpRect.GetSize(),
+ Point( 0, 0 ), aBmpRect.GetSize(),
+ aDev );
}
long BackingWindow::Notify( NotifyEvent& rNEvt )
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index 90c460b74298..b66d21cfe81c 100644..100755
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -29,7 +29,7 @@
#include "precompiled_framework.hxx"
//_________________________________________________________________________________________________________________
-// my own includes
+// my own includes
//_________________________________________________________________________________________________________________
#include "services/substitutepathvars.hxx"
#include <threadhelp/resetableguard.hxx>
@@ -37,12 +37,12 @@
#include "services.h"
//_________________________________________________________________________________________________________________
-// interface includes
+// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/beans/XPropertySet.hpp>
//_________________________________________________________________________________________________________________
-// includes of other projects
+// includes of other projects
//_________________________________________________________________________________________________________________
#include <unotools/configitem.hxx>
#include <unotools/localfilehelper.hxx>
@@ -69,38 +69,38 @@
#include <string.h>
//_________________________________________________________________________________________________________________
-// Defines
+// Defines
//_________________________________________________________________________________________________________________
//
-#define STRPOS_NOTFOUND (sal_Int32)-1
+#define STRPOS_NOTFOUND (sal_Int32)-1
-#define ASCII_STR( val ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( val ))
+#define ASCII_STR( val ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( val ))
-#define SEARCHPATH_DELIMITER ';'
+#define SEARCHPATH_DELIMITER ';'
// Variable start/end characters
-#define SIGN_STARTVARIABLE ASCII_STR("$(")
-#define SIGN_ENDVARIABLE ASCII_STR(")")
+#define SIGN_STARTVARIABLE ASCII_STR("$(")
+#define SIGN_ENDVARIABLE ASCII_STR(")")
// Length of SUBSTITUTE_... to replace it with real values.
-#define REPLACELENGTH_INST 7
-#define REPLACELENGTH_PROG 7
-#define REPLACELENGTH_USER 7
-#define REPLACELENGTH_WORK 7
-#define REPLACELENGTH_HOME 7
-#define REPLACELENGTH_TEMP 7
-#define REPLACELENGTH_PATH 7
+#define REPLACELENGTH_INST 7
+#define REPLACELENGTH_PROG 7
+#define REPLACELENGTH_USER 7
+#define REPLACELENGTH_WORK 7
+#define REPLACELENGTH_HOME 7
+#define REPLACELENGTH_TEMP 7
+#define REPLACELENGTH_PATH 7
#define REPLACELENGTH_INSTPATH 11
#define REPLACELENGTH_PROGPATH 11
#define REPLACELENGTH_USERPATH 11
#define REPLACELENGTH_INSTURL 10
#define REPLACELENGTH_PROGURL 10
#define REPLACELENGTH_USERURL 10
-#define REPLACELENGTH_PATH 7
-#define REPLACELENGTH_LANG 7
-#define REPLACELENGTH_LANGID 9
-#define REPLACELENGTH_VLANG 8
+#define REPLACELENGTH_PATH 7
+#define REPLACELENGTH_LANG 7
+#define REPLACELENGTH_LANGID 9
+#define REPLACELENGTH_VLANG 8
#define REPLACELENGTH_WORKDIRURL 13
// --> PB 2004-10-27 #i32656# - new variable of hierachy service
#define REPLACELENGTH_BASEINSTURL 14
@@ -108,27 +108,28 @@
// <--
// Name of the pre defined path variables
-#define VARIABLE_INST "$(inst)"
-#define VARIABLE_PROG "$(prog)"
-#define VARIABLE_USER "$(user)"
-#define VARIABLE_WORK "$(work)"
-#define VARIABLE_HOME "$(home)"
-#define VARIABLE_TEMP "$(temp)"
-#define VARIABLE_PATH "$(path)"
-#define VARIABLE_LANG "$(lang)"
-#define VARIABLE_LANGID "$(langid)"
-#define VARIABLE_VLANG "$(vlang)"
-#define VARIABLE_INSTPATH "$(instpath)"
-#define VARIABLE_PROGPATH "$(progpath)"
-#define VARIABLE_USERPATH "$(userpath)"
-#define VARIABLE_INSTURL "$(insturl)"
-#define VARIABLE_PROGURL "$(progurl)"
-#define VARIABLE_USERURL "$(userurl)"
-#define VARIABLE_WORKDIRURL "$(workdirurl)"
+#define VARIABLE_INST "$(inst)"
+#define VARIABLE_PROG "$(prog)"
+#define VARIABLE_USER "$(user)"
+#define VARIABLE_WORK "$(work)"
+#define VARIABLE_HOME "$(home)"
+#define VARIABLE_TEMP "$(temp)"
+#define VARIABLE_PATH "$(path)"
+#define VARIABLE_LANG "$(lang)"
+#define VARIABLE_LANGID "$(langid)"
+#define VARIABLE_VLANG "$(vlang)"
+#define VARIABLE_INSTPATH "$(instpath)"
+#define VARIABLE_PROGPATH "$(progpath)"
+#define VARIABLE_USERPATH "$(userpath)"
+#define VARIABLE_INSTURL "$(insturl)"
+#define VARIABLE_PROGURL "$(progurl)"
+#define VARIABLE_USERURL "$(userurl)"
+#define VARIABLE_WORKDIRURL "$(workdirurl)"
// --> PB 2004-10-27 #i32656# - new variable of hierachy service
-#define VARIABLE_BASEINSTURL "$(baseinsturl)"
-#define VARIABLE_USERDATAURL "$(userdataurl)"
+#define VARIABLE_BASEINSTURL "$(baseinsturl)"
+#define VARIABLE_USERDATAURL "$(userdataurl)"
// <--
+#define VARIABLE_BRANDBASEURL "$(brandbaseurl)"
using namespace com::sun::star::uno;
using namespace com::sun::star::beans;
@@ -137,7 +138,7 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::container;
//_________________________________________________________________________________________________________________
-// Namespace
+// Namespace
//_________________________________________________________________________________________________________________
//
@@ -149,6 +150,7 @@ struct FixedVariable
const char* pVarName;
PreDefVariable nEnumValue;
int nStrLen;
+ bool bAbsPath;
};
struct TableEntry
@@ -162,11 +164,11 @@ struct TableEntry
// of the string
static TableEntry aOSTable[OS_COUNT] =
{
- { "WINDOWS" , 7 },
- { "UNIX" , 4 },
- { "SOLARIS" , 7 },
- { "LINUX" , 5 },
- { "" , 0 } // unknown
+ { "WINDOWS" , 7 },
+ { "UNIX" , 4 },
+ { "SOLARIS" , 7 },
+ { "LINUX" , 5 },
+ { "" , 0 } // unknown
};
// Table with valid environment variables
@@ -174,12 +176,12 @@ static TableEntry aOSTable[OS_COUNT] =
// the length of the string.
static TableEntry aEnvTable[ET_COUNT] =
{
- { "HOST" , 4 },
- { "YPDOMAIN" , 8 },
- { "DNSDOMAIN" , 9 },
- { "NTDOMAIN" , 8 },
- { "OS" , 2 },
- { "" , 0 } // unknown
+ { "HOST" , 4 },
+ { "YPDOMAIN" , 8 },
+ { "DNSDOMAIN" , 9 },
+ { "NTDOMAIN" , 8 },
+ { "OS" , 2 },
+ { "" , 0 } // unknown
};
// Priority table for the environment types. Lower numbers define
@@ -187,44 +189,43 @@ static TableEntry aEnvTable[ET_COUNT] =
// that the first match wins!!
static sal_Int16 aEnvPrioTable[ET_COUNT] =
{
- 1, // ET_HOST
- 2, // ET_IPDOMAIN
- 2, // ET_DNSDOMAIN
- 2, // ET_NTDOMAIN
- 3, // ET_OS
- 99, // ET_UNKNOWN
+ 1, // ET_HOST
+ 2, // ET_IPDOMAIN
+ 2, // ET_DNSDOMAIN
+ 2, // ET_NTDOMAIN
+ 3, // ET_OS
+ 99, // ET_UNKNOWN
};
// Table with all fixed/predefined variables supported.
static FixedVariable aFixedVarTable[] =
{
- { VARIABLE_INST, PREDEFVAR_INST, REPLACELENGTH_INST },
- { VARIABLE_PROG, PREDEFVAR_PROG, REPLACELENGTH_PROG },
- { VARIABLE_USER, PREDEFVAR_USER, REPLACELENGTH_USER },
- { VARIABLE_WORK, PREDEFVAR_WORK, REPLACELENGTH_WORK }, // Special variable (transient)!
- { VARIABLE_HOME, PREDEFVAR_HOME, REPLACELENGTH_HOME },
- { VARIABLE_TEMP, PREDEFVAR_TEMP, REPLACELENGTH_TEMP },
- { VARIABLE_PATH, PREDEFVAR_PATH, REPLACELENGTH_PATH },
- { VARIABLE_LANG, PREDEFVAR_LANG, REPLACELENGTH_LANG },
- { VARIABLE_LANGID, PREDEFVAR_LANGID, REPLACELENGTH_LANGID },
- { VARIABLE_VLANG, PREDEFVAR_VLANG, REPLACELENGTH_VLANG },
- { VARIABLE_INSTPATH, PREDEFVAR_INSTPATH, REPLACELENGTH_INSTPATH },
- { VARIABLE_PROGPATH, PREDEFVAR_PROGPATH, REPLACELENGTH_PROGPATH },
- { VARIABLE_USERPATH, PREDEFVAR_USERPATH, REPLACELENGTH_USERPATH },
- { VARIABLE_INSTURL, PREDEFVAR_INSTURL, REPLACELENGTH_INSTURL },
- { VARIABLE_PROGURL, PREDEFVAR_PROGURL, REPLACELENGTH_PROGURL },
- { VARIABLE_USERURL, PREDEFVAR_USERURL, REPLACELENGTH_USERURL },
- { VARIABLE_WORKDIRURL, PREDEFVAR_WORKDIRURL, REPLACELENGTH_WORKDIRURL }, // Special variable (transient) and don't use for resubstitution!
+ { VARIABLE_INST, PREDEFVAR_INST, REPLACELENGTH_INST, true },
+ { VARIABLE_PROG, PREDEFVAR_PROG, REPLACELENGTH_PROG, true },
+ { VARIABLE_USER, PREDEFVAR_USER, REPLACELENGTH_USER, true },
+ { VARIABLE_WORK, PREDEFVAR_WORK, REPLACELENGTH_WORK, true }, // Special variable (transient)!
+ { VARIABLE_HOME, PREDEFVAR_HOME, REPLACELENGTH_HOME, true },
+ { VARIABLE_TEMP, PREDEFVAR_TEMP, REPLACELENGTH_TEMP, true },
+ { VARIABLE_PATH, PREDEFVAR_PATH, REPLACELENGTH_PATH, true },
+ { VARIABLE_LANG, PREDEFVAR_LANG, REPLACELENGTH_LANG, false },
+ { VARIABLE_LANGID, PREDEFVAR_LANGID, REPLACELENGTH_LANGID, false },
+ { VARIABLE_VLANG, PREDEFVAR_VLANG, REPLACELENGTH_VLANG, false },
+ { VARIABLE_INSTPATH, PREDEFVAR_INSTPATH, REPLACELENGTH_INSTPATH, true },
+ { VARIABLE_PROGPATH, PREDEFVAR_PROGPATH, REPLACELENGTH_PROGPATH, true },
+ { VARIABLE_USERPATH, PREDEFVAR_USERPATH, REPLACELENGTH_USERPATH, true },
+ { VARIABLE_INSTURL, PREDEFVAR_INSTURL, REPLACELENGTH_INSTURL, true },
+ { VARIABLE_PROGURL, PREDEFVAR_PROGURL, REPLACELENGTH_PROGURL, true },
+ { VARIABLE_USERURL, PREDEFVAR_USERURL, REPLACELENGTH_USERURL, true },
+ { VARIABLE_WORKDIRURL, PREDEFVAR_WORKDIRURL, REPLACELENGTH_WORKDIRURL,true }, // Special variable (transient) and don't use for resubstitution!
// --> PB 2004-10-27 #i32656# - new variable of hierachy service
- { VARIABLE_BASEINSTURL, PREDEFVAR_BASEINSTURL, REPLACELENGTH_BASEINSTURL },
- { VARIABLE_USERDATAURL, PREDEFVAR_USERDATAURL, REPLACELENGTH_USERDATAURL },
+ { VARIABLE_BASEINSTURL, PREDEFVAR_BASEINSTURL, REPLACELENGTH_BASEINSTURL,true },
+ { VARIABLE_USERDATAURL, PREDEFVAR_USERDATAURL, REPLACELENGTH_USERDATAURL,true },
// <--
- { "$(brandbaseurl)", PREDEFVAR_BRANDBASEURL,
- RTL_CONSTASCII_LENGTH("$(brandbaseurl)") }
+ { VARIABLE_BRANDBASEURL,PREDEFVAR_BRANDBASEURL, RTL_CONSTASCII_LENGTH(VARIABLE_BRANDBASEURL), true }
};
//_________________________________________________________________________________________________________________
-// Implementation helper classes
+// Implementation helper classes
//_________________________________________________________________________________________________________________
//
@@ -252,11 +253,11 @@ EnvironmentType SubstitutePathVariables_Impl::GetEnvTypeFromString( const rtl::O
SubstitutePathVariables_Impl::SubstitutePathVariables_Impl( const Link& aNotifyLink ) :
utl::ConfigItem( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Substitution" ))),
- m_bYPDomainRetrieved( sal_False ),
- m_bDNSDomainRetrieved( sal_False ),
- m_bNTDomainRetrieved( sal_False ),
- m_bHostRetrieved( sal_False ),
- m_bOSRetrieved( sal_False ),
+ m_bYPDomainRetrieved( false ),
+ m_bDNSDomainRetrieved( false ),
+ m_bNTDomainRetrieved( false ),
+ m_bHostRetrieved( false ),
+ m_bOSRetrieved( false ),
m_aListenerNotify( aNotifyLink ),
m_aSharePointsNodeName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SharePoints" ))),
m_aDirPropertyName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/Directory" ))),
@@ -302,10 +303,9 @@ void SubstitutePathVariables_Impl::GetSharePointsRules( SubstituteVariables& aSu
// We have found an active rule
aActiveRule.aSubstVariable = aSharePointNames[ nSharePoints ];
aSubstVarMap.insert( SubstituteVariables::value_type(
- aActiveRule.aSubstVariable, aActiveRule ));
+ aActiveRule.aSubstVariable, aActiveRule ));
}
}
-
++nSharePoints;
}
}
@@ -322,7 +322,7 @@ void SubstitutePathVariables_Impl::Commit()
//_________________________________________________________________________________________________________________
-// private methods
+// private methods
//_________________________________________________________________________________________________________________
//
@@ -407,18 +407,19 @@ const rtl::OUString& SubstitutePathVariables_Impl::GetHostName()
return m_aHost;
}
-sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule )
+bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule )
{
- sal_Bool bResult = sal_False;
+ bool bResult = sal_False;
if ( !aRuleSet.empty() )
{
- sal_Int16 nPrioCurrentRule = aEnvPrioTable[ ET_UNKNOWN ];
const sal_uInt32 nCount = aRuleSet.size();
+
+ sal_Int16 nPrioCurrentRule = aEnvPrioTable[ ET_UNKNOWN ];
for ( sal_uInt32 nIndex = 0; nIndex < nCount; nIndex++ )
{
const SubstituteRule& aRule = aRuleSet[nIndex];
- EnvironmentType eEnvType = aRule.aEnvType;
+ EnvironmentType eEnvType = aRule.aEnvType;
// Check if environment type has a higher priority than current one!
if ( nPrioCurrentRule > aEnvPrioTable[eEnvType] )
@@ -433,13 +434,13 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector
aHostStr = aHostStr.toAsciiLowerCase();
// Pattern match if domain environment match
- WildCard aPattern(aHostStr);
- sal_Bool bMatch = aPattern.Matches(aHost);
+ WildCard aPattern(aHostStr);
+ bool bMatch = aPattern.Matches(aHost);
if ( bMatch )
{
- aActiveRule = aRule;
- bResult = sal_True;
- nPrioCurrentRule = aEnvPrioTable[eEnvType];
+ aActiveRule = aRule;
+ bResult = true;
+ nPrioCurrentRule = aEnvPrioTable[eEnvType];
}
}
break;
@@ -462,13 +463,13 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector
aDomain = GetNTDomainName();
// Pattern match if domain environment match
- WildCard aPattern(aDomainStr);
- sal_Bool bMatch = aPattern.Matches(aDomain);
+ WildCard aPattern(aDomainStr);
+ bool bMatch = aPattern.Matches(aDomain);
if ( bMatch )
{
- aActiveRule = aRule;
- bResult = sal_True;
- nPrioCurrentRule = aEnvPrioTable[eEnvType];
+ aActiveRule = aRule;
+ bResult = true;
+ nPrioCurrentRule = aEnvPrioTable[eEnvType];
}
}
break;
@@ -481,24 +482,24 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector
sal_Int16 nValue = 0;
aRule.aEnvValue >>= nValue;
- sal_Bool bUnix = ( eOSType == OS_LINUX ) || ( eOSType == OS_SOLARIS );
+ bool bUnix = ( eOSType == OS_LINUX ) || ( eOSType == OS_SOLARIS );
OperatingSystem eRuleOSType = (OperatingSystem)nValue;
// Match if OS identical or rule is set to UNIX and OS is LINUX/SOLARIS!
if (( eRuleOSType == eOSType ) || ( eRuleOSType == OS_UNIX && bUnix ))
{
- aActiveRule = aRule;
- bResult = sal_True;
- nPrioCurrentRule = aEnvPrioTable[eEnvType];
+ aActiveRule = aRule;
+ bResult = true;
+ nPrioCurrentRule = aEnvPrioTable[eEnvType];
}
}
break;
- case ET_UNKNOWN: // nothing to do
- break;
+ case ET_UNKNOWN: // nothing to do
+ break;
- default:
- break;
+ default:
+ break;
}
}
}
@@ -514,9 +515,9 @@ void SubstitutePathVariables_Impl::ReadSharePointsFromConfiguration( Sequence< r
}
void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration(
- const rtl::OUString& aSharePointName,
- const rtl::OUString& aSharePointNodeName,
- SubstituteRuleVector& rRuleSet )
+ const rtl::OUString& aSharePointName,
+ const rtl::OUString& aSharePointNodeName,
+ SubstituteRuleVector& rRuleSet )
{
Sequence< rtl::OUString > aSharePointMappingsNodeNames = GetNodeNames( aSharePointNodeName, utl::CONFIG_NAME_LOCAL_PATH );
@@ -569,7 +570,7 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration(
}
// Decode the environment and optional the operatng system settings
- Any aEnvValue;
+ Any aEnvValue;
EnvironmentType eEnvType = GetEnvTypeFromString( aEnvUsed );
if ( eEnvType == ET_OS )
{
@@ -588,13 +589,12 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration(
}
//*****************************************************************************************************************
-// XInterface, XTypeProvider, XServiceInfo
+// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables ,
- ::cppu::OWeakObject ,
- SERVICENAME_SUBSTITUTEPATHVARIABLES ,
- IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES
- )
+DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables ,
+ ::cppu::OWeakObject ,
+ SERVICENAME_SUBSTITUTEPATHVARIABLES ,
+ IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES )
DEFINE_INIT_SERVICE ( SubstitutePathVariables, {} )
@@ -626,16 +626,15 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiService
// Sort predefined/fixed variable to path length
for ( i = 0; i < PREDEFVAR_COUNT; i++ )
{
- if (( i != PREDEFVAR_WORKDIRURL ) &&
- ( i != PREDEFVAR_PATH ))
+ if (( i != PREDEFVAR_WORKDIRURL ) && ( i != PREDEFVAR_PATH ))
{
// Special path variables, don't include into automatic resubstituion search!
// $(workdirurl) is not allowed to resubstitute! This variable is the value of path settings entry
// and it could be possible that it will be resubstituted by itself!!
// Example: WORK_PATH=c:\test, $(workdirurl)=WORK_PATH => WORK_PATH=$(workdirurl) and this cannot be substituted!
ReSubstFixedVarOrder aFixedVar;
- aFixedVar.eVariable = aFixedVarTable[i].nEnumValue;
- aFixedVar.nVarValueLength = m_aPreDefVars.m_FixedVar[(sal_Int32)aFixedVar.eVariable].getLength();
+ aFixedVar.eVariable = aFixedVarTable[i].nEnumValue;
+ aFixedVar.nVarValueLength = m_aPreDefVars.m_FixedVar[(sal_Int32)aFixedVar.eVariable].getLength();
m_aReSubstFixedVarOrder.push_back( aFixedVar );
}
}
@@ -650,8 +649,8 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiService
aStrBuffer.append( m_aVarStart );
aStrBuffer.append( pIter->second.aSubstVariable );
aStrBuffer.append( m_aVarEnd );
- aUserOrderVar.aVarName = aStrBuffer.makeStringAndClear();
- aUserOrderVar.nVarValueLength = pIter->second.aSubstVariable.getLength();
+ aUserOrderVar.aVarName = aStrBuffer.makeStringAndClear();
+ aUserOrderVar.nVarValueLength = pIter->second.aSubstVariable.getLength();
m_aReSubstUserVarOrder.push_back( aUserOrderVar );
}
m_aReSubstUserVarOrder.sort();
@@ -687,7 +686,7 @@ throw ( NoSuchElementException, RuntimeException )
}
//_________________________________________________________________________________________________________________
-// protected methods
+// protected methods
//_________________________________________________________________________________________________________________
//
@@ -702,7 +701,7 @@ IMPL_LINK( SubstitutePathVariables, implts_ConfigurationNotify, SubstitutePathNo
rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::ConvertOSLtoUCBURL" );
- String aResult;
+ String aResult;
rtl::OUString aTemp;
osl::FileBase::getSystemPathFromFileURL( aOSLCompliantURL, aTemp );
@@ -718,7 +717,7 @@ rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString&
rtl::OUString SubstitutePathVariables::GetWorkPath() const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetWorkPath" );
- rtl::OUString aWorkPath;
+ rtl::OUString aWorkPath;
::comphelper::ConfigurationHelper::readDirectKey(
m_xServiceManager,
::rtl::OUString::createFromAscii("org.openoffice.Office.Paths"),
@@ -739,7 +738,7 @@ rtl::OUString SubstitutePathVariables::GetWorkVariableValue() const
::rtl::OUString::createFromAscii("Work"),
::comphelper::ConfigurationHelper::E_READONLY) >>= aWorkPath;
- // fallback to $HOME in case platform dependend config layer does not return
+ // fallback to $HOME in case platform dependend config layer does not return
// an usuable work dir value.
if (aWorkPath.getLength() < 1)
{
@@ -773,7 +772,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
rtl::OUString aPathList( pEnv, strlen( pEnv ), gsl_getSystemTextEncoding() );
rtl::OUStringBuffer aPathStrBuffer( aPathList.getLength() * PATH_EXTEND_FACTOR / 100 );
- sal_Bool bAppendSep = sal_False;
+ bool bAppendSep = false;
sal_Int32 nToken = 0;
do
{
@@ -784,7 +783,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
if ( bAppendSep )
aPathStrBuffer.appendAscii( ";" ); // Office uses ';' as path separator
aPathStrBuffer.append( aTmp );
- bAppendSep = sal_True;
+ bAppendSep = true;
}
}
while(nToken>=0);
@@ -795,7 +794,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
return aRetStr;
}
-rtl::OUString SubstitutePathVariables::impl_substituteVariable( const ::rtl::OUString& rText, sal_Bool bSubstRequired )
+rtl::OUString SubstitutePathVariables::impl_substituteVariable( const ::rtl::OUString& rText, bool bSubstRequired )
throw ( NoSuchElementException, RuntimeException )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::impl_substituteVariable" );
@@ -811,9 +810,9 @@ throw ( NoSuchElementException, RuntimeException )
// Search for first occure of "$(...".
sal_Int32 nDepth = 0;
sal_Int32 bSubstitutionCompleted = sal_False;
- sal_Int32 nPosition = aWorkText.indexOf( m_aVarStart ); // = first position of "$(" in string
+ sal_Int32 nPosition = aWorkText.indexOf( m_aVarStart ); // = first position of "$(" in string
sal_Int32 nLength = 0; // = count of letters from "$(" to ")" in string
- sal_Bool bVarNotSubstituted = sal_False;
+ bool bVarNotSubstituted = false;
// Have we found any variable like "$(...)"?
if ( nPosition != STRPOS_NOTFOUND )
@@ -826,17 +825,17 @@ throw ( NoSuchElementException, RuntimeException )
}
// Is there something to replace ?
- sal_Bool bWorkRetrieved = sal_False;
- sal_Bool bWorkDirURLRetrieved = sal_False;
+ bool bWorkRetrieved = false;
+ bool bWorkDirURLRetrieved = false;
while ( !bSubstitutionCompleted && nDepth < nMaxRecursiveDepth )
{
while ( ( nPosition != STRPOS_NOTFOUND ) && ( nLength > 3 ) ) // "$(" ")"
{
// YES; Get the next variable for replace.
- sal_Int32 nReplaceLength = 0;
- rtl::OUString aReplacement;
- rtl::OUString aSubString = aWorkText.copy( nPosition, nLength );
- rtl::OUString aSubVarString;
+ sal_Int32 nReplaceLength = 0;
+ rtl::OUString aReplacement;
+ rtl::OUString aSubString = aWorkText.copy( nPosition, nLength );
+ rtl::OUString aSubVarString;
// Path variables are not case sensitive!
aSubVarString = aSubString.toAsciiLowerCase();
@@ -851,17 +850,24 @@ throw ( NoSuchElementException, RuntimeException )
{
// Transient value, retrieve it again
m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ] = GetWorkVariableValue();
- bWorkRetrieved = sal_True;
+ bWorkRetrieved = true;
}
else if ( nIndex == PREDEFVAR_WORKDIRURL && !bWorkDirURLRetrieved )
{
// Transient value, retrieve it again
m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ] = GetWorkPath();
- bWorkDirURLRetrieved = sal_True;
+ bWorkDirURLRetrieved = true;
}
- aReplacement = m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ];
- nReplaceLength = nLength;
+ // Check preconditions to substitue path variables.
+ // 1. A path variable can only be substituted if it follows a SEARCHPATH_DELIMITER ';'!
+ // 2. It's located exactly at the start of the string being substituted!
+ if (( aFixedVarTable[ int( nIndex ) ].bAbsPath && (( nPosition == 0 ) || (( nPosition > 0 ) && ( aWorkText[nPosition-1] == ';')))) ||
+ ( !aFixedVarTable[ int( nIndex ) ].bAbsPath ))
+ {
+ aReplacement = m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ];
+ nReplaceLength = nLength;
+ }
}
else
{
@@ -870,7 +876,7 @@ throw ( NoSuchElementException, RuntimeException )
SubstituteVariables::const_iterator pIter = m_aSubstVarMap.find( aVarName );
if ( pIter != m_aSubstVarMap.end() )
{
- // found!
+ // Found.
aReplacement = pIter->second.aSubstValue;
nReplaceLength = nLength;
}
@@ -885,7 +891,7 @@ throw ( NoSuchElementException, RuntimeException )
else
{
// Variable not known
- bVarNotSubstituted = sal_False;
+ bVarNotSubstituted = false;
nPosition += nLength;
}
@@ -1017,8 +1023,8 @@ throw ( RuntimeException )
}
// Due to a recursive definition this code must exchange variables with variables!
- sal_Bool bResubstitutionCompleted = sal_False;
- sal_Bool bVariableFound = sal_False;
+ bool bResubstitutionCompleted = false;
+ bool bVariableFound = false;
// Get transient predefined path variable $(work) value before starting resubstitution
m_aPreDefVars.m_FixedVar[ PREDEFVAR_WORK ] = GetWorkVariableValue();
@@ -1032,7 +1038,7 @@ throw ( RuntimeException )
sal_Int32 nPos = aURL.indexOf( aValue );
if ( nPos >= 0 )
{
- sal_Bool bMatch = sal_True;
+ bool bMatch = true;
if ( pIterFixed->eVariable == PREDEFVAR_LANG ||
pIterFixed->eVariable == PREDEFVAR_LANGID ||
pIterFixed->eVariable == PREDEFVAR_VLANG )
@@ -1058,7 +1064,7 @@ throw ( RuntimeException )
aStrBuffer.append( m_aPreDefVars.m_FixedVarNames[ (sal_Int32)pIterFixed->eVariable ] ); // Get the variable name for struct var name array!
aStrBuffer.append( aURL.copy( nPos + aValue.getLength(), ( aURL.getLength() - ( nPos + aValue.getLength() )) ));
aURL = aStrBuffer.makeStringAndClear();
- bVariableFound = sal_True; // Resubstitution not finished yet!
+ bVariableFound = true; // Resubstitution not finished yet!
break;
}
}
@@ -1079,12 +1085,12 @@ throw ( RuntimeException )
aStrBuffer.append( m_aVarEnd );
aStrBuffer.append( aURL.copy( nPos + aVarValue.getLength(), ( aURL.getLength() - ( nPos + aVarValue.getLength() )) ));
aURL = aStrBuffer.makeStringAndClear();
- bVariableFound = sal_True; // Resubstitution not finished yet!
+ bVariableFound = true; // Resubstitution not finished yet!
}
}
if ( !bVariableFound )
- bResubstitutionCompleted = sal_True;
+ bResubstitutionCompleted = true;
else
bVariableFound = sal_False; // Next resubstitution
}
@@ -1150,7 +1156,7 @@ throw ( NoSuchElementException, RuntimeException )
void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariables& aPreDefPathVariables )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::SetPredefinedPathVariables" );
- Any aAny;
+ Any aAny;
::rtl::OUString aOfficePath;
::rtl::OUString aUserPath;
::rtl::OUString aTmp;
@@ -1170,12 +1176,12 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
}
aState = utl::Bootstrap::locateUserData( sVal );
+ //There can be the valid case that there is no user installation. For example, "unopkg sync"
+ //is currently (OOo3.4) run as part of the setup. Then no user installation is required.
+ //Therefore we do not assert here.
if( aState == ::utl::Bootstrap::PATH_EXISTS ) {
aPreDefPathVariables.m_FixedVar[ PREDEFVAR_USERPATH ] = ConvertOSLtoUCBURL( sVal );
}
- else {
- LOG_ERROR( "SubstitutePathVariables::SetPredefinedPathVariables", "Bootstrap code has no value for userpath");
- }
// Set $(inst), $(instpath), $(insturl)
aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ];
@@ -1194,14 +1200,12 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
// Detect the program directory
// Set $(prog), $(progpath), $(progurl)
INetURLObject aProgObj(
- aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ] );
- if ( !aProgObj.HasError() &&
- aProgObj.insertName(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("program")) ) )
+ aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ] );
+ if ( !aProgObj.HasError() && aProgObj.insertName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("program")) ) )
{
- aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ] = aProgObj.GetMainURL(INetURLObject::NO_DECODE);
- aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ];
- aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROG ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ];
+ aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ] = aProgObj.GetMainURL(INetURLObject::NO_DECODE);
+ aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ];
+ aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROG ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ];
}
// Detect the language type of the current office
@@ -1216,7 +1220,8 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
// Set $(lang)
aPreDefPathVariables.m_FixedVar[ PREDEFVAR_LANG ] = ConvertOSLtoUCBURL(
- rtl::OUString::createFromAscii( ResMgr::GetLang( aPreDefPathVariables.m_eLanguageType, 0 ) ));
+ rtl::OUString::createFromAscii( ResMgr::GetLang( aPreDefPathVariables.m_eLanguageType, 0 ) ));
+
// Set $(vlang)
aPreDefPathVariables.m_FixedVar[ PREDEFVAR_VLANG ] = aLocaleStr;
@@ -1241,7 +1246,7 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
aPreDefPathVariables.m_FixedVar[ PREDEFVAR_TEMP ] = ConvertOSLtoUCBURL( aTmp );
aPreDefPathVariables.m_FixedVar[PREDEFVAR_BRANDBASEURL] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR"));
+ RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR"));
rtl::Bootstrap::expandMacros(
aPreDefPathVariables.m_FixedVar[PREDEFVAR_BRANDBASEURL]);
}
diff --git a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu
index 00030d71bf9b..a51ff5b244c8 100755
--- a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu
@@ -14,6 +14,8 @@
<value>
<!-- Matrox G550 - blank display on 2nd head -->
4139 9511 260313131 1 5 13 1 1320
+ <!-- Matrox G550 - blank display (single head?) -->
+ 4139 9511 255987755 1 6 12 1 1930
<!-- Matrox G400 - random crashes -->
4139 1317 54005803 4 5 12 1 1200
<!-- Mobility Radeon M6 16MB - blank screen 1st slide on internal LCD -->
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu
index e8b483b8622d..27054b8a3417 100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -348,7 +348,7 @@
<value >swform</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value>Base: Form Design</value>
+ <value>Base: Database Form</value>
</prop>
<prop oor:name="ooSetupFactoryWindowStateConfigRef">
<value >WriterFormWindowState</value>
diff --git a/scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java b/scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java
new file mode 100644
index 000000000000..fffb78523798
--- /dev/null
+++ b/scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 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.
+*
+************************************************************************/
+
+package com.sun.star.script.framework.provider;
+
+import javax.swing.SwingUtilities;
+
+// On Mac OS X, AWT/Swing must not be accessed from the AppKit thread, so call
+// SwingUtilities.invokeLater always on a fresh thread to avoid that problem
+// (also, the current thread must not wait for that fresh thread to terminate,
+// as that would cause a deadlock if this thread is the AppKit thread):
+public final class SwingInvocation {
+ public static void invoke(final Runnable doRun) {
+ new Thread("SwingInvocation") {
+ public void run() { SwingUtilities.invokeLater(doRun); }
+ }.start();
+ }
+
+ private SwingInvocation() {}
+}
diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
index 4fd5d85ac28d..167e9297e861 100644
--- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
+++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
@@ -47,6 +47,7 @@ import java.util.HashMap;
import com.sun.star.script.provider.XScriptContext;
import com.sun.star.script.framework.provider.ScriptEditor;
+import com.sun.star.script.framework.provider.SwingInvocation;
import com.sun.star.script.framework.container.ScriptMetaData;
import com.sun.star.script.framework.provider.ClassLoaderFactory;
@@ -128,7 +129,9 @@ public class ScriptEditorForBeanShell
*/
public static ScriptEditorForBeanShell getEditor(URL url)
{
- return (ScriptEditorForBeanShell)BEING_EDITED.get(url);
+ synchronized (BEING_EDITED) {
+ return (ScriptEditorForBeanShell)BEING_EDITED.get(url);
+ }
}
/**
@@ -194,8 +197,7 @@ public class ScriptEditorForBeanShell
* @param context The context in which to execute the script
*
*/
- public void edit(XScriptContext context, ScriptMetaData entry) {
-
+ public void edit(final XScriptContext context, ScriptMetaData entry) {
if (entry != null ) {
try {
ClassLoader cl = null;
@@ -205,26 +207,30 @@ public class ScriptEditorForBeanShell
catch (Exception ignore) // TODO re-examine error handling
{
}
+ final ClassLoader theCl = cl;
String sUrl = entry.getParcelLocation();
if ( !sUrl.endsWith( "/" ) )
{
sUrl += "/";
}
sUrl += entry.getLanguageName();
- URL url = entry.getSourceURL();
-
- // check if there is already an editing session for this script
- if (BEING_EDITED.containsKey(url))
- {
- ScriptEditorForBeanShell editor =
- (ScriptEditorForBeanShell) BEING_EDITED.get(url);
-
- editor.frame.toFront();
- }
- else
- {
- new ScriptEditorForBeanShell(context, cl, url);
- }
+ final URL url = entry.getSourceURL();
+ SwingInvocation.invoke(
+ new Runnable() {
+ public void run() {
+ ScriptEditorForBeanShell editor;
+ synchronized (BEING_EDITED) {
+ editor = (ScriptEditorForBeanShell)
+ BEING_EDITED.get(url);
+ if (editor == null) {
+ editor = new ScriptEditorForBeanShell(
+ context, theCl, url);
+ BEING_EDITED.put(url, editor);
+ }
+ }
+ editor.frame.toFront();
+ }
+ });
}
catch (IOException ioe) {
showErrorMessage( "Error loading file: " + ioe.getMessage() );
@@ -269,8 +275,6 @@ public class ScriptEditorForBeanShell
this.model.setView(this.view);
initUI();
frame.show();
-
- BEING_EDITED.put(url, this);
}
private void showErrorMessage(String message) {
@@ -384,7 +388,7 @@ public class ScriptEditorForBeanShell
private void shutdown()
{
- if (BEING_EDITED.containsKey(scriptURL)) {
+ synchronized (BEING_EDITED) {
BEING_EDITED.remove(scriptURL);
}
}
diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
index b9849d1e4e1d..0b62ece9cc9f 100644
--- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
+++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
@@ -36,6 +36,7 @@ import org.mozilla.javascript.tools.debugger.ScopeProvider;
import com.sun.star.script.provider.XScriptContext;
import com.sun.star.script.framework.container.ScriptMetaData;
import com.sun.star.script.framework.provider.ScriptEditor;
+import com.sun.star.script.framework.provider.SwingInvocation;
import com.sun.star.script.framework.log.LogUtils;
import java.io.InputStream;
@@ -45,7 +46,6 @@ import java.net.URL;
import java.util.Map;
import java.util.HashMap;
-import javax.swing.SwingUtilities;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@@ -117,7 +117,9 @@ public class ScriptEditorForJavaScript implements ScriptEditor
*/
public static ScriptEditorForJavaScript getEditor(URL url)
{
- return (ScriptEditorForJavaScript)BEING_EDITED.get(url);
+ synchronized (BEING_EDITED) {
+ return (ScriptEditorForJavaScript)BEING_EDITED.get(url);
+ }
}
/**
@@ -187,31 +189,25 @@ public class ScriptEditorForJavaScript implements ScriptEditor
sUrl += "/";
}
sUrl += entry.getLanguageName();
- URL url = entry.getSourceURL();
-
- // check if there is already an editing session for this script
- //if (BEING_EDITED.containsKey(url))
- if ( rhinoWindow != null )
- {
- ScriptEditorForJavaScript editor =
- (ScriptEditorForJavaScript) BEING_EDITED.get(url);
- if ( editor == null )
- {
- editor = new ScriptEditorForJavaScript( context, url );
- editor.edit( context, entry );
- }
- else
- {
- rhinoWindow.showScriptWindow( url );
- }
- }
- else
- {
- ScriptEditorForJavaScript editor =
- new ScriptEditorForJavaScript( context, url );
-
- }
- rhinoWindow.toFront();
+ final URL url = entry.getSourceURL();
+ SwingInvocation.invoke(
+ new Runnable() {
+ public void run() {
+ synchronized (BEING_EDITED) {
+ ScriptEditorForJavaScript editor =
+ (ScriptEditorForJavaScript) BEING_EDITED.get(
+ url);
+ if (editor == null) {
+ editor = new ScriptEditorForJavaScript(
+ context, url);
+ BEING_EDITED.put(url, editor);
+ }
+ }
+ assert rhinoWindow != null;
+ rhinoWindow.showScriptWindow(url);
+ rhinoWindow.toFront();
+ }
+ });
}
catch ( IOException e )
{
@@ -234,11 +230,6 @@ public class ScriptEditorForJavaScript implements ScriptEditor
this.scriptURL = url;
- synchronized( ScriptEditorForJavaScript.class )
- {
- BEING_EDITED.put(url, this);
- }
-
}
/**
@@ -274,13 +265,9 @@ public class ScriptEditorForJavaScript implements ScriptEditor
}
final Main sdb = new Main("Rhino JavaScript Debugger");
- swingInvoke(new Runnable() {
- public void run() {
- sdb.pack();
- sdb.setSize(640, 640);
- sdb.setVisible(true);
- }
- });
+ sdb.pack();
+ sdb.setSize(640, 640);
+ sdb.setVisible(true);
sdb.setExitAction(new Runnable() {
public void run() {
sdb.clearAllBreakpoints();
@@ -306,18 +293,6 @@ public class ScriptEditorForJavaScript implements ScriptEditor
}
}
- private static void swingInvoke(Runnable f) {
- if (SwingUtilities.isEventDispatchThread()) {
- f.run();
- return;
- }
- try {
- SwingUtilities.invokeAndWait(f);
- } catch (Exception exc) {
- LogUtils.DEBUG( LogUtils.getTrace( exc ) );
- }
- }
-
private void shutdown()
{
// dereference Rhino Debugger window
diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx
index f944b29c18da..5551df850ff2 100644
--- a/sfx2/inc/sfx2/module.hxx
+++ b/sfx2/inc/sfx2/module.hxx
@@ -34,6 +34,7 @@
#include <sfx2/imgdef.hxx>
#include <sal/types.h>
#include <tools/fldunit.hxx>
+#include <com/sun/star/uno/Reference.hxx>
class ImageList;
@@ -56,6 +57,9 @@ class SfxStbCtrlFactArr_Impl;
class SfxTabPage;
class Window;
+namespace com { namespace sun { namespace star { namespace frame {
+ class XFrame;
+} } } }
//====================================================================
class SFX2_DLLPUBLIC SfxModule : public SfxShell
@@ -97,6 +101,14 @@ public:
static SfxModule* GetActiveModule( SfxViewFrame* pFrame=NULL );
static FieldUnit GetCurrentFieldUnit();
+ /** retrieves the field unit of the module belonging to the document displayed in the given frame
+
+ Effectively, this method looks up the SfxViewFrame belonging to the given XFrame, then the SfxModule belonging to
+ the document in this frame, then this module's field unit.
+
+ Failures in any of those steps are reported as assertion in non-product builds, and then FUNIT_100TH_MM is returned.
+ */
+ static FieldUnit GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame );
FieldUnit GetFieldUnit() const;
//#if 0 // _SOLAR__PRIVATE
diff --git a/sfx2/qa/cppunit/makefile.mk b/sfx2/qa/cppunit/makefile.mk
new file mode 100644
index 000000000000..b53a04ec43f9
--- /dev/null
+++ b/sfx2/qa/cppunit/makefile.mk
@@ -0,0 +1,86 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ=../..
+PRJNAME=sfx2
+TARGET=qa_cppunit
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+DLLPRE = # no leading "lib" on .so files
+
+# --- Libs ---------------------------------------------------------
+
+SHL1OBJS= \
+ $(SLO)/test_metadatable.obj \
+
+
+SHL1STDLIBS= \
+ $(CPPUNITLIB) \
+ $(SALLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(VCLLIB) \
+ $(SFXLIB) \
+
+
+SHL1TARGET= test_metadatable
+SHL1RPATH = NONE
+SHL1IMPLIB= i$(SHL1TARGET)
+# SHL1DEF= $(MISC)/$(SHL1TARGET).def
+DEF1NAME=$(SHL1TARGET)
+# DEF1EXPORTFILE= export.exp
+SHL1VERSIONMAP= version.map
+
+# --- All object files ---------------------------------------------
+
+SLOFILES= \
+ $(SHL1OBJS) \
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+.INCLUDE : _cppunit.mk
+
+.END
diff --git a/sfx2/qa/unoapi/makefile.mk b/sfx2/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..ea91ba4d1c44
--- /dev/null
+++ b/sfx2/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# 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.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = sfx2
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/sfx2/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 90b93cc3748e..87953e134292 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -51,6 +51,7 @@
#include <svl/intitem.hxx>
#include "sfx2/taskpane.hxx"
#include <tools/diagnose_ex.h>
+#include <rtl/strbuf.hxx>
#define SfxModule
#include "sfxslots.hxx"
@@ -423,6 +424,39 @@ SfxModule* SfxModule::GetActiveModule( SfxViewFrame* pFrame )
return pSh ? pSh->GetModule() : 0;
}
+FieldUnit SfxModule::GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame )
+{
+ ENSURE_OR_RETURN( i_frame.is(), "SfxModule::GetModuleFieldUnit: invalid frame!", FUNIT_100TH_MM );
+
+ // find SfxViewFrame for the given XFrame
+ SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst();
+ while ( pViewFrame != NULL )
+ {
+ if ( pViewFrame->GetFrame().GetFrameInterface() == i_frame )
+ break;
+ pViewFrame = SfxViewFrame::GetNext( *pViewFrame );
+ }
+ ENSURE_OR_RETURN( pViewFrame != NULL, "SfxModule::GetModuleFieldUnit: unable to find an SfxViewFrame for the given XFrame", FUNIT_100TH_MM );
+
+ // find the module
+ SfxModule const * pModule = GetActiveModule( pViewFrame );
+ ENSURE_OR_RETURN( pModule != NULL, "SfxModule::GetModuleFieldUnit: no SfxModule for the given frame!", FUNIT_100TH_MM );
+
+ SfxPoolItem const * pItem = pModule->GetItem( SID_ATTR_METRIC );
+ if ( pItem == NULL )
+ {
+#if OSL_DEBUG_LEVEL > 0
+ ::rtl::OStringBuffer message;
+ message.append( "SfxModule::GetFieldUnit: no metric item in the module implemented by '" );
+ message.append( typeid( *pModule ).name() );
+ message.append( "'!" );
+ OSL_ENSURE( false, message.makeStringAndClear().getStr() );
+#endif
+ return FUNIT_100TH_MM;
+ }
+ return (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
+}
+
FieldUnit SfxModule::GetCurrentFieldUnit()
{
FieldUnit eUnit = FUNIT_INCH;
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 59d3107532a4..31f9105c28aa 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -59,7 +59,7 @@
// -----------------------------------------------------------------------
TYPEINIT1(SfxEventHint, SfxHint);
TYPEINIT1(SfxEventNamesItem, SfxPoolItem);
-TYPEINIT1(SfxViewEventHint, SfxHint);
+TYPEINIT1(SfxViewEventHint, SfxEventHint);
using namespace com::sun::star;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 2a54e5b1c638..0bde76cb44b1 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -131,7 +131,7 @@ void SfxUnoControllerItem::UnBind()
void SAL_CALL SfxUnoControllerItem::statusChanged(const ::com::sun::star::frame::FeatureStateEvent& rEvent) throw ( ::com::sun::star::uno::RuntimeException )
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
- DBG_ASSERT( pCtrlItem, "Dispatch hat den StatusListener nicht entfern!" );
+ DBG_ASSERT( pCtrlItem, "dispatch implementation didn't respect our previous removeStatusListener call!" );
if ( rEvent.Requery )
{
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 0f3b35648061..eb6373b5b998 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1566,7 +1566,7 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
// the item should remain only if it was set by the dialog
rpSet->ClearItem( SID_SELECTION );
- if( mbExport )
+ if( mbExport && mbHasSelectionBox )
{
try
{
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index f18e903eb6e4..41b969fc1e59 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1142,7 +1142,6 @@ void SAL_CALL SfxDocumentMetaData::init(
m_isInitialized = false;
m_xDoc = i_xDoc;
- m_xDoc->normalize();
// select nodes for standard meta data stuff
xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xlink")),
@@ -1171,26 +1170,49 @@ void SAL_CALL SfxDocumentMetaData::init(
if (!m_xParent.is()) {
// all this create/append stuff may throw DOMException
try {
- css::uno::Reference<css::xml::dom::XElement> xRElem(
- i_xDoc->createElementNS(
+ css::uno::Reference<css::xml::dom::XElement> xRElem;
+ css::uno::Reference<css::xml::dom::XNode> xNode(
+ i_xDoc->getFirstChild());
+ while (xNode.is()) {
+ if (css::xml::dom::NodeType_ELEMENT_NODE ==xNode->getNodeType())
+ {
+ if (xNode->getNamespaceURI().equalsAscii(s_nsODF) &&
+ xNode->getLocalName().equalsAscii("document-meta"))
+ {
+ xRElem.set(xNode, css::uno::UNO_QUERY_THROW);
+ break;
+ }
+ else
+ {
+ OSL_TRACE("SfxDocumentMetaData::init(): "
+ "deleting unexpected root element: %s",
+ ::rtl::OUStringToOString(xNode->getLocalName(),
+ RTL_TEXTENCODING_UTF8).getStr());
+ i_xDoc->removeChild(xNode);
+ xNode = i_xDoc->getFirstChild(); // start over
+ }
+ } else {
+ xNode = xNode->getNextSibling();
+ }
+ }
+ if (!xRElem.is()) {
+ xRElem = i_xDoc->createElementNS(
::rtl::OUString::createFromAscii(s_nsODF),
- ::rtl::OUString::createFromAscii("office:document-meta")));
- css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem,
- css::uno::UNO_QUERY_THROW);
- // NB: the following is a _bad_idea_ with our DOM implementation
- // do _not_ create attributes with xmlns prefix!
-// xRElem->setAttribute(::rtl::OUString::createFromAscii("xmlns:office"),
-// ::rtl::OUString::createFromAscii(s_nsODF));
+ ::rtl::OUString::createFromAscii("office:document-meta"));
+ css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem,
+ css::uno::UNO_QUERY_THROW);
+ i_xDoc->appendChild(xRNode);
+ }
xRElem->setAttributeNS(::rtl::OUString::createFromAscii(s_nsODF),
::rtl::OUString::createFromAscii("office:version"),
::rtl::OUString::createFromAscii("1.0"));
- i_xDoc->appendChild(xRNode);
+ // does not exist, otherwise m_xParent would not be null
css::uno::Reference<css::xml::dom::XNode> xParent (
i_xDoc->createElementNS(
::rtl::OUString::createFromAscii(s_nsODF),
::rtl::OUString::createFromAscii("office:meta")),
css::uno::UNO_QUERY_THROW);
- xRNode->appendChild(xParent);
+ xRElem->appendChild(xParent);
m_xParent = xParent;
} catch (css::xml::dom::DOMException & e) {
css::uno::Any a(e);
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 4255e9bd2939..3da1f374af1c 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -921,11 +921,6 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
s_xCurrentComponent = _rxComponent;
if ( pAppMgr )
pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( _rxComponent ) );
-
-#if OSL_DEBUG_LEVEL > 0
- const char* pComponentImplName = _rxComponent.get() ? typeid( *_rxComponent.get() ).name() : "void";
- OSL_TRACE( "current component is a %s\n", pComponentImplName );
-#endif
}
Reference< XInterface > SfxObjectShell::GetCurrentComponent()
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 515149c5a2d3..b91e8b4848ba 100644..100755
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -80,13 +80,15 @@ class SfxPrinterController : public vcl::PrinterController, public SfxListener
sal_Bool m_bOrigStatus;
sal_Bool m_bNeedsChange;
sal_Bool m_bApi;
+ sal_Bool m_bTempPrinter;
util::DateTime m_aLastPrinted;
::rtl::OUString m_aLastPrintedBy;
Sequence< beans::PropertyValue > getMergedOptions() const;
const Any& getSelectionObject() const;
public:
- SfxPrinterController( const Any& i_rComplete,
+ SfxPrinterController( const boost::shared_ptr<Printer>& i_rPrinter,
+ const Any& i_rComplete,
const Any& i_rSelection,
const Any& i_rViewProp,
const Reference< view::XRenderable >& i_xRender,
@@ -105,7 +107,8 @@ public:
virtual void jobFinished( com::sun::star::view::PrintableState );
};
-SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
+SfxPrinterController::SfxPrinterController( const boost::shared_ptr<Printer>& i_rPrinter,
+ const Any& i_rComplete,
const Any& i_rSelection,
const Any& i_rViewProp,
const Reference< view::XRenderable >& i_xRender,
@@ -113,7 +116,8 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
SfxViewShell* pView,
const uno::Sequence< beans::PropertyValue >& rProps
)
- : maCompleteSelection( i_rComplete )
+ : PrinterController( i_rPrinter)
+ , maCompleteSelection( i_rComplete )
, maSelection( i_rSelection )
, mxRenderable( i_xRender )
, mpLastPrinter( NULL )
@@ -122,6 +126,7 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
, m_bOrigStatus( sal_False )
, m_bNeedsChange( sal_False )
, m_bApi(i_bApi)
+ , m_bTempPrinter( i_rPrinter.get() != NULL )
{
if ( mpViewShell )
{
@@ -191,15 +196,19 @@ SfxPrinterController::~SfxPrinterController()
const Any& SfxPrinterController::getSelectionObject() const
{
+ const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) );
+ if( pVal )
+ {
+ sal_Bool bSel = sal_False;
+ pVal->Value >>= bSel;
+ return bSel ? maSelection : maCompleteSelection;
+ }
+
sal_Int32 nChoice = 0;
- sal_Bool bSel = sal_False;
- const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) );
+ pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) );
if( pVal )
pVal->Value >>= nChoice;
- pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) );
- if( pVal )
- pVal->Value >>= bSel;
- return (nChoice > 1 || bSel) ? maSelection : maCompleteSelection;
+ return (nChoice > 1) ? maSelection : maCompleteSelection;
}
Sequence< beans::PropertyValue > SfxPrinterController::getMergedOptions() const
@@ -307,6 +316,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
{
if ( mpObjectShell )
{
+ bool bCopyJobSetup = false;
mpObjectShell->Broadcast( SfxPrintingHint( nState ) );
switch ( nState )
{
@@ -334,6 +344,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
rBind.Invalidate( SID_PRINTDOC );
rBind.Invalidate( SID_PRINTDOCDIRECT );
rBind.Invalidate( SID_SETUPPRINTER );
+ bCopyJobSetup = ! m_bTempPrinter;
break;
}
@@ -341,6 +352,27 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
break;
}
+ if( bCopyJobSetup && mpViewShell )
+ {
+ // #i114306#
+ // Note: this possibly creates a printer that gets immediately replaced
+ // by a new one. The reason for this is that otherwise we would not get
+ // the printer's SfxItemSet here to copy. Awkward, but at the moment there is no
+ // other way here to get the item set.
+ SfxPrinter* pDocPrt = mpViewShell->GetPrinter(sal_True);
+ if( pDocPrt )
+ {
+ if( pDocPrt->GetName() == getPrinter()->GetName() )
+ pDocPrt->SetJobSetup( getPrinter()->GetJobSetup() );
+ else
+ {
+ SfxPrinter* pNewPrt = new SfxPrinter( pDocPrt->GetOptions().Clone(), getPrinter()->GetName() );
+ pNewPrt->SetJobSetup( getPrinter()->GetJobSetup() );
+ mpViewShell->SetPrinter( pNewPrt, SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
+ }
+ }
+ }
+
if ( m_bNeedsChange )
mpObjectShell->EnableSetModified( m_bOrigStatus );
@@ -586,8 +618,23 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
aSelection <<= GetObjectShell()->GetModel();
Any aComplete( makeAny( GetObjectShell()->GetModel() ) );
Any aViewProp( makeAny( xController ) );
+ boost::shared_ptr<Printer> aPrt;
- boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController( aComplete,
+ const beans::PropertyValue* pVal = rProps.getConstArray();
+ for( sal_Int32 i = 0; i < rProps.getLength(); i++ )
+ {
+ if( pVal[i].Name.equalsAscii( "PrinterName" ) )
+ {
+ rtl::OUString aPrinterName;
+ pVal[i].Value >>= aPrinterName;
+ aPrt.reset( new Printer( aPrinterName ) );
+ break;
+ }
+ }
+
+ boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController(
+ aPrt,
+ aComplete,
aSelection,
aViewProp,
GetRenderable(),
@@ -704,10 +751,18 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
}
}
}
- sal_Int32 nLen = aProps.getLength();
- aProps.realloc( nLen + 1 );
- aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) );
- aProps[nLen].Value = makeAny( bSelection );
+ // HACK: writer sets the SID_SELECTION item when printing directly and expects
+ // to get only the selection document in that case (see getSelectionObject)
+ // however it also reacts to the PrintContent property. We need this distinction here, too,
+ // else one of the combinations print / print direct and selection / all will not work.
+ // it would be better if writer handled this internally
+ if( nId == SID_PRINTDOCDIRECT )
+ {
+ sal_Int32 nLen = aProps.getLength();
+ aProps.realloc( nLen + 1 );
+ aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) );
+ aProps[nLen].Value = makeAny( bSelection );
+ }
ExecPrint( aProps, bIsAPI, (nId == SID_PRINTDOCDIRECT) );
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 4fbd1f3c288e..abc25d865d06 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -2803,7 +2803,7 @@ void SvxRuler::EvalModifier()
const RulerType eType = GetDragType();
nDragType = DRAG_OBJECT_SIZE_PROPORTIONAL;
if( RULER_TYPE_TAB == eType ||
- ( ( RULER_TYPE_BORDER == eType || RULER_TYPE_MARGIN1 == eType ) &&
+ ( ( RULER_TYPE_BORDER == eType || RULER_TYPE_MARGIN1 == eType || RULER_TYPE_MARGIN2 == eType) &&
pColumnItem ) )
PrepareProportional_Impl(eType);
break;
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 38342bf355ea..26f36802a8f9 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -2001,6 +2001,18 @@ void DbGridControl::AdjustRows()
RowRemoved(GetRowCount() - nDelta, nDelta, sal_False);
// es sind Zeilen weggefallen, dann ab der aktuellen Position neu zeichen
Invalidate();
+
+ sal_Int32 nNewPos = AlignSeekCursor();
+ if (m_bSynchDisplay)
+ DbGridControl_Base::GoToRow(nNewPos);
+
+ SetCurrent(nNewPos);
+ // there are rows so go to the selected current column
+ if (nRecordCount)
+ GoToRowColumnId(nNewPos, GetColumnId(GetCurColumnId()));
+ if (!IsResizing() && GetRowCount())
+ RecalcRows(GetTopRow(), GetVisibleRows(), sal_True);
+ m_aBar.InvalidateAll(m_nCurrentPos, sal_True);
}
else // zuwenig
RowInserted(GetRowCount(), -nDelta, sal_True);
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index 2b7ad83f7f5f..a3a4038e4ab8 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -650,7 +650,9 @@ void FmFormObj::SetUnoControlModel( const Reference< com::sun::star::awt::XContr
{
SdrUnoObj::SetUnoControlModel( _rxModel );
- // TODO: call something like formObjectInserted at the form page, to tell it the new model
+ FmFormPage* pFormPage = PTR_CAST( FmFormPage, GetPage() );
+ if ( pFormPage )
+ pFormPage->GetImpl().formModelAssigned( *this );
impl_checkRefDevice_nothrow( true );
}
diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx
index 480bc5678eaf..bf86964d76de 100644
--- a/svx/source/form/fmpage.cxx
+++ b/svx/source/form/fmpage.cxx
@@ -105,12 +105,15 @@ FmFormPage::FmFormPage(FmFormModel& rModel, StarBASIC* _pBasic, FASTBOOL bMaster
FmFormPage::FmFormPage(const FmFormPage& rPage)
:SdrPage(rPage)
#ifndef SVX_LIGHT
- ,m_pImpl(new FmFormPageImpl( *this, rPage.GetImpl() ) )
+ ,m_pImpl(new FmFormPageImpl( *this ) )
#else
,m_pImpl(NULL)
#endif
,m_pBasic(0)
{
+#ifndef SVX_LIGHT
+ m_pImpl->initFrom( rPage.GetImpl() );
+#endif
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPage::FmFormPage" );
m_sPageName = rPage.m_sPageName;
}
diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx
index e239e982dd66..a0d2f5a3c47a 100644
--- a/svx/source/form/fmpgeimp.cxx
+++ b/svx/source/form/fmpgeimp.cxx
@@ -167,21 +167,18 @@ namespace
}
//------------------------------------------------------------------------------
-FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl )
- :m_rPage( _rPage )
- ,m_bFirstActivation( sal_True )
- ,m_bAttemptedFormCreation( false )
+void FmFormPageImpl::initFrom( FmFormPageImpl& i_foreignImpl )
{
- DBG_CTOR(FmFormPageImpl,NULL);
-
// clone the Forms collection
- Reference< XCloneable > xCloneable( const_cast< FmFormPageImpl& >( rImpl ).getForms( false ), UNO_QUERY );
+ const Reference< XNameContainer > xForeignForms( const_cast< FmFormPageImpl& >( i_foreignImpl ).getForms( false ) );
+ const Reference< XCloneable > xCloneable( xForeignForms, UNO_QUERY );
if ( !xCloneable.is() )
{
// great, nothing to do
- OSL_ENSURE( !const_cast< FmFormPageImpl& >( rImpl ).getForms( false ).is(), "FmFormPageImpl::FmFormPageImpl: a non-cloneable forms container!?" );
+ OSL_ENSURE( !xForeignForms.is(), "FmFormPageImpl::FmFormPageImpl: a non-cloneable forms container!?" );
return;
}
+
try
{
m_xForms.set( xCloneable->createClone(), UNO_QUERY_THROW );
@@ -196,7 +193,7 @@ FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl
aVisitor.process( FormComponentPair( xCloneable, m_xForms ), aAssignmentProcessor );
// assign the cloned models to their SdrObjects
- SdrObjListIter aForeignIter( rImpl.m_rPage );
+ SdrObjListIter aForeignIter( i_foreignImpl.m_rPage );
SdrObjListIter aOwnIter( m_rPage );
OSL_ENSURE( aForeignIter.IsMore() == aOwnIter.IsMore(), "FmFormPageImpl::FmFormPageImpl: inconsistent number of objects (1)!" );
@@ -208,31 +205,23 @@ FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl
bool bForeignIsForm = pForeignObj && ( pForeignObj->GetObjInventor() == FmFormInventor );
bool bOwnIsForm = pOwnObj && ( pOwnObj->GetObjInventor() == FmFormInventor );
- if ( bForeignIsForm != bOwnIsForm )
- {
- OSL_ENSURE( false, "FmFormPageImpl::FmFormPageImpl: inconsistent ordering of objects!" );
- // don't attempt to do further assignments, something's completely messed up
- break;
- }
+ ENSURE_OR_BREAK( bForeignIsForm == bOwnIsForm, "FmFormPageImpl::FmFormPageImpl: inconsistent ordering of objects!" );
+ // if this fires, don't attempt to do further assignments, something's completely messed up
+
if ( !bForeignIsForm )
// no form control -> next round
continue;
Reference< XControlModel > xForeignModel( pForeignObj->GetUnoControlModel() );
- OSL_ENSURE( xForeignModel.is(), "FmFormPageImpl::FmFormPageImpl: control shape without control!" );
- if ( !xForeignModel.is() )
- // the SdrObject does not have a UNO Control Model. This is pathological, but well ... So the cloned
- // SdrObject will also not have a UNO Control Model.
- continue;
-
- OSL_ENSURE( !pOwnObj->GetUnoControlModel().is(), "FmFormPageImpl::FmFormPageImpl: there already is a control model for the target object!" );
+ ENSURE_OR_CONTINUE( xForeignModel.is(), "FmFormPageImpl::FmFormPageImpl: control shape without control!" );
+ // if this fires, the SdrObject does not have a UNO Control Model. This is pathological, but well ...
+ // So the cloned SdrObject will also not have a UNO Control Model.
MapControlModels::const_iterator assignment = aModelAssignment.find( xForeignModel );
- OSL_ENSURE( assignment != aModelAssignment.end(), "FmFormPageImpl::FmFormPageImpl: no clone found for this model!" );
- if ( assignment == aModelAssignment.end() )
- // the source SdrObject has a model, but it is not part of the model hierarchy in rImpl.getForms().
+ ENSURE_OR_CONTINUE( assignment != aModelAssignment.end(), "FmFormPageImpl::FmFormPageImpl: no clone found for this model!" );
+ // if this fires, the source SdrObject has a model, but it is not part of the model hierarchy in
+ // i_foreignImpl.getForms().
// Pathological, too ...
- continue;
pOwnObj->SetUnoControlModel( assignment->second );
}
@@ -275,7 +264,7 @@ namespace
_map->put( makeAny( xControlModel ), makeAny( xControlShape ) );
}
- static void lcl_removeFormObject( const FmFormObj& _object, const Reference< XMap >& _map )
+ static void lcl_removeFormObject_throw( const FmFormObj& _object, const Reference< XMap >& _map, bool i_ignoreNonExistence = false )
{
// the control model
Reference< XControlModel > xControlModel( _object.GetUnoControlModel(), UNO_QUERY );
@@ -287,8 +276,13 @@ namespace
Any aOldAssignment =
#endif
_map->remove( makeAny( xControlModel ) );
- OSL_ENSURE( aOldAssignment == makeAny( Reference< XControlShape >( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ) ),
- "lcl_removeFormObject: map was inconsistent!" );
+ #if OSL_DEBUG_LEVEL > 0
+ (void)aOldAssignment;
+ #endif
+ OSL_ENSURE( !i_ignoreNonExistence ||
+ ( aOldAssignment == makeAny( Reference< XControlShape >( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ) ) ),
+ "lcl_removeFormObject: map was inconsistent!" );
+ (void)i_ignoreNonExistence;
}
}
@@ -703,7 +697,26 @@ Reference< XForm > FmFormPageImpl::findFormForDataSource(
return sName;
}
-//------------------------------------------------------------------
+//----------------------------------------------------------------------------------------------------------------------
+void FmFormPageImpl::formModelAssigned( const FmFormObj& _object )
+{
+ Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY );
+ if ( !xControlShapeMap.is() )
+ // our map does not exist -> not interested in this event
+ return;
+
+ try
+ {
+ lcl_removeFormObject_throw( _object, xControlShapeMap, false );
+ lcl_insertFormObject_throw( _object, xControlShapeMap );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
void FmFormPageImpl::formObjectInserted( const FmFormObj& _object )
{
Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY );
@@ -721,6 +734,7 @@ void FmFormPageImpl::formObjectInserted( const FmFormObj& _object )
}
}
+//----------------------------------------------------------------------------------------------------------------------
void FmFormPageImpl::formObjectRemoved( const FmFormObj& _object )
{
Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY );
@@ -730,7 +744,7 @@ void FmFormPageImpl::formObjectRemoved( const FmFormObj& _object )
try
{
- lcl_removeFormObject( _object, xControlShapeMap );
+ lcl_removeFormObject_throw( _object, xControlShapeMap );
}
catch( const Exception& )
{
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index 112b47b1107e..4dec747ca431 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -901,19 +901,19 @@ void FmFormShell::GetState(SfxItemSet &rSet)
case SID_FM_USE_WIZARDS:
if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SDATABASE ) )
rSet.Put( SfxVisibilityItem( nWhich, sal_False ) );
- else if (!m_bDesignMode || !GetFormModel())
+ else if (!GetFormModel())
rSet.DisableItem( nWhich );
else
rSet.Put( SfxBoolItem(nWhich, GetImpl()->GetWizardUsing() ) );
break;
case SID_FM_AUTOCONTROLFOCUS:
- if (!m_bDesignMode || !GetFormModel())
+ if (!GetFormModel())
rSet.DisableItem( nWhich );
else
rSet.Put( SfxBoolItem(nWhich, GetFormModel()->GetAutoControlFocus() ) );
break;
case SID_FM_OPEN_READONLY:
- if (!m_bDesignMode || !GetFormModel())
+ if (!GetFormModel())
rSet.DisableItem( nWhich );
else
rSet.Put( SfxBoolItem(nWhich, GetFormModel()->GetOpenInDesignMode() ) );
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index eee61c5c2dee..ecbfc8afbe1a 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -66,6 +66,7 @@
#include <comphelper/property.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/stl_types.hxx>
+#include <comphelper/componentcontext.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
@@ -88,7 +89,9 @@ typedef cppu::WeakImplHelper1< XScriptListener > ScriptEventListener_BASE;
class ScriptEventListenerWrapper : public ScriptEventListener_BASE
{
public:
- ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException ) : pModel(&_rModel)
+ ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException )
+ :m_rModel( _rModel )
+ ,m_attemptedListenerCreation( false )
{
}
@@ -98,7 +101,7 @@ public:
// XScriptListener
virtual void SAL_CALL firing(const ScriptEvent& evt) throw(RuntimeException)
{
- setModel();
+ attemptListenerCreation();
if ( m_vbaListener.is() )
{
m_vbaListener->firing( evt );
@@ -107,7 +110,7 @@ public:
virtual Any SAL_CALL approveFiring(const ScriptEvent& evt) throw( com::sun::star::reflection::InvocationTargetException, RuntimeException)
{
- setModel();
+ attemptListenerCreation();
if ( m_vbaListener.is() )
{
return m_vbaListener->approveFiring( evt );
@@ -116,61 +119,32 @@ public:
}
private:
- void setModel()
+ void attemptListenerCreation()
{
- if ( !m_vbaListener.is() )
- {
- Reference < XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY );
- if ( xProps.is() )
- {
- Reference< XComponentContext > xCtx( xProps->getPropertyValue(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY );
- if ( xCtx.is() )
- {
- Reference< XMultiComponentFactory > xMFac(
- xCtx->getServiceManager(), UNO_QUERY );
-
- // SfxObjectShellRef is good here since the model controls the lifetime of the shell
- SfxObjectShellRef xObjSh = pModel->GetObjectShell();
- Reference< XMultiServiceFactory > xDocFac;
- if ( xObjSh.Is() )
- xDocFac.set( xObjSh->GetModel(), UNO_QUERY );
+ if ( m_attemptedListenerCreation )
+ return;
+ m_attemptedListenerCreation = true;
- if ( xMFac.is() )
- {
- m_vbaListener.set( xMFac->createInstanceWithContext(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "ooo.vba.EventListener" ) ), xCtx ),
- UNO_QUERY_THROW );
- }
- }
- }
+ try
+ {
+ ::comphelper::ComponentContext const aContext( ::comphelper::getProcessServiceFactory() );
+ Reference< XScriptListener > const xScriptListener( aContext.createComponent( "ooo.vba.EventListener" ), UNO_QUERY_THROW );
+ Reference< XPropertySet > const xListenerProps( xScriptListener, UNO_QUERY_THROW );
+ // SfxObjectShellRef is good here since the model controls the lifetime of the shell
+ SfxObjectShellRef const xObjectShell = m_rModel.GetObjectShell();
+ ENSURE_OR_THROW( xObjectShell.Is(), "no object shell!" );
+ xListenerProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ), makeAny( xObjectShell->GetModel() ) );
+
+ m_vbaListener = xScriptListener;
}
- Reference< XPropertySet > xProps( m_vbaListener, UNO_QUERY );
- if ( xProps.is() )
+ catch( Exception const & )
{
- try
- {
- // SfxObjectShellRef is good here since the model controls the lifetime of the shell
- SfxObjectShellRef xObjSh = pModel->GetObjectShell();
- if ( xObjSh.Is() && m_vbaListener.is() )
- {
- Any aVal;
- aVal <<= xObjSh->GetModel();
- xProps->setPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ),
- aVal );
- }
- }
- catch( Exception& )
- {
- //swallow any errors
- }
+ DBG_UNHANDLED_EXCEPTION();
}
}
- FmFormModel* pModel;
- Reference< XScriptListener > m_vbaListener;
+ FmFormModel& m_rModel;
+ Reference< XScriptListener > m_vbaListener;
+ bool m_attemptedListenerCreation;
};
diff --git a/svx/source/inc/fmpgeimp.hxx b/svx/source/inc/fmpgeimp.hxx
index 755c754853dc..9eb91c809d66 100644
--- a/svx/source/inc/fmpgeimp.hxx
+++ b/svx/source/inc/fmpgeimp.hxx
@@ -81,9 +81,10 @@ protected:
public:
FmFormPageImpl( FmFormPage& _rPage );
- FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl );
~FmFormPageImpl();
+ void initFrom( FmFormPageImpl& i_foreignImpl );
+
// nur wichtig fuer den DesignMode
void setCurForm(::com::sun::star::uno::Reference< ::com::sun::star::form::XForm> xForm);
::com::sun::star::uno::Reference< ::com::sun::star::form::XForm> getDefaultForm();
@@ -135,6 +136,7 @@ public:
void formObjectInserted( const FmFormObj& _object );
void formObjectRemoved( const FmFormObj& _object );
+ void formModelAssigned( const FmFormObj& _object );
/** returns an object mapping from control models to drawing shapes.
*/
diff --git a/svx/source/mnuctrls/fntctl.cxx b/svx/source/mnuctrls/fntctl.cxx
index 4f51e111c2c3..b10eac69bc54 100644..100755
--- a/svx/source/mnuctrls/fntctl.cxx
+++ b/svx/source/mnuctrls/fntctl.cxx
@@ -148,7 +148,7 @@ void SvxFontMenuControl::Notify( SfxBroadcaster&, const SfxHint& rHint )
IMPL_LINK_INLINE_START( SvxFontMenuControl, MenuSelect, FontNameMenu *, pMen )
{
SvxFontItem aItem( GetId() );
- aItem.GetFamilyName() = pMen->GetCurName();
+ aItem.SetFamilyName(pMen->GetCurName());
GetBindings().GetDispatcher()->Execute( GetId(), SFX_CALLMODE_RECORD, &aItem, 0L );
return 0;
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 5e225e626175..56f9a7bdaaf0 100755
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -57,8 +57,6 @@
#include <com/sun/star/container/XContainer.hpp>
/** === end UNO includes === **/
-#include <toolkit/helper/formpdfexport.hxx>
-#include <vcl/pdfextoutdevdata.hxx>
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
#include <comphelper/processfactory.hxx>
@@ -69,7 +67,6 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/controlprimitive2d.hxx>
-#include <boost/shared_ptr.hpp>
#include <boost/bind.hpp>
/*
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index 094cfbd96ee5..d1bc7d4d610e 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -78,7 +78,7 @@
String SvxPosSizeStatusBarControl::GetMetricStr_Impl( long nVal )
{
// Applikations-Metrik besorgen und setzen
- FieldUnit eOutUnit = SfxModule::GetCurrentFieldUnit();
+ FieldUnit eOutUnit = SfxModule::GetModuleFieldUnit( getFrameInterface() );
FieldUnit eInUnit = FUNIT_100TH_MM;
String sMetric;
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index a951819104aa..82cd950bbbed 100644..100755
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -1258,9 +1258,9 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse)
case ITEM_XCOLOR: break;
case ITEM_COLOR: break;
case ITEM_FONT: {
- ((SvxFontItem*)pNewItem)->GetFamily()=FAMILY_DONTKNOW;
- ((SvxFontItem*)pNewItem)->GetFamilyName()=aNewText;
- ((SvxFontItem*)pNewItem)->GetStyleName().Erase();
+ ((SvxFontItem*)pNewItem)->SetFamily( FAMILY_DONTKNOW );
+ ((SvxFontItem*)pNewItem)->SetFamilyName(aNewText);
+ ((SvxFontItem*)pNewItem)->SetStyleName( String() );
} break;
case ITEM_FONTHEIGHT: {
sal_uIntPtr nHgt=0;
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 5328e5f1a3d1..30628a10df86 100644..100755
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -836,11 +836,11 @@ void ImpGetDefaultFontsLanguage( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFo
aOutTypeArr[ n ].nFntType, aOutTypeArr[ n ].nLanguage,
DEFAULTFONT_FLAGS_ONLYONE, 0 ));
SvxFontItem* pI = aItemArr[ n ];
- pI->GetFamily() = aFnt.GetFamily();
- pI->GetFamilyName() = aFnt.GetName();
- pI->GetStyleName().Erase();
- pI->GetPitch() = aFnt.GetPitch();
- pI->GetCharSet() = aFnt.GetCharSet();
+ pI->SetFamily( aFnt.GetFamily());
+ pI->SetFamilyName( aFnt.GetName());
+ pI->SetStyleName( String() );
+ pI->SetPitch( aFnt.GetPitch());
+ pI->SetCharSet( aFnt.GetCharSet() );
}
}
@@ -854,29 +854,29 @@ void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt
// get DEFAULTFONT_LATIN_TEXT and set at pool as dynamic default
Font aFont(OutputDevice::GetDefaultFont(DEFAULTFONT_LATIN_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0));
- aSvxFontItem.GetFamily() = aFont.GetFamily();
- aSvxFontItem.GetFamilyName() = aFont.GetName();
- aSvxFontItem.GetStyleName().Erase();
- aSvxFontItem.GetPitch() = aFont.GetPitch();
- aSvxFontItem.GetCharSet() = aFont.GetCharSet();
+ aSvxFontItem.SetFamily(aFont.GetFamily());
+ aSvxFontItem.SetFamilyName(aFont.GetName());
+ aSvxFontItem.SetStyleName(String());
+ aSvxFontItem.SetPitch( aFont.GetPitch());
+ aSvxFontItem.SetCharSet( aFont.GetCharSet() );
pItemPool->SetPoolDefaultItem(aSvxFontItem);
// get DEFAULTFONT_CJK_TEXT and set at pool as dynamic default
Font aFontCJK(OutputDevice::GetDefaultFont(DEFAULTFONT_CJK_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0));
- aSvxFontItemCJK.GetFamily() = aFontCJK.GetFamily();
- aSvxFontItemCJK.GetFamilyName() = aFontCJK.GetName();
- aSvxFontItemCJK.GetStyleName().Erase();
- aSvxFontItemCJK.GetPitch() = aFontCJK.GetPitch();
- aSvxFontItemCJK.GetCharSet() = aFontCJK.GetCharSet();
+ aSvxFontItemCJK.SetFamily( aFontCJK.GetFamily());
+ aSvxFontItemCJK.SetFamilyName(aFontCJK.GetName());
+ aSvxFontItemCJK.SetStyleName(String());
+ aSvxFontItemCJK.SetPitch( aFontCJK.GetPitch());
+ aSvxFontItemCJK.SetCharSet( aFontCJK.GetCharSet());
pItemPool->SetPoolDefaultItem(aSvxFontItemCJK);
// get DEFAULTFONT_CTL_TEXT and set at pool as dynamic default
Font aFontCTL(OutputDevice::GetDefaultFont(DEFAULTFONT_CTL_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0));
- aSvxFontItemCTL.GetFamily() = aFontCTL.GetFamily();
- aSvxFontItemCTL.GetFamilyName() = aFontCTL.GetName();
- aSvxFontItemCTL.GetStyleName().Erase();
- aSvxFontItemCTL.GetPitch() = aFontCTL.GetPitch();
- aSvxFontItemCTL.GetCharSet() = aFontCTL.GetCharSet();
+ aSvxFontItemCTL.SetFamily(aFontCTL.GetFamily());
+ aSvxFontItemCTL.SetFamilyName(aFontCTL.GetName());
+ aSvxFontItemCTL.SetStyleName(String());
+ aSvxFontItemCTL.SetPitch( aFontCTL.GetPitch() );
+ aSvxFontItemCTL.SetCharSet( aFontCTL.GetCharSet());
pItemPool->SetPoolDefaultItem(aSvxFontItemCTL);
// set dynamic FontHeight defaults
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index ed6c2170a5f2..cd32145c191d 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -318,68 +318,25 @@ void SdrUnoObj::operator = (const SdrObject& rObj)
SdrRectObj::operator = (rObj);
// release the reference to the current control model
- SetUnoControlModel(uno::Reference< awt::XControlModel >());
+ SetUnoControlModel( NULL );
- aUnoControlModelTypeName = ((SdrUnoObj&) rObj).aUnoControlModelTypeName;
- aUnoControlTypeName = ((SdrUnoObj&) rObj).aUnoControlTypeName;
+ const SdrUnoObj& rUnoObj = dynamic_cast< const SdrUnoObj& >( rObj );
- // copy the uno control model
- uno::Reference< awt::XControlModel > xCtrl( ((SdrUnoObj&) rObj).GetUnoControlModel(), uno::UNO_QUERY );
- uno::Reference< util::XCloneable > xClone( xCtrl, uno::UNO_QUERY );
+ aUnoControlModelTypeName = rUnoObj.aUnoControlModelTypeName;
+ aUnoControlTypeName = rUnoObj.aUnoControlTypeName;
- if ( xClone.is() )
- {
- // copy the model by cloning
- uno::Reference< awt::XControlModel > xNewModel( xClone->createClone(), uno::UNO_QUERY );
- DBG_ASSERT( xNewModel.is(), "SdrUnoObj::operator =, no control model!");
- xUnoControlModel = xNewModel;
- }
- else
+ // copy the uno control model
+ const uno::Reference< awt::XControlModel > xSourceControlModel( rUnoObj.GetUnoControlModel(), uno::UNO_QUERY );
+ if ( xSourceControlModel.is() )
{
- // copy the model by streaming
- uno::Reference< io::XPersistObject > xObj( xCtrl, uno::UNO_QUERY );
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
-
- if ( xObj.is() && xFactory.is() )
+ try
{
- // creating a pipe
- uno::Reference< io::XOutputStream > xOutPipe(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.Pipe")), uno::UNO_QUERY);
- uno::Reference< io::XInputStream > xInPipe(xOutPipe, uno::UNO_QUERY);
-
- // creating the mark streams
- uno::Reference< io::XInputStream > xMarkIn(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.MarkableInputStream")), uno::UNO_QUERY);
- uno::Reference< io::XActiveDataSink > xMarkSink(xMarkIn, uno::UNO_QUERY);
-
- uno::Reference< io::XOutputStream > xMarkOut(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.MarkableOutputStream")), uno::UNO_QUERY);
- uno::Reference< io::XActiveDataSource > xMarkSource(xMarkOut, uno::UNO_QUERY);
-
- // connect mark and sink
- uno::Reference< io::XActiveDataSink > xSink(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.ObjectInputStream")), uno::UNO_QUERY);
-
- // connect mark and source
- uno::Reference< io::XActiveDataSource > xSource(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.ObjectOutputStream")), uno::UNO_QUERY);
-
- uno::Reference< io::XObjectOutputStream > xOutStrm(xSource, uno::UNO_QUERY);
- uno::Reference< io::XObjectInputStream > xInStrm(xSink, uno::UNO_QUERY);
-
- if (xMarkSink.is() && xMarkSource.is() && xSink.is() && xSource.is())
- {
- xMarkSink->setInputStream(xInPipe);
- xMarkSource->setOutputStream(xOutPipe);
- xSink->setInputStream(xMarkIn);
- xSource->setOutputStream(xMarkOut);
-
- // write the object to source
- xOutStrm->writeObject(xObj);
- xOutStrm->closeOutput();
- // read the object
- uno::Reference< awt::XControlModel > xModel(xInStrm->readObject(), uno::UNO_QUERY);
- xInStrm->closeInput();
-
- DBG_ASSERT(xModel.is(), "SdrUnoObj::operator =, keine Model erzeugt");
-
- xUnoControlModel = xModel;
- }
+ uno::Reference< util::XCloneable > xClone( xSourceControlModel, uno::UNO_QUERY_THROW );
+ xUnoControlModel.set( xClone->createClone(), uno::UNO_QUERY_THROW );
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
}
}
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 76fd7d423324..7666c1064e15 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -491,7 +491,7 @@ SvxMetricField::SvxMetricField(
SetLast( 5000 );
SetFirst( 0 );
- eDlgUnit = SfxModule::GetCurrentFieldUnit();
+ eDlgUnit = SfxModule::GetModuleFieldUnit( mxFrame );
SetFieldUnit( *this, eDlgUnit, sal_False );
Show();
}
@@ -576,7 +576,7 @@ void SvxMetricField::SetCoreUnit( SfxMapUnit eUnit )
void SvxMetricField::RefreshDlgUnit()
{
- FieldUnit eTmpUnit = SfxModule::GetCurrentFieldUnit();
+ FieldUnit eTmpUnit = SfxModule::GetModuleFieldUnit( mxFrame );
if ( eDlgUnit != eTmpUnit )
{
eDlgUnit = eTmpUnit;
diff --git a/sysui/desktop/icons/makefile.mk b/sysui/desktop/icons/makefile.mk
index ac32cdbe453b..ce5b0b70b636 100644
--- a/sysui/desktop/icons/makefile.mk
+++ b/sysui/desktop/icons/makefile.mk
@@ -127,69 +127,6 @@ all: \
$(MISC)$/ooo11-math-doc.ico \
$(MISC)$/ooo11-writer-doc.ico \
$(MISC)$/ooo11-writer-tem.ico \
- $(MISC)$/so8-base-app.ico \
- $(MISC)$/so8-base-doc.ico \
- $(MISC)$/so8-calc-app.ico \
- $(MISC)$/so8-calc-doc.ico \
- $(MISC)$/so8-calc-tem.ico \
- $(MISC)$/so8-chart-doc.ico \
- $(MISC)$/so8-configuration.ico \
- $(MISC)$/so8-draw-app.ico \
- $(MISC)$/so8-draw-doc.ico \
- $(MISC)$/so8-draw-tem.ico \
- $(MISC)$/so8-empty-doc.ico \
- $(MISC)$/so8-empty-tem.ico \
- $(MISC)$/so8-image-doc.ico \
- $(MISC)$/so8-impress-app.ico \
- $(MISC)$/so8-impress-doc.ico \
- $(MISC)$/so8-impress-tem.ico \
- $(MISC)$/so8-macro-doc.ico \
- $(MISC)$/so8-main-app.ico \
- $(MISC)$/so8-master-doc.ico \
- $(MISC)$/so8-math-app.ico \
- $(MISC)$/so8-math-doc.ico \
- $(MISC)$/so8-open.ico \
- $(MISC)$/so8-printer.ico \
- $(MISC)$/so8-web-doc.ico \
- $(MISC)$/so8-writer-app.ico \
- $(MISC)$/so8-writer-doc.ico \
- $(MISC)$/so8-writer-tem.ico \
- $(MISC)$/so9_empty_tem.ico \
- $(MISC)$/so9_math_app.ico \
- $(MISC)$/so9_global_doc.ico \
- $(MISC)$/so9_main_app.ico \
- $(MISC)$/so9_empty_doc.ico \
- $(MISC)$/so9_math_doc.ico \
- $(MISC)$/so9_base_app.ico \
- $(MISC)$/so9_html_doc.ico \
- $(MISC)$/so9_impress_doc.ico \
- $(MISC)$/so9_draw_tem.ico \
- $(MISC)$/so9_writer_tem.ico \
- $(MISC)$/so9_impress_app.ico \
- $(MISC)$/so9_calc_tem.ico \
- $(MISC)$/so9_base_doc.ico \
- $(MISC)$/so9_macro_doc.ico \
- $(MISC)$/so9_calc_doc.ico \
- $(MISC)$/so9_draw_doc.ico \
- $(MISC)$/so9_writer_doc.ico \
- $(MISC)$/so9_calc_app.ico \
- $(MISC)$/so9_impress_tem.ico \
- $(MISC)$/so9_chart_doc.ico \
- $(MISC)$/so9_writer_app.ico \
- $(MISC)$/so9_draw_app.ico \
- $(MISC)$/so9_open.ico \
- $(MISC)$/so7-base-doc.ico \
- $(MISC)$/so7-calc-doc.ico \
- $(MISC)$/so7-calc-tem.ico \
- $(MISC)$/so7-chart-doc.ico \
- $(MISC)$/so7-draw-doc.ico \
- $(MISC)$/so7-draw-tem.ico \
- $(MISC)$/so7-impress-doc.ico \
- $(MISC)$/so7-impress-tem.ico \
- $(MISC)$/so7-master-doc.ico \
- $(MISC)$/so7-math-doc.ico \
- $(MISC)$/so7-writer-doc.ico \
- $(MISC)$/so7-writer-tem.ico \
$(MISC)$/oxt-extension.ico
$(MISC)$/%.ico: %.ico
diff --git a/sysui/desktop/icons/so7-base-doc.ico b/sysui/desktop/icons/so7-base-doc.ico
deleted file mode 100644
index e4beab7270e1..000000000000
--- a/sysui/desktop/icons/so7-base-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-calc-doc.ico b/sysui/desktop/icons/so7-calc-doc.ico
deleted file mode 100644
index 8b34fc606c5d..000000000000
--- a/sysui/desktop/icons/so7-calc-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-calc-tem.ico b/sysui/desktop/icons/so7-calc-tem.ico
deleted file mode 100644
index d074a214a90b..000000000000
--- a/sysui/desktop/icons/so7-calc-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-chart-doc.ico b/sysui/desktop/icons/so7-chart-doc.ico
deleted file mode 100644
index bdc613fb30e2..000000000000
--- a/sysui/desktop/icons/so7-chart-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-draw-doc.ico b/sysui/desktop/icons/so7-draw-doc.ico
deleted file mode 100644
index c2881862053a..000000000000
--- a/sysui/desktop/icons/so7-draw-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-draw-tem.ico b/sysui/desktop/icons/so7-draw-tem.ico
deleted file mode 100644
index 8d713d0f470e..000000000000
--- a/sysui/desktop/icons/so7-draw-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-impress-doc.ico b/sysui/desktop/icons/so7-impress-doc.ico
deleted file mode 100644
index a8f9518e624b..000000000000
--- a/sysui/desktop/icons/so7-impress-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-impress-tem.ico b/sysui/desktop/icons/so7-impress-tem.ico
deleted file mode 100644
index ac140b269242..000000000000
--- a/sysui/desktop/icons/so7-impress-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-master-doc.ico b/sysui/desktop/icons/so7-master-doc.ico
deleted file mode 100644
index 1c3068715990..000000000000
--- a/sysui/desktop/icons/so7-master-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-math-doc.ico b/sysui/desktop/icons/so7-math-doc.ico
deleted file mode 100644
index d1cd9bd4c6bd..000000000000
--- a/sysui/desktop/icons/so7-math-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-writer-doc.ico b/sysui/desktop/icons/so7-writer-doc.ico
deleted file mode 100644
index b8eb3df20564..000000000000
--- a/sysui/desktop/icons/so7-writer-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-writer-tem.ico b/sysui/desktop/icons/so7-writer-tem.ico
deleted file mode 100644
index 318cce4bc9a7..000000000000
--- a/sysui/desktop/icons/so7-writer-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-base-app.ico b/sysui/desktop/icons/so8-base-app.ico
deleted file mode 100644
index 4a22d3529614..000000000000
--- a/sysui/desktop/icons/so8-base-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-base-doc.ico b/sysui/desktop/icons/so8-base-doc.ico
deleted file mode 100644
index bcddbf957630..000000000000
--- a/sysui/desktop/icons/so8-base-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-calc-app.ico b/sysui/desktop/icons/so8-calc-app.ico
deleted file mode 100644
index a28cab56157b..000000000000
--- a/sysui/desktop/icons/so8-calc-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-calc-doc.ico b/sysui/desktop/icons/so8-calc-doc.ico
deleted file mode 100644
index 5f293dd82c30..000000000000
--- a/sysui/desktop/icons/so8-calc-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-calc-tem.ico b/sysui/desktop/icons/so8-calc-tem.ico
deleted file mode 100644
index 98bf90678573..000000000000
--- a/sysui/desktop/icons/so8-calc-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-chart-doc.ico b/sysui/desktop/icons/so8-chart-doc.ico
deleted file mode 100644
index 01ff8365434b..000000000000
--- a/sysui/desktop/icons/so8-chart-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-configuration.ico b/sysui/desktop/icons/so8-configuration.ico
deleted file mode 100644
index 57f3b6701b30..000000000000
--- a/sysui/desktop/icons/so8-configuration.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-draw-app.ico b/sysui/desktop/icons/so8-draw-app.ico
deleted file mode 100644
index 6003ccb3d7c3..000000000000
--- a/sysui/desktop/icons/so8-draw-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-draw-doc.ico b/sysui/desktop/icons/so8-draw-doc.ico
deleted file mode 100644
index f4f169bd6fb5..000000000000
--- a/sysui/desktop/icons/so8-draw-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-draw-tem.ico b/sysui/desktop/icons/so8-draw-tem.ico
deleted file mode 100644
index d3f63c38dbe0..000000000000
--- a/sysui/desktop/icons/so8-draw-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-empty-doc.ico b/sysui/desktop/icons/so8-empty-doc.ico
deleted file mode 100644
index b71d2b939ca7..000000000000
--- a/sysui/desktop/icons/so8-empty-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-empty-tem.ico b/sysui/desktop/icons/so8-empty-tem.ico
deleted file mode 100644
index 9368b0a81aef..000000000000
--- a/sysui/desktop/icons/so8-empty-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-image-doc.ico b/sysui/desktop/icons/so8-image-doc.ico
deleted file mode 100644
index 11b4f0f6c718..000000000000
--- a/sysui/desktop/icons/so8-image-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-impress-app.ico b/sysui/desktop/icons/so8-impress-app.ico
deleted file mode 100644
index 8fae43dab26d..000000000000
--- a/sysui/desktop/icons/so8-impress-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-impress-doc.ico b/sysui/desktop/icons/so8-impress-doc.ico
deleted file mode 100644
index 9a91f89f2900..000000000000
--- a/sysui/desktop/icons/so8-impress-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-impress-tem.ico b/sysui/desktop/icons/so8-impress-tem.ico
deleted file mode 100644
index f84f813f992c..000000000000
--- a/sysui/desktop/icons/so8-impress-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-macro-doc.ico b/sysui/desktop/icons/so8-macro-doc.ico
deleted file mode 100644
index f3742e1274e7..000000000000
--- a/sysui/desktop/icons/so8-macro-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-main-app.ico b/sysui/desktop/icons/so8-main-app.ico
deleted file mode 100644
index aa044ad9c702..000000000000
--- a/sysui/desktop/icons/so8-main-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-master-doc.ico b/sysui/desktop/icons/so8-master-doc.ico
deleted file mode 100644
index 27a1d2f61c49..000000000000
--- a/sysui/desktop/icons/so8-master-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-math-app.ico b/sysui/desktop/icons/so8-math-app.ico
deleted file mode 100644
index 956c259c756a..000000000000
--- a/sysui/desktop/icons/so8-math-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-math-doc.ico b/sysui/desktop/icons/so8-math-doc.ico
deleted file mode 100644
index e7b88449999f..000000000000
--- a/sysui/desktop/icons/so8-math-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-open.ico b/sysui/desktop/icons/so8-open.ico
deleted file mode 100644
index b77a741b338f..000000000000
--- a/sysui/desktop/icons/so8-open.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-printer.ico b/sysui/desktop/icons/so8-printer.ico
deleted file mode 100644
index 25e61f8de5d5..000000000000
--- a/sysui/desktop/icons/so8-printer.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-web-doc.ico b/sysui/desktop/icons/so8-web-doc.ico
deleted file mode 100644
index 12eeb63cffb2..000000000000
--- a/sysui/desktop/icons/so8-web-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-writer-app.ico b/sysui/desktop/icons/so8-writer-app.ico
deleted file mode 100644
index 15f7f92d4b45..000000000000
--- a/sysui/desktop/icons/so8-writer-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-writer-doc.ico b/sysui/desktop/icons/so8-writer-doc.ico
deleted file mode 100644
index da774be1d3ac..000000000000
--- a/sysui/desktop/icons/so8-writer-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-writer-tem.ico b/sysui/desktop/icons/so8-writer-tem.ico
deleted file mode 100644
index 1bdb86c8090f..000000000000
--- a/sysui/desktop/icons/so8-writer-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_base_app.ico b/sysui/desktop/icons/so9_base_app.ico
deleted file mode 100755
index aa7036eb90fc..000000000000
--- a/sysui/desktop/icons/so9_base_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_base_doc.ico b/sysui/desktop/icons/so9_base_doc.ico
deleted file mode 100644
index 8cc1d4433c2c..000000000000
--- a/sysui/desktop/icons/so9_base_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_calc_app.ico b/sysui/desktop/icons/so9_calc_app.ico
deleted file mode 100755
index d7182cad0943..000000000000
--- a/sysui/desktop/icons/so9_calc_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_calc_doc.ico b/sysui/desktop/icons/so9_calc_doc.ico
deleted file mode 100644
index 2b9e514cb97b..000000000000
--- a/sysui/desktop/icons/so9_calc_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_calc_tem.ico b/sysui/desktop/icons/so9_calc_tem.ico
deleted file mode 100644
index 17f4823c4374..000000000000
--- a/sysui/desktop/icons/so9_calc_tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_chart_doc.ico b/sysui/desktop/icons/so9_chart_doc.ico
deleted file mode 100644
index b116c81903b3..000000000000
--- a/sysui/desktop/icons/so9_chart_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_draw_app.ico b/sysui/desktop/icons/so9_draw_app.ico
deleted file mode 100755
index a8b3c3270fc0..000000000000
--- a/sysui/desktop/icons/so9_draw_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_draw_doc.ico b/sysui/desktop/icons/so9_draw_doc.ico
deleted file mode 100644
index 51f95046709a..000000000000
--- a/sysui/desktop/icons/so9_draw_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_draw_tem.ico b/sysui/desktop/icons/so9_draw_tem.ico
deleted file mode 100644
index e4b341175bff..000000000000
--- a/sysui/desktop/icons/so9_draw_tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_empty_doc.ico b/sysui/desktop/icons/so9_empty_doc.ico
deleted file mode 100644
index a3970775e3ed..000000000000
--- a/sysui/desktop/icons/so9_empty_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_empty_tem.ico b/sysui/desktop/icons/so9_empty_tem.ico
deleted file mode 100644
index 1b0088b80277..000000000000
--- a/sysui/desktop/icons/so9_empty_tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_global_doc.ico b/sysui/desktop/icons/so9_global_doc.ico
deleted file mode 100644
index ea4ccb383956..000000000000
--- a/sysui/desktop/icons/so9_global_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_html_doc.ico b/sysui/desktop/icons/so9_html_doc.ico
deleted file mode 100644
index 4e5b8bc99c07..000000000000
--- a/sysui/desktop/icons/so9_html_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_impress_app.ico b/sysui/desktop/icons/so9_impress_app.ico
deleted file mode 100755
index cf10331c5ff9..000000000000
--- a/sysui/desktop/icons/so9_impress_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_impress_doc.ico b/sysui/desktop/icons/so9_impress_doc.ico
deleted file mode 100644
index 5258a8b6aa4c..000000000000
--- a/sysui/desktop/icons/so9_impress_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_impress_tem.ico b/sysui/desktop/icons/so9_impress_tem.ico
deleted file mode 100644
index dcdbddb3b654..000000000000
--- a/sysui/desktop/icons/so9_impress_tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_macro_doc.ico b/sysui/desktop/icons/so9_macro_doc.ico
deleted file mode 100644
index cd004015e63f..000000000000
--- a/sysui/desktop/icons/so9_macro_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_main_app.ico b/sysui/desktop/icons/so9_main_app.ico
deleted file mode 100755
index 90f193d80dd9..000000000000
--- a/sysui/desktop/icons/so9_main_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_math_app.ico b/sysui/desktop/icons/so9_math_app.ico
deleted file mode 100755
index 11fbbf9a494a..000000000000
--- a/sysui/desktop/icons/so9_math_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_math_doc.ico b/sysui/desktop/icons/so9_math_doc.ico
deleted file mode 100644
index 622ae939d23a..000000000000
--- a/sysui/desktop/icons/so9_math_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_open.ico b/sysui/desktop/icons/so9_open.ico
deleted file mode 100755
index 90f193d80dd9..000000000000
--- a/sysui/desktop/icons/so9_open.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_writer_app.ico b/sysui/desktop/icons/so9_writer_app.ico
deleted file mode 100755
index 10c964dba966..000000000000
--- a/sysui/desktop/icons/so9_writer_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_writer_doc.ico b/sysui/desktop/icons/so9_writer_doc.ico
deleted file mode 100644
index b0cf11a993c9..000000000000
--- a/sysui/desktop/icons/so9_writer_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_writer_tem.ico b/sysui/desktop/icons/so9_writer_tem.ico
deleted file mode 100644
index 2e62a1934646..000000000000
--- a/sysui/desktop/icons/so9_writer_tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/prj/build.lst b/sysui/prj/build.lst
index b5f26eb936b9..097cae97ed29 100644
--- a/sysui/prj/build.lst
+++ b/sysui/prj/build.lst
@@ -1,6 +1,6 @@
su sysui : L10N:l10n offapi xml2cmp rdbmaker l10ntools setup_native NULL
-su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL
-su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL
+#su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL
+#su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL
su sysui\desktop\icons nmake - w su_iconsw NULL
su sysui\desktop\os2 nmake - p su_iconsw NULL
su sysui\desktop\macosx nmake - u su_dtmacosx su_dtshare.u NULL
@@ -16,4 +16,4 @@ su sysui\desktop\debian nmake - u su_dtdebian su_dtshare.u
su sysui\desktop\slackware nmake - u su_dtslackware su_dtshare.u NULL
su sysui\desktop\solaris nmake - u su_dtsolaris su_dtshare.u NULL
su sysui\desktop\util nmake - u su_desktop su_dtredhat.u su_dtsuse.u su_dtmdk.u su_dtfreedesktop.u su_dtdebian.u su_dtslackware.u NULL
-su sysui\util nmake - all su_util su_dtsolaris.u su_desktop.u su_win32_quickstart_so.w su_iconsw.w NULL
+su sysui\util nmake - all su_util su_dtsolaris.u su_desktop.u su_iconsw.w NULL
diff --git a/sysui/prj/d.lst b/sysui/prj/d.lst
index c6019cea9a43..918ee8bcbc8f 100644
--- a/sysui/prj/d.lst
+++ b/sysui/prj/d.lst
@@ -15,10 +15,6 @@ mkdir: %_DEST%\bin%_EXT%\desktop-integration\pkg
..\%__SRC%\bin\pkg\*.tar.gz %_DEST%\bin%_EXT%\desktop-integration\pkg\*.tar.gz
..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
-..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe
-..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\install_quickstart.exe
-..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\quickstart.exe
-..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\install_quickstart.exe
..\%__SRC%\misc\ooo3_main_app.ico %_DEST%\bin%_EXT%\soffice.ico
diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
index 5bd774d618d5..c78ce26dd39a 100644
--- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
@@ -130,7 +130,11 @@ OfficeDocumentsManager::OfficeDocumentsManager(
// virtual
OfficeDocumentsManager::~OfficeDocumentsManager()
{
- OSL_ENSURE( m_aDocs.empty(), "document list not empty!" );
+ //OSL_ENSURE( m_aDocs.empty(), "document list not empty!" );
+ // no need to assert this: Normal shutdown of OOo could already trigger it, since the order in which
+ // objects are actually released/destroyed upon shutdown is not defined. And when we arrive *here*,
+ // OOo *is* shutting down currently, since we're held by the TDOC provider, which is disposed
+ // upon shutdown.
}
//=========================================================================
@@ -423,8 +427,18 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent(
++it;
}
- OSL_ENSURE( it != m_aDocs.end(),
- "TitleChanged event notified for unknown document!" );
+// OSL_ENSURE( it != m_aDocs.end(),
+// "TitleChanged event notified for unknown document!" );
+ // TODO: re-enable this assertion. It has been disabled for now, since it breaks the assertion-free smoketest,
+ // and the fix is more difficult than what can be done now.
+ // The problem is that at the moment, when you close a SFX-based document via API, it will first
+ // fire the notifyClosing event, which will make the OfficeDocumentsManager remove the doc from its list.
+ // Then, it will notify an OnTitleChanged, then an OnUnload. Documents closed via call the notifyClosing
+ // *after* OnUnload and all other On* events.
+ // In agreement with MBA, the implementation for SfxBaseModel::Close should be changed to also send notifyClosing
+ // as last event. When this happens, the assertion here must be enabled, again.
+ // There is no bug for this, yet - IZ is currently down due to the Kenai migration.
+ // 2011-02-23 / frank.schoenheit@sun.com
}
}
}
diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx
index 4df133c7c674..0703c329e9fc 100644
--- a/uui/source/iahndl-ssl.cxx
+++ b/uui/source/iahndl-ssl.cxx
@@ -25,12 +25,18 @@
*
************************************************************************/
+
#include "com/sun/star/security/CertificateValidity.hpp"
+#include "com/sun/star/security/XCertificateExtension.hpp"
+#include "com/sun/star/security/XSanExtension.hpp"
+#include <com/sun/star/security/ExtAltNameType.hpp>
#include "com/sun/star/task/XInteractionAbort.hpp"
#include "com/sun/star/task/XInteractionApprove.hpp"
#include "com/sun/star/task/XInteractionRequest.hpp"
#include "com/sun/star/ucb/CertificateValidationRequest.hpp"
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
#include "vos/mutex.hxx"
#include "tools/datetime.hxx"
#include "svl/zforlist.hxx"
@@ -47,6 +53,9 @@
#define DESCRIPTION_2 2
#define TITLE 3
+#define OID_SUBJECT_ALTERNATIVE_NAME "2.5.29.17"
+
+
using namespace com::sun::star;
namespace {
@@ -77,19 +86,25 @@ getContentPart( const String& _rRawString )
bool
isDomainMatch(
- rtl::OUString hostName, rtl::OUString certHostName)
+ rtl::OUString hostName, uno::Sequence< ::rtl::OUString > certHostNames)
{
- if (hostName.equalsIgnoreAsciiCase( certHostName ))
- return true;
-
- if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) &&
- hostName.getLength() >= certHostName.getLength() )
- {
- rtl::OUString cmpStr = certHostName.copy( 1 );
-
- if ( hostName.matchIgnoreAsciiCase(
- cmpStr, hostName.getLength() - cmpStr.getLength()) )
- return true;
+ for ( int i = 0; i < certHostNames.getLength(); i++){
+ ::rtl::OUString element = certHostNames[i];
+
+ if (element.getLength() == 0)
+ continue;
+
+ if (hostName.equalsIgnoreAsciiCase( element ))
+ return true;
+
+ if ( 0 == element.indexOf( rtl::OUString::createFromAscii( "*" ) ) &&
+ hostName.getLength() >= element.getLength() )
+ {
+ rtl::OUString cmpStr = element.copy( 1 );
+ if ( hostName.matchIgnoreAsciiCase(
+ cmpStr, hostName.getLength() - cmpStr.getLength()) )
+ return true;
+ }
}
return false;
@@ -278,10 +293,34 @@ handleCertificateValidationRequest_(
rRequest.Certificate );
}
+ uno::Sequence< uno::Reference< security::XCertificateExtension > > extensions = rRequest.Certificate->getExtensions();
+ uno::Sequence< security::CertAltNameEntry > altNames;
+ for (sal_Int32 i = 0 ; i < extensions.getLength(); i++){
+ uno::Reference< security::XCertificateExtension >element = extensions[i];
+
+ rtl::OString aId ( (const sal_Char *)element->getExtensionId().getArray(), element->getExtensionId().getLength());
+ if (aId.equals(OID_SUBJECT_ALTERNATIVE_NAME))
+ {
+ uno::Reference< security::XSanExtension > sanExtension ( element, uno::UNO_QUERY );
+ altNames = sanExtension->getAlternativeNames();
+ break;
+ }
+ }
+
+ ::rtl::OUString certHostName = getContentPart( rRequest.Certificate->getSubjectName() );
+ uno::Sequence< ::rtl::OUString > certHostNames(altNames.getLength() + 1);
+
+ certHostNames[0] = certHostName;
+
+ for(int n = 1; n < altNames.getLength(); n++){
+ if (altNames[n].Type == security::ExtAltNameType_DNS_NAME){
+ altNames[n].Value >>= certHostNames[n];
+ }
+ }
+
if ( (!isDomainMatch(
rRequest.HostName,
- getContentPart(
- rRequest.Certificate->getSubjectName()) )) &&
+ certHostNames )) &&
trustCert )
{
trustCert = executeSSLWarnDialog( pParent,
diff --git a/xmlhelp/source/com/sun/star/help/HelpIndexer.java b/xmlhelp/source/com/sun/star/help/HelpIndexer.java
index bd09982daa3e..abb866804b43 100644
--- a/xmlhelp/source/com/sun/star/help/HelpIndexer.java
+++ b/xmlhelp/source/com/sun/star/help/HelpIndexer.java
@@ -40,6 +40,14 @@ import java.io.IOException;
import java.util.Date;
import java.util.zip.ZipOutputStream;
+/**
+ When this tool is used with long path names on Windows, that is paths which start
+ with \\?\, then the caller must make sure that the path is unique. This is achieved
+ by removing '.' and '..' from the path. Paths which are created by
+ osl_getSystemPathFromFileURL fulfill this requirement. This is necessary because
+ lucene is patched to not use File.getCanonicalPath. See long_path.patch in the lucene
+ module.
+ */
public class HelpIndexer extends WeakBase
implements XServiceInfo, XInvocation
{
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index d798f6c42f81..e3749fc1f694 100644..100755
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -416,9 +416,6 @@ rtl::OUString Databases::getInstallPathAsSystemPath()
return m_aInstallDirectoryAsSystemPath;
}
-
-
-
rtl::OUString Databases::getInstallPathAsURL()
{
osl::MutexGuard aGuard( m_aMutex );
@@ -642,22 +639,18 @@ Db* Databases::getBerkeley( const rtl::OUString& Database,
{
Db* table = new Db();
- rtl::OUString fileNameOU;
+ rtl::OUString fileURL;
if( pExtensionPath )
- {
- rtl::OUString aExpandedURL = expandURL( *pExtensionPath );
- aExpandedURL += Language + dbFileName;
- osl::FileBase::getSystemPathFromFileURL( aExpandedURL, fileNameOU );
- }
+ fileURL = expandURL(*pExtensionPath) + Language + dbFileName;
else
- fileNameOU = getInstallPathAsSystemPath() + key;
-
+ fileURL = getInstallPathAsURL() + key;
- rtl::OString fileName( fileNameOU.getStr(),fileNameOU.getLength(),osl_getThreadTextEncoding() );
-
- rtl::OUString fileNameDBHelp( fileNameOU );
+ rtl::OUString fileNameDBHelp( fileURL );
+ //Extensions always use the new format
if( pExtensionPath != NULL )
fileNameDBHelp += rtl::OUString::createFromAscii( "_" );
+ //SimpleFileAccess takes file URLs as arguments!!! Using filenames works accidentally but
+ //fails for example when using long path names on Windows (starting with \\?\)
if( m_xSFA->exists( fileNameDBHelp ) )
{
DBHelp* pDBHelp = new DBHelp( fileNameDBHelp, m_xSFA );
@@ -666,13 +659,13 @@ Db* Databases::getBerkeley( const rtl::OUString& Database,
#ifdef TEST_DBHELP
bool bSuccess;
bool bOldDbAccess = false;
- bSuccess = pDBHelp->testAgainstDb( fileName, bOldDbAccess );
+ bSuccess = pDBHelp->testAgainstDb( fileURL, bOldDbAccess );
bOldDbAccess = true;
- bSuccess = pDBHelp->testAgainstDb( fileName, bOldDbAccess );
+ bSuccess = pDBHelp->testAgainstDb( fileURL, bOldDbAccess );
#endif
}
- else if( table->open( 0,fileName.getStr(),0,DB_BTREE,DB_RDONLY,0644 ) )
+ else if( table->open( 0,fileURL, DB_BTREE,DB_RDONLY,0644 ) )
{
table->close( 0 );
delete table;
@@ -950,17 +943,13 @@ KeywordInfo* Databases::getKeyword( const rtl::OUString& Database,
std::vector<KeywordInfo::KeywordElement> aVector;
KeyDataBaseFileIterator aDbFileIt( m_xContext, *this, Database, Language );
- rtl::OUString fileNameOU;
+ rtl::OUString fileURL;
bool bExtension = false;
- while( (fileNameOU = aDbFileIt.nextDbFile( bExtension )).getLength() > 0 )
+ while( (fileURL = aDbFileIt.nextDbFile( bExtension )).getLength() > 0 )
{
- rtl::OString fileName( fileNameOU.getStr(),
- fileNameOU.getLength(),
- osl_getThreadTextEncoding() );
-
Db table;
- rtl::OUString fileNameDBHelp( fileNameOU );
+ rtl::OUString fileNameDBHelp( fileURL );
if( bExtension )
fileNameDBHelp += rtl::OUString::createFromAscii( "_" );
if( m_xSFA->exists( fileNameDBHelp ) )
@@ -1009,16 +998,16 @@ KeywordInfo* Databases::getKeyword( const rtl::OUString& Database,
#ifdef TEST_DBHELP
bool bSuccess;
bool bOldDbAccess = false;
- bSuccess = aDBHelp.testAgainstDb( fileName, bOldDbAccess );
+ bSuccess = aDBHelp.testAgainstDb( fileURL, bOldDbAccess );
bOldDbAccess = true;
- bSuccess = aDBHelp.testAgainstDb( fileName, bOldDbAccess );
+ bSuccess = aDBHelp.testAgainstDb( fileURL, bOldDbAccess );
int nDummy = 0;
#endif
}
- else if( 0 == table.open( 0,fileName.getStr(),0,DB_BTREE,DB_RDONLY,0644 ) )
+ else if( 0 == table.open( 0,fileURL,DB_BTREE,DB_RDONLY,0644 ) )
{
Db* idmap = getBerkeley( Database,Language );
@@ -1867,6 +1856,7 @@ Db* DataBaseIterator::implGetDbFromPackage( Reference< deployment::XPackage > xP
//===================================================================
// class KeyDataBaseFileIterator
+//returns a file URL
rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension )
{
rtl::OUString aRetFile;
@@ -1877,7 +1867,7 @@ rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension )
{
case INITIAL_MODULE:
aRetFile =
- m_rDatabases.getInstallPathAsSystemPath() +
+ m_rDatabases.getInstallPathAsURL() +
m_rDatabases.processLang( m_aLanguage ) + aSlash + m_aInitialModule +
rtl::OUString::createFromAscii( ".key" );
@@ -1935,16 +1925,14 @@ rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension )
return aRetFile;
}
+//Returns a file URL, that does not contain macros
rtl::OUString KeyDataBaseFileIterator::implGetDbFileFromPackage
( Reference< deployment::XPackage > xPackage )
{
rtl::OUString aExpandedURL =
implGetFileFromPackage( rtl::OUString::createFromAscii( ".key" ), xPackage );
- rtl::OUString aRetFile;
- osl::FileBase::getSystemPathFromFileURL( aExpandedURL, aRetFile );
-
- return aRetFile;
+ return aExpandedURL;
}
diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx
index aa80bf27405b..793edafb480f 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.hxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.hxx
@@ -506,7 +506,7 @@ namespace chelp {
Databases& rDatabases, const rtl::OUString& aInitialModule, const rtl::OUString& aLanguage )
: ExtensionIteratorBase( xContext, rDatabases, aInitialModule, aLanguage )
{}
-
+ //Returns a file URL
rtl::OUString nextDbFile( bool& o_rbExtension );
private:
diff --git a/xmlhelp/source/cxxhelp/provider/db.cxx b/xmlhelp/source/cxxhelp/provider/db.cxx
index abc5acc6381c..3db8f5a3da87 100644..100755
--- a/xmlhelp/source/cxxhelp/provider/db.cxx
+++ b/xmlhelp/source/cxxhelp/provider/db.cxx
@@ -35,6 +35,8 @@
#include "com/sun/star/io/XSeekable.hpp"
+#include "osl/file.hxx"
+#include "osl/thread.hxx"
#ifdef TEST_DBHELP
#include <osl/time.h>
#endif
@@ -115,21 +117,25 @@ void testWriteKeyValue( FILE* pFile, const KeyValPair& rKeyValPair )
fprintf( pFile, "%c", cLF );
}
-bool DBHelp::testAgainstDb( const rtl::OString& fileName, bool bOldDbAccess )
+bool DBHelp::testAgainstDb( const rtl::OUString& fileURL, bool bOldDbAccess )
{
bool bSuccess = true;
KeyValPairVector avKeyValPair;
- rtl::OString aOutFileName = fileName;
- aOutFileName += "_TestOut";
+ rtl::OUString aOutFileName = fileURL;
+ aOutFileName += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_TestOut"));
if( bOldDbAccess )
- aOutFileName += "_Old";
- FILE* pFile = fopen( aOutFileName.getStr(), "wb" );
-
+ aOutFileName += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_Old"));
+#ifdef WNT
+ FILE* pFile = _wfopen( aOutFileName.getStr(), L"wb" );
+#else
+ rtl::OString sFile = rtl::OUStringToOString(aOutFileName, osl_getThreadTextEncoding());
+ FILE* pFile = fopen( sFile.getStr(), "wb" );
+#endif
// Get all values
Db table;
- if( 0 == table.open( 0,fileName.getStr(),0,DB_BTREE,DB_RDONLY,0644 ) )
+ if( 0 == table.open( 0,fileURL,DB_BTREE,DB_RDONLY,0644 ) )
{
bool first = true;
@@ -206,7 +212,7 @@ bool DBHelp::testAgainstDb( const rtl::OString& fileName, bool bOldDbAccess )
{
if( bFirst )
{
- if( tableTest.open( 0,fileName.getStr(),0,DB_BTREE,DB_RDONLY,0644 ) )
+ if( tableTest.open( 0,fileURL, DB_BTREE,DB_RDONLY,0644 ) )
{
if( pFile != NULL )
fprintf( pFile, "Cannot open database\n" );
@@ -305,11 +311,11 @@ void DBHelp::createHashMap( bool bOptimizeForPerformance )
m_pStringToValPosMap = new StringToValPosMap();
}
- Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileName );
+ Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileURL );
if( xIn.is() )
{
Sequence< sal_Int8 > aData;
- sal_Int32 nSize = m_xSFA->getSize( m_aFileName );
+ sal_Int32 nSize = m_xSFA->getSize( m_aFileURL );
sal_Int32 nRead = xIn->readBytes( aData, nSize );
const char* pData = (const char*)aData.getConstArray();
@@ -388,7 +394,7 @@ bool DBHelp::getValueForKey( const rtl::OString& rKey, DBData& rValue )
int iValuePos = rValPair.first;
int nValueLen = rValPair.second;
- Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileName );
+ Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileURL );
if( xIn.is() )
{
Reference< XSeekable > xXSeekable( xIn, UNO_QUERY );
@@ -436,9 +442,9 @@ bool DBHelp::startIteration( void )
{
bool bSuccess = false;
- sal_Int32 nSize = m_xSFA->getSize( m_aFileName );
+ sal_Int32 nSize = m_xSFA->getSize( m_aFileURL );
- Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileName );
+ Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileURL );
if( xIn.is() )
{
m_nItRead = xIn->readBytes( m_aItData, nSize );
@@ -519,6 +525,19 @@ int Db::open(DB_TXN *txnid,
return db_internal::check_error( err,"Db::open" );
}
+int Db::open(DB_TXN *txnid,
+ ::rtl::OUString const & fileURL,
+ DBTYPE type,
+ u_int32_t flags,
+ int mode)
+{
+ ::rtl::OUString ouPath;
+ ::osl::FileBase::getSystemPathFromFileURL(fileURL, ouPath);
+ const ::rtl::OString sPath = ::rtl::OUStringToOString(ouPath, osl_getThreadTextEncoding());
+ return open(txnid, sPath.getStr(), 0, type, flags, mode);
+}
+
+
int Db::get(DB_TXN *txnid, Dbt *key, Dbt *data, u_int32_t flags)
{
diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx
index eb867c0426d3..1e25ab1f579b 100644..100755
--- a/xmlhelp/source/cxxhelp/provider/db.hxx
+++ b/xmlhelp/source/cxxhelp/provider/db.hxx
@@ -118,7 +118,7 @@ namespace berkeleydbproxy {
class DBHelp
{
- rtl::OUString m_aFileName;
+ rtl::OUString m_aFileURL;
StringToDataMap* m_pStringToDataMap;
StringToValPosMap* m_pStringToValPosMap;
com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess >
@@ -133,16 +133,21 @@ namespace berkeleydbproxy {
bool implReadLenAndData( const char* pData, int& riPos, DBData& rValue );
public:
- DBHelp( const rtl::OUString& rFileName,
+ //DBHelp must get a fileURL which can then directly be used by simple file access.
+ //SimpleFileAccess requires file URLs as arguments. Passing file path may work but fails
+ //for example when using long file paths on Windows, which start with "\\?\"
+ DBHelp( const rtl::OUString& rFileURL,
com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > xSFA )
- : m_aFileName( rFileName )
+ : m_aFileURL( rFileURL )
, m_pStringToDataMap( NULL )
, m_pStringToValPosMap( NULL )
, m_xSFA( xSFA )
, m_pItData( NULL )
, m_nItRead( -1 )
, m_iItPos( -1 )
- {}
+ {
+ OSL_ASSERT(!rFileURL.compareTo(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:")), 5));
+ }
~DBHelp()
{ releaseHashMap(); }
@@ -150,7 +155,7 @@ namespace berkeleydbproxy {
void releaseHashMap( void );
#ifdef TEST_DBHELP
- bool testAgainstDb( const rtl::OString& fileName, bool bOldDbAccess );
+ bool testAgainstDb( const rtl::OUString& fileURL, bool bOldDbAccess );
#endif
bool getValueForKey( const rtl::OString& rKey, DBData& rValue );
@@ -184,6 +189,12 @@ namespace berkeleydbproxy {
u_int32_t flags,
int mode);
+ int open(DB_TXN *txnid,
+ ::rtl::OUString const & fileURL,
+ DBTYPE type,
+ u_int32_t flags,
+ int mode);
+
int get(DB_TXN* txnid, Dbt *key, Dbt *data, u_int32_t flags);
diff --git a/xmloff/inc/xmloff/PageMasterStyleMap.hxx b/xmloff/inc/xmloff/PageMasterStyleMap.hxx
index 6ca1ba29f2cb..592949ca2b82 100644
--- a/xmloff/inc/xmloff/PageMasterStyleMap.hxx
+++ b/xmloff/inc/xmloff/PageMasterStyleMap.hxx
@@ -83,6 +83,11 @@
#define CTF_PM_PRINT_HEADERS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0017))
#define CTF_PM_PRINT_OBJECTS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0018))
#define CTF_PM_PRINT_ZEROVALUES (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0019))
+#define CTF_PM_MARGINALL (XML_PM_CTF_START + 0x001A)
+#define CTF_PM_MARGINTOP (XML_PM_CTF_START + 0x001B)
+#define CTF_PM_MARGINBOTTOM (XML_PM_CTF_START + 0x001C)
+#define CTF_PM_MARGINLEFT (XML_PM_CTF_START + 0x001D)
+#define CTF_PM_MARGINRIGHT (XML_PM_CTF_START + 0x001E)
#define CTF_PM_PAGEUSAGE (XML_PM_CTF_START + 0x0031)
#define CTF_PM_GRAPHICPOSITION (XML_PM_CTF_START + 0x0032)
@@ -118,6 +123,12 @@
#define CTF_PM_HEADERGRAPHICPOSITION (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0034))
#define CTF_PM_HEADERGRAPHICFILTER (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0035))
#define CTF_PM_HEADERGRAPHICURL (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0036))
+#define CTF_PM_HEADERMARGINALL (CTF_PM_HEADERFLAG|CTF_PM_MARGINALL)
+#define CTF_PM_HEADERMARGINTOP (CTF_PM_HEADERFLAG|CTF_PM_MARGINTOP)
+#define CTF_PM_HEADERMARGINBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_MARGINBOTTOM)
+#define CTF_PM_HEADERMARGINLEFT (CTF_PM_HEADERFLAG|CTF_PM_MARGINLEFT)
+#define CTF_PM_HEADERMARGINRIGHT (CTF_PM_HEADERFLAG|CTF_PM_MARGINRIGHT)
+
// footer
#define CTF_PM_FOOTERBORDERALL (CTF_PM_FOOTERFLAG|CTF_PM_BORDERALL)
#define CTF_PM_FOOTERBORDERTOP (CTF_PM_FOOTERFLAG|CTF_PM_BORDERTOP)
@@ -140,6 +151,12 @@
#define CTF_PM_FOOTERGRAPHICPOSITION (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0034))
#define CTF_PM_FOOTERGRAPHICFILTER (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0035))
#define CTF_PM_FOOTERGRAPHICURL (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0036))
+#define CTF_PM_FOOTERMARGINALL (CTF_PM_FOOTERFLAG|CTF_PM_MARGINALL)
+#define CTF_PM_FOOTERMARGINTOP (CTF_PM_FOOTERFLAG|CTF_PM_MARGINTOP)
+#define CTF_PM_FOOTERMARGINBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_MARGINBOTTOM)
+#define CTF_PM_FOOTERMARGINLEFT (CTF_PM_FOOTERFLAG|CTF_PM_MARGINLEFT)
+#define CTF_PM_FOOTERMARGINRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_MARGINRIGHT)
+
#define CTF_PM_FTN_HEIGTH (XML_PM_CTF_START + 0x0060)
#define CTF_PM_FTN_LINE_WEIGTH (XML_PM_CTF_START + 0x0061)
#define CTF_PM_FTN_LINE_COLOR (XML_PM_CTF_START + 0x0062)
diff --git a/xmloff/inc/xmloff/txtprmap.hxx b/xmloff/inc/xmloff/txtprmap.hxx
index d64cc1266ef9..a02151cd0993 100644
--- a/xmloff/inc/xmloff/txtprmap.hxx
+++ b/xmloff/inc/xmloff/txtprmap.hxx
@@ -178,6 +178,14 @@
#define CTF_TEXT_DISPLAY (XML_TEXT_CTF_START + 143)
#define CTF_TEXT_CLIP (XML_TEXT_CTF_START + 144)
#define CTF_TEXT_CLIP11 (XML_TEXT_CTF_START + 145)
+#define CTF_PARAMARGINALL (XML_TEXT_CTF_START + 146)
+#define CTF_PARAMARGINALL_REL (XML_TEXT_CTF_START + 147)
+#define CTF_MARGINALL (XML_TEXT_CTF_START + 148)
+#define CTF_MARGINLEFT (XML_TEXT_CTF_START + 149)
+#define CTF_MARGINRIGHT (XML_TEXT_CTF_START + 150)
+#define CTF_MARGINTOP (XML_TEXT_CTF_START + 151)
+#define CTF_MARGINBOTTOM (XML_TEXT_CTF_START + 152)
+
#define TEXT_PROP_MAP_TEXT 0
#define TEXT_PROP_MAP_PARA 1
#define TEXT_PROP_MAP_FRAME 2
diff --git a/xmloff/inc/xmloff/xmlmetai.hxx b/xmloff/inc/xmloff/xmlmetai.hxx
index efdd1d3f024f..2ddd51920054 100644
--- a/xmloff/inc/xmloff/xmlmetai.hxx
+++ b/xmloff/inc/xmloff/xmlmetai.hxx
@@ -25,8 +25,8 @@
*
************************************************************************/
-#ifndef _XMLOFF_XMLMETAI_HXX
-#define _XMLOFF_XMLMETAI_HXX
+#ifndef XMLOFF_XMLMETAI_HXX
+#define XMLOFF_XMLMETAI_HXX
#include "sal/config.h"
#include "xmloff/dllapi.h"
@@ -69,12 +69,6 @@ public:
virtual void EndElement();
-protected:
- /// initialize DocumentProperties object with DOM and base URL
- void initDocumentProperties();
- // set the BuildId property at the importer
- void setBuildId(const ::rtl::OUString & i_rBuildId);
-
public:
static void setBuildId(const ::rtl::OUString & rGenerator,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xImportInfo );
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index ca321245fdb2..39186a044311 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -3130,6 +3130,8 @@ namespace xmloff { namespace token {
XML_MIN_VALUE,
XML_MAX_VALUE,
+ XML_MARGIN, // #i117001#
+
XML_TOKEN_END
};
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index c74abe953d2f..9e9ea12d40e2 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -602,24 +602,20 @@ OUString lcl_flattenStringSequence( const Sequence< OUString > & rSequence )
return aResult.makeStringAndClear();
}
-OUString lcl_getLabelString( const Reference< chart2::data::XDataSequence > & xLabelSeq )
+void lcl_getLabelStringSequence( Sequence< OUString >& rOutLabels, const Reference< chart2::data::XDataSequence > & xLabelSeq )
{
- Sequence< OUString > aLabels;
-
uno::Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xLabelSeq, uno::UNO_QUERY );
if( xTextualDataSequence.is())
{
- aLabels = xTextualDataSequence->getTextualData();
+ rOutLabels = xTextualDataSequence->getTextualData();
}
else if( xLabelSeq.is())
{
Sequence< uno::Any > aAnies( xLabelSeq->getData());
- aLabels.realloc( aAnies.getLength());
+ rOutLabels.realloc( aAnies.getLength());
for( sal_Int32 i=0; i<aAnies.getLength(); ++i )
- aAnies[i] >>= aLabels[i];
+ aAnies[i] >>= rOutLabels[i];
}
-
- return lcl_flattenStringSequence( aLabels );
}
sal_Int32 lcl_getMaxSequenceLength(
@@ -639,46 +635,96 @@ sal_Int32 lcl_getMaxSequenceLength(
return nResult;
}
-double lcl_getValueFromSequence( const Reference< chart2::data::XDataSequence > & xSeq, sal_Int32 nIndex )
+uno::Sequence< rtl::OUString > lcl_DataSequenceToStringSequence(
+ const uno::Reference< chart2::data::XDataSequence >& xDataSequence )
{
- double fResult = 0.0;
- ::rtl::math::setNan( &fResult );
- Reference< chart2::data::XNumericalDataSequence > xNumSeq( xSeq, uno::UNO_QUERY );
- if( xNumSeq.is())
+ uno::Sequence< rtl::OUString > aResult;
+ if(!xDataSequence.is())
+ return aResult;
+
+ uno::Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xDataSequence, uno::UNO_QUERY );
+ if( xTextualDataSequence.is() )
{
- Sequence< double > aValues( xNumSeq->getNumericalData());
- if( nIndex < aValues.getLength() )
- fResult = aValues[nIndex];
+ aResult = xTextualDataSequence->getTextualData();
}
else
{
- Sequence< uno::Any > aAnies( xSeq->getData());
- if( nIndex < aAnies.getLength() )
- aAnies[nIndex] >>= fResult;
+ uno::Sequence< uno::Any > aValues = xDataSequence->getData();
+ aResult.realloc(aValues.getLength());
+
+ for(sal_Int32 nN=aValues.getLength();nN--;)
+ aValues[nN] >>= aResult[nN];
}
- return fResult;
-}
+ return aResult;
+}
::std::vector< double > lcl_getAllValuesFromSequence( const Reference< chart2::data::XDataSequence > & xSeq )
{
double fNan = 0.0;
::rtl::math::setNan( &fNan );
::std::vector< double > aResult;
+ if(!xSeq.is())
+ return aResult;
+ uno::Sequence< double > aValuesSequence;
Reference< chart2::data::XNumericalDataSequence > xNumSeq( xSeq, uno::UNO_QUERY );
- if( xNumSeq.is())
+ if( xNumSeq.is() )
{
- Sequence< double > aValues( xNumSeq->getNumericalData());
- ::std::copy( aValues.getConstArray(), aValues.getConstArray() + aValues.getLength(),
- ::std::back_inserter( aResult ));
+ aValuesSequence = xNumSeq->getNumericalData();
}
- else if( xSeq.is())
+ else
{
- Sequence< uno::Any > aAnies( xSeq->getData());
- aResult.resize( aAnies.getLength(), fNan );
+ Sequence< uno::Any > aAnies( xSeq->getData() );
+ aValuesSequence.realloc( aAnies.getLength() );
for( sal_Int32 i=0; i<aAnies.getLength(); ++i )
- aAnies[i] >>= aResult[i];
+ aAnies[i] >>= aValuesSequence[i];
+ }
+
+ //special handling for x-values (if x-values do point to categories, indices are used instead )
+ Reference< beans::XPropertySet > xProp( xSeq, uno::UNO_QUERY );
+ if( xProp.is() )
+ {
+ OUString aRole;
+ xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Role") ) ) >>= aRole;
+ if( aRole.match( OUString( RTL_CONSTASCII_USTRINGPARAM( "values-x") ) ) )
+ {
+ //lcl_clearIfNoValuesButTextIsContained - replace by indices if the values are not appropriate
+ bool bHasValue=false;
+ bool bHasText=false;
+ sal_Int32 nCount = aValuesSequence.getLength();
+ for( sal_Int32 j = 0; j < nCount; ++j )
+ {
+ if( !::rtl::math::isNan( aValuesSequence[j] ) )
+ {
+ bHasValue=true;
+ break;
+ }
+ }
+ if(!bHasValue)
+ {
+ //no double value is countained
+ //is there any text?
+ uno::Sequence< rtl::OUString > aStrings( lcl_DataSequenceToStringSequence( xSeq ) );
+ sal_Int32 nTextCount = aStrings.getLength();
+ for( sal_Int32 j = 0; j < nTextCount; ++j )
+ {
+ if( aStrings[j].getLength() )
+ {
+ bHasText=true;
+ break;
+ }
+ }
+ }
+ if( !bHasValue && bHasText )
+ {
+ for( sal_Int32 j = 0; j < nCount; ++j )
+ aValuesSequence[j] = j+1;
+ }
+ }
}
+
+ ::std::copy( aValuesSequence.getConstArray(), aValuesSequence.getConstArray() + aValuesSequence.getLength(),
+ ::std::back_inserter( aResult ));
return aResult;
}
@@ -803,15 +849,20 @@ lcl_TableData lcl_getDataForLocalTable(
Sequence< OUString > aSimpleCategories;
if( xAnyDescriptionAccess.is() )
{
+ //categories
if( bSeriesFromColumns )
+ {
aSimpleCategories = xAnyDescriptionAccess->getRowDescriptions();
+ aResult.aComplexRowDescriptions = xAnyDescriptionAccess->getAnyRowDescriptions();
+ }
else
+ {
aSimpleCategories = xAnyDescriptionAccess->getColumnDescriptions();
-
- aResult.aComplexColumnDescriptions = xAnyDescriptionAccess->getAnyColumnDescriptions();
- aResult.aComplexRowDescriptions = xAnyDescriptionAccess->getAnyRowDescriptions();
+ aResult.aComplexColumnDescriptions = xAnyDescriptionAccess->getAnyColumnDescriptions();
+ }
}
+ //series values and series labels
SchXMLExportHelper_Impl::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size();
SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aBegin( aSequencesToExport.begin());
SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aEnd( aSequencesToExport.end());
@@ -856,19 +907,25 @@ lcl_TableData lcl_getDataForLocalTable(
// iterate over all sequences
size_t nSeqIdx = 0;
+ Sequence< Sequence< OUString > > aComplexLabels(nNumSequences);
for( ; aIt != aEnd; ++aIt, ++nSeqIdx )
{
OUString aRange;
+ Sequence< OUString >& rCurrentComplexLabel = aComplexLabels[nSeqIdx];
if( aIt->first.is())
{
- rLabels[nSeqIdx] = lcl_getLabelString( aIt->first );
+ lcl_getLabelStringSequence( rCurrentComplexLabel, aIt->first );
+ rLabels[nSeqIdx] = lcl_flattenStringSequence( rCurrentComplexLabel );
aRange = aIt->first->getSourceRangeRepresentation();
if( xRangeConversion.is())
aRange = xRangeConversion->convertRangeToXML( aRange );
}
else if( aIt->second.is())
- rLabels[nSeqIdx] = lcl_flattenStringSequence(
+ {
+ rCurrentComplexLabel.realloc(1);
+ rLabels[nSeqIdx] = rCurrentComplexLabel[0] = lcl_flattenStringSequence(
aIt->second->generateLabel( chart2::data::LabelOrigin_SHORT_SIDE ));
+ }
if( bSeriesFromColumns )
aResult.aColumnDescriptions_Ranges.push_back( aRange );
else
@@ -896,6 +953,16 @@ lcl_TableData lcl_getDataForLocalTable(
if( !lcl_SequenceHasUnhiddenData(aIt->first) && !lcl_SequenceHasUnhiddenData(aIt->second) )
aResult.aHiddenColumns.push_back(nSeqIdx);
}
+ Sequence< Sequence< Any > >& rComplexAnyLabels = bSeriesFromColumns ? aResult.aComplexColumnDescriptions : aResult.aComplexRowDescriptions;//#i116544#
+ rComplexAnyLabels.realloc(aComplexLabels.getLength());
+ for( sal_Int32 nN=0; nN<aComplexLabels.getLength();nN++ )
+ {
+ Sequence< OUString >& rSource = aComplexLabels[nN];
+ Sequence< Any >& rTarget = rComplexAnyLabels[nN];
+ rTarget.realloc( rSource.getLength() );
+ for( sal_Int32 i=0; i<rSource.getLength(); i++ )
+ rTarget[i] = uno::makeAny( rSource[i] );
+ }
}
catch( uno::Exception & rEx )
{
@@ -1769,7 +1836,7 @@ void SchXMLExportHelper_Impl::exportTable()
for( t2DNumberContainer::const_iterator aRowIt( aData.aDataInRows.begin())
; aRowIt != aData.aDataInRows.end()
- ; aRowIt++, nC++, aRowDescriptionsIter++ )
+ ; ++aRowIt, ++nC )
{
SvXMLElementExport aRow( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True );
@@ -1807,8 +1874,10 @@ void SchXMLExportHelper_Impl::exportTable()
if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd )
{
// remind the original range to allow a correct re-association when copying via clipboard
- SchXMLTools::exportRangeToSomewhere( mrExport, *aRowDescriptions_RangeIter++ );
+ SchXMLTools::exportRangeToSomewhere( mrExport, *aRowDescriptions_RangeIter );
+ ++aRowDescriptions_RangeIter;
}
+ ++aRowDescriptionsIter;
}
}
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index d106398a0fcd..f45f9a5e5f48 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -423,7 +423,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
// values
Reference< chart2::data::XDataSequence > xSeq;
- if( bHasRange )
+ if( bHasRange && m_aSeriesRange.getLength() )
xSeq = SchXMLTools::CreateDataSequence( m_aSeriesRange, mxNewDoc );
Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY );
@@ -442,7 +442,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq ));
// label
- if( bHasLabelRange )
+ if( bHasLabelRange && m_aSeriesLabelRange.getLength() )
{
Reference< chart2::data::XDataSequence > xLabelSequence =
SchXMLTools::CreateDataSequence( m_aSeriesLabelRange, mxNewDoc );
@@ -581,6 +581,11 @@ void SchXMLSeries2Context::EndElement()
aDomainInfos.push_back( aDomainInfo );
m_rGlobalSeriesImportInfo.nCurrentDataIndex++;
}
+ else if( m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress.getLength() )
+ {
+ DomainInfo aDomainInfo( OUString::createFromAscii("values-y"), m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress, m_rGlobalSeriesImportInfo.nFirstFirstDomainIndex ) ;
+ aDomainInfos.push_back( aDomainInfo );
+ }
}
if( bDeleteSeries )
diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index a0be5f4ec6a8..2aed07dca617 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -419,7 +419,7 @@ Reference< chart2::data::XDataSequence > CreateDataSequence(
DBG_ERROR( "could not create data sequence" );
}
- if( !xRet.is() && !xChartDoc->hasInternalDataProvider() )
+ if( !xRet.is() && !xChartDoc->hasInternalDataProvider() && rRange.getLength() )
{
//#i103911# switch to internal data in case the parent cannot provide the requested data
xChartDoc->createInternalDataProvider( sal_True /* bCloneExistingData */ );
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 50e0447d4a9d..32b4d322bba2 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -117,8 +117,8 @@ sal_Char __READONLY_DATA sXML_1_2[] = "1.2";
const sal_Char *sOpenOfficeOrgProject ="OpenOffice.org_project";
-const sal_Char s_grddl_xsl[] =
- "http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl";
+// #i115030#: the XSLT is not finished, and not available via HTTP
+const sal_Char s_grddl_xsl[] = "http://FIXME";
#define LOGFILE_AUTHOR "mb93740"
@@ -1315,7 +1315,7 @@ void SvXMLExport::SetBodyAttributes()
}
static void
-lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 nExportMode)
+lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 /*nExportMode*/)
{
// check version >= 1.2
switch (rExport.getDefaultVersion()) {
@@ -1324,11 +1324,14 @@ lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 nExportMode)
default: break;
}
+ // #i115030#: disabled
+#if 0
if (EXPORT_SETTINGS != nExportMode) // meta, content, styles
{
rExport.AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION,
OUString::createFromAscii(s_grddl_xsl) );
}
+#endif
}
sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index bc1e40114c5f..ec0039f16771 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3130,6 +3130,8 @@ namespace xmloff { namespace token {
TOKEN( "min-value", XML_MIN_VALUE ),
TOKEN( "max-value", XML_MAX_VALUE ),
+ TOKEN( "margin", XML_MARGIN),
+
#if OSL_DEBUG_LEVEL > 0
{ 0, NULL, NULL, XML_TOKEN_END }
#else
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index 578b3eefc719..7b69609fafe9 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -30,15 +30,11 @@
#include <tools/string.hxx>
-#ifndef _XMLOFF_XMLMETAI_HXX
#include <xmloff/xmlscripti.hxx>
-#endif
#include "sdxmlimp_impl.hxx"
#include "ximpbody.hxx"
-#ifndef _SFX_XMLMETAI_HXX
#include <xmloff/xmlmetai.hxx>
-#endif
#include "ximpstyl.hxx"
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/xmltoken.hxx>
@@ -447,6 +443,17 @@ void SAL_CALL SdXMLImport::initialize( const uno::Sequence< uno::Any >& aArgumen
if( xInfoSetInfo->hasPropertyByName( msPreview ) )
xInfoSet->getPropertyValue( msPreview ) >>= mbPreview;
+
+ ::rtl::OUString const sOrganizerMode(
+ RTL_CONSTASCII_USTRINGPARAM("OrganizerMode"));
+ if (xInfoSetInfo->hasPropertyByName(sOrganizerMode))
+ {
+ sal_Bool bStyleOnly(sal_False);
+ if (xInfoSet->getPropertyValue(sOrganizerMode) >>= bStyleOnly)
+ {
+ mbLoadDoc = !bStyleOnly;
+ }
+ }
}
}
@@ -765,7 +772,7 @@ SvXMLImportContext *SdXMLImport::CreateMetaContext(const OUString& rLocalName,
{
SvXMLImportContext* pContext = 0L;
- if (!IsStylesOnlyMode() && (getImportFlags() & IMPORT_META))
+ if (getImportFlags() & IMPORT_META)
{
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
mxServiceFactory->createInstance(::rtl::OUString::createFromAscii(
@@ -773,9 +780,11 @@ SvXMLImportContext *SdXMLImport::CreateMetaContext(const OUString& rLocalName,
uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
GetModel(), uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> const xDocProps(
+ (IsStylesOnlyMode()) ? 0 : xDPS->getDocumentProperties());
pContext = new SvXMLMetaDocumentContext(*this,
XML_NAMESPACE_OFFICE, rLocalName,
- xDPS->getDocumentProperties(), xDocBuilder);
+ xDocProps, xDocBuilder);
}
if(!pContext)
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index aebd513995e3..a8f09f2d99bd 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -711,7 +711,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
if( xSet.is() && ( mrExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) )
{
if( aShapeInfo.meShapeType != XmlShapeTypeDrawPageShape && aShapeInfo.meShapeType != XmlShapeTypePresPageShape &&
- aShapeInfo.meShapeType != XmlShapeTypeHandoutShape )
+ aShapeInfo.meShapeType != XmlShapeTypeHandoutShape && aShapeInfo.meShapeType != XmlShapeTypeDrawChartShape )
try
{
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index e2ba207e5cd6..9f5aebece935 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/xml/dom/XSAXDocumentBuilder.hpp>
+#include <com/sun/star/xml/xpath/XXPathAPI.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
@@ -124,6 +125,71 @@ void XMLDocumentBuilderContext::EndElement()
//===========================================================================
+static void
+lcl_initDocumentProperties(SvXMLImport & rImport,
+ uno::Reference<xml::sax::XDocumentHandler> const& xDocBuilder,
+ uno::Reference<document::XDocumentProperties> const& xDocProps)
+{
+ uno::Sequence< uno::Any > aSeq(1);
+ uno::Reference< xml::dom::XSAXDocumentBuilder > const xDB(xDocBuilder,
+ uno::UNO_QUERY_THROW);
+ aSeq[0] <<= xDB->getDocument();
+ uno::Reference< lang::XInitialization > const xInit(xDocProps,
+ uno::UNO_QUERY_THROW);
+ try {
+ xInit->initialize(aSeq);
+ rImport.SetStatistics(xDocProps->getDocumentStatistics());
+ // convert all URLs from relative to absolute
+ xDocProps->setTemplateURL(rImport.GetAbsoluteReference(
+ xDocProps->getTemplateURL()));
+ xDocProps->setAutoloadURL(rImport.GetAbsoluteReference(
+ xDocProps->getAutoloadURL()));
+ SvXMLMetaDocumentContext::setBuildId(
+ xDocProps->getGenerator(), rImport.getImportInfo());
+ } catch (uno::RuntimeException) {
+ throw;
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "SvXMLMetaDocumentContext::initDocumentProperties: "
+ "properties init exception"),
+ rImport, makeAny(e));
+ }
+}
+
+static void
+lcl_initGenerator(SvXMLImport & rImport,
+ uno::Reference<xml::sax::XDocumentHandler> const& xDocBuilder)
+{
+ uno::Reference< xml::dom::XSAXDocumentBuilder > const xDB(xDocBuilder,
+ uno::UNO_QUERY_THROW);
+ uno::Reference< xml::dom::XDocument > const xDoc(xDB->getDocument(),
+ uno::UNO_SET_THROW);
+ try {
+ uno::Reference< xml::xpath::XXPathAPI > const xPath(
+ rImport.getServiceFactory()->createInstance(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.xml.xpath.XPathAPI"))),
+ uno::UNO_QUERY_THROW );
+ xPath->registerNS(GetXMLToken(XML_NP_OFFICE),GetXMLToken(XML_N_OFFICE));
+ xPath->registerNS(GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META));
+
+ ::rtl::OUString const expr(RTL_CONSTASCII_USTRINGPARAM(
+ "string(/office:document-meta/office:meta/meta:generator)"));
+ uno::Reference< xml::xpath::XXPathObject > const xObj(
+ xPath->eval(xDoc.get(), expr), uno::UNO_SET_THROW);
+ OUString const value(xObj->getString());
+ SvXMLMetaDocumentContext::setBuildId(value, rImport.getImportInfo());
+ } catch (uno::RuntimeException) {
+ throw;
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "SvXMLMetaDocumentContext::initGenerator: exception"),
+ rImport, makeAny(e));
+ }
+}
+
SvXMLMetaDocumentContext::SvXMLMetaDocumentContext(SvXMLImport& rImport,
sal_uInt16 nPrfx, const rtl::OUString& rLName,
const uno::Reference<document::XDocumentProperties>& xDocProps,
@@ -132,8 +198,9 @@ SvXMLMetaDocumentContext::SvXMLMetaDocumentContext(SvXMLImport& rImport,
mxDocProps(xDocProps),
mxDocBuilder(xDocBuilder)
{
- DBG_ASSERT(xDocProps.is(), "SvXMLMetaDocumentContext: no document props");
- DBG_ASSERT(xDocBuilder.is(), "SvXMLMetaDocumentContext: no document hdlr");
+// #i103539#: must always read meta.xml for generator, xDocProps unwanted then
+// OSL_ENSURE(xDocProps.is(), "SvXMLMetaDocumentContext: no document props");
+ OSL_ENSURE(xDocBuilder.is(), "SvXMLMetaDocumentContext: no document hdlr");
// here are no attributes
}
@@ -166,6 +233,7 @@ void SvXMLMetaDocumentContext::StartElement(
mxDocBuilder->startElement(
GetImport().GetNamespaceMap().GetQNameByKey(GetPrefix(),
GetXMLToken(XML_DOCUMENT_META)), xAttrList);
+
}
void SvXMLMetaDocumentContext::EndElement()
@@ -175,43 +243,16 @@ void SvXMLMetaDocumentContext::EndElement()
GetImport().GetNamespaceMap().GetQNameByKey(GetPrefix(),
GetXMLToken(XML_DOCUMENT_META)));
mxDocBuilder->endDocument();
- initDocumentProperties();
-}
-
-void SvXMLMetaDocumentContext::initDocumentProperties()
-{
- uno::Sequence< uno::Any > aSeq(1);
- uno::Reference< xml::dom::XSAXDocumentBuilder > xDB (mxDocBuilder,
- uno::UNO_QUERY_THROW);
- aSeq[0] <<= xDB->getDocument();
- uno::Reference< lang::XInitialization > xInit(mxDocProps,
- uno::UNO_QUERY_THROW);
- try {
- xInit->initialize(aSeq);
- GetImport().SetStatistics(mxDocProps->getDocumentStatistics());
- // convert all URLs from relative to absolute
- mxDocProps->setTemplateURL(GetImport().GetAbsoluteReference(
- mxDocProps->getTemplateURL()));
- mxDocProps->setAutoloadURL(GetImport().GetAbsoluteReference(
- mxDocProps->getAutoloadURL()));
- setBuildId(mxDocProps->getGenerator());
- } catch (uno::RuntimeException) {
- throw;
- } catch (uno::Exception & e) {
- throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString::createFromAscii(
- "SvXMLMetaDocumentContext::initDocumentProperties: "
- "properties init exception"),
- GetImport(), makeAny(e));
+ if (mxDocProps.is())
+ {
+ lcl_initDocumentProperties(GetImport(), mxDocBuilder, mxDocProps);
+ }
+ else
+ {
+ lcl_initGenerator(GetImport(), mxDocBuilder);
}
}
-void SvXMLMetaDocumentContext::setBuildId(const ::rtl::OUString & i_rBuildId)
-{
- SvXMLMetaDocumentContext::setBuildId( i_rBuildId, GetImport().getImportInfo() );
-}
-
-//static
void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId, const uno::Reference<beans::XPropertySet>& xImportInfo )
{
OUString sBuildId;
diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx
index fe14231e51c4..d803b79b50a1 100644
--- a/xmloff/source/style/PageMasterExportPropMapper.cxx
+++ b/xmloff/source/style/PageMasterExportPropMapper.cxx
@@ -31,9 +31,7 @@
#include <xmloff/xmltoken.hxx>
#include <comphelper/types.hxx>
#include <com/sun/star/table/BorderLine.hpp>
-#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX
#include <xmloff/PageMasterStyleMap.hxx>
-#endif
#include <tools/debug.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/extract.hxx>
@@ -84,6 +82,12 @@ void lcl_AddState(::std::vector< XMLPropertyState >& rPropState, sal_Int32 nInde
struct XMLPropertyStateBuffer
{
+ XMLPropertyState* pPMMarginAll;
+ XMLPropertyState* pPMMarginTop;
+ XMLPropertyState* pPMMarginBottom;
+ XMLPropertyState* pPMMarginLeft;
+ XMLPropertyState* pPMMarginRight;
+
XMLPropertyState* pPMBorderAll;
XMLPropertyState* pPMBorderTop;
XMLPropertyState* pPMBorderBottom;
@@ -106,7 +110,13 @@ struct XMLPropertyStateBuffer
void ContextFilter( ::std::vector< XMLPropertyState >& rPropState );
};
-XMLPropertyStateBuffer::XMLPropertyStateBuffer() :
+XMLPropertyStateBuffer::XMLPropertyStateBuffer()
+ : pPMMarginAll( NULL )
+ , pPMMarginTop( NULL )
+ , pPMMarginBottom( NULL )
+ , pPMMarginLeft( NULL )
+ , pPMMarginRight( NULL )
+ ,
pPMBorderAll( NULL ),
pPMBorderTop( NULL ),
pPMBorderBottom( NULL ),
@@ -129,6 +139,31 @@ XMLPropertyStateBuffer::XMLPropertyStateBuffer() :
void XMLPropertyStateBuffer::ContextFilter( ::std::vector< XMLPropertyState >& )
{
+ if (pPMMarginAll)
+ {
+ if (pPMMarginTop && pPMMarginBottom && pPMMarginLeft && pPMMarginRight)
+ {
+ sal_Int32 nTop = 0, nBottom = 0, nLeft = 0, nRight = 0;
+
+ pPMMarginTop->maValue >>= nTop;
+ pPMMarginBottom->maValue >>= nBottom;
+ pPMMarginLeft->maValue >>= nLeft;
+ pPMMarginRight->maValue >>= nRight;
+
+ if ((nTop == nBottom) && (nBottom == nLeft) && (nLeft == nRight))
+ {
+ lcl_RemoveState( pPMMarginTop );
+ lcl_RemoveState( pPMMarginBottom );
+ lcl_RemoveState( pPMMarginLeft );
+ lcl_RemoveState( pPMMarginRight );
+ }
+ else
+ lcl_RemoveState( pPMMarginAll );
+ }
+ else
+ lcl_RemoveState( pPMMarginAll );
+ }
+
if( pPMBorderAll )
{
if( pPMBorderTop && pPMBorderBottom && pPMBorderLeft && pPMBorderRight )
@@ -348,6 +383,11 @@ void XMLPageMasterExportPropMapper::ContextFilter(
switch( nSimpleId )
{
+ case CTF_PM_MARGINALL: pBuffer->pPMMarginAll = pProp; break;
+ case CTF_PM_MARGINTOP: pBuffer->pPMMarginTop = pProp; break;
+ case CTF_PM_MARGINBOTTOM: pBuffer->pPMMarginBottom = pProp; break;
+ case CTF_PM_MARGINLEFT: pBuffer->pPMMarginLeft = pProp; break;
+ case CTF_PM_MARGINRIGHT: pBuffer->pPMMarginRight = pProp; break;
case CTF_PM_BORDERALL: pBuffer->pPMBorderAll = pProp; break;
case CTF_PM_BORDERTOP: pBuffer->pPMBorderTop = pProp; break;
case CTF_PM_BORDERBOTTOM: pBuffer->pPMBorderBottom = pProp; break;
diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx
index 59cff11d65cc..4af6e1ce16e1 100644
--- a/xmloff/source/style/PageMasterImportPropMapper.cxx
+++ b/xmloff/source/style/PageMasterImportPropMapper.cxx
@@ -28,14 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-
#include "PageMasterImportPropMapper.hxx"
-#ifndef _XMLOFF_PAGEMASTERPROPMAPPER_HXX
#include "PageMasterPropMapper.hxx"
-#endif
-#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX
#include <xmloff/PageMasterStyleMap.hxx>
-#endif
#include <xmloff/maptype.hxx>
#include <com/sun/star/table/BorderLine.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
@@ -129,7 +124,15 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
XMLPropertyState* pFooterHeight = NULL;
XMLPropertyState* pFooterMinHeight = NULL;
XMLPropertyState* pFooterDynamic = NULL;
- sal_uInt16 i; // for the "for" loop
+ XMLPropertyState* pAllMarginProperty = NULL;
+ XMLPropertyState* pMargins[4] = { NULL, NULL, NULL, NULL };
+ ::std::auto_ptr<XMLPropertyState> pNewMargins[4];
+ XMLPropertyState* pAllHeaderMarginProperty = NULL;
+ XMLPropertyState* pHeaderMargins[4] = { NULL, NULL, NULL, NULL };
+ ::std::auto_ptr<XMLPropertyState> pNewHeaderMargins[4];
+ XMLPropertyState* pAllFooterMarginProperty = NULL;
+ XMLPropertyState* pFooterMargins[4] = { NULL, NULL, NULL, NULL };
+ ::std::auto_ptr<XMLPropertyState> pNewFooterMargins[4];
::std::vector< XMLPropertyState >::iterator aEnd = rProperties.end();
for (::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin(); aIter != aEnd; ++aIter)
@@ -189,12 +192,60 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
case CTF_PM_HEADERMINHEIGHT : pHeaderMinHeight = property; break;
case CTF_PM_FOOTERHEIGHT : pFooterHeight = property; break;
case CTF_PM_FOOTERMINHEIGHT : pFooterMinHeight = property; break;
+ case CTF_PM_MARGINALL :
+ pAllMarginProperty = property; break;
+ case CTF_PM_MARGINTOP :
+ pMargins[XML_LINE_TOP] = property; break;
+ case CTF_PM_MARGINBOTTOM:
+ pMargins[XML_LINE_BOTTOM] = property; break;
+ case CTF_PM_MARGINLEFT :
+ pMargins[XML_LINE_LEFT] = property; break;
+ case CTF_PM_MARGINRIGHT :
+ pMargins[XML_LINE_RIGHT] = property; break;
+ case CTF_PM_HEADERMARGINALL :
+ pAllHeaderMarginProperty = property; break;
+ case CTF_PM_HEADERMARGINTOP :
+ pHeaderMargins[XML_LINE_TOP] = property; break;
+ case CTF_PM_HEADERMARGINBOTTOM:
+ pHeaderMargins[XML_LINE_BOTTOM] = property; break;
+ case CTF_PM_HEADERMARGINLEFT :
+ pHeaderMargins[XML_LINE_LEFT] = property; break;
+ case CTF_PM_HEADERMARGINRIGHT :
+ pHeaderMargins[XML_LINE_RIGHT] = property; break;
+ case CTF_PM_FOOTERMARGINALL :
+ pAllFooterMarginProperty = property; break;
+ case CTF_PM_FOOTERMARGINTOP :
+ pFooterMargins[XML_LINE_TOP] = property; break;
+ case CTF_PM_FOOTERMARGINBOTTOM:
+ pFooterMargins[XML_LINE_BOTTOM] = property; break;
+ case CTF_PM_FOOTERMARGINLEFT :
+ pFooterMargins[XML_LINE_LEFT] = property; break;
+ case CTF_PM_FOOTERMARGINRIGHT :
+ pFooterMargins[XML_LINE_RIGHT] = property; break;
}
}
}
- for ( i = 0; i < 4; i++)
+ for (sal_uInt16 i = 0; i < 4; i++)
{
+ if (pAllMarginProperty && !pMargins[i])
+ {
+ pNewMargins[i].reset(new XMLPropertyState(
+ pAllMarginProperty->mnIndex + 1 + i,
+ pAllMarginProperty->maValue));
+ }
+ if (pAllHeaderMarginProperty && !pHeaderMargins[i])
+ {
+ pNewHeaderMargins[i].reset(new XMLPropertyState(
+ pAllHeaderMarginProperty->mnIndex + 1 + i,
+ pAllHeaderMarginProperty->maValue));
+ }
+ if (pAllFooterMarginProperty && !pFooterMargins[i])
+ {
+ pNewFooterMargins[i].reset(new XMLPropertyState(
+ pAllFooterMarginProperty->mnIndex + 1 + i,
+ pAllFooterMarginProperty->maValue));
+ }
if (pAllPaddingProperty && !pPadding[i])
pNewPadding[i] = new XMLPropertyState(pAllPaddingProperty->mnIndex + 1 + i, pAllPaddingProperty->maValue);
if (pAllBorderProperty && !pBorders[i])
@@ -294,8 +345,20 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
aAny.setValue( &bValue, ::getBooleanCppuType() );
pFooterDynamic = new XMLPropertyState(pFooterMinHeight->mnIndex + 1, aAny);
}
- for (i = 0; i < 4; i++)
+ for (sal_uInt16 i = 0; i < 4; i++)
{
+ if (pNewMargins[i].get())
+ {
+ rProperties.push_back(*pNewMargins[i]);
+ }
+ if (pNewHeaderMargins[i].get())
+ {
+ rProperties.push_back(*pNewHeaderMargins[i]);
+ }
+ if (pNewFooterMargins[i].get())
+ {
+ rProperties.push_back(*pNewFooterMargins[i]);
+ }
if (pNewPadding[i])
{
rProperties.push_back(*pNewPadding[i]);
diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx
index 6dbda70f5125..41d2172ab4fa 100644
--- a/xmloff/source/style/PageMasterStyleMap.cxx
+++ b/xmloff/source/style/PageMasterStyleMap.cxx
@@ -28,10 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX
#include <xmloff/PageMasterStyleMap.hxx>
-#endif
-#include "xmloff/xmlnmspe.hxx"
+
+#include <xmloff/xmlnmspe.hxx>
#include <xmloff/xmltoken.hxx>
using namespace ::xmloff::token;
@@ -54,10 +53,11 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] =
PLMAP( "NumberingType", XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC, XML_PM_TYPE_NUMLETTERSYNC, 0 ),
PLMAP( "PrinterPaperTray", XML_NAMESPACE_STYLE, XML_PAPER_TRAY_NAME, XML_TYPE_STRING | MID_FLAG_PROPERTY_MAY_EXCEPT, 0 ),
PLMAP( "IsLandscape", XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_PM_TYPE_PRINTORIENTATION, 0 ),
- PLMAP( "TopMargin", XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TYPE_MEASURE, 0 ),
- PLMAP( "BottomMargin", XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TYPE_MEASURE, 0 ),
- PLMAP( "LeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, 0 ),
- PLMAP( "RightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, 0 ),
+ PLMAP( "TopMargin", XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_MEASURE, CTF_PM_MARGINALL ),
+ PLMAP( "TopMargin", XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TYPE_MEASURE, CTF_PM_MARGINTOP ),
+ PLMAP( "BottomMargin", XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TYPE_MEASURE, CTF_PM_MARGINBOTTOM ),
+ PLMAP( "LeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_MARGINLEFT ),
+ PLMAP( "RightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_MARGINRIGHT ),
PLMAP( "TopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_BORDERALL ),
PLMAP( "TopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_BORDERTOP ),
PLMAP( "BottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_BORDERBOTTOM ),
@@ -130,9 +130,10 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] =
HFMAP( "HeaderHeight", XML_NAMESPACE_SVG, XML_HEIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERHEIGHT ),
HFMAP( "HeaderHeight", XML_NAMESPACE_FO, XML_MIN_HEIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERMINHEIGHT ),
HFMAP( "HeaderIsDynamicHeight", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_BOOL, CTF_PM_HEADERDYNAMIC ),
- HFMAP( "HeaderLeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_HEADERFLAG ),
- HFMAP( "HeaderRightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERFLAG ),
- HFMAP( "HeaderBodyDistance", XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TYPE_MEASURE, CTF_PM_HEADERFLAG ),
+ HFMAP( "HeaderLeftMargin", XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINALL ),
+ HFMAP( "HeaderLeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINLEFT ),
+ HFMAP( "HeaderRightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINRIGHT ),
+ HFMAP( "HeaderBodyDistance", XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINBOTTOM ),
HFMAP( "HeaderTopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_HEADERBORDERALL ),
HFMAP( "HeaderTopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_HEADERBORDERTOP ),
HFMAP( "HeaderBottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_HEADERBORDERBOTTOM ),
@@ -160,9 +161,10 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] =
HFMAP( "FooterHeight", XML_NAMESPACE_SVG, XML_HEIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERHEIGHT ),
HFMAP( "FooterHeight", XML_NAMESPACE_FO, XML_MIN_HEIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERMINHEIGHT ),
HFMAP( "FooterIsDynamicHeight", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_BOOL, CTF_PM_FOOTERDYNAMIC ),
- HFMAP( "FooterLeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_FOOTERFLAG ),
- HFMAP( "FooterRightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERFLAG ),
- HFMAP( "FooterBodyDistance", XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TYPE_MEASURE, CTF_PM_FOOTERFLAG ),
+ HFMAP( "FooterLeftMargin", XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINALL ),
+ HFMAP( "FooterLeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINLEFT ),
+ HFMAP( "FooterRightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINRIGHT ),
+ HFMAP( "FooterBodyDistance", XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINTOP ),
HFMAP( "FooterTopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERALL ),
HFMAP( "FooterTopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERTOP ),
HFMAP( "FooterBottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERBOTTOM ),
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index d4e880f09b52..59849df1a20e 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -298,15 +298,25 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
sTmp.append( nLevel + 1 );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_LEVEL, sTmp.makeStringAndClear() );
// #i110694#: no style-name on list-level-style-image
- if ((sTextStyleName.getLength() > 0) && (NumberingType::BITMAP != eType))
+ // #i116149#: neither prefix/suffix
+ if (NumberingType::BITMAP != eType)
{
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- GetExport().EncodeStyleName( sTextStyleName ) );
+ if (sTextStyleName.getLength() > 0)
+ {
+ GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
+ GetExport().EncodeStyleName( sTextStyleName ) );
+ }
+ if (sPrefix.getLength() > 0)
+ {
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_PREFIX,
+ sPrefix );
+ }
+ if (sSuffix.getLength() > 0)
+ {
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_SUFFIX,
+ sSuffix );
+ }
}
- if( sPrefix.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_PREFIX, sPrefix );
- if( sSuffix.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, sSuffix );
enum XMLTokenEnum eElem = XML_LIST_LEVEL_STYLE_NUMBER;
if( NumberingType::CHAR_SPECIAL == eType )
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 0d45fdc289d0..1417f239082a 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -501,6 +501,22 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties(
nCount++;
}
+ if (bBullet && sSuffix.getLength())
+ {
+ sal_uInt16 const nVersion(GetImport().getGeneratorVersion());
+ sal_Int32 nUPD;
+ sal_Int32 nBuildId;
+ if (GetImport().getBuildIds(nUPD, nBuildId)
+ && ( (SvXMLImport::OOo_1x == nVersion)
+ || (SvXMLImport::OOo_2x == nVersion)
+ || (310 == nUPD) || (320 == nUPD) || (330 == nUPD)
+ || ((300 == nUPD) && (nBuildId <= 9573))))
+ {
+ // #i93908# OOo < 3.4 wrote a bogus suffix for bullet chars
+ sSuffix = ::rtl::OUString(); // clear it
+ }
+ }
+
Sequence<beans::PropertyValue> aPropSeq( nCount );
if( nCount > 0 )
{
diff --git a/xmloff/source/text/XMLAutoTextEventExport.cxx b/xmloff/source/text/XMLAutoTextEventExport.cxx
index dcef23ba5734..eab3c77efc7f 100644
--- a/xmloff/source/text/XMLAutoTextEventExport.cxx
+++ b/xmloff/source/text/XMLAutoTextEventExport.cxx
@@ -221,6 +221,9 @@ void XMLAutoTextEventExport::addNamespaces()
GetAttrList().AddAttribute(
GetNamespaceMap().GetAttrNameByIndex( XML_NAMESPACE_OOO ),
GetNamespaceMap().GetNameByIndex( XML_NAMESPACE_OOO ) );
+ GetAttrList().AddAttribute(
+ GetNamespaceMap().GetAttrNameByIndex( XML_NAMESPACE_XLINK ),
+ GetNamespaceMap().GetNameByIndex( XML_NAMESPACE_XLINK ) );
}
void XMLAutoTextEventExport::exportEvents()
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index 7b3c7e828683..6bca8e8f4e20 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -27,8 +27,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#include <tools/debug.hxx>
-#include <xmloff/txtprmap.hxx>
+
+#include "txtexppr.hxx"
+
#include <com/sun/star/table/BorderLine.hpp>
#include <com/sun/star/text/SizeType.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
@@ -37,7 +38,10 @@
#include <com/sun/star/awt/FontPitch.hpp>
#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/text/XChapterNumberingSupplier.hpp>
-#include "txtexppr.hxx"
+
+#include <tools/debug.hxx>
+
+#include <xmloff/txtprmap.hxx>
#include <xmloff/xmlexp.hxx>
#include "XMLSectionFootnoteConfigExport.hxx"
@@ -302,6 +306,26 @@ void XMLTextExportPropertySetMapper::ContextFontHeightFilter(
// helper method; implementation below
bool lcl_IsOutlineStyle(const SvXMLExport&, const OUString&);
+static void
+lcl_checkMultiProperty(XMLPropertyState *const pState,
+ XMLPropertyState *const pRelState)
+{
+ if (pState && pRelState)
+ {
+ sal_Int32 nTemp = 0;
+ pRelState->maValue >>= nTemp;
+ if (100 == nTemp)
+ {
+ pRelState->mnIndex = -1;
+ pRelState->maValue.clear();
+ }
+ else
+ {
+ pState->mnIndex = -1;
+ pState->maValue.clear();
+ }
+ }
+}
void XMLTextExportPropertySetMapper::ContextFilter(
::std::vector< XMLPropertyState >& rProperties,
@@ -444,6 +468,9 @@ void XMLTextExportPropertySetMapper::ContextFilter(
XMLPropertyState* pClip11State = NULL;
XMLPropertyState* pClipState = NULL;
+ XMLPropertyState* pAllParaMargin = NULL;
+ XMLPropertyState* pAllMargin = NULL;
+
sal_Bool bNeedsAnchor = sal_False;
for( ::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin();
@@ -560,6 +587,8 @@ void XMLTextExportPropertySetMapper::ContextFilter(
case CTF_NUMBERINGSTYLENAME: pListStyleName = propertie; break;
case CTF_TEXT_CLIP11: pClip11State = propertie; break;
case CTF_TEXT_CLIP: pClipState = propertie; break;
+ case CTF_PARAMARGINALL: pAllParaMargin = propertie; break;
+ case CTF_MARGINALL: pAllMargin = propertie; break;
}
}
@@ -605,87 +634,21 @@ void XMLTextExportPropertySetMapper::ContextFilter(
}
}
- if( pParaLeftMarginState && pParaLeftMarginRelState )
- {
- sal_Int32 nTemp = 0;
- pParaLeftMarginRelState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pParaLeftMarginRelState->mnIndex = -1;
- pParaLeftMarginRelState->maValue.clear();
- }
- else
- {
- pParaLeftMarginState->mnIndex = -1;
- pParaLeftMarginState->maValue.clear();
- }
-
- }
-
- if( pParaRightMarginState && pParaRightMarginRelState )
- {
- sal_Int32 nTemp = 0;
- pParaRightMarginRelState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pParaRightMarginRelState->mnIndex = -1;
- pParaRightMarginRelState->maValue.clear();
- }
- else
- {
- pParaRightMarginState->mnIndex = -1;
- pParaRightMarginState->maValue.clear();
- }
- }
-
- if( pParaFirstLineState && pParaFirstLineRelState )
- {
- sal_Int32 nTemp = 0;
- pParaFirstLineRelState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pParaFirstLineRelState->mnIndex = -1;
- pParaFirstLineRelState->maValue.clear();
- }
- else
- {
- pParaFirstLineState->mnIndex = -1;
- pParaFirstLineState->maValue.clear();
- }
- }
+ lcl_checkMultiProperty(pParaLeftMarginState, pParaLeftMarginRelState);
+ lcl_checkMultiProperty(pParaRightMarginState, pParaRightMarginRelState);
+ lcl_checkMultiProperty(pParaTopMarginState, pParaTopMarginRelState);
+ lcl_checkMultiProperty(pParaBottomMarginState, pParaBottomMarginRelState);
+ lcl_checkMultiProperty(pParaFirstLineState, pParaFirstLineRelState);
- if( pParaTopMarginState && pParaTopMarginRelState )
+ if (pAllParaMargin)
{
- sal_Int32 nTemp = 0;
- pParaTopMarginRelState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pParaTopMarginRelState->mnIndex = -1;
- pParaTopMarginRelState->maValue.clear();
- }
- else
- {
- pParaTopMarginState->mnIndex = -1;
- pParaTopMarginState->maValue.clear();
- }
-
+ pAllParaMargin->mnIndex = -1; // just export individual attributes...
+ pAllParaMargin->maValue.clear();
}
-
- if( pParaBottomMarginState && pParaBottomMarginRelState )
+ if (pAllMargin)
{
- sal_Int32 nTemp = 0;
- pParaBottomMarginRelState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pParaBottomMarginRelState->mnIndex = -1;
- pParaBottomMarginRelState->maValue.clear();
- }
- else
- {
- pParaBottomMarginState->mnIndex = -1;
- pParaBottomMarginState->maValue.clear();
- }
-
+ pAllMargin->mnIndex = -1; // just export individual attributes...
+ pAllMargin->maValue.clear();
}
if( pAllBorderWidthState )
diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx
index dceac7a26890..93e8750b8fb2 100644
--- a/xmloff/source/text/txtimppr.cxx
+++ b/xmloff/source/text/txtimppr.cxx
@@ -316,7 +316,12 @@ void XMLTextImportPropertyMapper::finished(
XMLPropertyState* pVertOrientRelAsChar = 0;
XMLPropertyState* pBackTransparency = NULL; // transparency in %
XMLPropertyState* pBackTransparent = NULL; // transparency as boolean
- sal_uInt16 i; // for the "for" loop
+ XMLPropertyState* pAllParaMargin = 0;
+ XMLPropertyState* pParaMargins[4] = { 0, 0, 0, 0 };
+ ::std::auto_ptr<XMLPropertyState> pNewParaMargins[4];
+ XMLPropertyState* pAllMargin = 0;
+ XMLPropertyState* pMargins[4] = { 0, 0, 0, 0 };
+ ::std::auto_ptr<XMLPropertyState> pNewMargins[4];
for( ::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin();
aIter != rProperties.end();
@@ -384,7 +389,31 @@ void XMLTextImportPropertyMapper::finished(
bHasAnyWidth = sal_True; break;
case CTF_BACKGROUND_TRANSPARENCY: pBackTransparency = property; break;
case CTF_BACKGROUND_TRANSPARENT: pBackTransparent = property; break;
-
+ case CTF_PARAMARGINALL:
+ case CTF_PARAMARGINALL_REL:
+ pAllParaMargin = property; break;
+ case CTF_PARALEFTMARGIN:
+ case CTF_PARALEFTMARGIN_REL:
+ pParaMargins[XML_LINE_LEFT] = property; break;
+ case CTF_PARARIGHTMARGIN:
+ case CTF_PARARIGHTMARGIN_REL:
+ pParaMargins[XML_LINE_RIGHT] = property; break;
+ case CTF_PARATOPMARGIN:
+ case CTF_PARATOPMARGIN_REL:
+ pParaMargins[XML_LINE_TOP] = property; break;
+ case CTF_PARABOTTOMMARGIN:
+ case CTF_PARABOTTOMMARGIN_REL:
+ pParaMargins[XML_LINE_BOTTOM] = property; break;
+ case CTF_MARGINALL:
+ pAllMargin = property; break;
+ case CTF_MARGINLEFT:
+ pMargins[XML_LINE_LEFT] = property; break;
+ case CTF_MARGINRIGHT:
+ pMargins[XML_LINE_RIGHT] = property; break;
+ case CTF_MARGINTOP:
+ pMargins[XML_LINE_TOP] = property; break;
+ case CTF_MARGINBOTTOM:
+ pMargins[XML_LINE_BOTTOM] = property; break;
}
}
@@ -401,8 +430,31 @@ void XMLTextImportPropertyMapper::finished(
FontFinished( pFontFamilyNameCTL, pFontStyleNameCTL, pFontFamilyCTL,
pFontPitchCTL, pFontCharSetCTL );
- for( i = 0; i < 4; i++ )
+ for (sal_uInt16 i = 0; i < 4; i++)
{
+ if (pAllParaMargin && !pParaMargins[i])
+ {
+#ifdef DBG_UTIL
+ sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
+ pAllParaMargin->mnIndex + (2*i) + 2 );
+ OSL_ENSURE( nTmp >= CTF_PARALEFTMARGIN &&
+ nTmp <= CTF_PARABOTTOMMARGIN_REL,
+ "wrong property context id" );
+#endif
+ pNewParaMargins[i].reset(new XMLPropertyState(
+ pAllParaMargin->mnIndex + (2*i) + 2, pAllParaMargin->maValue));
+ }
+ if (pAllMargin && !pMargins[i])
+ {
+#ifdef DBG_UTIL
+ sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
+ pAllMargin->mnIndex + i + 1 );
+ OSL_ENSURE( nTmp >= CTF_MARGINLEFT && nTmp <= CTF_MARGINBOTTOM,
+ "wrong property context id" );
+#endif
+ pNewMargins[i].reset(new XMLPropertyState(
+ pAllMargin->mnIndex + i + 1, pAllMargin->maValue));
+ }
if( pAllBorderDistance && !pBorderDistances[i] )
{
#ifdef DBG_UTIL
@@ -506,6 +558,16 @@ void XMLTextImportPropertyMapper::finished(
}
#endif
}
+
+ if (pAllParaMargin)
+ {
+ pAllParaMargin->mnIndex = -1;
+ }
+ if (pAllMargin)
+ {
+ pAllMargin->mnIndex = -1;
+ }
+
if( pAllBorderDistance )
pAllBorderDistance->mnIndex = -1;
@@ -649,8 +711,16 @@ void XMLTextImportPropertyMapper::finished(
delete pNewFontCharSetCTL;
}
- for( i=0; i<4; i++ )
+ for (sal_uInt16 i=0; i<4; i++)
{
+ if (pNewParaMargins[i].get())
+ {
+ rProperties.push_back(*pNewParaMargins[i]);
+ }
+ if (pNewMargins[i].get())
+ {
+ rProperties.push_back(*pNewMargins[i]);
+ }
if( pNewBorderDistances[i] )
{
rProperties.push_back( *pNewBorderDistances[i] );
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx
index 3a26fe37c794..9c3d50d6f9ed 100644
--- a/xmloff/source/text/txtprhdl.cxx
+++ b/xmloff/source/text/txtprhdl.cxx
@@ -1039,7 +1039,8 @@ sal_Bool XMLTextCombineCharPropHdl_Impl::exportXML(
{
rValue >>= rStrExpValue;
- return sal_True;
+ // #i114107# attribute of type "character": export only if length is 1
+ return (1 == rStrExpValue.getLength()) ? sal_True : sal_False;
}
XMLTextCombineCharPropHdl_Impl::~XMLTextCombineCharPropHdl_Impl()
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index fbc53ef3e16e..ff49ecd234f9 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -27,15 +27,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
+
+#include <xmloff/txtprmap.hxx>
+
#include <tools/debug.hxx>
-#include "xmloff/xmlnmspe.hxx"
+
+#include <xmloff/xmlnmspe.hxx>
#include <xmloff/xmltoken.hxx>
-#ifndef _XMLOFF_TXTPRHDL_HXX
#include "txtprhdl.hxx"
-#endif
-#ifndef _XMLOFF_TXTPRMAP_HXX
-#include <xmloff/txtprmap.hxx>
-#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -91,6 +90,9 @@ XMLPropertyMapEntry aXMLParaPropMap[] =
// RES_UNKNOWNATR_CONTAINER
MP_E( "ParaUserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ),
// RES_LR_SPACE
+ // !!! DO NOT REORDER THE MARGINS !!!
+ MP_E( "ParaLeftMargin", FO, MARGIN, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARAMARGINALL ),
+ MP_E( "ParaLeftMarginRelative", FO, MARGIN, XML_TYPE_PERCENT16, CTF_PARAMARGINALL_REL ),
MP_E( "ParaLeftMargin", FO, MARGIN_LEFT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARALEFTMARGIN ),
MP_E( "ParaLeftMarginRelative", FO, MARGIN_LEFT, XML_TYPE_PERCENT16, CTF_PARALEFTMARGIN_REL ),
MP_E( "ParaRightMargin", FO, MARGIN_RIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARARIGHTMARGIN ),
@@ -578,11 +580,12 @@ XMLPropertyMapEntry aXMLFramePropMap[] =
MG_ED( "VertOrientPosition", SVG, Y, XML_TYPE_MEASURE, 0 ),
// ***** The map for automatic styles starts here *****
// RES_LR_SPACE
- MG_E( "LeftMargin", FO, MARGIN_LEFT, XML_TYPE_MEASURE, 0),
- MG_E( "RightMargin", FO, MARGIN_RIGHT, XML_TYPE_MEASURE, 0 ),
+ MG_E( "LeftMargin", FO, MARGIN, XML_TYPE_MEASURE, CTF_MARGINALL ),
+ MG_E( "LeftMargin", FO, MARGIN_LEFT, XML_TYPE_MEASURE, CTF_MARGINLEFT ),
+ MG_E( "RightMargin", FO, MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_MARGINRIGHT ),
// RES_UL_SPACE
- MG_E( "TopMargin", FO, MARGIN_TOP, XML_TYPE_MEASURE, 0 ),
- MG_E( "BottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE, 0 ),
+ MG_E( "TopMargin", FO, MARGIN_TOP, XML_TYPE_MEASURE, CTF_MARGINTOP ),
+ MG_E( "BottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE, CTF_MARGINBOTTOM ),
// RES_PAGEDESC
// not required
// RES_BREAK
@@ -852,7 +855,7 @@ XMLPropertyMapEntry *lcl_txtprmap_getMap( sal_uInt16 nType )
break;
case TEXT_PROP_MAP_SHAPE_PARA:
pMap = &(aXMLParaPropMap[1]);
- DBG_ASSERT( pMap->meXMLName == XML_MARGIN_LEFT, "shape para map changed" );
+ OSL_ENSURE( pMap->meXMLName == XML_MARGIN, "shape para map changed" );
break;
case TEXT_PROP_MAP_PARA:
pMap = aXMLParaPropMap;
@@ -862,7 +865,7 @@ XMLPropertyMapEntry *lcl_txtprmap_getMap( sal_uInt16 nType )
break;
case TEXT_PROP_MAP_AUTO_FRAME:
pMap = &(aXMLFramePropMap[13]);
- DBG_ASSERT( pMap->meXMLName == XML_MARGIN_LEFT, "frame map changed" );
+ OSL_ENSURE( pMap->meXMLName == XML_MARGIN, "frame map changed" );
break;
case TEXT_PROP_MAP_SHAPE:
pMap = aXMLShapePropMap;
diff --git a/xmloff/source/transform/PropertyActionsOOo.cxx b/xmloff/source/transform/PropertyActionsOOo.cxx
index bc91561de206..e0b9259787eb 100644
--- a/xmloff/source/transform/PropertyActionsOOo.cxx
+++ b/xmloff/source/transform/PropertyActionsOOo.cxx
@@ -649,6 +649,8 @@ XMLTransformerActionInit aTextPropertyOOoAttrActionTable[] =
NO_PARAMS }, /* #i113645# */
{ XML_NAMESPACE_STYLE, XML_TEXT_OVERLINE_COLOR, XML_ATACTION_REMOVE,
NO_PARAMS }, /* #i113645# */
+ { XML_NAMESPACE_FO, XML_WRAP_OPTION, XML_ATACTION_REMOVE,
+ NO_PARAMS }, /* #i116555# */
{ XML_NAMESPACE_OFFICE, XML_TOKEN_INVALID, XML_ATACTION_EOT, NO_PARAMS }
};