You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2013/03/16 00:19:21 UTC
svn commit: r1457158 [2/5] - in /openoffice/trunk/main: ./
default_images/minimizer/ default_images/res/commandimagelist/
helpcontent2/prj/ helpcontent2/source/text/simpress/
helpcontent2/source/text/simpress/minimizer/ helpcontent2/util/simpress/
offi...
Modified: openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Impress.xcs?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Impress.xcs (original)
+++ openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Impress.xcs Fri Mar 15 23:19:19 2013
@@ -86,6 +86,113 @@
</info>
</prop>
</group>
+ <group oor:name="PresentationMinimizerSettings">
+ <info>
+ <desc>Describes the Presentation Optimization Wizard settings of one session</desc>
+ </info>
+ <prop oor:name="Name" oor:type="xs:string" oor:localized="true">
+ <info>
+ <desc>Specifies the name settings name</desc>
+ </info>
+ <value>Default</value>
+ </prop>
+ <prop oor:name="JPEGCompression" oor:type="xs:boolean">
+ <info>
+ <desc>Specifies if JPEG compression is being used</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="JPEGQuality" oor:type="xs:int">
+ <info>
+ <desc>Specifies quality of the JPG export. A higher value results in higher quality and file size.</desc>
+ </info>
+ <constraints>
+ <minInclusive oor:value="1">
+ <info>
+ <desc>Represents lowest value that can be used. The lower the value, the less good is the compression quality and the bigger is be the file size.</desc>
+ </info>
+ </minInclusive>
+ <maxInclusive oor:value="100">
+ <info>
+ <desc>Represents highest value that can be used. The higher the value, the better is the compression quality and the smaller is the file size.</desc>
+ </info>
+ </maxInclusive>
+ </constraints>
+ <value>45</value>
+ </prop>
+ <prop oor:name="RemoveCropArea" oor:type="xs:boolean">
+ <info>
+ <desc>Specifies if the crop area of a picture has to be removed</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="ImageResolution" oor:type="xs:int">
+ <info>
+ <desc>Specifies the Image Resolution that should be used in dpi. A value of zero determines that the image resolution should not be changed.</desc>
+ </info>
+ <value>150</value>
+ </prop>
+ <prop oor:name="EmbedLinkedGraphics" oor:type="xs:boolean">
+ <info>
+ <desc>Specifies if linked graphics are to be embedded</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="OLEOptimization" oor:type="xs:boolean">
+ <info>
+ <desc>Specifies if OLE Objects are converted to Graphic objects at all</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="OLEOptimizationType" oor:type="xs:short">
+ <info>
+ <desc>Specifies the compression type that is being used,.</desc>
+ </info>
+ <constraints>
+ <enumeration oor:value="0">
+ <info>
+ <desc>Each</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="1">
+ <info>
+ <desc>Alien</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ <value>0</value>
+ </prop>
+ <prop oor:name="DeleteUnusedMasterPages" oor:type="xs:boolean">
+ <info>
+ <desc>Specifies if unused Master Pages are being deleted</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="DeleteHiddenSlides" oor:type="xs:boolean">
+ <info>
+ <desc>Specifies if hidden Slides are being deleted</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="DeleteNotesPages" oor:type="xs:boolean">
+ <info>
+ <desc>Specifies if Notes Pages are being deleted</desc>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="SaveAs" oor:type="xs:boolean">
+ <info>
+ <desc>Specifies if the optimization is done on a new document.</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="OpenNewDocument" oor:type="xs:boolean">
+ <info>
+ <desc>Specifies if the newly created document is opened automatically.</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
</templates>
<component>
<group oor:name="Layout">
@@ -1535,5 +1642,25 @@
</group>
</group>
</group>
+ <group oor:name="PresentationMinimizer">
+ <info>
+ <desc>Contains configuration for the Presentation Minimizer.</desc>
+ </info>
+ <node-ref oor:name="LastUsedSettings" oor:node-type="PresentationMinimizerSettings">
+ <info>
+ <desc>describes the name of the last used settings</desc>
+ </info>
+ </node-ref>
+ <group oor:name="Settings">
+ <info>
+ <desc>The PresentationMinimizer settings</desc>
+ </info>
+ <set oor:name="Templates" oor:node-type="PresentationMinimizerSettings">
+ <info>
+ <desc>List of the saved Presentation Minimizer Wizard settings</desc>
+ </info>
+ </set>
+ </group>
+ </group>
</component>
</oor:component-schema>
Modified: openoffice/trunk/main/postprocess/packcomponents/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/postprocess/packcomponents/makefile.mk?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/postprocess/packcomponents/makefile.mk (original)
+++ openoffice/trunk/main/postprocess/packcomponents/makefile.mk Fri Mar 15 23:19:19 2013
@@ -174,7 +174,8 @@ my_components = \
xmlfd \
xmx \
xsltdlg \
- xstor
+ xstor \
+ PresentationMinimizer
.IF "$(OS)" == "MACOSX"
my_components += component/vcl/vcl.macosx
Modified: openoffice/trunk/main/postprocess/prj/build.lst
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/postprocess/prj/build.lst?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/postprocess/prj/build.lst (original)
+++ openoffice/trunk/main/postprocess/prj/build.lst Fri Mar 15 23:19:19 2013
@@ -1,4 +1,4 @@
-po postprocess :: svgio accessibility automation basctl bean BINFILTER:binfilter chart2 configmgr CRASHREP:crashrep COINMP:coinmp cui dbaccess desktop dtrans embeddedobj embedserv EPM:epm eventattacher extensions extras fileaccess filter forms fpicker helpcontent2 hwpfilter io JAVAINSTALLER2:javainstaller2 lingucomponent MATHMLDTD:MathMLDTD ODK:odk officecfg package padmin psprint_config remotebridges sc scaddins sccomp scp2 scripting sd setup_native slideshow starmath sw sysui testtools ucb UnoControls unoxml ure wizards xmerge xmlsecurity MORE_FONTS:more_fonts OOo:pyuno OOo:readlicense_oo SO:top unodevtools JFREEREPORT:jfreereport REPORTBUILDER:reportbuilder reportdesign SDEXT:sdext SWEXT:swext smoketestdoc uui writerfilter oox MYSQLC:mysqlc LIBXSLT:libxslt NULL
+po postprocess :: svgio accessibility automation basctl bean BINFILTER:binfilter chart2 configmgr CRASHREP:crashrep COINMP:coinmp cui dbaccess desktop dtrans embeddedobj embedserv EPM:epm eventattacher extensions extras fileaccess filter forms fpicker helpcontent2 hwpfilter io JAVAINSTALLER2:javainstaller2 lingucomponent MATHMLDTD:MathMLDTD ODK:odk officecfg package padmin psprint_config remotebridges sc scaddins sccomp scp2 scripting sd setup_native slideshow starmath sw sysui testtools ucb UnoControls unoxml ure wizards xmerge xmlsecurity MORE_FONTS:more_fonts OOo:pyuno OOo:readlicense_oo SO:top unodevtools JFREEREPORT:jfreereport REPORTBUILDER:reportbuilder reportdesign sdext SWEXT:swext smoketestdoc uui writerfilter oox MYSQLC:mysqlc LIBXSLT:libxslt NULL
po postprocess usr1 - all po_mkout NULL
po postprocess\checkxml nmake - all po_checkxml NULL
po postprocess\checkdeliver nmake - all po_checkdlv NULL
Modified: openoffice/trunk/main/scp2/source/ooo/file_library_ooo.scp
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/scp2/source/ooo/file_library_ooo.scp?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/scp2/source/ooo/file_library_ooo.scp (original)
+++ openoffice/trunk/main/scp2/source/ooo/file_library_ooo.scp Fri Mar 15 23:19:19 2013
@@ -1337,6 +1337,19 @@ File gid_File_Lib_Slideshow
#endif
End
+File gid_File_Lib_PresentationMinimizer
+ TXT_FILE_BODY;
+ Styles = (PACKED);
+ Dir = SCP2_OOO_BIN_DIR;
+ #ifdef UNX
+ Name = STRING(CONCAT2(PresentationMinimizer.uno,UNXSUFFIX));
+ #elif defined OS2
+ Name = "PresentationMinimizer.dll";
+ #else
+ Name = "PresentationMinimizer.uno.dll";
+ #endif
+End
+
File gid_File_Lib_Sdbc_2
TXT_FILE_BODY;
Styles = (PACKED);
Modified: openoffice/trunk/main/scp2/source/ooo/file_resource_ooo.scp
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/scp2/source/ooo/file_resource_ooo.scp?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/scp2/source/ooo/file_resource_ooo.scp (original)
+++ openoffice/trunk/main/scp2/source/ooo/file_resource_ooo.scp Fri Mar 15 23:19:19 2013
@@ -126,3 +126,5 @@ STD_RES_FILE( gid_File_Res_T602Filter, t
STD_RES_FILE( gid_File_Res_Forui, forui )
STD_RES_FILE( gid_File_Res_For, for )
+STD_RES_FILE( gid_File_Res_PresentationMinimizer, minimizer )
+
Modified: openoffice/trunk/main/scp2/source/ooo/module_hidden_ooo.scp
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/scp2/source/ooo/module_hidden_ooo.scp?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/scp2/source/ooo/module_hidden_ooo.scp (original)
+++ openoffice/trunk/main/scp2/source/ooo/module_hidden_ooo.scp Fri Mar 15 23:19:19 2013
@@ -338,6 +338,7 @@ Module gid_Module_Root_Files_5
gid_File_Lib_Sax_Uno,
gid_File_Lib_Fastsax_Uno,
gid_File_Lib_Slideshow,
+ gid_File_Lib_PresentationMinimizer
gid_File_Lib_Recentfile,
gid_File_Lib_Scriptframe,
gid_File_Lib_Sdbc_2,
Modified: openoffice/trunk/main/scp2/source/ooo/module_lang_template.scp
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/scp2/source/ooo/module_lang_template.scp?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/scp2/source/ooo/module_lang_template.scp (original)
+++ openoffice/trunk/main/scp2/source/ooo/module_lang_template.scp Fri Mar 15 23:19:19 2013
@@ -102,7 +102,8 @@ Module gid_Module_Langpack_Resource_Temp
gid_File_Res_Tfu,
gid_File_Res_Eps,
gid_File_Res_UpdChk,
- gid_File_Res_Upd);
+ gid_File_Res_Upd,
+ gid_File_Res_PresentationMinimizer);
End
Module gid_Module_Langpack_Help_Template
Modified: openoffice/trunk/main/sd/inc/app.hrc
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sd/inc/app.hrc?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sd/inc/app.hrc (original)
+++ openoffice/trunk/main/sd/inc/app.hrc Fri Mar 15 23:19:19 2013
@@ -503,5 +503,6 @@
#define SID_ADD_MOTION_PATH (SID_SD_START+441)
#define SID_TABLE_TOOLBOX (SID_SD_START+442)
+#define SID_PRESENTATION_MINIMIZER (SID_SD_START+442)
#endif
Modified: openoffice/trunk/main/sd/sdi/drviewsh.sdi
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sd/sdi/drviewsh.sdi?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sd/sdi/drviewsh.sdi (original)
+++ openoffice/trunk/main/sd/sdi/drviewsh.sdi Fri Mar 15 23:19:19 2013
@@ -75,6 +75,11 @@ interface ImpressEditView : DrawView
ExecMethod = FuSupport ;
StateMethod = GetMenuState ;
]
+ SID_PRESENTATION_MINIMIZER
+ [
+ ExecMethod = FuSupport ;
+ StateMethod = GetMenuState ;
+ ]
SID_CLEAR_UNDO_STACK // ole : no, status : ?
[
ExecMethod = FuSupport ;
Modified: openoffice/trunk/main/sd/sdi/sdraw.sdi
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sd/sdi/sdraw.sdi?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sd/sdi/sdraw.sdi (original)
+++ openoffice/trunk/main/sd/sdi/sdraw.sdi Fri Mar 15 23:19:19 2013
@@ -5385,6 +5385,31 @@ SfxVoidItem PresentationDialog SID_PRESE
]
//--------------------------------------------------------------------------
+SfxVoidItem PresentationMinimizer SID_PRESENTATION_MINIMIZER
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
SfxVoidItem PresentationEnd SID_PRESENTATION_END
()
[
Modified: openoffice/trunk/main/sd/source/ui/view/drviewse.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sd/source/ui/view/drviewse.cxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sd/source/ui/view/drviewse.cxx (original)
+++ openoffice/trunk/main/sd/source/ui/view/drviewse.cxx Fri Mar 15 23:19:19 2013
@@ -29,6 +29,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <comphelper/processfactory.hxx>
@@ -102,6 +103,7 @@
#include "fuformatpaintbrush.hxx"
using ::rtl::OUString;
+using com::sun::star::ui::dialogs::XExecutableDialog;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::presentation;
@@ -1472,6 +1474,34 @@ void DrawViewShell::FuSupport(SfxRequest
}
break;
+ case SID_PRESENTATION_MINIMIZER:
+ {
+ if ( GetDoc()->GetDocumentType() == DOCUMENT_TYPE_IMPRESS &&
+ GetViewShellBase().GetController() != NULL )
+ {
+ try
+ {
+ uno::Reference< uno::XComponentContext > xContext(
+ ::comphelper::getProcessComponentContext() );
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[0] <<= GetViewShellBase().GetController();
+
+ uno::Reference< XExecutableDialog > xDialog(
+ xContext->getServiceManager()->
+ createInstanceWithArgumentsAndContext(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ui.dialogs.PresentationMinimizerDialog")),
+ aArgs, xContext), uno::UNO_QUERY_THROW );
+ xDialog->execute();
+ }
+ catch (...)
+ {}
+ }
+
+ rReq.Done();
+ }
+ break;
+
default:
break;
}
Modified: openoffice/trunk/main/sd/uiconfig/simpress/menubar/menubar.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sd/uiconfig/simpress/menubar/menubar.xml?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sd/uiconfig/simpress/menubar/menubar.xml (original)
+++ openoffice/trunk/main/sd/uiconfig/simpress/menubar/menubar.xml Fri Mar 15 23:19:19 2013
@@ -270,6 +270,7 @@
<menu:menuitem menu:id=".uno:Gallery"/>
<menu:menuitem menu:id=".uno:BmpMask"/>
<menu:menuitem menu:id=".uno:AVMediaPlayer"/>
+ <menu:menuitem menu:id=".uno:PresentationMinimizer"/>
<menu:menuseparator/>
<menu:menu menu:id=".uno:MacrosMenu">
<menu:menupopup>
Modified: openoffice/trunk/main/sdext/prj/build.lst
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/prj/build.lst?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/prj/build.lst (original)
+++ openoffice/trunk/main/sdext/prj/build.lst Fri Mar 15 23:19:19 2013
@@ -1,9 +1,7 @@
dx sdext : L10N:l10n offuh comphelper unotools readlicense_oo cppu tools cppuhelper sal javaunohelper officecfg LIBXSLT:libxslt xmlhelp NULL
dx sdext usr1 - all sdext_mkout NULL
dx sdext\prj get - all sdext_prj NULL
-dx sdext\source\minimizer nmake - all sdext_minimizer sdext_minimizer_rdoooe sdext_minimizer_rdooo sdext_inc NULL
-dx sdext\source\minimizer\registry\data\org\openoffice\Office\extension nmake - all sdext_minimizer_rdoooe NULL
-dx sdext\source\minimizer\registry\data\org\openoffice\Office nmake - all sdext_minimizer_rdooo NULL
+dx sdext\source\minimizer nmake - all sdext_minimizer sdext_inc NULL
dx sdext\source\presenter\registry\data\org\openoffice\Office\extension nmake - all sdext_presenter_xcu NULL
dx sdext\source\presenter\help\en-US\com.sun.PresenterScreen nmake - all sdext_presenter_help NULL
dx sdext\source\presenter nmake - all sdext_presenter sdext_inc sdext_presenter_xcu sdext_presenter_help NULL
Modified: openoffice/trunk/main/sdext/prj/d.lst
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/prj/d.lst?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/prj/d.lst (original)
+++ openoffice/trunk/main/sdext/prj/d.lst Fri Mar 15 23:19:19 2013
@@ -1,10 +1,30 @@
-mkdir: %_DEST%\bin%_EXT%\minimizer
mkdir: %_DEST%\bin%_EXT%\presenter
mkdir: %_DEST%\bin%_EXT%\pdfimport
..\%__SRC%\bin\pdf2xml.* %_DEST%\bin%_EXT%\pdf2xml.*
..\%__SRC%\bin\pdfunzip.* %_DEST%\bin%_EXT%\pdfunzip.*
..\%__SRC%\bin\pdfimport.oxt %_DEST%\bin%_EXT%\pdfimport\pdfimport.oxt
-..\%__SRC%\bin\presentation-minimizer.oxt %_DEST%\bin%_EXT%\minimizer\presentation-minimizer.oxt
-..\%__SRC%\bin\presentation_minimizer_develop.zip %_DEST%\bin%_EXT%\minimizer\presentation_minimizer_develop.zip
..\%__SRC%\bin\presenter-screen.oxt %_DEST%\bin%_EXT%\presenter\presenter-screen.oxt
..\%__SRC%\bin\presenter-screen_develop.zip %_DEST%\bin%_EXT%\presenter\presenter-screen_develop.zip
+
+
+
+mkdir: %COMMON_DEST%\res%_EXT%
+..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res
+
+mkdir: %_DEST%\xml%_EXT%
+mkdir: %_DEST%\xml%_EXT%\registry
+mkdir: %_DEST%\xml%_EXT%\registry\spool
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Addons
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\ProtocolHandler
+
+..\%__SRC%\misc\registry\spool\org\openoffice\Office\Addons\*.xcu %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Addons
+..\%__SRC%\misc\registry\spool\org\openoffice\Office\ProtocolHandler\*.xcu %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\ProtocolHandler
+
+mkdir: %_DEST%\xml%_EXT%
+..\%__SRC%\misc\PresentationMinimizer.component %_DEST%\xml%_EXT%\PresentationMinimizer.component
+
+..\%__SRC%\bin\PresentationMinimizer*.dll %_DEST%\bin%_EXT%\PresentationMinimizer*.dll
+..\%__SRC%\lib\PresentationMinimizer*.so %_DEST%\lib%_EXT%
Copied: openoffice/trunk/main/sdext/source/minimizer/PresentationMinimizer.component (from r1455531, openoffice/trunk/main/sdext/source/minimizer/registry/data/org/openoffice/Office/ProtocolHandler.xcu)
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/PresentationMinimizer.component?p2=openoffice/trunk/main/sdext/source/minimizer/PresentationMinimizer.component&p1=openoffice/trunk/main/sdext/source/minimizer/registry/data/org/openoffice/Office/ProtocolHandler.xcu&r1=1455531&r2=1457158&rev=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/registry/data/org/openoffice/Office/ProtocolHandler.xcu (original)
+++ openoffice/trunk/main/sdext/source/minimizer/PresentationMinimizer.component Fri Mar 15 23:19:19 2013
@@ -1,6 +1,6 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,24 +8,23 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
***********************************************************-->
-
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="ProtocolHandler" oor:package="org.openoffice.Office">
- <node oor:name="HandlerSet">
- <node oor:name="com.sun.star.comp.SunPresentationMinimizerImp" oor:op="replace">
- <prop oor:name="Protocols" oor:type="oor:string-list">
- <value>vnd.com.sun.star.comp.SunPresentationMinimizer:*</value>
- </prop>
- </node>
- </node>
-</oor:component-data>
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.PPPOptimizerImp">
+ <service name="com.sun.star.comp.PPPOptimizer"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ui.dialogs.PresentationMinimizerDialog">
+ <service name="com.sun.star.ui.dialogs.PresentationMinimizerDialog"/>
+ </implementation>
+</component>
Modified: openoffice/trunk/main/sdext/source/minimizer/configurationaccess.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/configurationaccess.cxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/configurationaccess.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/configurationaccess.cxx Fri Mar 15 23:19:19 2013
@@ -31,13 +31,39 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/resource/XResourceBundleLoader.hpp>
+
+#include <rtl/ustrbuf.hxx>
+
+#include "minimizer.hrc"
-using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
+using rtl::OUString;
+using rtl::OUStringBuffer;
+
+
+#include <rtl/instance.hxx>
+
+typedef std::map < sal_Int32, rtl::OUString > StringResourceMap;
+
+struct StaticResourceMap
+ : public rtl::StaticWithInit< StringResourceMap, StaticResourceMap >
+{
+ StringResourceMap &
+ operator()() const;
+};
+
+StringResourceMap &
+StaticResourceMap::operator()() const
+{
+ static StringResourceMap aMap;
+ return aMap;
+}
+
static const OUString& GetConfigurationProviderServiceName (void)
{
static const OUString sConfigurationProviderServiceName (
@@ -48,10 +74,31 @@ static const OUString& GetConfigurationP
static const OUString& GetPathToConfigurationRoot (void)
{
static const OUString sPathToConfigurationRoot (
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.extension.SunPresentationMinimizer"));
+ RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Impress/PresentationMinimizer"));
return sPathToConfigurationRoot;
}
+static OUString lcl_loadString(
+ const Reference< resource::XResourceBundle > xResourceBundle,
+ sal_Int32 nResourceId )
+{
+ OUString sString;
+ OUStringBuffer sKey;
+ sKey.appendAscii( RTL_CONSTASCII_STRINGPARAM( "string:" ) );
+ sKey.append( nResourceId );
+
+ try
+ {
+ OSL_VERIFY( xResourceBundle->getByName( sKey.makeStringAndClear() ) >>= sString );
+ }
+ catch( const uno::Exception& )
+ {
+ OSL_ENSURE( false, "OptimizerSettings: missing resource!" );
+ }
+
+ return sString;
+}
+
void OptimizerSettings::LoadSettingsFromConfiguration( const Reference< XNameAccess >& rSettings )
{
if ( rSettings.is() )
@@ -159,8 +206,8 @@ sal_Bool OptimizerSettings::operator==(
}
-ConfigurationAccess::ConfigurationAccess( const Reference< uno::XComponentContext >& rxMSF, OptimizerSettings* pDefaultSettings ) :
- mxMSF( rxMSF )
+ConfigurationAccess::ConfigurationAccess( const Reference< uno::XComponentContext >& rxContext, OptimizerSettings* pDefaultSettings ) :
+ m_xContext( rxContext )
{
LoadStrings();
maSettings.push_back( pDefaultSettings ?
@@ -174,66 +221,101 @@ ConfigurationAccess::~ConfigurationAcces
{
}
-rtl::OUString ConfigurationAccess::getPath( const PPPOptimizerTokenEnum eToken )
-{
- rtl::OUString aPath;
- try
- {
- static const OUString sProtocol( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.expand:" ) );
- static const OUString stheMacroExpander( RTL_CONSTASCII_USTRINGPARAM( "/singletons/com.sun.star.util.theMacroExpander" ) );
- Reference< container::XNameAccess > xSet( OpenConfiguration( true ), UNO_QUERY_THROW );
- if ( xSet->hasByName( TKGet( eToken ) ) )
- xSet->getByName( TKGet( eToken ) ) >>= aPath;
- if ( aPath.match( sProtocol, 0 ) )
- {
- rtl::OUString aTmp( aPath.copy( 20 ) );
- Reference< util::XMacroExpander > xExpander;
- if ( mxMSF->getValueByName( stheMacroExpander ) >>= xExpander )
- {
- aPath = xExpander->expandMacros( aTmp );
- }
- }
- }
- catch ( Exception& )
- {
- }
- return aPath;
-}
-
-rtl::OUString ConfigurationAccess::getString( const PPPOptimizerTokenEnum eToken ) const
+rtl::OUString ConfigurationAccess::getString( sal_Int32 nResId )
{
- std::map< PPPOptimizerTokenEnum, rtl::OUString, Compare >::const_iterator aIter( maStrings.find( eToken ) );
- return aIter != maStrings.end() ? ((*aIter).second) : rtl::OUString();
+ const StringResourceMap &aStrings = StaticResourceMap::get();
+ StringResourceMap::const_iterator aIter( aStrings.find( nResId ) );
+ return aIter != aStrings.end() ? ((*aIter).second) : rtl::OUString();
}
void ConfigurationAccess::LoadStrings()
{
+ static bool bLoaded = false;
+ if ( bLoaded )
+ return;
+ else
+ bLoaded = true;
try
{
- do
- {
- Reference< XInterface > xRoot( OpenConfiguration( true ) );
- if ( !xRoot.is() )
- break;
- Reference< container::XNameAccess > xSet( GetConfigurationNode( xRoot, TKGet( TK_Strings ) ), UNO_QUERY );
- if ( xSet.is() )
- {
- const Sequence< OUString > aElements( xSet->getElementNames() );
- for ( int i = 0; i < aElements.getLength(); i++ )
- {
- try
- {
- OUString aString, aPropertyName( aElements[ i ] );
- if ( xSet->getByName( aPropertyName ) >>= aString )
- maStrings[ TKGet( aPropertyName ) ] = aString;
- }
- catch( Exception& )
- {
- }
- }
- }
- }
- while( false );
+
+ Reference< resource::XResourceBundleLoader > xResourceBundleLoader(
+ m_xContext->getValueByName(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "/singletons/com.sun.star.resource.OfficeResourceLoader" ) ) ),
+ UNO_QUERY_THROW );
+
+ Reference< resource::XResourceBundle > xResourceBundle(
+ xResourceBundleLoader->loadBundle_Default(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "minimizer" ) ) ),
+ UNO_SET_THROW );
+
+ StringResourceMap &aStrings = StaticResourceMap::get();
+ aStrings[ STR_PRESENTATION_MINIMIZER ] = lcl_loadString( xResourceBundle, STR_PRESENTATION_MINIMIZER );
+ aStrings[ STR_STEPS ] = lcl_loadString( xResourceBundle, STR_STEPS );
+ aStrings[ STR_HELP ] = lcl_loadString( xResourceBundle, STR_HELP );
+ aStrings[ STR_BACK ] = lcl_loadString( xResourceBundle, STR_BACK );
+ aStrings[ STR_NEXT ] = lcl_loadString( xResourceBundle, STR_NEXT );
+ aStrings[ STR_FINISH ] = lcl_loadString( xResourceBundle, STR_FINISH );
+ aStrings[ STR_CANCEL ] = lcl_loadString( xResourceBundle, STR_CANCEL );
+ aStrings[ STR_INTRODUCTION ] = lcl_loadString( xResourceBundle, STR_INTRODUCTION );
+ aStrings[ STR_INTRODUCTION_T ] = lcl_loadString( xResourceBundle, STR_INTRODUCTION_T );
+ aStrings[ STR_CHOSE_SETTINGS ] = lcl_loadString( xResourceBundle, STR_CHOSE_SETTINGS );
+ aStrings[ STR_REMOVE ] = lcl_loadString( xResourceBundle, STR_REMOVE );
+ aStrings[ STR_GRAPHIC_OPTIMIZATION ] = lcl_loadString( xResourceBundle, STR_GRAPHIC_OPTIMIZATION );
+ aStrings[ STR_IMAGE_OPTIMIZATION ] = lcl_loadString( xResourceBundle, STR_IMAGE_OPTIMIZATION );
+ aStrings[ STR_LOSSLESS_COMPRESSION ] = lcl_loadString( xResourceBundle, STR_LOSSLESS_COMPRESSION );
+ aStrings[ STR_JPEG_COMPRESSION ] = lcl_loadString( xResourceBundle, STR_JPEG_COMPRESSION );
+ aStrings[ STR_QUALITY ] = lcl_loadString( xResourceBundle, STR_QUALITY );
+ aStrings[ STR_REMOVE_CROP_AREA ] = lcl_loadString( xResourceBundle, STR_REMOVE_CROP_AREA );
+ aStrings[ STR_IMAGE_RESOLUTION ] = lcl_loadString( xResourceBundle, STR_IMAGE_RESOLUTION );
+ aStrings[ STR_IMAGE_RESOLUTION_0 ] = lcl_loadString( xResourceBundle, STR_IMAGE_RESOLUTION_0 );
+ aStrings[ STR_IMAGE_RESOLUTION_1 ] = lcl_loadString( xResourceBundle, STR_IMAGE_RESOLUTION_1 );
+ aStrings[ STR_IMAGE_RESOLUTION_2 ] = lcl_loadString( xResourceBundle, STR_IMAGE_RESOLUTION_2 );
+ aStrings[ STR_IMAGE_RESOLUTION_3 ] = lcl_loadString( xResourceBundle, STR_IMAGE_RESOLUTION_3 );
+ aStrings[ STR_EMBED_LINKED_GRAPHICS ] = lcl_loadString( xResourceBundle, STR_EMBED_LINKED_GRAPHICS );
+ aStrings[ STR_OLE_OBJECTS ] = lcl_loadString( xResourceBundle, STR_OLE_OBJECTS );
+ aStrings[ STR_OLE_OPTIMIZATION ] = lcl_loadString( xResourceBundle, STR_OLE_OPTIMIZATION );
+ aStrings[ STR_OLE_REPLACE ] = lcl_loadString( xResourceBundle, STR_OLE_REPLACE );
+ aStrings[ STR_ALL_OLE_OBJECTS ] = lcl_loadString( xResourceBundle, STR_ALL_OLE_OBJECTS );
+ aStrings[ STR_ALIEN_OLE_OBJECTS_ONLY ] = lcl_loadString( xResourceBundle, STR_ALIEN_OLE_OBJECTS_ONLY );
+ aStrings[ STR_OLE_OBJECTS_DESC ] = lcl_loadString( xResourceBundle, STR_OLE_OBJECTS_DESC );
+ aStrings[ STR_NO_OLE_OBJECTS_DESC ] = lcl_loadString( xResourceBundle, STR_NO_OLE_OBJECTS_DESC );
+ aStrings[ STR_SLIDES ] = lcl_loadString( xResourceBundle, STR_SLIDES );
+ aStrings[ STR_CHOOSE_SLIDES ] = lcl_loadString( xResourceBundle, STR_CHOOSE_SLIDES );
+ aStrings[ STR_MASTER_PAGES ] = lcl_loadString( xResourceBundle, STR_MASTER_PAGES );
+ aStrings[ STR_DELETE_MASTER_PAGES ] = lcl_loadString( xResourceBundle, STR_DELETE_MASTER_PAGES );
+ aStrings[ STR_DELETE_NOTES_PAGES ] = lcl_loadString( xResourceBundle, STR_DELETE_NOTES_PAGES );
+ aStrings[ STR_DELETE_HIDDEN_SLIDES ] = lcl_loadString( xResourceBundle, STR_DELETE_HIDDEN_SLIDES );
+ aStrings[ STR_CUSTOM_SHOW ] = lcl_loadString( xResourceBundle, STR_CUSTOM_SHOW );
+ aStrings[ STR_SUMMARY ] = lcl_loadString( xResourceBundle, STR_SUMMARY );
+ aStrings[ STR_SUMMARY_TITLE ] = lcl_loadString( xResourceBundle, STR_SUMMARY_TITLE );
+ aStrings[ STR_PROGRESS ] = lcl_loadString( xResourceBundle, STR_PROGRESS );
+ aStrings[ STR_OBJECTS_OPTIMIZED ] = lcl_loadString( xResourceBundle, STR_OBJECTS_OPTIMIZED );
+ aStrings[ STR_APPLY_TO_CURRENT ] = lcl_loadString( xResourceBundle, STR_APPLY_TO_CURRENT );
+ aStrings[ STR_AUTOMATICALLY_OPEN ] = lcl_loadString( xResourceBundle, STR_AUTOMATICALLY_OPEN );
+ aStrings[ STR_SAVE_SETTINGS ] = lcl_loadString( xResourceBundle, STR_SAVE_SETTINGS );
+ aStrings[ STR_SAVE_AS ] = lcl_loadString( xResourceBundle, STR_SAVE_AS );
+ aStrings[ STR_DELETE_SLIDES ] = lcl_loadString( xResourceBundle, STR_DELETE_SLIDES );
+ aStrings[ STR_OPTIMIZE_IMAGES ] = lcl_loadString( xResourceBundle, STR_OPTIMIZE_IMAGES );
+ aStrings[ STR_CREATE_REPLACEMENT ] = lcl_loadString( xResourceBundle, STR_CREATE_REPLACEMENT );
+ aStrings[ STR_CURRENT_FILESIZE ] = lcl_loadString( xResourceBundle, STR_CURRENT_FILESIZE );
+ aStrings[ STR_ESTIMATED_FILESIZE ] = lcl_loadString( xResourceBundle, STR_ESTIMATED_FILESIZE );
+ aStrings[ STR_MB ] = lcl_loadString( xResourceBundle, STR_MB );
+ aStrings[ STR_MY_SETTINGS ] = lcl_loadString( xResourceBundle, STR_MY_SETTINGS );
+ aStrings[ STR_DEFAULT_SESSION ] = lcl_loadString( xResourceBundle, STR_DEFAULT_SESSION );
+ aStrings[ STR_MODIFY_WARNING ] = lcl_loadString( xResourceBundle, STR_MODIFY_WARNING );
+ aStrings[ STR_YES ] = lcl_loadString( xResourceBundle, STR_YES );
+ aStrings[ STR_OK ] = lcl_loadString( xResourceBundle, STR_OK );
+ aStrings[ STR_INFO_1 ] = lcl_loadString( xResourceBundle, STR_INFO_1 );
+ aStrings[ STR_INFO_2 ] = lcl_loadString( xResourceBundle, STR_INFO_2 );
+ aStrings[ STR_INFO_3 ] = lcl_loadString( xResourceBundle, STR_INFO_3 );
+ aStrings[ STR_INFO_4 ] = lcl_loadString( xResourceBundle, STR_INFO_4 );
+ aStrings[ STR_DUPLICATING_PRESENTATION ] = lcl_loadString( xResourceBundle, STR_DUPLICATING_PRESENTATION );
+ aStrings[ STR_DELETING_SLIDES ] = lcl_loadString( xResourceBundle, STR_DELETING_SLIDES );
+ aStrings[ STR_OPTIMIZING_GRAPHICS ] = lcl_loadString( xResourceBundle, STR_OPTIMIZING_GRAPHICS );
+ aStrings[ STR_CREATING_OLE_REPLACEMENTS] = lcl_loadString( xResourceBundle, STR_CREATING_OLE_REPLACEMENTS );
+ aStrings[ STR_FILESIZESEPARATOR ] = lcl_loadString( xResourceBundle, STR_FILESIZESEPARATOR );
+ aStrings[ STR_INFO_DIALOG ] = lcl_loadString( xResourceBundle, STR_INFO_DIALOG );
}
catch( Exception& )
{
@@ -334,7 +416,7 @@ Reference< XInterface > ConfigurationAcc
Reference< XInterface > xRoot;
try
{
- Reference< lang::XMultiServiceFactory > xProvider( mxMSF->getServiceManager()->createInstanceWithContext( GetConfigurationProviderServiceName(), mxMSF ), UNO_QUERY );
+ Reference< lang::XMultiServiceFactory > xProvider( m_xContext->getServiceManager()->createInstanceWithContext( GetConfigurationProviderServiceName(), m_xContext ), UNO_QUERY );
if ( xProvider.is() )
{
Sequence< Any > aCreationArguments( 2 );
Modified: openoffice/trunk/main/sdext/source/minimizer/configurationaccess.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/configurationaccess.hxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/configurationaccess.hxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/configurationaccess.hxx Fri Mar 15 23:19:19 2013
@@ -40,6 +40,7 @@
#include <com/sun/star/container/XNameReplace.hpp>
#include <map>
+
struct OptimizerSettings
{
rtl::OUString maName;
@@ -86,13 +87,12 @@ class ConfigurationAccess
{
public :
- ConfigurationAccess( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rXFactory,
+ ConfigurationAccess( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
OptimizerSettings* pDefaultSettings = NULL );
~ConfigurationAccess();
void SaveConfiguration();
- rtl::OUString getPath( const PPPOptimizerTokenEnum );
- rtl::OUString getString( const PPPOptimizerTokenEnum ) const;
+ static rtl::OUString getString( sal_Int32 nResId );
// access to current OptimizerSettings (stored in the first entry of maSettings)
com::sun::star::uno::Any GetConfigProperty( const PPPOptimizerTokenEnum ) const;
@@ -110,20 +110,10 @@ class ConfigurationAccess
private :
- struct Compare
- {
- bool operator()( const PPPOptimizerTokenEnum s1, const PPPOptimizerTokenEnum s2 ) const
- {
- return s1 < s2;
- }
- };
- std::map < PPPOptimizerTokenEnum, rtl::OUString, Compare > maStrings;
-
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
std::vector< OptimizerSettings > maSettings;
std::vector< OptimizerSettings > maInitialSettings;
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF;
-
void LoadStrings();
void LoadConfiguration();
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > OpenConfiguration( bool bReadOnly );
Modified: openoffice/trunk/main/sdext/source/minimizer/fileopendialog.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/fileopendialog.cxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/fileopendialog.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/fileopendialog.cxx Fri Mar 15 23:19:19 2013
@@ -57,7 +57,6 @@
#include <rtl/ustrbuf.hxx>
-using namespace ::rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
@@ -65,14 +64,53 @@ using namespace ::com::sun::star::contai
using namespace ::com::sun::star::view;
using namespace ::com::sun::star::ui::dialogs;
-FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxMSF ) :
- mxMSF( rxMSF )
+using ::com::sun::star::awt::XWindow;
+using ::rtl::OUString;
+
+namespace
{
- Sequence< Any > aInitPropSeq( 1 );
- aInitPropSeq[ 0 ] <<= (sal_Int16)TemplateDescription::FILESAVE_AUTOEXTENSION; // TemplateDescription.FILEOPEN_SIMPLE
+ inline bool lcl_isSystemDialog(
+ const Reference< XInterface > &rxIfce )
+ {
+ Reference< XServiceInfo > xInfo( rxIfce, UNO_QUERY );
+ if ( !xInfo.is() )
+ return false;
+
+ return xInfo->supportsService(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ui.dialogs.SystemFilePicker" ) ) );
+ }
+}
+
+FileOpenDialog::FileOpenDialog(
+ const Reference< XComponentContext >& rxContext,
+ const Reference< XWindow > &rxParent )
+ : mxContext( rxContext )
+{
+ mxFilePicker = Reference < XFilePicker >(
+ mxContext->getServiceManager()->createInstanceWithContext(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ui.dialogs.FilePicker" ) ),
+ rxContext ), UNO_QUERY_THROW );
+ Reference< XInitialization > xInit( mxFilePicker, UNO_QUERY_THROW );
+ bool bIsSystemDlg = lcl_isSystemDialog( mxFilePicker );
+ Sequence< Any > aInitPropSeq( bIsSystemDlg ? 1 : 2 );
+ if ( bIsSystemDlg )
+ {
+ aInitPropSeq[0] <<= TemplateDescription::FILESAVE_AUTOEXTENSION;
+ xInit->initialize( aInitPropSeq );
+ }
+ else
+ {
+ aInitPropSeq[ 0 ] <<= NamedValue(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("TemplateDescription")),
+ makeAny( (sal_Int16)TemplateDescription::FILESAVE_AUTOEXTENSION));
+ aInitPropSeq[ 1 ] <<= NamedValue(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")),
+ makeAny( rxParent ));
+ xInit->initialize( aInitPropSeq );
+ }
- mxFilePicker = Reference < XFilePicker >( mxMSF->getServiceManager()->createInstanceWithArgumentsAndContext(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ), aInitPropSeq, rxMSF ),UNO_QUERY_THROW );
mxFilePicker->setMultiSelectionMode( sal_False );
Reference< XFilePickerControlAccess > xAccess( mxFilePicker, UNO_QUERY );
@@ -88,8 +126,8 @@ FileOpenDialog::FileOpenDialog( const Re
}
// collecting a list of impress filters
- Reference< XNameAccess > xFilters( mxMSF->getServiceManager()->createInstanceWithContext(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" ) ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XNameAccess > xFilters( mxContext->getServiceManager()->createInstanceWithContext(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" ) ), rxContext ), UNO_QUERY_THROW );
Sequence< OUString > aFilterList( xFilters->getElementNames() );
for ( int i = 0; i < aFilterList.getLength(); i++ )
{
@@ -133,14 +171,14 @@ FileOpenDialog::FileOpenDialog( const Re
}
}
- Reference< XNameAccess > xTypes( mxMSF->getServiceManager()->createInstanceWithContext(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" ) ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XNameAccess > xTypes( mxContext->getServiceManager()->createInstanceWithContext(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" ) ), rxContext ), UNO_QUERY_THROW );
Sequence< OUString > aTypeList( xFilters->getElementNames() );
// mxFilePicker->setDefaultName( );
const char filter[] = "*.";
- // the filter title must be formed in the same it is currently done
+ // the filter title must be formed in the same way it is currently done
// in the internal implementation: "UIName (.<extension>)"
rtl::OUStringBuffer aUIName;
// the filter must be in the form "*.<extension>"
Modified: openoffice/trunk/main/sdext/source/minimizer/fileopendialog.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/fileopendialog.hxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/fileopendialog.hxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/fileopendialog.hxx Fri Mar 15 23:19:19 2013
@@ -30,6 +30,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
class FileOpenDialog
{
@@ -46,13 +47,14 @@ class FileOpenDialog
FilterEntry() :
maFlags( 0 ) {}
};
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePicker > mxFilePicker;
std::vector< FilterEntry > aFilterEntryList;
public :
- FileOpenDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF );
+ FileOpenDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const com::sun::star::uno::Reference< com::sun::star::awt::XWindow > &rxParent );
~FileOpenDialog();
sal_Int16 execute();
Modified: openoffice/trunk/main/sdext/source/minimizer/graphiccollector.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/graphiccollector.cxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/graphiccollector.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/graphiccollector.cxx Fri Mar 15 23:19:19 2013
@@ -35,7 +35,6 @@
#include "impoptimizer.hxx"
-using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
@@ -45,6 +44,8 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::presentation;
+using ::rtl::OUString;
+
const DeviceInfo& GraphicCollector::GetDeviceInfo( const Reference< XComponentContext >& rxFact )
{
static DeviceInfo aDeviceInfo;
@@ -95,7 +96,7 @@ void ImpAddEntity( std::vector< GraphicC
}
}
-void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference< XShape >& rxShape, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
+void ImpAddGraphicEntity( const Reference< XComponentContext >& rxContext, Reference< XShape >& rxShape, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
{
Reference< XGraphic > xGraphic;
Reference< XPropertySet > xShapePropertySet( rxShape, UNO_QUERY_THROW );
@@ -114,7 +115,7 @@ void ImpAddGraphicEntity( const Referenc
// calculating the logical size, as if there were no cropping
if ( aGraphicCropLogic.Left || aGraphicCropLogic.Right || aGraphicCropLogic.Top || aGraphicCropLogic.Bottom )
{
- awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) );
+ awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxContext, xGraphic ) );
if ( aSize100thMM.Width && aSize100thMM.Height )
{
awt::Size aCropSize( aSize100thMM.Width - ( aGraphicCropLogic.Left + aGraphicCropLogic.Right ),
@@ -133,7 +134,7 @@ void ImpAddGraphicEntity( const Referenc
}
}
-void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const Reference< XPropertySet >& rxPropertySet, const awt::Size& rLogicalSize,
+void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxContext, const Reference< XPropertySet >& rxPropertySet, const awt::Size& rLogicalSize,
std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities, const GraphicSettings& rGraphicSettings, const Reference< XPropertySet >& rxPagePropertySet )
{
try
@@ -171,7 +172,7 @@ void ImpAddFillBitmapEntity( const Refer
{
if ( !aSize.Width || !aSize.Height )
{
- awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) );
+ awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxContext, xGraphic ) );
if ( aSize100thMM.Width && aSize100thMM.Height )
aLogicalSize = aSize100thMM;
}
@@ -205,7 +206,7 @@ void ImpAddFillBitmapEntity( const Refer
}
}
-void ImpCollectBackgroundGraphic( const Reference< XComponentContext >& rxMSF, const Reference< XDrawPage >& rxDrawPage, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
+void ImpCollectBackgroundGraphic( const Reference< XComponentContext >& rxContext, const Reference< XDrawPage >& rxDrawPage, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
{
try
{
@@ -216,14 +217,14 @@ void ImpCollectBackgroundGraphic( const
Reference< XPropertySet > xBackgroundPropSet;
if ( xPropertySet->getPropertyValue( TKGet( TK_Background ) ) >>= xBackgroundPropSet )
- ImpAddFillBitmapEntity( rxMSF, xBackgroundPropSet, aLogicalSize, rGraphicEntities, rGraphicSettings, xPropertySet );
+ ImpAddFillBitmapEntity( rxContext, xBackgroundPropSet, aLogicalSize, rGraphicEntities, rGraphicSettings, xPropertySet );
}
catch( Exception& )
{
}
}
-void ImpCollectGraphicObjects( const Reference< XComponentContext >& rxMSF, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
+void ImpCollectGraphicObjects( const Reference< XComponentContext >& rxContext, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
{
for ( sal_Int32 i = 0; i < rxShapes->getCount(); i++ )
{
@@ -236,18 +237,18 @@ void ImpCollectGraphicObjects( const Ref
if ( sShapeType == sGroupShape )
{
Reference< XShapes > xShapes( xShape, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xShapes, rGraphicSettings, rGraphicEntities );
+ ImpCollectGraphicObjects( rxContext, xShapes, rGraphicSettings, rGraphicEntities );
continue;
}
if ( sShapeType == sGraphicObjectShape )
- ImpAddGraphicEntity( rxMSF, xShape, rGraphicSettings, rGraphicEntities );
+ ImpAddGraphicEntity( rxContext, xShape, rGraphicSettings, rGraphicEntities );
// now check for a fillstyle
Reference< XPropertySet > xEmptyPagePropSet;
Reference< XPropertySet > xShapePropertySet( xShape, UNO_QUERY_THROW );
awt::Size aLogicalSize( xShape->getSize() );
- ImpAddFillBitmapEntity( rxMSF, xShapePropertySet, aLogicalSize, rGraphicEntities, rGraphicSettings, xEmptyPagePropSet );
+ ImpAddFillBitmapEntity( rxContext, xShapePropertySet, aLogicalSize, rGraphicEntities, rGraphicSettings, xEmptyPagePropSet );
}
catch( Exception& )
{
@@ -255,7 +256,7 @@ void ImpCollectGraphicObjects( const Ref
}
}
-awt::Size GraphicCollector::GetOriginalSize( const Reference< XComponentContext >& rxMSF, const Reference< XGraphic >& rxGraphic )
+awt::Size GraphicCollector::GetOriginalSize( const Reference< XComponentContext >& rxContext, const Reference< XGraphic >& rxGraphic )
{
awt::Size aSize100thMM( 0, 0 );
Reference< XPropertySet > xGraphicPropertySet( rxGraphic, UNO_QUERY_THROW );
@@ -266,7 +267,7 @@ awt::Size GraphicCollector::GetOriginalS
awt::Size aSourceSizePixel( 0, 0 );
if ( xGraphicPropertySet->getPropertyValue( TKGet( TK_SizePixel ) ) >>= aSourceSizePixel )
{
- const DeviceInfo& rDeviceInfo( GraphicCollector::GetDeviceInfo( rxMSF ) );
+ const DeviceInfo& rDeviceInfo( GraphicCollector::GetDeviceInfo( rxContext ) );
if ( rDeviceInfo.PixelPerMeterX && rDeviceInfo.PixelPerMeterY )
{
aSize100thMM.Width = static_cast< sal_Int32 >( ( aSourceSizePixel.Width * 100000.0 ) / rDeviceInfo.PixelPerMeterX );
@@ -278,7 +279,7 @@ awt::Size GraphicCollector::GetOriginalS
return aSize100thMM;
}
-void GraphicCollector::CollectGraphics( const Reference< XComponentContext >& rxMSF, const Reference< XModel >& rxModel,
+void GraphicCollector::CollectGraphics( const Reference< XComponentContext >& rxContext, const Reference< XModel >& rxModel,
const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicList )
{
try
@@ -289,24 +290,24 @@ void GraphicCollector::CollectGraphics(
for ( i = 0; i < xDrawPages->getCount(); i++ )
{
Reference< XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), UNO_QUERY_THROW );
- ImpCollectBackgroundGraphic( rxMSF, xDrawPage, rGraphicSettings, rGraphicList );
+ ImpCollectBackgroundGraphic( rxContext, xDrawPage, rGraphicSettings, rGraphicList );
Reference< XShapes > xDrawShapes( xDrawPage, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xDrawShapes, rGraphicSettings, rGraphicList );
+ ImpCollectGraphicObjects( rxContext, xDrawShapes, rGraphicSettings, rGraphicList );
Reference< XPresentationPage > xPresentationPage( xDrawPage, UNO_QUERY_THROW );
Reference< XDrawPage > xNotesPage( xPresentationPage->getNotesPage() );
- ImpCollectBackgroundGraphic( rxMSF, xNotesPage, rGraphicSettings, rGraphicList );
+ ImpCollectBackgroundGraphic( rxContext, xNotesPage, rGraphicSettings, rGraphicList );
Reference< XShapes > xNotesShapes( xNotesPage, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xNotesShapes, rGraphicSettings, rGraphicList );
+ ImpCollectGraphicObjects( rxContext, xNotesShapes, rGraphicSettings, rGraphicList );
}
Reference< XMasterPagesSupplier > xMasterPagesSupplier( rxModel, UNO_QUERY_THROW );
Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_QUERY_THROW );
for ( i = 0; i < xMasterPages->getCount(); i++ )
{
Reference< XDrawPage > xMasterPage( xMasterPages->getByIndex( i ), UNO_QUERY_THROW );
- ImpCollectBackgroundGraphic( rxMSF, xMasterPage, rGraphicSettings, rGraphicList );
+ ImpCollectBackgroundGraphic( rxContext, xMasterPage, rGraphicSettings, rGraphicList );
Reference< XShapes > xMasterPageShapes( xMasterPage, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xMasterPageShapes, rGraphicSettings, rGraphicList );
+ ImpCollectGraphicObjects( rxContext, xMasterPageShapes, rGraphicSettings, rGraphicList );
}
std::vector< GraphicCollector::GraphicEntity >::iterator aGraphicIter( rGraphicList.begin() );
@@ -348,7 +349,7 @@ void GraphicCollector::CollectGraphics(
}
}
-void ImpCountGraphicObjects( const Reference< XComponentContext >& rxMSF, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, sal_Int32& rnGraphics )
+void ImpCountGraphicObjects( const Reference< XComponentContext >& rxContext, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, sal_Int32& rnGraphics )
{
for ( sal_Int32 i = 0; i < rxShapes->getCount(); i++ )
{
@@ -361,7 +362,7 @@ void ImpCountGraphicObjects( const Refer
if ( sShapeType == sGroupShape )
{
Reference< XShapes > xShapes( xShape, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxContext, xShapes, rGraphicSettings, rnGraphics );
continue;
}
@@ -390,7 +391,7 @@ void ImpCountGraphicObjects( const Refer
}
}
-void ImpCountBackgroundGraphic( const Reference< XComponentContext >& /* rxMSF */, const Reference< XDrawPage >& rxDrawPage,
+void ImpCountBackgroundGraphic( const Reference< XComponentContext >& /* rxContext */, const Reference< XDrawPage >& rxDrawPage,
const GraphicSettings& /* rGraphicSettings */, sal_Int32& rnGraphics )
{
try
@@ -418,7 +419,7 @@ void ImpCountBackgroundGraphic( const Re
}
}
-void GraphicCollector::CountGraphics( const Reference< XComponentContext >& rxMSF, const Reference< XModel >& rxModel,
+void GraphicCollector::CountGraphics( const Reference< XComponentContext >& rxContext, const Reference< XModel >& rxModel,
const GraphicSettings& rGraphicSettings, sal_Int32& rnGraphics )
{
try
@@ -429,24 +430,24 @@ void GraphicCollector::CountGraphics( co
for ( i = 0; i < xDrawPages->getCount(); i++ )
{
Reference< XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), UNO_QUERY_THROW );
- ImpCountBackgroundGraphic( rxMSF, xDrawPage, rGraphicSettings, rnGraphics );
+ ImpCountBackgroundGraphic( rxContext, xDrawPage, rGraphicSettings, rnGraphics );
Reference< XShapes > xDrawShapes( xDrawPage, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xDrawShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxContext, xDrawShapes, rGraphicSettings, rnGraphics );
Reference< XPresentationPage > xPresentationPage( xDrawPage, UNO_QUERY_THROW );
Reference< XDrawPage > xNotesPage( xPresentationPage->getNotesPage() );
- ImpCountBackgroundGraphic( rxMSF, xNotesPage, rGraphicSettings, rnGraphics );
+ ImpCountBackgroundGraphic( rxContext, xNotesPage, rGraphicSettings, rnGraphics );
Reference< XShapes > xNotesShapes( xNotesPage, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xNotesShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxContext, xNotesShapes, rGraphicSettings, rnGraphics );
}
Reference< XMasterPagesSupplier > xMasterPagesSupplier( rxModel, UNO_QUERY_THROW );
Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_QUERY_THROW );
for ( i = 0; i < xMasterPages->getCount(); i++ )
{
Reference< XDrawPage > xMasterPage( xMasterPages->getByIndex( i ), UNO_QUERY_THROW );
- ImpCountBackgroundGraphic( rxMSF, xMasterPage, rGraphicSettings, rnGraphics );
+ ImpCountBackgroundGraphic( rxContext, xMasterPage, rGraphicSettings, rnGraphics );
Reference< XShapes > xMasterPageShapes( xMasterPage, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xMasterPageShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxContext, xMasterPageShapes, rGraphicSettings, rnGraphics );
}
}
catch ( Exception& )
Modified: openoffice/trunk/main/sdext/source/minimizer/graphiccollector.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/graphiccollector.hxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/graphiccollector.hxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/graphiccollector.hxx Fri Mar 15 23:19:19 2013
@@ -82,14 +82,14 @@ class GraphicCollector
};
static const com::sun::star::awt::DeviceInfo& GetDeviceInfo( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxFact );
- static com::sun::star::awt::Size GetOriginalSize( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF,
+ static com::sun::star::awt::Size GetOriginalSize( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
const com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic >& rxGraphic );
// collecting graphic instances, the downside of this method is that every graphic is swapped in
- static void CollectGraphics( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel,
+ static void CollectGraphics( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel,
const GraphicSettings& rGraphicSettings, std::vector< GraphicEntity >& io_rGraphicList );
// counting graphics without swapping in graphics
- static void CountGraphics( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel,
+ static void CountGraphics( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel,
const GraphicSettings& rGraphicSettings, sal_Int32& rGraphics );
};
Added: openoffice/trunk/main/sdext/source/minimizer/helpid.hrc
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/helpid.hrc?rev=1457158&view=auto
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/helpid.hrc (added)
+++ openoffice/trunk/main/sdext/source/minimizer/helpid.hrc Fri Mar 15 23:19:19 2013
@@ -0,0 +1,57 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#define HID( helpid ) ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( helpid ) ) )
+
+#define HID_SDEXT_MINIMIZER_WIZ_DLG "sdext:Minimizer:Wizard:Dialog"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP1 "sdext:Minimizer:Wizard:Step1"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP1_LB_SETTINGS "sdext:Minimizer:Wizard:Step1:LBSettings"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP1_PB_DELSETTS "sdext:Minimizer:Wizard:Step1:PBDelSetts"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2 "sdext:Minimizer:Wizard:Step2"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_CUSTOMSHOW "sdext:Minimizer:Wizard:Step2:CBCustomShow"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_HIDDENSLIDES "sdext:Minimizer:Wizard:Step2:CBHiddenSlides"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_MASTERPAGES "sdext:Minimizer:Wizard:Step2:CBMasterPages"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_NOTES "sdext:Minimizer:Wizard:Step2:CBNotes"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2_LB_CUSTOMSHOW "sdext:Minimizer:Wizard:Step2:LBCustomShow"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3 "sdext:Minimizer:Wizard:Step3"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_CB_CROP "sdext:Minimizer:Wizard:Step3:CBCrop"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_LB_DPI "sdext:Minimizer:Wizard:Step3:LBDPI" // TODO change in help
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_CB_LINKS "sdext:Minimizer:Wizard:Step3:CBLinks"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_MF_QUALITY "sdext:Minimizer:Wizard:Step3:MFQuality"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_RB_JPEG "sdext:Minimizer:Wizard:Step3:RBJPEG"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_RB_LOSSLESS "sdext:Minimizer:Wizard:Step3:RBLossless"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP4 "sdext:Minimizer:Wizard:Step4"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP4_CB_OLE "sdext:Minimizer:Wizard:Step4:CBOLE"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP4_RB_ALLOLE "sdext:Minimizer:Wizard:Step4:RBAllOLE"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP4_RB_NOTODF "sdext:Minimizer:Wizard:Step4:RBNotODF"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP5 "sdext:Minimizer:Wizard:Step5"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP5_RB_CURDOC "sdext:Minimizer:Wizard:Step5:RBCurDoc"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP5_RB_NEWDOC "sdext:Minimizer:Wizard:Step5:RBNewDoc"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP5_CB_SAVESETTINGS "sdext:Minimizer:Wizard:Step5:CBSaveSetts" // TODO ADD to help
+#define HID_SDEXT_MINIMIZER_WIZ_STEP5_LB_SETTINGSNAME "sdext:Minimizer:Wizard:Step5:LBSettsName" // TODO ADD to help
+#define HID_SDEXT_MINIMIZER_WIZ_PB_HELP "sdext:Minimizer:Wizard:PBHelp" // TODO ADD to help
+#define HID_SDEXT_MINIMIZER_WIZ_PB_BACK "sdext:Minimizer:Wizard:PBBack"
+#define HID_SDEXT_MINIMIZER_WIZ_PB_NEXT "sdext:Minimizer:Wizard:PBNext"
+#define HID_SDEXT_MINIMIZER_WIZ_PB_FINISH "sdext:Minimizer:Wizard:PBFinish"
+#define HID_SDEXT_MINIMIZER_WIZ_PB_CANCEL "sdext:Minimizer:Wizard:PBCancel"
+#define HID_SDEXT_MINIMIZER_INFOBOX_DLG "sdext:Minimizer:InfoBox:Dialog"
+#define HID_SDEXT_MINIMIZER_INFOBOX_CB_OPENNEW "sdext:Minimizer:InfoBox:CBOpenNew"
+
Modified: openoffice/trunk/main/sdext/source/minimizer/impoptimizer.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/impoptimizer.cxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/impoptimizer.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/impoptimizer.cxx Fri Mar 15 23:19:19 2013
@@ -30,8 +30,8 @@
#include "pagecollector.hxx"
#include "informationdialog.hxx"
-#include <unotools/localfilehelper.hxx>
-#include <unotools/processfactory.hxx>
+#include "minimizer.hrc"
+
#include <vector>
#include "com/sun/star/util/URL.hpp"
#include "com/sun/star/util/XURLTransformer.hpp"
@@ -43,12 +43,9 @@
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/frame/XStorable.hpp>
-#ifndef _COM_SUN_STAR_FRAME_FrameSearchFlag_HPP_
#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#endif
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
-#include <unotools/configmgr.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
@@ -61,9 +58,7 @@
#include <com/sun/star/presentation/XPresentationPage.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XExporter.hpp>
-#ifndef _COM_SUN_STAR_UNO_RUNTIME_EXCEPTION_HPP_
#include <com/sun/star/uno/RuntimeException.hpp>
-#endif
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <com/sun/star/graphic/GraphicType.hpp>
@@ -73,7 +68,6 @@
#include <com/sun/star/util/URL.hpp>
using namespace ::std;
-using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::awt;
@@ -88,6 +82,8 @@ using namespace ::com::sun::star::docume
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::presentation;
+using ::rtl::OUString;
+
void ImpExtractCustomShow( const Reference< XModel >& rxModel, const OUString& rCustomShowName )
{
vector< Reference< XDrawPage > > vNonUsedPageList;
@@ -266,7 +262,7 @@ void ImpCompressGraphic( Reference< XGra
}
}
-Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >& rxMSF,
+Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >& rxContext,
const Reference< XGraphic >& xGraphic, const awt::Size& aLogicalSize, const text::GraphicCrop& aGraphicCropLogic,
const GraphicSettings& rGraphicSettings )
{
@@ -301,7 +297,7 @@ Reference< XGraphic > ImpCompressGraphic
// cropping has to be removed from SourceSizePixel
if ( aGraphicCropLogic.Left || aGraphicCropLogic.Top || aGraphicCropLogic.Right || aGraphicCropLogic.Bottom )
{
- const awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) );
+ const awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxContext, xGraphic ) );
if ( bRemoveCropArea )
bNeedsOptimizing = sal_True;
@@ -350,9 +346,9 @@ Reference< XGraphic > ImpCompressGraphic
}
if ( bNeedsOptimizing && aDestSizePixel.Width && aDestSizePixel.Height )
{
- Reference< XStream > xTempFile( rxMSF->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.io.TempFile" ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XStream > xTempFile( rxContext->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.io.TempFile" ), rxContext ), UNO_QUERY_THROW );
Reference< XOutputStream > xOutputStream( xTempFile->getOutputStream() );
- Reference< XGraphicProvider > xGraphicProvider( rxMSF->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XGraphicProvider > xGraphicProvider( rxContext->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ), rxContext ), UNO_QUERY_THROW );
ImpCompressGraphic( xGraphicProvider, xGraphic, xOutputStream, aDestMimeType, aLogicalSize, rGraphicSettings.mnJPEGQuality, rGraphicSettings.mnImageResolution, bRemoveCropArea, aGraphicCropLogic );
Reference< XInputStream > xInputStream( xTempFile->getInputStream() );
@@ -370,9 +366,9 @@ Reference< XGraphic > ImpCompressGraphic
else // this is a metafile
{
rtl::OUString aDestMimeType( aSourceMimeType );
- Reference< XStream > xTempFile( rxMSF->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.io.TempFile" ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XStream > xTempFile( rxContext->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.io.TempFile" ), rxContext ), UNO_QUERY_THROW );
Reference< XOutputStream > xOutputStream( xTempFile->getOutputStream() );
- Reference< XGraphicProvider > xGraphicProvider( rxMSF->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XGraphicProvider > xGraphicProvider( rxContext->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ), rxContext ), UNO_QUERY_THROW );
ImpCompressGraphic( xGraphicProvider, xGraphic, xOutputStream, aDestMimeType, aLogicalSize, rGraphicSettings.mnJPEGQuality, rGraphicSettings.mnImageResolution, sal_False, aGraphicCropLogic );
Reference< XInputStream > xInputStream( xTempFile->getInputStream() );
Reference< XSeekable > xSeekable( xInputStream, UNO_QUERY_THROW );
@@ -390,7 +386,7 @@ Reference< XGraphic > ImpCompressGraphic
return xNewGraphic;
}
-void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentContext >& rxMSF, const GraphicSettings& rGraphicSettings,
+void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentContext >& rxContext, const GraphicSettings& rGraphicSettings,
std::vector< GraphicCollector::GraphicEntity >& rGraphicList )
{
try
@@ -425,8 +421,8 @@ void CompressGraphics( ImpOptimizer& rOp
if ( xGraphic.is() )
{
Reference< XPropertySet > xNewGraphicPropertySet( xGraphic, UNO_QUERY_THROW );
- awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) );
- Reference< XGraphic > xNewGraphic( ImpCompressGraphic( rxMSF, xGraphic, aGraphicIter->maLogicalSize, aGraphicIter->maGraphicCropLogic, aGraphicSettings ) );
+ awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxContext, xGraphic ) );
+ Reference< XGraphic > xNewGraphic( ImpCompressGraphic( rxContext, xGraphic, aGraphicIter->maLogicalSize, aGraphicIter->maGraphicCropLogic, aGraphicSettings ) );
if ( xNewGraphic.is() )
{
// applying graphic to each user
@@ -446,7 +442,7 @@ void CompressGraphics( ImpOptimizer& rOp
text::GraphicCrop aGraphicCropLogic( 0, 0, 0, 0 );
if ( !aGraphicSettings.mbRemoveCropArea )
{
- awt::Size aNewSize( GraphicCollector::GetOriginalSize( rxMSF, xNewGraphic ) );
+ awt::Size aNewSize( GraphicCollector::GetOriginalSize( rxContext, xNewGraphic ) );
aGraphicCropLogic.Left = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Left * ((double)aNewSize.Width / (double)aSize100thMM.Width));
aGraphicCropLogic.Top = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Top * ((double)aNewSize.Height / (double)aSize100thMM.Height));
aGraphicCropLogic.Right = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Right * ((double)aNewSize.Width / (double)aSize100thMM.Width));
@@ -497,8 +493,8 @@ void CompressGraphics( ImpOptimizer& rOp
// - ImpOptimizer -
// ----------------
-ImpOptimizer::ImpOptimizer( const Reference< XComponentContext >& rxMSF, const Reference< XModel >& rxModel ) :
- mxMSF ( rxMSF ),
+ImpOptimizer::ImpOptimizer( const Reference< XComponentContext >& rxContext, const Reference< XModel >& rxModel ) :
+ mxContext ( rxContext ),
mxModel ( rxModel ),
mbJPEGCompression ( sal_False ),
mnJPEGQuality ( 90 ),
@@ -512,30 +508,35 @@ ImpOptimizer::ImpOptimizer( const Refere
mbDeleteNotesPages ( sal_False ),
mbOpenNewDocument ( sal_True )
{
+ OSL_TRACE("ImpOptimizer::ImpOptimizer");
+ Reference< XController > xController( mxModel->getCurrentController() );
+ if (xController.is() )
+ mxFrame.set( xController->getFrame() );
}
// -----------------------------------------------------------------------------
ImpOptimizer::~ImpOptimizer()
{
+ OSL_TRACE("ImpOptimizer::~ImpOptimizer");
}
// -----------------------------------------------------------------------------
void ImpOptimizer::DispatchStatus()
{
- if ( mxStatusDispatcher.is() )
+ if ( mxStatusListener.is() )
{
- URL aURL;
- aURL.Protocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.com.sun.star.comp.SunPresentationMinimizer:" ) );
- aURL.Path = OUString( RTL_CONSTASCII_USTRINGPARAM( "statusupdate" ) );
- mxStatusDispatcher->dispatch( aURL, GetStatusSequence() );
+ FeatureStateEvent aState;
+ aState.IsEnabled = sal_True;
+ aState.State <<= GetStatusSequence();
+ mxStatusListener->statusChanged( aState );
}
}
// -----------------------------------------------------------------------------
-sal_Bool ImpOptimizer::Optimize()
+sal_Bool ImpOptimizer::ImplOptimize()
{
if ( maCustomShowName.getLength() )
@@ -544,7 +545,7 @@ sal_Bool ImpOptimizer::Optimize()
if ( mbDeleteUnusedMasterPages )
{
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_DELETING_SLIDES ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_DELETING_SLIDES ) ) );
DispatchStatus();
ImpDeleteUnusedMasterPages( mxModel );
}
@@ -552,14 +553,14 @@ sal_Bool ImpOptimizer::Optimize()
if ( mbDeleteHiddenSlides )
{
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_DELETING_SLIDES ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_DELETING_SLIDES ) ) );
DispatchStatus();
ImpDeleteHiddenSlides( mxModel );
}
if ( mbDeleteNotesPages )
{
- SetStatusValue( TK_Status, Any( TKGet( STR_DELETING_SLIDES ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_DELETING_SLIDES ) ) );
DispatchStatus();
ImpDeleteNotesPages( mxModel );
}
@@ -567,7 +568,7 @@ sal_Bool ImpOptimizer::Optimize()
if ( mbOLEOptimization )
{
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 45 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_CREATING_OLE_REPLACEMENTS ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_CREATING_OLE_REPLACEMENTS ) ) );
DispatchStatus();
ImpConvertOLE( mxModel, mnOLEOptimizationType );
}
@@ -575,13 +576,13 @@ sal_Bool ImpOptimizer::Optimize()
if ( mbJPEGCompression || mbRemoveCropArea || mnImageResolution )
{
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 50 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_OPTIMIZING_GRAPHICS ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_OPTIMIZING_GRAPHICS ) ) );
DispatchStatus();
std::vector< GraphicCollector::GraphicEntity > aGraphicList;
GraphicSettings aGraphicSettings( mbJPEGCompression, mnJPEGQuality, mbRemoveCropArea, mnImageResolution, mbEmbedLinkedGraphics );
- GraphicCollector::CollectGraphics( mxMSF, mxModel, aGraphicSettings, aGraphicList );
- CompressGraphics( *this, mxMSF, aGraphicSettings, aGraphicList );
+ GraphicCollector::CollectGraphics( mxContext, mxModel, aGraphicSettings, aGraphicList );
+ CompressGraphics( *this, mxContext, aGraphicSettings, aGraphicList );
}
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 100 ) ) );
DispatchStatus();
@@ -612,10 +613,12 @@ static void DispatchURL( Reference< XCom
sal_Bool ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments )
{
+ OSL_TRACE("ImpOptimizer::Optimize");
sal_Bool bRet = sal_True;
if ( mxModel.is() )
{
+ Reference< XWindowPeer > xParentWindow;
sal_Int64 nEstimatedFileSize = 0;
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 0 ) ) );
DispatchStatus();
@@ -625,8 +628,8 @@ sal_Bool ImpOptimizer::Optimize( const S
{
switch( TKGet( rArguments[ i ].Name ) )
{
- case TK_StatusDispatcher : rArguments[ i ].Value >>= mxStatusDispatcher; break;
- case TK_InformationDialog: rArguments[ i ].Value >>= mxInformationDialog; break;
+ case TK_StatusListener : rArguments[ i ].Value >>= mxStatusListener; break;
+ case TK_ParentWindow: rArguments[ i ].Value >>= xParentWindow; break;
case TK_Settings :
{
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aSettings;
@@ -668,7 +671,7 @@ sal_Bool ImpOptimizer::Optimize( const S
{
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 10 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_DUPLICATING_PRESENTATION ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_DUPLICATING_PRESENTATION ) ) );
DispatchStatus();
Reference< XStorable >xStorable( mxModel, UNO_QUERY );
@@ -690,11 +693,11 @@ sal_Bool ImpOptimizer::Optimize( const S
nSourceSize = PPPOptimizer::GetFileSize( maSaveAsURL );
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 30 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_DUPLICATING_PRESENTATION ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_DUPLICATING_PRESENTATION ) ) );
DispatchStatus();
- Reference< XDesktop > xDesktop( mxMSF->getServiceManager()->createInstanceWithContext(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ), mxMSF ), UNO_QUERY );
+ Reference< XDesktop > xDesktop( mxContext->getServiceManager()->createInstanceWithContext(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ), mxContext ), UNO_QUERY );
Reference< XFrame > xFrame( xDesktop, UNO_QUERY );
xSelf = xFrame->findFrame( TKGet( TK__blank ), FrameSearchFlag::CREATE );
Reference< XComponentLoader > xComponentLoader( xSelf, UNO_QUERY );
@@ -712,15 +715,15 @@ sal_Bool ImpOptimizer::Optimize( const S
if ( xStorable.is() && !xStorable->isReadonly() )
{
mxModel->lockControllers();
- bRet = Optimize();
+ bRet = ImplOptimize();
mxModel->unlockControllers();
// clearing undo stack:
- Reference< XFrame > xFrame( xSelf.is() ? xSelf : mxInformationDialog );
+ Reference< XFrame > xFrame( mxFrame );
if ( xFrame.is() )
{
const OUString sSlot( RTL_CONSTASCII_USTRINGPARAM( "slot:27115" ) );
- DispatchURL( mxMSF, sSlot, xFrame );
+ DispatchURL( mxContext, sSlot, xFrame );
}
}
@@ -733,9 +736,11 @@ sal_Bool ImpOptimizer::Optimize( const S
}
}
- if ( mxInformationDialog.is() )
+ if ( xParentWindow.is() )
{
- InformationDialog aInformationDialog( mxMSF, mxInformationDialog, maSaveAsURL, mbOpenNewDocument, nSourceSize, nDestSize, nEstimatedFileSize );
+ InformationDialog aInformationDialog(
+ mxContext, xParentWindow, maSaveAsURL, mbOpenNewDocument,
+ nSourceSize, nDestSize, nEstimatedFileSize );
aInformationDialog.execute();
SetStatusValue( TK_OpenNewDocument, Any( mbOpenNewDocument ) );
DispatchStatus();
Modified: openoffice/trunk/main/sdext/source/minimizer/impoptimizer.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/impoptimizer.hxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/impoptimizer.hxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/impoptimizer.hxx Fri Mar 15 23:19:19 2013
@@ -35,6 +35,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#endif
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
class Point;
class Size;
@@ -47,9 +48,9 @@ class ImpOptimizer : public Optimization
{
private:
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel;
- com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > mxStatusDispatcher;
+ com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener > mxStatusListener;
sal_Bool mbJPEGCompression;
sal_Int32 mnJPEGQuality;
@@ -66,9 +67,9 @@ private:
rtl::OUString maFilterName;
sal_Bool mbOpenNewDocument;
- com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxInformationDialog;
+ com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame;
- sal_Bool Optimize();
+ sal_Bool ImplOptimize();
public: