From cd3135ff156542afdf8c1ab0b4484381184b3ce1 Mon Sep 17 00:00:00 2001 From: Ariel Constenla-Haile Date: Mon, 4 Mar 2013 21:29:36 -0300 Subject: [PATCH] i121872 - Integrate the Presentation Minimizer --- main/configure.in | 14 +- main/default_images/minimizer/opt_16.png | Bin 4033 -> 0 bytes main/default_images/minimizer/opt_16_h.png | Bin 3683 -> 0 bytes main/default_images/minimizer/opt_26.png | Bin 4401 -> 0 bytes main/default_images/minimizer/opt_26_h.png | Bin 3845 -> 0 bytes .../commandimagelist/lc_presentationminimizer.png | Bin 0 -> 4401 bytes .../commandimagelist/lch_presentationminimizer.png | Bin 0 -> 3845 bytes .../commandimagelist/sc_presentationminimizer.png | Bin 0 -> 4033 bytes .../commandimagelist/sch_presentationminimizer.png | Bin 0 -> 3683 bytes main/extensions.lst | 6 - main/helpcontent2/prj/build.lst | 19 +- main/helpcontent2/source/text/simpress/makefile.mk | 2 +- .../source/text/simpress/minimizer/infobox.xhp | 44 ++ .../source/text/simpress/minimizer/main.xhp | 77 ++++ .../source/text/simpress/minimizer/makefile.mk | 56 +++ .../source/text/simpress/minimizer/shared.xhp | 37 ++ .../source/text/simpress/minimizer/step1.xhp | 52 +++ .../source/text/simpress/minimizer/step2.xhp | 62 +++ .../source/text/simpress/minimizer/step3.xhp | 67 +++ .../source/text/simpress/minimizer/step4.xhp | 55 +++ .../source/text/simpress/minimizer/step5.xhp | 56 +++ main/helpcontent2/util/simpress/makefile.mk | 7 + .../data/org/openoffice/Office/Impress.xcu | 170 ++++++++ .../openoffice/Office/UI/DrawImpressCommands.xcu | 8 + .../schema/org/openoffice/Office/Impress.xcs | 127 ++++++ main/postprocess/packcomponents/makefile.mk | 3 +- main/postprocess/prj/build.lst | 2 +- main/scp2/source/ooo/file_library_ooo.scp | 13 + main/scp2/source/ooo/file_resource_ooo.scp | 2 + main/scp2/source/ooo/module_hidden_ooo.scp | 1 + main/scp2/source/ooo/module_lang_template.scp | 3 +- main/sd/inc/app.hrc | 1 + main/sd/sdi/drviewsh.sdi | 5 + main/sd/sdi/sdraw.sdi | 25 ++ main/sd/source/ui/view/drviewse.cxx | 30 ++ main/sd/uiconfig/simpress/menubar/menubar.xml | 1 + main/sdext/prj/build.lst | 4 +- main/sdext/prj/d.lst | 26 +- .../minimizer/PresentationMinimizer.component | 30 ++ .../sdext/source/minimizer/configurationaccess.cxx | 198 +++++++--- .../sdext/source/minimizer/configurationaccess.hxx | 18 +- main/sdext/source/minimizer/delzip | 1 - main/sdext/source/minimizer/description.xml | 58 --- main/sdext/source/minimizer/fileopendialog.cxx | 36 ++- main/sdext/source/minimizer/fileopendialog.hxx | 6 +- main/sdext/source/minimizer/graphiccollector.cxx | 61 ++-- main/sdext/source/minimizer/graphiccollector.hxx | 6 +- main/sdext/source/minimizer/help/component.txt | 2 - main/sdext/source/minimizer/help/help_de.odt | Bin 8987 -> 0 bytes main/sdext/source/minimizer/help/help_en-US.odt | Bin 8987 -> 0 bytes main/sdext/source/minimizer/helpid.hrc | 57 +++ main/sdext/source/minimizer/impoptimizer.cxx | 93 +++-- main/sdext/source/minimizer/impoptimizer.hxx | 9 +- main/sdext/source/minimizer/informationdialog.cxx | 225 +++++++---- main/sdext/source/minimizer/informationdialog.hxx | 83 +++-- main/sdext/source/minimizer/makefile.mk | 158 +++----- main/sdext/source/minimizer/manifest.xml | 36 -- main/sdext/source/minimizer/minimizer.hrc | 95 +++++ main/sdext/source/minimizer/minimizer.pmk | 24 -- main/sdext/source/minimizer/minimizer.src | 379 +++++++++++++++++ main/sdext/source/minimizer/optimizationstats.cxx | 3 +- main/sdext/source/minimizer/optimizerdialog.cxx | 438 +++++++++----------- main/sdext/source/minimizer/optimizerdialog.hxx | 260 +++++------- .../source/minimizer/optimizerdialogcontrols.cxx | 289 ++++++++----- main/sdext/source/minimizer/pagecollector.cxx | 3 +- main/sdext/source/minimizer/pppoptimizer.cxx | 16 +- main/sdext/source/minimizer/pppoptimizer.hxx | 4 +- main/sdext/source/minimizer/pppoptimizerdialog.cxx | 204 +++++----- main/sdext/source/minimizer/pppoptimizerdialog.hxx | 51 +-- main/sdext/source/minimizer/pppoptimizertoken.cxx | 15 +- main/sdext/source/minimizer/pppoptimizertoken.hxx | 13 +- main/sdext/source/minimizer/pppoptimizeruno.cxx | 124 ++---- .../registry/data/org/openoffice/Office/Addons.xcu | 86 ---- .../data/org/openoffice/Office/ProtocolHandler.xcu | 31 -- .../Office/extension/SunPresentationMinimizer.xcu | 404 ------------------ .../org/openoffice/Office/extension/makefile.mk | 46 -- .../data/org/openoffice/Office/makefile.mk | 44 -- .../Office/extension/SunPresentationMinimizer.xcs | 346 ---------------- main/sdext/source/minimizer/unodialog.cxx | 119 ++++-- main/sdext/source/minimizer/unodialog.hxx | 46 +-- main/set_soenv.in | 1 - 81 files changed, 2793 insertions(+), 2300 deletions(-) delete mode 100644 main/default_images/minimizer/opt_16.png delete mode 100644 main/default_images/minimizer/opt_16_h.png delete mode 100644 main/default_images/minimizer/opt_26.png delete mode 100644 main/default_images/minimizer/opt_26_h.png create mode 100644 main/default_images/res/commandimagelist/lc_presentationminimizer.png create mode 100644 main/default_images/res/commandimagelist/lch_presentationminimizer.png create mode 100644 main/default_images/res/commandimagelist/sc_presentationminimizer.png create mode 100644 main/default_images/res/commandimagelist/sch_presentationminimizer.png create mode 100644 main/helpcontent2/source/text/simpress/minimizer/infobox.xhp create mode 100644 main/helpcontent2/source/text/simpress/minimizer/main.xhp create mode 100644 main/helpcontent2/source/text/simpress/minimizer/makefile.mk create mode 100644 main/helpcontent2/source/text/simpress/minimizer/shared.xhp create mode 100644 main/helpcontent2/source/text/simpress/minimizer/step1.xhp create mode 100644 main/helpcontent2/source/text/simpress/minimizer/step2.xhp create mode 100644 main/helpcontent2/source/text/simpress/minimizer/step3.xhp create mode 100644 main/helpcontent2/source/text/simpress/minimizer/step4.xhp create mode 100644 main/helpcontent2/source/text/simpress/minimizer/step5.xhp create mode 100644 main/sdext/source/minimizer/PresentationMinimizer.component delete mode 100644 main/sdext/source/minimizer/delzip delete mode 100644 main/sdext/source/minimizer/description.xml delete mode 100644 main/sdext/source/minimizer/help/component.txt delete mode 100644 main/sdext/source/minimizer/help/help_de.odt delete mode 100644 main/sdext/source/minimizer/help/help_en-US.odt create mode 100644 main/sdext/source/minimizer/helpid.hrc delete mode 100644 main/sdext/source/minimizer/manifest.xml create mode 100644 main/sdext/source/minimizer/minimizer.hrc delete mode 100644 main/sdext/source/minimizer/minimizer.pmk create mode 100644 main/sdext/source/minimizer/minimizer.src delete mode 100644 main/sdext/source/minimizer/registry/data/org/openoffice/Office/Addons.xcu delete mode 100644 main/sdext/source/minimizer/registry/data/org/openoffice/Office/ProtocolHandler.xcu delete mode 100644 main/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu delete mode 100644 main/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/makefile.mk delete mode 100644 main/sdext/source/minimizer/registry/data/org/openoffice/Office/makefile.mk delete mode 100644 main/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs diff --git a/main/configure.in b/main/configure.in index 08361e0..1f22d77 100644 --- a/main/configure.in +++ b/main/configure.in @@ -519,9 +519,6 @@ AC_ARG_WITH(beanshell-jar, [ --with-beanshell-jar=JARFILE Specify path to jarfile manually ], [ BSH_JAR="$withval" ]) -AC_ARG_ENABLE(minimizer, -[ --enable-minimizer enables the build of the Presentation Minimizer extension -],,) AC_ARG_ENABLE(presenter-screen, [ --enable-presenter-screen enables the build of the Presenter Screen extension ],,) @@ -6413,15 +6410,6 @@ fi AC_SUBST(ENABLE_OPENGL) -AC_MSG_CHECKING([whether to build the Presentation Minimizer extension]) -if test -n "$enable_minimizer" -a "$enable_minimizer" != "no"; then - AC_MSG_RESULT([yes]) - ENABLE_MINIMIZER=YES -else - AC_MSG_RESULT([no]) - ENABLE_MINIMIZER=NO -fi -AC_SUBST(ENABLE_MINIMIZER) AC_MSG_CHECKING([whether to build the Presenter Screen extension]) if test -n "$enable_presenter_screen" -a "$enable_presenter_screen" != "no"; then @@ -6461,7 +6449,7 @@ AC_SUBST(SYSTEM_POPPLER) AC_SUBST(POPPLER_CFLAGS) AC_SUBST(POPPLER_LIBS) -if test "$ENABLE_PRESENTER_SCREEN" = "YES" -o "$ENABLE_MINIMIZER" = "YES" -o "$ENABLE_PDFIMPORT" = "YES"; then +if test "$ENABLE_PRESENTER_SCREEN" = "YES" -o "$ENABLE_PDFIMPORT" = "YES"; then AC_MSG_CHECKING([for sdext module]) if test -d ./sdext; then AC_MSG_RESULT([OK]) diff --git a/main/default_images/minimizer/opt_16.png b/main/default_images/minimizer/opt_16.png deleted file mode 100644 index 97620000059338cc40c843b7cac25922e36ab683..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4033 zcmeHKeM}Q)7%yK15d>q@DqFao6OBsmD4_Os1-k;$L|6wnNHEju-O+Yjd-d*REhJ9F z@2{wdo5W3l%x!K?W45?VoQjV56&cywoN;r0i<_J1I)cuR+uQ30B@@Gv`5#T%r|&(_ z@Atg#?|t4U_pUY<&rXaVAFog-5>179CD11OzHv(Uo9dM)XvTs33Q)>d0XHSE3IoGi zSj6O@tZWHOF|`X%vLpo0vX@nWilR9L%{w%dFGk~WxFA}gAagw~imqk>VqvXzrylJ- za2Q4Gj2Adn7@^r#I07lC1Jw_D@R)bN58%h2g`7_P;%+H@F^F4j5$ zwYeyNN+JO?x|IjeZN%=^dK4UCZQ0Td$ykHNqFMmwk-*joZShg<^#u$yU~ zfo1A1;3tp+VIcA{mMiB4*h8L(&391tr}^g!L9bj8q+D8I4FK+j{~2s7u%}_6rWUBC zK>vAGMpo-tkq3E)k_43)lpT_5P%;IBhU5w=F(^AE*Pvty1`Wv-RANweNUlN26byQr zT=9L^BGw7tkKORnv+UcH>k38WSW}*%%yZsyty=e}DI)d@^{ua)?|M?!J-AKpTaCAl zPfKpur9O4%Y+8e%z@S>!8?A||ejB)B&crrsIg(Aze_@41{T}znCTVQqQC0N%{iX`)1NSVe~G&@m%-PgvjTnC5+_{wYp0tnujqrz1t3q+f%5iiB7rmp#IOrV`2)F z$`MnQD^icE9+USvk$KnK?o?iAqGq2Oquij&aYY^O@W$+~H)wB zuID!dbS+63dFk@~`4`XqHGkEHB+UqM*SAjGMBn8Q-vp{Snl<9W2Cv9v@x?Xnvn?+6F0@JHQ}F}-@8fOesM#~ zj!)OLe0XrZTK!qFCh7aw)ywaDyN;_@Mzo5Z@9Mlw+m^@t{(N%c@WSStLe=T5*;9v= zmmNvCJAAFwdGtiw^ys{$3Ug|E{jgDK*B(xate+P-N05Gcv9&GBd~xx{R}wlpI_5Uz zEV^PvB7Z)#sM2!v*!qQ~9~9FkPJYv{EaD?o+`1*I_QsQOqmgmAR@;zJt4v;?@UD3{ VVb;i&*L;_1Q+{#Yo|hIh`~%`_xuyUB diff --git a/main/default_images/minimizer/opt_16_h.png b/main/default_images/minimizer/opt_16_h.png deleted file mode 100644 index 7b7e85083c19a44763afcc92fe7e09ecf93acf91..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3683 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 diff --git a/main/default_images/minimizer/opt_26_h.png b/main/default_images/minimizer/opt_26_h.png deleted file mode 100644 index 924ad50b71eec39fd4747599aca6dfd70293833d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3845 zcmeHKe@qis94{`2VLB$_RJLT7Ba=mG@7e;|%T?{#0^MjOr3@A{dfYwQ3vI95J=Oy= z9gM^ffh-QETb5;u&P8Gz!(}cL6@O$u!ZJ3UE|WQzfSQc?EGwTD@Zu9uqwkFoX;hQ&Q(=vq!LI5(D914adO19!E zFNOXqj|m)8Ltv8?k4>u1U4_{N5n#mzlfk5C$x<^`Vm6pdOr@scBFsdR8wqj)VJ7v) zjTBiz6&tbm2j7&9(IVGKc^zf(bZBJ70}w_if`~?=hN#&fhIGF~a1zK?&`LQ@T$0oQVEn-k*=2!v*K?sDQL>LW5 zA~_x@;pP1SC?#NFDXucon~<3Zf{=u$#>_!R0s<7IfDoAsQMMKs5Jag; zka$H(r{s^$!$Rx8^wk}UeTEfGGV_Jm-QTIWLkm{C*lY~*%b{!6LSd_ zepUnw6vU(i)u4H9f;n88SLI3uD`b#|L6AhHC5~6if1c|sA3dvNjfBpl4~QY@|H`x= zH=VrilszVuT|no6g|2X;pqBaE7~aN-P8l+ss2ziU`|UhzUD)eIokOjG1=y=tfkR~) zE8uy^p|}va4+Luk5%rLHvCa^~Kg?evYF@P*nIN!p_gsqMQmvwZT)!b;EwUbIj^-(ciz4>^wn;6?>iHZ z^=B^0t6X%cxun3(9RbXF8{W}&@wu*nwTIjH4BmE@p185JZ`}oB22-$dP@#-)6zE8IqhRb)qG5$ryOWn@9StFl48#(av@yEXz{HcH6B&1g#{rt?R{q0jn zujg!dWzRuuYJGVBgAV)o>c*Qr;}utmm)|Jlo|*XzFS|3c3U1E|ja{Hef4z2cpMP>% zBI#h0f8vllV!pDTo9Eh`2GF+$6;^RA+~I^b9ryayqflJOB3~h1IoqJ<@7jCys)$5AHk7hSO5S3 diff --git a/main/default_images/res/commandimagelist/lc_presentationminimizer.png b/main/default_images/res/commandimagelist/lc_presentationminimizer.png new file mode 100644 index 0000000000000000000000000000000000000000..7dba57b6ddcba8d29ca60fadbe3de23722cd48a3 GIT binary patch literal 4401 zcmeHLYfuwc6pp3!0b_mCN1&yq3skTs8v;R+31|pWphhU5AQkJ9U6O^(ZrI&Ou(tRh zN>z#)Y0;Fb6)aW|jdoCrj}9^j_TjTWingLqXv^@hMWsl)*(3;4?a-O_ADP*ly?f60 zoqNA~?wM@fi&-#ltgDABhr<~g84(`KSP$DZdL;9`FKYfbjB%%xiF6#1N@qeO!jZ#7 z3c`!jK^i0$f#9r+Iz+~R=b-V4bfRj$R88mvkS#`F)ae;Cha;P9)I;iYgyy9n8Wax! z+P^pj@K87eND!-pD!l^Hq7f@dByPomc=d{OwFCxchq}s)Qiec>&=Ak4!*EJ!3;|eP zDRXao3<5khgia3u?2}4V#qbmaiSPmiB7umn76t|I!~uc;u_#CsIFlz53WGu6EHFUG z_Yal|#nM23p5p_Ay7FWsoGOhCpX*4+j6wh{P3xr~n3Afo>3we)o5v|ABIy7l^MN3Bcx{_LXc!*1|juYf+i>}p?@;6-_7C&ri|3n z>Ody1P0)TUvnn+^S&D|ife|d6-6wnY{s~J}5SflJdp#GzD1=S$*q4B$#L*DVF4`eb z|AeG+1Fa=UDu$p?o0N>-rZ7(itEKjJvO~M%a*Vc*>_ZH-=`6({ToVEq`7n|S888|E z9SG32D^7?E9875ASCa@t6XbvdaY)AC1cSJoUY2Vh*hWU9G=>bIawc|E%fFuMV?Nnq zB^Of6d5lL$9ra&jdMdYU;J!;0cBvEua}LyWB%VsJWj;6tmBXacNJB8`JO+RFD^NP? z>E2kTbFek=6!sW30W)Q4FW@JT)8y00;}I-@AekQWM66N=q5tGxNIJc2LCDzB8qffk z-LOAn8Vl3Y!2YJ@s3u4M`M(US*8fHBA=zQMh9r|S=%3_ref(O4;LPviOy;F0=faCk9FEKS$Z&bQ@kZIAy?=;Nc$9MA2;QXhVJPITBKJZOeTSoSO>I&yLH%$D^^ zcgf6>*?F+&> zO465Z{-w5{vGPLxolYNOa@^MGp1&SiIjTc8GOWw*<%kPtl(H?!Mg7~wEzcYZ*lFmS zQd=&mdNZsmtM(PweM^eHtymd+I;RCs-4s8i>c`?WyUvx#k5s&b>er$(*zG z@fN&s-Dh4)K5nb6_y6tkmgvs0lm9qadT@NZxUz8PAjleI>2Qbd7MY{<8Uy zWwX#5ulzova_Kbh0FS(2#hx#ZzJ2-f<(%xo*;(zMhBh2I92lImvl6;}Ai414?WX;U zDj;hsigK^kX))|>@#h*)Z(a3VL>Pb0UeI^6*QMg(-lDRTCtu#(GO8h4 zYuZpBRk))tH``}M!;W!3MSHqgj%4>u>|64Z=eK6F`BK2$&X#qdhUew>qH zwCI%+xM>SIJ`eO8QJnLvKCibiczfdXF$a&$n@hic>%QE&_R1BZa%&&YT(y*lc>})g zi*k=a(FZ?DDY`rE`*(X*9-kIc#1G2;F-A3(TVH>EBX^}KLh#{hsV;sfEOB}DJD<+# zi_v>yeCbCwJ^AHPKE5@j{vNx_il3b~qHsPL{8Cd*O$|z(@{Bbpb1-1vf%a<42MIGK zm&ON`inq@Jagt}v?s47F?ZK_Yq_f(1|_|{+wHW@x;pRQf2v~wLPl! xy%oEHC!754<%>6Pv$yIRg=YY-^gsEhIr2Qiw&XiY`)q$=L@F1A9|&8v<}W@sgCGC^ literal 0 HcmV?d00001 diff --git a/main/default_images/res/commandimagelist/lch_presentationminimizer.png b/main/default_images/res/commandimagelist/lch_presentationminimizer.png new file mode 100644 index 0000000000000000000000000000000000000000..924ad50b71eec39fd4747599aca6dfd70293833d GIT binary patch literal 3845 zcmeHKe@qis94{`2VLB$_RJLT7Ba=mG@7e;|%T?{#0^MjOr3@A{dfYwQ3vI95J=Oy= z9gM^ffh-QETb5;u&P8Gz!(}cL6@O$u!ZJ3UE|WQzfSQc?EGwTD@Zu9uqwkFoX;hQ&Q(=vq!LI5(D914adO19!E zFNOXqj|m)8Ltv8?k4>u1U4_{N5n#mzlfk5C$x<^`Vm6pdOr@scBFsdR8wqj)VJ7v) zjTBiz6&tbm2j7&9(IVGKc^zf(bZBJ70}w_if`~?=hN#&fhIGF~a1zK?&`LQ@T$0oQVEn-k*=2!v*K?sDQL>LW5 zA~_x@;pP1SC?#NFDXucon~<3Zf{=u$#>_!R0s<7IfDoAsQMMKs5Jag; zka$H(r{s^$!$Rx8^wk}UeTEfGGV_Jm-QTIWLkm{C*lY~*%b{!6LSd_ zepUnw6vU(i)u4H9f;n88SLI3uD`b#|L6AhHC5~6if1c|sA3dvNjfBpl4~QY@|H`x= zH=VrilszVuT|no6g|2X;pqBaE7~aN-P8l+ss2ziU`|UhzUD)eIokOjG1=y=tfkR~) zE8uy^p|}va4+Luk5%rLHvCa^~Kg?evYF@P*nIN!p_gsqMQmvwZT)!b;EwUbIj^-(ciz4>^wn;6?>iHZ z^=B^0t6X%cxun3(9RbXF8{W}&@wu*nwTIjH4BmE@p185JZ`}oB22-$dP@#-)6zE8IqhRb)qG5$ryOWn@9StFl48#(av@yEXz{HcH6B&1g#{rt?R{q0jn zujg!dWzRuuYJGVBgAV)o>c*Qr;}utmm)|Jlo|*XzFS|3c3U1E|ja{Hef4z2cpMP>% zBI#h0f8vllV!pDTo9Eh`2GF+$6;^RA+~I^b9ryayqflJOB3~h1IoqJ<@7jCys)$5AHk7hSO5S3 literal 0 HcmV?d00001 diff --git a/main/default_images/res/commandimagelist/sc_presentationminimizer.png b/main/default_images/res/commandimagelist/sc_presentationminimizer.png new file mode 100644 index 0000000000000000000000000000000000000000..97620000059338cc40c843b7cac25922e36ab683 GIT binary patch literal 4033 zcmeHKeM}Q)7%yK15d>q@DqFao6OBsmD4_Os1-k;$L|6wnNHEju-O+Yjd-d*REhJ9F z@2{wdo5W3l%x!K?W45?VoQjV56&cywoN;r0i<_J1I)cuR+uQ30B@@Gv`5#T%r|&(_ z@Atg#?|t4U_pUY<&rXaVAFog-5>179CD11OzHv(Uo9dM)XvTs33Q)>d0XHSE3IoGi zSj6O@tZWHOF|`X%vLpo0vX@nWilR9L%{w%dFGk~WxFA}gAagw~imqk>VqvXzrylJ- za2Q4Gj2Adn7@^r#I07lC1Jw_D@R)bN58%h2g`7_P;%+H@F^F4j5$ zwYeyNN+JO?x|IjeZN%=^dK4UCZQ0Td$ykHNqFMmwk-*joZShg<^#u$yU~ zfo1A1;3tp+VIcA{mMiB4*h8L(&391tr}^g!L9bj8q+D8I4FK+j{~2s7u%}_6rWUBC zK>vAGMpo-tkq3E)k_43)lpT_5P%;IBhU5w=F(^AE*Pvty1`Wv-RANweNUlN26byQr zT=9L^BGw7tkKORnv+UcH>k38WSW}*%%yZsyty=e}DI)d@^{ua)?|M?!J-AKpTaCAl zPfKpur9O4%Y+8e%z@S>!8?A||ejB)B&crrsIg(Aze_@41{T}znCTVQqQC0N%{iX`)1NSVe~G&@m%-PgvjTnC5+_{wYp0tnujqrz1t3q+f%5iiB7rmp#IOrV`2)F z$`MnQD^icE9+USvk$KnK?o?iAqGq2Oquij&aYY^O@W$+~H)wB zuID!dbS+63dFk@~`4`XqHGkEHB+UqM*SAjGMBn8Q-vp{Snl<9W2Cv9v@x?Xnvn?+6F0@JHQ}F}-@8fOesM#~ zj!)OLe0XrZTK!qFCh7aw)ywaDyN;_@Mzo5Z@9Mlw+m^@t{(N%c@WSStLe=T5*;9v= zmmNvCJAAFwdGtiw^ys{$3Ug|E{jgDK*B(xate+P-N05Gcv9&GBd~xx{R}wlpI_5Uz zEV^PvB7Z)#sM2!v*!qQ~9~9FkPJYv{EaD?o+`1*I_QsQOqmgmAR@;zJt4v;?@UD3{ VVb;i&*L;_1Q+{#Yo|hIh`~%`_xuyUB literal 0 HcmV?d00001 diff --git a/main/default_images/res/commandimagelist/sch_presentationminimizer.png b/main/default_images/res/commandimagelist/sch_presentationminimizer.png new file mode 100644 index 0000000000000000000000000000000000000000..7b7e85083c19a44763afcc92fe7e09ecf93acf91 GIT binary patch literal 3683 zcmeHKUx*t;7~j71PoQd{Al8R2YZVSnW|Lgb-ga|$X_7X%Hs>{$azO>1?9L@ic6at> z=g8hsrJjATV1-g2w6@YWK}7sRD^~@55$TK27pp$Coc10RPLx6wtOnj^Z$tSSKM$Ur8wK|B@*o$*YGvQ}?UyA3n# zKxL*kaG=E?A|PH&7t(5AitPrr)bS8+i%VeAB2lMIrST9SGE(kd&FD4NUAwY-_HR%&z>-2`c ziK3cVgz zC)g#U8r4w;RhT%amj680H9mPw$)h$qj}=4=`~S+cA-CMQ?^4#6DvQ}UP-xMd!Cskn z$7mUq|AblDW)3YF-|_T}nHrZDJkaz)mzMaX3D$1Qg0IdS#jAK8UzshG=DobO*R zpWN{UzxCybn~lqFo_}?G$Jbl_unulIRLh-yg&)#Kx9#3_{f)Q2`g8OBOV_S#8$X>t z_0i+|?pqo-TlnDoScd2Bl%G4Yc)Pmg(&e2m&Hixq#x40&U8aAo + + + + + Presentation Minimizer - Result + /text/simpress/minimizer/infobox.xhp + + + +
+ + + Presentation Minimizer - Result + Shows the result of the optimization process. +
+ + + + Open the copy of this presentation where the changes where applied. + + Go to Presentation Minimizer Wizard + + +
diff --git a/main/helpcontent2/source/text/simpress/minimizer/main.xhp b/main/helpcontent2/source/text/simpress/minimizer/main.xhp new file mode 100644 index 0000000..813e461 --- /dev/null +++ b/main/helpcontent2/source/text/simpress/minimizer/main.xhp @@ -0,0 +1,77 @@ + + + + + + Presentation Minimizer + /text/simpress/minimizer/main.xhp + + + + + + presentations; optimize file size + Presentation Minimizer + + + Presentation Minimizer + Opens the Presentation Minimizer wizards, where you can optimize the size of %PRODUCTNAME Impress files, by compresing large images, reducing cropped areas, removing unused master pages, etc. + +
+ +
+ + The Presentation Minimizer is used to reduce the file size of the current presentation. Images will be compressed and data, that is no longer needed, will be removed. + At the last step of the wizard you can choose to apply the changes to the current presentation or to create an optimized new version of the presentation. + + + + + + + + + + + Help + Open the Online Help for this Wizard. + + + Back + Returns to the selections made on the previous page. The current settings remain in effect. This button only becomes active after the first page. + + + Next + The wizard saves the current settings and goes to the next page. Once you reach the last page, this button will become inactive. + + + Finish + According to your selections, the wizard creates a document template and saves it on your hard disk. A new document based on the template appears in the work area, with the filename "UntitledX" (X stands for an automatic number). + + + + $[officename] saves the current settings in the wizard according to the selected document template. These will be used as the default settings the next time you activate the wizard. + + + Dialog ID here, below any <avis> tags (else the tagged text will be shown on the buttons) + +
diff --git a/main/helpcontent2/source/text/simpress/minimizer/makefile.mk b/main/helpcontent2/source/text/simpress/minimizer/makefile.mk new file mode 100644 index 0000000..60918c6 --- /dev/null +++ b/main/helpcontent2/source/text/simpress/minimizer/makefile.mk @@ -0,0 +1,56 @@ +#************************************************************** +# +# 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. +# +#************************************************************** + + + +# edit to match directory level +PRJ=..$/..$/..$/.. +# same for all makefiles in "helpcontent2" +PRJNAME = helpcontent2 +# edit to match the current package +PACKAGE = text/simpress/minimizer +# uniqe name (module wide); +# using a modified form of package should do here +TARGET = text_simpress_minimizer +# edit to match the current module +MODULE = simpress + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/settings.pmk + +# this list matches the *.xhp files to process +XHPFILES = \ + main.xhp \ + step1.xhp \ + step2.xhp \ + step3.xhp \ + step4.xhp \ + step5.xhp \ + infobox.xhp \ + shared.xhp \ + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk +.INCLUDE : tg_help.mk diff --git a/main/helpcontent2/source/text/simpress/minimizer/shared.xhp b/main/helpcontent2/source/text/simpress/minimizer/shared.xhp new file mode 100644 index 0000000..e2920dc --- /dev/null +++ b/main/helpcontent2/source/text/simpress/minimizer/shared.xhp @@ -0,0 +1,37 @@ + + + + + + Shared content for the Presentation Minimizer Wizard + /text/simpress/minimizer/shared.xhp + + + + Choose Tools - Presentation Minimizer... + Choose Tools - Presentation Minimizer... - Introduction + Choose Tools - Presentation Minimizer... - Slides + Choose Tools - Presentation Minimizer... - Graphics + Choose Tools - Presentation Minimizer... - OLE Objects + Choose Tools - Presentation Minimizer... - Summary + + diff --git a/main/helpcontent2/source/text/simpress/minimizer/step1.xhp b/main/helpcontent2/source/text/simpress/minimizer/step1.xhp new file mode 100644 index 0000000..b11c897 --- /dev/null +++ b/main/helpcontent2/source/text/simpress/minimizer/step1.xhp @@ -0,0 +1,52 @@ + + + + + + Presentation Minimizer - Introduction + /text/simpress/minimizer/step1.xhp + + + +
+ + Presentation Minimizer - Introduction + In this step you can select the settings of the wizard that you have stored previously. +
+
+ +
+ + + + Choose settings for Presentation Minimizer + This list box contains a list of all available wizard settings. Choose one to apply the settings to the wizard options. + + + Delete + Delete the wizard settings currently selected on the list box. + + + Go to Presentation Minimizer - Slides + + +
diff --git a/main/helpcontent2/source/text/simpress/minimizer/step2.xhp b/main/helpcontent2/source/text/simpress/minimizer/step2.xhp new file mode 100644 index 0000000..87e1284 --- /dev/null +++ b/main/helpcontent2/source/text/simpress/minimizer/step2.xhp @@ -0,0 +1,62 @@ + + + + + + Presentation Minimizer - Slides + /text/simpress/minimizer/step2.xhp + + + +
+ + + Presentation Minimizer - Slides + Choose which slides to delete. +
+
+ +
+ + + Delete unused master pages + Delete unused master pages. + + + Delete hidden slides + Delete hidden slides. + + + Delete slides that are not used for the custom slide show + Delete slides that are not used for the custom slide show. + + + This list box displays all slides that are not used in the custom slide show. + + + Clear notes + Clear the contents of all notes. + + Go to Presentation Minimizer - Graphics + + +
diff --git a/main/helpcontent2/source/text/simpress/minimizer/step3.xhp b/main/helpcontent2/source/text/simpress/minimizer/step3.xhp new file mode 100644 index 0000000..b2d75b8 --- /dev/null +++ b/main/helpcontent2/source/text/simpress/minimizer/step3.xhp @@ -0,0 +1,67 @@ + + + + + + Presentation Minimizer - Graphics + /text/simpress/minimizer/step3.xhp + + + +
+ + + Presentation Minimizer - Graphics + Choose settings for optimizing pictures and graphics. +
+
+ +
+ + + Lossless compression + Lossless compression. + + + JPEG compression + Compress JPEG graphics. + + + Quality in percent + Specify the quality of the compression. A higher value means less compression. + + + Reduce image resolution + Specify the image resolution in DPI (dots per inch). + + + Delete cropped graphic areas + Delete cropped graphic areas from the graphics. + + + Break links to external graphics + Break all links to external graphics. + + Go to Presentation Minimizer - OLE Objects + + +
diff --git a/main/helpcontent2/source/text/simpress/minimizer/step4.xhp b/main/helpcontent2/source/text/simpress/minimizer/step4.xhp new file mode 100644 index 0000000..c854bde --- /dev/null +++ b/main/helpcontent2/source/text/simpress/minimizer/step4.xhp @@ -0,0 +1,55 @@ + + + + + + Presentation Minimizer - OLE Objects + /text/simpress/minimizer/step4.xhp + + + +
+ + + Presentation Minimizer - OLE Objects + Choose settings for replacing OLE objects. +
+
+ +
+ + + Create static replacement graphics for OLE objects + Replace OLE object with a static graphic. + + + For all OLE objects + Replace all OLE objects with a static graphic. + + + For OLE objects not based on OpenDocument format + Replace only OLE objects not based on the Open Document Format used by %PRODUCTNAME. + + Go to Presentation Minimizer - Summary + + +
diff --git a/main/helpcontent2/source/text/simpress/minimizer/step5.xhp b/main/helpcontent2/source/text/simpress/minimizer/step5.xhp new file mode 100644 index 0000000..917864a --- /dev/null +++ b/main/helpcontent2/source/text/simpress/minimizer/step5.xhp @@ -0,0 +1,56 @@ + + + + + + Presentation Minimizer - Summary + /text/simpress/minimizer/step5.xhp + + + +
+ + + Presentation Minimizer - Summary + Choose where to apply the following changes. +
+
+ +
+ + + Apply changes to current presentation + Apply the changes to the current presentation. + + + Duplicate presentation before applying changes + Create a copy of the current presentation, and apply the changes only to this copy. + + + Save settings as + Apply the changes to the current presentation. + + + Enter the name of the settings to be stored. + Go to Presentation Minimizer Wizard + +
diff --git a/main/helpcontent2/util/simpress/makefile.mk b/main/helpcontent2/util/simpress/makefile.mk index c69de1d..4ec14de 100644 --- a/main/helpcontent2/util/simpress/makefile.mk +++ b/main/helpcontent2/util/simpress/makefile.mk @@ -269,6 +269,13 @@ LINKLINKFILES= \ text$/simpress$/guide$/table_insert.xhp \ text$/simpress$/guide$/text2curve.xhp \ text$/simpress$/guide$/vectorize.xhp \ + text$/simpress$/minimizer$/main.xhp \ + text$/simpress$/minimizer$/step1.xhp \ + text$/simpress$/minimizer$/step2.xhp \ + text$/simpress$/minimizer$/step3.xhp \ + text$/simpress$/minimizer$/step4.xhp \ + text$/simpress$/minimizer$/step5.xhp \ + text$/simpress$/minimizer$/infobox.xhp \ text$/simpress$/main0000.xhp \ text$/simpress$/main0100.xhp \ text$/simpress$/main0101.xhp \ diff --git a/main/officecfg/registry/data/org/openoffice/Office/Impress.xcu b/main/officecfg/registry/data/org/openoffice/Office/Impress.xcu index be3c3a5..ee43c2b 100644 --- a/main/officecfg/registry/data/org/openoffice/Office/Impress.xcu +++ b/main/officecfg/registry/data/org/openoffice/Office/Impress.xcu @@ -159,4 +159,174 @@ vnd.sun.star.expand:$OOO_BASE_DIR/share/config/soffice.cfg/simpress/transitions.xml;vnd.sun.star.expand:$OOO_BASE_DIR/share/config/soffice.cfg/simpress/transitions-ogl.xml + + + + Projector optimized + + + true + + + 50 + + + true + + + 150 + + + true + + + true + + + 0 + + + true + + + true + + + false + + + true + + + true + + + + + + + Screen optimized (smallest file size) + + + true + + + 25 + + + true + + + 90 + + + true + + + true + + + 0 + + + true + + + true + + + false + + + true + + + true + + + + + Projector optimized + + + true + + + 50 + + + true + + + 150 + + + true + + + true + + + 0 + + + true + + + true + + + false + + + true + + + true + + + + + Print optimized + + + true + + + 75 + + + true + + + 300 + + + true + + + true + + + 0 + + + true + + + true + + + false + + + true + + + true + + + + + diff --git a/main/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/main/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu index befef1a..e723a9a 100644 --- a/main/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu +++ b/main/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu @@ -1279,6 +1279,14 @@ 1 + + + Minimize Presentation... + + + 1 + + Black and White diff --git a/main/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/main/officecfg/registry/schema/org/openoffice/Office/Impress.xcs index c954c53..7a88c7e 100644 --- a/main/officecfg/registry/schema/org/openoffice/Office/Impress.xcs +++ b/main/officecfg/registry/schema/org/openoffice/Office/Impress.xcs @@ -86,6 +86,113 @@ + + + Describes the Presentation Optimization Wizard settings of one session + + + + Specifies the name settings name + + Default + + + + Specifies if JPEG compression is being used + + true + + + + Specifies quality of the JPG export. A higher value results in higher quality and file size. + + + + + 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. + + + + + Represents highest value that can be used. The higher the value, the better is the compression quality and the smaller is the file size. + + + + 45 + + + + Specifies if the crop area of a picture has to be removed + + true + + + + Specifies the Image Resolution that should be used in dpi. A value of zero determines that the image resolution should not be changed. + + 150 + + + + Specifies if linked graphics are to be embedded + + true + + + + Specifies if OLE Objects are converted to Graphic objects at all + + true + + + + Specifies the compression type that is being used,. + + + + + Each + + + + + Alien + + + + 0 + + + + Specifies if unused Master Pages are being deleted + + true + + + + Specifies if hidden Slides are being deleted + + true + + + + Specifies if Notes Pages are being deleted + + false + + + + Specifies if the optimization is done on a new document. + + true + + + + Specifies if the newly created document is opened automatically. + + true + + @@ -1535,5 +1642,25 @@ + + + Contains configuration for the Presentation Minimizer. + + + + describes the name of the last used settings + + + + + The PresentationMinimizer settings + + + + List of the saved Presentation Minimizer Wizard settings + + + + diff --git a/main/postprocess/packcomponents/makefile.mk b/main/postprocess/packcomponents/makefile.mk index e7ae0c5..1a92d18 100644 --- a/main/postprocess/packcomponents/makefile.mk +++ b/main/postprocess/packcomponents/makefile.mk @@ -174,7 +174,8 @@ my_components = \ xmlfd \ xmx \ xsltdlg \ - xstor + xstor \ + PresentationMinimizer .IF "$(OS)" == "MACOSX" my_components += component/vcl/vcl.macosx diff --git a/main/postprocess/prj/build.lst b/main/postprocess/prj/build.lst index e1c2a72..521c356 100644 --- a/main/postprocess/prj/build.lst +++ b/main/postprocess/prj/build.lst @@ -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 diff --git a/main/scp2/source/ooo/file_library_ooo.scp b/main/scp2/source/ooo/file_library_ooo.scp index 0299e35..8654993 100644 --- a/main/scp2/source/ooo/file_library_ooo.scp +++ b/main/scp2/source/ooo/file_library_ooo.scp @@ -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); diff --git a/main/scp2/source/ooo/file_resource_ooo.scp b/main/scp2/source/ooo/file_resource_ooo.scp index e863575..317f2fb 100644 --- a/main/scp2/source/ooo/file_resource_ooo.scp +++ b/main/scp2/source/ooo/file_resource_ooo.scp @@ -126,3 +126,5 @@ STD_RES_FILE( gid_File_Res_T602Filter, t602filter ) STD_RES_FILE( gid_File_Res_Forui, forui ) STD_RES_FILE( gid_File_Res_For, for ) +STD_RES_FILE( gid_File_Res_PresentationMinimizer, minimizer ) + diff --git a/main/scp2/source/ooo/module_hidden_ooo.scp b/main/scp2/source/ooo/module_hidden_ooo.scp index 511201d..b020a7f 100644 --- a/main/scp2/source/ooo/module_hidden_ooo.scp +++ b/main/scp2/source/ooo/module_hidden_ooo.scp @@ -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, diff --git a/main/scp2/source/ooo/module_lang_template.scp b/main/scp2/source/ooo/module_lang_template.scp index 05fd735..089492b 100644 --- a/main/scp2/source/ooo/module_lang_template.scp +++ b/main/scp2/source/ooo/module_lang_template.scp @@ -102,7 +102,8 @@ Module gid_Module_Langpack_Resource_Template 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 diff --git a/main/sd/inc/app.hrc b/main/sd/inc/app.hrc index 9e52d65..22e1fd0 100644 --- a/main/sd/inc/app.hrc +++ b/main/sd/inc/app.hrc @@ -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 diff --git a/main/sd/sdi/drviewsh.sdi b/main/sd/sdi/drviewsh.sdi index cba2719..5eacab2 100644 --- a/main/sd/sdi/drviewsh.sdi +++ b/main/sd/sdi/drviewsh.sdi @@ -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 ; diff --git a/main/sd/sdi/sdraw.sdi b/main/sd/sdi/sdraw.sdi index 46fe68a..7eef092 100644 --- a/main/sd/sdi/sdraw.sdi +++ b/main/sd/sdi/sdraw.sdi @@ -5385,6 +5385,31 @@ SfxVoidItem PresentationDialog SID_PRESENTATION_DLG ] //-------------------------------------------------------------------------- +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 () [ diff --git a/main/sd/source/ui/view/drviewse.cxx b/main/sd/source/ui/view/drviewse.cxx index 2d43bf3..1e5b09b 100644 --- a/main/sd/source/ui/view/drviewse.cxx +++ b/main/sd/source/ui/view/drviewse.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -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& rReq) } 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; } diff --git a/main/sd/uiconfig/simpress/menubar/menubar.xml b/main/sd/uiconfig/simpress/menubar/menubar.xml index baef237..cb17a47 100644 --- a/main/sd/uiconfig/simpress/menubar/menubar.xml +++ b/main/sd/uiconfig/simpress/menubar/menubar.xml @@ -270,6 +270,7 @@ + diff --git a/main/sdext/prj/build.lst b/main/sdext/prj/build.lst index 7462e48..29350f7 100644 --- a/main/sdext/prj/build.lst +++ b/main/sdext/prj/build.lst @@ -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 diff --git a/main/sdext/prj/d.lst b/main/sdext/prj/d.lst index bcaa430..aacc8a5 100644 --- a/main/sdext/prj/d.lst +++ b/main/sdext/prj/d.lst @@ -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% diff --git a/main/sdext/source/minimizer/PresentationMinimizer.component b/main/sdext/source/minimizer/PresentationMinimizer.component new file mode 100644 index 0000000..2a243c2 --- /dev/null +++ b/main/sdext/source/minimizer/PresentationMinimizer.component @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/main/sdext/source/minimizer/configurationaccess.cxx b/main/sdext/source/minimizer/configurationaccess.cxx index 7191663..8e714e4 100644 --- a/main/sdext/source/minimizer/configurationaccess.cxx +++ b/main/sdext/source/minimizer/configurationaccess.cxx @@ -31,13 +31,39 @@ #include #include #include +#include + +#include + +#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 + +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& GetConfigurationProviderServiceName (void) 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==( const OptimizerSettings& rOptimizerSetti } -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::~ConfigurationAccess() { } -rtl::OUString ConfigurationAccess::getPath( const PPPOptimizerTokenEnum eToken ) +rtl::OUString ConfigurationAccess::getString( sal_Int32 nResId ) { - 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 -{ - 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 > ConfigurationAccess::OpenConfiguration( bool bReadOnly ) 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 ); diff --git a/main/sdext/source/minimizer/configurationaccess.hxx b/main/sdext/source/minimizer/configurationaccess.hxx index 46704fd..f425fde 100644 --- a/main/sdext/source/minimizer/configurationaccess.hxx +++ b/main/sdext/source/minimizer/configurationaccess.hxx @@ -40,6 +40,7 @@ #include #include + 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 ); diff --git a/main/sdext/source/minimizer/delzip b/main/sdext/source/minimizer/delzip deleted file mode 100644 index 8b13789..0000000 --- a/main/sdext/source/minimizer/delzip +++ /dev/null @@ -1 +0,0 @@ - diff --git a/main/sdext/source/minimizer/description.xml b/main/sdext/source/minimizer/description.xml deleted file mode 100644 index 0c2c522..0000000 --- a/main/sdext/source/minimizer/description.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - Apache Software Foundation - - - - Presentation Minimizer - - - - - - - - diff --git a/main/sdext/source/minimizer/fileopendialog.cxx b/main/sdext/source/minimizer/fileopendialog.cxx index 838b92e..ff4ace2 100644 --- a/main/sdext/source/minimizer/fileopendialog.cxx +++ b/main/sdext/source/minimizer/fileopendialog.cxx @@ -57,7 +57,6 @@ #include -using namespace ::rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; @@ -65,14 +64,27 @@ using namespace ::com::sun::star::container; 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; + +FileOpenDialog::FileOpenDialog( + const Reference< XComponentContext >& rxContext, + const Reference< XWindow > &rxParent ) + : mxContext( rxContext ) { - Sequence< Any > aInitPropSeq( 1 ); - aInitPropSeq[ 0 ] <<= (sal_Int16)TemplateDescription::FILESAVE_AUTOEXTENSION; // TemplateDescription.FILEOPEN_SIMPLE + Sequence< Any > aInitPropSeq( 2 ); + aInitPropSeq[ 0 ] <<= NamedValue( + OUString(RTL_CONSTASCII_USTRINGPARAM("TemplateDescription")), + makeAny( (sal_Int16)TemplateDescription::FILESAVE_AUTOEXTENSION)); + aInitPropSeq[ 1 ] <<= NamedValue( + OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")), + makeAny( rxParent )); - mxFilePicker = Reference < XFilePicker >( mxMSF->getServiceManager()->createInstanceWithArgumentsAndContext( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ), aInitPropSeq, rxMSF ),UNO_QUERY_THROW ); + mxFilePicker = Reference < XFilePicker >( + mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( + OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.ui.dialogs.FilePicker" ) ), + aInitPropSeq, rxContext ), UNO_QUERY_THROW ); mxFilePicker->setMultiSelectionMode( sal_False ); Reference< XFilePickerControlAccess > xAccess( mxFilePicker, UNO_QUERY ); @@ -88,8 +100,8 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxMSF ) : } // 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 +145,14 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxMSF ) : } } - 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 (.)" rtl::OUStringBuffer aUIName; // the filter must be in the form "*." diff --git a/main/sdext/source/minimizer/fileopendialog.hxx b/main/sdext/source/minimizer/fileopendialog.hxx index 20e479a..6fb814a 100644 --- a/main/sdext/source/minimizer/fileopendialog.hxx +++ b/main/sdext/source/minimizer/fileopendialog.hxx @@ -30,6 +30,7 @@ #include #include #include +#include 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(); diff --git a/main/sdext/source/minimizer/graphiccollector.cxx b/main/sdext/source/minimizer/graphiccollector.cxx index cff3b60..1b0f467 100644 --- a/main/sdext/source/minimizer/graphiccollector.cxx +++ b/main/sdext/source/minimizer/graphiccollector.cxx @@ -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< GraphicCollector::GraphicEntity >& rGraphicEntit } } -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 Reference< XComponentContext >& rxMSF, Reference // 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 Reference< XComponentContext >& rxMSF, Reference } } -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 Reference< XComponentContext >& rxMSF, const { 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 Reference< XComponentContext >& rxMSF, const } } -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< XComponentContext >& rxMSF, c 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 Reference< XComponentContext >& rxMSF, cons 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 Reference< XComponentContext >& rxMSF, cons } } -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::GetOriginalSize( const Reference< XComponentContext 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::GetOriginalSize( const Reference< XComponentContext 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( const Reference< XComponentContext >& rx 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( const Reference< XComponentContext >& rx } } -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 Reference< XComponentContext >& rxMSF, const 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 Reference< XComponentContext >& rxMSF, const } } -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 Reference< XComponentContext >& /* rxMSF * } } -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( const Reference< XComponentContext >& rxMS 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& ) diff --git a/main/sdext/source/minimizer/graphiccollector.hxx b/main/sdext/source/minimizer/graphiccollector.hxx index 679b7b5..d7ce2dd 100644 --- a/main/sdext/source/minimizer/graphiccollector.hxx +++ b/main/sdext/source/minimizer/graphiccollector.hxx @@ -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 ); }; diff --git a/main/sdext/source/minimizer/help/component.txt b/main/sdext/source/minimizer/help/component.txt deleted file mode 100644 index 98f2687..0000000 --- a/main/sdext/source/minimizer/help/component.txt +++ /dev/null @@ -1,2 +0,0 @@ -The Presentation Minimizer is used to reduce the file size of the current presentation. Images will be compressed, and data that is no longer needed will be removed. -The Presentation Minimizer can optimize the image quality size. Presentations designed for screen or projector do not require the same high quality as presentations designed for print. diff --git a/main/sdext/source/minimizer/help/help_de.odt b/main/sdext/source/minimizer/help/help_de.odt deleted file mode 100644 index bb9bc0395c0fd16135f3badd8eefd1564b3f945e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8987 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 -#include +#include "minimizer.hrc" + #include #include "com/sun/star/util/URL.hpp" #include "com/sun/star/util/XURLTransformer.hpp" @@ -43,12 +43,9 @@ #include #include #include -#ifndef _COM_SUN_STAR_FRAME_FrameSearchFlag_HPP_ #include -#endif #include #include -#include #include #include #include @@ -61,9 +58,7 @@ #include #include #include -#ifndef _COM_SUN_STAR_UNO_RUNTIME_EXCEPTION_HPP_ #include -#endif #include #include #include @@ -73,7 +68,6 @@ #include 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::document; 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< XGraphicProvider >& rxGraphicProvider, const } } -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( const Reference< XComponentContext >& // 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( const Reference< XComponentContext >& } 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( const Reference< XComponentContext >& 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( const Reference< XComponentContext >& 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& rOptimizer, const Reference< XComponentCont 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& rOptimizer, const Reference< XComponentCont 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& rOptimizer, const Reference< XComponentCont // - 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 Reference< XComponentContext >& rxMSF, const R 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< XComponentContext > xMSF, OUString sURL, Ref 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 Sequence< PropertyValue >& rArguments ) { 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 Sequence< PropertyValue >& rArguments ) { 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 Sequence< PropertyValue >& rArguments ) 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 Sequence< PropertyValue >& rArguments ) 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 Sequence< PropertyValue >& rArguments ) } } - 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(); diff --git a/main/sdext/source/minimizer/impoptimizer.hxx b/main/sdext/source/minimizer/impoptimizer.hxx index 2b3f908..f753cf1 100644 --- a/main/sdext/source/minimizer/impoptimizer.hxx +++ b/main/sdext/source/minimizer/impoptimizer.hxx @@ -35,6 +35,7 @@ #include #endif #include +#include class Point; class Size; @@ -47,9 +48,9 @@ class ImpOptimizer : public OptimizationStats { 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: diff --git a/main/sdext/source/minimizer/informationdialog.cxx b/main/sdext/source/minimizer/informationdialog.cxx index 081d16c..1d798a4 100644 --- a/main/sdext/source/minimizer/informationdialog.cxx +++ b/main/sdext/source/minimizer/informationdialog.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * 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 @@ -7,31 +7,38 @@ * 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. - * + * *************************************************************/ - + // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sdext.hxx" #include "informationdialog.hxx" #include "optimizationstats.hxx" +#include "minimizer.hrc" +#include "helpid.hrc" + #include +#include #include #include +#include #include #include "com/sun/star/util/URL.hpp" #include "com/sun/star/util/XURLTransformer.hpp" +#include +#include #define DIALOG_WIDTH 240 #define DIALOG_HEIGHT 80 @@ -43,7 +50,6 @@ // - INFORMATIONDIALOG - // --------------------- -using namespace ::rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::io; using namespace ::com::sun::star::ui; @@ -56,12 +62,19 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::script; using namespace ::com::sun::star::container; - +using ::rtl::OUString; // ----------------------------------------------------------------------------- -rtl::OUString InsertFixedText( InformationDialog& rInformationDialog, const rtl::OUString& rControlName, const OUString& rLabel, - sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Bool bMultiLine, sal_Int16 nTabIndex ) +Reference< XFixedText > InformationDialog::InsertFixedText( + const rtl::OUString& rControlName, + const OUString& rLabel, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Bool bMultiLine, + sal_Int16 nTabIndex ) { OUString pNames[] = { TKGet( TK_Height ), @@ -88,12 +101,10 @@ rtl::OUString InsertFixedText( InformationDialog& rInformationDialog, const rtl: Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - rInformationDialog.insertFixedText( rControlName, aNames, aValues ); - return rControlName; + return insertFixedText( rControlName, aNames, aValues ); } -rtl::OUString InsertImage( - InformationDialog& rInformationDialog, +Reference< XControl > InformationDialog::InsertImage( const OUString& rControlName, const OUString& rURL, sal_Int32 nPosX, @@ -124,17 +135,23 @@ rtl::OUString InsertImage( Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - rInformationDialog.insertImage( rControlName, aNames, aValues ); - return rControlName; + return insertImage( rControlName, aNames, aValues ); } -rtl::OUString InsertCheckBox( InformationDialog& rInformationDialog, const OUString& rControlName, - const Reference< XItemListener > xItemListener, const OUString& rLabel, - sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex ) +Reference< XCheckBox > InformationDialog::InsertCheckBox( + const OUString& rControlName, + const OUString& rLabel, + const OUString& rHelpURL, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex ) { OUString pNames[] = { TKGet( TK_Enabled ), TKGet( TK_Height ), + TKGet( TK_HelpURL ), TKGet( TK_Label ), TKGet( TK_PositionX ), TKGet( TK_PositionY ), @@ -145,6 +162,7 @@ rtl::OUString InsertCheckBox( InformationDialog& rInformationDialog, const OUStr Any pValues[] = { Any( sal_True ), Any( nHeight ), + Any( rHelpURL ), Any( rLabel ), Any( nXPos ), Any( nYPos ), @@ -157,14 +175,17 @@ rtl::OUString InsertCheckBox( InformationDialog& rInformationDialog, const OUStr Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - Reference< XCheckBox > xCheckBox( rInformationDialog.insertCheckBox( rControlName, aNames, aValues ) ); - if ( xItemListener.is() ) - xCheckBox->addItemListener( xItemListener ); - return rControlName; + return insertCheckBox( rControlName, aNames, aValues ); } -rtl::OUString InsertButton( InformationDialog& rInformationDialog, const OUString& rControlName, Reference< XActionListener >& xActionListener, - sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex, PPPOptimizerTokenEnum nResID ) +Reference< XButton > InformationDialog::InsertButton( + const OUString& rControlName, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex, + sal_Int32 nResID ) { OUString pNames[] = { TKGet( TK_Enabled ), @@ -180,7 +201,7 @@ rtl::OUString InsertButton( InformationDialog& rInformationDialog, const OUStrin Any pValues[] = { Any( sal_True ), Any( nHeight ), - Any( rInformationDialog.getString( nResID ) ), + Any( getString( nResID ) ), Any( nXPos ), Any( nYPos ), Any( static_cast< sal_Int16 >( PushButtonType_OK ) ), @@ -194,8 +215,7 @@ rtl::OUString InsertButton( InformationDialog& rInformationDialog, const OUStrin Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - rInformationDialog.insertButton( rControlName, xActionListener, aNames, aValues ); - return rControlName; + return insertButton( rControlName, Reference< XActionListener >(), aNames, aValues ); } @@ -221,6 +241,7 @@ void InformationDialog::InitDialog() OUString pNames[] = { TKGet( TK_Closeable ), TKGet( TK_Height ), + TKGet( TK_HelpURL ), TKGet( TK_Moveable ), TKGet( TK_PositionX ), TKGet( TK_PositionY ), @@ -230,10 +251,11 @@ void InformationDialog::InitDialog() Any pValues[] = { Any( sal_True ), Any( nDialogHeight ), + Any( HID( HID_SDEXT_MINIMIZER_INFOBOX_DLG ) ), Any( sal_True ), Any( sal_Int32( 245 ) ), Any( sal_Int32( 115 ) ), - Any( getString( STR_SUN_OPTIMIZATION_WIZARD2 ) ), + Any( getString( STR_INFO_DIALOG ) ), Any( sal_Int32( DIALOG_WIDTH ) ) }; sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString ); @@ -246,30 +268,30 @@ void InformationDialog::InitDialog() sal_Int64 nSource = mnSourceSize; sal_Int64 nDest = mnDestSize; - PPPOptimizerTokenEnum eInfoString( STR_INFO_1 ); + sal_Int32 nInfoStrResId( STR_INFO_1 ); if ( mnSourceSize ) { if ( mnDestSize ) - eInfoString = STR_INFO_1; + nInfoStrResId = STR_INFO_1; else { - eInfoString = STR_INFO_2; + nInfoStrResId = STR_INFO_2; nDest = mnApproxSize; } } else if ( mnDestSize ) - eInfoString = STR_INFO_3; + nInfoStrResId = STR_INFO_3; else { - eInfoString = STR_INFO_4; + nInfoStrResId = STR_INFO_4; nDest = mnApproxSize; } rtl::OUString aTitle; if ( maSaveAsURL.getLength() ) { - Reference< XURLTransformer > xURLTransformer( mxMSF->getServiceManager()->createInstanceWithContext( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) ), mxMSF ), UNO_QUERY ); + Reference< XURLTransformer > xURLTransformer( mxContext->getServiceManager()->createInstanceWithContext( + OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) ), mxContext ), UNO_QUERY ); if ( xURLTransformer.is() ) { util::URL aURL, aPresentationURL; @@ -285,7 +307,7 @@ void InformationDialog::InitDialog() } } - OUString aInfoString( getString( eInfoString ) ); + OUString aInfoString( getString( nInfoStrResId ) ); const OUString aOldSizePlaceholder( RTL_CONSTASCII_USTRINGPARAM( "%OLDFILESIZE" ) ); const OUString aNewSizePlaceholder( RTL_CONSTASCII_USTRINGPARAM( "%NEWFILESIZE" ) ); const OUString aTitlePlaceholder( aTitle.getLength() ? OUString::createFromAscii( "%TITLE" ) : OUString::createFromAscii( "'%TITLE'" ) ); @@ -302,38 +324,106 @@ void InformationDialog::InitDialog() if ( k >= 0 ) aInfoString = aInfoString.replaceAt( k, aTitlePlaceholder.getLength(), aTitle ); - com::sun::star::uno::Reference< com::sun::star::awt::XItemListener > xItemListener; - InsertImage( *this, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "aboutimage" ) ), + + Reference< XControl > xImageCtrl = InsertImage( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "aboutimage" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:standardimage/query" ) ), - 5, 5, 25, 25, sal_False ); - InsertFixedText( *this, rtl::OUString( rtl::OUString::createFromAscii( "fixedtext" ) ), aInfoString, PAGE_POS_X, 6, PAGE_WIDTH, 24, sal_True, 0 ); + 3, 3, 25, 25, sal_False ); + Reference< XControl > xFixedText( InsertFixedText( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "fixedtext" ) ), aInfoString, PAGE_POS_X, 6, PAGE_WIDTH, 24, sal_True, 0 ), UNO_QUERY); + if ( maSaveAsURL.getLength() ) - InsertCheckBox( *this, TKGet( TK_OpenNewDocument ), xItemListener, getString( STR_AUTOMATICALLY_OPEN ), PAGE_POS_X, 42, PAGE_WIDTH, 8, 1 ); - InsertButton( *this, rtl::OUString( rtl::OUString::createFromAscii( "button" ) ), mxActionListener, DIALOG_WIDTH / 2 - 25, nDialogHeight - 20, 50, 14, 2, STR_OK ); + mxCheckBox = InsertCheckBox( TKGet( TK_OpenNewDocument ), + getString( STR_AUTOMATICALLY_OPEN ), + HID( HID_SDEXT_MINIMIZER_INFOBOX_CB_OPENNEW ), + PAGE_POS_X, 42, + PAGE_WIDTH, 8, 1 ); + Reference< XControl> xButtonCtrl( InsertButton( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "button" ) ), DIALOG_WIDTH / 2 - 15, nDialogHeight - 20, 30, 14, 2, STR_OK ), UNO_QUERY ); sal_Bool bOpenNewDocument = mrbOpenNewDocument; setControlProperty( TKGet( TK_OpenNewDocument ), TKGet( TK_State ), Any( (sal_Int16)bOpenNewDocument ) ); + + sal_Int32 nX, nY, nDlgWidth; + Size aSize3( 3, 3 ); + Reference< XUnitConversion > xUnitConverter( mxDialogWindow, UNO_QUERY_THROW ); + aSize3 = xUnitConverter->convertSizeToPixel( aSize3, util::MeasureUnit::APPFONT ); + nX = nY = aSize3.Width; + + Reference< XPropertySet > xImageProps (xImageCtrl->getModel(), UNO_QUERY_THROW ); + Reference< graphic::XGraphic > xGraphic( + xImageProps->getPropertyValue( + OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic") ) ), UNO_QUERY_THROW ); + if ( xGraphic.is() && xGraphic->getType() != graphic::GraphicType::EMPTY ) + { + Size aSizePixel; + Rectangle aPosSizePixel; + Reference< XPropertySet > xGraphicProps( xGraphic, UNO_QUERY_THROW ); + xGraphicProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("SizePixel"))) >>= aSizePixel; + Reference< XWindow > xImage (xImageCtrl->getPeer(), UNO_QUERY_THROW ); + + xImage->setPosSize( nX, nY, + aSizePixel.Width, + aSizePixel.Height, + awt::PosSize::POSSIZE ); + + nX += aSizePixel.Width + aSize3.Width; + + Reference< XWindow > xLabel ( xFixedText->getPeer(), UNO_QUERY_THROW ); + aPosSizePixel = xLabel->getPosSize(); + xLabel->setPosSize( nX, nY, + aPosSizePixel.Width, + aPosSizePixel.Height, + awt::PosSize::POSSIZE ); + + nDlgWidth = nX + aPosSizePixel.Width + aSize3.Width; + nY += aPosSizePixel.Height + aSize3.Height; + + if ( mxCheckBox.is() ) + { + Reference< XControl > xCheckBoxCtrl( mxCheckBox, UNO_QUERY_THROW ); + Reference< XWindow > xCheckBox( xCheckBoxCtrl->getPeer(), UNO_QUERY_THROW ); + Rectangle aCBSize = xCheckBox->getPosSize(); + xCheckBox->setPosSize( nX, nY, + aPosSizePixel.Width, + aCBSize.Height , + awt::PosSize::POSSIZE); + nY += aCBSize.Height + aSize3.Height; + } + + nY += aSize3.Height; + Reference< XWindow > xButton ( xButtonCtrl->getPeer(), UNO_QUERY_THROW ); + aPosSizePixel = xButton->getPosSize(); + xButton->setPosSize( nDlgWidth / 2 - aPosSizePixel.Width / 2, + nY , + aPosSizePixel.Width, + aPosSizePixel.Height, + awt::PosSize::POSSIZE ); + nY += aPosSizePixel.Height + aSize3.Height; + mxDialogWindow->setPosSize( 0, 0, nDlgWidth, nY, awt::PosSize::SIZE ); + } + + centerDialog(); } // ----------------------------------------------------------------------------- -InformationDialog::InformationDialog( const Reference< XComponentContext > &rxMSF, Reference< XFrame >& rxFrame, const rtl::OUString& rSaveAsURL, sal_Bool& rbOpenNewDocument, const sal_Int64& rSourceSize, const sal_Int64& rDestSize, const sal_Int64& rApproxSize ) : - UnoDialog( rxMSF, rxFrame ), - ConfigurationAccess( rxMSF, NULL ), - mxMSF( rxMSF ), - mxFrame( rxFrame ), - mxActionListener( new OKActionListener( *this ) ), +InformationDialog::InformationDialog( + const Reference< XComponentContext > &rxContext, + const Reference< XWindowPeer>& rxParent, + const rtl::OUString& rSaveAsURL, + sal_Bool& rbOpenNewDocument, + const sal_Int64& rSourceSize, + const sal_Int64& rDestSize, + const sal_Int64& rApproxSize ) +: UnoDialog( rxContext, rxParent ), + ConfigurationAccess( rxContext, NULL ), + mxContext( rxContext ), mnSourceSize( rSourceSize ), mnDestSize( rDestSize ), mnApproxSize( rApproxSize ), mrbOpenNewDocument( rbOpenNewDocument ), maSaveAsURL( rSaveAsURL ) { - Reference< XFrame > xFrame( mxController->getFrame() ); - Reference< XWindow > xContainerWindow( xFrame->getContainerWindow() ); - Reference< XWindowPeer > xWindowPeer( xContainerWindow, UNO_QUERY_THROW ); - createWindowPeer( xWindowPeer ); + OSL_TRACE( "InformationDialog::InformationDialog" ); + createWindowPeer(); InitDialog(); } @@ -342,38 +432,23 @@ InformationDialog::InformationDialog( const Reference< XComponentContext > &rxMS InformationDialog::~InformationDialog() { + OSL_TRACE( "InformationDialog::~InformationDialog" ); } // ----------------------------------------------------------------------------- sal_Bool InformationDialog::execute() { + OSL_TRACE( "InformationDialog::execute" ); UnoDialog::execute(); - if ( maSaveAsURL.getLength() ) + if ( maSaveAsURL.getLength() && mxCheckBox.is() ) { - sal_Int16 nInt16 = 0; - Any aAny( getControlProperty( TKGet( TK_OpenNewDocument ), TKGet( TK_State ) ) ); - if ( aAny >>= nInt16 ) - { - sal_Bool bOpenNewDocument = static_cast< sal_Bool >( nInt16 ); - mrbOpenNewDocument = bOpenNewDocument; - } + sal_Bool bOpenNewDocument = static_cast< sal_Bool >( mxCheckBox->getState() ); + mrbOpenNewDocument = bOpenNewDocument; } + + endExecute( sal_True ); return mbStatus; } -// ----------------------------------------------------------------------------- - -void OKActionListener::actionPerformed( const ActionEvent& rEvent ) - throw ( com::sun::star::uno::RuntimeException ) -{ - if ( rEvent.ActionCommand == rtl::OUString( rtl::OUString::createFromAscii( "button" ) ) ) - { - mrInformationDialog.endExecute( sal_True ); - } -} -void OKActionListener::disposing( const ::com::sun::star::lang::EventObject& /* Source */ ) - throw ( com::sun::star::uno::RuntimeException ) -{ -} diff --git a/main/sdext/source/minimizer/informationdialog.hxx b/main/sdext/source/minimizer/informationdialog.hxx index 0ad4abb..d14bc45 100644 --- a/main/sdext/source/minimizer/informationdialog.hxx +++ b/main/sdext/source/minimizer/informationdialog.hxx @@ -46,49 +46,68 @@ // --------------------- // - InformationDialog - // --------------------- -class InformationDialog : public UnoDialog, public ConfigurationAccess + +class InformationDialog : public UnoDialog + , public ConfigurationAccess { public : - InformationDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, - com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rxFrame, const rtl::OUString& rSaveAsURL, - sal_Bool& bOpenNewDocument, const sal_Int64& nSourceSize, const sal_Int64& nDestSize, const sal_Int64& nApproxDest ); + InformationDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, + const com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer >& rxParent, + const rtl::OUString& rSaveAsURL, + sal_Bool& bOpenNewDocument, + const sal_Int64& nSourceSize, + const sal_Int64& nDestSize, + const sal_Int64& nApproxDest ); ~InformationDialog(); sal_Bool execute(); - private : - com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >mxMSF; - com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame; - com::sun::star::uno::Reference< com::sun::star::io::XStream > mxTempFile; - - com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > mxActionListener; + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext; + sal_Int64 mnSourceSize; + sal_Int64 mnDestSize; + sal_Int64 mnApproxSize; + sal_Bool& mrbOpenNewDocument; + const rtl::OUString& maSaveAsURL; + com::sun::star::uno::Reference< com::sun::star::awt::XCheckBox > mxCheckBox; void InitDialog(); + com::sun::star::uno::Reference< com::sun::star::awt::XFixedText > InsertFixedText( + const rtl::OUString& rControlName, + const rtl::OUString& rLabel, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Bool bMultiLine, + sal_Int16 nTabIndex ); + com::sun::star::uno::Reference< com::sun::star::awt::XControl > InsertImage( + const rtl::OUString& rControlName, + const rtl::OUString& rURL, + sal_Int32 nPosX, + sal_Int32 nPosY, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Bool bScale ); + com::sun::star::uno::Reference< com::sun::star::awt::XCheckBox > InsertCheckBox( + const rtl::OUString& rControlName, + const rtl::OUString& rLabel, + const rtl::OUString& rHelpURL, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex ); + com::sun::star::uno::Reference< com::sun::star::awt::XButton > InsertButton( + const rtl::OUString& rControlName, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex, + sal_Int32 nResID ); - sal_Int64 mnSourceSize; - sal_Int64 mnDestSize; - sal_Int64 mnApproxSize; - sal_Bool& mrbOpenNewDocument; - const rtl::OUString& maSaveAsURL; - -public : - - com::sun::star::uno::Reference< com::sun::star::frame::XFrame>& GetFrame() { return mxFrame; }; - const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& GetComponentContext() { return mxMSF; }; -}; - -class OKActionListener : public ::cppu::WeakImplHelper1< com::sun::star::awt::XActionListener > -{ -public: - OKActionListener( InformationDialog& rInformationDialog ) : mrInformationDialog( rInformationDialog ){}; - - virtual void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException); -private: - - InformationDialog& mrInformationDialog; }; #endif diff --git a/main/sdext/source/minimizer/makefile.mk b/main/sdext/source/minimizer/makefile.mk index 32e7ae1..75eec98 100644 --- a/main/sdext/source/minimizer/makefile.mk +++ b/main/sdext/source/minimizer/makefile.mk @@ -1,5 +1,5 @@ #************************************************************** -# +# # 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 @@ -7,143 +7,91 @@ # 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. -# +# #************************************************************** - - PRJ=..$/.. PRJNAME=sdext -TARGET=SunPresentationMinimizer +TARGET=PresentationMinimizer +EXTENSIONNAME=$(TARGET) + GEN_HID=FALSE ENABLE_EXCEPTIONS=TRUE # --- Settings ---------------------------------- .INCLUDE : settings.mk -.IF "$(L10N_framework)"=="" -.INCLUDE : $(PRJ)$/source$/minimizer$/minimizer.pmk -.INCLUDE : $(PRJ)$/util$/makefile.pmk -# set in minimizer.pmk -#EXTENSIONNAME:=PresentationMinimizer -EXTENSION_ZIPNAME:=presentation-minimizer +.IF "$(L10N_framework)"=="" -.IF "$(ENABLE_MINIMIZER)" != "YES" -@all: - @echo "Presentation Minimizer build disabled." -.ENDIF DLLPRE= # --- Files ------------------------------------- -SLOFILES= $(SLO)$/unodialog.obj \ - $(SLO)$/optimizerdialog.obj \ - $(SLO)$/optimizerdialogcontrols.obj \ - $(SLO)$/configurationaccess.obj \ - $(SLO)$/impoptimizer.obj \ - $(SLO)$/pppoptimizer.obj \ - $(SLO)$/pppoptimizeruno.obj \ - $(SLO)$/pppoptimizertoken.obj \ - $(SLO)$/pppoptimizerdialog.obj \ - $(SLO)$/fileopendialog.obj \ - $(SLO)$/optimizationstats.obj \ - $(SLO)$/graphiccollector.obj \ - $(SLO)$/pagecollector.obj \ - $(SLO)$/informationdialog.obj +SLOFILES=\ + $(SLO)$/unodialog.obj \ + $(SLO)$/optimizerdialog.obj \ + $(SLO)$/informationdialog.obj \ + $(SLO)$/fileopendialog.obj \ + $(SLO)$/optimizerdialogcontrols.obj \ + $(SLO)$/configurationaccess.obj \ + $(SLO)$/impoptimizer.obj \ + $(SLO)$/pppoptimizer.obj \ + $(SLO)$/pppoptimizeruno.obj \ + $(SLO)$/pppoptimizertoken.obj \ + $(SLO)$/pppoptimizerdialog.obj \ + $(SLO)$/optimizationstats.obj \ + $(SLO)$/graphiccollector.obj \ + $(SLO)$/pagecollector.obj \ # --- Library ----------------------------------- -SHL1TARGET= $(TARGET).uno +SHL1TARGET= $(TARGET).uno -SHL1STDLIBS= $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) +SHL1STDLIBS=\ + $(CPPUHELPERLIB)\ + $(CPPULIB)\ + $(SALLIB) SHL1DEPN= -SHL1IMPLIB= i$(SHL1TARGET) -SHL1LIBS= $(SLB)$/$(TARGET).lib -SHL1DEF= $(MISC)$/$(SHL1TARGET).def -SHL1VERSIONMAP=$(SOLARENV)/src/reg-component.map -SHL1RPATH= OXT -DEF1NAME= $(SHL1TARGET) - -COMPONENT_XCU_REPLACEMENT=s/@MINIMIZEREXTENSIONPRODUCTNAME@/Presentation Minimizer/g - -COMPONENT_MERGED_XCU= \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Addons.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/ProtocolHandler.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/extension$/SunPresentationMinimizer.xcu - -COMPONENT_FILES= \ - $(EXTENSIONDIR)$/registry$/schema$/org$/openoffice$/Office$/extension$/SunPresentationMinimizer.xcs - -# native libraries -COMPONENT_LIBRARIES= \ - $(EXTENSIONDIR)$/SunPresentationMinimizer.uno$(DLLPOST) - -# rather freestyle or common to all? -COMPONENT_BITMAPS= \ - $(EXTENSIONDIR)$/bitmaps$/opt_16.png \ - $(EXTENSIONDIR)$/bitmaps$/opt_26.png \ - $(EXTENSIONDIR)$/bitmaps$/opt_16_h.png \ - $(EXTENSIONDIR)$/bitmaps$/opt_26_h.png \ - $(EXTENSIONDIR)$/bitmaps$/minimizepresi_80.png \ - $(EXTENSIONDIR)$/bitmaps$/minimizepresi_80_h.png - -COMPONENT_IMAGES=\ - $(EXTENSIONDIR)$/bitmaps$/extension_32.png \ - $(EXTENSIONDIR)$/bitmaps$/extension_32_h.png - -# rather freestyle or common to all? -COMPONENT_HELP= \ - $(EXTENSIONDIR)$/help$/help_de.odt \ - $(EXTENSIONDIR)$/help$/help_en-US.odt \ - $(EXTENSIONDIR)$/help$/component.txt - -# make sure to add your custom files here -EXTENSION_PACKDEPS=$(COMPONENT_BITMAPS) $(COMPONENT_IMAGES) $(COMPONENT_HELP) - -ZIP2TARGET= presentation_minimizer_develop -.IF "$(WITH_LANG)"!="" -ZIP2DIR= $(MISC)/$(EXTENSIONNAME)_in/merge -.ELSE # "$(WITH_LANG)"!="" -ZIP2DIR= registry/data -.ENDIF # "$(WITH_LANG)"!="" -ZIP2EXT= .zip -ZIP2FLAGS=-r -ZIP2LIST= \ - org/openoffice/Office/Addons.xcu \ - org/openoffice/Office/extension/*.xcu +SHL1IMPLIB=i$(SHL1TARGET) +SHL1LIBS=$(SLB)$/$(TARGET).lib +SHL1DEF=$(MISC)$/$(SHL1TARGET).def +SHL1VERSIONMAP=$(SOLARENV)/src/component.map +SHL1RPATH=OXT +DEF1NAME=$(SHL1TARGET) -# --- Targets ---------------------------------- +# ------------------------------------------------------------------------------ -.INCLUDE : extension_pre.mk +# Resource files -.ENDIF # L10N_framework -.INCLUDE : target.mk +SRS1NAME=minimizer +SRC1FILES = \ + minimizer.src \ -.IF "$(L10N_framework)"=="" -.INCLUDE : extension_post.mk - -$(COMPONENT_BITMAPS) : $(SOLARSRC)$/$(RSCDEFIMG)$/minimizer$/$$(@:f) - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ +SRSFILELIST=\ + $(SRS)$/minimizer.srs \ -$(COMPONENT_IMAGES) : $(SOLARSRC)$/$(RSCDEFIMG)$/desktop$/res$/$$(@:f) - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ +RESLIB1NAME=minimizer +RESLIB1SRSFILES= $(SRSFILELIST) -$(COMPONENT_HELP) : help$/$$(@:f) - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ +# --- Targets ---------------------------------- .ENDIF # L10N_framework +.INCLUDE : target.mk + + +ALLTAR : $(MISC)/PresentationMinimizer.component + +$(MISC)/PresentationMinimizer.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt PresentationMinimizer.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt PresentationMinimizer.component diff --git a/main/sdext/source/minimizer/manifest.xml b/main/sdext/source/minimizer/manifest.xml deleted file mode 100644 index 55f5fe0..0000000 --- a/main/sdext/source/minimizer/manifest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - diff --git a/main/sdext/source/minimizer/minimizer.hrc b/main/sdext/source/minimizer/minimizer.hrc new file mode 100644 index 0000000..4aa7426 --- /dev/null +++ b/main/sdext/source/minimizer/minimizer.hrc @@ -0,0 +1,95 @@ +/************************************************************** + * + * 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 MINIMIZER_RES_START 255 + +#define IMAGE_MINIMIZER_ROADMAP MINIMIZER_RES_START + 1 +#define IMAGE_MINIMIZER_ROADMAP_HC MINIMIZER_RES_START + 2 + +#define IMAGE_MINIMIZER_END MINIMIZER_RES_START + 50 +#define MINIMIZER_RES_STR_START IMAGE_MINIMIZER_END + +#define STR_PRESENTATION_MINIMIZER MINIMIZER_RES_STR_START + 1 +#define STR_STEPS MINIMIZER_RES_STR_START + 2 +#define STR_HELP MINIMIZER_RES_STR_START + 3 +#define STR_BACK MINIMIZER_RES_STR_START + 4 +#define STR_NEXT MINIMIZER_RES_STR_START + 5 +#define STR_FINISH MINIMIZER_RES_STR_START + 6 +#define STR_CANCEL MINIMIZER_RES_STR_START + 7 +#define STR_INTRODUCTION MINIMIZER_RES_STR_START + 8 +#define STR_INTRODUCTION_T MINIMIZER_RES_STR_START + 9 +#define STR_CHOSE_SETTINGS MINIMIZER_RES_STR_START + 10 +#define STR_REMOVE MINIMIZER_RES_STR_START + 11 +#define STR_GRAPHIC_OPTIMIZATION MINIMIZER_RES_STR_START + 12 +#define STR_IMAGE_OPTIMIZATION MINIMIZER_RES_STR_START + 13 +#define STR_LOSSLESS_COMPRESSION MINIMIZER_RES_STR_START + 14 +#define STR_JPEG_COMPRESSION MINIMIZER_RES_STR_START + 15 +#define STR_QUALITY MINIMIZER_RES_STR_START + 16 +#define STR_REMOVE_CROP_AREA MINIMIZER_RES_STR_START + 17 +#define STR_IMAGE_RESOLUTION MINIMIZER_RES_STR_START + 18 +#define STR_IMAGE_RESOLUTION_0 MINIMIZER_RES_STR_START + 19 +#define STR_IMAGE_RESOLUTION_1 MINIMIZER_RES_STR_START + 20 +#define STR_IMAGE_RESOLUTION_2 MINIMIZER_RES_STR_START + 21 +#define STR_IMAGE_RESOLUTION_3 MINIMIZER_RES_STR_START + 22 +#define STR_EMBED_LINKED_GRAPHICS MINIMIZER_RES_STR_START + 23 +#define STR_OLE_OBJECTS MINIMIZER_RES_STR_START + 24 +#define STR_OLE_OPTIMIZATION MINIMIZER_RES_STR_START + 25 +#define STR_OLE_REPLACE MINIMIZER_RES_STR_START + 26 +#define STR_ALL_OLE_OBJECTS MINIMIZER_RES_STR_START + 27 +#define STR_ALIEN_OLE_OBJECTS_ONLY MINIMIZER_RES_STR_START + 28 +#define STR_OLE_OBJECTS_DESC MINIMIZER_RES_STR_START + 29 +#define STR_NO_OLE_OBJECTS_DESC MINIMIZER_RES_STR_START + 30 +#define STR_SLIDES MINIMIZER_RES_STR_START + 31 +#define STR_CHOOSE_SLIDES MINIMIZER_RES_STR_START + 32 +#define STR_MASTER_PAGES MINIMIZER_RES_STR_START + 33 +#define STR_DELETE_MASTER_PAGES MINIMIZER_RES_STR_START + 34 +#define STR_DELETE_NOTES_PAGES MINIMIZER_RES_STR_START + 35 +#define STR_DELETE_HIDDEN_SLIDES MINIMIZER_RES_STR_START + 36 +#define STR_CUSTOM_SHOW MINIMIZER_RES_STR_START + 37 +#define STR_SUMMARY MINIMIZER_RES_STR_START + 38 +#define STR_SUMMARY_TITLE MINIMIZER_RES_STR_START + 39 +#define STR_PROGRESS MINIMIZER_RES_STR_START + 40 +#define STR_OBJECTS_OPTIMIZED MINIMIZER_RES_STR_START + 41 +#define STR_APPLY_TO_CURRENT MINIMIZER_RES_STR_START + 42 +#define STR_AUTOMATICALLY_OPEN MINIMIZER_RES_STR_START + 43 +#define STR_SAVE_SETTINGS MINIMIZER_RES_STR_START + 44 +#define STR_SAVE_AS MINIMIZER_RES_STR_START + 45 +#define STR_DELETE_SLIDES MINIMIZER_RES_STR_START + 46 +#define STR_OPTIMIZE_IMAGES MINIMIZER_RES_STR_START + 47 +#define STR_CREATE_REPLACEMENT MINIMIZER_RES_STR_START + 48 +#define STR_CURRENT_FILESIZE MINIMIZER_RES_STR_START + 49 +#define STR_ESTIMATED_FILESIZE MINIMIZER_RES_STR_START + 50 +#define STR_MB MINIMIZER_RES_STR_START + 51 +#define STR_MY_SETTINGS MINIMIZER_RES_STR_START + 52 +#define STR_DEFAULT_SESSION MINIMIZER_RES_STR_START + 53 +#define STR_MODIFY_WARNING MINIMIZER_RES_STR_START + 54 +#define STR_YES MINIMIZER_RES_STR_START + 55 +#define STR_OK MINIMIZER_RES_STR_START + 56 +#define STR_INFO_1 MINIMIZER_RES_STR_START + 57 +#define STR_INFO_2 MINIMIZER_RES_STR_START + 58 +#define STR_INFO_3 MINIMIZER_RES_STR_START + 59 +#define STR_INFO_4 MINIMIZER_RES_STR_START + 60 +#define STR_DUPLICATING_PRESENTATION MINIMIZER_RES_STR_START + 61 +#define STR_DELETING_SLIDES MINIMIZER_RES_STR_START + 62 +#define STR_OPTIMIZING_GRAPHICS MINIMIZER_RES_STR_START + 63 +#define STR_CREATING_OLE_REPLACEMENTS MINIMIZER_RES_STR_START + 64 +#define STR_FILESIZESEPARATOR MINIMIZER_RES_STR_START + 65 +#define STR_INFO_DIALOG MINIMIZER_RES_STR_START + 66 diff --git a/main/sdext/source/minimizer/minimizer.pmk b/main/sdext/source/minimizer/minimizer.pmk deleted file mode 100644 index 1839e25..0000000 --- a/main/sdext/source/minimizer/minimizer.pmk +++ /dev/null @@ -1,24 +0,0 @@ -#************************************************************** -# -# 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. -# -#************************************************************** - - - -EXTENSIONNAME:=PresentationMinimizer diff --git a/main/sdext/source/minimizer/minimizer.src b/main/sdext/source/minimizer/minimizer.src new file mode 100644 index 0000000..b4edfd4 --- /dev/null +++ b/main/sdext/source/minimizer/minimizer.src @@ -0,0 +1,379 @@ +/************************************************************** + * + * 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. + * + *************************************************************/ + +#include "minimizer.hrc" + +Bitmap IMAGE_MINIMIZER_ROADMAP +{ + File = "minimizer/minimizepresi_80.png"; +}; + +Bitmap IMAGE_MINIMIZER_ROADMAP_HC +{ + File = "minimizer/minimizepresi_80_h.png"; +}; + +String STR_PRESENTATION_MINIMIZER +{ + Text[ en-US ] = "Presentation Minimizer"; +}; + +String STR_INFO_DIALOG +{ + Text[ en-US ] = "Presentation Minimizer - Result"; +}; + +String STR_STEPS +{ + Text[ en-US ] = "Steps"; +}; + +String STR_HELP +{ + Text[ en-US ] = "~Help"; +}; + +String STR_BACK +{ + Text[ en-US ] = "< ~Back"; +}; + +String STR_NEXT +{ + Text[ en-US ] = "~Next >"; +}; + +String STR_FINISH +{ + Text[ en-US ] = "~Finish"; +}; + +String STR_CANCEL +{ + Text[ en-US ] = "Cancel"; +}; + +String STR_INTRODUCTION +{ + Text[ en-US ] = "Introduction"; +}; + +String STR_INTRODUCTION_T +{ + Text[ en-US ] = "The Presentation Minimizer is used to reduce the " + "file size of the current presentation. Images will be compressed and " + "data, that is no longer needed, will be removed.\n" + "At the last step of the wizard you can choose to apply the changes " + "to the current presentation or to create an optimized new version of" + " the presentation."; +}; + +String STR_CHOSE_SETTINGS +{ + Text[ en-US ] = "~Choose settings for Presentation Minimizer"; +}; + +String STR_REMOVE +{ + Text[ en-US ] = "~Delete"; +}; + +String STR_GRAPHIC_OPTIMIZATION +{ + Text[ en-US ] = "Choose settings for optimizing pictures and graphics"; +}; + +String STR_IMAGE_OPTIMIZATION +{ + Text[ en-US ] = "Graphics"; +}; + +String STR_LOSSLESS_COMPRESSION +{ + Text[ en-US ] = "~Lossless compression"; +}; + +String STR_JPEG_COMPRESSION +{ + Text[ en-US ] = "~JPEG compression"; +}; + +String STR_QUALITY +{ + Text[ en-US ] = "~Quality in %"; +}; + +String STR_REMOVE_CROP_AREA +{ + Text[ en-US ] = "~Delete cropped graphic areas"; +}; + +String STR_IMAGE_RESOLUTION +{ + Text[ en-US ] = "Reduce ~image resolution"; +}; + +String STR_IMAGE_RESOLUTION_0 +{ + Text[ en-US ] = ""; +}; + +String STR_IMAGE_RESOLUTION_1 +{ + Text[ en-US ] = "90;90 DPI (screen resolution)"; +}; + +String STR_IMAGE_RESOLUTION_2 +{ + Text[ en-US ] = "150;150 DPI (projector resolution)"; +}; + +String STR_IMAGE_RESOLUTION_3 +{ + Text[ en-US ] = "300;300 DPI (print resolution)"; +}; + +String STR_EMBED_LINKED_GRAPHICS +{ + Text[ en-US ] = "~Break links to external graphics"; +}; + +String STR_OLE_OBJECTS +{ + Text[ en-US ] = "OLE Objects"; +}; + +String STR_OLE_OPTIMIZATION +{ + Text[ en-US ] = "Choose settings for replacing OLE objects"; +}; + +String STR_OLE_REPLACE +{ + Text[ en-US ] = "Create static replacement graphics for OLE objects"; +}; + +String STR_ALL_OLE_OBJECTS +{ + Text[ en-US ] = "For ~all OLE objects"; +}; + +String STR_ALIEN_OLE_OBJECTS_ONLY +{ + Text[ en-US ] = "~For OLE objects not based on OpenDocument format"; +}; + +String STR_OLE_OBJECTS_DESC +{ + Text[ en-US ] = "Object Linking and Embedding (OLE) is a technology that " + "allows embedding and linking to documents and other objects.\n" + "The current presentation contains OLE objects."; +}; + +String STR_NO_OLE_OBJECTS_DESC +{ + Text[ en-US ] = "Object Linking and Embedding (OLE) is a technology that " + "allows embedding and linking to documents and other objects.\n" + "The current presentation contains no OLE objects."; +}; + +String STR_SLIDES +{ + Text[ en-US ] = "Slides"; +}; + +String STR_CHOOSE_SLIDES +{ + Text[ en-US ] = "Choose which slides to delete"; +}; + +String STR_MASTER_PAGES +{ + Text[ en-US ] = "Master Pages"; +}; + +String STR_DELETE_MASTER_PAGES +{ + Text[ en-US ] = "Delete unused ~master pages"; +}; + +String STR_DELETE_NOTES_PAGES +{ + Text[ en-US ] = "~Clear notes"; +}; + +String STR_DELETE_HIDDEN_SLIDES +{ + Text[ en-US ] = "Delete hidden ~slides"; +}; + +String STR_CUSTOM_SHOW +{ + Text[ en-US ] = "Delete slides that are not used for the ~custom slide show"; +}; + +String STR_SUMMARY +{ + Text[ en-US ] = "Summary"; +}; + +String STR_SUMMARY_TITLE +{ + Text[ en-US ] = "Choose where to apply the following changes"; +}; + +String STR_PROGRESS +{ + Text[ en-US ] = "Progress"; +}; + +String STR_OBJECTS_OPTIMIZED +{ + Text[ en-US ] = "Objects optimized"; +}; + +String STR_APPLY_TO_CURRENT +{ + Text[ en-US ] = "~Apply changes to current presentation"; +}; + +String STR_AUTOMATICALLY_OPEN +{ + Text[ en-US ] = "~Open newly created presentation"; +}; + +String STR_SAVE_SETTINGS +{ + Text[ en-US ] = "~Save settings as"; +}; + +String STR_SAVE_AS +{ + Text[ en-US ] = "~Duplicate presentation before applying changes"; +}; + +String STR_DELETE_SLIDES +{ + Text[ en-US ] = "Delete %SLIDES slides."; +}; + +String STR_OPTIMIZE_IMAGES +{ + Text[ en-US ] = "Optimize %IMAGES graphics to %QUALITY% JPEG quality at %RESOLUTION DPI."; +}; + +String STR_CREATE_REPLACEMENT +{ + Text[ en-US ] = "Create replacement graphics for %OLE objects."; +}; + +String STR_CURRENT_FILESIZE +{ + Text[ en-US ] = "Current file size:"; +}; + +String STR_ESTIMATED_FILESIZE +{ + Text[ en-US ] = "Estimated new file size:"; +}; + +String STR_MB +{ + Text[ en-US ] = "%1 MB"; +}; + +String STR_MY_SETTINGS +{ + Text[ en-US ] = "My Settings "; +}; + +String STR_DEFAULT_SESSION +{ + Text[ en-US ] = "default session"; +}; + +String STR_MODIFY_WARNING +{ + Text[ en-US ] = "The optimization will modify the current document. " + "Do you want to continue?"; +}; + +String STR_YES +{ + Text[ en-US ] = "~Yes"; +}; + +String STR_OK +{ + Text[ en-US ] = "OK"; +}; + +String STR_INFO_1 +{ + Text[ en-US ] = "The Presentation Minimizer has successfully updated the " + "presentation '%TITLE'. The file size has changed " + "from %OLDFILESIZE MB to %NEWFILESIZE MB."; +}; + +String STR_INFO_2 +{ + Text[ en-US ] = "The Presentation Minimizer has successfully updated the " + "presentation '%TITLE'. The file size has changed " + "from %OLDFILESIZE MB to approximated %NEWFILESIZE MB."; +}; + +String STR_INFO_3 +{ + Text[ en-US ] = "The Presentation Minimizer has successfully updated the " + "presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB."; +}; + +String STR_INFO_4 +{ + Text[ en-US ] = "The Presentation Minimizer has successfully updated the " + "presentation '%TITLE'. " + "The file size has changed to approximated %NEWFILESIZE MB."; +}; + +String STR_DUPLICATING_PRESENTATION +{ + Text[ en-US ] = "Duplicating presentation..."; +}; + +String STR_DELETING_SLIDES +{ + Text[ en-US ] = "Deleting slides..."; +}; + +String STR_OPTIMIZING_GRAPHICS +{ + Text[ en-US ] = "Optimizing graphics..."; +}; + +String STR_CREATING_OLE_REPLACEMENTS +{ + Text[ en-US ] = "Creating replacement graphics for OLE objects..."; +}; + +String STR_FILESIZESEPARATOR +{ + Text[ en-US ] = "."; +}; diff --git a/main/sdext/source/minimizer/optimizationstats.cxx b/main/sdext/source/minimizer/optimizationstats.cxx index 02ab3be..95a6f3e 100644 --- a/main/sdext/source/minimizer/optimizationstats.cxx +++ b/main/sdext/source/minimizer/optimizationstats.cxx @@ -31,13 +31,14 @@ #include -using namespace ::rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::beans; +using ::rtl::OUString; + // ----------------------------------------------------------------------------- OptimizationStats::OptimizationStats() diff --git a/main/sdext/source/minimizer/optimizerdialog.cxx b/main/sdext/source/minimizer/optimizerdialog.cxx index 00ffc73..566700e 100644 --- a/main/sdext/source/minimizer/optimizerdialog.cxx +++ b/main/sdext/source/minimizer/optimizerdialog.cxx @@ -34,14 +34,22 @@ #endif #include #include +#include #include +#include "minimizer.hrc" +#include "helpid.hrc" + +#define URL_GRAPHIC_REPO "private:graphicrepository" +#define IMAGE_ROADMAP URL_GRAPHIC_REPO "/minimizer/minimizepresi_80.png" +#define IMAGE_ROADMAP_HC URL_GRAPHIC_REPO "/minimizer/minimizepresi_80.png" + // ------------------- // - OPTIMIZERDIALOG - // ------------------- -using namespace ::rtl; using namespace ::com::sun::star::io; +using namespace ::com::sun::star::graphic; using namespace ::com::sun::star::ui; using namespace ::com::sun::star::awt; using namespace ::com::sun::star::ucb; @@ -53,6 +61,7 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::script; using namespace ::com::sun::star::container; +using ::rtl::OUString; // ----------------------------------------------------------------------------- @@ -62,6 +71,7 @@ void OptimizerDialog::InitDialog() OUString pNames[] = { TKGet( TK_Closeable ), TKGet( TK_Height ), + TKGet( TK_HelpURL ), TKGet( TK_Moveable ), TKGet( TK_PositionX ), TKGet( TK_PositionY ), @@ -71,10 +81,11 @@ void OptimizerDialog::InitDialog() Any pValues[] = { Any( sal_True ), Any( sal_Int32( DIALOG_HEIGHT ) ), + Any( HID( HID_SDEXT_MINIMIZER_WIZ_DLG ) ), Any( sal_True ), Any( sal_Int32( 200 ) ), Any( sal_Int32( 52 ) ), - Any( getString( STR_SUN_OPTIMIZATION_WIZARD2 ) ), + Any( getString( STR_PRESENTATION_MINIMIZER ) ), Any( sal_Int32( OD_DIALOG_WIDTH ) ) }; sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString ); @@ -124,12 +135,12 @@ void OptimizerDialog::InitRoadmap() InsertRoadmapItem( 3, sal_True, getString( STR_OLE_OBJECTS ), ITEM_ID_OLE_OPTIMIZATION ); InsertRoadmapItem( 4, sal_True, getString( STR_SUMMARY ), ITEM_ID_SUMMARY ); - rtl::OUString sBitmapPath( getPath( TK_BitmapPath ) ); - rtl::OUString sBitmap( isHighContrast() ? rtl::OUString::createFromAscii( "/minimizepresi_80_h.png" ) - : rtl::OUString::createFromAscii( "/minimizepresi_80.png" ) ); - rtl::OUString sURL( sBitmapPath += sBitmap ); + rtl::OUString sBitmap( + isHighContrast() ? + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMAGE_ROADMAP_HC ) ) : + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMAGE_ROADMAP ) ) ); - xPropertySet->setPropertyValue( TKGet( TK_ImageURL ), Any( sURL ) ); + xPropertySet->setPropertyValue( TKGet( TK_ImageURL ), Any( sBitmap ) ); xPropertySet->setPropertyValue( TKGet( TK_Activated ), Any( (sal_Bool)sal_True ) ); xPropertySet->setPropertyValue( TKGet( TK_Complete ), Any( (sal_Bool)sal_True ) ); xPropertySet->setPropertyValue( TKGet( TK_CurrentItemID ), Any( (sal_Int16)ITEM_ID_INTRODUCTION ) ); @@ -213,22 +224,21 @@ void OptimizerDialog::UpdateConfiguration() // ----------------------------------------------------------------------------- -OptimizerDialog::OptimizerDialog( const Reference< XComponentContext > &rxMSF, Reference< XFrame >& rxFrame, Reference< XDispatch > rxStatusDispatcher ) : - UnoDialog( rxMSF, rxFrame ), - ConfigurationAccess( rxMSF, NULL ), - mnCurrentStep( 0 ), - mnTabIndex( 0 ), - mxMSF( rxMSF ), - mxFrame( rxFrame ), - mxItemListener( new ItemListener( *this ) ), - mxActionListener( new ActionListener( *this ) ), - mxActionListenerListBox0Pg0( new ActionListenerListBox0Pg0( *this ) ), - mxTextListenerFormattedField0Pg1( new TextListenerFormattedField0Pg1( *this ) ), - mxTextListenerComboBox0Pg1( new TextListenerComboBox0Pg1( *this ) ), - mxSpinListenerFormattedField0Pg1( new SpinListenerFormattedField0Pg1( *this ) ), - mxStatusDispatcher( rxStatusDispatcher ) +OptimizerDialog::OptimizerDialog( + const Reference< XComponentContext > &rxContext, + const Reference< XFrame > &rxFrame, + const Reference< XWindowPeer >& rxParent ) + : UnoDialog( rxContext, rxParent ) + , ConfigurationAccess( rxContext, NULL ) + , mxFrame( rxFrame ) + , mnCurrentStep( 0 ) + , mnTabIndex( 0 ) { - Reference< XStorable > xStorable( mxController->getModel(), UNO_QUERY_THROW ); + OSL_TRACE("OptimizerDialog::OptimizerDialog"); + OSL_ENSURE( mxFrame.is(), "OptimizerDialog: no XFrame!" ); + Reference< XController > xController( mxFrame->getController() ); + mxModel = xController->getModel(); + Reference< XStorable> xStorable( mxModel, UNO_QUERY_THROW ); mbIsReadonly = xStorable->isReadonly(); InitDialog(); @@ -242,29 +252,54 @@ OptimizerDialog::OptimizerDialog( const Reference< XComponentContext > &rxMSF, R ActivatePage( 0 ); OptimizationStats aStats; - aStats.InitializeStatusValuesFromDocument( mxController->getModel() ); + aStats.InitializeStatusValuesFromDocument( mxModel ); Sequence< PropertyValue > aStatusSequence( aStats.GetStatusSequence() ); UpdateStatus( aStatusSequence ); + + centerDialog(); } // ----------------------------------------------------------------------------- OptimizerDialog::~OptimizerDialog() { + OSL_TRACE("OptimizerDialog::~OptimizerDialog"); // not saving configuration if the dialog has been finished via cancel or close window if ( mbStatus ) SaveConfiguration(); + + Reference< XComponent > xComponent( mxDialog, UNO_QUERY ); + if ( xComponent.is() ) + { + OSL_TRACE("OptimizerDialog::~OptimizerDialog - disposing dialog!"); + xComponent->dispose(); + } } + +void SAL_CALL OptimizerDialog::statusChanged( + const ::com::sun::star::frame::FeatureStateEvent& aState ) +throw (::com::sun::star::uno::RuntimeException) +{ + Sequence< PropertyValue > aArguments; + if ( ( aState.State >>= aArguments ) && aArguments.getLength() ) + UpdateStatus( aArguments ); +} + +void SAL_CALL OptimizerDialog::disposing( + const ::com::sun::star::lang::EventObject& /*aSource*/ ) +throw (::com::sun::star::uno::RuntimeException) +{} + // ----------------------------------------------------------------------------- sal_Bool OptimizerDialog::execute() { Reference< XItemEventBroadcaster > maRoadmapBroadcaster( mxRoadmapControl, UNO_QUERY_THROW ); - maRoadmapBroadcaster->addItemListener( mxItemListener ); + maRoadmapBroadcaster->addItemListener( this ); UnoDialog::execute(); UpdateConfiguration(); // taking actual control settings for the configuration - maRoadmapBroadcaster->removeItemListener( mxItemListener ); + maRoadmapBroadcaster->removeItemListener( this ); return mbStatus; } @@ -350,7 +385,7 @@ void OptimizerDialog::UpdateStatus( const com::sun::star::uno::Sequence< com::su if ( *pVal >>= sStatus ) { setControlProperty( TKGet( TK_FixedText1Pg4 ), TKGet( TK_Enabled ), Any( sal_True ) ); - setControlProperty( TKGet( TK_FixedText1Pg4 ), TKGet( TK_Label ), Any( getString( TKGet( sStatus ) ) ) ); + setControlProperty( TKGet( TK_FixedText1Pg4 ), TKGet( TK_Label ), Any( sStatus ) ); } } pVal = maStats.GetStatusValue( TK_Progress ); @@ -370,7 +405,7 @@ void OptimizerDialog::UpdateStatus( const com::sun::star::uno::Sequence< com::su // ----------------------------------------------------------------------------- -void ItemListener::itemStateChanged( const ItemEvent& Event ) +void OptimizerDialog::itemStateChanged( const ItemEvent& Event ) throw ( RuntimeException ) { try @@ -388,28 +423,28 @@ void ItemListener::itemStateChanged( const ItemEvent& Event ) { case TK_rdmNavi : { - mrOptimizerDialog.SwitchPage( static_cast< sal_Int16 >( Event.ItemId ) ); + SwitchPage( static_cast< sal_Int16 >( Event.ItemId ) ); } break; case TK_CheckBox1Pg1 : { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) - mrOptimizerDialog.SetConfigProperty( TK_RemoveCropArea, Any( nState != 0 ) ); + SetConfigProperty( TK_RemoveCropArea, Any( nState != 0 ) ); } break; case TK_CheckBox2Pg1 : { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) - mrOptimizerDialog.SetConfigProperty( TK_EmbedLinkedGraphics, Any( nState != 0 ) ); + SetConfigProperty( TK_EmbedLinkedGraphics, Any( nState != 0 ) ); } break; case TK_CheckBox0Pg2 : { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) { - mrOptimizerDialog.SetConfigProperty( TK_OLEOptimization, Any( nState != 0 ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_RadioButton0Pg2 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_RadioButton1Pg2 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); + SetConfigProperty( TK_OLEOptimization, Any( nState != 0 ) ); + setControlProperty( TKGet( TK_RadioButton0Pg2 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); + setControlProperty( TKGet( TK_RadioButton1Pg2 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); } } break; @@ -419,9 +454,9 @@ void ItemListener::itemStateChanged( const ItemEvent& Event ) if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nInt16 ) { nInt16 ^= 1; - mrOptimizerDialog.SetConfigProperty( TK_JPEGCompression, Any( nInt16 != 0 ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_FixedText1Pg1 ), TKGet( TK_Enabled ), Any( nInt16 != 0 ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_Enabled ), Any( nInt16 != 0 ) ); + SetConfigProperty( TK_JPEGCompression, Any( nInt16 != 0 ) ); + setControlProperty( TKGet( TK_FixedText1Pg1 ), TKGet( TK_Enabled ), Any( nInt16 != 0 ) ); + setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_Enabled ), Any( nInt16 != 0 ) ); } } break; @@ -429,9 +464,9 @@ void ItemListener::itemStateChanged( const ItemEvent& Event ) { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) { - mrOptimizerDialog.SetConfigProperty( TK_JPEGCompression, Any( nState != 0 ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_FixedText1Pg1 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); + SetConfigProperty( TK_JPEGCompression, Any( nState != 0 ) ); + setControlProperty( TKGet( TK_FixedText1Pg1 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); + setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); } } break; @@ -441,51 +476,51 @@ void ItemListener::itemStateChanged( const ItemEvent& Event ) if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nInt16 ) { nInt16 ^= 1; - mrOptimizerDialog.SetConfigProperty( TK_OLEOptimizationType, Any( nInt16 ) ); + SetConfigProperty( TK_OLEOptimizationType, Any( nInt16 ) ); } } break; case TK_RadioButton1Pg2 : { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) - mrOptimizerDialog.SetConfigProperty( TK_OLEOptimizationType, Any( nState ) ); + SetConfigProperty( TK_OLEOptimizationType, Any( nState ) ); } break; case TK_CheckBox0Pg3 : { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) - mrOptimizerDialog.SetConfigProperty( TK_DeleteUnusedMasterPages, Any( nState != 0 ) ); + SetConfigProperty( TK_DeleteUnusedMasterPages, Any( nState != 0 ) ); } break; case TK_CheckBox1Pg3 : { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) - mrOptimizerDialog.SetConfigProperty( TK_DeleteNotesPages, Any( nState != 0 ) ); + SetConfigProperty( TK_DeleteNotesPages, Any( nState != 0 ) ); } break; case TK_CheckBox2Pg3 : { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) - mrOptimizerDialog.SetConfigProperty( TK_DeleteHiddenSlides, Any( nState != 0 ) ); + SetConfigProperty( TK_DeleteHiddenSlides, Any( nState != 0 ) ); } break; case TK_CheckBox3Pg3 : { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) - mrOptimizerDialog.setControlProperty( TKGet( TK_ListBox0Pg3 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); + setControlProperty( TKGet( TK_ListBox0Pg3 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); } break; case TK_CheckBox1Pg4 : { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) - mrOptimizerDialog.setControlProperty( TKGet( TK_ComboBox0Pg4 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); + setControlProperty( TKGet( TK_ComboBox0Pg4 ), TKGet( TK_Enabled ), Any( nState != 0 ) ); } break; case TK_RadioButton0Pg4 : case TK_RadioButton1Pg4 : { if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState ) - mrOptimizerDialog.SetConfigProperty( TK_SaveAs, Any( eControl == TK_RadioButton1Pg4 ? nState != 0 : nState == 0 ) ); + SetConfigProperty( TK_SaveAs, Any( eControl == TK_RadioButton1Pg4 ? nState != 0 : nState == 0 ) ); } break; default: @@ -495,93 +530,42 @@ void ItemListener::itemStateChanged( const ItemEvent& Event ) } catch ( Exception& ) { - } } -void ItemListener::disposing( const ::com::sun::star::lang::EventObject& /* Source */ ) - throw ( com::sun::star::uno::RuntimeException ) -{ -} // ----------------------------------------------------------------------------- -void ActionListener::actionPerformed( const ActionEvent& rEvent ) +void OptimizerDialog::actionPerformed( const ActionEvent& rEvent ) throw ( com::sun::star::uno::RuntimeException ) { switch( TKGet( rEvent.ActionCommand ) ) { - case TK_btnNavHelp : - { - try - { - static Reference< XFrame > xHelpFrame; - if ( !xHelpFrame.is() ) - { - rtl::OUString sHelpFile( mrOptimizerDialog.getPath( TK_HelpFile ) ); - Reference< XDesktop > desktop( mrOptimizerDialog.GetComponentContext()->getServiceManager()->createInstanceWithContext( - OUString::createFromAscii( "com.sun.star.frame.Desktop" ), mrOptimizerDialog.GetComponentContext() ), UNO_QUERY_THROW ); - Reference< XSimpleFileAccess > xSimpleFileAccess( mrOptimizerDialog.GetComponentContext()->getServiceManager()->createInstanceWithContext( - OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), mrOptimizerDialog.GetComponentContext() ), UNO_QUERY_THROW ); - Reference< XInputStream > xInputStream( xSimpleFileAccess->openFileRead( sHelpFile ) ); - Reference< XDesktop > xDesktop( mrOptimizerDialog.GetComponentContext()->getServiceManager()->createInstanceWithContext( - OUString::createFromAscii( "com.sun.star.frame.Desktop" ), mrOptimizerDialog.GetComponentContext() ), UNO_QUERY_THROW ); - Reference< XFrame > xDesktopFrame( xDesktop, UNO_QUERY_THROW ); - xHelpFrame = Reference< XFrame >( xDesktopFrame->findFrame( TKGet( TK__blank ), 0 ) ); - Reference< XCloseBroadcaster > xCloseBroadcaster( xHelpFrame, UNO_QUERY_THROW ); - xCloseBroadcaster->addCloseListener( new HelpCloseListener( xHelpFrame ) ); - Reference< XComponentLoader > xLoader( xHelpFrame, UNO_QUERY_THROW ); - - Sequence< PropertyValue > aLoadProps( 2 ); - aLoadProps[ 0 ].Name = TKGet( TK_ReadOnly ); - aLoadProps[ 0 ].Value <<= (sal_Bool)( sal_True ); - aLoadProps[ 1 ].Name = TKGet( TK_InputStream ); - aLoadProps[ 1 ].Value <<= xInputStream; - - Reference< XComponent >( xLoader->loadComponentFromURL( OUString::createFromAscii( "private:stream" ), - TKGet( TK__self ), 0, aLoadProps ) ); - - Reference< XPropertySet > xPropSet( xHelpFrame, UNO_QUERY_THROW ); - Reference< XLayoutManager > xLayoutManager; - if ( xPropSet->getPropertyValue( OUString::createFromAscii( "LayoutManager" ) ) >>= xLayoutManager ) - { - xLayoutManager->setVisible( sal_False ); - xLayoutManager->hideElement( OUString::createFromAscii( "private:resource/menubar/menubar" ) ); - xLayoutManager->destroyElement( OUString::createFromAscii( "private:resource/statusbar/statusbar" ) ); - } - } - } - catch( Exception& ) - { - - } - } - break; - case TK_btnNavBack : mrOptimizerDialog.SwitchPage( mrOptimizerDialog.mnCurrentStep - 1 ); break; - case TK_btnNavNext : mrOptimizerDialog.SwitchPage( mrOptimizerDialog.mnCurrentStep + 1 ); break; + case TK_btnNavBack : SwitchPage( mnCurrentStep - 1 ); break; + case TK_btnNavNext : SwitchPage( mnCurrentStep + 1 ); break; case TK_btnNavFinish : { - mrOptimizerDialog.UpdateConfiguration(); + UpdateConfiguration(); - mrOptimizerDialog.SwitchPage( ITEM_ID_SUMMARY ); - mrOptimizerDialog.DisablePage( ITEM_ID_SUMMARY ); - mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavHelp ), TKGet( TK_Enabled ), Any( sal_False ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavBack ), TKGet( TK_Enabled ), Any( sal_False ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_Enabled ), Any( sal_False ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavFinish ), TKGet( TK_Enabled ), Any( sal_False ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavCancel ), TKGet( TK_Enabled ), Any( sal_False ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_FixedText0Pg4 ), TKGet( TK_Enabled ), Any( sal_True ) ); + SwitchPage( ITEM_ID_SUMMARY ); + DisablePage( ITEM_ID_SUMMARY ); + setControlProperty( TKGet( TK_btnNavHelp ), TKGet( TK_Enabled ), Any( sal_False ) ); + setControlProperty( TKGet( TK_btnNavBack ), TKGet( TK_Enabled ), Any( sal_False ) ); + setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_Enabled ), Any( sal_False ) ); + setControlProperty( TKGet( TK_btnNavFinish ), TKGet( TK_Enabled ), Any( sal_False ) ); + setControlProperty( TKGet( TK_btnNavCancel ), TKGet( TK_Enabled ), Any( sal_False ) ); + setControlProperty( TKGet( TK_FixedText0Pg4 ), TKGet( TK_Enabled ), Any( sal_True ) ); // check if we have to open the FileDialog sal_Bool bSuccessfullyExecuted = sal_True; sal_Int16 nInt16 = 0; - mrOptimizerDialog.getControlProperty( TKGet( TK_RadioButton1Pg4 ), TKGet( TK_State ) ) >>= nInt16; + getControlProperty( TKGet( TK_RadioButton1Pg4 ), TKGet( TK_State ) ) >>= nInt16; if ( nInt16 ) { rtl::OUString aSaveAsURL; - FileOpenDialog aFileOpenDialog( ((UnoDialog&)mrOptimizerDialog).mxMSF ); + FileOpenDialog aFileOpenDialog( mxContext, Reference< XWindow >( mxParent, UNO_QUERY ) ); // generating default file name - Reference< XStorable > xStorable( mrOptimizerDialog.mxController->getModel(), UNO_QUERY ); + Reference< XStorable > xStorable( mxModel, UNO_QUERY ); if ( xStorable.is() && xStorable->hasLocation() ) { rtl::OUString aLocation( xStorable->getLocation() ); @@ -608,8 +592,8 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent ) if ( bDialogExecuted ) { aSaveAsURL = aFileOpenDialog.getURL(); - mrOptimizerDialog.SetConfigProperty( TK_SaveAsURL, Any( aSaveAsURL ) ); - mrOptimizerDialog.SetConfigProperty( TK_FilterName, Any( aFileOpenDialog.getFilterName() ) ); + SetConfigProperty( TK_SaveAsURL, Any( aSaveAsURL ) ); + SetConfigProperty( TK_FilterName, Any( aFileOpenDialog.getFilterName() ) ); } if ( !aSaveAsURL.getLength() ) { @@ -618,23 +602,23 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent ) } // waiting for 500ms - if ( mrOptimizerDialog.mxReschedule.is() ) + if ( mxReschedule.is() ) { - mrOptimizerDialog.mxReschedule->reschedule(); + mxReschedule->reschedule(); for ( sal_uInt32 i = osl_getGlobalTimer(); ( i + 500 ) > ( osl_getGlobalTimer() ); ) - mrOptimizerDialog.mxReschedule->reschedule(); + mxReschedule->reschedule(); } } if ( bSuccessfullyExecuted ) { // now check if we have to store a session template nInt16 = 0; OUString aSettingsName; - mrOptimizerDialog.getControlProperty( TKGet( TK_CheckBox1Pg4 ), TKGet( TK_State ) ) >>= nInt16; - mrOptimizerDialog.getControlProperty( TKGet( TK_ComboBox0Pg4 ), TKGet( TK_Text ) ) >>= aSettingsName; + getControlProperty( TKGet( TK_CheckBox1Pg4 ), TKGet( TK_State ) ) >>= nInt16; + getControlProperty( TKGet( TK_ComboBox0Pg4 ), TKGet( TK_Text ) ) >>= aSettingsName; if ( nInt16 && aSettingsName.getLength() ) { - std::vector< OptimizerSettings >::iterator aIter( mrOptimizerDialog.GetOptimizerSettingsByName( aSettingsName ) ); - std::vector< OptimizerSettings >& rSettings( mrOptimizerDialog.GetOptimizerSettings() ); + std::vector< OptimizerSettings >::iterator aIter( GetOptimizerSettingsByName( aSettingsName ) ); + std::vector< OptimizerSettings >& rSettings( GetOptimizerSettings() ); OptimizerSettings aNewSettings( rSettings[ 0 ] ); aNewSettings.maName = aSettingsName; if ( aIter == rSettings.end() ) @@ -646,10 +630,10 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent ) if ( bSuccessfullyExecuted ) { Sequence< Any > aArgs( 1 ); - aArgs[ 0 ] <<= mrOptimizerDialog.GetFrame(); + aArgs[ 0 ] <<= mxFrame; - Reference < XDispatch > xDispatch( mrOptimizerDialog.GetComponentContext()->getServiceManager()->createInstanceWithArgumentsAndContext( - OUString::createFromAscii( "com.sun.star.comp.PPPOptimizer" ), aArgs, mrOptimizerDialog.GetComponentContext() ), UNO_QUERY ); + Reference < XDispatch > xDispatch( mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( + OUString::createFromAscii( "com.sun.star.comp.PPPOptimizer" ), aArgs, mxContext ), UNO_QUERY ); URL aURL; aURL.Protocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.com.sun.star.comp.PPPOptimizer:" ) ); @@ -657,179 +641,151 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent ) Sequence< PropertyValue > lArguments( 3 ); lArguments[ 0 ].Name = TKGet( TK_Settings ); - lArguments[ 0 ].Value <<= mrOptimizerDialog.GetConfigurationSequence(); - lArguments[ 1 ].Name = TKGet( TK_StatusDispatcher ); - lArguments[ 1 ].Value <<= mrOptimizerDialog.GetStatusDispatcher(); - lArguments[ 2 ].Name = TKGet( TK_InformationDialog ); - lArguments[ 2 ].Value <<= mrOptimizerDialog.GetFrame(); + lArguments[ 0 ].Value <<= GetConfigurationSequence(); + lArguments[ 1 ].Name = TKGet( TK_StatusListener ); + lArguments[ 1 ].Value <<= Reference< XStatusListener >( this ); + lArguments[ 2 ].Name = TKGet( TK_ParentWindow ); + lArguments[ 2 ].Value <<= mxDialogWindowPeer; if( xDispatch.is() ) xDispatch->dispatch( aURL, lArguments ); - mrOptimizerDialog.endExecute( bSuccessfullyExecuted ); + endExecute( bSuccessfullyExecuted ); } else { - mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavHelp ), TKGet( TK_Enabled ), Any( sal_True ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavBack ), TKGet( TK_Enabled ), Any( sal_True ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_Enabled ), Any( sal_False ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavFinish ), TKGet( TK_Enabled ), Any( sal_True ) ); - mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavCancel ), TKGet( TK_Enabled ), Any( sal_True ) ); - mrOptimizerDialog.EnablePage( ITEM_ID_SUMMARY ); + setControlProperty( TKGet( TK_btnNavHelp ), TKGet( TK_Enabled ), Any( sal_True ) ); + setControlProperty( TKGet( TK_btnNavBack ), TKGet( TK_Enabled ), Any( sal_True ) ); + setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_Enabled ), Any( sal_False ) ); + setControlProperty( TKGet( TK_btnNavFinish ), TKGet( TK_Enabled ), Any( sal_True ) ); + setControlProperty( TKGet( TK_btnNavCancel ), TKGet( TK_Enabled ), Any( sal_True ) ); + EnablePage( ITEM_ID_SUMMARY ); } } break; - case TK_btnNavCancel : mrOptimizerDialog.endExecute( sal_False ); break; + case TK_btnNavCancel : endExecute( sal_False ); break; case TK_Button0Pg0 : // delete configuration { - OUString aSelectedItem( mrOptimizerDialog.GetSelectedString( TK_ListBox0Pg0 ) ); + OUString aSelectedItem( GetSelectedString( TK_ListBox0Pg0 ) ); if ( aSelectedItem.getLength() ) { - std::vector< OptimizerSettings >::iterator aIter( mrOptimizerDialog.GetOptimizerSettingsByName( aSelectedItem ) ); - std::vector< OptimizerSettings >& rList( mrOptimizerDialog.GetOptimizerSettings() ); + std::vector< OptimizerSettings >::iterator aIter( GetOptimizerSettingsByName( aSelectedItem ) ); + std::vector< OptimizerSettings >& rList( GetOptimizerSettings() ); if ( aIter != rList.end() ) { rList.erase( aIter ); - mrOptimizerDialog.UpdateControlStates(); + UpdateControlStates(); } } } break; - default: break; + default: + { + Reference< XControl > xControl( rEvent.Source, UNO_QUERY ); + if ( xControl.is() ) + { + OUString aName; + Reference< XPropertySet > xProps( xControl->getModel(), UNO_QUERY ); + xProps->getPropertyValue( TKGet( TK_Name ) ) >>= aName; + if ( TKGet( aName ) == TK_ListBox0Pg0 ) + { + if ( rEvent.ActionCommand.getLength() ) + { + std::vector< OptimizerSettings >::iterator aIter( GetOptimizerSettingsByName( rEvent.ActionCommand ) ); + std::vector< OptimizerSettings >& rList( GetOptimizerSettings() ); + if ( aIter != rList.end() ) + rList[ 0 ] = *aIter; + } + UpdateControlStates(); + } + } + } + break; } } -void ActionListener::disposing( const ::com::sun::star::lang::EventObject& /* Source */ ) - throw ( com::sun::star::uno::RuntimeException ) -{ -} // ----------------------------------------------------------------------------- -void ActionListenerListBox0Pg0::actionPerformed( const ActionEvent& rEvent ) +void OptimizerDialog::textChanged( const TextEvent& rEvent ) throw ( com::sun::star::uno::RuntimeException ) { - if ( rEvent.ActionCommand.getLength() ) - { - std::vector< OptimizerSettings >::iterator aIter( mrOptimizerDialog.GetOptimizerSettingsByName( rEvent.ActionCommand ) ); - std::vector< OptimizerSettings >& rList( mrOptimizerDialog.GetOptimizerSettings() ); - if ( aIter != rList.end() ) - rList[ 0 ] = *aIter; - } - mrOptimizerDialog.UpdateControlStates(); -} -void ActionListenerListBox0Pg0::disposing( const ::com::sun::star::lang::EventObject& /* Source */ ) - throw ( com::sun::star::uno::RuntimeException ) -{ -} - -// ----------------------------------------------------------------------------- - -void TextListenerFormattedField0Pg1::textChanged( const TextEvent& /* rEvent */ ) - throw ( com::sun::star::uno::RuntimeException ) -{ - double fDouble = 0; - Any aAny = mrOptimizerDialog.getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) ); - if ( aAny >>= fDouble ) - mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) ); -} -void TextListenerFormattedField0Pg1::disposing( const ::com::sun::star::lang::EventObject& /* Source */ ) - throw ( com::sun::star::uno::RuntimeException ) -{ -} - -// ----------------------------------------------------------------------------- + Reference< XSpinField > xFormattedField( rEvent.Source, UNO_QUERY ); + if ( xFormattedField.is() ) + { + double fDouble = 0; + Any aAny = getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) ); + if ( aAny >>= fDouble ) + SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) ); + return; + } -void TextListenerComboBox0Pg1::textChanged( const TextEvent& /* rEvent */ ) - throw ( com::sun::star::uno::RuntimeException ) -{ - rtl::OUString aString; - Any aAny = mrOptimizerDialog.getControlProperty( TKGet( TK_ComboBox0Pg1 ), TKGet( TK_Text ) ); - if ( aAny >>= aString ) - { - sal_Int32 nI0, nI1, nI2, nI3, nI4; - nI0 = nI1 = nI2 = nI3 = nI4 = 0; - - if ( mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_0 ).getToken( 1, ';', nI0 ) == aString ) - aString = mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_0 ).getToken( 0, ';', nI4 ); - else if ( mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_1 ).getToken( 1, ';', nI1 ) == aString ) - aString = mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_1 ).getToken( 0, ';', nI4 ); - else if ( mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_2 ).getToken( 1, ';', nI2 ) == aString ) - aString = mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_2 ).getToken( 0, ';', nI4 ); - else if ( mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_3 ).getToken( 1, ';', nI3 ) == aString ) - aString = mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_3 ).getToken( 0, ';', nI4 ); - - mrOptimizerDialog.SetConfigProperty( TK_ImageResolution, Any( aString.toInt32() ) ); - } -} -void TextListenerComboBox0Pg1::disposing( const ::com::sun::star::lang::EventObject& /* Source */ ) - throw ( com::sun::star::uno::RuntimeException ) -{ + Reference< XComboBox > xComboBox( rEvent.Source, UNO_QUERY ); + if ( xComboBox.is() ) + { + rtl::OUString aString; + Any aAny = getControlProperty( TKGet( TK_ComboBox0Pg1 ), TKGet( TK_Text ) ); + if ( aAny >>= aString ) + { + sal_Int32 nI0, nI1, nI2, nI3, nI4; + nI0 = nI1 = nI2 = nI3 = nI4 = 0; + + if ( getString( STR_IMAGE_RESOLUTION_0 ).getToken( 1, ';', nI0 ) == aString ) + aString = getString( STR_IMAGE_RESOLUTION_0 ).getToken( 0, ';', nI4 ); + else if ( getString( STR_IMAGE_RESOLUTION_1 ).getToken( 1, ';', nI1 ) == aString ) + aString = getString( STR_IMAGE_RESOLUTION_1 ).getToken( 0, ';', nI4 ); + else if ( getString( STR_IMAGE_RESOLUTION_2 ).getToken( 1, ';', nI2 ) == aString ) + aString = getString( STR_IMAGE_RESOLUTION_2 ).getToken( 0, ';', nI4 ); + else if ( getString( STR_IMAGE_RESOLUTION_3 ).getToken( 1, ';', nI3 ) == aString ) + aString = getString( STR_IMAGE_RESOLUTION_3 ).getToken( 0, ';', nI4 ); + + SetConfigProperty( TK_ImageResolution, Any( aString.toInt32() ) ); + } + } } // ----------------------------------------------------------------------------- -void SpinListenerFormattedField0Pg1::up( const SpinEvent& /* rEvent */ ) +void OptimizerDialog::up( const SpinEvent& /* rEvent */ ) throw ( com::sun::star::uno::RuntimeException ) { double fDouble; - Any aAny = mrOptimizerDialog.getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) ); + Any aAny = getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) ); if ( aAny >>= fDouble ) { fDouble += 9; if ( fDouble > 100 ) fDouble = 100; - mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) ); - mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) ); + setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) ); + SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) ); } } -void SpinListenerFormattedField0Pg1::down( const SpinEvent& /* rEvent */ ) + +void OptimizerDialog::down( const SpinEvent& /* rEvent */ ) throw ( com::sun::star::uno::RuntimeException ) { double fDouble; - Any aAny = mrOptimizerDialog.getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) ); + Any aAny = getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) ); if ( aAny >>= fDouble ) { fDouble -= 9; if ( fDouble < 0 ) fDouble = 0; - mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) ); - mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) ); + setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) ); + SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) ); } } -void SpinListenerFormattedField0Pg1::first( const SpinEvent& /* rEvent */ ) - throw ( com::sun::star::uno::RuntimeException ) -{ - mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( static_cast< double >( 0 ) ) ); - mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)0 ) ); -} -void SpinListenerFormattedField0Pg1::last( const SpinEvent& /* rEvent */ ) + +void OptimizerDialog::first( const SpinEvent& /* rEvent */ ) throw ( com::sun::star::uno::RuntimeException ) { - mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( static_cast< double >( 100 ) ) ); - mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)100 ) ); + setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( static_cast< double >( 0 ) ) ); + SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)0 ) ); } -void SpinListenerFormattedField0Pg1::disposing( const ::com::sun::star::lang::EventObject& /* Source */ ) + +void OptimizerDialog::last( const SpinEvent& /* rEvent */ ) throw ( com::sun::star::uno::RuntimeException ) { + setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( static_cast< double >( 100 ) ) ); + SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)100 ) ); } -// ----------------------------------------------------------------------------- - -void HelpCloseListener::addCloseListener( const Reference < XCloseListener >& ) throw( RuntimeException ) -{ -} -void HelpCloseListener::removeCloseListener( const Reference < XCloseListener >& ) throw( RuntimeException ) -{ -} -void HelpCloseListener::queryClosing( const EventObject&, sal_Bool /* bDeliverOwnership */ ) - throw ( RuntimeException, CloseVetoException ) -{ -} -void HelpCloseListener::notifyClosing( const EventObject& ) - throw ( RuntimeException ) -{ -} -void HelpCloseListener::disposing( const EventObject& ) throw ( RuntimeException ) -{ - mrXFrame = NULL; -} diff --git a/main/sdext/source/minimizer/optimizerdialog.hxx b/main/sdext/source/minimizer/optimizerdialog.hxx index 686a1bd..e31a511 100644 --- a/main/sdext/source/minimizer/optimizerdialog.hxx +++ b/main/sdext/source/minimizer/optimizerdialog.hxx @@ -51,6 +51,8 @@ #include #include #include +#include +#include #define MAX_STEP 4 #define OD_DIALOG_WIDTH 330 @@ -66,36 +68,47 @@ // ------------------- // - OPTIMIZERDIALOG - // ------------------- -class OptimizerDialog : public UnoDialog, public ConfigurationAccess + +typedef ::cppu::WeakImplHelper5< + com::sun::star::frame::XStatusListener, + com::sun::star::awt::XSpinListener, + com::sun::star::awt::XItemListener, + com::sun::star::awt::XActionListener, + com::sun::star::awt::XTextListener > OptimizerDialog_Base; + +class OptimizerDialog : public UnoDialog, public ConfigurationAccess, public OptimizerDialog_Base { public : - OptimizerDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rxFrame, - com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > rxStatusDispatcher ); + OptimizerDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, + const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame, + const com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer >& rxParent ); ~OptimizerDialog(); - sal_Bool execute(); + virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& aState ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aSource ) throw (::com::sun::star::uno::RuntimeException); - sal_Int16 mnCurrentStep; - sal_Int16 mnTabIndex; - sal_Bool mbIsReadonly; + virtual void SAL_CALL up( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL down( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL first( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL last( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); -private : - com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >mxMSF; - com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame; + sal_Bool execute(); +private : + com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame; + sal_Int16 mnCurrentStep; + sal_Int16 mnTabIndex; + sal_Bool mbIsReadonly; + com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel; com::sun::star::uno::Reference< com::sun::star::uno::XInterface > mxRoadmapControl; com::sun::star::uno::Reference< com::sun::star::uno::XInterface > mxRoadmapControlModel; - com::sun::star::uno::Reference< com::sun::star::awt::XItemListener > mxItemListener; - com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > mxActionListener; - com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > mxActionListenerListBox0Pg0; - com::sun::star::uno::Reference< com::sun::star::awt::XTextListener > mxTextListenerFormattedField0Pg1; - com::sun::star::uno::Reference< com::sun::star::awt::XTextListener > mxTextListenerComboBox0Pg1; - com::sun::star::uno::Reference< com::sun::star::awt::XSpinListener > mxSpinListenerFormattedField0Pg1; - com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > mxStatusDispatcher; - std::vector< std::vector< rtl::OUString > > maControlPages; + OptimizationStats maStats; void InitDialog(); void InitRoadmap(); @@ -113,133 +126,90 @@ private : void ActivatePage( sal_Int16 nStep ); void DeactivatePage( sal_Int16 nStep ); - void InsertRoadmapItem( const sal_Int32 nIndex, const sal_Bool bEnabled, const rtl::OUString& rLabel, const sal_Int32 nItemID ); - -public : - - OptimizationStats maStats; - - void UpdateStatus( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rStatus ); - - // the ConfigurationAccess is updated to actual control settings - void UpdateConfiguration(); - - void EnablePage( sal_Int16 nStep ); - void DisablePage( sal_Int16 nStep ); - - void SwitchPage( sal_Int16 nNewStep ); - void UpdateControlStates( sal_Int16 nStep = -1 ); - - rtl::OUString GetSelectedString( PPPOptimizerTokenEnum eListBox ); - com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >& GetStatusDispatcher() { return mxStatusDispatcher; }; - com::sun::star::uno::Reference< com::sun::star::frame::XFrame>& GetFrame() { return mxFrame; }; - const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& GetComponentContext() { return mxMSF; }; + void EnablePage( sal_Int16 nStep ); + void DisablePage( sal_Int16 nStep ); + void SwitchPage( sal_Int16 nNewStep ); + + // the ConfigurationAccess is updated to actual control settings + void UpdateConfiguration(); + void UpdateStatus( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rStatus ); + void UpdateControlStates( sal_Int16 nStep = -1 ); + + rtl::OUString GetSelectedString( PPPOptimizerTokenEnum eListBox ); + void ImplSetBold( const rtl::OUString& rControl ); + void InsertRoadmapItem( const sal_Int32 nIndex, + const sal_Bool bEnabled, + const rtl::OUString& rLabel, + const sal_Int32 nItemID ); + rtl::OUString ImplInsertSeparator( const rtl::OUString& rControlName, + sal_Int32 nOrientation, + sal_Int32 nPosX, + sal_Int32 nPosY, + sal_Int32 nWidth, + sal_Int32 nHeight ); + rtl::OUString ImplInsertButton( const rtl::OUString& rControlName, + const rtl::OUString& rHelpURL, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex, + sal_Bool bEnabled, + sal_Int32 nResID, + sal_Int16 nPushButtonType ); + rtl::OUString ImplInsertFixedText( const rtl::OUString& rControlName, + const rtl::OUString& rLabel, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Bool bMultiLine, + sal_Bool bBold, + sal_Int16 nTabIndex ); + rtl::OUString ImplInsertCheckBox( const rtl::OUString& rControlName, + const rtl::OUString& rLabel, + const rtl::OUString& rHelpURL, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex ); + rtl::OUString ImplInsertFormattedField( const rtl::OUString& rControlName, + const rtl::OUString& rHelpURL, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + double fEffectiveMin, + double fEffectiveMax, + sal_Int16 nTabIndex ); + rtl::OUString ImplInsertComboBox( const rtl::OUString& rControlName, + const rtl::OUString& rHelpURL, + const sal_Bool bEnabled, + const com::sun::star::uno::Sequence< rtl::OUString >& rItemList, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex, + bool bListen = true ); + rtl::OUString ImplInsertRadioButton( const rtl::OUString& rControlName, + const rtl::OUString& rLabel, + const rtl::OUString& rHelpURL, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Bool bMultiLine, + sal_Int16 nTabIndex ); + rtl::OUString ImplInsertListBox( const rtl::OUString& rControlName, + const rtl::OUString& rHelpURL, + const sal_Bool bEnabled, + const com::sun::star::uno::Sequence< rtl::OUString >& rItemList, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex ); }; -// ----------------------------------------------------------------------------- - -class ItemListener : public ::cppu::WeakImplHelper1< com::sun::star::awt::XItemListener > -{ -public: - ItemListener( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){}; - - virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException); -private: - - OptimizerDialog& mrOptimizerDialog; -}; - -// ----------------------------------------------------------------------------- - -class ActionListener : public ::cppu::WeakImplHelper1< com::sun::star::awt::XActionListener > -{ -public: - ActionListener( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){}; - - virtual void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException); -private: - - OptimizerDialog& mrOptimizerDialog; -}; - -// ----------------------------------------------------------------------------- - -class ActionListenerListBox0Pg0 : public ::cppu::WeakImplHelper1< com::sun::star::awt::XActionListener > -{ -public: - ActionListenerListBox0Pg0( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){}; - - virtual void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException); -private: - - OptimizerDialog& mrOptimizerDialog; -}; - -// ----------------------------------------------------------------------------- - -class TextListenerFormattedField0Pg1 : public ::cppu::WeakImplHelper1< com::sun::star::awt::XTextListener > -{ -public: - TextListenerFormattedField0Pg1( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){}; - - virtual void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException); -private: - - OptimizerDialog& mrOptimizerDialog; -}; - -// ----------------------------------------------------------------------------- - -class TextListenerComboBox0Pg1 : public ::cppu::WeakImplHelper1< com::sun::star::awt::XTextListener > -{ -public: - TextListenerComboBox0Pg1( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){}; - - virtual void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException); -private: - - OptimizerDialog& mrOptimizerDialog; -}; - -// ----------------------------------------------------------------------------- - -class SpinListenerFormattedField0Pg1 : public ::cppu::WeakImplHelper1< com::sun::star::awt::XSpinListener > -{ -public: - SpinListenerFormattedField0Pg1( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){}; - - virtual void SAL_CALL up( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL down( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL first( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL last( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException); -private: - - OptimizerDialog& mrOptimizerDialog; -}; - -// ----------------------------------------------------------------------------- - -class HelpCloseListener : public ::cppu::WeakImplHelper1< com::sun::star::util::XCloseListener > -{ -public: - HelpCloseListener( com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rXFrame ) : mrXFrame( rXFrame ){}; - - virtual void SAL_CALL addCloseListener(const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& ) throw( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& xListener ) throw( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL notifyClosing( const com::sun::star::lang::EventObject& aEvent ) throw (com::sun::star::uno::RuntimeException) ; - virtual void SAL_CALL queryClosing( const com::sun::star::lang::EventObject& aEvent, sal_Bool bDeliverOwnership ) throw (com::sun::star::uno::RuntimeException, com::sun::star::util::CloseVetoException) ; - virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& aEvent ) throw (com::sun::star::uno::RuntimeException) ; - -private: - - com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& mrXFrame; -}; - - #endif // OPTIMIZERDIALOG_HXX diff --git a/main/sdext/source/minimizer/optimizerdialogcontrols.cxx b/main/sdext/source/minimizer/optimizerdialogcontrols.cxx index 7c8349d..5c4b298 100644 --- a/main/sdext/source/minimizer/optimizerdialogcontrols.cxx +++ b/main/sdext/source/minimizer/optimizerdialogcontrols.cxx @@ -25,6 +25,8 @@ #include "precompiled_sdext.hxx" #include "optimizerdialog.hxx" +#include "minimizer.hrc" +#include "helpid.hrc" // ------------------- // - OptimizerDialog - @@ -41,7 +43,6 @@ #endif #include -using namespace ::rtl; using namespace ::com::sun::star::awt; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; @@ -53,22 +54,29 @@ using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::container; using namespace ::com::sun::star::presentation; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; // ----------------------------------------------------------------------------- -void SetBold( OptimizerDialog& rOptimizerDialog, const rtl::OUString& rControl ) +void OptimizerDialog::ImplSetBold( const rtl::OUString& rControl ) { FontDescriptor aFontDescriptor; - if ( rOptimizerDialog.getControlProperty( rControl, TKGet( TK_FontDescriptor ) ) >>= aFontDescriptor ) + if ( getControlProperty( rControl, TKGet( TK_FontDescriptor ) ) >>= aFontDescriptor ) { aFontDescriptor.Weight = FontWeight::BOLD; - rOptimizerDialog.setControlProperty( rControl, TKGet( TK_FontDescriptor ), Any( aFontDescriptor ) ); + setControlProperty( rControl, TKGet( TK_FontDescriptor ), Any( aFontDescriptor ) ); } } // ----------------------------------------------------------------------------- -rtl::OUString InsertSeparator( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, sal_Int32 nOrientation, - sal_Int32 nPosX, sal_Int32 nPosY, sal_Int32 nWidth, sal_Int32 nHeight ) +rtl::OUString OptimizerDialog::ImplInsertSeparator( + const OUString& rControlName, + sal_Int32 nOrientation, + sal_Int32 nPosX, + sal_Int32 nPosY, + sal_Int32 nWidth, + sal_Int32 nHeight ) { OUString pNames[] = { TKGet( TK_Height ), @@ -91,19 +99,29 @@ rtl::OUString InsertSeparator( OptimizerDialog& rOptimizerDialog, const OUString Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - rOptimizerDialog.insertControlModel( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlFixedLineModel" ) ), + insertControlModel( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlFixedLineModel" ) ), rControlName, aNames, aValues ); return rControlName; } // ----------------------------------------------------------------------------- -rtl::OUString InsertButton( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, Reference< XActionListener >& xActionListener, - sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex, sal_Bool bEnabled, PPPOptimizerTokenEnum nResID, sal_Int16 nPushButtonType ) +rtl::OUString OptimizerDialog::ImplInsertButton( + const OUString& rControlName, + const rtl::OUString& rHelpURL, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex, + sal_Bool bEnabled, + sal_Int32 nResID, + sal_Int16 nPushButtonType ) { OUString pNames[] = { TKGet( TK_Enabled ), TKGet( TK_Height ), + TKGet( TK_HelpURL ), TKGet( TK_Label ), TKGet( TK_PositionX ), TKGet( TK_PositionY ), @@ -115,7 +133,8 @@ rtl::OUString InsertButton( OptimizerDialog& rOptimizerDialog, const OUString& r Any pValues[] = { Any( bEnabled ), Any( nHeight ), - Any( rOptimizerDialog.getString( nResID ) ), + Any( rHelpURL ), + Any( getString( nResID ) ), Any( nXPos ), Any( nYPos ), Any( nPushButtonType ), @@ -129,14 +148,22 @@ rtl::OUString InsertButton( OptimizerDialog& rOptimizerDialog, const OUString& r Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - rOptimizerDialog.insertButton( rControlName, xActionListener, aNames, aValues ); + insertButton( rControlName, this, aNames, aValues ); return rControlName; } // ----------------------------------------------------------------------------- -rtl::OUString InsertFixedText( OptimizerDialog& rOptimizerDialog, const rtl::OUString& rControlName, const OUString& rLabel, - sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Bool bMultiLine, sal_Bool bBold, sal_Int16 nTabIndex ) +rtl::OUString OptimizerDialog::ImplInsertFixedText( + const rtl::OUString& rControlName, + const OUString& rLabel, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Bool bMultiLine, + sal_Bool bBold, + sal_Int16 nTabIndex ) { OUString pNames[] = { TKGet( TK_Height ), @@ -163,21 +190,28 @@ rtl::OUString InsertFixedText( OptimizerDialog& rOptimizerDialog, const rtl::OUS Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - rOptimizerDialog.insertFixedText( rControlName, aNames, aValues ); + insertFixedText( rControlName, aNames, aValues ); if ( bBold ) - SetBold( rOptimizerDialog, rControlName ); + ImplSetBold( rControlName ); return rControlName; } // ----------------------------------------------------------------------------- -rtl::OUString InsertCheckBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, - const Reference< XItemListener > xItemListener, const OUString& rLabel, - sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex ) +rtl::OUString OptimizerDialog::ImplInsertCheckBox( + const OUString& rControlName, + const OUString& rLabel, + const rtl::OUString& rHelpURL, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex ) { OUString pNames[] = { TKGet( TK_Enabled ), TKGet( TK_Height ), + TKGet( TK_HelpURL ), TKGet( TK_Label ), TKGet( TK_PositionX ), TKGet( TK_PositionY ), @@ -188,6 +222,7 @@ rtl::OUString InsertCheckBox( OptimizerDialog& rOptimizerDialog, const OUString& Any pValues[] = { Any( sal_True ), Any( nHeight ), + Any( rHelpURL ), Any( rLabel ), Any( nXPos ), Any( nYPos ), @@ -200,23 +235,29 @@ rtl::OUString InsertCheckBox( OptimizerDialog& rOptimizerDialog, const OUString& Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - Reference< XCheckBox > xCheckBox( rOptimizerDialog.insertCheckBox( rControlName, aNames, aValues ) ); - if ( xItemListener.is() ) - xCheckBox->addItemListener( xItemListener ); + Reference< XCheckBox > xCheckBox( insertCheckBox( rControlName, aNames, aValues ) ); + xCheckBox->addItemListener( this ); return rControlName; } // ----------------------------------------------------------------------------- -rtl::OUString InsertFormattedField( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, - const Reference< XTextListener > xTextListener, const Reference< XSpinListener > xSpinListener, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, - double fEffectiveMin, double fEffectiveMax, sal_Int16 nTabIndex ) +rtl::OUString OptimizerDialog::ImplInsertFormattedField( + const OUString& rControlName, + const rtl::OUString& rHelpURL, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + double fEffectiveMin, + double fEffectiveMax, + sal_Int16 nTabIndex ) { OUString pNames[] = { TKGet( TK_EffectiveMax ), TKGet( TK_EffectiveMin ), TKGet( TK_Enabled ), TKGet( TK_Height ), + TKGet( TK_HelpURL ), TKGet( TK_PositionX ), TKGet( TK_PositionY ), TKGet( TK_Repeat ), @@ -230,6 +271,7 @@ rtl::OUString InsertFormattedField( OptimizerDialog& rOptimizerDialog, const OUS Any( fEffectiveMin ), Any( sal_True ), Any( (sal_Int32)12 ), + Any( rHelpURL ), Any( nXPos ), Any( nYPos ), Any( (sal_Bool)sal_True ), @@ -243,27 +285,33 @@ rtl::OUString InsertFormattedField( OptimizerDialog& rOptimizerDialog, const OUS Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - Reference< XTextComponent > xTextComponent( rOptimizerDialog.insertFormattedField( rControlName, aNames, aValues ), UNO_QUERY_THROW ); - if ( xTextListener.is() ) - xTextComponent->addTextListener( xTextListener ); - if ( xSpinListener.is() ) - { - Reference< XSpinField > xSpinField( xTextComponent, UNO_QUERY_THROW ); - xSpinField->addSpinListener( xSpinListener ); - } + Reference< XTextComponent > xTextComponent( insertFormattedField( rControlName, aNames, aValues ), UNO_QUERY_THROW ); + xTextComponent->addTextListener( this ); + Reference< XSpinField > xSpinField( xTextComponent, UNO_QUERY_THROW ); + xSpinField->addSpinListener( this ); + return rControlName; } // ----------------------------------------------------------------------------- -rtl::OUString InsertComboBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, - const Reference< XTextListener > xTextListener, const sal_Bool bEnabled, const Sequence< OUString >& rItemList, - sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex ) +rtl::OUString OptimizerDialog::ImplInsertComboBox( + const OUString& rControlName, + const rtl::OUString& rHelpURL, + const sal_Bool bEnabled, + const Sequence< OUString >& rItemList, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex, + bool bListen ) { OUString pNames[] = { TKGet( TK_Dropdown ), TKGet( TK_Enabled ), TKGet( TK_Height ), + TKGet( TK_HelpURL ), TKGet( TK_LineCount ), TKGet( TK_PositionX ), TKGet( TK_PositionY ), @@ -276,6 +324,7 @@ rtl::OUString InsertComboBox( OptimizerDialog& rOptimizerDialog, const OUString& Any( sal_True ), Any( bEnabled ), Any( nHeight ), + Any( rHelpURL ), Any( (sal_Int16)8), Any( nXPos ), Any( nYPos ), @@ -289,19 +338,28 @@ rtl::OUString InsertComboBox( OptimizerDialog& rOptimizerDialog, const OUString& Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - Reference< XTextComponent > xTextComponent( rOptimizerDialog.insertComboBox( rControlName, aNames, aValues ), UNO_QUERY_THROW ); - if ( xTextListener.is() ) - xTextComponent->addTextListener( xTextListener ); + Reference< XTextComponent > xTextComponent( insertComboBox( rControlName, aNames, aValues ), UNO_QUERY_THROW ); + if ( bListen ) + xTextComponent->addTextListener( this ); return rControlName; } // ----------------------------------------------------------------------------- -rtl::OUString InsertRadioButton( OptimizerDialog& rOptimizerDialog, const rtl::OUString& rControlName, const Reference< XItemListener > xItemListener, - const OUString& rLabel, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Bool bMultiLine, sal_Int16 nTabIndex ) +rtl::OUString OptimizerDialog::ImplInsertRadioButton( + const rtl::OUString& rControlName, + const OUString& rLabel, + const rtl::OUString& rHelpURL, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Bool bMultiLine, + sal_Int16 nTabIndex ) { OUString pNames[] = { TKGet( TK_Height ), + TKGet( TK_HelpURL ), TKGet( TK_Label ), TKGet( TK_MultiLine ), TKGet( TK_PositionX ), @@ -312,6 +370,7 @@ rtl::OUString InsertRadioButton( OptimizerDialog& rOptimizerDialog, const rtl::O Any pValues[] = { Any( nHeight ), + Any( rHelpURL ), Any( rLabel ), Any( bMultiLine ), Any( nXPos ), @@ -325,22 +384,29 @@ rtl::OUString InsertRadioButton( OptimizerDialog& rOptimizerDialog, const rtl::O Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - Reference< XRadioButton > xRadioButton( rOptimizerDialog.insertRadioButton( rControlName, aNames, aValues ) ); - if ( xItemListener.is() ) - xRadioButton->addItemListener( xItemListener ); + Reference< XRadioButton > xRadioButton( insertRadioButton( rControlName, aNames, aValues ) ); + xRadioButton->addItemListener( this ); return rControlName; } // ----------------------------------------------------------------------------- -rtl::OUString InsertListBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, - const Reference< XActionListener > xActionListener, const sal_Bool bEnabled, const Sequence< OUString >& rItemList, - sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex ) +rtl::OUString OptimizerDialog::ImplInsertListBox( + const OUString& rControlName, + const rtl::OUString& rHelpURL, + const sal_Bool bEnabled, + const Sequence< OUString >& rItemList, + sal_Int32 nXPos, + sal_Int32 nYPos, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 nTabIndex ) { OUString pNames[] = { TKGet( TK_Dropdown ), TKGet( TK_Enabled ), TKGet( TK_Height ), + TKGet( TK_HelpURL ), TKGet( TK_LineCount ), TKGet( TK_MultiSelection ), TKGet( TK_PositionX ), @@ -354,6 +420,7 @@ rtl::OUString InsertListBox( OptimizerDialog& rOptimizerDialog, const OUString& Any( sal_True ), Any( bEnabled ), Any( nHeight ), + Any( rHelpURL ), Any( (sal_Int16)8), Any( sal_False ), Any( nXPos ), @@ -368,9 +435,8 @@ rtl::OUString InsertListBox( OptimizerDialog& rOptimizerDialog, const OUString& Sequence< rtl::OUString > aNames( pNames, nCount ); Sequence< Any > aValues( pValues, nCount ); - Reference< XListBox > xListBox( rOptimizerDialog.insertListBox( rControlName, aNames, aValues ) ); - if ( xListBox.is() ) - xListBox->addActionListener( xActionListener ); + Reference< XListBox > xListBox( insertListBox( rControlName, aNames, aValues ) ); + xListBox->addActionListener( this ); return rControlName; } @@ -383,14 +449,14 @@ void OptimizerDialog::InitNavigationBar() sal_Int32 nNextPosX = nFinishPosX - 6 - BUTTON_WIDTH; sal_Int32 nBackPosX = nNextPosX - 3 - BUTTON_WIDTH; - InsertSeparator( *this, TKGet( TK_lnNavSep1 ), 0, 0, DIALOG_HEIGHT - 26, OD_DIALOG_WIDTH, 1 ); - InsertSeparator( *this, TKGet( TK_lnNavSep2 ), 1, 85, 0, 1, BUTTON_POS_Y - 6 ); + ImplInsertSeparator( TKGet( TK_lnNavSep1 ), 0, 0, DIALOG_HEIGHT - 26, OD_DIALOG_WIDTH, 1 ); + ImplInsertSeparator( TKGet( TK_lnNavSep2 ), 1, 85, 0, 1, BUTTON_POS_Y - 6 ); - InsertButton( *this, TKGet( TK_btnNavHelp ), mxActionListener, 8, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_HELP, PushButtonType_STANDARD ); - InsertButton( *this, TKGet( TK_btnNavBack ), mxActionListener, nBackPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_False, STR_BACK, PushButtonType_STANDARD ); - InsertButton( *this, TKGet( TK_btnNavNext ), mxActionListener, nNextPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_NEXT, PushButtonType_STANDARD ); - InsertButton( *this, TKGet( TK_btnNavFinish ), mxActionListener, nFinishPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_FINISH, PushButtonType_STANDARD ); - InsertButton( *this, TKGet( TK_btnNavCancel ), mxActionListener, nCancelPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_CANCEL, PushButtonType_STANDARD ); + ImplInsertButton( TKGet( TK_btnNavHelp ), HID( HID_SDEXT_MINIMIZER_WIZ_PB_HELP ), 8, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_HELP, PushButtonType_HELP ); + ImplInsertButton( TKGet( TK_btnNavBack ), HID( HID_SDEXT_MINIMIZER_WIZ_PB_BACK ), nBackPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_False, STR_BACK, PushButtonType_STANDARD ); + ImplInsertButton( TKGet( TK_btnNavNext ), HID( HID_SDEXT_MINIMIZER_WIZ_PB_NEXT ), nNextPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_NEXT, PushButtonType_STANDARD ); + ImplInsertButton( TKGet( TK_btnNavFinish ), HID( HID_SDEXT_MINIMIZER_WIZ_PB_FINISH ), nFinishPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_FINISH, PushButtonType_STANDARD ); + ImplInsertButton( TKGet( TK_btnNavCancel ), HID( HID_SDEXT_MINIMIZER_WIZ_PB_CANCEL ), nCancelPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_CANCEL, PushButtonType_STANDARD ); setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_DefaultButton ), Any( sal_True ) ); } @@ -433,12 +499,12 @@ void OptimizerDialog::InitPage0() { Sequence< OUString > aItemList; std::vector< rtl::OUString > aControlList; - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText0Pg0 ), getString( STR_INTRODUCTION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText1Pg0 ), getString( STR_INTRODUCTION_T ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 100, sal_True, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertSeparator( *this, TKGet( TK_Separator1Pg0 ), 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 66, PAGE_WIDTH - 12, 1 ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText2Pg0 ), getString( STR_CHOSE_SETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 60, PAGE_WIDTH - 12, 8, sal_True, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertListBox( *this, TKGet( TK_ListBox0Pg0 ), mxActionListenerListBox0Pg0, sal_True, aItemList, PAGE_POS_X + 6, DIALOG_HEIGHT - 48, ( OD_DIALOG_WIDTH - 50 ) - ( PAGE_POS_X + 6 ), 12, mnTabIndex++ ) ); - aControlList.push_back( InsertButton( *this, TKGet( TK_Button0Pg0 ), mxActionListener, OD_DIALOG_WIDTH - 46, DIALOG_HEIGHT - 49, 40, 14, mnTabIndex++, sal_True, STR_REMOVE, PushButtonType_STANDARD ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText0Pg0 ), getString( STR_INTRODUCTION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText1Pg0 ), getString( STR_INTRODUCTION_T ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 100, sal_True, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertSeparator( TKGet( TK_Separator1Pg0 ), 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 66, PAGE_WIDTH - 12, 1 ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText2Pg0 ), getString( STR_CHOSE_SETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 60, PAGE_WIDTH - 12, 8, sal_True, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertListBox( TKGet( TK_ListBox0Pg0 ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP1_LB_SETTINGS),sal_True, aItemList, PAGE_POS_X + 6, DIALOG_HEIGHT - 48, ( OD_DIALOG_WIDTH - 50 ) - ( PAGE_POS_X + 6 ), 12, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertButton( TKGet( TK_Button0Pg0 ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP1_PB_DELSETTS ),OD_DIALOG_WIDTH - 46, DIALOG_HEIGHT - 49, 40, 14, mnTabIndex++, sal_True, STR_REMOVE, PushButtonType_STANDARD ) ); maControlPages.push_back( aControlList ); DeactivatePage( 0 ); UpdateControlStatesPage0(); @@ -459,7 +525,7 @@ void OptimizerDialog::UpdateControlStatesPage1() void OptimizerDialog::InitPage1() { Sequence< OUString > aCustomShowList; - Reference< XModel > xModel( mxController->getModel() ); + Reference< XModel > xModel( mxModel ); if ( xModel.is() ) { Reference< XCustomPresentationSupplier > aXCPSup( xModel, UNO_QUERY_THROW ); @@ -468,12 +534,12 @@ void OptimizerDialog::InitPage1() aCustomShowList = aXCont->getElementNames(); } std::vector< rtl::OUString > aControlList; - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText0Pg3 ), getString( STR_CHOOSE_SLIDES ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) ); - aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox0Pg3 ), mxItemListener, getString( STR_DELETE_MASTER_PAGES ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); - aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox2Pg3 ), mxItemListener, getString( STR_DELETE_HIDDEN_SLIDES ), PAGE_POS_X + 6, PAGE_POS_Y + 28, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); - aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox3Pg3 ), mxItemListener, getString( STR_CUSTOM_SHOW ), PAGE_POS_X + 6, PAGE_POS_Y + 42, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); - aControlList.push_back( InsertListBox( *this, TKGet( TK_ListBox0Pg3 ), mxActionListener, sal_True, aCustomShowList, PAGE_POS_X + 14, PAGE_POS_Y + 54, 150, 12, mnTabIndex++ ) ); - aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox1Pg3 ), mxItemListener, getString( STR_DELETE_NOTES_PAGES ), PAGE_POS_X + 6, PAGE_POS_Y + 70, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText0Pg3 ), getString( STR_CHOOSE_SLIDES ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox0Pg3 ), getString( STR_DELETE_MASTER_PAGES ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_MASTERPAGES ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox2Pg3 ), getString( STR_DELETE_HIDDEN_SLIDES ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_HIDDENSLIDES ), PAGE_POS_X + 6, PAGE_POS_Y + 28, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox3Pg3 ), getString( STR_CUSTOM_SHOW ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_CUSTOMSHOW ), PAGE_POS_X + 6, PAGE_POS_Y + 42, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertListBox( TKGet( TK_ListBox0Pg3 ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP2_LB_CUSTOMSHOW),sal_True, aCustomShowList, PAGE_POS_X + 14, PAGE_POS_Y + 54, 150, 12, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox1Pg3 ), getString( STR_DELETE_NOTES_PAGES ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_NOTES ), PAGE_POS_X + 6, PAGE_POS_Y + 70, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); maControlPages.push_back( aControlList ); DeactivatePage( 1 ); @@ -535,15 +601,15 @@ void OptimizerDialog::InitPage2() aResolutionItemList[ 3 ] = getString( STR_IMAGE_RESOLUTION_3 ).getToken( 1, ';', nI3 ); std::vector< rtl::OUString > aControlList; - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText0Pg1 ), getString( STR_GRAPHIC_OPTIMIZATION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) ); - aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton0Pg1 ), mxItemListener, getString( STR_LOSSLESS_COMPRESSION ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton1Pg1 ), mxItemListener, getString( STR_JPEG_COMPRESSION ), PAGE_POS_X + 6, PAGE_POS_Y + 28, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText1Pg1 ), getString( STR_QUALITY ), PAGE_POS_X + 20, PAGE_POS_Y + 40, 72, 8, sal_False, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertFormattedField( *this, TKGet( TK_FormattedField0Pg1 ), mxTextListenerFormattedField0Pg1, mxSpinListenerFormattedField0Pg1, PAGE_POS_X + 106, PAGE_POS_Y + 38, 50, 0, 100, mnTabIndex++ ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText2Pg1 ), getString( STR_IMAGE_RESOLUTION ), PAGE_POS_X + 6, PAGE_POS_Y + 54, 94, 8, sal_False, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertComboBox( *this, TKGet( TK_ComboBox0Pg1 ), mxTextListenerComboBox0Pg1, sal_True, aResolutionItemList, PAGE_POS_X + 106, PAGE_POS_Y + 52, 100, 12, mnTabIndex++ ) ); - aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox1Pg1 ), mxItemListener, getString( STR_REMOVE_CROP_AREA ), PAGE_POS_X + 6, PAGE_POS_Y + 68, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); - aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox2Pg1 ), mxItemListener, getString( STR_EMBED_LINKED_GRAPHICS ), PAGE_POS_X + 6, PAGE_POS_Y + 82, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText0Pg1 ), getString( STR_GRAPHIC_OPTIMIZATION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton0Pg1 ), getString( STR_LOSSLESS_COMPRESSION ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_RB_LOSSLESS ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton1Pg1 ), getString( STR_JPEG_COMPRESSION ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_RB_JPEG ), PAGE_POS_X + 6, PAGE_POS_Y + 28, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText1Pg1 ), getString( STR_QUALITY ), PAGE_POS_X + 20, PAGE_POS_Y + 40, 72, 8, sal_False, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFormattedField( TKGet( TK_FormattedField0Pg1 ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_MF_QUALITY ), PAGE_POS_X + 106, PAGE_POS_Y + 38, 50, 0, 100, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText2Pg1 ), getString( STR_IMAGE_RESOLUTION ), PAGE_POS_X + 6, PAGE_POS_Y + 54, 94, 8, sal_False, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertComboBox( TKGet( TK_ComboBox0Pg1 ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_LB_DPI ), sal_True, aResolutionItemList, PAGE_POS_X + 106, PAGE_POS_Y + 52, 100, 12, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox1Pg1 ), getString( STR_REMOVE_CROP_AREA ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_CB_CROP ), PAGE_POS_X + 6, PAGE_POS_Y + 68, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox2Pg1 ), getString( STR_EMBED_LINKED_GRAPHICS ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_CB_LINKS ), PAGE_POS_X + 6, PAGE_POS_Y + 82, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); maControlPages.push_back( aControlList ); DeactivatePage( 2 ); UpdateControlStatesPage2(); @@ -565,7 +631,7 @@ void OptimizerDialog::UpdateControlStatesPage3() void OptimizerDialog::InitPage3() { int nOLECount = 0; - Reference< XModel > xModel( mxController->getModel() ); + Reference< XModel > xModel( mxModel ); Reference< XDrawPagesSupplier > xDrawPagesSupplier( xModel, UNO_QUERY_THROW ); Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW ); for ( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ ) @@ -581,11 +647,11 @@ void OptimizerDialog::InitPage3() } std::vector< rtl::OUString > aControlList; - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText0Pg2 ), getString( STR_OLE_OPTIMIZATION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) ); - aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox0Pg2 ), mxItemListener, getString( STR_OLE_REPLACE ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); - aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton0Pg2 ), mxItemListener, getString( STR_ALL_OLE_OBJECTS ), PAGE_POS_X + 14, PAGE_POS_Y + 28, PAGE_WIDTH - 22, 8, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton1Pg2 ), mxItemListener, getString( STR_ALIEN_OLE_OBJECTS_ONLY ), PAGE_POS_X + 14, PAGE_POS_Y + 40, PAGE_WIDTH - 22, 8, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText1Pg2 ), nOLECount ? getString( STR_OLE_OBJECTS_DESC ) : getString( STR_NO_OLE_OBJECTS_DESC ), PAGE_POS_X + 6, PAGE_POS_Y + 64, PAGE_WIDTH - 22, 50, sal_True, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText0Pg2 ), getString( STR_OLE_OPTIMIZATION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox0Pg2 ), getString( STR_OLE_REPLACE ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP4_CB_OLE ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton0Pg2 ), getString( STR_ALL_OLE_OBJECTS ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP4_RB_ALLOLE), PAGE_POS_X + 14, PAGE_POS_Y + 28, PAGE_WIDTH - 22, 8, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton1Pg2 ), getString( STR_ALIEN_OLE_OBJECTS_ONLY ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP4_RB_NOTODF),PAGE_POS_X + 14, PAGE_POS_Y + 40, PAGE_WIDTH - 22, 8, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText1Pg2 ), nOLECount ? getString( STR_OLE_OBJECTS_DESC ) : getString( STR_NO_OLE_OBJECTS_DESC ), PAGE_POS_X + 6, PAGE_POS_Y + 64, PAGE_WIDTH - 22, 50, sal_True, sal_False, mnTabIndex++ ) ); maControlPages.push_back( aControlList ); DeactivatePage( 3 ); UpdateControlStatesPage3(); @@ -683,7 +749,7 @@ void OptimizerDialog::UpdateControlStatesPage4() if ( aCustomShowName.getLength() ) { std::vector< Reference< XDrawPage > > vNonUsedPageList; - PageCollector::CollectNonCustomShowPages( mxController->getModel(), aCustomShowName, vNonUsedPageList ); + PageCollector::CollectNonCustomShowPages( mxModel, aCustomShowName, vNonUsedPageList ); nDeletedSlides += vNonUsedPageList.size(); } if ( GetConfigProperty( TK_DeleteHiddenSlides, sal_False ) ) @@ -691,7 +757,7 @@ void OptimizerDialog::UpdateControlStatesPage4() if ( aCustomShowName.getLength() ) { std::vector< Reference< XDrawPage > > vUsedPageList; - PageCollector::CollectCustomShowPages( mxController->getModel(), aCustomShowName, vUsedPageList ); + PageCollector::CollectCustomShowPages( mxModel, aCustomShowName, vUsedPageList ); std::vector< Reference< XDrawPage > >::iterator aIter( vUsedPageList.begin() ); while( aIter != vUsedPageList.end() ) { @@ -708,7 +774,7 @@ void OptimizerDialog::UpdateControlStatesPage4() } else { - Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxController->getModel(), UNO_QUERY_THROW ); + Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxModel, UNO_QUERY_THROW ); Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW ); for( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ ) { @@ -728,8 +794,8 @@ void OptimizerDialog::UpdateControlStatesPage4() if ( GetConfigProperty( TK_DeleteUnusedMasterPages, sal_False ) ) { std::vector< PageCollector::MasterPageEntity > aMasterPageList; - PageCollector::CollectMasterPages( mxController->getModel(), aMasterPageList ); - Reference< XMasterPagesSupplier > xMasterPagesSupplier( mxController->getModel(), UNO_QUERY_THROW ); + PageCollector::CollectMasterPages( mxModel, aMasterPageList ); + Reference< XMasterPagesSupplier > xMasterPagesSupplier( mxModel, UNO_QUERY_THROW ); Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_QUERY_THROW ); std::vector< PageCollector::MasterPageEntity >::iterator aIter( aMasterPageList.begin() ); while( aIter != aMasterPageList.end() ) @@ -756,7 +822,7 @@ void OptimizerDialog::UpdateControlStatesPage4() sal_Int32 nImageResolution( GetConfigProperty( TK_ImageResolution, (sal_Int32)0 ) ); GraphicSettings aGraphicSettings( bJPEGCompression, nJPEGQuality, GetConfigProperty( TK_RemoveCropArea, sal_False ), nImageResolution, GetConfigProperty( TK_EmbedLinkedGraphics, sal_True ) ); - GraphicCollector::CountGraphics( mxMSF, mxController->getModel(), aGraphicSettings, nGraphics ); + GraphicCollector::CountGraphics( mxContext, mxModel, aGraphicSettings, nGraphics ); if ( nGraphics > 1 ) { OUString aStr( getString( STR_OPTIMIZE_IMAGES ) ); @@ -781,7 +847,7 @@ void OptimizerDialog::UpdateControlStatesPage4() if ( GetConfigProperty( TK_OLEOptimization, sal_False ) ) { sal_Int32 nOLEReplacements = 0; - Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxController->getModel(), UNO_QUERY_THROW ); + Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxModel, UNO_QUERY_THROW ); Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW ); for ( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ ) { @@ -812,7 +878,7 @@ void OptimizerDialog::UpdateControlStatesPage4() sal_Int64 nCurrentFileSize = 0; sal_Int64 nEstimatedFileSize = 0; - Reference< XStorable > xStorable( mxController->getModel(), UNO_QUERY ); + Reference< XStorable > xStorable( mxModel, UNO_QUERY ); if ( xStorable.is() && xStorable->hasLocation() ) nCurrentFileSize = PPPOptimizer::GetFileSize( xStorable->getLocation() ); @@ -856,7 +922,7 @@ void OptimizerDialog::InitPage4() Any pValues[] = { Any( (sal_Int32)12 ), - Any( TKGet( STR_SAVE_AS ) ), + Any( OUString( RTL_CONSTASCII_USTRINGPARAM("STR_SAVE_AS") ) ),//TODO Any( (sal_Int32)( PAGE_POS_X + 6 ) ), Any( (sal_Int32)( DIALOG_HEIGHT - 75 ) ), Any( (sal_Int32)( 0 ) ), @@ -872,30 +938,35 @@ void OptimizerDialog::InitPage4() Reference< XMultiPropertySet > xMultiPropertySet( insertControlModel( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlProgressBarModel" ) ), TKGet( TK_Progress ), aNames, aValues ), UNO_QUERY ); } - Reference< XTextListener > xTextListener; + Sequence< OUString > aItemList; std::vector< rtl::OUString > aControlList; - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText0Pg4 ), getString( STR_SUMMARY_TITLE ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) ); -// aControlList.push_back( InsertSeparator( *this, TKGet( TK_Separator0Pg4 ), 0, PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, 1 ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText0Pg4 ), getString( STR_SUMMARY_TITLE ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) ); +// aControlList.push_back( ImplInsertSeparator( TKGet( TK_Separator0Pg4 ), 0, PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, 1 ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText4Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText5Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 22, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText6Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 30, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText4Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText5Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 22, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText6Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 30, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText2Pg4 ), getString( STR_CURRENT_FILESIZE ), PAGE_POS_X + 6, PAGE_POS_Y + 50, 88, 8, sal_False, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText7Pg4 ), OUString(), PAGE_POS_X + 100, PAGE_POS_Y + 50, 30, 8, sal_False, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText2Pg4 ), getString( STR_CURRENT_FILESIZE ), PAGE_POS_X + 6, PAGE_POS_Y + 50, 88, 8, sal_False, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText7Pg4 ), OUString(), PAGE_POS_X + 100, PAGE_POS_Y + 50, 30, 8, sal_False, sal_False, mnTabIndex++ ) ); setControlProperty( TKGet( TK_FixedText7Pg4 ), TKGet( TK_Align ), Any( static_cast< short >( 2 ) ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText3Pg4 ), getString( STR_ESTIMATED_FILESIZE ), PAGE_POS_X + 6, PAGE_POS_Y + 58, 88, 8, sal_False, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText8Pg4 ), OUString(), PAGE_POS_X + 100, PAGE_POS_Y + 58, 30, 8, sal_False, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText3Pg4 ), getString( STR_ESTIMATED_FILESIZE ), PAGE_POS_X + 6, PAGE_POS_Y + 58, 88, 8, sal_False, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText8Pg4 ), OUString(), PAGE_POS_X + 100, PAGE_POS_Y + 58, 30, 8, sal_False, sal_False, mnTabIndex++ ) ); setControlProperty( TKGet( TK_FixedText8Pg4 ), TKGet( TK_Align ), Any( static_cast< short >( 2 ) ) ); - aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton0Pg4 ), mxItemListener, getString( STR_APPLY_TO_CURRENT ), PAGE_POS_X + 6, PAGE_POS_Y + 78, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton1Pg4 ), mxItemListener, getString( STR_SAVE_AS ), PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) ); - aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText1Pg4 ), OUString(), PAGE_POS_X + 6, DIALOG_HEIGHT - 87, PAGE_WIDTH - 12, 8, sal_True, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton0Pg4 ), getString( STR_APPLY_TO_CURRENT ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP5_RB_CURDOC),PAGE_POS_X + 6, PAGE_POS_Y + 78, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton1Pg4 ), getString( STR_SAVE_AS ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP5_RB_NEWDOC),PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText1Pg4 ), OUString(), PAGE_POS_X + 6, DIALOG_HEIGHT - 87, PAGE_WIDTH - 12, 8, sal_True, sal_False, mnTabIndex++ ) ); aControlList.push_back( TKGet( TK_Progress ) ); - aControlList.push_back( InsertSeparator( *this, TKGet( TK_Separator1Pg4 ), 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 58, PAGE_WIDTH - 12, 1 ) ); - aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox1Pg4 ), mxItemListener, getString( STR_SAVE_SETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 47, 100, 8, mnTabIndex++ ) ); - aControlList.push_back( InsertComboBox( *this, TKGet( TK_ComboBox0Pg4 ), xTextListener, sal_True, aItemList, PAGE_POS_X + 106, DIALOG_HEIGHT - 48, 100, 12, mnTabIndex++ ) ); + aControlList.push_back( ImplInsertSeparator( TKGet( TK_Separator1Pg4 ), 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 58, PAGE_WIDTH - 12, 1 ) ); + aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox1Pg4 ), getString( STR_SAVE_SETTINGS ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP5_CB_SAVESETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 47, 100, 8, mnTabIndex++ ) ); + // don't listen to this + aControlList.push_back( + ImplInsertComboBox( + TKGet( TK_ComboBox0Pg4 ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP5_LB_SETTINGSNAME ),sal_True, aItemList, + PAGE_POS_X + 106, DIALOG_HEIGHT - 48, 100, 12, mnTabIndex++ , + false) ); maControlPages.push_back( aControlList ); DeactivatePage( 4 ); diff --git a/main/sdext/source/minimizer/pagecollector.cxx b/main/sdext/source/minimizer/pagecollector.cxx index bbb4096..8db2112 100644 --- a/main/sdext/source/minimizer/pagecollector.cxx +++ b/main/sdext/source/minimizer/pagecollector.cxx @@ -33,7 +33,6 @@ #include #include -using namespace ::rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; @@ -43,6 +42,8 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::presentation; +using ::rtl::OUString; + void PageCollector::CollectCustomShowPages( const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel, const rtl::OUString& rCustomShowName, std::vector< Reference< XDrawPage > >& rUsedPageList ) { try diff --git a/main/sdext/source/minimizer/pppoptimizer.cxx b/main/sdext/source/minimizer/pppoptimizer.cxx index c6b2f7a..f08fc64 100644 --- a/main/sdext/source/minimizer/pppoptimizer.cxx +++ b/main/sdext/source/minimizer/pppoptimizer.cxx @@ -30,28 +30,32 @@ #include -using namespace ::rtl; +#define SERVICE_NAME "com.sun.star.comp.PPPOptimizer" + + using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::beans; -#define SERVICE_NAME "com.sun.star.comp.PPPOptimizer" +using ::rtl::OUString; // ---------------- // - PPPOptimizer - // ---------------- -PPPOptimizer::PPPOptimizer( const Reference< XComponentContext > &rxMSF ) : - mxMSF( rxMSF ) +PPPOptimizer::PPPOptimizer( const Reference< XComponentContext > &rxContext ) : + mxContext( rxContext ) { + OSL_TRACE("PPPOptimizer::PPPOptimizer"); } // ----------------------------------------------------------------------------- PPPOptimizer::~PPPOptimizer() { + OSL_TRACE("PPPOptimizer::~PPPOptimizer"); } // ----------------------------------------------------------------------------- @@ -61,6 +65,7 @@ PPPOptimizer::~PPPOptimizer() void SAL_CALL PPPOptimizer::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException ) { + OSL_TRACE("PPPOptimizer::initialize"); if( aArguments.getLength() != 1 ) throw IllegalArgumentException(); @@ -130,6 +135,7 @@ Sequence< Reference< com::sun::star::frame::XDispatch > > SAL_CALL PPPOptimizer: void SAL_CALL PPPOptimizer::dispatch( const URL& rURL, const Sequence< PropertyValue >& lArguments ) throw( RuntimeException ) { + OSL_TRACE("PPPOptimizer::dispatch"); if ( mxController.is() && ( rURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) == 0 ) ) { if ( rURL.Path.compareToAscii( "optimize" ) == 0 ) @@ -139,7 +145,7 @@ void SAL_CALL PPPOptimizer::dispatch( const URL& rURL, const Sequence< PropertyV { try { - ImpOptimizer aOptimizer( mxMSF, xModel ); + ImpOptimizer aOptimizer( mxContext, xModel ); aOptimizer.Optimize( lArguments ); } catch( Exception& ) diff --git a/main/sdext/source/minimizer/pppoptimizer.hxx b/main/sdext/source/minimizer/pppoptimizer.hxx index db61885..a9ee8b7 100644 --- a/main/sdext/source/minimizer/pppoptimizer.hxx +++ b/main/sdext/source/minimizer/pppoptimizer.hxx @@ -43,12 +43,12 @@ class PPPOptimizer : public cppu::WeakImplHelper4< com::sun::star::frame::XDispatchProvider, com::sun::star::frame::XDispatch > { - 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::XController > mxController; public: - PPPOptimizer( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF ); + PPPOptimizer( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext ); virtual ~PPPOptimizer(); // XInitialization diff --git a/main/sdext/source/minimizer/pppoptimizerdialog.cxx b/main/sdext/source/minimizer/pppoptimizerdialog.cxx index 4e5c956..538ddc1 100644 --- a/main/sdext/source/minimizer/pppoptimizerdialog.cxx +++ b/main/sdext/source/minimizer/pppoptimizerdialog.cxx @@ -27,30 +27,40 @@ #include "pppoptimizerdialog.hxx" #include "optimizerdialog.hxx" -using namespace ::rtl; +#include +#include +#include + +#define SERVICE_NAME "com.sun.star.ui.dialogs.PresentationMinimizerDialog" +#define IMPLEMENTATION_NAME "com.sun.star.comp.ui.dialogs.PresentationMinimizerDialog" + using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::beans; -#define SERVICE_NAME "com.sun.star.comp.SunPresentationMinimizer" -#include +using ::rtl::OUString; +using ::com::sun::star::awt::XWindow; +using ::com::sun::star::awt::XWindowPeer; // ---------------------- // - PPPOptimizerDialog - // ---------------------- -PPPOptimizerDialog::PPPOptimizerDialog( const Reference< XComponentContext > &rxMSF ) : - mxMSF( rxMSF ), - mpOptimizerDialog( NULL ) +PPPOptimizerDialog::PPPOptimizerDialog( + const Reference< XComponentContext > &rxContext ) + : m_xContext( rxContext ) + , mbInitialized( false ) { + OSL_TRACE("PPPOptimizerDialog::PPPOptimizerDialog"); } // ----------------------------------------------------------------------------- PPPOptimizerDialog::~PPPOptimizerDialog() { + OSL_TRACE("PPPOptimizerDialog::~PPPOptimizerDialog"); } // ----------------------------------------------------------------------------- @@ -60,12 +70,60 @@ PPPOptimizerDialog::~PPPOptimizerDialog() void SAL_CALL PPPOptimizerDialog::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException ) { - if( aArguments.getLength() != 1 ) - throw IllegalArgumentException(); - - aArguments[ 0 ] >>= mxFrame; - if ( mxFrame.is() ) - mxController = mxFrame->getController(); + OSL_TRACE("PPPOptimizerDialog::initialize"); + osl::ResettableMutexGuard aGuard( m_aMutex ); + if ( mbInitialized ) + throw RuntimeException( + OUString( RTL_CONSTASCII_USTRINGPARAM( + "PPPOptimizerDialog has already been initialized!") ), + Reference< XInterface >() ); + aGuard.clear(); + + Reference< XFrame > xFrame; + Reference< XController > xController; + Reference< XModel > xModel; + Reference< XWindow > xWindow; + + const Any *pAny = aArguments.getConstArray(); + const Any *pEnd = pAny + aArguments.getLength(); + for ( ; pAny != pEnd && !xFrame.is() && !xWindow.is(); pAny++ ) + { + if ( ( *pAny >>= xFrame ) && xFrame.is() ) + { + xWindow = xFrame->getContainerWindow(); + } + else if ( ( *pAny >>= xController ) && xController.is() ) + { + xFrame = xController->getFrame(); + if ( xFrame.is() ) + xWindow = xFrame->getContainerWindow(); + } + else if ( ( *pAny >>= xModel ) && xModel.is() ) + { + xController = xModel->getCurrentController(); + if ( xController.is() ) + { + xFrame = xController->getFrame(); + if ( xFrame.is() ) + xWindow = xFrame->getContainerWindow(); + } + } + else + *pAny >>= xWindow; + } + + if ( !xFrame.is() ) + throw IllegalArgumentException( + OUString( RTL_CONSTASCII_USTRINGPARAM( + "PPPOptimizerDialog must be initialized with an " + "XFrame, XController or XModel!") ), + Reference< XInterface >(), 0 ); + + aGuard.reset(); + mxFrame = xFrame; + mxParentWindow.set( xWindow, UNO_QUERY ); + mbInitialized = true; + aGuard.clear(); } // ----------------------------------------------------------------------------- @@ -90,110 +148,48 @@ Sequence< OUString > SAL_CALL PPPOptimizerDialog::getSupportedServiceNames() return PPPOptimizerDialog_getSupportedServiceNames(); } -// ----------------------------------------------------------------------------- -// XDispatchProvider -// ----------------------------------------------------------------------------- -Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizerDialog::queryDispatch( - const URL& aURL, const ::rtl::OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException ) +void SAL_CALL PPPOptimizerDialog::setTitle( const ::rtl::OUString& aTitle ) +throw (::com::sun::star::uno::RuntimeException) { - Reference < XDispatch > xRet; - if ( aURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.SunPresentationMinimizer:" ) == 0 ) - xRet = this; - - return xRet; + osl::MutexGuard aGuard( m_aMutex ); + msTitle = aTitle; } -//------------------------------------------------------------------------------ - -Sequence< Reference< com::sun::star::frame::XDispatch > > SAL_CALL PPPOptimizerDialog::queryDispatches( - const Sequence< com::sun::star::frame::DispatchDescriptor >& aDescripts ) throw( RuntimeException ) +::sal_Int16 SAL_CALL PPPOptimizerDialog::execute( ) +throw (::com::sun::star::uno::RuntimeException) { - Sequence< Reference< com::sun::star::frame::XDispatch> > aReturn( aDescripts.getLength() ); - Reference< com::sun::star::frame::XDispatch>* pReturn = aReturn.getArray(); - const com::sun::star::frame::DispatchDescriptor* pDescripts = aDescripts.getConstArray(); - for (sal_Int16 i = 0; i < aDescripts.getLength(); ++i, ++pReturn, ++pDescripts ) - { - *pReturn = queryDispatch( pDescripts->FeatureURL, pDescripts->FrameName, pDescripts->SearchFlags ); - } - return aReturn; -} + OSL_TRACE("PPPOptimizerDialog::execute"); + sal_Int16 aRet = ::com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL; + + osl::ClearableMutexGuard aGuard( m_aMutex ); + bool bInit( mbInitialized ); + Reference< XFrame > xFrame( mxFrame ); + Reference< XWindowPeer > xParent( mxParentWindow ); + aGuard.clear(); + + if ( !bInit || !xFrame.is() || !xParent.is() ) + throw RuntimeException(); + try + { + OptimizerDialog *pDialog( + new OptimizerDialog( m_xContext, xFrame, xParent ) ); + pDialog->setTitle( msTitle ); + aRet = pDialog->execute(); + delete pDialog; + } + catch( ... ) + { + } -// ----------------------------------------------------------------------------- -// XDispatch -// ----------------------------------------------------------------------------- - -void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL, - const Sequence< PropertyValue >& rArguments ) - throw( RuntimeException ) -{ - sal_Int64 nFileSizeSource = 0; - sal_Int64 nFileSizeDest = 0; - - if ( mxController.is() && ( rURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.SunPresentationMinimizer:" ) == 0 ) ) - { - if ( rURL.Path.compareToAscii( "execute" ) == 0 ) - { - sal_Bool bDialogExecuted = sal_False; - - try - { - mpOptimizerDialog = new OptimizerDialog( mxMSF, mxFrame, this ); - bDialogExecuted = mpOptimizerDialog->execute(); - - const Any* pVal( mpOptimizerDialog->maStats.GetStatusValue( TK_FileSizeSource ) ); - if ( pVal ) - *pVal >>= nFileSizeSource; - pVal = mpOptimizerDialog->maStats.GetStatusValue( TK_FileSizeDestination ); - if ( pVal ) - *pVal >>= nFileSizeDest; - - if ( nFileSizeSource && nFileSizeDest ) - { - rtl::OUStringBuffer sBuf( rtl::OUString::createFromAscii( "Your Presentation has been minimized from:" ) ); - sBuf.append( rtl::OUString::valueOf( nFileSizeSource >> 10 ) ); - sBuf.append( rtl::OUString::createFromAscii( "KB to " ) ); - sBuf.append( rtl::OUString::valueOf( nFileSizeDest >> 10 ) ); - sBuf.append( rtl::OUString::createFromAscii( "KB." ) ); - OUString sResult( sBuf.makeStringAndClear() ); -// mpOptimizerDialog->showMessageBox( sResult, sResult, sal_False ); - } - delete mpOptimizerDialog, mpOptimizerDialog = NULL; - } - catch( ... ) - { - - } - } - else if ( rURL.Path.compareToAscii( "statusupdate" ) == 0 ) - { - if ( mpOptimizerDialog ) - mpOptimizerDialog->UpdateStatus( rArguments ); - } - } -} - -//=============================================== -void SAL_CALL PPPOptimizerDialog::addStatusListener( const Reference< XStatusListener >&, const URL& ) - throw( RuntimeException ) -{ - // TODO - // OSL_ENSURE( sal_False, "PPPOptimizerDialog::addStatusListener()\nNot implemented yet!" ); -} - -//=============================================== -void SAL_CALL PPPOptimizerDialog::removeStatusListener( const Reference< XStatusListener >&, const URL& ) - throw( RuntimeException ) -{ - // TODO - // OSL_ENSURE( sal_False, "PPPOptimizerDialog::removeStatusListener()\nNot implemented yet!" ); + return aRet; } // ----------------------------------------------------------------------------- OUString PPPOptimizerDialog_getImplementationName() { - return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.SunPresentationMinimizerImp" ) ); + return OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) ); } Sequence< OUString > PPPOptimizerDialog_getSupportedServiceNames() diff --git a/main/sdext/source/minimizer/pppoptimizerdialog.hxx b/main/sdext/source/minimizer/pppoptimizerdialog.hxx index 4aaeb48..8bd7c09 100644 --- a/main/sdext/source/minimizer/pppoptimizerdialog.hxx +++ b/main/sdext/source/minimizer/pppoptimizerdialog.hxx @@ -31,41 +31,46 @@ #include #include #include -#ifndef _COM_SUN_STAR_LANG_XMULTI_COMPONENT_FACTORY_HPP_ #include -#endif #include #include #include #include -#include +#include +#include + +#include +#include // ---------------------- // - PPPOptimizerDialog - // ---------------------- -class OptimizerDialog; -class PPPOptimizerDialog : public ::cppu::WeakImplHelper4< +class PPPOptimizerDialog : protected ::cppu::BaseMutex, + public ::cppu::WeakImplHelper3< com::sun::star::lang::XInitialization, com::sun::star::lang::XServiceInfo, - com::sun::star::frame::XDispatchProvider, - com::sun::star::frame::XDispatch > + com::sun::star::ui::dialogs::XExecutableDialog > { - com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF; - com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame; - com::sun::star::uno::Reference< com::sun::star::frame::XController > mxController; - - OptimizerDialog* mpOptimizerDialog; +private: + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext; + bool mbInitialized; + com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame; + com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxParentWindow; + rtl::OUString msTitle; public: - PPPOptimizerDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF ); + PPPOptimizerDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext ); virtual ~PPPOptimizerDialog(); // XInitialization void SAL_CALL initialize( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) throw( com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL execute( ) throw (::com::sun::star::uno::RuntimeException); + // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() throw( com::sun::star::uno::RuntimeException ); @@ -75,26 +80,6 @@ public: virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( com::sun::star::uno::RuntimeException ); - - // XDispatchProvider - virtual com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( - const com::sun::star::util::URL& aURL, const rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags ) - throw(com::sun::star::uno::RuntimeException); - - virtual com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches( - const com::sun::star::uno::Sequence< com::sun::star::frame::DispatchDescriptor >& aDescripts ) throw( com::sun::star::uno::RuntimeException ); - - // XDispatch - virtual void SAL_CALL dispatch( const com::sun::star::util::URL& aURL, - const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lArguments ) - throw( com::sun::star::uno::RuntimeException ); - - virtual void SAL_CALL addStatusListener( const com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener >& xListener, - const com::sun::star::util::URL& aURL ) - throw( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeStatusListener( const com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener >& xListener, - const com::sun::star::util::URL& aURL ) - throw( com::sun::star::uno::RuntimeException ); }; rtl::OUString PPPOptimizerDialog_getImplementationName(); diff --git a/main/sdext/source/minimizer/pppoptimizertoken.cxx b/main/sdext/source/minimizer/pppoptimizertoken.cxx index 51238a5..029083a 100644 --- a/main/sdext/source/minimizer/pppoptimizertoken.cxx +++ b/main/sdext/source/minimizer/pppoptimizertoken.cxx @@ -49,7 +49,7 @@ struct TokenTable const char* pS; PPPOptimizerTokenEnum pE; }; - + static const TokenTable pTokenTableArray[] = { { "rdmNavi", TK_rdmNavi }, @@ -112,7 +112,6 @@ static const TokenTable pTokenTableArray[] = { "Alpha", TK_Alpha }, { "Animated", TK_Animated }, { "Background", TK_Background }, - { "BitmapPath", TK_BitmapPath }, { "Border", TK_Border }, { "Closeable", TK_Closeable }, { "ColorMode", TK_ColorMode }, @@ -146,11 +145,11 @@ static const TokenTable pTokenTableArray[] = { "GraphicURL", TK_GraphicURL }, { "GraphicStreamURL", TK_GraphicStreamURL }, { "Height", TK_Height }, - { "HelpFile", TK_HelpFile }, + { "HelpURL", TK_HelpURL }, { "Hidden", TK_Hidden }, { "ID", TK_ID }, { "ImageURL", TK_ImageURL }, - { "InformationDialog", TK_InformationDialog }, + { "ParentWindow", TK_ParentWindow },// TODO move it { "InputStream", TK_InputStream }, { "Interlaced", TK_Interlaced }, { "IsInternal", TK_IsInternal }, @@ -186,7 +185,7 @@ static const TokenTable pTokenTableArray[] = { "Spin", TK_Spin }, { "Step", TK_Step }, { "State", TK_State }, - { "StatusDispatcher", TK_StatusDispatcher }, + { "StatusListener", TK_StatusListener }, { "StringItemList", TK_StringItemList }, { "Strings", TK_Strings }, { "TabIndex", TK_TabIndex }, @@ -226,8 +225,8 @@ static const TokenTable pTokenTableArray[] = { "CurrentGraphicObject",TK_CurrentGraphicObject }, { "OLEObjects", TK_OLEObjects }, { "CurrentOLEObject", TK_CurrentOLEObject }, - - { "STR_SUN_OPTIMIZATION_WIZARD2",STR_SUN_OPTIMIZATION_WIZARD2 }, +#if 0 + { "STR_PRESENTATION_MINIMIZER",STR_PRESENTATION_MINIMIZER }, { "STR_STEPS", STR_STEPS }, { "STR_HELP", STR_HELP }, { "STR_BACK", STR_BACK }, @@ -292,7 +291,7 @@ static const TokenTable pTokenTableArray[] = { "STR_OPTIMIZING_GRAPHICS", STR_OPTIMIZING_GRAPHICS }, { "STR_CREATING_OLE_REPLACEMENTS",STR_CREATING_OLE_REPLACEMENTS }, { "STR_FileSizeSeparator", STR_FILESIZESEPARATOR }, - +#endif { "Last", TK_Last }, { "NotFound", TK_NotFound } }; diff --git a/main/sdext/source/minimizer/pppoptimizertoken.hxx b/main/sdext/source/minimizer/pppoptimizertoken.hxx index 3194025..de719cb 100644 --- a/main/sdext/source/minimizer/pppoptimizertoken.hxx +++ b/main/sdext/source/minimizer/pppoptimizertoken.hxx @@ -88,7 +88,6 @@ enum PPPOptimizerTokenEnum TK_Alpha, TK_Animated, TK_Background, - TK_BitmapPath, TK_Border, TK_Closeable, TK_ColorMode, @@ -122,11 +121,11 @@ enum PPPOptimizerTokenEnum TK_GraphicURL, TK_GraphicStreamURL, TK_Height, - TK_HelpFile, + TK_HelpURL, TK_Hidden, TK_ID, TK_ImageURL, - TK_InformationDialog, + TK_ParentWindow, TK_InputStream, TK_Interlaced, TK_IsInternal, @@ -162,7 +161,7 @@ enum PPPOptimizerTokenEnum TK_Spin, TK_Step, TK_State, - TK_StatusDispatcher, + TK_StatusListener, TK_StringItemList, TK_Strings, TK_TabIndex, @@ -202,8 +201,8 @@ enum PPPOptimizerTokenEnum TK_CurrentGraphicObject, TK_OLEObjects, TK_CurrentOLEObject, - - STR_SUN_OPTIMIZATION_WIZARD2, +#if 0 + STR_PRESENTATION_MINIMIZER, STR_STEPS, STR_HELP, STR_BACK, @@ -268,7 +267,7 @@ enum PPPOptimizerTokenEnum STR_OPTIMIZING_GRAPHICS, STR_CREATING_OLE_REPLACEMENTS, STR_FILESIZESEPARATOR, - +#endif TK_Last, TK_NotFound }; diff --git a/main/sdext/source/minimizer/pppoptimizeruno.cxx b/main/sdext/source/minimizer/pppoptimizeruno.cxx index 32f6a66..39654dc 100644 --- a/main/sdext/source/minimizer/pppoptimizeruno.cxx +++ b/main/sdext/source/minimizer/pppoptimizeruno.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * 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 @@ -7,110 +7,66 @@ * 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. - * + * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sdext.hxx" -#include -#include -#include +#include "pppoptimizer.hxx" +#include "pppoptimizerdialog.hxx" + #include -#include -#include +#include -using namespace ::rtl; -using namespace ::cppu; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::registry; -extern "C" +namespace sdext_presentation_minimizer { - void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** ) + static struct cppu::ImplementationEntry g_entries[] = { - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; - } + { + PPPOptimizer_createInstance, + PPPOptimizer_getImplementationName, + PPPOptimizer_getSupportedServiceNames, + cppu::createSingleComponentFactory, + 0, + 0 + }, + { + PPPOptimizerDialog_createInstance, + PPPOptimizerDialog_getImplementationName, + PPPOptimizer_getSupportedServiceNames, + cppu::createSingleComponentFactory, + 0, + 0 + }, + { 0, 0, 0, 0, 0, 0 } + }; +} - // ------------------------------------------------------------------------- - - sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) +extern "C" +{ + SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( + const sal_Char **ppEnvTypeName, uno_Environment **/*ppEnv*/ ) { - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey; - sal_Int32 nPos; - - xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( PPPOptimizer_getImplementationName() ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - const Sequence< OUString > & rSNL1 = PPPOptimizer_getSupportedServiceNames(); - const OUString * pArray1 = rSNL1.getConstArray(); - for ( nPos = rSNL1.getLength(); nPos--; ) - xNewKey->createKey( pArray1[nPos] ); - - xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( PPPOptimizerDialog_getImplementationName() ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - const Sequence< OUString > & rSNL2 = PPPOptimizerDialog_getSupportedServiceNames(); - const OUString * pArray2 = rSNL2.getConstArray(); - for ( nPos = rSNL2.getLength(); nPos--; ) - xNewKey->createKey( pArray2[nPos] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - // ------------------------------------------------------------------------- - - void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) + SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory( + const sal_Char *pImplName, void *pServiceManager, void *pRegistryKey ) { - OUString aImplName( OUString::createFromAscii( pImplName ) ); - void* pRet = 0; - - if( pServiceManager ) - { - Reference< XSingleComponentFactory > xFactory; - if( aImplName.equals( PPPOptimizer_getImplementationName() ) ) - { - xFactory = createSingleComponentFactory( - PPPOptimizer_createInstance, - OUString::createFromAscii( pImplName ), - PPPOptimizer_getSupportedServiceNames() ); - - } - else if( aImplName.equals( PPPOptimizerDialog_getImplementationName() ) ) - { - xFactory = createSingleComponentFactory( - PPPOptimizerDialog_createInstance, - OUString::createFromAscii( pImplName ), - PPPOptimizerDialog_getSupportedServiceNames() ); - } - if( xFactory.is() ) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - } - return pRet; + return ::cppu::component_getFactoryHelper( pImplName, + pServiceManager, + pRegistryKey , + sdext_presentation_minimizer::g_entries ); } } diff --git a/main/sdext/source/minimizer/registry/data/org/openoffice/Office/Addons.xcu b/main/sdext/source/minimizer/registry/data/org/openoffice/Office/Addons.xcu deleted file mode 100644 index 238a033..0000000 --- a/main/sdext/source/minimizer/registry/data/org/openoffice/Office/Addons.xcu +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - vnd.com.sun.star.comp.SunPresentationMinimizer:execute - - - - %origin%/../../../../../bitmaps/opt_16.png - - - %origin%/../../../../../bitmaps/opt_26.png - - - %origin%/../../../../../bitmaps/opt_16_h.png - - - %origin%/../../../../../bitmaps/opt_26_h.png - - - - - - - - - .uno:ToolsMenu\.uno:AVMediaPlayer - - - AddAfter - - - AddPath - - - com.sun.star.presentation.PresentationDocument - - - - - private:separator - - - - - vnd.com.sun.star.comp.SunPresentationMinimizer:execute - - - ~Minimize Presentation... - - - _self - - - com.sun.star.presentation.PresentationDocument - - - - - - - - diff --git a/main/sdext/source/minimizer/registry/data/org/openoffice/Office/ProtocolHandler.xcu b/main/sdext/source/minimizer/registry/data/org/openoffice/Office/ProtocolHandler.xcu deleted file mode 100644 index cfb9867..0000000 --- a/main/sdext/source/minimizer/registry/data/org/openoffice/Office/ProtocolHandler.xcu +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - vnd.com.sun.star.comp.SunPresentationMinimizer:* - - - - diff --git a/main/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu b/main/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu deleted file mode 100644 index e009b76..0000000 --- a/main/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu +++ /dev/null @@ -1,404 +0,0 @@ - - - - - - - %origin%/../../../../../../bitmaps - - - - %origin%/../../../../../../help/help_en-US.odt - - - - - @MINIMIZEREXTENSIONPRODUCTNAME@ - - - Steps - - - ~Help - - - < ~Back - - - ~Next > - - - ~Finish - - - Cancel - - - Introduction - - - The @MINIMIZEREXTENSIONPRODUCTNAME@ is used to reduce the file size of the current presentation. Images will be compressed and data, that is no longer needed, will be removed. - - At the last step of the wizard you can choose to apply the changes to the current presentation or to create an optimized new version of the presentation. - - - ~Choose settings for @MINIMIZEREXTENSIONPRODUCTNAME@ - - - ~Delete - - - Choose settings for optimizing pictures and graphics - - - Graphics - - - ~Lossless compression - - - ~JPEG compression - - - ~Quality in % - - - ~Delete cropped graphic areas - - - Reduce ~image resolution - - - 0;<no change> - - - 90;90 DPI (screen resolution) - - - 150;150 DPI (projector resolution) - - - 300;300 DPI (print resolution) - - - ~Break links to external graphics - - - OLE Objects - - - Choose settings for replacing OLE objects - - - Create static replacement graphics for OLE objects - - - For ~all OLE objects - - - ~For OLE objects not based on OpenDocument format - - - Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects. - -The current presentation contains OLE objects. - - - Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects. - -The current presentation contains no OLE objects. - - - Slides - - - Choose which slides to delete - - - Master Pages - - - Delete unused ~master pages - - - ~Clear notes - - - Delete hidden ~slides - - - Delete slides that are not used for the ~custom slide show - - - Summary - - - Choose where to apply the following changes - - - Progress - - - Objects optimized - - - ~Apply changes to current presentation - - - ~Open newly created presentation - - - ~Save settings as - - - ~Duplicate presentation before applying changes - - - Delete %SLIDES slides. - - - Optimize %IMAGES graphics to %QUALITY% JPEG quality at %RESOLUTION DPI. - - - Create replacement graphics for %OLE objects. - - - Current file size: - - - Estimated new file size: - - - %1 MB - - - My Settings - - - default session - - - The optimization will modify the current document. Do you want to continue? - - - ~Yes - - - OK - - - The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB. - - - The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to approximated %NEWFILESIZE MB. - - - The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB. - - - The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed to approximated %NEWFILESIZE MB. - - - Duplicating presentation... - - - Deleting slides... - - - Optimizing graphics... - - - Creating replacement graphics for OLE objects... - - - . - - - - - Projector optimized - - - true - - - 50 - - - true - - - 150 - - - true - - - true - - - 0 - - - true - - - true - - - false - - - true - - - true - - - - - - - Screen optimized (smallest file size) - - - true - - - 25 - - - true - - - 90 - - - true - - - true - - - 0 - - - true - - - true - - - false - - - true - - - true - - - - - Projector optimized - - - true - - - 50 - - - true - - - 150 - - - true - - - true - - - 0 - - - true - - - true - - - false - - - true - - - true - - - - - Print optimized - - - true - - - 75 - - - true - - - 300 - - - true - - - true - - - 0 - - - true - - - true - - - false - - - true - - - true - - - - - diff --git a/main/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/makefile.mk b/main/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/makefile.mk deleted file mode 100644 index 2d2d03d..0000000 --- a/main/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************** -# -# 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. -# -#************************************************************** - - -PRJ=..$/..$/..$/..$/..$/..$/..$/.. - -PRJNAME=sdext -TARGET=data_ooOfficeext -PACKAGE=org.openoffice.Office.extension - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/source$/minimizer$/minimizer.pmk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -XCSROOT=$(PRJ)$/source$/minimizer -ABSXCSROOT=$(PWD)$/$(PRJ)$/source$/minimizer - -# --- Targets ------------------------------------------------------ - -XCUFILES= \ - SunPresentationMinimizer.xcu - -MODULEFILES= - -LOCALIZEDFILES= \ - SunPresentationMinimizer.xcu - -.INCLUDE : target.mk diff --git a/main/sdext/source/minimizer/registry/data/org/openoffice/Office/makefile.mk b/main/sdext/source/minimizer/registry/data/org/openoffice/Office/makefile.mk deleted file mode 100644 index 7370b25..0000000 --- a/main/sdext/source/minimizer/registry/data/org/openoffice/Office/makefile.mk +++ /dev/null @@ -1,44 +0,0 @@ -#************************************************************** -# -# 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. -# -#************************************************************** - - -PRJ=..$/..$/..$/..$/..$/..$/.. - -PRJNAME=sdext -TARGET=data_ooOffice -PACKAGE=org.openoffice.Office - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/source$/minimizer$/minimizer.pmk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Targets ------------------------------------------------------ - -XCUFILES= \ - Addons.xcu \ - ProtocolHandler.xcu - -MODULEFILES= - -LOCALIZEDFILES= \ - Addons.xcu - -.INCLUDE : target.mk diff --git a/main/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs b/main/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs deleted file mode 100644 index 0d8106a..0000000 --- a/main/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - Describes the Presentation Optimization Wizard settings of one session - - - - Specifies the name settings name - - Default - - - - Specifies if JPEG compression is being used - - true - - - - Specifies quality of the JPG export. A higher value results in higher quality and file size. - - - - - 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. - - - - - Represents highest value that can be used. The higher the value, the better is the compression quality and the smaller is the file size. - - - - 45 - - - - Specifies if the crop area of a picture has to be removed - - true - - - - Specifies the Image Resolution that should be used in dpi. A value of zero determines that the image resolution should not be changed. - - 150 - - - - Specifies if linked graphics are to be embedded - - true - - - - Specifies if OLE Objects are converted to Graphic objects at all - - true - - - - Specifies the compression type that is being used,. - - - Each - Alien - - 0 - - - - Specifies if unused Master Pages are being deleted - - true - - - - Specifies if hidden Slides are being deleted - - true - - - - Specifies if Notes Pages are being deleted - - false - - - - Specifies if the optimization is done on a new document. - - true - - - - Specifies if the newly created document is opened automatically. - - true - - - - - - - - - Presentation Minimizer - - - Steps - - - ~Help - - - < ~Back - - - ~Next > - - - ~Finish - - - Cancel - - - Introduction - - - The Presentation Minimizer is used to reduce the file size of the current presentation. Images will be compressed and data, that is no longer needed, will be removed. - - At the last step of the wizard you can choose to apply the changes to the current presentation or to create an optimized new version of the presentation. - - - ~Choose settings for the Presentation Minimization Wizard - - - ~Delete - - - Choose settings for optimizing pictures and graphics - - - Graphics - - - ~Lossless compression - - - ~JPEG compression - - - ~Quality - - - ~Delete cropped graphic areas - - - ~Image Resolution - - - 0;<no change> - - - 90;90 DPI (screen resolution) - - - 150;150 DPI (projector resolution) - - - 300;300 DPI (print resolution) - - - ~Break links to external graphics - - - OLE Objects - - - Choose settings for replacing OLE objects - - - Create static replacement graphics for OLE objects - - - For ~all OLE objects - - - ~For OLE objects not based on OpenDocument format - - - Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects. - -The current presentation contains no OLE objects. - - - Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects. - -The current presentation contains no OLE objects. - - - Slides - - - Choose which slides to delete - - - Master Pages - - - Delete unused ~master pages - - - ~Clear notes - - - Delete hidden ~slides - - - Delete slides that are not used for the ~custom slide show - - - Summary - - - Choose where to apply the following changes - - - Progress - - - Objects optimized - - - ~Apply changes to current presentation - - - ~Open newly created presentation - - - ~Save settings as - - - ~Duplicate presentation before applying changes - - - Delete %SLIDES slides - - - - The following string is only used in plural. - - Optimize %IMAGES graphics to %QUALITY% JPEG quality at %RESOLUTION DPI. - - - Create replacement graphics for %OLE objects. - - - Current file size: - - - Estimated new file size: - - - %1 MB - - - My Settings - - - default session - - - The optimization will modify the current document. Do you want to continue? - - - ~Yes - - - OK - - - The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB. - - - The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to approximated %NEWFILESIZE MB. - - - The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB. - - - The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed to approximated %NEWFILESIZE MB. - - - Duplicating presentation... - - - Deleting slides... - - - Optimizing graphics... - - - Creating replacement graphics for OLE objects... - - - . - - - - - describes the name of the last used settings - - - - - - List of the saved Presentation Optimization Wizard settings - - - - - diff --git a/main/sdext/source/minimizer/unodialog.cxx b/main/sdext/source/minimizer/unodialog.cxx index bf99c74..843f21b 100644 --- a/main/sdext/source/minimizer/unodialog.cxx +++ b/main/sdext/source/minimizer/unodialog.cxx @@ -25,20 +25,23 @@ #include "precompiled_sdext.hxx" #include "unodialog.hxx" -#include -#include + +#include +#include +#include +#include +#include #include -#include -#include +#include #include -#include -#include +#include +#include +#include // ------------- // - UnoDialog - // ------------- -using namespace ::rtl; using namespace ::com::sun::star::awt; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; @@ -48,44 +51,58 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::script; -UnoDialog::UnoDialog( const Reference< XComponentContext > &rxMSF, Reference< XFrame >& rxFrame ) : - mxMSF( rxMSF ), - mxController( rxFrame->getController() ), - mxDialogModel( mxMSF->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.awt.UnoControlDialogModel" ) ), mxMSF ), UNO_QUERY_THROW ), +using ::rtl::OUString; + +UnoDialog::UnoDialog( + const Reference< XComponentContext > &rxContext, + const Reference< XWindowPeer >& rxParent ) : + mxContext( rxContext ), + mxParent( rxParent ), + mxDialogModel( mxContext->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.awt.UnoControlDialogModel" ) ), mxContext ), UNO_QUERY_THROW ), mxDialogModelMultiPropertySet( mxDialogModel, UNO_QUERY_THROW ), mxDialogModelPropertySet( mxDialogModel, UNO_QUERY_THROW ), mxDialogModelMSF( mxDialogModel, UNO_QUERY_THROW ), mxDialogModelNameContainer( mxDialogModel, UNO_QUERY_THROW ), mxDialogModelNameAccess( mxDialogModel, UNO_QUERY_THROW ), mxControlModel( mxDialogModel, UNO_QUERY_THROW ), - mxDialog( mxMSF->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.awt.UnoControlDialog" ) ), mxMSF ), UNO_QUERY_THROW ), + mxDialog( mxContext->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.awt.UnoControlDialog" ) ), mxContext ), UNO_QUERY_THROW ), mxControl( mxDialog, UNO_QUERY_THROW ), mbStatus( sal_False ) { + OSL_TRACE("UnoDialog::UnoDialog"); mxControl->setModel( mxControlModel ); mxDialogControlContainer = Reference< XControlContainer >( mxDialog, UNO_QUERY_THROW ); - mxDialogComponent = Reference< XComponent >( mxDialog, UNO_QUERY_THROW ); - mxDialogWindow = Reference< XWindow >( mxDialog, UNO_QUERY_THROW ); - - Reference< XFrame > xFrame( mxController->getFrame() ); - Reference< XWindow > xContainerWindow( xFrame->getContainerWindow() ); - mxWindowPeer = Reference< XWindowPeer >( xContainerWindow, UNO_QUERY_THROW ); - createWindowPeer( mxWindowPeer ); + mxDialogWindow = Reference< XWindow >( mxDialog, UNO_QUERY ); + mxDialogWindowPeer = createWindowPeer(); } // ----------------------------------------------------------------------------- UnoDialog::~UnoDialog() { - + OSL_TRACE("UnoDialog::~UnoDialog"); + Reference< XComponent > xComponent( mxDialog, UNO_QUERY ); + if ( xComponent.is() ) + { + xComponent->dispose(); + } } // ----------------------------------------------------------------------------- +void UnoDialog::setTitle( const rtl::OUString &rTitle ) +{ + if ( rTitle.getLength() ) + { + mxDialog->setTitle( rTitle ); + } +} + void UnoDialog::execute() { + OSL_TRACE("UnoDialog::execute"); mxDialogWindow->setEnable( sal_True ); mxDialogWindow->setVisible( sal_True ); mxDialog->execute(); @@ -93,22 +110,55 @@ void UnoDialog::execute() void UnoDialog::endExecute( sal_Bool bStatus ) { + OSL_TRACE("UnoDialog::endExecute"); mbStatus = bStatus; mxDialog->endExecute(); } +void UnoDialog::centerDialog() +{ + Reference< XWindow > xParent( mxParent, UNO_QUERY ); + if ( !xParent.is() ) + return; + + Rectangle aParentPosSize = xParent->getPosSize(); + Rectangle aWinPosSize = mxDialogWindow->getPosSize(); + Point aWinPos((aParentPosSize.Width - aWinPosSize.Width) / 2, + (aParentPosSize.Height - aWinPosSize.Height) / 2); + + if ( ( aWinPos.X + aWinPosSize.Width ) > ( aParentPosSize.X + aParentPosSize.Width ) ) + aWinPos.X = aParentPosSize.X + aParentPosSize.Width - aWinPosSize.Width; + + if ( ( aWinPos.Y + aWinPosSize.Height ) > ( aParentPosSize.Y + aParentPosSize.Height ) ) + aWinPos.Y = aParentPosSize.Y + aParentPosSize.Height - aWinPosSize.Height; + + mxDialogWindow->setPosSize( aWinPos.X, aWinPos.Y, + aWinPosSize.Width, + aWinPosSize.Height, + PosSize::POS ); +} + // ----------------------------------------------------------------------------- -Reference< XWindowPeer > UnoDialog::createWindowPeer( Reference< XWindowPeer > xParentPeer ) +Reference< XWindowPeer > UnoDialog::createWindowPeer() throw ( Exception ) { - mxDialogWindow->setVisible( sal_False ); - Reference< XToolkit > xToolkit( mxMSF->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ), mxMSF ), UNO_QUERY_THROW ); - if ( !xParentPeer.is() ) - xParentPeer = xToolkit->getDesktopWindow(); + mxDialogWindow->setVisible( sal_False ); + + // reuse the parent's toolkit + Reference< XToolkit > xToolkit; + if ( mxParent.is() ) + xToolkit.set( mxParent->getToolkit() ); + + if ( !xToolkit.is() ) + xToolkit.set( mxContext->getServiceManager()->createInstanceWithContext( + OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.awt.Toolkit" ) ), mxContext ), + UNO_QUERY_THROW ); + mxReschedule = Reference< XReschedule >( xToolkit, UNO_QUERY ); - mxControl->createPeer( xToolkit, xParentPeer ); -// xWindowPeer = xControl.getPeer(); + mxControl->createPeer( xToolkit, mxParent ); + return mxControl->getPeer(); } @@ -153,14 +203,9 @@ sal_Bool UnoDialog::isHighContrast() sal_Bool bHighContrast = sal_False; try { - sal_Int32 nBackgroundColor = 0; - if ( mxDialogModelPropertySet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "BackgroundColor" ) ) ) >>= nBackgroundColor ) - { - sal_uInt8 nLum( static_cast< sal_uInt8 >( ( static_cast< sal_uInt8 >( nBackgroundColor >> 16 ) * 28 + - static_cast< sal_uInt8 >( nBackgroundColor >> 8 ) * 151 + - static_cast< sal_uInt8 >( nBackgroundColor ) * 77 ) >> 8 ) ); - bHighContrast = nLum <= 38; - } + Reference< XStyleSettingsSupplier > xStyleSettingsSuppl( mxDialogWindow, UNO_QUERY_THROW ); + Reference< XStyleSettings > xStyleSettings( xStyleSettingsSuppl->getStyleSettings() ); + bHighContrast = xStyleSettings->getHighContrastMode(); } catch( Exception& ) { diff --git a/main/sdext/source/minimizer/unodialog.hxx b/main/sdext/source/minimizer/unodialog.hxx index ca50a84..5b5f401 100644 --- a/main/sdext/source/minimizer/unodialog.hxx +++ b/main/sdext/source/minimizer/unodialog.hxx @@ -26,9 +26,7 @@ #include #include -#ifndef _COM_SUN_STAR_LANG_XMULTI_COMPONENT_FACTORY_HPP_ #include -#endif #include #include #include @@ -53,9 +51,6 @@ #include #include #include -#include -#include -#include // ------------- // - UnoDialog - @@ -67,23 +62,24 @@ class UnoDialog { public : - UnoDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rxFrame ); - ~UnoDialog(); + UnoDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, + const com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer >& rxParent); + virtual ~UnoDialog(); + void execute(); + void endExecute( sal_Bool bStatus ); + void setTitle( const rtl::OUString &rTitle); - void execute(); - void endExecute( sal_Bool bStatus ); +protected: + void setVisible( const rtl::OUString& rName, sal_Bool bVisible ); + sal_Int32 getMapsFromPixels( sal_Int32 nPixels ) const; + sal_Bool isHighContrast(); + void centerDialog(); - com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > createWindowPeer( com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > xParentPeer ) - throw ( com::sun::star::uno::Exception ); + com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > createWindowPeer() throw ( com::sun::star::uno::Exception ); com::sun::star::uno::Reference< com::sun::star::uno::XInterface > insertControlModel( const rtl::OUString& rServiceName, const rtl::OUString& rName, const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& rPropertyValues ); - void setVisible( const rtl::OUString& rName, sal_Bool bVisible ); - - sal_Bool isHighContrast(); - - sal_Int32 getMapsFromPixels( sal_Int32 nPixels ) const; com::sun::star::uno::Reference< com::sun::star::awt::XButton > insertButton( const rtl::OUString& rName, com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > xActionListener, const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, @@ -112,15 +108,13 @@ public : void setControlProperty( const rtl::OUString& rControlName, const rtl::OUString& rPropertyName, const com::sun::star::uno::Any& rPropertyValue ); com::sun::star::uno::Any getControlProperty( const rtl::OUString& rControlName, const rtl::OUString& rPropertyName ); -#if 0 - void showMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, sal_Bool bErrorBox ) const; -#endif void enableControl( const rtl::OUString& rControlName ); void disableControl( const rtl::OUString& rControlName ); - com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF; - com::sun::star::uno::Reference< com::sun::star::frame::XController > mxController; - com::sun::star::uno::Reference< com::sun::star::awt::XReschedule > mxReschedule; +protected: + + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext; + com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxParent; com::sun::star::uno::Reference< com::sun::star::uno::XInterface > mxDialogModel; com::sun::star::uno::Reference< com::sun::star::beans::XMultiPropertySet > mxDialogModelMultiPropertySet; @@ -128,18 +122,16 @@ public : com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxDialogModelMSF; com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxDialogModelNameContainer; com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > mxDialogModelNameAccess; - com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > mxControlModel; - com::sun::star::uno::Reference< com::sun::star::awt::XDialog > mxDialog; com::sun::star::uno::Reference< com::sun::star::awt::XControl > mxControl; - com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxWindowPeer; + sal_Bool mbStatus; com::sun::star::uno::Reference< com::sun::star::awt::XControlContainer > mxDialogControlContainer; - com::sun::star::uno::Reference< com::sun::star::lang::XComponent > mxDialogComponent; com::sun::star::uno::Reference< com::sun::star::awt::XWindow > mxDialogWindow; + com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxDialogWindowPeer; - sal_Bool mbStatus; + com::sun::star::uno::Reference< com::sun::star::awt::XReschedule > mxReschedule; }; #endif // UNODIALOG_HXX diff --git a/main/set_soenv.in b/main/set_soenv.in index f7b6cce..ed2efe5 100644 --- a/main/set_soenv.in +++ b/main/set_soenv.in @@ -1676,7 +1676,6 @@ ToFile( "ENABLE_CAIRO", "@ENABLE_CAIRO@", "e" ); ToFile( "ENABLE_CAIRO_CANVAS", "@ENABLE_CAIRO_CANVAS@", "e" ); ToFile( "ENABLE_OPENGL", "@ENABLE_OPENGL@", "e" ); ToFile( "ENABLE_PDFIMPORT", "@ENABLE_PDFIMPORT@", "e" ); -ToFile( "ENABLE_MINIMIZER", "@ENABLE_MINIMIZER@","e" ); ToFile( "ENABLE_PRESENTER_SCREEN","@ENABLE_PRESENTER_SCREEN@","e" ); ToFile( "ENABLE_REPORTBUILDER","@ENABLE_REPORTBUILDER@","e" ); ToFile( "SYSTEM_JFREEREPORT","@SYSTEM_JFREEREPORT@","e" ); -- 1.7.9