diff options
109 files changed, 1726 insertions, 871 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 7454b1b83358..399f0b700f98 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -411,11 +411,13 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt ) long nLinSz = pModulWindow->GetHScrollBar()->GetLineSize(); (void)nLinSz; long nThumb = pModulWindow->GetHScrollBar()->GetThumbPos(); (void)nThumb; #endif - sal_Bool bDone = sal_False; sal_Bool bWasModified = pEditEngine->IsModified(); - if ( !TextEngine::DoesKeyChangeText( rKEvt ) || ImpCanModify() ) + // see if there is an accelerator to be processed first + sal_Bool bDone = SfxViewShell::Current()->KeyInput( rKEvt ); + + if ( !bDone && ( !TextEngine::DoesKeyChangeText( rKEvt ) || ImpCanModify() ) ) { - if ( ( rKEvt.GetKeyCode().GetCode() == KEY_A) && rKEvt.GetKeyCode().IsMod1() ) + if ( ( rKEvt.GetKeyCode().GetCode() == KEY_A) && rKEvt.GetKeyCode().IsMod1() && !rKEvt.GetKeyCode().IsMod2() ) pEditView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) ); else if ( ( rKEvt.GetKeyCode().GetCode() == KEY_Y ) && rKEvt.GetKeyCode().IsMod1() ) bDone = sal_True; // CTRL-Y schlucken, damit kein Vorlagenkatalog @@ -442,7 +444,6 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt ) } if ( !bDone ) { - if ( !SfxViewShell::Current()->KeyInput( rKEvt ) ) Window::KeyInput( rKEvt ); } else diff --git a/basctl/uiconfig/basicide/toolbar/findbar.xml b/basctl/uiconfig/basicide/toolbar/findbar.xml new file mode 100644 index 000000000000..0338d3156195 --- /dev/null +++ b/basctl/uiconfig/basicide/toolbar/findbar.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> +<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar"> + <toolbar:toolbaritem xlink:href=".uno:FindText"/> + <toolbar:toolbaritem xlink:href=".uno:DownSearch"/> + <toolbar:toolbaritem xlink:href=".uno:UpSearch"/> + <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:visible="false"/> +</toolbar:toolbar> diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx index 1febb2809bf4..558a01353fbd 100644 --- a/basic/source/app/app.cxx +++ b/basic/source/app/app.cxx @@ -243,10 +243,8 @@ int BasicApp::Main( ) try { -#ifdef _USE_UNO + // this line is not ( afaics ) necessary ( remove from master ) uno::Reference< XContentProviderManager > xUcb = InitializeUCB(); -#endif - { DirEntry aIniPath( Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ) ); if ( !aIniPath.Exists() ) diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index e46c51caee11..ac02051ba679 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -171,8 +171,6 @@ void SbiStream::MapError() } } -#ifdef _USE_UNO - // TODO: Code is copied from daemons2/source/uno/asciiEncoder.cxx ::rtl::OUString findUserInDescription( const ::rtl::OUString& aDescription ) @@ -205,7 +203,6 @@ void SbiStream::MapError() return user; } -#endif // Hack for #83750 @@ -213,7 +210,6 @@ sal_Bool runsInSetup( void ); sal_Bool needSecurityRestrictions( void ) { -#ifdef _USE_UNO static sal_Bool bNeedInit = sal_True; static sal_Bool bRetVal = sal_True; @@ -290,9 +286,6 @@ sal_Bool needSecurityRestrictions( void ) } return bRetVal; -#else - return sal_False; -#endif } // Returns sal_True if UNO is available, otherwise the old file @@ -300,7 +293,6 @@ sal_Bool needSecurityRestrictions( void ) // #89378 New semantic: Don't just ask for UNO but for UCB sal_Bool hasUno( void ) { -#ifdef _USE_UNO static sal_Bool bNeedInit = sal_True; static sal_Bool bRetVal = sal_True; @@ -326,9 +318,6 @@ sal_Bool hasUno( void ) } } return bRetVal; -#else - return sal_False; -#endif } @@ -421,7 +410,6 @@ void OslStream::SetSize( sal_uIntPtr nSize ) } -#ifdef _USE_UNO class UCBStream : public SvStream { @@ -585,8 +573,6 @@ void UCBStream::SetSize( sal_uIntPtr nSize ) SetError( ERRCODE_IO_GENERAL ); } -#endif - // Oeffnen eines Streams SbError SbiStream::Open ( short nCh, const ByteString& rName, short nStrmMode, short nFlags, short nL ) @@ -601,7 +587,6 @@ SbError SbiStream::Open String aStr( rName, gsl_getSystemTextEncoding() ); String aNameStr = getFullPath( aStr ); -#ifdef _USE_UNO if( hasUno() ) { Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); @@ -646,7 +631,6 @@ SbError SbiStream::Open } } -#endif if( !pStrm ) { pStrm = new OslStream( aNameStr, nStrmMode ); diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index 0eb9ae7bf047..9e77ad94c35d 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -183,6 +183,8 @@ ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs) : aFmtFldMax.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl)); aFmtFldStepMain.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl)); aFmtFldOrigin.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl)); + + HideAllControls(); } IMPL_LINK( ScaleTabPage, FmtFieldModifiedHdl, FormattedField*, pFmtFied ) @@ -784,6 +786,49 @@ bool ScaleTabPage::ShowWarning( sal_uInt16 nResIdMessage, Control* pControl /* = return true; } +void ScaleTabPage::HideAllControls() +{ + // We need to set these controls invisible when the class is instantiated + // since some code in EnableControls() depends on that logic. The real + // visibility of these controls depend on axis data type, and are + // set in EnableControls(). + + m_aTxt_AxisType.Hide(); + m_aLB_AxisType.Hide(); + + aCbxLogarithm.Hide(); + aTxtMin.Hide(); + aFmtFldMin.Hide(); + aCbxAutoMin.Hide(); + aTxtMax.Hide(); + aFmtFldMax.Hide(); + aCbxAutoMax.Hide(); + aTxtMain.Hide(); + aFmtFldStepMain.Hide(); + aCbxAutoStepMain.Hide(); + aTxtHelp.Hide(); + aTxtHelpCount.Hide(); + aMtStepHelp.Hide(); + aCbxAutoStepHelp.Hide(); + + aTxtOrigin.Hide(); + aFmtFldOrigin.Hide(); + aCbxAutoOrigin.Hide(); + + aTxtHelpCount.Hide(); + aTxtHelp.Hide(); + + m_aTxt_TimeResolution.Hide(); + m_aLB_TimeResolution.Hide(); + m_aCbx_AutoTimeResolution.Hide(); + + aFmtFldStepMain.Hide(); + m_aMt_MainDateStep.Hide(); + + m_aLB_MainTimeUnit.Hide(); + m_aLB_HelpTimeUnit.Hide(); +} + //............................................................................. } //namespace chart //............................................................................. diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx index f062ed438383..0a56b4f7a0bd 100644 --- a/chart2/source/controller/dialogs/tp_Scale.hxx +++ b/chart2/source/controller/dialogs/tp_Scale.hxx @@ -138,6 +138,8 @@ private: @return false, if nResIdMessage was 0, true otherwise */ bool ShowWarning( sal_uInt16 nResIdMessage, Control* pControl = NULL ); + + void HideAllControls(); }; //............................................................................. diff --git a/configure.in b/configure.in index 895d43be5451..522b705e8ec0 100755 --- a/configure.in +++ b/configure.in @@ -403,15 +403,6 @@ AC_ARG_ENABLE(check-only, ], ,) -AC_ARG_ENABLE(ccache-skip, - AS_HELP_STRING([--enable-ccache-skip], - [Allow the use of --ccache-skip to escape compiler flags that would - otherwise prevent caching of the result (currently used on Mac only) - NOTE: requires patched version because of a bug in ccache (see issue - 104567 for details and patch) explicitly enable if your version of - ccache doesn't identify as version 2.4_OOo. (default=auto)]), -,enable_ccache_skip=auto) - AC_ARG_ENABLE(build-unowinreg, AS_HELP_STRING([--enable-build-unowinreg], [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++ @@ -2879,19 +2870,14 @@ fi AC_SUBST(HAVE_CXX0X) # =================================================================== -# use --ccache-skip? +# use ccache? # =================================================================== -dnl used to escape compiler options for ccache that otherwise prevent +dnl need to check for ccache version: otherwise prevents dnl caching of the results (like "-x objective-c++" for Mac) -AC_MSG_CHECKING([whether we are allowed and able to use --ccache-skip]) +AC_MSG_CHECKING([whether we are able to use --ccache-skip]) if test "$_os" != "Darwin" ; then AC_MSG_RESULT([only used on Mac currently, skipping]) -elif test "$enable_ccache_skip" = "no" ; then - AC_MSG_RESULT([no - diabled explicitly]) -elif test "$enable_ccache_skip" = "yes" ; then - AC_MSG_RESULT([yes - enabled explicitly, skipping checks]) - AC_SUBST([USE_CCACHE], [YES]) -elif test "$enable_ccache_skip" = "auto" ; then +else # checking for ccache presence/version AC_MSG_RESULT([probing...]) AC_PATH_PROG([CCACHE],[ccache],[not_found]) @@ -2901,7 +2887,8 @@ elif test "$enable_ccache_skip" = "auto" ; then # check ccache version AC_MSG_CHECKING([whether version of ccache is suitable]) CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'` - if test "$CCACHE_VERSION" = "2.4_OOo"; then + CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` + if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then AC_MSG_RESULT([yes]) AC_MSG_CHECKING([whether ccache is actually used for the build]) AC_LANG_PUSH([C++]) @@ -2920,11 +2907,9 @@ elif test "$enable_ccache_skip" = "auto" ; then AC_LANG_POP([C++]) else AC_MSG_RESULT([no]) - AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip]) + AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. ccache will not be used.]) fi fi -else - AC_MSG_ERROR([invalid option to --enable-ccache-skip. Valid values are "auto", "yes" and "no"]) fi dnl =================================================================== @@ -7150,11 +7135,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Watch Window extension integration]) if test "z$enable_ext_watch_window" = "z" -o "z$enable_ext_watch_window" = "zno" ; then AC_MSG_RESULT([no]) + WATCH_WINDOW_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW" + WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt" fi -AC_SUBST(WITH_WATCH_WINDOW_EXTENSION) +AC_SUBST(WATCH_WINDOW_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Diagram extension @@ -7162,11 +7149,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Diagram extension integration]) if test "z$enable_ext_diagram" = "z" -o "z$enable_ext_diagram" = "zno" ; then AC_MSG_RESULT([no]) + DIAGRAM_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM" + DIAGRAM_EXTENSION_PACK="41c9b65ad60af4b3255bbecdfef11736-Diagram_1.1.0.0.oxt" fi -AC_SUBST(WITH_DIAGRAM_EXTENSION) +AC_SUBST(DIAGRAM_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Validator extension @@ -7174,11 +7163,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Validator extension integration]) if test "z$enable_ext_validator" = "z" -o "z$enable_ext_validator" = "zno" ; then AC_MSG_RESULT([no]) + VALIDATOR_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR" + VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt" fi -AC_SUBST(WITH_VALIDATOR_EXTENSION) +AC_SUBST(VALIDATOR_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Barcode extension @@ -7186,11 +7177,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Barcode extension integration]) if test "z$enable_ext_barcode" = "z" -o "z$enable_ext_barcode" = "zno" ; then AC_MSG_RESULT([no]) + BARCODE_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE" + BARCODE_EXTENSION_PACK="7e7efc5d4a03126bb9ae3ae9aa2c4e87-Barcode_1.3.1.0.oxt" fi -AC_SUBST(WITH_BARCODE_EXTENSION) +AC_SUBST(BARCODE_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include ConvertTextToNumber extension @@ -7198,11 +7191,14 @@ dnl =================================================================== AC_MSG_CHECKING([for ConvertTextToNumber extension integration]) if test "z$enable_ext_ct2n" = "z" -o "z$enable_ext_ct2n" = "zno" ; then AC_MSG_RESULT([no]) + CT2N_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) BUILD_TYPE="$BUILD_TYPE CT2N" SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N" + CT2N_EXTENSION_PACK="451ccf439a36a568653b024534669971-ConvertTextToNumber-1.3.2.oxt" fi +AC_SUBST(CT2N_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Numbertext extension @@ -7210,11 +7206,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Numbertext extension integration]) if test "z$enable_ext_numbertext" = "z" -o "z$enable_ext_numbertext" = "zno" ; then AC_MSG_RESULT([no]) + NUMBERTEXT_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT" + NUMBERTEXT_EXTENSION_PACK="b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext-0.9.4.oxt" fi -AC_SUBST(WITH_NUMBERTEXT_EXTENSION) +AC_SUBST(NUMBERTEXT_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Hungarian Cross-reference Toolbar extension @@ -7222,11 +7220,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration]) if test "z$enable_ext_hunart" = "z" -o "z$enable_ext_hunart" = "zno" ; then AC_MSG_RESULT([no]) + HUNART_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART" + HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart-0.3.oxt" fi -AC_SUBST(WITH_HUNART_EXTENSION) +AC_SUBST(HUNART_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Typography Toolbar extension @@ -7234,11 +7234,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Typography Toolbar extension integration]) if test "z$enable_ext_typo" = "z" -o "z$enable_ext_typo" = "zno" ; then AC_MSG_RESULT([no]) + TYPO_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO" + TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo-0.4.2.oxt" fi -AC_SUBST(WITH_TYPO_EXTENSION) +AC_SUBST(TYPO_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Google Docs extension @@ -7246,10 +7248,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Google Docs extension integration]) if test "z$enable_ext_google_docs" = "z" -o "z$enable_ext_google_docs" = "zno" ; then AC_MSG_RESULT([no]) + GOOGLE_DOCS_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS" + GOOGLE_DOCS_EXTENSION_PACK="dbaafd21de055e582d92d7d32fe9da13-gdocs_2.3.1.oxt" fi +AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include NLPSolver extension diff --git a/desktop/source/pagein/pagein.c b/desktop/source/pagein/pagein.c index 3ba12f9437a2..947b4b7375d5 100755 --- a/desktop/source/pagein/pagein.c +++ b/desktop/source/pagein/pagein.c @@ -107,16 +107,25 @@ int pagein_execute (int argc, char **argv) if ((argv[i][0] == '@') && ((fp = fopen (argv[i], "r")) == 0)) { - char path[1024]; + char fullpath[4096]; + char *path; + strncpy (fullpath, argv[i] + 1, 3000); + if (!(path = strrchr (fullpath, '/'))) + path = fullpath; + else + path++; + if ((fp = fopen (&(argv[i][1]), "r")) == 0) { fprintf (stderr, "fopen %s: %s\n", &(argv[i][1]), strerror(errno)); continue; } - while (fgets (path, sizeof(path), fp) != 0) + while (fgets (path, 1024, fp) != 0) { path[strlen(path) - 1] = '\0', k = 0; - if (do_pagein (path, &k) == 0) + + /* paths relative to the location of the pagein file */ + if (do_pagein (fullpath, &k) == 0) { /* accumulate total size */ nbytes += k; diff --git a/desktop/unx/source/args.c b/desktop/unx/source/args.c index 0f47f791d5eb..d69fe62e2466 100644 --- a/desktop/unx/source/args.c +++ b/desktop/unx/source/args.c @@ -61,10 +61,10 @@ static struct { { "minimized", 0, 1, 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" }, + { "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 }, diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index e81cd6129d0a..b3042f75ea24 100755 --- a/desktop/unx/source/start.c +++ b/desktop/unx/source/start.c @@ -728,6 +728,24 @@ system_checks( void ) /* re-use the pagein code */ extern int pagein_execute (int argc, char **argv); +#define REL_PATH "/../basis-link/program" +static char *build_pagein_path (Args *args, const char *pagein_name) +{ + char *path; + rtl_String *app_path; + + app_path = ustr_to_str (args->pAppPath); + path = malloc (app_path->length + strlen (pagein_name) + sizeof (REL_PATH) + 8); + strcpy (path, "@"); + strcpy (path + 1, rtl_string_getStr (app_path)); + strcat (path, "/../basis-link/program/"); + strcat (path, pagein_name); + + rtl_string_release( app_path ); + + return path; +} + void exec_pagein (Args *args) { @@ -735,24 +753,20 @@ exec_pagein (Args *args) #ifdef MACOSX (void)args; #else - char *argv[5]; - rtl_String *app_path; - - app_path = ustr_to_str (args->pAppPath); + char *argv[3]; + /* don't use -L - since that does a chdir that breaks relative paths */ argv[0] = "dummy-pagein"; - argv[1] = malloc (app_path->length + sizeof ("-L/../basis-link/program") + 2); - strcpy (argv[1], "-L"); - strcat (argv[1], app_path->buffer); - strcat (argv[1], "/../basis-link/program"); - argv[2] = "@pagein-common"; - argv[3] = (char *)args->pPageinType; - argv[4] = NULL; - - rtl_string_release( app_path ); + argv[1] = build_pagein_path (args, "pagein-common"); + if (args->pPageinType) { + argv[2] = build_pagein_path (args, args->pPageinType); + } else + argv[2] = NULL; - pagein_execute (args->pPageinType ? 4 : 3, argv); + pagein_execute (args->pPageinType ? 3 : 2, argv); + if (argv[2]) + free (argv[2]); free (argv[1]); #endif } diff --git a/distro-configs/LibreOfficeMacOSX.conf b/distro-configs/LibreOfficeMacOSX.conf index 28f49fa3838c..387b970518db 100644 --- a/distro-configs/LibreOfficeMacOSX.conf +++ b/distro-configs/LibreOfficeMacOSX.conf @@ -1,8 +1,6 @@ --with-vendor=The Document Foundation ---enable-opengl ---enable-hids +--enable-epm --enable-binfilter ---with-fonts --with-java-target-version=1.5 --enable-ext-presenter-minimizer --enable-ext-presenter-console diff --git a/distro-configs/OxygenOfficeLinux.conf b/distro-configs/OxygenOfficeLinux.conf index d2050eb0009d..a1a432737041 100644 --- a/distro-configs/OxygenOfficeLinux.conf +++ b/distro-configs/OxygenOfficeLinux.conf @@ -1,5 +1,7 @@ --with-vendor=OxygenOffice Professional Team --with-build-version=OxygenOffice Professional Beta 3.4.0 M000 - OxygenOffice Build 0 +--with-intro-bitmap=$TARFILE_LOCATION/openintro_ooop.png +--with-about-bitmap=$TARFILE_LOCATION/openabout_ooop.png --enable-binfilter --enable-vba --enable-build-mozilla diff --git a/distro-configs/OxygenOfficeWin32.conf b/distro-configs/OxygenOfficeWin32.conf index 45927e0dd351..ba6f999b653c 100644 --- a/distro-configs/OxygenOfficeWin32.conf +++ b/distro-configs/OxygenOfficeWin32.conf @@ -1,5 +1,7 @@ --with-vendor=OxygenOffice Professional Team --with-build-version=OxygenOffice Professional Beta 3.4.0 M000 - OxygenOffice Build 0 +--with-intro-bitmap=$TARFILE_LOCATION/openintro_ooop.png +--with-about-bitmap=$TARFILE_LOCATION/openabout_ooop.png --enable-binfilter --enable-vba --disable-build-mozilla @@ -34,6 +34,18 @@ fi # we want to clone if we are in the bootstrap git repo and clone does not exist yet # we need to test for a .git in order not to clone after rsync if we are called in # the inner autogen of the buid-repo based build + +check_file() +{ + echo "Looking for $1 ..." + if test -f $1; then + echo "ok" + else + echo "missing required archive; run './download' again"; + exit 1; + fi +} + if [ -d .git ] ; then if [ -z "$GIT_LINK_SRC" ]; then ./g -f clone @@ -276,6 +288,24 @@ if [ "$GUI" = "WNT" -a -n "$md5sum" ]; then fi fi +# OxygenOffice extras +echo "Unpacking OxygenOffice extras ..." +for pack in $OOOP_FONTS_PACK $OOOP_GALLERY_PACK $OOOP_SAMPLES_PACK $OOOP_TEMPLATES_PACK ; do + check_file $TARFILE_LOCATION/$pack + echo "Unpacking $pack ..." + unzip -o -q $TARFILE_LOCATION/$pack -d $SRC_ROOT/extras/source +done + +# Extensions copy +echo "Copy extensions to their location ..." +for pack in $BARCODE_EXTENSION_PACK $DIAGRAM_EXTENSION_PACK $VALIDATOR_EXTENSION_PACK $WATCH_WINDOW_EXTENSION_PACK $NUMBERTEXT_EXTENSION_PACK $HUNART_EXTENSION_PACK $TYPO_EXTENSION_PACK $GOOGLE_DOCS_EXTENSION_PACK ; do + check_file $TARFILE_LOCATION/$pack + packfilename=`echo "$pack" | cut --only-delimited --delimiter=- --fields=2 | cut --delimiter=_ --fields=1` + echo "Copy extension: '$pack' as '$packfilename.oxt' ..." + mkdir -p $SRC_ROOT/extras/source/extensions/ || exit 1 + cp $TARFILE_LOCATION/$pack $SRC_ROOT/extras/source/extensions/$packfilename.oxt || exit 1 +done + [ -x "post_download" ] || { echo "'post_download' script not found, run ./autogen.sh." ; exit 1 ; } ./post_download || exit 1 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 7b65b92c6e55..efc8dc4c8c38 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -113,7 +113,7 @@ SV_IMPL_VARARR( EECharAttribArray, EECharAttrib ); static SfxItemPool* pGlobalPool=0; -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- // EditEngine // ---------------------------------------------------------------------- EditEngine::EditEngine( SfxItemPool* pItemPool ) diff --git a/filter/inc/filter/msfilter/msocximex.hxx b/filter/inc/filter/msfilter/msocximex.hxx index b639730785ec..5e1915d0406f 100644 --- a/filter/inc/filter/msfilter/msocximex.hxx +++ b/filter/inc/filter/msfilter/msocximex.hxx @@ -1177,6 +1177,31 @@ public: const com::sun::star::awt::Size& rSize ); }; +class HTML_Select : public OCX_ModernControl +{ +public: + HTML_Select() : OCX_ModernControl(rtl::OUString::createFromAscii("TextBox")) { + msFormType = rtl::OUString::createFromAscii("com.sun.star.form.component.ListBox"); + msDialogType = rtl::OUString::createFromAscii("com.sun.star.form.component.ListBox"); + mnBackColor = 0x80000005L; + mnForeColor = 0x80000008L; + nBorderColor = 0x80000006L; + aFontData.SetHasAlign(sal_True); + fEnabled = true; + nMultiState =false; + } + + using OCX_ModernControl::Import; // to not hide the other two import methods + virtual sal_Bool Import(com::sun::star::uno::Reference< + com::sun::star::beans::XPropertySet> &rPropSet); + + static OCX_Control *Create() { return new HTML_Select;} + + virtual sal_Bool Read(SotStorageStream *pS); + virtual sal_Bool ReadFontData(SotStorageStream *pS); + com::sun::star::uno::Sequence< rtl::OUString > msListData; + com::sun::star::uno::Sequence< sal_Int16 > msIndices; +}; class HTML_TextBox : public OCX_ModernControl { diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx index 3d87c8f8fa0a..835070c58116 100644 --- a/filter/source/msfilter/msocximex.cxx +++ b/filter/source/msfilter/msocximex.cxx @@ -4270,6 +4270,8 @@ OCX_map aOCXTab[] = {&OCX_ProgressBar::Create,"", form::FormComponentType::CONTROL,""}, {&HTML_TextBox::Create,"5512D124-5CC6-11CF-8d67-00aa00bdce1d", form::FormComponentType::TEXTFIELD,"TextBox"}, + {&HTML_Select::Create,"5512D122-5CC6-11CF-8d67-00aa00bdce1d", + form::FormComponentType::LISTBOX,"ListBox"}, }; const int NO_OCX = sizeof( aOCXTab ) / sizeof( *aOCXTab ); @@ -5054,6 +5056,143 @@ sal_Bool HTML_TextBox::ReadFontData(SotStorageStream * /*pS*/) return sal_True; } +// HTML_Select +sal_Bool HTML_Select::Import(com::sun::star::uno::Reference< + com::sun::star::beans::XPropertySet> &rPropSet) +{ + uno::Any aTmp(&sName,getCppuType((OUString *)0)); + rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp ); + + sal_Bool bTmp=fEnabled; + aTmp = bool2any(bTmp); + rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp); + + bTmp=fLocked; + aTmp = bool2any(bTmp); + rPropSet->setPropertyValue( WW8_ASCII2STR("ReadOnly"), aTmp); + + aTmp <<= ImportColor(mnForeColor); + rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp); + + sal_Bool bTemp = nMultiState; + aTmp = bool2any(bTemp); + rPropSet->setPropertyValue( WW8_ASCII2STR("MultiSelection"), aTmp); + + aTmp <<= ImportColor(mnBackColor); + rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp); + + aTmp <<= ImportBorder(nSpecialEffect,nBorderStyle); + rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp); + + aTmp <<= ImportColor( nBorderColor ); + rPropSet->setPropertyValue( WW8_ASCII2STR("BorderColor"), aTmp); + + if ( msListData.getLength() ) + { + aTmp <<= msListData; + rPropSet->setPropertyValue( WW8_ASCII2STR("StringItemList"), aTmp); + if ( msIndices.getLength() ) + { + aTmp <<= msIndices; + rPropSet->setPropertyValue( WW8_ASCII2STR("SelectedItems"), aTmp); + } + } + rPropSet->setPropertyValue( WW8_ASCII2STR("Dropdown"), uno::makeAny( sal_True )); + + return sal_True; +} + +sal_Bool HTML_Select::Read(SotStorageStream *pS) +{ + static rtl::OUString sTerm( RTL_CONSTASCII_USTRINGPARAM("</SELECT") ); + static String sMultiple( RTL_CONSTASCII_USTRINGPARAM("<SELECT MULTIPLE") ); + static String sSelected( RTL_CONSTASCII_USTRINGPARAM("OPTION SELECTED") ); + + // we should be positioned at the html fragment ( really we should + // reorganise the reading of controls from excel such that the position and + // lenght of the associated record in the Ctls stream is available + // But since we don't know about the lenght of the stream lets read the stream + // until we reach the end of the fragment + // I wish I know where there was a html parser in openoffice + OUStringBuffer buf(40); + bool bTerminate = false; + do + { + sal_uInt16 ch = 0; + *pS >> ch; + sal_Unicode uni = static_cast< sal_Unicode >( ch ); + // if the buffer ends with </SELECT> we are done + if ( uni == '>' ) + { + rtl::OUString bufContents( buf.getStr() ); + if ( bufContents.indexOf( sTerm ) != -1 ) + bTerminate = true; + + } + buf.append( &uni, 1 ); + + } while ( !pS->IsEof() && !bTerminate ); + String data = buf.makeStringAndClear(); + + // replace crlf with lf + data.SearchAndReplaceAll( String( RTL_CONSTASCII_USTRINGPARAM( "\x0D\x0A" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "\x0A" ) ) ); + std::vector< rtl::OUString > listValues; + std::vector< sal_Int16 > selectedIndices; + + // Ultra hacky parser for the info + sal_Int32 nTokenCount = data.GetTokenCount( '\n' ); + + for ( sal_Int32 nToken = 0; nToken < nTokenCount; ++nToken ) + { + String sLine( data.GetToken( nToken, '\n' ) ); + if ( !nToken ) // first line will tell us if multiselect is enabled + { + if ( sLine.CompareTo( sMultiple, sMultiple.Len() ) == COMPARE_EQUAL ) + nMultiState = true; + } + // skip first and last lines, no data there + else if ( nToken < nTokenCount - 1) + { + if ( sLine.GetTokenCount( '>' ) ) + { + String displayValue = sLine.GetToken( 1, '>' ); + if ( displayValue.Len() ) + { + // Really we should be using a proper html parser + // escaping some common bits to be escaped + displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "<" ) ), String( RTL_CONSTASCII_USTRINGPARAM("<") ) ); + displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( ">" ) ), String( RTL_CONSTASCII_USTRINGPARAM(">") ) ); + displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( """ ) ), String( RTL_CONSTASCII_USTRINGPARAM("\"") ) ); + displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "&" ) ), String( RTL_CONSTASCII_USTRINGPARAM("&") ) ); + listValues.push_back( displayValue ); + if( sLine.Search( sSelected ) != STRING_NOTFOUND ) + selectedIndices.push_back( static_cast< sal_Int16 >( listValues.size() ) - 1 ); + } + } + } + } + if ( listValues.size() ) + { + msListData.realloc( listValues.size() ); + sal_Int32 index = 0; + for( std::vector< rtl::OUString >::iterator it = listValues.begin(); it != listValues.end(); ++it, ++index ) + msListData[ index ] = *it; + } + if ( selectedIndices.size() ) + { + msIndices.realloc( selectedIndices.size() ); + sal_Int32 index = 0; + for( std::vector< sal_Int16 >::iterator it = selectedIndices.begin(); it != selectedIndices.end(); ++it, ++index ) + msIndices[ index ] = *it; + } + return sal_True; +} + +sal_Bool HTML_Select::ReadFontData(SotStorageStream* /*pS*/) +{ + return sal_True; +} + // Doesn't really read anything but just skips the // record. sal_Bool OCX_TabStrip::Read(SotStorageStream *pS) diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst index 5124ddebdca9..2fb7e97558da 100644 --- a/instsetoo_native/util/openoffice.lst +++ b/instsetoo_native/util/openoffice.lst @@ -9,7 +9,7 @@ Globals UREPACKAGEVERSION 3.4.0 URELAYERVERSION 1 BASISROOTNAME LibreOffice - UNIXBASISROOTNAME libreoffice + UNIXBASISROOTNAME libreoffice3.4 SERVICETAG_PRODUCTNAME LibreOffice 3.4 SERVICETAG_PRODUCTVERSION 3.4 SERVICETAG_PARENTNAME LibreOffice 3.4 @@ -57,10 +57,10 @@ LibreOffice PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 BASEPRODUCTVERSION 3.4 @@ -75,7 +75,7 @@ LibreOffice FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} LICENSENAME LGPL GLOBALFILEGID gid_File_Lib_Vcl GLOBALPATCHFILEGID gid_File_Txt_Patchfiles @@ -125,10 +125,10 @@ LibreOffice_wJRE PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 BASEPRODUCTVERSION 3.4 @@ -142,7 +142,7 @@ LibreOffice_wJRE FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} LICENSENAME LGPL WITHJREPRODUCT 1 GLOBALFILEGID gid_File_Lib_Vcl @@ -189,12 +189,12 @@ LibreOffice_Dev PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 BASISROOTNAME LibO-dev UNIXBASISROOTNAME lo-dev POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 BASEPRODUCTVERSION 3.4 @@ -212,7 +212,7 @@ LibreOffice_Dev FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} LICENSENAME LGPL GLOBALFILEGID gid_File_Lib_Vcl GLOBALPATCHFILEGID gid_File_Txt_Patchfiles @@ -264,9 +264,9 @@ URE PACKAGEVERSION 3.4 PACKAGEREVISION 1 PRODUCTEXTENSION - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 LICENSENAME LGPL SETSTATICPATH 1 NOVERSIONINDIRNAME 1 @@ -305,12 +305,12 @@ LibreOffice_SDK PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 POSTVERSIONEXTENSION SDK POSTVERSIONEXTENSIONUNIX sdk - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} PACK_INSTALLED 1 POOLPRODUCT 0 DMG_VOLUMEEXTENSION SDK @@ -351,14 +351,14 @@ LibreOffice_Dev_SDK PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 BASISROOTNAME LibO-dev UNIXBASISROOTNAME lo-dev POSTVERSIONEXTENSION SDK POSTVERSIONEXTENSIONUNIX sdk - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} BASISPACKAGEPREFIX libobasis-dev UREPACKAGEPREFIX lodev SOLSUREPACKAGEPREFIX lodev @@ -400,14 +400,13 @@ OxygenOffice variables { PRODUCTNAME OxygenOffice - PRODUCTNAME_BR OxygenOffice PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 BASEPRODUCTVERSION 3.4 @@ -422,7 +421,7 @@ OxygenOffice FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} LICENSENAME LGPL SERVICESPROJEKT 1 GLOBALFILEGID gid_File_Lib_Vcl @@ -436,12 +435,14 @@ OxygenOffice STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A} CHANGETARGETDIR 1 USE_FILEVERSION 1 - LIBRARYVERSION 9.3.0 + LIBRARYVERSION 9.4.0 PATCHCODEFILE ooo_patchcodes.txt DOWNLOADBANNER ooobanner_ooop.bmp DOWNLOADBITMAP ooobitmap_ooop.bmp - DOWNLOADBANNER_BR ooobanner_ooop.bmp - DOWNLOADBITMAP_BR ooobitmap_ooop.bmp + PROGRESSBARCOLOR 126,170,23 + PROGRESSSIZE 430,5 + PROGRESSPOSITION 5,230 + PROGRESSFRAMECOLOR 207,208,211 DOWNLOADSETUPICO ooosetup.ico RELATIVE_PATHES_IN_DDF 1 STARTCENTER_ADDFEATURE_URL http://extensions.libreoffice.org/ @@ -469,17 +470,16 @@ OxygenOffice_wJRE variables { PRODUCTNAME OxygenOffice - PRODUCTNAME_BR OxygenOffice PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 - BASEPRODUCTVERSION 3.3 + BASEPRODUCTVERSION 3.4 UPDATEURL http://update.libreoffice.org/ProductUpdateService/check.Update ODFNOTIFYURL http://odfnotify.libreoffice.org/OOo3.0/notification.jsp?version=ODF ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,javaversion2.dat,userland.txt,version.lst @@ -490,7 +490,7 @@ OxygenOffice_wJRE FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} LICENSENAME LGPL SERVICESPROJEKT 1 WITHJREPRODUCT 1 @@ -505,14 +505,16 @@ OxygenOffice_wJRE STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A} CHANGETARGETDIR 1 USE_FILEVERSION 1 - LIBRARYVERSION 9.3.0 + LIBRARYVERSION 9.4.0 PATCHCODEFILE ooo_patchcodes.txt JAVAPRODUCT 1 DOWNLOADBANNER ooobanner_ooop.bmp DOWNLOADBITMAP ooobitmap_ooop.bmp - DOWNLOADBANNER_BR ooobanner_ooop.bmp - DOWNLOADBITMAP_BR ooobitmap_ooop.bmp DOWNLOADSETUPICO ooosetup.ico + PROGRESSBARCOLOR 126,170,23 + PROGRESSSIZE 430,5 + PROGRESSPOSITION 5,230 + PROGRESSFRAMECOLOR 207,208,211 RELATIVE_PATHES_IN_DDF 1 STARTCENTER_ADDFEATURE_URL http://extensions.libreoffice.org/ STARTCENTER_INFO_URL http://www.libreoffice.org/ diff --git a/offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl b/offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl new file mode 100644 index 000000000000..3a535617f1de --- /dev/null +++ b/offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl @@ -0,0 +1,78 @@ +/* + * 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. + * + * The Initial Developer of the Original Code is + * Markus Mohrhard <markus.mohrhard@googlemail.com> + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Major Contributor(s): + * Markus Mohrhard <markus.mohrhard@googlemail.com> + * + * 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. + */ + +#ifndef __com_sun_star_sheet_XUnnamedDatabaseRanges_idl__ +#define __com_sun_star_sheet_XUnnamedDatabaseRanges_idl__ + +#ifndef __com_sun_star_table_CellRangeAddress_idl__ +#include <com/sun/star/table/CellRangeAddress.idl> +#endif + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +#ifndef __com_sun_star_container_NoSuchElementException_idl__ +#include <com/sun/star/container/NoSuchElementException.idl> +#endif + +#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__ +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module sheet { + +//============================================================================= + +/** provides functions to manage the sheet local databases + */ + +interface XUnnamedDatabaseRanges: com::sun::star::uno::XInterface + { + void setByTable( [in] com::sun::star::table::CellRangeAddress aRange ) + raises( com::sun::star::lang::IndexOutOfBoundsException ); + + any getByTable( [in] long nTab ) + raises( com::sun::star::container::NoSuchElementException, + com::sun::star::lang::IndexOutOfBoundsException ); + + boolean hasByTable ( [in] long nTab ) + raises( com::sun::star::lang::IndexOutOfBoundsException ); + + }; + +//============================================================================= + +}; }; }; }; + +#endif + diff --git a/offapi/com/sun/star/sheet/makefile.mk b/offapi/com/sun/star/sheet/makefile.mk index 37a0cadacacd..10bb43d23173 100644 --- a/offapi/com/sun/star/sheet/makefile.mk +++ b/offapi/com/sun/star/sheet/makefile.mk @@ -338,6 +338,7 @@ IDLFILES=\ XSubTotalDescriptor.idl\ XSubTotalField.idl\ XUniqueCellFormatRangesSupplier.idl\ + XUnnamedDatabaseRanges.idl\ XUsedAreaCursor.idl\ XViewFreezable.idl\ XViewPane.idl\ diff --git a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu index ccd1e979fbef..031a01a831a1 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu @@ -146,6 +146,20 @@ <value>true</value> </prop> </node> + <node oor:name="private:resource/toolbar/findbar" oor:op="replace"> + <prop oor:name="DockPos" oor:type="xs:string"> + <value>1,0</value> + </prop> + <prop oor:name="DockingArea" oor:type="xs:int"> + <value>1</value> + </prop> + <prop oor:name="UIName" oor:type="xs:string"> + <value xml:lang="en-US">Find</value> + </prop> + <prop oor:name="Visible" oor:type="xs:boolean"> + <value>false</value> + </prop> + </node> </node> </node> </oor:component-data> diff --git a/ooo.lst.in b/ooo.lst.in index 94d69c21d5ea..f20a385e956d 100644 --- a/ooo.lst.in +++ b/ooo.lst.in @@ -90,4 +90,13 @@ http://ooo.itc.hu/oxygenoffice/download/libreoffice/ @OOOP_TEMPLATES_PACK@ @OOOP_FONTS_PACK@ @OOOP_SAMPLES_PACK@ +@CT2N_EXTENSION_PACK@ +@BARCODE_EXTENSION_PACK@ +@DIAGRAM_EXTENSION_PACK@ +@VALIDATOR_EXTENSION_PACK@ +@WATCH_WINDOW_EXTENSION_PACK@ +@NUMBERTEXT_EXTENSION_PACK@ +@HUNART_EXTENSION_PACK@ +@TYPO_EXTENSION_PACK@ +@GOOGLE_DOCS_EXTENSION_PACK@ diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx index fa32ea026fca..4c0670534dab 100644 --- a/oox/inc/oox/xls/workbookhelper.hxx +++ b/oox/inc/oox/xls/workbookhelper.hxx @@ -201,6 +201,12 @@ public: ::rtl::OUString& orName, const ::com::sun::star::table::CellRangeAddress& rRangeAddr ) const; + /** Creates and returns an unnamed database range on-the-fly in the Calc document. + The range will not be buffered in the global table buffer. */ + ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRange > + createUnnamedDatabaseRangeObject( + const ::com::sun::star::table::CellRangeAddress& rRangeAddr ) const; + /** Creates and returns a com.sun.star.style.Style object for cells or pages. */ ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > createStyleObject( diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 224b15068353..8bd8a3985fa5 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/awt/FontUnderline.hpp> #include <com/sun/star/awt/Gradient.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/drawing/FillStyle.hpp> @@ -76,6 +77,7 @@ #include <oox/export/chartexport.hxx> using namespace ::com::sun::star; +using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::i18n; @@ -105,6 +107,7 @@ using ::sax_fastparser::FSHelperPtr; #define IDS(x) (OString(#x " ") + OString::valueOf( mnShapeIdMax++ )).getStr() + struct CustomShapeTypeTranslationTable { const char* sOOo; @@ -408,17 +411,34 @@ awt::Size ShapeExport::MapSize( const awt::Size& rSize ) const sal_Bool ShapeExport::NonEmptyText( Reference< XShape > xShape ) { Reference< XPropertySet > xPropSet( xShape, UNO_QUERY ); - sal_Bool bIsEmptyPresObj = sal_False; - if( xPropSet.is() && ( xPropSet->getPropertyValue( S( "IsEmptyPresentationObject" ) ) >>= bIsEmptyPresObj ) ) { - DBG(printf("empty presentation object %d, props:\n", bIsEmptyPresObj)); - if( bIsEmptyPresObj ) - return sal_True; - } - sal_Bool bIsPresObj = sal_False; - if( xPropSet.is() && ( xPropSet->getPropertyValue( S( "IsPresentationObject" ) ) >>= bIsPresObj ) ) { - DBG(printf("presentation object %d, props:\n", bIsPresObj)); - if( bIsPresObj ) - return sal_True; + + if( xPropSet.is() ) + { + Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); + if ( xPropSetInfo.is() ) + { + if ( xPropSetInfo->hasPropertyByName( S( "IsEmptyPresentationObject" ) ) ) + { + sal_Bool bIsEmptyPresObj = sal_False; + if ( xPropSet->getPropertyValue( S( "IsEmptyPresentationObject" ) ) >>= bIsEmptyPresObj ) + { + DBG(printf("empty presentation object %d, props:\n", bIsEmptyPresObj)); + if( bIsEmptyPresObj ) + return sal_True; + } + } + + if ( xPropSetInfo->hasPropertyByName( S( "IsPresentationObject" ) ) ) + { + sal_Bool bIsPresObj = sal_False; + if ( xPropSet->getPropertyValue( S( "IsPresentationObject" ) ) >>= bIsPresObj ) + { + DBG(printf("presentation object %d, props:\n", bIsPresObj)); + if( bIsPresObj ) + return sal_True; + } + } + } } Reference< XSimpleText > xText( xShape, UNO_QUERY ); diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index f8447b64a4a7..693ccb1be7dd 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -463,6 +463,7 @@ TransitionType Transparency TriState Type +UnnamedDatabaseRanges URL Url UseFilterCriteriaSource diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx index 7cf359f6d3c9..e7b6f321f9b0 100644 --- a/oox/source/xls/autofilterbuffer.cxx +++ b/oox/source/xls/autofilterbuffer.cxx @@ -772,8 +772,7 @@ void AutoFilterBuffer::finalizeImport( sal_Int16 nSheet ) if( pFilterDBName->getAbsoluteRange( aFilterRange ) && (aFilterRange.Sheet == nSheet) ) { // use the same name for the database range as used for the defined name '_FilterDatabase' - OUString aDBRangeName = pFilterDBName->getCalcName(); - Reference< XDatabaseRange > xDatabaseRange = createDatabaseRangeObject( aDBRangeName, aFilterRange ); + Reference< XDatabaseRange > xDatabaseRange = createUnnamedDatabaseRangeObject( aFilterRange ); // first, try to create an auto filter bool bHasAutoFilter = finalizeImport( xDatabaseRange ); // no success: try to create an advanced filter diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx index a0ad1144b152..d3390204bce7 100644 --- a/oox/source/xls/tablebuffer.cxx +++ b/oox/source/xls/tablebuffer.cxx @@ -94,7 +94,7 @@ void Table::finalizeImport() if( (maModel.mnId > 0) && (maModel.maDisplayName.getLength() > 0) ) try { maDBRangeName = maModel.maDisplayName; - Reference< XDatabaseRange > xDatabaseRange( createDatabaseRangeObject( maDBRangeName, maModel.maRange ), UNO_SET_THROW ); + Reference< XDatabaseRange > xDatabaseRange( createUnnamedDatabaseRangeObject( maModel.maRange ), UNO_SET_THROW ); maDestRange = xDatabaseRange->getDataArea(); // get formula token index of the database range diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx index ed13bddadfa7..b7533d3f7a2e 100644 --- a/oox/source/xls/workbookhelper.cxx +++ b/oox/source/xls/workbookhelper.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/document/XActionLockable.hpp> #include <com/sun/star/sheet/XDatabaseRange.hpp> #include <com/sun/star/sheet/XDatabaseRanges.hpp> +#include <com/sun/star/sheet/XUnnamedDatabaseRanges.hpp> #include <com/sun/star/sheet/XNamedRange.hpp> #include <com/sun/star/sheet/XNamedRanges.hpp> #include <com/sun/star/sheet/XSpreadsheet.hpp> @@ -140,6 +141,8 @@ public: Reference< XNamedRange > createNamedRangeObject( OUString& orName, sal_Int32 nNameFlags ) const; /** Creates and returns a database range on-the-fly in the Calc document. */ Reference< XDatabaseRange > createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const; + /** Creates and returns an unnamed database range on-the-fly in the Calc document. */ + Reference< XDatabaseRange > createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr ) const; /** Creates and returns a com.sun.star.style.Style object for cells or pages. */ Reference< XStyle > createStyleObject( OUString& orStyleName, bool bPageStyle ) const; @@ -400,6 +403,28 @@ Reference< XDatabaseRange > WorkbookData::createDatabaseRangeObject( OUString& o return xDatabaseRange; } +Reference< XDatabaseRange > WorkbookData::createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr ) const +{ + // validate cell range + CellRangeAddress aDestRange = rRangeAddr; + bool bValidRange = getAddressConverter().validateCellRange( aDestRange, true, true ); + + // create database range and insert it into the Calc document + Reference< XDatabaseRange > xDatabaseRange; + PropertySet aDocProps( mxDoc ); + Reference< XUnnamedDatabaseRanges > xDatabaseRanges( aDocProps.getAnyProperty( PROP_UnnamedDatabaseRanges ), UNO_QUERY_THROW ); + if( bValidRange ) try + { + xDatabaseRanges->setByTable( aDestRange ); + xDatabaseRange.set( xDatabaseRanges->getByTable( aDestRange.Sheet ), UNO_QUERY ); + } + catch( Exception& ) + { + } + OSL_ENSURE( xDatabaseRange.is(), "WorkbookData::createDatabaseRangeObject - cannot create database range" ); + return xDatabaseRange; +} + Reference< XStyle > WorkbookData::createStyleObject( OUString& orStyleName, bool bPageStyle ) const { Reference< XStyle > xStyle; @@ -748,6 +773,11 @@ Reference< XDatabaseRange > WorkbookHelper::createDatabaseRangeObject( OUString& return mrBookData.createDatabaseRangeObject( orName, rRangeAddr ); } +Reference< XDatabaseRange > WorkbookHelper::createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr ) const +{ + return mrBookData.createUnnamedDatabaseRangeObject( rRangeAddr ); +} + Reference< XStyle > WorkbookHelper::createStyleObject( OUString& orStyleName, bool bPageStyle ) const { return mrBookData.createStyleObject( orStyleName, bPageStyle ); @@ -947,4 +977,4 @@ bool WorkbookHelperRoot::isValid() const } // namespace xls } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx index 0094ea388541..9025e8fd9b22 100644 --- a/sal/qa/osl/security/osl_Security.cxx +++ b/sal/qa/osl/security/osl_Security.cxx @@ -393,8 +393,11 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *, strUserName = ::rtl::OUString::createFromAscii( pw->pw_name ); /// get home directory; + char *pw_dir = pw->pw_dir; + if( getenv( "FAKEROOTKEY" ) ) + pw_dir = getenv("HOME"); CPPUNIT_ASSERT_MESSAGE( "#Convert from system path to URL failed.", - ::osl::File::E_None == ::osl::File::getFileURLFromSystemPath( ::rtl::OUString::createFromAscii( pw->pw_dir ), strHomeDirectory ) ); + ::osl::File::E_None == ::osl::File::getFileURLFromSystemPath( ::rtl::OUString::createFromAscii( pw_dir ), strHomeDirectory ) ); /// get config directory; strConfigDirectory = strHomeDirectory.copy(0); diff --git a/sc/inc/datauno.hxx b/sc/inc/datauno.hxx index cf47b7b3bc62..34345e4a3c07 100644 --- a/sc/inc/datauno.hxx +++ b/sc/inc/datauno.hxx @@ -40,6 +40,7 @@ #include <com/sun/star/sheet/XConsolidationDescriptor.hpp> #include <com/sun/star/sheet/XDatabaseRanges.hpp> #include <com/sun/star/sheet/XDatabaseRange.hpp> +#include <com/sun/star/sheet/XUnnamedDatabaseRanges.hpp> #include <com/sun/star/sheet/XSubTotalDescriptor.hpp> #include <com/sun/star/sheet/XSubTotalField.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -501,6 +502,8 @@ private: String aName; SfxItemPropertySet aPropSet; XDBRefreshListenerArr_Impl aRefreshListeners; + bool bIsUnnamed; + SCTAB aTab; private: ScDBData* GetDBData_Impl() const; @@ -508,6 +511,7 @@ private: public: ScDatabaseRangeObj(ScDocShell* pDocSh, const String& rNm); + ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab); virtual ~ScDatabaseRangeObj(); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); @@ -662,6 +666,32 @@ public: throw(::com::sun::star::uno::RuntimeException); }; +class ScUnnamedDatabaseRangesObj : public cppu::WeakImplHelper1< + com::sun::star::sheet::XUnnamedDatabaseRanges>, + public SfxListener +{ +private: + ScDocShell* pDocShell; + +public: + ScUnnamedDatabaseRangesObj(ScDocShell* pDocSh); + virtual ~ScUnnamedDatabaseRangesObj(); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + // XUnnamedDatabaseRanges + virtual void SAL_CALL setByTable( const ::com::sun::star::table::CellRangeAddress& aRange ) + throw(::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException ); + virtual com::sun::star::uno::Any SAL_CALL getByTable( const sal_Int32 nTab ) + throw(::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::container::NoSuchElementException ); + virtual sal_Bool SAL_CALL hasByTable( sal_Int32 nTab ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); +}; + #endif diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 19496d0f3f15..3c485fd48575 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1487,7 +1487,6 @@ public: VirtualDevice* GetVirtualDevice_100th_mm(); SC_DLLPUBLIC OutputDevice* GetRefDevice(); // WYSIWYG: Printer, otherwise VirtualDevice... - void EraseNonUsedSharedNames(sal_uInt16 nLevel); sal_Bool GetNextSpellingCell(SCCOL& nCol, SCROW& nRow, SCTAB nTab, sal_Bool bInSel, const ScMarkData& rMark) const; diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 30ca8406d11e..d71040906443 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -297,6 +297,11 @@ public: ::rtl::OUString maDBName; ::rtl::OUString maCommand; DBType(sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const ::rtl::OUString& rCommand); + + struct less : public ::std::binary_function<DBType, DBType, bool> + { + bool operator() (const DBType& left, const DBType& right) const; + }; }; /** @@ -304,7 +309,7 @@ public: */ class DBCaches { - typedef ::boost::ptr_map<DBType, ScDPCache> CachesType; + typedef ::boost::ptr_map<DBType, ScDPCache, DBType::less> CachesType; CachesType maCaches; ScDocument* mpDoc; public: diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx index c9e00e64dfb1..3689634ba62d 100644 --- a/sc/inc/rangenam.hxx +++ b/sc/inc/rangenam.hxx @@ -181,7 +181,6 @@ class ScRangeName private: typedef ::boost::ptr_set<ScRangeData> DataType; DataType maData; - sal_uInt16 mnSharedMaxIndex; public: /// Map that manages stored ScRangeName instances. @@ -208,8 +207,6 @@ public: void UpdateTabRef(SCTAB nTable, sal_uInt16 nFlag, SCTAB nNewTable = 0); void UpdateTranspose(const ScRange& rSource, const ScAddress& rDest); void UpdateGrow(const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY); - sal_uInt16 GetSharedMaxIndex(); - void SetSharedMaxIndex(sal_uInt16 nInd); SC_DLLPUBLIC const_iterator begin() const; SC_DLLPUBLIC const_iterator end() const; diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 26cb8a846263..cf30f6b23cd8 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -173,7 +173,6 @@ private: ScSortParam aSortParam; CollatorWrapper* pSortCollator; sal_Bool bGlobalKeepQuery; - sal_Bool bSharedNameInserted; ScRangeVec aPrintRanges; bool bPrintEntireSheet; diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 5fb6edaf592d..7bc50f1af812 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -48,6 +48,7 @@ #define SC_UNO_EXTERNALDOCLINKS "ExternalDocLinks" #define SC_UNO_COLLABELRNG "ColumnLabelRanges" #define SC_UNO_DATABASERNG "DatabaseRanges" +#define SC_UNO_UNNAMEDDBRNG "UnnamedDatabaseRanges" #define SC_UNO_NAMEDRANGES "NamedRanges" #define SC_UNO_ROWLABELRNG "RowLabelRanges" #define SC_UNO_SHEETLINKS "SheetLinks" diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 35558d1a75a3..56e205c696a2 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -49,6 +49,8 @@ #include <cppuhelper/bootstrap.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/oslfile2streamwrap.hxx> +#include <i18npool/mslangid.hxx> +#include <unotools/syslocaleoptions.hxx> #include <vcl/svapp.hxx> #include "scdll.hxx" @@ -224,7 +226,7 @@ public: void testCollator(); void testInput(); - void testSUM(); + void testCellFunctions(); void testVolatileFunc(); void testFuncParam(); void testNamedRange(); @@ -264,7 +266,7 @@ public: CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testCollator); CPPUNIT_TEST(testInput); - CPPUNIT_TEST(testSUM); + CPPUNIT_TEST(testCellFunctions); CPPUNIT_TEST(testVolatileFunc); CPPUNIT_TEST(testFuncParam); CPPUNIT_TEST(testNamedRange); @@ -304,28 +306,6 @@ Test::Test() //of retaining references to the root ServiceFactory as its passed around comphelper::setProcessServiceFactory(xSM); -#if 0 - // TODO: attempt to explicitly set UI locale to en-US, to get the unit - // test to work under non-English build environment. But this causes - // runtime exception.... - uno::Reference<lang::XMultiServiceFactory> theConfigProvider = - uno::Reference<lang::XMultiServiceFactory> ( - xSM->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))), uno::UNO_QUERY_THROW); - - uno::Sequence<uno::Any> theArgs(1); - OUString aLocalePath(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Linguistic/General")); - theArgs[0] <<= aLocalePath; - uno::Reference<beans::XPropertySet> xProp( - theConfigProvider->createInstanceWithArguments( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess")), theArgs), uno::UNO_QUERY_THROW); - - OUString aLang(RTL_CONSTASCII_USTRINGPARAM("en-US")); - uno::Any aAny; - aAny <<= aLang; - xProp->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale")), aAny); -#endif - // initialise UCB-Broker uno::Sequence<uno::Any> aUcbInitSequence(2); aUcbInitSequence[0] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local")); @@ -339,8 +319,19 @@ Test::Test() rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.FileContentProvider"))), uno::UNO_QUERY); xUcb->registerContentProvider(xFileProvider, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file")), sal_True); - InitVCL(xSM); + // force locale (and resource files loaded) to en-US + const LanguageType eLang=LANGUAGE_ENGLISH_US; + + rtl::OUString aLang, aCountry; + MsLangId::convertLanguageToIsoNames(eLang, aLang, aCountry); + lang::Locale aLocale(aLang, aCountry, rtl::OUString()); + ResMgr::SetDefaultLocale( aLocale ); + SvtSysLocaleOptions aLocalOptions; + aLocalOptions.SetUILocaleConfigString( + MsLangId::convertLanguageToIsoString( eLang ) ); + + InitVCL(xSM); ScDLL::Init(); oslProcessError err = osl_getProcessWorkingDir(&m_aPWDURL.pData); @@ -398,11 +389,13 @@ void Test::testInput() m_pDoc->DeleteTab(0); } -void Test::testSUM() +void Test::testCellFunctions() { rtl::OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("foo")); CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, aTabName)); + + // SUM double val = 1; m_pDoc->SetValue (0, 0, 0, val); m_pDoc->SetValue (0, 1, 0, val); @@ -412,6 +405,23 @@ void Test::testSUM() m_pDoc->GetValue (0, 2, 0, result); CPPUNIT_ASSERT_MESSAGE ("calculation failed", result == 2.0); + // PRODUCT + val = 1; + m_pDoc->SetValue(0, 0, 0, val); + val = 2; + m_pDoc->SetValue(0, 1, 0, val); + val = 3; + m_pDoc->SetValue(0, 2, 0, val); + m_pDoc->SetString(0, 3, 0, OUString(RTL_CONSTASCII_USTRINGPARAM("=PRODUCT(A1:A3)"))); + m_pDoc->CalcAll(); + m_pDoc->GetValue(0, 3, 0, result); + CPPUNIT_ASSERT_MESSAGE("Calculation of PRODUCT failed", result == 6.0); + + m_pDoc->SetString(0, 4, 0, OUString(RTL_CONSTASCII_USTRINGPARAM("=PRODUCT({1;2;3})"))); + m_pDoc->CalcAll(); + m_pDoc->GetValue(0, 4, 0, result); + CPPUNIT_ASSERT_MESSAGE("Calculation of PRODUCT with inline array failed", result == 6.0); + m_pDoc->DeleteTab(0); } @@ -779,7 +789,7 @@ ScDPObject* createDPFromRange( { OUString aDimName(aFields[i].pName, strlen(aFields[i].pName), RTL_TEXTENCODING_UTF8); ScDPSaveDimension* pDim = aSaveData.GetDimensionByName(aDimName); - pDim->SetOrientation(aFields[i].eOrient); + pDim->SetOrientation(static_cast<sal_uInt16>(aFields[i].eOrient)); pDim->SetUsedHierarchy(0); pDim->SetShowEmpty(true); diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 40390816128b..2668893ed4d3 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1270,7 +1270,8 @@ ScConditionalFormat::ScConditionalFormat(const ScConditionalFormat& r) : pAreas( NULL ), nKey( r.nKey ), ppEntries( NULL ), - nEntryCount( r.nEntryCount ) + nEntryCount( r.nEntryCount ), + pRanges( NULL ) { if (nEntryCount) { @@ -1281,7 +1282,8 @@ ScConditionalFormat::ScConditionalFormat(const ScConditionalFormat& r) : ppEntries[i]->SetParent(this); } } - pRanges = new ScRangeList( *r.pRanges ); + if (r.pRanges) + pRanges = new ScRangeList( *r.pRanges ); } ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const @@ -1320,10 +1322,16 @@ sal_Bool ScConditionalFormat::EqualEntries( const ScConditionalFormat& r ) const if ( ! (*ppEntries[i] == *r.ppEntries[i]) ) return false; - if( *pRanges != *r.pRanges ) - return false; + if (pRanges) + { + if (r.pRanges) + return *pRanges == *r.pRanges; + else + return false; + } - return true; + // pRanges is NULL, which means r.pRanges must be NULL. + return r.pRanges.Is() == false; } void ScConditionalFormat::AddRangeInfo( const ScRangeListRef& rRanges ) diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 2188a458a855..756990e681bc 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -1130,53 +1130,6 @@ void ScDocument::SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const sal_uInt16 pTab[nTab]->SetError( nCol, nRow, nError ); } -namespace { - -bool eraseUnusedSharedName(ScRangeName* pRangeName, ScTable* pTab[], sal_uInt16 nLevel) -{ - if (!pRangeName) - return false; - - ScRangeName::iterator itr = pRangeName->begin(), itrEnd = pRangeName->end(); - for (; itr != itrEnd; ++itr) - { - if (!itr->HasType(RT_SHARED)) - continue; - - String aName; - itr->GetName(aName); - aName.Erase(0, 6); // !!! vgl. Table4, FillFormula !! - sal_uInt16 nInd = static_cast<sal_uInt16>(aName.ToInt32()); - if (nInd > nLevel) - continue; - - sal_uInt16 nIndex = itr->GetIndex(); - - bool bInUse = false; - for (SCTAB j = 0; !bInUse && (j <= MAXTAB); ++j) - { - if (pTab[j]) - bInUse = pTab[j]->IsRangeNameInUse(0, 0, MAXCOL-1, MAXROW-1, nIndex); - } - if (!bInUse) - { - pRangeName->erase(itr); - return true; - } - } - return false; -} - -} - -void ScDocument::EraseNonUsedSharedNames(sal_uInt16 nLevel) -{ - if (!pRangeName) - return; - while (eraseUnusedSharedName(pRangeName, pTab, nLevel)) - ; -} - // ---------------------------------------------------------------------------- void ScDocument::SetConsolidateDlgData( const ScConsolidateParam* pData ) diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 1958bf721a4c..b9c79e1c9ebf 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -296,42 +296,71 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera pTab[i]->PutCell( j, k, aRefCell.CloneWithoutNote( *this, ScAddress( j, k, i ), SC_CLONECELL_STARTLISTENING ) ); } +namespace { + +bool setCacheTableReferenced(ScToken& rToken, ScExternalRefManager& rRefMgr) +{ + switch (rToken.GetType()) + { + case svExternalSingleRef: + return rRefMgr.setCacheTableReferenced( + rToken.GetIndex(), rToken.GetString(), 1); + case svExternalDoubleRef: + { + const ScComplexRefData& rRef = rToken.GetDoubleRef(); + size_t nSheets = rRef.Ref2.nTab - rRef.Ref1.nTab + 1; + return rRefMgr.setCacheTableReferenced( + rToken.GetIndex(), rToken.GetString(), nSheets); + } + case svExternalName: + /* TODO: external names aren't supported yet, but would + * have to be marked as well, if so. Mechanism would be + * different. */ + DBG_ERRORFILE("ScDocument::MarkUsedExternalReferences: implement the svExternalName case!"); + default: + ; + } + return false; +} + +} + bool ScDocument::MarkUsedExternalReferences( ScTokenArray & rArr ) { + if (!rArr.GetLen()) + return false; + + ScExternalRefManager* pRefMgr = NULL; + rArr.Reset(); + ScToken* t = NULL; bool bAllMarked = false; - if (rArr.GetLen()) + while (!bAllMarked && (t = static_cast<ScToken*>(rArr.GetNextReferenceOrName())) != NULL) { - ScExternalRefManager* pRefMgr = NULL; - rArr.Reset(); - ScToken* t; - while (!bAllMarked && (t = static_cast<ScToken*>(rArr.GetNextReferenceOrName())) != NULL) + if (t->IsExternalRef()) + { + if (!pRefMgr) + pRefMgr = GetExternalRefManager(); + + bAllMarked = setCacheTableReferenced(*t, *pRefMgr); + } + else if (t->GetType() == svIndex) { - if (t->IsExternalRef()) + // this is a named range. Check if the range contains an external + // reference. + ScRangeData* pRangeData = GetRangeName()->findByIndex(t->GetIndex()); + if (!pRangeData) + continue; + + ScTokenArray* pArray = pRangeData->GetCode(); + for (t = static_cast<ScToken*>(pArray->First()); t; t = static_cast<ScToken*>(pArray->Next())) { + if (!t->IsExternalRef()) + continue; + if (!pRefMgr) pRefMgr = GetExternalRefManager(); - switch (t->GetType()) - { - case svExternalSingleRef: - bAllMarked = pRefMgr->setCacheTableReferenced( - t->GetIndex(), t->GetString(), 1); - break; - case svExternalDoubleRef: - { - const ScComplexRefData& rRef = t->GetDoubleRef(); - size_t nSheets = rRef.Ref2.nTab - rRef.Ref1.nTab + 1; - bAllMarked = pRefMgr->setCacheTableReferenced( - t->GetIndex(), t->GetString(), nSheets); - } - break; - case svExternalName: - /* TODO: external names aren't supported yet, but would - * have to be marked as well, if so. Mechanism would be - * different. */ - DBG_ERRORFILE("ScDocument::MarkUsedExternalReferences: implement the svExternalName case!"); - break; - default: break; - } + + bAllMarked = setCacheTableReferenced(*t, *pRefMgr); } } } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 8d236383dac2..b8f026503dc4 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -5422,7 +5422,14 @@ void ScDocument::SetSubTotalCellsDirty(const ScRange& rDirtyRange) void ScDocument::EnableUndo( bool bVal ) { - GetUndoManager()->EnableUndo(bVal); + // The undo manager increases lock count every time undo is disabled. + // Because of this, we shouldn't disable undo unless it's currently + // enabled, or else re-enabling it may not actually re-enable undo unless + // the lock count becomes zero. + + if (bVal != GetUndoManager()->IsUndoEnabled()) + GetUndoManager()->EnableUndo(bVal); + mbUndoEnabled = bVal; } diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 9589fe838f7a..7f5abef802ea 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -2445,6 +2445,11 @@ void ScDPCollection::NameCaches::removeCache(const OUString& rName) ScDPCollection::DBType::DBType(sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand) : mnSdbType(nSdbType), maDBName(rDBName), maCommand(rCommand) {} +bool ScDPCollection::DBType::less::operator() (const DBType& left, const DBType& right) const +{ + return left < right; +} + ScDPCollection::DBCaches::DBCaches(ScDocument* pDoc) : mpDoc(pDoc) {} const ScDPCache* ScDPCollection::DBCaches::getCache(sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand) diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index d4c194676471..554a22773dd6 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1696,6 +1696,8 @@ void ScTable::SetRepeatColRange( const ScRange* pNew ) if (IsStreamValid()) SetStreamValid(false); + + InvalidatePageBreaks(); } void ScTable::SetRepeatRowRange( const ScRange* pNew ) @@ -1704,6 +1706,8 @@ void ScTable::SetRepeatRowRange( const ScRange* pNew ) if (IsStreamValid()) SetStreamValid(false); + + InvalidatePageBreaks(); } void ScTable::ClearPrintRanges() @@ -1713,6 +1717,8 @@ void ScTable::ClearPrintRanges() if (IsStreamValid()) SetStreamValid(false); + + InvalidatePageBreaks(); } void ScTable::AddPrintRange( const ScRange& rNew ) @@ -1723,6 +1729,8 @@ void ScTable::AddPrintRange( const ScRange& rNew ) if (IsStreamValid()) SetStreamValid(false); + + InvalidatePageBreaks(); } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 646be060b6a9..c5e2c7644085 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -157,18 +157,17 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (!maRowManualBreaks.empty()) { - std::set<SCROW>::reverse_iterator rit = maRowManualBreaks.rbegin(); - while (rit != maRowManualBreaks.rend()) - { - SCROW nRow = *rit; - if (nRow < nStartRow) - break; // while - else - { - maRowManualBreaks.erase( (++rit).base()); - maRowManualBreaks.insert( static_cast<SCROW>( nRow + nSize)); - } - } + // Copy all breaks up to nStartRow (non-inclusive). + ::std::set<SCROW>::iterator itr1 = maRowManualBreaks.lower_bound(nStartRow); + ::std::set<SCROW> aNewBreaks(maRowManualBreaks.begin(), itr1); + + // Copy all breaks from nStartRow (inclusive) to the last element, + // but add nSize to each value. + ::std::set<SCROW>::iterator itr2 = maRowManualBreaks.end(); + for (; itr1 != itr2; ++itr1) + aNewBreaks.insert(static_cast<SCROW>(*itr1 + nSize)); + + maRowManualBreaks.swap(aNewBreaks); } } @@ -208,14 +207,21 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (!maRowManualBreaks.empty()) { - std::set<SCROW>::iterator it = maRowManualBreaks.upper_bound( static_cast<SCROW>( nStartRow + nSize - 1)); - maRowManualBreaks.erase( maRowManualBreaks.lower_bound( nStartRow), it); - while (it != maRowManualBreaks.end()) - { - SCROW nRow = *it; - maRowManualBreaks.erase( it++); - maRowManualBreaks.insert( static_cast<SCROW>( nRow - nSize)); - } + // Erase all manual breaks between nStartRow and nStartRow + nSize - 1 (inclusive). + std::set<SCROW>::iterator itr1 = maRowManualBreaks.lower_bound(nStartRow); + std::set<SCROW>::iterator itr2 = maRowManualBreaks.upper_bound(static_cast<SCROW>(nStartRow + nSize - 1)); + maRowManualBreaks.erase(itr1, itr2); + + // Copy all breaks from the 1st element up to nStartRow to the new container. + itr1 = maRowManualBreaks.lower_bound(nStartRow); + ::std::set<SCROW> aNewBreaks(maRowManualBreaks.begin(), itr1); + + // Copy all breaks from nStartRow to the last element, but subtract each value by nSize. + itr2 = maRowManualBreaks.end(); + for (; itr1 != itr2; ++itr1) + aNewBreaks.insert(static_cast<SCROW>(*itr1 - nSize)); + + maRowManualBreaks.swap(aNewBreaks); } } diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 55b4da849665..edba012fadd1 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1576,17 +1576,11 @@ void ScTable::Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScProgress aProgress( pDocument->GetDocumentShell(), ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS), nProgCount ); - bSharedNameInserted = false; - if (eFillCmd == FILL_AUTO) FillAuto(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, aProgress); else FillSeries(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, eFillCmd, eFillDateCmd, nStepValue, nMaxValue, 0, sal_True, aProgress); - - if (bSharedNameInserted) // Wurde Shared-Name eingefuegt? - pDocument->GetRangeName()->SetSharedMaxIndex( - pDocument->GetRangeName()->GetSharedMaxIndex()+1); // dann hochzaehlen } diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index ce59c16ffa20..7caee7518f8b 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -316,6 +316,7 @@ void PopExternalSingleRef(ScExternalRefCache::TokenRef& rToken, ScExternalRefCac void PopExternalDoubleRef(sal_uInt16& rFileId, String& rTabName, ScComplexRefData& rRef); void PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArray); void PopExternalDoubleRef(ScMatrixRef& rMat); +void GetExternalDoubleRef(sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& aData, ScExternalRefCache::TokenArrayRef& rArray); sal_Bool PopDoubleRefOrSingleRef( ScAddress& rAdr ); void PopDoubleRefPushMatrix(); // If MatrixFormula: convert formula::svDoubleRef to svMatrix, create JumpMatrix. diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 476eb6ef2cb0..c4a8cdd346cd 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -810,6 +810,38 @@ double ScInterpreter::Compare() } } break; + case svExternalSingleRef: + { + ScMatrixRef pMat = GetMatrix(); + if (!pMat) + { + SetError( errIllegalParameter); + break; + } + + SCSIZE nC, nR; + pMat->GetDimensions(nC, nR); + if (!nC || !nR) + { + SetError( errIllegalParameter); + break; + } + if (pMat->IsEmpty(0, 0)) + aComp.bEmpty[i] = true; + else if (pMat->IsString(0, 0)) + { + *aComp.pVal[i] = pMat->GetString(0, 0); + aComp.bVal[i] = false; + } + else + { + aComp.nVal[i] = pMat->GetDouble(0, 0); + aComp.bVal[i] = true; + } + } + break; + case svExternalDoubleRef: + // TODO: Find out how to handle this... default: SetError( errIllegalParameter); break; @@ -2908,8 +2940,10 @@ void ScInterpreter::ScMin( sal_Bool bTextAsZero ) } break; case svMatrix : + case svExternalSingleRef: + case svExternalDoubleRef: { - ScMatrixRef pMat = PopMatrix(); + ScMatrixRef pMat = GetMatrix(); if (pMat) { SCSIZE nC, nR; @@ -3029,8 +3063,10 @@ void ScInterpreter::ScMax( sal_Bool bTextAsZero ) } break; case svMatrix : + case svExternalSingleRef: + case svExternalDoubleRef: { - ScMatrixRef pMat = PopMatrix(); + ScMatrixRef pMat = GetMatrix(); if (pMat) { nFuncFmtType = NUMBERFORMAT_NUMBER; @@ -4603,7 +4639,9 @@ void ScInterpreter::ScCountIf() } } break; - case svMatrix : + case svMatrix: + case svExternalSingleRef: + case svExternalDoubleRef: { ScMatValType nType = GetDoubleOrStringFromMatrix( fVal, rString); @@ -4648,23 +4686,25 @@ void ScInterpreter::ScCountIf() nTab2 = nTab1; break; case svMatrix: + case svExternalSingleRef: + case svExternalDoubleRef: + { + pQueryMatrix = GetMatrix(); + if (!pQueryMatrix) { - pQueryMatrix = PopMatrix(); - if (!pQueryMatrix) - { - PushIllegalParameter(); - return; - } - nCol1 = 0; - nRow1 = 0; - nTab1 = 0; - SCSIZE nC, nR; - pQueryMatrix->GetDimensions( nC, nR); - nCol2 = static_cast<SCCOL>(nC - 1); - nRow2 = static_cast<SCROW>(nR - 1); - nTab2 = 0; + PushIllegalParameter(); + return; } - break; + nCol1 = 0; + nRow1 = 0; + nTab1 = 0; + SCSIZE nC, nR; + pQueryMatrix->GetDimensions( nC, nR); + nCol2 = static_cast<SCCOL>(nC - 1); + nRow2 = static_cast<SCROW>(nR - 1); + nTab2 = 0; + } + break; default: PushIllegalParameter(); return ; diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 1c7ecdd33c78..bfe5b6b632ac 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1519,6 +1519,28 @@ void ScInterpreter::PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArr if (nGlobalError) return; + GetExternalDoubleRef(nFileId, aTabName, aData, rArray); + if (nGlobalError) + return; +} + +void ScInterpreter::PopExternalDoubleRef(ScMatrixRef& rMat) +{ + ScExternalRefCache::TokenArrayRef pArray; + PopExternalDoubleRef(pArray); + if (nGlobalError) + return; + + // For now, we only support single range data for external + // references, which means the array should only contain a + // single matrix token. + ScToken* p = static_cast<ScToken*>(pArray->First()); + rMat = p->GetMatrix(); +} + +void ScInterpreter::GetExternalDoubleRef( + sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rData, ScExternalRefCache::TokenArrayRef& rArray) +{ ScExternalRefManager* pRefMgr = pDok->GetExternalRefManager(); const String* pFile = pRefMgr->getExternalFileName(nFileId); if (!pFile) @@ -1526,18 +1548,19 @@ void ScInterpreter::PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArr SetError(errNoName); return; } - if (aData.Ref1.IsTabRel() || aData.Ref2.IsTabRel()) + if (rData.Ref1.IsTabRel() || rData.Ref2.IsTabRel()) { OSL_FAIL("ScCompiler::GetToken: external double reference must have an absolute table reference!"); SetError(errNoRef); return; } + ScComplexRefData aData(rData); aData.CalcAbsIfRel(aPos); ScRange aRange(aData.Ref1.nCol, aData.Ref1.nRow, aData.Ref1.nTab, aData.Ref2.nCol, aData.Ref2.nRow, aData.Ref2.nTab); ScExternalRefCache::TokenArrayRef pArray = pRefMgr->getDoubleRefTokens( - nFileId, aTabName, aRange, &aPos); + nFileId, rTabName, aRange, &aPos); if (!pArray) { @@ -1562,20 +1585,6 @@ void ScInterpreter::PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArr rArray = pArray; } -void ScInterpreter::PopExternalDoubleRef(ScMatrixRef& rMat) -{ - ScExternalRefCache::TokenArrayRef pArray; - PopExternalDoubleRef(pArray); - if (nGlobalError) - return; - - // For now, we only support single range data for external - // references, which means the array should only contain a - // single matrix token. - ScToken* p = static_cast<ScToken*>(pArray->First()); - rMat = p->GetMatrix(); -} - sal_Bool ScInterpreter::PopDoubleRefOrSingleRef( ScAddress& rAdr ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::PopDoubleRefOrSingleRef" ); @@ -1643,6 +1652,7 @@ bool ScInterpreter::ConvertMatrixParameters() case svDouble: case svString: case svSingleRef: + case svExternalSingleRef: case svMissing: case svError: case svEmptyCell: @@ -1700,6 +1710,35 @@ bool ScInterpreter::ConvertMatrixParameters() } } break; + case svExternalDoubleRef: + { + ScParameterClassification::Type eType = + ScParameterClassification::GetParameterType( pCur, nParams - i); + if (eType == ScParameterClassification::Array) + { + sal_uInt16 nFileId = p->GetIndex(); + const String& rTabName = p->GetString(); + const ScComplexRefData& rRef = static_cast<ScToken*>(p)->GetDoubleRef(); + ScExternalRefCache::TokenArrayRef pArray; + GetExternalDoubleRef(nFileId, rTabName, rRef, pArray); + if (nGlobalError) + break; + + ScToken* pTemp = static_cast<ScToken*>(pArray->First()); + if (!pTemp) + break; + + ScMatrixRef pMat = pTemp->GetMatrix(); + if (pMat) + { + ScToken* pNew = new ScMatrixToken( pMat); + pNew->IncRef(); + pStack[ sp - i ] = pNew; + p->DecRef(); // p may be dead now! + } + } + } + break; case svRefList: { ScParameterClassification::Type eType = @@ -2350,13 +2389,9 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( double& rDouble, ScMatrixRef pMat; StackVar eType = GetStackType(); - if (eType == svExternalDoubleRef) - { - PopExternalDoubleRef(pMat); - } - else if (eType == svMatrix) + if (eType == svExternalDoubleRef || eType == svExternalSingleRef || eType == svMatrix) { - pMat = PopMatrix(); + pMat = GetMatrix(); } else { diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx index 440a9598e59e..df5f43617ae1 100644 --- a/sc/source/core/tool/rangenam.cxx +++ b/sc/source/core/tool/rangenam.cxx @@ -729,11 +729,10 @@ void ScRangeName::copyLocalNames(const TabNameMap& rNames, TabNameCopyMap& rCopy } } -ScRangeName::ScRangeName() : - mnSharedMaxIndex(0) {} +ScRangeName::ScRangeName() {} ScRangeName::ScRangeName(const ScRangeName& r) : - maData(r.maData), mnSharedMaxIndex(r.mnSharedMaxIndex) {} + maData(r.maData) {} const ScRangeData* ScRangeName::findByRange(const ScRange& rRange) const { @@ -806,16 +805,6 @@ void ScRangeName::UpdateGrow(const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY) itr->UpdateGrow(rArea, nGrowX, nGrowY); } -sal_uInt16 ScRangeName::GetSharedMaxIndex() -{ - return mnSharedMaxIndex; -} - -void ScRangeName::SetSharedMaxIndex(sal_uInt16 nInd) -{ - mnSharedMaxIndex = nInd; -} - ScRangeName::const_iterator ScRangeName::begin() const { return maData.begin(); @@ -886,7 +875,7 @@ void ScRangeName::clear() bool ScRangeName::operator== (const ScRangeName& r) const { - return maData == r.maData && mnSharedMaxIndex == r.mnSharedMaxIndex; + return maData == r.maData; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index c03799aa6ffe..8cb3d6e136e8 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1533,7 +1533,7 @@ ScNameInputType lcl_GetInputType( const String& rText ) sal_Int32 nNumeric; if ( aRange.Parse( rText, pDoc, eConv ) & SCA_VALID ) - eRet = SC_NAME_INPUT_NAMEDRANGE; + eRet = SC_NAME_INPUT_RANGE; else if ( aAddress.Parse( rText, pDoc, eConv ) & SCA_VALID ) eRet = SC_NAME_INPUT_CELL; else if ( aRangeUtil.MakeRangeFromName( rText, pDoc, nTab, aRange, RUTL_NAMES, eConv ) ) @@ -1697,11 +1697,14 @@ void ScPosWnd::DoEnter() else { // for all selection types, excecute the SID_CURRENTCELL slot. - // Note that SID_CURRENTCELL always expects address to be - // in Calc A1 format. Convert the text. - ScRange aRange; - aRange.ParseAny(aText, pDoc, pDoc->GetAddressConvention()); - aRange.Format(aText, SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO); + if (eType == SC_NAME_INPUT_CELL || eType == SC_NAME_INPUT_RANGE) + { + // Note that SID_CURRENTCELL always expects address to + // be in Calc A1 format. Convert the text. + ScRange aRange; + aRange.ParseAny(aText, pDoc, pDoc->GetAddressConvention()); + aRange.Format(aText, SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO); + } SfxStringItem aPosItem( SID_CURRENTCELL, aText ); SfxBoolItem aUnmarkItem( FN_PARAM_1, sal_True ); // remove existing selection diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index f280af43f7e0..fa063bcf7ab8 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -1450,11 +1450,24 @@ void ScDPLayoutDlg::UpdateSrcRange() switch (eSrcType) { case SRC_REF: + { // data source is a range reference. if (inSheet.GetSourceRange() == aNewRange) // new range is identical to the current range. Nothing to do. return; inSheet.SetSourceRange(aNewRange); + sal_uLong nError = inSheet.CheckSourceRange(); + if (nError) + { + // The error number corresponds with string ID for the error + // message. In the future we should display the error message + // somewhere in the dialog to let the user know of the reason + // for error. + aEdInPos.SetRefValid(false); + aBtnOk.Disable(); + return; + } + } break; case SRC_NAME: // data source is a range name. diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 8991706293a1..8fde7e29e57a 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -255,7 +255,7 @@ sal_Bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData, sal_Bool /* bApi * // ----------------------------------------------------------------- -sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi ) +sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi, bool bIsUnnamed, SCTAB aTab ) { //! auch fuer ScDBFunc::RepeatDB benutzen! @@ -263,12 +263,21 @@ sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Boo ScDocument* pDoc = rDocShell.GetDocument(); if (bRecord && !pDoc->IsUndoEnabled()) bRecord = false; - ScDBCollection* pColl = pDoc->GetDBCollection(); - sal_uInt16 nIndex; - if ( pColl && pColl->SearchName( rDBName, nIndex ) ) + ScDBData* pDBData = NULL; + if (bIsUnnamed) { - ScDBData* pDBData = (*pColl)[nIndex]; + pDBData = pDoc->GetAnonymousDBData( aTab ); + } + else + { + sal_uInt16 nIndex; + ScDBCollection* pColl = pDoc->GetDBCollection(); + if ( pColl && pColl->SearchName( rDBName, nIndex ) ) + pDBData = (*pColl)[nIndex]; + } + if ( pDBData ) + { ScQueryParam aQueryParam; pDBData->GetQueryParam( aQueryParam ); sal_Bool bQuery = aQueryParam.GetEntry(0).bDoQuery; diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index c9d600f34d9c..62ced922b01f 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4023,8 +4023,7 @@ sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMar { rDocShell.GetUndoManager()->AddUndoAction( new ScUndoAutoFill( &rDocShell, aDestArea, aSourceArea, pUndoDoc, aMark, - eDir, FILL_SIMPLE, FILL_DAY, MAXDOUBLE, 1.0, 1e307, - pDoc->GetRangeName()->GetSharedMaxIndex()+1 ) ); + eDir, FILL_SIMPLE, FILL_DAY, MAXDOUBLE, 1.0, 1e307) ); } rDocShell.PostPaintGridAll(); @@ -4143,8 +4142,7 @@ sal_Bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMar { rDocShell.GetUndoManager()->AddUndoAction( new ScUndoAutoFill( &rDocShell, aDestArea, aSourceArea, pUndoDoc, aMark, - eDir, eCmd, eDateCmd, fStart, fStep, fMax, - pDoc->GetRangeName()->GetSharedMaxIndex()+1 ) ); + eDir, eCmd, eDateCmd, fStart, fStep, fMax) ); } bSuccess = sal_True; @@ -4271,8 +4269,7 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillD { rDocShell.GetUndoManager()->AddUndoAction( new ScUndoAutoFill( &rDocShell, aDestArea, aSourceArea, pUndoDoc, aMark, - eDir, eCmd, eDateCmd, MAXDOUBLE, fStep, fMax, - pDoc->GetRangeName()->GetSharedMaxIndex()+1 ) ); + eDir, eCmd, eDateCmd, MAXDOUBLE, fStep, fMax) ); } rDocShell.PostPaintGridAll(); diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index f9de3e8c0c48..1bfdc8b5b88f 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -74,6 +74,7 @@ using ::rtl::OUString; using ::std::vector; using ::std::find; using ::std::find_if; +using ::std::remove_if; using ::std::distance; using ::std::pair; using ::std::list; @@ -85,7 +86,7 @@ using namespace formula; namespace { -class TabNameSearchPredicate : public unary_function<bool, ScExternalRefCache::TableName> +class TabNameSearchPredicate : public unary_function<ScExternalRefCache::TableName, bool> { public: explicit TabNameSearchPredicate(const String& rSearchName) : @@ -201,6 +202,56 @@ private: ScDocument* mpDoc; }; +/** + * Check whether a named range contains an external reference to a + * particular document. + */ +bool hasRefsToSrcDoc(ScRangeData& rData, sal_uInt16 nFileId) +{ + ScTokenArray* pArray = rData.GetCode(); + if (!pArray) + return false; + + pArray->Reset(); + ScToken* p = static_cast<ScToken*>(pArray->GetNextReference()); + for (; p; p = static_cast<ScToken*>(pArray->GetNextReference())) + { + if (!p->IsExternalRef()) + continue; + + if (p->GetIndex() == nFileId) + return true; + } + return false; +} + +class EraseRangeByIterator : unary_function<ScRangeName::iterator, void> +{ + ScRangeName& mrRanges; +public: + EraseRangeByIterator(ScRangeName& rRanges) : mrRanges(rRanges) {} + void operator() (const ScRangeName::iterator& itr) + { + mrRanges.erase(itr); + } +}; + +/** + * Remove all named ranges that contain references to specified source + * document. + */ +void removeRangeNamesBySrcDoc(ScRangeName& rRanges, sal_uInt16 nFileId) +{ + ScRangeName::iterator itr = rRanges.begin(), itrEnd = rRanges.end(); + vector<ScRangeName::iterator> v; + for (; itr != itrEnd; ++itr) + { + if (hasRefsToSrcDoc(*itr, nFileId)) + v.push_back(itr); + } + for_each(v.begin(), v.end(), EraseRangeByIterator(rRanges)); +} + } // ============================================================================ @@ -2358,9 +2409,14 @@ void lcl_removeByFileId(sal_uInt16 nFileId, MapContainer& rMap) { typename MapContainer::iterator itr = rMap.find(nFileId); if (itr != rMap.end()) + { + // Close this document shell. + itr->second.maShell->DoClose(); rMap.erase(itr); + } } + void ScExternalRefManager::refreshNames(sal_uInt16 nFileId) { maRefCache.clearCache(nFileId); @@ -2389,6 +2445,21 @@ void ScExternalRefManager::breakLink(sal_uInt16 nFileId) maRefCells.erase(nFileId); } + // Remove all named ranges that reference this document. + + // Global named ranges. + ScRangeName* pRanges = mpDoc->GetRangeName(); + if (pRanges) + removeRangeNamesBySrcDoc(*pRanges, nFileId); + + // Sheet-local named ranges. + for (SCTAB i = 0, n = mpDoc->GetTableCount(); i < n; ++i) + { + pRanges = mpDoc->GetRangeName(i); + if (pRanges) + removeRangeNamesBySrcDoc(*pRanges, nFileId); + } + lcl_removeByFileId(nFileId, maDocShells); if (maDocShells.empty()) @@ -2528,6 +2599,9 @@ void ScExternalRefManager::purgeStaleSrcDocument(sal_Int32 nTimeOut) sal_Int32 nSinceLastAccess = (Time() - itr->second.maLastAccess).GetTime(); if (nSinceLastAccess < nTimeOut) aNewDocShells.insert(*itr); + else + // Timed out. Let's close this. + itr->second.maShell->DoClose(); } maDocShells.swap(aNewDocShells); diff --git a/sc/source/ui/inc/dbdocfun.hxx b/sc/source/ui/inc/dbdocfun.hxx index 132eb9a3750b..11b2ce27ef62 100644 --- a/sc/source/ui/inc/dbdocfun.hxx +++ b/sc/source/ui/inc/dbdocfun.hxx @@ -114,7 +114,7 @@ public: sal_Bool RenameDBRange( const String& rOld, const String& rNew, sal_Bool bApi ); sal_Bool ModifyDBData( const ScDBData& rNewData, sal_Bool bApi ); // Name unveraendert - sal_Bool RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi ); + sal_Bool RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi, bool bIsUnnamed=false, SCTAB aTab = 0); sal_Bool DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewObj, sal_Bool bRecord, sal_Bool bApi, sal_Bool bAllowMove = false ); diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx index d8617490219a..16fc7591ac08 100644 --- a/sc/source/ui/inc/undoblk.hxx +++ b/sc/source/ui/inc/undoblk.hxx @@ -421,8 +421,7 @@ public: ScDocument* pNewUndoDoc, const ScMarkData& rMark, FillDir eNewFillDir, FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd, - double fNewStartValue, double fNewStepValue, double fNewMaxValue, - sal_uInt16 nMaxShIndex ); + double fNewStartValue, double fNewStepValue, double fNewMaxValue ); virtual ~ScUndoAutoFill(); virtual void Undo(); @@ -444,7 +443,6 @@ private: double fMaxValue; sal_uLong nStartChangeAction; sal_uLong nEndChangeAction; - sal_uInt16 nMaxSharedIndex; void SetChangeTrack(); }; diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 446e3dede1c6..45ea822f2090 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -602,8 +602,7 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, const ScRange& rRange, const ScRange& rSourceArea, ScDocument* pNewUndoDoc, const ScMarkData& rMark, FillDir eNewFillDir, FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd, - double fNewStartValue, double fNewStepValue, double fNewMaxValue, - sal_uInt16 nMaxShIndex ) + double fNewStartValue, double fNewStepValue, double fNewMaxValue ) // : ScBlockUndo( pNewDocShell, rRange, SC_UNDO_AUTOHEIGHT ), // @@ -615,8 +614,7 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, eFillDateCmd ( eNewFillDateCmd ), fStartValue ( fNewStartValue ), fStepValue ( fNewStepValue ), - fMaxValue ( fNewMaxValue ), - nMaxSharedIndex ( nMaxShIndex) + fMaxValue ( fNewMaxValue ) { SetChangeTrack(); } @@ -626,7 +624,6 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, ScUndoAutoFill::~ScUndoAutoFill() { - pDocShell->GetDocument()->EraseNonUsedSharedNames(nMaxSharedIndex); delete pUndoDoc; } @@ -649,26 +646,6 @@ void ScUndoAutoFill::SetChangeTrack() nStartChangeAction = nEndChangeAction = 0; } -namespace { - -bool eraseNameContaining(ScRangeName& rNames, const rtl::OUString& rCriteria) -{ - ScRangeName::iterator itr = rNames.begin(), itrEnd = rNames.end(); - for (; itr != itrEnd; ++itr) - { - rtl::OUString aRName = itr->GetName(); - if (aRName.indexOf(rCriteria) >= 0) - { - // Criteria found. Erase this. - rNames.erase(itr); - return true; - } - } - return false; -} - -} - void ScUndoAutoFill::Undo() { BeginUndo(); @@ -698,29 +675,6 @@ void ScUndoAutoFill::Undo() if (pViewShell) pViewShell->CellContentChanged(); -// Shared-Names loeschen -// Falls Undo ins Dokument gespeichert -// => automatisches Loeschen am Ende -// umarbeiten!! - - String aName = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("___SC_")); - aName += String::CreateFromInt32(nMaxSharedIndex); - aName += '_'; - ScRangeName* pRangeName = pDoc->GetRangeName(); - bool bHasFound = false; - // Remove all range names that contain ___SC_... - while (true) - { - bool bErased = eraseNameContaining(*pRangeName, aName); - if (bErased) - bHasFound = true; - else - break; - } - - if (bHasFound) - pRangeName->SetSharedMaxIndex(pRangeName->GetSharedMaxIndex()-1); - ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); if ( pChangeTrack ) pChangeTrack->Undo( nStartChangeAction, nEndChangeAction ); diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index f5f2ab6071d0..a1ee63dc8b26 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -57,6 +57,7 @@ #include "docsh.hxx" #include "dbdocfun.hxx" #include "unonames.hxx" +#include "globalnames.hxx" #include "globstr.hrc" #include "convuno.hxx" #include "hints.hxx" @@ -1607,7 +1608,18 @@ void ScDataPilotFilterDescriptor::PutData( const ScQueryParam& rParam ) ScDatabaseRangeObj::ScDatabaseRangeObj(ScDocShell* pDocSh, const String& rNm) : pDocShell( pDocSh ), aName( rNm ), - aPropSet( lcl_GetDBRangePropertyMap() ) + aPropSet( lcl_GetDBRangePropertyMap() ), + bIsUnnamed(false) +{ + pDocShell->GetDocument()->AddUnoObject(*this); +} + +ScDatabaseRangeObj::ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab) : + pDocShell( pDocSh ), + aName(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)), + aPropSet( lcl_GetDBRangePropertyMap() ), + bIsUnnamed(true), + aTab( nTab ) { pDocShell->GetDocument()->AddUnoObject(*this); } @@ -1641,12 +1653,19 @@ ScDBData* ScDatabaseRangeObj::GetDBData_Impl() const ScDBData* pRet = NULL; if (pDocShell) { - ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection(); - if (pNames) + if (bIsUnnamed) { - sal_uInt16 nPos = 0; - if (pNames->SearchName( aName, nPos )) - pRet = (*pNames)[nPos]; + pRet = pDocShell->GetDocument()->GetAnonymousDBData(aTab); + } + else + { + ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection(); + if (pNames) + { + sal_uInt16 nPos = 0; + if (pNames->SearchName( aName, nPos )) + pRet = (*pNames)[nPos]; + } } } return pRet; @@ -1889,7 +1908,7 @@ void SAL_CALL ScDatabaseRangeObj::refresh() throw(uno::RuntimeException) // interne Operationen (sort, query, subtotal) nur, wenn kein Fehler if (bContinue) - aFunc.RepeatDB( pData->GetName(), sal_True, sal_True ); + aFunc.RepeatDB( pData->GetName(), true, true, bIsUnnamed, aTab ); } } @@ -2079,7 +2098,7 @@ uno::Any SAL_CALL ScDatabaseRangeObj::getPropertyValue( const rtl::OUString& aPr { // all database ranges except "unnamed" are user defined ScUnoHelpFunctions::SetBoolInAny( aRet, - ( pData->GetName() != ScGlobal::GetRscString(STR_DB_NONAME) ) ); + ( pData->GetName() != String(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)) ) ); } else if ( aString.EqualsAscii( SC_UNO_LINKDISPBIT ) ) { @@ -2354,8 +2373,90 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const rtl::OUString& aName ) //------------------------------------------------------------------------ +ScUnnamedDatabaseRangesObj::ScUnnamedDatabaseRangesObj(ScDocShell* pDocSh) : + pDocShell( pDocSh ) +{ + pDocShell->GetDocument()->AddUnoObject(*this); +} + +ScUnnamedDatabaseRangesObj::~ScUnnamedDatabaseRangesObj() +{ + if (pDocShell) + pDocShell->GetDocument()->RemoveUnoObject(*this); +} + +void ScUnnamedDatabaseRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) +{ + // Referenz-Update interessiert hier nicht + + if ( rHint.ISA( SfxSimpleHint ) && + ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) + { + pDocShell = NULL; // ungueltig geworden + } +} + +// XUnnamedDatabaseRanges + +void ScUnnamedDatabaseRangesObj::setByTable( const table::CellRangeAddress& aRange ) + throw( uno::RuntimeException, + lang::IndexOutOfBoundsException ) +{ + SolarMutexGuard aGuard; + bool bDone = false; + if (pDocShell) + { + if ( pDocShell->GetDocument()->GetTableCount() <= aRange.Sheet ) + throw lang::IndexOutOfBoundsException(); + ScDBDocFunc aFunc(*pDocShell); + String aString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)); + ScRange aUnnamedRange( (SCCOL)aRange.StartColumn, (SCROW)aRange.StartRow, aRange.Sheet, + (SCCOL)aRange.EndColumn, (SCROW)aRange.EndRow, aRange.Sheet ); + bDone = aFunc.AddDBRange( aString, aUnnamedRange, sal_True ); + } + if (!bDone) + throw uno::RuntimeException(); // no other exceptions specified +} +uno::Any ScUnnamedDatabaseRangesObj::getByTable( const sal_Int32 nTab ) + throw(uno::RuntimeException, + lang::IndexOutOfBoundsException, + container::NoSuchElementException) +{ + SolarMutexGuard aGuard; + if (pDocShell) + { + if ( pDocShell->GetDocument()->GetTableCount() <= nTab ) + throw lang::IndexOutOfBoundsException(); + uno::Reference<sheet::XDatabaseRange> xRange( new ScDatabaseRangeObj(pDocShell, (SCTAB) nTab) ); + if (xRange.is()) + return uno::makeAny(xRange); + else + throw container::NoSuchElementException(); + } + else + throw uno::RuntimeException(); +} + +sal_Bool ScUnnamedDatabaseRangesObj::hasByTable( sal_Int32 nTab ) + throw (uno::RuntimeException, + lang::IndexOutOfBoundsException) +{ + SolarMutexGuard aGuard; + if (pDocShell) + { + if (pDocShell->GetDocument()->GetTableCount() <= nTab) + throw lang::IndexOutOfBoundsException(); + if (pDocShell->GetDocument()->GetAnonymousDBData((SCTAB) nTab)) + return true; + return false; + } + else + return false; +} + +//------------------------------------------------------------------------ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index e84f6756757e..15673f35c0b8 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -56,6 +56,7 @@ #include <com/sun/star/util/Date.hpp> #include <com/sun/star/sheet/XNamedRanges.hpp> #include <com/sun/star/sheet/XLabelRanges.hpp> +#include <com/sun/star/sheet/XUnnamedDatabaseRanges.hpp> #include <com/sun/star/i18n/XForbiddenCharacters.hpp> #include <com/sun/star/script/XLibraryContainer.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -1780,6 +1781,10 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa { aRet <<= uno::Reference<sheet::XDatabaseRanges>(new ScDatabaseRangesObj( pDocShell )); } + else if ( aString.EqualsAscii( SC_UNO_UNNAMEDDBRNG ) ) + { + aRet <<= uno::Reference<sheet::XUnnamedDatabaseRanges>(new ScUnnamedDatabaseRangesObj(pDocShell)); + } else if ( aString.EqualsAscii( SC_UNO_COLLABELRNG ) ) { aRet <<= uno::Reference<sheet::XLabelRanges>(new ScLabelRangesObj( pDocShell, sal_True )); diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index d98f1ac7ee1e..cbf30eba603d 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -66,36 +66,33 @@ GetDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException ) return xDBRanges; } +uno::Reference< sheet::XUnnamedDatabaseRanges > +GetUnnamedDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException ) +{ + uno::Reference< frame::XModel > xModel; + if ( pShell ) + xModel.set( pShell->GetModel(), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( xModelProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UnnamedDatabaseRanges") ) ), uno::UNO_QUERY_THROW ); + return xUnnamedDBRanges; +} + // returns the XDatabaseRange for the autofilter on sheet (nSheet) // also populates sName with the name of range uno::Reference< sheet::XDatabaseRange > -GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) throw ( uno::RuntimeException ) +GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet ) throw ( uno::RuntimeException ) { - uno::Reference< container::XIndexAccess > xIndexAccess( GetDataBaseRanges( pShell ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( GetUnnamedDataBaseRanges( pShell ), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XDatabaseRange > xDataBaseRange; - table::CellRangeAddress dbAddress; - for ( sal_Int32 index=0; index < xIndexAccess->getCount(); ++index ) + if (xUnnamedDBRanges->hasByTable( nSheet ) ) { - uno::Reference< sheet::XDatabaseRange > xDBRange( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); - uno::Reference< container::XNamed > xNamed( xDBRange, uno::UNO_QUERY_THROW ); - // autofilters work weirdly with openoffice, unnamed is the default - // named range which is used to create an autofilter, but - // its also possible that another name could be used - // this also causes problems when an autofilter is created on - // another sheet - // ( but.. you can use any named range ) - dbAddress = xDBRange->getDataArea(); - if ( dbAddress.Sheet == nSheet ) + uno::Reference< sheet::XDatabaseRange > xDBRange( xUnnamedDBRanges->getByTable( nSheet ) , uno::UNO_QUERY_THROW ); + sal_Bool bHasAuto = false; + uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW ); + xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto; + if ( bHasAuto ) { - sal_Bool bHasAuto = false; - uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW ); - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto; - if ( bHasAuto ) - { - sName = xNamed->getName(); - xDataBaseRange=xDBRange; - break; - } + xDataBaseRange=xDBRange; } } return xDataBaseRange; diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx index 9befc1548357..1cc0546a4fd7 100644 --- a/sc/source/ui/vba/excelvbahelper.hxx +++ b/sc/source/ui/vba/excelvbahelper.hxx @@ -32,6 +32,7 @@ #include "docsh.hxx" #include <com/sun/star/sheet/XDatabaseRanges.hpp> #include <com/sun/star/sheet/XDatabaseRange.hpp> +#include <com/sun/star/sheet/XUnnamedDatabaseRanges.hpp> #include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp> #include <com/sun/star/sheet/XSpreadsheet.hpp> @@ -65,8 +66,9 @@ formula::FormulaGrammar::Grammar GetFormulaGrammar( ScDocument* pDoc, const ScAd void CompileExcelFormulaToODF( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula ); void CompileODFFormulaToExcel( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula, const formula::FormulaGrammar::Grammar eGrammar ); css::uno::Reference< css::sheet::XDatabaseRanges > GetDataBaseRanges( ScDocShell* pShell ) throw ( css::uno::RuntimeException ); +css::uno::Reference< css::sheet::XUnnamedDatabaseRanges > GetUnnamedDataBaseRanges( ScDocShell* pShell ) throw ( css::uno::RuntimeException ); -css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) throw ( css::uno::RuntimeException ); +css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet ) throw ( css::uno::RuntimeException ); css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet ) throw ( css::uno::RuntimeException ); css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException ); css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::uno::RuntimeException ); diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index df750a774ad4..9c199423abd0 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/script/vba/XVBAEventProcessor.hpp> #include <com/sun/star/sheet/XDatabaseRange.hpp> #include <com/sun/star/sheet/XDatabaseRanges.hpp> +#include <com/sun/star/sheet/XUnnamedDatabaseRanges.hpp> #include <com/sun/star/sheet/XGoalSeek.hpp> #include <com/sun/star/sheet/XSheetOperation.hpp> #include <com/sun/star/sheet/CellFlags.hpp> @@ -4334,20 +4335,10 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC // Helper functions for AutoFilter ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet ) { - rtl::OUString sName; - excel::GetAutoFiltRange( pDocShell, nSheet, sName ); - OSL_TRACE("lcl_GetDBData_Impl got autofilter range %s for sheet %d", - rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() , nSheet ); ScDBData* pRet = NULL; if (pDocShell) { - ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection(); - if (pNames) - { - sal_uInt16 nPos = 0; - if (pNames->SearchName( sName , nPos )) - pRet = (*pNames)[nPos]; - } + pRet = pDocShell->GetDocument()->GetAnonymousDBData(nSheet); } return pRet; } @@ -4501,8 +4492,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const sal_Int16 nSheet = thisAddress.Sheet; ScDocShell* pShell = getScDocShell(); sal_Bool bHasAuto = false; - rtl::OUString sAutofiltRangeName; - uno::Reference< sheet::XDatabaseRange > xDataBaseRange = excel::GetAutoFiltRange( pShell, nSheet, sAutofiltRangeName ); + uno::Reference< sheet::XDatabaseRange > xDataBaseRange = excel::GetAutoFiltRange( pShell, nSheet ); if ( xDataBaseRange.is() ) bHasAuto = true; @@ -4549,16 +4539,13 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const } } - uno::Reference< sheet::XDatabaseRanges > xDBRanges = excel::GetDataBaseRanges( pShell ); + uno::Reference< sheet::XUnnamedDatabaseRanges > xDBRanges = excel::GetUnnamedDataBaseRanges( pShell ); if ( xDBRanges.is() ) { - rtl::OUString sGenName( RTL_CONSTASCII_USTRINGPARAM("VBA_Autofilter_") ); - sGenName += rtl::OUString::valueOf( static_cast< sal_Int32 >( nSheet ) ); - OSL_TRACE("Going to add new autofilter range.. name %s", - rtl::OUStringToOString( sGenName, RTL_TEXTENCODING_UTF8 ).getStr() , nSheet ); - if ( !xDBRanges->hasByName( sGenName ) ) - xDBRanges->addNewByName( sGenName, autoFiltAddress ); - xDataBaseRange.set( xDBRanges->getByName( sGenName ), uno::UNO_QUERY_THROW ); + OSL_TRACE("Going to add new autofilter range.. sheet %i", nSheet ); + if ( !xDBRanges->hasByTable( nSheet ) ) + xDBRanges->setByTable( autoFiltAddress ); + xDataBaseRange.set( xDBRanges->getByTable(nSheet ), uno::UNO_QUERY_THROW ); } if ( !xDataBaseRange.is() ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Failed to find the autofilter placeholder range" ) ), uno::Reference< uno::XInterface >() ); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 2918410d0923..cc85ef7b7137 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -97,10 +97,13 @@ static void lcl_PostRepaintCondFormat( const ScConditionalFormat *pCondFmt, ScDo { if( pCondFmt ) { - const ScRangeListRef& aRanges = pCondFmt->GetRangeInfo(); - size_t nCount = aRanges->size(); + const ScRangeListRef& xRanges = pCondFmt->GetRangeInfo(); + if (!xRanges) + return; + + size_t nCount = xRanges->size(); for( size_t n = 0 ; n < nCount; n++ ) - pDocSh->PostPaint( *((*aRanges)[n]), PAINT_ALL ); + pDocSh->PostPaint( *((*xRanges)[n]), PAINT_ALL ); } } diff --git a/scp2/source/accessories/file_font_accessories.scp b/scp2/source/accessories/file_font_accessories.scp index 2683ed978d4b..9adbe4bdfacf 100644 --- a/scp2/source/accessories/file_font_accessories.scp +++ b/scp2/source/accessories/file_font_accessories.scp @@ -880,22 +880,3 @@ STD_FONT_FILE( gid_File_Fnt_Verina_Serif_Bold, Verina_Serif_Bold.otf, Verina Ser STD_FONT_FILE( gid_File_Fnt_Verina_Serif, Verina_Serif.otf, Verina Serif ) #endif -#ifdef WITH_EXTRA_FONT -STD_FONT_FILE( gid_File_Fnt_MagyarLinBiolinum, MagyarLinBiolinum.ttf, Magyar Linux Biolinum) -STD_FONT_FILE( gid_File_Fnt_MagyarLinBiolinumB, MagyarLinBiolinumB.ttf, Magyar Linux Biolinum Bold) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertine, MagyarLinLibertine.ttf, Magyar Linux Libertine) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineB, MagyarLinLibertineB.ttf, Magyar Linux Libertine Bold) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineBI, MagyarLinLibertineBI.ttf, Magyar Linux Libertine Bold Italic) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineC, MagyarLinLibertineC_Re.ttf, Magyar Linux Libertine Capital) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineG, MagyarLinLibertineG.ttf, Magyar Linux Libertine Graphite) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineGB, MagyarLinLibertineGB.ttf, Magyar Linux Libertine Bold Graphite) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineGBI, MagyarLinLibertineGBI.ttf, Magyar Linux Libertine Bold Italic Graphite) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineGI, MagyarLinLibertineGI.ttf, Magyar Linux Libertine Italic Graphite) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineI, MagyarLinLibertineI.ttf, Magyar Linux Libertine Italic) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineN, MagyarLinLibertineN.ttf, Magyar Linux N Libertine) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineNB, MagyarLinLibertineNB.ttf, Magyar Linux Libertine N Bold) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineNBI, MagyarLinLibertineNBI.ttf, Magyar Linux Libertine N Bold Italic) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineNI, MagyarLinLibertineNI.ttf, Magyar Linux Libertine N Italic) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineNC, MagyarLinLibertineNC_Re.ttf, Magyar Linux Libertine N Capital) -#endif - diff --git a/scp2/source/ooo/module_ooo.scp b/scp2/source/ooo/module_ooo.scp index 3142ac6e0e20..293878bc9e71 100644 --- a/scp2/source/ooo/module_ooo.scp +++ b/scp2/source/ooo/module_ooo.scp @@ -149,7 +149,7 @@ Module gid_Module_Root_Extension_Dictionary_En Files = (gid_File_Extension_Dictionary_En); InstallOrder = "2000"; Sortkey = "550"; - Spellcheckerlanguage = "en-US"; + Spellcheckerlanguage = "en"; PackageInfo = "packinfo_office.txt"; ParentID = gid_Module_Dictionaries; Styles = (); diff --git a/set_soenv.in b/set_soenv.in index a1bd947380de..522de78b27fb 100755 --- a/set_soenv.in +++ b/set_soenv.in @@ -1874,6 +1874,19 @@ ToFile( "MOZ_NSPR_CFLAGS", "@MOZ_NSPR_CFLAGS@", "e" ); ToFile( "MOZ_NSS_CFLAGS", "@MOZ_NSS_CFLAGS@", "e" ); ToFile( "MOZ_NSS_LIBS", "@MOZ_NSS_LIBS@", "e" ); ToFile( "MOZ_LDAP_CFLAGS", "@MOZ_LDAP_CFLAGS@", "e" ); +ToFile( "OOOP_GALLERY_PACK", "@OOOP_GALLERY_PACK@","e" ); +ToFile( "OOOP_TEMPLATES_PACK", "@OOOP_TEMPLATES_PACK@","e" ); +ToFile( "OOOP_FONTS_PACK", "@OOOP_FONTS_PACK@","e" ); +ToFile( "OOOP_SAMPLES_PACK", "@OOOP_SAMPLES_PACK@","e" ); +ToFile( "CT2N_EXTENSION_PACK", "@CT2N_EXTENSION_PACK@","e" ); +ToFile( "BARCODE_EXTENSION_PACK", "@BARCODE_EXTENSION_PACK@","e" ); +ToFile( "DIAGRAM_EXTENSION_PACK", "@DIAGRAM_EXTENSION_PACK@","e" ); +ToFile( "VALIDATOR_EXTENSION_PACK", "@VALIDATOR_EXTENSION_PACK@","e" ); +ToFile( "WATCH_WINDOW_EXTENSION_PACK", "@WATCH_WINDOW_EXTENSION_PACK@","e" ); +ToFile( "NUMBERTEXT_EXTENSION_PACK", "@NUMBERTEXT_EXTENSION_PACK@","e" ); +ToFile( "HUNART_EXTENSION_PACK", "@HUNART_EXTENSION_PACK@","e" ); +ToFile( "TYPO_EXTENSION_PACK", "@TYPO_EXTENSION_PACK@","e" ); +ToFile( "GOOGLE_DOCS_EXTENSION_PACK", "@GOOGLE_DOCS_EXTENSION_PACK@","e" ); ToFile( "WITH_FONTS", "@WITH_FONTS@", "e" ); ToFile( "WITH_AGFA_MONOTYPE_FONTS", "@WITH_AGFA_MONOTYPE_FONTS@", "e" ); ToFile( "WITHOUT_AFMS", "@WITHOUT_AFMS@", "e" ); diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt index 34ea3b29e4a3..a628509d63d6 100644 --- a/setup_native/source/packinfo/spellchecker_selection.txt +++ b/setup_native/source/packinfo/spellchecker_selection.txt @@ -29,7 +29,7 @@ dgo = "EMPTY" dz = "EMPTY" el = "EMPTY" en-GB = "EMPTY" -en-US = "en,af,br,ca,cs,da,de-AT,de-CH,de-DE,es,et,fr,gl,he,hr,hu,it,ku-TR,lt,ne,nl,no,oc,pl,pt,ro,ru,sk,sl,sr,sv,sw,th,uk,vi,zu" +en-US = "EMPTY,af,br,ca,cs,da,de-AT,de-CH,de-DE,en,es,et,fr,gl,he,hr,hu,it,ku-TR,lt,ne,nl,no,oc,pl,pt,ro,ru,sk,sl,sr,sv,sw,th,uk,vi,zu" en-ZA = "EMPTY" eo = "EMPTY" es = "EMPTY" diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 6ab161be9f33..f9dd7cdc814b 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -188,6 +188,15 @@ void AppendConfigToken( String& rURL, sal_Bool bQuestionMark, const rtl::OUStrin rURL += DEFINE_CONST_UNICODE("&System="); rURL += SvtHelpOptions().GetSystem(); + static rtl::OUString aVersion; + if ( aVersion.isEmpty() ) + aVersion = utl::Bootstrap::getProductVersion(); + + if ( !aVersion.isEmpty() ) + { + rURL += DEFINE_CONST_UNICODE( "&Version=" ); + rURL += String( aVersion ); + } } sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor ) diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm index f17965fa3d7f..8c844d55609c 100644 --- a/solenv/bin/modules/installer/parameter.pm +++ b/solenv/bin/modules/installer/parameter.pm @@ -161,7 +161,7 @@ sub getparameter elsif ($param eq "-destdir") # new parameter for simple installer { $installer::globals::rootpath ne "" && die "must set destdir before -i or -simple"; - $installer::globals::destdir = shift @ARGV; + $installer::globals::destdir = Cwd::realpath( shift @ARGV ); } elsif ($param eq "-simple") # new parameter for simple installer { diff --git a/solenv/bin/ooinstall b/solenv/bin/ooinstall index 4afdb23d0133..89aea81a6741 100755 --- a/solenv/bin/ooinstall +++ b/solenv/bin/ooinstall @@ -28,11 +28,13 @@ for $arg (@ARGV) { } elsif ($arg eq '-h' || $arg eq '--help') { $help = 1; } else { - # Cwd::realpath does not work if the path does not exist - mkpath($ENV{DESTDIR} . $arg) unless -d $ENV{DESTDIR} . $arg; - $path = Cwd::realpath( $ENV{DESTDIR} . $arg ); - my $destdir = Cwd::realpath( $ENV{DESTDIR} ); - $path =~ s|$destdir||; + # Cwd::realpath does not work if the path does not exist + mkpath($ENV{DESTDIR} . $arg) unless -d $ENV{DESTDIR} . $arg; + $path = Cwd::realpath( $ENV{DESTDIR} . $arg ); + if (!$do_link) { + my $destdir = Cwd::realpath( $ENV{DESTDIR} ); + $path =~ s|$destdir||; + } } } diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 5c33719a2edb..df8e8a651ff0 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -36,7 +36,7 @@ export DBGSV_ERROR_OUT # gb_CppunitTest_TARGETTYPE # gb_CppunitTest_get_filename gb_CppunitTest_CPPTESTTARGET := $(call gb_Executable_get_target,cppunit/cppunittester) -gb_CppunitTest_CPPTESTCOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) STAR_RESOURCEPATH=$(dir $(call gb_ResTarget_get_outdir_target,example)) LANG=en_US.UTF-8 $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_CPPTESTTARGET) +gb_CppunitTest_CPPTESTCOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) STAR_RESOURCEPATH=$(dir $(call gb_ResTarget_get_outdir_target,example)) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_CPPTESTTARGET) gb_CppunitTest__get_linktargetname = CppunitTest/$(call gb_CppunitTest_get_filename,$(1)) .PHONY : $(call gb_CppunitTest_get_clean_target,%) diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk index fafb78820522..aad4f45bb97f 100644 --- a/solenv/inc/minor.mk +++ b/solenv/inc/minor.mk @@ -1,5 +1,5 @@ RSCVERSION=300 -RSCREVISION=300m103(Build:4) -BUILD=4 +RSCREVISION=300m103(Build:5) +BUILD=5 LAST_MINOR=m103 SOURCEVERSION=DEV300 diff --git a/solenv/inc/rules.mk b/solenv/inc/rules.mk index db97eddea355..0ff659c7ec1b 100644 --- a/solenv/inc/rules.mk +++ b/solenv/inc/rules.mk @@ -715,14 +715,14 @@ $(MISC)/%.sh : %.sh .IF "$(WITH_LANG)"!="" $(COMMONMISC)/$(TARGET)/%.ulf : %.ulf @echo "Making: " $(@:f) - $(COMMAND_ECHO)-$(MKDIR) $(@:d) + $(COMMAND_ECHO)-$(MKDIRHIER) $(@:d) $(COMMAND_ECHO)-$(RM) $@ $(COMMAND_ECHO)$(ULFEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@ $(COMMAND_ECHO)-$(RM) $@.$(INPATH) $(COMMONMISC)/$(TARGET)/%.xrb : %.xrb - $(COMMAND_ECHO)-$(MKDIR) $(@:d) + $(COMMAND_ECHO)-$(MKDIRHIER) $(@:d) $(COMMAND_ECHO)-$(RM) $@ $(COMMAND_ECHO)$(XMLEX) -t xrb -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@ diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index ea015a242661..1aa56358693d 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -2513,11 +2513,15 @@ const SmErrorDesc *SmParser::PrevError() } -const SmErrorDesc *SmParser::GetError(size_t i) +const SmErrorDesc *SmParser::GetError(size_t i) { - return ( i < m_aErrDescList.size() ) - ? m_aErrDescList[ i ] - : m_aErrDescList[ m_nCurError ]; + if ( i < m_aErrDescList.size() ) + return m_aErrDescList[ i ]; + + if ( (size_t)m_nCurError < m_aErrDescList.size() ) + return m_aErrDescList[ m_nCurError ]; + + return NULL; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk index 8b976275694a..ae19390676b3 100644 --- a/svx/AllLangResTarget_svx.mk +++ b/svx/AllLangResTarget_svx.mk @@ -106,18 +106,18 @@ $(call gb_SrsTarget_get_clean_target,svx/res) : $(WORKDIR)/inc/svx/globlmn.hrc_c # hack !!! # just a temporary - globlmn.hrc about to be removed! ifeq ($(strip $(WITH_LANG)),) -$(WORKDIR)/inc/svx/globlmn.hrc : $(SRCDIR)/svx/inc/globlmn_tmpl.hrc +$(WORKDIR)/inc/svx/globlmn.hrc : $(realpath $(SRCDIR)/svx/inc/globlmn_tmpl.hrc) echo copying $@ -mkdir -p $(WORKDIR)/inc/svx - cp $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(WORKDIR)/inc/svx/globlmn.hrc - cp $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(OUTDIR)/inc/svx/globlmn.hrc + cp $< $@ + $(call gb_Deliver_deliver, $@, $(OUTDIR)/inc/svx/globlmn.hrc) rm -f $(WORKDIR)/inc/svx/lastrun.mk else -include $(WORKDIR)/inc/svx/lastrun.mk ifneq ($(gb_lastrun_globlmn),MERGED) .PHONY : $(WORKDIR)/inc/svx/globlmn.hrc endif -$(WORKDIR)/inc/svx/globlmn.hrc : $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf +$(WORKDIR)/inc/svx/globlmn.hrc : $(realpath $(SRCDIR)/svx/inc/globlmn_tmpl.hrc) $(realpath $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf) echo merging $@ -mkdir -p $(WORKDIR)/inc/svx rm -f $(WORKDIR)/inc/svx/lastrun.mk @@ -125,8 +125,8 @@ $(WORKDIR)/inc/svx/globlmn.hrc : $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(gb_SrsPart $(call gb_Helper_abbreviate_dirs_native, \ $(gb_SrsPartMergeTarget_TRANSEXCOMMAND) \ -p svx \ - -i $< -o $@ -m $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf -l all) - cp $(WORKDIR)/inc/svx/globlmn.hrc $(OUTDIR)/inc/svx/globlmn.hrc + -i $< -o $@ -m $(realpath $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf) -l all) + $(call gb_Deliver_deliver, $@, $(OUTDIR)/inc/svx/globlmn.hrc) endif .PHONY : $(WORKDIR)/inc/svx/globlmn.hrc_clean diff --git a/svx/inc/svx/svdpntv.hxx b/svx/inc/svx/svdpntv.hxx index 259fe62b720a..e345093bc5f4 100644 --- a/svx/inc/svx/svdpntv.hxx +++ b/svx/inc/svx/svdpntv.hxx @@ -400,6 +400,8 @@ public: // #i74769# Interface change to use common BeginCompleteRedraw/EndCompleteRedraw // #i76114# bDisableIntersect disables intersecting rReg with the Window's paint region SdrPaintWindow* BeginDrawLayers(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false); + // used when the region passed to BeginDrawLayers needs to be changed + void UpdateDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false); void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer); protected: @@ -412,6 +414,8 @@ protected: // used to paint the form layer after the PreRender device is flushed (painted) to the window. void ImpFormLayerDrawing(SdrPaintWindow& rPaintWindow) const; + Region OptimizeDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect); + public: sal_Bool IsPageVisible() const { return bPageVisible; } // Seite (weisse Flaeche) malen oder nicht sal_Bool IsPageBorderVisible() const { return bPageBorderVisible; } // Seite (weisse Flaeche) malen oder nicht diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index 3350a33d23c9..a04ab26d949d 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -964,47 +964,7 @@ SdrPaintWindow* SdrPaintView::BeginDrawLayers(OutputDevice* pOut, const Region& if(pKnownTarget) { - // #i74769# check if pOut is a win and has a ClipRegion. If Yes, the Region - // rReg may be made more granular (fine) with using it. Normally, rReg - // does come from Window::Paint() anyways and thus is based on a single - // rectangle which was derived from exactly that repaint region - Region aOptimizedRepaintRegion(rReg); - - // #i76114# Intersecting the region with the Window's paint region is disabled - // for print preview in Calc, because the intersection can be empty (if the paint - // region is outside of the table area of the page), and then no clip region - // would be set. - if(pOut && OUTDEV_WINDOW == pOut->GetOutDevType() && !bDisableIntersect) - { - Window* pWindow = (Window*)pOut; - - if(pWindow->IsInPaint()) - { - if(!pWindow->GetPaintRegion().IsEmpty()) - { - aOptimizedRepaintRegion.Intersect(pWindow->GetPaintRegion()); - -#ifdef DBG_UTIL - // #i74769# test-paint repaint region - static bool bDoPaintForVisualControl(false); - if(bDoPaintForVisualControl) - { - RegionHandle aRegionHandle(aOptimizedRepaintRegion.BeginEnumRects()); - Rectangle aRegionRectangle; - - while(aOptimizedRepaintRegion.GetEnumRects(aRegionHandle, aRegionRectangle)) - { - pWindow->SetLineColor(COL_LIGHTGREEN); - pWindow->SetFillColor(); - pWindow->DrawRect(aRegionRectangle); - } - - aOptimizedRepaintRegion.EndEnumRects(aRegionHandle); - } -#endif - } - } - } + Region aOptimizedRepaintRegion = OptimizeDrawLayersRegion( pOut, rReg, bDisableIntersect ); // prepare redraw pKnownTarget->PrepareRedraw(aOptimizedRepaintRegion); @@ -1029,6 +989,70 @@ void SdrPaintView::EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLa } } +void SdrPaintView::UpdateDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect) +{ + SdrPaintWindow* pPaintWindow = FindPaintWindow(*pOut); + OSL_ENSURE(pPaintWindow, "SdrPaintView::UpdateDrawLayersRegion: No SdrPaintWindow (!)"); + + if(mpPageView) + { + SdrPageWindow* pKnownTarget = mpPageView->FindPageWindow(*pPaintWindow); + + if(pKnownTarget) + { + Region aOptimizedRepaintRegion = OptimizeDrawLayersRegion( pOut, rReg, bDisableIntersect ); + pKnownTarget->GetPaintWindow().SetRedrawRegion(aOptimizedRepaintRegion); + mpPageView->setPreparedPageWindow(pKnownTarget); // already set actually + } + } +} + +Region SdrPaintView::OptimizeDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect) +{ + // #i74769# check if pOut is a win and has a ClipRegion. If Yes, the Region + // rReg may be made more granular (fine) with using it. Normally, rReg + // does come from Window::Paint() anyways and thus is based on a single + // rectangle which was derived from exactly that repaint region + Region aOptimizedRepaintRegion(rReg); + + // #i76114# Intersecting the region with the Window's paint region is disabled + // for print preview in Calc, because the intersection can be empty (if the paint + // region is outside of the table area of the page), and then no clip region + // would be set. + if(pOut && OUTDEV_WINDOW == pOut->GetOutDevType() && !bDisableIntersect) + { + Window* pWindow = (Window*)pOut; + + if(pWindow->IsInPaint()) + { + if(!pWindow->GetPaintRegion().IsEmpty()) + { + aOptimizedRepaintRegion.Intersect(pWindow->GetPaintRegion()); + +#ifdef DBG_UTIL + // #i74769# test-paint repaint region + static bool bDoPaintForVisualControl(false); + if(bDoPaintForVisualControl) + { + RegionHandle aRegionHandle(aOptimizedRepaintRegion.BeginEnumRects()); + Rectangle aRegionRectangle; + + while(aOptimizedRepaintRegion.GetEnumRects(aRegionHandle, aRegionRectangle)) + { + pWindow->SetLineColor(COL_LIGHTGREEN); + pWindow->SetFillColor(); + pWindow->DrawRect(aRegionRectangle); + } + + aOptimizedRepaintRegion.EndEnumRects(aRegionHandle); + } +#endif + } + } + } + return aOptimizedRepaintRegion; +} + //////////////////////////////////////////////////////////////////////////////////////////////////// void SdrPaintView::ImpTextEditDrawing(SdrPaintWindow& rPaintWindow) const diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 27f4d434df44..006895099bd1 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -37,6 +37,7 @@ #include <ring.hxx> #include <swrect.hxx> #include <boost/shared_ptr.hpp>// swmod 080115 +#include <stack> #include <vcl/mapmod.hxx> #include <vcl/print.hxx> @@ -236,7 +237,7 @@ public: ////////////////////////////////////////////////////////////////////////////// // #i72754# set of Pre/PostPaints with lock counter and initial target OutDev protected: - sal_uInt32 mnPrePostPaintCount; + std::stack<Region> mPrePostPaintRegions; // acts also as a lock counter (empty == not locked) OutputDevice* mpPrePostOutDev; MapMode maPrePostMapMode; public: @@ -248,7 +249,7 @@ public: virtual void Paint(const Rectangle &rRect); sal_Bool IsPaintInProgress() const { return bPaintInProgress; } - bool IsDrawingLayerPaintInProgress() const { return 0 != mnPrePostPaintCount; } + bool IsDrawingLayerPaintInProgress() const { return !mPrePostPaintRegions.empty(); } //Benachrichtung, dass sich der sichtbare Bereich geaendert hat. //VisArea wird neu gesetzt, anschliessend wird gescrollt. diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index a031aa86098f..7c4e1984b819 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1947,7 +1947,7 @@ void SwDoc::ResetModified() mbModified = sal_False; // If there is already a document statistic, we assume that // it is correct. In this case we reset the modified flag. - if ( 0 != pDocStat->nChar ) + if ( 0 != pDocStat->nCharExcludingSpaces ) pDocStat->bModified = sal_False; GetIDocumentUndoRedo().SetUndoNoModifiedPosition(); if( nCall && aOle2Link.IsSet() ) diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 2673082d5468..17b9a29ee78b 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -162,63 +162,63 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, aPoint.Y() = Min( aPoint.Y(), Frm().Bottom() ); } - //Wenn kein Cntnt unterhalb der Seite 'antwortet', so korrigieren - //wir den StartPoint und fangen nochmal eine Seite vor der - //aktuellen an. Mit Flys ist es dann allerdings vorbei. - if ( SwLayoutFrm::GetCrsrOfst( pPos, aPoint, pCMS ) ) - bRet = sal_True; - else + //Koennte ein Freifliegender gemeint sein? + //Wenn sein Inhalt geschuetzt werden soll, so ist nix mit Crsr + //hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein. + if ( GetSortedObjs() ) { - if ( pCMS && (pCMS->bStop || pCMS->bExactOnly) ) + SwOrderIter aIter( this ); + aIter.Top(); + while ( aIter() ) { - ((SwCrsrMoveState*)pCMS)->bStop = sal_True; - return sal_False; - } - const SwCntntFrm *pCnt = GetCntntPos( aPoint, sal_False, sal_False, sal_False, pCMS, sal_False ); - if ( pCMS && pCMS->bStop ) - return sal_False; - - OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" ); - if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() ) - bRet = pCnt->GetCrsrOfst( pPos, rPoint, pCMS ); - else - bRet = pCnt->GetCrsrOfst( pPos, aPoint, pCMS ); + const SwVirtFlyDrawObj* pObj = + static_cast<const SwVirtFlyDrawObj*>(aIter()); + const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0; + if ( pFly && + ( ( pCMS ? pCMS->bSetInReadOnly : sal_False ) || + !pFly->IsProtected() ) && + pFly->GetCrsrOfst( pPos, aPoint, pCMS ) ) + { + bRet = sal_True; + break; + } - if ( !bRet ) - { - // Set point to pCnt, delete mark - // this may happen, if pCnt is hidden - *pPos = SwPosition( *pCnt->GetNode(), SwIndex( (SwTxtNode*)pCnt->GetNode(), 0 ) ); - bRet = sal_True; + if ( pCMS && pCMS->bStop ) + return sal_False; + aIter.Prev(); } } if ( !bRet ) { - //Koennte ein Freifliegender gemeint sein? - //Wenn sein Inhalt geschuetzt werden soll, so ist nix mit Crsr - //hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein. - if ( GetSortedObjs() ) + //Wenn kein Cntnt unterhalb der Seite 'antwortet', so korrigieren + //wir den StartPoint und fangen nochmal eine Seite vor der + //aktuellen an. Mit Flys ist es dann allerdings vorbei. + if ( SwLayoutFrm::GetCrsrOfst( pPos, aPoint, pCMS ) ) + bRet = sal_True; + else { - SwOrderIter aIter( this ); - aIter.Top(); - while ( aIter() ) + if ( pCMS && (pCMS->bStop || pCMS->bExactOnly) ) { - const SwVirtFlyDrawObj* pObj = - static_cast<const SwVirtFlyDrawObj*>(aIter()); - const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0; - if ( pFly && - ( ( pCMS ? pCMS->bSetInReadOnly : sal_False ) || - !pFly->IsProtected() ) && - pFly->GetCrsrOfst( pPos, aPoint, pCMS ) ) - { - bRet = sal_True; - break; - } + ((SwCrsrMoveState*)pCMS)->bStop = sal_True; + return sal_False; + } + const SwCntntFrm *pCnt = GetCntntPos( aPoint, sal_False, sal_False, sal_False, pCMS, sal_False ); + if ( pCMS && pCMS->bStop ) + return sal_False; - if ( pCMS && pCMS->bStop ) - return sal_False; - aIter.Prev(); + OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" ); + if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() ) + bRet = pCnt->GetCrsrOfst( pPos, rPoint, pCMS ); + else + bRet = pCnt->GetCrsrOfst( pPos, aPoint, pCMS ); + + if ( !bRet ) + { + // Set point to pCnt, delete mark + // this may happen, if pCnt is hidden + *pPos = SwPosition( *pCnt->GetNode(), SwIndex( (SwTxtNode*)pCnt->GetNode(), 0 ) ); + bRet = sal_True; } } } diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index a84ccb6b52de..c72c22fb02f9 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -820,7 +820,7 @@ void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const { if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) { // a checkbox... - ICheckboxFieldmark* pCheckboxFm = reinterpret_cast< ICheckboxFieldmark* >(pBM); + ICheckboxFieldmark* pCheckboxFm = dynamic_cast< ICheckboxFieldmark* >(pBM); bool checked = pCheckboxFm->IsChecked(); rInf.DrawCheckBox(*this, checked); } diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index 8a40614a3d93..5696984a7dce 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -623,7 +623,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) pBigFont = pLastFont; // Hier entsteht der Kleinbuchstabenfont: - aFont.SetProportion( sal_uInt8 (aFont.GetPropr() * SMALL_CAPS_PERCENTAGE ) / 100L); + aFont.SetProportion( (aFont.GetPropr() * SMALL_CAPS_PERCENTAGE ) / 100L ); pMagic2 = NULL; nIndex2 = 0; SwFntAccess *pSmallFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont, diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 797ed01a3287..e328e369e696 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -98,7 +98,7 @@ using namespace ::com::sun::star; ////////////////////////////////////////////////////////////////////////////// // #i72754# 2nd set of Pre/PostPaints -// This time it uses the lock counter mnPrePostPaintCount to allow only one activation +// This time it uses the lock counter (mPrePostPaintRegions empty/non-empty) to allow only one activation // and deactivation and mpPrePostOutDev to remember the OutDev from the BeginDrawLayers // call. That way, all places where paint take place can be handled the same way, even // when calling other paint methods. This is the case at the places where SW paints @@ -116,8 +116,9 @@ void ViewShell::PrePaint() void ViewShell::DLPrePaint2(const Region& rRegion) { - if(0L == mnPrePostPaintCount) + if(mPrePostPaintRegions.empty()) { + mPrePostPaintRegions.push( rRegion ); // #i75172# ensure DrawView to use DrawingLayer bufferings if ( !HasDrawView() ) MakeDrawView(); @@ -139,16 +140,29 @@ void ViewShell::DLPrePaint2(const Region& rRegion) // remember original paint MapMode for wrapped FlyFrame paints maPrePostMapMode = pOut->GetMapMode(); } - - mnPrePostPaintCount++; + else + { + // region needs to be updated to the given one + if( mPrePostPaintRegions.top() != rRegion ) + Imp()->GetDrawView()->UpdateDrawLayersRegion(mpPrePostOutDev, rRegion); + mPrePostPaintRegions.push( rRegion ); + } } void ViewShell::DLPostPaint2(bool bPaintFormLayer) { - OSL_ENSURE(mnPrePostPaintCount > 0L, "ViewShell::DLPostPaint2: Pre/PostPaint encapsulation broken (!)"); - mnPrePostPaintCount--; + OSL_ENSURE(!mPrePostPaintRegions.empty(), "ViewShell::DLPostPaint2: Pre/PostPaint encapsulation broken (!)"); - if((0L == mnPrePostPaintCount) && (0 != mpTargetPaintWindow)) + if( mPrePostPaintRegions.size() > 1 ) + { + Region current = mPrePostPaintRegions.top(); + mPrePostPaintRegions.pop(); + if( current != mPrePostPaintRegions.top()) + Imp()->GetDrawView()->UpdateDrawLayersRegion(mpPrePostOutDev, mPrePostPaintRegions.top()); + return; + } + mPrePostPaintRegions.pop(); // clear + if(0 != mpTargetPaintWindow) { // #i74769# restore buffered OutDev if(mpTargetPaintWindow->GetPreRenderDevice()) diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 668a9028d36a..7b51f53b9df3 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -158,7 +158,6 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow, pDoc( &rDocument ), nStartAction( 0 ), nLockPaint( 0 ), - mnPrePostPaintCount(0L), mpPrePostOutDev(0), maPrePostMapMode() { @@ -226,7 +225,6 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow, pDoc( rShell.GetDoc() ), nStartAction( 0 ), nLockPaint( 0 ), - mnPrePostPaintCount(0L), mpPrePostOutDev(0), maPrePostMapMode() { diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index bc60b3e21e74..357aded1322d 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -657,9 +657,7 @@ void DocxAttributeOutput::WriteFFData( const FieldInfos& rInfos ) FieldMarkParamsHelper params( rFieldmark ); params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMCHECKBOX_NAME ) ), sName ); - const sw::mark::ICheckboxFieldmark* pCheckboxFm = NULL; - if ( rFieldmark.GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) - pCheckboxFm = reinterpret_cast<const sw::mark::ICheckboxFieldmark*>(&rFieldmark); + const sw::mark::ICheckboxFieldmark* pCheckboxFm = dynamic_cast<const sw::mark::ICheckboxFieldmark*>(&rFieldmark); if ( pCheckboxFm && pCheckboxFm->IsChecked() ) bChecked = true; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 81920922c145..fe160b9493fe 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3522,9 +3522,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) return; const ::sw::mark::IFieldmark* pFieldmark = &rFieldmark; - const ::sw::mark::ICheckboxFieldmark* pAsCheckbox = NULL; - if ( rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) - pAsCheckbox = reinterpret_cast< const ::sw::mark::ICheckboxFieldmark* >( pFieldmark ); + const ::sw::mark::ICheckboxFieldmark* pAsCheckbox = dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( pFieldmark ); OSL_ENSURE(rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) || diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 6d014a08a61a..45cc68c4cdfc 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -225,7 +225,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr ) OSL_ENSURE(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); if (pFieldmark!=NULL) { IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters(); - ICheckboxFieldmark* pCheckboxFm = reinterpret_cast<ICheckboxFieldmark*>(pFieldmark); + ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(pFieldmark); (*pParameters)[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_NAME))] = uno::makeAny(::rtl::OUString(aFormula.sTitle)); (*pParameters)[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_HELPTEXT))] = uno::makeAny(::rtl::OUString(aFormula.sToolTip)); diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx index 92c743518cb6..be0e7d42d286 100644 --- a/sw/source/filter/xml/xmlmeta.cxx +++ b/sw/source/filter/xml/xmlmeta.cxx @@ -94,6 +94,7 @@ enum SvXMLTokenMapAttrs XML_TOK_META_STAT_PARA = 16, XML_TOK_META_STAT_WORD = 32, XML_TOK_META_STAT_CHAR = 64, + XML_TOK_META_STAT_NON_WHITE_SPACE_CHAR = 128, XML_TOK_META_STAT_END=XML_TOK_UNKNOWN }; @@ -112,6 +113,7 @@ static const struct statistic s_stats [] = { { XML_TOK_META_STAT_PARA, "ParagraphCount", 0, &SwDocStat::nPara }, { XML_TOK_META_STAT_WORD, "WordCount", 0, &SwDocStat::nWord }, { XML_TOK_META_STAT_CHAR, "CharacterCount", 0, &SwDocStat::nChar }, + { XML_TOK_META_STAT_NON_WHITE_SPACE_CHAR, "NonWhitespaceCharacterCount", 0, &SwDocStat::nCharExcludingSpaces }, { XML_TOK_META_STAT_END, 0, 0, 0 } }; @@ -149,7 +151,7 @@ void SwXMLImport::SetStatistics( } } - if( 127 == nTokens ) + if( 255 == nTokens ) aDocStat.bModified = sal_False; if( nTokens ) pDoc->SetDocStat( aDocStat ); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index c78cedad805c..818aec6e04a3 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -2195,9 +2195,8 @@ KEYINPUT_CHECKTABLE_INSDEL: case KS_InsChar: if (rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) { - ::sw::mark::ICheckboxFieldmark* pFieldmark = NULL; - if ( rSh.GetCurrentFieldmark() && rSh.GetCurrentFieldmark()->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) - pFieldmark = reinterpret_cast< ::sw::mark::ICheckboxFieldmark* > + ::sw::mark::ICheckboxFieldmark* pFieldmark = + dynamic_cast< ::sw::mark::ICheckboxFieldmark* > (rSh.GetCurrentFieldmark()); OSL_ENSURE(pFieldmark, "Where is my FieldMark??"); @@ -4119,7 +4118,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) IFieldmark *fieldBM = const_cast< IFieldmark* > ( aCntntAtPos.aFnd.pFldmark ); if (fieldBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) { - ICheckboxFieldmark* pCheckboxFm = reinterpret_cast<ICheckboxFieldmark*>(fieldBM); + ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(fieldBM); pCheckboxFm->SetChecked(!pCheckboxFm->IsChecked()); pCheckboxFm->Invalidate(); rSh.InvalidateWindows( rView.GetVisArea() ); diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx index 63298235243f..a2ff8e8c0294 100644 --- a/sw/source/ui/inc/swuicnttab.hxx +++ b/sw/source/ui/inc/swuicnttab.hxx @@ -28,25 +28,27 @@ #ifndef _SWUI_CNTTAB_HXX #define _SWUI_CNTTAB_HXX -#include <boost/ptr_container/ptr_vector.hpp> - -#include <tools/resary.hxx> -#include <sfx2/tabdlg.hxx> -#include <svtools/svtreebx.hxx> -#include <svx/checklbx.hxx> -#include <svx/langbox.hxx> #include <svx/stddlg.hxx> + #include <vcl/button.hxx> + #include <vcl/edit.hxx> -#include <vcl/field.hxx> + #include <vcl/fixed.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/menubtn.hxx> -#include <cnttab.hxx> -#include <toxmgr.hxx> +#include <vcl/field.hxx> +#include <vcl/lstbox.hxx> +#include <sfx2/tabdlg.hxx> #include "tox.hxx" +#include <toxmgr.hxx> +#include <svx/checklbx.hxx> +#include <tools/resary.hxx> +#include <svtools/svtreebx.hxx> +#include <vcl/menubtn.hxx> +#include <svx/langbox.hxx> +#include <cnttab.hxx> +#include <vector> class SwWrtShell; class SwTOXMgr; @@ -259,16 +261,15 @@ class SwTOXEntryTabPage; class SwTokenWindow : public Window { - typedef boost::ptr_vector<Control> TOXControlList; - typedef TOXControlList::iterator ctrl_iterator; - typedef TOXControlList::const_iterator ctrl_const_iterator; - typedef TOXControlList::reverse_iterator ctrl_reverse_iterator; - typedef TOXControlList::const_reverse_iterator ctrl_const_reverse_iterator; + typedef std::vector<Control*>::iterator ctrl_iterator; + typedef std::vector<Control*>::const_iterator ctrl_const_iterator; + typedef std::vector<Control*>::reverse_iterator ctrl_reverse_iterator; + typedef std::vector<Control*>::const_reverse_iterator ctrl_const_reverse_iterator; ImageButton aLeftScrollWin; Window aCtrlParentWin; ImageButton aRightScrollWin; - TOXControlList aControlList; + std::vector<Control*> aControlList; SwForm* pForm; sal_uInt16 nLevel; sal_Bool bValid; diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 5ae40724d85b..4fc60b300dfb 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -111,17 +111,6 @@ static const sal_Unicode aDeliEnd = ']'; //fuer die form #define IDX_FILE_EXTENSION String::CreateFromAscii( \ RTL_CONSTASCII_STRINGPARAM( "*.sdi" )) -static boost::ptr_vector<Control>::iterator FindControl (boost::ptr_vector<Control> &list, Control *ctrl) -{ - for (boost::ptr_vector<Control>::iterator it = list.begin(); it != list.end(); ++it) - { - if ((&(*it)) == ctrl) - return it; - } - - return list.end(); -} - String lcl_CreateAutoMarkFileDlg( const String& rURL, const String& rFileString, sal_Bool bOpen ) { @@ -2879,6 +2868,13 @@ SwTokenWindow::SwTokenWindow(SwTOXEntryTabPage* pParent, const ResId& rResId) : SwTokenWindow::~SwTokenWindow() { + for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) + { + Control* pControl = (*it); + pControl->SetGetFocusHdl( Link() ); + pControl->SetLoseFocusHdl( Link() ); + delete pControl; + } } void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) @@ -2886,9 +2882,14 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) SetActiveControl(0); bValid = sal_True; - //apply current level settings to the form if(pForm) + { + //apply current level settings to the form + for (ctrl_iterator iter = aControlList.begin(); iter != aControlList.end(); ++iter) + delete (*iter); + aControlList.clear(); + } nLevel = nL; pForm = &rForm; @@ -2986,17 +2987,17 @@ Control* SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rT Point aControlPos; if(!aControlList.empty()) - { - ctrl_const_reverse_iterator iterLast = aControlList.rbegin(); + { + Control* pLast = *(aControlList.rbegin()); - aControlSize = iterLast->GetSizePixel(); - aControlPos = iterLast->GetPosPixel(); + aControlSize = pLast->GetSizePixel(); + aControlPos = pLast->GetPosPixel(); aControlPos.X() += aControlSize.Width(); } if(TOKEN_TEXT == rToken.eTokenType) { - SwTOXEdit *pEdit = new SwTOXEdit(&aCtrlParentWin, this, rToken); + SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, rToken); pEdit->SetPosPixel(aControlPos); aControlList.push_back(pEdit); @@ -3063,73 +3064,71 @@ void SwTokenWindow::InsertAtSelection( //<insert> LS //<insert> LE //<insert> - bool bPreStartLinkFound = false; - bool bPreEndLinkFound = false; + sal_Bool bPreStartLinkFound = sal_False; + sal_Bool bPreEndLinkFound = sal_False; - const Control *pExchange = 0; - ctrl_const_iterator it = aControlList.begin(); + const Control* pControl = 0; + const Control* pExchange = 0; - while ( it != aControlList.end()) + ctrl_const_iterator it = aControlList.begin(); + for( ; it != aControlList.end() && pActiveCtrl != (*it); ++it ) { - if ((&(*it)) == pActiveCtrl) - break; + pControl = *it; - if( WINDOW_EDIT != it->GetType()) + if( WINDOW_EDIT != pControl->GetType()) { const SwFormToken& rNewToken = - (reinterpret_cast<const SwTOXButton&>(*it)).GetFormToken(); + ((SwTOXButton*)pControl)->GetFormToken(); if( TOKEN_LINK_START == rNewToken.eTokenType ) { - bPreStartLinkFound = true; + bPreStartLinkFound = sal_True; pExchange = 0; } else if(TOKEN_LINK_END == rNewToken.eTokenType) { if( bPreStartLinkFound ) - bPreStartLinkFound = false; + bPreStartLinkFound = sal_False; else { - bPreEndLinkFound = false; - pExchange = const_cast<Control*>(&(*it)); + bPreEndLinkFound = sal_False; + pExchange = pControl; } } } - - ++it; } bool bPostLinkStartFound = false; if(!bPreStartLinkFound && !bPreEndLinkFound) { - while(it != aControlList.end()) + for( ; it != aControlList.end(); ++it ) { - if( (&(*it)) != pActiveCtrl && - WINDOW_EDIT != it->GetType()) + pControl = *it; + + if( pControl != pActiveCtrl && + WINDOW_EDIT != pControl->GetType()) { const SwFormToken& rNewToken = - reinterpret_cast<const SwTOXButton&>(*it).GetFormToken(); + ((SwTOXButton*)pControl)->GetFormToken(); if( TOKEN_LINK_START == rNewToken.eTokenType ) { if(bPostLinkStartFound) break; - bPostLinkStartFound = true; - pExchange = const_cast<Control*>(&(*it)); + bPostLinkStartFound = sal_True; + pExchange = pControl; } else if(TOKEN_LINK_END == rNewToken.eTokenType ) { if(bPostLinkStartFound) { - bPostLinkStartFound = false; + bPostLinkStartFound = sal_False; pExchange = 0; } break; } } - - ++it; } } @@ -3142,7 +3141,6 @@ void SwTokenWindow::InsertAtSelection( if(bPostLinkStartFound) { OSL_ENSURE(pExchange, "no control to exchange?"); - if(pExchange) { ((SwTOXButton*)pExchange)->SetLinkEnd(); @@ -3164,7 +3162,9 @@ void SwTokenWindow::InsertAtSelection( //if the active control is text then insert a new button at the selection //else replace the button - ctrl_iterator iterActive = FindControl(aControlList,pActiveCtrl); + ctrl_iterator iterActive = std::find(aControlList.begin(), + aControlList.end(), pActiveCtrl); + ctrl_iterator iterInsert = iterActive; Size aControlSize(GetOutputSizePixel()); @@ -3187,7 +3187,7 @@ void SwTokenWindow::InsertAtSelection( SwFormToken aTmpToken(TOKEN_TEXT); SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken); - aControlList.insert(iterInsert,pEdit); + aControlList.insert(iterInsert, pEdit); pEdit->SetText(sRight); pEdit->SetSizePixel(aControlSize); @@ -3199,13 +3199,15 @@ void SwTokenWindow::InsertAtSelection( } else { - pActiveCtrl->Hide(); aControlList.erase(iterActive); + pActiveCtrl->Hide(); + delete pActiveCtrl; } //now the new button SwTOXButton* pButton = new SwTOXButton(&aCtrlParentWin, this, aToInsertToken); - aControlList.insert(iterInsert,pButton); + + aControlList.insert(iterInsert, pButton); pButton->SetPrevNextLink(LINK(this, SwTokenWindow, NextItemBtnHdl)); pButton->SetGetFocusHdl(LINK(this, SwTokenWindow, TbxFocusBtnHdl)); @@ -3237,7 +3239,7 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall ) if(bInternalCall && TOX_AUTHORITIES == pForm->GetTOXType()) m_pParent->PreTokenButtonRemoved(pDel->GetFormToken()); - ctrl_iterator it = FindControl(aControlList,pDel); + ctrl_iterator it = std::find(aControlList.begin(), aControlList.end(), pDel); OSL_ENSURE(it != aControlList.end(), "Control does not exist!"); @@ -3246,22 +3248,26 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall ) OSL_ENSURE(it != aControlList.begin() && it != aControlList.end() - 1, "Button at first or last position?"); - Control *pLeftCtrl = const_cast<Control*>(&(*(it-1))); - Control *pRightCtrl = const_cast<Control*>(&(*(it+1))); + ctrl_iterator itLeft = it, itRight = it; + --itLeft; + ++itRight; + Control *pLeftEdit = *itLeft; + Control *pRightEdit = *itRight; - String sTemp(((SwTOXEdit*)pLeftCtrl)->GetText()); - sTemp += ((SwTOXEdit*)pRightCtrl)->GetText(); - ((SwTOXEdit*)pLeftCtrl)->SetText(sTemp); - ((SwTOXEdit*)pLeftCtrl)->AdjustSize(); + String sTemp(((SwTOXEdit*)pLeftEdit)->GetText()); + sTemp += ((SwTOXEdit*)pRightEdit)->GetText(); + ((SwTOXEdit*)pLeftEdit)->SetText(sTemp); + ((SwTOXEdit*)pLeftEdit)->AdjustSize(); - aControlList.erase(it+1); - aControlList.erase(it); + aControlList.erase(itRight); + delete pRightEdit; + aControlList.erase(it); pActiveCtrl->Hide(); + delete pActiveCtrl; - SetActiveControl(pLeftCtrl); + SetActiveControl(pLeftEdit); AdjustPositions(); - if(aModifyHdl.IsSet()) aModifyHdl.Call(0); } @@ -3271,14 +3277,17 @@ void SwTokenWindow::AdjustPositions() if(aControlList.size() > 1) { ctrl_iterator it = aControlList.begin(); + Control* pCtrl = *it; + ++it; - Point aNextPos = it->GetPosPixel(); - aNextPos.X() += it->GetSizePixel().Width(); + Point aNextPos = pCtrl->GetPosPixel(); + aNextPos.X() += pCtrl->GetSizePixel().Width(); - for (++it; it != aControlList.end(); ++it) - { - it->SetPosPixel(aNextPos); - aNextPos.X() += it->GetSizePixel().Width(); + for(; it != aControlList.end(); ++it) + { + pCtrl = *it; + pCtrl->SetPosPixel(aNextPos); + aNextPos.X() += pCtrl->GetSizePixel().Width(); } AdjustScrolling(); @@ -3290,10 +3299,12 @@ void SwTokenWindow::MoveControls(long nOffset) // move the complete list for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - Point aPos = it->GetPosPixel(); + Control *pCtrl = *it; + + Point aPos = pCtrl->GetPosPixel(); aPos.X() += nOffset; - it->SetPosPixel(aPos); + pCtrl->SetPosPixel(aPos); } } @@ -3302,19 +3313,21 @@ void SwTokenWindow::AdjustScrolling() if(aControlList.size() > 1) { //validate scroll buttons - ctrl_const_reverse_iterator iterLast = aControlList.rbegin(); - ctrl_const_iterator iterFirst = aControlList.begin(); + Control* pFirstCtrl = *(aControlList.begin()); + Control* pLastCtrl = *(aControlList.rbegin()); long nSpace = aCtrlParentWin.GetSizePixel().Width(); - long nWidth = iterLast->GetPosPixel().X() - iterFirst->GetPosPixel().X() - + iterLast->GetSizePixel().Width(); + long nWidth = pLastCtrl->GetPosPixel().X() - pFirstCtrl->GetPosPixel().X() + + pLastCtrl->GetSizePixel().Width(); bool bEnable = nWidth > nSpace; + //the active control must be visible if(bEnable && pActiveCtrl) { - long nMove = 0; Point aActivePos(pActiveCtrl->GetPosPixel()); + long nMove = 0; + if(aActivePos.X() < 0) nMove = -aActivePos.X(); else if((aActivePos.X() + pActiveCtrl->GetSizePixel().Width()) > nSpace) @@ -3323,16 +3336,20 @@ void SwTokenWindow::AdjustScrolling() if(nMove) MoveControls(nMove); - aLeftScrollWin.Enable(iterFirst->GetPosPixel().X() < 0); - aRightScrollWin.Enable((iterLast->GetPosPixel().X() + iterLast->GetSizePixel().Width()) > nSpace); + aLeftScrollWin.Enable(pFirstCtrl->GetPosPixel().X() < 0); + + aRightScrollWin.Enable((pLastCtrl->GetPosPixel().X() + pLastCtrl->GetSizePixel().Width()) > nSpace); } else { - //if the control fits into the space then the first control must be at postion 0 - long nFirstPos = iterFirst->GetPosPixel().X(); + if(pFirstCtrl) + { + //if the control fits into the space then the first control must be at postion 0 + long nFirstPos = pFirstCtrl->GetPosPixel().X(); - if(nFirstPos != 0) - MoveControls(-nFirstPos); + if(nFirstPos != 0) + MoveControls(-nFirstPos); + } aRightScrollWin.Enable(false); aLeftScrollWin.Enable(false); @@ -3346,7 +3363,6 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) return 0; const long nSpace = aCtrlParentWin.GetSizePixel().Width(); - #if OSL_DEBUG_LEVEL > 1 //find all start/end positions and print it String sMessage(String::CreateFromAscii("Space: ")); @@ -3355,8 +3371,10 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - long nDebugXPos = it->GetPosPixel().X(); - long nDebugWidth = it->GetSizePixel().Width(); + Control *pDebugCtrl = *it; + + long nDebugXPos = pDebugCtrl->GetPosPixel().X(); + long nDebugWidth = pDebugCtrl->GetSizePixel().Width(); sMessage += String::CreateFromInt32( nDebugXPos ); sMessage += String::CreateFromAscii(" "); @@ -3372,11 +3390,13 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) //find the first completely visible control (left edge visible) for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - long nXPos = it->GetPosPixel().X(); + Control *pCtrl = *it; + + long nXPos = pCtrl->GetPosPixel().X(); if (nXPos >= 0) { - if(it == aControlList.begin()) + if (it == aControlList.begin()) { //move the current control to the left edge nMove = -nXPos; @@ -3384,8 +3404,11 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) else { //move the left neighbor to the start position - ctrl_iterator iterLeft = it-1; - nMove = -iterLeft->GetPosPixel().X(); + ctrl_iterator itLeft = it; + --itLeft; + Control *pLeft = *itLeft; + + nMove = -pLeft->GetPosPixel().X(); } break; @@ -3397,16 +3420,20 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) //find the first completely visible control (right edge visible) for (ctrl_reverse_iterator it = aControlList.rbegin(); it != aControlList.rend(); ++it) { - long nCtrlWidth = it->GetSizePixel().Width(); - long nXPos = it->GetPosPixel().X() + nCtrlWidth; + Control *pCtrl = *it; + + long nCtrlWidth = pCtrl->GetSizePixel().Width(); + long nXPos = pCtrl->GetPosPixel().X() + nCtrlWidth; if (nXPos <= nSpace) { if (it != aControlList.rbegin()) { //move the right neighbor to the right edge right aligned - ctrl_reverse_iterator iterRight = it-1; - nMove = nSpace - iterRight->GetPosPixel().X() - iterRight->GetSizePixel().Width(); + ctrl_reverse_iterator itRight = it; + --it; + Control *pRight = *itRight; + nMove = nSpace - pRight->GetPosPixel().X() - pRight->GetSizePixel().Width(); } break; @@ -3419,20 +3446,23 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) if(nMove) { // move the complete list + + Control *pCtrl = 0; + for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - Point aPos = it->GetPosPixel(); + pCtrl = *it; + Point aPos = pCtrl->GetPosPixel(); aPos.X() += nMove; - - it->SetPosPixel(aPos); + pCtrl->SetPosPixel(aPos); } - ctrl_iterator iterCtrl = aControlList.begin(); - aLeftScrollWin.Enable(iterCtrl->GetPosPixel().X() < 0); + pCtrl = *(aControlList.begin()); + aLeftScrollWin.Enable(pCtrl->GetPosPixel().X() < 0); - iterCtrl = aControlList.end()-1; - aRightScrollWin.Enable((iterCtrl->GetPosPixel().X() + iterCtrl->GetSizePixel().Width()) > nSpace); + pCtrl = *(aControlList.rbegin()); + aRightScrollWin.Enable((pCtrl->GetPosPixel().X() + pCtrl->GetSizePixel().Width()) > nSpace); #if OSL_DEBUG_LEVEL > 1 sMessage.AppendAscii("Move: "); @@ -3447,14 +3477,14 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) String SwTokenWindow::GetPattern() const { String sRet; - const Control *ctrl = 0; + for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - ctrl = &(*it); + const Control *pCtrl = *it; - const SwFormToken& rNewToken = WINDOW_EDIT == ctrl->GetType() - ? ((SwTOXEdit*)ctrl)->GetFormToken() - : ((SwTOXButton*)ctrl)->GetFormToken(); + const SwFormToken &rNewToken = pCtrl->GetType() == WINDOW_EDIT + ? ((SwTOXEdit*)pCtrl)->GetFormToken() + : ((SwTOXButton*)pCtrl)->GetFormToken(); //TODO: prevent input of TOX_STYLE_DELIMITER in KeyInput sRet += rNewToken.GetString(); @@ -3469,15 +3499,14 @@ String SwTokenWindow::GetPattern() const sal_Bool SwTokenWindow::Contains(FormTokenType eSearchFor) const { bool bRet = false; - const Control* pControl = 0; for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - pControl = &(*it); + const Control *pCtrl = *it; - const SwFormToken& rNewToken = WINDOW_EDIT == pControl->GetType() - ? ((SwTOXEdit*)pControl)->GetFormToken() - : ((SwTOXButton*)pControl)->GetFormToken(); + const SwFormToken &rNewToken = pCtrl->GetType() == WINDOW_EDIT + ? ((SwTOXEdit*)pCtrl)->GetFormToken() + : ((SwTOXButton*)pCtrl)->GetFormToken(); if (eSearchFor == rNewToken.eTokenType) { @@ -3563,24 +3592,22 @@ IMPL_LINK(SwTokenWindow, EditResize, Edit*, pEdit) IMPL_LINK(SwTokenWindow, NextItemHdl, SwTOXEdit*, pEdit) { - ctrl_iterator it = FindControl(aControlList,pEdit); + ctrl_iterator it = std::find(aControlList.begin(),aControlList.end(),pEdit); if (it == aControlList.end()) return 0; - ctrl_iterator lastIter = aControlList.end()-1; + ctrl_iterator itTest = it; + ++itTest; if ((it != aControlList.begin() && !pEdit->IsNextControl()) || - (it != lastIter && pEdit->IsNextControl())) + (itTest != aControlList.end() && pEdit->IsNextControl())) { ctrl_iterator iterFocus = it; - pEdit->IsNextControl() ? ++iterFocus : --iterFocus; - Control *pCtrlFocus = &(*iterFocus); - + Control *pCtrlFocus = *iterFocus; pCtrlFocus->GrabFocus(); - reinterpret_cast<SwTOXButton*>(pCtrlFocus)->Check(); AdjustScrolling(); @@ -3593,7 +3620,7 @@ IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit) { for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - Control *pCtrl = &(*it); + Control *pCtrl = *it; if (pCtrl && pCtrl->GetType() != WINDOW_EDIT) reinterpret_cast<SwTOXButton*>(pCtrl)->Check(false); @@ -3606,31 +3633,29 @@ IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit) IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton*, pBtn ) { - ctrl_iterator iter = FindControl(aControlList,pBtn); + ctrl_iterator it = std::find(aControlList.begin(),aControlList.end(),pBtn); - if (iter == aControlList.end()) + if (it == aControlList.end()) return 0; - ctrl_iterator lastIter = aControlList.end()-1; + ctrl_iterator itTest = it; + ++itTest; - if((iter != aControlList.begin() && !pBtn->IsNextControl()) || - (iter != lastIter && pBtn->IsNextControl())) + if (!pBtn->IsNextControl() || (itTest != aControlList.end() && pBtn->IsNextControl())) { - bool bNext = pBtn->IsNextControl(); - - ctrl_iterator iterFocus = iter; + bool isNext = pBtn->IsNextControl(); - bNext ? ++iterFocus : --iterFocus; - - Control *pCtrlFocus = &(*iterFocus); + ctrl_iterator iterFocus = it; + isNext ? ++iterFocus : --iterFocus; + Control *pCtrlFocus = *iterFocus; pCtrlFocus->GrabFocus(); - Selection aSel(0,0); - if(!bNext) + if (!isNext) { - sal_uInt16 nLen = ((SwTOXEdit*)pCtrlFocus)->GetText().Len(); + sal_uInt16 nLen = reinterpret_cast<SwTOXEdit*>(pCtrlFocus)->GetText().Len(); + aSel.A() = nLen; aSel.B() = nLen; } @@ -3647,10 +3672,9 @@ IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton*, pBtn ) IMPL_LINK(SwTokenWindow, TbxFocusBtnHdl, SwTOXButton*, pBtn ) { - Control *pControl = 0; - for (ctrl_iterator sit = aControlList.begin(); sit != aControlList.end(); ++sit) + for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - pControl = &(*sit); + Control *pControl = *it; if (pControl && WINDOW_EDIT != pControl->GetType()) reinterpret_cast<SwTOXButton*>(pControl)->Check(pBtn == pControl); @@ -3667,11 +3691,14 @@ void SwTokenWindow::GetFocus() { if (!aControlList.empty()) { - Control *pFirst = &(*aControlList.begin()); + Control *pFirst = *aControlList.begin(); - pFirst->GrabFocus(); - SetActiveControl(pFirst); - AdjustScrolling(); + if (pFirst) + { + pFirst->GrabFocus(); + SetActiveControl(pFirst); + AdjustScrolling(); + } } } } diff --git a/sysui/desktop/freedesktop/freedesktop-menus.spec b/sysui/desktop/freedesktop/freedesktop-menus.spec index 8cec36901e9f..1cb1554a6a5f 100755 --- a/sysui/desktop/freedesktop/freedesktop-menus.spec +++ b/sysui/desktop/freedesktop/freedesktop-menus.spec @@ -40,7 +40,6 @@ umask 0000 export DESTDIR=$RPM_BUILD_ROOT export KDEMAINDIR=/usr export GNOMEDIR=/usr -export GNOME_MIME_THEME=hicolor ./create_tree.sh @@ -105,6 +104,54 @@ if [ "$1" = "1" ] ; then # first install fi fi +# add symlinks so that nautilus can identify the mime-icons +# not strictly freedesktop-stuff but there is no common naming scheme yet. +# One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png" +# for e.g. application/vnd.oasis.opendocument.spreadsheet +link_target_root="/opt/gnome/share/icons/hicolor" + +if [ ! -d "${link_target_root}" ] +then + link_target_root="/opt/gnome/share/icons/gnome" +fi + +for subdir in `cd ${link_target_root}; ls -d *` +do + link_dir="/opt/gnome/share/icons/hicolor/$subdir/mimetypes" + link_target_dir="../../../gnome/$subdir/mimetypes" + + test -d ${link_dir}/${link_target_dir} || continue; + + if [ ! -d "${link_dir}" ] + then + mkdir -p "${link_dir}" + fi + + icon=%iconprefix-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png + icon=%iconprefix-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png + icon=%iconprefix-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png + icon=%iconprefix-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png + icon=%iconprefix-oasis-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png + icon=%iconprefix-oasis-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png + icon=%iconprefix-oasis-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png + icon=%iconprefix-oasis-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png + icon=%iconprefix-oasis-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png + icon=%iconprefix-oasis-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png + icon=%iconprefix-oasis-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png + icon=%iconprefix-oasis-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png + icon=%iconprefix-oasis-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png + icon=%iconprefix-oasis-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png + icon=%iconprefix-oasis-web-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png + icon=%iconprefix-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png + icon=%iconprefix-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png + icon=%iconprefix-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png + icon=%iconprefix-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png + icon=%iconprefix-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png + icon=%iconprefix-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png + icon=%iconprefix-extension.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png +done #run always for theme in gnome hicolor locolor; do @@ -326,9 +373,9 @@ done # glibc breaks rpm unless rpm is build with internal glob-matching (issue 49374) # https://bugzilla.redhat.com/beta/show_bug.cgi?id=134362 %defattr(-, root, root) -%if %unixfilename != libreoffice +%if "%unixfilename" != "libreoffice%productversion" # compat symlinks -%attr(0755, root, root) /opt/%unixfilename +%attr(0755,root,root) /opt/%unixfilename %endif %attr(0755, root, root) /usr/bin/* /usr/share/applications/%unixfilename-base.desktop diff --git a/sysui/desktop/mandriva/mandriva-menus.spec b/sysui/desktop/mandriva/mandriva-menus.spec index a2c52de584ff..47f64ed226cb 100755 --- a/sysui/desktop/mandriva/mandriva-menus.spec +++ b/sysui/desktop/mandriva/mandriva-menus.spec @@ -317,11 +317,11 @@ fi %files -%if %unixfilename != libreoffice +%if "%unixfilename" != "libreoffice%productversion" # compat symlinks %attr(0755,root,root) /opt/%unixfilename -%attr(0755,root,root) /usr/bin/libreoffice -%attr(0755,root,root) /usr/bin/libreoffice-printeradmin +%attr(0755,root,root) /usr/bin/libreoffice%productversion +%attr(0755,root,root) /usr/bin/libreoffice%productversion-printeradmin %endif %attr(0755,root,root) %verify(not size md5) /usr/bin/%unixfilename %attr(0755,root,root) /usr/bin/%unixfilename-printeradmin diff --git a/sysui/desktop/productversion.mk b/sysui/desktop/productversion.mk index 6f41333370dc..8d1f93cd69c8 100755 --- a/sysui/desktop/productversion.mk +++ b/sysui/desktop/productversion.mk @@ -62,14 +62,14 @@ PRODUCTNAME.libreoffice = LibreOffice PRODUCTVERSION.libreoffice = $(PRODUCTVERSION) PRODUCTVERSIONSHORT.libreoffice = $(PRODUCTVERSIONSHORT) PKGVERSION.libreoffice = $(PKGVERSION) -UNIXFILENAME.libreoffice = $(PRODUCTNAME.libreoffice:l) +UNIXFILENAME.libreoffice = $(PRODUCTNAME.libreoffice:l)$(PRODUCTVERSION.libreoffice) ICONPREFIX.libreoffice = $(UNIXFILENAME.libreoffice:s/.//g) PRODUCTNAME.broffice = BrOffice PRODUCTVERSION.broffice = $(PRODUCTVERSION) PRODUCTVERSIONSHORT.broffice = $(PRODUCTVERSIONSHORT) PKGVERSION.broffice = $(PKGVERSION) -UNIXFILENAME.broffice = $(PRODUCTNAME.broffice:l) +UNIXFILENAME.broffice = $(PRODUCTNAME.broffice:l)$(PRODUCTVERSION.broffice) ICONPREFIX.broffice = $(UNIXFILENAME.broffice:s/.//g) diff --git a/sysui/desktop/redhat/redhat-menus.spec b/sysui/desktop/redhat/redhat-menus.spec index 865703b0797a..8ecb446d2774 100755 --- a/sysui/desktop/redhat/redhat-menus.spec +++ b/sysui/desktop/redhat/redhat-menus.spec @@ -28,7 +28,6 @@ mkdir -p $RPM_BUILD_ROOT export DESTDIR=$RPM_BUILD_ROOT export KDEMAINDIR=/usr export GNOMEDIR=/usr -export GNOME_MIME_THEME=hicolor ./create_tree.sh @@ -65,6 +64,55 @@ if [ -x /usr/bin/update-mime-database ]; then update-mime-database /usr/share/mime fi +# add symlinks so that nautilus can identify the mime-icons +# not strictly freedesktop-stuff but there is no common naming scheme yet. +# One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png" +# for e.g. application/vnd.oasis.opendocument.spreadsheet +link_target_root="/opt/gnome/share/icons/hicolor" + +if [ ! -d "${link_target_root}" ] +then + link_target_root="/opt/gnome/share/icons/gnome" +fi + +for subdir in `cd ${link_target_root}; ls -d *` +do + link_dir="/opt/gnome/share/icons/hicolor/$subdir/mimetypes" + link_target_dir="../../../gnome/$subdir/mimetypes" + + test -d ${link_dir}/${link_target_dir} || continue; + + if [ ! -d "${link_dir}" ] + then + mkdir -p "${link_dir}" + fi + + icon=%iconprefix-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png + icon=%iconprefix-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png + icon=%iconprefix-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png + icon=%iconprefix-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png + icon=%iconprefix-oasis-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png + icon=%iconprefix-oasis-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png + icon=%iconprefix-oasis-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png + icon=%iconprefix-oasis-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png + icon=%iconprefix-oasis-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png + icon=%iconprefix-oasis-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png + icon=%iconprefix-oasis-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png + icon=%iconprefix-oasis-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png + icon=%iconprefix-oasis-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png + icon=%iconprefix-oasis-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png + icon=%iconprefix-oasis-web-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png + icon=%iconprefix-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png + icon=%iconprefix-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png + icon=%iconprefix-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png + icon=%iconprefix-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png + icon=%iconprefix-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png + icon=%iconprefix-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png + icon=%iconprefix-extension.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png +done + # run only on first install, since postun is run when updating # post would be run before the old files are removed if [ "$1" = "1" ] ; then # first install @@ -274,13 +322,14 @@ for theme in gnome hicolor locolor; do true fi done +echo unixfilename=%unixfilename %files -%if %unixfilename != libreoffice +%if "%unixfilename" != "libreoffice%productversion" # compat symlinks %attr(0755,root,root) /opt/%unixfilename -%attr(0755,root,root) /usr/bin/libreoffice -%attr(0755,root,root) /usr/bin/libreoffice-printeradmin +%attr(0755,root,root) /usr/bin/libreoffice%productversion +%attr(0755,root,root) /usr/bin/libreoffice%productversion-printeradmin %endif %attr(0755,root,root) %verify(not size md5) /usr/bin/%unixfilename %attr(0755,root,root) /usr/bin/%unixfilename-printeradmin diff --git a/sysui/desktop/share/create_tree.sh b/sysui/desktop/share/create_tree.sh index 2fe78c36a4ec..d0c4e7621d9d 100755 --- a/sysui/desktop/share/create_tree.sh +++ b/sysui/desktop/share/create_tree.sh @@ -39,55 +39,6 @@ then mkdir -p ${DESTDIR}/${GNOMEDIR}/share/application-registry cp openoffice.applications ${DESTDIR}/${GNOMEDIR}/share/application-registry/${PREFIX}.applications chmod 0644 ${DESTDIR}/${GNOMEDIR}/share/application-registry/${PREFIX}.* - - if [ "${GNOME_MIME_THEME}" ] - then - echo "Creating legacy mimetype symlinks for GNOME .." - # add symlinks so that nautilus can identify the mime-icons - # not strictly freedesktop-stuff but there is no common naming scheme yet. - # One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png" - # for e.g. application/vnd.oasis.opendocument.spreadsheet - link_target_root="${DESTDIR}/${GNOMEDIR}/share/icons/${GNOME_MIME_THEME}" - if [ ! -d "${link_target_root}" ] - then - link_target_root="${DESTDIR}/${GNOMEDIR}/share/icons/gnome" - fi - - for subdir in `cd ${link_target_root}; ls -d *` - do - link_target_dir="" - link_dir="${DESTDIR}/${GNOMEDIR}/share/icons/${GNOME_MIME_THEME}/$subdir/mimetypes" - if [ ! -d "${link_dir}" ] - then - mkdir -p "${link_dir}" - link_target_dir="../../../gnome/$subdir/mimetypes/" - fi - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}drawing.png ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}drawing-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}formula.png ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}master-document.png ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-database.png ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-database.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-drawing.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-drawing-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-formula.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-master-document.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-presentation.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-presentation-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-spreadsheet.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-spreadsheet-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-text.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-text-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-web-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}presentation.png ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}presentation-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}spreadsheet.png ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}spreadsheet-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}text.png ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}text-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}extension.png ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png - done - fi fi mkdir -p ${DESTDIR}/usr/bin @@ -101,17 +52,17 @@ ln -sf ${office_root}/program/soffice ${DESTDIR}/usr/bin/${PREFIX} cp printeradmin.sh ${DESTDIR}/usr/bin/${PREFIX}-printeradmin chmod 0755 ${DESTDIR}/usr/bin/${PREFIX} ${DESTDIR}/usr/bin/${PREFIX}-printeradmin -if test "${PREFIX}" != libreoffice ; then +if test "${PREFIX}" != libreoffice${PRODUCTVERSION} ; then # compat symlinks mkdir -p ${DESTDIR}${office_prefix} - ln -sf libreoffice ${DESTDIR}${office_root} - ln -sf /usr/bin/${PREFIX} ${DESTDIR}/usr/bin/libreoffice - ln -sf /usr/bin/${PREFIX}-printeradmin ${DESTDIR}/usr/bin/libreoffice-printeradmin + ln -sf libreoffice${PRODUCTVERSION} ${DESTDIR}${office_root} + ln -sf /usr/bin/${PREFIX} ${DESTDIR}/usr/bin/libreoffice${PRODUCTVERSION} + ln -sf /usr/bin/${PREFIX}-printeradmin ${DESTDIR}/usr/bin/libreoffice${PRODUCTVERSION}-printeradmin fi mkdir -p ${DESTDIR}/usr/share/mime/packages -cp openoffice.org.xml ${DESTDIR}/usr/share/mime/packages/libreoffice.xml -chmod 0644 ${DESTDIR}/usr/share/mime/packages/libreoffice.xml +cp openoffice.org.xml ${DESTDIR}/usr/share/mime/packages/libreoffice${PRODUCTVERSION}.xml +chmod 0644 ${DESTDIR}/usr/share/mime/packages/libreoffice${PRODUCTVERSION}.xml mkdir -p ${DESTDIR}/usr/share/applications for i in `cat launcherlist`; do diff --git a/sysui/desktop/share/makefile.mk b/sysui/desktop/share/makefile.mk index 45a1b11c85f3..bc1ef5082c89 100755 --- a/sysui/desktop/share/makefile.mk +++ b/sysui/desktop/share/makefile.mk @@ -224,6 +224,7 @@ $(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh : $$(@:f) @echo "PREFIX=$(UNIXFILENAME.$(@:d:d:f))" >> $@.$(INPATH) @echo "ICON_PREFIX=$(ICONPREFIX.$(@:d:d:f))" >> $@.$(INPATH) @echo "ICON_SOURCE_DIR=../../../desktop/icons" >> $@.$(INPATH) + @echo "PRODUCTVERSION=$(PRODUCTVERSION.$(@:d:d:f))" >> $@.$(INPATH) @cat $< >> $@.$(INPATH) @chmod 774 $@.$(INPATH) @mv -f $@.$(INPATH) $@ diff --git a/sysui/desktop/suse/suse-menus.spec b/sysui/desktop/suse/suse-menus.spec index 74eb0a5fcc9c..9ea2d332cb07 100755 --- a/sysui/desktop/suse/suse-menus.spec +++ b/sysui/desktop/suse/suse-menus.spec @@ -33,7 +33,6 @@ mkdir -p $RPM_BUILD_ROOT export DESTDIR=$RPM_BUILD_ROOT export KDEMAINDIR=/opt/kde3 export GNOMEDIR=/opt/gnome -export GNOME_MIME_THEME=hicolor ./create_tree.sh @@ -74,6 +73,55 @@ if [ -x /opt/gnome/bin/update-desktop-database ]; then /opt/gnome/bin/update-desktop-database fi +# add symlinks so that nautilus can identify the mime-icons +# not strictly freedesktop-stuff but there is no common naming scheme yet. +# One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png" +# for e.g. application/vnd.oasis.opendocument.spreadsheet +link_target_root="/opt/gnome/share/icons/hicolor" + +if [ ! -d "${link_target_root}" ] +then + link_target_root="/opt/gnome/share/icons/gnome" +fi + +for subdir in `cd ${link_target_root}; ls -d *` +do + link_dir="/opt/gnome/share/icons/hicolor/$subdir/mimetypes" + link_target_dir="../../../gnome/$subdir/mimetypes" + + test -d ${link_dir}/${link_target_dir} || continue; + + if [ ! -d "${link_dir}" ] + then + mkdir -p "${link_dir}" + fi + + icon=%iconprefix-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png + icon=%iconprefix-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png + icon=%iconprefix-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png + icon=%iconprefix-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png + icon=%iconprefix-oasis-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png + icon=%iconprefix-oasis-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png + icon=%iconprefix-oasis-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png + icon=%iconprefix-oasis-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png + icon=%iconprefix-oasis-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png + icon=%iconprefix-oasis-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png + icon=%iconprefix-oasis-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png + icon=%iconprefix-oasis-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png + icon=%iconprefix-oasis-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png + icon=%iconprefix-oasis-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png + icon=%iconprefix-oasis-web-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png + icon=%iconprefix-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png + icon=%iconprefix-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png + icon=%iconprefix-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png + icon=%iconprefix-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png + icon=%iconprefix-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png + icon=%iconprefix-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png + icon=%iconprefix-extension.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png +done + # run only on first install, since postun is run when updating # post would be run before the old files are removed if [ "$1" = "1" ] ; then # first install @@ -288,11 +336,11 @@ for themedir in /opt/gnome/share/icons/gnome /opt/gnome/share/icons/hicolor /opt done %files -%if %unixfilename != libreoffice +%if "%unixfilename" != "libreoffice%productversion" # compat symlinks %attr(0755,root,root) /opt/%unixfilename -%attr(0755,root,root) /usr/bin/libreoffice -%attr(0755,root,root) /usr/bin/libreoffice-printeradmin +%attr(0755,root,root) /usr/bin/libreoffice%productversion +%attr(0755,root,root) /usr/bin/libreoffice%productversion-printeradmin %endif %attr(0755,root,root) %verify(not size md5) /usr/bin/%unixfilename %attr(0755,root,root) /usr/bin/%unixfilename-printeradmin @@ -312,7 +360,6 @@ done /opt/kde3/share/mimelnk/application/*.desktop /opt/gnome/share/icons/gnome/*/apps/*png /opt/gnome/share/icons/gnome/*/mimetypes/*png -/opt/gnome/share/icons/hicolor/*/mimetypes/*png /opt/kde3/share/icons/hicolor/*/apps/*png /opt/kde3/share/icons/hicolor/*/mimetypes/*png /opt/kde3/share/icons/locolor/*/apps/*png diff --git a/sysui/desktop/tg_rpm.mk b/sysui/desktop/tg_rpm.mk index 6fab6e748a99..0ff9af4dca3d 100755 --- a/sysui/desktop/tg_rpm.mk +++ b/sysui/desktop/tg_rpm.mk @@ -38,6 +38,7 @@ $(RPMFLAGFILES) : $(SPECFILE) --define "productname $(PRODUCTNAME.$(@:b:s/-/ /:1))" \ --define "pkgprefix $(@:b:s/-/ /:1)$(PRODUCTVERSION.$(@:b:s/-/ /:1))" \ --define "unixfilename $(UNIXFILENAME.$(@:b:s/-/ /:1))" \ + --define "productversion $(PRODUCTVERSION.$(@:b:s/-/ /:1))" \ --define "iconprefix $(ICONPREFIX.$(@:b:s/-/ /:1))" \ --define "version $(PKGVERSION.$(@:b:s/-/ /:1))" \ --define "release $(PKGREV)" \ diff --git a/testautomation/global/win/bars.win b/testautomation/global/win/bars.win index 9bd0d252cd55..850baef4f598 100644 --- a/testautomation/global/win/bars.win +++ b/testautomation/global/win/bars.win @@ -1231,7 +1231,7 @@ DruckLayout .uno:PrintLayout Effekt .uno:EffectWindow Edit .uno:EditDoc Einfuegen .uno:InsertCtrl -Ellipsen .uno:Ellipse +Ellipsen .uno:BasicShapes.ellipse ExecuteBtn .uno:SbaExecuteSql Feldbefehle .uno:InsertFieldCtrl Filter .uno:DataFilterStandardFilter @@ -1271,7 +1271,7 @@ OnlineLayout .uno:BrowseView Paste .uno:Paste Praesentation .uno:Presentation PrintDefault .uno:PrintDefault -Rechteck .uno:Rect +Rechteck .uno:BasicShapes.rectangle Rechtschreibung .uno:Spelling RecSearch .uno:RecSearch RecSave .uno:RecSave diff --git a/unotools/inc/unotools/bootstrap.hxx b/unotools/inc/unotools/bootstrap.hxx index d17e2940890d..523247b97141 100644 --- a/unotools/inc/unotools/bootstrap.hxx +++ b/unotools/inc/unotools/bootstrap.hxx @@ -55,6 +55,9 @@ namespace utl /// retrieve the product key; uses the given default, if not found static rtl::OUString getProductKey(rtl::OUString const& _sDefault); + /// retrieve the product version + static rtl::OUString getProductVersion(); + /// retrieve the product source (MWS name) static ::rtl::OUString getProductSource(rtl::OUString const& _sDefault); diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx index b19ee6a3683f..adc4b8cbf3a4 100644 --- a/unotools/source/config/bootstrap.cxx +++ b/unotools/source/config/bootstrap.cxx @@ -52,6 +52,7 @@ #define BOOTSTRAP_DATA_NAME SAL_CONFIGFILE("bootstrap") #define BOOTSTRAP_ITEM_PRODUCT_KEY "ProductKey" +#define BOOTSTRAP_ITEM_PRODUCT_VERSION "OOOBaseVersion" #define BOOTSTRAP_ITEM_PRODUCT_SOURCE "ProductSource" #define BOOTSTRAP_ITEM_VERSIONFILE "Location" #define BOOTSTRAP_ITEM_BUILDID "buildid" @@ -652,6 +653,14 @@ OUString Bootstrap::getProductKey(OUString const& _sDefault) } // --------------------------------------------------------------------------------------- +OUString Bootstrap::getProductVersion() +{ + // read OOOBaseVersion from version.ini (versionrc) + OUString sVersion; + data().getVersionValue( OUString( RTL_CONSTASCII_USTRINGPARAM( BOOTSTRAP_ITEM_PRODUCT_VERSION ) ), sVersion, OUString() ); + return sVersion; +} + OUString Bootstrap::getProductSource(OUString const& _sDefault) { OUString const csProductSourceItem(RTL_CONSTASCII_USTRINGPARAM(BOOTSTRAP_ITEM_PRODUCT_SOURCE)); @@ -675,6 +684,7 @@ OUString Bootstrap::getBuildIdData(OUString const& _sDefault) sBuildId = data().getBootstrapValue( csBuildIdItem, _sDefault ); return sBuildId; } + // --------------------------------------------------------------------------------------- OUString Bootstrap::getAllUsersValue(OUString const& _sDefault) diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx index 97c1776bf95b..69b945b1c754 100644 --- a/unotools/source/config/configmgr.cxx +++ b/unotools/source/config/configmgr.cxx @@ -38,7 +38,6 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <osl/diagnose.h> -#include <i18npool/mslangid.hxx> #include <rtl/bootstrap.hxx> #include <rtl/instance.hxx> #if OSL_DEBUG_LEVEL > 0 @@ -377,18 +376,10 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) Any aRet; - ::rtl::OUString sBrandName; -#ifdef ENABLE_BROFFICE - LanguageType nType = MsLangId::getRealLanguage( LANGUAGE_NONE ); - if ( nType == LANGUAGE_PORTUGUESE_BRAZILIAN ) - sBrandName = OUString(RTL_CONSTASCII_USTRINGPARAM("BrOffice")); - else -#endif - sBrandName = BrandName::get(); - - if ( eProp == PRODUCTNAME && sBrandName.getLength() ) + ::rtl::OUString &rBrandName = BrandName::get(); + if ( eProp == PRODUCTNAME && rBrandName.getLength() ) { - aRet <<= sBrandName; + aRet <<= rBrandName; return aRet; } @@ -536,7 +527,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) } if ( eProp == PRODUCTNAME ) - aRet >>= sBrandName; + aRet >>= rBrandName; if ( eProp == PRODUCTXMLFILEFORMATNAME ) aRet >>= rXMLFileFormatName; diff --git a/unotools/source/config/makefile.mk b/unotools/source/config/makefile.mk index 9a8e8d2d3d92..d639657eb7c6 100644 --- a/unotools/source/config/makefile.mk +++ b/unotools/source/config/makefile.mk @@ -37,10 +37,6 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/makefile.pmk -.IF "$(ENABLE_BROFFICE)"=="TRUE" -CDEFS+=-DENABLE_BROFFICE -.ENDIF - # --- Files ------------------------------------- SLOFILES=\ diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx index 2b6f4f2cdc1b..9c071cea2dd1 100644 --- a/unotools/source/config/syslocaleoptions.cxx +++ b/unotools/source/config/syslocaleoptions.cxx @@ -273,19 +273,16 @@ void SvtSysLocaleOptions_Impl::MakeRealLocale() void SvtSysLocaleOptions_Impl::MakeRealUILocale() { - if ( !m_aRealUILocale.Language.getLength() ) + // as we can't switch UILocale at runtime, we only store changes in the configuration + m_aRealUILocale = lcl_str_to_locale( m_aUILocaleString ); + if ( m_aRealUILocale.Language.getLength() ) { - // as we can't switch UILocale at runtime, we only store changes in the configuration - m_aRealUILocale = lcl_str_to_locale( m_aUILocaleString ); - if ( m_aRealUILocale.Language.getLength() ) - { - m_eRealUILanguage = MsLangId::convertLocaleToLanguage( m_aRealUILocale ); - } - else - { - m_eRealUILanguage = MsLangId::getSystemUILanguage(); - MsLangId::convertLanguageToLocale( m_eRealUILanguage, m_aRealUILocale ); - } + m_eRealUILanguage = MsLangId::convertLocaleToLanguage( m_aRealUILocale ); + } + else + { + m_eRealUILanguage = MsLangId::getSystemUILanguage(); + MsLangId::convertLanguageToLocale( m_eRealUILanguage, m_aRealUILocale ); } } @@ -399,13 +396,12 @@ void SvtSysLocaleOptions_Impl::SetUILocaleString( const OUString& rStr ) if (!m_bROUILocale && rStr != m_aUILocaleString ) { m_aUILocaleString = rStr; -/* + // as we can't switch UILocale at runtime, we only store changes in the configuration MakeRealUILocale(); MsLangId::setConfiguredSystemLanguage( m_eRealUILanguage ); SetModified(); NotifyListeners( SYSLOCALEOPTIONS_HINT_UILOCALE ); -*/ } } diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 50d288b71686..837fa60d1e1e 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -118,7 +118,9 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry ) do { nIndex++; - ImplAccelEntry* pTempEntry = (*pList)[ nIndex ]; + ImplAccelEntry* pTempEntry = NULL; + if ( nIndex < pList->size() ) + pTempEntry = (*pList)[ nIndex ]; if ( !pTempEntry || (pTempEntry->mnId != pEntry->mnId) ) break; } diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx index 30d4598568d2..f51e4133fa13 100644 --- a/vcl/unx/source/printer/ppdparser.cxx +++ b/vcl/unx/source/printer/ppdparser.cxx @@ -510,7 +510,7 @@ void PPDParser::initPPDFiles() INetURLObject aDir( aExe ); aDir.removeSegment(); #ifdef DEBUG - fprintf( stderr, "scanning last chance dir: %s\n", OUStringToOString( aDir.GetMainURL( INetURLObject::NO_DECODE ), osl_getThreadTextEncoding() ).getStr() ); + fprintf( stderr, "scanning last chance dir: %s\n", rtl::OUStringToOString( aDir.GetMainURL( INetURLObject::NO_DECODE ), osl_getThreadTextEncoding() ).getStr() ); #endif scanPPDDir( aDir.GetMainURL( INetURLObject::NO_DECODE ) ); #ifdef DEBUG @@ -655,7 +655,7 @@ const PPDParser* PPDParser::getParser( const String& rFile ) if( ! aFile.Len() ) { #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "Could not get printer PPD file \"%s\" !\n", OUStringToOString( rFile, osl_getThreadTextEncoding() ).getStr() ); + fprintf( stderr, "Could not get printer PPD file \"%s\" !\n", rtl::OUStringToOString( rFile, osl_getThreadTextEncoding() ).getStr() ); #endif return NULL; } diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx index e4634ab0c8b5..5334ac2cfcae 100644 --- a/vcl/unx/source/printer/printerinfomanager.cxx +++ b/vcl/unx/source/printer/printerinfomanager.cxx @@ -268,7 +268,7 @@ void PrinterInfoManager::initialize() if( aConfig.HasGroup( GLOBAL_DEFAULTS_GROUP ) ) { #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "found global defaults in %s\n", OUStringToOString( aFile.PathToFileName(), RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); + fprintf( stderr, "found global defaults in %s\n", rtl::OUStringToOString( aFile.PathToFileName(), RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); #endif aConfig.SetGroup( GLOBAL_DEFAULTS_GROUP ); @@ -817,8 +817,8 @@ bool PrinterInfoManager::writePrinterConfig() subst != it->second.m_aInfo.m_aFontSubstitutes.end(); ++subst ) { ByteString aKey( "SubstFont_" ); - aKey.Append( OUStringToOString( subst->first, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); - pConfig->WriteKey( aKey, OUStringToOString( subst->second, RTL_TEXTENCODING_ISO_8859_1 ) ); + aKey.Append( rtl::OUStringToOString( subst->first, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); + pConfig->WriteKey( aKey, rtl::OUStringToOString( subst->second, RTL_TEXTENCODING_ISO_8859_1 ) ); } } } @@ -873,7 +873,7 @@ bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUStrin bSuccess = true; #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "new printer %s, level = %d, pdfdevice = %d, colordevice = %d, depth = %d\n", - OUStringToOString( rPrinterName, osl_getThreadTextEncoding() ).getStr(), + rtl::OUStringToOString( rPrinterName, osl_getThreadTextEncoding() ).getStr(), m_aPrinters[rPrinterName].m_aInfo.m_nPSLevel, m_aPrinters[rPrinterName].m_aInfo.m_nPDFDevice, m_aPrinters[rPrinterName].m_aInfo.m_nColorDevice, @@ -1046,12 +1046,12 @@ void PrinterInfoManager::fillFontSubstitutions( PrinterInfo& rInfo ) const fprintf( stderr, "substitute %s %s %d %d\n" " -> %s %s %d %d\n", - OUStringToOString( it->m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr(), + rtl::OUStringToOString( it->m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr(), it->m_eItalic == italic::Upright ? "r" : it->m_eItalic == italic::Oblique ? "o" : it->m_eItalic == italic::Italic ? "i" : "u", it->m_eWeight, it->m_eWidth, - OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr(), + rtl::OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr(), aInfo.m_eItalic == italic::Upright ? "r" : aInfo.m_eItalic == italic::Oblique ? "o" : aInfo.m_eItalic == italic::Italic ? "i" : "u", aInfo.m_eWeight, aInfo.m_eWidth @@ -1117,7 +1117,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC const PrinterInfo& rPrinterInfo = getPrinterInfo (rPrintername); const rtl::OUString& rCommand = (bQuickCommand && rPrinterInfo.m_aQuickCommand.getLength() ) ? rPrinterInfo.m_aQuickCommand : rPrinterInfo.m_aCommand; - rtl::OString aShellCommand = OUStringToOString (rCommand, RTL_TEXTENCODING_ISO_8859_1); + rtl::OString aShellCommand = rtl::OUStringToOString (rCommand, RTL_TEXTENCODING_ISO_8859_1); aShellCommand += rtl::OString( " 2>/dev/null" ); return popen (aShellCommand.getStr(), "w"); @@ -1157,7 +1157,7 @@ void PrinterInfoManager::setDefaultPaper( PPDContext& rContext ) const { #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "not setting default paper, already set %s\n", - OUStringToOString( rContext.getValue( pPageSizeKey )->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); + rtl::OUStringToOString( rContext.getValue( pPageSizeKey )->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); #endif return; } @@ -1174,12 +1174,12 @@ void PrinterInfoManager::setDefaultPaper( PPDContext& rContext ) const if( pPaperVal ) { #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "setting default paper %s\n", OUStringToOString( pPaperVal->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); + fprintf( stderr, "setting default paper %s\n", rtl::OUStringToOString( pPaperVal->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); #endif rContext.setValue( pPageSizeKey, pPaperVal ); #if OSL_DEBUG_LEVEL > 1 pPaperVal = rContext.getValue( pPageSizeKey ); - fprintf( stderr, "-> got paper %s\n", OUStringToOString( pPaperVal->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); + fprintf( stderr, "-> got paper %s\n", rtl::OUStringToOString( pPaperVal->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); #endif } } diff --git a/writerfilter/inc/resourcemodel/TableManager.hxx b/writerfilter/inc/resourcemodel/TableManager.hxx index 5d5d819b8581..ad43cd998de5 100644 --- a/writerfilter/inc/resourcemodel/TableManager.hxx +++ b/writerfilter/inc/resourcemodel/TableManager.hxx @@ -221,7 +221,7 @@ class TableManager void resetRowProps() { - mpCellProps.reset(); + mpRowProps.reset(); } void setRowProps(PropertiesPointer pProps) diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 7f89f12c4c99..f0ca219e1155 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -697,6 +697,8 @@ bool URLParameter::query() m_nHitCount = value.toInt32(); else if( parameter.compareToAscii( "Active" ) == 0 ) m_aActive = value; + else if( parameter.compareToAscii( "Version" ) == 0 ) + ; // ignored (but accepted) in the build-in help, useful only for the online help else ret = false; } |