diff options
162 files changed, 1893 insertions, 1384 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 57b72498172c..730043cb5022 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -1104,14 +1104,15 @@ endef else # !SYSTEM_LIBPNG -$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\ +$(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\ png \ )) define gb_LinkTarget__use_png -$(call gb_LinkTarget_use_libraries,$(1),\ +$(call gb_LinkTarget_use_static_libraries,$(1),\ png \ ) +$(call gb_LinkTarget__use_zlib,$(1)) endef diff --git a/accessibility/Jar_accessibility.mk b/accessibility/Jar_accessibility.mk deleted file mode 100644 index 1d82c5f1bfc8..000000000000 --- a/accessibility/Jar_accessibility.mk +++ /dev/null @@ -1,90 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# Major Contributor(s): -# Copyright (C) 2010 Red Hat, Inc., David Tardon <dtardon@redhat.com> -# (initial developer) -# -# All Rights Reserved. -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. - -$(eval $(call gb_Jar_Jar,java_accessibility)) - -$(eval $(call gb_Jar_use_jars,java_accessibility,\ - $(OUTDIR)/bin/jurt.jar \ - $(OUTDIR)/bin/ridl.jar \ - $(OUTDIR)/bin/unoil.jar \ -)) - -$(eval $(call gb_Jar_set_packageroot,java_accessibility,org)) - -$(eval $(call gb_Jar_add_sourcefiles,java_accessibility,\ - accessibility/bridge/org/openoffice/java/accessibility/AbstractButton \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleActionImpl \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleComponentImpl \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleEditableTextImpl \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleExtendedState \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleHypertextImpl \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleIconImpl \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleKeyBinding \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleRoleAdapter \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleSelectionImpl \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleStateAdapter \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl \ - accessibility/bridge/org/openoffice/java/accessibility/AccessibleValueImpl \ - accessibility/bridge/org/openoffice/java/accessibility/Alert \ - accessibility/bridge/org/openoffice/java/accessibility/Application \ - accessibility/bridge/org/openoffice/java/accessibility/Button \ - accessibility/bridge/org/openoffice/java/accessibility/CheckBox \ - accessibility/bridge/org/openoffice/java/accessibility/ComboBox \ - accessibility/bridge/org/openoffice/java/accessibility/Component \ - accessibility/bridge/org/openoffice/java/accessibility/Container \ - accessibility/bridge/org/openoffice/java/accessibility/DescendantManager \ - accessibility/bridge/org/openoffice/java/accessibility/Dialog \ - accessibility/bridge/org/openoffice/java/accessibility/FocusTraversalPolicy \ - accessibility/bridge/org/openoffice/java/accessibility/Frame \ - accessibility/bridge/org/openoffice/java/accessibility/Icon \ - accessibility/bridge/org/openoffice/java/accessibility/Label \ - accessibility/bridge/org/openoffice/java/accessibility/List \ - accessibility/bridge/org/openoffice/java/accessibility/Menu \ - accessibility/bridge/org/openoffice/java/accessibility/MenuContainer \ - accessibility/bridge/org/openoffice/java/accessibility/MenuItem \ - accessibility/bridge/org/openoffice/java/accessibility/NativeFrame \ - accessibility/bridge/org/openoffice/java/accessibility/Paragraph \ - accessibility/bridge/org/openoffice/java/accessibility/RadioButton \ - accessibility/bridge/org/openoffice/java/accessibility/ScrollBar \ - accessibility/bridge/org/openoffice/java/accessibility/Separator \ - accessibility/bridge/org/openoffice/java/accessibility/Table \ - accessibility/bridge/org/openoffice/java/accessibility/TextComponent \ - accessibility/bridge/org/openoffice/java/accessibility/ToggleButton \ - accessibility/bridge/org/openoffice/java/accessibility/ToolTip \ - accessibility/bridge/org/openoffice/java/accessibility/Tree \ - accessibility/bridge/org/openoffice/java/accessibility/Window \ - accessibility/bridge/org/openoffice/java/accessibility/logging/XAccessibleEventLog \ - accessibility/bridge/org/openoffice/java/accessibility/logging/XAccessibleHypertextLog \ - accessibility/bridge/org/openoffice/java/accessibility/logging/XAccessibleTextLog \ -)) - -$(eval $(call gb_Jar_add_generated_sourcefiles,java_accessibility,\ - CustomTarget/accessibility/bridge/org/openoffice/java/accessibility/Build \ -)) - -# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/accessibility/Jar_uno_accessbridge.mk b/accessibility/Jar_uno_accessbridge.mk index 586f775f3870..09018bc0a403 100644 --- a/accessibility/Jar_uno_accessbridge.mk +++ b/accessibility/Jar_uno_accessbridge.mk @@ -28,7 +28,6 @@ $(eval $(call gb_Jar_Jar,java_uno_accessbridge)) $(eval $(call gb_Jar_use_jars,java_uno_accessbridge,\ - $(OUTDIR)/bin/java_accessibility.jar \ $(OUTDIR)/bin/jurt.jar \ $(OUTDIR)/bin/ridl.jar \ $(OUTDIR)/bin/unoil.jar \ @@ -49,6 +48,55 @@ $(eval $(call gb_Jar_add_sourcefiles,java_uno_accessbridge,\ accessibility/bridge/org/openoffice/accessibility/KeyHandler \ accessibility/bridge/org/openoffice/accessibility/PopupWindow \ accessibility/bridge/org/openoffice/accessibility/WindowsAccessBridgeAdapter \ + accessibility/bridge/org/openoffice/java/accessibility/AbstractButton \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleActionImpl \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleComponentImpl \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleEditableTextImpl \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleExtendedState \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleHypertextImpl \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleIconImpl \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleKeyBinding \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleRoleAdapter \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleSelectionImpl \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleStateAdapter \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl \ + accessibility/bridge/org/openoffice/java/accessibility/AccessibleValueImpl \ + accessibility/bridge/org/openoffice/java/accessibility/Alert \ + accessibility/bridge/org/openoffice/java/accessibility/Application \ + accessibility/bridge/org/openoffice/java/accessibility/Button \ + accessibility/bridge/org/openoffice/java/accessibility/CheckBox \ + accessibility/bridge/org/openoffice/java/accessibility/ComboBox \ + accessibility/bridge/org/openoffice/java/accessibility/Component \ + accessibility/bridge/org/openoffice/java/accessibility/Container \ + accessibility/bridge/org/openoffice/java/accessibility/DescendantManager \ + accessibility/bridge/org/openoffice/java/accessibility/Dialog \ + accessibility/bridge/org/openoffice/java/accessibility/FocusTraversalPolicy \ + accessibility/bridge/org/openoffice/java/accessibility/Frame \ + accessibility/bridge/org/openoffice/java/accessibility/Icon \ + accessibility/bridge/org/openoffice/java/accessibility/Label \ + accessibility/bridge/org/openoffice/java/accessibility/List \ + accessibility/bridge/org/openoffice/java/accessibility/Menu \ + accessibility/bridge/org/openoffice/java/accessibility/MenuContainer \ + accessibility/bridge/org/openoffice/java/accessibility/MenuItem \ + accessibility/bridge/org/openoffice/java/accessibility/NativeFrame \ + accessibility/bridge/org/openoffice/java/accessibility/Paragraph \ + accessibility/bridge/org/openoffice/java/accessibility/RadioButton \ + accessibility/bridge/org/openoffice/java/accessibility/ScrollBar \ + accessibility/bridge/org/openoffice/java/accessibility/Separator \ + accessibility/bridge/org/openoffice/java/accessibility/Table \ + accessibility/bridge/org/openoffice/java/accessibility/TextComponent \ + accessibility/bridge/org/openoffice/java/accessibility/ToggleButton \ + accessibility/bridge/org/openoffice/java/accessibility/ToolTip \ + accessibility/bridge/org/openoffice/java/accessibility/Tree \ + accessibility/bridge/org/openoffice/java/accessibility/Window \ + accessibility/bridge/org/openoffice/java/accessibility/logging/XAccessibleEventLog \ + accessibility/bridge/org/openoffice/java/accessibility/logging/XAccessibleHypertextLog \ + accessibility/bridge/org/openoffice/java/accessibility/logging/XAccessibleTextLog \ +)) + +$(eval $(call gb_Jar_add_generated_sourcefiles,java_uno_accessbridge,\ + CustomTarget/accessibility/bridge/org/openoffice/java/accessibility/Build \ )) # vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/accessibility/Module_accessibility.mk b/accessibility/Module_accessibility.mk index 368973e54581..47751e88b396 100644 --- a/accessibility/Module_accessibility.mk +++ b/accessibility/Module_accessibility.mk @@ -37,7 +37,6 @@ ifeq ($(OS),WNT) $(eval $(call gb_Module_add_targets,accessibility,\ CustomTarget_bridge \ CustomTarget_bridge_inc \ - Jar_accessibility \ Jar_uno_accessbridge \ Library_java_uno_accessbridge \ )) diff --git a/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx b/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx index 9ee03eb06bdb..b1d8d6171d38 100644 --- a/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx +++ b/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx @@ -83,12 +83,12 @@ jmethodID g_jmRevokeTopWindow = 0; // functions //------------------------------------------------------------------------ -JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *, void *) +SAL_DLLPUBLIC_EXPORT jint JNICALL JNI_OnLoad(JavaVM *, void *) { return JNI_VERSION_1_2; } -JNIEXPORT jbyteArray JNICALL +SAL_DLLPUBLIC_EXPORT jbyteArray JNICALL Java_org_openoffice_accessibility_WindowsAccessBridgeAdapter_getProcessID(JNIEnv *pJNIEnv, jclass clazz) { // Initialize global class and method references @@ -124,7 +124,7 @@ Java_org_openoffice_accessibility_WindowsAccessBridgeAdapter_getProcessID(JNIEnv return jbaProcessID; } -JNIEXPORT jboolean JNICALL +SAL_DLLPUBLIC_EXPORT jboolean JNICALL Java_org_openoffice_accessibility_WindowsAccessBridgeAdapter_createMapping(JNIEnv *, jclass, jlong pointer) { uno_Environment * pJava_environment = NULL; @@ -180,7 +180,7 @@ Java_org_openoffice_accessibility_WindowsAccessBridgeAdapter_createMapping(JNIEn return JNI_TRUE; } -JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *jvm, void *) +SAL_DLLPUBLIC_EXPORT void JNICALL JNI_OnUnload(JavaVM *jvm, void *) { ::Application::RemoveEventListener(g_aEventListenerLink); diff --git a/chart2/source/controller/dialogs/tp_ChartType.src b/chart2/source/controller/dialogs/tp_ChartType.src index 049ef897f795..0f4966aff14d 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.src +++ b/chart2/source/controller/dialogs/tp_ChartType.src @@ -257,11 +257,11 @@ ModalDialog DLG_SPLINE_PROPERTIES Repeat = TRUE ; Spin = TRUE ; Minimum = 1 ; - Maximum = 100 ; + Maximum = 15 ; StrictFormat = TRUE ; Unit = FUNIT_CUSTOM ; First = 1 ; - Last = 100 ; + Last = 15 ; SpinSize = 1 ; }; FixedLine FL_SPLINE_DIALOGBUTTONS diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx index 5f29c41e365c..eac5b4a96911 100644 --- a/chart2/source/view/charttypes/Splines.cxx +++ b/chart2/source/view/charttypes/Splines.cxx @@ -35,6 +35,8 @@ #include <algorithm> #include <functional> +#define MAX_BSPLINE_DEGREE 15 + //............................................................................. namespace chart { @@ -702,7 +704,9 @@ void SplineCalculater::CalculateBSplines( // ODF1.2 spec variable p OSL_ASSERT( nResolution > 1 ); OSL_ASSERT( nDegree >= 1 ); - sal_uInt32 p = nDegree; + + // limit the b-spline degree to prevent insanely large sets of points + sal_uInt32 p = std::min<sal_uInt32>(nDegree, MAX_BSPLINE_DEGREE); rResult.SequenceX.realloc(0); rResult.SequenceY.realloc(0); diff --git a/config_host.mk.in b/config_host.mk.in index 9f38be91d5cc..3997e7f71b2a 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -422,6 +422,8 @@ export PRODUCTNAME=@PRODUCTNAME@ export PRODUCTVERSION=@PRODUCTVERSION@ export PROGRESSBARCOLOR=@PROGRESSBARCOLOR@ export PROGRESSFRAMECOLOR=@PROGRESSFRAMECOLOR@ +export PROGRESSTEXTCOLOR=@PROGRESSTEXTCOLOR@ +export PROGRESSTEXTBASELINE=@PROGRESSTEXTBASELINE@ export PROGRESSPOSITION=@PROGRESSPOSITION@ export PROGRESSSIZE=@PROGRESSSIZE@ export PROEXT=@PROEXT@ diff --git a/configure.in b/configure.in index 7f144130a5ed..2f01827d2db4 100644 --- a/configure.in +++ b/configure.in @@ -1837,6 +1837,20 @@ AC_ARG_WITH(intro-progressbar-frame-color, Usage: --with-intro-progressbar-frame-color=207,208,211 ],,) +AC_ARG_WITH(intro-progressbar-text-color, + AS_HELP_STRING([--with-intro-progressbar-text-color], + [Set color of progress bar text on intro screen. Comma separated RGB values in decimal format.]) + [ + Usage: --with-intro-progressbar-text-color=207,208,211 +],,) + +AC_ARG_WITH(intro-progressbar-text-baseline, + AS_HELP_STRING([--with-intro-progressbar-text-baseline], + [Set vertical position of progress bar text on intro screen. Value in decimal format.]) + [ + Usage: --with-intro-progressbar-text-baseline=250 +],,) + AC_ARG_WITH(flat-logo-svg, [ --with-flat-logo-svg Allows specification of the flat Logo SVG. @@ -11408,6 +11422,28 @@ else fi AC_SUBST(PROGRESSFRAMECOLOR) +AC_MSG_CHECKING([for custom 'intro' progress text color]) +PROGRESSTEXTCOLOR= +if test -z "$with_intro_progressbar_text_color"; then + PROGRESSTEXTCOLOR="255,255,255" + AC_MSG_RESULT([none]) +else + PROGRESSTEXTCOLOR="$with_intro_progressbar_text_color" + AC_MSG_RESULT([$PROGRESSTEXTCOLOR]) +fi +AC_SUBST(PROGRESSTEXTCOLOR) + +AC_MSG_CHECKING([for custom 'intro' progress text baseline]) +PROGRESSTEXTBASELINE= +if test -z "$with_intro_progressbar_text_baseline"; then + PROGRESSTEXTBASELINE="287" + AC_MSG_RESULT([none]) +else + PROGRESSTEXTBASELINE="$with_intro_progressbar_text_baseline" + AC_MSG_RESULT([$PROGRESSTEXTBASELINE]) +fi +AC_SUBST(PROGRESSTEXTBASELINE) + AC_MSG_CHECKING([for alternative branding images directory]) INTRO_BITMAP= ABOUT_BACKGROUND_SVG= diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 40f73027bb31..9753a2ca9ed8 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -1407,8 +1407,8 @@ IMPL_LINK( ColorPickerDialog, ColorModifyHdl, void *, p ) if( aColor != GetColor() ) { mdRed = ((double)aColor.GetRed()) / 255.0; - mdGreen = ((double)aColor.GetRed()) / 255.0; - mdBlue = ((double)aColor.GetRed()) / 255.0; + mdGreen = ((double)aColor.GetGreen()) / 255.0; + mdBlue = ((double)aColor.GetBlue()) / 255.0; RGBtoHSV( mdRed, mdGreen, mdBlue, mdHue, mdSat, mdBri ); RGBtoCMYK( mdRed, mdGreen, mdBlue, mdCyan, mdMagenta, mdYellow, mdKey ); diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index c830b02506fd..ecfd0143baf8 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -107,15 +107,16 @@ class Desktop : public Application static ResMgr* GetDesktopResManager(); static CommandLineArgs& GetCommandLineArgs(); - void HandleBootstrapErrors( BootstrapError ); - void SetBootstrapError( BootstrapError nError ) + void HandleBootstrapErrors( + BootstrapError nError, rtl::OUString const & aMessage ); + void SetBootstrapError( + BootstrapError nError, rtl::OUString const & aMessage ) { if ( m_aBootstrapError == BE_OK ) + { m_aBootstrapError = nError; - } - BootstrapError GetBootstrapError() const - { - return m_aBootstrapError; + m_aBootstrapErrorMessage = aMessage; + } } void SetBootstrapStatus( BootstrapStatus nStatus ) @@ -139,13 +140,11 @@ class Desktop : public Application void SetSplashScreenText( const ::rtl::OUString& rText ); void SetSplashScreenProgress( sal_Int32 ); - static void ensureProcessServiceFactory(); - - private: // Bootstrap methods - static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > CreateApplicationServiceManager(); - // returns a non-null reference or throws an exception + static void InitApplicationServiceManager(); + // throws an exception upon failure + private: void RegisterServices(); void DeregisterServices(); @@ -163,9 +162,6 @@ class Desktop : public Application void HandleBootstrapPathErrors( ::utl::Bootstrap::Status, const ::rtl::OUString& aMsg ); void StartSetup( const ::rtl::OUString& aParameters ); - // Get a resource message string securely e.g. if resource cannot be retrieved return aFaultBackMsg - ::rtl::OUString GetMsgString( sal_uInt16 nId, const ::rtl::OUString& aFaultBackMsg ); - // Create a error message depending on bootstrap failure code and an optional file url ::rtl::OUString CreateErrorMsgString( utl::Bootstrap::FailureCode nFailureCode, const ::rtl::OUString& aFileURL ); @@ -207,6 +203,7 @@ class Desktop : public Application bool m_bServicesRegistered; sal_uInt16 m_nAppEvents; BootstrapError m_aBootstrapError; + rtl::OUString m_aBootstrapErrorMessage; BootstrapStatus m_aBootstrapStatus; std::auto_ptr< Lockfile > m_pLockfile; diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh index 97a2be913f13..f35bebb158f1 100755 --- a/desktop/scripts/soffice.sh +++ b/desktop/scripts/soffice.sh @@ -158,21 +158,5 @@ if [ -n "$VALGRINDCHECK" -a -z "$VALGRIND" ] ; then exec &>valgrind.log fi -# do not pass the request for command line help to oosplash -for arg in $@ ; do - case "$arg" in - -h | --h | --he | --hel | --help) - "$sd_prog/soffice.bin" --help - exit 0 - ;; - -V | --v | --ve | --ver | --vers | --versi | --versio | --version) - "$sd_prog/soffice.bin" --version - exit 0 - ;; - *) - ;; - esac -done - # oosplash does the rest: forcing pages in, javaldx etc. are exec $VALGRINDCHECK $STRACECHECK "$sd_prog/oosplash" "$@" diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 5fb653b5484d..001eac7bee07 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -373,28 +373,34 @@ ResMgr* Desktop::GetDesktopResManager() return Desktop::pResMgr; } +namespace { + // ---------------------------------------------------------------------------- // Get a message string securely. There is a fallback string if the resource // is not available. -OUString Desktop::GetMsgString( sal_uInt16 nId, const OUString& aFaultBackMsg ) +OUString GetMsgString( + sal_uInt16 nId, const OUString& aFaultBackMsg, + bool bAlwaysUseFaultBackMsg = false ) { - ResMgr* resMgr = GetDesktopResManager(); - if ( !resMgr ) - return aFaultBackMsg; - else - return OUString( String( ResId( nId, *resMgr ))); + if ( !bAlwaysUseFaultBackMsg ) + { + ResMgr* resMgr = Desktop::GetDesktopResManager(); + if ( resMgr ) + return OUString( String( ResId( nId, *resMgr ))); + } + return aFaultBackMsg; } -OUString MakeStartupErrorMessage(OUString const & aErrorMessage) +OUString MakeStartupErrorMessage( + OUString const & aErrorMessage, bool bAlwaysUseFaultBackMsg = false ) { OUStringBuffer aDiagnosticMessage( 100 ); - ResMgr* pResMgr = Desktop::GetDesktopResManager(); - if ( pResMgr ) - aDiagnosticMessage.append( OUString(String(ResId(STR_BOOTSTRAP_ERR_CANNOT_START, *pResMgr))) ); - else - aDiagnosticMessage.appendAscii( "The program cannot be started." ); + aDiagnosticMessage.append( + GetMsgString( + STR_BOOTSTRAP_ERR_CANNOT_START, "The program cannot be started.", + bAlwaysUseFaultBackMsg ) ); aDiagnosticMessage.appendAscii( "\n" ); @@ -463,9 +469,8 @@ static bool ShouldSuppressUI(const CommandLineArgs& rCmdLine) rCmdLine.IsQuickstart(); } -namespace -{ - struct theCommandLineArgs : public rtl::Static< CommandLineArgs, theCommandLineArgs > {}; +struct theCommandLineArgs : public rtl::Static< CommandLineArgs, theCommandLineArgs > {}; + } CommandLineArgs& Desktop::GetCommandLineArgs() @@ -583,29 +588,30 @@ void Desktop::Init() // We need to have service factory before going further, but see fdo#37195. // Doing this will mmap common.rdb, making it not overwritable on windows, // so this can't happen before the synchronization above. Lets rework this - // so that the above is called *from* ensureProcessServiceFactory or + // so that the above is called *from* CreateApplicationServiceManager or // something to enforce this gotcha - ensureProcessServiceFactory(); - - if( !::comphelper::getProcessServiceFactory().is()) + try + { + InitApplicationServiceManager(); + } + catch (css::uno::Exception & e) { - OSL_FAIL("Service factory should have been crated in soffice_main()."); - SetBootstrapError( BE_UNO_SERVICEMANAGER ); + SetBootstrapError( BE_UNO_SERVICEMANAGER, e.Message ); } - if ( GetBootstrapError() == BE_OK ) + if ( m_aBootstrapError == BE_OK ) { // prepare language if ( !LanguageSelection::prepareLanguage() ) { if ( LanguageSelection::getStatus() == LanguageSelection::LS_STATUS_CANNOT_DETERMINE_LANGUAGE ) - SetBootstrapError( BE_LANGUAGE_MISSING ); + SetBootstrapError( BE_LANGUAGE_MISSING, OUString() ); else - SetBootstrapError( BE_OFFICECONFIG_BROKEN ); + SetBootstrapError( BE_OFFICECONFIG_BROKEN, OUString() ); } } - if ( GetBootstrapError() == BE_OK ) + if ( m_aBootstrapError == BE_OK ) { const CommandLineArgs& rCmdLineArgs = GetCommandLineArgs(); // start ipc thread only for non-remote offices @@ -613,14 +619,15 @@ void Desktop::Init() OfficeIPCThread::Status aStatus = OfficeIPCThread::EnableOfficeIPCThread(); if ( aStatus == OfficeIPCThread::IPC_STATUS_BOOTSTRAP_ERROR ) { - SetBootstrapError( BE_PATHINFO_MISSING ); + SetBootstrapError( BE_PATHINFO_MISSING, OUString() ); } else if ( aStatus == OfficeIPCThread::IPC_STATUS_2ND_OFFICE ) { // 2nd office startup should terminate after sending cmdlineargs through pipe SetBootstrapStatus(BS_TERMINATE); } - else if ( rCmdLineArgs.IsHelp() ) + else if ( !rCmdLineArgs.GetUnknown().isEmpty() + || rCmdLineArgs.IsHelp() || rCmdLineArgs.IsVersion() ) { // disable IPC thread in an instance that is just showing a help message OfficeIPCThread::DisableOfficeIPCThread(); @@ -636,29 +643,6 @@ void Desktop::InitFinished() CloseSplashScreen(); } -// GetCommandLineArgs() requires this code to work, otherwise it will abort, and -// on Unix command line args needs to be checked before Desktop::Init() -void Desktop::ensureProcessServiceFactory() -{ - if (!comphelper::getProcessServiceFactory().is()) - { - try - { - comphelper::setProcessServiceFactory( - CreateApplicationServiceManager()); - } - catch (const css::uno::Exception& e) - { - // Application::ShowNativeErrorBox would only work after InitVCL, so - // all we can realistically do here is hope the user can see stderr: - std::cerr << "UNO Exception: " << e.Message << std::endl; - // Let exceptions escape and tear down the process, it is completely - // broken anyway: - throw; - } - } -} - void Desktop::DeInit() { RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::DeInit" ); @@ -873,7 +857,8 @@ void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStat return MakeStartupErrorMessage( aMsg ); } -void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError ) +void Desktop::HandleBootstrapErrors( + BootstrapError aBootstrapError, OUString const & aErrorMessage ) { if ( aBootstrapError == BE_PATHINFO_MISSING ) { @@ -954,16 +939,18 @@ void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError ) // PropertyValue is available). To give the user a hint even if // generating and displaying a message box below crashes, print a // hard-coded message on stderr first: - fputs( - aBootstrapError == BE_UNO_SERVICEMANAGER - ? ("The application cannot be started. " "\n" - "The component manager is not available." "\n") - // STR_BOOTSTRAP_ERR_CANNOT_START, STR_BOOTSTRAP_ERR_NO_SERVICE - : ("The application cannot be started. " "\n" - "The configuration service is not available." "\n"), - // STR_BOOTSTRAP_ERR_CANNOT_START, - // STR_BOOTSTRAP_ERR_NO_CFG_SERVICE - stderr); + std::cerr + << "The application cannot be started.\n" + // STR_BOOTSTRAP_ERR_CANNOT_START + << (aBootstrapError == BE_UNO_SERVICEMANAGER + ? "The component manager is not available.\n" + // STR_BOOTSTRAP_ERR_NO_SERVICE + : "The configuration service is not available.\n"); + // STR_BOOTSTRAP_ERR_NO_CFG_SERVICE + if ( !aErrorMessage.isEmpty() ) + { + std::cerr << "(\"" << aErrorMessage << "\")\n"; + } // First sentence. We cannot bootstrap office further! OUString aMessage; @@ -972,24 +959,32 @@ void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError ) OUString aErrorMsg; if ( aBootstrapError == BE_UNO_SERVICEMANAGER ) - aErrorMsg = GetMsgString( STR_BOOTSTRAP_ERR_NO_SERVICE, - OUString( "The service manager is not available." ) ); + aErrorMsg = "The service manager is not available."; else aErrorMsg = GetMsgString( STR_BOOTSTRAP_ERR_NO_CFG_SERVICE, OUString( "The configuration service is not available." ) ); aDiagnosticMessage.append( aErrorMsg ); aDiagnosticMessage.appendAscii( "\n" ); + if ( !aErrorMessage.isEmpty() ) + { + aDiagnosticMessage.appendAscii( "(\"" ); + aDiagnosticMessage.append( aErrorMessage ); + aDiagnosticMessage.appendAscii( "\")\n" ); + } // Due to the fact the we haven't a backup applicat.rdb file anymore it is not possible to // repair the installation with the setup executable besides the office executable. Now // we have to ask the user to start the setup on CD/installation directory manually!! OUString aStartSetupManually( GetMsgString( STR_ASK_START_SETUP_MANUALLY, - OUString( "Start setup application to repair the installation from CD, or the folder containing the installation packages." ) )); + OUString( "Start setup application to repair the installation from CD, or the folder containing the installation packages." ), + aBootstrapError == BE_UNO_SERVICEMANAGER ) ); aDiagnosticMessage.append( aStartSetupManually ); - aMessage = MakeStartupErrorMessage( aDiagnosticMessage.makeStringAndClear() ); + aMessage = MakeStartupErrorMessage( + aDiagnosticMessage.makeStringAndClear(), + aBootstrapError == BE_UNO_SERVICEMANAGER ); FatalError( aMessage); } @@ -1386,10 +1381,9 @@ int Desktop::Main() com::sun::star::uno::ContextLayer layer( com::sun::star::uno::getCurrentContext() ); - BootstrapError eError = GetBootstrapError(); - if ( eError != BE_OK ) + if ( m_aBootstrapError != BE_OK ) { - HandleBootstrapErrors( eError ); + HandleBootstrapErrors( m_aBootstrapError, m_aBootstrapErrorMessage ); return EXIT_FAILURE; } @@ -1403,6 +1397,22 @@ int Desktop::Main() new DesktopContext( com::sun::star::uno::getCurrentContext() ) ); CommandLineArgs& rCmdLineArgs = GetCommandLineArgs(); + OUString aUnknown( rCmdLineArgs.GetUnknown() ); + if ( !aUnknown.isEmpty() ) + { + displayCmdlineHelp( aUnknown ); + return EXIT_FAILURE; + } + if ( rCmdLineArgs.IsHelp() ) + { + displayCmdlineHelp( OUString() ); + return EXIT_SUCCESS; + } + if ( rCmdLineArgs.IsVersion() ) + { + displayVersion(); + return EXIT_SUCCESS; + } // setup configuration error handling ConfigurationErrorHandler aConfigErrHandler; @@ -1423,11 +1433,12 @@ int Desktop::Main() { OSL_FAIL("userinstall failed"); if ( inst_fin == UserInstall::E_NoDiskSpace ) - HandleBootstrapErrors( BE_USERINSTALL_NOTENOUGHDISKSPACE ); + HandleBootstrapErrors( + BE_USERINSTALL_NOTENOUGHDISKSPACE, OUString() ); else if ( inst_fin == UserInstall::E_NoWriteAccess ) - HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS ); + HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS, OUString() ); else - HandleBootstrapErrors( BE_USERINSTALL_FAILED ); + HandleBootstrapErrors( BE_USERINSTALL_FAILED, OUString() ); return EXIT_FAILURE; } // refresh path information @@ -1445,14 +1456,6 @@ int Desktop::Main() SetSplashScreenProgress(25); -#ifndef UNX - if ( rCmdLineArgs.IsHelp() ) - { - displayCmdlineHelp(); - return EXIT_SUCCESS; - } -#endif - // check user installation directory for lockfile so we can be sure // there is no other instance using our data files from a remote host RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" ); @@ -1805,9 +1808,10 @@ bool Desktop::InitializeConfiguration() comphelper::getProcessComponentContext() ); return true; } - catch( const ::com::sun::star::lang::ServiceNotRegisteredException& ) + catch( ::com::sun::star::lang::ServiceNotRegisteredException & e ) { - this->HandleBootstrapErrors( Desktop::BE_UNO_SERVICE_CONFIG_MISSING ); + this->HandleBootstrapErrors( + Desktop::BE_UNO_SERVICE_CONFIG_MISSING, e.Message ); } catch( const ::com::sun::star::configuration::MissingBootstrapFileException& e ) { @@ -2714,10 +2718,10 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) } break; case ApplicationEvent::TYPE_HELP: -#ifndef UNX - // in non unix version allow showing of cmdline help window - displayCmdlineHelp(); -#endif + displayCmdlineHelp(rAppEvent.GetData()); + break; + case ApplicationEvent::TYPE_VERSION: + displayVersion(); break; case ApplicationEvent::TYPE_OPEN: { diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 4b33cb29fa6d..7a32d13c19f2 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -163,20 +163,21 @@ static bool configureUcb() return ret; } -Reference< XMultiServiceFactory > Desktop::CreateApplicationServiceManager() +void Desktop::InitApplicationServiceManager() { RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::createApplicationServiceManager" ); - + Reference<XMultiServiceFactory> sm; #ifdef ANDROID rtl::OUString aUnoRc( OUString( "file:///assets/program/unorc" ) ); - return Reference<XMultiServiceFactory>( + sm.set( cppu::defaultBootstrap_InitialComponentContext( aUnoRc )->getServiceManager(), UNO_QUERY_THROW); #else - return Reference<XMultiServiceFactory>( + sm.set( cppu::defaultBootstrap_InitialComponentContext()->getServiceManager(), UNO_QUERY_THROW); #endif + comphelper::setProcessServiceFactory(sm); } void Desktop::DestroyApplicationServiceManager( Reference< XMultiServiceFactory >& xSMgr ) diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 473dfd69d309..51bdad0ba857 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -287,26 +287,25 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) { bConversionOutEvent = true; } -#if defined UNX else // because it's impossible to filter these options that // are handled in the soffice shell script with the // primitive tools that /bin/sh offers, ignore them here - if (!oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("backtrace")) && + if ( +#if defined UNX + !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("backtrace")) && !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("strace")) && !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("valgrind")) && // for X Session Management, handled in // vcl/unx/generic/app/sm.cxx: !oArg.match("session=") && +#endif //ignore additional legacy options that don't do anything anymore - !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("nocrashreport"))) + !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("nocrashreport")) && + m_unknown.isEmpty()) { - fprintf(stderr, "Unknown option %s\n", - rtl::OUStringToOString(aArg, osl_getThreadTextEncoding()).getStr()); - fprintf(stderr, "Run 'soffice --help' to see a full list of available command line options.\n"); - m_unknown = true; + m_unknown = aArg; } -#endif } else { @@ -623,7 +622,6 @@ void CommandLineArgs::InitParamValues() m_helpbase = false; m_psn = false; m_version = false; - m_unknown = false; m_splashpipe = false; m_bEmpty = true; m_bDocumentArgs = false; @@ -761,7 +759,7 @@ bool CommandLineArgs::IsVersion() const return m_version; } -bool CommandLineArgs::HasUnknown() const +OUString CommandLineArgs::GetUnknown() const { return m_unknown; } diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx index c6286d2ba895..995176346463 100644 --- a/desktop/source/app/cmdlineargs.hxx +++ b/desktop/source/app/cmdlineargs.hxx @@ -93,9 +93,10 @@ class CommandLineArgs: private boost::noncopyable bool IsWeb() const; bool IsVersion() const; bool HasModuleParam() const; - bool HasUnknown() const; bool WantsToLoadDocument() const; + rtl::OUString GetUnknown() const; + // Access to string parameters bool HasSplashPipe() const; std::vector< rtl::OUString > const & GetAccept() const; @@ -153,9 +154,10 @@ class CommandLineArgs: private boost::noncopyable bool m_helpbase; bool m_psn; bool m_version; - bool m_unknown; bool m_splashpipe; + rtl::OUString m_unknown; + bool m_bEmpty; // No Args at all bool m_bDocumentArgs; // A document creation/open/load arg is used std::vector< rtl::OUString > m_accept; diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index d09b5012f0ba..79741de80969 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -136,7 +136,7 @@ namespace desktop rtl::OUString ReplaceStringHookProc(const rtl::OUString& rStr); - void displayCmdlineHelp() + void displayCmdlineHelp(rtl::OUString const & unknown) { // if you put variables in other chunks don't forget to call the replace routines // for those chunks... @@ -147,6 +147,11 @@ namespace desktop String aHelpMessage_bottom(aCmdLineHelp_bottom, RTL_TEXTENCODING_ASCII_US); aHelpMessage_version = ReplaceStringHookProc(aHelpMessage_version); aHelpMessage_head.SearchAndReplaceAscii( "%CMDNAME", String( "soffice", RTL_TEXTENCODING_ASCII_US) ); + if (!unknown.isEmpty()) + { + aHelpMessage_head = "Unknown option: " + unknown + "\n\n" + + aHelpMessage_head; + } #ifdef UNX // on unix use console for output fprintf(stdout, "%s%s", diff --git a/desktop/source/app/cmdlinehelp.hxx b/desktop/source/app/cmdlinehelp.hxx index 5c92512ea1e9..fbf520af7521 100644 --- a/desktop/source/app/cmdlinehelp.hxx +++ b/desktop/source/app/cmdlinehelp.hxx @@ -5,7 +5,7 @@ namespace desktop { - void displayCmdlineHelp( void ); + void displayCmdlineHelp( rtl::OUString const & unknown ); void displayVersion(); #ifndef UNX class CmdlineHelpDialog : public ModalDialog diff --git a/desktop/source/app/desktop.hrc b/desktop/source/app/desktop.hrc index 9c68d7b9fd2d..83aa711aaaca 100644 --- a/desktop/source/app/desktop.hrc +++ b/desktop/source/app/desktop.hrc @@ -67,7 +67,6 @@ #define STR_BOOTSTRAP_ERR_NO_SUPPORT (RID_DESKTOP_STRING_START+107) #define STR_BOOTSTRAP_ERR_LANGUAGE_MISSING (RID_DESKTOP_STRING_START+108) -#define STR_BOOTSTRAP_ERR_NO_SERVICE (RID_DESKTOP_STRING_START+120) #define STR_BOOTSTRAP_ERR_NO_CFG_SERVICE (RID_DESKTOP_STRING_START+121) #define STR_BOOTSTRAP_ERR_CFG_DATAACCESS (RID_DESKTOP_STRING_START+122) #define STR_BOOTSTRAP_ERR_NO_PATHSET_SERVICE (RID_DESKTOP_STRING_START+123) diff --git a/desktop/source/app/desktop.src b/desktop/source/app/desktop.src index 0b6bc3f3c803..913f88ba92ed 100644 --- a/desktop/source/app/desktop.src +++ b/desktop/source/app/desktop.src @@ -88,11 +88,6 @@ String STR_BOOTSTRAP_ERR_LANGUAGE_MISSING Text [ en-US ] = "The user interface language cannot be determined."; }; -String STR_BOOTSTRAP_ERR_NO_SERVICE -{ - Text [ en-US ] = "The component manager is not available."; -}; - String STR_BOOTSTRAP_ERR_NO_CFG_SERVICE { Text [ en-US ] = "The configuration service is not available."; diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index e99eb1d20eac..b9ede23532d9 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -700,192 +700,193 @@ void OfficeIPCThread::execute() continue; } -#ifdef UNX - if (aCmdLineArgs->HasUnknown() || aCmdLineArgs->IsVersion() || aCmdLineArgs->IsHelp()) - continue; -#endif - - const CommandLineArgs &rCurrentCmdLineArgs = Desktop::GetCommandLineArgs(); + sal_Bool bDocRequestSent = sal_False; - if ( aCmdLineArgs->IsQuickstart() ) + OUString aUnknown( aCmdLineArgs->GetUnknown() ); + if ( !aUnknown.isEmpty() || aCmdLineArgs->IsHelp() ) { - // we have to use application event, because we have to start quickstart service in main thread!! ApplicationEvent* pAppEvent = - new ApplicationEvent(ApplicationEvent::TYPE_QUICKSTART); + new ApplicationEvent(ApplicationEvent::TYPE_HELP, aUnknown); ImplPostForeignAppEvent( pAppEvent ); } - - // handle request for acceptor - std::vector< rtl::OUString > const & accept = aCmdLineArgs-> - GetAccept(); - for (std::vector< rtl::OUString >::const_iterator i(accept.begin()); - i != accept.end(); ++i) + else if ( aCmdLineArgs->IsVersion() ) { - ApplicationEvent* pAppEvent = new ApplicationEvent( - ApplicationEvent::TYPE_ACCEPT, *i); - ImplPostForeignAppEvent( pAppEvent ); - } - // handle acceptor removal - std::vector< rtl::OUString > const & unaccept = aCmdLineArgs-> - GetUnaccept(); - for (std::vector< rtl::OUString >::const_iterator i( - unaccept.begin()); - i != unaccept.end(); ++i) - { - ApplicationEvent* pAppEvent = new ApplicationEvent( - ApplicationEvent::TYPE_UNACCEPT, *i); - ImplPostForeignAppEvent( pAppEvent ); - } - -#ifndef UNX - // only in non-unix version, we need to handle a -help request - // in a running instance in order to display the command line help - if ( aCmdLineArgs->IsHelp() ) { ApplicationEvent* pAppEvent = - new ApplicationEvent(ApplicationEvent::TYPE_HELP); + new ApplicationEvent(ApplicationEvent::TYPE_VERSION); ImplPostForeignAppEvent( pAppEvent ); } -#endif - - sal_Bool bDocRequestSent = sal_False; - ProcessDocumentsRequest* pRequest = new ProcessDocumentsRequest( - aCmdLineArgs->getCwdUrl()); - cProcessed.reset(); - pRequest->pcProcessed = &cProcessed; - - // Print requests are not dependent on the --invisible cmdline argument as they are - // loaded with the "hidden" flag! So they are always checked. - pRequest->aPrintList = aCmdLineArgs->GetPrintList(); - bDocRequestSent |= !pRequest->aPrintList.empty(); - pRequest->aPrintToList = aCmdLineArgs->GetPrintToList(); - pRequest->aPrinterName = aCmdLineArgs->GetPrinterName(); - bDocRequestSent |= !( pRequest->aPrintToList.empty() || pRequest->aPrinterName.isEmpty() ); - - if ( !rCurrentCmdLineArgs.IsInvisible() ) + else { - // Read cmdline args that can open/create documents. As they would open a window - // they are only allowed if the "--invisible" is currently not used! - pRequest->aOpenList = aCmdLineArgs->GetOpenList(); - bDocRequestSent |= !pRequest->aOpenList.empty(); - pRequest->aViewList = aCmdLineArgs->GetViewList(); - bDocRequestSent |= !pRequest->aViewList.empty(); - pRequest->aStartList = aCmdLineArgs->GetStartList(); - bDocRequestSent |= !pRequest->aStartList.empty(); - pRequest->aForceOpenList = aCmdLineArgs->GetForceOpenList(); - bDocRequestSent |= !pRequest->aForceOpenList.empty(); - pRequest->aForceNewList = aCmdLineArgs->GetForceNewList(); - bDocRequestSent |= !pRequest->aForceNewList.empty(); - - // Special command line args to create an empty document for a given module - - // #i18338# (lo) - // we only do this if no document was specified on the command line, - // since this would be inconsistent with the the behaviour of - // the first process, see OpenClients() (call to OpenDefault()) in app.cxx - if ( aCmdLineArgs->HasModuleParam() && (!bDocRequestSent) ) + const CommandLineArgs &rCurrentCmdLineArgs = Desktop::GetCommandLineArgs(); + + if ( aCmdLineArgs->IsQuickstart() ) { - SvtModuleOptions aOpt; - SvtModuleOptions::EFactory eFactory = SvtModuleOptions::E_WRITER; - if ( aCmdLineArgs->IsWriter() ) - eFactory = SvtModuleOptions::E_WRITER; - else if ( aCmdLineArgs->IsCalc() ) - eFactory = SvtModuleOptions::E_CALC; - else if ( aCmdLineArgs->IsDraw() ) - eFactory = SvtModuleOptions::E_DRAW; - else if ( aCmdLineArgs->IsImpress() ) - eFactory = SvtModuleOptions::E_IMPRESS; - else if ( aCmdLineArgs->IsBase() ) - eFactory = SvtModuleOptions::E_DATABASE; - else if ( aCmdLineArgs->IsMath() ) - eFactory = SvtModuleOptions::E_MATH; - else if ( aCmdLineArgs->IsGlobal() ) - eFactory = SvtModuleOptions::E_WRITERGLOBAL; - else if ( aCmdLineArgs->IsWeb() ) - eFactory = SvtModuleOptions::E_WRITERWEB; - - if ( !pRequest->aOpenList.empty() ) - pRequest->aModule = aOpt.GetFactoryName( eFactory ); - else - pRequest->aOpenList.push_back( aOpt.GetFactoryEmptyDocumentURL( eFactory ) ); - bDocRequestSent = sal_True; + // we have to use application event, because we have to start quickstart service in main thread!! + ApplicationEvent* pAppEvent = + new ApplicationEvent(ApplicationEvent::TYPE_QUICKSTART); + ImplPostForeignAppEvent( pAppEvent ); } - } - if ( !aCmdLineArgs->IsQuickstart() ) { - sal_Bool bShowHelp = sal_False; - rtl::OUStringBuffer aHelpURLBuffer; - if (aCmdLineArgs->IsHelpWriter()) { - bShowHelp = sal_True; - aHelpURLBuffer.appendAscii("vnd.sun.star.help://swriter/start"); - } else if (aCmdLineArgs->IsHelpCalc()) { - bShowHelp = sal_True; - aHelpURLBuffer.appendAscii("vnd.sun.star.help://scalc/start"); - } else if (aCmdLineArgs->IsHelpDraw()) { - bShowHelp = sal_True; - aHelpURLBuffer.appendAscii("vnd.sun.star.help://sdraw/start"); - } else if (aCmdLineArgs->IsHelpImpress()) { - bShowHelp = sal_True; - aHelpURLBuffer.appendAscii("vnd.sun.star.help://simpress/start"); - } else if (aCmdLineArgs->IsHelpBase()) { - bShowHelp = sal_True; - aHelpURLBuffer.appendAscii("vnd.sun.star.help://sdatabase/start"); - } else if (aCmdLineArgs->IsHelpBasic()) { - bShowHelp = sal_True; - aHelpURLBuffer.appendAscii("vnd.sun.star.help://sbasic/start"); - } else if (aCmdLineArgs->IsHelpMath()) { - bShowHelp = sal_True; - aHelpURLBuffer.appendAscii("vnd.sun.star.help://smath/start"); + // handle request for acceptor + std::vector< rtl::OUString > const & accept = aCmdLineArgs-> + GetAccept(); + for (std::vector< rtl::OUString >::const_iterator i(accept.begin()); + i != accept.end(); ++i) + { + ApplicationEvent* pAppEvent = new ApplicationEvent( + ApplicationEvent::TYPE_ACCEPT, *i); + ImplPostForeignAppEvent( pAppEvent ); } - if (bShowHelp) { - aHelpURLBuffer.appendAscii("?Language="); - aHelpURLBuffer.append(utl::ConfigManager::getLocale()); -#if defined UNX - aHelpURLBuffer.appendAscii("&System=UNX"); -#elif defined WNT - aHelpURLBuffer.appendAscii("&System=WIN"); -#endif + // handle acceptor removal + std::vector< rtl::OUString > const & unaccept = aCmdLineArgs-> + GetUnaccept(); + for (std::vector< rtl::OUString >::const_iterator i( + unaccept.begin()); + i != unaccept.end(); ++i) + { ApplicationEvent* pAppEvent = new ApplicationEvent( - ApplicationEvent::TYPE_OPENHELPURL, - aHelpURLBuffer.makeStringAndClear()); + ApplicationEvent::TYPE_UNACCEPT, *i); ImplPostForeignAppEvent( pAppEvent ); } - } - if ( bDocRequestSent ) - { - // Send requests to dispatch watcher if we have at least one. The receiver - // is responsible to delete the request after processing it. - if ( aCmdLineArgs->HasModuleParam() ) + ProcessDocumentsRequest* pRequest = new ProcessDocumentsRequest( + aCmdLineArgs->getCwdUrl()); + cProcessed.reset(); + pRequest->pcProcessed = &cProcessed; + + // Print requests are not dependent on the --invisible cmdline argument as they are + // loaded with the "hidden" flag! So they are always checked. + pRequest->aPrintList = aCmdLineArgs->GetPrintList(); + bDocRequestSent |= !pRequest->aPrintList.empty(); + pRequest->aPrintToList = aCmdLineArgs->GetPrintToList(); + pRequest->aPrinterName = aCmdLineArgs->GetPrinterName(); + bDocRequestSent |= !( pRequest->aPrintToList.empty() || pRequest->aPrinterName.isEmpty() ); + + if ( !rCurrentCmdLineArgs.IsInvisible() ) { - SvtModuleOptions aOpt; - - // Support command line parameters to start a module (as preselection) - if ( aCmdLineArgs->IsWriter() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) ) - pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::E_WRITER ); - else if ( aCmdLineArgs->IsCalc() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) ) - pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::E_CALC ); - else if ( aCmdLineArgs->IsImpress() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) ) - pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::E_IMPRESS ); - else if ( aCmdLineArgs->IsDraw() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) ) - pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::E_DRAW ); + // Read cmdline args that can open/create documents. As they would open a window + // they are only allowed if the "--invisible" is currently not used! + pRequest->aOpenList = aCmdLineArgs->GetOpenList(); + bDocRequestSent |= !pRequest->aOpenList.empty(); + pRequest->aViewList = aCmdLineArgs->GetViewList(); + bDocRequestSent |= !pRequest->aViewList.empty(); + pRequest->aStartList = aCmdLineArgs->GetStartList(); + bDocRequestSent |= !pRequest->aStartList.empty(); + pRequest->aForceOpenList = aCmdLineArgs->GetForceOpenList(); + bDocRequestSent |= !pRequest->aForceOpenList.empty(); + pRequest->aForceNewList = aCmdLineArgs->GetForceNewList(); + bDocRequestSent |= !pRequest->aForceNewList.empty(); + + // Special command line args to create an empty document for a given module + + // #i18338# (lo) + // we only do this if no document was specified on the command line, + // since this would be inconsistent with the the behaviour of + // the first process, see OpenClients() (call to OpenDefault()) in app.cxx + if ( aCmdLineArgs->HasModuleParam() && (!bDocRequestSent) ) + { + SvtModuleOptions aOpt; + SvtModuleOptions::EFactory eFactory = SvtModuleOptions::E_WRITER; + if ( aCmdLineArgs->IsWriter() ) + eFactory = SvtModuleOptions::E_WRITER; + else if ( aCmdLineArgs->IsCalc() ) + eFactory = SvtModuleOptions::E_CALC; + else if ( aCmdLineArgs->IsDraw() ) + eFactory = SvtModuleOptions::E_DRAW; + else if ( aCmdLineArgs->IsImpress() ) + eFactory = SvtModuleOptions::E_IMPRESS; + else if ( aCmdLineArgs->IsBase() ) + eFactory = SvtModuleOptions::E_DATABASE; + else if ( aCmdLineArgs->IsMath() ) + eFactory = SvtModuleOptions::E_MATH; + else if ( aCmdLineArgs->IsGlobal() ) + eFactory = SvtModuleOptions::E_WRITERGLOBAL; + else if ( aCmdLineArgs->IsWeb() ) + eFactory = SvtModuleOptions::E_WRITERWEB; + + if ( !pRequest->aOpenList.empty() ) + pRequest->aModule = aOpt.GetFactoryName( eFactory ); + else + pRequest->aOpenList.push_back( aOpt.GetFactoryEmptyDocumentURL( eFactory ) ); + bDocRequestSent = sal_True; + } } + if ( !aCmdLineArgs->IsQuickstart() ) { + sal_Bool bShowHelp = sal_False; + rtl::OUStringBuffer aHelpURLBuffer; + if (aCmdLineArgs->IsHelpWriter()) { + bShowHelp = sal_True; + aHelpURLBuffer.appendAscii("vnd.sun.star.help://swriter/start"); + } else if (aCmdLineArgs->IsHelpCalc()) { + bShowHelp = sal_True; + aHelpURLBuffer.appendAscii("vnd.sun.star.help://scalc/start"); + } else if (aCmdLineArgs->IsHelpDraw()) { + bShowHelp = sal_True; + aHelpURLBuffer.appendAscii("vnd.sun.star.help://sdraw/start"); + } else if (aCmdLineArgs->IsHelpImpress()) { + bShowHelp = sal_True; + aHelpURLBuffer.appendAscii("vnd.sun.star.help://simpress/start"); + } else if (aCmdLineArgs->IsHelpBase()) { + bShowHelp = sal_True; + aHelpURLBuffer.appendAscii("vnd.sun.star.help://sdatabase/start"); + } else if (aCmdLineArgs->IsHelpBasic()) { + bShowHelp = sal_True; + aHelpURLBuffer.appendAscii("vnd.sun.star.help://sbasic/start"); + } else if (aCmdLineArgs->IsHelpMath()) { + bShowHelp = sal_True; + aHelpURLBuffer.appendAscii("vnd.sun.star.help://smath/start"); + } + if (bShowHelp) { + aHelpURLBuffer.appendAscii("?Language="); + aHelpURLBuffer.append(utl::ConfigManager::getLocale()); +#if defined UNX + aHelpURLBuffer.appendAscii("&System=UNX"); +#elif defined WNT + aHelpURLBuffer.appendAscii("&System=WIN"); +#endif + ApplicationEvent* pAppEvent = new ApplicationEvent( + ApplicationEvent::TYPE_OPENHELPURL, + aHelpURLBuffer.makeStringAndClear()); + ImplPostForeignAppEvent( pAppEvent ); + } + } - ImplPostProcessDocumentsEvent( pRequest ); - } - else - { - // delete not used request again - delete pRequest; - pRequest = NULL; - } - if (aArguments.equalsL(sc_aShowSequence, sc_nShSeqLength) || - aCmdLineArgs->IsEmpty()) - { - // no document was sent, just bring Office to front - ApplicationEvent* pAppEvent = - new ApplicationEvent(ApplicationEvent::TYPE_APPEAR); - ImplPostForeignAppEvent( pAppEvent ); + if ( bDocRequestSent ) + { + // Send requests to dispatch watcher if we have at least one. The receiver + // is responsible to delete the request after processing it. + if ( aCmdLineArgs->HasModuleParam() ) + { + SvtModuleOptions aOpt; + + // Support command line parameters to start a module (as preselection) + if ( aCmdLineArgs->IsWriter() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) ) + pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::E_WRITER ); + else if ( aCmdLineArgs->IsCalc() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) ) + pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::E_CALC ); + else if ( aCmdLineArgs->IsImpress() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) ) + pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::E_IMPRESS ); + else if ( aCmdLineArgs->IsDraw() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) ) + pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::E_DRAW ); + } + + ImplPostProcessDocumentsEvent( pRequest ); + } + else + { + // delete not used request again + delete pRequest; + pRequest = NULL; + } + if (aArguments.equalsL(sc_aShowSequence, sc_nShSeqLength) || + aCmdLineArgs->IsEmpty()) + { + // no document was sent, just bring Office to front + ApplicationEvent* pAppEvent = + new ApplicationEvent(ApplicationEvent::TYPE_APPEAR); + ImplPostForeignAppEvent( pAppEvent ); + } } // we don't need the mutex any longer... diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index a9501eda85ee..37b9c924d067 100755 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -38,21 +38,14 @@ #include <rtl/bootstrap.hxx> #include <tools/extendapplicationenvironment.hxx> -#if defined WNT -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#endif - int SVMain(); // -=-= main() -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= extern "C" int DESKTOP_DLLPUBLIC soffice_main() { -#if defined ANDROID || defined WNT +#if defined ANDROID try { -#endif -#if defined(ANDROID) rtl::Bootstrap::setIniFilename( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///assets/program/lofficerc"))); #endif @@ -67,38 +60,31 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main() // handle --version and --help already here, otherwise they would be handled // after VCL initialization that might fail if $DISPLAY is not set const desktop::CommandLineArgs& rCmdLineArgs = aDesktop.GetCommandLineArgs(); + rtl::OUString aUnknown( rCmdLineArgs.GetUnknown() ); + if ( !aUnknown.isEmpty() ) + { + desktop::Desktop::InitApplicationServiceManager(); + desktop::displayCmdlineHelp( aUnknown ); + return EXIT_FAILURE; + } if ( rCmdLineArgs.IsHelp() ) { - desktop::Desktop::ensureProcessServiceFactory(); - desktop::displayCmdlineHelp(); + desktop::Desktop::InitApplicationServiceManager(); + desktop::displayCmdlineHelp( rtl::OUString() ); return EXIT_SUCCESS; } - else if ( rCmdLineArgs.IsVersion() ) + if ( rCmdLineArgs.IsVersion() ) { - desktop::Desktop::ensureProcessServiceFactory(); + desktop::Desktop::InitApplicationServiceManager(); desktop::displayVersion(); return EXIT_SUCCESS; } - else if ( rCmdLineArgs.HasUnknown() ) - { - return EXIT_FAILURE; - } #endif return SVMain(); -#if defined ANDROID || defined WNT - } catch (const ::com::sun::star::uno::Exception &e) { #if defined ANDROID + } catch (const ::com::sun::star::uno::Exception &e) { fprintf (stderr, "Not handled UNO exception at main: '%s'\n", rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); -#elif defined WNT - MessageBoxW( - 0, - reinterpret_cast< LPCWSTR >( - rtl::OUString("Unhandled exception:\n" + e.Message).getStr()), - reinterpret_cast< LPCWSTR >(rtl::OUString("Fatal Error").getStr()), - (MB_OK | MB_ICONERROR | MB_DEFBUTTON1 | MB_TASKMODAL - | MB_SETFOREGROUND | MB_TOPMOST)); -#endif throw; // to get exception type printed } #endif diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 0ef211a3cbeb..48510b19172c 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -88,6 +88,7 @@ private: BitmapEx _aIntroBmp; Color _cProgressFrameColor; Color _cProgressBarColor; + Color _cProgressTextColor; bool _bNativeProgress; OUString _sAppName; OUString _sProgressText; @@ -103,7 +104,7 @@ private: sal_Bool _bFullScreenSplash; sal_Bool _bProgressEnd; long _height, _width, _tlx, _tly, _barwidth; - long _barheight, _barspace; + long _barheight, _barspace, _textBaseline; double _fXPos, _fYPos; double _fWidth, _fHeight; const long _xoffset, _yoffset; @@ -132,6 +133,7 @@ SplashScreen::SplashScreen() , _vdev(*((IntroWindow*)this)) , _cProgressFrameColor(sal::static_int_cast< ColorData >(NOT_LOADED)) , _cProgressBarColor(sal::static_int_cast< ColorData >(NOT_LOADED)) + , _cProgressTextColor(sal::static_int_cast< ColorData >(NOT_LOADED)) , _bNativeProgress(true) , _iMax(100) , _iProgress(0) @@ -146,6 +148,7 @@ SplashScreen::SplashScreen() , _barwidth(NOT_LOADED) , _barheight(NOT_LOADED) , _barspace(2) + , _textBaseline(NOT_LOADED) , _fXPos(-1.0) , _fYPos(-1.0) , _fWidth(-1.0) @@ -154,6 +157,7 @@ SplashScreen::SplashScreen() , _yoffset(18) { loadConfig(); + _vdev.EnableRTL(IsRTLEnabled()); } SplashScreen::~SplashScreen() @@ -299,6 +303,9 @@ SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::sta } } + if ( NOT_LOADED == _textBaseline ) + _textBaseline = _height; + if ( sal::static_int_cast< ColorData >(NOT_LOADED) == _cProgressFrameColor.GetColor() ) _cProgressFrameColor = Color( COL_LIGHTGRAY ); @@ -313,6 +320,10 @@ SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::sta _cProgressBarColor = Color( COL_BLUE ); } + if ( sal::static_int_cast< ColorData >(NOT_LOADED) == + _cProgressTextColor.GetColor() ) + _cProgressTextColor = Color( COL_BLACK ); + Application::AddEventListener( LINK( this, SplashScreen, AppEventListenerHdl ) ); @@ -365,6 +376,10 @@ void SplashScreen::loadConfig() OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressFrameColor" ) ) ); OUString sProgressBarColor = implReadBootstrapKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressBarColor" ) ) ); + OUString sProgressTextColor = implReadBootstrapKey( + OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressTextColor" ) ) ); + OUString sProgressTextBaseline = implReadBootstrapKey( + OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressTextBaseline" ) ) ); OUString sSize = implReadBootstrapKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressSize" ) ) ); OUString sPosition = implReadBootstrapKey( @@ -420,6 +435,29 @@ void SplashScreen::loadConfig() } } + if ( !sProgressTextColor.isEmpty() ) + { + sal_uInt8 nRed = 0; + sal_Int32 idx = 0; + sal_Int32 temp = sProgressTextColor.getToken( 0, ',', idx ).toInt32(); + if ( idx != -1 ) + { + nRed = static_cast< sal_uInt8 >( temp ); + temp = sProgressTextColor.getToken( 0, ',', idx ).toInt32(); + } + if ( idx != -1 ) + { + sal_uInt8 nGreen = static_cast< sal_uInt8 >( temp ); + sal_uInt8 nBlue = static_cast< sal_uInt8 >( sProgressTextColor.getToken( 0, ',', idx ).toInt32() ); + _cProgressTextColor = Color( nRed, nGreen, nBlue ); + } + } + + if ( !sProgressTextBaseline.isEmpty() ) + { + _textBaseline = sProgressTextBaseline.toInt32(); + } + if( !sNativeProgress.isEmpty() ) { _bNativeProgress = sNativeProgress.toBoolean(); @@ -610,7 +648,12 @@ void SplashScreen::Paint( const Rectangle&) _vdev.SetFillColor( _cProgressBarColor ); _vdev.SetLineColor(); _vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace)); - _vdev.DrawText( Rectangle(_tlx, _tly+_barheight+5, _tlx+_barwidth, _tly+_barheight+5+20), _sProgressText, TEXT_DRAW_CENTER ); + Font aFont; + aFont.SetSize(Size(0, 12)); + aFont.SetAlign(ALIGN_BASELINE); + _vdev.SetFont(aFont); + _vdev.SetTextColor(_cProgressTextColor); + _vdev.DrawText(Point(_tlx, _textBaseline), _sProgressText); } DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev.GetOutputSizePixel(), _vdev ); } diff --git a/desktop/unx/source/args.c b/desktop/unx/source/args.c index 0952911b5763..e08d119397de 100644 --- a/desktop/unx/source/args.c +++ b/desktop/unx/source/args.c @@ -48,30 +48,34 @@ static struct { unsigned int bInhibitSplash : 1; unsigned int bInhibitPagein : 1; unsigned int bInhibitJavaLdx : 1; + unsigned int bInhibitPipe : 1; const char *pPageinType; } pArgDescr[] = { /* have a trailing argument */ - { "pt", 1, 0, 0, 0, NULL }, - { "display", 1, 0, 0, 0, NULL }, + { "pt", 1, 0, 0, 0, 0, NULL }, + { "display", 1, 0, 0, 0, 0, NULL }, /* no splash */ - { "nologo", 0, 1, 0, 0, NULL }, - { "headless", 0, 1, 0, 0, NULL }, - { "invisible", 0, 1, 0, 0, NULL }, - { "quickstart", 0, 1, 0, 0, NULL }, - { "minimized", 0, 1, 0, 0, NULL }, + { "nologo", 0, 1, 0, 0, 0, NULL }, + { "headless", 0, 1, 0, 0, 0, NULL }, + { "invisible", 0, 1, 0, 0, 0, NULL }, + { "quickstart", 0, 1, 0, 0, 0, NULL }, + { "minimized", 0, 1, 0, 0, 0, NULL }, /* pagein bits */ - { "writer", 0, 0, 0, 0, "pagein-writer" }, - { "calc", 0, 0, 0, 0, "pagein-calc" }, - { "draw", 0, 0, 0, 0, "pagein-draw" }, - { "impress", 0, 0, 0, 0, "pagein-impress" }, - - /* nothing much */ - { "version", 0, 1, 1, 1, NULL }, - { "help", 0, 1, 1, 1, NULL }, - { "h", 0, 1, 1, 1, NULL }, - { "?", 0, 1, 1, 1, NULL }, + { "writer", 0, 0, 0, 0, 0, "pagein-writer" }, + { "calc", 0, 0, 0, 0, 0, "pagein-calc" }, + { "draw", 0, 0, 0, 0, 0, "pagein-draw" }, + { "impress", 0, 0, 0, 0, 0, "pagein-impress" }, + + /* Do not send --help/--version over the pipe, as their output shall go to + the calling process's stdout (ideally, this would also happen in the + presence of unknown options); also prevent splash/pagein/javaldx overhead + (as these options will be processed early in soffice_main): */ + { "version", 0, 1, 1, 1, 1, NULL }, + { "help", 0, 1, 1, 1, 1, NULL }, + { "h", 0, 1, 1, 1, 1, NULL }, + { "?", 0, 1, 1, 1, 1, NULL }, }; Args *args_parse (void) @@ -126,14 +130,17 @@ Args *args_parse (void) } for ( j = 0; j < SAL_N_ELEMENTS (pArgDescr); ++j ) { - if (!rtl_ustr_indexOfAscii_WithLength - (arg, length, pArgDescr[j].name, strlen (pArgDescr[j].name))) { - + if (rtl_ustr_ascii_compare_WithLength( + arg, length, pArgDescr[j].name) + == 0) + { args->bInhibitSplash |= pArgDescr[j].bInhibitSplash; args->bInhibitPagein |= pArgDescr[j].bInhibitPagein; args->bInhibitJavaLdx |= pArgDescr[j].bInhibitJavaLdx; + args->bInhibitPipe |= pArgDescr[j].bInhibitPipe; if (pArgDescr[j].pPageinType) args->pPageinType = pArgDescr[j].pPageinType; + break; } } } diff --git a/desktop/unx/source/args.h b/desktop/unx/source/args.h index 4a0cb55ffcde..9176badbda2a 100644 --- a/desktop/unx/source/args.h +++ b/desktop/unx/source/args.h @@ -38,6 +38,7 @@ typedef struct { sal_Bool bInhibitSplash; // should we show a splash screen sal_Bool bInhibitPagein; // should we run pagein ? sal_Bool bInhibitJavaLdx; // should we run javaldx ? + sal_Bool bInhibitPipe; // for --help and --version sal_uInt32 nArgsEnv; // number of -env: style args sal_uInt32 nArgsTotal; // number of -env: as well as -writer style args diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index 8fe4774ef504..c6a8c2b826ed 100644 --- a/desktop/unx/source/start.c +++ b/desktop/unx/source/start.c @@ -831,21 +831,24 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) if ( pUsePlugin && !strcmp(pUsePlugin, "svp") ) args->bInhibitSplash = sal_True; - pPipePath = get_pipe_path( args->pAppPath ); - - if ( ( fd = connect_pipe( pPipePath ) ) >= 0 ) + if ( !args->bInhibitPipe ) { - rtl_uString *pCwdPath = NULL; - osl_getProcessWorkingDir( &pCwdPath ); + pPipePath = get_pipe_path( args->pAppPath ); + + if ( ( fd = connect_pipe( pPipePath ) ) >= 0 ) + { + rtl_uString *pCwdPath = NULL; + osl_getProcessWorkingDir( &pCwdPath ); - bSentArgs = send_args( fd, pCwdPath ); + bSentArgs = send_args( fd, pCwdPath ); - close( fd ); - } + close( fd ); + } #if OSL_DEBUG_LEVEL > 1 - else - ustr_debug( "Failed to connect to pipe", pPipePath ); + else + ustr_debug( "Failed to connect to pipe", pPipePath ); #endif + } if ( !bSentArgs ) { @@ -935,7 +938,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) } /* cleanup */ - rtl_uString_release( pPipePath ); + if ( pPipePath ) + rtl_uString_release( pPipePath ); args_free (args); return status; diff --git a/editeng/inc/editeng/borderline.hxx b/editeng/inc/editeng/borderline.hxx index 7d18587e78fb..4bb4388243ea 100644 --- a/editeng/inc/editeng/borderline.hxx +++ b/editeng/inc/editeng/borderline.hxx @@ -52,9 +52,12 @@ namespace editeng { // values from ::com::sun::star::table::BorderLineStyle typedef sal_Int16 SvxBorderStyle; + // convert border style between Word formats and LO + SvxBorderStyle EDITENG_DLLPUBLIC ConvertBorderStyleFromWord(int); /// convert border width in twips between Word formats and LO double EDITENG_DLLPUBLIC ConvertBorderWidthToWord(SvxBorderStyle, double); - double EDITENG_DLLPUBLIC ConvertBorderWidthFromWord(SvxBorderStyle, double); + double EDITENG_DLLPUBLIC ConvertBorderWidthFromWord(SvxBorderStyle, + double, int); class EDITENG_DLLPUBLIC SvxBorderLine { diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index a97fcecd8538..d952e6a5f6d2 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -535,7 +535,7 @@ public: sal_uInt16 GetLen() const { return nEnd - nStart; } sal_uInt16 GetStartPosX() const { return nStartPosX; } - void SetStartPosX( sal_uInt16 start ) { nStartPosX = start; } + void SetStartPosX( long start ) { if (start > 0) nStartPosX = start; else nStartPosX = 0; } Size CalcTextSize( ParaPortion& rParaPortion ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index a4441c47b210..59c70bfc73b9 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1414,11 +1414,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY ) { long n = ( nMaxLineWidth - aTextSize.Width() ) / 2; n += nStartX; // Indentation is kept. - if ( n > 0 ) - pLine->SetStartPosX( (sal_uInt16)n ); - else - pLine->SetStartPosX( 0 ); - + pLine->SetStartPosX( n ); } break; case SVX_ADJUST_RIGHT: @@ -1427,24 +1423,21 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY ) // the blank must not be displayed! long n = nMaxLineWidth - aTextSize.Width(); n += nStartX; // Indentation is kept. - if ( n > 0 ) - pLine->SetStartPosX( (sal_uInt16)n ); - else - pLine->SetStartPosX( 0 ); + pLine->SetStartPosX( n ); } break; case SVX_ADJUST_BLOCK: { bool bDistLastLine = (GetJustifyMethod(nPara) == SVX_JUSTIFY_METHOD_DISTRIBUTE); long nRemainingSpace = nMaxLineWidth - aTextSize.Width(); - pLine->SetStartPosX( (sal_uInt16)nStartX ); + pLine->SetStartPosX( nStartX ); if ( nRemainingSpace > 0 && (!bEOC || bDistLastLine) ) ImpAdjustBlocks( pParaPortion, pLine, nRemainingSpace ); } break; default: { - pLine->SetStartPosX( (sal_uInt16)nStartX ); // FI, LI + pLine->SetStartPosX( nStartX ); // FI, LI } break; } @@ -1467,7 +1460,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY ) if ( GetTextRanger() ) { if ( nTextXOffset ) - pLine->SetStartPosX( (sal_uInt16) ( pLine->GetStartPosX() + nTextXOffset ) ); + pLine->SetStartPosX( pLine->GetStartPosX() + nTextXOffset ); if ( nTextExtraYOffset ) { pLine->SetHeight( (sal_uInt16) ( pLine->GetHeight() + nTextExtraYOffset ), 0, pLine->GetHeight() ); diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx index 9f538c2a5bd4..6fdefe2f8e47 100644 --- a/editeng/source/items/borderline.cxx +++ b/editeng/source/items/borderline.cxx @@ -120,6 +120,78 @@ SvxBorderLine::SvxBorderLine( const Color *pCol, long nWidth, aColor = *pCol; } + +SvxBorderStyle +ConvertBorderStyleFromWord(int const nWordLineStyle) +{ + switch (nWordLineStyle) + { + // First the single lines + case 1: + case 2: // thick line + case 5: // hairline + // and the unsupported special cases which we map to a single line + case 8: + case 9: + case 20: + return SOLID; + break; + case 6: + return DOTTED; + break; + case 7: + case 22: + return DASHED; + break; + // then the shading beams which we represent by a double line + case 23: + return DOUBLE; + break; + // then the double lines, for which we have good matches + case 3: + case 10: // Don't have triple so use double + case 21: // Don't have double wave: use double instead + return DOUBLE; + break; + case 11: + return THINTHICK_SMALLGAP; + break; + case 12: + case 13: // Don't have thin thick thin, so use thick thin + return THICKTHIN_SMALLGAP; + break; + case 14: + return THINTHICK_MEDIUMGAP; + break; + case 15: + case 16: // Don't have thin thick thin, so use thick thin + return THICKTHIN_MEDIUMGAP; + break; + case 17: + return THINTHICK_LARGEGAP; + break; + case 18: + case 19: // Don't have thin thick thin, so use thick thin + return THICKTHIN_LARGEGAP; + break; + case 24: + return EMBOSSED; + break; + case 25: + return ENGRAVED; + break; + case 26: + return OUTSET; + break; + case 27: + return INSET; + break; + default: + return NONE; + break; + } +} + static const double THINTHICK_SMALLGAP_line2 = 15.0; static const double THINTHICK_SMALLGAP_gap = 15.0; static const double THINTHICK_LARGEGAP_line1 = 30.0; @@ -132,12 +204,27 @@ static const double OUTSET_line1 = 15.0; static const double INSET_line2 = 15.0; double -ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, double const fWidth) +ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, double const fWidth, + int const nWordLineStyle) { switch (eStyle) { // Single lines case SOLID: + switch (nWordLineStyle) + { + case 2: + return (fWidth * 2.0); // thick + break; + case 5: // fdo#55526: map 0 hairline width to > 0 + return (fWidth > 1.0) ? fWidth : 1.0; + break; + default: + return fWidth; + break; + } + break; + case DOTTED: case DASHED: return fWidth; diff --git a/extras/source/autotext/lang/pt-BR/acor_pt-BR.dat b/extras/source/autotext/lang/pt-BR/acor_pt-BR.dat Binary files differindex 8ff201c2c3c7..71c25b0a83af 100644 --- a/extras/source/autotext/lang/pt-BR/acor_pt-BR.dat +++ b/extras/source/autotext/lang/pt-BR/acor_pt-BR.dat diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index bbd63d51d0f4..32d5680442b2 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -208,7 +208,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, if( ( rObj.ImplGetPropertyValue( ::rtl::OUString( "IsFontwork" ) ) && ::cppu::any2bool( rObj.GetUsrAny() ) ) || - rObj.GetType().EqualsAscii( "drawing.Measure" ) || rObj.GetType().EqualsAscii( "drawing.Caption" ) ) + rObj.GetType().EqualsAscii( "drawing.Measure" ) ) { rObj.SetType( String( RTL_CONSTASCII_STRINGPARAM( "drawing.dontknow" ), @@ -614,6 +614,14 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Bitmap" ) ), sal_False ) ) aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 ); } + else if ( rObj.GetType().EqualsAscii( "drawing.Caption" )) + { + rObj.SetAngle( 0 ); + mpEscherEx->OpenContainer( ESCHER_SpContainer ); + ADD_SHAPE( ESCHER_ShpInst_TextBox, 0xa00 ); + if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False ) ) + aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 ); + } else if ( rObj.GetType().EqualsAscii( "drawing.dontknow" )) { rObj.SetAngle( 0 ); diff --git a/hsqldb/patches/jdbc-4.1.patch b/hsqldb/patches/jdbc-4.1.patch index 4c4eb8507773..68180a2c6eb6 100644 --- a/hsqldb/patches/jdbc-4.1.patch +++ b/hsqldb/patches/jdbc-4.1.patch @@ -231,7 +231,7 @@ // boucherb@users 20040411 - doc 1.7.2 - javadoc updates toward 1.7.2 final /** -@@ -323,4 +328,12 @@ +@@ -323,4 +328,15 @@ } //#endif JAVA6 @@ -239,7 +239,10 @@ +//#ifdef JAVA7 + public Logger getParentLogger() throws SQLFeatureNotSupportedException + { -+ throw new SQLFeatureNotSupportedException("Not supported yet."); ++ throw new AbstractMethodError( ++ "org.hsqldb.jdbc.jdbcDataSource.getParentLogger should throw" + ++ " SQLFeatureNotSupportedException, but that is not yet available" + ++ " in Java 5"); + } + +//#endif JAVA7 @@ -299,7 +302,7 @@ // fredt@users 20011220 - patch 1.7.0 by fredt // new version numbering scheme // fredt@users 20020320 - patch 1.7.0 - JDBC 2 support and error trapping -@@ -321,4 +326,12 @@ +@@ -321,4 +326,15 @@ DriverManager.registerDriver(new jdbcDriver()); } catch (Exception e) {} } @@ -307,7 +310,10 @@ +//#ifdef JAVA7 + public Logger getParentLogger() throws SQLFeatureNotSupportedException + { -+ throw new SQLFeatureNotSupportedException("Not supported yet."); ++ throw new AbstractMethodError( ++ "org.hsqldb.jdbcDriver.getParentLogger should throw" + ++ " SQLFeatureNotSupportedException, but that is not yet available" + ++ " in Java 5"); + } + +//#endif JAVA7 diff --git a/i18npool/source/localedata/data/hu_HU.xml b/i18npool/source/localedata/data/hu_HU.xml index dc3be12ad93e..8ad831e9d023 100644 --- a/i18npool/source/localedata/data/hu_HU.xml +++ b/i18npool/source/localedata/data/hu_HU.xml @@ -35,6 +35,8 @@ <MeasurementSystem>metric</MeasurementSystem> </LC_CTYPE> <LC_FORMAT> + <DateAcceptancePattern>M-D</DateAcceptancePattern> + <DateAcceptancePattern>M.D</DateAcceptancePattern> <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0"> <FormatCode>Standard</FormatCode> </FormatElement> diff --git a/jurt/test/com/sun/star/comp/connections/PipedConnection_Test.java b/jurt/test/com/sun/star/comp/connections/PipedConnection_Test.java index affbb8b05dde..d0a444465421 100644 --- a/jurt/test/com/sun/star/comp/connections/PipedConnection_Test.java +++ b/jurt/test/com/sun/star/comp/connections/PipedConnection_Test.java @@ -27,115 +27,82 @@ package com.sun.star.comp.connections; +import com.sun.star.io.IOException; import org.junit.Test; import static org.junit.Assert.*; public final class PipedConnection_Test { + private static final int ROUNDS = 2000; + @Test public void test() throws Exception { PipedConnection rightSide = new PipedConnection(new Object[0]); PipedConnection leftSide = new PipedConnection(new Object[]{rightSide}); - byte theByte[] = new byte[1]; - - Reader reader = new Reader(rightSide, theByte); - Writer writer = new Writer(leftSide, theByte, reader); + Reader reader = new Reader(rightSide); + Writer writer = new Writer(leftSide); reader.start(); writer.start(); - Thread.sleep(2000); - - writer.term(); writer.join(); - reader.join(); assertTrue(writer._state); assertTrue(reader._state); + assertEquals(ROUNDS, reader._rounds); } - static class Reader extends Thread { + private static class Reader extends Thread { PipedConnection _pipedConnection; - byte _theByte[]; - boolean _quit; boolean _state = false; + int _rounds = 0; - Reader(PipedConnection pipedConnection, byte theByte[]) { + Reader(PipedConnection pipedConnection) { _pipedConnection = pipedConnection; - _theByte = theByte; } public void run() { try { - byte bytes[][] = new byte[1][]; - - while(!_quit) { - int read = _pipedConnection.read(bytes, 1); - - if(read == 1) { -// System.err.println("read :" + bytes[0][0]); - - if(_theByte[0] != bytes[0][0]) - throw new NullPointerException(); - - synchronized(this) { - notifyAll(); - } + for (byte v = 0;; v++) { + byte[][] b = new byte[1][]; + int n = _pipedConnection.read(b, 1); + if (n == 0) { + break; } - else - _quit = true; // EOF + assertEquals(1, n); + assertEquals(1, b[0].length); + assertEquals(v, b[0][0]); + ++_rounds; } - _pipedConnection.close(); _state = true; + } catch (IOException e) { + throw new RuntimeException(e); } - catch(com.sun.star.io.IOException ioException) { - System.err.println("#### Reader - unexpected:" + ioException); - } - } } - static class Writer extends Thread { + private static class Writer extends Thread { PipedConnection _pipedConnection; - byte _theByte[]; - Reader _reader; - boolean _quit; boolean _state = false; - Writer(PipedConnection pipedConnection, byte theByte[], Reader reader) { + Writer(PipedConnection pipedConnection) { _pipedConnection = pipedConnection; - _reader = reader; - _theByte = theByte; } public void run() { try { - while(!_quit) { - synchronized(_reader) { - _pipedConnection.write(_theByte); - _pipedConnection.flush(); -// System.err.println("written :" + _theByte[0]); - - _reader.wait(); - } - ++ _theByte[0]; + byte v = 0; + for (int i = 0; i != ROUNDS; ++i) { + byte[] b = new byte[] { v++ }; + _pipedConnection.write(b); + _pipedConnection.flush(); } - _pipedConnection.close(); - _state = true; + } catch (IOException e) { + throw new RuntimeException(e); } - catch(com.sun.star.io.IOException ioException) { - System.err.println("#### Writer:" + ioException); - } - catch(InterruptedException interruptedException) { - System.err.println("#### Writer:" + interruptedException); - } - } - - public void term() { - _quit = true; } } } diff --git a/l10ntools/Library_helplinker.mk b/l10ntools/Library_helplinker.mk index 8cabe50768aa..c5fabe35589a 100644 --- a/l10ntools/Library_helplinker.mk +++ b/l10ntools/Library_helplinker.mk @@ -35,6 +35,12 @@ $(eval $(call gb_Library_add_defs,helplinker,\ -DHELPLINKER_DLLIMPLEMENTATION \ )) +ifeq ($(HAVE_CXX0X),TRUE) +$(eval $(call gb_Library_add_defs,helplinker,\ + -DHAVE_CXX0X \ +)) +endif + $(eval $(call gb_Library_use_libraries,helplinker,\ sal \ )) diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx index 49ebd602501d..df943b44ca25 100644 --- a/l10ntools/source/help/HelpCompiler.hxx +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -30,6 +30,9 @@ #define HELPCOMPILER_HXX #include <string> +#ifndef HAVE_CXX0X +#define BOOST_NO_0X_HDR_TYPEINDEX +#endif #include <boost/unordered_map.hpp> #include <vector> #include <list> diff --git a/libcdr/README b/libcdr/README index d3ba94db6252..9aa5ada714a9 100644 --- a/libcdr/README +++ b/libcdr/README @@ -1,3 +1,3 @@ Library parsing the Corel cdr documents. -I couldn't find an upstream for this library - although I did only try a primitive Google search. +http://wiki.freedesktop.org/wiki/Software/libcdr diff --git a/libcdr/libcdr-0.0.8-msc.patch b/libcdr/libcdr-0.0.8-msc.patch deleted file mode 100644 index 6a44e7dc426b..000000000000 --- a/libcdr/libcdr-0.0.8-msc.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- misc/libcdr-0.0.8/src/lib/libcdr_utils.h 2012-06-06 13:42:03.000000000 +0200 -+++ misc/build/libcdr-0.0.8/src/lib/libcdr_utils.h 2012-06-11 15:09:43.305289500 +0200 -@@ -50,6 +50,7 @@ - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned uint32_t; -+typedef short int16_t; - typedef int int32_t; - typedef unsigned __int64 uint64_t; - diff --git a/libcdr/makefile.mk b/libcdr/makefile.mk index 771ac46b0778..0a8df79319a6 100755 --- a/libcdr/makefile.mk +++ b/libcdr/makefile.mk @@ -59,10 +59,8 @@ INCPRE+=$(LCMS2_CFLAGS) INCPRE+=$(SOLARVER)$/$(INPATH)$/inc$/lcms2 .ENDIF -TARFILE_NAME=libcdr-0.0.8 -TARFILE_MD5=ce5a1def34578b75959ac31210f031f6 - -PATCH_FILES = libcdr-0.0.8-msc.patch +TARFILE_NAME=libcdr-0.0.9 +TARFILE_MD5=3c0037fb07dea2f0bbae8386fa7c6a9a BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS) BUILD_DIR=src$/lib diff --git a/liblangtag/liblangtag-0.2-xmlCleanupParser.patch b/liblangtag/liblangtag-0.2-xmlCleanupParser.patch new file mode 100644 index 000000000000..3617125016c6 --- /dev/null +++ b/liblangtag/liblangtag-0.2-xmlCleanupParser.patch @@ -0,0 +1,20 @@ +--- misc/liblangtag-0.2/liblangtag/lt-xml.c ++++ misc/build/liblangtag-0.2/liblangtag/lt-xml.c +@@ -101,8 +101,6 @@ lt_xml_read_subtag_registry(lt_xml_t *x + if (xmlparser) + xmlFreeParserCtxt(xmlparser); + +- xmlCleanupParser(); +- + if (err) { + if (error) + *error = g_error_copy(err); +@@ -158,8 +156,6 @@ lt_xml_read_cldr_bcp47(lt_xml_t *xml + if (xmlparser) + xmlFreeParserCtxt(xmlparser); + +- xmlCleanupParser(); +- + if (err) { + if (error) + *error = g_error_copy(err); diff --git a/liblangtag/makefile.mk b/liblangtag/makefile.mk index a8efa55b7d12..327269836ca7 100644 --- a/liblangtag/makefile.mk +++ b/liblangtag/makefile.mk @@ -37,6 +37,7 @@ PATCH_FILES=liblangtag-0.2-0001-Fix-a-memory-leak.patch PATCH_FILES+=liblangtag-0.2-0002-Fix-invalid-memory-access.patch PATCH_FILES+=liblangtag-0.2-configure.patch PATCH_FILES+=liblangtag-0.2-datadir.patch +PATCH_FILES+=liblangtag-0.2-xmlCleanupParser.patch CONFIGURE_DIR=. BUILD_DIR=$(CONFIGURE_DIR) @@ -72,6 +73,14 @@ CONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) .$/configure BUILD_ACTION=$(AUGMENT_LIBRARY_PATH) $(GNUMAKE) -j$(EXTMAXPROCESS) && \ $(AUGMENT_LIBRARY_PATH) $(GNUMAKE) install +.IF "$(SYSTEM_LIBXML)"!="YES" || "$(SYSTEM_GLIB)"!="YES" +.IF "$(OS)"=="FREEBSD" || "$(OS)"=="LINUX" +CONFIGURE_FLAGS+= \ + LDFLAGS=-Wl,-z,origin\ -Wl,-rpath,\'\$$\$$ORIGIN:\$$\$$ORIGIN/../ure-link/lib\' +.ELIF "$(OS)"=="SOLARIS" +CONFIGURE_FLAGS+= LDFLAGS=-Wl,-R\'\$$\$$ORIGIN:\$$\$$ORIGIN/../ure-link/lib\' +.END +.END .IF "$(GUI)"=="WNT" .IF "$(COM)"=="GCC" diff --git a/mdds/0001-Workaround-for-gcc-bug.patch b/mdds/0001-Workaround-for-gcc-bug.patch new file mode 100644 index 000000000000..4205ea54f99c --- /dev/null +++ b/mdds/0001-Workaround-for-gcc-bug.patch @@ -0,0 +1,27 @@ +From e1c795c8734119985ea09bf4d9f860d11e440b2a Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida <kohei.yoshida@gmail.com> +Date: Mon, 30 Jul 2012 14:36:24 -0400 +Subject: [PATCH] Workaround for gcc bug. + +c.f. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44963 +--- + include/mdds/multi_type_vector_types.hpp | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/include/mdds/multi_type_vector_types.hpp b/include/mdds/multi_type_vector_types.hpp +index 78f18cb..6189139 100644 +--- a/include/mdds/multi_type_vector_types.hpp ++++ misc/build/mdds_0.6.1/include/mdds/multi_type_vector_types.hpp +@@ -218,7 +218,8 @@ public: + typename store_type::const_iterator it_end = it; + std::advance(it_end, len); + d.reserve(d.size() + len); +- std::copy(it, it_end, std::back_inserter(d)); ++ for (; it != it_end; ++it) ++ d.push_back(*it); + } + + static void assign_values_from_block( +-- +1.7.7 + diff --git a/mdds/makefile.mk b/mdds/makefile.mk index b759886d66bc..7338e0abef95 100644 --- a/mdds/makefile.mk +++ b/mdds/makefile.mk @@ -36,9 +36,11 @@ TARGET=mdds # --- Files -------------------------------------------------------- -TARFILE_NAME=mdds_0.5.3 -TARFILE_MD5=0ff7d225d087793c8c2c680d77aac3e7 -PATCH_FILES=mdds_0.5.3.patch +TARFILE_NAME=mdds_0.6.1 +TARFILE_MD5=9f9e15966b5624834157fe3d748312bc + +PATCH_FILES=mdds_0.6.0.patch \ + 0001-Workaround-for-gcc-bug.patch CONFIGURE_DIR= CONFIGURE_ACTION= diff --git a/mdds/mdds_0.5.3.patch b/mdds/mdds_0.6.0.patch index 40aedb17d59a..d1d997c107d9 100644 --- a/mdds/mdds_0.5.3.patch +++ b/mdds/mdds_0.6.0.patch @@ -1,13 +1,5 @@ ---- misc/mdds_0.5.3/include/mdds/mixed_type_matrix_def.inl 2011-07-13 13:26:27.000000000 -0600 -+++ misc/build/mdds_0.5.3/include/mdds/mixed_type_matrix_def.inl 2011-07-20 02:02:21.164198900 -0600 -@@ -44,7 +44,6 @@ - default: - throw matrix_error("unknown density type"); - } -- return NULL; - } - - template<typename _String, typename _Flag> +--- misc/mdds_0.6.1/include/mdds/mixed_type_matrix_def.inl 2011-07-13 13:26:27.000000000 -0600 ++++ misc/build/mdds_0.6.1/include/mdds/mixed_type_matrix_def.inl 2011-07-20 02:02:21.164198900 -0600 @@ -216,8 +216,8 @@ // assignment to self. return; @@ -19,8 +11,8 @@ for (size_t i = 0; i < row_count; ++i) for (size_t j = 0; j < col_count; ++j) mp_storage->get_element(i, j) = r.mp_storage->get_element(i, j); ---- misc/mdds_0.5.3/include/mdds/mixed_type_matrix_storage_filled_linear.inl 2011-07-13 13:26:27.000000000 -0600 -+++ misc/build/mdds_0.5.3/include/mdds/mixed_type_matrix_storage_filled_linear.inl 2011-07-20 02:02:21.179798900 -0600 +--- misc/mdds_0.6.1/include/mdds/mixed_type_matrix_storage_filled_linear.inl 2011-07-13 13:26:27.000000000 -0600 ++++ misc/build/mdds_0.6.1/include/mdds/mixed_type_matrix_storage_filled_linear.inl 2011-07-20 02:02:21.179798900 -0600 @@ -354,8 +354,8 @@ } @@ -43,8 +35,8 @@ for (size_t i = 0; i < min_rows; ++i) { for (size_t j = 0; j < min_cols; ++j) ---- misc/mdds_0.5.3/include/mdds/point_quad_tree.hpp 2011-07-13 13:26:27.000000000 -0600 -+++ misc/build/mdds_0.5.3/include/mdds/point_quad_tree.hpp 2011-07-20 02:04:36.088835900 -0600 +--- misc/mdds_0.6.1/include/mdds/point_quad_tree.hpp 2011-07-13 13:26:27.000000000 -0600 ++++ misc/build/mdds_0.6.1/include/mdds/point_quad_tree.hpp 2011-07-20 02:04:36.088835900 -0600 @@ -623,10 +623,10 @@ template<typename _Key, typename _Data> void point_quad_tree<_Key,_Data>::insert(key_type x, key_type y, data_type data) diff --git a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu index a51ff5b244c8..715802585593 100644 --- a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu @@ -22,6 +22,8 @@ 4098 19545 -2132340659 0 6 13 3265 0 <!-- ATI Mobility 128 AGP 2X - blank screen --> 4098 19526 11604008 2 5 10 0 1028 + <!-- CPU-integrated HD4000 Graphic - busted max texture size - fdo#54417 --> + 32902 354 -2067132349 9 9 17 10 2828 </value> </prop> </node> diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index 0f5898ea19e9..55ee57a88715 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -340,7 +340,7 @@ </info> <value>false</value> </prop> - <prop oor:name="SimpleControlPoint" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="SimpleControlPoint" oor:type="xs:boolean"> <!-- OldPath: Calc/Layout/Lines --> <!-- OldLocation: Soffice.cfg --> <!-- UIHints: Tools - Options -Spreadsheets - Layout - [Section] Lines --> @@ -351,7 +351,7 @@ </info> <value>false</value> </prop> - <prop oor:name="LargeControlPoint" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="LargeControlPoint" oor:type="xs:boolean"> <!-- OldPath: Calc/Layout/Lines --> <!-- OldLocation: Soffice.cfg --> <!-- UIHints: Tools - Options -Spreadsheets - Layout - [Section] Lines --> diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index e79798885a83..8865f7401710 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -1306,7 +1306,7 @@ </info> <value>false</value> </prop> - <prop oor:name="SimpleControlPoint" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="SimpleControlPoint" oor:type="xs:boolean"> <!-- OldPath: Writer/Layout/Lines --> <!-- OldLocation: Soffice.cfg --> <!-- UIHints: Tools - Options - Text document - Layout - [Section] Lines --> @@ -1317,7 +1317,7 @@ </info> <value>false</value> </prop> - <prop oor:name="LargeControlPoint" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="LargeControlPoint" oor:type="xs:boolean"> <!-- OldPath: Writer/Layout/Lines --> <!-- OldLocation: Soffice.cfg --> <!-- UIHints: Tools - Options - Text document - Layout - [Section] Lines --> diff --git a/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs b/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs index 79f581a42928..6b998699903d 100644 --- a/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs @@ -210,7 +210,7 @@ </info> <value>false</value> </prop> - <prop oor:name="SimpleControlPoint" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="SimpleControlPoint" oor:type="xs:boolean"> <!-- OldPath: HTML_Editor/Layout/Lines --> <!-- OldLocation: Soffice.cfg --> <!-- UIHints: Tools - Option - HTML-Document - Layout - [Section] Lines --> @@ -221,7 +221,7 @@ </info> <value>false</value> </prop> - <prop oor:name="LargeControlPoint" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="LargeControlPoint" oor:type="xs:boolean"> <!-- OldPath: HTML_Editor/Layout/Lines --> <!-- OldLocation: Soffice.cfg --> <!-- UIHints: Tools - Option - HTML-Document - Layout - [Section] Lines --> diff --git a/ooo.lst.in b/ooo.lst.in index 9a8bf7464b4e..02d14b0dabaa 100644 --- a/ooo.lst.in +++ b/ooo.lst.in @@ -83,14 +83,14 @@ a0a861f539f0e7a91d05e6b9457e4db1-nss-3.13.5-with-nspr-4.9.1.tar.gz 9d283e02441d8cebdcd1e5d9df227d67-libwpg-0.2.1.tar.bz2 c01351d7db2b205de755d58769288224-libwpd-0.9.4.tar.bz2 d197bd6211669a2fa4ca648faf04bcb1-libwps-0.2.7.tar.bz2 -0ff7d225d087793c8c2c680d77aac3e7-mdds_0.5.3.tar.bz2 +9f9e15966b5624834157fe3d748312bc-mdds_0.6.1.tar.bz2 f02578f5218f217a9f20e9c30e119c6a-boost_1_44_0.tar.bz2 3121aaf3e13e5d88dfff13fb4a5f1ab8-hunspell-1.3.2.tar.gz 3bf481ca95109b14435125c0dd1f2217-graphite2-1.0.3.tgz 94e7f271e38c976462558b4278590178-libvisio-0.0.19.tar.bz2 e7a384790b13c29113e22e596ade9687-LinLibertineG-20120116.zip 0d2dcdfbf28d6208751b33057f5361f0-libcmis-0.2.3.tar.gz -ce5a1def34578b75959ac31210f031f6-libcdr-0.0.8.tar.bz2 +3c0037fb07dea2f0bbae8386fa7c6a9a-libcdr-0.0.9.tar.bz2 327348d67c979c88c2dec59a23a17d85-lcms2-2.3.tar.gz @GOOGLE_DOCS_EXTENSION_PACK@ @FREETYPE_TARBALL@ diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 62933fe16850..0345a33f6877 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -534,7 +534,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect } if ( rProps.GetOpt( ESCHER_Prop_fillColor, nValue ) ) - impl_AddColor( pAttrList, XML_color, nValue ); + impl_AddColor( m_pShapeAttrList, XML_fillcolor, nValue ); if ( rProps.GetOpt( ESCHER_Prop_fillBackColor, nValue ) ) impl_AddColor( pAttrList, XML_color2, nValue ); @@ -666,7 +666,34 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect break; case ESCHER_Prop_fHidden: - m_pShapeStyle->append( ";visibility:hidden" ); + if ( !it->nPropValue ) + m_pShapeStyle->append( ";visibility:hidden" ); + break; + case ESCHER_Prop_shadowColor: + case ESCHER_Prop_fshadowObscured: + { + sal_uInt32 nValue = 0; + bool bShadow = false; + bool bObscured = false; + if ( rProps.GetOpt( ESCHER_Prop_fshadowObscured, nValue ) ) + { + bShadow = (( nValue & 0x20002 ) == 0x20002 ); + bObscured = (( nValue & 0x10001 ) == 0x10001 ); + } + if ( bShadow ) + { + sax_fastparser::FastAttributeList *pAttrList = m_pSerializer->createAttrList(); + impl_AddBool( pAttrList, XML_on, bShadow ); + impl_AddBool( pAttrList, XML_obscured, bObscured ); + + if ( rProps.GetOpt( ESCHER_Prop_shadowColor, nValue ) ) + impl_AddColor( pAttrList, XML_color, nValue ); + + m_pSerializer->singleElementNS( XML_v, XML_shadow, XFastAttributeListRef( pAttrList ) ); + bAlreadyWritten[ ESCHER_Prop_fshadowObscured ] = true; + bAlreadyWritten[ ESCHER_Prop_shadowColor ] = true; + } + } break; default: #if OSL_DEBUG_LEVEL > 0 diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index 56ee7fa5e427..0cf2998d4b82 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -598,9 +598,6 @@ PyRef Runtime::any2PyObject (const Any &a ) const throw RuntimeException(buf.makeStringAndClear( ), Reference< XInterface > () ); } } - //We shouldn't be here... - Py_INCREF( Py_None ); - return Py_None; } static Sequence< Type > invokeGetTypes( const Runtime & r , PyObject * o ) diff --git a/sal/inc/osl/diagnose.hxx b/sal/inc/osl/diagnose.hxx index 6463d8dcca5d..18dc0fe10bd1 100644 --- a/sal/inc/osl/diagnose.hxx +++ b/sal/inc/osl/diagnose.hxx @@ -33,6 +33,9 @@ #include <functional> #include <typeinfo> +#ifndef HAVE_CXX0X +#define BOOST_NO_0X_HDR_TYPEINDEX +#endif #include "boost/unordered_set.hpp" #include "osl/diagnose.h" #include "osl/interlck.h" diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index 4e76b7410303..e70f3ac29f25 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -320,12 +320,9 @@ public: @since LibreOffice 3.4 */ - sal_Bool isEmpty() const SAL_THROW(()) + bool isEmpty() const SAL_THROW(()) { - if ( pData->length ) - return sal_False; - else - return sal_True; + return pData->length == 0; } /** diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index f3d224ecdb0f..5962752c7af2 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -405,12 +405,9 @@ public: @since LibreOffice 3.4 */ - sal_Bool isEmpty() const SAL_THROW(()) + bool isEmpty() const SAL_THROW(()) { - if ( pData->length ) - return sal_False; - else - return sal_True; + return pData->length == 0; } /** diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx index 68b1029edc5d..4be73d312190 100644 --- a/sc/inc/dpcache.hxx +++ b/sc/inc/dpcache.hxx @@ -121,6 +121,7 @@ private: LabelsType maLabelNames; // Stores dimension names. mdds::flat_segment_tree<SCROW, bool> maEmptyRows; + SCROW mnDataSize; bool mbDisposing; @@ -150,8 +151,9 @@ public: bool InitFromDoc(ScDocument* pDoc, const ScRange& rRange); bool InitFromDataBase(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& xRowSet, const Date& rNullDate); - SCROW GetRowCount() const; - SCROW GetItemDataId( sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty ) const; + SCROW GetRowCount() const; + SCROW GetDataSize() const; + SCROW GetItemDataId( sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty ) const; rtl::OUString GetDimensionName(LabelsType::size_type nDim) const; bool IsRowEmpty(SCROW nRow) const; bool ValidQuery(SCROW nRow, const ScQueryParam& rQueryParam) const; diff --git a/sc/inc/dpcachetable.hxx b/sc/inc/dpcachetable.hxx index d83491089d16..c55ec2605438 100644 --- a/sc/inc/dpcachetable.hxx +++ b/sc/inc/dpcachetable.hxx @@ -37,18 +37,9 @@ #include <vector> #include <boost/unordered_set.hpp> #include <boost/shared_ptr.hpp> -#include <com/sun/star/uno/Reference.hxx> - -namespace com { namespace sun { namespace star { - namespace sdbc { - class XRowSet; - } - namespace sheet { - struct DataPilotFieldFilter; - } -}}} - -class Date; + +#include <mdds/flat_segment_tree.hpp> + class ScDPItemData; class ScDPCache; class ScDocument; @@ -64,15 +55,7 @@ struct ScQueryParam; */ class SC_DLLPUBLIC ScDPCacheTable { - struct RowFlag - { - bool mbShowByFilter:1; - bool mbShowByPage:1; - bool isActive() const; - RowFlag(); - }; public: - /** interface class used for filtering of rows. */ class FilterBase { @@ -142,7 +125,7 @@ public: /** Check whether a specified row is active or not. When a row is active, it is used in calculation of the results data. A row becomes inactive when it is filtered out by page field. */ - bool isRowActive(sal_Int32 nRow) const; + bool isRowActive(sal_Int32 nRow, sal_Int32* pLastRow = NULL) const; /** Set filter on/off flag to each row to control visibility. The caller must ensure that the table is filled before calling this function. */ @@ -185,11 +168,15 @@ private: bool isRowQualified(sal_Int32 nRow, const ::std::vector<Criterion>& rCriteria, const ::boost::unordered_set<sal_Int32>& rRepeatIfEmptyDims) const; private: + typedef mdds::flat_segment_tree<SCROW, bool> RowFlagType; + /** unique field entires for each field (column). */ ::std::vector< ::std::vector<SCROW> > maFieldEntries; - /** Row flags. The first row below the header row has the index of 0. */ - ::std::vector<RowFlag> maRowFlags; + /** Rows visible by standard filter query. */ + RowFlagType maShowByFilter; + /** Rows visible by page dimension filtering. */ + RowFlagType maShowByPage; const ScDPCache* mpCache; }; diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 272b4592a9a8..f591f1253c7d 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -53,6 +53,10 @@ namespace com { namespace sun { namespace star { class XIndexAccess; } + namespace sdbc { + class XRowSet; + } + namespace sheet { struct DataPilotTablePositionData; struct DataPilotTableHeaderData; diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx index 74bb7be1d99a..8bf3bed47266 100644 --- a/sc/inc/rangelst.hxx +++ b/sc/inc/rangelst.hxx @@ -81,6 +81,7 @@ public: bool Intersects( const ScRange& ) const; bool In( const ScRange& ) const; size_t GetCellCount() const; + ScAddress GetTopLeftCorner() const; ScRange* Remove(size_t nPos); void RemoveAll(); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index c28249a6d827..03f7b5421ac9 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1131,7 +1131,8 @@ bool ScColumn::IsEmptyVisData() const SCSIZE i; for (i=0; i<maItems.size() && !bVisData; i++) { - bVisData = true; + if(!maItems[i].pCell->IsBlank()) + bVisData = true; } return !bVisData; } @@ -1165,8 +1166,11 @@ SCROW ScColumn::GetLastVisDataPos() const for (i=maItems.size(); i>0 && !bFound; ) { --i; - bFound = true; - nRet = maItems[i].nRow; + if(!maItems[i].pCell->IsBlank()) + { + bFound = true; + nRet = maItems[i].nRow; + } } } return nRet; diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 48d77dc6f5fc..475299da6293 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1501,6 +1501,10 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, std::vector<ScTy } break; + // skip broadcaster cells + case CELLTYPE_NOTE: + continue; + default: ; } diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 9561d64d1e62..ea6657addea2 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -66,7 +66,6 @@ bool ScFormatEntry::operator==( const ScFormatEntry& r ) const { case condformat::CONDITION: return static_cast<const ScCondFormatEntry&>(*this) == static_cast<const ScCondFormatEntry&>(r); - break; default: // TODO: implement also this case // actually return false for these cases is not that bad @@ -74,8 +73,6 @@ bool ScFormatEntry::operator==( const ScFormatEntry& r ) const // to think about the range return false; } - - return true; } bool lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, sal_uInt16 nRecursion = 0 ) diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index f1e45318cb7e..c754fba1549d 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -73,6 +73,7 @@ ScDPCache::ScDPCache(ScDocument* pDoc) : mpDoc( pDoc ), mnColumnCount ( 0 ), maEmptyRows(0, MAXROW, true), + mnDataSize(-1), mbDisposing(false) { } @@ -751,7 +752,21 @@ public: void ScDPCache::PostInit() { + OSL_ENSURE(!maFields.empty(), "Cache not initialized!"); + maEmptyRows.build_tree(); + typedef mdds::flat_segment_tree<SCROW, bool>::const_reverse_iterator itr_type; + itr_type it = maEmptyRows.rbegin(), itEnd = maEmptyRows.rend(); + OSL_ENSURE(it != itEnd, "corrupt flat_segment_tree instance!"); + mnDataSize = maFields[0].maData.size(); + ++it; // Skip the first position. + OSL_ENSURE(it != itEnd, "buggy version of flat_segment_tree is used."); + if (it->second) + { + SCROW nLastNonEmpty = it->first - 1; + if (nLastNonEmpty+1 < mnDataSize) + mnDataSize = nLastNonEmpty+1; + } } void ScDPCache::Clear() @@ -850,6 +865,12 @@ SCROW ScDPCache::GetRowCount() const return maFields[0].maData.size(); } +SCROW ScDPCache::GetDataSize() const +{ + OSL_ENSURE(mnDataSize <= GetRowCount(), "Data size should never be larger than the row count."); + return mnDataSize >= 0 ? mnDataSize : 0; +} + const ScDPCache::ItemsType& ScDPCache::GetDimMemberValues(SCCOL nDim) const { OSL_ENSURE( nDim>=0 && nDim < mnColumnCount ," nDim < mnColumnCount "); diff --git a/sc/source/core/data/dpcachetable.cxx b/sc/source/core/data/dpcachetable.cxx index dc7a63a8b637..14f4e8e2e48e 100644 --- a/sc/source/core/data/dpcachetable.cxx +++ b/sc/source/core/data/dpcachetable.cxx @@ -64,17 +64,6 @@ using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::sheet::DataPilotFieldFilter; -bool ScDPCacheTable::RowFlag::isActive() const -{ - return mbShowByFilter && mbShowByPage; -} - -ScDPCacheTable::RowFlag::RowFlag() : - mbShowByFilter(true), - mbShowByPage(true) -{ -} - ScDPCacheTable::SingleFilter::SingleFilter(const ScDPItemData& rItem) : maItem(rItem) {} @@ -125,7 +114,7 @@ ScDPCacheTable::Criterion::Criterion() : // ---------------------------------------------------------------------------- ScDPCacheTable::ScDPCacheTable(const ScDPCache* pCache) : - mpCache(pCache) + maShowByFilter(0, MAXROW+1, false), maShowByPage(0, MAXROW+1, true), mpCache(pCache) { } @@ -146,124 +135,145 @@ sal_Int32 ScDPCacheTable::getColSize() const void ScDPCacheTable::fillTable( const ScQueryParam& rQuery, bool bIgnoreEmptyRows, bool bRepeatIfEmpty) { - const SCROW nRowCount = getRowSize(); - const SCCOL nColCount = (SCCOL) getColSize(); - if ( nRowCount <= 0 || nColCount <= 0) + SCROW nRowCount = getRowSize(); + SCROW nDataSize = mpCache->GetDataSize(); + SCCOL nColCount = getColSize(); + if (nRowCount <= 0 || nColCount <= 0) return; - maRowFlags.clear(); - maRowFlags.reserve(nRowCount); + maShowByFilter.clear(); + maShowByPage.clear(); - // Initialize field entries container. - maFieldEntries.clear(); - maFieldEntries.reserve(nColCount); - - // Data rows - for (SCCOL nCol = 0; nCol < nColCount; ++nCol) + // Process the non-empty data rows. + for (SCROW nRow = 0; nRow < nDataSize; ++nRow) { - maFieldEntries.push_back( vector<SCROW>() ); - SCROW nMemCount = getCache()->GetDimMemberCount( nCol ); - if ( nMemCount ) - { - std::vector<SCROW> aAdded( nMemCount, -1 ); - - for (SCROW nRow = 0; nRow < nRowCount; ++nRow ) - { - SCROW nIndex = getCache()->GetItemDataId( nCol, nRow, bRepeatIfEmpty ); - SCROW nOrder = getOrder( nCol, nIndex ); - - if ( nCol == 0 ) - { - maRowFlags.push_back(RowFlag()); - maRowFlags.back().mbShowByFilter = false; - } - - if (!getCache()->ValidQuery(nRow, rQuery)) - continue; - - if ( bIgnoreEmptyRows && getCache()->IsRowEmpty( nRow ) ) - continue; + if (!getCache()->ValidQuery(nRow, rQuery)) + continue; - if ( nCol == 0 ) - maRowFlags.back().mbShowByFilter = true; + if (bIgnoreEmptyRows && getCache()->IsRowEmpty(nRow)) + continue; - aAdded[nOrder] = nIndex; - } - for ( SCROW nRow = 0; nRow < nMemCount; nRow++ ) - { - if ( aAdded[nRow] != -1 ) - maFieldEntries.back().push_back( aAdded[nRow] ); - } - } + maShowByFilter.insert_back(nRow, nRow+1, true); } -} -void ScDPCacheTable::fillTable() -{ - const SCROW nRowCount = getRowSize(); - const SCCOL nColCount = (SCCOL) getColSize(); - if ( nRowCount <= 0 || nColCount <= 0) - return; - - maRowFlags.clear(); - maRowFlags.reserve(nRowCount); + // Process the trailing empty rows. + if (!bIgnoreEmptyRows) + maShowByFilter.insert_back(nDataSize, nRowCount, true); + maShowByFilter.build_tree(); // Initialize field entries container. maFieldEntries.clear(); maFieldEntries.reserve(nColCount); - // Data rows + // Build unique field entries. for (SCCOL nCol = 0; nCol < nColCount; ++nCol) { maFieldEntries.push_back( vector<SCROW>() ); SCROW nMemCount = getCache()->GetDimMemberCount( nCol ); - if ( nMemCount ) - { - std::vector< SCROW > pAdded( nMemCount, -1 ); + if (!nMemCount) + continue; - for (SCROW nRow = 0; nRow < nRowCount; ++nRow ) + std::vector<SCROW> aAdded(nMemCount, -1); + bool bShow = false; + SCROW nEndSegment = -1; + for (SCROW nRow = 0; nRow < nRowCount; ++nRow) + { + if (nRow > nEndSegment) { - SCROW nIndex = getCache()->GetItemDataId( nCol, nRow, false ); - SCROW nOrder = getOrder( nCol, nIndex ); - - if ( nCol == 0 ) + if (!maShowByFilter.search_tree(nRow, bShow, NULL, &nEndSegment)) { - maRowFlags.push_back(RowFlag()); - maRowFlags.back().mbShowByFilter = true; + OSL_FAIL("Tree search failed!"); + continue; } - - pAdded[nOrder] = nIndex; + --nEndSegment; // End position is not inclusive. Move back one. } - for ( SCROW nRow = 0; nRow < nMemCount; nRow++ ) + + if (!bShow) { - if ( pAdded[nRow] != -1 ) - maFieldEntries.back().push_back( pAdded[nRow] ); + nRow = nEndSegment; + continue; } + + SCROW nIndex = getCache()->GetItemDataId(nCol, nRow, bRepeatIfEmpty); + SCROW nOrder = getOrder(nCol, nIndex); + aAdded[nOrder] = nIndex; + } + for (SCROW nRow = 0; nRow < nMemCount; ++nRow) + { + if (aAdded[nRow] != -1) + maFieldEntries.back().push_back(aAdded[nRow]); } } } -bool ScDPCacheTable::isRowActive(sal_Int32 nRow) const +void ScDPCacheTable::fillTable() { - if (nRow < 0 || static_cast<size_t>(nRow) >= maRowFlags.size()) - // row index out of bound - return false; + SCROW nRowCount = getRowSize(); + SCCOL nColCount = getColSize(); + if (nRowCount <= 0 || nColCount <= 0) + return; + + maShowByFilter.clear(); + maShowByPage.clear(); + maShowByFilter.insert_front(0, nRowCount, true); + + // Initialize field entries container. + maFieldEntries.clear(); + maFieldEntries.reserve(nColCount); + + // Data rows + for (SCCOL nCol = 0; nCol < nColCount; ++nCol) + { + maFieldEntries.push_back( vector<SCROW>() ); + SCROW nMemCount = getCache()->GetDimMemberCount( nCol ); + if (!nMemCount) + continue; + + std::vector<SCROW> aAdded(nMemCount, -1); + + for (SCROW nRow = 0; nRow < nRowCount; ++nRow) + { + SCROW nIndex = getCache()->GetItemDataId(nCol, nRow, false); + SCROW nOrder = getOrder(nCol, nIndex); + aAdded[nOrder] = nIndex; + } + for (SCROW nRow = 0; nRow < nMemCount; ++nRow) + { + if (aAdded[nRow] != -1) + maFieldEntries.back().push_back(aAdded[nRow]); + } + } +} + +bool ScDPCacheTable::isRowActive(sal_Int32 nRow, sal_Int32* pLastRow) const +{ + bool bFilter = false, bPage = true; + SCROW nLastRowFilter = MAXROW, nLastRowPage = MAXROW; + maShowByFilter.search_tree(nRow, bFilter, NULL, &nLastRowFilter); + maShowByPage.search_tree(nRow, bPage, NULL, &nLastRowPage); + if (pLastRow) + { + // Return the last row of current segment. + *pLastRow = nLastRowFilter < nLastRowPage ? nLastRowFilter : nLastRowPage; + *pLastRow -= 1; // End position is not inclusive. Move back one. + } - return maRowFlags[nRow].isActive(); + return bFilter && bPage; } void ScDPCacheTable::filterByPageDimension(const vector<Criterion>& rCriteria, const boost::unordered_set<sal_Int32>& rRepeatIfEmptyDims) { - sal_Int32 nRowSize = getRowSize(); - if (nRowSize != static_cast<sal_Int32>(maRowFlags.size())) + SCROW nRowSize = getRowSize(); + + maShowByPage.clear(); + for (SCROW nRow = 0; nRow < nRowSize; ++nRow) { - // sizes of the two tables differ! - return; + bool bShow = isRowQualified(nRow, rCriteria, rRepeatIfEmptyDims); + maShowByPage.insert_back(nRow, nRow+1, bShow); } - for (sal_Int32 nRow = 0; nRow < nRowSize; ++nRow) - maRowFlags[nRow].mbShowByPage = isRowQualified(nRow, rCriteria, rRepeatIfEmptyDims); + maShowByPage.build_tree(); } const ScDPItemData* ScDPCacheTable::getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const @@ -333,12 +343,15 @@ void ScDPCacheTable::filterTable(const vector<Criterion>& rCriteria, Sequence< S } tableData.push_back(headerRow); - for (sal_Int32 nRow = 0; nRow < nRowSize; ++nRow) { - if (!maRowFlags[nRow].isActive()) + sal_Int32 nLastRow; + if (!isRowActive(nRow, &nLastRow)) + { // This row is filtered out. + nRow = nLastRow; continue; + } if (!isRowQualified(nRow, rCriteria, rRepeatIfEmptyDims)) continue; @@ -378,7 +391,8 @@ SCROW ScDPCacheTable::getOrder(long nDim, SCROW nIndex) const void ScDPCacheTable::clear() { maFieldEntries.clear(); - maRowFlags.clear(); + maShowByFilter.clear(); + maShowByPage.clear(); } bool ScDPCacheTable::empty() const diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index 91e9ccee3c8d..ea04b7c32fd8 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -767,8 +767,12 @@ void ScDPGroupTableData::CalcResults(CalcInfo& rInfo, bool bAutoShow) sal_Int32 nRowSize = rCacheTable.getRowSize(); for (sal_Int32 nRow = 0; nRow < nRowSize; ++nRow) { - if (!rCacheTable.isRowActive(nRow)) + sal_Int32 nLastRow; + if (!rCacheTable.isRowActive(nRow, &nLastRow)) + { + nRow = nLastRow; continue; + } CalcRowData aData; FillRowDataFromCacheTable(nRow, rCacheTable, rInfo, aData); diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx index a2566bec5d2e..060090876b97 100644 --- a/sc/source/core/data/dptabdat.cxx +++ b/sc/source/core/data/dptabdat.cxx @@ -226,8 +226,12 @@ void ScDPTableData::CalcResultsFromCacheTable(const ScDPCacheTable& rCacheTable, sal_Int32 nRowSize = rCacheTable.getRowSize(); for (sal_Int32 nRow = 0; nRow < nRowSize; ++nRow) { - if (!rCacheTable.isRowActive(nRow)) + sal_Int32 nLastRow; + if (!rCacheTable.isRowActive(nRow, &nLastRow)) + { + nRow = nLastRow; continue; + } CalcRowData aData; FillRowDataFromCacheTable(nRow, rCacheTable, rInfo, aData); diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 4230cbd764a5..cd193c142009 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -267,8 +267,13 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (nRow >= nStartRow) { - aNotes.insert(nCol, nRow - nSize, pPostIt); - maNotes.ReleaseNote(nCol, nRow); + if(nRow - nStartRow > static_cast<SCROW>(nSize)) + { + aNotes.insert(nCol, nRow - nSize, pPostIt); + maNotes.ReleaseNote(nCol, nRow); + } + else + maNotes.erase(nCol, nRow); } } @@ -486,8 +491,13 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE if (nCol >= nStartCol) { - aNotes.insert(nCol - nSize, nRow, pPostIt); - maNotes.ReleaseNote(nCol, nRow); + if(nCol - nStartCol > static_cast<SCCOL>(nSize)) + { + aNotes.insert(nCol - nSize, nRow, pPostIt); + maNotes.ReleaseNote(nCol, nRow); + } + else + maNotes.erase(nCol, nRow); } } diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 15087c551f72..7be749ed91e9 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -386,10 +386,14 @@ short ScTable::CompareCell( sal_uInt16 nSort, if (pCell1) { eType1 = pCell1->GetCellType(); + if (eType1 == CELLTYPE_NOTE) + pCell1 = NULL; } if (pCell2) { eType2 = pCell2->GetCellType(); + if (eType2 == CELLTYPE_NOTE) + pCell2 = NULL; } if (pCell1) diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index bb5475cb725d..a6e6364e126b 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -455,7 +455,9 @@ bool ScDBData::HasQueryParam() const bool ScDBData::HasSortParam() const { - return mpSortParam && mpSortParam->maKeyState[0].bDoSort; + return mpSortParam && + !mpSortParam->maKeyState.empty() && + mpSortParam->maKeyState[0].bDoSort; } bool ScDBData::HasSubTotalParam() const diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index 8214c507e958..e99e47fc1779 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -438,6 +438,9 @@ bool ScRangeList::UpdateReference( } } + if(maRanges.empty()) + return true; + vector<ScRange*>::iterator itr = maRanges.begin(), itrEnd = maRanges.end(); for (; itr != itrEnd; ++itr) { @@ -460,6 +463,16 @@ bool ScRangeList::UpdateReference( pR->aEnd.Set( theCol2, theRow2, theTab2 ); } } + + if(eUpdateRefMode == URM_INSDEL) + { + if(nDx < 0 || nDy < 0) + { + size_t n = maRanges.size(); + Join(*maRanges[n-1], true); + } + } + return bChanged; } @@ -1135,6 +1148,21 @@ void ScRangeList::push_back(ScRange* p) maRanges.push_back(p); } +ScAddress ScRangeList::GetTopLeftCorner() const +{ + if(empty()) + return ScAddress(); + + ScAddress aAddr = maRanges[0]->aStart; + for(size_t i = 1, n = size(); i < n; ++i) + { + if(maRanges[i]->aStart < aAddr) + aAddr = maRanges[i]->aStart; + } + + return aAddr; +} + // === ScRangePairList ======================================================== ScRangePairList::~ScRangePairList() diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index d611077744fb..08a32d65c4c4 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1483,6 +1483,7 @@ XclExpColinfo::XclExpColinfo( const XclExpRoot& rRoot, XclExpRecord( EXC_ID_COLINFO, 12 ), XclExpRoot( rRoot ), mnWidth( 0 ), + mnScWidth( 0 ), mnFlags( 0 ), mnFirstXclCol( static_cast< sal_uInt16 >( nScCol ) ), mnLastXclCol( static_cast< sal_uInt16 >( nScCol ) ) @@ -1497,7 +1498,7 @@ XclExpColinfo::XclExpColinfo( const XclExpRoot& rRoot, // column width sal_uInt16 nScWidth = rDoc.GetColWidth( nScCol, nScTab ); mnWidth = XclTools::GetXclColumnWidth( nScWidth, GetCharWidth() ); - + mnScWidth = sc::TwipsToHMM( nScWidth ); // column flags ::set_flag( mnFlags, EXC_COLINFO_HIDDEN, rDoc.ColHidden(nScCol, nScTab) ); @@ -1563,7 +1564,7 @@ void XclExpColinfo::SaveXml( XclExpXmlStream& rStrm ) // OOXTODO: XML_outlineLevel, // OOXTODO: XML_phonetic, XML_style, lcl_GetStyleId( rStrm, maXFId.mnXFIndex ).getStr(), - XML_width, OString::valueOf( (double) (mnWidth / 255.0) ).getStr(), + XML_width, OString::valueOf( (double) (mnScWidth / (double)sc::TwipsToHMM( GetCharWidth() )) ).getStr(), FSEND ); } @@ -2446,6 +2447,13 @@ void XclExpCellTable::Save( XclExpStream& rStrm ) void XclExpCellTable::SaveXml( XclExpXmlStream& rStrm ) { + // DEFAULT row height + XclExpDefaultRowData& rDefData = mxDefrowheight->GetDefaultData(); + sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); + rWorksheet->startElement( XML_sheetFormatPr, + XML_defaultRowHeight, OString::valueOf( (double) rDefData.mnHeight / 20.0 ).getStr(), FSEND ); + rWorksheet->endElement( XML_sheetFormatPr ); + maColInfoBfr.SaveXml( rStrm ); maRowBfr.SaveXml( rStrm ); } diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 900d2e6f86d2..894016791a2f 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -3210,7 +3210,7 @@ String XclImpObjectManager::GetOleNameOverride( SCTAB nTab, sal_uInt16 nObjId ) rtl::OUString sOleName; String sCodeName = GetExtDocOptions().GetCodeName( nTab ); - if ( mxOleCtrlNameOverride->hasByName( sCodeName ) ) + if (mxOleCtrlNameOverride.is() && mxOleCtrlNameOverride->hasByName(sCodeName)) { Reference< XIndexContainer > xIdToOleName; mxOleCtrlNameOverride->getByName( sCodeName ) >>= xIdToOleName; diff --git a/sc/source/filter/inc/lotattr.hxx b/sc/source/filter/inc/lotattr.hxx index 844da072c129..cc8971aba307 100644 --- a/sc/source/filter/inc/lotattr.hxx +++ b/sc/source/filter/inc/lotattr.hxx @@ -42,7 +42,7 @@ class ScPatternAttr; class SvxColorItem; class Color; class LotAttrTable; -class LOTUS_ROOT; +struct LOTUS_ROOT; namespace editeng { class SvxBorderLine; } diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx index 33b7b2c2fa77..d9ce5eac0e21 100644 --- a/sc/source/filter/inc/xetable.hxx +++ b/sc/source/filter/inc/xetable.hxx @@ -783,6 +783,7 @@ private: private: XclExpXFId maXFId; /// The XF identifier for column default format. sal_uInt16 mnWidth; /// Excel width of the column. + sal_uInt16 mnScWidth; /// Calc width of the column. sal_uInt16 mnFlags; /// Additional column flags. sal_uInt16 mnFirstXclCol; /// Index to first column. sal_uInt16 mnLastXclCol; /// Index to last column. @@ -851,7 +852,7 @@ public: /** Sets the passed default data as current record contents. */ void SetDefaultData( const XclExpDefaultRowData& rDefData ); - + XclExpDefaultRowData& GetDefaultData() { return maDefData; } private: /** Writes the contents of the record. */ virtual void WriteBody( XclExpStream& rStrm ); diff --git a/sc/source/filter/oox/addressconverter.cxx b/sc/source/filter/oox/addressconverter.cxx index 52e74ebbcecc..1da39663255f 100644 --- a/sc/source/filter/oox/addressconverter.cxx +++ b/sc/source/filter/oox/addressconverter.cxx @@ -57,7 +57,7 @@ using ::rtl::OUStringToOString; namespace { //! TODO: this limit may change, is there a way to obtain it via API? -const sal_Int16 API_MAXTAB = 255; +const sal_Int16 API_MAXTAB = MAXTAB; const sal_Int32 OOX_MAXCOL = static_cast< sal_Int32 >( (1 << 14) - 1 ); const sal_Int32 OOX_MAXROW = static_cast< sal_Int32 >( (1 << 20) - 1 ); diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx index 3bbf751f2f84..39d57a0b4988 100644 --- a/sc/source/filter/oox/commentsbuffer.cxx +++ b/sc/source/filter/oox/commentsbuffer.cxx @@ -195,8 +195,7 @@ void Comment::finalizeImport() // position and formatting pNoteShape->convertFormatting( xAnnoShape ); // visibility - const ::oox::vml::ClientData* pClientData = pNoteShape->getClientData(); - xAnno->setIsVisible( pClientData && pClientData->mbVisible ); + bVisible = pNoteShape->getTypeModel().mbVisible; } } break; diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 64351285316f..d5cc534079ac 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -170,7 +170,13 @@ ContextHandlerRef ExtGlobalContext::onCreateContext( sal_Int32 nElement, const A if(nElement == XLS_EXT_TOKEN( cfRule )) { rtl::OUString aId = rAttribs.getString( XML_id, rtl::OUString() ); - void* pInfo = getExtLst().find( aId )->second; + + // an ext entrie does not need to have an existing corresponding entry + ExtLst::const_iterator aExt = getExtLst().find( aId ); + if(aExt == getExtLst().end()) + return NULL; + + void* pInfo = aExt->second; if (!pInfo) { return NULL; @@ -180,8 +186,6 @@ ContextHandlerRef ExtGlobalContext::onCreateContext( sal_Int32 nElement, const A else return this; } - - return 0; } void ExtGlobalContext::onStartElement( const AttributeList& rAttribs ) diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index a82e19551792..f2b89a89ed04 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -112,23 +112,23 @@ void FormulaBuffer::finalizeImport() applyCellFormulas( cellIt->second ); } + ArrayFormulaDataMap::iterator itArray = cellArrayFormulas.find( nTab ); + if ( itArray != cellArrayFormulas.end() ) + { + applyArrayFormulas( itArray->second ); + } + FormulaValueMap::iterator itValues = cellFormulaValues.find( nTab ); if ( itValues != cellFormulaValues.end() ) { std::vector< ValueAddressPair > & rVector = itValues->second; applyCellFormulaValues( rVector ); } - - ArrayFormulaDataMap::iterator itArray = cellArrayFormulas.find( nTab ); - - if ( itArray != cellArrayFormulas.end() ) - { - applyArrayFormulas( itArray->second ); - } } rDoc.SetAutoNameCache( NULL ); xFormulaBar->setPosition( 1.0 ); } + void FormulaBuffer::applyCellFormula( ScDocument& rDoc, const ApiTokenSequence& rTokens, const ::com::sun::star::table::CellAddress& rAddress ) { ScTokenArray aTokenArray; @@ -158,7 +158,8 @@ void FormulaBuffer::applyCellFormulaValues( const std::vector< ValueAddressPair ScAddress aCellPos; ScUnoConversion::FillScAddress( aCellPos, it->first ); ScBaseCell* pBaseCell = rDoc.GetCell( aCellPos ); - if ( pBaseCell->GetCellType() == CELLTYPE_FORMULA ) + SAL_WARN_IF( !pBaseCell, "sc", "why is the formula not imported? bug?"); + if ( pBaseCell && pBaseCell->GetCellType() == CELLTYPE_FORMULA ) { ScFormulaCell* pCell = static_cast< ScFormulaCell* >( pBaseCell ); pCell->SetHybridDouble( it->second ); diff --git a/sc/source/filter/oox/unitconverter.cxx b/sc/source/filter/oox/unitconverter.cxx index e2feb875882e..2d0431b21be1 100644 --- a/sc/source/filter/oox/unitconverter.cxx +++ b/sc/source/filter/oox/unitconverter.cxx @@ -149,18 +149,17 @@ void UnitConverter::finalizeImport() { // XDevice expects pixels in font descriptor, but font contains twips FontDescriptor aDesc = pDefFont->getFontDescriptor(); - aDesc.Height = static_cast< sal_Int16 >( scaleValue( aDesc.Height, UNIT_TWIP, UNIT_REFDEVX ) + 0.5 ); Reference< XFont > xFont = xDevice->getFont( aDesc ); if( xFont.is() ) { // get maximum width of all digits sal_Int32 nDigitWidth = 0; for( sal_Unicode cChar = '0'; cChar <= '9'; ++cChar ) - nDigitWidth = ::std::max( nDigitWidth, scaleToMm100( xFont->getCharWidth( cChar ), UNIT_REFDEVX ) ); + nDigitWidth = ::std::max( nDigitWidth, scaleToMm100( xFont->getCharWidth( cChar ), UNIT_TWIP ) ); if( nDigitWidth > 0 ) maCoeffs[ UNIT_DIGIT ] = nDigitWidth; // get width of space character - sal_Int32 nSpaceWidth = scaleToMm100( xFont->getCharWidth( ' ' ), UNIT_REFDEVX ); + sal_Int32 nSpaceWidth = scaleToMm100( xFont->getCharWidth( ' ' ), UNIT_TWIP ); if( nSpaceWidth > 0 ) maCoeffs[ UNIT_SPACE ] = nSpaceWidth; } diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index f1f8a4053afe..500a332d78d7 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -566,7 +566,20 @@ VmlCommentExporter::VmlCommentExporter( sax_fastparser::FSHelperPtr p, ScAddress void VmlCommentExporter::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect ) { lcl_FillProps( rProps, mpCaption, mbVisible ); - rProps.AddOpt( ESCHER_Prop_fHidden, 1 ); // bool field + rProps.AddOpt( ESCHER_Prop_fHidden, mbVisible ); // bool field + + // shadow property value for comment ( set in lcl_FillProps [*] ) has been + // overwritten by new value ( 0x20000 ) in the generic part of the export + // ( see EscherPropertyContainer::CreateShadowProperties ) + // Safer option here is to just force the needed value here for oox vml + // export alone ( and avoid potential problems with binary export ) + // #TODO investigate value of ESCHER_Prop_fshadowObscured generally + // in binary export ( if indeed this value is good for binary export ) + // we can change the heuristics and/or initialisation path and get + // rid of line below. + // [*] lcl_FillProps seems to be called twice when exporting to xlsx + // once from XclObjComment::ProcessEscherObj #TODO look into that also + rProps.AddOpt( ESCHER_Prop_fshadowObscured, 0x00030003 ); // force value for comments VMLExport::Commit( rProps, rRect ); } diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 7388d86e283f..59d1fe43749e 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -392,12 +392,15 @@ XMLTableStyleContext::XMLTableStyleContext( ScXMLImport& rImport, nNumberFormat(-1), nLastSheet(-1), bParentSet(false), - mpCondFormat(NULL) + mpCondFormat(NULL), + mbDeleteCondFormat(true) { } XMLTableStyleContext::~XMLTableStyleContext() { + if(mbDeleteCondFormat) + delete mpCondFormat; } SvXMLImportContext *XMLTableStyleContext::CreateChildContext( @@ -444,11 +447,6 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres { if(itr->EqualEntries(*mpCondFormat)) { - // we don't need the new cond format entry now - // the found one is the same and we just need to add the range to it - delete mpCondFormat; - mpCondFormat = NULL; - ScRangeList& rRangeList = itr->GetRangeList(); sal_uInt32 nCondId = itr->GetKey(); size_t n = rRange.size(); @@ -464,12 +462,13 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres aMarkData.MarkFromRangeList(rRange, true); pDoc->ApplySelectionPattern( aPattern , aMarkData); - break; + return; } } - if(mpCondFormat) + if(mpCondFormat && mbDeleteCondFormat) { + mbDeleteCondFormat = false; sal_uLong nIndex = pDoc->AddCondFormat(mpCondFormat, nTab ); mpCondFormat->SetKey(nIndex); mpCondFormat->AddRange(rRange); diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx index d674fe3625c9..2498b3cc8618 100644 --- a/sc/source/filter/xml/xmlstyli.hxx +++ b/sc/source/filter/xml/xmlstyli.hxx @@ -101,6 +101,7 @@ class XMLTableStyleContext : public XMLPropStyleContext SCTAB nLastSheet; bool bParentSet; ScConditionalFormat* mpCondFormat; + bool mbDeleteCondFormat; const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 845e551ac7f1..2635cb8e628c 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -2051,7 +2051,10 @@ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId ) // TP_USERLISTS if ( pUL ) + { aULItem.SetUserList( *pUL ); + pRet->Put(aULItem); + } // TP_COMPATIBILITY pRet->Put( SfxUInt16Item( SID_SC_OPT_KEY_BINDING_COMPAT, diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 5c6d0f2586e1..6b877de44cfe 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -494,30 +494,25 @@ void ScCondFrmtEntry::HideColorScaleElements() void ScCondFrmtEntry::SetHeight() { - if(mbActive) + long nPad = LogicToPixel(Size(42,2), MapMode(MAP_APPFONT)).getHeight(); + + // Calculate maximum height we need from visible widgets + sal_uInt16 nChildren = GetChildCount(); + + long nMaxHeight = 0; + for(sal_uInt16 i = 0; i < nChildren; i++) { - Size aSize = GetSizePixel(); - switch (meType) - { - case CONDITION: - case FORMULA: - aSize.Height() = 120; - break; - case COLORSCALE: - aSize.Height() = 200; - break; - case DATABAR: - aSize.Height() = 200; - break; - default: - break; - } - SetSizePixel(aSize); + Window *pChild = GetChild(i); + if(!pChild || !pChild->IsVisible()) + continue; + Point aPos = pChild->GetPosPixel(); + Size aSize = pChild->GetSizePixel(); + nMaxHeight = std::max(aPos.Y() + aSize.Height(), nMaxHeight); } - else + Size aSize = GetSizePixel(); + if(nMaxHeight > 0) { - Size aSize = GetSizePixel(); - aSize.Height() = 40; + aSize.Height() = nMaxHeight + nPad; SetSizePixel(aSize); } } @@ -984,6 +979,8 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocum { maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, pFormat->GetEntry(nIndex), maPos )); } + if (nCount > 0) + maEntries.begin()->Select(); } RecalcAll(); diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index aee8b6f26dd4..03fbeb3a4aa5 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -77,7 +77,7 @@ String ScCondFormatManagerWindow::createEntryString(const ScConditionalFormat& r String aStr; aRange.Format(aStr, SCA_VALID, mpDoc, mpDoc->GetAddressConvention()); aStr += '\t'; - aStr += ScCondFormatHelper::GetExpression(rFormat, mrPos); + aStr += ScCondFormatHelper::GetExpression(rFormat, aRange.GetTopLeftCorner()); return aStr; } @@ -209,7 +209,8 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl) if(!pFormat) return 0; - ScCondFormatDlg* pDlg = new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(), maPos); + ScCondFormatDlg* pDlg = new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(), + pFormat->GetRange().GetTopLeftCorner()); if(pDlg->Execute() == RET_OK) { sal_Int32 nKey = pFormat->GetKey(); diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 303d6c6b8efb..7ebbb474da79 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -275,9 +275,11 @@ sal_Bool ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet ) // ----------------------------------------------------------------------- -// for data exchange without dialogue detour: (still TODO!) -void ScTabPageSortFields::ActivatePage() +// for data exchange without dialogue detour: +void ScTabPageSortFields::ActivatePage( const SfxItemSet& rSet ) { + // Refresh local copy with shared data + aSortData = static_cast<const ScSortItem&>(rSet.Get( SCITEM_SORTDATA )).GetSortData(); if ( pDlg ) { if ( bHasHeader != pDlg->GetHeaders() @@ -744,9 +746,11 @@ sal_Bool ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet ) // ----------------------------------------------------------------------- -// for data exchange without dialogue detour: (still TODO!) -void ScTabPageSortOptions::ActivatePage() +// for data exchange without dialogue detour: +void ScTabPageSortOptions::ActivatePage( const SfxItemSet& rSet ) { + // Refresh local copy with shared data + aSortData = static_cast<const ScSortItem&>(rSet.Get( SCITEM_SORTDATA )).GetSortData(); if ( pDlg ) { if ( aBtnHeader.IsChecked() != pDlg->GetHeaders() ) diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx index 14fce4efb4d1..7167e2ebebc3 100644 --- a/sc/source/ui/inc/tpsort.hxx +++ b/sc/source/ui/inc/tpsort.hxx @@ -69,11 +69,9 @@ public: virtual void Reset ( const SfxItemSet& rArgSet ); protected: -// for data exchange (TODO: should be changed!) -// virtual void ActivatePage ( const SfxItemSet& rSet ); + virtual void ActivatePage ( const SfxItemSet& rSet ); using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; - virtual void ActivatePage (); virtual int DeactivatePage ( SfxItemSet* pSet = 0); private: @@ -132,11 +130,9 @@ public: virtual void Reset ( const SfxItemSet& rArgSet ); protected: -// for data exchange (TODO: should be changed!) -// virtual void ActivatePage ( const SfxItemSet& rSet ); + virtual void ActivatePage ( const SfxItemSet& rSet ); using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; - virtual void ActivatePage (); virtual int DeactivatePage ( SfxItemSet* pSet = 0); private: diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 3eee0085bb0e..ba6fc9a7b926 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -96,6 +96,7 @@ ScTpUserLists::ScTpUserLists( Window* pParent, { SetExchangeSupport(); Init(); + Reset(rCoreAttrs); FreeResource(); } @@ -153,6 +154,7 @@ void ScTpUserLists::Init() aFtCopyFrom.Disable(); aEdCopyFrom.Disable(); } + } // ----------------------------------------------------------------------- diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 14ed86bb29a7..c53294563ba4 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2075,7 +2075,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } else { - pDlg = pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aPos, RID_SCDLG_CONDFORMAT ); + pDlg = pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), RID_SCDLG_CONDFORMAT ); } if(pDlg->Execute() == RET_OK) diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp index 27369365dabc..997a142695d4 100644 --- a/scp2/source/ooo/common_brand.scp +++ b/scp2/source/ooo/common_brand.scp @@ -336,14 +336,14 @@ Directory gid_Brand_Dir_Share_Extensions_Dict_Pl DosName = "dict-pl"; End -Directory gid_Brand_Dir_Share_Extensions_Dict_Pt +Directory gid_Brand_Dir_Share_Extensions_Dict_Pt_Br ParentID = gid_Brand_Dir_Share_Extensions; - DosName = "dict-pt"; + DosName = "dict-pt-BR"; End Directory gid_Brand_Dir_Share_Extensions_Dict_Pt_Pt ParentID = gid_Brand_Dir_Share_Extensions; - DosName = "dict-pt-pt"; + DosName = "dict-pt-PT"; End Directory gid_Brand_Dir_Share_Extensions_Dict_Ro @@ -934,6 +934,24 @@ ProfileItem gid_Brand_Profileitem_Soffice_NativeProgress_So Value = "${NATIVEPROGRESS}"; End +ProfileItem gid_Brand_Profileitem_Soffice_ProgressTextColor_So + ProfileID = gid_Brand_Profile_Soffice_Ini; + ModuleID = gid_Module_Root_Brand; + Section = "Bootstrap"; + Order = 7; + Key = "ProgressTextColor"; + Value = "${PROGRESSTEXTCOLOR}"; +End + +ProfileItem gid_Brand_Profileitem_Soffice_ProgressTextBaseline_So + ProfileID = gid_Brand_Profile_Soffice_Ini; + ModuleID = gid_Module_Root_Brand; + Section = "Bootstrap"; + Order = 8; + Key = "ProgressTextBaseline"; + Value = "${PROGRESSTEXTBASELINE}"; +End + ProfileItem gid_Brand_Profileitem_Soffice_Hideeula ProfileID = gid_Brand_Profile_Soffice_Ini; ModuleID = gid_Module_Root_Brand; diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp index b35e1bb6314f..5042de379fd7 100644 --- a/scp2/source/ooo/file_ooo.scp +++ b/scp2/source/ooo/file_ooo.scp @@ -1604,9 +1604,9 @@ End #endif #ifndef WITHOUT_MYSPELL_DICTS -File gid_File_Extension_Dictionary_Pt - Dir = gid_Brand_Dir_Share_Extensions_Dict_Pt; - Name = "dict-pt.oxt"; +File gid_File_Extension_Dictionary_Pt_Br + Dir = gid_Brand_Dir_Share_Extensions_Dict_Pt_Br; + Name = "dict-pt-BR.oxt"; Styles = (PACKED, FORCELANGUAGEPACK, ARCHIVE); UnixRights = 444; End @@ -1615,7 +1615,7 @@ End #ifndef WITHOUT_MYSPELL_DICTS File gid_File_Extension_Dictionary_Pt_Pt Dir = gid_Brand_Dir_Share_Extensions_Dict_Pt_Pt; - Name = "dict-pt-pt.oxt"; + Name = "dict-pt-PT.oxt"; Styles = (PACKED, FORCELANGUAGEPACK, ARCHIVE); UnixRights = 444; End diff --git a/scp2/source/ooo/module_ooo.scp b/scp2/source/ooo/module_ooo.scp index 23196e2ddbed..af6e72c3b15e 100644 --- a/scp2/source/ooo/module_ooo.scp +++ b/scp2/source/ooo/module_ooo.scp @@ -408,9 +408,9 @@ Module gid_Module_Root_Extension_Dictionary_Pl Styles = (); End -Module gid_Module_Root_Extension_Dictionary_Pt - MOD_NAME_DESC ( MODULE_EXTENSION_DICTIONARY_PT ); - Files = (gid_File_Extension_Dictionary_Pt); +Module gid_Module_Root_Extension_Dictionary_Pt_Br + MOD_NAME_DESC ( MODULE_EXTENSION_DICTIONARY_PT_BR ); + Files = (gid_File_Extension_Dictionary_Pt_Br); InstallOrder = "2000"; Sortkey = "515"; Spellcheckerlanguage = "pt-BR"; diff --git a/scp2/source/ooo/module_ooo.ulf b/scp2/source/ooo/module_ooo.ulf index 8d0ddf659ca8..a4927bacc2ed 100644 --- a/scp2/source/ooo/module_ooo.ulf +++ b/scp2/source/ooo/module_ooo.ulf @@ -241,10 +241,10 @@ en-US = "Polish" [STR_DESC_MODULE_EXTENSION_DICTIONARY_PL] en-US = "Polish spelling dictionary, hyphenation rules, and thesaurus" -[STR_NAME_MODULE_EXTENSION_DICTIONARY_PT] +[STR_NAME_MODULE_EXTENSION_DICTIONARY_PT_BR] en-US = "Brazilian Portuguese" -[STR_DESC_MODULE_EXTENSION_DICTIONARY_PT] +[STR_DESC_MODULE_EXTENSION_DICTIONARY_PT_BR] en-US = "Brazilian Portuguese spelling Dictionary (1990 Spelling Agreement), and hyphenation rules" [STR_NAME_MODULE_EXTENSION_DICTIONARY_PT_PT] diff --git a/sdext/source/pdfimport/inc/pdfihelper.hxx b/sdext/source/pdfimport/inc/pdfihelper.hxx index d8f7d3c60e44..ad4774aadd46 100644 --- a/sdext/source/pdfimport/inc/pdfihelper.hxx +++ b/sdext/source/pdfimport/inc/pdfihelper.hxx @@ -196,6 +196,10 @@ namespace pdfi bool bFirstTry, const rtl::OUString& rDocName ); + + void reportUnsupportedEncryptionFormat( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionHandler > const & handler); } #define USTR(x) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) diff --git a/sdext/source/pdfimport/inc/pdfparse.hxx b/sdext/source/pdfimport/inc/pdfparse.hxx index df3e4259ab1a..5e87b89a164a 100644 --- a/sdext/source/pdfimport/inc/pdfparse.hxx +++ b/sdext/source/pdfimport/inc/pdfparse.hxx @@ -253,6 +253,9 @@ struct PDFFile : public PDFContainer virtual PDFEntry* clone() const; bool isEncrypted() const; + + bool usesSupportedEncryptionFormat() const; + // this method checks whether rPwd is compatible with // either user or owner password and sets up decrypt data in that case // returns true if decryption can be done diff --git a/sdext/source/pdfimport/misc/pwdinteract.cxx b/sdext/source/pdfimport/misc/pwdinteract.cxx index e5fb674047bc..f68c31e76cb1 100644 --- a/sdext/source/pdfimport/misc/pwdinteract.cxx +++ b/sdext/source/pdfimport/misc/pwdinteract.cxx @@ -26,9 +26,14 @@ * ************************************************************************/ +#include "sal/config.h" + +#include <cassert> #include "pdfihelper.hxx" +#include <boost/noncopyable.hpp> +#include <com/sun/star/task/ErrorCodeRequest.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/task/XInteractionRequest.hpp> #include <com/sun/star/task/XInteractionPassword.hpp> @@ -36,8 +41,9 @@ #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/compbase2.hxx> +#include <cppuhelper/implbase1.hxx> #include <cppuhelper/basemutex.hxx> - +#include <tools/errcode.hxx> using namespace com::sun::star; @@ -125,6 +131,32 @@ void SAL_CALL PDFPasswordRequest::select() throw (uno::RuntimeException) m_bSelected = true; } +class UnsupportedEncryptionFormatRequest: + public cppu::WeakImplHelper1< task::XInteractionRequest >, + private boost::noncopyable +{ +public: + UnsupportedEncryptionFormatRequest() {} + +private: + virtual ~UnsupportedEncryptionFormatRequest() {} + + virtual uno::Any SAL_CALL getRequest() throw (uno::RuntimeException) { + return uno::makeAny( + task::ErrorCodeRequest( + rtl::OUString(), uno::Reference< uno::XInterface >(), + ERRCODE_IO_WRONGVERSION)); + //TODO: should be something more informative than crudely reused + // ERRCODE_IO_WRONGVERSION + } + + virtual uno::Sequence< uno::Reference< task::XInteractionContinuation > > + SAL_CALL getContinuations() throw (uno::RuntimeException) { + return + uno::Sequence< uno::Reference< task::XInteractionContinuation > >(); + } +}; + } // namespace namespace pdfi @@ -159,6 +191,13 @@ bool getPassword( const uno::Reference< task::XInteractionHandler >& xHandler, return bSuccess; } +void reportUnsupportedEncryptionFormat( + uno::Reference< task::XInteractionHandler > const & handler) +{ + assert(handler.is()); + handler->handle(new UnsupportedEncryptionFormatRequest); +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index 04d5022547bc..9bd8364e3d6f 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -1223,17 +1223,22 @@ static bool check_user_password( const OString& rPwd, PDFFileImplData* pData ) return bValid; } +bool PDFFile::usesSupportedEncryptionFormat() const +{ + return m_pData->m_bStandardHandler && + m_pData->m_nAlgoVersion >= 1 && + m_pData->m_nAlgoVersion <= 2 && + m_pData->m_nStandardRevision >= 2 && + m_pData->m_nStandardRevision <= 3; +} + bool PDFFile::setupDecryptionData( const OString& rPwd ) const { if( !impl_getData()->m_bIsEncrypted ) return rPwd.isEmpty(); // check if we can handle this encryption at all - if( ! m_pData->m_bStandardHandler || - m_pData->m_nAlgoVersion < 1 || - m_pData->m_nAlgoVersion > 2 || - m_pData->m_nStandardRevision < 2 || - m_pData->m_nStandardRevision > 3 ) + if( ! usesSupportedEncryptionFormat() ) return false; if( ! m_pData->m_aCipher ) diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index 772dac337c68..c6176b3446b3 100644 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -927,44 +927,56 @@ static bool checkEncryption( const rtl::OUString& o_rIsEncrypted = pPDFFile->isEncrypted(); if( o_rIsEncrypted ) { - bool bAuthenticated = false; - if( !io_rPwd.isEmpty() ) + if( pPDFFile->usesSupportedEncryptionFormat() ) { - rtl::OString aIsoPwd = rtl::OUStringToOString( io_rPwd, - RTL_TEXTENCODING_ISO_8859_1 ); - bAuthenticated = pPDFFile->setupDecryptionData( aIsoPwd.getStr() ); - // trash password string on heap - rtl_zeroMemory( (void*)aIsoPwd.getStr(), aIsoPwd.getLength() ); - } - if( bAuthenticated ) - bSuccess = true; - else - { - if( i_xIHdl.is() ) + bool bAuthenticated = false; + if( !io_rPwd.isEmpty() ) + { + rtl::OString aIsoPwd = rtl::OUStringToOString( io_rPwd, + RTL_TEXTENCODING_ISO_8859_1 ); + bAuthenticated = pPDFFile->setupDecryptionData( aIsoPwd.getStr() ); + // trash password string on heap + rtl_zeroMemory( (void*)aIsoPwd.getStr(), aIsoPwd.getLength() ); + } + if( bAuthenticated ) + bSuccess = true; + else { - bool bEntered = false; - do + if( i_xIHdl.is() ) { - bEntered = getPassword( i_xIHdl, io_rPwd, ! bEntered, i_rDocName ); - rtl::OString aIsoPwd = rtl::OUStringToOString( io_rPwd, - RTL_TEXTENCODING_ISO_8859_1 ); - bAuthenticated = pPDFFile->setupDecryptionData( aIsoPwd.getStr() ); - // trash password string on heap - rtl_zeroMemory( (void*)aIsoPwd.getStr(), aIsoPwd.getLength() ); - } while( bEntered && ! bAuthenticated ); + bool bEntered = false; + do + { + bEntered = getPassword( i_xIHdl, io_rPwd, ! bEntered, i_rDocName ); + rtl::OString aIsoPwd = rtl::OUStringToOString( io_rPwd, + RTL_TEXTENCODING_ISO_8859_1 ); + bAuthenticated = pPDFFile->setupDecryptionData( aIsoPwd.getStr() ); + // trash password string on heap + rtl_zeroMemory( (void*)aIsoPwd.getStr(), aIsoPwd.getLength() ); + } while( bEntered && ! bAuthenticated ); + } + + OSL_TRACE( "password: %s", bAuthenticated ? "matches" : "does not match" ); + bSuccess = bAuthenticated; + } + // trash password string on heap + rtl_zeroMemory( (void*)io_rPwd.getStr(), io_rPwd.getLength()*sizeof(sal_Unicode) ); + if( bAuthenticated ) + { + rtl::OUStringBuffer aBuf( 128 ); + aBuf.appendAscii( "_OOO_pdfi_Credentials_" ); + aBuf.append( pPDFFile->getDecryptionKey() ); + io_rPwd = aBuf.makeStringAndClear(); } - - OSL_TRACE( "password: %s", bAuthenticated ? "matches" : "does not match" ); - bSuccess = bAuthenticated; } - // trash password string on heap - rtl_zeroMemory( (void*)io_rPwd.getStr(), io_rPwd.getLength()*sizeof(sal_Unicode) ); - if( bAuthenticated ) + else if( i_xIHdl.is() ) { - rtl::OUStringBuffer aBuf( 128 ); - aBuf.appendAscii( "_OOO_pdfi_Credentials_" ); - aBuf.append( pPDFFile->getDecryptionKey() ); - io_rPwd = aBuf.makeStringAndClear(); + reportUnsupportedEncryptionFormat( i_xIHdl ); + //TODO: this should either be handled further down the + // call stack, or else information that this has already + // been handled should be passed down the call stack, so + // that SfxBaseModel::load does not show an additional + // "General Error" message box } } else diff --git a/setup_native/prj/build.lst b/setup_native/prj/build.lst index 8898e8ad4e17..9b9914c8f86a 100644 --- a/setup_native/prj/build.lst +++ b/setup_native/prj/build.lst @@ -3,12 +3,13 @@ pk setup_native usr1 - all sn_mkou pk setup_native\scripts\source nmake - u sn_source NULL pk setup_native\scripts nmake - u sn_scripts sn_source.u NULL pk setup_native\source\mac nmake - u sn_mac NULL +pk setup_native\source\packinfo nmake - w sn_packinfo NULL pk setup_native\source\win32\customactions\tools nmake - w sn_tools NULL pk setup_native\source\win32\customactions\rebase nmake - w sn_rebase NULL pk setup_native\source\win32\customactions\regactivex nmake - w sn_regactivex NULL pk setup_native\source\win32\customactions\regpatchactivex nmake - w sn_regpatchactivex NULL pk setup_native\source\win32\customactions\reg4allmsdoc nmake - w sn_reg4allmsdoc NULL -pk setup_native\source\win32\customactions\sellang nmake - w sn_sellang NULL +pk setup_native\source\win32\customactions\sellang nmake - w sn_sellang sn_packinfo.w NULL pk setup_native\source\win32\customactions\thesaurus nmake - w sn_thesaurus NULL pk setup_native\source\win32\customactions\javafilter nmake - w sn_javafilter NULL pk setup_native\source\win32\customactions\quickstarter nmake - w sn_quickstarter NULL diff --git a/setup_native/source/packinfo/makefile.mk b/setup_native/source/packinfo/makefile.mk new file mode 100644 index 000000000000..a2c647886cf2 --- /dev/null +++ b/setup_native/source/packinfo/makefile.mk @@ -0,0 +1,24 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +PRJ = ../.. +PRJNAME = setup_native +TARGET = packinfo + +.INCLUDE: settings.mk + +ALLTAR: $(OUT)/inc/spellchecker_selection.hxx + +.INCLUDE: target.mk + +$(OUT)/inc/spellchecker_selection.hxx .ERRREMOVE : spellchecker_selection.pl \ + spellchecker_selection.txt + $(PERL) -w spellchecker_selection.pl <spellchecker_selection.txt >$@ + +# vim: set noet sw=4 ts=4: diff --git a/setup_native/source/packinfo/packinfo_office.txt b/setup_native/source/packinfo/packinfo_office.txt index bc7605bfd1ce..3a17e73573a8 100644 --- a/setup_native/source/packinfo/packinfo_office.txt +++ b/setup_native/source/packinfo/packinfo_office.txt @@ -941,25 +941,25 @@ packageversion = "%PACKAGEVERSION" End Start -module = "gid_Module_Root_Extension_Dictionary_Pt" -solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pt" +module = "gid_Module_Root_Extension_Dictionary_Pt_Br" +solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-BR" solarisrequires = "%SOLSUREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core01, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core02, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core03, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core04, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core05, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core06, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core07, %PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" -packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-pt" +packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-BR" requires = "%UREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure,%BASISPACKAGEPREFIX%PRODUCTVERSION-core01,%BASISPACKAGEPREFIX%PRODUCTVERSION-core02,%BASISPACKAGEPREFIX%PRODUCTVERSION-core03,%BASISPACKAGEPREFIX%PRODUCTVERSION-core04,%BASISPACKAGEPREFIX%PRODUCTVERSION-core05,%BASISPACKAGEPREFIX%PRODUCTVERSION-core06,%BASISPACKAGEPREFIX%PRODUCTVERSION-core07,%UNIXPACKAGENAME%BRANDPACKAGEVERSION" linuxpatchrequires = "" copyright = "1999-2010 by Oracle" solariscopyright = "solariscopyrightfile" vendor = "Oracle" -description = "Pt dictionary for %PRODUCTNAME %PRODUCTVERSION" +description = "Pt-BR dictionary for %PRODUCTNAME %PRODUCTVERSION" destpath = "/opt" packageversion = "%PACKAGEVERSION" End Start module = "gid_Module_Root_Extension_Dictionary_Pt_Pt" -solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-pt" +solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-PT" solarisrequires = "%SOLSUREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core01, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core02, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core03, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core04, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core05, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core06, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core07, %PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" -packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-pt" +packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-PT" requires = "%UREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure,%BASISPACKAGEPREFIX%PRODUCTVERSION-core01,%BASISPACKAGEPREFIX%PRODUCTVERSION-core02,%BASISPACKAGEPREFIX%PRODUCTVERSION-core03,%BASISPACKAGEPREFIX%PRODUCTVERSION-core04,%BASISPACKAGEPREFIX%PRODUCTVERSION-core05,%BASISPACKAGEPREFIX%PRODUCTVERSION-core06,%BASISPACKAGEPREFIX%PRODUCTVERSION-core07,%UNIXPACKAGENAME%BRANDPACKAGEVERSION" linuxpatchrequires = "" copyright = "1999-2010 by Oracle" diff --git a/setup_native/source/packinfo/spellchecker_selection.pl b/setup_native/source/packinfo/spellchecker_selection.pl new file mode 100644 index 000000000000..b30a843e4acd --- /dev/null +++ b/setup_native/source/packinfo/spellchecker_selection.pl @@ -0,0 +1,68 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +use List::Util qw[max]; + +@ARGV == 0 or die 'Usage: translates from stdin to stdout'; + +my %map = (); +my $max = 0; + +while (<>) { + next if /^\s*(#.*)?$/; + /^ \s* ([a-z]{2}(?:-[A-Z]{2})?) \s* = \s* + \"(EMPTY|[a-z]{2}(?:-[A-Z]{2})?(?:,[a-z]{2}(?:-[A-Z]{2})?)*)\" \s* $/x + or die "bad input line \"$_\""; + my $lang = $1; + $lang =~ tr/-/_/; + my $dicts = $2; + $dicts =~ tr/-/_/; + !exists($map{$lang}) or die "duplicate values for $lang"; + if ($dicts eq 'EMPTY') { + @{$map{$lang}} = (); + } else { + @{$map{$lang}} = split(/,/, $dicts); + $max = max($max, scalar(@{$map{$lang}})); + } +} + +++$max; + +print <<EOF; +// generated by setup_native/source/packinfo/spellchecker_selection.pl + +#ifndef INCLUDED_SETUP_NATIVE_SOURCE_PACKINFO_SPELLCHECKER_SELECTION_HXX +#define INCLUDED_SETUP_NATIVE_SOURCE_PACKINFO_SPELLCHECKER_SELECTION_HXX + +#include "sal/config.h" + +namespace setup_native { + +struct LanguageDictionaries { + char const * language; + char const * dictionaries[$max]; +}; + +LanguageDictionaries const languageDictionaries[] = { +EOF + +foreach $i (sort(keys(%map))) { + print(" { \"$i\", {"); + foreach $j (sort(@{$map{$i}})) { + print(" \"$j\","); + } + print(" 0 } },\n"); +} + +print <<EOF; +}; + +} + +#endif +EOF diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt index a2e10bbac94b..f80e5d584716 100644 --- a/setup_native/source/packinfo/spellchecker_selection.txt +++ b/setup_native/source/packinfo/spellchecker_selection.txt @@ -22,7 +22,7 @@ el = "el" en-US = "en,es,fr" en-GB = "en,es,fr" en-ZA = "en,es,fr" -es = "an,es,fr,pt" +es = "an,es,fr,pt-PT" et = "et" fr = "fr,es" gd = "gd" diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx index d88bbf767e5a..cda413c9d1b0 100644 --- a/setup_native/source/win32/customactions/sellang/sellang.cxx +++ b/setup_native/source/win32/customactions/sellang/sellang.cxx @@ -49,6 +49,8 @@ #include <sal/macros.h> #include <systools/win32/uwinapi.h> +#include "spellchecker_selection.hxx" + BOOL GetMsiProp( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) { DWORD sz = 0; @@ -65,7 +67,7 @@ BOOL GetMsiProp( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) } static const char * -langid_to_string( LANGID langid, int *have_default_lang ) +langid_to_string( LANGID langid ) { /* Map from LANGID to string. The languages below are now in * alphabetical order of codes as in @@ -73,11 +75,6 @@ langid_to_string( LANGID langid, int *have_default_lang ) * language part is returned in the string. */ switch (PRIMARYLANGID (langid)) { - case LANG_ENGLISH: - if (have_default_lang != NULL && - langid == MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT)) - *have_default_lang = 1; - return "en"; #define CASE(name, primary) \ case LANG_##primary: return #name CASE(af, AFRIKAANS); @@ -94,6 +91,7 @@ langid_to_string( LANGID langid, int *have_default_lang ) CASE(da, DANISH); CASE(de, GERMAN); CASE(el, GREEK); + CASE(en, ENGLISH); CASE(es, SPANISH); CASE(et, ESTONIAN); CASE(eu, BASQUE); @@ -174,7 +172,7 @@ langid_to_string( LANGID langid, int *have_default_lang ) CASE(sh, SERBIAN, SERBIAN_LATIN); CASE(sr, SERBIAN, SERBIAN_CYRILLIC); #undef CASE - default: return ""; + default: return 0; } } } @@ -185,14 +183,20 @@ langid_to_string( LANGID langid, int *have_default_lang ) static const char *ui_langs[MAX_LANGUAGES]; static int num_ui_langs = 0; +void add_ui_lang(char const * lang) +{ + if (lang != 0 && num_ui_langs != SAL_N_ELEMENTS(ui_langs)) { + ui_langs[num_ui_langs++] = lang; + } +} + BOOL CALLBACK enum_ui_lang_proc (LPTSTR language, LONG_PTR /* unused_lParam */) { long langid = strtol(language, NULL, 16); if (langid > 0xFFFF) return TRUE; - ui_langs[num_ui_langs] = langid_to_string((LANGID) langid, NULL); - num_ui_langs++; + add_ui_lang(langid_to_string((LANGID) langid)); if (num_ui_langs == SAL_N_ELEMENTS(ui_langs) ) return FALSE; return TRUE; @@ -207,13 +211,47 @@ present_in_ui_langs(const char *lang) return FALSE; } +namespace { + +struct InstallLocalized { + char lang[sizeof("xx_XX")]; + bool install; +}; + +void addMatchingDictionaries( + char const * lang, InstallLocalized * dicts, int ndicts) +{ + for (int i = 0; i != SAL_N_ELEMENTS(setup_native::languageDictionaries); + ++i) + { + if (strcmp(lang, setup_native::languageDictionaries[i].language) == 0) { + for (char const * const * p = setup_native::languageDictionaries[i]. + dictionaries; + *p != NULL; ++p) + { + for (int j = 0; j != ndicts; ++j) { + if (_stricmp(*p, dicts[j].lang) == 0) { + dicts[j].install = true; + break; + } + } + } + break; + } + } +} + +} + extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle ) { char feature[100]; MSIHANDLE database, view, record; DWORD length; int nlangs = 0; - char langs[MAX_LANGUAGES][6]; + InstallLocalized langs[MAX_LANGUAGES]; + int ndicts = 0; + InstallLocalized dicts[MAX_LANGUAGES]; database = MsiGetActiveDatabase(handle); @@ -238,100 +276,118 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle ) return ERROR_SUCCESS; } - /* Keep track of what languages are included in this installer, if - * it is a multilanguage one. + /* Keep track of what langpacks are included in this installer. */ - if (strcmp(feature, "gm_Langpack_r_en_US") != 0) - strcpy(langs[nlangs++], feature + strlen("gm_Langpack_r_")); + strcpy(langs[nlangs].lang, feature + strlen("gm_Langpack_r_")); + langs[nlangs].install = false; + ++nlangs; MsiCloseHandle(record); } MsiCloseHandle(view); - if (nlangs > 0) { - int i; - char* pVal = NULL; - if ( (GetMsiProp( handle, "UI_LANGS", &pVal )) && pVal ) { - /* user gave UI languages explicitely with UI_LANGS property */ - int sel_ui_lang = 0; - strcpy(langs[nlangs++], "en_US"); - char *str_ptr; - str_ptr = strtok(pVal, ","); - for(; str_ptr != NULL ;) { - ui_langs[num_ui_langs] = str_ptr; - num_ui_langs++; - str_ptr = strtok(NULL, ","); - } - for (i = 0; i < nlangs; i++) { - if (!present_in_ui_langs(langs[i])) { - UINT rc; - sprintf(feature, "gm_Langpack_r_%s", langs[i]); - rc = MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); - } - else { - sel_ui_lang++; - } - } - if ( sel_ui_lang == 0 ) { - /* When UI_LANG property contains only languages that are not present - * in the installer, install at least en_US localization. - */ - MsiSetFeatureStateA(handle, "gm_Langpack_r_en_US", INSTALLSTATE_LOCAL); - } - } - else { - /* Deselect those languages that don't match any of the UI languages - * available on the system. - */ - - int have_system_default_lang = 0; - const char *system_default_lang = langid_to_string(GetSystemDefaultUILanguage(), &have_system_default_lang); - const char *user_locale_lang = langid_to_string(LANGIDFROMLCID(GetThreadLocale()), NULL); - - EnumUILanguagesA(enum_ui_lang_proc, 0, 0); - - /* If one of the alternative languages in a multi-language installer - * is the system default UI language, deselect those languages that - * aren't among the UI languages available on the system. - * (On most Windows installations, just one UI language is present, - * which obviously is the same as the default UI language. But - * we want to be generic.) - * If none of the languages in a multi-language installer is the - * system default UI language (this happens now in 2.4.0 where we - * cannot put as many UI languages into the installer as we would - * like, but only half a dozen: en-US,de,es,fr,it,pt-BR), pretend - * that English is the system default UI language, - * so that we will by default deselect everything except - * English. We don't want to by default install all half dozen - * languages for an unsuspecting user of a Finnish Windows, for - * instance. Sigh. - */ - if (system_default_lang[0]) { - for (i = 0; i < nlangs; i++) { - if (memcmp (system_default_lang, langs[i], 2) == 0) { - have_system_default_lang = 1; + /* Keep track of what dictionaries are included in this installer: + */ + if (MsiDatabaseOpenViewA( + database, + ("SELECT Feature from Feature WHERE" + " Feature_Parent = 'gm_Dictionaries'"), + &view) + == ERROR_SUCCESS) + { + if (MsiViewExecute(view, NULL) == ERROR_SUCCESS) { + while (ndicts < MAX_LANGUAGES && + MsiViewFetch(view, &record) == ERROR_SUCCESS) + { + length = sizeof(feature); + if (MsiRecordGetStringA(record, 1, feature, &length) + == ERROR_SUCCESS) + { + if (strncmp( + feature, "gm_r_ex_Dictionary_", + strlen("gm_r_ex_Dictionary_")) + == 0) + { + strcpy( + dicts[ndicts].lang, + feature + strlen("gm_r_ex_Dictionary_")); + dicts[ndicts].install = false; + ++ndicts; } } + MsiCloseHandle(record); } + } + MsiCloseHandle(view); + } - if (!have_system_default_lang) { - system_default_lang = "en"; - have_system_default_lang = 1; + /* Keep track of what UI languages are relevant, either the ones explicitly + * requested with the UI_LANGS property, or all available on the system: + */ + char* pVal = NULL; + if ( (GetMsiProp( handle, "UI_LANGS", &pVal )) && pVal ) { + char *str_ptr; + str_ptr = strtok(pVal, ","); + for(; str_ptr != NULL ;) { + add_ui_lang(str_ptr); + str_ptr = strtok(NULL, ","); + } + } else { + add_ui_lang(langid_to_string(GetSystemDefaultUILanguage())); + add_ui_lang(langid_to_string(LANGIDFROMLCID(GetThreadLocale()))); + //TODO: are the above two explicit additions necessary, or will + // those values always be included in the below EnumUILanguages + // anyway? + EnumUILanguagesA(enum_ui_lang_proc, 0, 0); + } + + // If the set of langpacks that match any of the relevant UI languages is + // non-empty, select just those matching langpacks; otherwise, if an en_US + // langpack is included, select just that langpack (this happens if, e.g., + // a multi-language en-US,de,es,fr,it,pt-BR installation set is installed on + // a Finnish Windows); otherwise, select all langpacks (this happens if, + // e.g., a single-language de installation set is installed on a Finnish + // Windows): + bool matches = false; + for (int i = 0; i < nlangs; i++) { + if (present_in_ui_langs(langs[i].lang)) { + langs[i].install = true; + matches = true; + } + } + if (!matches) { + for (int i = 0; i < nlangs; i++) { + if (strcmp(langs[nlangs].lang, "en_US") == 0) { + langs[i].install = true; + matches = true; + break; } - if (have_system_default_lang) { - for (i = 0; i < nlangs; i++) { - if (memcmp(system_default_lang, langs[i], 2) != 0 && - memcmp(user_locale_lang, langs[i], 2) != 0 && - !present_in_ui_langs(langs[i])) { - UINT rc; - sprintf(feature, "gm_Langpack_r_%s", langs[i]); - rc = MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); - } - } + } + if (!matches) { + for (int i = 0; i < nlangs; i++) { + langs[i].install = true; } } } + + for (int i = 0; i < nlangs; i++) { + if (langs[i].install) { + addMatchingDictionaries(langs[i].lang, dicts, ndicts); + } else { + sprintf(feature, "gm_Langpack_r_%s", langs[i].lang); + MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); + } + } + + // Select just those dictionaries that match any of the selected langpacks: + for (int i = 0; i != ndicts; ++i) { + if (!dicts[i].install) { + sprintf(feature, "gm_r_ex_Dictionary_%s", dicts[i].lang); + MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); + } + } + MsiCloseHandle(database); return ERROR_SUCCESS; diff --git a/setup_native/source/win32/msi-encodinglist.txt b/setup_native/source/win32/msi-encodinglist.txt index 1fd3cb96e70d..84d77f7c78b4 100644 --- a/setup_native/source/win32/msi-encodinglist.txt +++ b/setup_native/source/win32/msi-encodinglist.txt @@ -104,7 +104,7 @@ pt-BR 1252 1046 pt-PT 1252 2070 qtz 1252 1033 # key id pseudo language rm 0 1047 # Raeto-Romance -ro 1250 1048 # Romanian +ro 0 1048 # Romanian ru 1251 1049 rw 0 1569 # Kinyarwanda sa-IN 0 1103 # Sanskrit diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index a69800230211..13afd10c8a99 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -365,7 +365,7 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin // load configuration SvtViewOptions aWinOpt( E_WINDOW, String::CreateFromInt32( nId ) ); - if ( aWinOpt.Exists() ) + if ( aWinOpt.Exists() && aWinOpt.HasVisible() ) rInfo.bVisible = aWinOpt.IsVisible(); // set state from configuration. Can be overwritten by UserData, see below ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt.GetUserData(); diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx index c9ea9b33f799..21a25132a773 100644 --- a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx +++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx @@ -186,7 +186,8 @@ HRESULT STDMETHODCALLTYPE CPropertyHdl::GetValue( REFPROPERTYKEY key, PROPVARIAN } //----------------------------- -HRESULT STDMETHODCALLTYPE CPropertyHdl::SetValue( REFPROPERTYKEY key, REFPROPVARIANT propVar ) +HRESULT STDMETHODCALLTYPE +CPropertyHdl::SetValue(REFPROPERTYKEY /*key*/, REFPROPVARIANT /*propVar*/) { HRESULT hr = E_UNEXPECTED; if ( m_pCache ) @@ -205,7 +206,8 @@ HRESULT STDMETHODCALLTYPE CPropertyHdl::Commit() //----------------------------- // IPropertyStore //----------------------------- -HRESULT STDMETHODCALLTYPE CPropertyHdl::IsPropertyWritable( REFPROPERTYKEY key ) +HRESULT STDMETHODCALLTYPE +CPropertyHdl::IsPropertyWritable(REFPROPERTYKEY /*key*/) { // We start with read only properties only return S_FALSE; diff --git a/solenv/bin/modules/installer/ziplist.pm b/solenv/bin/modules/installer/ziplist.pm index 95b56389fd47..651469b1e46f 100644 --- a/solenv/bin/modules/installer/ziplist.pm +++ b/solenv/bin/modules/installer/ziplist.pm @@ -755,6 +755,8 @@ sub overwrite_branding $variableshashref->{'PROGRESSSIZE'} = $ENV{'PROGRESSSIZE'} , if( defined $ENV{'PROGRESSSIZE'} && $ENV{'PROGRESSSIZE'} ne "" ); $variableshashref->{'PROGRESSPOSITION'} = $ENV{'PROGRESSPOSITION'} , if( defined $ENV{'PROGRESSPOSITION'} && $ENV{'PROGRESSPOSITION'} ne "" ); $variableshashref->{'PROGRESSFRAMECOLOR'} = $ENV{'PROGRESSFRAMECOLOR'} , if( defined $ENV{'PROGRESSFRAMECOLOR'} && $ENV{'PROGRESSFRAMECOLOR'} ne "" ); + $variableshashref->{'PROGRESSTEXTCOLOR'} = $ENV{'PROGRESSTEXTCOLOR'} , if( defined $ENV{'PROGRESSTEXTCOLOR'} && $ENV{'PROGRESSTEXTCOLOR'} ne "" ); + $variableshashref->{'PROGRESSTEXTBASELINE'} = $ENV{'PROGRESSTEXTBASELINE'} , if( defined $ENV{'PROGRESSTEXTBASELINE'} && $ENV{'PROGRESSTEXTBASELINE'} ne "" ); } ########################################################### diff --git a/solenv/inc/wntmsc.mk b/solenv/inc/wntmsc.mk index afafe3861dc9..ec84e985dfa6 100644 --- a/solenv/inc/wntmsc.mk +++ b/solenv/inc/wntmsc.mk @@ -195,7 +195,7 @@ CFLAGSWERRCC=-WX -DLIBO_WERROR # Once all modules on this platform compile without warnings, set # COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see # settings.mk): -MODULES_WITH_WARNINGS := +MODULES_WITH_WARNINGS := binfilter CDEFS+=-DWIN32 -D_MT -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 .IF "$(COMEX)" == "11" diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index a263e91865ec..6ed7615bf580 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -67,19 +67,13 @@ typedef boost::unordered_map // a page buffer, even if a read fails. It is up to the caller to determine // the correctness of the I/O. -StgPage::StgPage( StgCache* p, short n ) +StgPage::StgPage( StgCache* , short n ) { OSL_ENSURE( n >= 512, "Unexpected page size is provided!" ); - pCache = p; nData = n; bDirty = sal_False; nPage = 0; pData = new sal_uInt8[ nData ]; - pNext1 = - pNext2 = - pLast1 = - pLast2 = NULL; - pOwner = NULL; } StgPage::~StgPage() @@ -99,6 +93,11 @@ void StgPage::SetPage( short nOff, sal_Int32 nVal ) } } +bool StgPage::IsPageGreater( const StgPage *pA, const StgPage *pB ) +{ + return pA->nPage < pB->nPage; +} + //////////////////////////////// class StgCache //////////////////////////// // The disk cache holds the cached sectors. The sector type differ according @@ -115,7 +114,6 @@ StgCache::StgCache() { nRef = 0; pStrm = NULL; - pCur = pElem1 = NULL; nPageSize = 512; nError = SVSTREAM_OK; bMyStream = sal_False; @@ -145,7 +143,6 @@ void StgCache::SetPhysPageSize( short n ) } // Create a new cache element -// pCur points to this element StgPage* StgCache::Create( sal_Int32 nPg ) { @@ -154,40 +151,10 @@ StgPage* StgCache::Create( sal_Int32 nPg ) // For data security, clear the buffer contents memset( pElem->pData, 0, pElem->nData ); - // insert to LRU - if( pCur ) - { - pElem->pNext1 = pCur; - pElem->pLast1 = pCur->pLast1; - pElem->pNext1->pLast1 = - pElem->pLast1->pNext1 = pElem; - } - else - pElem->pNext1 = pElem->pLast1 = pElem; if( !pLRUCache ) pLRUCache = new UsrStgPagePtr_Impl(); (*(UsrStgPagePtr_Impl*)pLRUCache)[pElem->nPage] = pElem; - pCur = pElem; - // insert to Sorted - if( !pElem1 ) - pElem1 = pElem->pNext2 = pElem->pLast2 = pElem; - else - { - StgPage* p = pElem1; - do - { - if( pElem->nPage < p->nPage ) - break; - p = p->pNext2; - } while( p != pElem1 ); - pElem->pNext2 = p; - pElem->pLast2 = p->pLast2; - pElem->pNext2->pLast2 = - pElem->pLast2->pNext2 = pElem; - if( p->nPage < pElem1->nPage ) - pElem1 = pElem; - } return pElem; } @@ -198,19 +165,8 @@ void StgCache::Erase( StgPage* pElem ) OSL_ENSURE( pElem, "The pointer should not be NULL!" ); if ( pElem ) { - OSL_ENSURE( pElem->pNext1 && pElem->pLast1, "The pointers may not be NULL!" ); - //remove from LRU - pElem->pNext1->pLast1 = pElem->pLast1; - pElem->pLast1->pNext1 = pElem->pNext1; - if( pCur == pElem ) - pCur = ( pElem->pNext1 == pElem ) ? NULL : pElem->pNext1; if( pLRUCache ) ((UsrStgPagePtr_Impl*)pLRUCache)->erase( pElem->nPage ); - // remove from Sorted - pElem->pNext2->pLast2 = pElem->pLast2; - pElem->pLast2->pNext2 = pElem->pNext2; - if( pElem1 == pElem ) - pElem1 = ( pElem->pNext2 == pElem ) ? NULL : pElem->pNext2; delete pElem; } } @@ -219,16 +175,6 @@ void StgCache::Erase( StgPage* pElem ) void StgCache::Clear() { - StgPage* pElem = pCur; - if( pCur ) do - { - StgPage* pDelete = pElem; - pElem = pElem->pNext1; - delete pDelete; - } - while( pCur != pElem ); - pCur = NULL; - pElem1 = NULL; delete (UsrStgPagePtr_Impl*)pLRUCache; pLRUCache = NULL; } @@ -245,19 +191,6 @@ StgPage* StgCache::Find( sal_Int32 nPage ) // page found StgPage* pFound = (*aIt).second; OSL_ENSURE( pFound, "The pointer may not be NULL!" ); - - if( pFound != pCur ) - { - OSL_ENSURE( pFound->pNext1 && pFound->pLast1, "The pointers may not be NULL!" ); - // remove from LRU - pFound->pNext1->pLast1 = pFound->pLast1; - pFound->pLast1->pNext1 = pFound->pNext1; - // insert to LRU - pFound->pNext1 = pCur; - pFound->pLast1 = pCur->pLast1; - pFound->pNext1->pLast1 = - pFound->pLast1->pNext1 = pFound; - } return pFound; } return NULL; @@ -304,52 +237,34 @@ StgPage* StgCache::Copy( sal_Int32 nNew, sal_Int32 nOld ) return p; } -// Flush the cache whose owner is given. NULL flushes all. +// Historically this wrote pages in a sorted, ascending order; +// continue that tradition. sal_Bool StgCache::Commit() { - StgPage* p = pElem1; - if( p ) do + UsrStgPagePtr_Impl *pCache = (UsrStgPagePtr_Impl*)pLRUCache; + + std::vector< StgPage * > aToWrite; + for ( UsrStgPagePtr_Impl::iterator aIt = pCache->begin(); + aIt != pCache->end(); ++aIt ) { - if( p->bDirty ) - { - sal_Bool b = Write( p->nPage, p->pData, 1 ); - if( !b ) - return sal_False; - p->bDirty = sal_False; - } - p = p->pNext2; - } while( p != pElem1 ); + if ( aIt->second->bDirty ) + aToWrite.push_back( aIt->second ); + } + + std::sort( aToWrite.begin(), aToWrite.end(), StgPage::IsPageGreater ); + for (std::vector< StgPage * >::iterator aWr = aToWrite.begin(); + aWr != aToWrite.end(); ++aWr) + { + StgPage *pPage = *aWr; + if ( !Write( pPage->GetPage(), pPage->GetData(), 1 ) ) + return sal_False; + pPage->bDirty = sal_False; + } + pStrm->Flush(); SetError( pStrm->GetError() ); -#ifdef CHECK_DIRTY - p = pElem1; - if( p ) do - { - if( p->bDirty ) - { - ErrorBox( NULL, WB_OK, String("SO2: Dirty Block in Ordered List") ).Execute(); - sal_Bool b = Write( p->nPage, p->pData, 1 ); - if( !b ) - return sal_False; - p->bDirty = sal_False; - } - p = p->pNext2; - } while( p != pElem1 ); - p = pElem1; - if( p ) do - { - if( p->bDirty ) - { - ErrorBox( NULL, WB_OK, String("SO2: Dirty Block in LRU List") ).Execute(); - sal_Bool b = Write( p->nPage, p->pData, 1 ); - if( !b ) - return sal_False; - p->bDirty = sal_False; - } - p = p->pNext1; - } while( p != pElem1 ); -#endif + return sal_True; } diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx index 4ea16d3b3d9e..e2d0a06d3594 100644 --- a/sot/source/sdstor/stgcache.hxx +++ b/sot/source/sdstor/stgcache.hxx @@ -42,8 +42,6 @@ class StgDirEntry; class StorageBase; class StgCache { - StgPage* pCur; // top of LRU list - StgPage* pElem1; // top of ordered list sal_uLong nError; // error code sal_Int32 nPages; // size of data area in pages sal_uInt16 nRef; // reference count @@ -93,10 +91,6 @@ public: class StgPage { friend class StgCache; - StgCache* pCache; // the cache - StgPage *pNext1, *pLast1; // LRU chain - StgPage *pNext2, *pLast2; // ordered chain - StgDirEntry* pOwner; // owner sal_Int32 nPage; // page # sal_uInt8* pData; // nPageSize characters short nData; // size of this page @@ -108,7 +102,7 @@ public: sal_Int32 GetPage() { return nPage; } void* GetData() { return pData; } short GetSize() { return nData; } - void SetOwner( StgDirEntry* p ) { pOwner = p; } + void SetOwner( StgDirEntry* ) { } // routines for accessing FAT pages // Assume that the data is a FAT page and get/put FAT data. sal_Int32 GetPage( short nOff ) @@ -123,6 +117,7 @@ public: #endif } void SetPage( short, sal_Int32 ); // put an element + static bool IsPageGreater( const StgPage *pA, const StgPage *pB ); }; #endif diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 546540e7a0f6..b22c63318594 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -940,8 +940,10 @@ IMPL_LINK(FmXFormView, OnAutoFocus, void*, /*EMPTYTAG*/) do { + SdrPageView *pPageView = m_pView ? m_pView->GetSdrPageView() : NULL; + SdrPage *pSdrPage = pPageView ? pPageView->GetPage() : NULL; // get the forms collection of the page we belong to - FmFormPage* pPage = m_pView ? PTR_CAST( FmFormPage, m_pView->GetSdrPageView()->GetPage() ) : NULL; + FmFormPage* pPage = PTR_CAST( FmFormPage, pSdrPage ); Reference< XIndexAccess > xForms( pPage ? Reference< XIndexAccess >( pPage->GetForms(), UNO_QUERY ) : Reference< XIndexAccess >() ); const PFormViewPageWindowAdapter pAdapter = m_aPageWindowAdapters.empty() ? NULL : m_aPageWindowAdapters[0]; diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 02d56b8a20b2..a64ece90e1d1 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -42,7 +42,6 @@ class SwDoc; class SwDocShell; -class ViewShell; class _SetGetExpFlds; class SwViewOption; class OutputDevice; @@ -278,6 +277,7 @@ public: void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions); void ViewOptionAdjust( SwPrintData const* const pPrtOptions ); void ViewOptionAdjustStop(); + void ViewOptionAdjustCrashPreventionKludge(); bool HasSwPrtOptions() const { return m_pPrtOptions != 0; } SwPrintData const* GetSwPrtOptions() const { return m_pPrtOptions.get(); } diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 29c779a51ed2..a3525882c142 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -422,6 +422,7 @@ public: SwFrmFmt* ClaimFrmFmt(); void ChgFrmFmt( SwTableBoxFmt *pNewFmt ); + void RemoveFromTable(); const SwStartNode *GetSttNd() const { return pSttNd; } sal_uLong GetSttIdx() const; diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 9d94f18323ee..63004fb7e4b0 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -586,7 +586,7 @@ public: -----------------------------------------------------------------------*/ class SwViewOptionAdjust_Impl { - ViewShell & m_rShell; + ViewShell * m_pShell; SwViewOption m_aOldViewOptions; public: @@ -594,7 +594,8 @@ public: ~SwViewOptionAdjust_Impl(); void AdjustViewOptions( SwPrintData const* const pPrtOptions ); bool checkShell( const ViewShell& rCompare ) const - { return &rCompare == &m_rShell; } + { return &rCompare == m_pShell; } + void DontTouchThatViewShellItSmellsFunny() { m_pShell = 0; } }; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index ca62c557e9f5..1493d14cd180 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -2012,26 +2012,27 @@ void SwCrsrShell::Combine() return; SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen - SwCrsrSaveState aSaveState( *pCurCrsr ); + // rhbz#689053: IsSelOvr must restore the saved stack position, not the + // current one, because current point + stack mark may be invalid PaM + SwCrsrSaveState aSaveState(*pCrsrStk); if( pCrsrStk->HasMark() ) // nur wenn GetMark gesetzt wurde { bool const bResult = CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True ); OSL_ENSURE(bResult, "StackCrsr & act. Crsr not in same Section."); (void) bResult; // non-debug: unused - // kopiere das GetMark - if( !pCurCrsr->HasMark() ) - pCurCrsr->SetMark(); - *pCurCrsr->GetMark() = *pCrsrStk->GetMark(); - pCurCrsr->GetMkPos() = pCrsrStk->GetMkPos(); } + *pCrsrStk->GetPoint() = *pCurCrsr->GetPoint(); + pCrsrStk->GetPtPos() = pCurCrsr->GetPtPos(); SwShellCrsr * pTmp = 0; if( pCrsrStk->GetNext() != pCrsrStk ) { pTmp = dynamic_cast<SwShellCrsr*>(pCrsrStk->GetNext()); } - delete pCrsrStk; + delete pCurCrsr; + pCurCrsr = pCrsrStk; + pCrsrStk->MoveTo(0); // remove from ring pCrsrStk = pTmp; if( !pCurCrsr->IsInProtectTable( sal_True ) && !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index b14e07d0cd7f..ad42cff7539d 100644..100755 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -973,12 +973,9 @@ String lcl_TokenType2Str(FormTokenType nType) case TOKEN_END: return String("END", RTL_TEXTENCODING_ASCII_US); default: + OSL_FAIL("should not be reached"); return String("??", RTL_TEXTENCODING_ASCII_US); } - - OSL_FAIL("should not be reached"); - - return String("??", RTL_TEXTENCODING_ASCII_US); } String lcl_dbg_out(const SwFormToken & rToken) diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 3a57a7586b4f..69e755b09a70 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1747,10 +1747,9 @@ SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, const SwStartNode& rSttNd, SwTableL rSrtArr.Insert( p ); // eintragen } -SwTableBox::~SwTableBox() +void SwTableBox::RemoveFromTable() { - // Inhaltstragende Box ? - if( !GetFrmFmt()->GetDoc()->IsInDtor() && pSttNd ) + if (pSttNd) // box containing contents? { // an der Table austragen const SwTableNode* pTblNd = pSttNd->FindTableNode(); @@ -1759,6 +1758,15 @@ SwTableBox::~SwTableBox() GetTabSortBoxes(); SwTableBox *p = this; // error: &this rSrtArr.Remove( p ); // austragen + pSttNd = 0; // clear it so this is only run once + } +} + +SwTableBox::~SwTableBox() +{ + if (!GetFrmFmt()->GetDoc()->IsInDtor()) + { + RemoveFromTable(); } // ist die TabelleBox der letzte Client im FrameFormat, kann dieses diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 11dbb4b7eeaa..e3a6af5d7a6a 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -1755,7 +1755,11 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) rDoc.GetNodes()._MoveNodes( aRg, rDoc.GetNodes(), aInsPos, sal_False ); } else + { // first disconnect box from node, otherwise ~SwTableBox would + // access pBox->pSttNd, deleted by DeleteSection + pBox->RemoveFromTable(); rDoc.DeleteSection( rDoc.GetNodes()[ nIdx ] ); + } aDelBoxes.insert( aDelBoxes.end(), pBox ); } } @@ -1771,6 +1775,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) // TL_CHART2: notify chart about box to be removed if (pPCD) pPCD->DeleteBox( &pTblNd->GetTable(), *pBox ); + pBox->RemoveFromTable(); // ~SwTableBox would access pBox->pSttNd aDelBoxes.insert( aDelBoxes.end(), pBox ); rDoc.DeleteSection( rDoc.GetNodes()[ nIdx ] ); } diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 4e6d37f1cab1..99888555d2dd 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -131,6 +131,11 @@ void SwRenderData::ViewOptionAdjustStop() m_pViewOptionAdjust.reset(); } +void SwRenderData::ViewOptionAdjustCrashPreventionKludge() +{ + m_pViewOptionAdjust->DontTouchThatViewShellItSmellsFunny(); +} + void SwRenderData::MakeSwPrtOptions( SwDocShell const*const pDocShell, diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index b9f2295c407b..1b780e0a0333 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -546,7 +546,11 @@ void DocxAttributeOutput::EndRun() if ( m_closeHyperlinkInPreviousRun ) { - m_pSerializer->endElementNS( XML_w, XML_hyperlink ); + if ( m_startedHyperlink ) + { + m_pSerializer->endElementNS( XML_w, XML_hyperlink ); + m_startedHyperlink = false; + } m_closeHyperlinkInPreviousRun = false; } diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index cfaf64becc42..88055d2774b2 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1665,6 +1665,10 @@ bool lcl_isInHeader(const SwFrmFmt& rFmt) if (!pFlyFrmFmt) return false; SwFlyFrm* pFlyFrm = const_cast<SwFlyFrm*>(pFlyFrmFmt->GetFrm()); + if (!pFlyFrm) // fdo#54648: "hidden" drawing object has no layout frame + { + return false; + } SwPageFrm* pPageFrm = pFlyFrm->FindPageFrmOfAnchor(); SwFrm* pHeader = pPageFrm->Lower(); if (pHeader->GetType() == FRM_HEADER) diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 1b5bd7588a0b..679f1161df60 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -2751,7 +2751,6 @@ void WW8TabDesc::FinishSwTable() nRowSpan : ((-1) * (nRowSpan - n)); pCurrentBox->setRowSpan( nRowSpanSet ); - ++n; } } } diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 786bc00278a5..a74c4d0692c8 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -1279,83 +1279,13 @@ sal_uInt8 lcl_ReadBorders(bool bVer67, WW8_BRC* brc, WW8PLCFx_Cp_FKP* pPap, void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt8 nCol, short nIdx, sal_uInt16 nOOIndex, sal_uInt16 nWWIndex, short *pSize=0) { - ::editeng::SvxBorderStyle eStyle = table::BorderLineStyle::SOLID; - switch (nIdx) - { - // First the single lines - case 1: - case 5: - // and the unsupported special cases which we map to a single line - case 8: - case 9: - case 20: - case 22: - eStyle = table::BorderLineStyle::SOLID; - break; - case 2: - { - eStyle = table::BorderLineStyle::SOLID; - nLineThickness *= 2; - } - break; - case 6: - eStyle = table::BorderLineStyle::DOTTED; - break; - case 7: - eStyle = table::BorderLineStyle::DASHED; - break; - // then the shading beams which we represent by a double line - case 23: - eStyle = table::BorderLineStyle::DOUBLE; - break; - // then the double lines, for which we have good matches - case 3: - case 10: //Don't have tripple so use double - case 21: //Don't have double wave: use double instead - eStyle = table::BorderLineStyle::DOUBLE; - break; - case 11: - eStyle = table::BorderLineStyle::THINTHICK_SMALLGAP; - break; - case 12: - case 13: //Don't have thin thick thin, so use thick thin - eStyle = table::BorderLineStyle::THICKTHIN_SMALLGAP; - break; - case 14: - eStyle = table::BorderLineStyle::THINTHICK_MEDIUMGAP; - break; - case 15: - case 16: //Don't have thin thick thin, so use thick thin - eStyle = table::BorderLineStyle::THICKTHIN_MEDIUMGAP; - break; - case 17: - eStyle = table::BorderLineStyle::THINTHICK_LARGEGAP; - break; - case 18: - case 19: //Don't have thin thick thin, so use thick thin - eStyle = table::BorderLineStyle::THICKTHIN_LARGEGAP; - break; - case 24: - eStyle = table::BorderLineStyle::EMBOSSED; - break; - case 25: - eStyle = table::BorderLineStyle::ENGRAVED; - break; - case 26: - eStyle = table::BorderLineStyle::OUTSET; - break; - case 27: - eStyle = table::BorderLineStyle::INSET; - break; - default: - eStyle = table::BorderLineStyle::NONE; - break; - } + ::editeng::SvxBorderStyle const eStyle( + ::editeng::ConvertBorderStyleFromWord(nIdx)); ::editeng::SvxBorderLine aLine; aLine.SetBorderLineStyle( eStyle ); double const fConverted( (table::BorderLineStyle::NONE == eStyle) ? 0.0 : - ::editeng::ConvertBorderWidthFromWord(eStyle, nLineThickness)); + ::editeng::ConvertBorderWidthFromWord(eStyle, nLineThickness, nIdx)); aLine.SetWidth(fConverted); //No AUTO for borders as yet, so if AUTO, use BLACK diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index ba8d4a9e5223..19917707fdb5 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -980,14 +980,9 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine, if ( nCol < nOldCol ) { OSL_FAIL( "table and/or table information seems to be corrupted." ); - if ( nBox == nBoxes - 1 ) - { - nCol = rLines.GetColumns().Count() - 1; - } - else - { - nCol = nOldCol; - } + // NOTE: nOldCol is not necessarily a valid index into + // GetColumns(), but that doesn't matter here + nCol = nOldCol; } sal_uInt16 nColSpan = nCol - nOldCol + 1U; diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx index 4159f1835bda..fe2dd1122cf8 100644 --- a/sw/source/ui/app/applab.cxx +++ b/sw/source/ui/app/applab.cxx @@ -91,21 +91,19 @@ const char MASTER_LABEL[] = "MasterLabel"; const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem, SwFrmFmt &rFmt, - sal_uInt16 nCol, sal_uInt16 nRow, sal_Bool bPage) + sal_uInt16 nCol, sal_uInt16 nRow ) { SfxItemSet aSet(rSh.GetAttrPool(), RES_ANCHOR, RES_ANCHOR, RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT, 0 ); sal_uInt16 nPhyPageNum, nVirtPageNum; rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); - aSet.Put(SwFmtAnchor(bPage ? FLY_AS_CHAR : FLY_AT_PAGE, nPhyPageNum)); - if (!bPage) - { - aSet.Put(SwFmtHoriOrient(rItem.lLeft + nCol * rItem.lHDist, - text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME )); - aSet.Put(SwFmtVertOrient(rItem.lUpper + nRow * rItem.lVDist, - text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME )); - } + //anchor frame to page + aSet.Put( SwFmtAnchor( FLY_AT_PAGE, nPhyPageNum ) ); + aSet.Put( SwFmtHoriOrient( rItem.lLeft + nCol * rItem.lHDist, + text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME ) ); + aSet.Put( SwFmtVertOrient( rItem.lUpper + nRow * rItem.lVDist, + text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME ) ); const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Insert Fly OSL_ENSURE( pFmt, "Fly not inserted" ); @@ -130,21 +128,19 @@ const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem, const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem, SwFrmFmt &rFmt, SwFldMgr& rFldMgr, - sal_uInt16 nCol, sal_uInt16 nRow, sal_Bool bLast, sal_Bool bPage) + sal_uInt16 nCol, sal_uInt16 nRow, sal_Bool bLast ) { SfxItemSet aSet(rSh.GetAttrPool(), RES_ANCHOR, RES_ANCHOR, RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT, 0 ); sal_uInt16 nPhyPageNum, nVirtPageNum; rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); - aSet.Put(SwFmtAnchor(bPage ? FLY_AS_CHAR : FLY_AT_PAGE, nPhyPageNum)); - if (!bPage) - { - aSet.Put(SwFmtHoriOrient(rItem.lLeft + nCol * rItem.lHDist, - text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME )); - aSet.Put(SwFmtVertOrient(rItem.lUpper + nRow * rItem.lVDist, - text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME )); - } + //anchor frame to page + aSet.Put( SwFmtAnchor( FLY_AT_PAGE, nPhyPageNum ) ); + aSet.Put( SwFmtHoriOrient( rItem.lLeft + nCol * rItem.lHDist, + text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME ) ); + aSet.Put( SwFmtVertOrient( rItem.lUpper + nRow * rItem.lVDist, + text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME ) ); const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Insert Fly OSL_ENSURE( pFmt, "Fly not inserted" ); @@ -300,26 +296,11 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) SwFmtFrmSize aFrmSize( ATT_FIX_SIZE, iWidth, iHeight ); pFmt->SetFmtAttr( aFrmSize ); - SwFrmFmt* pFmtEORow = new SwFrmFmt (*pFmt); - SwFrmFmt* pFmtEOCol = new SwFrmFmt (*pFmt); - SwFrmFmt* pFmtEOColEORow = new SwFrmFmt (*pFmt); - - SvxULSpaceItem aFrmULSpace( 0, (sal_uInt16)(rItem.lVDist - rItem.lHeight), - RES_UL_SPACE ); + //frame represents label itself, no border space SvxULSpaceItem aFrmNoULSpace( 0, 0, RES_UL_SPACE ); - - SvxLRSpaceItem aFrmLRSpace( 0, (sal_uInt16)(rItem.lHDist - rItem.lWidth), - 0, 0, RES_LR_SPACE ); SvxLRSpaceItem aFrmNoLRSpace( 0, 0, 0, 0, RES_LR_SPACE ); - - pFmt->SetFmtAttr(aFrmULSpace); - pFmt->SetFmtAttr(aFrmLRSpace); - pFmtEORow->SetFmtAttr(aFrmULSpace); - pFmtEORow->SetFmtAttr(aFrmNoLRSpace); - pFmtEOCol->SetFmtAttr(aFrmNoULSpace); - pFmtEOCol->SetFmtAttr(aFrmLRSpace); - pFmtEOColEORow->SetFmtAttr(aFrmNoULSpace); - pFmtEOColEORow->SetFmtAttr(aFrmNoLRSpace); + pFmt->SetFmtAttr( aFrmNoULSpace ); + pFmt->SetFmtAttr( aFrmNoLRSpace ); const SwFrmFmt *pFirstFlyFmt = 0; if ( rItem.bPage ) @@ -327,26 +308,16 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) SwFmtVertOrient aFrmVertOrient( pFmt->GetVertOrient() ); aFrmVertOrient.SetVertOrient( text::VertOrientation::TOP ); pFmt->SetFmtAttr(aFrmVertOrient); - pFmtEORow->SetFmtAttr(aFrmVertOrient); - pFmtEOCol->SetFmtAttr(aFrmVertOrient); - pFmtEOColEORow->SetFmtAttr(aFrmVertOrient); for ( sal_uInt16 i = 0; i < rItem.nRows; ++i ) { for ( sal_uInt16 j = 0; j < rItem.nCols; ++j ) { pSh->Push(); - SwFrmFmt* pFrmFmt; - if ( j == rItem.nCols - 1 ) - pFrmFmt = ( i == rItem.nRows - 1 ? pFmtEOColEORow : pFmtEORow ); - else - pFrmFmt = ( i == rItem.nRows - 1 ? pFmtEOCol : pFmt ); - - const SwFrmFmt *pTmp = - bLabel ? - lcl_InsertLabText( *pSh, rItem, *pFrmFmt, *pFldMgr, j, i, - i == rItem.nRows - 1 && j == rItem.nCols - 1, sal_True ) : - lcl_InsertBCText(*pSh, rItem, *pFrmFmt, j, i, sal_True); + const SwFrmFmt *pTmp = ( bLabel ? + lcl_InsertLabText( *pSh, rItem, *pFmt, *pFldMgr, j, i, + i == rItem.nRows - 1 && j == rItem.nCols - 1 ) : + lcl_InsertBCText( *pSh, rItem, *pFmt, j, i ) ); if (!(i|j)) { pFirstFlyFmt = pTmp; @@ -387,8 +358,6 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) } pSh->Pop( sal_False ); } - if ( i + 1 != rItem.nRows ) - pSh->SplitNode(); // Small optimisation } } else @@ -396,10 +365,10 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) pFirstFlyFmt = bLabel ? lcl_InsertLabText( *pSh, rItem, *pFmt, *pFldMgr, static_cast< sal_uInt16 >(rItem.nCol - 1), - static_cast< sal_uInt16 >(rItem.nRow - 1), sal_True, sal_False ) : + static_cast< sal_uInt16 >(rItem.nRow - 1), sal_True ) : lcl_InsertBCText(*pSh, rItem, *pFmt, static_cast< sal_uInt16 >(rItem.nCol - 1), - static_cast< sal_uInt16 >(rItem.nRow - 1), sal_False); + static_cast< sal_uInt16 >(rItem.nRow - 1)); } //fill the user fields diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index eada5cc81b4d..5fde0e5d0d78 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -2395,13 +2395,13 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, rtl::OUString sDataSource, sDataTableOrQuery; Sequence<Any> aSelection; - sal_Int16 nCmdType = CommandType::TABLE; + sal_Int32 nCmdType = CommandType::TABLE; uno::Reference< XConnection> xConnection; ODataAccessDescriptor aDescriptor(rProperties); sDataSource = aDescriptor.getDataSource(); - aDescriptor[daCommand] >>= sDataTableOrQuery; - aDescriptor[daCommandType] >>= nCmdType; + OSL_VERIFY(aDescriptor[daCommand] >>= sDataTableOrQuery); + OSL_VERIFY(aDescriptor[daCommandType] >>= nCmdType); if ( aDescriptor.has(daSelection) ) aDescriptor[daSelection] >>= aSelection; diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 43c167211eeb..69e524dd93b6 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -404,6 +404,13 @@ SwXTextDocument::~SwXTextDocument() xNumFmtAgg = 0; } delete m_pPrintUIOptions; + if (m_pRenderData && m_pRenderData->IsViewOptionAdjust()) + { // rhbz#827695: this can happen if the last page is not printed + // the ViewShell has been deleted already by SwView::~SwView + // FIXME: replace this awful implementation of XRenderable with + // something less insane that has its own view + m_pRenderData->ViewOptionAdjustCrashPreventionKludge(); + } delete m_pRenderData; } @@ -3856,14 +3863,17 @@ void SwXDocumentPropertyHelper::onChange() SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions) - : m_rShell( rSh ) + : m_pShell(&rSh) , m_aOldViewOptions( rViewOptions ) { } SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl() { - m_rShell.ApplyViewOptions( m_aOldViewOptions ); + if (m_pShell) + { + m_pShell->ApplyViewOptions( m_aOldViewOptions ); + } } void @@ -3871,14 +3881,14 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) { // to avoid unnecessary reformatting the view options related to the content // below should only change if necessary, that is if respective content is present - const bool bContainsHiddenChars = m_rShell.GetDoc()->ContainsHiddenChars(); - const SwFieldType* pFldType = m_rShell.GetDoc()->GetSysFldType( RES_HIDDENTXTFLD ); + const bool bContainsHiddenChars = m_pShell->GetDoc()->ContainsHiddenChars(); + const SwFieldType* pFldType = m_pShell->GetDoc()->GetSysFldType( RES_HIDDENTXTFLD ); const bool bContainsHiddenFields = pFldType && pFldType->GetDepends(); - pFldType = m_rShell.GetDoc()->GetSysFldType( RES_HIDDENPARAFLD ); + pFldType = m_pShell->GetDoc()->GetSysFldType( RES_HIDDENPARAFLD ); const bool bContainsHiddenParagraphs = pFldType && pFldType->GetDepends(); - pFldType = m_rShell.GetDoc()->GetSysFldType( RES_JUMPEDITFLD ); + pFldType = m_pShell->GetDoc()->GetSysFldType( RES_JUMPEDITFLD ); const bool bContainsPlaceHolders = pFldType && pFldType->GetDepends(); - const bool bContainsFields = m_rShell.IsAnyFieldInDoc(); + const bool bContainsFields = m_pShell->IsAnyFieldInDoc(); SwViewOption aRenderViewOptions( m_aOldViewOptions ); @@ -3918,7 +3928,7 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) if (m_aOldViewOptions != aRenderViewOptions) // check if reformatting is necessary { aRenderViewOptions.SetPrinting( pPrtOptions != NULL ); - m_rShell.ApplyViewOptions( aRenderViewOptions ); + m_pShell->ApplyViewOptions( aRenderViewOptions ); } } diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index ff10bd543f40..cb4ff75c0ed9 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -431,7 +431,7 @@ namespace cmis else SAL_INFO( "cmisucp", "Looking for unsupported property " << rProp.Name ); } - catch ( const libcmis::Exception& e ) + catch (const libcmis::Exception&) { xRow->appendVoid( rProp ); } diff --git a/unotools/inc/unotools/viewoptions.hxx b/unotools/inc/unotools/viewoptions.hxx index 34c00590dc0a..faad44186ea3 100644 --- a/unotools/inc/unotools/viewoptions.hxx +++ b/unotools/inc/unotools/viewoptions.hxx @@ -264,6 +264,13 @@ class UNOTOOLS_DLLPUBLIC SvtViewOptions: public utl::detail::Options sal_Bool IsVisible ( ) const; void SetVisible( sal_Bool bState ); + /** Return true if the "Visible" property actually has a non-nil value + + (IsVisible will somewhat arbitrarily return false if the property is + nil.) + */ + bool HasVisible() const; + /*-****************************************************************************************************//** @short use it to set/get the extended user data (consisting of a set of named scalar values) @descr It's supported for ALL types! diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index 01e1abd3a267..7429e2bde441 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/PropertyValue.hpp> +#include <comphelper/sequenceasvector.hxx> #include <tools/urlobj.hxx> #include <tools/wldcrd.hxx> @@ -490,7 +491,7 @@ void SvtSecurityOptions_Impl::LoadAuthors( void ) Sequence< Any > lValues = GetProperties( lAllAuthors ); if( lValues.getLength() == c2 ) { - m_seqTrustedAuthors.realloc( c1 ); + comphelper::SequenceAsVector< SvtSecurityOptions::Certificate > v; SvtSecurityOptions::Certificate aCert( 3 ); for( i1 = 0, i2 = 0 ; i1 < c1 ; ++i1 ) { @@ -500,8 +501,16 @@ void SvtSecurityOptions_Impl::LoadAuthors( void ) ++i2; lValues[ i2 ] >>= aCert[ 2 ]; ++i2; - m_seqTrustedAuthors[ i1 ] = aCert; + // Filter out TrustedAuthor entries with empty RawData, which + // would cause an unexpected std::bad_alloc in + // SecurityEnvironment_NssImpl::createCertificateFromAscii and + // have been observed in the wild (fdo#55019): + if( !aCert[ 2 ].isEmpty() ) + { + v.push_back( aCert ); + } } + m_seqTrustedAuthors = v.getAsConstList(); } } } diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx index 112ffbb36b33..a327c77f534a 100644 --- a/unotools/source/config/viewoptions.cxx +++ b/unotools/source/config/viewoptions.cxx @@ -283,6 +283,8 @@ class SvtViewOptionsBase_Impl { //------------------------------------------------------------------------------------------------------------- public: + enum State { STATE_NONE, STATE_FALSE, STATE_TRUE }; + SvtViewOptionsBase_Impl ( const ::rtl::OUString& sList ); virtual ~SvtViewOptionsBase_Impl ( ); sal_Bool Exists ( const ::rtl::OUString& sName ); @@ -296,7 +298,7 @@ class SvtViewOptionsBase_Impl sal_Int32 GetPageID ( const ::rtl::OUString& sName ); void SetPageID ( const ::rtl::OUString& sName , sal_Int32 nID ); - sal_Bool GetVisible ( const ::rtl::OUString& sName ); + State GetVisible ( const ::rtl::OUString& sName ); void SetVisible ( const ::rtl::OUString& sName , sal_Bool bVisible ); css::uno::Any GetUserItem ( const ::rtl::OUString& sName , @@ -703,28 +705,33 @@ void SvtViewOptionsBase_Impl::SetPageID( const ::rtl::OUString& sName , } //***************************************************************************************************************** -sal_Bool SvtViewOptionsBase_Impl::GetVisible( const ::rtl::OUString& sName ) +SvtViewOptionsBase_Impl::State SvtViewOptionsBase_Impl::GetVisible( const ::rtl::OUString& sName ) { #ifdef DEBUG_VIEWOPTIONS ++m_nReadCount; #endif - sal_Bool bVisible = sal_False; + State eState = STATE_NONE; try { css::uno::Reference< css::beans::XPropertySet > xNode( impl_getSetNode(sName, sal_False), css::uno::UNO_QUERY); if (xNode.is()) - xNode->getPropertyValue(PROPERTY_VISIBLE) >>= bVisible; + { + sal_Bool bVisible = sal_False; + if (xNode->getPropertyValue(PROPERTY_VISIBLE) >>= bVisible) + { + eState = bVisible ? STATE_TRUE : STATE_FALSE; + } + } } catch(const css::uno::Exception& ex) { - bVisible = sal_False; SVTVIEWOPTIONS_LOG_UNEXPECTED_EXCEPTION(ex) } - return bVisible; + return eState; } //***************************************************************************************************************** @@ -1082,7 +1089,7 @@ sal_Bool SvtViewOptions::IsVisible() const sal_Bool bState = sal_False; if( m_eViewType == E_WINDOW ) - bState = m_pDataContainer_Windows->GetVisible( m_sViewName ); + bState = m_pDataContainer_Windows->GetVisible( m_sViewName ) == SvtViewOptionsBase_Impl::STATE_TRUE; return bState; } @@ -1104,6 +1111,25 @@ void SvtViewOptions::SetVisible( sal_Bool bState ) } //***************************************************************************************************************** +// public method +//***************************************************************************************************************** +bool SvtViewOptions::HasVisible() const +{ + // Ready for multithreading + ::osl::MutexGuard aGuard( GetOwnStaticMutex() ); + + // Safe impossible cases. + // These call isn't allowed for dialogs, tab-dialogs or tab-pages! + OSL_ENSURE( !(m_eViewType==E_DIALOG||m_eViewType==E_TABDIALOG||m_eViewType==E_TABPAGE), "SvtViewOptions::IsVisible()\nCall not allowed for Dialogs, TabDialogs or TabPages! I do nothing!\n" ); + + bool bState = false; + if( m_eViewType == E_WINDOW ) + bState = m_pDataContainer_Windows->GetVisible( m_sViewName ) != SvtViewOptionsBase_Impl::STATE_NONE; + + return bState; +} + +//***************************************************************************************************************** css::uno::Sequence< css::beans::NamedValue > SvtViewOptions::GetUserData() const { // Ready for multithreading diff --git a/vcl/aqua/source/a11y/aqua11yfocustracker.cxx b/vcl/aqua/source/a11y/aqua11yfocustracker.cxx index 822b2b498c99..3bb11688d107 100644 --- a/vcl/aqua/source/a11y/aqua11yfocustracker.cxx +++ b/vcl/aqua/source/a11y/aqua11yfocustracker.cxx @@ -81,7 +81,20 @@ long AquaA11yFocusTracker::WindowEventHandler(AquaA11yFocusTracker *pFocusTracke pFocusTracker->tabpage_activated( getWindow(pEvent) ); break; case VCLEVENT_MENU_HIGHLIGHT: - pFocusTracker->menu_highlighted( static_cast < const VclMenuEvent * > (pEvent) ); + // Inspired by code in WindowEventHandler in + // vcl/unx/gtk/a11y/atkutil.cxx, find out what kind of event + // it is to avoid blindly using a static_cast and crash, + // fdo#47275. + if( const VclMenuEvent* pMenuEvent = dynamic_cast < const VclMenuEvent* > (pEvent) ) + { + pFocusTracker->menu_highlighted( pMenuEvent ); + } + else if( const VclAccessibleEvent* pAccEvent = dynamic_cast < const VclAccessibleEvent* > (pEvent) ) + { + Reference< XAccessible > xAccessible = pAccEvent->GetAccessible(); + if( xAccessible.is() ) + pFocusTracker->setFocusedObject( xAccessible ); + } break; default: break; diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm index 9f4e55e408a0..1be3e4ae5910 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm @@ -378,8 +378,17 @@ static BOOL isPopupMenuOpen = NO; -(id)windowAttribute { // go upstairs until reaching the broken connection AquaA11yWrapper * aWrapper = self; + int loops = 0; while ( [ aWrapper accessibleContext ] -> getAccessibleParent().is() ) { - aWrapper = [ AquaA11yFactory wrapperForAccessibleContext: [ aWrapper accessibleContext ] -> getAccessibleParent() -> getAccessibleContext() ]; + AquaA11yWrapper *aTentativeParentWrapper = [ AquaA11yFactory wrapperForAccessibleContext: [ aWrapper accessibleContext ] -> getAccessibleParent() -> getAccessibleContext() ]; + // Quick-and-dirty fix for infinite loop after fixing crash in + // fdo#47275 + if ( aTentativeParentWrapper == aWrapper ) + break; + // Even dirtier fix for infinite loop in fdo#55156 + if ( loops++ == 100 ) + break; + aWrapper = aTentativeParentWrapper; [ aWrapper autorelease ]; } // get associated NSWindow diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx index 7c6f683751c8..6c65178cae92 100644 --- a/vcl/aqua/source/app/salsys.cxx +++ b/vcl/aqua/source/app/salsys.cxx @@ -106,9 +106,13 @@ rtl::OUString AquaSalSystem::GetDisplayScreenName( unsigned int nScreen ) return aRet; } -static NSString* getStandardString( int nButtonId ) +static NSString* getStandardString( int nButtonId, bool bUseResources ) { - rtl::OUString aText( Button::GetStandardText( nButtonId ) ); + rtl::OUString aText; + if( bUseResources ) + { + aText = Button::GetStandardText( nButtonId ); + } if( aText.isEmpty() ) // this is for bad cases, we might be missing the vcl resource { switch( nButtonId ) @@ -127,7 +131,7 @@ static NSString* getStandardString( int nButtonId ) int AquaSalSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton) + int nDefaultButton, bool bUseResources) { NSString* pTitle = CreateNSString( rTitle ); NSString* pMessage = CreateNSString( rMessage ); @@ -166,11 +170,14 @@ int AquaSalSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, if( aButtonIds[nC].nDefaultButton == nDefaultButton ) { if( aButtonIds[nC].nTextIds[0] != -1 ) - pDefText = getStandardString( aButtonIds[nC].nTextIds[0] ); + pDefText = getStandardString( + aButtonIds[nC].nTextIds[0], bUseResources ); if( aButtonIds[nC].nTextIds[1] != -1 ) - pAltText = getStandardString( aButtonIds[nC].nTextIds[1] ); + pAltText = getStandardString( + aButtonIds[nC].nTextIds[1], bUseResources ); if( aButtonIds[nC].nTextIds[2] != -1 ) - pOthText = getStandardString( aButtonIds[nC].nTextIds[2] ); + pOthText = getStandardString( + aButtonIds[nC].nTextIds[2], bUseResources ); break; } } diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx index f368f514aff1..cf827ef595f2 100644 --- a/vcl/aqua/source/gdi/salatslayout.cxx +++ b/vcl/aqua/source/gdi/salatslayout.cxx @@ -436,7 +436,7 @@ void ATSLayout::DrawText( SalGraphics& rGraphics ) const { const SubPortion& rSubPortion = *it; // calculate sub-portion offset for rotated text - Fixed nXOfsFixed = 0, nYOfsFixed = 0; + Fixed nXOfsFixed = rSubPortion.mnXOffset, nYOfsFixed = 0; if( rAquaGraphics.mnATSUIRotation != 0 ) { const double fRadians = rAquaGraphics.mnATSUIRotation * (M_PI/0xB40000); diff --git a/vcl/generic/app/gensys.cxx b/vcl/generic/app/gensys.cxx index ded4900e8809..4a26a4b19968 100644 --- a/vcl/generic/app/gensys.cxx +++ b/vcl/generic/app/gensys.cxx @@ -47,6 +47,47 @@ using namespace com::sun::star; +namespace { + +OUString GetNativeMessageBoxButtonText( int nButtonId, bool bUseResources ) +{ + OUString aText; + if( bUseResources ) + { + aText = Button::GetStandardText( nButtonId ); + } + if( aText.isEmpty() ) + { + switch( nButtonId ) + { + case BUTTON_OK: + aText = "OK"; + break; + case BUTTON_CANCEL: + aText = "Cancel"; + break; + case BUTTON_ABORT: + aText = "Abort"; + break; + case BUTTON_RETRY: + aText = "Retry"; + break; + case BUTTON_IGNORE: + aText = "Ignore"; + break; + case BUTTON_YES: + aText = "Yes"; + break; + case BUTTON_NO: + aText = "No"; + break; + } + } + return aText; +} + +} + SalGenericSystem::SalGenericSystem() { } @@ -56,7 +97,8 @@ SalGenericSystem::~SalGenericSystem() } int SalGenericSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, - int nButtonCombination, int nDefaultButton ) + int nButtonCombination, int nDefaultButton, + bool bUseResources ) { int nDefButton = 0; std::list< rtl::OUString > aButtons; @@ -67,15 +109,15 @@ int SalGenericSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const r if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK || nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL ) { - aButtons.push_back( Button::GetStandardText( BUTTON_OK ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_OK, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK; } if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL || nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO ) { - aButtons.push_back( Button::GetStandardText( BUTTON_YES ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_YES, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; - aButtons.push_back( Button::GetStandardText( BUTTON_NO ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_NO, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; if( nDefaultButton == SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO ) nDefButton = 1; @@ -86,21 +128,21 @@ int SalGenericSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const r { if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL ) { - aButtons.push_back( Button::GetStandardText( BUTTON_RETRY ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_RETRY, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; } - aButtons.push_back( Button::GetStandardText( BUTTON_CANCEL ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_CANCEL, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL; if( nDefaultButton == SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL ) nDefButton = aButtons.size()-1; } if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE ) { - aButtons.push_back( Button::GetStandardText( BUTTON_ABORT ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_ABORT, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; - aButtons.push_back( Button::GetStandardText( BUTTON_RETRY ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_RETRY, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; - aButtons.push_back( Button::GetStandardText( BUTTON_IGNORE ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_IGNORE, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; switch( nDefaultButton ) { diff --git a/vcl/inc/aqua/salsys.h b/vcl/inc/aqua/salsys.h index 6491cab50048..d352ebb87ddb 100644 --- a/vcl/inc/aqua/salsys.h +++ b/vcl/inc/aqua/salsys.h @@ -52,7 +52,7 @@ public: virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton); + int nDefaultButton, bool bUseResources); }; diff --git a/vcl/inc/generic/gensys.h b/vcl/inc/generic/gensys.h index e485cc50f215..bf98fe657b16 100644 --- a/vcl/inc/generic/gensys.h +++ b/vcl/inc/generic/gensys.h @@ -51,7 +51,7 @@ class VCL_DLLPUBLIC SalGenericSystem : public SalSystem virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton); + int nDefaultButton, bool bUseResources); // simple helpers primarily for X Windowing W_CLASS hints static const char *getFrameResName(); diff --git a/vcl/inc/ios/salsys.h b/vcl/inc/ios/salsys.h index 2184d2b23c30..17c831cf88a2 100644 --- a/vcl/inc/ios/salsys.h +++ b/vcl/inc/ios/salsys.h @@ -46,7 +46,7 @@ public: virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton); + int nDefaultButton, bool bUseResources); }; #endif // _SV_SALSYS_H diff --git a/vcl/inc/salsys.hxx b/vcl/inc/salsys.hxx index 6c9eb37ae011..60b89ad917f6 100644 --- a/vcl/inc/salsys.hxx +++ b/vcl/inc/salsys.hxx @@ -133,6 +133,10 @@ public: The effect of specifying a button that doesn't belong to the specified button combination is undefined. + @param bUseResources + If false, assume initialization of the application failed early and do + not try to access any resources. + @returns the identifier of the button that was pressed by the user. See button identifier above. If the function fails the return value is 0. @@ -140,7 +144,8 @@ public: virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton) = 0; + int nDefaultButton, + bool bUseResources ) = 0; }; SalSystem* ImplGetSalSystem(); diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index af766f4a9762..9e1d88d9cbf0 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -111,9 +111,9 @@ class VCL_DLLPUBLIC ApplicationEvent { public: enum Type { - TYPE_ACCEPT, TYPE_APPEAR, TYPE_HELP, TYPE_OPEN, TYPE_OPENHELPURL, - TYPE_PRINT, TYPE_PRIVATE_DOSHUTDOWN, TYPE_QUICKSTART, TYPE_SHOWDIALOG, - TYPE_UNACCEPT + TYPE_ACCEPT, TYPE_APPEAR, TYPE_HELP, TYPE_VERSION, TYPE_OPEN, + TYPE_OPENHELPURL, TYPE_PRINT, TYPE_PRIVATE_DOSHUTDOWN, TYPE_QUICKSTART, + TYPE_SHOWDIALOG, TYPE_UNACCEPT }; ApplicationEvent() {} diff --git a/vcl/inc/win/salsys.h b/vcl/inc/win/salsys.h index b15c1a773600..c70b03219730 100644 --- a/vcl/inc/win/salsys.h +++ b/vcl/inc/win/salsys.h @@ -76,7 +76,7 @@ public: virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton); + int nDefaultButton, bool bUseResources); bool initMonitors(); // discards monitorinfo; used by WM_DISPLAYCHANGED handler void clearMonitors(); diff --git a/vcl/ios/source/app/salsys.cxx b/vcl/ios/source/app/salsys.cxx index 02cd6442525a..8501e3f6ba8d 100644 --- a/vcl/ios/source/app/salsys.cxx +++ b/vcl/ios/source/app/salsys.cxx @@ -106,9 +106,13 @@ rtl::OUString IosSalSystem::GetDisplayScreenName( unsigned int nScreen ) return aRet; } -static NSString* getStandardString( int nButtonId ) +static NSString* getStandardString( int nButtonId, bool bUseResources ) { - rtl::OUString aText( Button::GetStandardText( nButtonId ) ); + rtl::OUString aText; + if( bUseResources ) + { + aText = Button::GetStandardText( nButtonId ); + } if( ! aText.getLength() ) // this is for bad cases, we might be missing the vcl resource { switch( nButtonId ) @@ -150,7 +154,7 @@ static NSString* getStandardString( int nButtonId ) int IosSalSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton) + int nDefaultButton, bool bUseResources) { NSString* pTitle = CreateNSString( rTitle ); NSString* pMessage = CreateNSString( rMessage ); @@ -189,11 +193,14 @@ int IosSalSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, if( aButtonIds[nC].nDefaultButton == nDefaultButton ) { if( aButtonIds[nC].nTextIds[0] != -1 ) - pDefText = getStandardString( aButtonIds[nC].nTextIds[0] ); + pDefText = getStandardString( + aButtonIds[nC].nTextIds[0], bUseResources ); if( aButtonIds[nC].nTextIds[1] != -1 ) - pAltText = getStandardString( aButtonIds[nC].nTextIds[1] ); + pAltText = getStandardString( + aButtonIds[nC].nTextIds[1], bUseResources ); if( aButtonIds[nC].nTextIds[2] != -1 ) - pOthText = getStandardString( aButtonIds[nC].nTextIds[2] ); + pOthText = getStandardString( + aButtonIds[nC].nTextIds[2], bUseResources ); break; } } diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 7e6d54471169..b98f3a6a68b0 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1736,7 +1736,7 @@ void Application::ShowNativeErrorBox(const String& sTitle , sTitle, sMessage, SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, false); if (btn != SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK) { OSL_TRACE("ShowNativeMessageBox returned %d", btn); } diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index c1c0954175ef..c7432efbbbfe 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -410,7 +410,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); // Do not change the setting in case the user chooses to cancel if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) @@ -434,7 +434,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); // Do not change the setting in case the user chooses to cancel if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) @@ -458,7 +458,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); // Do not change the setting in case the user chooses to cancel if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) @@ -482,7 +482,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); // Do not change the setting in case the user chooses to cancel if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) @@ -522,7 +522,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); // Do not change the setting in case the user chooses to cancel if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) @@ -536,7 +536,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, true); } } } diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 96507fde1621..b5ba7e2d18d9 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -152,12 +152,15 @@ XubString Button::GetStandardText( StandardButtonType eButton ) sal_uInt32 nResId = aResIdAry[(sal_uInt16)eButton].nResId; aText = ResId(nResId, *pResMgr).toString(); - // Windows (apparently) has some magic auto-accelerator evil around - // ok / cancel so add this only for Unix -#ifdef UNX - if( nResId == SV_BUTTONTEXT_OK || nResId == SV_BUTTONTEXT_CANCEL ) - aText.Insert( String::CreateFromAscii("~"), 0 ); + if (nResId == SV_BUTTONTEXT_OK || nResId == SV_BUTTONTEXT_CANCEL) + { +#ifndef WNT + // Windows (apparently) has some magic auto-accelerator evil around + // ok / cancel so add accelerators only for Unix + if (aText.Search('~') == STRING_NOTFOUND) + aText.Insert(String::CreateFromAscii("~"), 0); #endif + } } else { diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx index b5576c97ebb1..0a0dcacc79d6 100644 --- a/vcl/win/source/app/salinfo.cxx +++ b/vcl/win/source/app/salinfo.cxx @@ -220,7 +220,7 @@ static int DEFAULT_BTN_MAPPING_TABLE[][8] = { MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1 } //RETRY_CANCEL }; -int WinSalSystem::ShowNativeMessageBox(const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, int nDefaultButton) +int WinSalSystem::ShowNativeMessageBox(const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, int nDefaultButton, SAL_UNUSED_PARAMETER bool) { DBG_ASSERT( nButtonCombination >= SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK && nButtonCombination <= SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL && diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx index bb060eb559cd..dfb54a1f7f2b 100644 --- a/writerfilter/source/dmapper/ConversionHelper.cxx +++ b/writerfilter/source/dmapper/ConversionHelper.cxx @@ -144,77 +144,16 @@ void MakeBorderLine( sal_Int32 nLineThickness, sal_Int32 nLineType, if(!bIsOOXML && sal::static_int_cast<sal_uInt32>(nLineColor) < SAL_N_ELEMENTS(aBorderDefColor)) nLineColor = aBorderDefColor[nLineColor]; - sal_Int16 nLineStyle = NONE; // Map to our border types, we should use of one equal line // thickness, or one of smaller thickness. If too small we // can make the defecit up in additional white space or // object size - switch(nLineType) - { - // First the single lines - case 1: - case 2: - case 5: - nLineStyle = SOLID; - break; - // Dotted and dashed lines - case 6: - nLineStyle = DOTTED; - break; - case 7: - case 22: - nLineStyle = DASHED; - break; - // and the unsupported special cases which we map to a single line - case 8: - case 9: - case 20: - nLineStyle = SOLID; - break; - // Double line - case 3: - case 10: //Don't have tripple so use double - case 21: - case 23: - nLineStyle = DOUBLE; - break; - case 11: - case 13: //Don't have thin thick thin, so use thick thin - nLineStyle = THINTHICK_SMALLGAP; - break; - case 12: - nLineStyle = THICKTHIN_SMALLGAP; - break; - case 14: - nLineStyle = THINTHICK_MEDIUMGAP; - break; - case 15: - case 16: //Don't have thin thick thin, so use thick thin - nLineStyle = THICKTHIN_MEDIUMGAP; - break; - case 17: - nLineStyle = THINTHICK_LARGEGAP; - break; - case 18: - case 19: //Don't have thin thick thin, so use thick thin - nLineStyle = THICKTHIN_LARGEGAP; - break; - // Embossed and engraved lines - case 24: - nLineStyle = EMBOSSED; - break; - case 25: - nLineStyle = ENGRAVED; - break; - case 0: - case 255: - default: - break; - } - + ::editeng::SvxBorderStyle const nLineStyle( + ::editeng::ConvertBorderStyleFromWord(nLineType)); rToFill.LineStyle = nLineStyle; double const fConverted( (NONE == nLineStyle) ? 0.0 : - ::editeng::ConvertBorderWidthFromWord(nLineStyle, nLineThickness)); + ::editeng::ConvertBorderWidthFromWord(nLineStyle, nLineThickness, + nLineType)); rToFill.LineWidth = convertTwipToMM100(fConverted); rToFill.Color = nLineColor; } diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 3ce3eb2d0248..3ff8519ce029 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3617,8 +3617,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) { m_pImpl->getTableManager().utext(data_, len); - // RTF always uses text() instead of utext() for run break - if(len == 1 && ((*data_) == 0x0d || (*data_) == 0x07) && !IsRTFImport()) + if(len == 1 && (sText[0] == 0x0d || sText[0] == 0x07)) { PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH); if (pContext && m_pImpl->GetSettingsTable()->GetSplitPgBreakAndParaMark()) diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 90d86365d281..925aaa635877 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -925,6 +925,10 @@ void GraphicImport::lcl_attribute(Id nName, Value & val) uno::makeAny( aSize.Height ) ); xGraphProps->setPropertyValue( rtl::OUString("Width"), uno::makeAny( aSize.Width ) ); + + // We need to drop the shape here somehow + uno::Reference< lang::XComponent > xShapeComponent( xShape, uno::UNO_QUERY ); + xShapeComponent->dispose( ); } } catch( const beans::UnknownPropertyException & ) diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 3c19e6f28670..10a1749d7a07 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -913,14 +913,20 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) if( aElement != end()) aElement->second >>= eWritingMode; - - sal_Int32 nTextAreaHeight = eWritingMode == text::WritingMode_LR_TB ? nHeight - m_nTopMargin - m_nBottomMargin : nWidth - m_nLeftMargin - m_nRightMargin; + sal_Int32 nGridLinePitch = m_nGridLinePitch; + //sep.dyaLinePitch + if (nGridLinePitch < 1 || nGridLinePitch > 31680) + { + SAL_WARN("writerfilter", "sep.dyaLinePitch outside legal range: " << nGridLinePitch); + nGridLinePitch = 1; + } + operator[]( PropertyDefinition( PROP_GRID_LINES, false )) = - uno::makeAny( static_cast<sal_Int16>(nTextAreaHeight/m_nGridLinePitch)); + uno::makeAny( static_cast<sal_Int16>(nTextAreaHeight/nGridLinePitch)); sal_Int32 nCharWidth = 423; //240 twip/ 12 pt //todo: is '0' the right index here? @@ -950,7 +956,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) nCharWidth += ConversionHelper::convertTwipToMM100( nFraction ); } operator[]( PropertyDefinition( PROP_GRID_BASE_HEIGHT, false )) = uno::makeAny( nCharWidth ); - sal_Int32 nRubyHeight = m_nGridLinePitch - nCharWidth; + sal_Int32 nRubyHeight = nGridLinePitch - nCharWidth; if(nRubyHeight < 0 ) nRubyHeight = 0; operator[]( PropertyDefinition( PROP_GRID_RUBY_HEIGHT, false )) = uno::makeAny( nRubyHeight ); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index fb18553ddb58..45e1920c9ea5 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -991,6 +991,14 @@ void RTFDocumentImpl::text(OUString& rString) return; } + // Are we in the middle of the table definition? (No cell defs yet, but we already have some cell props.) + if (m_aStates.top().aTableCellSprms.find(NS_ooxml::LN_CT_TcPrBase_vAlign).get() && + m_aStates.top().nCells == 0) + { + m_aTableBuffer.push_back(make_pair(BUFFER_UTEXT, RTFValue::Pointer_t(new RTFValue(rString)))); + return; + } + checkFirstRun(); checkNeedPap(); @@ -2441,9 +2449,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) m_aDefaultState.aCharacterSprms.set(NS_sprm::LN_CLidBi, pIntValue); break; case RTF_CHCBPAT: - if (nParam) { - RTFValue::Pointer_t pValue(new RTFValue(getColorTable(nParam))); + RTFValue::Pointer_t pValue(new RTFValue(nParam ? getColorTable(nParam) : COL_AUTO)); lcl_putNestedAttribute(m_aStates.top().aCharacterSprms, NS_sprm::LN_CShd, NS_ooxml::LN_CT_Shd_fill, pValue); } break; @@ -3483,6 +3490,8 @@ int RTFDocumentImpl::popState() // This is the end of the doc, see if we need to close the last section. if (m_nGroup == 1 && !m_bFirstRun) { + if (m_bNeedCr) + dispatchSymbol(RTF_PAR); m_bDeferredContSectBreak = false; sectBreak(true); } diff --git a/xmlhelp/Library_ucpchelp1.mk b/xmlhelp/Library_ucpchelp1.mk index 2dfe46f4edcf..b3988503b581 100644 --- a/xmlhelp/Library_ucpchelp1.mk +++ b/xmlhelp/Library_ucpchelp1.mk @@ -94,4 +94,10 @@ $(eval $(call gb_Library_add_exception_objects,ucpchelp1,\ xmlhelp/source/cxxhelp/util/Decompressor \ )) +ifeq ($(HAVE_CXX0X),TRUE) +$(eval $(call gb_Library_add_defs,ucpchelp1,\ + -DHAVE_CXX0X \ +)) +endif + # vim: set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 028fad1931bf..a7a7ed64d6c2 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -31,6 +31,9 @@ #include <set> #include <vector> +#ifndef HAVE_CXX0X +#define BOOST_NO_0X_HDR_TYPEINDEX +#endif #include <boost/unordered_map.hpp> #include <boost/unordered_set.hpp> #include <osl/mutex.hxx> diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx index 402a734fc7d9..e8ac5ed86a56 100644 --- a/xmlhelp/source/cxxhelp/provider/db.hxx +++ b/xmlhelp/source/cxxhelp/provider/db.hxx @@ -36,6 +36,9 @@ #include "com/sun/star/ucb/XSimpleFileAccess.hpp" +#ifndef HAVE_CXX0X +#define BOOST_NO_0X_HDR_TYPEINDEX +#endif #include <boost/unordered_map.hpp> #include <rtl/string.hxx> diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx index c5d3e75ce4f2..284e88fa550f 100644 --- a/xmloff/inc/xmloff/txtparae.hxx +++ b/xmloff/inc/xmloff/txtparae.hxx @@ -44,6 +44,7 @@ #include <xmloff/SinglePropertySetInfoCache.hxx> #include <xmloff/XMLStringVector.hxx> #include <vector> +#include <boost/scoped_ptr.hpp> class XMLTextListsHelper; class SvXMLExport; @@ -76,6 +77,8 @@ namespace xmloff class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport { + struct Impl; + ::boost::scoped_ptr<Impl> m_pImpl; // SvXMLExport& rExport; SvXMLAutoStylePoolP& rAutoStylePool; diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index 00856c83572a..56a5e6783f21 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -1452,6 +1452,24 @@ void XMLShapeExport::ImpExportConnectorShape( } } + // get matrix + ::basegfx::B2DHomMatrix aMatrix; + ImpExportNewTrans_GetB2DHomMatrix(aMatrix, xProps); + + // decompose and correct about pRefPoint + ::basegfx::B2DTuple aTRScale; + double fTRShear(0.0); + double fTRRotate(0.0); + ::basegfx::B2DTuple aTRTranslate; + ImpExportNewTrans_DecomposeAndRefPoint(aMatrix, aTRScale, fTRShear, + fTRRotate, aTRTranslate, pRefPoint); + + // fdo#49678: create and export ViewBox + awt::Point aPoint(0, 0); + awt::Size aSize(FRound(aTRScale.getX()), FRound(aTRScale.getY())); + SdXMLImExViewBox aViewBox(0, 0, aSize.Width, aSize.Height); + mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX, aViewBox.GetExportString()); + // write connector shape. Add Export later. sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210# SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_CONNECTOR, bCreateNewline, sal_True); diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx index 8b8f842ec7f7..0a607efd1bd9 100644 --- a/xmloff/source/style/chrhghdl.cxx +++ b/xmloff/source/style/chrhghdl.cxx @@ -67,6 +67,7 @@ sal_Bool XMLCharHeightHdl::importXML( const OUString& rStrImpValue, uno::Any& rV if (::sax::Converter::convertDouble(fSize, rStrImpValue, eSrcUnit, util::MeasureUnit::POINT)) { + fSize = ::std::max<double>(fSize, 1.0); // fdo#49876: 0pt is invalid rValue <<= (float)fSize; return sal_True; } @@ -82,6 +83,7 @@ sal_Bool XMLCharHeightHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV float fSize = 0; if( rValue >>= fSize ) { + fSize = ::std::max<float>(fSize, 1.0f); // fdo#49876: 0pt is invalid ::sax::Converter::convertDouble(aOut, (double)fSize, true, util::MeasureUnit::POINT, util::MeasureUnit::POINT); aOut.append( sal_Unicode('p')); diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 410bb05d6938..7b17574845e8 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -1696,6 +1696,7 @@ void XMLTextFieldExport::ExportFieldHelper( ProcessString(XML_TARGET_FRAME_NAME, GetStringProperty(sPropertyTargetFrame,rPropSet), sal_True, XML_NAMESPACE_OFFICE); + GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); SvXMLElementExport aUrlField(rExport, XML_NAMESPACE_TEXT, XML_A, sal_False, sal_False); GetExport().Characters(sPresentation); diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 04b008cd993b..01ad5dc8e164 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1153,11 +1153,36 @@ void XMLTextParagraphExport::exportListChange( } } +struct XMLTextParagraphExport::Impl +{ + typedef ::std::map<Reference<XFormField>, sal_Int32> FieldMarkMap_t; + FieldMarkMap_t m_FieldMarkMap; + + explicit Impl() {} + sal_Int32 AddFieldMarkStart(Reference<XFormField> const& i_xFieldMark) + { + assert(m_FieldMarkMap.find(i_xFieldMark) == m_FieldMarkMap.end()); + sal_Int32 const ret(m_FieldMarkMap.size()); + m_FieldMarkMap.insert(::std::make_pair(i_xFieldMark, ret)); + return ret; + } + sal_Int32 GetFieldMarkIndex(Reference<XFormField> const& i_xFieldMark) + { + FieldMarkMap_t::const_iterator const it( + m_FieldMarkMap.find(i_xFieldMark)); + // rely on SwXFieldmark::CreateXFieldmark returning the same instance + // because the Reference in m_FieldMarkMap will keep it alive + assert(it != m_FieldMarkMap.end()); + return it->second; + } +}; + XMLTextParagraphExport::XMLTextParagraphExport( SvXMLExport& rExp, SvXMLAutoStylePoolP & rASP ) : XMLStyleExport( rExp, OUString(), &rASP ), + m_pImpl(new Impl), rAutoStylePool( rASP ), pBoundFrameSets(new BoundFrameSets(GetExport().GetModel())), pFieldExport( 0 ), @@ -2179,7 +2204,8 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( sal_Bool bAutoStyles, sal_Bool bIsProgress, sal_Bool bPrvChrIsSpc ) { - static OUString sMeta("InContentMetadata"); + static const OUString sMeta("InContentMetadata"); + static const OUString sFieldMarkName("__FieldMark_"); bool bPrevCharIsSpace = bPrvChrIsSpc; /* This is used for exporting to strict OpenDocument 1.2, in which case traditional @@ -2291,16 +2317,22 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( Reference< ::com::sun::star::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); if (xFormField.is()) { + OUString sName; Reference< ::com::sun::star::container::XNameAccess > xParameters(xFormField->getParameters(), UNO_QUERY); if (xParameters.is() && xParameters->hasByName("Name")) { const Any aValue = xParameters->getByName("Name"); OUString sValue; - if (aValue >>= sValue) - { - GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, sValue); - } + aValue >>= sName; + } + if (sName.isEmpty()) + { // name attribute is mandatory, so have to pull a + // rabbit out of the hat here + sName = sFieldMarkName + OUString::valueOf( + m_pImpl->AddFieldMarkStart(xFormField)); } + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, + sName); SvXMLElementExport aElem( GetExport(), !bAutoStyles, XML_NAMESPACE_TEXT, XML_BOOKMARK_START, sal_False, sal_False ); @@ -2333,20 +2365,25 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( Reference< ::com::sun::star::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); if (xFormField.is()) { + OUString sName; Reference< ::com::sun::star::container::XNameAccess > xParameters(xFormField->getParameters(), UNO_QUERY); if (xParameters.is() && xParameters->hasByName("Name")) { const Any aValue = xParameters->getByName("Name"); - OUString sValue; - if (aValue >>= sValue) - { - GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, sValue); - } + aValue >>= sName; } + if (sName.isEmpty()) + { // name attribute is mandatory, so have to pull a + // rabbit out of the hat here + sName = sFieldMarkName + OUString::valueOf( + m_pImpl->GetFieldMarkIndex(xFormField)); + } + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, + sName); + SvXMLElementExport aElem( GetExport(), !bAutoStyles, + XML_NAMESPACE_TEXT, XML_BOOKMARK_END, + sal_False, sal_False ); } - SvXMLElementExport aElem( GetExport(), !bAutoStyles, - XML_NAMESPACE_TEXT, XML_BOOKMARK_END, - sal_False, sal_False ); } } else if (sType.equals(sTextFieldStartEnd)) @@ -2376,10 +2413,10 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( if (xBookmark.is()) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName()); + SvXMLElementExport aElem( GetExport(), !bAutoStyles, + XML_NAMESPACE_TEXT, XML_BOOKMARK, + sal_False, sal_False ); } - SvXMLElementExport aElem( GetExport(), !bAutoStyles, - XML_NAMESPACE_TEXT, XML_BOOKMARK, - sal_False, sal_False ); } } else if (sType.equals(sSoftPageBreak)) diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index edf8c2d1f79d..b2edddc28243 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -276,7 +276,6 @@ XMLPropertyMapEntry aXMLParaPropMap[] = MP_E( "ParaRegisterModeActive", STYLE, REGISTER_TRUE, XML_TYPE_BOOL, 0 ), // RES_PARATR_NUMRULE MP_E( "NumberingStyleName", STYLE, LIST_STYLE_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STYLENAME, CTF_NUMBERINGSTYLENAME ), - MP_E( "NumberingRules", TEXT, ENABLE_NUMBERING, MID_FLAG_NO_PROPERTY|XML_TYPE_BOOL, CTF_ALIEN_ATTRIBUTE_IMPORT ), // RES_FILL_ORDER // not required |