summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basegfx/source/curve/b2dcubicbezier.cxx24
-rw-r--r--basegfx/source/polygon/b2dtrapezoid.cxx4
-rw-r--r--comphelper/inc/comphelper/docpasswordhelper.hxx63
-rw-r--r--comphelper/inc/comphelper/mediadescriptor.hxx1
-rw-r--r--comphelper/inc/comphelper/storagehelper.hxx11
-rw-r--r--comphelper/source/misc/docpasswordhelper.cxx152
-rw-r--r--comphelper/source/misc/mediadescriptor.cxx6
-rw-r--r--comphelper/source/misc/storagehelper.cxx52
-rw-r--r--configmgr/source/childaccess.cxx18
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx12
-rw-r--r--editeng/inc/editeng/svxrtf.hxx2
-rw-r--r--editeng/source/items/flditem.cxx109
-rw-r--r--editeng/source/misc/svxacorr.cxx2
-rw-r--r--editeng/source/rtf/rtfitem.cxx12
-rw-r--r--editeng/source/rtf/svxrtf.cxx10
-rw-r--r--extras/source/gallery/gallery_system/sg24.sdgbin49161 -> 45786 bytes
-rw-r--r--extras/source/gallery/gallery_system/sg24.sdvbin359424 -> 360960 bytes
-rw-r--r--extras/source/gallery/gallery_system/sg24.thmbin1236 -> 1236 bytes
-rw-r--r--filter/inc/filter/msfilter/mscodec.hxx67
-rw-r--r--filter/source/graphicfilter/itiff/itiff.cxx370
-rw-r--r--filter/source/msfilter/mscodec.cxx140
-rw-r--r--filter/source/msfilter/svdfppt.cxx16
-rw-r--r--filter/source/pdf/impdialog.cxx81
-rw-r--r--filter/source/pdf/impdialog.hrc5
-rw-r--r--filter/source/pdf/impdialog.hxx21
-rw-r--r--filter/source/pdf/impdialog.src35
-rw-r--r--filter/source/pdf/makefile.mk1
-rw-r--r--filter/source/pdf/pdfexport.cxx312
-rw-r--r--filter/source/pdf/pdfexport.hxx8
-rw-r--r--filter/source/pdf/pdffilter.component3
-rw-r--r--filter/source/pdf/pdffilter.cxx5
-rw-r--r--filter/source/pdf/pdffilter.hxx1
-rw-r--r--filter/source/pdf/pdfinteract.cxx137
-rw-r--r--filter/source/pdf/pdfinteract.hxx91
-rw-r--r--filter/source/pdf/pdfuno.cxx8
-rw-r--r--jfreereport/java/flute/makefile.mk30
-rw-r--r--jfreereport/java/jfreereport/makefile.mk15
-rw-r--r--jfreereport/java/libbase/makefile.mk28
-rw-r--r--jfreereport/java/libfonts/makefile.mk28
-rw-r--r--jfreereport/java/libformula/makefile.mk30
-rw-r--r--jfreereport/java/liblayout/makefile.mk14
-rw-r--r--jfreereport/java/libloader/makefile.mk29
-rw-r--r--jfreereport/java/librepository/makefile.mk29
-rw-r--r--jfreereport/java/libserializer/makefile.mk28
-rw-r--r--jfreereport/java/libxml/makefile.mk28
-rw-r--r--jfreereport/java/sac/makefile.mk4
-rwxr-xr-xjfreereport/patches/common_build.patch76
-rw-r--r--jfreereport/patches/flow-engine.patch4
-rw-r--r--jfreereport/patches/flute.patch19
-rw-r--r--jfreereport/patches/libbase.patch19
-rw-r--r--jfreereport/patches/libfonts.patch10
-rw-r--r--jfreereport/patches/libformula.patch27
-rw-r--r--jfreereport/patches/liblayout.patch4
-rw-r--r--jfreereport/patches/libloader.patch11
-rw-r--r--jfreereport/patches/librepository.patch10
-rw-r--r--jfreereport/patches/libserializer.patch10
-rw-r--r--jfreereport/patches/libxml.patch10
-rw-r--r--jfreereport/prj/d.lst1
-rw-r--r--jfreereport/version.mk12
-rw-r--r--jvmaccess/util/cc5_solaris_sparc.map4
-rw-r--r--jvmaccess/util/gcc3.map4
-rw-r--r--jvmaccess/util/msvc_win32_intel.map4
-rw-r--r--offapi/com/sun/star/document/MediaDescriptor.idl29
-rw-r--r--offapi/com/sun/star/embed/XEncryptionProtectedSource2.idl65
-rw-r--r--offapi/com/sun/star/embed/XHierarchicalStorageAccess2.idl109
-rw-r--r--offapi/com/sun/star/embed/XStorage2.idl165
-rw-r--r--offapi/com/sun/star/embed/makefile.mk3
-rw-r--r--offapi/com/sun/star/task/PDFExportException.idl52
-rw-r--r--[-rwxr-xr-x]offapi/com/sun/star/task/makefile.mk1
-rw-r--r--officecfg/registry/data/org/openoffice/Interaction.xcu12
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Writer.xcu3
-rw-r--r--oox/inc/oox/core/binarycodec.hxx50
-rw-r--r--oox/inc/oox/core/filterbase.hxx7
-rw-r--r--oox/inc/oox/dump/dumperbase.hxx4
-rw-r--r--oox/inc/oox/xls/biffcodec.hxx21
-rw-r--r--oox/source/core/binarycodec.cxx111
-rw-r--r--oox/source/core/filterbase.cxx4
-rw-r--r--oox/source/core/filterdetect.cxx109
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx2
-rw-r--r--oox/source/drawingml/textrun.cxx50
-rw-r--r--oox/source/dump/biffdumper.cxx2
-rw-r--r--oox/source/dump/dumperbase.cxx16
-rw-r--r--oox/source/xls/biffcodec.cxx92
-rw-r--r--package/source/xstor/ohierarchyholder.cxx21
-rw-r--r--package/source/xstor/ohierarchyholder.hxx18
-rw-r--r--package/source/xstor/owriteablestream.cxx206
-rw-r--r--package/source/xstor/owriteablestream.hxx38
-rw-r--r--package/source/xstor/xstorage.cxx586
-rw-r--r--package/source/xstor/xstorage.hxx66
-rw-r--r--package/source/zippackage/ZipPackage.cxx2
-rw-r--r--postprocess/packcomponents/makefile.mk1
-rw-r--r--reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk5
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/Manifest.mf8
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java16
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/makefile.mk14
-rw-r--r--reportbuilder/java/com/sun/star/report/util/makefile.mk6
-rw-r--r--[-rwxr-xr-x]reportbuilder/util/makefile.mk22
-rw-r--r--sc/source/filter/excel/excdoc.cxx2
-rw-r--r--sc/source/filter/excel/excel.cxx17
-rw-r--r--sc/source/filter/excel/xeroot.cxx64
-rw-r--r--sc/source/filter/excel/xestream.cxx64
-rw-r--r--sc/source/filter/excel/xicontent.cxx2
-rw-r--r--sc/source/filter/excel/xistream.cxx110
-rw-r--r--sc/source/filter/excel/xlroot.cxx6
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx34
-rw-r--r--sc/source/filter/inc/fapihelper.hxx7
-rw-r--r--sc/source/filter/inc/xcl97rec.hxx6
-rw-r--r--sc/source/filter/inc/xeroot.hxx6
-rw-r--r--sc/source/filter/inc/xestream.hxx18
-rw-r--r--sc/source/filter/inc/xistream.hxx24
-rw-r--r--sc/source/filter/inc/xlroot.hxx5
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx33
-rw-r--r--scp2/source/ooo/directory_ooo.scp10
-rw-r--r--scp2/source/ooo/file_extra_ooo.scp7
-rwxr-xr-xscp2/source/ooo/file_library_ooo.scp2
-rw-r--r--scp2/source/ooo/module_hidden_ooo.scp1
-rwxr-xr-xscp2/source/ooo/module_lang_template.scp1
-rwxr-xr-xsd/source/filter/ppt/propread.cxx2
-rwxr-xr-x[-rw-r--r--]sd/source/ui/func/fuexpand.cxx3
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx25
-rwxr-xr-xsd/source/ui/view/drviews7.cxx28
-rwxr-xr-xsd/source/ui/view/outlnvsh.cxx21
-rw-r--r--[-rwxr-xr-x]sdext/source/minimizer/description.xml2
-rw-r--r--[-rwxr-xr-x]sdext/source/presenter/description.xml2
-rw-r--r--sfx2/inc/sfx2/docfile.hxx2
-rw-r--r--sfx2/inc/sfx2/passwd.hxx22
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc4
-rw-r--r--sfx2/inc/sfx2/sfxuno.hxx3
-rw-r--r--[-rwxr-xr-x]sfx2/sdi/sfx.sdi2
-rw-r--r--sfx2/source/appl/appopen.cxx49
-rw-r--r--sfx2/source/appl/appuno.cxx20
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx31
-rw-r--r--sfx2/source/dialog/mailmodelapi.cxx2
-rw-r--r--[-rwxr-xr-x]sfx2/source/dialog/makefile.mk2
-rw-r--r--sfx2/source/dialog/passwd.cxx179
-rw-r--r--sfx2/source/dialog/passwd.hrc5
-rw-r--r--sfx2/source/dialog/passwd.src30
-rw-r--r--sfx2/source/dialog/versdlg.cxx8
-rw-r--r--sfx2/source/doc/docfile.cxx14
-rw-r--r--sfx2/source/doc/guisaveas.cxx10
-rw-r--r--sfx2/source/doc/objserv.cxx3
-rw-r--r--sfx2/source/doc/objstor.cxx46
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx70
-rw-r--r--solenv/bin/addsym.awk23
-rw-r--r--[-rwxr-xr-x]solenv/bin/build.pl20
-rw-r--r--solenv/inc/minor.mk6
-rw-r--r--svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx9
-rw-r--r--svx/inc/svx/svdograf.hxx3
-rw-r--r--svx/source/sdr/contact/objectcontactofobjlistpainter.cxx19
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofgraphic.cxx36
-rw-r--r--svx/source/svdraw/svdmodel.cxx2
-rw-r--r--svx/source/svdraw/svdograf.cxx192
-rw-r--r--sw/prj/d.lst1
-rw-r--r--sw/source/core/doc/doclay.cxx5
-rw-r--r--sw/source/core/doc/doctxm.cxx3
-rw-r--r--sw/source/core/doc/tblrwcl.cxx8
-rw-r--r--sw/source/core/edit/edsect.cxx4
-rw-r--r--sw/source/core/frmedt/feshview.cxx6
-rw-r--r--sw/source/core/frmedt/tblsel.cxx4
-rw-r--r--sw/source/core/layout/layact.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx8
-rw-r--r--sw/source/core/layout/trvlfrm.cxx22
-rw-r--r--sw/source/core/layout/wsfrm.cxx2
-rw-r--r--sw/source/core/table/swtable.cxx2
-rw-r--r--sw/source/core/text/frmcrsr.cxx2
-rw-r--r--sw/source/core/unocore/unostyle.cxx12
-rw-r--r--sw/source/core/unocore/unotbl.cxx12
-rw-r--r--sw/source/filter/ascii/ascatr.cxx4
-rw-r--r--sw/source/filter/html/htmlctxt.cxx2
-rw-r--r--sw/source/filter/html/htmltabw.cxx13
-rw-r--r--sw/source/filter/inc/wrtswtbl.hxx36
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx2
-rw-r--r--sw/source/filter/writer/wrtswtbl.cxx40
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx26
-rw-r--r--sw/source/filter/ww8/rtfexportfilter.cxx38
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx10
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx92
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx7
-rw-r--r--sw/source/filter/ww8/ww8par.cxx172
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx17
-rw-r--r--sw/source/filter/xml/xmltble.cxx34
-rw-r--r--sw/source/ui/app/docsh.cxx18
-rw-r--r--sw/source/ui/chrdlg/break.cxx2
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx25
-rw-r--r--sw/source/ui/frmdlg/cption.cxx8
-rw-r--r--sw/source/ui/index/cnttab.cxx12
-rw-r--r--sw/source/ui/misc/docfnote.cxx2
-rw-r--r--sw/source/ui/misc/glosdoc.cxx2
-rw-r--r--sw/source/ui/misc/outline.cxx4
-rw-r--r--sw/source/ui/shells/frmsh.cxx6
-rw-r--r--sw/source/ui/shells/tabsh.cxx16
-rw-r--r--sw/source/ui/shells/textsh.cxx24
-rw-r--r--sw/source/ui/shells/textsh1.cxx4
-rw-r--r--sw/source/ui/shells/txtattr.cxx4
-rw-r--r--sw/source/ui/table/tabledlg.cxx2
-rw-r--r--sw/source/ui/uiview/view.cxx4
-rw-r--r--sw/source/ui/uiview/viewtab.cxx22
-rw-r--r--sw/source/ui/utlui/content.cxx10
-rw-r--r--sw/util/makefile.mk8
-rw-r--r--sw/util/msword.component37
-rw-r--r--sw/util/msword.map1
-rw-r--r--testautomation/graphics/optional/includes/global/g_arrangealign.inc130
-rw-r--r--testautomation/graphics/optional/includes/global/g_convertto.inc221
-rw-r--r--testautomation/graphics/optional/includes/global/g_customshapes.inc138
-rw-r--r--testautomation/graphics/optional/includes/global/g_format.inc1510
-rw-r--r--testautomation/graphics/optional/includes/global/g_line.inc242
-rw-r--r--testautomation/graphics/optional/includes/global/g_spellcheck.inc4
-rw-r--r--testautomation/graphics/optional/includes/impress/i_headerfooter.inc220
-rw-r--r--testautomation/graphics/optional/includes/impress/i_pengine1.inc336
-rw-r--r--testautomation/graphics/optional/includes/impress/i_pengine2.inc163
-rw-r--r--testautomation/graphics/optional/includes/impress/i_slidelayer.inc181
-rw-r--r--testautomation/graphics/optional/includes/impress/i_slideshow.inc489
-rw-r--r--testautomation/graphics/optional/includes/impress/i_slideshow2.inc227
-rw-r--r--testautomation/graphics/optional/includes/impress/i_slideshow3.inc1905
-rw-r--r--testautomation/spreadsheet/required/includes/c_upd_filemenu.inc8
-rwxr-xr-xvcl/aqua/source/gdi/salatslayout.cxx5
-rw-r--r--vcl/inc/vcl/arrange.hxx56
-rw-r--r--vcl/inc/vcl/pdfwriter.hxx87
-rw-r--r--vcl/inc/vcl/prndlg.hxx10
-rw-r--r--vcl/inc/vcl/svdata.hxx2
-rw-r--r--vcl/inc/vcl/window.h6
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/window.hxx69
-rw-r--r--vcl/inc/vcl/wpropset.hxx66
-rw-r--r--vcl/prj/d.lst3
-rw-r--r--vcl/source/app/svdata.cxx3
-rw-r--r--vcl/source/gdi/metaact.cxx34
-rw-r--r--vcl/source/gdi/pdfwriter.cxx24
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx610
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx172
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx507
-rw-r--r--vcl/source/gdi/pngread.cxx28
-rw-r--r--vcl/source/gdi/print2.cxx1
-rw-r--r--vcl/source/window/arrange.cxx234
-rw-r--r--vcl/source/window/makefile.mk2
-rw-r--r--vcl/source/window/printdlg.cxx191
-rwxr-xr-xvcl/source/window/window.cxx7
-rw-r--r--vcl/source/window/window4.cxx224
-rw-r--r--vcl/source/window/wpropset.cxx346
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx11
-rw-r--r--wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java4
-rw-r--r--wizards/com/sun/star/wizards/common/Desktop.java4
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java2
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java2
-rw-r--r--wizards/com/sun/star/wizards/web/FTPDialog.java2
-rw-r--r--wizards/com/sun/star/wizards/web/WWD_Startup.java2
-rw-r--r--wizards/source/euro/Init.xba2
-rw-r--r--wizards/source/formwizard/tools.xba2
-rw-r--r--wizards/source/importwizard/Main.xba2
-rw-r--r--wizards/source/schedule/CalendarMain.xba2
-rw-r--r--wizards/source/template/Samples.xba2
-rw-r--r--wizards/source/tutorials/Functions.xba8
-rw-r--r--wizards/source/tutorials/ShowInfoDialog.xba4
-rw-r--r--wizards/source/webwizard/Language.xba2
-rw-r--r--writerfilter/util/writerfilter.component4
-rw-r--r--xmloff/source/draw/XMLGraphicsDefaultStyle.cxx18
-rw-r--r--xmloff/source/text/XMLTextListAutoStylePool.cxx8
256 files changed, 9203 insertions, 5633 deletions
diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx
index adf819a214a1..adec8a2ac6ca 100644
--- a/basegfx/source/curve/b2dcubicbezier.cxx
+++ b/basegfx/source/curve/b2dcubicbezier.cxx
@@ -978,10 +978,10 @@ namespace basegfx
// calculate the x-extrema parameters by zeroing first x-derivative
// of the cubic bezier's parametric formula, which results in a
// quadratic equation: dBezier/dt = t*t*fAX - 2*t*fBX + fCX
- const B2DPoint aRelativeEndPoint(maEndPoint-maStartPoint);
- const double fAX = 3 * (maControlPointA.getX() - maControlPointB.getX()) + aRelativeEndPoint.getX();
- const double fBX = 2 * maControlPointA.getX() - maControlPointB.getX() - maStartPoint.getX();
- double fCX(maControlPointA.getX() - maStartPoint.getX());
+ const B2DPoint aControlDiff( maControlPointA - maControlPointB );
+ double fCX = maControlPointA.getX() - maStartPoint.getX();
+ const double fBX = fCX + aControlDiff.getX();
+ const double fAX = 3 * aControlDiff.getX() + (maEndPoint.getX() - maStartPoint.getX());
if(fTools::equalZero(fCX))
{
@@ -997,9 +997,9 @@ namespace basegfx
{
const double fS = sqrt(fD);
// calculate both roots (avoiding a numerically unstable subtraction)
- const double fQ = -(fBX + ((fBX >= 0) ? +fS : -fS));
+ const double fQ = fBX + ((fBX >= 0) ? +fS : -fS);
impCheckExtremumResult(fQ / fAX, rResults);
- if( fD > 0.0 ) // ignore root multiplicity
+ if( !fTools::equalZero(fS) ) // ignore root multiplicity
impCheckExtremumResult(fCX / fQ, rResults);
}
}
@@ -1010,9 +1010,9 @@ namespace basegfx
}
// calculate the y-extrema parameters by zeroing first y-derivative
- const double fAY = 3 * (maControlPointA.getY() - maControlPointB.getY()) + aRelativeEndPoint.getY();
- const double fBY = 2 * maControlPointA.getY() - maControlPointB.getY() - maStartPoint.getY();
- double fCY(maControlPointA.getY() - maStartPoint.getY());
+ double fCY = maControlPointA.getY() - maStartPoint.getY();
+ const double fBY = fCY + aControlDiff.getY();
+ const double fAY = 3 * aControlDiff.getY() + (maEndPoint.getY() - maStartPoint.getY());
if(fTools::equalZero(fCY))
{
@@ -1024,13 +1024,13 @@ namespace basegfx
{
// derivative is polynomial of order 2 => use binomial formula
const double fD = fBY*fBY - fAY*fCY;
- if( fD >= 0 )
+ if( fD >= 0.0 )
{
const double fS = sqrt(fD);
// calculate both roots (avoiding a numerically unstable subtraction)
- const double fQ = -(fBY + ((fBY >= 0) ? +fS : -fS));
+ const double fQ = fBY + ((fBY >= 0) ? +fS : -fS);
impCheckExtremumResult(fQ / fAY, rResults);
- if( fD > 0.0 ) // ignore root multiplicity, TODO: use equalZero() instead?
+ if( !fTools::equalZero(fS) ) // ignore root multiplicity
impCheckExtremumResult(fCY / fQ, rResults);
}
}
diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx
index c1e0f7f6c7c1..d89ec7c6cf73 100644
--- a/basegfx/source/polygon/b2dtrapezoid.cxx
+++ b/basegfx/source/polygon/b2dtrapezoid.cxx
@@ -798,6 +798,7 @@ namespace basegfx
if(splitEdgeAtGivenPoint(aLeft, *pNewLeft, aCurrent))
{
maNewPoints.push_back(pNewLeft);
+ bDone = true;
}
else
{
@@ -809,13 +810,12 @@ namespace basegfx
if(splitEdgeAtGivenPoint(aRight, *pNewRight, aCurrent))
{
maNewPoints.push_back(pNewRight);
+ bDone = true;
}
else
{
delete pNewRight;
}
-
- bDone = true;
}
}
diff --git a/comphelper/inc/comphelper/docpasswordhelper.hxx b/comphelper/inc/comphelper/docpasswordhelper.hxx
index dbbb68372a07..7e9f06318a26 100644
--- a/comphelper/inc/comphelper/docpasswordhelper.hxx
+++ b/comphelper/inc/comphelper/docpasswordhelper.hxx
@@ -28,6 +28,7 @@
#ifndef COMPHELPER_DOCPASSWORDHELPR_HXX
#define COMPHELPER_DOCPASSWORDHELPR_HXX
+#include <com/sun/star/beans/NamedValue.hpp>
#include "comphelper/comphelperdllapi.h"
#include <vector>
#include "comphelper/docpasswordrequest.hxx"
@@ -53,7 +54,7 @@ enum DocPasswordVerifierResult
/** Base class for a password verifier used by the DocPasswordHelper class
below.
- Users have to implement the virtual function and pass an instance of the
+ Users have to implement the virtual functions and pass an instance of the
verifier to one of the password request functions.
*/
class COMPHELPER_DLLPUBLIC IDocPasswordVerifier
@@ -63,6 +64,14 @@ public:
/** Will be called everytime a password needs to be verified.
+ @param rPassword
+ The password to be verified
+
+ @param o_rEncryptionData
+ Output parameter, that is filled with the EncryptionData generated
+ from the password. The data is filled only if the validation was
+ successful.
+
@return The result of the verification.
- DocPasswordVerifierResult_OK, if and only if the passed password
is valid and can be used to process the related document.
@@ -72,7 +81,23 @@ public:
occured while password verification. The password request loop
will be aborted.
*/
- virtual DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword ) = 0;
+ virtual DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData ) = 0;
+
+ /** Will be called everytime an encryption data needs to be verified.
+
+ @param rEncryptionData
+ The data will be validated
+
+ @return The result of the verification.
+ - DocPasswordVerifierResult_OK, if and only if the passed encryption data
+ is valid and can be used to process the related document.
+ - DocPasswordVerifierResult_WRONG_PASSWORD, if the encryption data is
+ wrong.
+ - DocPasswordVerifierResult_ABORT, if an unrecoverable error
+ occured while data verification. The password request loop
+ will be aborted.
+ */
+ virtual DocPasswordVerifierResult verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData ) = 0;
};
@@ -195,6 +220,35 @@ public:
// ------------------------------------------------------------------------
+ /** This helper function generates a random sequence of bytes of
+ requested length.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateRandomByteSequence(
+ sal_Int32 nLength );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates a byte sequence representing the
+ key digest value used by MSCodec_Std97 codec.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateStd97Key(
+ const ::rtl::OUString& aPassword,
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aDocId );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates a byte sequence representing the
+ key digest value used by MSCodec_Std97 codec.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateStd97Key(
+ const sal_uInt16 pPassData[16],
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aDocId );
+
+ // ------------------------------------------------------------------------
+
/** This helper function tries to request and verify a password to load a
protected document.
@@ -248,8 +302,9 @@ public:
passed password verifier. If empty, no valid password has been
found, or the user has chossen to cancel password input.
*/
- static ::rtl::OUString requestAndVerifyDocPassword(
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rMediaEncData,
const ::rtl::OUString& rMediaPassword,
const ::com::sun::star::uno::Reference<
::com::sun::star::task::XInteractionHandler >& rxInteractHandler,
@@ -300,7 +355,7 @@ public:
passed password verifier. If empty, no valid password has been
found, or the user has chossen to cancel password input.
*/
- static ::rtl::OUString requestAndVerifyDocPassword(
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
MediaDescriptor& rMediaDesc,
DocPasswordRequestType eRequestType,
diff --git a/comphelper/inc/comphelper/mediadescriptor.hxx b/comphelper/inc/comphelper/mediadescriptor.hxx
index 7d2333045390..01fa8059b284 100644
--- a/comphelper/inc/comphelper/mediadescriptor.hxx
+++ b/comphelper/inc/comphelper/mediadescriptor.hxx
@@ -78,6 +78,7 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
static const ::rtl::OUString& PROP_DEEPDETECTION();
static const ::rtl::OUString& PROP_DETECTSERVICE();
static const ::rtl::OUString& PROP_DOCUMENTSERVICE();
+ static const ::rtl::OUString& PROP_ENCRYPTIONDATA();
static const ::rtl::OUString& PROP_EXTENSION();
static const ::rtl::OUString& PROP_FILENAME();
static const ::rtl::OUString& PROP_FILTERNAME();
diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx
index b7e5704c4d68..9d44b42e9514 100644
--- a/comphelper/inc/comphelper/storagehelper.hxx
+++ b/comphelper/inc/comphelper/storagehelper.hxx
@@ -33,6 +33,7 @@
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XStream.hpp>
@@ -43,6 +44,9 @@
#define ZIP_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ZipFormat" ) )
#define OFOPXML_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OFOPXMLFormat" ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1UTF8EncryptionKey" ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1MS1252EncryptionKey" ) )
+
namespace comphelper {
class COMPHELPER_DLLPUBLIC OStorageHelper
@@ -112,9 +116,9 @@ public:
= ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
throw ( ::com::sun::star::uno::Exception );
- static void SetCommonStoragePassword(
+ static void SetCommonStorageEncryptionData(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
- const ::rtl::OUString& aPass )
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData )
throw ( ::com::sun::star::uno::Exception );
// the following method supports only storages of OOo formats
@@ -159,6 +163,9 @@ public:
sal_Bool bRepairStorage = sal_False )
throw ( ::com::sun::star::uno::Exception );
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ CreatePackageEncryptionData( const ::rtl::OUString& aPassword );
+
static sal_Bool IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed );
static sal_Bool IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed );
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx
index 37941352ae28..3c8d66bd57e4 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -84,16 +84,9 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo
{
uno::Sequence< beans::PropertyValue > aResult;
- uno::Sequence< sal_Int8 > aSalt( 16 );
+ uno::Sequence< sal_Int8 > aSalt = GenerateRandomByteSequence( 16 );
sal_Int32 nCount = 1024;
- TimeValue aTime;
- osl_getSystemTime( &aTime );
- rtlRandomPool aRandomPool = rtl_random_createPool ();
- rtl_random_addBytes ( aRandomPool, &aTime, 8 );
-
- rtl_random_getBytes ( aRandomPool, aSalt.getArray(), 16 );
-
uno::Sequence< sal_Int8 > aNewHash = GeneratePBKDF2Hash( aPassword, aSalt, nCount, 16 );
if ( aNewHash.getLength() )
{
@@ -108,9 +101,6 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo
aResult[3].Value <<= aNewHash;
}
- // Clean up random pool memory
- rtl_random_destroyPool ( aRandomPool );
-
return aResult;
}
@@ -282,9 +272,98 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
}
// ============================================================================
+/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateRandomByteSequence( sal_Int32 nLength )
+{
+ uno::Sequence< sal_Int8 > aResult( nLength );
+
+ TimeValue aTime;
+ osl_getSystemTime( &aTime );
+ rtlRandomPool aRandomPool = rtl_random_createPool ();
+ rtl_random_addBytes ( aRandomPool, &aTime, 8 );
+ rtl_random_getBytes ( aRandomPool, aResult.getArray(), nLength );
+ rtl_random_destroyPool ( aRandomPool );
-/*static*/ OUString DocPasswordHelper::requestAndVerifyDocPassword(
+ return aResult;
+}
+
+
+// ============================================================================
+/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateStd97Key( const ::rtl::OUString& aPassword, const uno::Sequence< sal_Int8 >& aDocId )
+{
+ uno::Sequence< sal_Int8 > aResultKey;
+ if ( aPassword.getLength() && aDocId.getLength() == 16 )
+ {
+ sal_uInt16 pPassData[16];
+ rtl_zeroMemory( pPassData, sizeof(pPassData) );
+
+ sal_Int32 nPassLen = ::std::min< sal_Int32 >( aPassword.getLength(), 15 );
+ rtl_copyMemory( pPassData, aPassword.getStr(), nPassLen * sizeof(pPassData[0]) );
+
+ aResultKey = GenerateStd97Key( pPassData, aDocId );
+ }
+
+ return aResultKey;
+}
+
+// ============================================================================
+/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateStd97Key( const sal_uInt16 pPassData[16], const uno::Sequence< sal_Int8 >& aDocId )
+{
+ uno::Sequence< sal_Int8 > aResultKey;
+ if ( pPassData[0] && aDocId.getLength() == 16 )
+ {
+ sal_uInt8 pKeyData[64];
+ rtl_zeroMemory( pKeyData, sizeof(pKeyData) );
+
+ sal_Int32 nInd = 0;
+
+ // Fill PassData into KeyData.
+ for ( nInd = 0; nInd < 16 && pPassData[nInd]; nInd++)
+ {
+ pKeyData[2*nInd] = sal::static_int_cast< sal_uInt8 >( (pPassData[nInd] >> 0) & 0xff );
+ pKeyData[2*nInd + 1] = sal::static_int_cast< sal_uInt8 >( (pPassData[nInd] >> 8) & 0xff );
+ }
+
+ pKeyData[2*nInd] = 0x80;
+ pKeyData[56] = sal::static_int_cast< sal_uInt8 >( nInd << 4 );
+
+ // Fill raw digest of KeyData into KeyData.
+ rtlDigest hDigest = rtl_digest_create ( rtl_Digest_AlgorithmMD5 );
+ (void)rtl_digest_updateMD5 (
+ hDigest, pKeyData, sizeof(pKeyData));
+ (void)rtl_digest_rawMD5 (
+ hDigest, pKeyData, RTL_DIGEST_LENGTH_MD5);
+
+ // Update digest with KeyData and Unique.
+ for ( nInd = 0; nInd < 16; nInd++ )
+ {
+ rtl_digest_updateMD5( hDigest, pKeyData, 5 );
+ rtl_digest_updateMD5( hDigest, (const sal_uInt8*)aDocId.getConstArray(), aDocId.getLength() );
+ }
+
+ // Update digest with padding.
+ pKeyData[16] = 0x80;
+ rtl_zeroMemory( pKeyData + 17, sizeof(pKeyData) - 17 );
+ pKeyData[56] = 0x80;
+ pKeyData[57] = 0x0a;
+
+ rtl_digest_updateMD5( hDigest, &(pKeyData[16]), sizeof(pKeyData) - 16 );
+
+ // Fill raw digest of above updates
+ aResultKey.realloc( RTL_DIGEST_LENGTH_MD5 );
+ rtl_digest_rawMD5 ( hDigest, (sal_uInt8*)aResultKey.getArray(), aResultKey.getLength() );
+
+ // Erase KeyData array and leave.
+ rtl_zeroMemory( pKeyData, sizeof(pKeyData) );
+ }
+
+ return aResultKey;
+}
+
+// ============================================================================
+
+/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > DocPasswordHelper::requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rMediaEncData,
const OUString& rMediaPassword,
const Reference< XInteractionHandler >& rxInteractHandler,
const OUString& rDocumentName,
@@ -292,7 +371,7 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
const ::std::vector< OUString >* pDefaultPasswords,
bool* pbIsDefaultPassword )
{
- OUString aPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > aEncData;
DocPasswordVerifierResult eResult = DocPasswordVerifierResult_WRONG_PASSWORD;
// first, try provided default passwords
@@ -302,23 +381,32 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
{
for( ::std::vector< OUString >::const_iterator aIt = pDefaultPasswords->begin(), aEnd = pDefaultPasswords->end(); (eResult == DocPasswordVerifierResult_WRONG_PASSWORD) && (aIt != aEnd); ++aIt )
{
- aPassword = *aIt;
- OSL_ENSURE( aPassword.getLength() > 0, "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" );
- if( aPassword.getLength() > 0 )
+ OSL_ENSURE( aIt->getLength() > 0, "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" );
+ if( aIt->getLength() > 0 )
{
- eResult = rVerifier.verifyPassword( aPassword );
+ eResult = rVerifier.verifyPassword( *aIt, aEncData );
if( pbIsDefaultPassword )
*pbIsDefaultPassword = eResult == DocPasswordVerifierResult_OK;
}
}
}
+ // try media encryption data (skip, if result is OK or ABORT)
+ if( eResult == DocPasswordVerifierResult_WRONG_PASSWORD )
+ {
+ if( rMediaEncData.getLength() > 0 )
+ {
+ eResult = rVerifier.verifyEncryptionData( rMediaEncData );
+ if( eResult == DocPasswordVerifierResult_OK )
+ aEncData = rMediaEncData;
+ }
+ }
+
// try media password (skip, if result is OK or ABORT)
if( eResult == DocPasswordVerifierResult_WRONG_PASSWORD )
{
- aPassword = rMediaPassword;
- if( aPassword.getLength() > 0 )
- eResult = rVerifier.verifyPassword( aPassword );
+ if( rMediaPassword.getLength() > 0 )
+ eResult = rVerifier.verifyPassword( rMediaPassword, aEncData );
}
// request a password (skip, if result is OK or ABORT)
@@ -332,9 +420,8 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
rxInteractHandler->handle( xRequest );
if( pRequest->isPassword() )
{
- aPassword = pRequest->getPassword();
- if( aPassword.getLength() > 0 )
- eResult = rVerifier.verifyPassword( aPassword );
+ if( pRequest->getPassword().getLength() > 0 )
+ eResult = rVerifier.verifyPassword( pRequest->getPassword(), aEncData );
}
else
{
@@ -347,15 +434,17 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
{
}
- return (eResult == DocPasswordVerifierResult_OK) ? aPassword : OUString();
+ return (eResult == DocPasswordVerifierResult_OK) ? aEncData : uno::Sequence< beans::NamedValue >();
}
-/*static*/ OUString DocPasswordHelper::requestAndVerifyDocPassword(
+/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > DocPasswordHelper::requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
MediaDescriptor& rMediaDesc,
DocPasswordRequestType eRequestType,
const ::std::vector< OUString >* pDefaultPasswords )
{
+ uno::Sequence< beans::NamedValue > aMediaEncData = rMediaDesc.getUnpackedValueOrDefault(
+ MediaDescriptor::PROP_ENCRYPTIONDATA(), uno::Sequence< beans::NamedValue >() );
OUString aMediaPassword = rMediaDesc.getUnpackedValueOrDefault(
MediaDescriptor::PROP_PASSWORD(), OUString() );
Reference< XInteractionHandler > xInteractHandler = rMediaDesc.getUnpackedValueOrDefault(
@@ -364,14 +453,17 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
MediaDescriptor::PROP_URL(), OUString() );
bool bIsDefaultPassword = false;
- OUString aPassword = requestAndVerifyDocPassword(
- rVerifier, aMediaPassword, xInteractHandler, aDocumentName, eRequestType, pDefaultPasswords, &bIsDefaultPassword );
+ uno::Sequence< beans::NamedValue > aEncryptionData = requestAndVerifyDocPassword(
+ rVerifier, aMediaEncData, aMediaPassword, xInteractHandler, aDocumentName, eRequestType, pDefaultPasswords, &bIsDefaultPassword );
+
+ rMediaDesc.erase( MediaDescriptor::PROP_PASSWORD() );
+ rMediaDesc.erase( MediaDescriptor::PROP_ENCRYPTIONDATA() );
// insert valid password into media descriptor (but not a default password)
- if( (aPassword.getLength() > 0) && !bIsDefaultPassword )
- rMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= aPassword;
+ if( (aEncryptionData.getLength() > 0) && !bIsDefaultPassword )
+ rMediaDesc[ MediaDescriptor::PROP_ENCRYPTIONDATA() ] <<= aEncryptionData;
- return aPassword;
+ return aEncryptionData;
}
// ============================================================================
diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx
index 9e02afe8c56c..143f8ba4dfa2 100644
--- a/comphelper/source/misc/mediadescriptor.cxx
+++ b/comphelper/source/misc/mediadescriptor.cxx
@@ -112,6 +112,12 @@ const ::rtl::OUString& MediaDescriptor::PROP_DOCUMENTSERVICE()
return sProp;
}
+const ::rtl::OUString& MediaDescriptor::PROP_ENCRYPTIONDATA()
+{
+ static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("EncryptionData"));
+ return sProp;
+}
+
const ::rtl::OUString& MediaDescriptor::PROP_EXTENSION()
{
static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Extension"));
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index db5ba71cd876..60ffa965fcf1 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -28,12 +28,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_comphelper.hxx"
#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/embed/XEncryptionProtectedSource.hpp>
+#include <com/sun/star/embed/XEncryptionProtectedSource2.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/IllegalTypeException.hpp>
+#include <rtl/digest.h>
+
#include <ucbhelper/content.hxx>
#include <comphelper/fileformat.h>
@@ -236,16 +239,16 @@ uno::Reference< io::XInputStream > OStorageHelper::GetInputStreamFromURL(
}
// ----------------------------------------------------------------------
-void OStorageHelper::SetCommonStoragePassword(
+void OStorageHelper::SetCommonStorageEncryptionData(
const uno::Reference< embed::XStorage >& xStorage,
- const ::rtl::OUString& aPass )
+ const uno::Sequence< beans::NamedValue >& aEncryptionData )
throw ( uno::Exception )
{
- uno::Reference< embed::XEncryptionProtectedSource > xEncrSet( xStorage, uno::UNO_QUERY );
+ uno::Reference< embed::XEncryptionProtectedSource2 > xEncrSet( xStorage, uno::UNO_QUERY );
if ( !xEncrSet.is() )
throw io::IOException(); // TODO
- xEncrSet->setEncryptionPassword( aPass );
+ xEncrSet->setEncryptionData( aEncryptionData );
}
// ----------------------------------------------------------------------
@@ -419,6 +422,45 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromStream(
}
// ----------------------------------------------------------------------
+uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData( const ::rtl::OUString& aPassword )
+{
+ // TODO/LATER: Should not the method be part of DocPasswordHelper?
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ if ( aPassword.getLength() )
+ {
+ // MS_1252 encoding was used for SO60 document format password encoding,
+ // this encoding supports only a minor subset of nonascii characters,
+ // but for compatibility reasons it has to be used for old document formats
+ aEncryptionData.realloc( 2 );
+ aEncryptionData[0].Name = PACKAGE_ENCRYPTIONDATA_SHA1UTF8;
+ aEncryptionData[1].Name = PACKAGE_ENCRYPTIONDATA_SHA1MS1252;
+
+ rtl_TextEncoding pEncoding[2] = { RTL_TEXTENCODING_UTF8, RTL_TEXTENCODING_MS_1252 };
+
+ for ( sal_Int32 nInd = 0; nInd < 2; nInd++ )
+ {
+ ::rtl::OString aByteStrPass = ::rtl::OUStringToOString( aPassword, pEncoding[nInd] );
+
+ sal_uInt8 pBuffer[RTL_DIGEST_LENGTH_SHA1];
+ rtlDigestError nError = rtl_digest_SHA1( aByteStrPass.getStr(),
+ aByteStrPass.getLength(),
+ pBuffer,
+ RTL_DIGEST_LENGTH_SHA1 );
+
+ if ( nError != rtl_Digest_E_None )
+ {
+ aEncryptionData.realloc( 0 );
+ break;
+ }
+
+ aEncryptionData[nInd].Value <<= uno::Sequence< sal_Int8 >( (sal_Int8*)pBuffer, RTL_DIGEST_LENGTH_SHA1 );
+ }
+ }
+
+ return aEncryptionData;
+}
+
+// ----------------------------------------------------------------------
sal_Bool OStorageHelper::IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed )
{
return IsValidZipEntryFileName( aName.getStr(), aName.getLength(), bSlashAllowed );
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index c20fa49fb18c..d387f351de30 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -282,8 +282,8 @@ css::uno::Any ChildAccess::asValue() {
if (!Components::allLocales(locale)) {
// Find best match using an adaption of RFC 4647 lookup matching
// rules, removing "-" or "_" delimited segments from the end;
- // defaults are the empty string locale, the "en-US" locale, the
- // "en" locale, the first child (if any), or a nil value (even
+ // defaults are the "en-US" locale, the "en" locale, the empty
+ // string locale, the first child (if any), or a nil value (even
// though it may be illegal for the given property), in that
// order:
rtl::Reference< ChildAccess > child;
@@ -296,6 +296,9 @@ css::uno::Any ChildAccess::asValue() {
while (i > 0 && locale[i] != '-' && locale[i] != '_') {
--i;
}
+ if (i == 0) {
+ break;
+ }
locale = locale.copy(0, i);
}
if (!child.is()) {
@@ -305,10 +308,13 @@ css::uno::Any ChildAccess::asValue() {
child = getChild(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")));
if (!child.is()) {
- std::vector< rtl::Reference< ChildAccess > > all(
- getAllChildren());
- if (!all.empty()) {
- child = all.front();
+ child = getChild(rtl::OUString());
+ if (!child.is()) {
+ std::vector< rtl::Reference< ChildAccess > >
+ all(getAllChildren());
+ if (!all.empty()) {
+ child = all.front();
+ }
}
}
}
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 0d57e566ef8a..73683884e2bd 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -248,9 +248,12 @@ namespace
if(nPushFlags)
{
OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: PUSH with no property holders (!)");
- PropertyHolder* pNew = new PropertyHolder(*maPropertyHolders.back());
- pNew->setPushFlags(nPushFlags);
- maPropertyHolders.push_back(pNew);
+ if ( !maPropertyHolders.empty() )
+ {
+ PropertyHolder* pNew = new PropertyHolder(*maPropertyHolders.back());
+ pNew->setPushFlags(nPushFlags);
+ maPropertyHolders.push_back(pNew);
+ }
}
}
@@ -354,8 +357,9 @@ namespace
PropertyHolder& Current()
{
+ static PropertyHolder aDummy;
OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: CURRENT with no property holders (!)");
- return *maPropertyHolders.back();
+ return maPropertyHolders.empty() ? aDummy : *maPropertyHolders.back();
}
~PropertyHolders()
diff --git a/editeng/inc/editeng/svxrtf.hxx b/editeng/inc/editeng/svxrtf.hxx
index 10864b1850f1..62bc6efcd4bf 100644
--- a/editeng/inc/editeng/svxrtf.hxx
+++ b/editeng/inc/editeng/svxrtf.hxx
@@ -470,7 +470,7 @@ inline const Color& SvxRTFParser::GetColor( size_t nId ) const
inline SfxItemSet& SvxRTFParser::GetAttrSet()
{
SvxRTFItemStackTypePtr pTmp;
- if( bNewGroup || 0 == ( pTmp = aAttrStack.back()) )
+ if( bNewGroup || 0 == ( pTmp = aAttrStack.empty() ? 0 : aAttrStack.back()) )
pTmp = _GetAttrSet();
return pTmp->aAttrSet;
}
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 5cb45144abab..132a6d0ee38c 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -377,83 +377,46 @@ int SvxURLField::operator==( const SvxFieldData& rOther ) const
// -----------------------------------------------------------------------
-void SvxURLField::Load( SvPersistStream & rStm )
+static void write_unicode( SvPersistStream & rStm, const String& rString )
{
- USHORT nFormat;
- sal_uInt32 nFrameMarker, nCharSetMarker;
- long nUlongSize = (long)sizeof(sal_uInt32);
- String aTmpURL;
-
- rStm >> nFormat;
-
- // UNICODE: rStm >> aTmpURL;
- rStm.ReadByteString(aTmpURL);
-
- // UNICODE: rStm >> aRepresentation;
- // read to a temp string first, read text encoding and
- // convert later to stay compatible to fileformat
- ByteString aTempString;
- rtl_TextEncoding aTempEncoding = RTL_TEXTENCODING_MS_1252; // #101493# Init for old documents
- rStm.ReadByteString(aTempString);
+ USHORT nL = rString.Len();
+ rStm << nL;
+ rStm.Write( rString.GetBuffer(), nL*sizeof(sal_Unicode) );
+}
- rStm >> nFrameMarker;
- if ( nFrameMarker == FRAME_MARKER )
+static void read_unicode( SvPersistStream & rStm, String& rString )
+{
+ USHORT nL = 0;
+ rStm >> nL;
+ if ( nL )
{
- // UNICODE: rStm >> aTargetFrame;
- rStm.ReadByteString(aTargetFrame);
-
- rStm >> nCharSetMarker;
- if ( nCharSetMarker == CHARSET_MARKER )
- {
- USHORT nCharSet;
- rStm >> nCharSet;
-
- // remember encoding
- aTempEncoding = (rtl_TextEncoding)nCharSet;
- }
- else
- rStm.SeekRel( -nUlongSize );
+ rString.AllocBuffer( nL );
+ rStm.Read( rString.GetBufferAccess(), nL*sizeof(sal_Unicode) );
+ rString.ReleaseBufferAccess( nL );
}
- else
- rStm.SeekRel( -nUlongSize );
+}
- // now build representation string due to known encoding
- aRepresentation = String(aTempString, aTempEncoding);
+void SvxURLField::Load( SvPersistStream & rStm )
+{
+ USHORT nFormat = 0;
+ rStm >> nFormat;
eFormat= (SvxURLFormat)nFormat;
- // Relatives Speichern => Beim laden absolut machen.
- DBG_ERROR("No BaseURL!");
- // TODO/MBA: no BaseURL
- aURL = INetURLObject::GetAbsURL( String(), aTmpURL );
+ read_unicode( rStm, aURL );
+ read_unicode( rStm, aRepresentation );
+ read_unicode( rStm, aTargetFrame );
}
// -----------------------------------------------------------------------
void SvxURLField::Save( SvPersistStream & rStm )
{
- // Relatives Speichern der URL
- DBG_ERROR("No BaseURL!");
- // TODO/MBA: no BaseURL
- String aTmpURL = INetURLObject::GetRelURL( String(), aURL );
-
rStm << (USHORT)eFormat;
- // UNICODE: rStm << aTmpURL;
- rStm.WriteByteString(aTmpURL);
-
- // UNICODE: rStm << aRepresentation;
- rStm.WriteByteString(aRepresentation);
-
- rStm << FRAME_MARKER;
-
- // UNICODE: rStm << aTargetFrame;
- rStm.WriteByteString(aTargetFrame);
-
- rStm << CHARSET_MARKER;
-
- // #90477# rStm << (USHORT)GetStoreCharSet(gsl_getSystemTextEncoding(), rStm.GetVersion());
- rStm << (USHORT)GetSOStoreTextEncoding(gsl_getSystemTextEncoding(), (sal_uInt16)rStm.GetVersion());
+ write_unicode( rStm, aURL );
+ write_unicode( rStm, aRepresentation );
+ write_unicode( rStm, aTargetFrame );
}
MetaAction* SvxURLField::createBeginComment() const
@@ -921,16 +884,11 @@ int SvxAuthorField::operator==( const SvxFieldData& rOther ) const
void SvxAuthorField::Load( SvPersistStream & rStm )
{
- USHORT nType, nFormat;
-
- // UNICODE: rStm >> aName;
- rStm.ReadByteString(aName);
+ USHORT nType = 0, nFormat = 0;
- // UNICODE: rStm >> aFirstName;
- rStm.ReadByteString(aFirstName);
-
- // UNICODE: rStm >> aShortName;
- rStm.ReadByteString(aShortName);
+ read_unicode( rStm, aName );
+ read_unicode( rStm, aFirstName );
+ read_unicode( rStm, aShortName );
rStm >> nType;
rStm >> nFormat;
@@ -943,14 +901,9 @@ void SvxAuthorField::Load( SvPersistStream & rStm )
void SvxAuthorField::Save( SvPersistStream & rStm )
{
- // UNICODE: rStm << aName;
- rStm.WriteByteString(aName);
-
- // UNICODE: rStm << aFirstName;
- rStm.WriteByteString(aFirstName);
-
- // UNICODE: rStm << aShortName;
- rStm.WriteByteString(aShortName);
+ write_unicode( rStm, aName );
+ write_unicode( rStm, aFirstName );
+ write_unicode( rStm, aShortName );
rStm << (USHORT) eType;
rStm << (USHORT) eFormat;
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index ae977b2ed0d7..f2481e79eb22 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -701,7 +701,7 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace(
bRunNext = true;
}
}
- else if ( cChar == '/' )
+ else if ( cChar == '/' && nEndPos > 1 && rTxt.Len() > (nEndPos - 1) )
{
// Remove the hardspace right before to avoid formatting URLs
sal_Unicode cPrevChar = rTxt.GetChar( nEndPos - 1 );
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index 3141ab20afcd..58789fab2106 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -228,7 +228,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet )
RTF_CharTypeDef eCharType = NOTDEF_CHARTYPE;
USHORT nFontAlign;
- int bChkStkPos = !bNewGroup && aAttrStack.back();
+ int bChkStkPos = !bNewGroup && !aAttrStack.empty();
while( bWeiter && IsParserWorking() ) // solange bekannte Attribute erkannt werden
{
@@ -250,7 +250,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet )
if( !bChkStkPos )
break;
- SvxRTFItemStackType* pAkt = aAttrStack.back();
+ SvxRTFItemStackType* pAkt = aAttrStack.empty() ? 0 : aAttrStack.back();
if( !pAkt || (pAkt->pSttNd->GetIdx() == pInsPos->GetNodeIdx() &&
pAkt->nSttCnt == pInsPos->GetCntIdx() ))
break;
@@ -269,7 +269,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet )
// alle bis hierher gueltigen Attribute "setzen"
AttrGroupEnd();
- pAkt = aAttrStack.back(); // can be changed after AttrGroupEnd!
+ pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); // can be changed after AttrGroupEnd!
pNew->aAttrSet.SetParent( pAkt ? &pAkt->aAttrSet : 0 );
aAttrStack.push_back( pNew );
@@ -305,7 +305,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet )
nStyleNo = -1 == nTokenValue ? 0 : USHORT(nTokenValue);
// setze am akt. auf dem AttrStack stehenden Style die
// StyleNummer
- SvxRTFItemStackType* pAkt = aAttrStack.back();
+ SvxRTFItemStackType* pAkt = aAttrStack.empty() ? 0 : aAttrStack.back();
if( !pAkt )
break;
@@ -1869,7 +1869,7 @@ void SvxRTFParser::ReadBackgroundAttr( int nToken, SfxItemSet& rSet,
// pard / plain abarbeiten
void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet )
{
- if( !bNewGroup && aAttrStack.back() ) // not at the beginning of a new group
+ if( !bNewGroup && !aAttrStack.empty() ) // not at the beginning of a new group
{
SvxRTFItemStackType* pAkt = aAttrStack.back();
@@ -1887,7 +1887,7 @@ void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet )
// alle bis hierher gueltigen Attribute "setzen"
AttrGroupEnd();
- pAkt = aAttrStack.back(); // can be changed after AttrGroupEnd!
+ pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); // can be changed after AttrGroupEnd!
pNew->aAttrSet.SetParent( pAkt ? &pAkt->aAttrSet : 0 );
aAttrStack.push_back( pNew );
pAkt = pNew;
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index 14b17807a0ea..2788d2fd4b10 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -875,7 +875,7 @@ const Font& SvxRTFParser::GetFont( USHORT nId )
SvxRTFItemStackType* SvxRTFParser::_GetAttrSet( int bCopyAttr )
{
- SvxRTFItemStackType* pAkt = aAttrStack.back();
+ SvxRTFItemStackType* pAkt = aAttrStack.empty() ? 0 : aAttrStack.back();
SvxRTFItemStackType* pNew;
if( pAkt )
pNew = new SvxRTFItemStackType( *pAkt, *pInsPos, bCopyAttr );
@@ -941,9 +941,9 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen
{
if( !aAttrStack.empty() )
{
- SvxRTFItemStackType *pOld = aAttrStack.back();
+ SvxRTFItemStackType *pOld = aAttrStack.empty() ? 0 : aAttrStack.back();
aAttrStack.pop_back();
- SvxRTFItemStackType *pAkt = aAttrStack.back();
+ SvxRTFItemStackType *pAkt = aAttrStack.empty() ? 0 : aAttrStack.back();
do { // middle check loop
ULONG nOldSttNdIdx = pOld->pSttNd->GetIdx();
@@ -1118,7 +1118,7 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen
// alle bis hierher gueltigen Attribute "setzen"
AttrGroupEnd();
- pAkt = aAttrStack.back(); // can be changed after AttrGroupEnd!
+ pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); // can be changed after AttrGroupEnd!
pNew->aAttrSet.SetParent( pAkt ? &pAkt->aAttrSet : 0 );
aAttrStack.push_back( pNew );
pAkt = pNew;
@@ -1181,7 +1181,7 @@ void SvxRTFParser::SetAttrSet( SvxRTFItemStackType &rSet )
// Is text wasn't inserted? (Get SttPos from the top of stack!)
int SvxRTFParser::IsAttrSttPos()
{
- SvxRTFItemStackType* pAkt = aAttrStack.back();
+ SvxRTFItemStackType* pAkt = aAttrStack.empty() ? 0 : aAttrStack.back();
return !pAkt || (pAkt->pSttNd->GetIdx() == pInsPos->GetNodeIdx() &&
pAkt->nSttCnt == pInsPos->GetCntIdx());
}
diff --git a/extras/source/gallery/gallery_system/sg24.sdg b/extras/source/gallery/gallery_system/sg24.sdg
index 019c5801180c..7441d764cb37 100644
--- a/extras/source/gallery/gallery_system/sg24.sdg
+++ b/extras/source/gallery/gallery_system/sg24.sdg
Binary files differ
diff --git a/extras/source/gallery/gallery_system/sg24.sdv b/extras/source/gallery/gallery_system/sg24.sdv
index adbf1a399f3f..2e780644618c 100644
--- a/extras/source/gallery/gallery_system/sg24.sdv
+++ b/extras/source/gallery/gallery_system/sg24.sdv
Binary files differ
diff --git a/extras/source/gallery/gallery_system/sg24.thm b/extras/source/gallery/gallery_system/sg24.thm
index e44262abc470..b821a9de8bb2 100644
--- a/extras/source/gallery/gallery_system/sg24.thm
+++ b/extras/source/gallery/gallery_system/sg24.thm
Binary files differ
diff --git a/filter/inc/filter/msfilter/mscodec.hxx b/filter/inc/filter/msfilter/mscodec.hxx
index 7bad8af6b788..60e3adf1d5ba 100644
--- a/filter/inc/filter/msfilter/mscodec.hxx
+++ b/filter/inc/filter/msfilter/mscodec.hxx
@@ -28,8 +28,11 @@
#ifndef SVX_MSCODEC_HXX
#define SVX_MSCODEC_HXX
-#include "rtl/cipher.h"
-#include "rtl/digest.h"
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+#include <rtl/cipher.h>
+#include <rtl/digest.h>
#include "filter/msfilter/msfilterdllapi.h"
namespace msfilter {
@@ -52,6 +55,23 @@ public:
*/
void InitKey( const sal_uInt8 pnPassData[ 16 ] );
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ sal_Bool InitCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetEncryptionData();
+
+
/** Verifies the validity of the password using the passed key and hash.
@precond
@@ -105,16 +125,6 @@ public:
*/
void Skip( sal_Size nBytes );
- // static -----------------------------------------------------------------
-
- /** Calculates the 16-bit hash value for the given password.
-
- The password data may be longer than 16 bytes. The array does not need
- to be terminated with a NULL byte (but it can without invalidating the
- result).
- */
- static sal_uInt16 GetHash( const sal_uInt8* pnPassData, sal_Size nSize );
-
protected:
sal_uInt8 mpnKey[ 16 ]; /// Encryption key.
sal_Size mnOffset; /// Key offset.
@@ -185,17 +195,34 @@ public:
explicit MSCodec_Std97();
~MSCodec_Std97();
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ sal_Bool InitCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetEncryptionData();
+
+
/** Initializes the algorithm with the specified password and document ID.
@param pPassData
Wide character array containing the password. Must be zero
terminated, which results in a maximum length of 15 characters.
- @param pUnique
+ @param pDocId
Unique document identifier read from or written to the file.
*/
void InitKey(
const sal_uInt16 pPassData[ 16 ],
- const sal_uInt8 pUnique[ 16 ] );
+ const sal_uInt8 pDocId[ 16 ] );
/** Verifies the validity of the password using the passed salt data.
@@ -320,16 +347,26 @@ public:
sal_uInt8 pSaltData[16],
sal_uInt8 pSaltDigest[16]);
-private:
+ /* allows to get the unique document id from the codec
+ */
+ void GetDocId( sal_uInt8 pDocId[16] );
+
void GetDigestFromSalt( const sal_uInt8 pSaltData[16], sal_uInt8 pDigest[16] );
private:
+ void InitKeyImpl(
+ const sal_uInt8 pKeyData[64],
+ const sal_uInt8 pDocId[16] );
+
+
+private:
MSFILTER_DLLPRIVATE MSCodec_Std97( const MSCodec_Std97& );
MSFILTER_DLLPRIVATE MSCodec_Std97& operator=( const MSCodec_Std97& );
rtlCipher m_hCipher;
rtlDigest m_hDigest;
sal_uInt8 m_pDigestValue[ RTL_DIGEST_LENGTH_MD5 ];
+ sal_uInt8 m_pDocId[16];
};
// ============================================================================
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index f10b8a15f3ef..6f356b042d28 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -764,245 +764,259 @@ BOOL TIFFReader::ConvertScanline( ULONG nY )
}
else if ( nPhotometricInterpretation == 2 && nSamplesPerPixel >= 3 )
{
- ULONG nMinMax = nMinSampleValue * 255 / ( nMaxSampleValue - nMinSampleValue );
- for ( nx = 0; nx < nImageWidth; nx++ )
+ if ( nMaxSampleValue > nMinSampleValue )
{
- if ( nPlanes < 3 )
- {
- nRed = GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + 0 ) * nBitsPerSample, nBitsPerSample );
- nGreen = GetBits( pMap[ 1 ], ( nx * nSamplesPerPixel + 1 ) * nBitsPerSample, nBitsPerSample );
- nBlue = GetBits( pMap[ 2 ], ( nx * nSamplesPerPixel + 2 ) * nBitsPerSample, nBitsPerSample );
- }
- else
+ ULONG nMinMax = nMinSampleValue * 255 / ( nMaxSampleValue - nMinSampleValue );
+ for ( nx = 0; nx < nImageWidth; nx++ )
{
- nRed = GetBits( pMap[ 0 ], nx * nBitsPerSample, nBitsPerSample );
- nGreen = GetBits( pMap[ 1 ], nx * nBitsPerSample, nBitsPerSample );
- nBlue = GetBits( pMap[ 2 ], nx * nBitsPerSample, nBitsPerSample );
+ if ( nPlanes < 3 )
+ {
+ nRed = GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + 0 ) * nBitsPerSample, nBitsPerSample );
+ nGreen = GetBits( pMap[ 1 ], ( nx * nSamplesPerPixel + 1 ) * nBitsPerSample, nBitsPerSample );
+ nBlue = GetBits( pMap[ 2 ], ( nx * nSamplesPerPixel + 2 ) * nBitsPerSample, nBitsPerSample );
+ }
+ else
+ {
+ nRed = GetBits( pMap[ 0 ], nx * nBitsPerSample, nBitsPerSample );
+ nGreen = GetBits( pMap[ 1 ], nx * nBitsPerSample, nBitsPerSample );
+ nBlue = GetBits( pMap[ 2 ], nx * nBitsPerSample, nBitsPerSample );
+ }
+ pAcc->SetPixel( nY, nx, Color( (BYTE)( nRed - nMinMax ), (BYTE)( nGreen - nMinMax ), (BYTE)(nBlue - nMinMax) ) );
}
- pAcc->SetPixel( nY, nx, Color( (BYTE)( nRed - nMinMax ), (BYTE)( nGreen - nMinMax ), (BYTE)(nBlue - nMinMax) ) );
}
}
else if ( nPhotometricInterpretation == 5 && nSamplesPerPixel == 3 )
{
- ULONG nMinMax = nMinSampleValue * 255 / ( nMaxSampleValue - nMinSampleValue );
- for ( nx = 0; nx < nImageWidth; nx++ )
+ if ( nMaxSampleValue > nMinSampleValue )
{
- if ( nPlanes < 3 )
- {
- nRed = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 0 ) * nBitsPerSample, nBitsPerSample );
- nGreen = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 1 ) * nBitsPerSample, nBitsPerSample );
- nBlue = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 2 ) * nBitsPerSample, nBitsPerSample );
- }
- else
+ ULONG nMinMax = nMinSampleValue * 255 / ( nMaxSampleValue - nMinSampleValue );
+ for ( nx = 0; nx < nImageWidth; nx++ )
{
- nRed = GetBits( pMap[ 0 ], nx * nBitsPerSample, nBitsPerSample );
- nGreen = GetBits( pMap[ 1 ], nx * nBitsPerSample, nBitsPerSample );
- nBlue = GetBits( pMap[ 2 ], nx * nBitsPerSample, nBitsPerSample );
+ if ( nPlanes < 3 )
+ {
+ nRed = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 0 ) * nBitsPerSample, nBitsPerSample );
+ nGreen = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 1 ) * nBitsPerSample, nBitsPerSample );
+ nBlue = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 2 ) * nBitsPerSample, nBitsPerSample );
+ }
+ else
+ {
+ nRed = GetBits( pMap[ 0 ], nx * nBitsPerSample, nBitsPerSample );
+ nGreen = GetBits( pMap[ 1 ], nx * nBitsPerSample, nBitsPerSample );
+ nBlue = GetBits( pMap[ 2 ], nx * nBitsPerSample, nBitsPerSample );
+ }
+ nRed = 255 - (BYTE)( nRed - nMinMax );
+ nGreen = 255 - (BYTE)( nGreen - nMinMax );
+ nBlue = 255 - (BYTE)( nBlue - nMinMax );
+ pAcc->SetPixel( nY, nx, Color( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ) );
}
- nRed = 255 - (BYTE)( nRed - nMinMax );
- nGreen = 255 - (BYTE)( nGreen - nMinMax );
- nBlue = 255 - (BYTE)( nBlue - nMinMax );
- pAcc->SetPixel( nY, nx, Color( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ) );
}
}
else if( nPhotometricInterpretation == 5 && nSamplesPerPixel == 4 )
{
- BYTE nSamp[ 4 ];
- BYTE nSampLast[ 4 ] = { 0, 0, 0, 0 };
- long nBlack;
-
- for( nx = 0; nx < nImageWidth; nx++ )
+ if ( nMaxSampleValue > nMinSampleValue )
{
- // sind die Werte als Differenz abgelegt?
- if( 2 == nPredictor )
+ BYTE nSamp[ 4 ];
+ BYTE nSampLast[ 4 ] = { 0, 0, 0, 0 };
+ long nBlack;
+
+ for( nx = 0; nx < nImageWidth; nx++ )
{
- for( ns = 0; ns < 4; ns++ )
+ // sind die Werte als Differenz abgelegt?
+ if( 2 == nPredictor )
{
- if( nPlanes < 3 )
- nSampLast[ ns ] = nSampLast[ ns ] + (BYTE) GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + ns ) * nBitsPerSample, nBitsPerSample );
- else
- nSampLast[ ns ] = nSampLast[ ns ] + (BYTE) GetBits( pMap[ ns ], nx * nBitsPerSample, nBitsPerSample );
- nSamp[ ns ] = nSampLast[ ns ];
+ for( ns = 0; ns < 4; ns++ )
+ {
+ if( nPlanes < 3 )
+ nSampLast[ ns ] = nSampLast[ ns ] + (BYTE) GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + ns ) * nBitsPerSample, nBitsPerSample );
+ else
+ nSampLast[ ns ] = nSampLast[ ns ] + (BYTE) GetBits( pMap[ ns ], nx * nBitsPerSample, nBitsPerSample );
+ nSamp[ ns ] = nSampLast[ ns ];
+ }
}
- }
- else
- {
- for( ns = 0; ns < 4; ns++ )
+ else
{
- if( nPlanes < 3 )
- nSamp[ ns ] = (BYTE) GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + ns ) * nBitsPerSample, nBitsPerSample );
- else
- nSamp[ ns ]= (BYTE) GetBits( pMap[ ns ], nx * nBitsPerSample, nBitsPerSample );
+ for( ns = 0; ns < 4; ns++ )
+ {
+ if( nPlanes < 3 )
+ nSamp[ ns ] = (BYTE) GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + ns ) * nBitsPerSample, nBitsPerSample );
+ else
+ nSamp[ ns ]= (BYTE) GetBits( pMap[ ns ], nx * nBitsPerSample, nBitsPerSample );
+ }
}
+ nBlack = nSamp[ 3 ];
+ nRed = (BYTE) Max( 0L, 255L - ( ( (long) nSamp[ 0 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
+ 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
+ nGreen = (BYTE) Max( 0L, 255L - ( ( (long) nSamp[ 1 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
+ 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
+ nBlue = (BYTE) Max( 0L, 255L - ( ( (long) nSamp[ 2 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
+ 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
+ pAcc->SetPixel( nY, nx, Color ( (BYTE)nRed, (BYTE)nGreen, (BYTE)nBlue ) );
}
- nBlack = nSamp[ 3 ];
- nRed = (BYTE) Max( 0L, 255L - ( ( (long) nSamp[ 0 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
- 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
- nGreen = (BYTE) Max( 0L, 255L - ( ( (long) nSamp[ 1 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
- 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
- nBlue = (BYTE) Max( 0L, 255L - ( ( (long) nSamp[ 2 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
- 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
- pAcc->SetPixel( nY, nx, Color ( (BYTE)nRed, (BYTE)nGreen, (BYTE)nBlue ) );
-
}
}
}
else if ( nSamplesPerPixel == 1 && ( nPhotometricInterpretation <= 1 || nPhotometricInterpretation == 3 ) )
{
- ULONG nMinMax = ( ( 1 << nDstBitsPerPixel ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
- BYTE* pt = pMap[ 0 ];
- BYTE nShift;
-
- switch ( nDstBitsPerPixel )
+ if ( nMaxSampleValue > nMinSampleValue )
{
- case 8 :
+ ULONG nMinMax = ( ( 1 << nDstBitsPerPixel ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
+ BYTE* pt = pMap[ 0 ];
+ BYTE nShift;
+
+ switch ( nDstBitsPerPixel )
{
- BYTE nLast;
- if ( bByteSwap )
+ case 8 :
{
- if ( nPredictor == 2 )
+ BYTE nLast;
+ if ( bByteSwap )
{
- nLast = BYTESWAP( (BYTE)*pt++ );
- for ( nx = 0; nx < nImageWidth; nx++ )
+ if ( nPredictor == 2 )
{
- pAcc->SetPixel( nY, nx, nLast );
- nLast = nLast + *pt++;
+ nLast = BYTESWAP( (BYTE)*pt++ );
+ for ( nx = 0; nx < nImageWidth; nx++ )
+ {
+ pAcc->SetPixel( nY, nx, nLast );
+ nLast = nLast + *pt++;
+ }
}
- }
- else
- {
- for ( nx = 0; nx < nImageWidth; nx++ )
+ else
{
- nLast = *pt++;
- pAcc->SetPixel( nY, nx, (BYTE)( ( (BYTESWAP((ULONG)nLast ) - nMinSampleValue ) * nMinMax ) ) );
+ for ( nx = 0; nx < nImageWidth; nx++ )
+ {
+ nLast = *pt++;
+ pAcc->SetPixel( nY, nx, (BYTE)( ( (BYTESWAP((ULONG)nLast ) - nMinSampleValue ) * nMinMax ) ) );
+ }
}
}
- }
- else
- {
- if ( nPredictor == 2 )
+ else
{
- nLast = *pt++;
- for ( nx = 0; nx < nImageWidth; nx++ )
+ if ( nPredictor == 2 )
{
- pAcc->SetPixel( nY, nx, nLast );
- nLast = nLast + *pt++;
+ nLast = *pt++;
+ for ( nx = 0; nx < nImageWidth; nx++ )
+ {
+ pAcc->SetPixel( nY, nx, nLast );
+ nLast = nLast + *pt++;
+ }
}
- }
- else
- {
- for ( nx = 0; nx < nImageWidth; nx++ )
+ else
{
- pAcc->SetPixel( nY, nx, (BYTE)( ( (ULONG)*pt++ - nMinSampleValue ) * nMinMax ) );
+ for ( nx = 0; nx < nImageWidth; nx++ )
+ {
+ pAcc->SetPixel( nY, nx, (BYTE)( ( (ULONG)*pt++ - nMinSampleValue ) * nMinMax ) );
+ }
}
}
}
- }
- break;
+ break;
- case 7 :
- case 6 :
- case 5 :
- case 4 :
- case 3 :
- case 2 :
- {
- for ( nx = 0; nx < nImageWidth; nx++ )
+ case 7 :
+ case 6 :
+ case 5 :
+ case 4 :
+ case 3 :
+ case 2 :
{
- nVal = ( GetBits( pt, nx * nBitsPerSample, nBitsPerSample ) - nMinSampleValue ) * nMinMax;
- pAcc->SetPixel( nY, nx, (BYTE)nVal );
+ for ( nx = 0; nx < nImageWidth; nx++ )
+ {
+ nVal = ( GetBits( pt, nx * nBitsPerSample, nBitsPerSample ) - nMinSampleValue ) * nMinMax;
+ pAcc->SetPixel( nY, nx, (BYTE)nVal );
+ }
}
- }
- break;
+ break;
- case 1 :
- {
- if ( bByteSwap )
+ case 1 :
{
- nx = 0;
- nByteCount = ( nImageWidth >> 3 ) + 1;
- while ( --nByteCount )
+ if ( bByteSwap )
{
- nByteVal = *pt++;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal );
- }
- if ( nImageWidth & 7 )
- {
- nByteVal = *pt++;
- while ( nx < nImageWidth )
+ nx = 0;
+ nByteCount = ( nImageWidth >> 3 ) + 1;
+ while ( --nByteCount )
{
+ nByteVal = *pt++;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
pAcc->SetPixel( nY, nx++, nByteVal & 1 );
nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal );
+ }
+ if ( nImageWidth & 7 )
+ {
+ nByteVal = *pt++;
+ while ( nx < nImageWidth )
+ {
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ }
}
}
- }
- else
- {
- nx = 7;
- nByteCount = ( nImageWidth >> 3 ) + 1;
- while ( --nByteCount )
- {
- nByteVal = *pt++;
- pAcc->SetPixel( nY, nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal );
- nx += 15;
- }
- if ( nImageWidth & 7 )
+ else
{
- nx -= 7;
- nByteVal = *pt++;
- nShift = 7;
- while ( nx < nImageWidth )
+ nx = 7;
+ nByteCount = ( nImageWidth >> 3 ) + 1;
+ while ( --nByteCount )
{
- pAcc->SetPixel( nY, nx++, ( nByteVal >> nShift ) & 1);
+ nByteVal = *pt++;
+ pAcc->SetPixel( nY, nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal );
+ nx += 15;
+ }
+ if ( nImageWidth & 7 )
+ {
+ nx -= 7;
+ nByteVal = *pt++;
+ nShift = 7;
+ while ( nx < nImageWidth )
+ {
+ pAcc->SetPixel( nY, nx++, ( nByteVal >> nShift ) & 1);
+ }
}
}
}
- }
- break;
+ break;
- default :
- return FALSE;
+ default :
+ return FALSE;
+ }
}
}
else if ( ( nSamplesPerPixel == 2 ) && ( nBitsPerSample == 8 ) &&
( nPlanarConfiguration == 1 ) && ( pColorMap == 0 ) ) // grayscale
{
- ULONG nMinMax = ( ( 1 << 8 /*nDstBitsPerPixel*/ ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
- BYTE* pt = pMap[ 0 ];
- if ( nByte1 == 'I' )
- pt++;
- for ( nx = 0; nx < nImageWidth; nx++, pt += 2 )
+ if ( nMaxSampleValue > nMinSampleValue )
{
- pAcc->SetPixel( nY, nx, (BYTE)( ( (ULONG)*pt - nMinSampleValue ) * nMinMax ) );
+ ULONG nMinMax = ( ( 1 << 8 /*nDstBitsPerPixel*/ ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
+ BYTE* pt = pMap[ 0 ];
+ if ( nByte1 == 'I' )
+ pt++;
+ for ( nx = 0; nx < nImageWidth; nx++, pt += 2 )
+ {
+ pAcc->SetPixel( nY, nx, (BYTE)( ( (ULONG)*pt - nMinSampleValue ) * nMinMax ) );
+ }
}
}
else
@@ -1207,11 +1221,17 @@ BOOL TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
if ( pTIFF->IsEof() )
nNextIfd = 0;
}
+ if ( !nBitsPerSample || ( nBitsPerSample > 32 ) )
+ bStatus = FALSE;
if ( bStatus )
{
if ( nMaxSampleValue == 0 )
- nMaxSampleValue = ( 1 << nBitsPerSample ) - 1;
-
+ {
+ if ( nBitsPerSample == 32 ) // sj: i93300, compiler bug, 1 << 32 gives 1 one 32bit windows platforms,
+ nMaxSampleValue = 0xffffffff; // (up from 80286 only the lower 5 bits are used when shifting a 32bit register)
+ else
+ nMaxSampleValue = ( 1 << nBitsPerSample ) - 1;
+ }
if ( nPhotometricInterpretation == 2 || nPhotometricInterpretation == 5 || nPhotometricInterpretation == 6 )
nDstBitsPerPixel = 24;
else if ( nBitsPerSample*nSamplesPerPixel <= 1 )
diff --git a/filter/source/msfilter/mscodec.cxx b/filter/source/msfilter/mscodec.cxx
index de17da6bde59..c6feb4fb57dd 100644
--- a/filter/source/msfilter/mscodec.cxx
+++ b/filter/source/msfilter/mscodec.cxx
@@ -34,12 +34,16 @@
#include <string.h>
#include <tools/solar.h>
+#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/docpasswordhelper.hxx>
+
#define DEBUG_MSO_ENCRYPTION_STD97 0
#if DEBUG_MSO_ENCRYPTION_STD97
#include <stdio.h>
#endif
+using namespace ::com::sun::star;
namespace msfilter {
@@ -169,6 +173,37 @@ void MSCodec_Xor95::InitKey( const sal_uInt8 pnPassData[ 16 ] )
}
}
+sal_Bool MSCodec_Xor95::InitCodec( const uno::Sequence< beans::NamedValue >& aData )
+{
+ sal_Bool bResult = sal_False;
+
+ ::comphelper::SequenceAsHashMap aHashData( aData );
+ uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95EncryptionKey" ) ), uno::Sequence< sal_Int8 >() );
+
+ if ( aKey.getLength() == 16 )
+ {
+ (void)memcpy( mpnKey, aKey.getConstArray(), 16 );
+ bResult = sal_True;
+
+ mnKey = (sal_uInt16)aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95BaseKey" ) ), (sal_Int16)0 );
+ mnHash = (sal_uInt16)aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95PasswordHash" ) ), (sal_Int16)0 );
+ }
+ else
+ OSL_ENSURE( sal_False, "Unexpected key size!\n" );
+
+ return bResult;
+}
+
+uno::Sequence< beans::NamedValue > MSCodec_Xor95::GetEncryptionData()
+{
+ ::comphelper::SequenceAsHashMap aHashData;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95EncryptionKey" ) ) ] <<= uno::Sequence<sal_Int8>( (sal_Int8*)mpnKey, 16 );
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95BaseKey" ) ) ] <<= (sal_Int16)mnKey;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95PasswordHash" ) ) ] <<= (sal_Int16)mnHash;
+
+ return aHashData.getAsConstNamedValueList();
+}
+
bool MSCodec_Xor95::VerifyKey( sal_uInt16 nKey, sal_uInt16 nHash ) const
{
return (nKey == mnKey) && (nHash == mnHash);
@@ -218,11 +253,6 @@ void MSCodec_Xor95::Skip( sal_Size nBytes )
mnOffset = (mnOffset + nBytes) & 0x0F;
}
-sal_uInt16 MSCodec_Xor95::GetHash( const sal_uInt8* pnPassData, sal_Size nSize )
-{
- return lclGetHash( pnPassData, nSize );
-}
-
// ============================================================================
MSCodec_Std97::MSCodec_Std97 ()
@@ -236,15 +266,18 @@ MSCodec_Std97::MSCodec_Std97 ()
OSL_ASSERT(m_hDigest != 0);
(void)memset (m_pDigestValue, 0, sizeof(m_pDigestValue));
+ (void)memset (m_pDocId, 0, sizeof(m_pDocId));
}
MSCodec_Std97::~MSCodec_Std97 ()
{
(void)memset (m_pDigestValue, 0, sizeof(m_pDigestValue));
+ (void)memset (m_pDocId, 0, sizeof(m_pDocId));
rtl_digest_destroy (m_hDigest);
rtl_cipher_destroy (m_hCipher);
}
+#if 0
#if DEBUG_MSO_ENCRYPTION_STD97
static void lcl_PrintKeyData(const sal_uInt8* pKeyData, const char* msg)
{
@@ -261,6 +294,7 @@ static void lcl_PrintKeyData(const sal_uInt8* /*pKeyData*/, const char* /*msg*/)
{
}
#endif
+#endif
#if DEBUG_MSO_ENCRYPTION_STD97
static void lcl_PrintDigest(const sal_uInt8* pDigest, const char* msg)
@@ -276,65 +310,65 @@ static void lcl_PrintDigest(const sal_uInt8* /*pDigest*/, const char* /*msg*/)
}
#endif
-void MSCodec_Std97::InitKey (
- const sal_uInt16 pPassData[16],
- const sal_uInt8 pUnique[16])
+sal_Bool MSCodec_Std97::InitCodec( const uno::Sequence< beans::NamedValue >& aData )
{
#if DEBUG_MSO_ENCRYPTION_STD97
- fprintf(stdout, "MSCodec_Std97::InitKey: --begin\n");fflush(stdout);
+ fprintf(stdout, "MSCodec_Std97::InitCodec: --begin\n");fflush(stdout);
#endif
- sal_uInt8 pKeyData[64];
- int i, n;
+ sal_Bool bResult = sal_False;
- // Fill PassData into KeyData.
- (void)memset (pKeyData, 0, sizeof(pKeyData));
- lcl_PrintKeyData(pKeyData, "initial");
- for (i = 0, n = 16; (i < n) && pPassData[i]; i++)
- {
- pKeyData[2*i ] = sal::static_int_cast< sal_uInt8 >(
- (pPassData[i] >> 0) & 0xff);
- pKeyData[2*i + 1] = sal::static_int_cast< sal_uInt8 >(
- (pPassData[i] >> 8) & 0xff);
- }
- pKeyData[2*i] = 0x80;
- pKeyData[ 56] = sal::static_int_cast< sal_uInt8 >(i << 4);
+ ::comphelper::SequenceAsHashMap aHashData( aData );
+ uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97EncryptionKey" ) ), uno::Sequence< sal_Int8 >() );
- lcl_PrintKeyData(pKeyData, "password data");
-
- // Fill raw digest of KeyData into KeyData.
- (void)rtl_digest_updateMD5 (
- m_hDigest, pKeyData, sizeof(pKeyData));
- (void)rtl_digest_rawMD5 (
- m_hDigest, pKeyData, RTL_DIGEST_LENGTH_MD5);
-
- lcl_PrintKeyData(pKeyData, "raw digest of key data");
-
- // Update digest with KeyData and Unique.
- for (i = 0; i < 16; i++)
+ if ( aKey.getLength() == RTL_DIGEST_LENGTH_MD5 )
{
- rtl_digest_updateMD5 (m_hDigest, pKeyData, 5);
- rtl_digest_updateMD5 (m_hDigest, pUnique, 16);
+ (void)memcpy( m_pDigestValue, aKey.getConstArray(), RTL_DIGEST_LENGTH_MD5 );
+ uno::Sequence< sal_Int8 > aUniqueID = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97UniqueID" ) ), uno::Sequence< sal_Int8 >() );
+ if ( aUniqueID.getLength() == 16 )
+ {
+ (void)memcpy( m_pDocId, aUniqueID.getConstArray(), 16 );
+ bResult = sal_True;
+ lcl_PrintDigest(m_pDigestValue, "digest value");
+ lcl_PrintDigest(m_pDocId, "DocId value");
+ }
+ else
+ OSL_ENSURE( sal_False, "Unexpected document ID!\n" );
}
+ else
+ OSL_ENSURE( sal_False, "Unexpected key size!\n" );
- // Update digest with padding.
- pKeyData[16] = 0x80;
- (void)memset (pKeyData + 17, 0, sizeof(pKeyData) - 17);
- pKeyData[56] = 0x80;
- pKeyData[57] = 0x0a;
+ return bResult;
+}
- lcl_PrintKeyData(pKeyData, "update digest with padding");
+uno::Sequence< beans::NamedValue > MSCodec_Std97::GetEncryptionData()
+{
+ ::comphelper::SequenceAsHashMap aHashData;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97EncryptionKey" ) ) ] <<= uno::Sequence< sal_Int8 >( (sal_Int8*)m_pDigestValue, RTL_DIGEST_LENGTH_MD5 );
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97UniqueID" ) ) ] <<= uno::Sequence< sal_Int8 >( (sal_Int8*)m_pDocId, 16 );
- rtl_digest_updateMD5 (
- m_hDigest, &(pKeyData[16]), sizeof(pKeyData) - 16);
+ return aHashData.getAsConstNamedValueList();
+}
+void MSCodec_Std97::InitKey (
+ const sal_uInt16 pPassData[16],
+ const sal_uInt8 pDocId[16])
+{
+#if DEBUG_MSO_ENCRYPTION_STD97
+ fprintf(stdout, "MSCodec_Std97::InitKey: --begin\n");fflush(stdout);
+#endif
+ uno::Sequence< sal_Int8 > aKey = ::comphelper::DocPasswordHelper::GenerateStd97Key( pPassData, uno::Sequence< sal_Int8 >( (sal_Int8*)pDocId, 16 ) );
// Fill raw digest of above updates into DigestValue.
- rtl_digest_rawMD5 (
- m_hDigest, m_pDigestValue, sizeof(m_pDigestValue));
+
+ if ( aKey.getLength() == sizeof(m_pDigestValue) )
+ (void)memcpy ( m_pDigestValue, aKey.getConstArray(), sizeof(m_pDigestValue) );
+ else
+ memset( m_pDigestValue, 0, sizeof(m_pDigestValue) );
lcl_PrintDigest(m_pDigestValue, "digest value");
- // Erase KeyData array and leave.
- (void)memset (pKeyData, 0, sizeof(pKeyData));
+ (void)memcpy (m_pDocId, pDocId, 16);
+
+ lcl_PrintDigest(m_pDocId, "DocId value");
}
bool MSCodec_Std97::VerifyKey (
@@ -411,7 +445,7 @@ bool MSCodec_Std97::InitCipher (sal_uInt32 nCounter)
bool MSCodec_Std97::CreateSaltDigest( const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] )
{
#if DEBUG_MSO_ENCRYPTION_STD97
- lcl_PrintDigest(pSaltData, "salt data");
+ lcl_PrintDigest(nSaltData, "salt data");
#endif
bool result = false;
@@ -528,6 +562,12 @@ void MSCodec_Std97::GetEncryptKey (
}
}
+void MSCodec_Std97::GetDocId( sal_uInt8 pDocId[16] )
+{
+ if ( sizeof( m_pDocId ) == 16 )
+ (void)memcpy( pDocId, m_pDocId, 16 );
+}
+
// ============================================================================
} // namespace svx
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index f334c86bbc5f..05f99aa36813 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1468,12 +1468,16 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
if ( bOk )
{
- // PersistPtrs lesen (alle)
- nPersistPtrAnz = aUserEditAtom.nMaxPersistWritten + 1; // 1 mehr, damit ich immer direkt indizieren kann
- pPersistPtr = new UINT32[ nPersistPtrAnz ]; // (die fangen naemlich eigentlich bei 1 an)
+ nPersistPtrAnz = aUserEditAtom.nMaxPersistWritten + 1;
+ if ( ( nPersistPtrAnz >> 2 ) > nStreamLen ) // sj: at least nPersistPtrAnz is not allowed to be greater than filesize
+ bOk = FALSE; // (it should not be greater than the PPT_PST_PersistPtrIncrementalBlock, but
+ // we are reading this block later, so we do not have access yet)
+
+ if ( bOk && ( nPersistPtrAnz < ( SAL_MAX_UINT32 / sizeof( UINT32 ) ) ) )
+ pPersistPtr = new (std::nothrow) UINT32[ nPersistPtrAnz ];
if ( !pPersistPtr )
bOk = FALSE;
- else
+ if ( bOk )
{
memset( pPersistPtr, 0x00, nPersistPtrAnz * 4 );
@@ -5087,8 +5091,8 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport&
rIn >> nCharCount
>> aParaPropSet.pParaSet->mnDepth; // Einruecktiefe
- aParaPropSet.pParaSet->mnDepth =
- std::min(sal_uInt16(9),
+ aParaPropSet.pParaSet->mnDepth = // taking care of about using not more than 9 outliner levels
+ std::min(sal_uInt16(8),
aParaPropSet.pParaSet->mnDepth);
nCharCount--;
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index bb125bd37a47..1adbbc63619c 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -33,7 +33,9 @@
#include "vcl/svapp.hxx"
#include "vcl/msgbox.hxx"
#include "sfx2/passwd.hxx"
-#include "com/sun/star/uno/Sequence.hxx"
+
+#include "comphelper/storagehelper.hxx"
+
#include "com/sun/star/text/XTextRange.hpp"
#include "com/sun/star/drawing/XShapes.hpp"
#include "com/sun/star/container/XIndexAccess.hpp"
@@ -382,8 +384,8 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
nElementAdded--;
// add the open password
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentOpenPassword" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= OUString( msUserPassword );
+ aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPasswords" ) );
+ aRet[ aRet.getLength() - nElementAdded ].Value <<= mxPreparedPasswords;
nElementAdded--;
//the restrict permission flag (needed to have the scripting consistent with the dialog)
@@ -392,8 +394,8 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
nElementAdded--;
//add the permission password
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PermissionPassword" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= OUString( msOwnerPassword );
+ aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPermissionPassword" ) );
+ aRet[ aRet.getLength() - nElementAdded ].Value <<= maPreparedOwnerPassword;
nElementAdded--;
// this should be the last added...
@@ -1017,12 +1019,12 @@ void ImpPDFTabViewerPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
ImpPDFTabSecurityPage::ImpPDFTabSecurityPage( Window* i_pParent,
const SfxItemSet& i_rCoreSet ) :
SfxTabPage( i_pParent, PDFFilterResId( RID_PDF_TAB_SECURITY ), i_rCoreSet ),
- maPbUserPwd( this, PDFFilterResId( BTN_USER_PWD ) ),
+ maFlGroup( this, PDFFilterResId( FL_PWD_GROUP ) ),
+ maPbSetPwd( this, PDFFilterResId( BTN_SET_PWD ) ),
maFtUserPwd( this, PDFFilterResId( FT_USER_PWD ) ),
maUserPwdSet( PDFFilterResId( STR_USER_PWD_SET ) ),
maUserPwdUnset( PDFFilterResId( STR_USER_PWD_UNSET ) ),
-
- maPbOwnerPwd( this, PDFFilterResId( BTN_OWNER_PWD ) ),
+ maStrSetPwd( PDFFilterResId( STR_SET_PWD ) ),
maFtOwnerPwd( this, PDFFilterResId( FT_OWNER_PWD ) ),
maOwnerPwdSet( PDFFilterResId( STR_OWNER_PWD_SET ) ),
maOwnerPwdUnset( PDFFilterResId( STR_OWNER_PWD_UNSET ) ),
@@ -1043,6 +1045,8 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage( Window* i_pParent,
maCbEnableAccessibility( this, PDFFilterResId( CB_ENAB_ACCESS ) ),
msUserPwdTitle( PDFFilterResId( STR_PDF_EXPORT_UDPWD ) ),
+ mbHaveOwnerPassword( false ),
+ mbHaveUserPassword( false ),
msOwnerPwdTitle( PDFFilterResId( STR_PDF_EXPORT_ODPWD ) )
{
@@ -1081,6 +1085,8 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage( Window* i_pParent,
(*pCurrent++)->SetPosPixel( aNewPos );
}
}
+
+ maPbSetPwd.SetClickHdl( LINK( this, ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl ) );
}
// -----------------------------------------------------------------------------
@@ -1100,13 +1106,11 @@ void ImpPDFTabSecurityPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
{
// please note that in PDF/A-1a mode even if this are copied back,
// the security settings are forced disabled in PDFExport::Export
- paParent->mbEncrypt = (msUserPassword.Len() > 0);
- if( paParent->mbEncrypt )
- paParent->msUserPassword = msUserPassword;
+ paParent->mbEncrypt = mbHaveUserPassword;
+ paParent->mxPreparedPasswords = mxPreparedPasswords;
- paParent->mbRestrictPermissions = (msOwnerPassword.Len() > 0);
- if( msOwnerPassword.Len() > 0 )
- paParent->msOwnerPassword = msOwnerPassword;
+ paParent->mbRestrictPermissions = mbHaveOwnerPassword;
+ paParent->maPreparedOwnerPassword = maPreparedOwnerPassword;
//verify print status
paParent->mnPrint = 0;
@@ -1135,10 +1139,6 @@ void ImpPDFTabSecurityPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
// -----------------------------------------------------------------------------
void ImpPDFTabSecurityPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent )
{
- maPbUserPwd.SetClickHdl( LINK( this, ImpPDFTabSecurityPage, ClickmaPbUserPwdHdl ) );
-
- maPbOwnerPwd.SetClickHdl( LINK( this, ImpPDFTabSecurityPage, ClickmaPbOwnerPwdHdl ) );
-
switch( paParent->mnPrint )
{
default:
@@ -1184,39 +1184,44 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const ImpPDFTabDialog* paParen
!( ( ImpPDFTabGeneralPage* )paParent->GetTabPage( RID_PDF_TAB_GENER ) )->IsPdfaSelected() );
}
-//method common to both the password entry procedures
-void ImpPDFTabSecurityPage::ImplPwdPushButton( const String & i_rDlgTitle, String & io_rDestPassword )
+IMPL_LINK( ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, void*, EMPTYARG )
{
-// string needed: dialog title, message box text, depending on the button clicked
- SfxPasswordDialog aPwdDialog( this );
+ SfxPasswordDialog aPwdDialog( this, &msUserPwdTitle );
aPwdDialog.SetMinLen( 0 );
- aPwdDialog.ShowExtras( SHOWEXTRAS_CONFIRM );
- aPwdDialog.SetText( i_rDlgTitle );
+ aPwdDialog.ShowExtras( SHOWEXTRAS_CONFIRM | SHOWEXTRAS_PASSWORD2 | SHOWEXTRAS_CONFIRM2 );
+ aPwdDialog.SetText( maStrSetPwd );
+ aPwdDialog.SetGroup2Text( msOwnerPwdTitle );
aPwdDialog.AllowAsciiOnly();
if( aPwdDialog.Execute() == RET_OK ) //OK issued get password and set it
- io_rDestPassword = aPwdDialog.GetPassword();
- enablePermissionControls();
-}
+ {
+ rtl::OUString aUserPW( aPwdDialog.GetPassword() );
+ rtl::OUString aOwnerPW( aPwdDialog.GetPassword2() );
-IMPL_LINK( ImpPDFTabSecurityPage, ClickmaPbUserPwdHdl, void*, EMPTYARG )
-{
- ImplPwdPushButton(msUserPwdTitle, msUserPassword );
- return 0;
-}
+ mbHaveUserPassword = (aUserPW.getLength() != 0);
+ mbHaveOwnerPassword = (aOwnerPW.getLength() != 0);
-IMPL_LINK( ImpPDFTabSecurityPage, ClickmaPbOwnerPwdHdl, void*, EMPTYARG )
-{
- ImplPwdPushButton( msOwnerPwdTitle, msOwnerPassword );
+ mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW, true );
+
+ if( mbHaveOwnerPassword )
+ {
+ maPreparedOwnerPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW );
+ }
+ else
+ maPreparedOwnerPassword = Sequence< NamedValue >();
+ // trash clear text passwords string memory
+ rtl_zeroMemory( (void*)aUserPW.getStr(), aUserPW.getLength() );
+ rtl_zeroMemory( (void*)aOwnerPW.getStr(), aOwnerPW.getLength() );
+ }
+ enablePermissionControls();
return 0;
}
void ImpPDFTabSecurityPage::enablePermissionControls()
{
- maFtUserPwd.SetText( (msUserPassword.Len() > 0 && IsEnabled()) ? maUserPwdSet : maUserPwdUnset );
-
- sal_Bool bLocalEnable = (msOwnerPassword.Len() > 0) && IsEnabled();
+ maFtUserPwd.SetText( (mbHaveUserPassword && IsEnabled()) ? maUserPwdSet : maUserPwdUnset );
+ sal_Bool bLocalEnable = mbHaveOwnerPassword && IsEnabled();
maFtOwnerPwd.SetText( bLocalEnable ? maOwnerPwdSet : maOwnerPwdUnset );
maFlPrintPermissions.Enable( bLocalEnable );
diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc
index cc438255650f..dccdc2cad11b 100644
--- a/filter/source/pdf/impdialog.hrc
+++ b/filter/source/pdf/impdialog.hrc
@@ -144,14 +144,15 @@
#define NUM_BOOKMARKLEVELS 114
//controls for security preferences tab page
-#define BTN_USER_PWD 120
+#define FL_PWD_GROUP 119
+#define BTN_SET_PWD 120
#define FT_USER_PWD 121
#define STR_USER_PWD_SET 122
#define STR_USER_PWD_ENC 123
#define STR_USER_PWD_UNSET 124
#define STR_USER_PWD_UNENC 125
+#define STR_SET_PWD 126
-#define BTN_OWNER_PWD 127
#define FT_OWNER_PWD 128
#define STR_OWNER_PWD_SET 129
#define STR_OWNER_PWD_REST 130
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 38da273c2fbd..3fd98c775e0d 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -44,6 +44,8 @@
#include "sfx2/tabdlg.hxx"
+#include "com/sun/star/beans/NamedValue.hpp"
+
// ----------------
// - ImpPDFDialog -
// ----------------
@@ -126,14 +128,14 @@ protected:
sal_Bool mbFirstPageLeft;
sal_Bool mbEncrypt;
- String msUserPassword;
sal_Bool mbRestrictPermissions;
- String msOwnerPassword;
+ com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > maPreparedOwnerPassword;
sal_Int32 mnPrint;
sal_Int32 mnChangesAllowed;
sal_Bool mbCanCopyOrExtract;
sal_Bool mbCanExtractForAccessibility;
+ com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder > mxPreparedPasswords;
sal_Bool mbIsRangeChecked;
String msPageRange;
@@ -314,12 +316,13 @@ public:
//class security tab page
class ImpPDFTabSecurityPage : public SfxTabPage
{
- PushButton maPbUserPwd;
+ FixedLine maFlGroup;
+ PushButton maPbSetPwd;
FixedText maFtUserPwd;
String maUserPwdSet;
String maUserPwdUnset;
+ String maStrSetPwd;
- PushButton maPbOwnerPwd;
FixedText maFtOwnerPwd;
String maOwnerPwdSet;
String maOwnerPwdUnset;
@@ -339,16 +342,18 @@ class ImpPDFTabSecurityPage : public SfxTabPage
CheckBox maCbEnableCopy;
CheckBox maCbEnableAccessibility;
- String msUserPassword;
String msUserPwdTitle;
- String msOwnerPassword;
+ bool mbHaveOwnerPassword;
+ bool mbHaveUserPassword;
+ com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > maPreparedOwnerPassword;
String msOwnerPwdTitle;
+ com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder > mxPreparedPasswords;
+
long nWidth;
- DECL_LINK( ClickmaPbUserPwdHdl, void* );
- DECL_LINK( ClickmaPbOwnerPwdHdl, void* );
+ DECL_LINK( ClickmaPbSetPwdHdl, void* );
void enablePermissionControls();
diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src
index 248d7d8491f7..1c941d6a9972 100644
--- a/filter/source/pdf/impdialog.src
+++ b/filter/source/pdf/impdialog.src
@@ -39,13 +39,13 @@ String STR_PDF_EXPORT
//password dialog title
String STR_PDF_EXPORT_UDPWD
{
- Text[ en-US ] = "Set Open Password";
+ Text[ en-US ] = "Set open password";
};
//password dialog title
String STR_PDF_EXPORT_ODPWD
{
- Text[ en-US ] = "Set Permission Password";
+ Text[ en-US ] = "Set permission password";
};
//////////////////////////////////////////////////////////////
@@ -561,20 +561,29 @@ TabPage RID_PDF_TAB_SECURITY
TAB_PDF_SIZE;
Hide = TRUE;
-//////////////////////////////////////
- PushButton BTN_USER_PWD
+ FixedLine FL_PWD_GROUP
+ {
+ Pos = MAP_APPFONT( 5, 5 );
+ Size = MAP_APPFONT( 125, 10 );
+ Text[ en-US ] = "File encryption and permission";
+ };
+ PushButton BTN_SET_PWD
{
- HelpID = "filter:PushButton:RID_PDF_TAB_SECURITY:BTN_USER_PWD";
+ HelpID = "filter:PushButton:RID_PDF_TAB_SECURITY:BTN_PWD";
TabStop = TRUE ;
Disable = TRUE ;
- Pos = MAP_APPFONT ( 12, 5 ) ;
+ Pos = MAP_APPFONT ( 12, 20 ) ;
Size = MAP_APPFONT ( 120 , 13 ) ;
- Text[ en-US ] = "Set ~open password...";
+ Text[ en-US ] = "Set ~passwords...";
+ };
+ String STR_SET_PWD
+ {
+ Text[ en-US ] = "Set passwords";
};
FixedText FT_USER_PWD
{
- Pos = MAP_APPFONT(12 , 25 );
+ Pos = MAP_APPFONT(12 , 40 );
Size = MAP_APPFONT( 160, 20 );
};
@@ -598,16 +607,6 @@ TabPage RID_PDF_TAB_SECURITY
Text [ en-US ] = "PDF document will not be encrypted";
};
- PushButton BTN_OWNER_PWD
- {
- HelpID = "filter:PushButton:RID_PDF_TAB_SECURITY:BTN_OWNER_PWD";
- TabStop = TRUE ;
- Disable = TRUE ;
- Pos = MAP_APPFONT ( 12, 45 ) ;
- Size = MAP_APPFONT ( 120 , 13 ) ;
- Text[ en-US ] = "Set ~permission password...";
- };
-
FixedText FT_OWNER_PWD
{
Pos = MAP_APPFONT( 12 , 65 );
diff --git a/filter/source/pdf/makefile.mk b/filter/source/pdf/makefile.mk
index 776729ac0d97..65028c7d5d8d 100644
--- a/filter/source/pdf/makefile.mk
+++ b/filter/source/pdf/makefile.mk
@@ -47,6 +47,7 @@ SLOFILES= $(SLO)$/pdfuno.obj \
$(SLO)$/pdfdialog.obj \
$(SLO)$/impdialog.obj \
$(SLO)$/pdffilter.obj \
+ $(SLO)$/pdfinteract.obj \
$(SLO)$/pdfexport.obj
# --- Library -----------------------------------
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index a8d4e1d0d14c..382dd12eeb83 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -32,49 +32,58 @@
#include "impdialog.hxx"
#include "pdf.hrc"
-#include <tools/urlobj.hxx>
-#include <tools/fract.hxx>
-#include <tools/poly.hxx>
-#include <vcl/mapmod.hxx>
-#include <vcl/virdev.hxx>
-#include <vcl/metaact.hxx>
-#include <vcl/gdimtf.hxx>
-#include <vcl/jobset.hxx>
-#include <vcl/salbtype.hxx>
-#include <vcl/bmpacc.hxx>
+#include "tools/urlobj.hxx"
+#include "tools/fract.hxx"
+#include "tools/poly.hxx"
+#include "vcl/mapmod.hxx"
+#include "vcl/virdev.hxx"
+#include "vcl/metaact.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/jobset.hxx"
+#include "vcl/salbtype.hxx"
+#include "vcl/bmpacc.hxx"
#include "vcl/svapp.hxx"
-#include <toolkit/awt/vclxdevice.hxx>
-#include <unotools/localfilehelper.hxx>
-#include <unotools/processfactory.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include <svtools/filter.hxx>
-#include <svl/solar.hrc>
-#include <comphelper/string.hxx>
-#include <unotools/streamwrap.hxx>
-#include <com/sun/star/io/XSeekable.hpp>
+#include "toolkit/awt/vclxdevice.hxx"
+#include "unotools/localfilehelper.hxx"
+#include "unotools/processfactory.hxx"
+#include "svtools/FilterConfigItem.hxx"
+#include "svtools/filter.hxx"
+#include "svl/solar.hrc"
+#include "comphelper/string.hxx"
+#include "comphelper/storagehelper.hxx"
+#include "unotools/streamwrap.hxx"
+#include "com/sun/star/io/XSeekable.hpp"
+
#include "basegfx/polygon/b2dpolygon.hxx"
#include "basegfx/polygon/b2dpolypolygon.hxx"
#include "basegfx/polygon/b2dpolygontools.hxx"
-#include <unotools/saveopt.hxx> // only for testing of relative saving options in PDF
-
-#include <vcl/graphictools.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/awt/Rectangle.hpp>
-#include <com/sun/star/awt/XDevice.hpp>
-#include <com/sun/star/util/MeasureUnit.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/view/XViewSettingsSupplier.hpp>
-#include <unotools/configmgr.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
-#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include "unotools/saveopt.hxx" // only for testing of relative saving options in PDF
+
+#include "vcl/graphictools.hxx"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/awt/Rectangle.hpp"
+#include "com/sun/star/awt/XDevice.hpp"
+#include "com/sun/star/util/MeasureUnit.hpp"
+#include "com/sun/star/frame/XModel.hpp"
+#include "com/sun/star/frame/XModuleManager.hpp"
+#include "com/sun/star/frame/XStorable.hpp"
+#include "com/sun/star/frame/XController.hpp"
+#include "com/sun/star/document/XDocumentProperties.hpp"
+#include "com/sun/star/document/XDocumentPropertiesSupplier.hpp"
+#include "com/sun/star/container/XNameAccess.hpp"
+#include "com/sun/star/view/XViewSettingsSupplier.hpp"
+#include "com/sun/star/task/XInteractionRequest.hpp"
+#include "com/sun/star/task/PDFExportException.hpp"
+
+#include "unotools/configmgr.hxx"
+#include "cppuhelper/exc_hlp.hxx"
+#include "cppuhelper/compbase1.hxx"
+#include "cppuhelper/basemutex.hxx"
+
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/drawing/XShapes.hpp"
+#include "com/sun/star/graphic/XGraphicProvider.hpp"
using namespace ::rtl;
using namespace ::vcl;
@@ -89,10 +98,14 @@ using namespace ::com::sun::star::graphic;
// - PDFExport -
// -------------
-PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc, Reference< task::XStatusIndicator >& rxStatusIndicator, const Reference< lang::XMultiServiceFactory >& xFactory ) :
+PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc,
+ const Reference< task::XStatusIndicator >& rxStatusIndicator,
+ const Reference< task::XInteractionHandler >& rxIH,
+ const Reference< lang::XMultiServiceFactory >& xFactory ) :
mxSrcDoc ( rxSrcDoc ),
mxMSF ( xFactory ),
mxStatusIndicator ( rxStatusIndicator ),
+ mxIH ( rxIH ),
mbUseTaggedPDF ( sal_False ),
mnPDFTypeSelection ( 0 ),
mbExportNotes ( sal_True ),
@@ -130,9 +143,7 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc, Reference< task::
mbFirstPageLeft ( sal_False ),
mbEncrypt ( sal_False ),
- msOpenPassword (),
mbRestrictPermissions ( sal_False ),
- msPermissionPassword (),
mnPrintAllowed ( 2 ),
mnChangesAllowed ( 4 ),
mbCanCopyOrExtract ( sal_True ),
@@ -250,12 +261,12 @@ sal_Bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter, Reference< com:
class PDFExportStreamDoc : public vcl::PDFOutputStream
{
- Reference< XComponent > m_xSrcDoc;
- rtl::OUString m_aPassWd;
+ Reference< XComponent > m_xSrcDoc;
+ Sequence< beans::NamedValue > m_aPreparedPassword;
public:
- PDFExportStreamDoc( const Reference< XComponent >& xDoc, const rtl::OUString& rPwd )
+ PDFExportStreamDoc( const Reference< XComponent >& xDoc, const Sequence<beans::NamedValue>& rPwd )
: m_xSrcDoc( xDoc ),
- m_aPassWd( rPwd )
+ m_aPreparedPassword( rPwd )
{}
virtual ~PDFExportStreamDoc();
@@ -271,15 +282,16 @@ void PDFExportStreamDoc::write( const Reference< XOutputStream >& xStream )
Reference< com::sun::star::frame::XStorable > xStore( m_xSrcDoc, UNO_QUERY );
if( xStore.is() )
{
- Sequence< beans::PropertyValue > aArgs( m_aPassWd.getLength() ? 3 : 2 );
+ Sequence< beans::PropertyValue > aArgs( 2 + ((m_aPreparedPassword.getLength() > 0) ? 1 : 0) );
aArgs.getArray()[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
aArgs.getArray()[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "OutputStream" ) );
aArgs.getArray()[1].Value <<= xStream;
- if( m_aPassWd.getLength() )
+ if( m_aPreparedPassword.getLength() )
{
- aArgs.getArray()[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Password" ) );
- aArgs.getArray()[2].Value <<= m_aPassWd;
+ aArgs.getArray()[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionData" ) );
+ aArgs.getArray()[2].Value <<= m_aPreparedPassword;
}
+
try
{
xStore->storeToURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:stream" ) ),
@@ -390,6 +402,11 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
VCLXDevice* pXDevice = new VCLXDevice;
OUString aPageRange;
Any aSelection;
+ PDFWriter::PDFWriterContext aContext;
+ rtl::OUString aOpenPassword, aPermissionPassword;
+ Reference< beans::XMaterialHolder > xEnc;
+ Sequence< beans::NamedValue > aPreparedPermissionPassword;
+
// getting the string for the creator
String aCreator;
@@ -408,7 +425,34 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
aCreator.AppendAscii( "Math" );
}
- PDFWriter::PDFWriterContext aContext;
+ Reference< document::XDocumentPropertiesSupplier > xDocumentPropsSupplier( mxSrcDoc, UNO_QUERY );
+ if ( xDocumentPropsSupplier.is() )
+ {
+ Reference< document::XDocumentProperties > xDocumentProps( xDocumentPropsSupplier->getDocumentProperties() );
+ if ( xDocumentProps.is() )
+ {
+ aContext.DocumentInfo.Title = xDocumentProps->getTitle();
+ aContext.DocumentInfo.Author = xDocumentProps->getAuthor();
+ aContext.DocumentInfo.Subject = xDocumentProps->getSubject();
+ aContext.DocumentInfo.Keywords = ::comphelper::string::convertCommaSeparated(xDocumentProps->getKeywords());
+ }
+ }
+ // getting the string for the producer
+ String aProducer;
+ ::utl::ConfigManager* pMgr = ::utl::ConfigManager::GetConfigManager();
+ if ( pMgr )
+ {
+ Any aProductName = pMgr->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
+ ::rtl::OUString sProductName;
+ aProductName >>= sProductName;
+ aProducer = sProductName;
+ aProductName = pMgr->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
+ aProductName >>= sProductName;
+ aProducer.AppendAscii(" ");
+ aProducer += String( sProductName );
+ }
+ aContext.DocumentInfo.Producer = aProducer;
+ aContext.DocumentInfo.Creator = aCreator;
for( sal_Int32 nData = 0, nDataCount = rFilterData.getLength(); nData < nDataCount; ++nData )
{
@@ -482,11 +526,15 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptFile" ) ) )
rFilterData[ nData ].Value >>= mbEncrypt;
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentOpenPassword" ) ) )
- rFilterData[ nData ].Value >>= msOpenPassword;
+ rFilterData[ nData ].Value >>= aOpenPassword;
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "RestrictPermissions" ) ) )
rFilterData[ nData ].Value >>= mbRestrictPermissions;
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PermissionPassword" ) ) )
- rFilterData[ nData ].Value >>= msPermissionPassword;
+ rFilterData[ nData ].Value >>= aPermissionPassword;
+ else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPasswords" ) ) )
+ rFilterData[ nData ].Value >>= xEnc;
+ else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPermissionPassword" ) ) )
+ rFilterData[ nData ].Value >>= aPreparedPermissionPassword;
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "Printing" ) ) )
rFilterData[ nData ].Value >>= mnPrintAllowed;
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "Changes" ) ) )
@@ -521,14 +569,17 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
break;
case 1:
aContext.Version = PDFWriter::PDF_A_1;
-//force the tagged PDF as well
+ //force the tagged PDF as well
mbUseTaggedPDF = sal_True;
-//force embedding of standard fonts
+ //force embedding of standard fonts
mbEmbedStandardFonts = sal_True;
-//force disabling of form conversion
+ //force disabling of form conversion
mbExportFormFields = sal_False;
-// PDF/A does not allow transparencies
+ // PDF/A does not allow transparencies
mbRemoveTransparencies = sal_True;
+ // no encryption
+ mbEncrypt = sal_False;
+ xEnc.clear();
break;
}
@@ -604,23 +655,17 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
if( aContext.Version != PDFWriter::PDF_A_1 )
{
//set values needed in encryption
- aContext.Encrypt = mbEncrypt;
//set encryption level, fixed, but here it can set by the UI if needed.
// true is 128 bit, false 40
//note that in 40 bit mode the UI needs reworking, since the current UI is meaningfull only for
//128bit security mode
- aContext.Security128bit = sal_True;
-
-//set the open password
- if( aContext.Encrypt && msOpenPassword.getLength() > 0 )
- aContext.UserPassword = msOpenPassword;
+ aContext.Encryption.Security128bit = sal_True;
//set check for permission change password
// if not enabled and no permission password, force permissions to default as if PDF where without encryption
- if( mbRestrictPermissions && msPermissionPassword.getLength() > 0 )
+ if( mbRestrictPermissions && (xEnc.is() || aPermissionPassword.getLength() > 0) )
{
- aContext.OwnerPassword = msPermissionPassword;
- aContext.Encrypt = sal_True;
+ mbEncrypt = sal_True;
//permission set as desired, done after
}
else
@@ -638,9 +683,9 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
break;
default:
case 2:
- aContext.AccessPermissions.CanPrintFull = sal_True;
+ aContext.Encryption.CanPrintFull = sal_True;
case 1:
- aContext.AccessPermissions.CanPrintTheDocument = sal_True;
+ aContext.Encryption.CanPrintTheDocument = sal_True;
break;
}
@@ -649,26 +694,36 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
case 0: //already in struct PDFSecPermissions CTOR
break;
case 1:
- aContext.AccessPermissions.CanAssemble = sal_True;
+ aContext.Encryption.CanAssemble = sal_True;
break;
case 2:
- aContext.AccessPermissions.CanFillInteractive = sal_True;
+ aContext.Encryption.CanFillInteractive = sal_True;
break;
case 3:
- aContext.AccessPermissions.CanAddOrModify = sal_True;
+ aContext.Encryption.CanAddOrModify = sal_True;
break;
default:
case 4:
- aContext.AccessPermissions.CanModifyTheContent =
- aContext.AccessPermissions.CanCopyOrExtract =
- aContext.AccessPermissions.CanAddOrModify =
- aContext.AccessPermissions.CanFillInteractive = sal_True;
+ aContext.Encryption.CanModifyTheContent =
+ aContext.Encryption.CanCopyOrExtract =
+ aContext.Encryption.CanAddOrModify =
+ aContext.Encryption.CanFillInteractive = sal_True;
break;
}
- aContext.AccessPermissions.CanCopyOrExtract = mbCanCopyOrExtract;
- aContext.AccessPermissions.CanExtractForAccessibility = mbCanExtractForAccessibility;
+ aContext.Encryption.CanCopyOrExtract = mbCanCopyOrExtract;
+ aContext.Encryption.CanExtractForAccessibility = mbCanExtractForAccessibility;
+ if( mbEncrypt && ! xEnc.is() )
+ xEnc = PDFWriter::InitEncryption( aPermissionPassword, aOpenPassword, aContext.Encryption.Security128bit );
+ if( mbEncrypt && aPermissionPassword.getLength() && ! aPreparedPermissionPassword.getLength() )
+ aPreparedPermissionPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aPermissionPassword );
}
+ // after this point we don't need the legacy clear passwords anymore
+ // however they are still inside the passed filter data sequence
+ // which is sadly out out our control
+ aPermissionPassword = rtl::OUString();
+ aOpenPassword = rtl::OUString();
+
/*
* FIXME: the entries are only implicitly defined by the resource file. Should there
* ever be an additional form submit format this could get invalid.
@@ -731,7 +786,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
//<---
}
// all context data set, time to create the printing device
- PDFWriter* pPDFWriter = new PDFWriter( aContext );
+ PDFWriter* pPDFWriter = new PDFWriter( aContext, xEnc );
OutputDevice* pOut = pPDFWriter->GetReferenceDevice();
vcl::PDFExtOutDevData* pPDFExtOutDevData = NULL;
@@ -744,41 +799,10 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
// get mimetype
OUString aSrcMimetype = getMimetypeForDocument( mxMSF, mxSrcDoc );
pPDFWriter->AddStream( aSrcMimetype,
- new PDFExportStreamDoc( mxSrcDoc, msPermissionPassword ),
+ new PDFExportStreamDoc( mxSrcDoc, aPreparedPermissionPassword ),
false
);
}
- PDFDocInfo aDocInfo;
- Reference< document::XDocumentPropertiesSupplier > xDocumentPropsSupplier( mxSrcDoc, UNO_QUERY );
- if ( xDocumentPropsSupplier.is() )
- {
- Reference< document::XDocumentProperties > xDocumentProps( xDocumentPropsSupplier->getDocumentProperties() );
- if ( xDocumentProps.is() )
- {
- aDocInfo.Title = xDocumentProps->getTitle();
- aDocInfo.Author = xDocumentProps->getAuthor();
- aDocInfo.Subject = xDocumentProps->getSubject();
- aDocInfo.Keywords = ::comphelper::string::convertCommaSeparated(xDocumentProps->getKeywords());
- }
- }
- // getting the string for the producer
- String aProducer;
- ::utl::ConfigManager* pMgr = ::utl::ConfigManager::GetConfigManager();
- if ( pMgr )
- {
- Any aProductName = pMgr->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
- ::rtl::OUString sProductName;
- aProductName >>= sProductName;
- aProducer = sProductName;
- aProductName = pMgr->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
- aProductName >>= sProductName;
- aProducer.AppendAscii(" ");
- aProducer += String( sProductName );
- }
- aDocInfo.Producer = aProducer;
- aDocInfo.Creator = aCreator;
-
- pPDFWriter->SetDocInfo( aDocInfo );
if ( pOut )
{
@@ -926,12 +950,59 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
return bRet;
}
+namespace
+{
+
+typedef cppu::WeakComponentImplHelper1< task::XInteractionRequest > PDFErrorRequestBase;
+
+class PDFErrorRequest : private cppu::BaseMutex,
+ public PDFErrorRequestBase
+{
+ task::PDFExportException maExc;
+public:
+ PDFErrorRequest( const task::PDFExportException& i_rExc );
+
+ // XInteractionRequest
+ virtual uno::Any SAL_CALL getRequest() throw (uno::RuntimeException);
+ virtual uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL getContinuations() throw (uno::RuntimeException);
+};
+
+PDFErrorRequest::PDFErrorRequest( const task::PDFExportException& i_rExc ) :
+ PDFErrorRequestBase( m_aMutex ),
+ maExc( i_rExc )
+{
+}
+
+uno::Any SAL_CALL PDFErrorRequest::getRequest() throw (uno::RuntimeException)
+{
+ osl::MutexGuard const guard( m_aMutex );
+
+ uno::Any aRet;
+ aRet <<= maExc;
+ return aRet;
+}
+
+uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL PDFErrorRequest::getContinuations() throw (uno::RuntimeException)
+{
+ return uno::Sequence< uno::Reference< task::XInteractionContinuation > >();
+}
+
+} // namespace
+
void PDFExport::showErrors( const std::set< PDFWriter::ErrorCode >& rErrors )
{
- if( ! rErrors.empty() )
+ if( ! rErrors.empty() && mxIH.is() )
{
- ImplErrorDialog aDlg( rErrors );
- aDlg.Execute();
+ task::PDFExportException aExc;
+ aExc.ErrorCodes.realloc( sal_Int32(rErrors.size()) );
+ sal_Int32 i = 0;
+ for( std::set< PDFWriter::ErrorCode >::const_iterator it = rErrors.begin();
+ it != rErrors.end(); ++it, i++ )
+ {
+ aExc.ErrorCodes.getArray()[i] = (sal_Int32)*it;
+ }
+ Reference< task::XInteractionRequest > xReq( new PDFErrorRequest( aExc ) );
+ mxIH->handle( xReq );
}
}
@@ -939,8 +1010,15 @@ void PDFExport::showErrors( const std::set< PDFWriter::ErrorCode >& rErrors )
sal_Bool PDFExport::ImplExportPage( PDFWriter& rWriter, PDFExtOutDevData& rPDFExtOutDevData, const GDIMetaFile& rMtf )
{
- vcl::PDFWriter::PlayMetafileContext aCtx;
+ const Size aSizePDF( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_POINT ) );
+ Point aOrigin;
+ Rectangle aPageRect( aOrigin, rMtf.GetPrefSize() );
+ sal_Bool bRet = sal_True;
+
+ rWriter.NewPage( aSizePDF.Width(), aSizePDF.Height() );
+ rWriter.SetMapMode( rMtf.GetPrefMapMode() );
+ vcl::PDFWriter::PlayMetafileContext aCtx;
GDIMetaFile aMtf;
if( mbRemoveTransparencies )
{
@@ -957,14 +1035,6 @@ sal_Bool PDFExport::ImplExportPage( PDFWriter& rWriter, PDFExtOutDevData& rPDFEx
aCtx.m_nJPEGQuality = mnQuality;
- const Size aSizePDF( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_POINT ) );
- Point aOrigin;
- Rectangle aPageRect( aOrigin, rMtf.GetPrefSize() );
- sal_Bool bRet = sal_True;
-
- rWriter.NewPage( aSizePDF.Width(), aSizePDF.Height() );
- rWriter.SetMapMode( rMtf.GetPrefMapMode() );
-
basegfx::B2DRectangle aB2DRect( aPageRect.Left(), aPageRect.Top(), aPageRect.Right(), aPageRect.Bottom() );
rWriter.SetClipRegion( basegfx::B2DPolyPolygon( basegfx::tools::createPolygonFromRect( aB2DRect ) ) );
diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx
index 71bee383133c..5b07a50765b1 100644
--- a/filter/source/pdf/pdfexport.hxx
+++ b/filter/source/pdf/pdfexport.hxx
@@ -56,6 +56,7 @@ private:
Reference< XComponent > mxSrcDoc;
Reference< lang::XMultiServiceFactory > mxMSF;
Reference< task::XStatusIndicator > mxStatusIndicator;
+ Reference< task::XInteractionHandler > mxIH;
sal_Bool mbUseTaggedPDF;
sal_Int32 mnPDFTypeSelection;
@@ -98,9 +99,7 @@ private:
sal_Bool mbFirstPageLeft;
sal_Bool mbEncrypt;
- rtl::OUString msOpenPassword;
sal_Bool mbRestrictPermissions;
- rtl::OUString msPermissionPassword;
sal_Int32 mnPrintAllowed;
sal_Int32 mnChangesAllowed;
sal_Bool mbCanCopyOrExtract;
@@ -120,7 +119,10 @@ private:
void ImplWriteWatermark( ::vcl::PDFWriter& rWriter, const Size& rPageSize );
public:
- PDFExport( const Reference< XComponent >& rxSrcDoc, Reference< task::XStatusIndicator >& xStatusIndicator, const Reference< lang::XMultiServiceFactory >& xFact );
+ PDFExport( const Reference< XComponent >& rxSrcDoc,
+ const Reference< task::XStatusIndicator >& xStatusIndicator,
+ const Reference< task::XInteractionHandler >& xIH,
+ const Reference< lang::XMultiServiceFactory >& xFact );
~PDFExport();
sal_Bool ExportSelection( vcl::PDFWriter& rPDFWriter, Reference< com::sun::star::view::XRenderable >& rRenderable, Any& rSelection,
diff --git a/filter/source/pdf/pdffilter.component b/filter/source/pdf/pdffilter.component
index 36766b61eb97..438d697a77b1 100644
--- a/filter/source/pdf/pdffilter.component
+++ b/filter/source/pdf/pdffilter.component
@@ -34,4 +34,7 @@
<implementation name="com.sun.star.comp.PDF.PDFFilter">
<service name="com.sun.star.document.PDFFilter"/>
</implementation>
+ <implementation name="com.sun.star.comp.PDF.PDFExportInteractionHandler">
+ <service name="com.sun.star.filter.pdfexport.PDFExportInteractionHandler"/>
+ </implementation>
</component>
diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index 0c08be6d8a66..0abb2eb1d3da 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -60,6 +60,7 @@ sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
const PropertyValue* pValue = rDescriptor.getConstArray();
sal_Bool bRet = sal_False;
Reference< task::XStatusIndicator > xStatusIndicator;
+ Reference< task::XInteractionHandler > xIH;
for ( sal_Int32 i = 0 ; ( i < nLength ) && !xOStm.is(); ++i)
{
@@ -69,6 +70,8 @@ sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
pValue[ i ].Value >>= aFilterData;
else if ( pValue[ i ].Name.equalsAscii( "StatusIndicator" ) )
pValue[ i ].Value >>= xStatusIndicator;
+ else if( pValue[i].Name.equalsAscii( "InteractionHandler" ) )
+ pValue[i].Value >>= xIH;
}
/* we don't get FilterData if we are exporting directly
@@ -117,7 +120,7 @@ sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
}
if( mxSrcDoc.is() && xOStm.is() )
{
- PDFExport aExport( mxSrcDoc, xStatusIndicator, mxMSF );
+ PDFExport aExport( mxSrcDoc, xStatusIndicator, xIH, mxMSF );
::utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
diff --git a/filter/source/pdf/pdffilter.hxx b/filter/source/pdf/pdffilter.hxx
index b4720c1627c7..ea223496522e 100644
--- a/filter/source/pdf/pdffilter.hxx
+++ b/filter/source/pdf/pdffilter.hxx
@@ -42,6 +42,7 @@
#include <com/sun/star/beans/XPropertyAccess.hpp>
#include <comphelper/property.hxx>
#include <com/sun/star/task/XStatusIndicator.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
#include <osl/diagnose.h>
#include <rtl/process.h>
diff --git a/filter/source/pdf/pdfinteract.cxx b/filter/source/pdf/pdfinteract.cxx
new file mode 100644
index 000000000000..23ea98d6bf51
--- /dev/null
+++ b/filter/source/pdf/pdfinteract.cxx
@@ -0,0 +1,137 @@
+ /*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_filter.hxx"
+
+#include "pdfinteract.hxx"
+#include "impdialog.hxx"
+
+#include "com/sun/star/task/XInteractionRequest.hpp"
+#include "com/sun/star/task/PDFExportException.hpp"
+
+// -------------
+// - PDFInteractionHandler -
+// -------------
+
+PDFInteractionHandler::PDFInteractionHandler( const Reference< XMultiServiceFactory > &rxMSF ) :
+ mxMSF( rxMSF )
+{
+}
+
+// -----------------------------------------------------------------------------
+
+PDFInteractionHandler::~PDFInteractionHandler()
+{
+}
+
+
+void SAL_CALL PDFInteractionHandler::handle( const Reference< task::XInteractionRequest >& i_xRequest )
+ throw (RuntimeException)
+{
+ handleInteractionRequest( i_xRequest );
+}
+
+sal_Bool SAL_CALL PDFInteractionHandler::handleInteractionRequest( const Reference< task::XInteractionRequest >& i_xRequest )
+ throw (RuntimeException)
+{
+ sal_Bool bHandled = sal_False;
+
+ Any aRequest( i_xRequest->getRequest() );
+ task::PDFExportException aExc;
+ if( aRequest >>= aExc )
+ {
+ std::set< vcl::PDFWriter::ErrorCode > aCodes;
+ sal_Int32 nCodes = aExc.ErrorCodes.getLength();
+ for( sal_Int32 i = 0; i < nCodes; i++ )
+ aCodes.insert( (vcl::PDFWriter::ErrorCode)aExc.ErrorCodes.getConstArray()[i] );
+ ImplErrorDialog aDlg( aCodes );
+ aDlg.Execute();
+ bHandled = sal_True;
+ }
+ return bHandled;
+}
+
+// -----------------------------------------------------------------------------
+
+OUString PDFInteractionHandler_getImplementationName ()
+ throw (RuntimeException)
+{
+ return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.PDF.PDFExportInteractionHandler" ) );
+}
+
+// -----------------------------------------------------------------------------
+
+#define SERVICE_NAME "com.sun.star.filter.pdfexport.PDFExportInteractionHandler"
+
+sal_Bool SAL_CALL PDFInteractionHandler_supportsService( const OUString& ServiceName )
+ throw (RuntimeException)
+{
+ return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) );
+}
+
+// -----------------------------------------------------------------------------
+
+Sequence< OUString > SAL_CALL PDFInteractionHandler_getSupportedServiceNames( ) throw (RuntimeException)
+{
+ Sequence < OUString > aRet(1);
+ OUString* pArray = aRet.getArray();
+ pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
+ return aRet;
+}
+
+#undef SERVICE_NAME
+
+// -----------------------------------------------------------------------------
+
+Reference< XInterface > SAL_CALL PDFInteractionHandler_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception )
+{
+ return (cppu::OWeakObject*) new PDFInteractionHandler( rSMgr );
+}
+
+// -----------------------------------------------------------------------------
+
+OUString SAL_CALL PDFInteractionHandler::getImplementationName()
+ throw (RuntimeException)
+{
+ return PDFInteractionHandler_getImplementationName();
+}
+
+// -----------------------------------------------------------------------------
+
+sal_Bool SAL_CALL PDFInteractionHandler::supportsService( const OUString& rServiceName )
+ throw (RuntimeException)
+{
+ return PDFInteractionHandler_supportsService( rServiceName );
+}
+
+// -----------------------------------------------------------------------------
+
+::com::sun::star::uno::Sequence< OUString > SAL_CALL PDFInteractionHandler::getSupportedServiceNames( ) throw (RuntimeException)
+{
+ return PDFInteractionHandler_getSupportedServiceNames();
+}
diff --git a/filter/source/pdf/pdfinteract.hxx b/filter/source/pdf/pdfinteract.hxx
new file mode 100644
index 000000000000..4cffc70c962a
--- /dev/null
+++ b/filter/source/pdf/pdfinteract.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef PDFINTERACT_HXX
+#define PDFINTERACT_HXX
+
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "cppuhelper/implbase2.hxx"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/task/XInteractionHandler2.hpp"
+
+using namespace ::rtl;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+
+// -------------
+// - PDFFilter -
+// -------------
+
+class PDFInteractionHandler : public cppu::WeakImplHelper2 < task::XInteractionHandler2,
+ XServiceInfo >
+{
+private:
+
+ Reference< XMultiServiceFactory > mxMSF;
+
+protected:
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(RuntimeException);
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException);
+
+ // XIniteractionHandler
+ virtual void SAL_CALL handle( const Reference< task::XInteractionRequest >& ) throw(RuntimeException);
+
+ // XIniteractionHandler2
+ virtual sal_Bool SAL_CALL handleInteractionRequest( const Reference< task::XInteractionRequest >& ) throw(RuntimeException);
+public:
+
+ PDFInteractionHandler( const Reference< XMultiServiceFactory >& rxMSF );
+ virtual ~PDFInteractionHandler();
+};
+
+// -----------------------------------------------------------------------------
+
+OUString PDFInteractionHandler_getImplementationName ()
+ throw ( RuntimeException );
+
+// -----------------------------------------------------------------------------
+
+sal_Bool SAL_CALL PDFInteractionHandler_supportsService( const OUString& ServiceName )
+ throw ( RuntimeException );
+
+// -----------------------------------------------------------------------------
+
+Sequence< OUString > SAL_CALL PDFInteractionHandler_getSupportedServiceNames( )
+ throw ( RuntimeException );
+
+// -----------------------------------------------------------------------------
+
+Reference< XInterface >
+SAL_CALL PDFInteractionHandler_createInstance( const Reference< XMultiServiceFactory > & rSMgr)
+ throw ( Exception );
+
+#endif // PDFINTERACT_HXX
+
diff --git a/filter/source/pdf/pdfuno.cxx b/filter/source/pdf/pdfuno.cxx
index 78bfff4c89f7..69b3d7a1ebc2 100644
--- a/filter/source/pdf/pdfuno.cxx
+++ b/filter/source/pdf/pdfuno.cxx
@@ -36,6 +36,7 @@
#include <pdffilter.hxx>
#include <pdfdialog.hxx>
+#include <pdfinteract.hxx>
using namespace ::rtl;
using namespace ::cppu;
@@ -76,6 +77,13 @@ extern "C"
PDFDialog_createInstance, PDFDialog_getSupportedServiceNames() );
}
+ else if( aImplName.equals( PDFInteractionHandler_getImplementationName() ) )
+ {
+ xFactory = createSingleFactory( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ),
+ OUString::createFromAscii( pImplName ),
+ PDFInteractionHandler_createInstance, PDFInteractionHandler_getSupportedServiceNames() );
+
+ }
if( xFactory.is() )
{
diff --git a/jfreereport/java/flute/makefile.mk b/jfreereport/java/flute/makefile.mk
index 9444d75fb692..413b951d1961 100644
--- a/jfreereport/java/flute/makefile.mk
+++ b/jfreereport/java/flute/makefile.mk
@@ -29,29 +29,29 @@ PRJ=..$/..
PRJNAME=jfreereport
TARGET=flute
-VERSION=-1.3.0
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : antsettings.mk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)" != ""
# --- Files --------------------------------------------------------
.IF "$(L10N_framework)"==""
-TARFILE_NAME=$(TARGET)
-TARFILE_MD5=f3e2febd267c8e4b13df00dac211dd6d
-TARFILE_ROOTDIR=$(TARGET)
-# PATCH_FILES=$(PRJ)$/patches$/$(TARGET).patch
-# CONVERTFILES=build.xml
-
+TARFILE_NAME=$(TARGET)-$(FLUTE_VERSION)
+TARFILE_MD5=d8bd5eed178db6e2b18eeed243f85aa8
+# TARFILE_ROOTDIR=$(TARGET)
+TARFILE_IS_FLAT=true
+PATCH_FILES=$(PACKAGE_DIR)$/$(TARGET).patch
+CONVERTFILES=common_build.xml
.IF "$(JAVACISGCJ)"=="yes"
JAVA_HOME=
.EXPORT : JAVA_HOME
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(FLUTE_VERSION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
.ELSE
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(FLUTE_VERSION)" -f $(ANT_BUILDFILE) jar
.ENDIF
.ENDIF # $(SOLAR_JAVA)!= ""
@@ -65,9 +65,15 @@ BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)"
.IF "$(SOLAR_JAVA)" != ""
.INCLUDE : tg_ext.mk
.IF "$(L10N_framework)"==""
-ALLTAR : $(CLASSDIR)$/$(TARGET)$(VERSION).jar
-$(CLASSDIR)$/$(TARGET)$(VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
- $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+ALLTAR : $(CLASSDIR)$/$(TARGET)-$(FLUTE_VERSION).jar
+
+$(PACKAGE_DIR)$/$(TARGET).patch :
+ @-$(MKDIRHIER) $(PACKAGE_DIR)$(fake_root_dir)
+ ( $(TYPE:s/+//) $(PRJ)$/patches$/common_build.patch | $(SED) 's/libloader-1.1.3/$(TARGET)-$(FLUTE_VERSION)/g' > $(PACKAGE_DIR)$/$(TARGET).patch )
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)$/so_converted_$(TARGET).dummy
+
+$(CLASSDIR)$/$(TARGET)-$(FLUTE_VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+ $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/dist$/$(TARGET)-$(FLUTE_VERSION).jar $(CLASSDIR)$/$(TARGET)-$(FLUTE_VERSION).jar
.ENDIF
.ENDIF
diff --git a/jfreereport/java/jfreereport/makefile.mk b/jfreereport/java/jfreereport/makefile.mk
index b527d28973e9..483400d23233 100644
--- a/jfreereport/java/jfreereport/makefile.mk
+++ b/jfreereport/java/jfreereport/makefile.mk
@@ -29,21 +29,20 @@ PRJ=..$/..
PRJNAME=jfreereport
TARGET=flow-engine
-VERSION=-0.9.2
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : antsettings.mk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)" != ""
# --- Files --------------------------------------------------------
.IF "$(L10N_framework)"==""
-TARFILE_NAME=core
-TARFILE_MD5=d4c4d91ab3a8e52a2e69d48d34ef4df4
-TARFILE_ROOTDIR=core
+TARFILE_NAME=$(TARGET)-$(FLOW_ENGINE_VERSION)
+TARFILE_IS_FLAT=true
+TARFILE_MD5=ba2930200c9f019c2d93a8c88c651a0f
PATCH_FILES=$(PRJ)$/patches$/$(TARGET).patch
-# ADDITIONAL_FILES=MANIFEST.MF
CONVERTFILES=build.xml
.IF "$(JAVACISGCJ)"=="yes"
@@ -64,8 +63,8 @@ BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)"
.IF "$(SOLAR_JAVA)" != ""
.INCLUDE : tg_ext.mk
.IF "$(L10N_framework)"==""
-ALLTAR : $(CLASSDIR)$/$(TARGET)$(VERSION).jar
-$(CLASSDIR)$/$(TARGET)$(VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
- $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+ALLTAR : $(CLASSDIR)$/$(TARGET)-$(FLOW_ENGINE_VERSION).jar
+$(CLASSDIR)$/$(TARGET)-$(FLOW_ENGINE_VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+ $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)-$(FLOW_ENGINE_VERSION).jar
.ENDIF
.ENDIF
diff --git a/jfreereport/java/libbase/makefile.mk b/jfreereport/java/libbase/makefile.mk
index 1cbfc11de0da..bcbe1e68e956 100644
--- a/jfreereport/java/libbase/makefile.mk
+++ b/jfreereport/java/libbase/makefile.mk
@@ -29,28 +29,29 @@ PRJ=..$/..
PRJNAME=jfreereport
TARGET=libbase
-VERSION=-1.0.0
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : antsettings.mk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)" != ""
# --- Files --------------------------------------------------------
-TARFILE_NAME=$(TARGET)
-TARFILE_MD5=8ea307d71d11140574bfb9fcc2487e33
-TARFILE_ROOTDIR=$(TARGET)
+TARFILE_NAME=$(TARGET)-$(LIBBASE_VERSION)
+TARFILE_MD5=eeb2c7ddf0d302fba4bfc6e97eac9624
+#TARFILE_ROOTDIR=$(TARGET)
+TARFILE_IS_FLAT=true
-# PATCH_FILES=$(PRJ)$/patches$/libbase.patch
-# CONVERTFILES=build.xml
+PATCH_FILES=$(PACKAGE_DIR)$/$(TARGET).patch
+CONVERTFILES=common_build.xml
.IF "$(JAVACISGCJ)"=="yes"
JAVA_HOME=
.EXPORT : JAVA_HOME
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBBASE_VERSION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
.ELSE
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBBASE_VERSION)" -f $(ANT_BUILDFILE) jar
.ENDIF
.ENDIF # $(SOLAR_JAVA)!= ""
@@ -64,8 +65,13 @@ BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)"
.IF "$(L10N_framework)"==""
.INCLUDE : tg_ext.mk
-ALLTAR : $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+ALLTAR : $(CLASSDIR)$/$(TARGET)-$(LIBBASE_VERSION).jar
+$(PACKAGE_DIR)$/$(TARGET).patch :
+ @-$(MKDIRHIER) $(PACKAGE_DIR)$(fake_root_dir)
+ ( $(TYPE:s/+//) $(PRJ)$/patches$/common_build.patch | $(SED) 's/libloader-1.1.3/$(TARGET)-$(LIBBASE_VERSION)/g' > $(PACKAGE_DIR)$/$(TARGET).patch )
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)$/so_converted_$(TARGET).dummy
+
# XCLASSPATH/CLASSPATH does not work and we only can give lib once. But
# the build.xmls fortunately take *.jar out of lib so we can copy our
# commons-logging.jar here - yes, even in the system-apache commons case.
@@ -79,7 +85,7 @@ $(CLASSDIR)$/commons-logging.jar :
$(COPY) $(COMMONS_LOGGING_JAR) $(CLASSDIR)$/commons-logging.jar
.ENDIF
-$(CLASSDIR)$/$(TARGET)$(VERSION).jar : $(CLASSDIR)$/commons-logging.jar $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
- $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+$(CLASSDIR)$/$(TARGET)-$(LIBBASE_VERSION).jar : $(CLASSDIR)$/commons-logging.jar $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+ $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/dist$/$(TARGET)-$(LIBBASE_VERSION).jar $(CLASSDIR)$/$(TARGET)-$(LIBBASE_VERSION).jar
.ENDIF
.ENDIF
diff --git a/jfreereport/java/libfonts/makefile.mk b/jfreereport/java/libfonts/makefile.mk
index f59b3cc0963f..2c7e60e9e48a 100644
--- a/jfreereport/java/libfonts/makefile.mk
+++ b/jfreereport/java/libfonts/makefile.mk
@@ -29,28 +29,28 @@ PRJ=..$/..
PRJNAME=jfreereport
TARGET=libfonts
-VERSION=-1.0.0
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : antsettings.mk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)" != ""
# --- Files --------------------------------------------------------
.IF "$(L10N_framework)"==""
-TARFILE_NAME=$(TARGET)
-TARFILE_MD5=f7925ba8491fe570e5164d2c72791358
-TARFILE_ROOTDIR=$(TARGET)
-PATCH_FILES=$(PRJ)$/patches$/$(TARGET).patch
-CONVERTFILES=build.xml
+TARFILE_NAME=$(TARGET)-$(LIBFONTS_VERSION)
+TARFILE_IS_FLAT=true
+TARFILE_MD5=3bdf40c0d199af31923e900d082ca2dd
+PATCH_FILES=$(PACKAGE_DIR)$/$(TARGET).patch
+CONVERTFILES=common_build.xml
.IF "$(JAVACISGCJ)"=="yes"
JAVA_HOME=
.EXPORT : JAVA_HOME
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBFONTS_VERSION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
.ELSE
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBFONTS_VERSION)" -f $(ANT_BUILDFILE) jar
.ENDIF
.ENDIF # $(SOLAR_JAVA)!= ""
@@ -63,9 +63,15 @@ BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)"
.IF "$(SOLAR_JAVA)" != ""
.INCLUDE : tg_ext.mk
-ALLTAR : $(CLASSDIR)$/$(TARGET)$(VERSION).jar
-$(CLASSDIR)$/$(TARGET)$(VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
- $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+ALLTAR : $(CLASSDIR)$/$(TARGET)-$(LIBFONTS_VERSION).jar
+
+$(PACKAGE_DIR)$/$(TARGET).patch :
+ @-$(MKDIRHIER) $(PACKAGE_DIR)$(fake_root_dir)
+ ( $(TYPE:s/+//) $(PRJ)$/patches$/common_build.patch | $(SED) 's/libloader-1.1.3/$(TARGET)-$(LIBFONTS_VERSION)/g' > $(PACKAGE_DIR)$/$(TARGET).patch )
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)$/so_converted_$(TARGET).dummy
+
+$(CLASSDIR)$/$(TARGET)-$(LIBFONTS_VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+ $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/dist$/$(TARGET)-$(LIBFONTS_VERSION).jar $(CLASSDIR)$/$(TARGET)-$(LIBFONTS_VERSION).jar
.ENDIF
.ENDIF
diff --git a/jfreereport/java/libformula/makefile.mk b/jfreereport/java/libformula/makefile.mk
index 4372ce2b764d..195130d1c2cc 100644
--- a/jfreereport/java/libformula/makefile.mk
+++ b/jfreereport/java/libformula/makefile.mk
@@ -29,30 +29,28 @@ PRJ=..$/..
PRJNAME=jfreereport
TARGET=libformula
-VERSION=-0.2.0
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : antsettings.mk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)" != ""
# --- Files --------------------------------------------------------
.IF "$(L10N_framework)"==""
-TARFILE_NAME=$(TARGET)
-TARFILE_MD5=d1a3205871c3c52e8a50c9f18510ae12
-TARFILE_ROOTDIR=$(TARGET)
-PATCH_FILES=$(PRJ)$/patches$/$(TARGET).patch
-CONVERTFILES=build.xml \
- source$/org$/pentaho$/reporting$/libraries$/formula$/function$/datetime$/DateDifFunction.java \
- source$/org$/pentaho$/reporting$/libraries$/formula$/lvalues$/FormulaFunction.java
+TARFILE_NAME=$(TARGET)-$(LIBFORMULA_VERSION)
+TARFILE_IS_FLAT=true
+TARFILE_MD5=3404ab6b1792ae5f16bbd603bd1e1d03
+PATCH_FILES=$(PACKAGE_DIR)$/$(TARGET).patch
+CONVERTFILES=common_build.xml
.IF "$(JAVACISGCJ)"=="yes"
JAVA_HOME=
.EXPORT : JAVA_HOME
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBFORMULA_VERSION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
.ELSE
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBFORMULA_VERSION)" -f $(ANT_BUILDFILE) jar
.ENDIF
@@ -66,9 +64,15 @@ BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)"
.IF "$(SOLAR_JAVA)" != ""
.INCLUDE : tg_ext.mk
-ALLTAR : $(CLASSDIR)$/$(TARGET)$(VERSION).jar
-$(CLASSDIR)$/$(TARGET)$(VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
- $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+ALLTAR : $(CLASSDIR)$/$(TARGET)-$(LIBFORMULA_VERSION).jar
+
+$(PACKAGE_DIR)$/$(TARGET).patch :
+ @-$(MKDIRHIER) $(PACKAGE_DIR)$(fake_root_dir)
+ ( $(TYPE:s/+//) $(PRJ)$/patches$/common_build.patch | $(SED) 's/libloader-1.1.3/$(TARGET)-$(LIBFORMULA_VERSION)/g' > $(PACKAGE_DIR)$/$(TARGET).patch )
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)$/so_converted_$(TARGET).dummy
+
+$(CLASSDIR)$/$(TARGET)-$(LIBFORMULA_VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+ $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/dist$/$(TARGET)-$(LIBFORMULA_VERSION).jar $(CLASSDIR)$/$(TARGET)-$(LIBFORMULA_VERSION).jar
.ENDIF
# $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/source$/org$/jfree$/formula$/function$/information$/IsRef-Function.properties :
diff --git a/jfreereport/java/liblayout/makefile.mk b/jfreereport/java/liblayout/makefile.mk
index 0340e43ccbd7..778b1b17c87f 100644
--- a/jfreereport/java/liblayout/makefile.mk
+++ b/jfreereport/java/liblayout/makefile.mk
@@ -29,19 +29,19 @@ PRJ=..$/..
PRJNAME=jfreereport
TARGET=liblayout
-VERSION=-0.2.9
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : antsettings.mk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)" != ""
# --- Files --------------------------------------------------------
.IF "$(L10N_framework)"==""
-TARFILE_NAME=$(TARGET)
-TARFILE_MD5=79600e696a98ff95c2eba976f7a8dfbb
-TARFILE_ROOTDIR=$(TARGET)
+TARFILE_NAME=$(TARGET)-$(LIBLAYOUT_VERSION)
+TARFILE_IS_FLAT=true
+TARFILE_MD5=db60e4fde8dd6d6807523deb71ee34dc
PATCH_FILES=$(PRJ)$/patches$/$(TARGET).patch
CONVERTFILES=build.xml
@@ -63,9 +63,9 @@ BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)"
.IF "$(SOLAR_JAVA)" != ""
.INCLUDE : tg_ext.mk
-ALLTAR : $(CLASSDIR)$/$(TARGET)$(VERSION).jar
-$(CLASSDIR)$/$(TARGET)$(VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
- $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+ALLTAR : $(CLASSDIR)$/$(TARGET)-$(LIBLAYOUT_VERSION).jar
+$(CLASSDIR)$/$(TARGET)-$(LIBLAYOUT_VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+ $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)-$(LIBLAYOUT_VERSION).jar
.ENDIF
.ENDIF
diff --git a/jfreereport/java/libloader/makefile.mk b/jfreereport/java/libloader/makefile.mk
index ce97b402d1dd..bb1b6f2e147e 100644
--- a/jfreereport/java/libloader/makefile.mk
+++ b/jfreereport/java/libloader/makefile.mk
@@ -29,28 +29,29 @@ PRJ=..$/..
PRJNAME=jfreereport
TARGET=libloader
-VERSION=-1.0.0
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : antsettings.mk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)" != ""
# --- Files --------------------------------------------------------
-TARFILE_NAME=$(TARGET)
-TARFILE_MD5=a06a496d7a43cbdc35e69dbe678efadb
-TARFILE_ROOTDIR=$(TARGET)
-PATCH_FILES=$(PRJ)$/patches$/$(TARGET).patch
-CONVERTFILES=build.xml
+TARFILE_NAME=$(TARGET)-$(LIBLOADER_VERSION)
+TARFILE_IS_FLAT=true
+TARFILE_MD5=97b2d4dba862397f446b217e2b623e71
+PATCH_FILES=$(PACKAGE_DIR)$/$(TARGET).patch
+CONVERTFILES=common_build.xml
+
.IF "$(L10N_framework)"==""
.IF "$(JAVACISGCJ)"=="yes"
JAVA_HOME=
.EXPORT : JAVA_HOME
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBLOADER_VERSION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
.ELSE
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBLOADER_VERSION)" -f $(ANT_BUILDFILE) jar
.ENDIF
.ENDIF # $(SOLAR_JAVA)!= ""
@@ -63,9 +64,15 @@ BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)"
.IF "$(SOLAR_JAVA)" != ""
.INCLUDE : tg_ext.mk
-ALLTAR : $(CLASSDIR)$/$(TARGET)$(VERSION).jar
-$(CLASSDIR)$/$(TARGET)$(VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
- $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+ALLTAR : $(CLASSDIR)$/$(TARGET)-$(LIBLOADER_VERSION).jar
+
+$(PACKAGE_DIR)$/$(TARGET).patch :
+ @-$(MKDIRHIER) $(PACKAGE_DIR)$(fake_root_dir)
+ ( $(TYPE:s/+//) $(PRJ)$/patches$/common_build.patch | $(SED) 's/libloader-1.1.3/$(TARGET)-$(LIBLOADER_VERSION)/g' > $(PACKAGE_DIR)$/$(TARGET).patch )
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)$/so_converted_$(TARGET).dummy
+
+$(CLASSDIR)$/$(TARGET)-$(LIBLOADER_VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+ $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/dist$/$(TARGET)-$(LIBLOADER_VERSION).jar $(CLASSDIR)$/$(TARGET)-$(LIBLOADER_VERSION).jar
.ENDIF
.ENDIF
diff --git a/jfreereport/java/librepository/makefile.mk b/jfreereport/java/librepository/makefile.mk
index e11639c7ae62..37da0755618a 100644
--- a/jfreereport/java/librepository/makefile.mk
+++ b/jfreereport/java/librepository/makefile.mk
@@ -29,28 +29,29 @@ PRJ=..$/..
PRJNAME=jfreereport
TARGET=librepository
-VERSION=-1.0.0
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : antsettings.mk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)" != ""
# --- Files --------------------------------------------------------
-TARFILE_NAME=$(TARGET)
-TARFILE_MD5=dbb3757275dc5cc80820c0b4dd24ed95
-TARFILE_ROOTDIR=$(TARGET)
-PATCH_FILES=$(PRJ)$/patches$/$(TARGET).patch
-CONVERTFILES=build.xml
+TARFILE_NAME=$(TARGET)-$(LIBREPOSITORY_VERSION)
+TARFILE_IS_FLAT=true
+TARFILE_MD5=8ce2fcd72becf06c41f7201d15373ed9
+PATCH_FILES=$(PACKAGE_DIR)$/$(TARGET).patch
+CONVERTFILES=common_build.xml
+
.IF "$(L10N_framework)"==""
.IF "$(JAVACISGCJ)"=="yes"
JAVA_HOME=
.EXPORT : JAVA_HOME
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBREPOSITORY_VERSION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
.ELSE
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBREPOSITORY_VERSION)" -f $(ANT_BUILDFILE) jar
.ENDIF
.ENDIF # $(SOLAR_JAVA)!= ""
@@ -63,9 +64,15 @@ BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)"
.IF "$(SOLAR_JAVA)" != ""
.INCLUDE : tg_ext.mk
-ALLTAR : $(CLASSDIR)$/$(TARGET)$(VERSION).jar
-$(CLASSDIR)$/$(TARGET)$(VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
- $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+ALLTAR : $(CLASSDIR)$/$(TARGET)-$(LIBREPOSITORY_VERSION).jar
+
+$(PACKAGE_DIR)$/$(TARGET).patch :
+ @-$(MKDIRHIER) $(PACKAGE_DIR)$(fake_root_dir)
+ ( $(TYPE:s/+//) $(PRJ)$/patches$/common_build.patch | $(SED) 's/libloader-1.1.3/$(TARGET)-$(LIBREPOSITORY_VERSION)/g' > $(PACKAGE_DIR)$/$(TARGET).patch )
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)$/so_converted_$(TARGET).dummy
+
+$(CLASSDIR)$/$(TARGET)-$(LIBREPOSITORY_VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+ $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/dist$/$(TARGET)-$(LIBREPOSITORY_VERSION).jar $(CLASSDIR)$/$(TARGET)-$(LIBREPOSITORY_VERSION).jar
.ENDIF
.ENDIF
diff --git a/jfreereport/java/libserializer/makefile.mk b/jfreereport/java/libserializer/makefile.mk
index 12a301edc9e6..170d3fa4c2c6 100644
--- a/jfreereport/java/libserializer/makefile.mk
+++ b/jfreereport/java/libserializer/makefile.mk
@@ -29,28 +29,28 @@ PRJ=..$/..
PRJNAME=jfreereport
TARGET=libserializer
-VERSION=-1.0.0
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : antsettings.mk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)" != ""
# --- Files --------------------------------------------------------
.IF "$(L10N_framework)"==""
-TARFILE_NAME=$(TARGET)
-TARFILE_MD5=5aba06ede2daa9f2c11892fbd7bc3057
-TARFILE_ROOTDIR=$(TARGET)
-PATCH_FILES=$(PRJ)$/patches$/$(TARGET).patch
-CONVERTFILES=build.xml
+TARFILE_NAME=$(TARGET)-$(LIBSERIALIZER_VERSION)
+TARFILE_IS_FLAT=true
+TARFILE_MD5=f94d9870737518e3b597f9265f4e9803
+PATCH_FILES=$(PACKAGE_DIR)$/$(TARGET).patch
+CONVERTFILES=common_build.xml
.IF "$(JAVACISGCJ)"=="yes"
JAVA_HOME=
.EXPORT : JAVA_HOME
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBSERIALIZER_VERSION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
.ELSE
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBSERIALIZER_VERSION)" -f $(ANT_BUILDFILE) jar
.ENDIF
.ENDIF # $(SOLAR_JAVA)!= ""
@@ -63,9 +63,15 @@ BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)"
.IF "$(SOLAR_JAVA)" != ""
.INCLUDE : tg_ext.mk
-ALLTAR : $(CLASSDIR)$/$(TARGET)$(VERSION).jar
-$(CLASSDIR)$/$(TARGET)$(VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
- $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+ALLTAR : $(CLASSDIR)$/$(TARGET)-$(LIBSERIALIZER_VERSION).jar
+
+$(PACKAGE_DIR)$/$(TARGET).patch :
+ @-$(MKDIRHIER) $(PACKAGE_DIR)$(fake_root_dir)
+ ( $(TYPE:s/+//) $(PRJ)$/patches$/common_build.patch | $(SED) 's/libloader-1.1.3/$(TARGET)-$(LIBSERIALIZER_VERSION)/g' > $(PACKAGE_DIR)$/$(TARGET).patch )
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)$/so_converted_$(TARGET).dummy
+
+$(CLASSDIR)$/$(TARGET)-$(LIBSERIALIZER_VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+ $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/dist$/$(TARGET)-$(LIBSERIALIZER_VERSION).jar $(CLASSDIR)$/$(TARGET)-$(LIBSERIALIZER_VERSION).jar
.ENDIF
.ENDIF
diff --git a/jfreereport/java/libxml/makefile.mk b/jfreereport/java/libxml/makefile.mk
index d0c8bb427103..356d05fc957e 100644
--- a/jfreereport/java/libxml/makefile.mk
+++ b/jfreereport/java/libxml/makefile.mk
@@ -29,28 +29,28 @@ PRJ=..$/..
PRJNAME=jfreereport
TARGET=libxml
-VERSION=-1.0.0
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : antsettings.mk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)" != ""
# --- Files --------------------------------------------------------
.IF "$(L10N_framework)"==""
-TARFILE_NAME=$(TARGET)
-TARFILE_MD5=67b42915c8432abf0a922438f00860a2
-TARFILE_ROOTDIR=$(TARGET)
-PATCH_FILES=$(PRJ)$/patches$/$(TARGET).patch
-CONVERTFILES=build.xml
+TARFILE_NAME=$(TARGET)-$(LIBXML_VERSION)
+TARFILE_IS_FLAT=true
+TARFILE_MD5=ace6ab49184e329db254e454a010f56d
+PATCH_FILES=$(PACKAGE_DIR)$/$(TARGET).patch
+CONVERTFILES=common_build.xml
.IF "$(JAVACISGCJ)"=="yes"
JAVA_HOME=
.EXPORT : JAVA_HOME
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBXML_VERSION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
.ELSE
-BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dbuild.id="10682" -Dproject.revision="$(LIBXML_VERSION)" -f $(ANT_BUILDFILE) jar
.ENDIF
.ENDIF # $(SOLAR_JAVA)!= ""
@@ -63,9 +63,15 @@ BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)"
.IF "$(SOLAR_JAVA)" != ""
.INCLUDE : tg_ext.mk
-ALLTAR : $(CLASSDIR)$/$(TARGET)$(VERSION).jar
-$(CLASSDIR)$/$(TARGET)$(VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
- $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/build$/lib$/$(TARGET).jar $(CLASSDIR)$/$(TARGET)$(VERSION).jar
+ALLTAR : $(CLASSDIR)$/$(TARGET)-$(LIBXML_VERSION).jar
+
+$(PACKAGE_DIR)$/$(TARGET).patch :
+ @-$(MKDIRHIER) $(PACKAGE_DIR)$(fake_root_dir)
+ ( $(TYPE:s/+//) $(PRJ)$/patches$/common_build.patch | $(SED) 's/libloader-1.1.3/$(TARGET)-$(LIBXML_VERSION)/g' > $(PACKAGE_DIR)$/$(TARGET).patch )
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)$/so_converted_$(TARGET).dummy
+
+$(CLASSDIR)$/$(TARGET)-$(LIBXML_VERSION).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+ $(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/dist$/$(TARGET)-$(LIBXML_VERSION).jar $(CLASSDIR)$/$(TARGET)-$(LIBXML_VERSION).jar
.ENDIF
.ENDIF
diff --git a/jfreereport/java/sac/makefile.mk b/jfreereport/java/sac/makefile.mk
index 44cb28435142..01d6186fd36d 100644
--- a/jfreereport/java/sac/makefile.mk
+++ b/jfreereport/java/sac/makefile.mk
@@ -58,9 +58,9 @@ ADDITIONAL_FILES=build.xml
.IF "$(JAVACISGCJ)"=="yes"
JAVA_HOME=
.EXPORT : JAVA_HOME
-BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) all
+BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dproject.revision="$(VERSION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) all
.ELSE
-BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) all
+BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dantcontrib.available="true" -Dproject.revision="$(VERSION)" -f $(ANT_BUILDFILE) all
.ENDIF
.ENDIF # $(SOLAR_JAVA)!= ""
diff --git a/jfreereport/patches/common_build.patch b/jfreereport/patches/common_build.patch
new file mode 100755
index 000000000000..3d5330b9e383
--- /dev/null
+++ b/jfreereport/patches/common_build.patch
@@ -0,0 +1,76 @@
+--- misc/libloader-1.1.3/common_build.xml 2009-11-16 10:25:34.000000000 +0100
++++ misc/build/libloader-1.1.3/common_build.xml 2009-12-04 10:22:24.277647200 +0100
+@@ -497,7 +497,7 @@
+ Sets a property build.id to the either "development" or the svn revision
+ if in release mode
+ ====================================================================-->
+- <target name="set-build.id" unless="build.id" depends="install-antcontrib">
++ <target name="set-build.id" unless="build.id" >
+ <if>
+ <istrue value="${release}" />
+ <then>
+@@ -1061,6 +1061,11 @@
+ Performs the actual compile
+ ====================================================================-->
+ <target name="compile.compile" depends="init">
++ <copy todir="${classes.dir}">
++ <fileset dir="source">
++ <include name="**/*.properties"/>
++ </fileset>
++ </copy>
+ <javac destdir="${classes.dir}"
+ debug="${javac.debug}"
+ deprecation="${javac.deprecation}"
+@@ -1082,27 +1082,32 @@
+ duplicate copying of resources from src tree (handled by compile.src_copy
+ if jar.include.source is set.
+ ====================================================================-->
+- <target name="compile.res_copy" depends="install-antcontrib">
+- <if>
+- <available file="${res.dir}" />
+- <then>
+- <copy todir="${classes.dir}">
+- <fileset dir="${res.dir}" />
+- </copy>
+- </then>
+- </if>
++ <target name="compile.res_copy" >
++ <condition property="copy.res.available">
++ <available file="$(res.dir)" type="dir" />
++ </condition>
++ <antcall target="copy.res" />
+
+- <if>
+- <not>
+- <isset property="jar.include.source" />
+- </not>
+- <then>
+- <copy todir="${classes.dir}" flatten="false">
+- <fileset dir="${src.dir}" excludes="**/*.java" />
+- </copy>
+- </then>
+- </if>
+- </target>
++ <condition property="copy.res.class.available">
++ <not>
++ <isset property="jar.include.source" />
++ </not>
++ </condition>
++ <antcall target="copy.res.class" />
++ </target>
++
++ <target name="copy.res" if="copy.res.available" >
++ <copy todir="${classes.dir}">
++ <fileset dir="${res.dir}"/>
++ </copy>
++ </target>
++
++ <target name="copy.res.class" if="copy.res.class.available" >
++ <uptodate targetfile="${classes.dir}" property="s">
++ <srcfiles dir= "${src.dir}" excludes="**/*.java" />
++ <flattenmapper/>
++ </uptodate>
++ </target>
+
+
+ <!--=======================================================================
diff --git a/jfreereport/patches/flow-engine.patch b/jfreereport/patches/flow-engine.patch
index 13da432113fb..aef70cb7fef6 100644
--- a/jfreereport/patches/flow-engine.patch
+++ b/jfreereport/patches/flow-engine.patch
@@ -1,5 +1,5 @@
---- misc/core/build.xml (Revision 6728)
-+++ misc/build/core/build.xml (Arbeitskopie)
+--- misc/flow-engine-0.9.4/build.xml (Revision 6728)
++++ misc/build/flow-engine-0.9.4/build.xml (Arbeitskopie)
@@ -24,6 +24,6 @@
<!-- Setup the compile classpath -->
<path id="classpath">
diff --git a/jfreereport/patches/flute.patch b/jfreereport/patches/flute.patch
deleted file mode 100644
index aad7756c3b65..000000000000
--- a/jfreereport/patches/flute.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- misc/flute/build.xml (Revision 6820)
-+++ misc/build/flute/build.xml (Arbeitskopie)
-@@ -9,6 +9,7 @@
- <property name="build.doc" value="${build}/api"/>
- <property name="build.lib" value="${build}/lib"/>
- <property name="packagenames" value="org.w3c.flute.*"/>
-+ <property name="lib" value="lib"/>
-
- <!-- Targets -->
- <!-- Prepare build directories -->
-@@ -21,7 +22,7 @@
-
- <!-- Setup the compile classpath -->
- <path id="classpath">
-- <fileset dir="lib">
-+ <fileset dir="${lib}">
- <include name="*.jar" />
- </fileset>
- </path>
diff --git a/jfreereport/patches/libbase.patch b/jfreereport/patches/libbase.patch
deleted file mode 100644
index f6a7560de145..000000000000
--- a/jfreereport/patches/libbase.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- misc/libbase/build.xml (Revision 6728)
-+++ misc/build/libbase/build.xml (Arbeitskopie)
-@@ -6,6 +6,7 @@
- <property name="build.classes" value="${build}/classes"/>
- <property name="build.doc" value="${build}/api"/>
- <property name="build.lib" value="${build}/lib"/>
-+ <property name="lib" value="lib"/>
-
- <!-- Targets -->
- <!-- Prepare build directories -->
-@@ -18,7 +19,7 @@
-
- <!-- Setup the compile classpath -->
- <path id="classpath">
-- <fileset dir="lib">
-+ <fileset dir="${lib}">
- <include name="*.jar" />
- </fileset>
- </path>
diff --git a/jfreereport/patches/libfonts.patch b/jfreereport/patches/libfonts.patch
deleted file mode 100644
index 63c5a1a48f93..000000000000
--- a/jfreereport/patches/libfonts.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- misc/libfonts/build.xml (Revision 6728)
-+++ misc/build/libfonts/build.xml (Arbeitskopie)
-@@ -23,6 +23,6 @@
- <!-- Setup the compile classpath -->
- <path id="classpath">
-- <fileset dir="lib">
-+ <fileset dir="${lib}">
- <include name="*.jar" />
- </fileset>
- </path>
diff --git a/jfreereport/patches/libformula.patch b/jfreereport/patches/libformula.patch
deleted file mode 100644
index 07968b448675..000000000000
--- a/jfreereport/patches/libformula.patch
+++ /dev/null
@@ -1,27 +0,0 @@
---- misc/libformula/source/org/pentaho/reporting/libraries/formula/function/datetime/DateDifFunction.java 2008-12-12 13:04:46.000000000 +0100
-+++ misc/build/libformula/source/org/pentaho/reporting/libraries/formula/function/datetime/DateDifFunction.java 2008-12-15 08:15:18.293125000 +0100
-@@ -198,12 +198,6 @@
- LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
- }
-
-- if (res < 0)
-- {
-- throw new EvaluationException(
-- LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
-- }
--
- //noinspection UnpredictableBigDecimalConstructorCall
- return new TypeValuePair(NumberType.GENERIC_NUMBER, new BigDecimal((double) res));
- }
---- misc/libformula/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java 2008-12-12 13:04:46.000000000 +0100
-+++ misc/build/libformula/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java 2008-12-15 08:13:14.308750000 +0100
-@@ -161,7 +161,8 @@
-
- for (int i = 0; i < parameters.length; i++)
- {
-- parameters[i].initialize(context);
-+ if ( parameters[i] != null )
-+ parameters[i].initialize(context);
- }
- }
-
diff --git a/jfreereport/patches/liblayout.patch b/jfreereport/patches/liblayout.patch
index ef9cb5bb06b3..4b1c23100987 100644
--- a/jfreereport/patches/liblayout.patch
+++ b/jfreereport/patches/liblayout.patch
@@ -1,5 +1,5 @@
---- misc/liblayout/build.xml (Revision 6728)
-+++ misc/build/liblayout/build.xml (Arbeitskopie)
+--- misc/liblayout-0.2.10/build.xml (Revision 6728)
++++ misc/build/liblayout-0.2.10/build.xml (Arbeitskopie)
@@ -24,6 +24,6 @@
<!-- Setup the compile classpath -->
<path id="classpath">
diff --git a/jfreereport/patches/libloader.patch b/jfreereport/patches/libloader.patch
deleted file mode 100644
index 82a2624855a9..000000000000
--- a/jfreereport/patches/libloader.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- misc/libloader/build.xml 2009-02-12 18:01:56.000000000 +0100
-+++ misc/build/libloader/build.xml 2009-02-13 09:57:21.856601684 +0100
-@@ -23,7 +23,7 @@
-
- <!-- Setup the compile classpath -->
- <path id="classpath">
-- <fileset dir="lib">
-+ <fileset dir="${lib}">
- <include name="*.jar" />
- </fileset>
- </path>
diff --git a/jfreereport/patches/librepository.patch b/jfreereport/patches/librepository.patch
deleted file mode 100644
index 8a981595798c..000000000000
--- a/jfreereport/patches/librepository.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- misc/librepository/build.xml (Revision 6728)
-+++ misc/build/librepository/build.xml (Arbeitskopie)
-@@ -24,6 +24,6 @@
- <!-- Setup the compile classpath -->
- <path id="classpath">
-- <fileset dir="lib">
-+ <fileset dir="${lib}">
- <include name="*.jar" />
- </fileset>
- </path>
diff --git a/jfreereport/patches/libserializer.patch b/jfreereport/patches/libserializer.patch
deleted file mode 100644
index 830fdb9ca348..000000000000
--- a/jfreereport/patches/libserializer.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- misc/libserializer/build.xml (Revision 6728)
-+++ misc/build/libserializer/build.xml (Arbeitskopie)
-@@ -24,6 +24,6 @@
- <!-- Setup the compile classpath -->
- <path id="classpath">
-- <fileset dir="lib">
-+ <fileset dir="${lib}">
- <include name="*.jar" />
- </fileset>
- </path>
diff --git a/jfreereport/patches/libxml.patch b/jfreereport/patches/libxml.patch
deleted file mode 100644
index 50981a462de2..000000000000
--- a/jfreereport/patches/libxml.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- misc/libxml/build.xml (Revision 6728)
-+++ misc/build/libxml/build.xml (Arbeitskopie)
-@@ -24,6 +24,6 @@
- <!-- Setup the compile classpath -->
- <path id="classpath">
-- <fileset dir="lib">
-+ <fileset dir="${lib}">
- <include name="*.jar" />
- </fileset>
- </path>
diff --git a/jfreereport/prj/d.lst b/jfreereport/prj/d.lst
index a63f3a1312d5..2527cc676782 100644
--- a/jfreereport/prj/d.lst
+++ b/jfreereport/prj/d.lst
@@ -1 +1,2 @@
..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.jar
+..\version.mk %_DEST%\bin%_EXT%\jfreereport_version.mk
diff --git a/jfreereport/version.mk b/jfreereport/version.mk
new file mode 100644
index 000000000000..cd9a8053bbd9
--- /dev/null
+++ b/jfreereport/version.mk
@@ -0,0 +1,12 @@
+FLUTE_VERSION=1.1.6
+LIBBASE_VERSION=1.1.6
+LIBFONTS_VERSION=1.1.6
+LIBFORMAT_VERSION=1.1.6
+LIBFORMULA_VERSION=1.1.7
+LIBLAYOUT_VERSION=0.2.10
+LIBLOADER_VERSION=1.1.6
+LIBREPOSITORY_VERSION=1.1.6
+LIBSERIALIZER_VERSION=1.1.6
+LIBXML_VERSION=1.1.7
+FLOW_ENGINE_VERSION=0.9.4
+
diff --git a/jvmaccess/util/cc5_solaris_sparc.map b/jvmaccess/util/cc5_solaris_sparc.map
index bb59a648f4c5..e2cb767dc65e 100644
--- a/jvmaccess/util/cc5_solaris_sparc.map
+++ b/jvmaccess/util/cc5_solaris_sparc.map
@@ -25,7 +25,7 @@
#
#*************************************************************************
-UDK_3_0_0 {
+UDK_3.1 {
global:
# jvmaccess/virtualmachine.hxx:
__1cJjvmaccessOVirtualMachineLAttachGuardRCreationException2t6M_v_; # jvmaccess::VirtualMachine::AttachGuard::CreationException::CreationException()
@@ -52,7 +52,7 @@ UDK_3.2 {
__1cJjvmaccesscQ__RTTI__1CpnJjvmaccessOVirtualMachineLAttachGuardRCreationException__; # RTTI for jvmaccess::VirtualMachine::AttachGuard::CreationException *
__1cJjvmaccesscR__RTTI__1CpknJjvmaccessOVirtualMachineLAttachGuardRCreationException__; # RTTI for jvmaccess::VirtualMachine::AttachGuard::CreationException const *
__1cJjvmaccessOVirtualMachine2t5B6MpnHJavaVM__ibpnHJNIEnv___v_; # jvmaccess::VirtualMachine::VirtualMachine(JavaVM *, int, bool, JNIEnv *) #Nvariant 1
-} UDK_3_0_0;
+} UDK_3.1;
UDK_3.3 {
global:
diff --git a/jvmaccess/util/gcc3.map b/jvmaccess/util/gcc3.map
index 707645d2c829..330651a1cf6e 100644
--- a/jvmaccess/util/gcc3.map
+++ b/jvmaccess/util/gcc3.map
@@ -25,7 +25,7 @@
#
#*************************************************************************
-UDK_3_0_0 {
+UDK_3.1 {
global:
# jvmaccess/virtualmachine.hxx:
_ZN9jvmaccess14VirtualMachine11AttachGuard17CreationExceptionC1Ev; # jvmaccess::VirtualMachine::AttachGuard::CreationException::CreationException()
@@ -59,7 +59,7 @@ UDK_3.2 {
# We put the '*' at the beginning because its unlikely that these symbols will ever be a postfix of another symbol.
_*ZN9jvmaccess14VirtualMachineC1EP10_Jv_JavaVMibP10_Jv_JNIEnv; # jvmaccess::VirtualMachine::VirtualMachine(JavaVM *, int, bool, JNIEnv *)
_*ZN9jvmaccess14VirtualMachineC2EP10_Jv_JavaVMibP10_Jv_JNIEnv; # jvmaccess::VirtualMachine::VirtualMachine(JavaVM *, int, bool, JNIEnv *)
-} UDK_3_0_0;
+} UDK_3.1;
UDK_3.3 {
global:
diff --git a/jvmaccess/util/msvc_win32_intel.map b/jvmaccess/util/msvc_win32_intel.map
index 4620b1caa940..fd148b1892ba 100644
--- a/jvmaccess/util/msvc_win32_intel.map
+++ b/jvmaccess/util/msvc_win32_intel.map
@@ -1,4 +1,4 @@
-UDK_3_0_0 {
+UDK_3.1 {
global:
# jvmaccess/virtualmachine.hxx:
??0CreationException@AttachGuard@VirtualMachine@jvmaccess@@QAE@XZ; # jvmaccess::VirtualMachine::AttachGuard::CreationException::CreationException()
@@ -15,7 +15,7 @@ UDK_3_0_0 {
UDK_3.2 {
global:
-} UDK_3_0_0;
+} UDK_3.1;
UDK_3.3 {
global:
diff --git a/offapi/com/sun/star/document/MediaDescriptor.idl b/offapi/com/sun/star/document/MediaDescriptor.idl
index 36da721cc159..fa7ce3dc99c3 100644
--- a/offapi/com/sun/star/document/MediaDescriptor.idl
+++ b/offapi/com/sun/star/document/MediaDescriptor.idl
@@ -39,6 +39,10 @@
#include <com/sun/star/awt/Rectangle.idl>
#endif
+#ifndef __com_sun_star_beans_NamedValue_idl__
+#include <com/sun/star/beans/NamedValue.idl>
+#endif
+
#ifndef __com_sun_star_util_URL_idl__
#include <com/sun/star/util/URL.idl>
#endif
@@ -164,6 +168,23 @@ published service MediaDescriptor
[optional,property] string DocumentTitle;
//-------------------------------------------------------------------------
+ /** encryption information for encryption/decryption of documents
+
+ <p>
+ It contains the necessary information for encryption/decryption of
+ a component (if necessary).
+ If neither password nor encryption data is specified, loading of
+ a password protected document will fail, storing will be done without
+ encryption. If both are provided, the encryption data is used
+ ( if the filter supports it ).
+ </p>
+ <p>
+ The encryption data is generated based on the password.
+ </p>
+ */
+ [optional,property] sequence< ::com::sun::star::beans::NamedValue > EncryptionData;
+
+ //-------------------------------------------------------------------------
/** same as <member>MediaDescriptor::URL</member>
<p>
@@ -365,9 +386,11 @@ published service MediaDescriptor
/** pasword for loading storing documents
<p>
- It caontains a password for loading or storing a component (if necessary).
- If no password is specified, loading of a password protected document
- will fail, storing will be done without encryption.
+ It contains a password for loading or storing a component (if necessary).
+ If neither password nor encryption data is specified, loading of
+ a password protected document will fail, storing will be done without
+ encryption. If both are provided, the encryption data is used
+ ( if the filter supports it ).
</p>
*/
[optional,property] string Password;
diff --git a/offapi/com/sun/star/embed/XEncryptionProtectedSource2.idl b/offapi/com/sun/star/embed/XEncryptionProtectedSource2.idl
new file mode 100644
index 000000000000..e590a5764178
--- /dev/null
+++ b/offapi/com/sun/star/embed/XEncryptionProtectedSource2.idl
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef __com_sun_star_embed_XEncryptionProtectedSource2_idl__
+#define __com_sun_star_embed_XEncryptionProtectedSource2_idl__
+
+#ifndef __com_sun_star_embed_XEncryptionProtectedSource_idl__
+#include <com/sun/star/embed/XEncryptionProtectedSource.idl>
+#endif
+
+#ifndef __com_sun_star_beans_NamedValue_idl__
+#include <com/sun/star/beans/NamedValue.idl>
+#endif
+
+//============================================================================
+
+module com { module sun { module star { module embed {
+
+//============================================================================
+/** This interface allows to set a password for an object.
+ */
+published interface XEncryptionProtectedSource2: XEncryptionProtectedSource
+{
+ // -----------------------------------------------------------------------
+ /** sets an encryption data for the object.
+
+ @param aEncryptionData
+ the new encryption data
+
+ @throws ::com::sun::star::io::IOException
+ in case the data could not be set
+ */
+ void setEncryptionData( [in] sequence< ::com::sun::star::beans::NamedValue > aEncryptionData )
+ raises( ::com::sun::star::io::IOException );
+};
+
+//============================================================================
+
+}; }; }; };
+
+#endif
+
diff --git a/offapi/com/sun/star/embed/XHierarchicalStorageAccess2.idl b/offapi/com/sun/star/embed/XHierarchicalStorageAccess2.idl
new file mode 100644
index 000000000000..0df83ea33580
--- /dev/null
+++ b/offapi/com/sun/star/embed/XHierarchicalStorageAccess2.idl
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef __com_sun_star_embed_XHierarchicalStorageAccess2_idl__
+#define __com_sun_star_embed_XHierarchicalStorageAccess2_idl__
+
+#ifndef __com_sun_star_embed_XHierarchicalStorageAccess_idl__
+#include <com/sun/star/embed/XHierarchicalStorageAccess.idl>
+#endif
+
+#ifndef __com_sun_star_beans_NamedValue_idl__
+#include <com/sun/star/beans/NamedValue.idl>
+#endif
+
+//============================================================================
+
+ module com { module sun { module star { module embed {
+
+//============================================================================
+/** This interface extends XHierarchicalStorageAccess interface.
+ */
+interface XHierarchicalStorageAccess2 : XHierarchicalStorageAccess
+{
+ // -----------------------------------------------------------------------
+ /** allows to get access to a child encrypted stream with encryption data
+ using hierarchical path.
+
+ <p>
+ If storage does not allow any encryption this method will always throw
+ <type scope="com::sun::star::packages">NoEncryptionException</type>.
+ </p>
+
+ <p>
+ In case the stream is open in readonly mode the
+ <method scope="com::sun::star::io">XStream::getOutputStream</method>
+ method will return an empty reference.
+ </p>
+
+ @param sStreamPath
+ the path to the substream that should be open
+
+ @param nOpenMode
+ a mode the stream should be open in,
+ can be a combination of <type>ElementModes</type> values
+
+ @param aEncryptionData
+ this parameter allowes to specify an encryption data for the
+ stream, the data must be correct, otherwise an
+ exception will be thrown
+
+ @throws ::com::sun::star::embed::InvalidStorageException
+ this storage is in invalid state for any reason
+
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ one of provided arguments is illegal
+
+ @throws ::com::sun::star::packages::NoEncryptionException
+ the stream is not encrypted
+
+ @throws ::com::sun::star::packages::WrongPasswordException
+ the provided password is wrong
+
+ @throws ::com::sun::star::io::IOException
+ in case of io errors during stream opening
+
+ @throws ::com::sun::star::embed::StorageWrappedTargetException
+ wraps other exceptions
+ */
+ XExtendedStorageStream openEncryptedStreamByHierarchicalName(
+ [in] string sStreamName,
+ [in] long nOpenMode,
+ [in] sequence< ::com::sun::star::beans::NamedValue > aEncryptionData )
+ raises( ::com::sun::star::embed::InvalidStorageException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::packages::NoEncryptionException,
+ ::com::sun::star::packages::WrongPasswordException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::embed::StorageWrappedTargetException );
+};
+
+//============================================================================
+
+}; }; }; };
+
+#endif
+
diff --git a/offapi/com/sun/star/embed/XStorage2.idl b/offapi/com/sun/star/embed/XStorage2.idl
new file mode 100644
index 000000000000..cf4f9907b66e
--- /dev/null
+++ b/offapi/com/sun/star/embed/XStorage2.idl
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef __com_sun_star_embed_XStorage2_idl__
+#define __com_sun_star_embed_XStorage2_idl__
+
+#ifndef __com_sun_star_embed_XStorage_idl__
+#include <com/sun/star/embed/XStorage.idl>
+#endif
+
+#ifndef __com_sun_star_beans_NamedValue_idl__
+#include <com/sun/star/beans/NamedValue.idl>
+#endif
+
+
+//============================================================================
+
+ module com { module sun { module star { module embed {
+
+//============================================================================
+/** This interface extends the base XStorage interface.
+ */
+interface XStorage2 : XStorage
+{
+ // -----------------------------------------------------------------------
+ /** allows to get access to a child encrypted stream with EncryptionData.
+
+ <p>
+ If storage does not allow any encryption this method will always throw
+ <type scope="com::sun::star::packages">NoEncryptionException</type>.
+ </p>
+
+ <p>
+ In case the stream is open in readonly mode the
+ <method scope="com::sun::star::io">XStream::getOutputStream</method>
+ method will return an empty reference.
+ </p>
+
+ @param sStreamName
+ the name of the substream that should be open
+
+ @param nOpenMode
+ a mode the stream should be open in,
+ can be a combination of <type>ElementModes</type> values
+
+ @param aEncryptionData
+ this parameter allowes to specify an encryption data to decrypt the
+ stream, the encryption data must be correct, otherwise an
+ exception will be thrown
+
+ @throws ::com::sun::star::embed::InvalidStorageException
+ this storage is in invalid state for any reason
+
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ one of provided arguments is illegal
+
+ @throws ::com::sun::star::packages::NoEncryptionException
+ the stream is not encrypted
+
+ @throws ::com::sun::star::packages::WrongPasswordException
+ the provided encryption data is wrong
+
+ @throws ::com::sun::star::io::IOException
+ in case of io errors during stream opening
+
+ @throws ::com::sun::star::embed::StorageWrappedTargetException
+ wraps other exceptions
+ */
+ ::com::sun::star::io::XStream openEncryptedStream(
+ [in] string sStreamName,
+ [in] long nOpenMode,
+ [in] sequence< ::com::sun::star::beans::NamedValue > aEncryptionData )
+ raises( ::com::sun::star::embed::InvalidStorageException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::packages::NoEncryptionException,
+ ::com::sun::star::packages::WrongPasswordException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::embed::StorageWrappedTargetException );
+
+ // -----------------------------------------------------------------------
+ /** allows to get readonly copy of a child encrypted stream with encryption
+ data.
+
+ <p>
+ If storage does not allow any encryption this method will always throw
+ <type scope="com::sun::star::packages">NoEncryptionException</type>.
+ </p>
+
+ <p>
+ The stream is open in readonly mode so the
+ <method scope="com::sun::star::io">XStream::getOutputStream</method>
+ method will return an empty reference.
+ </p>
+
+ <p>
+ This method allows to specify encryption data for the child stream
+ explicitly.
+ </p>
+
+ @param sStreamName
+ the name of the substream that should be copied
+
+ @param aEncryptionData
+ this parameter allowes to specify an encryption data for the
+ stream, the encryption data must be correct, otherwise an
+ exception will be thrown
+
+ @throws ::com::sun::star::embed::InvalidStorageException
+ this storage is in invalid state for any reason
+
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ one of provided arguments is illegal
+
+ @throws ::com::sun::star::packages::NoEncryptionException
+ the stream is not encrypted
+
+ @throws ::com::sun::star::packages::WrongPasswordException
+ the provided encryption data is wrong
+
+ @throws ::com::sun::star::io::IOException
+ in case of io errors during stream opening
+
+ @throws ::com::sun::star::embed::StorageWrappedTargetException
+ wraps other exceptions
+ */
+ ::com::sun::star::io::XStream cloneEncryptedStream(
+ [in] string sStreamName,
+ [in] sequence< ::com::sun::star::beans::NamedValue > aEncryptionData )
+ raises( ::com::sun::star::embed::InvalidStorageException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::packages::NoEncryptionException,
+ ::com::sun::star::packages::WrongPasswordException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::embed::StorageWrappedTargetException );
+};
+
+//============================================================================
+
+}; }; }; };
+
+#endif
+
diff --git a/offapi/com/sun/star/embed/makefile.mk b/offapi/com/sun/star/embed/makefile.mk
index 349017452ef3..8ee156af48ba 100644
--- a/offapi/com/sun/star/embed/makefile.mk
+++ b/offapi/com/sun/star/embed/makefile.mk
@@ -77,6 +77,7 @@ IDLFILES=\
XLinkCreator.idl\
XLinkFactory.idl\
XEncryptionProtectedSource.idl\
+ XEncryptionProtectedSource2.idl\
XInplaceClient.idl\
XInsertObjectDialog.idl\
XWindowSupplier.idl\
@@ -89,9 +90,11 @@ IDLFILES=\
XTransferableSupplier.idl\
XComponentSupplier.idl\
XStorage.idl\
+ XStorage2.idl\
XStorageRawAccess.idl\
XExtendedStorageStream.idl\
XHierarchicalStorageAccess.idl\
+ XHierarchicalStorageAccess2.idl\
XHatchWindowController.idl\
XHatchWindowFactory.idl\
XHatchWindow.idl\
diff --git a/offapi/com/sun/star/task/PDFExportException.idl b/offapi/com/sun/star/task/PDFExportException.idl
new file mode 100644
index 000000000000..8547aea76418
--- /dev/null
+++ b/offapi/com/sun/star/task/PDFExportException.idl
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef __com_sun_star_task_PDFExportException_idl__
+#define __com_sun_star_task_PDFExportException_idl__
+
+#ifndef __com_sun_star_uno_Exception_idl__
+#include <com/sun/star/uno/Exception.idl>
+#endif
+
+ module com { module sun { module star { module task {
+
+
+/** is an exception that provides information on an error during PDF export.
+ */
+published exception PDFExportException: com::sun::star::uno::Exception
+{
+ /** contains a number of errors that occured during PDFExport
+ */
+ sequence< long > ErrorCodes;
+};
+
+//=============================================================================
+
+}; }; }; };
+
+/*===========================================================================
+===========================================================================*/
+#endif
diff --git a/offapi/com/sun/star/task/makefile.mk b/offapi/com/sun/star/task/makefile.mk
index 16b0be56e36c..cd9db6b5a738 100755..100644
--- a/offapi/com/sun/star/task/makefile.mk
+++ b/offapi/com/sun/star/task/makefile.mk
@@ -59,6 +59,7 @@ IDLFILES=\
PasswordContainerInteractionHandler.idl\
PasswordRequest.idl\
PasswordRequestMode.idl\
+ PDFExportException.idl\
OfficeRestartManager.idl\
UnsupportedOverwriteRequest.idl\
UrlRecord.idl\
diff --git a/officecfg/registry/data/org/openoffice/Interaction.xcu b/officecfg/registry/data/org/openoffice/Interaction.xcu
index afd78005fb71..cc207de626d2 100644
--- a/officecfg/registry/data/org/openoffice/Interaction.xcu
+++ b/officecfg/registry/data/org/openoffice/Interaction.xcu
@@ -52,5 +52,17 @@
<value>com.sun.star.comp.dbaccess.DatabaseInteractionHandler</value>
</prop>
</node>
+ <node oor:name="org.openoffice.Filter.PDFExport.Interactions" oor:op="replace">
+ <node oor:name="HandledRequestTypes">
+ <node oor:name="com.sun.star.task.PDFExportException" oor:op="replace">
+ <prop oor:name="Propagation" oor:type="xs:string">
+ <value>named-and-derived</value>
+ </prop>
+ </node>
+ </node>
+ <prop oor:name="ServiceName" oor:type="xs:string">
+ <value>com.sun.star.filter.pdfexport.PDFExportInteractionHandler</value>
+ </prop>
+ </node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/Writer.xcu b/officecfg/registry/data/org/openoffice/Office/Writer.xcu
index b318614ef789..06eff1b079e7 100644
--- a/officecfg/registry/data/org/openoffice/Office/Writer.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Writer.xcu
@@ -53,6 +53,9 @@
</node>
<node oor:name="Insert">
<node oor:name="Caption">
+ <prop oor:name="CaptionOrderNumberingFirst">
+ <value xml:lang="hu">true</value>
+ </prop>
<node oor:name="WriterObject">
<node oor:name="Table">
<node oor:name="Settings">
diff --git a/oox/inc/oox/core/binarycodec.hxx b/oox/inc/oox/core/binarycodec.hxx
index 8abafffa2481..ce57e190f088 100644
--- a/oox/inc/oox/core/binarycodec.hxx
+++ b/oox/inc/oox/core/binarycodec.hxx
@@ -28,6 +28,9 @@
#ifndef OOX_CORE_BINARYCODEC_HXX
#define OOX_CORE_BINARYCODEC_HXX
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+
#include <rtl/cipher.h>
#include <rtl/digest.h>
@@ -85,6 +88,22 @@ public:
*/
void initKey( const sal_uInt8 pnPassData[ 16 ] );
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ bool initCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > getEncryptionData();
+
/** Verifies the validity of the password using the passed key and hash.
@precond
@@ -150,16 +169,6 @@ public:
*/
bool skip( sal_Int32 nBytes );
- // static -----------------------------------------------------------------
-
- /** Calculates the 16-bit hash value for the given password.
-
- The password data may be longer than 16 bytes. The array does not need
- to be terminated with a null byte (but it can without invalidating the
- result).
- */
- static sal_uInt16 getHash( const sal_uInt8* pnPassData, sal_Int32 nSize );
-
private:
CodecType meCodecType; /// Codec type.
sal_uInt8 mpnKey[ 16 ]; /// Encryption key.
@@ -189,6 +198,22 @@ public:
~BinaryCodec_RCF();
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ bool initCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > getEncryptionData();
+
/** Initializes the algorithm with the specified password and document ID.
@param pnPassData
@@ -278,9 +303,14 @@ public:
bool skip( sal_Int32 nBytes );
private:
+ void InitKeyImpl(
+ const sal_uInt8 pKeyData[64],
+ const sal_uInt8 pUnique[16] );
+
rtlCipher mhCipher;
rtlDigest mhDigest;
sal_uInt8 mpnDigestValue[ RTL_DIGEST_LENGTH_MD5 ];
+ sal_uInt8 mpnUnique[16];
};
// ============================================================================
diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx
index 1757b2be4334..9d9b8dcca515 100644
--- a/oox/inc/oox/core/filterbase.hxx
+++ b/oox/inc/oox/core/filterbase.hxx
@@ -31,6 +31,7 @@
#include <memory>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XFilter.hpp>
@@ -194,9 +195,9 @@ public:
/** Returns a helper for the handling of OLE obejcts. */
::oox::ole::OleObjectHelper& getOleObjectHelper() const;
- /** Requests a password from the media descriptor or from the user. On
- success, the password will be inserted into the media descriptor. */
- ::rtl::OUString requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
+ /** Requests the encryption data from the media descriptor or from the user. On
+ success, the encryption data will be inserted into the media descriptor. */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
/** Imports the raw binary data from the specified stream.
@return True, if the data could be imported from the stream. */
diff --git a/oox/inc/oox/dump/dumperbase.hxx b/oox/inc/oox/dump/dumperbase.hxx
index ed1a3e1fc938..d9acaa1f1011 100644
--- a/oox/inc/oox/dump/dumperbase.hxx
+++ b/oox/inc/oox/dump/dumperbase.hxx
@@ -910,7 +910,7 @@ public:
void eraseNameList( const ::rtl::OUString& rListName );
NameListRef getNameList( const ::rtl::OUString& rListName ) const;
- ::rtl::OUString requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier );
inline bool isPasswordCancelled() const { return mbPwCancelled; }
protected:
@@ -1011,7 +1011,7 @@ public:
template< typename Type >
bool hasName( const NameListWrapper& rListWrp, Type nKey ) const;
- ::rtl::OUString requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier );
bool isPasswordCancelled() const;
protected:
diff --git a/oox/inc/oox/xls/biffcodec.hxx b/oox/inc/oox/xls/biffcodec.hxx
index 21b3e82006fd..c1c040de095b 100644
--- a/oox/inc/oox/xls/biffcodec.hxx
+++ b/oox/inc/oox/xls/biffcodec.hxx
@@ -52,10 +52,9 @@ public:
/** Derived classes return a clone of the decoder for usage in new streams. */
inline BiffDecoderBase* clone() { return implClone(); }
- /** Implementation of the ::comphelper::IDocPasswordVerifier interface,
- calls the new virtual function implVerify(). */
- virtual ::comphelper::DocPasswordVerifierResult
- verifyPassword( const ::rtl::OUString& rPassword );
+ /** Implementation of the ::comphelper::IDocPasswordVerifier interface. */
+ virtual ::comphelper::DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData );
+ virtual ::comphelper::DocPasswordVerifierResult verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData );
/** Returns true, if the decoder has been initialized correctly. */
inline bool isValid() const { return mbValid; }
@@ -73,7 +72,8 @@ private:
/** Derived classes implement password verification and initialization of
the decoder. */
- virtual bool implVerify( const ::rtl::OUString& rPassword ) = 0;
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > implVerifyPassword( const ::rtl::OUString& rPassword ) = 0;
+ virtual bool implVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData ) = 0;
/** Implementation of decryption of a memory block. */
virtual void implDecode(
@@ -104,7 +104,9 @@ private:
virtual BiffDecoder_XOR* implClone();
/** Implements password verification and initialization of the decoder. */
- virtual bool implVerify( const ::rtl::OUString& rPassword );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > implVerifyPassword( const ::rtl::OUString& rPassword );
+ virtual bool implVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
+
/** Implementation of decryption of a memory block. */
virtual void implDecode(
@@ -115,7 +117,7 @@ private:
private:
::oox::core::BinaryCodec_XOR maCodec; /// Cipher algorithm implementation.
- ::std::vector< sal_uInt8 > maPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > maEncryptionData;
sal_uInt16 mnKey;
sal_uInt16 mnHash;
};
@@ -139,7 +141,8 @@ private:
virtual BiffDecoder_RCF* implClone();
/** Implements password verification and initialization of the decoder. */
- virtual bool implVerify( const ::rtl::OUString& rPassword );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > implVerifyPassword( const ::rtl::OUString& rPassword );
+ virtual bool implVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
/** Implementation of decryption of a memory block. */
virtual void implDecode(
@@ -150,7 +153,7 @@ private:
private:
::oox::core::BinaryCodec_RCF maCodec; /// Cipher algorithm implementation.
- ::std::vector< sal_uInt16 > maPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > maEncryptionData;
::std::vector< sal_uInt8 > maSalt;
::std::vector< sal_uInt8 > maVerifier;
::std::vector< sal_uInt8 > maVerifierHash;
diff --git a/oox/source/core/binarycodec.cxx b/oox/source/core/binarycodec.cxx
index 6127524c2aae..954f623f1f91 100644
--- a/oox/source/core/binarycodec.cxx
+++ b/oox/source/core/binarycodec.cxx
@@ -30,6 +30,11 @@
#include <string.h>
#include "oox/helper/attributelist.hxx"
+#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/docpasswordhelper.hxx>
+
+using namespace ::com::sun::star;
+
namespace oox {
namespace core {
@@ -176,6 +181,37 @@ void BinaryCodec_XOR::initKey( const sal_uInt8 pnPassData[ 16 ] )
}
}
+bool BinaryCodec_XOR::initCodec( const uno::Sequence< beans::NamedValue >& aData )
+{
+ bool bResult = sal_False;
+
+ ::comphelper::SequenceAsHashMap aHashData( aData );
+ uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95EncryptionKey" ) ), uno::Sequence< sal_Int8 >() );
+
+ if ( aKey.getLength() == 16 )
+ {
+ (void)memcpy( mpnKey, aKey.getConstArray(), 16 );
+ bResult = sal_True;
+
+ mnBaseKey = (sal_uInt16)aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95BaseKey" ) ), (sal_Int16)0 );
+ mnHash = (sal_uInt16)aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95PasswordHash" ) ), (sal_Int16)0 );
+ }
+ else
+ OSL_ENSURE( sal_False, "Unexpected key size!\n" );
+
+ return bResult;
+}
+
+uno::Sequence< beans::NamedValue > BinaryCodec_XOR::getEncryptionData()
+{
+ ::comphelper::SequenceAsHashMap aHashData;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95EncryptionKey" ) ) ] <<= uno::Sequence<sal_Int8>( (sal_Int8*)mpnKey, 16 );
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95BaseKey" ) ) ] <<= (sal_Int16)mnBaseKey;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95PasswordHash" ) ) ] <<= (sal_Int16)mnHash;
+
+ return aHashData.getAsConstNamedValueList();
+}
+
bool BinaryCodec_XOR::verifyKey( sal_uInt16 nKey, sal_uInt16 nHash ) const
{
return (nKey == mnBaseKey) && (nHash == mnHash);
@@ -230,11 +266,6 @@ bool BinaryCodec_XOR::skip( sal_Int32 nBytes )
return true;
}
-sal_uInt16 BinaryCodec_XOR::getHash( const sal_uInt8* pnPassData, sal_Int32 nSize )
-{
- return lclGetHash( pnPassData, nSize );
-}
-
// ============================================================================
BinaryCodec_RCF::BinaryCodec_RCF()
@@ -246,56 +277,62 @@ BinaryCodec_RCF::BinaryCodec_RCF()
OSL_ENSURE( mhDigest != 0, "BinaryCodec_RCF::BinaryCodec_RCF - cannot create digest" );
(void)memset( mpnDigestValue, 0, sizeof( mpnDigestValue ) );
+ (void)memset (mpnUnique, 0, sizeof(mpnUnique));
}
BinaryCodec_RCF::~BinaryCodec_RCF()
{
(void)memset( mpnDigestValue, 0, sizeof( mpnDigestValue ) );
+ (void)memset (mpnUnique, 0, sizeof(mpnUnique));
rtl_digest_destroy( mhDigest );
rtl_cipher_destroy( mhCipher );
}
-void BinaryCodec_RCF::initKey( const sal_uInt16 pnPassData[ 16 ], const sal_uInt8 pnSalt[ 16 ] )
+bool BinaryCodec_RCF::initCodec( const uno::Sequence< beans::NamedValue >& aData )
{
- // create little-endian key data array from password data
- sal_uInt8 pnKeyData[ 64 ];
- (void)memset( pnKeyData, 0, sizeof( pnKeyData ) );
+ bool bResult = sal_False;
- const sal_uInt16* pnCurrPass = pnPassData;
- const sal_uInt16* pnPassEnd = pnPassData + 16;
- sal_uInt8* pnCurrKey = pnKeyData;
- size_t nPassSize = 0;
- for( ; (pnCurrPass < pnPassEnd) && (*pnCurrPass != 0); ++pnCurrPass, ++nPassSize )
+ ::comphelper::SequenceAsHashMap aHashData( aData );
+ uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97EncryptionKey" ) ), uno::Sequence< sal_Int8 >() );
+
+ if ( aKey.getLength() == RTL_DIGEST_LENGTH_MD5 )
{
- *pnCurrKey++ = static_cast< sal_uInt8 >( *pnCurrPass );
- *pnCurrKey++ = static_cast< sal_uInt8 >( *pnCurrPass >> 8 );
+ (void)memcpy( mpnDigestValue, aKey.getConstArray(), RTL_DIGEST_LENGTH_MD5 );
+ uno::Sequence< sal_Int8 > aUniqueID = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97UniqueID" ) ), uno::Sequence< sal_Int8 >() );
+ if ( aUniqueID.getLength() == 16 )
+ {
+ (void)memcpy( mpnUnique, aUniqueID.getConstArray(), 16 );
+ bResult = sal_False;
+ }
+ else
+ OSL_ENSURE( sal_False, "Unexpected document ID!\n" );
}
- pnKeyData[ 2 * nPassSize ] = 0x80;
- pnKeyData[ 56 ] = static_cast< sal_uInt8 >( nPassSize << 4 );
+ else
+ OSL_ENSURE( sal_False, "Unexpected key size!\n" );
- // fill raw digest of key data into key data
- (void)rtl_digest_updateMD5( mhDigest, pnKeyData, sizeof( pnKeyData ) );
- (void)rtl_digest_rawMD5( mhDigest, pnKeyData, RTL_DIGEST_LENGTH_MD5 );
+ return bResult;
+}
- // update digest with key data and passed salt data
- for( size_t nIndex = 0; nIndex < 16; ++nIndex )
- {
- rtl_digest_updateMD5( mhDigest, pnKeyData, 5 );
- rtl_digest_updateMD5( mhDigest, pnSalt, 16 );
- }
+uno::Sequence< beans::NamedValue > BinaryCodec_RCF::getEncryptionData()
+{
+ ::comphelper::SequenceAsHashMap aHashData;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97EncryptionKey" ) ) ] <<= uno::Sequence< sal_Int8 >( (sal_Int8*)mpnDigestValue, RTL_DIGEST_LENGTH_MD5 );
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97UniqueID" ) ) ] <<= uno::Sequence< sal_Int8 >( (sal_Int8*)mpnUnique, 16 );
- // update digest with padding
- pnKeyData[ 16 ] = 0x80;
- (void)memset( pnKeyData + 17, 0, sizeof( pnKeyData ) - 17 );
- pnKeyData[ 56 ] = 0x80;
- pnKeyData[ 57 ] = 0x0A;
- rtl_digest_updateMD5( mhDigest, pnKeyData + 16, sizeof( pnKeyData ) - 16 );
+ return aHashData.getAsConstNamedValueList();
+}
- // fill raw digest of above updates into digest value
- rtl_digest_rawMD5( mhDigest, mpnDigestValue, sizeof( mpnDigestValue ) );
+void BinaryCodec_RCF::initKey( const sal_uInt16 pnPassData[ 16 ], const sal_uInt8 pnSalt[ 16 ] )
+{
+ uno::Sequence< sal_Int8 > aKey = ::comphelper::DocPasswordHelper::GenerateStd97Key( pnPassData, uno::Sequence< sal_Int8 >( (sal_Int8*)pnSalt, 16 ) );
+ // Fill raw digest of above updates into DigestValue.
- // erase key data array and leave
- (void)memset( pnKeyData, 0, sizeof( pnKeyData ) );
+ if ( aKey.getLength() == sizeof(mpnDigestValue) )
+ (void)memcpy ( mpnDigestValue, (const sal_uInt8*)aKey.getConstArray(), sizeof(mpnDigestValue) );
+ else
+ memset( mpnDigestValue, 0, sizeof(mpnDigestValue) );
+
+ (void)memcpy( mpnUnique, pnSalt, 16 );
}
bool BinaryCodec_RCF::verifyKey( const sal_uInt8 pnVerifier[ 16 ], const sal_uInt8 pnVerifierHash[ 16 ] )
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 9b7b00988dd0..6d2b98454444 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -67,6 +67,8 @@ using ::comphelper::MediaDescriptor;
using ::comphelper::SequenceAsHashMap;
using ::oox::ole::OleObjectHelper;
+using namespace ::com::sun::star;
+
namespace oox {
namespace core {
@@ -399,7 +401,7 @@ OleObjectHelper& FilterBase::getOleObjectHelper() const
return *mxImpl->mxOleObjHelper;
}
-OUString FilterBase::requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const
+uno::Sequence< beans::NamedValue > FilterBase::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const
{
::std::vector< OUString > aDefaultPasswords;
aDefaultPasswords.push_back( CREATE_OUSTRING( "VelvetSweatshop" ) );
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index 00244c224778..53d8809330d9 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -65,6 +65,8 @@ using ::com::sun::star::xml::sax::XLocator;
using ::comphelper::MediaDescriptor;
using ::comphelper::SequenceAsHashMap;
+using namespace ::com::sun::star;
+
namespace oox {
namespace core {
@@ -366,7 +368,49 @@ void lclDeriveKey( const sal_uInt8* pnHash, sal_uInt32 nHashLen, sal_uInt8* pnKe
// ----------------------------------------------------------------------------
-bool lclGenerateEncryptionKey( const PackageEncryptionInfo& rEncrInfo, const OUString& rPassword, sal_uInt8* pnKey, sal_uInt32 nRequiredKeyLen )
+bool lclCheckEncryptionData( const sal_uInt8* pnKey, sal_uInt32 nKeySize, const sal_uInt8* pnVerifier, sal_uInt32 nVerifierSize, const sal_uInt8* pnVerifierHash, sal_uInt32 nVerifierHashSize )
+{
+ bool bResult = false;
+
+ // the only currently supported algorithm needs key size 128
+ if ( nKeySize == 16 && nVerifierSize == 16 && nVerifierHashSize == 32 )
+ {
+ // check password
+ EVP_CIPHER_CTX aes_ctx;
+ EVP_CIPHER_CTX_init( &aes_ctx );
+ EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
+ EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
+ int nOutLen = 0;
+ sal_uInt8 pnTmpVerifier[ 16 ];
+ (void) memset( pnTmpVerifier, 0, sizeof(pnTmpVerifier) );
+
+ /*int*/ EVP_DecryptUpdate( &aes_ctx, pnTmpVerifier, &nOutLen, pnVerifier, nVerifierSize );
+ EVP_CIPHER_CTX_cleanup( &aes_ctx );
+
+ EVP_CIPHER_CTX_init( &aes_ctx );
+ EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
+ EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
+ sal_uInt8 pnTmpVerifierHash[ 32 ];
+ (void) memset( pnTmpVerifierHash, 0, sizeof(pnTmpVerifierHash) );
+
+ /*int*/ EVP_DecryptUpdate( &aes_ctx, pnTmpVerifierHash, &nOutLen, pnVerifierHash, nVerifierHashSize );
+ EVP_CIPHER_CTX_cleanup( &aes_ctx );
+
+ rtlDigest aDigest = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
+ rtlDigestError aError = rtl_digest_update( aDigest, pnTmpVerifier, sizeof( pnTmpVerifier ) );
+ sal_uInt8 pnSha1Hash[ RTL_DIGEST_LENGTH_SHA1 ];
+ aError = rtl_digest_get( aDigest, pnSha1Hash, RTL_DIGEST_LENGTH_SHA1 );
+ rtl_digest_destroy( aDigest );
+
+ bResult = ( memcmp( pnSha1Hash, pnTmpVerifierHash, RTL_DIGEST_LENGTH_SHA1 ) == 0 );
+ }
+
+ return bResult;
+}
+
+// ----------------------------------------------------------------------------
+
+uno::Sequence< beans::NamedValue > lclGenerateEncryptionKey( const PackageEncryptionInfo& rEncrInfo, const OUString& rPassword, sal_uInt8* pnKey, sal_uInt32 nRequiredKeyLen )
{
size_t nBufferSize = rEncrInfo.mnSaltSize + 2 * rPassword.getLength();
sal_uInt8* pnBuffer = new sal_uInt8[ nBufferSize ];
@@ -405,30 +449,19 @@ bool lclGenerateEncryptionKey( const PackageEncryptionInfo& rEncrInfo, const OUS
lclDeriveKey( pnHash, RTL_DIGEST_LENGTH_SHA1, pnKey, nRequiredKeyLen );
delete[] pnHash;
- // check password
- EVP_CIPHER_CTX aes_ctx;
- EVP_CIPHER_CTX_init( &aes_ctx );
- EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
- EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
- int nOutLen = 0;
- sal_uInt8 pnVerifier[ 16 ] = { 0 };
- /*int*/ EVP_DecryptUpdate( &aes_ctx, pnVerifier, &nOutLen, rEncrInfo.mpnEncrVerifier, sizeof( rEncrInfo.mpnEncrVerifier ) );
- EVP_CIPHER_CTX_cleanup( &aes_ctx );
-
- EVP_CIPHER_CTX_init( &aes_ctx );
- EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
- EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
- sal_uInt8 pnVerifierHash[ 32 ] = { 0 };
- /*int*/ EVP_DecryptUpdate( &aes_ctx, pnVerifierHash, &nOutLen, rEncrInfo.mpnEncrVerifierHash, sizeof( rEncrInfo.mpnEncrVerifierHash ) );
- EVP_CIPHER_CTX_cleanup( &aes_ctx );
+ uno::Sequence< beans::NamedValue > aResult;
+ if ( lclCheckEncryptionData( pnKey, nRequiredKeyLen, rEncrInfo.mpnEncrVerifier, sizeof( rEncrInfo.mpnEncrVerifier ), rEncrInfo.mpnEncrVerifierHash, sizeof( rEncrInfo.mpnEncrVerifierHash ) ) )
+ {
+ ::comphelper::SequenceAsHashMap aEncryptionData;
+ aEncryptionData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionKey" ) ) ] <<= uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( pnKey ), nRequiredKeyLen );
+ aEncryptionData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionSalt" ) ) ] <<= uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnSalt ), rEncrInfo.mnSaltSize );
+ aEncryptionData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionVerifier" ) ) ] <<= uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnEncrVerifier ), sizeof( rEncrInfo.mpnEncrVerifier ) );
+ aEncryptionData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionVerifierHash" ) ) ] <<= uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnEncrVerifierHash ), sizeof( rEncrInfo.mpnEncrVerifierHash ) );
- aDigest = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
- aError = rtl_digest_update( aDigest, pnVerifier, sizeof( pnVerifier ) );
- sal_uInt8 pnSha1Hash[ RTL_DIGEST_LENGTH_SHA1 ];
- aError = rtl_digest_get( aDigest, pnSha1Hash, RTL_DIGEST_LENGTH_SHA1 );
- rtl_digest_destroy( aDigest );
+ aResult = aEncryptionData.getAsConstNamedValueList();
+ }
- return memcmp( pnSha1Hash, pnVerifierHash, RTL_DIGEST_LENGTH_SHA1 ) == 0;
+ return aResult;
}
// the password verifier ------------------------------------------------------
@@ -438,8 +471,8 @@ class PasswordVerifier : public ::comphelper::IDocPasswordVerifier
public:
explicit PasswordVerifier( const PackageEncryptionInfo& rEncryptInfo );
- virtual ::comphelper::DocPasswordVerifierResult
- verifyPassword( const OUString& rPassword );
+ virtual ::comphelper::DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData );
+ virtual ::comphelper::DocPasswordVerifierResult verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
inline const sal_uInt8* getKey() const { return &maKey.front(); }
@@ -454,13 +487,31 @@ PasswordVerifier::PasswordVerifier( const PackageEncryptionInfo& rEncryptInfo )
{
}
-::comphelper::DocPasswordVerifierResult PasswordVerifier::verifyPassword( const OUString& rPassword )
+::comphelper::DocPasswordVerifierResult PasswordVerifier::verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData )
{
// verifies the password and writes the related decryption key into maKey
- return lclGenerateEncryptionKey( mrEncryptInfo, rPassword, &maKey.front(), maKey.size() ) ?
+ o_rEncryptionData = lclGenerateEncryptionKey( mrEncryptInfo, rPassword, &maKey.front(), maKey.size() );
+ return ( o_rEncryptionData.getLength() > 0 ) ?
::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
}
+::comphelper::DocPasswordVerifierResult PasswordVerifier::verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData )
+{
+ ::comphelper::SequenceAsHashMap aHashData( rEncryptionData );
+ uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionKey" ) ), uno::Sequence< sal_Int8 >() );
+ uno::Sequence< sal_Int8 > aVerifier = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionVerifier" ) ), uno::Sequence< sal_Int8 >() );
+ uno::Sequence< sal_Int8 > aVerifierHash = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionVerifierHash" ) ), uno::Sequence< sal_Int8 >() );
+
+ return lclCheckEncryptionData(
+ reinterpret_cast< const sal_uInt8* >( aKey.getConstArray() ),
+ aKey.getLength(),
+ reinterpret_cast< const sal_uInt8* >( aVerifier.getConstArray() ),
+ aVerifier.getLength(),
+ reinterpret_cast< const sal_uInt8* >( aVerifierHash.getConstArray() ),
+ aVerifierHash.getLength() )
+ ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+}
+
} // namespace
// ----------------------------------------------------------------------------
@@ -520,10 +571,10 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
(according to the verifier), or with an empty string if
user has cancelled the password input dialog. */
PasswordVerifier aVerifier( aEncryptInfo );
- OUString aPassword = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
+ uno::Sequence< beans::NamedValue > aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
aVerifier, rMediaDesc, ::comphelper::DocPasswordRequestType_MS, &aDefaultPasswords );
- if( aPassword.getLength() == 0 )
+ if( aEncryptionData.getLength() == 0 )
{
rMediaDesc[ MediaDescriptor::PROP_ABORTED() ] <<= true;
}
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 3ac5018c1dad..9750375f97dd 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -96,7 +96,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
rPropMap[ PROP_CharFontFamilyComplex ] <<= nFontFamily;
}
- // symbol font not supported
+ // symbolfont, will now be ... textrun.cxx ... ausgewertet !!!i#113673
if( maCharColor.isUsed() )
rPropMap[ PROP_CharColor ] <<= maCharColor.getColor( rFilter.getGraphicHelper() );
diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx
index aa74d767a7ad..cb8304b76d04 100644
--- a/oox/source/drawingml/textrun.cxx
+++ b/oox/source/drawingml/textrun.cxx
@@ -78,7 +78,55 @@ void TextRun::insertAt(
}
else
{
- xText->insertString( xStart, getText(), sal_False );
+ OUString aLatinFontName, aSymbolFontName;
+ sal_Int16 nLatinFontPitch = 0, nSymbolFontPitch = 0;
+ sal_Int16 nLatinFontFamily = 0, nSymbolFontFamily = 0;
+
+ if ( !aTextCharacterProps.maSymbolFont.getFontData( aSymbolFontName, nSymbolFontPitch, nSymbolFontFamily, rFilterBase ) )
+ xText->insertString( xStart, getText(), sal_False );
+ else if ( getText().getLength() )
+ { // !!#i113673<<<
+ aTextCharacterProps.maLatinFont.getFontData( aLatinFontName, nLatinFontPitch, nLatinFontFamily, rFilterBase );
+
+ sal_Int32 nIndex = 0;
+ while ( sal_True )
+ {
+ sal_Int32 nCount = 0;
+ sal_Bool bSymbol = ( getText()[ nIndex ] & 0xff00 ) == 0xf000;
+ if ( bSymbol )
+ {
+ do
+ {
+ nCount++;
+ }
+ while( ( ( nCount + nIndex ) < getText().getLength() ) && ( ( getText()[ nCount + nIndex ] & 0xff00 ) == 0xf000 ) );
+ aPropSet.setAnyProperty( PROP_CharFontName, Any( aSymbolFontName ) );
+ aPropSet.setAnyProperty( PROP_CharFontPitch, Any( nSymbolFontPitch ) );
+ aPropSet.setAnyProperty( PROP_CharFontFamily, Any( nSymbolFontFamily ) );
+ }
+ else
+ {
+ do
+ {
+ nCount++;
+ }
+ while( ( ( nCount + nIndex ) < getText().getLength() ) && ( ( getText()[ nCount + nIndex ] & 0xff00 ) != 0xf000 ) );
+ aPropSet.setAnyProperty( PROP_CharFontName, Any( aLatinFontName ) );
+ aPropSet.setAnyProperty( PROP_CharFontPitch, Any( nLatinFontPitch ) );
+ aPropSet.setAnyProperty( PROP_CharFontFamily, Any( nLatinFontFamily ) );
+ }
+ rtl::OUString aSubString( getText().copy( nIndex, nCount ) );
+ xText->insertString( xStart, aSubString, sal_False );
+ nIndex += nCount;
+
+ if ( nIndex >= getText().getLength() )
+ break;
+
+ xStart = Reference< XTextRange >( xAt, UNO_QUERY );
+ aPropSet = PropertySet( xStart );
+ aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase );
+ }
+ }
}
}
else
diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx
index 30938f9ebbe6..b78c993a0968 100644
--- a/oox/source/dump/biffdumper.cxx
+++ b/oox/source/dump/biffdumper.cxx
@@ -2324,7 +2324,7 @@ void WorkbookStreamObject::implDumpRecordBody()
rStrm.seekToStart();
BiffDecoderRef xDecoder = BiffCodecHelper::implReadFilePass( rStrm, eBiff );
if( xDecoder.get() )
- cfg().requestPassword( *xDecoder );
+ cfg().requestEncryptionData( *xDecoder );
setBinaryOnlyMode( !xDecoder || !xDecoder->isValid() );
}
break;
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index 807a5ec74715..53452765288a 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -65,6 +65,8 @@ using ::com::sun::star::io::XTextOutputStream;
using ::comphelper::MediaDescriptor;
using ::oox::core::FilterBase;
+using namespace ::com::sun::star;
+
namespace oox {
namespace dump {
@@ -1581,18 +1583,18 @@ NameListRef SharedConfigData::getNameList( const OUString& rListName ) const
return xList;
}
-OUString SharedConfigData::requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier )
+uno::Sequence< beans::NamedValue > SharedConfigData::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier )
{
- OUString aPassword;
+ uno::Sequence< beans::NamedValue > aEncryptionData;
if( !mbPwCancelled )
{
::std::vector< OUString > aDefaultPasswords;
aDefaultPasswords.push_back( CREATE_OUSTRING( "VelvetSweatshop" ) );
- aPassword = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
+ aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
rVerifier, mrMediaDesc, ::comphelper::DocPasswordRequestType_MS, &aDefaultPasswords );
- mbPwCancelled = aPassword.getLength() == 0;
+ mbPwCancelled = aEncryptionData.getLength() == 0;
}
- return aPassword;
+ return aEncryptionData;
}
bool SharedConfigData::implIsValid() const
@@ -1764,9 +1766,9 @@ NameListRef Config::getNameList( const String& rListName ) const
return implGetNameList( rListName );
}
-OUString Config::requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier )
+uno::Sequence< beans::NamedValue > Config::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier )
{
- return mxCfgData->requestPassword( rVerifier );
+ return mxCfgData->requestEncryptionData( rVerifier );
}
bool Config::isPasswordCancelled() const
diff --git a/oox/source/xls/biffcodec.cxx b/oox/source/xls/biffcodec.cxx
index 2021c21cb08c..0872dcc654df 100644
--- a/oox/source/xls/biffcodec.cxx
+++ b/oox/source/xls/biffcodec.cxx
@@ -36,6 +36,8 @@ using ::rtl::OUString;
using ::rtl::OStringToOUString;
using ::oox::core::FilterBase;
+using namespace ::com::sun::star;
+
namespace oox {
namespace xls {
@@ -50,9 +52,16 @@ BiffDecoderBase::~BiffDecoderBase()
{
}
-::comphelper::DocPasswordVerifierResult BiffDecoderBase::verifyPassword( const OUString& rPassword )
+::comphelper::DocPasswordVerifierResult BiffDecoderBase::verifyPassword( const ::rtl::OUString& rPassword, uno::Sequence< beans::NamedValue >& o_rEncryptionData )
+{
+ o_rEncryptionData = implVerifyPassword( rPassword );
+ mbValid = ( o_rEncryptionData.getLength() > 0 );
+ return mbValid ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+}
+
+::comphelper::DocPasswordVerifierResult BiffDecoderBase::verifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
{
- mbValid = implVerify( rPassword );
+ mbValid = implVerifyEncryptionData( rEncryptionData );
return mbValid ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
}
@@ -71,7 +80,6 @@ void BiffDecoderBase::decode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcData,
BiffDecoder_XOR::BiffDecoder_XOR( sal_uInt16 nKey, sal_uInt16 nHash ) :
maCodec( ::oox::core::BinaryCodec_XOR::CODEC_EXCEL ),
- maPassword( 16 ),
mnKey( nKey ),
mnHash( nHash )
{
@@ -80,12 +88,12 @@ BiffDecoder_XOR::BiffDecoder_XOR( sal_uInt16 nKey, sal_uInt16 nHash ) :
BiffDecoder_XOR::BiffDecoder_XOR( const BiffDecoder_XOR& rDecoder ) :
BiffDecoderBase(), // must be called to prevent compiler warning
maCodec( ::oox::core::BinaryCodec_XOR::CODEC_EXCEL ),
- maPassword( rDecoder.maPassword ),
+ maEncryptionData( rDecoder.maEncryptionData ),
mnKey( rDecoder.mnKey ),
mnHash( rDecoder.mnHash )
{
if( isValid() )
- maCodec.initKey( &maPassword.front() );
+ maCodec.initCodec( maEncryptionData );
}
BiffDecoder_XOR* BiffDecoder_XOR::implClone()
@@ -93,24 +101,40 @@ BiffDecoder_XOR* BiffDecoder_XOR::implClone()
return new BiffDecoder_XOR( *this );
}
-bool BiffDecoder_XOR::implVerify( const OUString& rPassword )
+uno::Sequence< beans::NamedValue > BiffDecoder_XOR::implVerifyPassword( const ::rtl::OUString& rPassword )
{
+ maEncryptionData.realloc( 0 );
+
/* Convert password to a byte string. TODO: this needs some finetuning
according to the spec... */
OString aBytePassword = OUStringToOString( rPassword, osl_getThreadTextEncoding() );
sal_Int32 nLen = aBytePassword.getLength();
if( (0 < nLen) && (nLen < 16) )
{
- // copy byte string to sal_uInt8 array
- maPassword.clear();
- maPassword.resize( 16, 0 );
- memcpy( &maPassword.front(), aBytePassword.getStr(), static_cast< size_t >( nLen ) );
+ // init codec
+ maCodec.initKey( (sal_uInt8*)aBytePassword.getStr() );
+ if ( maCodec.verifyKey( mnKey, mnHash ) )
+ maEncryptionData = maCodec.getEncryptionData();
+ }
+
+ return maEncryptionData;
+}
+
+bool BiffDecoder_XOR::implVerifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
+{
+ maEncryptionData.realloc( 0 );
+
+ if( rEncryptionData.getLength() )
+ {
// init codec
- maCodec.initKey( &maPassword.front() );
- return maCodec.verifyKey( mnKey, mnHash );
+ maCodec.initCodec( rEncryptionData );
+
+ if ( maCodec.verifyKey( mnKey, mnHash ) )
+ maEncryptionData = rEncryptionData;
}
- return false;
+
+ return maEncryptionData.getLength();
}
void BiffDecoder_XOR::implDecode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcData, sal_Int64 nStreamPos, sal_uInt16 nBytes )
@@ -141,7 +165,6 @@ sal_Int32 lclGetRcfOffset( sal_Int64 nStreamPos )
// ----------------------------------------------------------------------------
BiffDecoder_RCF::BiffDecoder_RCF( sal_uInt8 pnSalt[ 16 ], sal_uInt8 pnVerifier[ 16 ], sal_uInt8 pnVerifierHash[ 16 ] ) :
- maPassword( 16, 0 ),
maSalt( pnSalt, pnSalt + 16 ),
maVerifier( pnVerifier, pnVerifier + 16 ),
maVerifierHash( pnVerifierHash, pnVerifierHash + 16 )
@@ -150,13 +173,13 @@ BiffDecoder_RCF::BiffDecoder_RCF( sal_uInt8 pnSalt[ 16 ], sal_uInt8 pnVerifier[
BiffDecoder_RCF::BiffDecoder_RCF( const BiffDecoder_RCF& rDecoder ) :
BiffDecoderBase(), // must be called to prevent compiler warning
- maPassword( rDecoder.maPassword ),
+ maEncryptionData( rDecoder.maEncryptionData ),
maSalt( rDecoder.maSalt ),
maVerifier( rDecoder.maVerifier ),
maVerifierHash( rDecoder.maVerifierHash )
{
if( isValid() )
- maCodec.initKey( &maPassword.front(), &maSalt.front() );
+ maCodec.initCodec( maEncryptionData );
}
BiffDecoder_RCF* BiffDecoder_RCF::implClone()
@@ -164,27 +187,48 @@ BiffDecoder_RCF* BiffDecoder_RCF::implClone()
return new BiffDecoder_RCF( *this );
}
-bool BiffDecoder_RCF::implVerify( const OUString& rPassword )
+uno::Sequence< beans::NamedValue > BiffDecoder_RCF::implVerifyPassword( const ::rtl::OUString& rPassword )
{
+ maEncryptionData.realloc( 0 );
+
sal_Int32 nLen = rPassword.getLength();
if( (0 < nLen) && (nLen < 16) )
{
// copy string to sal_uInt16 array
- maPassword.clear();
- maPassword.resize( 16, 0 );
+ ::std::vector< sal_uInt16 > aPassVect( 16 );
const sal_Unicode* pcChar = rPassword.getStr();
const sal_Unicode* pcCharEnd = pcChar + nLen;
- ::std::vector< sal_uInt16 >::iterator aIt = maPassword.begin();
+ ::std::vector< sal_uInt16 >::iterator aIt = aPassVect.begin();
for( ; pcChar < pcCharEnd; ++pcChar, ++aIt )
*aIt = static_cast< sal_uInt16 >( *pcChar );
// init codec
- maCodec.initKey( &maPassword.front(), &maSalt.front() );
- return maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() );
+ maCodec.initKey( &aPassVect.front(), &maSalt.front() );
+ if ( maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ maEncryptionData = maCodec.getEncryptionData();
+ }
+
+ return maEncryptionData;
+}
+
+bool BiffDecoder_RCF::implVerifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
+{
+ maEncryptionData.realloc( 0 );
+
+ if( rEncryptionData.getLength() )
+ {
+ // init codec
+ maCodec.initCodec( rEncryptionData );
+
+ if ( maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ maEncryptionData = rEncryptionData;
}
- return false;
+
+ return maEncryptionData.getLength();
}
+
+
void BiffDecoder_RCF::implDecode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcData, sal_Int64 nStreamPos, sal_uInt16 nBytes )
{
sal_uInt8* pnCurrDest = pnDestData;
@@ -316,7 +360,7 @@ bool BiffCodecHelper::importFilePass( BiffInputStream& rStrm )
mxDecoder = implReadFilePass( rStrm, getBiff() );
// request and verify a password (decoder implements IDocPasswordVerifier)
if( mxDecoder.get() )
- getBaseFilter().requestPassword( *mxDecoder );
+ getBaseFilter().requestEncryptionData( *mxDecoder );
// correct password is indicated by isValid() function of decoder
return mxDecoder.get() && mxDecoder->isValid();
}
diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx
index 8e22b2b3a093..32ebc7068ec3 100644
--- a/package/source/xstor/ohierarchyholder.cxx
+++ b/package/source/xstor/ohierarchyholder.cxx
@@ -29,7 +29,7 @@
#include "precompiled_package.hxx"
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/embed/XHierarchicalStorageAccess.hpp>
+#include <com/sun/star/embed/XHierarchicalStorageAccess2.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include "ohierarchyholder.hxx"
@@ -41,7 +41,7 @@ using namespace ::com::sun::star;
//===============================================
//-----------------------------------------------
-uno::Reference< embed::XExtendedStorageStream > OHierarchyHolder_Impl::GetStreamHierarchically( sal_Int32 nStorageMode, OStringList_Impl& aListPath, sal_Int32 nStreamMode, const ::rtl::OUString& aPass )
+uno::Reference< embed::XExtendedStorageStream > OHierarchyHolder_Impl::GetStreamHierarchically( sal_Int32 nStorageMode, OStringList_Impl& aListPath, sal_Int32 nStreamMode, const ::comphelper::SequenceAsHashMap& aEncryptionData )
{
uno::Reference< embed::XStorage > xOwnStor( m_xWeakOwnStorage.get(), uno::UNO_QUERY_THROW );
@@ -49,7 +49,7 @@ uno::Reference< embed::XExtendedStorageStream > OHierarchyHolder_Impl::GetStream
throw io::IOException();
uno::Reference< embed::XExtendedStorageStream > xResult =
- m_xChild->GetStreamHierarchically( nStorageMode, aListPath, nStreamMode, aPass );
+ m_xChild->GetStreamHierarchically( nStorageMode, aListPath, nStreamMode, aEncryptionData );
if ( !xResult.is() )
throw uno::RuntimeException();
@@ -88,7 +88,7 @@ OStringList_Impl OHierarchyHolder_Impl::GetListPathFromString( const ::rtl::OUSt
//===============================================
//-----------------------------------------------
-uno::Reference< embed::XExtendedStorageStream > OHierarchyElement_Impl::GetStreamHierarchically( sal_Int32 nStorageMode, OStringList_Impl& aListPath, sal_Int32 nStreamMode, const ::rtl::OUString& aPass )
+uno::Reference< embed::XExtendedStorageStream > OHierarchyElement_Impl::GetStreamHierarchically( sal_Int32 nStorageMode, OStringList_Impl& aListPath, sal_Int32 nStreamMode, const ::comphelper::SequenceAsHashMap& aEncryptionData )
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -110,11 +110,16 @@ uno::Reference< embed::XExtendedStorageStream > OHierarchyElement_Impl::GetStrea
if ( !aListPath.size() )
{
- uno::Reference< embed::XHierarchicalStorageAccess > xHStorage( xOwnStor, uno::UNO_QUERY_THROW );
- if ( !aPass.getLength() )
+ if ( !aEncryptionData.size() )
+ {
+ uno::Reference< embed::XHierarchicalStorageAccess > xHStorage( xOwnStor, uno::UNO_QUERY_THROW );
xResult = xHStorage->openStreamElementByHierarchicalName( aNextName, nStreamMode );
+ }
else
- xResult = xHStorage->openEncryptedStreamElementByHierarchicalName( aNextName, nStreamMode, aPass );
+ {
+ uno::Reference< embed::XHierarchicalStorageAccess2 > xHStorage( xOwnStor, uno::UNO_QUERY_THROW );
+ xResult = xHStorage->openEncryptedStreamByHierarchicalName( aNextName, nStreamMode, aEncryptionData.getAsConstNamedValueList() );
+ }
uno::Reference< embed::XTransactedObject > xTransact( xResult, uno::UNO_QUERY );
if ( xTransact.is() )
@@ -150,7 +155,7 @@ uno::Reference< embed::XExtendedStorageStream > OHierarchyElement_Impl::GetStrea
aElement = new OHierarchyElement_Impl( NULL, xChildStorage );
}
- xResult = aElement->GetStreamHierarchically( nStorageMode, aListPath, nStreamMode, aPass );
+ xResult = aElement->GetStreamHierarchically( nStorageMode, aListPath, nStreamMode, aEncryptionData );
if ( !xResult.is() )
throw uno::RuntimeException();
diff --git a/package/source/xstor/ohierarchyholder.hxx b/package/source/xstor/ohierarchyholder.hxx
index 17c14d3a6001..d36d784ac839 100644
--- a/package/source/xstor/ohierarchyholder.hxx
+++ b/package/source/xstor/ohierarchyholder.hxx
@@ -33,6 +33,8 @@
#include <com/sun/star/embed/XExtendedStorageStream.hpp>
#include <cppuhelper/implbase1.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+
#include <rtl/ref.hxx>
#include <hash_map>
@@ -90,10 +92,10 @@ public:
void RemoveElement( const ::rtl::Reference< OHierarchyElement_Impl >& aRef );
::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream >
- GetStreamHierarchically( sal_Int32 nStorageMode,
- OStringList_Impl& aPath,
- sal_Int32 nStreamMode,
- const ::rtl::OUString& aPassword = ::rtl::OUString() );
+ GetStreamHierarchically( sal_Int32 nStorageMode,
+ OStringList_Impl& aPath,
+ sal_Int32 nStreamMode,
+ const ::comphelper::SequenceAsHashMap& aEncryptionData = ::comphelper::SequenceAsHashMap() );
void RemoveStreamHierarchically( OStringList_Impl& aListPath );
@@ -127,10 +129,10 @@ public:
static OStringList_Impl GetListPathFromString( const ::rtl::OUString& aPath );
::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream >
- GetStreamHierarchically( sal_Int32 nStorageMode,
- OStringList_Impl& aListPath,
- sal_Int32 nStreamMode,
- const ::rtl::OUString& aPassword = ::rtl::OUString() );
+ GetStreamHierarchically( sal_Int32 nStorageMode,
+ OStringList_Impl& aListPath,
+ sal_Int32 nStreamMode,
+ const ::comphelper::SequenceAsHashMap& aEncryptionData = ::comphelper::SequenceAsHashMap() );
void RemoveStreamHierarchically( OStringList_Impl& aListPath );
};
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 2f58595ab4a3..9a5876b3e6df 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -65,29 +65,25 @@ using namespace ::com::sun::star;
namespace package
{
//-----------------------------------------------
-uno::Sequence< sal_Int8 > MakeKeyFromPass( const ::rtl::OUString& aPass, sal_Bool bUseUTF )
+bool PackageEncryptionDatasEqual( const ::comphelper::SequenceAsHashMap& aHash1, const ::comphelper::SequenceAsHashMap& aHash2 )
{
- // MS_1252 encoding was used for SO60 document format password encoding,
- // this encoding supports only a minor subset of nonascii characters,
- // but for compatibility reasons it has to be used for old document formats
-
- ::rtl::OString aByteStrPass;
- if ( bUseUTF )
- aByteStrPass = ::rtl::OUStringToOString( aPass, RTL_TEXTENCODING_UTF8 );
- else
- aByteStrPass = ::rtl::OUStringToOString( aPass, RTL_TEXTENCODING_MS_1252 );
-
- sal_uInt8 pBuffer[RTL_DIGEST_LENGTH_SHA1];
- rtlDigestError nError = rtl_digest_SHA1( aByteStrPass.getStr(),
- aByteStrPass.getLength(),
- pBuffer,
- RTL_DIGEST_LENGTH_SHA1 );
-
- if ( nError != rtl_Digest_E_None )
- throw uno::RuntimeException();
-
- return uno::Sequence< sal_Int8 >( (sal_Int8*)pBuffer, RTL_DIGEST_LENGTH_SHA1 );
+ bool bResult = ( aHash1.size() && aHash1.size() == aHash2.size() );
+ for ( ::comphelper::SequenceAsHashMap::const_iterator aIter = aHash1.begin();
+ bResult && aIter != aHash1.end();
+ aIter++ )
+ {
+ uno::Sequence< sal_Int8 > aKey1;
+ bResult = ( ( aIter->second >>= aKey1 ) && aKey1.getLength() );
+ if ( bResult )
+ {
+ uno::Sequence< sal_Int8 > aKey2 = aHash2.getUnpackedValueOrDefault( aIter->first, uno::Sequence< sal_Int8 >() );
+ bResult = ( aKey1.getLength() == aKey2.getLength() );
+ for ( sal_Int32 nInd = 0; bResult && nInd < aKey1.getLength(); nInd++ )
+ bResult = ( aKey1[nInd] == aKey2[nInd] );
+ }
+ }
+ return bResult;
}
//-----------------------------------------------
@@ -256,8 +252,8 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent,
, m_xFactory( xFactory )
, m_pParent( pParent )
, m_bForceEncrypted( bForceEncrypted )
-, m_bUseCommonPass( !bForceEncrypted && nStorageType == embed::StorageFormats::PACKAGE )
-, m_bHasCachedPassword( sal_False )
+, m_bUseCommonEncryption( !bForceEncrypted && nStorageType == embed::StorageFormats::PACKAGE )
+, m_bHasCachedEncryptionData( sal_False )
, m_bCompressedSetExplicit( !bDefaultCompress )
, m_xPackage( xPackage )
, m_bHasInsertedStreamOptimization( sal_False )
@@ -364,7 +360,7 @@ sal_Bool OWriteStream_Impl::IsEncrypted()
if ( m_nStorageType != embed::StorageFormats::PACKAGE )
return sal_False;
- if ( m_bForceEncrypted || m_bHasCachedPassword )
+ if ( m_bForceEncrypted || m_bHasCachedEncryptionData )
return sal_True;
if ( m_aTempURL.getLength() || m_xCacheStream.is() )
@@ -411,7 +407,7 @@ sal_Bool OWriteStream_Impl::IsEncrypted()
if ( !bWasEncr && bToBeEncr && !aKey.getLength() )
{
// the stream is intended to use common storage password
- m_bUseCommonPass = sal_True;
+ m_bUseCommonEncryption = sal_True;
return sal_False;
}
else
@@ -433,8 +429,8 @@ void OWriteStream_Impl::SetDecrypted()
// remove encryption
m_bForceEncrypted = sal_False;
- m_bHasCachedPassword = sal_False;
- m_aPass = ::rtl::OUString();
+ m_bHasCachedEncryptionData = sal_False;
+ m_aEncryptionData.clear();
for ( sal_Int32 nInd = 0; nInd < m_aProps.getLength(); nInd++ )
{
@@ -444,12 +440,15 @@ void OWriteStream_Impl::SetDecrypted()
}
//-----------------------------------------------
-void OWriteStream_Impl::SetEncryptedWithPass( const ::rtl::OUString& aPass )
+void OWriteStream_Impl::SetEncrypted( const ::comphelper::SequenceAsHashMap& aEncryptionData )
{
OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE, "The encryption is supported only for package storages!\n" );
if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException();
+ if ( !aEncryptionData.size() )
+ throw uno::RuntimeException();
+
GetStreamProperties();
// let the stream be modified
@@ -463,10 +462,10 @@ void OWriteStream_Impl::SetEncryptedWithPass( const ::rtl::OUString& aPass )
m_aProps[nInd].Value <<= sal_True;
}
- m_bUseCommonPass = sal_False; // very important to set it to false
+ m_bUseCommonEncryption = sal_False; // very important to set it to false
- m_bHasCachedPassword = sal_True;
- m_aPass = aPass;
+ m_bHasCachedEncryptionData = sal_True;
+ m_aEncryptionData = aEncryptionData;
}
//-----------------------------------------------
@@ -797,7 +796,7 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt
xPropertySet->setPropertyValue( aProps[nInd].Name, aProps[nInd].Value );
}
else if ( m_nStorageType == embed::StorageFormats::PACKAGE && aProps[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) )
- aProps[nInd].Value >>= m_bUseCommonPass;
+ aProps[nInd].Value >>= m_bUseCommonEncryption;
else
throw lang::IllegalArgumentException();
@@ -816,7 +815,7 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt
m_bCompressedSetExplicit = sal_True;
}
- if ( m_bUseCommonPass )
+ if ( m_bUseCommonEncryption )
{
if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException();
@@ -915,7 +914,7 @@ void OWriteStream_Impl::Commit()
xPropertySet->setPropertyValue( m_aProps[nInd].Name, m_aProps[nInd].Value );
}
- if ( m_bUseCommonPass )
+ if ( m_bUseCommonEncryption )
{
if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException();
@@ -926,13 +925,13 @@ void OWriteStream_Impl::Commit()
xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "Encrypted" ),
uno::makeAny( sal_True ) );
}
- else if ( m_bHasCachedPassword )
+ else if ( m_bHasCachedEncryptionData )
{
if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException();
xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "EncryptionKey" ),
- uno::makeAny( ::package::MakeKeyFromPass( m_aPass, sal_True ) ) );
+ uno::makeAny( m_aEncryptionData.getUnpackedValueOrDefault( PACKAGE_ENCRYPTIONDATA_SHA1UTF8, uno::Sequence< sal_Int8 >() ) ) );
}
// the stream should be free soon, after package is stored
@@ -970,9 +969,9 @@ void OWriteStream_Impl::Revert()
m_bHasDataToFlush = sal_False;
- m_bUseCommonPass = sal_True;
- m_bHasCachedPassword = sal_False;
- m_aPass = ::rtl::OUString();
+ m_bUseCommonEncryption = sal_True;
+ m_bHasCachedEncryptionData = sal_False;
+ m_aEncryptionData.clear();
if ( m_nStorageType == embed::StorageFormats::OFOPXML )
{
@@ -1008,7 +1007,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::GetStreamProperties()
//-----------------------------------------------
uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps(
const uno::Sequence< beans::PropertyValue >& aProps,
- sal_Bool bUseCommonPass )
+ sal_Bool bUseCommonEncryption )
{
uno::Sequence< beans::PropertyValue > aResult( aProps );
sal_Int32 nLen = aResult.getLength();
@@ -1018,13 +1017,13 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps(
for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ )
if ( aResult[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) )
{
- aResult[nInd].Value <<= bUseCommonPass;
+ aResult[nInd].Value <<= bUseCommonEncryption;
return aResult;
}
aResult.realloc( ++nLen );
aResult[nLen - 1].Name = ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" );
- aResult[nLen - 1].Value <<= bUseCommonPass;
+ aResult[nLen - 1].Value <<= bUseCommonEncryption;
}
else if ( m_nStorageType == embed::StorageFormats::OFOPXML )
{
@@ -1173,11 +1172,11 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProper
//-----------------------------------------------
void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream >& xDestStream,
- const ::rtl::OUString& aPass )
+ const ::comphelper::SequenceAsHashMap& aEncryptionData )
{
::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ;
- OSL_ENSURE( !m_bUseCommonPass, "The stream can not be encrypted!" );
+ OSL_ENSURE( !m_bUseCommonEncryption, "The stream can not be encrypted!" );
if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw packages::NoEncryptionException();
@@ -1188,16 +1187,16 @@ void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream
}
else
{
- uno::Reference< io::XStream > xOwnStream = GetStream( embed::ElementModes::READ, aPass, sal_False );
+ uno::Reference< io::XStream > xOwnStream = GetStream( embed::ElementModes::READ, aEncryptionData, sal_False );
if ( !xOwnStream.is() )
throw io::IOException(); // TODO
OStorage_Impl::completeStorageStreamCopy_Impl( xOwnStream, xDestStream, m_nStorageType, GetAllRelationshipsIfAny() );
}
- uno::Reference< embed::XEncryptionProtectedSource > xEncr( xDestStream, uno::UNO_QUERY );
+ uno::Reference< embed::XEncryptionProtectedSource2 > xEncr( xDestStream, uno::UNO_QUERY );
if ( xEncr.is() )
- xEncr->setEncryptionPassword( aPass );
+ xEncr->setEncryptionData( aEncryptionData.getAsConstNamedValueList() );
}
//-----------------------------------------------
@@ -1237,7 +1236,7 @@ void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream
}
//-----------------------------------------------
-uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMode, const ::rtl::OUString& aPass, sal_Bool bHierarchyAccess )
+uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMode, const ::comphelper::SequenceAsHashMap& aEncryptionData, sal_Bool bHierarchyAccess )
{
::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ;
@@ -1255,9 +1254,9 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod
if ( !xPropertySet.is() )
throw uno::RuntimeException();
- if ( m_bHasCachedPassword )
+ if ( m_bHasCachedEncryptionData )
{
- if ( !m_aPass.equals( aPass ) )
+ if ( !::package::PackageEncryptionDatasEqual( m_aEncryptionData, aEncryptionData ) )
throw packages::WrongPasswordException();
// the correct key must be set already
@@ -1265,26 +1264,26 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod
}
else
{
- SetEncryptionKeyProperty_Impl( xPropertySet, ::package::MakeKeyFromPass( aPass, sal_True ) );
+ SetEncryptionKeyProperty_Impl( xPropertySet, aEncryptionData.getUnpackedValueOrDefault( PACKAGE_ENCRYPTIONDATA_SHA1UTF8, uno::Sequence< sal_Int8 >() ) );
try {
xResultStream = GetStream_Impl( nStreamMode, bHierarchyAccess );
- m_bUseCommonPass = sal_False; // very important to set it to false
- m_bHasCachedPassword = sal_True;
- m_aPass = aPass;
+ m_bUseCommonEncryption = sal_False; // very important to set it to false
+ m_bHasCachedEncryptionData = sal_True;
+ m_aEncryptionData = aEncryptionData;
}
catch( packages::WrongPasswordException& )
{
// retry with different encoding
- SetEncryptionKeyProperty_Impl( xPropertySet, ::package::MakeKeyFromPass( aPass, sal_False ) );
+ SetEncryptionKeyProperty_Impl( xPropertySet, aEncryptionData.getUnpackedValueOrDefault( PACKAGE_ENCRYPTIONDATA_SHA1MS1252, uno::Sequence< sal_Int8 >() ) );
try {
// the stream must be cashed to be resaved
xResultStream = GetStream_Impl( nStreamMode | embed::ElementModes::SEEKABLE, bHierarchyAccess );
- m_bUseCommonPass = sal_False; // very important to set it to false
- m_bHasCachedPassword = sal_True;
- m_aPass = aPass;
+ m_bUseCommonEncryption = sal_False; // very important to set it to false
+ m_bHasCachedEncryptionData = sal_True;
+ m_aEncryptionData = aEncryptionData;
// the stream must be resaved with new password encryption
if ( nStreamMode & embed::ElementModes::WRITE )
@@ -1344,10 +1343,10 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod
if ( IsEncrypted() )
{
- ::rtl::OUString aGlobalPass;
+ ::comphelper::SequenceAsHashMap aGlobalEncryptionData;
try
{
- aGlobalPass = GetCommonRootPass();
+ aGlobalEncryptionData = GetCommonRootEncryptionData();
}
catch( packages::NoEncryptionException& aNoEncryptionException )
{
@@ -1357,7 +1356,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod
throw packages::WrongPasswordException();
}
- xResultStream = GetStream( nStreamMode, aGlobalPass, bHierarchyAccess );
+ xResultStream = GetStream( nStreamMode, aGlobalEncryptionData, bHierarchyAccess );
}
else
xResultStream = GetStream_Impl( nStreamMode, bHierarchyAccess );
@@ -1386,7 +1385,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream_Impl( sal_Int32 nStre
if ( !xInStream.is() )
throw io::IOException();
- OInputCompStream* pStream = new OInputCompStream( *this, xInStream, InsertOwnProps( m_aProps, m_bUseCommonPass ), m_nStorageType );
+ OInputCompStream* pStream = new OInputCompStream( *this, xInStream, InsertOwnProps( m_aProps, m_bUseCommonEncryption ), m_nStorageType );
uno::Reference< io::XStream > xCompStream(
static_cast< ::cppu::OWeakObject* >( pStream ),
uno::UNO_QUERY );
@@ -1411,7 +1410,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream_Impl( sal_Int32 nStre
if ( !xInStream.is() )
throw io::IOException();
- OInputSeekStream* pStream = new OInputSeekStream( *this, xInStream, InsertOwnProps( m_aProps, m_bUseCommonPass ), m_nStorageType );
+ OInputSeekStream* pStream = new OInputSeekStream( *this, xInStream, InsertOwnProps( m_aProps, m_bUseCommonEncryption ), m_nStorageType );
uno::Reference< io::XStream > xSeekStream(
static_cast< ::cppu::OWeakObject* >( pStream ),
uno::UNO_QUERY );
@@ -1513,7 +1512,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetRawInStream()
}
//-----------------------------------------------
-::rtl::OUString OWriteStream_Impl::GetCommonRootPass()
+::comphelper::SequenceAsHashMap OWriteStream_Impl::GetCommonRootEncryptionData()
throw ( packages::NoEncryptionException )
{
::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ;
@@ -1521,7 +1520,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetRawInStream()
if ( m_nStorageType != embed::StorageFormats::PACKAGE || !m_pParent )
throw packages::NoEncryptionException();
- return m_pParent->GetCommonRootPass();
+ return m_pParent->GetCommonRootEncryptionData();
}
//-----------------------------------------------
@@ -1560,11 +1559,11 @@ void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( const uno::Reference< io:
if ( !xInStream.is() )
throw io::IOException();
- // TODO: remember last state of m_bUseCommonPass
+ // TODO: remember last state of m_bUseCommonEncryption
if ( !xTargetStream.is() )
xTargetStream = uno::Reference< io::XStream > (
static_cast< ::cppu::OWeakObject* >(
- new OInputSeekStream( xInStream, InsertOwnProps( aProps, m_bUseCommonPass ), m_nStorageType ) ),
+ new OInputSeekStream( xInStream, InsertOwnProps( aProps, m_bUseCommonEncryption ), m_nStorageType ) ),
uno::UNO_QUERY_THROW );
}
@@ -1581,10 +1580,10 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
if ( IsEncrypted() )
{
// an encrypted stream must contain input stream
- ::rtl::OUString aGlobalPass;
+ ::comphelper::SequenceAsHashMap aGlobalEncryptionData;
try
{
- aGlobalPass = GetCommonRootPass();
+ aGlobalEncryptionData = GetCommonRootEncryptionData();
}
catch( packages::NoEncryptionException& aNoEncryptionException )
{
@@ -1594,7 +1593,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
throw packages::WrongPasswordException();
}
- GetCopyOfLastCommit( xTargetStream, aGlobalPass );
+ GetCopyOfLastCommit( xTargetStream, aGlobalEncryptionData );
}
else
{
@@ -1603,12 +1602,12 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
// in case of new inserted package stream it is possible that input stream still was not set
GetStreamProperties();
- CreateReadonlyCopyBasedOnData( xDataToCopy, m_aProps, m_bUseCommonPass, xTargetStream );
+ CreateReadonlyCopyBasedOnData( xDataToCopy, m_aProps, m_bUseCommonEncryption, xTargetStream );
}
}
//-----------------------------------------------
-void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTargetStream, const ::rtl::OUString& aPass )
+void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTargetStream, const ::comphelper::SequenceAsHashMap& aEncryptionData )
{
::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
@@ -1621,12 +1620,12 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
uno::Reference< io::XInputStream > xDataToCopy;
- if ( m_bHasCachedPassword )
+ if ( m_bHasCachedEncryptionData )
{
// TODO: introduce last commited cashed password information and use it here
// that means "use common pass" also should be remembered on flash
- uno::Sequence< sal_Int8 > aNewKey = ::package::MakeKeyFromPass( aPass, sal_True );
- uno::Sequence< sal_Int8 > aOldKey = ::package::MakeKeyFromPass( aPass, sal_False );
+ uno::Sequence< sal_Int8 > aNewKey = aEncryptionData.getUnpackedValueOrDefault( PACKAGE_ENCRYPTIONDATA_SHA1UTF8, uno::Sequence< sal_Int8 >() );
+ uno::Sequence< sal_Int8 > aOldKey = aEncryptionData.getUnpackedValueOrDefault( PACKAGE_ENCRYPTIONDATA_SHA1MS1252, uno::Sequence< sal_Int8 >() );
uno::Reference< beans::XPropertySet > xProps( m_xPackageStream, uno::UNO_QUERY );
if ( !xProps.is() )
@@ -1648,7 +1647,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
else
{
uno::Reference< beans::XPropertySet > xPropertySet( m_xPackageStream, uno::UNO_QUERY );
- SetEncryptionKeyProperty_Impl( xPropertySet, ::package::MakeKeyFromPass( aPass, sal_True ) );
+ SetEncryptionKeyProperty_Impl( xPropertySet, aEncryptionData.getUnpackedValueOrDefault( PACKAGE_ENCRYPTIONDATA_SHA1UTF8, uno::Sequence< sal_Int8 >() ) );
try {
xDataToCopy = m_xPackageStream->getDataStream();
@@ -1661,7 +1660,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
}
catch( packages::WrongPasswordException& aWrongPasswordException )
{
- SetEncryptionKeyProperty_Impl( xPropertySet, ::package::MakeKeyFromPass( aPass, sal_False ) );
+ SetEncryptionKeyProperty_Impl( xPropertySet, aEncryptionData.getUnpackedValueOrDefault( PACKAGE_ENCRYPTIONDATA_SHA1MS1252, uno::Sequence< sal_Int8 >() ) );
try {
xDataToCopy = m_xPackageStream->getDataStream();
@@ -1697,7 +1696,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
// in case of new inserted package stream it is possible that input stream still was not set
GetStreamProperties();
- CreateReadonlyCopyBasedOnData( xDataToCopy, m_aProps, m_bUseCommonPass, xTargetStream );
+ CreateReadonlyCopyBasedOnData( xDataToCopy, m_aProps, m_bUseCommonEncryption, xTargetStream );
}
//-----------------------------------------------
@@ -2029,6 +2028,7 @@ uno::Any SAL_CALL OWriteStream::queryInterface( const uno::Type& rType )
{
aReturn <<= ::cppu::queryInterface
( rType
+ , static_cast<embed::XEncryptionProtectedSource2*> ( this )
, static_cast<embed::XEncryptionProtectedSource*> ( this ) );
}
else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML )
@@ -2081,7 +2081,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
{
if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE )
{
- m_pData->m_pTypeCollection = new ::cppu::OTypeCollection
+ ::cppu::OTypeCollection aTmpCollection
( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL )
, ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL )
, ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL )
@@ -2089,11 +2089,15 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
, ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL )
, ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL )
, ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL )
+ , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource2 >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XExtendedStorageStream >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL )
- , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL )
- , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) );
+ , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) );
+
+ m_pData->m_pTypeCollection = new ::cppu::OTypeCollection
+ ( ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL )
+ , aTmpCollection.getTypes() );
}
else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML )
{
@@ -2139,6 +2143,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
, ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL )
, ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL )
, ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL )
+ , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource2 >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL )
, ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) );
}
@@ -2703,7 +2708,7 @@ void SAL_CALL OWriteStream::setEncryptionPassword( const ::rtl::OUString& aPass
OSL_ENSURE( m_pImpl->m_xPackageStream.is(), "No package stream is set!\n" );
- m_pImpl->SetEncryptedWithPass( aPass );
+ m_pImpl->SetEncrypted( ::comphelper::OStorageHelper::CreatePackageEncryptionData( aPass ) );
ModifyParentUnlockMutex_Impl( aGuard );
}
@@ -2731,6 +2736,27 @@ void SAL_CALL OWriteStream::removeEncryption()
}
//-----------------------------------------------
+void SAL_CALL OWriteStream::setEncryptionData( const uno::Sequence< beans::NamedValue >& aEncryptionData )
+ throw (io::IOException, uno::RuntimeException)
+{
+ ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
+
+ CheckInitOnDemand();
+
+ if ( !m_pImpl )
+ {
+ ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Disposed!" ) ) );
+ throw lang::DisposedException();
+ }
+
+ OSL_ENSURE( m_pImpl->m_xPackageStream.is(), "No package stream is set!\n" );
+
+ m_pImpl->SetEncrypted( aEncryptionData );
+
+ ModifyParentUnlockMutex_Impl( aGuard );
+}
+
+//-----------------------------------------------
sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID )
throw ( io::IOException,
uno::RuntimeException )
@@ -3171,24 +3197,24 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa
else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE
&& aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) )
{
- sal_Bool bUseCommonPass = sal_False;
- if ( aValue >>= bUseCommonPass )
+ sal_Bool bUseCommonEncryption = sal_False;
+ if ( aValue >>= bUseCommonEncryption )
{
if ( m_bInitOnDemand && m_pImpl->m_bHasInsertedStreamOptimization )
{
// the data stream is provided to the packagestream directly
- m_pImpl->m_bUseCommonPass = bUseCommonPass;
+ m_pImpl->m_bUseCommonEncryption = bUseCommonEncryption;
}
- else if ( bUseCommonPass )
+ else if ( bUseCommonEncryption )
{
- if ( !m_pImpl->m_bUseCommonPass )
+ if ( !m_pImpl->m_bUseCommonEncryption )
{
m_pImpl->SetDecrypted();
- m_pImpl->m_bUseCommonPass = sal_True;
+ m_pImpl->m_bUseCommonEncryption = sal_True;
}
}
else
- m_pImpl->m_bUseCommonPass = sal_False;
+ m_pImpl->m_bUseCommonEncryption = sal_False;
}
else
throw lang::IllegalArgumentException(); //TODO
@@ -3283,7 +3309,7 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp )
}
else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE
&& aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) )
- return uno::makeAny( m_pImpl->m_bUseCommonPass );
+ return uno::makeAny( m_pImpl->m_bUseCommonEncryption );
else if ( aPropertyName.equalsAscii( "Size" ) )
{
CheckInitOnDemand();
diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx
index 0d4a29893887..08f862b22f6c 100644
--- a/package/source/xstor/owriteablestream.hxx
+++ b/package/source/xstor/owriteablestream.hxx
@@ -38,7 +38,7 @@
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/embed/XEncryptionProtectedSource.hpp>
+#include <com/sun/star/embed/XEncryptionProtectedSource2.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/XRelationshipAccess.hpp>
#include <com/sun/star/embed/XExtendedStorageStream.hpp>
@@ -53,6 +53,8 @@
#include <cppuhelper/weak.hxx>
#include <cppuhelper/interfacecontainer.h>
+#include <comphelper/sequenceashashmap.hxx>
+
#include <list>
#include "ocompinstream.hxx"
@@ -75,7 +77,7 @@ namespace cppu {
namespace package {
void StaticAddLog( const ::rtl::OUString& aMessage );
- ::com::sun::star::uno::Sequence< sal_Int8 > MakeKeyFromPass( const ::rtl::OUString& aPass, sal_Bool bUseUTF );
+ bool PackageEncryptionDatasEqual( const ::comphelper::SequenceAsHashMap& aHash1, const ::comphelper::SequenceAsHashMap& aHash2 );
}
struct WSInternalData_Impl
@@ -127,9 +129,9 @@ struct OWriteStream_Impl : public PreCreationStruct
sal_Bool m_bForceEncrypted;
- sal_Bool m_bUseCommonPass;
- sal_Bool m_bHasCachedPassword;
- ::rtl::OUString m_aPass;
+ sal_Bool m_bUseCommonEncryption;
+ sal_Bool m_bHasCachedEncryptionData;
+ ::comphelper::SequenceAsHashMap m_aEncryptionData;
sal_Bool m_bCompressedSetExplicit;
@@ -161,12 +163,12 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStream_Impl( sal_Int32 nStreamMode,
sal_Bool bHierarchyAccess );
- ::rtl::OUString GetCommonRootPass() throw ( ::com::sun::star::packages::NoEncryptionException );
+ ::comphelper::SequenceAsHashMap GetCommonRootEncryptionData() throw ( ::com::sun::star::packages::NoEncryptionException );
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > ReadPackageStreamProperties();
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > InsertOwnProps(
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
- sal_Bool bUseCommonPass );
+ sal_Bool bUseCommonEncryption );
public:
OWriteStream_Impl(
@@ -186,7 +188,7 @@ public:
void AddLog( const ::rtl::OUString& aMessage );
- sal_Bool UsesCommonPass_Impl() { return m_bUseCommonPass; }
+ sal_Bool UsesCommonEncryption_Impl() { return m_bUseCommonEncryption; }
sal_Bool HasTempFile_Impl() { return ( m_aTempURL.getLength() != 0 ); }
sal_Bool IsTransacted();
@@ -198,13 +200,14 @@ public:
void SetToBeCommited() { m_bFlushed = sal_True; }
- sal_Bool HasCachedPassword() { return m_bHasCachedPassword; }
- ::rtl::OUString GetCachedPassword() { return m_aPass; }
+ sal_Bool HasCachedEncryptionData() { return m_bHasCachedEncryptionData; }
+ ::comphelper::SequenceAsHashMap& GetCachedEncryptionData() { return m_aEncryptionData; }
+
sal_Bool IsModified() { return m_bHasDataToFlush || m_bFlushed; }
sal_Bool IsEncrypted();
void SetDecrypted();
- void SetEncryptedWithPass( const ::rtl::OUString& aPass );
+ void SetEncrypted( const ::comphelper::SequenceAsHashMap& aEncryptionData );
void DisposeWrappers();
@@ -226,12 +229,12 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny();
void CopyInternallyTo_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDestStream,
- const ::rtl::OUString& aPass );
+ const ::comphelper::SequenceAsHashMap& aEncryptionData );
void CopyInternallyTo_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDestStream );
::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStream(
sal_Int32 nStreamMode,
- const ::rtl::OUString& aPass,
+ const ::comphelper::SequenceAsHashMap& aEncryptionData,
sal_Bool bHierarchyAccess );
::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStream(
@@ -247,13 +250,13 @@ public:
void CreateReadonlyCopyBasedOnData(
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xDataToCopy,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
- sal_Bool bUseCommonPass,
+ sal_Bool bUseCommonEncryption,
::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream );
void GetCopyOfLastCommit( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream );
void GetCopyOfLastCommit(
::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream,
- const ::rtl::OUString& aPass );
+ const ::comphelper::SequenceAsHashMap& aEncryptionData );
void CommitStreamRelInfo(
@@ -272,7 +275,7 @@ class OWriteStream : ::com::sun::star::lang::XTypeProvider
, public ::com::sun::star::embed::XExtendedStorageStream
, public ::com::sun::star::io::XSeekable
, public ::com::sun::star::io::XTruncate
- , public ::com::sun::star::embed::XEncryptionProtectedSource
+ , public ::com::sun::star::embed::XEncryptionProtectedSource2
, public ::com::sun::star::embed::XRelationshipAccess
, public ::com::sun::star::embed::XTransactedObject
, public ::com::sun::star::embed::XTransactionBroadcaster
@@ -366,6 +369,9 @@ public:
throw ( ::com::sun::star::uno::RuntimeException,
::com::sun::star::io::IOException );
+ //XEncryptionProtectedSource2
+ virtual void SAL_CALL setEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
//XRelationshipAccess
virtual ::sal_Bool SAL_CALL hasByID( const ::rtl::OUString& sID ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getTargetByID( const ::rtl::OUString& sID ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 01489c5b4f5d..851fea6b086b 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -208,7 +208,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > xInputStream,
, m_bListCreated( sal_False )
, m_xFactory( xFactory )
, m_xProperties( xProperties )
-, m_bHasCommonPassword( sal_False )
+, m_bHasCommonEncryptionData( sal_False )
, m_pParent( NULL )
, m_bControlMediaType( sal_False )
, m_bMTFallbackUsed( sal_False )
@@ -248,7 +248,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > xStream,
, m_bListCreated( sal_False )
, m_xFactory( xFactory )
, m_xProperties( xProperties )
-, m_bHasCommonPassword( sal_False )
+, m_bHasCommonEncryptionData( sal_False )
, m_pParent( NULL )
, m_bControlMediaType( sal_False )
, m_bMTFallbackUsed( sal_False )
@@ -292,7 +292,7 @@ OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent,
, m_xPackageFolder( xPackageFolder )
, m_xPackage( xPackage )
, m_xFactory( xFactory )
-, m_bHasCommonPassword( sal_False )
+, m_bHasCommonEncryptionData( sal_False )
, m_pParent( pParent ) // can be empty in case of temporary readonly substorages and relation storage
, m_bControlMediaType( sal_False )
, m_bMTFallbackUsed( sal_False )
@@ -749,10 +749,9 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes
{
try
{
- ::rtl::OUString aCommonPass = GetCommonRootPass();
- uno::Reference< embed::XEncryptionProtectedSource > xEncr( xDest, uno::UNO_QUERY );
+ uno::Reference< embed::XEncryptionProtectedSource2 > xEncr( xDest, uno::UNO_QUERY );
if ( xEncr.is() )
- xEncr->setEncryptionPassword( aCommonPass );
+ xEncr->setEncryptionData( GetCommonRootEncryptionData().getAsConstNamedValueList() );
}
catch( packages::NoEncryptionException& aNoEncryptionException )
{
@@ -856,7 +855,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
{
aStrProps.realloc( ++nNum );
aStrProps[nNum-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) );
- aStrProps[nNum-1].Value <<= (sal_Bool)( pElement->m_pStream->UsesCommonPass_Impl() );
+ aStrProps[nNum-1].Value <<= (sal_Bool)( pElement->m_pStream->UsesCommonEncryption_Impl() );
}
else if ( m_nStorageType == embed::StorageFormats::OFOPXML )
{
@@ -914,15 +913,15 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
OSL_ENSURE( sal_False, "Encryption is only supported in package storage!\n" );
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
}
- else if ( pElement->m_pStream->HasCachedPassword()
+ else if ( pElement->m_pStream->HasCachedEncryptionData()
&& ( pElement->m_pStream->IsModified() || pElement->m_pStream->HasWriteOwner_Impl() ) )
{
- ::rtl::OUString aCommonPass;
- sal_Bool bHasCommonPass = sal_False;
+ ::comphelper::SequenceAsHashMap aCommonEncryptionData;
+ sal_Bool bHasCommonEncryptionData = sal_False;
try
{
- aCommonPass = GetCommonRootPass();
- bHasCommonPass = sal_True;
+ aCommonEncryptionData = GetCommonRootEncryptionData();
+ bHasCommonEncryptionData = sal_True;
}
catch( packages::NoEncryptionException& aNoEncryptionException )
{
@@ -930,7 +929,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "No Encryption" ) ) );
}
- if ( bHasCommonPass && pElement->m_pStream->GetCachedPassword().equals( aCommonPass ) )
+ if ( bHasCommonEncryptionData && ::package::PackageEncryptionDatasEqual( pElement->m_pStream->GetCachedEncryptionData(), aCommonEncryptionData ) )
{
// If the stream can be opened with the common storage password
// it must be stored with the common storage password as well
@@ -948,13 +947,14 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
else
{
// the stream is already opened for writing or was changed
+ uno::Reference< embed::XStorage2 > xDest2( xDest, uno::UNO_QUERY_THROW );
uno::Reference< io::XStream > xSubStr =
- xDest->openEncryptedStreamElement( aName,
+ xDest2->openEncryptedStream( aName,
embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE,
- pElement->m_pStream->GetCachedPassword() );
+ pElement->m_pStream->GetCachedEncryptionData().getAsConstNamedValueList() );
OSL_ENSURE( xSubStr.is(), "No destination substream!\n" );
- pElement->m_pStream->CopyInternallyTo_Impl( xSubStr, pElement->m_pStream->GetCachedPassword() );
+ pElement->m_pStream->CopyInternallyTo_Impl( xSubStr, pElement->m_pStream->GetCachedEncryptionData() );
}
}
else
@@ -1361,7 +1361,7 @@ void OStorage_Impl::Revert()
}
//-----------------------------------------------
-::rtl::OUString OStorage_Impl::GetCommonRootPass()
+::comphelper::SequenceAsHashMap OStorage_Impl::GetCommonRootEncryptionData()
throw ( packages::NoEncryptionException )
{
::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ;
@@ -1371,17 +1371,17 @@ void OStorage_Impl::Revert()
if ( m_bIsRoot )
{
- if ( !m_bHasCommonPassword )
+ if ( !m_bHasCommonEncryptionData )
throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
- return m_aCommonPassword;
+ return m_aCommonEncryptionData;
}
else
{
if ( !m_pParent )
throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
- return m_pParent->GetCommonRootPass();
+ return m_pParent->GetCommonRootEncryptionData();
}
}
@@ -1680,8 +1680,8 @@ void OStorage_Impl::ClearElement( SotElement_Impl* pElement )
//-----------------------------------------------
void OStorage_Impl::CloneStreamElement( const ::rtl::OUString& aStreamName,
- sal_Bool bPassProvided,
- const ::rtl::OUString& aPass,
+ sal_Bool bEncryptionDataProvided,
+ const ::comphelper::SequenceAsHashMap& aEncryptionData,
uno::Reference< io::XStream >& xTargetStream )
throw ( embed::InvalidStorageException,
lang::IllegalArgumentException,
@@ -1713,8 +1713,8 @@ void OStorage_Impl::CloneStreamElement( const ::rtl::OUString& aStreamName,
// storage. The only problem is that some package streams can be accessed from outside
// at the same time ( now solwed by wrappers that remember own position ).
- if ( bPassProvided )
- pElement->m_pStream->GetCopyOfLastCommit( xTargetStream, aPass );
+ if ( bEncryptionDataProvided )
+ pElement->m_pStream->GetCopyOfLastCommit( xTargetStream, aEncryptionData );
else
pElement->m_pStream->GetCopyOfLastCommit( xTargetStream );
}
@@ -2248,6 +2248,7 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType )
( rType
, static_cast<lang::XTypeProvider*> ( this )
, static_cast<embed::XStorage*> ( this )
+ , static_cast<embed::XStorage2*> ( this )
, static_cast<embed::XTransactedObject*> ( this )
, static_cast<embed::XTransactionBroadcaster*> ( this )
, static_cast<util::XModifiable*> ( this )
@@ -2255,8 +2256,15 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType )
, static_cast<container::XElementAccess*> ( this )
, static_cast<lang::XComponent*> ( this )
, static_cast<beans::XPropertySet*> ( this )
- , static_cast<embed::XOptimizedStorage*> ( this )
- , static_cast<embed::XHierarchicalStorageAccess*> ( this ) );
+ , static_cast<embed::XOptimizedStorage*> ( this ) );
+
+ if ( aReturn.hasValue() == sal_True )
+ return aReturn ;
+
+ aReturn <<= ::cppu::queryInterface
+ ( rType
+ , static_cast<embed::XHierarchicalStorageAccess*> ( this )
+ , static_cast<embed::XHierarchicalStorageAccess2*> ( this ) );
if ( aReturn.hasValue() == sal_True )
return aReturn ;
@@ -2268,7 +2276,8 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType )
aReturn <<= ::cppu::queryInterface
( rType
, static_cast<embed::XStorageRawAccess*> ( this )
- , static_cast<embed::XEncryptionProtectedSource*> ( this ) );
+ , static_cast<embed::XEncryptionProtectedSource*> ( this )
+ , static_cast<embed::XEncryptionProtectedSource2*> ( this ) );
}
else
{
@@ -2323,10 +2332,12 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes()
m_pData->m_pTypeCollection = new ::cppu::OTypeCollection
( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL )
+ , ::getCppuType( ( const uno::Reference< embed::XStorage2 >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XStorageRawAccess >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL )
, ::getCppuType( ( const uno::Reference< util::XModifiable >* )NULL )
+ , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource2 >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL )
, ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) );
}
@@ -2335,6 +2346,7 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes()
m_pData->m_pTypeCollection = new ::cppu::OTypeCollection
( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL )
+ , ::getCppuType( ( const uno::Reference< embed::XStorage2 >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XStorageRawAccess >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL )
, ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL )
@@ -2566,100 +2578,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStreamElement(
{
RTL_LOGFILE_CONTEXT( aLog, "package (mv76033) OStorage::openEncryptedStreamElement" );
- ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
-
- if ( !m_pImpl )
- {
- ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Disposed!" ) ) );
- throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
- }
-
- if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE )
- packages::NoEncryptionException();
-
- if ( ( nOpenMode & embed::ElementModes::WRITE ) && m_pData->m_bReadOnlyWrap )
- throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO: access denied
-
- if ( !aPass.getLength() )
- throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 3 );
-
- uno::Reference< io::XStream > xResult;
- try
- {
- SotElement_Impl *pElement = OpenStreamElement_Impl( aStreamName, nOpenMode, sal_True );
- OSL_ENSURE( pElement && pElement->m_pStream, "In case element can not be created an exception must be thrown!" );
-
- xResult = pElement->m_pStream->GetStream( nOpenMode, aPass, sal_False );
- OSL_ENSURE( xResult.is(), "The method must throw exception instead of removing empty result!\n" );
-
- if ( m_pData->m_bReadOnlyWrap )
- {
- // before the storage disposes the stream it must deregister itself as listener
- uno::Reference< lang::XComponent > xStreamComponent( xResult, uno::UNO_QUERY );
- if ( !xStreamComponent.is() )
- throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
-
- MakeLinkToSubComponent_Impl( xStreamComponent );
- }
- }
- catch( embed::InvalidStorageException& aInvalidStorageException )
- {
- m_pImpl->AddLog( aInvalidStorageException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( lang::IllegalArgumentException& aIllegalArgumentException )
- {
- m_pImpl->AddLog( aIllegalArgumentException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( packages::NoEncryptionException& aNoEncryptionException )
- {
- m_pImpl->AddLog( aNoEncryptionException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( packages::WrongPasswordException& aWrongPasswordException )
- {
- m_pImpl->AddLog( aWrongPasswordException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( embed::StorageWrappedTargetException& aStorageWrappedTargetException )
- {
- m_pImpl->AddLog( aStorageWrappedTargetException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( io::IOException& aIOException )
- {
- m_pImpl->AddLog( aIOException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( uno::RuntimeException& aRuntimeException )
- {
- m_pImpl->AddLog( aRuntimeException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( uno::Exception& aException )
- {
- m_pImpl->AddLog( aException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
-
- uno::Any aCaught( ::cppu::getCaughtException() );
- throw embed::StorageWrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't open encrypted stream stream!" ) ),
- uno::Reference< io::XInputStream >(),
- aCaught );
- }
-
- aGuard.clear();
-
- BroadcastModifiedIfNecessary();
-
- return xResult;
+ return openEncryptedStream( aStreamName, nOpenMode, ::comphelper::OStorageHelper::CreatePackageEncryptionData( aPass ) );
}
//-----------------------------------------------
@@ -2846,7 +2765,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneStreamElement( const ::rtl
try
{
uno::Reference< io::XStream > xResult;
- m_pImpl->CloneStreamElement( aStreamName, sal_False, ::rtl::OUString(), xResult );
+ m_pImpl->CloneStreamElement( aStreamName, sal_False, ::comphelper::SequenceAsHashMap(), xResult );
if ( !xResult.is() )
throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
return xResult;
@@ -2913,80 +2832,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStreamElement(
{
RTL_LOGFILE_CONTEXT( aLog, "package (mv76033) OStorage::cloneEncryptedStreamElement" );
- ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
-
- if ( !m_pImpl )
- {
- ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Disposed!" ) ) );
- throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
- }
-
- if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE )
- packages::NoEncryptionException();
-
- if ( !aPass.getLength() )
- throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 );
-
- try
- {
- uno::Reference< io::XStream > xResult;
- m_pImpl->CloneStreamElement( aStreamName, sal_True, aPass, xResult );
- if ( !xResult.is() )
- throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
- return xResult;
- }
- catch( embed::InvalidStorageException& aInvalidStorageException )
- {
- m_pImpl->AddLog( aInvalidStorageException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( lang::IllegalArgumentException& aIllegalArgumentException )
- {
- m_pImpl->AddLog( aIllegalArgumentException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( packages::NoEncryptionException& aNoEncryptionException )
- {
- m_pImpl->AddLog( aNoEncryptionException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( packages::WrongPasswordException& aWrongPasswordException )
- {
- m_pImpl->AddLog( aWrongPasswordException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( io::IOException& aIOException )
- {
- m_pImpl->AddLog( aIOException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( embed::StorageWrappedTargetException& aStorageWrappedTargetException )
- {
- m_pImpl->AddLog( aStorageWrappedTargetException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( uno::RuntimeException& aRuntimeException )
- {
- m_pImpl->AddLog( aRuntimeException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- throw;
- }
- catch( uno::Exception& aException )
- {
- m_pImpl->AddLog( aException.Message );
- m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
-
- uno::Any aCaught( ::cppu::getCaughtException() );
- throw embed::StorageWrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't clone encrypted stream!" ) ),
- uno::Reference< io::XInputStream >(),
- aCaught );
- }
+ return cloneEncryptedStream( aStreamName, ::comphelper::OStorageHelper::CreatePackageEncryptionData( aPass ) );
}
//-----------------------------------------------
@@ -3711,6 +3557,210 @@ void SAL_CALL OStorage::moveElementTo( const ::rtl::OUString& aElementName,
}
//____________________________________________________________________________________________________
+// XStorage2
+//____________________________________________________________________________________________________
+
+//-----------------------------------------------
+uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStream(
+ const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, const uno::Sequence< beans::NamedValue >& aEncryptionData )
+ throw ( embed::InvalidStorageException,
+ lang::IllegalArgumentException,
+ packages::NoEncryptionException,
+ packages::WrongPasswordException,
+ io::IOException,
+ embed::StorageWrappedTargetException,
+ uno::RuntimeException )
+{
+ RTL_LOGFILE_CONTEXT( aLog, "package (mv76033) OStorage::openEncryptedStream" );
+
+ ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
+
+ if ( !m_pImpl )
+ {
+ ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Disposed!" ) ) );
+ throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
+ }
+
+ if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE )
+ packages::NoEncryptionException();
+
+ if ( ( nOpenMode & embed::ElementModes::WRITE ) && m_pData->m_bReadOnlyWrap )
+ throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO: access denied
+
+ if ( !aEncryptionData.getLength() )
+ throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 3 );
+
+ uno::Reference< io::XStream > xResult;
+ try
+ {
+ SotElement_Impl *pElement = OpenStreamElement_Impl( aStreamName, nOpenMode, sal_True );
+ OSL_ENSURE( pElement && pElement->m_pStream, "In case element can not be created an exception must be thrown!" );
+
+ xResult = pElement->m_pStream->GetStream( nOpenMode, aEncryptionData, sal_False );
+ OSL_ENSURE( xResult.is(), "The method must throw exception instead of removing empty result!\n" );
+
+ if ( m_pData->m_bReadOnlyWrap )
+ {
+ // before the storage disposes the stream it must deregister itself as listener
+ uno::Reference< lang::XComponent > xStreamComponent( xResult, uno::UNO_QUERY );
+ if ( !xStreamComponent.is() )
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
+
+ MakeLinkToSubComponent_Impl( xStreamComponent );
+ }
+ }
+ catch( embed::InvalidStorageException& aInvalidStorageException )
+ {
+ m_pImpl->AddLog( aInvalidStorageException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( lang::IllegalArgumentException& aIllegalArgumentException )
+ {
+ m_pImpl->AddLog( aIllegalArgumentException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( packages::NoEncryptionException& aNoEncryptionException )
+ {
+ m_pImpl->AddLog( aNoEncryptionException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( packages::WrongPasswordException& aWrongPasswordException )
+ {
+ m_pImpl->AddLog( aWrongPasswordException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( embed::StorageWrappedTargetException& aStorageWrappedTargetException )
+ {
+ m_pImpl->AddLog( aStorageWrappedTargetException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( io::IOException& aIOException )
+ {
+ m_pImpl->AddLog( aIOException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( uno::RuntimeException& aRuntimeException )
+ {
+ m_pImpl->AddLog( aRuntimeException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( uno::Exception& aException )
+ {
+ m_pImpl->AddLog( aException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+
+ uno::Any aCaught( ::cppu::getCaughtException() );
+ throw embed::StorageWrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't open encrypted stream stream!" ) ),
+ uno::Reference< io::XInputStream >(),
+ aCaught );
+ }
+
+ aGuard.clear();
+
+ BroadcastModifiedIfNecessary();
+
+ return xResult;
+}
+
+//-----------------------------------------------
+uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStream(
+ const ::rtl::OUString& aStreamName,
+ const uno::Sequence< beans::NamedValue >& aEncryptionData )
+ throw ( embed::InvalidStorageException,
+ lang::IllegalArgumentException,
+ packages::NoEncryptionException,
+ packages::WrongPasswordException,
+ io::IOException,
+ embed::StorageWrappedTargetException,
+ uno::RuntimeException )
+{
+ RTL_LOGFILE_CONTEXT( aLog, "package (mv76033) OStorage::cloneEncryptedStream" );
+
+ ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
+
+ if ( !m_pImpl )
+ {
+ ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Disposed!" ) ) );
+ throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
+ }
+
+ if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE )
+ packages::NoEncryptionException();
+
+ if ( !aEncryptionData.getLength() )
+ throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 );
+
+ try
+ {
+ uno::Reference< io::XStream > xResult;
+ m_pImpl->CloneStreamElement( aStreamName, sal_True, aEncryptionData, xResult );
+ if ( !xResult.is() )
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
+ return xResult;
+ }
+ catch( embed::InvalidStorageException& aInvalidStorageException )
+ {
+ m_pImpl->AddLog( aInvalidStorageException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( lang::IllegalArgumentException& aIllegalArgumentException )
+ {
+ m_pImpl->AddLog( aIllegalArgumentException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( packages::NoEncryptionException& aNoEncryptionException )
+ {
+ m_pImpl->AddLog( aNoEncryptionException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( packages::WrongPasswordException& aWrongPasswordException )
+ {
+ m_pImpl->AddLog( aWrongPasswordException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( io::IOException& aIOException )
+ {
+ m_pImpl->AddLog( aIOException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( embed::StorageWrappedTargetException& aStorageWrappedTargetException )
+ {
+ m_pImpl->AddLog( aStorageWrappedTargetException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( uno::RuntimeException& aRuntimeException )
+ {
+ m_pImpl->AddLog( aRuntimeException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+ throw;
+ }
+ catch( uno::Exception& aException )
+ {
+ m_pImpl->AddLog( aException.Message );
+ m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
+
+ uno::Any aCaught( ::cppu::getCaughtException() );
+ throw embed::StorageWrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't clone encrypted stream!" ) ),
+ uno::Reference< io::XInputStream >(),
+ aCaught );
+ }
+}
+
+
+//____________________________________________________________________________________________________
// XStorageRawAccess
//____________________________________________________________________________________________________
@@ -4598,6 +4648,15 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass )
io::IOException )
{
RTL_LOGFILE_CONTEXT( aLog, "package (mv76033) OStorage::setEncryptionPassword" );
+ setEncryptionData( ::comphelper::OStorageHelper::CreatePackageEncryptionData( aPass ) );
+}
+
+//-----------------------------------------------
+void SAL_CALL OStorage::removeEncryption()
+ throw ( uno::RuntimeException,
+ io::IOException )
+{
+ RTL_LOGFILE_CONTEXT( aLog, "package (mv76033) OStorage::removeEncryption" );
::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
@@ -4610,8 +4669,7 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass )
if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage
- OSL_ENSURE( m_pData->m_bIsRoot, "setEncryptionPassword() method is not available for nonroot storages!\n" );
-
+ OSL_ENSURE( m_pData->m_bIsRoot, "removeEncryption() method is not available for nonroot storages!\n" );
if ( m_pData->m_bIsRoot )
{
try {
@@ -4629,12 +4687,15 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass )
m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
uno::Any aCaught( ::cppu::getCaughtException() );
- throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can not open package!\n" ) ),
+ throw lang::WrappedTargetRuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can not open package!\n" ) ),
uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ),
uno::UNO_QUERY ),
aCaught );
}
+ // TODO: check if the password is valid
+ // update all streams that was encrypted with old password
+
uno::Reference< beans::XPropertySet > xPackPropSet( m_pImpl->m_xPackage, uno::UNO_QUERY );
if ( !xPackPropSet.is() )
throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
@@ -4642,10 +4703,10 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass )
try
{
xPackPropSet->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionKey" ) ),
- uno::makeAny( ::package::MakeKeyFromPass( aPass, sal_True ) ) );
+ uno::makeAny( uno::Sequence< sal_Int8 >() ) );
- m_pImpl->m_bHasCommonPassword = sal_True;
- m_pImpl->m_aCommonPassword = aPass;
+ m_pImpl->m_bHasCommonEncryptionData = sal_False;
+ m_pImpl->m_aCommonEncryptionData.clear();
}
catch( uno::Exception& aException )
{
@@ -4658,12 +4719,15 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass )
}
}
-//-----------------------------------------------
-void SAL_CALL OStorage::removeEncryption()
- throw ( uno::RuntimeException,
- io::IOException )
+//____________________________________________________________________________________________________
+// XEncryptionProtectedSource2
+//____________________________________________________________________________________________________
+
+void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValue >& aEncryptionData )
+ throw ( io::IOException,
+ uno::RuntimeException )
{
- RTL_LOGFILE_CONTEXT( aLog, "package (mv76033) OStorage::removeEncryption" );
+ RTL_LOGFILE_CONTEXT( aLog, "package (mv76033) OStorage::setEncryptionData" );
::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
@@ -4676,8 +4740,10 @@ void SAL_CALL OStorage::removeEncryption()
if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage
- OSL_ENSURE( m_pData->m_bIsRoot, "removeEncryption() method is not available for nonroot storages!\n" );
+ if ( !aEncryptionData.getLength() )
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected empty encryption data!") ), uno::Reference< uno::XInterface >() );
+ OSL_ENSURE( m_pData->m_bIsRoot, "setEncryptionData() method is not available for nonroot storages!\n" );
if ( m_pData->m_bIsRoot )
{
try {
@@ -4695,38 +4761,37 @@ void SAL_CALL OStorage::removeEncryption()
m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
uno::Any aCaught( ::cppu::getCaughtException() );
- throw lang::WrappedTargetRuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can not open package!\n" ) ),
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can not open package!\n" ) ),
uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ),
uno::UNO_QUERY ),
aCaught );
}
- // TODO: check if the password is valid
- // update all streams that was encrypted with old password
-
uno::Reference< beans::XPropertySet > xPackPropSet( m_pImpl->m_xPackage, uno::UNO_QUERY );
if ( !xPackPropSet.is() )
throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
try
{
+ ::comphelper::SequenceAsHashMap aEncryptionMap( aEncryptionData );
xPackPropSet->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionKey" ) ),
- uno::makeAny( uno::Sequence< sal_Int8 >() ) );
+ uno::makeAny( aEncryptionMap.getUnpackedValueOrDefault( PACKAGE_ENCRYPTIONDATA_SHA1UTF8, uno::Sequence< sal_Int8 >() ) ) );
- m_pImpl->m_bHasCommonPassword = sal_False;
- m_pImpl->m_aCommonPassword = ::rtl::OUString();
+ m_pImpl->m_bHasCommonEncryptionData = sal_True;
+ m_pImpl->m_aCommonEncryptionData = aEncryptionMap;
}
catch( uno::Exception& aException )
{
m_pImpl->AddLog( aException.Message );
m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- OSL_ENSURE( sal_False, "The call must not fail, it is pretty simple!" );
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
}
}
+
}
+
//____________________________________________________________________________________________________
// XPropertySet
//____________________________________________________________________________________________________
@@ -5944,7 +6009,7 @@ void SAL_CALL OStorage::copyStreamElementData( const ::rtl::OUString& aStreamNam
try
{
uno::Reference< io::XStream > xNonconstRef = xTargetStream;
- m_pImpl->CloneStreamElement( aStreamName, sal_False, ::rtl::OUString(), xNonconstRef );
+ m_pImpl->CloneStreamElement( aStreamName, sal_False, ::comphelper::SequenceAsHashMap(), xNonconstRef );
OSL_ENSURE( xNonconstRef == xTargetStream, "The provided stream reference seems not be filled in correctly!\n" );
if ( xNonconstRef != xTargetStream )
@@ -6073,6 +6138,55 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted
embed::StorageWrappedTargetException,
uno::RuntimeException )
{
+ return openEncryptedStreamByHierarchicalName( aStreamPath, nOpenMode, ::comphelper::OStorageHelper::CreatePackageEncryptionData( sPassword ) );
+}
+
+//-----------------------------------------------
+void SAL_CALL OStorage::removeStreamElementByHierarchicalName( const ::rtl::OUString& aStreamPath )
+ throw ( embed::InvalidStorageException,
+ lang::IllegalArgumentException,
+ container::NoSuchElementException,
+ io::IOException,
+ embed::StorageWrappedTargetException,
+ uno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
+
+ if ( !m_pImpl )
+ {
+ ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Disposed!" ) ) );
+ throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
+ }
+
+ if ( !aStreamPath.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, sal_True ) )
+ throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 );
+
+ if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) )
+ throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // Access denied
+
+ OStringList_Impl aListPath = OHierarchyHolder_Impl::GetListPathFromString( aStreamPath );
+ OSL_ENSURE( aListPath.size(), "The result list must not be empty!" );
+
+ if ( !m_pData->m_rHierarchyHolder.is() )
+ m_pData->m_rHierarchyHolder = new OHierarchyHolder_Impl(
+ uno::Reference< embed::XStorage >( static_cast< embed::XStorage* >( this ) ) );
+
+ m_pData->m_rHierarchyHolder->RemoveStreamHierarchically( aListPath );
+}
+
+//____________________________________________________________________________________________________
+// XHierarchicalStorageAccess2
+//____________________________________________________________________________________________________
+
+uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncryptedStreamByHierarchicalName( const ::rtl::OUString& aStreamPath, ::sal_Int32 nOpenMode, const uno::Sequence< beans::NamedValue >& aEncryptionData )
+ throw ( embed::InvalidStorageException,
+ lang::IllegalArgumentException,
+ packages::NoEncryptionException,
+ packages::WrongPasswordException,
+ io::IOException,
+ embed::StorageWrappedTargetException,
+ uno::RuntimeException )
+{
::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
if ( !m_pImpl )
@@ -6087,7 +6201,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted
if ( !aStreamPath.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, sal_True ) )
throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 );
- if ( !sPassword.getLength() )
+ if ( !aEncryptionData.getLength() )
throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 3 );
if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE )
@@ -6107,7 +6221,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted
OSL_ENSURE( pElement && pElement->m_pStream, "In case element can not be created an exception must be thrown!" );
xResult = uno::Reference< embed::XExtendedStorageStream >(
- pElement->m_pStream->GetStream( nOpenMode, sPassword, sal_True ),
+ pElement->m_pStream->GetStream( nOpenMode, aEncryptionData, sal_True ),
uno::UNO_QUERY_THROW );
}
else
@@ -6121,7 +6235,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted
( m_pImpl->m_nStorageMode & embed::ElementModes::READWRITE ),
aListPath,
nOpenMode,
- sPassword );
+ aEncryptionData );
}
if ( !xResult.is() )
@@ -6130,36 +6244,4 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted
return xResult;
}
-//-----------------------------------------------
-void SAL_CALL OStorage::removeStreamElementByHierarchicalName( const ::rtl::OUString& aStreamPath )
- throw ( embed::InvalidStorageException,
- lang::IllegalArgumentException,
- container::NoSuchElementException,
- io::IOException,
- embed::StorageWrappedTargetException,
- uno::RuntimeException )
-{
- ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
-
- if ( !m_pImpl )
- {
- ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Disposed!" ) ) );
- throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
- }
-
- if ( !aStreamPath.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, sal_True ) )
- throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 );
-
- if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) )
- throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // Access denied
-
- OStringList_Impl aListPath = OHierarchyHolder_Impl::GetListPathFromString( aStreamPath );
- OSL_ENSURE( aListPath.size(), "The result list must not be empty!" );
-
- if ( !m_pData->m_rHierarchyHolder.is() )
- m_pData->m_rHierarchyHolder = new OHierarchyHolder_Impl(
- uno::Reference< embed::XStorage >( static_cast< embed::XStorage* >( this ) ) );
-
- m_pData->m_rHierarchyHolder->RemoveStreamHierarchically( aListPath );
-}
diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx
index f1c50e4d67bd..a49de3af6f3a 100644
--- a/package/source/xstor/xstorage.hxx
+++ b/package/source/xstor/xstorage.hxx
@@ -29,14 +29,14 @@
#define __XSTORAGE_HXX_
#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/embed/XStorage2.hpp>
#include <com/sun/star/embed/XOptimizedStorage.hpp>
-#include <com/sun/star/embed/XHierarchicalStorageAccess.hpp>
+#include <com/sun/star/embed/XHierarchicalStorageAccess2.hpp>
#include <com/sun/star/embed/XStorageRawAccess.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/embed/XTransactionBroadcaster.hpp>
#include <com/sun/star/embed/XClassifiedObject.hpp>
-#include <com/sun/star/embed/XEncryptionProtectedSource.hpp>
+#include <com/sun/star/embed/XEncryptionProtectedSource2.hpp>
#include <com/sun/star/embed/XRelationshipAccess.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -52,8 +52,10 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/packages/NoEncryptionException.hpp>
#include <com/sun/star/logging/XSimpleLogRing.hpp>
+
#include <cppuhelper/weak.hxx>
#include <cppuhelper/interfacecontainer.h>
+#include <comphelper/sequenceashashmap.hxx>
#include "mutexholder.hxx"
@@ -157,8 +159,8 @@ struct OStorage_Impl
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; // ??? may be stored in properties
::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream; // ??? may be stored in properties
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_xProperties;
- sal_Bool m_bHasCommonPassword;
- ::rtl::OUString m_aCommonPassword;
+ sal_Bool m_bHasCommonEncryptionData;
+ ::comphelper::SequenceAsHashMap m_aCommonEncryptionData;
// must be empty in case of root storage
OStorage_Impl* m_pParent;
@@ -231,7 +233,7 @@ struct OStorage_Impl
void Commit();
void Revert();
- ::rtl::OUString GetCommonRootPass() throw ( ::com::sun::star::packages::NoEncryptionException );
+ ::comphelper::SequenceAsHashMap GetCommonRootEncryptionData() throw ( ::com::sun::star::packages::NoEncryptionException );
void CopyToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
sal_Bool bDirect );
@@ -264,7 +266,7 @@ struct OStorage_Impl
void CloneStreamElement(
const ::rtl::OUString& aStreamName,
sal_Bool bPassProvided,
- const ::rtl::OUString& aPass,
+ const ::comphelper::SequenceAsHashMap& aEncryptionData,
::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream )
throw ( ::com::sun::star::embed::InvalidStorageException,
::com::sun::star::lang::IllegalArgumentException,
@@ -289,18 +291,18 @@ struct OStorage_Impl
class OStorage : public ::com::sun::star::lang::XTypeProvider
- , public ::com::sun::star::embed::XStorage
+ , public ::com::sun::star::embed::XStorage2
, public ::com::sun::star::embed::XStorageRawAccess
, public ::com::sun::star::embed::XTransactedObject
, public ::com::sun::star::embed::XTransactionBroadcaster
, public ::com::sun::star::util::XModifiable
// , public ::com::sun::star::container::XNameAccess
// , public ::com::sun::star::lang::XComponent
- , public ::com::sun::star::embed::XEncryptionProtectedSource
+ , public ::com::sun::star::embed::XEncryptionProtectedSource2
, public ::com::sun::star::beans::XPropertySet
, public ::com::sun::star::embed::XOptimizedStorage
, public ::com::sun::star::embed::XRelationshipAccess
- , public ::com::sun::star::embed::XHierarchicalStorageAccess
+ , public ::com::sun::star::embed::XHierarchicalStorageAccess2
, public ::cppu::OWeakObject
{
OStorage_Impl* m_pImpl;
@@ -490,6 +492,28 @@ public:
::com::sun::star::uno::RuntimeException );
//____________________________________________________________________________________________________
+ // XStorage2
+ //____________________________________________________________________________________________________
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openEncryptedStream( const ::rtl::OUString& sStreamName, ::sal_Int32 nOpenMode, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData )
+ throw ( ::com::sun::star::embed::InvalidStorageException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::packages::NoEncryptionException,
+ ::com::sun::star::packages::WrongPasswordException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::embed::StorageWrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneEncryptedStream( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData )
+ throw ( ::com::sun::star::embed::InvalidStorageException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::packages::NoEncryptionException,
+ ::com::sun::star::packages::WrongPasswordException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::embed::StorageWrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
// XStorageRawAccess
//____________________________________________________________________________________________________
@@ -616,6 +640,16 @@ public:
::com::sun::star::io::IOException );
//____________________________________________________________________________________________________
+ // XEncryptionProtectedSource2
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL setEncryptionData(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData )
+ throw ( ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::RuntimeException );
+
+
+ //____________________________________________________________________________________________________
// XPropertySet
//____________________________________________________________________________________________________
@@ -800,6 +834,18 @@ public:
::com::sun::star::embed::StorageWrappedTargetException,
::com::sun::star::uno::RuntimeException);
+ //____________________________________________________________________________________________________
+ // XHierarchicalStorageAccess2
+ //____________________________________________________________________________________________________
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openEncryptedStreamByHierarchicalName( const ::rtl::OUString& sStreamName, ::sal_Int32 nOpenMode, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData )
+ throw ( ::com::sun::star::embed::InvalidStorageException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::packages::NoEncryptionException,
+ ::com::sun::star::packages::WrongPasswordException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::embed::StorageWrappedTargetException,
+ ::com::sun::star::uno::RuntimeException );
};
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index c99cd22d3b4c..fca0e09f63bd 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1644,7 +1644,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const
throw PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EncryptionKey") ) )
{
- if (!( aValue >>= m_aEncryptionKey ) )
+ if (!( aValue >>= m_aEncryptionKey ) || m_aEncryptionKey.getLength() == 0 )
throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 );
}
else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UseManifest") ) )
diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk
index 521b69abdb5c..4cc574249fae 100644
--- a/postprocess/packcomponents/makefile.mk
+++ b/postprocess/packcomponents/makefile.mk
@@ -98,6 +98,7 @@ my_components = \
mcnttype \
migrationoo2 \
msforms \
+ msword \
mysql \
odbc \
offacc \
diff --git a/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk b/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk
index d68a2f8cedc8..008f50518ff1 100644
--- a/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk
+++ b/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk
@@ -32,12 +32,15 @@ PACKAGE = com$/sun$/star$/report$/function$/metadata
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
+.INCLUDE : $(SOLARBINDIR)/jfreereport_version.mk
#----- compile .java files -----------------------------------------
.IF "$(SYSTEM_JFREEREPORT)" == "YES"
EXTRAJARFILES = $(LIBBASE_JAR) $(LIBFORMULA_JAR)
.ELSE
-JARFILES = libbase-1.0.0.jar libformula-0.2.0.jar
+JARFILES += \
+ libbase-$(LIBBASE_VERSION).jar \
+ libformula-$(LIBFORMULA_VERSION).jar
.ENDIF
JAVAFILES := AuthorFunction.java \
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/Manifest.mf b/reportbuilder/java/com/sun/star/report/pentaho/Manifest.mf
index 70f3ff695cbb..5d27005f2d65 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/Manifest.mf
+++ b/reportbuilder/java/com/sun/star/report/pentaho/Manifest.mf
@@ -1,7 +1,7 @@
RegistrationClassName: com.sun.star.report.pentaho.SOReportJobFactory
Class-Path: reportbuilderwizard.jar
- flute-1.3.0.jar libserializer-1.0.0.jar libbase-1.0.0.jar
- libfonts-1.0.0.jar libformula-0.2.0.jar liblayout-0.2.9.jar
- libloader-1.0.0.jar librepository-1.0.0.jar libxml-1.0.0.jar
- flow-engine-0.9.2.jar sac.jar commons-logging-1.1.1.jar
+ flute-1.1.6.jar libserializer-1.1.6.jar libbase-1.1.6.jar
+ libfonts-1.1.6.jar libformula-1.1.7.jar liblayout-0.2.10.jar
+ libloader-1.1.6.jar librepository-1.1.6.jar libxml-1.1.7.jar
+ flow-engine-0.9.4.jar sac.jar commons-logging-1.1.1.jar
UNO-Type-Path:
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java b/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java
index fc637001d766..97b3db27201e 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java
@@ -34,6 +34,7 @@ import java.util.HashMap;
import java.util.Map;
import org.pentaho.reporting.libraries.resourceloader.ResourceData;
+import org.pentaho.reporting.libraries.resourceloader.ResourceException;
import org.pentaho.reporting.libraries.resourceloader.ResourceKey;
import org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException;
import org.pentaho.reporting.libraries.resourceloader.ResourceLoader;
@@ -169,4 +170,19 @@ public class InputRepositoryLoader implements ResourceLoader
{
return resourceManager;
}
+
+ public boolean isSupportedDeserializer(String string)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public String serialize(ResourceKey rk, ResourceKey rk1) throws ResourceException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public ResourceKey deserialize(ResourceKey rk, String string) throws ResourceKeyCreationException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/makefile.mk b/reportbuilder/java/com/sun/star/report/pentaho/makefile.mk
index 9280fcd71b70..d309e1da8385 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/makefile.mk
+++ b/reportbuilder/java/com/sun/star/report/pentaho/makefile.mk
@@ -33,13 +33,25 @@ PACKAGE = com$/sun$/star$/report$/pentaho
nodep=true
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
+.INCLUDE : $(SOLARBINDIR)/jfreereport_version.mk
#----- compile .java files -----------------------------------------
JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar
.IF "$(SYSTEM_JFREEREPORT)" == "YES"
EXTRAJARFILES += $(FLUTE_JAR) $(LIBBASE_JAR) $(LIBXML_JAR) $(JFREEREPORT_JAR) $(LIBLOADER_JAR) $(SAC_JAR) $(LIBLAYOUT_JAR) $(LIBSERIALIZER_JAR) $(LIBFONTS_JAR) $(LIBFORMULA_JAR) $(LIBREPOSITORY_JAR)
.ELSE
-JARFILES += flute-1.3.0.jar libbase-1.0.0.jar libfonts-1.0.0.jar libformula-0.2.0.jar liblayout-0.2.9.jar libloader-1.0.0.jar librepository-1.0.0.jar libxml-1.0.0.jar flow-engine-0.9.2.jar sac.jar
+JARFILES += \
+ flute-$(FLUTE_VERSION).jar \
+ libserializer-$(LIBSERIALIZER_VERSION).jar \
+ libbase-$(LIBBASE_VERSION).jar \
+ libfonts-$(LIBFONTS_VERSION).jar \
+ libformula-$(LIBFORMULA_VERSION).jar \
+ liblayout-$(LIBLAYOUT_VERSION).jar \
+ libloader-$(LIBLOADER_VERSION).jar \
+ librepository-$(LIBREPOSITORY_VERSION).jar \
+ libxml-$(LIBXML_VERSION).jar \
+ flow-engine-$(FLOW_ENGINE_VERSION).jar \
+ sac.jar
.ENDIF
.IF "$(SYSTEM_APACHE_COMMONS)" == "YES"
diff --git a/reportbuilder/java/com/sun/star/report/util/makefile.mk b/reportbuilder/java/com/sun/star/report/util/makefile.mk
index 8361ee6bfbf7..70e290e4884e 100644
--- a/reportbuilder/java/com/sun/star/report/util/makefile.mk
+++ b/reportbuilder/java/com/sun/star/report/util/makefile.mk
@@ -32,12 +32,16 @@ PACKAGE = com$/sun$/star$/report$/util
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
+.INCLUDE : $(SOLARBINDIR)/jfreereport_version.mk
#----- compile .java files -----------------------------------------
.IF "$(SYSTEM_JFREEREPORT)" == "YES"
EXTRAJARFILES = $(LIBBASE_JAR) $(LIBXML_JAR) $(JFREEREPORT_JAR)
.ELSE
-JARFILES = libbase-1.0.0.jar libxml-1.0.0.jar flow-engine-0.9.2.jar
+JARFILES += \
+ libbase-$(LIBBASE_VERSION).jar \
+ libxml-$(LIBXML_VERSION).jar \
+ flow-engine-$(FLOW_ENGINE_VERSION).jar
.ENDIF
JAVAFILES = DefaultJobProperties.java DefaultParameterMap.java DefaultReportJobDefinition.java ManifestWriter.java
diff --git a/reportbuilder/util/makefile.mk b/reportbuilder/util/makefile.mk
index c52e85841f68..810686822593 100755..100644
--- a/reportbuilder/util/makefile.mk
+++ b/reportbuilder/util/makefile.mk
@@ -38,6 +38,8 @@ EXTENSION_VERSION_BASE=1.2.1
# --- Settings ----------------------------------
.INCLUDE : makefile.pmk
+.INCLUDE : $(SOLARBINDIR)/jfreereport_version.mk
+
.IF "$(L10N_framework)"==""
# ------------------------------------------------------------------
# calready set in util$/makefile.pmk
@@ -96,16 +98,16 @@ COMPONENT_EXTJARFILES = \
.IF "$(SYSTEM_JFREEREPORT)" != "YES"
COMPONENT_EXTJARFILES += \
- $(EXTENSIONDIR)$/flute-1.3.0.jar \
- $(EXTENSIONDIR)$/libserializer-1.0.0.jar \
- $(EXTENSIONDIR)$/libbase-1.0.0.jar \
- $(EXTENSIONDIR)$/libfonts-1.0.0.jar \
- $(EXTENSIONDIR)$/libformula-0.2.0.jar \
- $(EXTENSIONDIR)$/liblayout-0.2.9.jar \
- $(EXTENSIONDIR)$/libloader-1.0.0.jar \
- $(EXTENSIONDIR)$/librepository-1.0.0.jar \
- $(EXTENSIONDIR)$/libxml-1.0.0.jar \
- $(EXTENSIONDIR)$/flow-engine-0.9.2.jar \
+ $(EXTENSIONDIR)$/flute-$(FLUTE_VERSION).jar \
+ $(EXTENSIONDIR)$/libserializer-$(LIBSERIALIZER_VERSION).jar \
+ $(EXTENSIONDIR)$/libbase-$(LIBBASE_VERSION).jar \
+ $(EXTENSIONDIR)$/libfonts-$(LIBFONTS_VERSION).jar \
+ $(EXTENSIONDIR)$/libformula-$(LIBFORMULA_VERSION).jar \
+ $(EXTENSIONDIR)$/liblayout-$(LIBLAYOUT_VERSION).jar \
+ $(EXTENSIONDIR)$/libloader-$(LIBLOADER_VERSION).jar \
+ $(EXTENSIONDIR)$/librepository-$(LIBREPOSITORY_VERSION).jar \
+ $(EXTENSIONDIR)$/libxml-$(LIBXML_VERSION).jar \
+ $(EXTENSIONDIR)$/flow-engine-$(FLOW_ENGINE_VERSION).jar \
$(EXTENSIONDIR)$/sac.jar
.ENDIF
.IF "$(SYSTEM_APACHE_COMMONS)" != "YES"
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 458629979172..f20b63efe7ba 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -222,7 +222,7 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList )
else
{
if( IsDocumentEncrypted() )
- Add( new XclExpFilePass( GetRoot() ) );
+ Add( new XclExpFileEncryption( GetRoot() ) );
Add( new XclExpInterfaceHdr( nCodePage ) );
Add( new XclExpUInt16Record( EXC_ID_MMS, 0 ) );
Add( new XclExpInterfaceEnd );
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index 3a43a23cd624..90ac8011a4bf 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -31,6 +31,8 @@
#include <sfx2/docfile.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/app.hxx>
+#include <sfx2/frame.hxx>
+#include <sfx2/request.hxx>
#include <sot/storage.hxx>
#include <sot/exchange.hxx>
#include <tools/globname.hxx>
@@ -99,10 +101,17 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument
SfxItemSet* pItemSet = rMedium.GetItemSet();
if( pItemSet )
{
- if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_FILE_NAME ) ) )
- aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pItem->GetValue() );
- if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_PASSWORD ) ) )
- aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pItem->GetValue() );
+ SFX_ITEMSET_ARG( pItemSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False);
+ if( pFileNameItem )
+ aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pFileNameItem->GetValue() );
+
+ SFX_ITEMSET_ARG( pItemSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ if( pPasswordItem )
+ aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pPasswordItem->GetValue() );
+
+ SFX_ITEMSET_ARG( pItemSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ if( pEncryptionDataItem )
+ aMediaDesc[ MediaDescriptor::PROP_ENCRYPTIONDATA() ] = pEncryptionDataItem->GetValue();
}
aMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ] <<= rMedium.GetInputStream();
aMediaDesc[ MediaDescriptor::PROP_INTERACTIONHANDLER() ] <<= rMedium.GetInteractionHandler();
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx
index 50e07ae1f2ed..4632a10a088e 100644
--- a/sc/source/filter/excel/xeroot.cxx
+++ b/sc/source/filter/excel/xeroot.cxx
@@ -28,7 +28,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+#include <rtl/random.h>
#include <sfx2/docfile.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/frame.hxx>
#include <sfx2/sfxsids.hrc>
#include <unotools/saveopt.hxx>
#include <svl/itemset.hxx>
@@ -51,6 +54,8 @@
#include "document.hxx"
#include "scextopt.hxx"
+using namespace ::com::sun::star;
+
// Global data ================================================================
XclExpRootData::XclExpRootData( XclBiff eBiff, SfxMedium& rMedium,
@@ -241,23 +246,66 @@ bool XclExpRoot::IsDocumentEncrypted() const
if (pDocProt && pDocProt->isProtected() && pDocProt->isOptionEnabled(ScDocProtection::STRUCTURE))
return true;
- if (GetPassword().Len() > 0)
+ if ( GetEncryptionData().getLength() > 0 )
// Password is entered directly into the save dialog.
return true;
return false;
}
-String XclExpRoot::GetPassword() const
+uno::Sequence< beans::NamedValue > XclExpRoot::GenerateEncryptionData( const ::rtl::OUString& aPass ) const
{
- if( SfxItemSet* pItemSet = GetMedium().GetItemSet() )
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+
+ if ( aPass.getLength() > 0 && aPass.getLength() < 16 )
{
- const SfxPoolItem* pItem = 0;
- if( pItemSet->GetItemState( SID_PASSWORD, TRUE, &pItem ) == SFX_ITEM_SET )
- if( const SfxStringItem* pStrItem = dynamic_cast< const SfxStringItem* >( pItem ) )
- return pStrItem->GetValue();
+ TimeValue aTime;
+ osl_getSystemTime( &aTime );
+ rtlRandomPool aRandomPool = rtl_random_createPool ();
+ rtl_random_addBytes ( aRandomPool, &aTime, 8 );
+
+ sal_uInt8 pnDocId[16];
+ rtl_random_getBytes( aRandomPool, pnDocId, 16 );
+
+ rtl_random_destroyPool( aRandomPool );
+
+ sal_uInt16 pnPasswd[16];
+ memset( pnPasswd, 0, sizeof( pnPasswd ) );
+ for (xub_StrLen nChar = 0; nChar < aPass.getLength(); ++nChar )
+ pnPasswd[nChar] = aPass.getStr()[nChar];
+
+ ::msfilter::MSCodec_Std97 aCodec;
+ aCodec.InitKey( pnPasswd, pnDocId );
+ aEncryptionData = aCodec.GetEncryptionData();
}
- return String::EmptyString();
+
+ return aEncryptionData;
+}
+
+uno::Sequence< beans::NamedValue > XclExpRoot::GetEncryptionData() const
+{
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ if ( pEncryptionDataItem )
+ pEncryptionDataItem->GetValue() >>= aEncryptionData;
+ else
+ {
+ // try to get the encryption data from the password
+ SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ if ( pPasswordItem && pPasswordItem->GetValue().Len() )
+ aEncryptionData = GenerateEncryptionData( pPasswordItem->GetValue() );
+ }
+
+ return aEncryptionData;
+}
+
+uno::Sequence< beans::NamedValue > XclExpRoot::GenerateDefaultEncryptionData() const
+{
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ if ( GetDefaultPassword().Len() > 0 )
+ aEncryptionData = GenerateEncryptionData( GetDefaultPassword() );
+
+ return aEncryptionData;
}
XclExpRootData::XclExpLinkMgrRef XclExpRoot::GetLocalLinkMgrRef() const
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index f828079c8735..356b0d8bab42 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -32,6 +32,7 @@
#include <utility>
#include <rtl/ustring.hxx>
+#include <rtl/random.h>
#include <sax/fshelper.hxx>
#include <unotools/streamwrap.hxx>
@@ -65,6 +66,7 @@ using ::utl::OStreamWrapper;
using ::std::vector;
using namespace formula;
+using namespace ::com::sun::star;
// ============================================================================
@@ -484,17 +486,16 @@ void XclExpStream::WriteRawZeroBytes( sal_Size nBytes )
// ============================================================================
-XclExpBiff8Encrypter::XclExpBiff8Encrypter( const XclExpRoot& rRoot, const sal_uInt8 nDocId[16],
- const sal_uInt8 nSalt[16] ) :
+XclExpBiff8Encrypter::XclExpBiff8Encrypter( const XclExpRoot& rRoot ) :
mrRoot(rRoot),
mnOldPos(STREAM_SEEK_TO_END),
mbValid(false)
{
- String aPass = rRoot.GetPassword();
- if (aPass.Len() == 0)
+ uno::Sequence< beans::NamedValue > aEncryptionData = rRoot.GetEncryptionData();
+ if ( aEncryptionData.getLength() == 0 )
// Empty password. Get the default biff8 password.
- aPass = rRoot.GetDefaultPassword();
- Init(aPass, nDocId, nSalt);
+ aEncryptionData = rRoot.GenerateDefaultEncryptionData();
+ Init( aEncryptionData );
}
XclExpBiff8Encrypter::~XclExpBiff8Encrypter()
@@ -506,9 +507,22 @@ bool XclExpBiff8Encrypter::IsValid() const
return mbValid;
}
-void XclExpBiff8Encrypter::GetSaltDigest( sal_uInt8 nSaltDigest[16] ) const
+void XclExpBiff8Encrypter::GetSaltDigest( sal_uInt8 pnSaltDigest[16] ) const
{
- memcpy(nSaltDigest, mnSaltDigest, 16);
+ if ( sizeof( mpnSaltDigest ) == 16 )
+ memcpy( pnSaltDigest, mpnSaltDigest, 16 );
+}
+
+void XclExpBiff8Encrypter::GetSalt( sal_uInt8 pnSalt[16] ) const
+{
+ if ( sizeof( mpnSalt ) == 16 )
+ memcpy( pnSalt, mpnSalt, 16 );
+}
+
+void XclExpBiff8Encrypter::GetDocId( sal_uInt8 pnDocId[16] ) const
+{
+ if ( sizeof( mpnDocId ) == 16 )
+ memcpy( pnDocId, mpnDocId, 16 );
}
void XclExpBiff8Encrypter::Encrypt( SvStream& rStrm, sal_uInt8 nData )
@@ -565,36 +579,32 @@ void XclExpBiff8Encrypter::Encrypt( SvStream& rStrm, sal_Int32 nData )
Encrypt(rStrm, static_cast<sal_uInt32>(nData));
}
-void XclExpBiff8Encrypter::Init( const String& aPass, const sal_uInt8 nDocId[16],
- const sal_uInt8 nSalt[16] )
+void XclExpBiff8Encrypter::Init( const uno::Sequence< beans::NamedValue >& aEncryptionData )
{
- memset(mnSaltDigest, 0, sizeof(mnSaltDigest));
+ mbValid = false;
- xub_StrLen nLen = aPass.Len();
- bool bValid = (0 < nLen) && (nLen < 16);
- if ( bValid )
+ if ( maCodec.InitCodec( aEncryptionData ) )
{
- // transform String to sal_uInt16 array
- memset(mnPassw, 0, sizeof(mnPassw));
- for (xub_StrLen nChar = 0; nChar < nLen; ++nChar)
- mnPassw[nChar] = static_cast<sal_uInt16>(aPass.GetChar(nChar));
+ maCodec.GetDocId( mpnDocId );
- // copy document ID
- memcpy(mnDocId, nDocId, sizeof(mnDocId));
+ // generate the salt here
+ TimeValue aTime;
+ osl_getSystemTime( &aTime );
+ rtlRandomPool aRandomPool = rtl_random_createPool ();
+ rtl_random_addBytes( aRandomPool, &aTime, 8 );
+ rtl_random_getBytes( aRandomPool, mpnSalt, 16 );
+ rtl_random_destroyPool( aRandomPool );
- // init codec
- maCodec.InitKey(mnPassw, mnDocId);
+ memset( mpnSaltDigest, 0, sizeof( mpnSaltDigest ) );
// generate salt hash.
::msfilter::MSCodec_Std97 aCodec;
- aCodec.InitKey(mnPassw, mnDocId);
- aCodec.CreateSaltDigest(nSalt, mnSaltDigest);
+ aCodec.InitCodec( aEncryptionData );
+ aCodec.CreateSaltDigest( mpnSalt, mpnSaltDigest );
// verify to make sure it's in good shape.
- bValid = maCodec.VerifyKey(nSalt, mnSaltDigest);
+ mbValid = maCodec.VerifyKey( mpnSalt, mpnSaltDigest );
}
-
- mbValid = bValid;
}
sal_uInt32 XclExpBiff8Encrypter::GetBlockPos( sal_Size nStrmPos ) const
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index fb1eb9a3bf44..b210d18f479c 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -1118,7 +1118,7 @@ ErrCode XclImpDecryptHelper::ReadFilepass( XclImpStream& rStrm )
// request and verify a password (decrypter implements IDocPasswordVerifier)
if( xDecr.is() )
- rStrm.GetRoot().RequestPassword( *xDecr );
+ rStrm.GetRoot().RequestEncryptionData( *xDecr );
// return error code (success, wrong password, etc.)
return xDecr.is() ? xDecr->GetError() : EXC_ENCR_ERROR_UNSUPP_CRYPT;
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index 98db9dcb4471..534d40fa5cd5 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -28,6 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+#include <comphelper/docpasswordhelper.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+
#include "xistream.hxx"
#include "xlstring.hxx"
#include "xiroot.hxx"
@@ -38,6 +41,8 @@ using ::rtl::OString;
using ::rtl::OUString;
using ::rtl::OUStringToOString;
+using namespace ::com::sun::star;
+
// ============================================================================
// Decryption
// ============================================================================
@@ -69,9 +74,16 @@ XclImpDecrypterRef XclImpDecrypter::Clone() const
return xNewDecr;
}
-::comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyPassword( const OUString& rPassword )
+::comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyPassword( const ::rtl::OUString& rPassword, uno::Sequence< beans::NamedValue >& o_rEncryptionData )
+{
+ o_rEncryptionData = OnVerifyPassword( rPassword );
+ mnError = o_rEncryptionData.getLength() ? ERRCODE_NONE : ERRCODE_ABORT;
+ return o_rEncryptionData.getLength() ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+}
+
+::comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
{
- bool bValid = OnVerify( rPassword );
+ bool bValid = OnVerifyEncryptionData( rEncryptionData );
mnError = bValid ? ERRCODE_NONE : ERRCODE_ABORT;
return bValid ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
}
@@ -110,7 +122,6 @@ sal_uInt16 XclImpDecrypter::Read( SvStream& rStrm, void* pData, sal_uInt16 nByte
// ----------------------------------------------------------------------------
XclImpBiff5Decrypter::XclImpBiff5Decrypter( sal_uInt16 nKey, sal_uInt16 nHash ) :
- maPassword( 16 ),
mnKey( nKey ),
mnHash( nHash )
{
@@ -118,12 +129,12 @@ XclImpBiff5Decrypter::XclImpBiff5Decrypter( sal_uInt16 nKey, sal_uInt16 nHash )
XclImpBiff5Decrypter::XclImpBiff5Decrypter( const XclImpBiff5Decrypter& rSrc ) :
XclImpDecrypter( rSrc ),
- maPassword( rSrc.maPassword ),
+ maEncryptionData( rSrc.maEncryptionData ),
mnKey( rSrc.mnKey ),
mnHash( rSrc.mnHash )
{
if( IsValid() )
- maCodec.InitKey( &maPassword.front() );
+ maCodec.InitCodec( maEncryptionData );
}
XclImpBiff5Decrypter* XclImpBiff5Decrypter::OnClone() const
@@ -131,24 +142,59 @@ XclImpBiff5Decrypter* XclImpBiff5Decrypter::OnClone() const
return new XclImpBiff5Decrypter( *this );
}
-bool XclImpBiff5Decrypter::OnVerify( const OUString& rPassword )
+uno::Sequence< beans::NamedValue > XclImpBiff5Decrypter::OnVerifyPassword( const ::rtl::OUString& rPassword )
{
+ maEncryptionData.realloc( 0 );
+
/* Convert password to a byte string. TODO: this needs some finetuning
according to the spec... */
OString aBytePassword = OUStringToOString( rPassword, osl_getThreadTextEncoding() );
sal_Int32 nLen = aBytePassword.getLength();
if( (0 < nLen) && (nLen < 16) )
{
- // copy byte string to sal_uInt8 array
- maPassword.clear();
- maPassword.resize( 16, 0 );
- memcpy( &maPassword.front(), aBytePassword.getStr(), static_cast< size_t >( nLen ) );
+ // init codec
+ maCodec.InitKey( (sal_uInt8*)aBytePassword.getStr() );
+
+ if ( maCodec.VerifyKey( mnKey, mnHash ) )
+ {
+ maEncryptionData = maCodec.GetEncryptionData();
+
+ // since the export uses Std97 encryption always we have to request it here
+ ::std::vector< sal_uInt16 > aPassVect( 16 );
+ ::std::vector< sal_uInt16 >::iterator aIt = aPassVect.begin();
+ for( sal_Int32 nInd = 0; nInd < nLen; ++nInd, ++aIt )
+ *aIt = static_cast< sal_uInt16 >( rPassword.getStr()[nInd] );
+
+ uno::Sequence< sal_Int8 > aDocId = ::comphelper::DocPasswordHelper::GenerateRandomByteSequence( 16 );
+ OSL_ENSURE( aDocId.getLength() == 16, "Unexpected length of the senquence!" );
+
+ ::msfilter::MSCodec_Std97 aCodec97;
+ aCodec97.InitKey( &aPassVect.front(), (sal_uInt8*)aDocId.getConstArray() );
+
+ // merge the EncryptionData, there should be no conflicts
+ ::comphelper::SequenceAsHashMap aEncryptionHash( maEncryptionData );
+ aEncryptionHash.update( ::comphelper::SequenceAsHashMap( aCodec97.GetEncryptionData() ) );
+ aEncryptionHash >> maEncryptionData;
+ }
+ }
+
+ return maEncryptionData;
+}
+bool XclImpBiff5Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
+{
+ maEncryptionData.realloc( 0 );
+
+ if( rEncryptionData.getLength() )
+ {
// init codec
- maCodec.InitKey( &maPassword.front() );
- return maCodec.VerifyKey( mnKey, mnHash );
+ maCodec.InitCodec( rEncryptionData );
+
+ if ( maCodec.VerifyKey( mnKey, mnHash ) )
+ maEncryptionData = rEncryptionData;
}
- return false;
+
+ return maEncryptionData.getLength();
}
void XclImpBiff5Decrypter::OnUpdate( sal_Size /*nOldStrmPos*/, sal_Size nNewStrmPos, sal_uInt16 nRecSize )
@@ -168,7 +214,6 @@ sal_uInt16 XclImpBiff5Decrypter::OnRead( SvStream& rStrm, sal_uInt8* pnData, sal
XclImpBiff8Decrypter::XclImpBiff8Decrypter( sal_uInt8 pnSalt[ 16 ],
sal_uInt8 pnVerifier[ 16 ], sal_uInt8 pnVerifierHash[ 16 ] ) :
- maPassword( 16, 0 ),
maSalt( pnSalt, pnSalt + 16 ),
maVerifier( pnVerifier, pnVerifier + 16 ),
maVerifierHash( pnVerifierHash, pnVerifierHash + 16 )
@@ -177,13 +222,13 @@ XclImpBiff8Decrypter::XclImpBiff8Decrypter( sal_uInt8 pnSalt[ 16 ],
XclImpBiff8Decrypter::XclImpBiff8Decrypter( const XclImpBiff8Decrypter& rSrc ) :
XclImpDecrypter( rSrc ),
- maPassword( rSrc.maPassword ),
+ maEncryptionData( rSrc.maEncryptionData ),
maSalt( rSrc.maSalt ),
maVerifier( rSrc.maVerifier ),
maVerifierHash( rSrc.maVerifierHash )
{
if( IsValid() )
- maCodec.InitKey( &maPassword.front(), &maSalt.front() );
+ maCodec.InitCodec( maEncryptionData );
}
XclImpBiff8Decrypter* XclImpBiff8Decrypter::OnClone() const
@@ -191,25 +236,44 @@ XclImpBiff8Decrypter* XclImpBiff8Decrypter::OnClone() const
return new XclImpBiff8Decrypter( *this );
}
-bool XclImpBiff8Decrypter::OnVerify( const OUString& rPassword )
+uno::Sequence< beans::NamedValue > XclImpBiff8Decrypter::OnVerifyPassword( const ::rtl::OUString& rPassword )
{
+ maEncryptionData.realloc( 0 );
+
sal_Int32 nLen = rPassword.getLength();
if( (0 < nLen) && (nLen < 16) )
{
// copy string to sal_uInt16 array
- maPassword.clear();
- maPassword.resize( 16, 0 );
+ ::std::vector< sal_uInt16 > aPassVect( 16 );
const sal_Unicode* pcChar = rPassword.getStr();
const sal_Unicode* pcCharEnd = pcChar + nLen;
- ::std::vector< sal_uInt16 >::iterator aIt = maPassword.begin();
+ ::std::vector< sal_uInt16 >::iterator aIt = aPassVect.begin();
for( ; pcChar < pcCharEnd; ++pcChar, ++aIt )
*aIt = static_cast< sal_uInt16 >( *pcChar );
// init codec
- maCodec.InitKey( &maPassword.front(), &maSalt.front() );
- return maCodec.VerifyKey( &maVerifier.front(), &maVerifierHash.front() );
+ maCodec.InitKey( &aPassVect.front(), &maSalt.front() );
+ if ( maCodec.VerifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ maEncryptionData = maCodec.GetEncryptionData();
+ }
+
+ return maEncryptionData;
+}
+
+bool XclImpBiff8Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
+{
+ maEncryptionData.realloc( 0 );
+
+ if( rEncryptionData.getLength() )
+ {
+ // init codec
+ maCodec.InitCodec( rEncryptionData );
+
+ if ( maCodec.VerifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ maEncryptionData = rEncryptionData;
}
- return false;
+
+ return maEncryptionData.getLength();
}
void XclImpBiff8Decrypter::OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 /*nRecSize*/ )
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index 2b2180db5e6a..c6d6c5b9246a 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -71,6 +71,8 @@ using ::com::sun::star::frame::XFrame;
using ::com::sun::star::frame::XFramesSupplier;
using ::com::sun::star::lang::XMultiServiceFactory;
+using namespace ::com::sun::star;
+
// Global data ================================================================
#ifdef DBG_UTIL
@@ -240,11 +242,11 @@ sal_Int32 XclRoot::GetHmmFromPixelY( double fPixelY ) const
return static_cast< sal_Int32 >( fPixelY * mrData.mfScreenPixelY + 0.5 );
}
-String XclRoot::RequestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const
+uno::Sequence< beans::NamedValue > XclRoot::RequestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const
{
::std::vector< OUString > aDefaultPasswords;
aDefaultPasswords.push_back( mrData.maDefPassword );
- return ScfApiHelper::QueryPasswordForMedium( mrData.mrMedium, rVerifier, &aDefaultPasswords );
+ return ScfApiHelper::QueryEncryptionDataForMedium( mrData.mrMedium, rVerifier, &aDefaultPasswords );
}
bool XclRoot::HasVbaStorage() const
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index eeef52aed550..185923b28277 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -38,6 +38,8 @@
#include <tools/urlobj.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/docfile.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/frame.hxx>
#include <sfx2/sfxsids.hrc>
#include <svl/stritem.hxx>
#include <svl/itemset.hxx>
@@ -59,6 +61,8 @@ using ::com::sun::star::lang::XServiceName;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::task::PasswordRequestMode_PASSWORD_ENTER;
+using namespace ::com::sun::star;
+
// Static helper functions ====================================================
OUString ScfApiHelper::GetServiceName( Reference< XInterface > xInt )
@@ -136,25 +140,33 @@ Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs(
return CreateInstanceWithArgs( ::comphelper::getProcessServiceFactory(), rServiceName, rArgs );
}
-String ScfApiHelper::QueryPasswordForMedium( SfxMedium& rMedium,
+uno::Sequence< beans::NamedValue > ScfApiHelper::QueryEncryptionDataForMedium( SfxMedium& rMedium,
::comphelper::IDocPasswordVerifier& rVerifier, const ::std::vector< OUString >* pDefaultPasswords )
{
- OUString aMediaPassword;
- SfxItemSet* pItemSet = rMedium.GetItemSet();
- const SfxPoolItem *pPasswordItem;
- if( pItemSet && (SFX_ITEM_SET == pItemSet->GetItemState( SID_PASSWORD, TRUE, &pPasswordItem )) )
- aMediaPassword = static_cast< const SfxStringItem* >( pPasswordItem )->GetValue();
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ if ( pEncryptionDataItem )
+ pEncryptionDataItem->GetValue() >>= aEncryptionData;
+
+ ::rtl::OUString aPassword;
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ if ( pPasswordItem )
+ aPassword = pPasswordItem->GetValue();
+
OUString aDocName = INetURLObject( rMedium.GetOrigURL() ).GetName( INetURLObject::DECODE_WITH_CHARSET );
bool bIsDefaultPassword = false;
- OUString aPassword = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
- rVerifier, aMediaPassword, rMedium.GetInteractionHandler(), aDocName,
+ aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
+ rVerifier, aEncryptionData, aPassword, rMedium.GetInteractionHandler(), aDocName,
::comphelper::DocPasswordRequestType_MS, pDefaultPasswords, &bIsDefaultPassword );
- if( !bIsDefaultPassword && (aPassword.getLength() > 0) && pItemSet )
- pItemSet->Put( SfxStringItem( SID_PASSWORD, aPassword ) );
+ rMedium.GetItemSet()->ClearItem( SID_PASSWORD );
+ rMedium.GetItemSet()->ClearItem( SID_ENCRYPTIONDATA );
+
+ if( !bIsDefaultPassword && (aEncryptionData.getLength() > 0) )
+ rMedium.GetItemSet()->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) ) );
- return aPassword;
+ return aEncryptionData;
}
// Property sets ==============================================================
diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx
index 8c204f1cef35..699a4e28720a 100644
--- a/sc/source/filter/inc/fapihelper.hxx
+++ b/sc/source/filter/inc/fapihelper.hxx
@@ -33,6 +33,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <tools/color.hxx>
#include <comphelper/types.hxx>
#include "ftools.hxx"
@@ -106,9 +107,9 @@ public:
const ::rtl::OUString& rServiceName,
const UnoAnySequence& rArgs );
- /** Opens a password dialog and returns the entered password.
- @return The entered password or an empty string on 'Cancel' or any error. */
- static String QueryPasswordForMedium( SfxMedium& rMedium,
+ /** Opens a password dialog and returns the encryption data.
+ @return The encryption data or an empty sequence on 'Cancel' or any error. */
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > QueryEncryptionDataForMedium( SfxMedium& rMedium,
::comphelper::IDocPasswordVerifier& rVerifier,
const ::std::vector< ::rtl::OUString >* pDefaultPasswords = 0 );
};
diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx
index 201562fa752c..8afbe946d2f7 100644
--- a/sc/source/filter/inc/xcl97rec.hxx
+++ b/sc/source/filter/inc/xcl97rec.hxx
@@ -478,11 +478,11 @@ public:
// ============================================================================
-class XclExpFilePass : public XclExpRecord
+class XclExpFileEncryption : public XclExpRecord
{
public:
- explicit XclExpFilePass( const XclExpRoot& rRoot );
- virtual ~XclExpFilePass();
+ explicit XclExpFileEncryption( const XclExpRoot& rRoot );
+ virtual ~XclExpFileEncryption();
private:
virtual void WriteBody( XclExpStream& rStrm );
diff --git a/sc/source/filter/inc/xeroot.hxx b/sc/source/filter/inc/xeroot.hxx
index 980590f9d4ff..ba51abdef1a2 100644
--- a/sc/source/filter/inc/xeroot.hxx
+++ b/sc/source/filter/inc/xeroot.hxx
@@ -28,6 +28,8 @@
#ifndef SC_XEROOT_HXX
#define SC_XEROOT_HXX
+#include <com/sun/star/beans/NamedValue.hpp>
+
#include "xlroot.hxx"
// Forward declarations of objects in public use ==============================
@@ -158,7 +160,9 @@ public:
bool IsDocumentEncrypted() const;
- String GetPassword() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GenerateEncryptionData( const ::rtl::OUString& aPass ) const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetEncryptionData() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GenerateDefaultEncryptionData() const;
private:
diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index 3308827441dd..38acef2783e8 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -30,6 +30,8 @@
#ifndef SC_XESTREAM_HXX
#define SC_XESTREAM_HXX
+#include <com/sun/star/beans/NamedValue.hpp>
+
#include <map>
#include <stack>
#include <string>
@@ -216,13 +218,14 @@ private:
class XclExpBiff8Encrypter
{
public:
- explicit XclExpBiff8Encrypter( const XclExpRoot& rRoot, const sal_uInt8 nDocId[16],
- const sal_uInt8 nSalt[16] );
+ explicit XclExpBiff8Encrypter( const XclExpRoot& rRoot );
~XclExpBiff8Encrypter();
bool IsValid() const;
- void GetSaltDigest( sal_uInt8 nSaltDigest[16] ) const;
+ void GetSaltDigest( sal_uInt8 pnSaltDigest[16] ) const;
+ void GetSalt( sal_uInt8 pnSalt[16] ) const;
+ void GetDocId( sal_uInt8 pnDocId[16] ) const;
void Encrypt( SvStream& rStrm, sal_uInt8 nData );
void Encrypt( SvStream& rStrm, sal_uInt16 nData );
@@ -238,17 +241,16 @@ public:
void EncryptBytes( SvStream& rStrm, ::std::vector<sal_uInt8>& aBytes );
private:
- void Init( const String& aPass, const sal_uInt8 nDocId[16],
- const sal_uInt8 nSalt[16] );
+ void Init( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData );
sal_uInt32 GetBlockPos( sal_Size nStrmPos ) const;
sal_uInt16 GetOffsetInBlock( sal_Size nStrmPos ) const;
private:
::msfilter::MSCodec_Std97 maCodec; /// Crypto algorithm implementation.
- sal_uInt16 mnPassw[16]; /// Cached password data for copy construction.
- sal_uInt8 mnDocId[16]; /// Cached document ID for copy construction.
- sal_uInt8 mnSaltDigest[16];
+ sal_uInt8 mpnDocId[16];
+ sal_uInt8 mpnSalt[16];
+ sal_uInt8 mpnSaltDigest[16];
const XclExpRoot& mrRoot;
sal_Size mnOldPos; /// Last known stream position
diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx
index 9b27077d78e7..4aec7c337a32 100644
--- a/sc/source/filter/inc/xistream.hxx
+++ b/sc/source/filter/inc/xistream.hxx
@@ -64,10 +64,9 @@ public:
/** Creates a (ref-counted) copy of this decrypter object. */
XclImpDecrypterRef Clone() const;
- /** Implementation of the ::comphelper::IDocPasswordVerifier interface,
- calls the new virtual function implVerify(). */
- virtual ::comphelper::DocPasswordVerifierResult
- verifyPassword( const ::rtl::OUString& rPassword );
+ /** Implementation of the ::comphelper::IDocPasswordVerifier interface */
+ virtual ::comphelper::DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData );
+ virtual ::comphelper::DocPasswordVerifierResult verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
/** Updates the decrypter on start of a new record or after seeking stream. */
void Update( SvStream& rStrm, sal_uInt16 nRecSize );
@@ -84,7 +83,10 @@ private:
virtual XclImpDecrypter* OnClone() const = 0;
/** Derived classes implement password verification and initialization of
the decoder. */
- virtual bool OnVerify( const ::rtl::OUString& rPassword ) = 0;
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ OnVerifyPassword( const ::rtl::OUString& rPassword ) = 0;
+ virtual bool OnVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData ) = 0;
+
/** Implementation of updating the decrypter. */
virtual void OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 nRecSize ) = 0;
/** Implementation of the decryption. */
@@ -111,7 +113,9 @@ private:
/** Implementation of cloning this object. */
virtual XclImpBiff5Decrypter* OnClone() const;
/** Implements password verification and initialization of the decoder. */
- virtual bool OnVerify( const ::rtl::OUString& rPassword );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ OnVerifyPassword( const ::rtl::OUString& rPassword );
+ virtual bool OnVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
/** Implementation of updating the decrypter. */
virtual void OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 nRecSize );
/** Implementation of the decryption. */
@@ -119,7 +123,7 @@ private:
private:
::msfilter::MSCodec_XorXLS95 maCodec; /// Crypto algorithm implementation.
- ::std::vector< sal_uInt8 > maPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > maEncryptionData;
sal_uInt16 mnKey;
sal_uInt16 mnHash;
};
@@ -140,7 +144,9 @@ private:
/** Implementation of cloning this object. */
virtual XclImpBiff8Decrypter* OnClone() const;
/** Implements password verification and initialization of the decoder. */
- virtual bool OnVerify( const ::rtl::OUString& rPassword );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ OnVerifyPassword( const ::rtl::OUString& rPassword );
+ virtual bool OnVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
/** Implementation of updating the decrypter. */
virtual void OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 nRecSize );
/** Implementation of the decryption. */
@@ -153,7 +159,7 @@ private:
private:
::msfilter::MSCodec_Std97 maCodec; /// Crypto algorithm implementation.
- ::std::vector< sal_uInt16 > maPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > maEncryptionData;
::std::vector< sal_uInt8 > maSalt;
::std::vector< sal_uInt8 > maVerifier;
::std::vector< sal_uInt8 > maVerifierHash;
diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx
index 2f029c74baa9..44ded449cd76 100644
--- a/sc/source/filter/inc/xlroot.hxx
+++ b/sc/source/filter/inc/xlroot.hxx
@@ -28,6 +28,8 @@
#ifndef SC_XLROOT_HXX
#define SC_XLROOT_HXX
+#include <com/sun/star/beans/NamedValue.hpp>
+
#include <i18npool/lang.h>
#include <sot/storage.hxx>
#include "xlconst.hxx"
@@ -196,7 +198,8 @@ public:
/** Returns the default password used for stream encryption. */
inline const String& GetDefaultPassword() const { return mrData.maDefPassword; }
/** Requests and verifies a password from the medium or the user. */
- String RequestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ RequestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
/** Returns the OLE2 root storage of the imported/exported file.
@return Pointer to root storage or 0, if the file is a simple stream. */
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index df6bdcbbe671..209bbc83f6c3 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1251,27 +1251,18 @@ void XclDelta::SaveXml( XclExpXmlStream& rStrm )
// ============================================================================
-XclExpFilePass::XclExpFilePass( const XclExpRoot& rRoot ) :
+XclExpFileEncryption::XclExpFileEncryption( const XclExpRoot& rRoot ) :
XclExpRecord(0x002F, 54),
mrRoot(rRoot)
{
}
-XclExpFilePass::~XclExpFilePass()
+XclExpFileEncryption::~XclExpFileEncryption()
{
}
-void XclExpFilePass::WriteBody( XclExpStream& rStrm )
+void XclExpFileEncryption::WriteBody( XclExpStream& rStrm )
{
- static const sal_uInt8 nDocId[] = {
- 0x17, 0xf7, 0x01, 0x08, 0xea, 0xad, 0x30, 0x5c,
- 0x1a, 0x95, 0xa5, 0x75, 0xd6, 0x79, 0xcd, 0x8d };
-
-
- static const sal_uInt8 nSalt[] = {
- 0xa4, 0x5b, 0xf7, 0xe9, 0x9f, 0x55, 0x21, 0xc5,
- 0xc5, 0x56, 0xa8, 0x0d, 0x39, 0x05, 0x3a, 0xb4 };
-
// 0x0000 - neither standard nor strong encryption
// 0x0001 - standard or strong encryption
rStrm << static_cast<sal_uInt16>(0x0001);
@@ -1281,13 +1272,17 @@ void XclExpFilePass::WriteBody( XclExpStream& rStrm )
sal_uInt16 nStdEnc = 0x0001;
rStrm << nStdEnc << nStdEnc;
- sal_uInt8 nSaltHash[16];
- XclExpEncrypterRef xEnc( new XclExpBiff8Encrypter(mrRoot, nDocId, nSalt) );
- xEnc->GetSaltDigest(nSaltHash);
-
- rStrm.Write(nDocId, 16);
- rStrm.Write(nSalt, 16);
- rStrm.Write(nSaltHash, 16);
+ sal_uInt8 pnDocId[16];
+ sal_uInt8 pnSalt[16];
+ sal_uInt8 pnSaltHash[16];
+ XclExpEncrypterRef xEnc( new XclExpBiff8Encrypter(mrRoot) );
+ xEnc->GetDocId(pnDocId);
+ xEnc->GetSalt(pnSalt);
+ xEnc->GetSaltDigest(pnSaltHash);
+
+ rStrm.Write(pnDocId, 16);
+ rStrm.Write(pnSalt, 16);
+ rStrm.Write(pnSaltHash, 16);
rStrm.SetEncrypter(xEnc);
}
diff --git a/scp2/source/ooo/directory_ooo.scp b/scp2/source/ooo/directory_ooo.scp
index cc805f9e8288..4b20c6de7cc1 100644
--- a/scp2/source/ooo/directory_ooo.scp
+++ b/scp2/source/ooo/directory_ooo.scp
@@ -965,6 +965,11 @@ Directory gid_Dir_Share_Template_Wizard
DosName = "wizard";
End
+Directory gid_Dir_Share_Template_Wizard_Bitmap
+ ParentID = gid_Dir_Share_Template_Wizard;
+ DosName = "bitmap";
+End
+
Directory gid_Dir_Share_Template_Wizard_Letter
ParentID = gid_Dir_Share_Template_Wizard;
DosName = "letter";
@@ -1025,11 +1030,6 @@ Directory gid_Dir_Template_Wizard
DIR_IDENT_ALL_LANG(wizard);
End
-Directory gid_Dir_Template_Wizard_Bitmap
- ParentID = gid_Dir_Template_Wizard;
- DIR_IDENT_ALL_LANG(bitmap);
-End
-
Directory gid_Dir_Template_Wizard_Web
ParentID = gid_Dir_Template_Wizard;
DIR_IDENT_ALL_LANG(web);
diff --git a/scp2/source/ooo/file_extra_ooo.scp b/scp2/source/ooo/file_extra_ooo.scp
index dbea12eee10c..ee8c46f2c33e 100644
--- a/scp2/source/ooo/file_extra_ooo.scp
+++ b/scp2/source/ooo/file_extra_ooo.scp
@@ -365,10 +365,9 @@ File gid_File_Extra_Tplpresntimpr_Lang
End
File gid_File_Extra_Tplwizbitmap
- Dir = gid_Dir_Template_Wizard_Bitmap;
- TXT_FILE_BODY;
- Styles = (ARCHIVE, DONT_OVERWRITE);
- EXTRA_IDENT_ALL_LANG(tplwizbitmap.zip);
+ Dir = gid_Dir_Share_Template_Wizard_Bitmap;
+ ARCHIVE_TXT_FILE_BODY;
+ Name = "tplwizbitmap.zip";
End
File gid_File_Extra_Tplwizdesktop_Lang
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index 7718cce4d4f5..cacfb19cad6b 100755
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -1346,7 +1346,7 @@ STD_LIB_FILE( gid_File_Lib_Msfilter, msfilter)
STD_LIB_FILE( gid_File_Lib_Sw , sw)
STD_LIB_FILE( gid_File_Lib_Swui, swui)
-STD_UNO_LIB_FILE( gid_File_Lib_Msword, msword )
+STD_LIB_FILE( gid_File_Lib_Msword, msword )
#if ! defined UNX
File gid_File_Lib_Sysdtrans
diff --git a/scp2/source/ooo/module_hidden_ooo.scp b/scp2/source/ooo/module_hidden_ooo.scp
index e8c20f99ca94..e1bc26118011 100644
--- a/scp2/source/ooo/module_hidden_ooo.scp
+++ b/scp2/source/ooo/module_hidden_ooo.scp
@@ -454,6 +454,7 @@ Module gid_Module_Root_Files_6
gid_File_Extra_Gallwwwgraf,
gid_File_Extra_Migration,
gid_File_Extra_Migration_Lang_Multi,
+ gid_File_Extra_Tplwizbitmap,
gid_File_Extra_Tplwizletter,
gid_File_Extra_Tplwizletter_en_US,
gid_File_Extra_Tplwizletter_de,
diff --git a/scp2/source/ooo/module_lang_template.scp b/scp2/source/ooo/module_lang_template.scp
index 8ffeadc2e99a..a21016e409d3 100755
--- a/scp2/source/ooo/module_lang_template.scp
+++ b/scp2/source/ooo/module_lang_template.scp
@@ -35,7 +35,6 @@ Module gid_Module_Langpack_Basis_Template
gid_File_Extra_Tpllayoutimpr_Lang,
gid_File_Extra_Tplpresntimpr_Lang,
gid_File_Extra_Tplwizagenda_Lang,
- gid_File_Extra_Tplwizbitmap,
gid_File_Extra_Tplwizdesktop_Lang,
gid_File_Extra_Tplwizfax_Lang,
gid_File_Extra_Tplwizletter_Lang,
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index 2be4b9f9055d..b77c2563fc03 100755
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -99,7 +99,7 @@ static xub_StrLen lcl_getMaxSafeStrLen(sal_uInt32 nSize)
if (nSize > STRING_MAXLEN)
nSize = STRING_MAXLEN;
- return xub_StrLen( nSize );
+ return static_cast< xub_StrLen >( nSize );
}
BOOL PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlign )
diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx
index 281e4c692228..e45b8ce36673 100644..100755
--- a/sd/source/ui/func/fuexpand.cxx
+++ b/sd/source/ui/func/fuexpand.cxx
@@ -84,6 +84,9 @@ FunctionReference FuExpandPage::Create( ViewShell* pViewSh, ::sd::Window* pWin,
void FuExpandPage::DoExecute( SfxRequest& )
{
+ if ( mpView && mpView->IsTextEdit() )
+ mpView->SdrEndTextEdit();
+
// Selektierte Seite finden (nur Standard-Seiten)
SdPage* pActualPage = NULL;
USHORT i = 0;
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index ded7c2ebfdde..0ab4b9e3bdc3 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -29,6 +29,8 @@
#include <com/sun/star/presentation/XPresentation2.hpp>
+#include <editeng/outlobj.hxx>
+
#include "controller/SlsSlotManager.hxx"
#include "SlideSorter.hxx"
#include "SlideSorterViewShell.hxx"
@@ -558,8 +560,27 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
{
SdPage* pPage = aSelectedPages.GetNextElement()->GetPage();
SdrObject* pObj = pPage->GetPresObj(PRESOBJ_OUTLINE);
- if (pObj!=NULL && !pObj->IsEmptyPresObj())
- bDisable = false;
+ if (pObj!=NULL )
+ {
+ if( !pObj->IsEmptyPresObj() )
+ {
+ bDisable = false;
+ }
+ else
+ {
+ // check if the object is in edit, than its temporarely not empty
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj );
+ if( pTextObj )
+ {
+ OutlinerParaObject* pParaObj = pTextObj->GetEditOutlinerParaObject();
+ if( pParaObj )
+ {
+ delete pParaObj;
+ bDisable = false;
+ }
+ }
+ }
+ }
}
}
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index fa2ddf1120d0..ab70090c5263 100755
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -34,12 +34,9 @@
#include <svx/globl3d.hxx>
#include <svx/svdouno.hxx>
#include <editeng/eeitem.hxx>
-#ifndef _FLDITEM_HXX
#include <editeng/flditem.hxx>
-#endif
-#ifndef _SVXIDS_HXX
+#include <editeng/outlobj.hxx>
#include <svx/svxids.hrc>
-#endif
#include <svx/svdpagv.hxx>
#include <svx/clipfmtitem.hxx>
#include <svx/fmshell.hxx>
@@ -310,7 +307,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if(bDisable)
{
- rSet.DisableItem(SID_EXPAND_PAGE);
+ rSet.DisableItem(SID_ASSIGN_LAYOUT);
}
}
@@ -325,9 +322,26 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
{
SdrObject* pObj = pPage->GetPresObj(PRESOBJ_OUTLINE);
- if(pObj && !pObj->IsEmptyPresObj())
+ if (pObj!=NULL )
{
- bDisable = false;
+ if( !pObj->IsEmptyPresObj() )
+ {
+ bDisable = false;
+ }
+ else
+ {
+ // check if the object is in edit, than its temporarely not empty
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj );
+ if( pTextObj )
+ {
+ OutlinerParaObject* pParaObj = pTextObj->GetEditOutlinerParaObject();
+ if( pParaObj )
+ {
+ delete pParaObj;
+ bDisable = false;
+ }
+ }
+ }
}
}
}
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 61f513970662..1282688fdd18 100755
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1030,9 +1030,26 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
{
SdrObject* pObj = pPage->GetPresObj(PRESOBJ_OUTLINE);
- if (pObj && !pObj->IsEmptyPresObj())
+ if (pObj!=NULL )
{
- bDisable = FALSE;
+ if( !pObj->IsEmptyPresObj() )
+ {
+ bDisable = false;
+ }
+ else
+ {
+ // check if the object is in edit, than its temporarely not empty
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj );
+ if( pTextObj )
+ {
+ OutlinerParaObject* pParaObj = pTextObj->GetEditOutlinerParaObject();
+ if( pParaObj )
+ {
+ delete pParaObj;
+ bDisable = false;
+ }
+ }
+ }
}
}
diff --git a/sdext/source/minimizer/description.xml b/sdext/source/minimizer/description.xml
index 64a67a05b343..a4f172d0ebe6 100755..100644
--- a/sdext/source/minimizer/description.xml
+++ b/sdext/source/minimizer/description.xml
@@ -17,7 +17,7 @@
</simple-license>
</registration>
- <version value="1.0.2"/>
+ <version value="1.0.3"/>
<platform value="UPDATED_SUPPORTED_PLATFORM"/>
diff --git a/sdext/source/presenter/description.xml b/sdext/source/presenter/description.xml
index ede52f0bf1bb..19fefec6de8a 100755..100644
--- a/sdext/source/presenter/description.xml
+++ b/sdext/source/presenter/description.xml
@@ -8,7 +8,7 @@
<identifier value="com.sun.PresenterScreen-UPDATED_PLATFORM" />
<dependencies>
- <OpenOffice.org-minimal-version value="3.2" dep:name="OpenOffice.org 3.2"/>
+ <OpenOffice.org-minimal-version value="3.3" dep:name="OpenOffice.org 3.3"/>
</dependencies>
<registration>
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 0cb57e7a414d..35656202650f 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -112,7 +112,7 @@ class SFX2_DLLPUBLIC SfxMedium : public SvRefBase
SAL_DLLPRIVATE void CloseStreams_Impl();
DECL_DLLPRIVATE_STATIC_LINK( SfxMedium, UCBHdl_Impl, sal_uInt32 * );
- SAL_DLLPRIVATE void SetPasswordToStorage_Impl();
+ SAL_DLLPRIVATE void SetEncryptionDataToStorage_Impl();
#endif
public:
diff --git a/sfx2/inc/sfx2/passwd.hxx b/sfx2/inc/sfx2/passwd.hxx
index b0105553cd40..5a3a48445c0f 100644
--- a/sfx2/inc/sfx2/passwd.hxx
+++ b/sfx2/inc/sfx2/passwd.hxx
@@ -39,29 +39,35 @@
// defines ---------------------------------------------------------------
-#define SHOWEXTRAS_NONE ((USHORT)0x0000)
-#define SHOWEXTRAS_USER ((USHORT)0x0001)
-#define SHOWEXTRAS_CONFIRM ((USHORT)0x0002)
-#define SHOWEXTRAS_ALL ((USHORT)(SHOWEXTRAS_USER | SHOWEXTRAS_CONFIRM))
+#define SHOWEXTRAS_NONE ((USHORT)0x0000)
+#define SHOWEXTRAS_USER ((USHORT)0x0001)
+#define SHOWEXTRAS_CONFIRM ((USHORT)0x0002)
+#define SHOWEXTRAS_PASSWORD2 ((USHORT)0x0004)
+#define SHOWEXTRAS_CONFIRM2 ((USHORT)0x0008)
+#define SHOWEXTRAS_ALL ((USHORT)(SHOWEXTRAS_USER | SHOWEXTRAS_CONFIRM))
// class SfxPasswordDialog -----------------------------------------------
class SFX2_DLLPUBLIC SfxPasswordDialog : public ModalDialog
{
private:
+ FixedLine maPasswordBox;
FixedText maUserFT;
Edit maUserED;
FixedText maPasswordFT;
Edit maPasswordED;
FixedText maConfirmFT;
Edit maConfirmED;
- FixedLine maPasswordBox;
+ FixedLine maPassword2Box;
+ FixedText maPassword2FT;
+ Edit maPassword2ED;
+ FixedText maConfirm2FT;
+ Edit maConfirm2ED;
OKButton maOKBtn;
CancelButton maCancelBtn;
HelpButton maHelpBtn;
- String maConfirmStr;
USHORT mnMinLen;
USHORT mnExtras;
@@ -76,6 +82,10 @@ public:
String GetPassword() const { return maPasswordED.GetText(); }
String GetConfirm() const { return maConfirmED.GetText(); }
+ String GetPassword2() const { return maPassword2ED.GetText(); }
+ String GetConfirm2() const { return maConfirm2ED.GetText(); }
+ void SetGroup2Text( const String& i_rText ) { maPassword2Box.SetText( i_rText ); }
+
void SetMinLen( USHORT Len );
void SetMaxLen( USHORT Len );
void SetEditHelpId( const rtl::OString& rId ) { maPasswordED.SetHelpId( rId ); }
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index b5dd2623ae35..561a41b04387 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -313,7 +313,9 @@
#define SID_RECOMMENDREADONLY (SID_SFX_START + 1719)
#define SID_SUGGESTEDSAVEASDIR (SID_SFX_START + 1720)
#define SID_SUGGESTEDSAVEASNAME (SID_SFX_START + 1721)
-#define SID_SFX_free_START (SID_SFX_START + 1722)
+#define SID_ENCRYPTIONDATA (SID_SFX_START + 1722)
+#define SID_PASSWORDINTERACTION (SID_SFX_START + 1723)
+#define SID_SFX_free_START (SID_SFX_START + 1724)
#define SID_SFX_free_END (SID_SFX_START + 3999)
#define SID_OPEN_NEW_VIEW (SID_SFX_START + 520)
diff --git a/sfx2/inc/sfx2/sfxuno.hxx b/sfx2/inc/sfx2/sfxuno.hxx
index f9702063713a..691716b70571 100644
--- a/sfx2/inc/sfx2/sfxuno.hxx
+++ b/sfx2/inc/sfx2/sfxuno.hxx
@@ -37,6 +37,7 @@
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/task/ErrorCodeIOException.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
//________________________________________________________________________________________________________________________
@@ -104,7 +105,7 @@ SFX2_DLLPUBLIC void TransformItems( sal_uInt16
UNOSEQUENCE< UNOPROPERTYVALUE >& seqArgs ,
const SfxSlot* pSlot = 0 );
-sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd );
+bool GetEncryptionData_Impl( const SfxItemSet* pSet, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData );
#define FrameSearchFlags sal_Int32
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 40d35ab4d702..aadd57185880 100755..100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -5317,7 +5317,7 @@ SfxBoolItem SaveAll SID_SAVEDOCS
//--------------------------------------------------------------------------
SfxBoolItem SaveAs SID_SAVEASDOC
-(SfxStringItem URL SID_FILE_NAME,SfxStringItem FilterName SID_FILTER_NAME,SfxStringItem Password SID_PASSWORD,SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS,SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem VersionAuthor SID_DOCINFO_AUTHOR,SfxBoolItem Overwrite SID_OVERWRITE,SfxBoolItem Unpacked SID_UNPACK,SfxBoolItem SaveTo SID_SAVETO)
+(SfxStringItem URL SID_FILE_NAME,SfxStringItem FilterName SID_FILTER_NAME,SfxStringItem Password SID_PASSWORD,SfxBoolItem PasswordInteraction SID_PASSWORDINTERACTION,SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS,SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem VersionAuthor SID_DOCINFO_AUTHOR,SfxBoolItem Overwrite SID_OVERWRITE,SfxBoolItem Unpacked SID_UNPACK,SfxBoolItem SaveTo SID_SAVETO)
[
/* flags: */
AutoUpdate = FALSE,
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 89bb5f23f1de..807834ca41a5 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -239,8 +239,7 @@ void SetTemplate_Impl( const String &rFileName,
pDoc->ResetFromTemplate( rLongName, rFileName );
}
-//--------------------------------------------------------------------
-
+//====================================================================
class SfxDocPasswordVerifier : public ::comphelper::IDocPasswordVerifier
{
public:
@@ -248,21 +247,33 @@ public:
mxStorage( rxStorage ) {}
virtual ::comphelper::DocPasswordVerifierResult
- verifyPassword( const ::rtl::OUString& rPassword );
+ verifyPassword( const ::rtl::OUString& rPassword, uno::Sequence< beans::NamedValue >& o_rEncryptionData );
+ virtual ::comphelper::DocPasswordVerifierResult
+ verifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData );
+
private:
Reference< embed::XStorage > mxStorage;
};
-::comphelper::DocPasswordVerifierResult SfxDocPasswordVerifier::verifyPassword( const ::rtl::OUString& rPassword )
+//--------------------------------------------------------------------
+::comphelper::DocPasswordVerifierResult SfxDocPasswordVerifier::verifyPassword( const ::rtl::OUString& rPassword, uno::Sequence< beans::NamedValue >& o_rEncryptionData )
+{
+ o_rEncryptionData = ::comphelper::OStorageHelper::CreatePackageEncryptionData( rPassword );
+ return verifyEncryptionData( o_rEncryptionData );
+}
+
+
+//--------------------------------------------------------------------
+::comphelper::DocPasswordVerifierResult SfxDocPasswordVerifier::verifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
{
::comphelper::DocPasswordVerifierResult eResult = ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
try
{
- // check the password
- // if the password correct is the stream will be opened successfuly
+ // check the encryption data
+ // if the data correct is the stream will be opened successfuly
// and immediatelly closed
- ::comphelper::OStorageHelper::SetCommonStoragePassword( mxStorage, rPassword );
+ ::comphelper::OStorageHelper::SetCommonStorageEncryptionData( mxStorage, rEncryptionData );
mxStorage->openStreamElement(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ) ),
@@ -283,6 +294,8 @@ private:
return eResult;
}
+//====================================================================
+
//--------------------------------------------------------------------
sal_uInt32 CheckPasswd_Impl
@@ -341,14 +354,28 @@ sal_uInt32 CheckPasswd_Impl
if( xInteractionHandler.is() )
{
// use the comphelper password helper to request a password
+ ::rtl::OUString aPassword;
+ SFX_ITEMSET_ARG( pSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ if ( pPasswordItem )
+ aPassword = pPasswordItem->GetValue();
+
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ SFX_ITEMSET_ARG( pSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ if ( pEncryptionDataItem )
+ pEncryptionDataItem->GetValue() >>= aEncryptionData;
+
::rtl::OUString aDocumentName = INetURLObject( pFile->GetOrigURL() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET );
+
SfxDocPasswordVerifier aVerifier( xStorage );
- ::rtl::OUString aPassword = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
- aVerifier, ::rtl::OUString(), xInteractionHandler, aDocumentName, comphelper::DocPasswordRequestType_STANDARD );
+ aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
+ aVerifier, aEncryptionData, aPassword, xInteractionHandler, aDocumentName, comphelper::DocPasswordRequestType_STANDARD );
+
+ pSet->ClearItem( SID_PASSWORD );
+ pSet->ClearItem( SID_ENCRYPTIONDATA );
- if ( aPassword.getLength() > 0 )
+ if ( aEncryptionData.getLength() > 0 )
{
- pSet->Put( SfxStringItem( SID_PASSWORD, aPassword ) );
+ pSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) ) );
try
{
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 5347aec0e99f..8d1ac08844bf 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -193,6 +193,8 @@ static char const sBlackList[] = "BlackList";
static char const sModifyPasswordInfo[] = "ModifyPasswordInfo";
static char const sSuggestedSaveAsDir[] = "SuggestedSaveAsDir";
static char const sSuggestedSaveAsName[] = "SuggestedSaveAsName";
+static char const sEncryptionData[] = "EncryptionData";
+
void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot )
{
@@ -852,6 +854,10 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
{
rSet.Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, rProp.Value ) );
}
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sEncryptionData)) )
+ {
+ rSet.Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, rProp.Value ) );
+ }
else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSuggestedSaveAsDir)) )
{
::rtl::OUString sVal;
@@ -1082,9 +1088,12 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
nAdditional++;
if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO ) == SFX_ITEM_SET )
nAdditional++;
- if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR ) == SFX_ITEM_SET )
+ if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR ) == SFX_ITEM_SET )
+ nAdditional++;
+ if ( rSet.GetItemState( SID_ENCRYPTIONDATA ) == SFX_ITEM_SET )
+ nAdditional++;
nAdditional++;
- if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME ) == SFX_ITEM_SET )
+ if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME ) == SFX_ITEM_SET )
nAdditional++;
// consider additional arguments
@@ -1221,6 +1230,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
continue;
if ( nId == SID_NOAUTOSAVE )
continue;
+ if ( nId == SID_ENCRYPTIONDATA )
+ continue;
// used only internally
if ( nId == SID_SAVETO )
@@ -1594,6 +1605,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sModifyPasswordInfo));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
+ if ( rSet.GetItemState( SID_ENCRYPTIONDATA, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sEncryptionData));
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR, sal_False, &pItem ) == SFX_ITEM_SET )
{
pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSuggestedSaveAsDir));
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 02b9003f59d2..5045f1e9d75c 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1522,8 +1522,8 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
// check password checkbox if the document had password before
if( mbHasPassword )
{
- SFX_ITEMSET_ARG( rpSet, pPassItem, SfxStringItem, SID_PASSWORD, FALSE );
- mbPwdCheckBoxState = ( pPassItem != NULL );
+ SFX_ITEMSET_ARG( rpSet, pPassItem, SfxBoolItem, SID_PASSWORDINTERACTION, FALSE );
+ mbPwdCheckBoxState = ( pPassItem != NULL && pPassItem->GetValue() );
// in case the document has password to modify, the dialog should be shown
SFX_ITEMSET_ARG( rpSet, pPassToModifyItem, SfxUnoAnyItem, SID_MODIFYPASSWORDINFO, FALSE );
@@ -1537,7 +1537,9 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
mbSelectionEnabled = sal_False;
// the password will be set in case user decide so
+ rpSet->ClearItem( SID_PASSWORDINTERACTION );
rpSet->ClearItem( SID_PASSWORD );
+ rpSet->ClearItem( SID_ENCRYPTIONDATA );
rpSet->ClearItem( SID_RECOMMENDREADONLY );
rpSet->ClearItem( SID_MODIFYPASSWORDINFO );
@@ -1652,7 +1654,30 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
if ( pPasswordRequest->isPassword() )
{
if ( pPasswordRequest->getPassword().getLength() )
- rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
+ {
+ // TODO/LATER: The filters should show the password dialog themself in future
+ if ( bMSType )
+ {
+ // all the current MS-filters use MSCodec_Std97 implementation
+ uno::Sequence< sal_Int8 > aUniqueID = ::comphelper::DocPasswordHelper::GenerateRandomByteSequence( 16 );
+ uno::Sequence< sal_Int8 > aEncryptionKey = ::comphelper::DocPasswordHelper::GenerateStd97Key( pPasswordRequest->getPassword(), aUniqueID );
+
+ if ( aEncryptionKey.getLength() )
+ {
+ ::comphelper::SequenceAsHashMap aHashData;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97EncryptionKey" ) ) ] <<= aEncryptionKey;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97UniqueID" ) ) ] <<= aUniqueID;
+
+ rpSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aHashData.getAsConstNamedValueList() ) ) );
+ }
+ else
+ return ERRCODE_IO_NOTSUPPORTED;
+ }
+ else
+ {
+ rpSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( ::comphelper::OStorageHelper::CreatePackageEncryptionData( pPasswordRequest->getPassword() ) ) ) );
+ }
+ }
if ( pPasswordRequest->getRecommendReadOnly() )
rpSet->Put( SfxBoolItem( SID_RECOMMENDREADONLY, sal_True ) );
diff --git a/sfx2/source/dialog/mailmodelapi.cxx b/sfx2/source/dialog/mailmodelapi.cxx
index 16d12f469205..223807d37b11 100644
--- a/sfx2/source/dialog/mailmodelapi.cxx
+++ b/sfx2/source/dialog/mailmodelapi.cxx
@@ -79,8 +79,6 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/urlobj.hxx>
-extern sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, String& rPasswd );
-
// --------------------------------------------------------------
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
diff --git a/sfx2/source/dialog/makefile.mk b/sfx2/source/dialog/makefile.mk
index 4c56cd683e34..572053557e00 100755..100644
--- a/sfx2/source/dialog/makefile.mk
+++ b/sfx2/source/dialog/makefile.mk
@@ -46,6 +46,7 @@ EXCEPTIONSFILES=\
$(SLO)$/templdlg.obj \
$(SLO)$/dinfdlg.obj \
$(SLO)$/dockwin.obj \
+ $(SLO)$/passwd.obj \
$(SLO)$/taskpane.obj
SLOFILES =\
@@ -58,7 +59,6 @@ SLOFILES =\
$(SLO)$/mgetempl.obj \
$(SLO)$/navigat.obj \
$(SLO)$/newstyle.obj \
- $(SLO)$/passwd.obj \
$(SLO)$/printopt.obj \
$(SLO)$/sfxdlg.obj \
$(SLO)$/splitwin.obj \
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index e7cc73ca04bf..52c6acedd4ea 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -41,14 +41,15 @@
#include "passwd.hrc"
#include "vcl/sound.hxx"
+#include "vcl/arrange.hxx"
// -----------------------------------------------------------------------
-IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, EMPTYARG )
+IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, pEdit )
{
- if( mbAsciiOnly )
+ if( mbAsciiOnly && (pEdit == &maPasswordED || pEdit == &maPassword2ED) )
{
- rtl::OUString aTest( maPasswordED.GetText() );
+ rtl::OUString aTest( pEdit->GetText() );
const sal_Unicode* pTest = aTest.getStr();
sal_Int32 nLen = aTest.getLength();
rtl::OUStringBuffer aFilter( nLen );
@@ -64,12 +65,15 @@ IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, EMPTYARG )
if( bReset )
{
Sound::Beep( SOUND_ERROR );
- maPasswordED.SetSelection( Selection( 0, nLen ) );
- maPasswordED.ReplaceSelected( aFilter.makeStringAndClear() );
+ pEdit->SetSelection( Selection( 0, nLen ) );
+ pEdit->ReplaceSelected( aFilter.makeStringAndClear() );
}
}
- maOKBtn.Enable( maPasswordED.GetText().Len() >= mnMinLen );
+ bool bEnable = maPasswordED.GetText().Len() >= mnMinLen;
+ if( maPassword2ED.IsVisible() )
+ bEnable = (bEnable && (maPassword2ED.GetText().Len() >= mnMinLen));
+ maOKBtn.Enable( bEnable );
return 0;
}
IMPL_LINK_INLINE_END( SfxPasswordDialog, EditModifyHdl, Edit *, EMPTYARG )
@@ -78,8 +82,11 @@ IMPL_LINK_INLINE_END( SfxPasswordDialog, EditModifyHdl, Edit *, EMPTYARG )
IMPL_LINK( SfxPasswordDialog, OKHdl, OKButton *, EMPTYARG )
{
- if ( ( ( mnExtras & SHOWEXTRAS_CONFIRM ) == SHOWEXTRAS_CONFIRM ) &&
- ( GetConfirm() != GetPassword() ) )
+ bool bConfirmFailed = ( ( mnExtras & SHOWEXTRAS_CONFIRM ) == SHOWEXTRAS_CONFIRM ) &&
+ ( GetConfirm() != GetPassword() );
+ if( ( mnExtras & SHOWEXTRAS_CONFIRM2 ) == SHOWEXTRAS_CONFIRM2 && ( GetConfirm2() != GetPassword2() ) )
+ bConfirmFailed = true;
+ if ( bConfirmFailed )
{
ErrorBox aBox( this, SfxResId( MSG_ERROR_WRONG_CONFIRM ) );
aBox.Execute();
@@ -97,27 +104,83 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText
ModalDialog( pParent, SfxResId ( DLG_PASSWD ) ),
+ maPasswordBox ( this, SfxResId( GB_PASSWD_PASSWORD ) ),
maUserFT ( this, SfxResId( FT_PASSWD_USER ) ),
maUserED ( this, SfxResId( ED_PASSWD_USER ) ),
maPasswordFT ( this, SfxResId( FT_PASSWD_PASSWORD ) ),
maPasswordED ( this, SfxResId( ED_PASSWD_PASSWORD ) ),
maConfirmFT ( this, SfxResId( FT_PASSWD_CONFIRM ) ),
maConfirmED ( this, SfxResId( ED_PASSWD_CONFIRM ) ),
- maPasswordBox ( this, SfxResId( GB_PASSWD_PASSWORD ) ),
+ maPassword2Box ( this, 0 ),
+ maPassword2FT ( this, SfxResId( FT_PASSWD_PASSWORD2 ) ),
+ maPassword2ED ( this, SfxResId( ED_PASSWD_PASSWORD2 ) ),
+ maConfirm2FT ( this, SfxResId( FT_PASSWD_CONFIRM2 ) ),
+ maConfirm2ED ( this, SfxResId( ED_PASSWD_CONFIRM2 ) ),
maOKBtn ( this, SfxResId( BTN_PASSWD_OK ) ),
maCancelBtn ( this, SfxResId( BTN_PASSWD_CANCEL ) ),
maHelpBtn ( this, SfxResId( BTN_PASSWD_HELP ) ),
- maConfirmStr ( SfxResId( STR_PASSWD_CONFIRM ) ),
- mnMinLen ( 5 ),
+ mnMinLen ( 1 ),
mnExtras ( 0 ),
mbAsciiOnly ( false )
{
FreeResource();
+ // setup layout
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
+ xLayout->setOuterBorder( 0 );
+
+ // get edit size, should be used as minimum
+ Size aEditSize( maUserED.GetSizePixel() );
+
+ // add labelcolumn for the labeled edit fields
+ boost::shared_ptr<vcl::LabelColumn> xEdits( new vcl::LabelColumn( xLayout.get() ) );
+ size_t nChildIndex = xLayout->addChild( xEdits );
+ xLayout->setBorders( nChildIndex, -2, -2, -2, 0 );
+
+ // add group box
+ xEdits->addWindow( &maPasswordBox );
+
+ // add user line
+ xEdits->addRow( &maUserFT, &maUserED, -2, aEditSize );
+
+ // add password line
+ xEdits->addRow( &maPasswordFT, &maPasswordED, -2, aEditSize );
+
+ // add confirm line
+ xEdits->addRow( &maConfirmFT, &maConfirmED, -2, aEditSize );
+
+ // add second group box
+ xEdits->addWindow( &maPassword2Box );
+
+ // add second password line
+ xEdits->addRow( &maPassword2FT, &maPassword2ED, -2, aEditSize );
+
+ // add second confirm line
+ xEdits->addRow( &maConfirm2FT, &maConfirm2ED, -2, aEditSize );
+
+ // add a FixedLine
+ FixedLine* pLine = new FixedLine( this, 0 );
+ pLine->Show();
+ addWindow( pLine, true );
+ xLayout->addWindow( pLine );
+
+ // add button column
+ Size aBtnSize( maCancelBtn.GetSizePixel() );
+ boost::shared_ptr<vcl::RowOrColumn> xButtons( new vcl::RowOrColumn( xLayout.get(), false ) );
+ nChildIndex = xLayout->addChild( xButtons );
+ xLayout->setBorders( nChildIndex, -2, 0, -2, -2 );
+
+ size_t nBtnIndex = xButtons->addWindow( &maHelpBtn, 0, aBtnSize );
+ xButtons->addChild( new vcl::Spacer( xButtons.get() ) );
+ nBtnIndex = xButtons->addWindow( &maOKBtn, 0, aBtnSize );
+ nBtnIndex = xButtons->addWindow( &maCancelBtn, 0, aBtnSize );
+
Link aLink = LINK( this, SfxPasswordDialog, EditModifyHdl );
maPasswordED.SetModifyHdl( aLink );
+ maPassword2ED.SetModifyHdl( aLink );
aLink = LINK( this, SfxPasswordDialog, OKHdl );
maOKBtn.SetClickHdl( aLink );
@@ -146,66 +209,46 @@ void SfxPasswordDialog::SetMaxLen( USHORT nLen )
short SfxPasswordDialog::Execute()
{
- if ( mnExtras < SHOWEXTRAS_ALL )
+ maUserFT.Hide();
+ maUserED.Hide();
+ maConfirmFT.Hide();
+ maConfirmED.Hide();
+ maPasswordFT.Hide();
+ maPassword2Box.Hide();
+ maPassword2FT.Hide();
+ maPassword2ED.Hide();
+ maPassword2FT.Hide();
+ maConfirm2FT.Hide();
+ maConfirm2ED.Hide();
+
+ if( mnExtras != SHOWEXTRAS_NONE )
+ maPasswordFT.Show();
+ if( (mnExtras & SHOWEXTRAS_USER ) )
{
- Size a3Size = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
- Size a6Size = LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
- long nMinHeight = maHelpBtn.GetPosPixel().Y() +
- maHelpBtn.GetSizePixel().Height() + a6Size.Height();
- USHORT nRowHided = 1;
-
- if ( SHOWEXTRAS_NONE == mnExtras )
- {
- maUserFT.Hide();
- maUserED.Hide();
- maConfirmFT.Hide();
- maConfirmED.Hide();
- maPasswordFT.Hide();
-
- Point aPos = maUserFT.GetPosPixel();
- long nEnd = maUserED.GetPosPixel().X() + maUserED.GetSizePixel().Width();
- maPasswordED.SetPosPixel( aPos );
- Size aSize = maPasswordED.GetSizePixel();
- aSize.Width() = nEnd - aPos.X();
- maPasswordED.SetSizePixel( aSize );
-
- nRowHided = 2;
- }
- else if ( SHOWEXTRAS_USER == mnExtras )
- {
- maConfirmFT.Hide();
- maConfirmED.Hide();
- }
- else if ( SHOWEXTRAS_CONFIRM == mnExtras )
- {
- maUserFT.Hide();
- maUserED.Hide();
-
- Point aPwdPos1 = maPasswordFT.GetPosPixel();
- Point aPwdPos2 = maPasswordED.GetPosPixel();
-
- Point aPos = maUserFT.GetPosPixel();
- maPasswordFT.SetPosPixel( aPos );
- aPos = maUserED.GetPosPixel();
- maPasswordED.SetPosPixel( aPos );
-
- maConfirmFT.SetPosPixel( aPwdPos1 );
- maConfirmED.SetPosPixel( aPwdPos2 );
- }
-
- Size aBoxSize = maPasswordBox.GetSizePixel();
- aBoxSize.Height() -= ( nRowHided * maUserED.GetSizePixel().Height() );
- aBoxSize.Height() -= ( nRowHided * a3Size.Height() );
- maPasswordBox.SetSizePixel( aBoxSize );
-
- long nDlgHeight = maPasswordBox.GetPosPixel().Y() + aBoxSize.Height() + a6Size.Height();
- if ( nDlgHeight < nMinHeight )
- nDlgHeight = nMinHeight;
- Size aDlgSize = GetOutputSizePixel();
- aDlgSize.Height() = nDlgHeight;
- SetOutputSizePixel( aDlgSize );
+ maUserFT.Show();
+ maUserED.Show();
+ }
+ if( (mnExtras & SHOWEXTRAS_CONFIRM ) )
+ {
+ maConfirmFT.Show();
+ maConfirmED.Show();
+ }
+ if( (mnExtras & SHOWEXTRAS_PASSWORD2) )
+ {
+ maPassword2Box.Show();
+ maPassword2FT.Show();
+ maPassword2ED.Show();
+ }
+ if( (mnExtras & SHOWEXTRAS_CONFIRM2 ) )
+ {
+ maConfirm2FT.Show();
+ maConfirm2ED.Show();
}
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
+ SetSizePixel( xLayout->getOptimalSize( WINDOWSIZE_PREFERRED ) );
+
return ModalDialog::Execute();
}
diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc
index 5be0446fd752..5c9b07c7a130 100644
--- a/sfx2/source/dialog/passwd.hrc
+++ b/sfx2/source/dialog/passwd.hrc
@@ -41,7 +41,10 @@
#define BTN_PASSWD_CANCEL 21
#define BTN_PASSWD_HELP 22
-#define STR_PASSWD_CONFIRM 30
+#define FT_PASSWD_PASSWORD2 25
+#define ED_PASSWD_PASSWORD2 26
+#define FT_PASSWD_CONFIRM2 27
+#define ED_PASSWD_CONFIRM2 28
#endif
diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src
index 79cbb382ad36..426fb9986d5a 100644
--- a/sfx2/source/dialog/passwd.src
+++ b/sfx2/source/dialog/passwd.src
@@ -86,6 +86,32 @@ ModalDialog DLG_PASSWD
Size = MAP_APPFONT( 132, 8 );
Text [ en-US ] = "Password" ;
};
+ FixedText FT_PASSWD_PASSWORD2
+ {
+ Pos = MAP_APPFONT( 12, 30 );
+ Size = MAP_APPFONT( 42, 10 );
+ Text [ en-US ] = "P~assword";
+ };
+ Edit ED_PASSWD_PASSWORD2
+ {
+ Border = TRUE;
+ PassWord = TRUE;
+ Pos = MAP_APPFONT( 57, 29 );
+ Size = MAP_APPFONT( 75, 12 );
+ };
+ FixedText FT_PASSWD_CONFIRM2
+ {
+ Pos = MAP_APPFONT( 12, 45 );
+ Size = MAP_APPFONT( 42, 10 );
+ Text [ en-US ] = "Confir~m";
+ };
+ Edit ED_PASSWD_CONFIRM2
+ {
+ Border = TRUE;
+ PassWord = TRUE;
+ Pos = MAP_APPFONT( 57, 44 );
+ Size = MAP_APPFONT( 75, 12 );
+ };
OKButton BTN_PASSWD_OK
{
Disable = TRUE;
@@ -103,10 +129,6 @@ ModalDialog DLG_PASSWD
Pos = MAP_APPFONT( 144, 43 );
Size = MAP_APPFONT( 50, 14 );
};
- String STR_PASSWD_CONFIRM
- {
- Text [ en-US ] = "Confirm password" ;
- };
};
// ********************************************************************** EOF
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index 8e440de0757c..a050e07da5ae 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -329,13 +329,13 @@ void SfxVersionDialog::Open_Impl()
SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE("private:user") );
SfxStringItem aFile( SID_FILE_NAME, pObjShell->GetMedium()->GetName() );
- ::rtl::OUString aPassString;
- if ( GetPasswd_Impl( pObjShell->GetMedium()->GetItemSet(), aPassString ) )
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ if ( GetEncryptionData_Impl( pObjShell->GetMedium()->GetItemSet(), aEncryptionData ) )
{
// there is a password, it should be used during the opening
- SfxStringItem aPassItem( SID_PASSWORD, aPassString );
+ SfxUnoAnyItem aEncryptionDataItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) );
pViewFrame->GetDispatcher()->Execute(
- SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, &aFile, &aItem, &aTarget, &aReferer, &aPassItem, 0L );
+ SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, &aFile, &aItem, &aTarget, &aReferer, &aEncryptionDataItem, 0L );
}
else
pViewFrame->GetDispatcher()->Execute(
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 29081e8e8418..6b9afa136e46 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -881,17 +881,21 @@ uno::Reference < embed::XStorage > SfxMedium::GetOutputStorage()
}
//------------------------------------------------------------------
-void SfxMedium::SetPasswordToStorage_Impl()
+void SfxMedium::SetEncryptionDataToStorage_Impl()
{
// in case media-descriptor contains password it should be used on opening
if ( pImp->xStorage.is() && pSet )
{
- ::rtl::OUString aPasswd;
- if ( GetPasswd_Impl( pSet, aPasswd ) )
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ if ( GetEncryptionData_Impl( pSet, aEncryptionData ) )
{
+ // replace the password with encryption data
+ pSet->ClearItem( SID_PASSWORD );
+ pSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) ) );
+
try
{
- ::comphelper::OStorageHelper::SetCommonStoragePassword( pImp->xStorage, aPasswd );
+ ::comphelper::OStorageHelper::SetCommonStorageEncryptionData( pImp->xStorage, aEncryptionData );
}
catch( uno::Exception& )
{
@@ -1326,7 +1330,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIf
// TODO/LATER: Get versionlist on demand
if ( pImp->xStorage.is() )
{
- SetPasswordToStorage_Impl();
+ SetEncryptionDataToStorage_Impl();
GetVersionList();
}
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 3c4df7276d6b..6b2b5dcb8c0b 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -978,12 +978,11 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
NULL );
const SfxPoolItem* pItem = NULL;
- if ( bPreselectPassword && aDialogParams.GetItemState( SID_PASSWORD, sal_True, &pItem ) != SFX_ITEM_SET )
+ if ( bPreselectPassword && aDialogParams.GetItemState( SID_ENCRYPTIONDATA, sal_True, &pItem ) != SFX_ITEM_SET )
{
- // the file dialog preselects the password checkbox if the provided mediadescriptor has password entry
- // after dialog execution the password entry will be either removed or replaced with the password
- // entered by the user
- aDialogParams.Put( SfxStringItem( SID_PASSWORD, String() ) );
+ // the file dialog preselects the password checkbox if the provided mediadescriptor has encryption data entry
+ // after dialog execution the password interaction flag will be either removed or not
+ aDialogParams.Put( SfxBoolItem( SID_PASSWORDINTERACTION, sal_True ) );
}
// aStringTypeFN is a pure output parameter, pDialogParams is an in/out parameter
@@ -1590,6 +1589,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
DocumentSettingsGuard aSettingsGuard( aModelData.GetModel(), aModelData.IsRecommendReadOnly(), nStoreMode & EXPORT_REQUESTED );
+ OSL_ENSURE( aModelData.GetMediaDescr().find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Password" ) ) ) == aModelData.GetMediaDescr().end(), "The Password property of MediaDescriptor should not be used here!" );
if ( aOptions.IsDocInfoSave()
&& ( !aModelData.GetStorable()->hasLocation()
|| INetURLObject( aModelData.GetStorable()->getLocation() ) != aURL ) )
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index bb0e6939ead8..b0be3638f2a4 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -599,8 +599,9 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// ========================================================================================================
sal_Bool bPreselectPassword = sal_False;
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pOldEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, FALSE );
SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pOldPasswordItem, SfxStringItem, SID_PASSWORD, FALSE );
- if ( pOldPasswordItem )
+ if ( pOldEncryptionDataItem || pOldPasswordItem )
bPreselectPassword = sal_True;
uno::Sequence< beans::PropertyValue > aDispatchArgs;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 037493c61252..c3f532ad1ba6 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -202,16 +202,30 @@ sal_Bool SfxObjectShell::QuerySlotExecutable( USHORT /*nSlotId*/ )
//-------------------------------------------------------------------------
-sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd )
+bool GetEncryptionData_Impl( const SfxItemSet* pSet, uno::Sequence< beans::NamedValue >& o_rEncryptionData )
{
- const SfxPoolItem* pItem = NULL;
- if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_PASSWORD, sal_True, &pItem ) )
+ bool bResult = false;
+ if ( pSet )
{
- DBG_ASSERT( pItem->IsA( TYPE(SfxStringItem) ), "wrong item type" );
- rPasswd = ( (const SfxStringItem*)pItem )->GetValue();
- return sal_True;
+ SFX_ITEMSET_ARG( pSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ if ( pEncryptionDataItem )
+ {
+ pEncryptionDataItem->GetValue() >>= o_rEncryptionData;
+ bResult = true;
+ }
+ else
+ {
+ SFX_ITEMSET_ARG( pSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ if ( pPasswordItem )
+ {
+ ::rtl::OUString aPassword = pPasswordItem->GetValue();
+ o_rEncryptionData = ::comphelper::OStorageHelper::CreatePackageEncryptionData( aPassword );
+ bResult = true;
+ }
+ }
}
- return sal_False;
+
+ return bResult;
}
//-------------------------------------------------------------------------
@@ -996,15 +1010,15 @@ sal_Bool SfxObjectShell::DoSave()
pImp->bIsSaving = sal_True;
- ::rtl::OUString aPasswd;
+ uno::Sequence< beans::NamedValue > aEncryptionData;
if ( IsPackageStorageFormat_Impl( *GetMedium() ) )
{
- if ( GetPasswd_Impl( GetMedium()->GetItemSet(), aPasswd ) )
+ if ( GetEncryptionData_Impl( GetMedium()->GetItemSet(), aEncryptionData ) )
{
try
{
//TODO/MBA: GetOutputStorage?! Special mode, because it's "Save"?!
- ::comphelper::OStorageHelper::SetCommonStoragePassword( GetMedium()->GetStorage(), aPasswd );
+ ::comphelper::OStorageHelper::SetCommonStorageEncryptionData( GetMedium()->GetStorage(), aEncryptionData );
bOk = sal_True;
}
catch( uno::Exception& )
@@ -1386,13 +1400,13 @@ sal_Bool SfxObjectShell::SaveTo_Impl
}
// transfer password from the parameters to the storage
- ::rtl::OUString aPasswd;
+ uno::Sequence< beans::NamedValue > aEncryptionData;
sal_Bool bPasswdProvided = sal_False;
- if ( GetPasswd_Impl( rMedium.GetItemSet(), aPasswd ) )
+ if ( GetEncryptionData_Impl( rMedium.GetItemSet(), aEncryptionData ) )
{
bPasswdProvided = sal_True;
try {
- ::comphelper::OStorageHelper::SetCommonStoragePassword( xMedStorage, aPasswd );
+ ::comphelper::OStorageHelper::SetCommonStorageEncryptionData( xMedStorage, aEncryptionData );
bOk = sal_True;
}
catch( uno::Exception& )
@@ -3154,13 +3168,13 @@ sal_Bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD, sal_False );
if ( pPasswdItem || ERRCODE_IO_ABORT != CheckPasswd_Impl( this, SFX_APP()->GetPool(), pMedium ) )
{
- ::rtl::OUString aPasswd;
- if ( GetPasswd_Impl(pMedium->GetItemSet(), aPasswd) )
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ if ( GetEncryptionData_Impl(pMedium->GetItemSet(), aEncryptionData) )
{
try
{
// the following code must throw an exception in case of failure
- ::comphelper::OStorageHelper::SetCommonStoragePassword( xStorage, aPasswd );
+ ::comphelper::OStorageHelper::SetCommonStorageEncryptionData( xStorage, aEncryptionData );
}
catch( uno::Exception& )
{
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index ee449d15b419..bf2654a1297e 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -980,6 +980,8 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
aArgs.remove( "InputStream" );
aArgs.remove( "URL" );
aArgs.remove( "Frame" );
+ aArgs.remove( "Password" );
+ aArgs.remove( "EncryptionData" );
// TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be removed here
@@ -1633,6 +1635,11 @@ void SAL_CALL SfxBaseModel::storeAsURL( const ::rtl::OUString&
uno::Sequence< beans::PropertyValue > aSequence ;
TransformItems( SID_OPENDOC, *m_pData->m_pObjectShell->GetMedium()->GetItemSet(), aSequence );
attachResource( rURL, aSequence );
+
+#if OSL_DEBUG_LEVEL > 0
+ SFX_ITEMSET_ARG( m_pData->m_pObjectShell->GetMedium()->GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD, sal_False);
+ OSL_ENSURE( !pPasswdItem, "There should be no Password property in the document MediaDescriptor!" );
+#endif
}
}
@@ -1891,6 +1898,11 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >&
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHidItem, SfxBoolItem, SID_HIDDEN, sal_False);
if ( pHidItem )
bHidden = pHidItem->GetValue();
+
+#if OSL_DEBUG_LEVEL > 0
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD, sal_False);
+ OSL_ENSURE( !pPasswdItem, "There should be no Password property in the document MediaDescriptor!" );
+#endif
// !TODO: will be done by Framework!
pMedium->SetUpdatePickList( !bHidden );
}
@@ -2670,49 +2682,41 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
aArgHash.erase( aFilterString );
aArgHash.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) );
- // if the password is changed SaveAs should be done
- // no password for encrypted document is also a change here
- sal_Bool bPassChanged = sal_False;
-
- ::comphelper::SequenceAsHashMap::iterator aNewPassIter
- = aArgHash.find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Password" ) ) );
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
- if ( pPasswordItem && aNewPassIter != aArgHash.end() )
+ try
{
- ::rtl::OUString aNewPass;
- aNewPassIter->second >>= aNewPass;
- bPassChanged = !aNewPass.equals( pPasswordItem->GetValue() );
+ storeSelf( aArgHash.getAsConstPropertyValueList() );
+ bSaved = sal_True;
}
- else if ( pPasswordItem || aNewPassIter != aArgHash.end() )
- bPassChanged = sal_True;
-
- if ( !bPassChanged )
+ catch( const lang::IllegalArgumentException& )
{
- try
- {
- storeSelf( aArgHash.getAsConstPropertyValueList() );
- bSaved = sal_True;
- }
- catch( const lang::IllegalArgumentException& )
+ // some additional arguments do not allow to use saving, SaveAs should be done
+ // but only for normal documents, the shared documents would be overwritten in this case
+ // that would mean an information loss
+ // TODO/LATER: need a new interaction for this case
+ if ( m_pData->m_pObjectShell->IsDocShared() )
{
- // some additional arguments do not allow to use saving, SaveAs should be done
- // but only for normal documents, the shared documents would be overwritten in this case
- // that would mean an information loss
- // TODO/LATER: need a new interaction for this case
- if ( m_pData->m_pObjectShell->IsDocShared() )
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't store shared document!" ) ) );
+ m_pData->m_pObjectShell->StoreLog();
+
+ uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionData" ) ), uno::Sequence< beans::NamedValue >() );
+ if ( !aNewEncryptionData.getLength() )
{
- m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't store shared document!" ) ) );
- m_pData->m_pObjectShell->StoreLog();
+ ::rtl::OUString aNewPassword = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Password" ) ), ::rtl::OUString() );
+ aNewEncryptionData = ::comphelper::OStorageHelper::CreatePackageEncryptionData( aNewPassword );
+ }
+
+ uno::Sequence< beans::NamedValue > aOldEncryptionData;
+ GetEncryptionData_Impl( pMedium->GetItemSet(), aOldEncryptionData );
+ if ( !aOldEncryptionData.getLength() && !aNewEncryptionData.getLength() )
throw;
+ else
+ {
+ // if the password is changed a special error should be used in case of shared document
+ throw task::ErrorCodeIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant change password for shared document." ) ), uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE );
}
}
}
- else if ( m_pData->m_pObjectShell->IsDocShared() )
- {
- // if the password is changed a special error should be used in case of shared document
- throw task::ErrorCodeIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant change password for shared document." ) ), uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE );
- }
}
}
}
diff --git a/solenv/bin/addsym.awk b/solenv/bin/addsym.awk
index 52efcb4ab740..621ca2e4bc42 100644
--- a/solenv/bin/addsym.awk
+++ b/solenv/bin/addsym.awk
@@ -26,16 +26,29 @@
#*************************************************************************
# Add certain symbol patterns to the first global section.
+#
+# The below code fails with 'perverted' mapfiles (using a strange line layout,
+# or containing version UDK_3_0_0 without a global section, ...).
BEGIN { state = 0 }
-/\{/ && state == 1 { exit 1 } #TODO: print error explanation to stderr?
-/^[\t ]*UDK_3_0_0[\t ]*\{/ && state == 0 { state = 1 }
-/^[\t ]*global[\t ]*:/ && state == 1 { state = 2 }
-{ print }
+END {
+ if (state == 0) {
+ print "# Weak RTTI symbols for C++ exceptions:"
+ print "UDK_3_0_0 {"
+ print "global:"
+ print "_ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions"
+ if (ENVIRON["USE_SYSTEM_STL"] != "YES")
+ print "_ZN4_STL7num_put*; # for STLport"
+ print "};"
+ }
+}
state == 2 {
print "_ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions"
if (ENVIRON["USE_SYSTEM_STL"] != "YES")
print "_ZN4_STL7num_put*; # for STLport"
state = 3
}
-END { if (state != 3) exit 1 } #TODO: print error explanation to stderr?
+# #i66636# - ???
+/^[\t ]*UDK_3_0_0[\t ]*\{/ { state = 1 }
+/^[\t ]*global[\t ]*:/ && state == 1 { state = 2 }
+{ print }
diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl
index 0ba604d55cec..3b325b62ad98 100755..100644
--- a/solenv/bin/build.pl
+++ b/solenv/bin/build.pl
@@ -786,6 +786,7 @@ sub dmake_dir {
$error_code = run_job($dmake, $job_name);
html_store_job_info(\%local_deps_hash, $job_name, $error_code) if (!$child);
};
+
if ($error_code && $ignore) {
push(@ignored_errors, $job_name);
$error_code = 0;
@@ -802,6 +803,7 @@ sub dmake_dir {
};
_exit(0);
} elsif ($error_code && ($error_code != -1)) {
+ $broken_build{$job_name} = $error_code;
return $error_code;
};
};
@@ -1681,23 +1683,23 @@ sub cancel_build {
};
if ($broken_modules_number && $build_all_parents) {
- print "\n";
- print $broken_modules_number;
- print " module(s): ";
+ print STDERR "\n";
+ print STDERR $broken_modules_number;
+ print STDERR " module(s): ";
foreach (@broken_module_names) {
- print "\n\t$_";
+ print STDERR "\n\t$_";
};
- print "\nneed(s) to be rebuilt\n\nReason(s):\n\n";
+ print STDERR "\nneed(s) to be rebuilt\n\nReason(s):\n\n";
foreach (keys %broken_build) {
- print "ERROR: error " . $broken_build{$_} . " occurred while making $_\n";
+ print STDERR "ERROR: error " . $broken_build{$_} . " occurred while making $_\n";
};
- print "\nAttention: if you fix the errors in above module(s) you may prolongue your the build issuing command:\n\n\t" . $message_part;
+ print STDERR "\nAttention: if you fix the errors in above module(s) you may prolongue your the build issuing command:\n\n\t" . $message_part;
} else {
while (children_number()) {
handle_dead_children(1);
}
foreach (keys %broken_build) {
- print "ERROR: error " . $broken_build{$_} . " occurred while making $_\n";
+ print STDERR "ERROR: error " . $broken_build{$_} . " occurred while making $_\n";
};
};
print "\n";
@@ -2031,7 +2033,7 @@ sub do_custom_job {
};
if ($error_code) {
$modules_with_errors{$dependencies_hash}++;
- $broken_build{$module} = $error_code;
+# $broken_build{$module_job} = $error_code;
} else {
remove_from_dependencies($module_job, $dependencies_hash);
};
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index 2716c19b5268..9f23c05cc53f 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,5 +1,5 @@
RSCVERSION=300
-RSCREVISION=300m94(Build:9547)
-BUILD=9547
-LAST_MINOR=m94
+RSCREVISION=300m95(Build:9553)
+BUILD=9553
+LAST_MINOR=m95
SOURCEVERSION=DEV300
diff --git a/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx b/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx
index 3f7211aa9dc0..870192c9b151 100644
--- a/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx
+++ b/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx
@@ -95,6 +95,15 @@ namespace sdr
// Process the whole displaying
virtual void ProcessDisplay(DisplayInfo& rDisplayInfo);
+ // VirtualDevice? Default is false
+ virtual bool isOutputToVirtualDevice() const;
+
+ // recording MetaFile? Default is false
+ virtual bool isOutputToRecordingMetaFile() const;
+
+ // pdf export? Default is false
+ virtual bool isOutputToPDFFile() const;
+
// access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
virtual OutputDevice* TryToGetOutputDevice() const;
};
diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx
index 23d9204ca891..1eba8822402a 100644
--- a/svx/inc/svx/svdograf.hxx
+++ b/svx/inc/svx/svdograf.hxx
@@ -120,7 +120,8 @@ protected:
void ImpLinkAnmeldung();
void ImpLinkAbmeldung();
- sal_Bool ImpUpdateGraphicLink() const;
+ sal_Bool ImpUpdateGraphicLink( sal_Bool bAsynchron = sal_True ) const;
+ void ImpSetLinkedGraphic( const Graphic& rGraphic );
DECL_LINK( ImpSwapHdl, GraphicObject* );
public:
diff --git a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
index da8518d7f1a1..c6965fcd40fb 100644
--- a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
+++ b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
@@ -151,6 +151,25 @@ namespace sdr
}
}
+ // VirtualDevice?
+ bool ObjectContactOfObjListPainter::isOutputToVirtualDevice() const
+ {
+ return (OUTDEV_VIRDEV == mrTargetOutputDevice.GetOutDevType());
+ }
+
+ // recording MetaFile?
+ bool ObjectContactOfObjListPainter::isOutputToRecordingMetaFile() const
+ {
+ GDIMetaFile* pMetaFile = mrTargetOutputDevice.GetConnectMetaFile();
+ return (pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
+ }
+
+ // pdf export?
+ bool ObjectContactOfObjListPainter::isOutputToPDFFile() const
+ {
+ return (0 != mrTargetOutputDevice.GetPDFWriter());
+ }
+
OutputDevice* ObjectContactOfObjListPainter::TryToGetOutputDevice() const
{
return &mrTargetOutputDevice;
diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
index cd2d9670bf7c..110186d41bf4 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
@@ -177,7 +177,7 @@ namespace sdr
if(rGrafObj.IsLinkedGraphic())
{
// update graphic link
- rGrafObj.ImpUpdateGraphicLink();
+ rGrafObj.ImpUpdateGraphicLink( sal_False );
}
else
{
@@ -196,7 +196,7 @@ namespace sdr
rGrafObj.mbInsidePaint = sal_True;
rGrafObj.ForceSwapIn();
rGrafObj.mbInsidePaint = sal_False;
- }
+ }
bRetval = true;
}
@@ -252,19 +252,27 @@ namespace sdr
// prepare primitive generation with evtl. loading the graphic when it's swapped out
SdrGrafObj& rGrafObj = const_cast< ViewObjectContactOfGraphic* >(this)->getSdrGrafObj();
bool bDoAsynchronGraphicLoading(rGrafObj.GetModel() && rGrafObj.GetModel()->IsSwapGraphics());
- static bool bSuppressAsynchLoading(false);
bool bSwapInDone(false);
+ bool bSwapInExclusive(false);
- if(bDoAsynchronGraphicLoading
- && rGrafObj.IsSwappedOut()
- && rGrafObj.GetPage()
- && rGrafObj.GetPage()->IsMasterPage())
+ if( bDoAsynchronGraphicLoading && rGrafObj.IsSwappedOut() )
{
- // #i102380# force Swap-In for GraphicObjects on MasterPage to have a nicer visualisation
- bDoAsynchronGraphicLoading = false;
+ // sometimes it is needed that each graphic is completely available and swapped in
+ // for these cases a ForceSwapIn is called later at the graphic object
+ if ( rGrafObj.GetPage() && rGrafObj.GetPage()->IsMasterPage() )
+ {
+ // #i102380# force Swap-In for GraphicObjects on MasterPage to have a nicer visualisation
+ bDoAsynchronGraphicLoading = false;
+ }
+ else if ( GetObjectContact().isOutputToPrinter()
+ || GetObjectContact().isOutputToRecordingMetaFile()
+ || GetObjectContact().isOutputToPDFFile() )
+ {
+ bDoAsynchronGraphicLoading = false;
+ bSwapInExclusive = true;
+ }
}
-
- if(bDoAsynchronGraphicLoading && !bSuppressAsynchLoading)
+ if( bDoAsynchronGraphicLoading )
{
bSwapInDone = const_cast< ViewObjectContactOfGraphic* >(this)->impPrepareGraphicWithAsynchroniousLoading();
}
@@ -293,10 +301,8 @@ namespace sdr
}
}
- // if swap in was forced only for printing, swap out again
- const bool bSwapInExclusiveForPrinting(bSwapInDone && GetObjectContact().isOutputToPrinter());
-
- if(bSwapInExclusiveForPrinting)
+ // if swap in was forced only for printing metafile and pdf, swap out again
+ if( bSwapInDone && bSwapInExclusive )
{
rGrafObj.ForceSwapOut();
}
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 8ab385fa329c..9abb1969459d 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -207,6 +207,8 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
else
nDefTextHgt = SdrEngineDefaults::GetFontHeight();
+ pItemPool->SetPoolDefaultItem( SdrTextWordWrapItem( sal_False ) );
+
SetTextDefaults();
pLayerAdmin=new SdrLayerAdmin;
pLayerAdmin->SetModel(this);
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index d1f65c30050d..27c96f6c819d 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -45,6 +45,7 @@
#include <vcl/svapp.hxx>
#include <sfx2/linkmgr.hxx>
+#include <sfx2/docfile.hxx>
#include <svx/svdetc.hxx>
#include "svdglob.hxx"
#include "svdstr.hrc"
@@ -69,6 +70,8 @@
#include <svx/sdr/contact/viewcontactofgraphic.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <osl/thread.hxx>
+#include <vos/mutex.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
@@ -80,13 +83,48 @@ using namespace ::com::sun::star::io;
#define GRAFSTREAMPOS_INVALID 0xffffffff
#define SWAPGRAPHIC_TIMEOUT 5000
+
// ------------------
// - SdrGraphicLink -
// ------------------
+
+const Graphic ImpLoadLinkedGraphic( const String& rFileName, const String& rFilterName )
+{
+ Graphic aGraphic;
+
+ SfxMedium xMed( rFileName, STREAM_STD_READ, TRUE );
+ xMed.DownLoad();
+
+ SvStream* pInStrm = xMed.GetInStream();
+ if ( pInStrm )
+ {
+ pInStrm->Seek( STREAM_SEEK_TO_BEGIN );
+ GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
+
+ const USHORT nFilter = rFilterName.Len() && pGF->GetImportFormatCount()
+ ? pGF->GetImportFormatNumber( rFilterName )
+ : GRFILTER_FORMAT_DONTKNOW;
+
+ String aEmptyStr;
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aFilterData( 1 );
+
+ // Room for improvment:
+ // As this is a linked graphic the GfxLink is not needed if saving/loading our own format.
+ // But this link is required by some filters to access the native graphic (pdf export/ms export),
+ // there we should create a new service to provide this data if needed
+ aFilterData[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CreateNativeLink" ) );
+ aFilterData[ 0 ].Value = Any( sal_True );
+ pGF->ImportGraphic( aGraphic, aEmptyStr, *pInStrm, nFilter, NULL, 0, &aFilterData );
+ }
+ return aGraphic;
+}
+
+class SdrGraphicUpdater;
class SdrGraphicLink : public sfx2::SvBaseLink
{
SdrGrafObj* pGrafObj;
+ SdrGraphicUpdater* pGraphicUpdater;
public:
SdrGraphicLink(SdrGrafObj* pObj);
@@ -95,16 +133,87 @@ public:
virtual void Closed();
virtual void DataChanged( const String& rMimeType,
const ::com::sun::star::uno::Any & rValue );
+ void DataChanged( const Graphic& rGraphic );
BOOL Connect() { return 0 != GetRealObject(); }
- void UpdateSynchron();
+ void UpdateAsynchron();
+ void RemoveGraphicUpdater();
};
+class SdrGraphicUpdater : public ::osl::Thread
+{
+public:
+ SdrGraphicUpdater( const String& rFileName, const String& rFilterName, SdrGraphicLink& );
+ virtual ~SdrGraphicUpdater( void );
+
+ void SAL_CALL Terminate( void );
+
+ sal_Bool GraphicLinkChanged( const String& rFileName ){ return mrFileName != rFileName; };
+
+protected:
+
+ /** is called from the inherited create method and acts as the
+ main function of this thread.
+ */
+ virtual void SAL_CALL run(void);
+
+ /** Called after the thread is terminated via the terminate
+ method. Used to kill the thread by calling delete on this.
+ */
+ virtual void SAL_CALL onTerminated(void);
+
+private:
+
+ ::osl::Mutex maMutex;
+ const String& mrFileName;
+ const String& mrFilterName;
+ SdrGraphicLink& mrGraphicLink;
+
+ volatile bool mbIsTerminated;
+};
+
+SdrGraphicUpdater::SdrGraphicUpdater( const String& rFileName, const String& rFilterName, SdrGraphicLink& rGraphicLink )
+: mrFileName( rFileName )
+, mrFilterName( rFilterName )
+, mrGraphicLink( rGraphicLink )
+, mbIsTerminated( sal_False )
+{
+ create();
+}
+
+SdrGraphicUpdater::~SdrGraphicUpdater( void )
+{
+}
+
+void SdrGraphicUpdater::Terminate()
+{
+ ::osl::MutexGuard aGuard( maMutex );
+ mbIsTerminated = sal_True;
+}
+
+void SAL_CALL SdrGraphicUpdater::onTerminated(void)
+{
+ delete this;
+}
+
+void SAL_CALL SdrGraphicUpdater::run(void)
+{
+ Graphic aGraphic( ImpLoadLinkedGraphic( mrFileName, mrFilterName ) );
+ ::osl::MutexGuard aGuard(maMutex);
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ if ( !mbIsTerminated )
+ {
+ mrGraphicLink.DataChanged( aGraphic );
+ mrGraphicLink.RemoveGraphicUpdater();
+ }
+}
+
// -----------------------------------------------------------------------------
-SdrGraphicLink::SdrGraphicLink(SdrGrafObj* pObj):
- ::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, SOT_FORMATSTR_ID_SVXB ),
- pGrafObj(pObj)
+SdrGraphicLink::SdrGraphicLink(SdrGrafObj* pObj)
+: ::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, SOT_FORMATSTR_ID_SVXB )
+, pGrafObj( pObj )
+, pGraphicUpdater( NULL )
{
SetSynchron( FALSE );
}
@@ -113,6 +222,22 @@ SdrGraphicLink::SdrGraphicLink(SdrGrafObj* pObj):
SdrGraphicLink::~SdrGraphicLink()
{
+ if ( pGraphicUpdater )
+ pGraphicUpdater->Terminate();
+}
+
+// -----------------------------------------------------------------------------
+
+void SdrGraphicLink::DataChanged( const Graphic& rGraphic )
+{
+ pGrafObj->ImpSetLinkedGraphic( rGraphic );
+}
+
+// -----------------------------------------------------------------------------
+
+void SdrGraphicLink::RemoveGraphicUpdater()
+{
+ pGraphicUpdater = NULL;
}
// -----------------------------------------------------------------------------
@@ -135,9 +260,8 @@ void SdrGraphicLink::DataChanged( const String& rMimeType,
}
else if( SotExchange::GetFormatIdFromMimeType( rMimeType ) != sfx2::LinkManager::RegisterStatusInfoId() )
{
- // only repaint, no objectchange
- pGrafObj->ActionChanged();
- // pGrafObj->BroadcastObjectChange();
+ // broadcasting, to update slidesorter
+ pGrafObj->BroadcastObjectChange();
}
}
}
@@ -155,14 +279,20 @@ void SdrGraphicLink::Closed()
// -----------------------------------------------------------------------------
-void SdrGraphicLink::UpdateSynchron()
+void SdrGraphicLink::UpdateAsynchron()
{
if( GetObj() )
{
- String aMimeType( SotExchange::GetFormatMimeType( GetContentType() ));
- ::com::sun::star::uno::Any aValue;
- GetObj()->GetData( aValue, aMimeType, TRUE );
- DataChanged( aMimeType, aValue );
+ if ( pGraphicUpdater )
+ {
+ if ( pGraphicUpdater->GraphicLinkChanged( pGrafObj->GetFileName() ) )
+ {
+ pGraphicUpdater->Terminate();
+ pGraphicUpdater = new SdrGraphicUpdater( pGrafObj->GetFileName(), pGrafObj->GetFilterName(), *this );
+ }
+ }
+ else
+ pGraphicUpdater = new SdrGraphicUpdater( pGrafObj->GetFileName(), pGrafObj->GetFilterName(), *this );
}
}
@@ -447,8 +577,10 @@ void SdrGrafObj::ForceSwapIn() const
const_cast< SdrGrafObj* >( this )->mbIsPreview = sal_False;
}
-
- pGraphic->FireSwapInRequest();
+ if ( pGraphicLink && pGraphic->IsSwappedOut() )
+ ImpUpdateGraphicLink( sal_False );
+ else
+ pGraphic->FireSwapInRequest();
if( pGraphic->IsSwappedOut() ||
( pGraphic->GetType() == GRAPHIC_NONE ) ||
@@ -558,24 +690,36 @@ UINT16 SdrGrafObj::GetObjIdentifier() const
// -----------------------------------------------------------------------------
-sal_Bool SdrGrafObj::ImpUpdateGraphicLink() const
+/* The graphic of the GraphicLink will be loaded. If it is called with
+ bAsynchron = true then the graphic will be set later via DataChanged
+*/
+sal_Bool SdrGrafObj::ImpUpdateGraphicLink( sal_Bool bAsynchron ) const
{
- sal_Bool bRet = sal_False;
-
+ sal_Bool bRet = sal_False;
if( pGraphicLink )
{
- const sal_Bool bIsChanged = pModel->IsChanged();
- pGraphicLink->UpdateSynchron();
- pModel->SetChanged( bIsChanged );
-
+ if ( bAsynchron )
+ pGraphicLink->UpdateAsynchron();
+ else
+ pGraphicLink->DataChanged( ImpLoadLinkedGraphic( aFileName, aFilterName ) );
bRet = sal_True;
}
-
return bRet;
}
// -----------------------------------------------------------------------------
+void SdrGrafObj::ImpSetLinkedGraphic( const Graphic& rGraphic )
+{
+ const sal_Bool bIsChanged = GetModel()->IsChanged();
+ NbcSetGraphic( rGraphic );
+ ActionChanged();
+ BroadcastObjectChange();
+ GetModel()->SetChanged( bIsChanged );
+}
+
+// -----------------------------------------------------------------------------
+
void SdrGrafObj::TakeObjNameSingul(XubString& rName) const
{
switch( pGraphic->GetType() )
@@ -1095,7 +1239,7 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
if( ( pGraphic->HasUserData() || pGraphicLink ) &&
( nSwapMode & SDR_SWAPGRAPHICSMODE_PURGE ) )
{
- pRet = NULL;
+ pRet = GRFMGR_AUTOSWAPSTREAM_LINK;
}
else if( nSwapMode & SDR_SWAPGRAPHICSMODE_TEMP )
{
@@ -1180,7 +1324,7 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
}
}
}
- else if( !ImpUpdateGraphicLink() )
+ else if( !ImpUpdateGraphicLink( sal_False ) )
{
pRet = GRFMGR_AUTOSWAPSTREAM_TEMP;
}
diff --git a/sw/prj/d.lst b/sw/prj/d.lst
index 0cb261c5f0f1..38c4f5046fc8 100644
--- a/sw/prj/d.lst
+++ b/sw/prj/d.lst
@@ -37,6 +37,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\swreport\statusbar
..\%__SRC%\bin\sw*.res %_DEST%\bin%_EXT%\sw*.res
..\%__SRC%\lib\lib*.* %_DEST%\lib%_EXT%\lib*.*
..\%__SRC%\misc\swd.component %_DEST%\xml%_EXT%\swd.component
+..\%__SRC%\misc\msword.component %_DEST%\xml%_EXT%\msword.component
..\uiconfig\swriter\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\swriter\menubar\*.xml
..\uiconfig\swxform\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\swxform\menubar\*.xml
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index ceb7d6e3463c..cc29cc8406d0 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1474,7 +1474,10 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
aTxt += ' ';
}
xub_StrLen nIdx = aTxt.Len();
- aTxt += rSeparator;
+ if( rTxt.Len() > 0 )
+ {
+ aTxt += rSeparator;
+ }
xub_StrLen nSepIdx = aTxt.Len();
aTxt += rTxt;
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index e144c47ee9a1..b7395402d01d 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -2380,8 +2380,7 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin
if( rIntl.IsEqual( sMyString, sMyStringReading, pBase->GetLocale(),
sToCompare, sToCompareReading, rNew.GetLocale() ) &&
- pBase->GetLevel() == nLevel &&
- pBase->GetType() == TOX_SORT_CUSTOM )
+ pBase->GetLevel() == nLevel )
break;
}
if(i == nMax)
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 6119184d3209..1b0cf4fdfa32 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -2924,10 +2924,10 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
if(
rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
(TBLFIX_CHGABS != rParam.nMode ||
- n < rBoxes.Count() &&
+ (n < rBoxes.Count() &&
(nDist + nWidth + rBoxes[ n+1 ]->
GetFrmFmt()->GetFrmSize().GetWidth() / 2)
- > rParam.nSide ))
+ > rParam.nSide) ))
: (nDist + nWidth / 2 ) > rParam.nSide
)
{
@@ -2989,10 +2989,10 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
if( nLowerDiff ||
(rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
(TBLFIX_CHGABS != rParam.nMode ||
- n < rBoxes.Count() &&
+ (n < rBoxes.Count() &&
(nDist + nWidth + rBoxes[ n+1 ]->
GetFrmFmt()->GetFrmSize().GetWidth() / 2)
- > rParam.nSide ))
+ > rParam.nSide) ))
: (nDist + nWidth / 2 ) > rParam.nSide ))
{
if( !nLowerDiff )
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index ba3c2e9c7966..a936002df9a2 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -143,8 +143,8 @@ BOOL SwEditShell::IsAnySectionInDoc( BOOL bChkReadOnly, BOOL bChkHidden, BOOL bC
const SwSectionFmt* pFmt = rFmts[ n ];
if( pFmt->IsInNodesArr() &&
(bChkTOX ||
- (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType ))
+ ( (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION
+ && TOX_HEADER_SECTION != eTmpType ) ) )
{
const SwSection& rSect = *rFmts[ n ]->GetSection();
if( (!bChkReadOnly && !bChkHidden ) ||
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 17628252b5e3..0f8a61134595 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1477,10 +1477,12 @@ const SdrObject* SwFEShell::GetBestObject( BOOL bNext, USHORT /*GOTOOBJ_...*/ eT
break;
}
- if( (bNext? (aPos.Y() < aCurPos.Y()) : // nur unter mir
+ if( (
+ (bNext? (aPos.Y() < aCurPos.Y()) : // nur unter mir
(aPos.Y() > aCurPos.Y())) && // " reverse
(bNext? (aBestPos.Y() > aCurPos.Y()) : // naeher drunter
- (aBestPos.Y() < aCurPos.Y())) || // " reverse
+ (aBestPos.Y() < aCurPos.Y()))
+ ) || // " reverse
(aBestPos.Y() == aCurPos.Y() &&
(bNext? (aBestPos.X() > aCurPos.X()) : // weiter links
(aBestPos.X() < aCurPos.X())))) // " reverse
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index af95f9e7b276..deefc2205b67 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -1746,8 +1746,8 @@ void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart,
(!pTmp->IsCellFrm() ||
( ( ! bRTL && (pTmp->Frm().*fnRect->fnGetLeft)() < nSX &&
(pTmp->Frm().*fnRect->fnGetRight)()< nSX2 ) ||
- bRTL && (pTmp->Frm().*fnRect->fnGetLeft)() > nSX &&
- (pTmp->Frm().*fnRect->fnGetRight)()> nSX2 ) ) )
+ ( bRTL && (pTmp->Frm().*fnRect->fnGetLeft)() > nSX &&
+ (pTmp->Frm().*fnRect->fnGetRight)()> nSX2 ) ) ) )
pTmp = pTmp->GetNextLayoutLeaf();
if ( pTmp )
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index ac20d8a4f86b..589569b3fb6b 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1077,7 +1077,7 @@ static bool lcl_IsInvaLay( const SwFrm *pFrm, long nBottom )
{
if (
!pFrm->IsValid() ||
- (pFrm->IsCompletePaint() && pFrm->Frm().Top() < nBottom)
+ (pFrm->IsCompletePaint() && ( pFrm->Frm().Top() < nBottom ) )
)
{
return true;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 9f518285bd30..6a6b0b9c9a0c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -520,7 +520,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
if ( rL2.GetTab() != rL1.GetTab() ||
rL2.IsPainted() ||
rL2.IsLocked() ||
- bVert == rL2.Height() > rL2.Width() )
+ (bVert == (rL2.Height() > rL2.Width())) )
continue;
long nL2a, nL2b, nL2c, nL2d;
@@ -694,7 +694,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
if ( rLine.IsLocked () )
continue;
- if ( !bVerticalSubs == rLine.Height() > rLine.Width() ) //gleiche Ausrichtung?
+ if ( (!bVerticalSubs == (rLine.Height() > rLine.Width())) ) //gleiche Ausrichtung?
continue;
if ( aSubsRect.IsOver( rLine ) )
@@ -899,7 +899,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
SwLineRect &rLk = operator[](k);
if ( rLi.SSize() == rLk.SSize() )
{
- if ( bVerticalSubs == rLk.Height() > rLk.Width() )
+ if ( (bVerticalSubs == (rLk.Height() > rLk.Width())) )
{
if ( bVerticalSubs )
{
@@ -6251,7 +6251,7 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
void SwPageFrm::RefreshExtraData( const SwRect &rRect ) const
{
const SwLineNumberInfo &rInfo = GetFmt()->GetDoc()->GetLineNumberInfo();
- BOOL bLineInFly = rInfo.IsPaintLineNumbers() && rInfo.IsCountInFlys()
+ BOOL bLineInFly = (rInfo.IsPaintLineNumbers() && rInfo.IsCountInFlys())
|| (sal_Int16)SW_MOD()->GetRedlineMarkPos() != text::HoriOrientation::NONE;
SwRect aRect( rRect );
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index ff0c6ec8f48f..8c54ed8623a6 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -581,8 +581,8 @@ const SwCntntFrm * MA_FASTCALL lcl_MissProtectedFrames( const SwCntntFrm *pCnt,
if ( !pCell ||
( ( bInReadOnly || !pCell->GetFmt()->GetProtect().IsCntntProtected() ) &&
( !bMissHeadline || !lcl_IsInRepeatedHeadline( pCell ) ) &&
- ( !bMissFollowFlowLine || !pCell->IsInFollowFlowRow() ) ) &&
- !pCell->IsCoveredCell() )
+ ( !bMissFollowFlowLine || !pCell->IsInFollowFlowRow() ) &&
+ !pCell->IsCoveredCell() ) )
bProtect = FALSE;
else
pCnt = (*fnNxtPrv)( pCnt );
@@ -701,14 +701,14 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
const long nPrtLeft = bRTL ?
(pTable->*fnRect->fnGetPrtRight)() :
(pTable->*fnRect->fnGetPrtLeft)();
- if ( bRTL != nX < nPrtLeft )
+ if ( (bRTL != (nX < nPrtLeft)) )
nX = nPrtLeft;
else
{
const long nPrtRight = bRTL ?
(pTable->*fnRect->fnGetPrtLeft)() :
(pTable->*fnRect->fnGetPrtRight)();
- if ( bRTL != nX > nPrtRight )
+ if ( (bRTL != (nX > nPrtRight)) )
nX = nPrtRight;
}
}
@@ -2308,12 +2308,14 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
(aTmp.*fnRectX->fnSetTop)( nTmp );
if( (aEndRect.*fnRectX->fnGetTop)() !=
(pEnd2Pos->aPortion.*fnRectX->fnGetTop)() )
- if( bPorR2L )
- (aTmp.*fnRectX->fnSetLeft)(
- (pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() );
- else
- (aTmp.*fnRectX->fnSetRight)(
- (pEnd2Pos->aPortion.*fnRectX->fnGetRight)() );
+ {
+ if( bPorR2L )
+ (aTmp.*fnRectX->fnSetLeft)(
+ (pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() );
+ else
+ (aTmp.*fnRectX->fnSetRight)(
+ (pEnd2Pos->aPortion.*fnRectX->fnGetRight)() );
+ }
aTmp.Intersection( aEndFrm );
Sub( aRegion, aTmp );
}
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index ade3efd4e70d..31d27d0152a0 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -3125,7 +3125,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
// Finally adjust the columns if width is set to auto
// Possible optimisation: execute this code earlier in this function and
// return???
- if ( ( bVert && bHeightChgd || ! bVert && bWidthChgd ) &&
+ if ( ( (bVert && bHeightChgd) || (! bVert && bWidthChgd) ) &&
Lower()->IsColumnFrm() )
{
// get column attribute
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 281aac016e43..48b3b5f335fb 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2410,7 +2410,7 @@ void SwTableBoxFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
BOOL bNewIsTxtFmt = pNumFmtr->IsTextFormat( nNewFmt ) ||
NUMBERFORMAT_TEXT == nNewFmt;
- if( !bNewIsTxtFmt && nOldFmt != nNewFmt || pNewFml )
+ if( (!bNewIsTxtFmt && nOldFmt != nNewFmt) || pNewFml )
{
BOOL bChgTxt = TRUE;
double fVal = 0;
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 8f9d3fc77337..aeddb97d3f83 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -780,7 +780,7 @@ sal_Bool SwTxtFrm::RightMargin(SwPaM *pPam, sal_Bool bAPI) const
if( aLine.GetCurr()->GetLen() &&
CH_BREAK == aInf.GetTxt().GetChar( nRightMargin - 1 ) )
--nRightMargin;
- if( !bAPI && (aLine.GetNext() || pFrm->GetFollow()) )
+ else if( !bAPI && (aLine.GetNext() || pFrm->GetFollow()) )
{
while( nRightMargin > aLine.GetStart() &&
' ' == aInf.GetTxt().GetChar( nRightMargin - 1 ) )
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index ae23406c04ce..252be1efa9ba 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1894,8 +1894,8 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
if(
pCharStyleNames[i] != SwXNumberingRules::GetInvalidStyle() &&
((pCharStyleNames[i].Len() && !pFmt->GetCharFmt()) ||
- pCharStyleNames[i].Len() &&
- pFmt->GetCharFmt()->GetName() != pCharStyleNames[i] ))
+ (pCharStyleNames[i].Len() &&
+ pFmt->GetCharFmt()->GetName() != pCharStyleNames[i]) ))
{
SwCharFmt* pCharFmt = 0;
@@ -1927,8 +1927,8 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
//jetzt nochmal fuer Fonts
if(pBulletFontNames[i] != SwXNumberingRules::GetInvalidStyle() &&
((pBulletFontNames[i].Len() && !pFmt->GetBulletFont()) ||
- pBulletFontNames[i].Len() &&
- pFmt->GetBulletFont()->GetName() != pBulletFontNames[i] ))
+ (pBulletFontNames[i].Len() &&
+ pFmt->GetBulletFont()->GetName() != pBulletFontNames[i]) ))
{
const SvxFontListItem* pFontListItem =
(const SvxFontListItem* )pDoc->GetDocShell()
@@ -3609,8 +3609,8 @@ MakeObject:
{
const SwPageDesc& rDesc = aBase.GetOldPageDesc();
const SwFrmFmt* pFrmFmt = 0;
- sal_Bool bShare = bHeader && rDesc.IsHeaderShared()||
- !bHeader && rDesc.IsFooterShared();
+ sal_Bool bShare = (bHeader && rDesc.IsHeaderShared())||
+ (!bHeader && rDesc.IsFooterShared());
// TextLeft returns the left content if there is one,
// Text and TextRight return the master content.
// TextRight does the same as Text and is for
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 5669ec8e6b99..856d5e0b44bb 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -700,7 +700,7 @@ void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableBox* pBo
{
aCols[i] = pArray[i].Position;
if(pArray[i].IsVisible == aCols.IsHidden(i) ||
- !bRow && aCols.IsHidden(i) ||
+ (!bRow && aCols.IsHidden(i)) ||
long(aCols[i] - long(nLastValue)) < 0 ||
UNO_TABLE_COLUMN_SUM < aCols[i] )
{
@@ -3428,10 +3428,10 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
const SwFrmFmt* pBoxFmt = pBox->GetFrmFmt();
const SvxBoxItem& rBox = pBoxFmt->GetBox();
if(
- aTableBorderDistances.IsLeftDistanceValid && nLeftDistance != rBox.GetDistance( BOX_LINE_LEFT ) ||
- aTableBorderDistances.IsRightDistanceValid && nRightDistance != rBox.GetDistance( BOX_LINE_RIGHT ) ||
- aTableBorderDistances.IsTopDistanceValid && nTopDistance != rBox.GetDistance( BOX_LINE_TOP ) ||
- aTableBorderDistances.IsBottomDistanceValid && nBottomDistance != rBox.GetDistance( BOX_LINE_BOTTOM ))
+ (aTableBorderDistances.IsLeftDistanceValid && nLeftDistance != rBox.GetDistance( BOX_LINE_LEFT )) ||
+ (aTableBorderDistances.IsRightDistanceValid && nRightDistance != rBox.GetDistance( BOX_LINE_RIGHT )) ||
+ (aTableBorderDistances.IsTopDistanceValid && nTopDistance != rBox.GetDistance( BOX_LINE_TOP )) ||
+ (aTableBorderDistances.IsBottomDistanceValid && nBottomDistance != rBox.GetDistance( BOX_LINE_BOTTOM )))
{
SvxBoxItem aSetBox( rBox );
SwFrmFmt* pSetBoxFmt = pBox->ClaimFrmFmt();
@@ -3744,7 +3744,7 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
vos::OGuard aGuard(Application::GetSolarMutex());
SwFrmFmt* pFmt = GetFrmFmt();
String sNewTblName(rName);
- if(!pFmt && !bIsDescriptor ||
+ if((!pFmt && !bIsDescriptor) ||
!sNewTblName.Len() ||
STRING_NOTFOUND != sNewTblName.Search('.') ||
STRING_NOTFOUND != sNewTblName.Search(' ') )
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index f2a8229c3092..68e6525d991d 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -205,8 +205,8 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
} while( nStrPos < nEnde );
if( !bLastNd ||
- ( !rWrt.bWriteClipboardDoc && !rWrt.bASCII_NoLastLineEnd )
- && !nStrPos && nEnde == nNodeEnde )
+ ( ( !rWrt.bWriteClipboardDoc && !rWrt.bASCII_NoLastLineEnd )
+ && !nStrPos && nEnde == nNodeEnde ) )
rWrt.Strm().WriteUnicodeOrByteText( ((SwASCWriter&)rWrt).GetLineEnd());
return rWrt;
diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx
index 485ac5dd2a2b..b3a62fe4d189 100644
--- a/sw/source/filter/html/htmlctxt.cxx
+++ b/sw/source/filter/html/htmlctxt.cxx
@@ -192,7 +192,7 @@ void SwHTMLParser::SplitAttrTab( const SwPosition& rNewPos )
nOldEndCnt = pPam->GetPoint()->nContent.GetIndex();
}
- if( RES_PARATR_BEGIN <= nWhich && bMoveBack ||
+ if( (RES_PARATR_BEGIN <= nWhich && bMoveBack) ||
pAttr->GetSttParaIdx() < pOldEndPara->GetIndex() ||
(pAttr->GetSttPara() == *pOldEndPara &&
pAttr->GetSttCnt() != nOldEndCnt) )
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 43b83557a149..7171f4ec28b1 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -70,6 +70,7 @@
#endif
#include <viewopt.hxx>
#endif
+#include <sal/types.h>
//#define MAX_DEPTH (USHRT_MAX)
#define MAX_DEPTH (3)
@@ -98,7 +99,7 @@ class SwHTMLWrtTable : public SwWriteTable
sal_Bool bTop, sal_Bool bBottom, sal_Bool bLeft, sal_Bool bRight );
public:
- SwHTMLWrtTable( const SwTableLines& rLines, long nWidth, sal_uInt16 nBWidth,
+ SwHTMLWrtTable( const SwTableLines& rLines, long nWidth, sal_uInt32 nBWidth,
sal_Bool bRel, USHORT nNumOfRowsToRepeat,
sal_uInt16 nLeftSub=0, sal_uInt16 nRightSub=0 );
SwHTMLWrtTable( const SwHTMLTableLayout *pLayoutInfo );
@@ -111,7 +112,7 @@ public:
SwHTMLWrtTable::SwHTMLWrtTable( const SwTableLines& rLines, long nWidth,
- sal_uInt16 nBWidth, sal_Bool bRel, USHORT nNumOfRowsToRepeat,
+ sal_uInt32 nBWidth, sal_Bool bRel, USHORT nNumOfRowsToRepeat,
sal_uInt16 nLSub, sal_uInt16 nRSub )
: SwWriteTable( rLines, nWidth, nBWidth, bRel, MAX_DEPTH, nLSub, nRSub, nNumOfRowsToRepeat )
{
@@ -337,7 +338,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
#ifndef PURE_HTML
long nWidth = 0;
- sal_uInt16 nPrcWidth = USHRT_MAX;
+ sal_uInt32 nPrcWidth = SAL_MAX_UINT32;
if( bOutWidth )
{
if( bLayoutExport )
@@ -471,7 +472,9 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
}
else
{
- sal_uInt16 nTWidth, nBWidth, nLSub, nRSub;
+ sal_uInt16 nTWidth;
+ sal_uInt32 nBWidth;
+ sal_uInt16 nLSub, nRSub;
if( HasRelWidths() )
{
nTWidth = 100;
@@ -845,7 +848,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
ByteString sOutStr( '<' );
sOutStr += OOO_STRING_SVTOOLS_HTML_col;
- sal_uInt16 nWidth;
+ sal_uInt32 nWidth;
sal_Bool bRel;
if( bLayoutExport )
{
diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx
index 5bbf776351a1..c47ac7809bd0 100644
--- a/sw/source/filter/inc/wrtswtbl.hxx
+++ b/sw/source/filter/inc/wrtswtbl.hxx
@@ -61,7 +61,7 @@ class SwWriteTableCell
long nHeight; // fixe/Mindest-Hoehe der Zeile
- USHORT nWidthOpt; // Breite aus Option;
+ sal_uInt32 nWidthOpt; // Breite aus Option;
USHORT nRow; // Start-Zeile
USHORT nCol; // Start-Spalte
@@ -99,7 +99,7 @@ public:
nWidthOpt = nWidth; bPrcWidthOpt = bPrc;
}
- USHORT GetWidthOpt() const { return nWidthOpt; }
+ sal_uInt32 GetWidthOpt() const { return nWidthOpt; }
BOOL HasPrcWidthOpt() const { return bPrcWidthOpt; }
};
@@ -180,9 +180,9 @@ SV_DECL_PTRARR_SORT_DEL( SwWriteTableRows, SwWriteTableRowPtr, 5, 5 )
class SwWriteTableCol
{
- USHORT nPos; // End Position der Spalte
+ sal_uInt32 nPos; // End Position der Spalte
- USHORT nWidthOpt;
+ sal_uInt32 nWidthOpt;
BOOL bRelWidthOpt : 1;
BOOL bOutWidth : 1; // Spaltenbreite ausgeben?
@@ -191,9 +191,9 @@ public:
BOOL bLeftBorder : 1; // Welche Umrandungen sind da?
BOOL bRightBorder : 1;
- SwWriteTableCol( USHORT nPosition );
+ SwWriteTableCol( sal_uInt32 nPosition );
- USHORT GetPos() const { return nPos; }
+ sal_uInt32 GetPos() const { return nPos; }
void SetLeftBorder( BOOL bBorder ) { bLeftBorder = bBorder; }
BOOL HasLeftBorder() const { return bLeftBorder; }
@@ -207,11 +207,11 @@ public:
inline int operator==( const SwWriteTableCol& rCol ) const;
inline int operator<( const SwWriteTableCol& rCol ) const;
- void SetWidthOpt( USHORT nWidth, BOOL bRel )
+ void SetWidthOpt( sal_uInt32 nWidth, BOOL bRel )
{
nWidthOpt = nWidth; bRelWidthOpt = bRel;
}
- USHORT GetWidthOpt() const { return nWidthOpt; }
+ sal_uInt32 GetWidthOpt() const { return nWidthOpt; }
BOOL HasRelWidthOpt() const { return bRelWidthOpt; }
};
@@ -248,14 +248,14 @@ protected:
USHORT nBorder; // Dicke der ausseren Umrandung
USHORT nInnerBorder; // Dicke der inneren Umrandung
- USHORT nBaseWidth; // Bezugsgroesse fur Breiten SwFmtFrmSize
+ sal_uInt32 nBaseWidth; // Bezugsgroesse fur Breiten SwFmtFrmSize
USHORT nHeadEndRow; // letzte Zeile des Tabellen-Kopfes
USHORT nLeftSub;
USHORT nRightSub;
- long nTabWidth; // Absolute/Relative Breite der Tabelle
+ sal_uInt32 nTabWidth; // Absolute/Relative Breite der Tabelle
BOOL bRelWidths : 1; // Breiten relativ ausgeben?
BOOL bUseLayoutHeights : 1; // Layout zur Hoehenbestimmung nehmen?
@@ -271,16 +271,16 @@ protected:
virtual BOOL ShouldExpandSub( const SwTableBox *pBox,
BOOL bExpandedBefore, USHORT nDepth ) const;
- void CollectTableRowsCols( long nStartRPos, USHORT nStartCPos,
+ void CollectTableRowsCols( long nStartRPos, sal_uInt32 nStartCPos,
long nParentLineHeight,
- USHORT nParentLineWidth,
+ sal_uInt32 nParentLineWidth,
const SwTableLines& rLines,
USHORT nDepth );
void FillTableRowsCols( long nStartRPos, USHORT nStartRow,
- USHORT nStartCPos, USHORT nStartCol,
+ sal_uInt32 nStartCPos, USHORT nStartCol,
long nParentLineHeight,
- USHORT nParentLineWidth,
+ sal_uInt32 nParentLineWidth,
const SwTableLines& rLines,
const SvxBrushItem* pLineBrush,
USHORT nDepth,
@@ -292,14 +292,14 @@ protected:
USHORT nRowSpan, USHORT nColSpan,
USHORT &rTopBorder, USHORT &rBottomBorder );
- USHORT GetBaseWidth() const { return nBaseWidth; }
+ sal_uInt32 GetBaseWidth() const { return nBaseWidth; }
BOOL HasRelWidths() const { return bRelWidths; }
public:
- static long GetBoxWidth( const SwTableBox *pBox );
+ static sal_uInt32 GetBoxWidth( const SwTableBox *pBox );
- USHORT GetRawWidth( USHORT nCol, USHORT nColSpan ) const;
+ sal_uInt32 GetRawWidth( USHORT nCol, USHORT nColSpan ) const;
USHORT GetAbsWidth( USHORT nCol, USHORT nColSpan ) const;
USHORT GetRelWidth( USHORT nCol, USHORT nColSpan ) const;
USHORT GetPrcWidth( USHORT nCol, USHORT nColSpan ) const;
@@ -317,7 +317,7 @@ protected:
public:
- SwWriteTable( const SwTableLines& rLines, long nWidth, USHORT nBWidth,
+ SwWriteTable( const SwTableLines& rLines, long nWidth, sal_uInt32 nBWidth,
BOOL bRel, USHORT nMaxDepth = USHRT_MAX,
USHORT nLeftSub=0, USHORT nRightSub=0, sal_uInt32 nNumOfRowsToRepeat=0 );
SwWriteTable( const SwHTMLTableLayout *pLayoutInfo );
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index a4f3063ea05a..0c23218092d5 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -3641,7 +3641,7 @@ void SwRTFParser::ReadHeaderFooter( int nToken, SwPageDesc* pPageDesc )
// wurde an der Position ein Escapement aufgespannt, so entferne
// das jetzt. Fussnoten sind bei uns immer hochgestellt.
- SvxRTFItemStackTypePtr pTmp = aSaveStack.back();
+ SvxRTFItemStackTypePtr pTmp = aSaveStack.empty() ? 0 : aSaveStack.back();
if( pTmp && pTmp->GetSttNodeIdx() ==
pPam->GetPoint()->nNode.GetIndex() &&
pTmp->GetSttCnt() == nPos )
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index 9c889fd2519b..9fd6bd3804b5 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -92,7 +92,7 @@ SwWriteTableCell *SwWriteTableRow::AddCell( const SwTableBox *pBox,
//-----------------------------------------------------------------------
-SwWriteTableCol::SwWriteTableCol(USHORT nPosition)
+SwWriteTableCol::SwWriteTableCol(sal_uInt32 nPosition)
: nPos(nPosition), nWidthOpt(0), bRelWidthOpt(false), bOutWidth(true),
bLeftBorder(true), bRightBorder(true)
{
@@ -100,13 +100,13 @@ SwWriteTableCol::SwWriteTableCol(USHORT nPosition)
//-----------------------------------------------------------------------
-long SwWriteTable::GetBoxWidth( const SwTableBox *pBox )
+sal_uInt32 SwWriteTable::GetBoxWidth( const SwTableBox *pBox )
{
const SwFrmFmt *pFmt = pBox->GetFrmFmt();
const SwFmtFrmSize& aFrmSize=
(const SwFmtFrmSize&)pFmt->GetFmtAttr( RES_FRM_SIZE );
- return aFrmSize.GetSize().Width();
+ return sal::static_int_cast<sal_uInt32>(aFrmSize.GetSize().Width());
}
long SwWriteTable::GetLineHeight( const SwTableLine *pLine )
@@ -306,9 +306,9 @@ USHORT SwWriteTable::MergeBoxBorders( const SwTableBox *pBox,
}
-USHORT SwWriteTable::GetRawWidth( USHORT nCol, USHORT nColSpan ) const
+sal_uInt32 SwWriteTable::GetRawWidth( USHORT nCol, USHORT nColSpan ) const
{
- USHORT nWidth = aCols[nCol+nColSpan-1]->GetPos();
+ sal_uInt32 nWidth = aCols[nCol+nColSpan-1]->GetPos();
if( nCol > 0 )
nWidth = nWidth - aCols[nCol-1]->GetPos();
@@ -352,7 +352,7 @@ USHORT SwWriteTable::GetRightSpace( USHORT nCol, USHORT nColSpan ) const
USHORT SwWriteTable::GetAbsWidth( USHORT nCol, USHORT nColSpan ) const
{
- long nWidth = GetRawWidth( nCol, nColSpan );
+ sal_uInt32 nWidth = GetRawWidth( nCol, nColSpan );
if( nBaseWidth != nTabWidth )
{
nWidth *= nTabWidth;
@@ -419,9 +419,9 @@ BOOL SwWriteTable::ShouldExpandSub(const SwTableBox *pBox, BOOL /*bExpandedBefor
}
void SwWriteTable::CollectTableRowsCols( long nStartRPos,
- USHORT nStartCPos,
+ sal_uInt32 nStartCPos,
long nParentLineHeight,
- USHORT nParentLineWidth,
+ sal_uInt32 nParentLineWidth,
const SwTableLines& rLines,
USHORT nDepth )
{
@@ -429,7 +429,7 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
USHORT nLines = rLines.Count();
#ifdef DBG_UTIL
- USHORT nEndCPos = 0;
+ sal_uInt32 nEndCPos = 0;
#endif
long nRPos = nStartRPos;
@@ -484,16 +484,16 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
USHORT nBoxes = rBoxes.Count();
- USHORT nCPos = nStartCPos;
+ sal_uInt32 nCPos = nStartCPos;
for( USHORT nBox=0; nBox<nBoxes; nBox++ )
{
const SwTableBox *pBox = rBoxes[nBox];
- USHORT nOldCPos = nCPos;
+ sal_uInt32 nOldCPos = nCPos;
if( nBox < nBoxes-1 || (nParentLineWidth==0 && nLine==0) )
{
- nCPos = nCPos + (USHORT)GetBoxWidth( pBox );
+ nCPos = nCPos + GetBoxWidth( pBox );
SwWriteTableCol *pCol = new SwWriteTableCol( nCPos );
USHORT nCol;
@@ -512,7 +512,7 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
else
{
#ifdef DBG_UTIL
- USHORT nCheckPos = nCPos + (USHORT)GetBoxWidth( pBox );
+ sal_uInt32 nCheckPos = nCPos + GetBoxWidth( pBox );
if( !nEndCPos )
{
nEndCPos = nCheckPos;
@@ -550,9 +550,9 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
void SwWriteTable::FillTableRowsCols( long nStartRPos, USHORT nStartRow,
- USHORT nStartCPos, USHORT nStartCol,
+ sal_uInt32 nStartCPos, USHORT nStartCol,
long nParentLineHeight,
- USHORT nParentLineWidth,
+ sal_uInt32 nParentLineWidth,
const SwTableLines& rLines,
const SvxBrushItem* pParentBrush,
USHORT nDepth,
@@ -655,7 +655,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, USHORT nStartRow,
}
USHORT nBoxes = rBoxes.Count();
- USHORT nCPos = nStartCPos;
+ sal_uInt32 nCPos = nStartCPos;
USHORT nCol = nStartCol;
for( USHORT nBox=0; nBox<nBoxes; nBox++ )
@@ -663,10 +663,10 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, USHORT nStartRow,
const SwTableBox *pBox = rBoxes[nBox];
// Position der letzten ueberdeckten Spalte ermitteln
- USHORT nOldCPos = nCPos;
+ sal_uInt32 nOldCPos = nCPos;
if( nBox < nBoxes-1 || (nParentLineWidth==0 && nLine==0) )
{
- nCPos = nCPos + (USHORT)GetBoxWidth( pBox );
+ nCPos = nCPos + GetBoxWidth( pBox );
if( nBox==nBoxes-1 )
nParentLineWidth = nCPos - nStartCPos;
}
@@ -768,7 +768,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, USHORT nStartRow,
}
SwWriteTable::SwWriteTable(const SwTableLines& rLines, long nWidth,
- USHORT nBWidth, BOOL bRel, USHORT nMaxDepth, USHORT nLSub, USHORT nRSub, sal_uInt32 nNumOfRowsToRepeat)
+ sal_uInt32 nBWidth, BOOL bRel, USHORT nMaxDepth, USHORT nLSub, USHORT nRSub, sal_uInt32 nNumOfRowsToRepeat)
: nBorderColor((UINT32)-1), nCellSpacing(0), nCellPadding(0), nBorder(0),
nInnerBorder(0), nBaseWidth(nBWidth), nHeadEndRow(USHRT_MAX),
nLeftSub(nLSub), nRightSub(nRSub), nTabWidth(nWidth), bRelWidths(bRel),
@@ -779,7 +779,7 @@ SwWriteTable::SwWriteTable(const SwTableLines& rLines, long nWidth,
bColsOption(false), bColTags(true), bLayoutExport(false),
bCollectBorderWidth(true)
{
- USHORT nParentWidth = nBaseWidth + nLeftSub + nRightSub;
+ sal_uInt32 nParentWidth = nBaseWidth + nLeftSub + nRightSub;
// Erstmal die Tabellen-Struktur festlegen. Hinter der Tabelle ist in
// jedem Fall eine Spalte zu Ende
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index f4f3f7166fe0..f899d2160e86 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -525,8 +525,8 @@ void RtfExport::ExportDocument_Impl()
// protected section in the document.
{
const SfxItemPool& rPool = pDoc->GetAttrPool();
- USHORT nMaxItem = rPool.GetItemCount2(RES_PROTECT);
- for( USHORT n = 0; n < nMaxItem; ++n )
+ sal_uInt32 const nMaxItem = rPool.GetItemCount2(RES_PROTECT);
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
const SvxProtectItem* pProtect = (const SvxProtectItem*)rPool.GetItem2(RES_PROTECT, n);
if (pProtect && pProtect->IsCntntProtected())
@@ -997,7 +997,7 @@ void RtfExport::OutColorTable()
{
// Build the table from rPool since the colors provided to
// RtfAttributeOutput callbacks are too late.
- USHORT n, nMaxItem;
+ sal_uInt32 nMaxItem;
const SfxItemPool& rPool = pDoc->GetAttrPool();
// char color
@@ -1009,7 +1009,7 @@ void RtfExport::OutColorTable()
RES_CHRATR_COLOR ) ))
InsColor( pCol->GetValue() );
nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR);
- for( n = 0; n < nMaxItem; ++n )
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
if( 0 != (pCol = (const SvxColorItem*)rPool.GetItem2(
RES_CHRATR_COLOR, n ) ) )
@@ -1019,7 +1019,7 @@ void RtfExport::OutColorTable()
const SvxUnderlineItem* pUnder = (const SvxUnderlineItem*)GetDfltAttr( RES_CHRATR_UNDERLINE );
InsColor( pUnder->GetColor() );
nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE);
- for( n = 0; n < nMaxItem;n++)
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
if( 0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem2( RES_CHRATR_UNDERLINE, n ) ) )
InsColor( pUnder->GetColor() );
@@ -1029,7 +1029,7 @@ void RtfExport::OutColorTable()
const SvxOverlineItem* pOver = (const SvxOverlineItem*)GetDfltAttr( RES_CHRATR_OVERLINE );
InsColor( pOver->GetColor() );
nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE);
- for( n = 0; n < nMaxItem;n++)
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
if( 0 != (pOver = (const SvxOverlineItem*)rPool.GetItem2( RES_CHRATR_OVERLINE, n ) ) )
InsColor( pOver->GetColor() );
@@ -1052,12 +1052,14 @@ void RtfExport::OutColorTable()
InsColor( pBkgrd->GetColor() );
}
nMaxItem = rPool.GetItemCount2( *pIds );
- for( n = 0; n < nMaxItem; ++n )
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
+ {
if( 0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem2(
*pIds , n ) ))
{
InsColor( pBkgrd->GetColor() );
}
+ }
}
// shadow color
@@ -1071,12 +1073,14 @@ void RtfExport::OutColorTable()
InsColor( pShadow->GetColor() );
}
nMaxItem = rPool.GetItemCount2(RES_SHADOW);
- for( n = 0; n < nMaxItem; ++n )
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
+ {
if( 0 != (pShadow = (const SvxShadowItem*)rPool.GetItem2(
RES_SHADOW, n ) ) )
{
InsColor( pShadow->GetColor() );
}
+ }
}
// frame border color
@@ -1086,12 +1090,14 @@ void RtfExport::OutColorTable()
RES_BOX ) ))
InsColorLine( *pBox );
nMaxItem = rPool.GetItemCount2(RES_BOX);
- for( n = 0; n < nMaxItem; ++n )
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
+ {
if( 0 != (pBox = (const SvxBoxItem*)rPool.GetItem2( RES_BOX, n ) ))
InsColorLine( *pBox );
+ }
}
- for( n = 0; n < m_aColTbl.size(); n++ )
+ for (size_t n = 0; n < m_aColTbl.size(); ++n)
{
const Color& rCol = m_aColTbl[ n ];
if( n || COL_AUTO != rCol.GetColor() )
diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx
index 8fe2dd5edea8..31b298a06017 100644
--- a/sw/source/filter/ww8/rtfexportfilter.cxx
+++ b/sw/source/filter/ww8/rtfexportfilter.cxx
@@ -143,44 +143,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
-{
- sal_Bool bRet = sal_False;
-
- if( pRegistryKey )
- {
- try
- {
- uno::Reference< registry::XRegistryKey > xNewKey1(
- static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
- OUString::createFromAscii( IMPL_NAME_RTFEXPORT "/UNO/SERVICES/" ) ) );
- xNewKey1->createKey( RtfExport_getSupportedServiceNames().getConstArray()[0] );
-
- bRet = sal_True;
- }
- catch( registry::InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException (rtfexport)!" );
- }
-
- try
- {
- uno::Reference< registry::XRegistryKey > xNewKey1(
- static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
- OUString::createFromAscii( IMPL_NAME_RTFIMPORT "/UNO/SERVICES/" ) ) );
- xNewKey1->createKey( RtfExport_getSupportedServiceNames().getConstArray()[0] );
-
- bRet = sal_True;
- }
- catch( registry::InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException (rtfimport)!" );
- }
- }
-
- return bRet;
-}
-
// ------------------------
// - component_getFactory -
// ------------------------
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 4d16a5646536..ab7a8c4e3a0e 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -784,14 +784,16 @@ void wwFontHelper::InitFontTable(bool bWrtWW8,const SwDoc& rDoc)
const USHORT aTypes[] = { RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_FONT, 0 };
for (const USHORT* pId = aTypes; *pId; ++pId)
{
- USHORT nMaxItem = rPool.GetItemCount2( *pId );
- for( USHORT nGet = 0; nGet < nMaxItem; ++nGet )
- if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem2(
- *pId, nGet )) )
+ sal_uInt32 const nMaxItem = rPool.GetItemCount2( *pId );
+ for (sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet)
+ {
+ pFont = (const SvxFontItem*)rPool.GetItem2( *pId, nGet );
+ if (0 != pFont)
{
GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(),
pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8));
}
+ }
}
}
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 0b1693e919f1..5c82f67a32f1 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -112,6 +112,8 @@
#include "dbgoutsw.hxx"
#include <sfx2/docfile.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/frame.hxx>
#include <svl/stritem.hxx>
#include <unotools/tempfile.hxx>
#include <filter/msfilter/mscodec.hxx>
@@ -2995,20 +2997,54 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
pDoc->SetRedlineMode( (RedlineMode_t)(mnRedlineMode) );
}
-String SwWW8Writer::GetPassword()
+bool SwWW8Writer::InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec )
{
- String sUniPassword;
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+
if ( mpMedium )
{
- SfxItemSet* pSet = mpMedium->GetItemSet();
+ SFX_ITEMSET_ARG( mpMedium->GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ if ( pEncryptionDataItem && ( pEncryptionDataItem->GetValue() >>= aEncryptionData ) && !rCodec.InitCodec( aEncryptionData ) )
+ {
+ OSL_ENSURE( false, "Unexpected EncryptionData!" );
+ aEncryptionData.realloc( 0 );
+ }
+
+ if ( !aEncryptionData.getLength() )
+ {
+ // try to generate the encryption data based on password
+ SFX_ITEMSET_ARG( mpMedium->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ if ( pPasswordItem && pPasswordItem->GetValue().Len() && pPasswordItem->GetValue().Len() <= 15 )
+ {
+ // Generate random number with a seed of time as salt.
+ TimeValue aTime;
+ osl_getSystemTime( &aTime );
+ rtlRandomPool aRandomPool = rtl_random_createPool ();
+ rtl_random_addBytes ( aRandomPool, &aTime, 8 );
- const SfxPoolItem* pPasswordItem = NULL;
- if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_PASSWORD, sal_True, &pPasswordItem ) )
- if( pPasswordItem != NULL )
- sUniPassword = ( (const SfxStringItem*)pPasswordItem )->GetValue();
+ sal_uInt8 pDocId[ 16 ];
+ rtl_random_getBytes( aRandomPool, pDocId, 16 );
+
+ rtl_random_destroyPool( aRandomPool );
+
+ sal_Unicode aPassword[16];
+ memset( aPassword, 0, sizeof( aPassword ) );
+ for ( xub_StrLen nChar = 0; nChar < pPasswordItem->GetValue().Len(); ++nChar )
+ aPassword[nChar] = pPasswordItem->GetValue().GetChar(nChar);
+
+ rCodec.InitKey( aPassword, pDocId );
+ aEncryptionData = rCodec.GetEncryptionData();
+
+ mpMedium->GetItemSet()->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) ) );
+ }
+ }
+
+ if ( aEncryptionData.getLength() )
+ mpMedium->GetItemSet()->ClearItem( SID_PASSWORD );
}
- return sUniPassword;
+ // nonempty encryption data means hier that the codec was successfuly initialized
+ return ( aEncryptionData.getLength() != 0 );
}
void WW8Export::ExportDocument_Impl()
@@ -3042,8 +3078,6 @@ void WW8Export::ExportDocument_Impl()
Strm().SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- String sUniPassword( GetWriter().GetPassword() );
-
utl::TempFile aTempMain;
aTempMain.EnableKillingFile();
utl::TempFile aTempTable;
@@ -3051,13 +3085,10 @@ void WW8Export::ExportDocument_Impl()
utl::TempFile aTempData;
aTempData.EnableKillingFile();
- bool bEncrypt = false;
-
- xub_StrLen nLen = sUniPassword.Len();
- if ( nLen > 0 && nLen <= 15) // Password has been set
+ msfilter::MSCodec_Std97 aCtx;
+ bool bEncrypt = m_pWriter ? m_pWriter->InitStd97CodecUpdateMedium( aCtx ) : false;
+ if ( bEncrypt )
{
- bEncrypt =true;
-
GetWriter().SetStream(
aTempMain.GetStream( STREAM_READWRITE | STREAM_SHARE_DENYWRITE ) );
@@ -3121,24 +3152,6 @@ void WW8Export::ExportDocument_Impl()
if ( bEncrypt )
{
- // Generate random number with a seed of time as salt.
- TimeValue aTime;
- osl_getSystemTime( &aTime );
- rtlRandomPool aRandomPool = rtl_random_createPool ();
- rtl_random_addBytes ( aRandomPool, &aTime, 8 );
-
- sal_uInt8 aDocId[ 16 ] = {0};
- rtl_random_getBytes( aRandomPool, aDocId, 16 );
-
- rtl_random_destroyPool( aRandomPool );
-
- sal_Unicode aPassword[16] = {0};
- for (xub_StrLen nChar = 0; nChar < nLen; ++nChar )
- aPassword[nChar] = sUniPassword.GetChar(nChar);
-
- msfilter::MSCodec_Std97 aCtx;
- aCtx.InitKey(aPassword, aDocId);
-
SvStream *pStrmTemp, *pTableStrmTemp, *pDataStrmTemp;
pStrmTemp = &xWwStrm;
pTableStrmTemp = &xTableStrm;
@@ -3155,11 +3168,14 @@ void WW8Export::ExportDocument_Impl()
sal_uInt32 nEncType = 0x10001;
*pTableStrmTemp << nEncType;
- sal_uInt8 pSaltData[16] = {0};
- sal_uInt8 pSaltDigest[16] = {0};
- aCtx.GetEncryptKey( aDocId, pSaltData, pSaltDigest );
+ sal_uInt8 pDocId[16];
+ aCtx.GetDocId( pDocId );
+
+ sal_uInt8 pSaltData[16];
+ sal_uInt8 pSaltDigest[16];
+ aCtx.GetEncryptKey( pDocId, pSaltData, pSaltDigest );
- pTableStrmTemp->Write( aDocId, 16 );
+ pTableStrmTemp->Write( pDocId, 16 );
pTableStrmTemp->Write( pSaltData, 16 );
pTableStrmTemp->Write( pSaltDigest, 16 );
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 4ba3bf3c1089..a4ab2c69aaa8 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -53,6 +53,11 @@
#include <expfld.hxx>
// einige Forward Deklarationen
+namespace msfilter
+{
+ class MSCodec_Std97;
+}
+
class SwAttrIter;
class AttributeOutputBase;
class DocxAttributeOutput;
@@ -881,7 +886,7 @@ public:
static void WriteString_xstz(SvStream& rStrm, const String& rStr, bool bAddZero);
- String GetPassword();
+ bool InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec );
using StgWriter::Write;
virtual ULONG Write( SwPaM&, SfxMedium&, const String* = 0 );
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 24f36b047a4e..21804b38dca9 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -29,16 +29,20 @@
#include "precompiled_sw.hxx"
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-#include <hash_set>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XStorage.hpp>
+
+#include <hash_set>
#include <unotools/ucbstreamhelper.hxx>
#include <tools/solar.h>
#include <rtl/tencinfo.h>
+#include <rtl/random.h>
#include <sot/storage.hxx>
#include <sfx2/docinf.hxx>
#include <sfx2/docfile.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/frame.hxx>
#include <tools/urlobj.hxx>
#include <unotools/tempfile.hxx>
#include <svtools/sfxecode.hxx>
@@ -107,6 +111,7 @@
#include <com/sun/star/i18n/ForbiddenCharacters.hpp>
#include <comphelper/extract.hxx>
+#include <comphelper/sequenceashashmap.hxx>
#include <fltini.hxx>
#include <algorithm>
@@ -3575,7 +3580,7 @@ void wwSectionManager::InsertSegments()
bool bThisAndNextAreCompatible = (aNext != aEnd) ? ((aIter->GetPageWidth() == aNext->GetPageWidth()) &&
(aIter->GetPageHeight() == aNext->GetPageHeight()) && (aIter->IsLandScape() == aNext->IsLandScape())) : true;
- if ((aNext != aEnd && aNext->IsContinous() && bThisAndNextAreCompatible) || bProtected)
+ if (((aNext != aEnd && aNext->IsContinous() && bThisAndNextAreCompatible) || bProtected))
{
bIgnoreCols = true;
if ((aIter->NoCols() > 1) || bProtected)
@@ -4344,6 +4349,90 @@ namespace
return aPassw;
}
+ uno::Sequence< beans::NamedValue > InitXorWord95Codec( ::msfilter::MSCodec_XorWord95& rCodec, SfxMedium& rMedium, WW8Fib* pWwFib )
+ {
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionData, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ if ( pEncryptionData && ( pEncryptionData->GetValue() >>= aEncryptionData ) && !rCodec.InitCodec( aEncryptionData ) )
+ aEncryptionData.realloc( 0 );
+
+ if ( !aEncryptionData.getLength() )
+ {
+ String sUniPassword = QueryPasswordForMedium( rMedium );
+
+ ByteString sPassword(sUniPassword, WW8Fib::GetFIBCharset( pWwFib->chseTables ) );
+
+ xub_StrLen nLen = sPassword.Len();
+ if( nLen <= 15 )
+ {
+ sal_uInt8 pPassword[16];
+ memset( pPassword, 0, sizeof( pPassword ) );
+
+ for (xub_StrLen nChar = 0; nChar < sPassword.Len(); ++nChar )
+ pPassword[nChar] = sPassword.GetChar(nChar);
+
+ rCodec.InitKey( pPassword );
+ aEncryptionData = rCodec.GetEncryptionData();
+
+ // the export supports RC4 algorithm only, so we have to generate the related EncryptionData as well,
+ // so that Save can export the document without asking for a password;
+ // as result there will be EncryptionData for both algorithms in the MediaDescriptor
+ ::msfilter::MSCodec_Std97 aCodec97;
+
+ // Generate random number with a seed of time as salt.
+ TimeValue aTime;
+ osl_getSystemTime( &aTime );
+ rtlRandomPool aRandomPool = rtl_random_createPool();
+ rtl_random_addBytes ( aRandomPool, &aTime, 8 );
+
+ sal_uInt8 pDocId[ 16 ];
+ rtl_random_getBytes( aRandomPool, pDocId, 16 );
+
+ rtl_random_destroyPool( aRandomPool );
+
+ sal_uInt16 pStd97Pass[16];
+ memset( pStd97Pass, 0, sizeof( pStd97Pass ) );
+ for (xub_StrLen nChar = 0; nChar < nLen; ++nChar )
+ pStd97Pass[nChar] = sUniPassword.GetChar(nChar);
+
+ aCodec97.InitKey( pStd97Pass, pDocId );
+
+ // merge the EncryptionData, there should be no conflicts
+ ::comphelper::SequenceAsHashMap aEncryptionHash( aEncryptionData );
+ aEncryptionHash.update( ::comphelper::SequenceAsHashMap( aCodec97.GetEncryptionData() ) );
+ aEncryptionHash >> aEncryptionData;
+ }
+ }
+
+ return aEncryptionData;
+ }
+
+ uno::Sequence< beans::NamedValue > InitStd97Codec( ::msfilter::MSCodec_Std97& rCodec, sal_uInt8 pDocId[16], SfxMedium& rMedium )
+ {
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionData, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ if ( pEncryptionData && ( pEncryptionData->GetValue() >>= aEncryptionData ) && !rCodec.InitCodec( aEncryptionData ) )
+ aEncryptionData.realloc( 0 );
+
+ if ( !aEncryptionData.getLength() )
+ {
+ String sUniPassword = QueryPasswordForMedium( rMedium );
+
+ xub_StrLen nLen = sUniPassword.Len();
+ if ( nLen <= 15 )
+ {
+ sal_Unicode pPassword[16];
+ memset( pPassword, 0, sizeof( pPassword ) );
+ for (xub_StrLen nChar = 0; nChar < nLen; ++nChar )
+ pPassword[nChar] = sUniPassword.GetChar(nChar);
+
+ rCodec.InitKey( pPassword, pDocId );
+ aEncryptionData = rCodec.GetEncryptionData();
+ }
+ }
+
+ return aEncryptionData;
+ }
}
ULONG SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss)
@@ -4397,31 +4486,22 @@ ULONG SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss)
if (bDecrypt)
{
nErrRet = ERRCODE_SVX_WRONGPASS;
- switch (eAlgo)
+ SfxMedium* pMedium = mpDocShell->GetMedium();
+
+ if ( pMedium )
{
- default:
- nErrRet = ERRCODE_SVX_READ_FILTER_CRYPT;
- break;
- case XOR:
+ switch (eAlgo)
{
- String sUniPassword =
- QueryPasswordForMedium(*(mpDocShell->GetMedium()));
-
- ByteString sPassword(sUniPassword,
- WW8Fib::GetFIBCharset(pWwFib->chseTables));
-
- xub_StrLen nLen = sPassword.Len();
- // DR: do not cut a wrong (too long) password
- if( nLen <= 15 )
+ default:
+ nErrRet = ERRCODE_SVX_READ_FILTER_CRYPT;
+ break;
+ case XOR:
{
- sal_uInt8 aPassword[16] = {0};
-
- for (xub_StrLen nChar = 0; nChar < sPassword.Len(); ++nChar )
- aPassword[nChar] = sPassword.GetChar(nChar);
-
msfilter::MSCodec_XorWord95 aCtx;
- aCtx.InitKey(aPassword);
- if (aCtx.VerifyKey(pWwFib->nKey, pWwFib->nHash))
+ uno::Sequence< beans::NamedValue > aEncryptionData = InitXorWord95Codec( aCtx, *pMedium, pWwFib );
+
+ // if initialization has failed the EncryptionData should be empty
+ if ( aEncryptionData.getLength() && aCtx.VerifyKey( pWwFib->nKey, pWwFib->nHash ) )
{
nErrRet = 0;
pTempMain = MakeTemp(aDecryptMain);
@@ -4453,22 +4533,15 @@ ULONG SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss)
DecryptXOR(aCtx, *pDataStream, aDecryptData);
pDataStream = &aDecryptData;
}
+
+ pMedium->GetItemSet()->ClearItem( SID_PASSWORD );
+ pMedium->GetItemSet()->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) ) );
}
}
- }
- break;
- case RC4:
- {
- String sUniPassword =
- QueryPasswordForMedium(*(mpDocShell->GetMedium()));
-
- xub_StrLen nLen = sUniPassword.Len();
- // DR: do not cut a wrong (too long) password
- if (nLen <= 15)
+ break;
+ case RC4:
{
- sal_Unicode aPassword[16] = {0};
- for (xub_StrLen nChar = 0; nChar < nLen; ++nChar )
- aPassword[nChar] = sUniPassword.GetChar(nChar);
+ msfilter::MSCodec_Std97 aCtx;
sal_uInt8 aDocId[ 16 ];
pTableStream->Read(aDocId, 16);
@@ -4477,9 +4550,9 @@ ULONG SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss)
sal_uInt8 aSaltHash[ 16 ];
pTableStream->Read(aSaltHash, 16);
- msfilter::MSCodec_Std97 aCtx;
- aCtx.InitKey(aPassword, aDocId);
- if (aCtx.VerifyKey(aSaltData, aSaltHash))
+ // if initialization has failed the EncryptionData should be empty
+ uno::Sequence< beans::NamedValue > aEncryptionData = InitStd97Codec( aCtx, aDocId, *pMedium );
+ if ( aEncryptionData.getLength() && aCtx.VerifyKey( aSaltData, aSaltHash ) )
{
nErrRet = 0;
@@ -4498,17 +4571,13 @@ ULONG SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss)
DecryptRC4(aCtx, *pDataStream, aDecryptData);
pDataStream = &aDecryptData;
}
- SfxMedium* pMedium = mpDocShell->GetMedium();
- if ( pMedium )
- {
- SfxItemSet* pSet = pMedium->GetItemSet();
- if ( pSet )
- pSet->Put( SfxStringItem(SID_PASSWORD, sUniPassword) );
- }
+
+ pMedium->GetItemSet()->ClearItem( SID_PASSWORD );
+ pMedium->GetItemSet()->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) ) );
}
}
+ break;
}
- break;
}
if (nErrRet == 0)
@@ -4919,7 +4988,14 @@ ULONG WW8Reader::Read(SwDoc &rDoc, const String& rBaseURL, SwPaM &rPam, const St
}
SwWW8ImplReader* pRdr = new SwWW8ImplReader(nVersion, pStg, pIn, rDoc,
rBaseURL, bNew);
- nRet = pRdr->LoadDoc( rPam );
+ try
+ {
+ nRet = pRdr->LoadDoc( rPam );
+ }
+ catch( const std::exception& )
+ {
+ nRet = ERR_WW8_NO_WW8_FILE_ERR;
+ }
delete pRdr;
if( refStrm.Is() )
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index d64e207313d8..171e45260818 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -892,11 +892,18 @@ void WW8SprmIter::SetSprms(const BYTE* pSprms_, long nLen_)
const BYTE* WW8SprmIter::operator ++( int )
{
- if (nRemLen > 0)
+ if (nRemLen > 0 )
{
- pSprms += nAktSize;
- nRemLen -= nAktSize;
- UpdateMyMembers();
+ if( nRemLen >= nAktSize )
+ {
+ pSprms += nAktSize;
+ nRemLen -= nAktSize;
+ UpdateMyMembers();
+ }
+ else
+ {
+ throw( ::std::exception() );
+ }
}
return pSprms;
}
@@ -3247,6 +3254,8 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
Otherwise our cool fastsave algorithm can be brought to bear on the
problem.
*/
+ if( !pPieceIter )
+ return;
ULONG nOldPos = pPieceIter->GetIdx();
bool bOk = pPieceIter->SeekPos(nOrigCp);
pPieceIter->SetIdx( nOldPos );
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index d2be01eba5b1..3b55e6f81697 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -82,7 +82,7 @@ class SwXMLTableColumn_Impl : public SwWriteTableCol
public:
- SwXMLTableColumn_Impl( sal_uInt16 nPosition ) :
+ SwXMLTableColumn_Impl( sal_uInt32 nPosition ) :
SwWriteTableCol( nPosition ),
nRelWidth( 0UL )
{};
@@ -137,7 +137,7 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) :
nWidth( 0UL )
{
#ifdef DBG_UTIL
- sal_uInt16 nEndCPos = 0U;
+ sal_uInt32 nEndCPos = 0U;
#endif
sal_uInt16 nLines = rLines.Count();
sal_uInt16 nLine;
@@ -147,14 +147,14 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) :
const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
sal_uInt16 nBoxes = rBoxes.Count();
- sal_uInt16 nCPos = 0U;
+ sal_uInt32 nCPos = 0U;
for( sal_uInt16 nBox=0U; nBox<nBoxes; nBox++ )
{
const SwTableBox *pBox = rBoxes[nBox];
if( nBox < nBoxes-1U || nWidth==0UL )
{
- nCPos = nCPos + (sal_uInt16)SwWriteTable::GetBoxWidth( pBox );
+ nCPos = nCPos + SwWriteTable::GetBoxWidth( pBox );
SwXMLTableColumn_Impl *pCol =
new SwXMLTableColumn_Impl( nCPos );
@@ -171,8 +171,8 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) :
else
{
#ifdef DBG_UTIL
- sal_uInt16 nCheckPos =
- nCPos + (sal_uInt16)SwWriteTable::GetBoxWidth( pBox );
+ sal_uInt32 nCheckPos =
+ nCPos + SwWriteTable::GetBoxWidth( pBox );
if( !nEndCPos )
{
nEndCPos = nCheckPos;
@@ -186,9 +186,9 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) :
*/
}
#endif
- nCPos = (sal_uInt16)nWidth;
+ nCPos = nWidth;
#ifdef DBG_UTIL
- SwXMLTableColumn_Impl aCol( (sal_uInt16)nWidth );
+ SwXMLTableColumn_Impl aCol( nWidth );
ASSERT( aCols.Seek_Entry(&aCol), "couldn't find last column" );
ASSERT( SwXMLTableColumn_Impl(nCheckPos) ==
SwXMLTableColumn_Impl(nCPos),
@@ -602,13 +602,13 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines,
// pass 2: export column styles
{
const SwXMLTableColumns_Impl& rCols = pLines->GetColumns();
- sal_uInt16 nCPos = 0U;
+ sal_uInt32 nCPos = 0U;
sal_uInt16 nColumns = rCols.Count();
for( sal_uInt16 nColumn=0U; nColumn<nColumns; nColumn++ )
{
SwXMLTableColumn_Impl *pColumn = rCols[nColumn];
- sal_uInt16 nOldCPos = nCPos;
+ sal_uInt32 nOldCPos = nCPos;
nCPos = pColumn->GetPos();
sal_uInt32 nWidth = nCPos - nOldCPos;
@@ -634,7 +634,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines,
nColAbsWidth += (nBaseWidth/2UL);
nColAbsWidth /= nBaseWidth;
}
- pColumn->SetWidthOpt( (sal_uInt16)nColAbsWidth, sal_False );
+ pColumn->SetWidthOpt( nColAbsWidth, sal_False );
}
ULONG nExpPos = 0;
@@ -678,16 +678,16 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines,
const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
sal_uInt16 nBoxes = rBoxes.Count();
- sal_uInt16 nCPos = 0U;
+ sal_uInt32 nCPos = 0U;
sal_uInt16 nCol = 0U;
for( sal_uInt16 nBox=0U; nBox<nBoxes; nBox++ )
{
SwTableBox *pBox = rBoxes[nBox];
if( nBox < nBoxes-1U )
- nCPos = nCPos + (sal_uInt16)SwWriteTable::GetBoxWidth( pBox );
+ nCPos = nCPos + SwWriteTable::GetBoxWidth( pBox );
else
- nCPos = (sal_uInt16)pLines->GetWidth();
+ nCPos = pLines->GetWidth();
// Und ihren Index
@@ -959,7 +959,7 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine,
const SwTableBoxes& rBoxes = rLine.GetTabBoxes();
sal_uInt16 nBoxes = rBoxes.Count();
- sal_uInt16 nCPos = 0U;
+ sal_uInt32 nCPos = 0U;
sal_uInt16 nCol = 0U;
for( sal_uInt16 nBox=0U; nBox<nBoxes; nBox++ )
{
@@ -975,9 +975,9 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine,
}
if( nBox < nBoxes-1U )
- nCPos = nCPos + (sal_uInt16)SwWriteTable::GetBoxWidth( pBox );
+ nCPos = nCPos + SwWriteTable::GetBoxWidth( pBox );
else
- nCPos = (sal_uInt16)rLines.GetWidth();
+ nCPos = rLines.GetWidth();
// Und ihren Index
const sal_uInt16 nOldCol = nCol;
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 9508c4c17864..c839b5c03f52 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -209,23 +209,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
return 0;
}
}
- if(rMedium.IsStorage())
- {
- //SvStorageRef aStor( rMedium.GetStorage() );
- const SfxItemSet* pSet = rMedium.GetItemSet();
- const SfxPoolItem *pItem;
- if(pSet && SFX_ITEM_SET == pSet->GetItemState(SID_PASSWORD, TRUE, &pItem))
- {
- DBG_ASSERT(pItem->IsA( TYPE(SfxStringItem) ), "Fehler Parametertype");
- comphelper::OStorageHelper::SetCommonStoragePassword( rMedium.GetStorage(), ((const SfxStringItem *)pItem)->GetValue() );
- }
- // Fuer's Dokument-Einfuegen noch die FF-Version, wenn's der
- // eigene Filter ist.
- ASSERT( /*pRead != ReadSw3 || */pRead != ReadXML || pFlt->GetVersion(),
- "Am Filter ist keine FF-Version gesetzt" );
- //if( (pRead == ReadSw3 || pRead == ReadXML) && pFlt->GetVersion() )
- // aStor->SetVersion( (long)pFlt->GetVersion() );
- }
+
// #i30171# set the UpdateDocMode at the SwDocShell
SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx
index cc1f208950dc..63d878006f7e 100644
--- a/sw/source/ui/chrdlg/break.cxx
+++ b/sw/source/ui/chrdlg/break.cxx
@@ -200,7 +200,7 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) :
}
String aFmtName;
- for(i = RES_POOLPAGE_BEGIN; i <= RES_POOLPAGE_REGISTER; ++i)
+ for(i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i)
if(LISTBOX_ENTRY_NOTFOUND == aPageCollBox.GetEntryPos( aFmtName =
SwStyleNameMapper::GetUIName( i, aFmtName )))
::InsertStringSorted(aFmtName, aPageCollBox, 1 );
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 0fe1a3717ca1..ee2803e73aad 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -1106,8 +1106,6 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
if(nRet != RET_OK && nRet != RET_YES)
return 0;
}
- //create the send dialog
- SwSendMailDialog* pDlg = new SwSendMailDialog( pButton, rConfigItem );
//add the documents
sal_uInt32 nBegin = 0;
sal_uInt32 nEnd = 0;
@@ -1133,7 +1131,26 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
switch( nDocType )
{
case MM_DOCTYPE_OOO : break;
- case MM_DOCTYPE_PDF : bIsPDF = true; break;
+ case MM_DOCTYPE_PDF : bIsPDF = true;
+ {
+ //the method SwIOSystemGetFilterOfFormat( ) returns the template filter
+ //because it uses the same user data :-(
+ SfxFilterMatcher aMatcher( pFilterContainer->GetName() );
+ SfxFilterMatcherIter aIter( &aMatcher );
+ const SfxFilter* pFilter = aIter.First();
+ String sFilterMime( String::CreateFromAscii( "application/pdf" ));
+ while ( pFilter )
+ {
+ if( pFilter->GetMimeType() == sFilterMime && pFilter->CanExport() )
+ {
+ pSfxFlt = pFilter;
+ break;
+ }
+ pFilter = aIter.Next();
+ }
+
+ }
+ break;
case MM_DOCTYPE_WORD:
{
//the method SwIOSystemGetFilterOfFormat( ) returns the template filter
@@ -1239,6 +1256,8 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
uno::Reference< frame::XStorable > xStore( pTargetView->GetDocShell()->GetModel(), uno::UNO_QUERY);
xStore->storeToURL( sTargetTempURL, aValues );
+ //create the send dialog
+ SwSendMailDialog* pDlg = new SwSendMailDialog( pButton, rConfigItem );
pDlg->SetDocumentCount( nEnd );
pDlg->ShowDialog();
//help to force painting the dialog
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 5e620ce6955c..e92cd4e0ae81 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -382,6 +382,7 @@ IMPL_LINK(SwCaptionDialog, CaptionHdl, PushButton*, EMPTYARG)
void SwCaptionDialog::DrawSample()
{
String aStr;
+ String sCaption = aTextEdit.GetText();
// Nummer
String sFldTypeName = aCategoryBox.GetText();
@@ -436,9 +437,12 @@ void SwCaptionDialog::DrawSample()
}
}
- aStr += aSepEdit.GetText();
+ if( sCaption.Len() > 0 )
+ {
+ aStr += aSepEdit.GetText();
+ }
}
- aStr += aTextEdit.GetText();
+ aStr += sCaption;
// do preview!
aPrevWin.SetPreviewText( aStr );
}
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 852bc6b2a5e0..a453a46988ee 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -1838,8 +1838,8 @@ void SwTOXEdit::KeyInput( const KeyEvent& rKEvt )
{
const Selection& rSel = GetSelection();
sal_uInt16 nTextLen = GetText().Len();
- if(rSel.A() == rSel.B() &&
- !rSel.A() || rSel.A() == nTextLen )
+ if( (rSel.A() == rSel.B() &&
+ !rSel.A() ) || rSel.A() == nTextLen )
{
sal_Bool bCall = sal_False;
KeyCode aCode = rKEvt.GetKeyCode();
@@ -3816,8 +3816,8 @@ IMPL_LINK(SwTokenWindow, EditResize, Edit*, pEdit)
IMPL_LINK(SwTokenWindow, NextItemHdl, SwTOXEdit*, pEdit)
{
sal_uInt16 nPos = (sal_uInt16)aControlList.GetPos(pEdit);
- if(nPos && !pEdit->IsNextControl() ||
- nPos < aControlList.Count() - 1 && pEdit->IsNextControl())
+ if( (nPos && !pEdit->IsNextControl()) ||
+ (nPos < aControlList.Count() - 1 && pEdit->IsNextControl()))
{
aControlList.Seek(nPos);
Control* pNextPrev = pEdit->IsNextControl() ? aControlList.Next() : aControlList.Prev();
@@ -3852,8 +3852,8 @@ IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit)
IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton*, pBtn )
{
sal_uInt16 nPos = (sal_uInt16)aControlList.GetPos(pBtn);
- if(nPos && !pBtn->IsNextControl() ||
- nPos < aControlList.Count() - 1 && pBtn->IsNextControl())
+ if( (nPos && !pBtn->IsNextControl()) ||
+ (nPos < aControlList.Count() - 1 && pBtn->IsNextControl()))
{
aControlList.Seek(nPos);
sal_Bool bNext = pBtn->IsNextControl();
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index 06a2e1ae69f4..67fc32bcf1c9 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -265,7 +265,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
}
// Seite
- for( i = RES_POOLPAGE_BEGIN; i <= RES_POOLPAGE_LANDSCAPE; ++i )
+ for( i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i )
aPageTemplBox.InsertEntry(SwStyleNameMapper::GetUIName( i, aEmptyStr ));
USHORT nCount = pSh->GetPageDescCnt();
diff --git a/sw/source/ui/misc/glosdoc.cxx b/sw/source/ui/misc/glosdoc.cxx
index 9ce1038eb898..6ed886fb3974 100644
--- a/sw/source/ui/misc/glosdoc.cxx
+++ b/sw/source/ui/misc/glosdoc.cxx
@@ -523,7 +523,7 @@ void SwGlossaries::UpdateGlosPath(sal_Bool bFull)
aDirArr.DeleteAndDestroy(0, aDirArr.Count());
if(!nTokenCount ||
- m_sErrPath.Len() && (bPathChanged || m_sOldErrPath != m_sErrPath) )
+ (m_sErrPath.Len() && (bPathChanged || m_sOldErrPath != m_sErrPath)) )
{
m_sOldErrPath = m_sErrPath;
// Falscher Pfad, d.h. AutoText-Verzeichnis existiert nicht
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index e733aa0389c2..5380a00afbaf 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -617,8 +617,8 @@ void SwOutlineSettingsTabPage::Update()
bSameSuffix &= aNumFmtArr[i]->GetSuffix() == aNumFmtArr[0]->GetSuffix();
bSameComplete &= aNumFmtArr[i]->GetIncludeUpperLevels() == aNumFmtArr[0]->GetIncludeUpperLevels();
const SwCharFmt* pFmt = aNumFmtArr[i]->GetCharFmt();
- bSameCharFmt &= !pFirstFmt && !pFmt
- || pFirstFmt && pFmt && pFmt->GetName() == pFirstFmt->GetName();
+ bSameCharFmt &= (!pFirstFmt && !pFmt)
+ || (pFirstFmt && pFmt && pFmt->GetName() == pFirstFmt->GetName());
}
}
CheckForStartValue_Impl(aNumFmtArr[0]->GetNumberingType());
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index d8f6afd98347..1bb2ae01ba6e 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -717,7 +717,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
case FN_FRAME_ALIGN_HORZ_LEFT:
if ( (eFrmType & FRMTYPE_FLY_INCNT) ||
bProtect ||
- (nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER)&& bHtmlMode )
+ ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER)&& bHtmlMode) )
rSet.DisableItem( nWhich );
break;
case FN_FRAME_ALIGN_VERT_ROW_TOP:
@@ -727,7 +727,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
case FN_FRAME_ALIGN_VERT_CHAR_CENTER:
case FN_FRAME_ALIGN_VERT_CHAR_BOTTOM:
if ( !(eFrmType & FRMTYPE_FLY_INCNT) || bProtect
- || bHtmlMode && FN_FRAME_ALIGN_VERT_CHAR_BOTTOM == nWhich )
+ || (bHtmlMode && FN_FRAME_ALIGN_VERT_CHAR_BOTTOM == nWhich) )
rSet.DisableItem( nWhich );
break;
@@ -738,7 +738,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
case FN_FRAME_ALIGN_VERT_TOP:
case FN_FRAME_ALIGN_VERT_CENTER:
case FN_FRAME_ALIGN_VERT_BOTTOM:
- if ( bProtect || bHtmlMode && eFrmType & FRMTYPE_FLY_ATCNT)
+ if ( bProtect || (bHtmlMode && eFrmType & FRMTYPE_FLY_ATCNT) )
rSet.DisableItem( nWhich );
else
{
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index f87bc0d41208..bb4f1c7fb609 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -220,7 +220,7 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh )
// Tabellenvariante, wenn mehrere Tabellenzellen selektiert
rSh.GetCrsr(); //Damit GetCrsrCnt() auch das Richtige liefert
- aBoxInfo.SetTable (rSh.IsTableMode() && rSh.GetCrsrCnt() > 1 ||
+ aBoxInfo.SetTable ((rSh.IsTableMode() && rSh.GetCrsrCnt() > 1) ||
!bTableSel);
// Abstandsfeld immer anzeigen
aBoxInfo.SetDist ((BOOL) TRUE);
@@ -663,7 +663,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
else
aCoreSet.InvalidateItem( RES_BACKGROUND );
- if ( !pDlg && rReq.GetArgs() || pDlg->Execute() == RET_OK )
+ if ( (!pDlg && rReq.GetArgs()) || pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutSet = pDlg ? pDlg->GetOutputItemSet() : rReq.GetArgs();
if ( pDlg )
@@ -1330,9 +1330,9 @@ void SwTableShell::GetState(SfxItemSet &rSet)
case FN_TABLE_VERT_BOTTOM:
{
USHORT nAlign = rSh.GetBoxAlign();
- BOOL bSet = nSlot == FN_TABLE_VERT_NONE && nAlign == text::VertOrientation::NONE||
- nSlot == FN_TABLE_VERT_CENTER && nAlign == text::VertOrientation::CENTER ||
- nSlot == FN_TABLE_VERT_BOTTOM && nAlign == text::VertOrientation::BOTTOM;
+ BOOL bSet = (nSlot == FN_TABLE_VERT_NONE && nAlign == text::VertOrientation::NONE) ||
+ (nSlot == FN_TABLE_VERT_CENTER && nAlign == text::VertOrientation::CENTER) ||
+ (nSlot == FN_TABLE_VERT_BOTTOM && nAlign == text::VertOrientation::BOTTOM);
rSet.Put(SfxBoolItem(nSlot, bSet));
}
break;
@@ -1342,9 +1342,9 @@ void SwTableShell::GetState(SfxItemSet &rSet)
case FN_TABLE_MODE_VARIABLE :
{
TblChgMode nMode = rSh.GetTblChgMode();
- BOOL bSet = nSlot == FN_TABLE_MODE_FIX && nMode == TBLFIX_CHGABS ||
- nSlot == FN_TABLE_MODE_FIX_PROP && nMode == TBLFIX_CHGPROP ||
- nSlot == FN_TABLE_MODE_VARIABLE && nMode == TBLVAR_CHGABS;
+ BOOL bSet = (nSlot == FN_TABLE_MODE_FIX && nMode == TBLFIX_CHGABS) ||
+ (nSlot == FN_TABLE_MODE_FIX_PROP && nMode == TBLFIX_CHGPROP) ||
+ (nSlot == FN_TABLE_MODE_VARIABLE && nMode == TBLVAR_CHGABS);
rSet.Put(SfxBoolItem(nSlot, bSet));
}
break;
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index 52b60c66d178..0d217532e32a 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -627,16 +627,18 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
DBG_ASSERT(pDlg, "Dialogdiet fail!");
if(pDlg->Execute() && pDlg->GetOutputItemSet())
{
- GetShell().LockPaint();
- GetShell().StartAllAction();
- GetShell().StartUndo(UNDO_INSERT);
+ //local variable necessary at least after call of .AutoCaption() because this could be deleted at this point
+ SwWrtShell& rShell = GetShell();
+ rShell.LockPaint();
+ rShell.StartAllAction();
+ rShell.StartUndo(UNDO_INSERT);
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
aMgr.SetAttrSet(*pOutSet);
// beim ClickToEditFeld erst die Selektion loeschen
- if( GetShell().IsInClickToEdit() )
- GetShell().DelRight();
+ if( rShell.IsInClickToEdit() )
+ rShell.DelRight();
aMgr.InsertFlyFrm();
@@ -647,8 +649,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
//FN_INSERT_FRAME
USHORT nAnchor = (USHORT)aMgr.GetAnchor();
rReq.AppendItem(SfxUInt16Item(nSlot, nAnchor));
- rReq.AppendItem(SfxPointItem(FN_PARAM_1, GetShell().GetObjAbsPos()));
- rReq.AppendItem(SvxSizeItem(FN_PARAM_2, GetShell().GetObjSize()));
+ rReq.AppendItem(SfxPointItem(FN_PARAM_1, rShell.GetObjAbsPos()));
+ rReq.AppendItem(SvxSizeItem(FN_PARAM_2, rShell.GetObjSize()));
rReq.Done();
}
@@ -659,10 +661,10 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_FRAME));
- GetShell().EndUndo(UNDO_INSERT, &aRewriter);
+ rShell.EndUndo(UNDO_INSERT, &aRewriter);
}
- GetShell().EndAllAction();
- GetShell().UnlockPaint();
+ rShell.EndAllAction();
+ rShell.UnlockPaint();
}
DELETEZ(pDlg);
@@ -900,7 +902,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
}
break;
case FN_INSERT_HRULER :
- if(rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel() || bCrsrInHidden )
+ if((rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel()) || bCrsrInHidden )
rSet.DisableItem(nWhich);
break;
case FN_FORMAT_COLUMN :
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 2dff1eddc4b4..e084c539da19 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -1743,8 +1743,8 @@ void SwTextShell::ChangeHeaderOrFooter(
if( !rStyleName.Len() || rStyleName == sTmp )
{
if( bShowWarning && !bOn && GetActiveView() && GetActiveView() == &GetView() &&
- (bHeader && aDesc.GetMaster().GetHeader().IsActive() ||
- !bHeader && aDesc.GetMaster().GetFooter().IsActive()))
+ ((bHeader && aDesc.GetMaster().GetHeader().IsActive()) ||
+ (!bHeader && aDesc.GetMaster().GetFooter().IsActive())))
{
bShowWarning = FALSE;
//Actions have to be closed while the dialog is showing
diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx
index 9e89620bed28..9d90ac5d5b26 100644
--- a/sw/source/ui/shells/txtattr.cxx
+++ b/sw/source/ui/shells/txtattr.cxx
@@ -119,8 +119,8 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
eEscape = nWhich == FN_SET_SUPER_SCRIPT ?
SVX_ESCAPEMENT_SUPERSCRIPT:
SVX_ESCAPEMENT_SUBSCRIPT;
- if( nWhich == FN_SET_SUB_SCRIPT && nTmpEsc < 0 ||
- nWhich == FN_SET_SUPER_SCRIPT && nTmpEsc > 0 )
+ if( (nWhich == FN_SET_SUB_SCRIPT && nTmpEsc < 0) ||
+ (nWhich == FN_SET_SUPER_SCRIPT && nTmpEsc > 0) )
eEscape = SVX_ESCAPEMENT_OFF;
SfxBindings& rBind = GetView().GetViewFrame()->GetBindings();
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index d8e1eed0f3fc..5b26b99d012f 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1643,7 +1643,7 @@ void SwTextFlowPage::Reset( const SfxItemSet& rSet )
}
String aFmtName;
- for(i = RES_POOLPAGE_BEGIN; i <= RES_POOLPAGE_REGISTER; ++i)
+ for(i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i)
if( LISTBOX_ENTRY_NOTFOUND == aPageCollLB.GetEntryPos(
aFmtName = SwStyleNameMapper::GetUIName( i, aFmtName ) ))
aPageCollLB.InsertEntry( aFmtName );
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index b1fd76c63aff..5abe83c3a53d 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -1179,8 +1179,8 @@ bool lcl_IsOwnDocument( SwView& rView )
String Created = xDocProps->getAuthor();
String Changed = xDocProps->getModifiedBy();
String FullName = SW_MOD()->GetUserOptions().GetFullName();
- return FullName.Len() &&
- (Changed.Len() && Changed == FullName ) ||
+ return (FullName.Len() &&
+ (Changed.Len() && Changed == FullName )) ||
(!Changed.Len() && Created.Len() && Created == FullName );
}
diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx
index 44e314a7475b..ca65184c74e6 100644
--- a/sw/source/ui/uiview/viewtab.cxx
+++ b/sw/source/ui/uiview/viewtab.cxx
@@ -529,7 +529,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
aUL.SetLower( (USHORT)aLongULSpace.GetLower() );
aDesc.GetMaster().SetFmtAttr( aUL );
- if( bHead && pHeaderFmt || !bHead && pFooterFmt )
+ if( (bHead && pHeaderFmt) || (!bHead && pFooterFmt) )
{
SwFmtFrmSize aSz( bHead ? pHeaderFmt->GetFrmSize() :
pFooterFmt->GetFrmSize() );
@@ -694,7 +694,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
SvxColumnItem aColItem((const SvxColumnItem&)rReq.
GetArgs()->Get(nSlot));
- if( bSetTabColFromDoc || !bSect && rSh.GetTableFmt() )
+ if( bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) )
{
ASSERT(aColItem.Count(), "ColDesc ist leer!!");
@@ -826,7 +826,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
SvxColumnItem aColItem((const SvxColumnItem&)rReq.
GetArgs()->Get(nSlot));
- if( bSetTabColFromDoc || !bSect && rSh.GetTableFmt() )
+ if( bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) )
{
ASSERT(aColItem.Count(), "ColDesc ist leer!!");
@@ -1078,8 +1078,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
(nSelType & nsSelectionType::SEL_FRM) ||
(nSelType & nsSelectionType::SEL_OLE) ||
SFX_ITEM_AVAILABLE > aCoreSet.GetItemState(RES_LR_SPACE)||
- !bVerticalWriting && (SID_ATTR_TABSTOP_VERTICAL == nWhich)||
- bVerticalWriting && (RES_PARATR_TABSTOP == nWhich)
+ (!bVerticalWriting && (SID_ATTR_TABSTOP_VERTICAL == nWhich))||
+ (bVerticalWriting && (RES_PARATR_TABSTOP == nWhich))
)
rSet.DisableItem( nWhich );
else
@@ -1106,8 +1106,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
nSelType & nsSelectionType::SEL_FRM ||
nSelType & nsSelectionType::SEL_OLE ||
nFrmType == FRMTYPE_DRAWOBJ ||
- !bVerticalWriting && (SID_ATTR_PARA_LRSPACE_VERTICAL == nWhich)||
- bVerticalWriting && (SID_ATTR_PARA_LRSPACE == nWhich)
+ (!bVerticalWriting && (SID_ATTR_PARA_LRSPACE_VERTICAL == nWhich))||
+ (bVerticalWriting && (SID_ATTR_PARA_LRSPACE == nWhich))
)
{
rSet.DisableItem(nWhich);
@@ -1282,9 +1282,9 @@ void SwView::StateTabWin(SfxItemSet& rSet)
BOOL bTableVertical = bHasTable && rSh.IsTableVertical();
- if((SID_RULER_BORDERS_VERTICAL == nWhich) &&
+ if( ( (SID_RULER_BORDERS_VERTICAL == nWhich) &&
((bHasTable && !bTableVertical)||
- (!bVerticalWriting && !bFrmSelection && !bHasTable ) || (bFrmSelection && !bFrameHasVerticalColumns)) ||
+ (!bVerticalWriting && !bFrmSelection && !bHasTable ) || (bFrmSelection && !bFrameHasVerticalColumns)) ) ||
((SID_RULER_BORDERS == nWhich) &&
((bHasTable && bTableVertical)||
(bVerticalWriting && !bFrmSelection&& !bHasTable) || bFrameHasVerticalColumns)))
@@ -1501,8 +1501,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
BOOL bFrameRTL;
BOOL bFrameHasVerticalColumns = rSh.IsFrmVertical(FALSE, bFrameRTL) && bFrmSelection;
- if((SID_RULER_ROWS == nWhich) &&
- ((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns)) ||
+ if( ( (SID_RULER_ROWS == nWhich) &&
+ ((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns)) ) ||
((SID_RULER_ROWS_VERTICAL == nWhich) &&
((bVerticalWriting && !bFrmSelection) || bFrameHasVerticalColumns)))
rSet.DisableItem(nWhich);
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index 38ecb34051e5..6eab64f68a60 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -2071,7 +2071,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier)
SvLBoxEntry* pFirstEntry = FirstSelected();
if (pFirstEntry && lcl_IsContent(pFirstEntry))
{
- if(bIsRoot && nRootType == CONTENT_TYPE_OUTLINE ||
+ if((bIsRoot && nRootType == CONTENT_TYPE_OUTLINE) ||
((SwContent*)pFirstEntry->GetUserData())->GetParent()->GetType()
== CONTENT_TYPE_OUTLINE)
{
@@ -2089,8 +2089,8 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier)
if( nMove )
{
short nDir = nCmd == FN_ITEM_UP ? -1 : 1;
- if( !bModifier && (nDir == -1 && nActPos > 0 ||
- nDir == 1 && nActPos < GetEntryCount() - 2 ) )
+ if( !bModifier && ((nDir == -1 && nActPos > 0) ||
+ (nDir == 1 && nActPos < GetEntryCount() - 2 )) )
{
pShell->MoveOutlinePara( nDir );
//Cursor wieder an die aktuelle Position setzen
@@ -2762,8 +2762,8 @@ sal_Bool SwContentTree::Select( SvLBoxEntry* pEntry, sal_Bool bSelect )
sal_Bool bEnable = sal_False;
SvLBoxEntry* pParentEntry = GetParent(pEntry);
if(!bIsLastReadOnly && (!IsVisible() ||
- (bIsRoot && nRootType == CONTENT_TYPE_OUTLINE && pParentEntry ||
- lcl_IsContent(pEntry) && ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE)))
+ ((bIsRoot && nRootType == CONTENT_TYPE_OUTLINE && pParentEntry) ||
+ (lcl_IsContent(pEntry) && ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE))))
bEnable = sal_True;
SwNavigationPI* pNavi = GetParentWindow();
pNavi->aContentToolBox.EnableItem(FN_ITEM_UP , bEnable);
diff --git a/sw/util/makefile.mk b/sw/util/makefile.mk
index 6fa4bd5432e2..98c616b7036d 100644
--- a/sw/util/makefile.mk
+++ b/sw/util/makefile.mk
@@ -375,7 +375,7 @@ SHL5LIBS=$(SLB)$/$(TARGET_VBA).lib
.INCLUDE : target.mk
-ALLTAR : $(MISC)/sw.component $(MISC)/swd.component $(MISC)/vbaswobj.component
+ALLTAR : $(MISC)/sw.component $(MISC)/swd.component $(MISC)/vbaswobj.component $(MISC)/msword.component
$(MISC)/sw.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
sw.component
@@ -394,3 +394,9 @@ $(MISC)/vbaswobj.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL5TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt vbaswobj.component
+
+$(MISC)/msword.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ msword.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL4TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt msword.component
diff --git a/sw/util/msword.component b/sw/util/msword.component
new file mode 100644
index 000000000000..84ae7aaf965f
--- /dev/null
+++ b/sw/util/msword.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.Writer.RtfExport">
+ <service name="com.sun.star.comp.Writer.RtfExport"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.RtfImport">
+ <service name="com.sun.star.comp.Writer.RtfImport"/>
+ </implementation>
+</component>
diff --git a/sw/util/msword.map b/sw/util/msword.map
index d2a9d9b4f7e1..6a4f01ffa7f7 100644
--- a/sw/util/msword.map
+++ b/sw/util/msword.map
@@ -7,7 +7,6 @@ UDK_3_0_0 {
SaveOrDelMSVBAStorage_ww8;
GetSaveWarningOfMSVBAStorage_ww8;
component_getImplementationEnvironment;
- component_writeInfo;
component_getFactory;
local:
*;
diff --git a/testautomation/graphics/optional/includes/global/g_arrangealign.inc b/testautomation/graphics/optional/includes/global/g_arrangealign.inc
index 29557214638b..1023ab88fd0a 100644
--- a/testautomation/graphics/optional/includes/global/g_arrangealign.inc
+++ b/testautomation/graphics/optional/includes/global/g_arrangealign.inc
@@ -35,8 +35,9 @@ testcase tiDatei_Fuer_Anordnen_Erstellen
dim sTemp as string
dim i as integer
dim zaehler as integer
- '/// This function creates the document, that will be used as reference and working object inthe following cases :-) ///'
- '///'Dim Datei ' somewhere global :-) defined in calling sub! :sub im_107c_ ///
+ printlog "This function creates the document, that will be used as reference and working object inthe following cases :-)"
+ 'Dim Datei ' somewhere global :-) defined in calling sub! :sub im_107c_
+ printlog "new document "
call hNewDocument
if gApplication = "DRAW" then
kontext "DocumentDraw"
@@ -49,22 +50,27 @@ testcase tiDatei_Fuer_Anordnen_Erstellen
hMenuSelectNr(4)
hMenuSelectNr(13)
call sSelectEmptyLayout '/// new document ///'
- if Dir(Datei)<>"" then app.Kill(Datei) ' kill old file
- for Zaehler = 1 to 3 '/// create 3 overlapping objects ///'
+ if Dir(Datei)<>"" then app.Kill(Datei) ' kill old file
+ printlog "create 3 overlapping objects "
+ for Zaehler = 1 to 3
Kontext
Select Case Zaehler
Case 1: WL_SD_Wuerfel
- gMouseMove (20,5, 80,60) '/// cubicel 20,5, 80,60 ///
+ printlog "cubicel 20,5, 80,60"
+ gMouseMove (20,5, 80,60)
Printlog " Object start ---------------------- "+ Zaehler +" cubicel "
Case 2: WL_SD_RechteckVoll
- gMouseMove (40,35, 90,90) '/// rectangel 40,35, 90,90 ///
- Printlog " Object start ---------------------- "+ Zaehler +" rectangel "
+ printlog "rectangel 40,35, 90,90"
+ gMouseMove (40,35, 90,90)
+ Printlog " Object start ---------------------- "+ Zaehler +" rectangel "
Case 3: WL_SD_Torus
- gMouseMove (1,35, 60,95) '/// donut ;-) 1,35, 60,95 ///
+ printlog "donut 1,35, 60,95 "
+ gMouseMove (1,35, 60,95)
Printlog " Object start ---------------------- "+ Zaehler +" donut "
End Select
sleep (1)
- FormatArea '/// assign different area properties for created objects (use rnd function)///'
+ printlog "assign different area properties for created objects (use rnd function)"
+ FormatArea
sleep (1)
kontext
Select Case Zaehler
@@ -85,12 +91,13 @@ testcase tiDatei_Fuer_Anordnen_Erstellen
TabFarben.OK
End Select
sleep 1
- ContextPositionAndSize '/// save position and size values into varialbes ///'
+ printlog "save position and size values into varialbes "
+ ContextPositionAndSize
sleep (1)
kontext
active.SetPage TabPositionAndSize
kontext "TabPositionAndSize"
- '/// the variables : Ueber_Text_[1-3] get set here ! with x position of object///
+ printlog "the variables : Ueber_Text_[1-3] get set here ! with x position of object"
Select Case Zaehler
Case 1: Ueber_Text_1 = PositionX.GetText : printlog "xpos: "+zaehler+": "+PositionX.GetText
Case 2: Ueber_Text_2 = PositionX.GetText : printlog "xpos: "+zaehler+": "+PositionX.GetText
@@ -100,41 +107,43 @@ testcase tiDatei_Fuer_Anordnen_Erstellen
gMouseClick 96,5
next Zaehler
sleep 1
- call hFileSaveAsKill (Datei) '/// save document ///'
+ printlog "save document "
+ call hFileSaveAsKill (Datei)
printlog "OK saved at ", Datei
sleep 1
- '/// select in default order and take Position X in mind ;-) ///'
- '///+ has to be from bottom to top: cubicel, rectangel, donut ///'
+ printlog "select in default order and take Position X in mind ;-)"
+ printlog "+ has to be from bottom to top: cubicel, rectangel, donut"
sPrintCheckOrder (TRUE)
- call hCloseDocument '/// close document ///'
+ printlog "close document "
+ call hCloseDocument
endcase 'tiDatei_Fuer_Anordnen_Erstellen
'-------------------------------------------------------------------------------
testcase tdContextSendBackward
dim sTemp as string
- '/// open created document 'with 3 figures' ///'
+ printlog "open created document 'with 3 figures'"
if (hFileOpen (Datei)) then
sleep 10
sPrintCheckOrder (TRUE)
- '/// select the middle object: rectangle, with keys: [TAB],[TAB] ///'
+ printlog "select the middle object: rectangle, with keys: [TAB],[TAB]"
hTypeKeys ("<TAB><TAB>")
- '/// Send Backward / [Strg]+[-] -> one level more to the back ///'
+ printlog "Send Backward / [Strg]+[-] -> one level more to the back"
WL_TB_ANORDNUNG_WeiterNachHinten
- '///+ has to be from bottom to top: rectangel cubicel donut ///'
+ printlog "+ has to be from bottom to top: rectangel cubicel donut"
sleep 2
sPrintCheckOrder
- '/// deselect all ///'
+ printlog "deselect all"
hTypeKeys ("<escape><escape>")
sleep 2
- '/// select the middle object: cubical, with keys: [TAB],[TAB] ///'
+ printlog "select the middle object: cubical, with keys: [TAB],[TAB]"
hTypeKeys ("<TAB><TAB>")
sleep 2
sTemp = fGetPositionX
if sTemp <> Ueber_Text_1 then
warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_1+";"
end if
- '/// close document ///'
+ printlog "close document"
Call hCloseDocument
endif
sleep 2
@@ -144,18 +153,18 @@ endcase 'tdContextSendBackward
testcase tdContextBringForward
dim sTemp as string
- '/// open created document 'with 3 figures' ///'
+ printlog "open created document 'with 3 figures'"
if (hFileOpen (Datei)) then
sleep 10
sPrintCheckOrder (TRUE)
- '/// select the middle object: rectangle, with keys: [TAB],[TAB] ///'
+ printlog "select the middle object: rectangle, with keys: [TAB],[TAB]"
hTypeKeys ("<TAB><TAB>")
- '/// Bring Forward / [Strg]+[+] -> one level more to the front ///'
+ printlog "Bring Forward / [Strg]+[+] -> one level more to the front"
WL_TB_ANORDNUNG_WeiterNachVorn
- '/// has to be from bottom to top: cubicel donut rectangel ///'
+ printlog "has to be from bottom to top: cubicel donut rectangel"
sleep 1
sPrintCheckOrder
- '/// select the middle object: donut, with keys: [TAB],[TAB] ///'
+ printlog "select the middle object: donut, with keys: [TAB],[TAB]"
hTypeKeys ("<TAB><TAB>")
sleep 2
sTemp = fGetPositionX
@@ -163,7 +172,7 @@ testcase tdContextBringForward
warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
end if
sleep 1
- '/// close document ///'
+ printlog "close document"
Call hCloseDocument
endif
@@ -172,18 +181,18 @@ endcase 'tdContextBringForward
testcase tdContextSendToBack
dim sTemp as string
- '/// open created document 'with 3 figures' ///'
+ printlog "open created document 'with 3 figures'"
if (hFileOpen (Datei)) then
sleep 10
sPrintCheckOrder (TRUE)
- '/// select the top object: donut, with keys: [TAB],[TAB],[TAB] ///'
+ printlog "select the top object: donut, with keys: [TAB],[TAB],[TAB]"
hTypeKeys ("<TAB><TAB><TAB>")
- '/// Send to Back / [Strg]+[Shift]+[-] -> backmost object ///'
+ printlog "Send to Back / [Strg]+[Shift]+[-] -> backmost object"
OL_DRAW_GanzNachHinten
- '/// has to be from bottom to top: rectangel cubicel donut ///'
+ printlog "has to be from bottom to top: rectangel cubicel donut"
sleep 3
sPrintCheckOrder
- '/// select the middle object: cubical, with keys: [TAB],[TAB] ///'
+ printlog "select the middle object: cubical, with keys: [TAB],[TAB]"
hTypeKeys ("<TAB><TAB>")
sleep 1
sTemp = fGetPositionX
@@ -191,7 +200,7 @@ testcase tdContextSendToBack
warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_1+";"
end if
sleep 3
- '/// close document ///'
+ printlog "close document"
Call hCloseDocument
endif
@@ -200,17 +209,17 @@ endcase 'tdContextSendToBack
testcase tdContextBringToFront
dim sTemp as string
- '/// open created document 'with 3 figures' ///'
+ printlog "open created document 'with 3 figures'"
if (hFileOpen (Datei)) then
sleep 10
sPrintCheckOrder (TRUE)
- '/// select the bottom object: cubical, with keys: [TAB] ///'
+ printlog "select the bottom object: cubical, with keys: [TAB]"
hTypeKeys ("<TAB>")
- '/// Bring to Front / [Strg]+[Shift]+[+] -> frontmost object ///'
+ printlog "Bring to Front / [Strg]+[Shift]+[+] -> frontmost object"
OL_DRAW_GanzNachVorn
- '/// has to be from bottom to top: rectangel, donut, cubicel ///'
+ printlog "has to be from bottom to top: rectangel, donut, cubicel"
sPrintCheckOrder
- '/// select the middle object: donut, with keys: [TAB],[TAB] ///'
+ printlog "select the middle object: donut, with keys: [TAB],[TAB]"
hTypeKeys ("<TAB><TAB>")
sleep 1
sTemp = fGetPositionX
@@ -218,7 +227,7 @@ testcase tdContextBringToFront
warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
end if
sleep 3
- '/// close document ///'
+ printlog "close document"
Call hCloseDocument
endif
@@ -227,26 +236,26 @@ endcase 'tdContextBringToFront
testcase tdContextInFrontOfObject
dim sTemp as string
- '/// open created document 'with 3 figures' ///'
+ printlog "open created document 'with 3 figures'"
if (hFileOpen (Datei)) then
sleep 10
sPrintCheckOrder (TRUE)
- '/// select the top object: donut, with keys: [TAB],[TAB],[TAB] ///'
+ printlog "select the top object: donut, with keys: [TAB],[TAB],[TAB]"
hTypeKeys ("<TAB><TAB><TAB>")
- '/// In Front of object ///'
+ printlog "In Front of object"
OL_DRAW_VorDasObjekt
- '/// left click the cubicel with the mouse ///'
+ printlog "left click the cubicel with the mouse"
gMouseClick 50,5
- '/// has to be from bottom to top: cubicel, donut, rectangel ///'
+ printlog "has to be from bottom to top: cubicel, donut, rectangel"
sPrintCheckOrder
sleep 1
- '/// select the middle object: donut, with keys: [TAB],[TAB] ///'
+ printlog "select the middle object: donut, with keys: [TAB],[TAB]"
hTypeKeys ("<TAB><TAB>")
sTemp = fGetPositionX
if sTemp <> Ueber_Text_3 then
printlog "DISABLED the WARNLOG, because mouseaction is not always the same :-( : Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
end if
- '/// close document ///'
+ printlog "close document"
Call hCloseDocument
endif
@@ -255,27 +264,27 @@ endcase 'tdContextInFrontOfObject
testcase tdContextBehindObject
dim sTemp as string
- '/// open created document 'with 3 figures' ///'
+ printlog "open created document 'with 3 figures'"
if (hFileOpen (Datei)) then
sleep 10
sPrintCheckOrder (TRUE)
- '/// select the top object: donut, with keys: [TAB],[TAB],[TAB] ///'
+ printlog "select the top object: donut, with keys: [TAB],[TAB],[TAB]"
hTypeKeys ("<TAB><TAB><TAB>")
- '/// Behind object ///'
+ printlog "Behind object"
OL_DRAW_HinterDasObjekt
sleep 1
- '/// left click the cubicel with the mouse ///'
+ printlog "left click the cubicel with the mouse"
gMouseClick 50,5
- '/// has to be from bottom to top: donut, cubicel, rectangel ///'
+ printlog "has to be from bottom to top: donut, cubicel, rectangel"
sPrintCheckOrder
sleep 1
- '/// select the bottom object: donut, with keys: [TAB] ///'
+ printlog "select the bottom object: donut, with keys: [TAB]"
hTypeKeys ("<TAB>")
sTemp = fGetPositionX
if sTemp <> Ueber_Text_3 then
printlog "DISABLED the WARNLOG, because mouseaction is not always tthe same Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
end if
- '/// close document ///'
+ printlog "close document"
Call hCloseDocument
endif
@@ -286,17 +295,17 @@ testcase tdContextReverse
dim sTemp as string
dim sTemp2 as string
dim i as integer
- '/// open created document 'with 3 figures' ///'
+ printlog "open created document 'with 3 figures'"
if (hFileOpen (Datei)) then
sleep 10
sPrintCheckOrder (TRUE)
- '/// Edit->Select All ///'
+ printlog "Edit->Select All"
EditSelectAll
sleep 3
- '/// Reverse ///'
+ printlog "Reverse"
WL_TB_ANORDNUNG_Vertauschen
sPrintCheckOrder
- '/// select in default order and take Position X in mind ;-) ///'
+ printlog "select in default order and take Position X in mind ;-)"
hTypeKeys ("<escape><escape>")
for i = 1 to 3
hTypeKeys ("<TAB>")
@@ -310,10 +319,9 @@ testcase tdContextReverse
warnlog " - " + i + " Arrangement is wrong; is: "+sTemp+"; should: "+sTemp2+";"
end if
next i
- '/// close document ///'
- Call hCloseDocument '/// close document ///'
+ printlog "close document"
+ Call hCloseDocument
endif
endcase 'tdContextReverse
'-------------------------------------------------------------------------------
-
diff --git a/testautomation/graphics/optional/includes/global/g_convertto.inc b/testautomation/graphics/optional/includes/global/g_convertto.inc
index 33eb157bc465..3a829b1ef275 100644
--- a/testautomation/graphics/optional/includes/global/g_convertto.inc
+++ b/testautomation/graphics/optional/includes/global/g_convertto.inc
@@ -30,15 +30,6 @@
'* short description :
'*
'**************************************************************************************
-' #1 tiAendernUmwandelnInPolygon
-' #1 tiModifyConvertToPolygon
-' #1 tdContextConvertIntoBitmap
-' #1 tiAendernUmwandelnInKurve
-' #1 tiAendernUmwandelnInPolygonGrafik
-' #1 tiAendernUmwandelnIn3D
-' #1 tiAendernUmwandelnIn3DRotationskoerper
-' #1 tiAendernUmwandelnInMetaFile
-'\*************************************************************************************
' Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\columbia.dxf")
' Call hGrafikEinfuegen ConvertPath ( gTesttoolPath + "global\input\graf_inp\enter.bmp" )
@@ -52,29 +43,29 @@
' Call tdContextConvertIntoMetaFile
testcase tiModifyConvertToPolygon
- Dim PosX as string
- Dim PosY as string
- Dim Maxanzahl as string
- Dim Minanzahl as string
+ Dim PosX as string
+ Dim PosY as string
+ Dim Maxanzahl as string
+ Dim Minanzahl as string
- Call hNewDocument
- Call sSelectEmptyLayout
- sleep 3
- hTextrahmenErstellen ("This is a text that will be transformed into a Polygon-object", 10,10,60,30)
- sleep 1
- hTypeKeys "<Escape>"
- sleep 1
- EditSelectAll
- sleep 1
- ContextConvertIntoPolygon
- sleep 1
- ContextPositionAndSize
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- PosX = Width.GetText
- PosY = Height.GetText
- TabPositionAndSize.OK
+ Call hNewDocument
+ Call sSelectEmptyLayout
+ sleep 3
+ hTextrahmenErstellen ("This is a text that will be transformed into a Polygon-object", 10,10,60,30)
+ sleep 1
+ hTypeKeys "<Escape>"
+ sleep 1
+ EditSelectAll
+ sleep 1
+ ContextConvertIntoPolygon
+ sleep 1
+ ContextPositionAndSize
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ PosX = Width.GetText
+ PosY = Height.GetText
+ TabPositionAndSize.OK
sleep 1
FormatCharacter
Kontext
@@ -120,7 +111,7 @@ testcase tiModifyConvertToPolygon
Kontext
Active.SetPage TabPositionAndSize
Kontext "TabPositionAndSize"
- '/// compare width and heigth to control is it is still text ///'
+ printlog "compare width and heigth to control is it is still text"
if ( Width.GetText = PosX or Height.GetText = PosY ) Then
Printlog "- Text converted into polygon"
else
@@ -133,7 +124,7 @@ testcase tiModifyConvertToPolygon
Call hNewDocument
sleep 3
- '/// insert graphic (input\\impress\\grafik\\sample.bmp)///'
+ printlog "insert graphic (input\\impress\\grafik\\sample.bmp)"
Call hGrafikEinfuegen ConvertPath ( gTesttoolPath + "global\input\graf_inp\enter.bmp" )
sleep 3
ContextConvertIntoPolygon
@@ -142,9 +133,11 @@ testcase tiModifyConvertToPolygon
MaxAnzahl = Farbanzahl.GetText
Farbanzahl.More 1
If Maxanzahl < Farbanzahl.GetText Then Warnlog "- Maximum value could be raised."
- Farbanzahl.ToMin '/// set color to min ///'
+ printlog "set color to min"
+ Farbanzahl.ToMin
MinAnzahl = Farbanzahl.GetText
- Farbanzahl.Less 1 '/// try to set a value lower than minimum ///'
+ printlog "try to set a value lower than minimum"
+ Farbanzahl.Less 1
If Farbanzahl.GetText < Minanzahl then Warnlog "- Minimum value could be lowered."
Farbanzahl.SetText "2"
Vorschau.Click
@@ -166,18 +159,20 @@ endcase 'tiModifyConvertToPolygon
'--------------------------------------------------------
testcase tdContextConvertIntoBitmap
- Call hNewDocument '/// new document ///'
- sleep 3
- InsertGraphicsFromFile '/// insert graphic ///'
- sleep 3
- kontext "Active"
+ printlog "new document"
+ Call hNewDocument
+ sleep 3
+ printlog "insert graphic"
+ InsertGraphicsFromFile
+ sleep 3
+ kontext "Active"
if Active.Exists Then
- Active.OK
+ Active.OK
end if
- sleep 5
- Kontext "GrafikEinfuegenDlg"
- sleep 2
-'/// uses input\\impress\\grafik\\columbia.dxf ///
+ sleep 5
+ Kontext "GrafikEinfuegenDlg"
+ sleep 2
+printlog " uses input\impress\grafik\columbia.dxf"
Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\columbia.dxf")
sleep 2
Oeffnen.Click
@@ -192,44 +187,53 @@ testcase tdContextConvertIntoBitmap
end if
Kontext "DocumentImpress"
try
- ContextConvertIntoBitmap '/// convert dxf file to bitmap ///'
+ printlog "convert dxf file to bitmap"
+ ContextConvertIntoBitmap
sleep 1
Printlog "- Convert into bitmap works"
catch
Warnlog "- Convert into bitmap does not work"
endcatch
- sleep 2
- Call hCloseDocument '/// close document ///'
-
+ sleep 2
+ printlog "close document"
+ Call hCloseDocument
+
endcase 'tdContextConvertIntoBitmap
'--------------------------------------------------------
testcase tiAendernUmwandelnInKurve
Printlog " ----- ContextConvertIntoCurve testen"
-
- Call hNewDocument '/// New impress document///'
+ printlog "New impress document"
+ Call hNewDocument
Call sSelectEmptyLayout
- Call hTextrahmenErstellen ("I test,test,test,test only, if it works for you",20,20,60,30) '/// create textbox///'
- sleep 2
- Kontext "DocumentImpress"
- gMouseDoubleClick 70,70 '/// deselect textbox ///'
- sleep 2
- EditSelectAll '/// select textbox ///'
- sleep 2
- ContextConvertIntoCurve '/// convert into curve ///'
- sleep 3
- gMouseClick 30,15
+ printlog "create textbox"
+ Call hTextrahmenErstellen ("I test,test,test,test only, if it works for you",20,20,60,30)
+ sleep 2
+ Kontext "DocumentImpress"
+ printlog "deselect textbox "
+ gMouseDoubleClick 70,70
+ sleep 2
+ printlog "select textbox "
+ EditSelectAll
+ sleep 2
+ printlog "convert into curve "
+ ContextConvertIntoCurve
+ sleep 3
+ gMouseClick 30,15
- hTypeKeys "<SHIFT RIGHT>",3 '/// try to select 3 letters ///'
+ printlog "try to select 3 letters "
+ hTypeKeys "<SHIFT RIGHT>",3
try
- EditCopy '/// try edit copy to check if its still text ///'
+ printlog "try edit copy to check if its still text "
+ EditCopy
Warnlog " - Convert into curve, seperate letters should not be selectable anymore"
catch
Printlog " - Text converted into a curve"
endcatch
- Call hCloseDocument '/// close document ///'
+ printlog "close document "
+ Call hCloseDocument
endcase 'tiAendernUmwandelnInKurve
'--------------------------------------------------------
@@ -237,13 +241,15 @@ testcase tiAendernUmwandelnInPolygonGrafik
Printlog "- Context/ConvertIntoPolygon"
- Call hNewDocument '/// new document ///'
+ printlog "new document "
+ Call hNewDocument
Call sSelectEmptyLayout
- InsertGraphicsFromFile '/// insert graphic (desp.bmp) ///'
+ printlog "insert graphic (desp.bmp) "
+ InsertGraphicsFromFile
Kontext "GrafikEinfuegenDlg"
- '///use graphic : input\\impress\\grafik\\desp.bmp ///
+ printlog "use graphic : input\impress\grafik\desp.bmp"
Dateiname.SetText ConvertPath ( gTesttoolPath + "global\input\graf_inp\desp.bmp" )
Oeffnen.Click
sleep 3
@@ -251,53 +257,66 @@ testcase tiAendernUmwandelnInPolygonGrafik
EditSelectAll
sleep 1
- ContextConvertIntoPolygon '/// convert into polygon ///'
+ printlog " convert into polygon "
+ ContextConvertIntoPolygon
Kontext "UmwandelnInPolygon"
Printlog "- Testing vectorize dialog"
- Farbanzahl.ToMax '/// set number of colors to max ///'
+ printlog "set number of colors to max"
+ Farbanzahl.ToMax
if Farbanzahl.GetText <> "32" Then Warnlog "- Maximum value for color depth should be 32, but it is: " + Farbanzahl.GetText
- Farbanzahl.ToMin '/// set number of colors to min ///'
+ printlog "set number of colors to min"
+ Farbanzahl.ToMin
sleep 1
if Farbanzahl.GetText <> "8" Then Warnlog "- Minimum value for color depth should be 8 but it is: " + Farbanzahl.GetText
sleep 2
- Punktreduktion.SetText "50" '/// set point reduction to 50 ///'
+ printlog "set point reduction to 50 "
+ Punktreduktion.SetText "50"
sleep 2
if Punktreduktion.GetText <> "32 Pixel" Then Warnlog "- Maximum value should be 32, but it is: " + Punktreduktion.GetText
sleep 1
- Punktreduktion.SetText "-50" '/// set an out of range value ///'
+ printlog "set an out of range value"
+ Punktreduktion.SetText "-50"
sleep 1
if Punktreduktion.GetText <> "0 Pixel" Then Warnlog "- Minimum value should be 0, but it is: " + Punktreduktion.GetText
- Loecherfuellen.Uncheck '/// uncheck fill holes ///'
+ printlog "uncheck fill holes"
+ Loecherfuellen.Uncheck
if Not Kachelgroesse.IsEnabled Then
Printlog "- Control disabled."
else
Warnlog "- Control should be disabled if Fill is not checked."
end if
- Vorschau.Click '/// open preview ///'
+ printlog "open preview"
+ Vorschau.Click
sleep 2
- UmwandelnInPolygon.OK '/// close dialog ///'
+ printlog "close dialog "
+ UmwandelnInPolygon.OK
sleep 5
- Call hCloseDocument '/// close document ///'
+ printlog "close document"
+ Call hCloseDocument
endcase 'tiAendernUmwandelnInPolygonGrafik
'--------------------------------------------------------
testcase tiAendernUmwandelnIn3D
Printlog "- Convert into 3D"
- Call hNewDocument
- sleep 1 '/// new impress document ///'
- hRechteckErstellen (10,10,40,40) '/// create rectangle ///'
- '/// convert into 3D ///'
+ printlog "new impress document "
+ Call hNewDocument
+ sleep 1
+ printlog "create rectangle"
+ hRechteckErstellen (10,10,40,40)
+ printlog "convert into 3D "
sleep 2
gMouseclick 35,35
sleep 1
try
- ContextConvertInto3D '/// try to access convert ito 3d a 2nd time, should be impossible using a 3d object as source ///'
+ printlog "try to access convert ito 3d a 2nd time, should be impossible using a 3d object as source "
+ ContextConvertInto3D
Printlog "- Convert into 3D works"
catch
Warnlog "- Convert into 3D does not work"
endcatch
- Call hCloseDocument '/// close document '///
+ printlog "close document"
+ Call hCloseDocument
endcase 'tiAendernUmwandelnIn3D
'--------------------------------------------------------
@@ -307,11 +326,14 @@ testcase tiAendernUmwandelnIn3DRotationskoerper
Dim PosX
Dim PosY
- Call hNewDocument '/// new document '///
+ printlog "new document"
+ Call hNewDocument
Kontext "DocumentImpress"
- hRechteckErstellen (20,20,50,50) '/// create rectangle ///'
+ printlog "create rectangle"
+ hRechteckErstellen (20,20,50,50)
sleep 1
- ContextPositionAndSize '/// get position values for the rectangle ///'
+ printlog "get position values for the rectangle "
+ ContextPositionAndSize
Kontext
Active.SetPage TabPositionAndSize
Kontext "TabPositionAndSize"
@@ -320,26 +342,31 @@ testcase tiAendernUmwandelnIn3DRotationskoerper
TabPositionAndSize.OK
sleep 1
Kontext "DocumentImpress"
- ContextConvertInto3DRotationObject '/// convert into 3d lathe object ///'
+ printlog "convert into 3d lathe object"
+ ContextConvertInto3DRotationObject
sleep 2
ContextPositionAndSize
Kontext
- Active.SetPage TabPositionAndSize '/// control changes in position values to confirm convert action ///'
+ printlog "control changes in position values to confirm convert action"
+ Active.SetPage TabPositionAndSize
Kontext "TabPositionAndSize"
if PositionX.GetText = PosX and PositionY.GetText = PosY Then Warnlog "- No change in position or dimension, converting seemd not to work"
TabPositionAndSize.OK
sleep 1
- Call hCloseDocument '/// close document ///'
+ printlog "close document "
+ Call hCloseDocument
endcase 'tiAendernUmwandelnIn3DRotationskoerper
'--------------------------------------------------------
testcase tiAendernUmwandelnInMetaFile
Printlog "- ConvertIntoMetaFile"
-
- Call hNewDocument '/// new document ///'
+
+ printlog "new document "
+ Call hNewDocument
sleep 3
- InsertGraphicsFromFile '/// insert graphic ///'
+ printlog "insert graphic"
+ InsertGraphicsFromFile
sleep 1
kontext "Active"
sleep 1
@@ -349,21 +376,21 @@ testcase tiAendernUmwandelnInMetaFile
sleep 1
Kontext "GrafikEinfuegenDlg"
sleep 2
- '/// uses input\\impress\\grafik\\desp.gif") ///
+ printlog " uses input\impress\grafik\desp.gif"
Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\purzel.gif")
sleep 2
Oeffnen.Click
sleep 5
Kontext "DocumentImpress"
try
- ContextConvertIntoMetafile '/// convert bitmap into metafile ///'
+ printlog "convert bitmap into metafile"
+ ContextConvertIntoMetafile
sleep 2
Printlog "- Convert into Metafile does work"
catch
Warnlog "- Convert into Metafile does not work"
endcatch
sleep 2
- Call hCloseDocument '/// close document ///'
-
-endcase 'tiAendernUmwandelnInMetaFile
-
+ printlog "close document"
+ Call hCloseDocument
+endcase 'tiAendernUmwandelnInMetaFile \ No newline at end of file
diff --git a/testautomation/graphics/optional/includes/global/g_customshapes.inc b/testautomation/graphics/optional/includes/global/g_customshapes.inc
index 28c2e22ed301..1a38090914e6 100644
--- a/testautomation/graphics/optional/includes/global/g_customshapes.inc
+++ b/testautomation/graphics/optional/includes/global/g_customshapes.inc
@@ -38,20 +38,19 @@ testcase tCustomshapes
dim counter as Integer
dim MakeInto3Dcounter as Integer
- '/// Create new document ///'
+ printlog "Create new document "
Call hNewDocument
Call sSelectEmptyLayout
- if gApplication = "DRAW" then
+ if gApplication = "DRAW" then
Kontext "Documentdraw"
- else '(Impress)
+ else '(Impress)
Kontext "DocumentImpress"
- endif
- kontext "Toolbar"
- sleep 1
- printlog "insert a Smiley."
- '/// From the toolbar: Insert three objects: ///'
- '/// insert a Smiley. ///'
- kontext "Toolbar"
+ endif
+ kontext "Toolbar"
+ sleep 1
+ printlog "From the toolbar: Insert three objects: "
+ printlog "1st: insert a Smiley. "
+ kontext "Toolbar"
if Toolbar.Exists then
if Toolbar.IsVisible then
sleep 1
@@ -73,17 +72,15 @@ testcase tCustomshapes
kontext "SymbolShapes"
SymbolShapes.Close
- '/// Unmark all objects ///'
+ printlog "Unmark all objects "
hTypeKeys "<ESCAPE>"
- '/// Mark the Smiley ///'
+ printlog "Mark the Smiley "
hTypeKeys "<TAB>"
printlog "Rename the object to 'First'."
- '/// Rename the object to 'First' ///"
hOpenContextMenu
sleep 2
- 'Choose rename.
if hMenuFindSelect(27027, true, 15) = false then
Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
Call hCloseDocument
@@ -93,11 +90,9 @@ testcase tCustomshapes
NameField.SetText "First"
NameDlgObject.OK
- printlog "Set the object -Title/Description to 'SecondTitle' and 'SecondText'"
- '/// Open the Context-menu and set the description of the object to 'First' ///"
+ printlog "Open the Context-menu and set the description of the object to 'First'"
hOpenContextMenu
sleep (2)
- 'Choose "Description"
if hMenuFindSelect(27033, true, 14) = false then
Warnlog "Context-Menu-entry `Description` was not found. Therefore the test ends."
Call hCloseDocument
@@ -115,8 +110,7 @@ testcase tCustomshapes
endif
gMouseClick 90, 90
- printlog "Insert a Triangle."
- '/// Insert a Triangle ///'
+ printlog "2nd: Insert a Triangle "
kontext "Toolbar"
if Toolbar.Exists then
if Toolbar.IsVisible then
@@ -138,16 +132,14 @@ testcase tCustomshapes
BasicShapes.Close
sleep 1
- '/// Unmark all objects ///'
+ printlog "Unmark all objects "
hTypeKeys "<ESCAPE>"
- '/// Mark the Triangle ///'
+ printlog "Mark the Triangle "
hTypeKeys "<TAB>", 2
- printlog "Rename the object into 'Second'."
- '/// Rename the object into 'Second'. ///'
+ printlog "Rename the object into 'Second'. "
hOpenContextMenu
sleep 2
- 'Choose rename.
if hMenuFindSelect(27027, true, 15) = false then
Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
Call hCloseDocument
@@ -159,11 +151,9 @@ testcase tCustomshapes
NameField.SetText "Second"
NameDlgObject.OK
- printlog "Set the object -Title/Description to 'SecondTitle' and 'SecondText'."
- '/// Open the Context-menu and set the description of the object to 'SecondTitle' and 'SecondText' ///"
+ printlog "Open the Context-menu and set the description of the object to 'SecondTitle' and 'SecondText'"
hOpenContextMenu
sleep (2)
- 'Choose "Description"
if hMenuFindSelect(27033, true, 14) = false then
Warnlog "Context-Menu-entry `Description` was not found. Therefore the test ends."
Call hCloseDocument
@@ -181,14 +171,13 @@ testcase tCustomshapes
endif
gMouseClick 90, 90
- printlog "Insert Thinking-cloud."
- '/// Insert Thinking-cloud. ///'
+ printlog "3rd: Insert Thinking-cloud."
kontext "Toolbar"
if Toolbar.Exists then
if Toolbar.IsVisible then
sleep 1
try
- CalloutShapes.TearOff ' insert Thinking-cloud
+ CalloutShapes.TearOff
catch
warnlog "bug for GH from FHA; .tearoff doesnt tell success"
endcatch
@@ -206,16 +195,14 @@ testcase tCustomshapes
Callouts.Close
sleep 1
- '/// Unmark all objects ///'
+ printlog "Unmark all objects "
hTypeKeys "<ESCAPE>"
- '/// Mark the cloud ///'
+ printlog "Mark the cloud "
hTypeKeys "<TAB>", 3
- printlog "Rename the object to 'Third'."
- '/// Rename the object to 'Third'. ///'
+ printlog "Rename the object to 'Third'. "
hOpenContextMenu
sleep 2
- 'Choose rename.
if hMenuFindSelect(27027, true, 15) = false then
Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
Call hCloseDocument
@@ -225,11 +212,9 @@ testcase tCustomshapes
NameField.SetText "Third"
NameDlgObject.OK
- printlog "Set the object -Title/Description to 'ThirdTitle' and 'ThirdText'."
- '/// Open the Context-menu and set the description of the object to 'First' ///"
+ printlog "Open the Context-menu and set the description of the object to 'First'"
hOpenContextMenu
sleep (2)
- 'Choose "Description"
if hMenuFindSelect(27033, true, 14) = false then
Warnlog "Context-Menu-entry `Description` was not found. Therefore the test ends."
Call hCloseDocument
@@ -247,8 +232,7 @@ testcase tCustomshapes
endif
gMouseClick 90, 90
- printlog "Change all objects into 3D."
- '/// Change all objects into 3D. ///'
+ printlog "Change all objects into 3D. "
if gApplication = "DRAW" then
Kontext "Documentdraw"
else '(Impress)
@@ -294,9 +278,8 @@ testcase tCustomshapes
hTypeKeys "<ESCAPE>"
Next MakeInto3Dcounter
- printlog "See if the objects still are Custom Shapes."
- '/// See if the objects still are Custom Shapes ///'
- '/// We do so by moving the lower part of the the thinking-cloud. ///'
+ printlog "See if the objects still are Custom Shapes "
+ printlog "We do so by moving the lower part of the the thinking-cloud. "
gMouseClick 90, 1
hTypeKeys "<TAB><TAB><TAB>"
@@ -313,8 +296,7 @@ testcase tCustomshapes
gMouseClick 90, 1
hTypeKeys "<TAB>"
- printlog "Check the name of the selected object (should be 'First')"
- '/// Check the name of the selected object (should be 'First') ///'
+ printlog "Check the name of the selected object (should be 'First') "
hOpenContextMenu
sleep 2
'Choose rename.
@@ -334,7 +316,6 @@ testcase tCustomshapes
NameDlgObject.OK
printlog "Open the Context-menu and check if the description of the object is right"
- '/// Open the Context-menu and check if the description of the object is right ///"
hOpenContextMenu
sleep (2)
'Choose "Description"
@@ -363,10 +344,9 @@ testcase tCustomshapes
gMouseClick 90, 1
hTypeKeys "<TAB><TAB>"
- '/// Check the name of the selected object (should be 'Second') ///'
+ printlog "Check the name of the selected object (should be 'Second') "
hOpenContextMenu
sleep 2
- 'Choose rename.
if hMenuFindSelect(27027, true, 15) = false then
Warnlog " Context-Menu-entry `Rename` was not found. Therefore the test ends."
Call hCloseDocument
@@ -383,7 +363,6 @@ testcase tCustomshapes
NameDlgObject.OK
printlog "Open the Context-menu and check if the description of the object is right"
- '/// Open the Context-menu and check if the description of the object is right ///"
hOpenContextMenu
sleep (2)
'Choose "Description"
@@ -416,7 +395,7 @@ testcase tCustomshapes
gMouseClick 90, 1
hTypeKeys "<TAB><TAB><TAB>"
- '/// Check the name of the selected object (should be "Third") ///'
+ printlog "Check the name of the selected object (should be Third) "
hOpenContextMenu
sleep 2
'Choose rename.
@@ -436,7 +415,6 @@ testcase tCustomshapes
NameDlgObject.OK
printlog "Open the Context-menu and check if the description of the object is right"
- '/// Open the Context-menu and check if the description of the object is right ///"
hOpenContextMenu
sleep (2)
'Choose "Description"
@@ -468,14 +446,14 @@ testcase tCustomshapes
endif
printlog "End of test. Close the document."
- Call hCloseDocument '/// Close Document ///'
+ Call hCloseDocument
endcase 'tCustomshapes
'---------------------------------------------------------
testcase tFormatPaintbrush
dim counter, ZaehlerVerlauf, j as Integer
- '/// Hatching ///'
+ printlog "Hatching "
dim HatchingDistance as string
dim HatchingAngle as string
dim HatchingLineType as string
@@ -524,23 +502,24 @@ testcase tFormatPaintbrush
dim front_value as string
dim background_value as string
- '/// Create new document ///'
+ printlog "Create new document "
Call hNewDocument
- '/// Create a new rectangle ///'
+ printlog "Create a new rectangle "
hRechteckErstellen ( 10, 10, 30, 30 )
FormatArea
- '/// Switch to Tabpage "Area" ///'
+ printlog "Switch to Tabpage Area "
Kontext
Active.SetPage TabArea
Kontext "TabArea"
sleep 1
- FillOptions.Select 4 '/// Select hatching, control after closing and reopening dialog if changes are recognized ///'
- '/// Switch to Tabpage "Hatching" ///'
+ printlog "Select hatching, control after closing and reopening dialog if changes are recognized "
+ FillOptions.Select 4
+ printlog "Switch to Tabpage Hatching "
Kontext
Active.setpage TabSchraffuren
Kontext "TabSchraffuren"
- '/// Get the values for the Rectangle ///'
+ printlog "Get the values for the Rectangle "
HatchingDistance = Abstand.GetText
HatchingAngle = Winkel.GetText
'Definition
@@ -551,7 +530,7 @@ testcase tFormatPaintbrush
sleep 1
' FormatArea
- '/// Switch to Tabpage "Shaddow" ///'
+ printlog "Switch to Tabpage Shaddow "
Kontext
Active.setpage TabSchatten
Kontext "TabSchatten"
@@ -565,7 +544,7 @@ testcase tFormatPaintbrush
endif
sleep 1
- '/// Switch to Tabpage "Transparency" ///'
+ printlog "Switch to Tabpage Transparency "
Kontext
Active.SetPage TabTransparenz
Kontext "TabTransparenz"
@@ -583,7 +562,7 @@ testcase tFormatPaintbrush
MFEnd_value = MFEndwert.GetText
sleep 1
- '/// Switch to Tabpage "Color" ///'
+ printlog "Switch to Tabpage Color "
Kontext
Active.setpage TabFarben
Kontext "TabFarben"
@@ -603,7 +582,7 @@ testcase tFormatPaintbrush
endif
sleep 1
- '/// Switch to Tabpage "Gradient" ///'
+ printlog "Switch to Tabpage Gradient "
Kontext
Active.setpage TabFarbverlaeufe
Kontext "TabFarbverlaeufe"
@@ -619,7 +598,7 @@ testcase tFormatPaintbrush
tovalue_value = BisWert.GetText
sleep 1
- '/// Switch to Tabpage "Bitmap" ///'
+ printlog "Switch to Tabpage Bitmap "
Kontext
Active.setpage TabBitmap
Kontext "TabBitmap"
@@ -627,11 +606,11 @@ testcase tFormatPaintbrush
front_value = Vordergrund.GetSelText
background_value = Hintergrund.GetSelText
sleep 1
- '/// Close the FormatArea-dialogue with "OK" ///'
+ printlog "Close the FormatArea-dialogue with OK "
TabBitmap.OK
sleep 2
- '/// Create a second rectangle, and use the "Paintbrush-icon" to copy the settings for the first rectangle onto the new one ///'
+ printlog "Create a second rectangle, and use the Paintbrush-icon to copy the settings for the first rectangle onto the new one "
hRechteckErstellen ( 70, 70, 90, 90 )
if gApplication = "DRAW" then
kontext "Documentdraw"
@@ -659,21 +638,23 @@ testcase tFormatPaintbrush
sleep 1
endif
- '/// Check if the Formatting is like the first one. ///'
+ printlog "Check if the Formatting is like the first one. "
FormatArea
- '/// Switch to Tabpage "Area" ///'
+ printlog "Switch to Tabpage Area "
Kontext
Active.SetPage TabArea
Kontext "TabArea"
-' if FillOptions.GetSelIndex <> 4 then '/// The selected value should be 'no fill' ///'
+' if FillOptions.GetSelIndex <> 4 then printlog "The selected value should be 'no fill' "
' warnlog "The FillOptions-value was not transferred correctly."
' else
' printlog "The FillOptions-value was transferred correctly."
' endif
- sleep 1 '/// control if changes are still there after closing and reopening dialog ///'
- FillOptions.Select 4 '/// Select hatching, control after closing and reopening dialog if changes are recognized ///'
- '/// Switch to Tabpage "Hatching" ///'
+ sleep 1
+ printlog "control if changes are still there after closing and reopening dialog "
+ FillOptions.Select 4
+ printlog "Select hatching, control after closing and reopening dialog if changes are recognized "
+ printlog "Switch to Tabpage Hatching "
kontext
Active.setpage TabSchraffuren
kontext "TabSchraffuren"
@@ -693,7 +674,7 @@ testcase tFormatPaintbrush
endif
sleep 1
- '/// Switch to Tabpage "Shaddow" ///'
+ printlog "Switch to Tabpage Shaddow "
Kontext
Active.setpage TabSchatten
Kontext "TabSchatten"
@@ -718,7 +699,7 @@ testcase tFormatPaintbrush
endif
sleep 1
- '/// Switch to Tabpage "Transparency" ///'
+ printlog "Switch to Tabpage Transparency "
Kontext
Active.SetPage TabTransparenz
Kontext "TabTransparenz"
@@ -757,7 +738,7 @@ testcase tFormatPaintbrush
endif
sleep 1
- '/// Switch to Tabpage "Color" ///'
+ printlog "Switch to Tabpage Color "
Kontext
Active.setpage TabFarben
Kontext "TabFarben"
@@ -798,7 +779,7 @@ testcase tFormatPaintbrush
endif
sleep 1
- '/// Switch to Tabpage "Gradient" ///'
+ printlog "Switch to Tabpage Gradient "
Kontext
Active.setpage TabFarbverlaeufe
Kontext "TabFarbverlaeufe"
@@ -831,7 +812,7 @@ testcase tFormatPaintbrush
endif
sleep 1
- '/// Switch to Tabpage "Bitmap" ///'
+ printlog "Switch to Tabpage Bitmap "
Kontext
Active.setpage TabBitmap
Kontext "TabBitmap"
@@ -843,6 +824,7 @@ testcase tFormatPaintbrush
endif
sleep 1
TabBitmap.OK
- Call hCloseDocument '/// Close Document ///'
+ printlog "Close Document "
+ Call hCloseDocument
endcase 'tFormatPaintbrush
diff --git a/testautomation/graphics/optional/includes/global/g_format.inc b/testautomation/graphics/optional/includes/global/g_format.inc
index dbd8d6fe8a43..edd57185e73b 100644
--- a/testautomation/graphics/optional/includes/global/g_format.inc
+++ b/testautomation/graphics/optional/includes/global/g_format.inc
@@ -46,267 +46,265 @@ testcase tiFormatText
Dim ZaehlerEffekt
dim sTemp as string
- '/// open application ///'
+ printlog "open application"
Call hNewDocument
Call sSelectEmptyLayout
- '/// create a textbox with text ///'
- Call hTextrahmenErstellen ("This is a text, which, I hope, in Staroffice, will be automaticly formatted. Should that not be the case, then it doesn't matter.",20,20,70,20)
+ printlog "create a textbox with text"
+ Call hTextrahmenErstellen ("This is a text, which, I hope, in Openoffice, will be automaticly formatted. Should that not be the case, then it doesn't matter.",20,20,70,20)
WaitSlot (1000)
- '/// click outside of textbox, to leave edit mode of textbox and deselect it ///'
+ printlog "click outside of textbox, to leave edit mode of textbox and deselect it"
gMouseClick 99,99
- '/// type key [TAB] to select textbox again ///'
+ printlog "type key [TAB] to select textbox again"
hTypeKeys "<TAB>"
- '/// Format->Position and Size ///'
+ printlog "Format->Position and Size"
FormatPositionAndSize
- Kontext
- '/// select tabpage 'Format and Size' on dialog 'Position and Size' ///'
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- sleep 2
- '/// get and remember Position: 'Position X' ///'
- a = PositionX.GetText
- '/// close dialog 'Position and Size' with OK ///'
- TabPositionAndSize.OK
+ Kontext
+ printlog "select tabpage 'Format and Size' on dialog 'Position and Size'"
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ sleep 2
+ printlog "get and remember Position: 'Position X'"
+ a = PositionX.GetText
+ printlog "close dialog 'Position and Size' with OK"
+ TabPositionAndSize.OK
- '/// Format -> Text... ///'
+ printlog "Format -> Text..."
FormatTextDraw
- Kontext
- '/// select tabpage 'Text' ///'
- Active.SetPage TabText
- Kontext "TabText"
- '/// Check checkbox 'Fit width to text' ///'
- BreiteAnTextAnpassen.Check
- '/// leave dialog with OK ///'
- TabText.OK
+ Kontext
+ printlog "select tabpage 'Text'"
+ Active.SetPage TabText
+ Kontext "TabText"
+ printlog "Check checkbox 'Fit width to text'"
+ BreiteAnTextAnpassen.Check
+ printlog "leave dialog with OK"
+ TabText.OK
+ printlog "Dialog should have been resized and moved now!"
- '/// Dialog should have been resized and moved now! ///'
-
- '/// Format->Position and Size ///'
+ printlog "Format->Position and Size"
ContextPositionAndSize
- Kontext
- '/// select tabpage 'Format and Size' on dialog 'Position and Size' ///'
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- WaitSlot (2000)
- '/// compare 'Position X' with saved value - has to be different ///'
- sTemp = PositionX.GetText
- if (sTemp <> a) Then
- Printlog " - Fit to frame does work"
- else
- warnlog " - Fit to frame doesn't work: expected: '" + a + "' is: '" + + "'"
- end if
- '/// get and remember Position: 'Position Y' ///'
- b=PositionY.GetText
- TabPositionAndSize.OK
+ Kontext
+ printlog "select tabpage 'Format and Size' on dialog 'Position and Size'"
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ WaitSlot (2000)
+ printlog "compare 'Position X' with saved value - has to be different"
+ sTemp = PositionX.GetText
+ if (sTemp <> a) Then
+ Printlog " - Fit to frame does work"
+ else
+ warnlog " - Fit to frame doesn't work: expected: '" + a + "' is: '" + + "'"
+ end if
+ printlog "get and remember Position: 'Position Y'"
+ b=PositionY.GetText
+ TabPositionAndSize.OK
- '/// Format -> Text... ///'
+ printlog "Format -> Text..."
FormatTextDraw
- Kontext
- '/// select tabpage 'Text' ///'
- Active.SetPage TabText
- Kontext "TabText"
- '/// UNCheck checkbox 'Fit width to text' ///'
- BreiteAnTextAnpassen.Uncheck
- '/// check checkbox 'Fit height to text' ///'
- HoeheAnTextAnpassen.Check
- '/// if checkbox 'Fit to frame' is enabled: this state only happens, if 'Fit height to text' and 'Fit width to text' are checked ///'
- if AmRahmenAnpassen.IsEnabled Then
- WarnLog " - checkbox 'Fit to frame' is enabled, which is wrong!"
- else
- PrintLog " - checkbox 'Fit to frame' is disabled."
- end if
- WaitSlot (1000)
- '/// UNcheck checkbox 'Fit height to text' ///'
- HoeheAnTextAnpassen.UnCheck
- '/// UNCheck checkbox 'Fit width to text' ///'
- BreiteAnTextAnpassen.UnCheck
- '/// if checkbox 'Fit to frame' is disabled: this state only happens, if 'Fit height to text' and/or 'Fit width to text' are checked ///'
- if AmRahmenAnpassen.IsEnabled Then
- PrintLog " - checkbox 'Fit to frame' is enabled."
- else
- WarnLog " - checkbox 'Fit to frame' is disabled, which is wrong!"
- end if
-' PrintLog "Full width: " + GanzeBreite.IsChecked
- '/// set metric field 'Left' to 10 ///'
- Links.SetText "10"
- '/// set metric field 'Right' to 10 ///'
- Rechts.SetText "10"
- '/// set metric field 'Top' to 10 ///'
- Oben.SetText "10"
- '/// set metric field 'Bottom' to 10 ///'
- Unten.SetText "10"
- '/// leave dialog with OK ///'
- TabText.OK
+ Kontext
+ printlog "select tabpage 'Text'"
+ Active.SetPage TabText
+ Kontext "TabText"
+ printlog "UNCheck checkbox 'Fit width to text'"
+ BreiteAnTextAnpassen.Uncheck
+ printlog "check checkbox 'Fit height to text'"
+ HoeheAnTextAnpassen.Check
+ printlog "if checkbox 'Fit to frame' is enabled: this state only happens, if 'Fit height to text' and 'Fit width to text' are checked"
+ if AmRahmenAnpassen.IsEnabled Then
+ WarnLog " - checkbox 'Fit to frame' is enabled, which is wrong!"
+ else
+ PrintLog " - checkbox 'Fit to frame' is disabled."
+ end if
+ WaitSlot (1000)
+ printlog "UNcheck checkbox 'Fit height to text'"
+ HoeheAnTextAnpassen.UnCheck
+ printlog "UNCheck checkbox 'Fit width to text'"
+ BreiteAnTextAnpassen.UnCheck
+ printlog "if checkbox 'Fit to frame' is disabled: this state only happens, if 'Fit height to text' and/or 'Fit width to text' are checked"
+ if AmRahmenAnpassen.IsEnabled Then
+ PrintLog " - checkbox 'Fit to frame' is enabled."
+ else
+ WarnLog " - checkbox 'Fit to frame' is disabled, which is wrong!"
+ end if
+ printlog "set metric field 'Left' to 10"
+ Links.SetText "10"
+ printlog "set metric field 'Right' to 10"
+ Rechts.SetText "10"
+ printlog "set metric field 'Top' to 10"
+ Oben.SetText "10"
+ printlog "set metric field 'Bottom' to 10"
+ Unten.SetText "10"
+ printlog "leave dialog with OK"
+ TabText.OK
- '/// Edit -> Select All ///'
+ printlog "Edit -> Select All"
EditSelectAll
- '/// type Keys [Strg]+[x] to cut object ///'
+ printlog "type Keys [Strg]+[x] to cut object"
hTypeKeys "<MOD1 X>"
- '/// No object exists in dokument right now! ///'
- '/// Format -> Text... ///'
+ printlog "No object exists in dokument right now!"
+ printlog "Format -> Text..."
FormatTextDraw
- Kontext
- '/// select tabpage 'Text' ///'
- Active.SetPage TabText
- Kontext "TabText"
- '/// check checkbox 'Adjust to contour' ///'
- Konturfluss.Check
- '/// now every other control on the dialog has to get disabled ///'
- if ((AmRahmenAnpassen.IsEnabled=False) And (Links.IsEnabled=False) And (Rechts.IsEnabled=False) And (Oben.IsEnabled=False) And (Unten.IsEnabled =False)) Then
- PrintLog " - Adjust to contour is working"
- else
- WarnLog " - contourflow aktivated doesn't work it's supposed to"
- end if
- '/// leave dialog with OK ///'
- TabText.OK
+ Kontext
+ printlog "select tabpage 'Text'"
+ Active.SetPage TabText
+ Kontext "TabText"
+ printlog "check checkbox 'Adjust to contour'"
+ Konturfluss.Check
+ printlog "now every other control on the dialog has to get disabled"
+ if ((AmRahmenAnpassen.IsEnabled=False) And (Links.IsEnabled=False) And (Rechts.IsEnabled=False) And (Oben.IsEnabled=False) And (Unten.IsEnabled =False)) Then
+ PrintLog " - Adjust to contour is working"
+ else
+ WarnLog " - contourflow aktivated doesn't work it's supposed to"
+ end if
+ printlog "leave dialog with OK"
+ TabText.OK
- '/// create a textbox with text ///'
- Call hTextrahmenErstellen ("blablablablablablablablablablablabla",20,20,60,60)
+ printlog "create a textbox with text"
+ Call hTextrahmenErstellen ("Just some test-text...",20,20,60,60)
WaitSlot (5000)
- '/// Format -> Text... ///'
+ printlog "Format -> Text..."
FormatTextDraw
- Kontext
- '/// select tabpage 'Text Animation' ///'
- Active.SetPage TabLauftext
- Kontext "TabLauftext"
+ Kontext
+ printlog "select tabpage 'Text Animation'"
+ Active.SetPage TabLauftext
+ Kontext "TabLauftext"
- ZaehlerEffekt = Effekt.GetItemCount
- if (ZaehlerEffekt <> 5) then
- qaerrorlog "There are now more or less than 5 Effects - Change testcase! " + ZaehlerEffekt
+ ZaehlerEffekt = Effekt.GetItemCount
+ if (ZaehlerEffekt <> 5) then
+ qaerrorlog "There are now more or less than 5 Effects - Change testcase! " + ZaehlerEffekt
+ end if
+ for n=1 to ZaehlerEffekt
+ Effekt.Select n
+ printlog n + ": '" + Effekt.getSelText + "' -------------------------------"
+ if (n > 2) then
+ printlog "test all directions"
+ for i = 1 to 4
+ printlog "" + i
+ select case i
+ case 1: NachOben.click
+ case 2: NachLinks.click
+ case 3: NachRechts.click
+ case 4: NachUnten.click
+ end select
+ sFormatTextDrawAnimation
+ next i
end if
- for n=1 to ZaehlerEffekt
- Effekt.Select n
- printlog "" + n + ": '" + Effekt.getSelText + "' -------------------------------"
- if (n > 2) then
- '/// test all directions ///'
- for i = 1 to 4
- printlog "" + i
- select case i
- case 1: NachOben.click
- case 2: NachLinks.click
- case 3: NachRechts.click
- case 4: NachUnten.click
- end select
- sFormatTextDrawAnimation
- next i
- end if
- if ((n > 1) AND (n < 5)) then
- '/// test all Start/End Text visibility ///'
- for i = 1 to 4
- printlog "" + i
- select case i
- case 1: TextSichtbarBeimStarten.check : TextSichtbarBeimBeenden.uncheck
- case 2: TextSichtbarBeimBeenden.check
- case 3: TextSichtbarBeimStarten.uncheck
- case 4: TextSichtbarBeimBeenden.uncheck
- end select
- sFormatTextDrawAnimation
- next i
- end if
- if ((n > 1) AND (n < 5)) then
- '/// test all Animation cycles ///'
- for i = 1 to 3
- printlog "" + i
- select case i
- case 1: Endlos.check
- case 2: Endlos.UnCheck : Anzahl.typeKeys ("<PageUp>")
- case 3: If Endlos.IsChecked = true then
- QaErrorLog "#i74067# - Checkbox checked when it shouldn't have been."
- Endlos.UnCheck
- end if
- Anzahl.setText ("1")
- end select
- sFormatTextDrawAnimation
- next i
- end if
- if (n > 2) then
- '/// test all Increment ///'
- for i = 1 to 4
- printlog "" + i
- select case i
- case 1: Pixel.check : Schrittweite.setText("1")
- case 2: printlog "#114551# Loop, if Step greater than object size"
- case 3: Pixel.UnCheck : Schrittweite.typeKeys ("<PageDown>")
- case 4: printlog "#114551# Loop, if Step greater than object size"
- end select
- sFormatTextDrawAnimation
- next i
- end if
- if (n > 1) then
- '/// test all Delay ///'
- for i = 1 to 3
- printlog "" + i
- select case i
- case 1: Automatisch.check
- case 2: Automatisch.UnCheck : Verzoegerung.setText("1")
- case 3: Verzoegerung.typeKeys ("<PageUp>")
- end select
- sFormatTextDrawAnimation
- next i
- end if
- next n
- TabLauftext.OK
+ if ((n > 1) AND (n < 5)) then
+ printlog "test all Start/End Text visibility"
+ for i = 1 to 4
+ printlog "" + i
+ select case i
+ case 1: TextSichtbarBeimStarten.check : TextSichtbarBeimBeenden.uncheck
+ case 2: TextSichtbarBeimBeenden.check
+ case 3: TextSichtbarBeimStarten.uncheck
+ case 4: TextSichtbarBeimBeenden.uncheck
+ end select
+ sFormatTextDrawAnimation
+ next i
+ end if
+ if ((n > 1) AND (n < 5)) then
+ printlog "test all Animation cycles"
+ for i = 1 to 3
+ printlog "" + i
+ select case i
+ case 1: Endlos.check
+ case 2: Endlos.UnCheck : Anzahl.typeKeys ("<PageUp>")
+ case 3: If Endlos.IsChecked = true then
+ QaErrorLog "#i74067# - Checkbox checked when it shouldn't have been."
+ Endlos.UnCheck
+ end if
+ Anzahl.setText ("1")
+ end select
+ sFormatTextDrawAnimation
+ next i
+ end if
+ if (n > 2) then
+ printlog "test all Increment"
+ for i = 1 to 4
+ printlog "" + i
+ select case i
+ case 1: Pixel.check : Schrittweite.setText("1")
+ case 2: printlog "#114551# Loop, if Step greater than object size"
+ case 3: Pixel.UnCheck : Schrittweite.typeKeys ("<PageDown>")
+ case 4: printlog "#114551# Loop, if Step greater than object size"
+ end select
+ sFormatTextDrawAnimation
+ next i
+ end if
+ if (n > 1) then
+ printlog "test all Delay"
+ for i = 1 to 3
+ printlog "" + i
+ select case i
+ case 1: Automatisch.check
+ case 2: Automatisch.UnCheck : Verzoegerung.setText("1")
+ case 3: Verzoegerung.typeKeys ("<PageUp>")
+ end select
+ sFormatTextDrawAnimation
+ next i
+ end if
+ next n
+ TabLauftext.OK
Call hCloseDocument
endcase 'tiFormatText
'-------------------------------------------------------------------------------
testcase tdFormatLayer
- '/// open application ///'
+ printlog "open application"
Call hNewDocument
- '/// Edit->Layer->Insert (in DRAW also via Insert->Layer) ///'
+ printlog "Edit->Layer->Insert (in DRAW also via Insert->Layer)"
InsertLayer
- Kontext "EbeneEinfuegenDlg"
- EbenenName.SetText " Test 4"
- LayerTitle.SetText " Test no 4"
- LayerDescription.SetText " This is the Description of the Layer."
- EbeneEinfuegenDlg.OK
+ Kontext "EbeneEinfuegenDlg"
+ EbenenName.SetText " Test 4"
+ LayerTitle.SetText " Test no 4"
+ LayerDescription.SetText " This is the Description of the Layer."
+ EbeneEinfuegenDlg.OK
- '/// Edit->Layer->Modify (in DRAW also via Format->Layer)///'
+ printlog "Edit->Layer->Modify (in DRAW also via Format->Layer)"
FormatLayer
- Kontext "EbeneAendernDlg"
- if EbenenName.GetText = " Test 4" Then
- EbenenName.SetText "Layer 5"
- end if
- if LayerTitle.GetText = " Test no 4" Then
- LayerTitle.SetText "Layer test 5"
- end if
- if LayerDescription.GetText = " This is the Description of the Layer." Then
- LayerDescription.SetText " This is the changed Description of the Layer."
- end if
+ Kontext "EbeneAendernDlg"
+ if EbenenName.GetText = " Test 4" Then
+ EbenenName.SetText "Layer 5"
+ end if
+ if LayerTitle.GetText = " Test no 4" Then
+ LayerTitle.SetText "Layer test 5"
+ end if
+ if LayerDescription.GetText = " This is the Description of the Layer." Then
+ LayerDescription.SetText " This is the changed Description of the Layer."
+ end if
- Sichtbar.Check
- Druckbar.Check
- Gesperrt.Check
- EbeneAendernDlg.OK
+ Sichtbar.Check
+ Druckbar.Check
+ Gesperrt.Check
+ EbeneAendernDlg.OK
- '/// Edit->Layer->Modify (in DRAW also via Format->Layer)///'
+ printlog "Edit->Layer->Modify (in DRAW also via Format->Layer)"
FormatLayer
- Kontext "EbeneAendernDlg"
- if EbenenName.GetText <> "Layer 5" Then
- WarnLog " Name-Value either didn't change at all, or was empty. Expected: 'Layer 5', but was: " + EbenenName.GetText
- end if
- if LayerTitle.GetText <> "Layer test 5" Then
- WarnLog " Title-Value either didn't change at all, or was empty. Expected: 'Layer test 5', but was: " + LayerTitle.GetText
- end if
- if LayerDescription.GetText <> " This is the changed Description of the Layer." Then
- WarnLog " Description-Value either didn't change at all, or was empty. Expected: ' This is the changed Description of the Layer.', but was: " + LayerDescription.GetText
- end if
-
- if Sichtbar.IsChecked=False Then
- WarnLog " Value changed: visible"
- end if
- if Druckbar.IsChecked=False Then
- WarnLog " Value changed: printable"
- end if
- if Gesperrt.IsChecked=False then
- WarnLog " Value changed: locked"
- end if
- EbeneAendernDlg.OK
+ Kontext "EbeneAendernDlg"
+ if EbenenName.GetText <> "Layer 5" Then
+ WarnLog " Name-Value either didn't change at all, or was empty. Expected: 'Layer 5', but was: " + EbenenName.GetText
+ end if
+ if LayerTitle.GetText <> "Layer test 5" Then
+ WarnLog " Title-Value either didn't change at all, or was empty. Expected: 'Layer test 5', but was: " + LayerTitle.GetText
+ end if
+ if LayerDescription.GetText <> " This is the changed Description of the Layer." Then
+ WarnLog " Description-Value either didn't change at all, or was empty. Expected: ' This is the changed Description of the Layer.', but was: " + LayerDescription.GetText
+ end if
- '/// close application ///'
+ if Sichtbar.IsChecked=False Then
+ WarnLog " Value changed: visible"
+ end if
+ if Druckbar.IsChecked=False Then
+ WarnLog " Value changed: printable"
+ end if
+ if Gesperrt.IsChecked=False then
+ WarnLog " Value changed: locked"
+ end if
+ EbeneAendernDlg.OK
+
+ printlog "close application"
Call hCloseDocument
endcase 'tdFormatLayer
@@ -326,29 +324,29 @@ testcase tdFormatConnector
end if
Call hNewDocument
- '/// insert connector ///
- kontext "Connectorsbar"
- if Connectorsbar.Exists then
- Connectorsbar.Close
- end if
+ printlog "insert connector"
+ kontext "Connectorsbar"
+ if Connectorsbar.Exists then
+ Connectorsbar.Close
+ end if
- kontext "Toolbar"
- Sleep (1)
- try
- Verbinder.TearOff ' insert connector
- catch
- warnlog "bug for GH from TBO; .tearoff doesn't tell success"
- endcatch
+ kontext "Toolbar"
+ Sleep (1)
+ try
+ Verbinder.TearOff ' insert connector
+ catch
+ warnlog "bug for GH from TBO; .tearoff doesn't tell success"
+ endcatch
kontext "Connectorsbar"
Verbinder.click
gMouseMove ( 10,10,30,30)
Call hCloseDocument
- '/// Open file with a finished scenario ///'
- hFileOpen ConvertPath (gTesttoolPath + "graphics\required\input\FormatConnector." + ExtensionString)
+ printlog "Open file with a finished scenario"
+ hFileOpen ConvertPath (gTesttoolPath + "graphics\required\input\FormatConnector." + ExtensionString)
sleep (1)
- '/// Check if the document is writable ///'
+ printlog "Check if the document is writable"
if fIsDocumentWritable = false then
' Make the document writable and check if it's succesfull
if fMakeDocumentWritable = false then
@@ -358,83 +356,84 @@ testcase tdFormatConnector
end if
gMouseClick 1,1
- '/// Press TAB three times to select the connector. ///'
+ printlog "Press TAB three times to select the connector."
hTypekeys "<TAB>"
hTypekeys "<TAB>"
hTypekeys "<TAB>"
WaitSlot (1000)
- hTypeKeys "<SHIFT F10>" 'OpenContextMenu(true)
- sleep (2)
- hMenuSelectNr(2) ' Connector
- sleep (1)
+ printlog "OpenContextMenu(true)"
+ hTypeKeys "<SHIFT F10>"
+ sleep (3)
+ printlog "Select Connector"
+ hMenuSelectNr(2)
Kontext "Verbinder"
- Typ.Select 2 ' the one with 2 from 3 posibilities to set a value...
+ Typ.Select 2 ' the one with 2 from 3 posibilities to set a value...
Sleep (1)
- AnfangHorizontal.SetText "1"
+ AnfangHorizontal.SetText "1"
+ Verbinder.TypeKeys "<TAB>"
+ AnfangVertikal.SetText "1"
+ Verbinder.TypeKeys "<TAB>"
+ EndeHorizontal.SetText "1"
+ Verbinder.TypeKeys "<TAB>"
+ EndeVertikal.SetText "1"
+ Verbinder.TypeKeys "<TAB>"
+ printlog EndeVertikal.getText
+ try
+ Linie1.SetText "10"
Verbinder.TypeKeys "<TAB>"
- AnfangVertikal.SetText "1"
+ sTemp = Linie1.getText
+ sUnit = GetMeasUnit(sTemp)
+ cDecSep = GetDecimalSeperator(sTemp)
+ catch
+ PrintLog " Lineoffset not activated -> you have to choose another linetype: 1"
+ endcatch
+ try
+ Linie2.SetText "10"
Verbinder.TypeKeys "<TAB>"
- EndeHorizontal.SetText "1"
+ catch
+ PrintLog " Lineoffset not activated -> you have to choose another linetype: 2"
+ endcatch
+ try
+ Linie3.SetText "10"
Verbinder.TypeKeys "<TAB>"
- EndeVertikal.SetText "1"
- Verbinder.TypeKeys "<TAB>"
- printlog EndeVertikal.getText
- try
- Linie1.SetText "10"
- Verbinder.TypeKeys "<TAB>"
- sTemp = Linie1.getText
- sUnit = GetMeasUnit(sTemp)
- cDecSep = GetDecimalSeperator(sTemp)
- catch
- PrintLog " Lineoffset not activated -> you have to choose another linetype: 1"
- endcatch
- try
- Linie2.SetText "10"
- Verbinder.TypeKeys "<TAB>"
- catch
- PrintLog " Lineoffset not activated -> you have to choose another linetype: 2"
- endcatch
- try
- Linie3.SetText "10"
- Verbinder.TypeKeys "<TAB>"
- catch
- PrintLog " Lineoffset not activated -> you have to choose another linetype: 3 when will this be enabled ?"
- endcatch
+ catch
+ PrintLog " Lineoffset not activated -> you have to choose another linetype: 3 when will this be enabled ?"
+ endcatch
Verbinder.OK
FormatConnector
- Kontext "Verbinder"
- sTemp = AnfangHorizontal.GetText
+ Kontext "Verbinder"
+ sTemp = AnfangHorizontal.GetText
- if fCompareTwoValues(sTemp, "1"+cDecSep+"00"+sUnit) Then
- WarnLog " value not changed"
- printlog "AnfangHorizontal = is '" + sTemp + "' should: '"+"1"+cDecSep+"00"+sUnit+"'"
- end if
- if fCompareTwoValues(AnfangVertikal.GetText, "1"+cDecSep+"00"+sUnit) Then
- WarnLog " value not changed"
- printlog "AnfangVertikal.GetText = " + AnfangVertikal.GetText
- end if
- if fCompareTwoValues(EndeHorizontal.GetText, "1"+cDecSep+"00"+sUnit) Then
- WarnLog " value not changed"
- printlog "EndeHorizontal.GetText = " + EndeHorizontal.GetText
- end if
- if fCompareTwoValues(EndeVertikal.GetText, "1"+cDecSep+"00"+sUnit) Then
- WarnLog " value not changed"
- printlog "EndeHorizontal.GetText = " + EndeHorizontal.GetText
- end if
+ if fCompareTwoValues(sTemp, "1"+cDecSep+"00"+sUnit) Then
+ WarnLog " value not changed"
+ printlog "AnfangHorizontal = is '" + sTemp + "' should: '"+"1"+cDecSep+"00"+sUnit+"'"
+ end if
+ if fCompareTwoValues(AnfangVertikal.GetText, "1"+cDecSep+"00"+sUnit) Then
+ WarnLog " value not changed"
+ printlog "AnfangVertikal.GetText = " + AnfangVertikal.GetText
+ end if
+ if fCompareTwoValues(EndeHorizontal.GetText, "1"+cDecSep+"00"+sUnit) Then
+ WarnLog " value not changed"
+ printlog "EndeHorizontal.GetText = " + EndeHorizontal.GetText
+ end if
+ if fCompareTwoValues(EndeVertikal.GetText, "1"+cDecSep+"00"+sUnit) Then
+ WarnLog " value not changed"
+ printlog "EndeHorizontal.GetText = " + EndeHorizontal.GetText
+ end if
- Zaehler = Typ.GetItemCount
- for i = 1 to Zaehler
- Typ.Select i
- SetClipboard Typ.GetSelText
- Verbinder.OK
- FormatConnector
- Kontext "Verbinder"
- if GetClipboardText <> Typ.GetSelText Then
- WarnLog " Selection not saved. Was: " + Typ.GetSelText + " . But should have been: " +GetClipboardText
- end if
- next i
+ Zaehler = Typ.GetItemCount
+ for i = 1 to Zaehler
+ Typ.Select i
+ SetClipboard Typ.GetSelText
+ Verbinder.OK
+ FormatConnector
+ Kontext "Verbinder"
+ if GetClipboardText <> Typ.GetSelText Then
+ WarnLog " Selection not saved. Was: " + Typ.GetSelText + " . But should have been: " +GetClipboardText
+ end if
+ next i
Verbinder.OK
Call hCloseDocument
@@ -452,7 +451,6 @@ testcase tiFormatPositionAndSize
printlog "New impress doc"
Call hNewDocument
WaitSlot (3000)
- printlog "RECTANGLE-----1/2"
printlog "create rectangle"
Call hRechteckErstellen (20,20,70,30)
WaitSlot (1000)
@@ -460,119 +458,119 @@ printlog "New impress doc"
WaitSlot (1000)
printlog "Format-position and size"
ContextPositionAndSize
- WaitSlot (1000)
- Kontext
- printlog "TabPositionAndSize"
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- printlog "put x and y position into clipboard"
- printlog "x = " & PositionX.GetText
- printlog "y = " & PositionY.GetText
- SetClipboard (PositionX.GetText + PositionY.GetText)
- TabPositionAndSize.OK
+ WaitSlot (1000)
+ Kontext
+ printlog "TabPositionAndSize"
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ printlog "put x and y position into clipboard"
+ printlog "x = " & PositionX.GetText
+ printlog "y = " & PositionY.GetText
+ SetClipboard (PositionX.GetText + PositionY.GetText)
+ TabPositionAndSize.OK
WaitSlot (1000)
printlog "move rectangle down and right"
hTypeKeys "<DOWN>",10
hTypeKeys "<RIGHT>",10
printlog "open PositionAndSize"
ContextPositionAndSize
- WaitSlot (1000)
- Kontext
- printlog "TabPositionAndSize"
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- printlog "control position changes with clipboard content"
- if (PositionX.GetText + PositionY.GetText) = GetClipboardText Then WarnLog "Der Dialog hat die Positionsaenderung nicht registriert"
- printlog "set position of rectange using the edit fields"
- PositionX.SetText "2"
- x=PositionX.GetText
- PositionY.SetText "2"
- y=PositionY.GetText
- printlog "check protect"
- ProtectPosition.Check
- TabPositionAndSize.OK
+ WaitSlot (1000)
+ Kontext
+ printlog "TabPositionAndSize"
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ printlog "control position changes with clipboard content"
+ if (PositionX.GetText + PositionY.GetText) = GetClipboardText Then WarnLog "Der Dialog hat die Positionsaenderung nicht registriert"
+ printlog "set position of rectange using the edit fields"
+ PositionX.SetText "2"
+ x=PositionX.GetText
+ PositionY.SetText "2"
+ y=PositionY.GetText
+ printlog "check protect"
+ ProtectPosition.Check
+ TabPositionAndSize.OK
WaitSlot (1000)
ContextPositionAndSize
- WaitSlot (1000)
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- printlog "check if values are correct"
- if PositionX.GetText = x And PositionY.GetText = y Then PrintLog " Values could be changed"
- printlog "check if protect works"
- if PositionX.GetText<> x Then
- WarnLog "Protect does not work"
- else
- PrintLog "Protext works, X axis checked"
- end if
- if PositionY.GetText<> y Then
- WarnLog "Protect does not work"
- else
- PrintLog " Protext does work, checked y axis"
- end if
- printlog "uncheck protect"
- ProtectPosition.UnCheck
- TabPositionAndSize.OK
+ WaitSlot (1000)
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ printlog "check if values are correct"
+ if PositionX.GetText = x And PositionY.GetText = y Then PrintLog " Values could be changed"
+ printlog "check if protect works"
+ if PositionX.GetText<> x Then
+ WarnLog "Protect does not work"
+ else
+ PrintLog "Protext works, X axis checked"
+ end if
+ if PositionY.GetText<> y Then
+ WarnLog "Protect does not work"
+ else
+ PrintLog " Protext does work, checked y axis"
+ end if
+ printlog "uncheck protect"
+ ProtectPosition.UnCheck
+ TabPositionAndSize.OK
WaitSlot (1000)
ContextPositionAndSize
- WaitSlot (1000)
- Kontext
- printlog "TabPositionAndSize"
- WaitSlot (1000)
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- KeepRatio.UnCheck
- printlog "set width to 10"
- WaitSlot (1000)
- Width.SetText "10"
- printlog "put value into a variable"
- WaitSlot (1000)
- b=Width.GetText
- printlog "Width is " & b
- SetClipboard Width.GetText
- '/// set heigth to 5 ///'
- Height.SetText "5"
- printlog "put value into variable"
- WaitSlot (1000)
- h=Height.GetText
- printlog "Height is " & h
- printlog "check protect"
- ProtectPosition.Check
- printlog "close dialog"
- TabPositionAndSize.OK
+ WaitSlot (1000)
+ Kontext
+ printlog "TabPositionAndSize"
+ WaitSlot (1000)
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ KeepRatio.UnCheck
+ printlog "set width to 10"
+ WaitSlot (1000)
+ Width.SetText "10"
+ printlog "put value into a variable"
+ WaitSlot (1000)
+ b=Width.GetText
+ printlog "Width is " & b
+ SetClipboard Width.GetText
+ printlog "set heigth to 5"
+ Height.SetText "5"
+ printlog "put value into variable"
+ WaitSlot (1000)
+ h=Height.GetText
+ printlog "Height is " & h
+ printlog "check protect"
+ ProtectPosition.Check
+ printlog "close dialog"
+ TabPositionAndSize.OK
WaitSlot (1000)
ContextPositionAndSize
- WaitSlot (1000)
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- WaitSlot (2000)
- printlog "control size changes"
- printlog "Width value is: " & Width.GetText
- printlog "Value from Clipboard is: " & GetClipboardText
- if Width.GetText = GetClipboardText Then
- PrintLog " Size of rectangle could be changed. It is = " + Width.GetText + " but it should be = " + b
- else
- WarnLog " Controls for height and width do not work"
- end if
- printlog "Uncheck the Position-Protection, so we can work with this window."
- if ProtectPosition.isChecked = FALSE then
- printlog "Should be checked since it was checked just 16 rows ago"
- ErrorLog "ProtectPosition was not checked - why?"
- else
- ProtectPosition.Uncheck
- end if
+ WaitSlot (1000)
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ WaitSlot (2000)
+ printlog "control size changes"
+ printlog "Width value is: " & Width.GetText
+ printlog "Value from Clipboard is: " & GetClipboardText
+ if Width.GetText = GetClipboardText Then
+ PrintLog " Size of rectangle could be changed. It is = " + Width.GetText + " but it should be = " + b
+ else
+ WarnLog " Controls for height and width do not work"
+ end if
+ printlog "Uncheck the Position-Protection, so we can work with this window."
+ if ProtectPosition.isChecked = FALSE then
+ printlog "Should be checked since it was checked just 16 rows ago"
+ ErrorLog "ProtectPosition was not checked - why?"
+ else
+ ProtectPosition.Uncheck
+ end if
- KeepRatio.Check
- printlog "raise value for width"
- Width.More 5
- if Height.GetText = h Then
- WarnLog " Keep ratio does not work properly"
- else
- PrintLog " Keep ratio does work"
- KeepRatio.UnCheck
- end if
- TabPositionAndSize.OK
+ KeepRatio.Check
+ printlog "raise value for width"
+ Width.More 5
+ if Height.GetText = h Then
+ WarnLog " Keep ratio does not work properly"
+ else
+ PrintLog " Keep ratio does work"
+ KeepRatio.UnCheck
+ end if
+ TabPositionAndSize.OK
WaitSlot (2000)
gMouseClick 90,90
WaitSlot (2000)
@@ -582,107 +580,107 @@ printlog "New impress doc"
WaitSlot (2000)
printlog "Format-Postion and Size"
FormatPositionAndSize
- WaitSlot (1000)
- Kontext
- printlog "TabPositionAndSize"
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- printlog "default value ?: width :-----"+Width.IsEnabled
- printlog "check fit width to text"
- if Width.IsEnabled then FitWidthText.Check
- if Width.IsEnabled = True Then
- WarnLog " Fit width does not work"
- else
- PrintLog " Fit width does work"
- end if
- printlog "fit heigth to text"
- FitHeightText.Check
- if Height.IsEnabled = True Then
- WarnLog " fit heigth doe not work"
- else
- PrintLog " fit heigth does work"
- end if
- ' PrintLog " Fit width to text active: " + FitWidthText.IsChecked
- ' PrintLog " Fit heigth to text active: " + FitHeightText.IsChecked
- printlog "uncheck fit width to text"
- FitWidthText.UnCheck
- printlog "uncheck fit heigth to text"
- FitHeightText.Uncheck
- TabPositionAndSize.OK
+ WaitSlot (1000)
+ Kontext
+ printlog "TabPositionAndSize"
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ printlog "default value ?: width :-----"+Width.IsEnabled
+ printlog "check fit width to text"
+ if Width.IsEnabled then FitWidthText.Check
+ if Width.IsEnabled = True Then
+ WarnLog " Fit width does not work"
+ else
+ PrintLog " Fit width does work"
+ end if
+ printlog "fit heigth to text"
+ FitHeightText.Check
+ if Height.IsEnabled = True Then
+ WarnLog " fit heigth doe not work"
+ else
+ PrintLog " fit heigth does work"
+ end if
+ ' PrintLog " Fit width to text active: " + FitWidthText.IsChecked
+ ' PrintLog " Fit heigth to text active: " + FitHeightText.IsChecked
+ printlog "uncheck fit width to text"
+ FitWidthText.UnCheck
+ printlog "uncheck fit heigth to text"
+ FitHeightText.Uncheck
+ TabPositionAndSize.OK
WaitSlot (1000)
hTypeKeys "<escape>",2
hTypeKeys "<TAB>",2
WaitSlot (1000)
ContextPositionAndSize
- WaitSlot (1000)
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- printlog "check x-position of textbox"
- SetClipboard PositionX.GetText
- WaitSlot (1000)
- Kontext
- printlog "set rotation angle to 50 and position x and y to 1"
- Active.SetPage TabDrehung
- Kontext "TabDrehung"
- PositionX.SetText "1"
- PositionY.SetText "1"
- Winkel.SetText "50"
- w=Winkel.GetText
- TabDrehung.OK
+ WaitSlot (1000)
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ printlog "check x-position of textbox"
+ SetClipboard PositionX.GetText
+ WaitSlot (1000)
+ Kontext
+ printlog "set rotation angle to 50 and position x and y to 1"
+ Active.SetPage TabDrehung
+ Kontext "TabDrehung"
+ PositionX.SetText "1"
+ PositionY.SetText "1"
+ Winkel.SetText "50"
+ w=Winkel.GetText
+ TabDrehung.OK
WaitSlot (3000)
printlog "check position of manipulated textbox"
ContextPositionAndSize
- WaitSlot (3000)
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- if PositionX = GetClipboardText Then PrintLog " Position changed due to rotation"
- Kontext
- Active.SetPage TabDrehung
- Kontext "TabDrehung"
- WaitSlot (1000)
- printlog "check rotation angle"
- if Winkel.GetText = w Then PrintLog " Object rotated"
- TabDrehung.OK
+ WaitSlot (3000)
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ if PositionX = GetClipboardText Then PrintLog " Position changed due to rotation"
+ Kontext
+ Active.SetPage TabDrehung
+ Kontext "TabDrehung"
+ WaitSlot (1000)
+ printlog "check rotation angle"
+ if Winkel.GetText = w Then PrintLog " Object rotated"
+ TabDrehung.OK
printlog "RECTANGLE-----2/2"
printlog "create rectangle"
Call hRechteckErstellen (10,60,70,90)
WaitSlot (2000)
ContextPositionAndSize
- WaitSlot (1000)
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- printlog "put x-axis postion of rectangle into clipboard"
- SetClipboard PositionX.GetText
- Kontext
- printlog "set slant angle to 5"
- Active.SetPage TabSchraegstellen
- Kontext "TabSchraegstellen"
- WaitSlot (1000)
- printlog "set radius to 5"
- Radius.SetText "5"
- r=Radius.GetText
- Winkel.SetText w
- TabSchraegstellen.OK
+ WaitSlot (1000)
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ printlog "put x-axis postion of rectangle into clipboard"
+ SetClipboard PositionX.GetText
+ Kontext
+ printlog "set slant angle to 5"
+ Active.SetPage TabSchraegstellen
+ Kontext "TabSchraegstellen"
+ WaitSlot (1000)
+ printlog "set radius to 5"
+ Radius.SetText "5"
+ r=Radius.GetText
+ Winkel.SetText w
+ TabSchraegstellen.OK
WaitSlot (1000)
ContextPositionAndSize
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- if PositionX <> GetClipboardText Then PrintLog " Object changed position due to scaling"
- printlog "Before we change tab, we set the Position-marker back to checked "
- ProtectPosition.Check
- Kontext
- printlog "check slant angle and radius"
- Active.SetPage TabSchraegstellen
- Kontext "TabSchraegstellen"
- if Radius.GetText = r Then PrintLog " Cornwer radius changed"
- if Winkel.GetText =w Then PrintLog " Object rotated over 45°"
- TabSchraegstellen.OK
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ if PositionX <> GetClipboardText Then PrintLog " Object changed position due to scaling"
+ printlog "Before we change tab, we set the Position-marker back to checked "
+ ProtectPosition.Check
+ Kontext
+ printlog "check slant angle and radius"
+ Active.SetPage TabSchraegstellen
+ Kontext "TabSchraegstellen"
+ if Radius.GetText = r Then PrintLog " Cornwer radius changed"
+ if Winkel.GetText =w Then PrintLog " Object rotated over 45°"
+ TabSchraegstellen.OK
Call hCloseDocument
endcase 'tiFormatPositionAndSize
@@ -702,64 +700,76 @@ testcase tiFormat3D_Effekte
Dim Posi as string
Call hNewDocument
- Call sSelectEmptyLayout
+ Call sSelectEmptyLayout
printlog "new document"
'-----------------------------------RECTANGLE------------------------------------------------------
- Call hRechteckErstellen (20,20,60,70) '/// create rectangle ///'
+ printlog "create rectangle"
+ Call hRechteckErstellen (20,20,60,70)
WaitSlot (1000)
- ContextPositionAndSize '/// get position and size of rectangle ///'
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- PositionX.SetText "5"
- X=PositionX.GetText
- printlog "--- created RECTANGLE; xPosition @ "+ x
- TabPositionAndSize.OK
- ContextConvertInto3D '/// convert rectangle into 3d ///'
+ printlog "get position and size of rectangle"
+ ContextPositionAndSize
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ PositionX.SetText "5"
+ X=PositionX.GetText
+ printlog "--- created RECTANGLE; xPosition @ "+ x
+ TabPositionAndSize.OK
+ printlog "convert rectangle into 3d"
+ ContextConvertInto3D
WaitSlot (1000)
Kontext "Drei_D_Effekte"
if Drei_D_Effekte.exists(3) then
qaerrorlog " The 3D-Effects-dialogue was open. Check why."
else
- Format3D_Effects '/// open 3d flyer///'
+ printlog "open 3d flyer"
+ Format3D_Effects
end if
- try
- if Perspektive.isvisible then
- Perspektive.Click '/// check perspective ///'
- else
- warnlog "why not in draw?"
- end if
- catch
- warnlog "something is wrong mit perspective"
- endcatch
- Zuweisen.Click '/// assign perspective ///'
- Kontext "DocumentImpress"
- hTypeKeys "<MOD1 A>"
- ContextPositionAndSize '/// check position and size ///'
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- if PositionX.GetText = X Then
- printlog "- Perspective acitvated x: "+PositionX.GetText
- else
- warnlog "- Perspective seems to have a problem, x value has changed!"
- end if
- TabPositionAndSize.OK
- Kontext "Drei_D_Effekte"
- Aktualisieren.Click
- Drei_D_Effekte.Close
- EditSelectAll '/// delete rectangle ///'
+ try
+ if Perspektive.isvisible then
+ printlog "check perspective"
+ Perspektive.Click
+ else
+ warnlog "why not in draw?"
+ end if
+ catch
+ warnlog "something is wrong mit perspective"
+ endcatch
+ printlog "assign perspective"
+ Zuweisen.Click
+ Kontext "DocumentImpress"
+ hTypeKeys "<MOD1 A>"
+ printlog "check position and size"
+ ContextPositionAndSize
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ if PositionX.GetText = X Then
+ printlog "- Perspective acitvated x: "+PositionX.GetText
+ else
+ warnlog "- Perspective seems to have a problem, x value has changed!"
+ end if
+ TabPositionAndSize.OK
+ Kontext "Drei_D_Effekte"
+ Aktualisieren.Click
+ Drei_D_Effekte.Close
+ EditSelectAll
+ printlog "delete rectangle"
hTypeKeys "<DELETE>"
'-----------------------------------RECTANGLE------------------------------------------------------
- hRechteckErstellen (20,20,60,70) '/// create new rectangle ///'
+ printlog "create new rectangle"
+ hRechteckErstellen (20,20,60,70)
printlog "--- created RECTANGLE 2"
- Format3D_Effects '/// open 3d flyer ///'
+ printlog "open 3d flyer"
+ Format3D_Effects
Kontext "Drei_D_Effekte"
- Rotationskoerper.Click '/// create lathe object ///'
+ printlog "create lathe object"
+ Rotationskoerper.Click
WaitSlot (1000)
Kontext "DocumentImpress"
- ContextPositionAndSize '/// check position and size ///'
+ printlog "check position and size"
+ ContextPositionAndSize
Kontext
Active.SetPage TabPositionAndSize
Kontext "TabPositionAndSize"
@@ -770,14 +780,17 @@ testcase tiFormat3D_Effekte
end if
TabPositionAndSize.OK
EditSelectAll
- hTypeKeys "<DELETE>" '/// delete object ///'
+ printlog "delete object"
+ hTypeKeys "<DELETE>"
Sleep (1)
'-----------------------------------RECTANGLE------------------------------------------------------
- hRechteckErstellen (20,20,60,70) '/// create rectangle ///'
+ printlog "create rectangle"
+ hRechteckErstellen (20,20,60,70)
printlog "--- created RECTANGLE 3"
Kontext "Drei_D_Effekte"
WaitSlot (1000)
- In_3D_Umwandeln.Click '/// convert to 3d in 3d flyer ///'
+ printlog "convert to 3d in 3d flyer"
+ In_3D_Umwandeln.Click
WaitSlot (2000)
gMouseClick 40,40
qaerrorlog "#i92910: automation: crash when executing tiFormat3D_Effekte in test g_format"
@@ -799,27 +812,36 @@ testcase tiFormat3D_Effekte
'end select
EditSelectAll
- hTypeKeys "<DELETE>" '/// delete object ///'
+ printlog "delete object"
+ hTypeKeys "<DELETE>"
'-----------------------------------ZYLINDER------------------------------------------------------
Sleep (1)
- printlog "--- create CYLINDER"
- WL_SD_Zylinder '/// create cylinder ///'
- gMousemove 30,30,80,80 '/// This affects the Vertical-value down to 15 ///'
+ printlog "create CYLINDER"
+ WL_SD_Zylinder
+ printlog "This affects the Vertical-value down to 15"
+ gMousemove 30,30,80,80
Sleep (1)
hTypeKeys "<ESC>"
Kontext "Drei_D_Effekte"
- Geometrie.Click '/// geometry ///'
+ printlog " geometry"
+ Geometrie.Click
WaitSlot (1000)
' Endwinkel.More
- Vert=Vertikale_Segmente.GetText '/// get value for vertical segments (default) ///'
- Hor =Horizontale_Segmente.GetText '/// get value for horizontal segments (default) ///'
- Rund=Kantenrundung.GetText '/// get value for edge rounding ///'
- Skal=Tiefenskalierung.GetText '/// get value for scale ///'
- Tief=Tiefe.GetText '/// get value for depth ///'
- Winkel=Endwinkel.GetText '/// get value for angle ///'
+ printlog "get value for vertical segments (default)"
+ Vert=Vertikale_Segmente.GetText
+ printlog "get value for horizontal segments (default)"
+ Hor =Horizontale_Segmente.GetText
+ printlog "get value for edge rounding"
+ Rund=Kantenrundung.GetText
+ printlog "get value for scale"
+ Skal=Tiefenskalierung.GetText
+ printlog "get value for depth"
+ Tief=Tiefe.GetText
+ printlog "get value for angle"
+ Winkel=Endwinkel.GetText
- '/// Check if every entry has a value <> "" -> an init value is shown. ///'
+ printlog "Check if every entry has a value <> "" -> an init value is shown."
if Vert ="" then warnlog "Vertical Segment has no init value"
if Hor ="" then warnlog "Horizontal Segment has no init value"
if Rund ="" then warnlog "Rounded edges has no init value"
@@ -827,49 +849,54 @@ testcase tiFormat3D_Effekte
if Tief ="" then warnlog "Depth has no init value"
if Winkel="" then printlog "Rotation angle has no init value"
- '/// Go back to the 3d-effects-dialogue and change the value for the cylinder ///'
-
- hTypeKeys "<ESC>" '/// Deselect object and check if 3d controller has default values again ///'
+ printlog "Go back to the 3d-effects-dialogue and change the value for the cylinder"
+ hTypeKeys "<ESC>"
Kontext "Drei_D_Effekte"
- '/// Check if value for vertical segments has changed in 3d controller ///'
+ printlog "Check if value for vertical segments has changed in 3d controller"
if Vertikale_Segmente.GetText = Vert Then
Printlog "- Vertical segment value read from object's properties in the 3d flyer"
else
Warnlog "- 3D flyer could not read vertical segment information from object. It is = '"+ Vertikale_Segmente.GetText + "' but should be = '" + Vert + "'"
end if
- if Horizontale_Segmente.GetText = Hor Then '/// check if value for horizontal segments has changed ///'
+ printlog "check if value for horizontal segments has changed"
+ if Horizontale_Segmente.GetText = Hor Then
Printlog "- Horizontal segment value read from object's properties in the 3d flyer"
else
Warnlog "- 3D flyer not be able to read horizonal segment information from object. It is = '"+ Horizontale_Segmente.GetText + "' but should be = '" + Hor + "'"
end if
- if Kantenrundung.GetText = Rund Then '/// check if value for edge rounding has changed ///'
+ printlog "check if value for edge rounding has changed"
+ if Kantenrundung.GetText = Rund Then
Printlog "- Rounded edges works"
else
Warnlog "- Rounded edges value could not be read by the 3d flyer It is = '" + Kantenrundung.GetText + "' but should be = '" + rund + "'"
end if
- if Tiefenskalierung.GetText = Skal Then '/// check value for scale ///'
+ printlog "check value for scale"
+ if Tiefenskalierung.GetText = Skal Then
Printlog "- Scaled depth works"
else
Warnlog "- Scale depth value could not be read by the 3d flyer It is = '" + Tiefenskalierung.GetText + "' but should be = '" + skal + "'"
end if
- if Tiefe.GetText = Tief Then '/// check value for depth ///'
+ printlog "check value for depth"
+ if Tiefe.GetText = Tief Then
Printlog "- Depth value could be read by the 3d flyer"
else
Warnlog "- Depth value of object could not be read by the flyer It is = '"+ Tiefe.GetText + "' but should be = '" + tief + "'"
end if
- if Endwinkel.GetText = Winkel Then '/// check value for angle ///'
+ printlog "check value for angle"
+ if Endwinkel.GetText = Winkel Then
Printlog "- Angle value could be read by the 3d flyer"
else
Warnlog "- Angle value is not correct"
end if
- hTypeKeys "<ESC>" '/// deselect object and check if 3d controller has default values again ///'
+ printlog "deselect object and check if 3d controller has default values again"
+ hTypeKeys "<ESC>"
Kontext "Drei_D_Effekte"
Sleep (2)
Printlog "- check if 3D flyer goes back to default values if object is deselected"
@@ -882,16 +909,19 @@ testcase tiFormat3D_Effekte
hTypeKeys "<TAB>"
Kontext "Drei_D_Effekte"
- Sleep (2)
- Horizontale_Segmente.SetText "32" '/// change horizontal and vertical segments ///'
- Vertikale_Segmente.SetText "32"
- Kantenrundung.SetText "100"
- Endwinkel.Settext "300"
- Tiefenskalierung.SetText "500"
- Tiefe.SetText "100"
- Zuweisen.Click '/// assign changes ///'
+ Sleep (2)
+ printlog "change horizontal and vertical segments"
+ Horizontale_Segmente.SetText "32"
+ Vertikale_Segmente.SetText "32"
+ Kantenrundung.SetText "100"
+ Endwinkel.Settext "300"
+ Tiefenskalierung.SetText "500"
+ Tiefe.SetText "100"
+ printlog "assign changes"
+ Zuweisen.Click
- WaitSlot (1000) '/// check value changes ///'
+ printlog "check value changes"
+ WaitSlot (1000)
if Vertikale_Segmente.GetText = Vert Then Warnlog "- Default value is wrong"
if Horizontale_Segmente.GetText = Hor Then Warnlog "- Default value is wrong"
if Kantenrundung.GetText = Rund Then Warnlog "- Default value is wrong"
@@ -899,87 +929,103 @@ testcase tiFormat3D_Effekte
if Endwinkel.GetText = Winkel Then Warnlog "- Default value is wrong"
if Tiefe.GetText=Tief Then Warnlog "- Default value is wrong"
EditSelectAll
- hTypeKeys "<DELETE>" '/// delete cylinder ///'
+ printlog "delete cylinder"
+ hTypeKeys "<DELETE>"
'-----------------------------------ZYLINDER------------------------------------------------------
- WL_SD_Zylinder '/// create new cylinder ///'
+ printlog "create new cylinder"
+ WL_SD_Zylinder
gMouseMove (20,20,60,60)
WaitSlot (3000)
Kontext "Drei_D_Effekte"
- Printlog "- Change basic geometric parameters for the object"
- Printlog "Segments : Horizontal: 8; Vertical: 8; Rounded edges: 50 %"
- Horizontale_Segmente.SetText "8" '/// changing values for cylinder ///'
- Vertikale_Segmente.SetText "8"
- Kantenrundung.SetText "50 %"
- Sleep (1)
- Zuweisen.Click
+ Printlog "- Change basic geometric parameters for the object"
+ Printlog "Segments : Horizontal: 8; Vertical: 8; Rounded edges: 50 %"
+ printlog "changing values for cylinder"
+ Horizontale_Segmente.SetText "8"
+ Vertikale_Segmente.SetText "8"
+ Kantenrundung.SetText "50 %"
+ Sleep (1)
+ Zuweisen.Click
WaitSlot (2000)
gMouseClick 90,90
Sleep (2)
- EditSelectAll '/// select object ///'
+ printlog "select object"
+ EditSelectAll
WaitSlot (1000)
- Kontext "Drei_D_Effekte" '/// control if changes are done ///'
- if Horizontale_Segmente.GetText <> "8" Then Warnlog "- Horizontal segment count is not correct "+Horizontale_Segmente.GetText
- if Vertikale_Segmente.GetText <> "8" Then Warnlog "- Vertical segment count is not correct "+Vertikale_Segmente.GetText
- if Kantenrundung.GetText <> "50 %" Then Warnlog "- Value for rounded edges is not correct "+Kantenrundung.GetText
+ printlog "control if changes are done"
+ Kontext "Drei_D_Effekte"
+ if Horizontale_Segmente.GetText <> "8" Then Warnlog "- Horizontal segment count is not correct "+Horizontale_Segmente.GetText
+ if Vertikale_Segmente.GetText <> "8" Then Warnlog "- Vertical segment count is not correct "+Vertikale_Segmente.GetText
+ if Kantenrundung.GetText <> "50 %" Then Warnlog "- Value for rounded edges is not correct "+Kantenrundung.GetText
Darstellung.Click
- Zaehler=Modus.GetItemCount '/// get number of pssibole render methods ///'
+ printlog "get number of pssibole render methods"
+ Zaehler=Modus.GetItemCount
for i =1 to Zaehler
Modus.Select i
- Zuweisen.Click '/// assign every render method ///'
+ printlog "assign every render method"
+ Zuweisen.Click
gMouseClick 90,90
Sleep (1)
- EditSelectAll '/// select object ///'
+ printlog "select object"
+ EditSelectAll
Sleep (1)
Kontext "Drei_D_Effekte"
- if Modus.GetSelIndex <> i Then Warnlog "- Value for render modus did not change" '/// check if render method has changed ///'
+ printlog "check if render method has changed"
+ if Modus.GetSelIndex <> i Then Warnlog "- Value for render modus did not change"
next i
- Printlog "- Check 3d shadow and surface angle"
- Drei_DSchatten.Click '/// check 3d shadow ///'
- Papierneigung.SetText "90 degree(s)"
- vert = Papierneigung.getText
- Zuweisen.Click '/// assign shadow ///'
- gMouseClick 90,90 '/// deselect object ///'
+ Printlog "- Check 3d shadow and surface angle"
+ Drei_DSchatten.Click
+ Papierneigung.SetText "90 degree(s)"
+ vert = Papierneigung.getText
+ printlog "assign shadow"
+ Zuweisen.Click
+ printlog "deselect object"
+ gMouseClick 90,90
WaitSlot (1000)
- EditSelectAll '/// select object ///'
+ printlog "select object"
+ EditSelectAll
+ printlog "check value changes"
Kontext "Drei_D_Effekte"
- if Papierneigung.GetText <> vert Then Warnlog "- Value for surface angle is not correct" '/// check value changes ///'
- Entfernung.SetText "10" '/// set distance to 10 ///'
- Sleep (1)
- hor = Entfernung.getText
- Sleep (1)
- Zuweisen.Click
+ if Papierneigung.GetText <> vert Then Warnlog "- Value for surface angle is not correct"
+ printlog "set distance to 10"
+ Entfernung.SetText "10"
+ Sleep (1)
+ hor = Entfernung.getText
+ Sleep (1)
+ Zuweisen.Click
if Entfernung.GetText <> hor Then Warnlog "- Value for distance is not correct; should: "+hor+"; is: "+Entfernung.GetText
WaitSlot (2000)
hTypeKeys "<TAB>"
Sleep (2)
ContextPositionAndSize
- WaitSlot (2000)
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- PositionX.SetText "5,00cm"
- Posi=PositionX.GetText
- TabPositionAndSize.OK
+ WaitSlot (2000)
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ PositionX.SetText "5,00cm"
+ Posi=PositionX.GetText
+ TabPositionAndSize.OK
WaitSlot (1000)
Kontext "Drei_D_Effekte"
- Brennweite.SetText "50" '/// set focval length to 50 ///'
+ printlog "set focval length to 50"
+ Brennweite.SetText "50"
Zuweisen.Click
- ContextPositionAndSize '/// check change in position of the object ///'
- Kontext
- Active.SetPage TabPositionAndSize
- Kontext "TabPositionAndSize"
- If PositionX.GetText = Posi Then
- printlog "- Raising value for focal length has not changed optical appearence of object, ok."
- else
- warnlog "Problem with focal lenght here!"
- endif
- TabPositionAndSize.OK
+ printlog "check change in position of the object"
+ ContextPositionAndSize
+ Kontext
+ Active.SetPage TabPositionAndSize
+ Kontext "TabPositionAndSize"
+ If PositionX.GetText = Posi Then
+ printlog "- Raising value for focal length has not changed optical appearence of object, ok."
+ else
+ warnlog "Problem with focal lenght here!"
+ endif
+ TabPositionAndSize.OK
WaitSlot (1000)
Kontext "Drei_D_Effekte"
- Brennweite.SetText "5"
- Zuweisen.Click
+ Brennweite.SetText "5"
+ Zuweisen.Click
WaitSlot (1000)
EditSelectAll
WaitSlot (3000)
@@ -1008,71 +1054,78 @@ testcase tdFormatTemplates
qaerrorlog "Not yet ready."
goto endsub
- dim Zaehler as integer
- dim i as integer
- dim x as integer
- dim iWaitIndex as integer
- dim sStyleName as string
- dim bDouble as boolean
- dim sTemp(2) as string
-
- Call hNewDocument '/// new impress document ///'
-
- WaitSlot (5000)
- FormatStylesCatalog '/// format-Style catalog///'
- iWaitIndex = 0
- do while Vorlagenkatalog.NotExists AND iWaitIndex < 10
+ dim Zaehler as integer
+ dim i as integer
+ dim x as integer
+ dim iWaitIndex as integer
+ dim sStyleName as string
+ dim bDouble as boolean
+ dim sTemp(2) as string
+
+ printlog "new impress document"
+ Call hNewDocument
+
+ WaitSlot (5000)
+ printlog "format-Style catalog!"
+ FormatStylesCatalog
+ iWaitIndex = 0
+ do while Vorlagenkatalog.NotExists AND iWaitIndex < 10
sleep (1)
iWaitIndex = iWaitIndex + 1
- loop
+ loop
- Kontext "Vorlagenkatalog"
- Vorlagen.GetItemCount '/// get item count for templates ///'
- Vorlagen.Select 2 '/// select template 2 ///'
-
- if Bereich.GetItemCount = Vorlagen.GetItemCount Then '/// check if area changes when selecting a template ///'
- PrintLog " - Area did changed"
- else
- WarnLog " Number of entrees should be 2, but it is " + Bereich.GetItemCount
- end if
-
- Zaehler = Ansicht.GetItemCount 'Vorlagenliste.GetItemCount
+ Kontext "Vorlagenkatalog"
+ printlog "get item count for templates"
+ Vorlagen.GetItemCount
+ printlog "select template 2"
+ Vorlagen.Select 2
+
+ printlog "check if area changes when selecting a template"
+ if Bereich.GetItemCount = Vorlagen.GetItemCount Then
+ PrintLog " - Area did changed"
+ else
+ WarnLog " Number of entrees should be 2, but it is " + Bereich.GetItemCount
+ end if
- for i = 1 to Zaehler
- Ansicht.TypeKeys "<DOWN>" ,i
- SetClipboard Ansicht.GetSelText
+ Zaehler = Ansicht.GetItemCount 'Vorlagenliste.GetItemCount
+
+ for i = 1 to Zaehler
+ Ansicht.TypeKeys "<DOWN>" ,i
+ SetClipboard Ansicht.GetSelText
WaitSlot (2000)
- Vorlagen.Select 1
- PrintLog " "+i+": Offset: '" + Vorlagen.GetSelText+"'"
- if Bereich.GetItemCount=Vorlagen.GetItemCount Then WarnLog " Range has not changed"
- Vorlagen.Select 2
+ Vorlagen.Select 1
+ PrintLog " "+i+": Offset: '" + Vorlagen.GetSelText+"'"
+ if Bereich.GetItemCount=Vorlagen.GetItemCount Then WarnLog " Range has not changed"
+ Vorlagen.Select 2
WaitSlot (1000)
Ansicht.TypeKeys "<HOME>"
WaitSlot (1000)
- Ansicht.Select 1
+ Ansicht.Select 1
WaitSlot (1000)
- PrintLog " : Offset: '"+Vorlagen.GetSelText + "'; Opinion: '" + Ansicht.GetSelText+"'"
- Vorlagenkatalog.OK
- FormatStylesCatalog
- Kontext "Vorlagenkatalog"
- next i
+ PrintLog " : Offset: '"+Vorlagen.GetSelText + "'; Opinion: '" + Ansicht.GetSelText+"'"
+ Vorlagenkatalog.OK
+ FormatStylesCatalog
+ Kontext "Vorlagenkatalog"
+ next i
- Vorlagen.Select 2
- WaitSlot (2000)
- Vorlagen.Select 1 '/// select first template ///'
- if Neu.IsEnabled =False Then WarnLog " Button must be choosable, but is not"
- Ansicht.Select 1
- WaitSlot (1000)
- Neu.Click '/// create new template ///'
- Kontext
- Active.SetPage TabVerwalten
- Kontext "TabVerwalten"
- sStyleName = VorlagenName.GetText
- printlog " created new style: '"+sStyleName +"'"
- TabVerwalten.OK
- PrintLog " New template created"
- Kontext "Vorlagenkatalog"
- WaitSlot (1000)
+ Vorlagen.Select 2
+ WaitSlot (2000)
+ printlog "select first template"
+ Vorlagen.Select 1
+ if Neu.IsEnabled =False Then WarnLog " Button must be choosable, but is not"
+ Ansicht.Select 1
+ WaitSlot (1000)
+ printlog "create new template"
+ Neu.Click
+ Kontext
+ Active.SetPage TabVerwalten
+ Kontext "TabVerwalten"
+ sStyleName = VorlagenName.GetText
+ printlog " created new style: '"+sStyleName +"'"
+ TabVerwalten.OK
+ PrintLog " New template created"
+ Kontext "Vorlagenkatalog"
+ WaitSlot (1000)
' find newly created style, because they are alphabetical ordered :-( i have to check every entry :-(((((
Zaehler = Ansicht.GetItemCount
i=1
@@ -1122,10 +1175,11 @@ testcase tdFormatTemplates
wEnd
end if
if (i <= Zaehler) then printlog " found created entry for deleting it :-)"
- ' Ansicht.TypeKeys "<DOWN>" ,( i + 1 ) '/// control if template list has created template included ///'
+ ' Ansicht.TypeKeys "<DOWN>" ,( i + 1 ) printlog "control if template list has created template included"
WaitSlot (2000)
try
- Loeschen.Click '/// delete template ///'
+ printlog "delete template"
+ Loeschen.Click
WaitSlot (1000)
Kontext "Active"
if active.exists then
@@ -1145,7 +1199,8 @@ testcase tdFormatTemplates
UseBindings
Ansicht.Select 1
WaitSlot (1000)
- Aendern.Click '/// modify template ///'
+ printlog "modify template"
+ Aendern.Click
WaitSlot (2000)
Kontext
Active.SetPage TabSchatten
@@ -1154,8 +1209,9 @@ testcase tdFormatTemplates
TabSchatten.Cancel
WaitSlot (2000)
Kontext "Vorlagenkatalog"
-
- Verwalten.Click '/// organize templates ///'
+
+ printlog "organize templates"
+ Verwalten.Click
WaitSlot (2000)
Kontext "DVVerwalten"
DVVerwalten.OK
@@ -1166,21 +1222,27 @@ testcase tdFormatTemplates
catch
Warnlog " - Style Catalog can't close unless the Template Management-dialog is closed"
endcatch
- PrintLog " FormatStylesCatalog finished" '/// close template catalog ///'
+ PrintLog " FormatStylesCatalog finished"
WaitSlot (2000)
- FormatModifyLayout '/// format modify layout ///'
+ printlog "format modify layout"
+ FormatModifyLayout
WaitSlot (2000)
Kontext "Seitenvorlage"
- if HintergrundseiteAustauschen.IsChecked=True Then HintergrundseiteAustauschen.UnCheck '/// uncheck switch background page ///'
- Laden.Click '/// load ///'
+ printlog "uncheck switch background page"
+ if HintergrundseiteAustauschen.IsChecked=True Then HintergrundseiteAustauschen.UnCheck
+ printlog "load"
+ Laden.Click
WaitSlot (2000)
Kontext "Neu"
Neu.Cancel
- Kontext "Seitenvorlage" '/// choose a page layout ///'
+ printlog "choose a page layout"
+ Kontext "Seitenvorlage"
'Waehlen.Click
- Seitenvorlage.OK '/// close dialog ///'
-
- Call hCloseDocument '/// close document ///'
+ printlog "close dialog"
+ Seitenvorlage.OK
+
+ printlog "close document"
+ Call hCloseDocument
endcase 'tdFormatTemplates
'-------------------------------------------------------------------------------
@@ -1195,56 +1257,56 @@ testcase tiFormatAufzaehlungszeichen
Kontext "DocumentImpress"
hTextrahmenErstellen ("Hello <Return><Return>",20,20,60,60)
for i=1 to 8
- Kontext "DocumentImpress"
- gMouseClick 30,30
- EditSelectAll
- WaitSlot (1000)
- FormatNumberingBulletsDraw
- WaitSlot (2000)
- Kontext
- Active.SetPage TabBullet
- Kontext "TabBullet"
- Auswahl.TypeKeys "<Right>", i
- TabBullet.OK
- Kontext "DocumentImpress"
+ Kontext "DocumentImpress"
+ gMouseClick 30,30
+ EditSelectAll
+ WaitSlot (1000)
+ FormatNumberingBulletsDraw
+ WaitSlot (2000)
+ Kontext
+ Active.SetPage TabBullet
+ Kontext "TabBullet"
+ Auswahl.TypeKeys "<Right>", i
+ TabBullet.OK
+ Kontext "DocumentImpress"
next i
for i=1 to 8
- Kontext "DocumentImpress"
- gMouseClick 30,30
- EditSelectAll
- WaitSlot (1000)
- FormatNumberingBulletsDraw
- Kontext
- Active.SetPage TabNumerierungsart
- Kontext "TabNumerierungsart"
- Auswahl.TypeKeys "<Right>", i
- TabNumerierungsart.OK
- Kontext "DocumentImpress"
+ Kontext "DocumentImpress"
+ gMouseClick 30,30
+ EditSelectAll
+ WaitSlot (1000)
+ FormatNumberingBulletsDraw
+ Kontext
+ Active.SetPage TabNumerierungsart
+ Kontext "TabNumerierungsart"
+ Auswahl.TypeKeys "<Right>", i
+ TabNumerierungsart.OK
+ Kontext "DocumentImpress"
next i
for i=1 to 8
- Kontext "DocumentImpress"
- gMouseClick 30,30
- EditSelectAll
- FormatNumberingBulletsDraw
- Kontext
- Active.SetPage TabNumerierungsart
- Kontext "TabNumerierungsart"
- Auswahl.TypeKeys "<Right>", i
- TabNumerierungsart.OK
- Kontext "DocumentImpress"
+ Kontext "DocumentImpress"
+ gMouseClick 30,30
+ EditSelectAll
+ FormatNumberingBulletsDraw
+ Kontext
+ Active.SetPage TabNumerierungsart
+ Kontext "TabNumerierungsart"
+ Auswahl.TypeKeys "<Right>", i
+ TabNumerierungsart.OK
+ Kontext "DocumentImpress"
next i
WaitSlot (3000)
for i=1 to 29
- WaitSlot (3000)
- FormatNumberingBulletsDraw
- WaitSlot (3000)
- Kontext
- Active.SetPage TabGrafiken
- Kontext "TabGrafiken"
- sleep 1
- Auswahl.TypeKeys "<Right>", i
- TabGrafiken.OK
- Kontext "DocumentImpress"
+ WaitSlot (3000)
+ FormatNumberingBulletsDraw
+ WaitSlot (3000)
+ Kontext
+ Active.SetPage TabGrafiken
+ Kontext "TabGrafiken"
+ sleep 1
+ Auswahl.TypeKeys "<Right>", i
+ TabGrafiken.OK
+ Kontext "DocumentImpress"
next i
gMouseClick 90,90
diff --git a/testautomation/graphics/optional/includes/global/g_line.inc b/testautomation/graphics/optional/includes/global/g_line.inc
index adc573a16e48..2a6d5b315f89 100644
--- a/testautomation/graphics/optional/includes/global/g_line.inc
+++ b/testautomation/graphics/optional/includes/global/g_line.inc
@@ -43,35 +43,46 @@ testcase tiFormatLine
Dim k 'Variable fuer Transparenz (Anzahl)
Dim l
Dim ZaehlerStilLinks
-
- Call hNewDocument '/// New impress document
+
+ printlog "New impress document"
+ Call hNewDocument
sleep 3
- Call hRechteckErstellen (10,10,60,60) '/// create rectangle
+ printlog "create rectangle"
+ Call hRechteckErstellen (10,10,60,60)
sleep 2
- FormatLine '/// open Format line dialog
+ printlog "open Format line dialog"
+ FormatLine
Kontext
- Active.SetPage TabLinie '///Open TabLine Tabpage
+ printlog "Open TabLine Tabpage"
+ Active.SetPage TabLinie
Kontext "TabLinie"
sleep 2
- Stil.GetItemCount '/// Get item count for style ///'
- Farbe.GetItemCount '/// Get item count for color ///'
- Breite.More 1 '/// change value for ///'
+ printlog "Get item count for style"
+ Stil.GetItemCount
+ printlog "Get item count for color"
+ Farbe.GetItemCount
+ printlog "change value for"
+ Breite.More 1
ZaehlerStil = Stil.GetItemCount
ZaehlerFarbe = Farbe.GetItemCount
-
- for i=1 to ZaehlerStil '/// Apply every style to the rectangle ///'
- wait 10
- Stil.Select i
- wait 10
- TabLinie.OK '/// Closing dialog with ok
- ' Kontext "DocumentImpress"
- FormatLine '///Open TabLine Tabpage
- Kontext
- Active.SetPage TabLinie
- Kontext "TabLinie"
+
+ printlog "Apply every style to the rectangle"
+ for i=1 to ZaehlerStil
+ wait 10
+ Stil.Select i
+ wait 10
+ printlog "Closing dialog with ok"
+ TabLinie.OK
+ ' Kontext "DocumentImpress"
+ printlog "Open TabLine Tabpage"
+ FormatLine
+ Kontext
+ Active.SetPage TabLinie
+ Kontext "TabLinie"
next i
-
- for j=1 to ZaehlerFarbe '/// Apply every color to the rectangle///'
+
+ printlog "Apply every color to the rectangle"
+ for j=1 to ZaehlerFarbe
PrintLog "-- " + Farbe.GetSelText
wait 10
Farbe.Select j
@@ -83,38 +94,46 @@ testcase tiFormatLine
Active.SetPage TabLinie
Kontext "TabLinie"
next j
- Breite.More 3 '/// change Breite ///'
+ printlog "change Breite"
+ Breite.More 3
Breite.Less 2
for k=1 to 6
- Transparenz.More 1 '/// change tranparence///'
+ printlog "change tranparence"
+ Transparenz.More 1
next k
TabLinie.OK
'---------------------------------------
sleep 2
- EditSelectAll '/// Select all objects in document ///'
+ printlog "Select all objects in document"
+ EditSelectAll
sleep 2
- hTypeKeys "<DELETE>" '/// Delete objects ///'
+ printlog "Delete objects"
+ hTypeKeys "<DELETE>"
sleep 2
FormatLine
Kontext
- Active.SetPage TabLinie '/// TabLine ///'
+ printlog "TabLine"
+ Active.SetPage TabLinie
Kontext "TabLinie"
StilLinks.GetItemCount
ZaehlerStilLinks=StilLinks.GetItemCount
- for l=1 to ZaehlerStilLinks '/// Apply all line end styles///'
- wait 10
- if EndenSynchronisieren.IsChecked=False Then EndenSynchronisieren.Check '/// check synchronize ///'
- wait 10
- StilLinks.Select l
- if StilLinks.GetSelText<>StilRechts.GetSelText Then
- WarnLog " Ends not synchronized. " + StilLinks.GetSelText + " Right: " + StilRechts.GetSelText '/// check if style is automatically applied for both ends ///'
- else
- PrintLog " Left: " + StilLinks.GetSelText + " Right: " + StilRechts.GetSelText
- end if
- EndenSynchronisieren.UnCheck
+ printlog "Apply all line end styles"
+ for l=1 to ZaehlerStilLinks
+ wait 10
+ printlog "check synchronize"
+ if EndenSynchronisieren.IsChecked=False Then EndenSynchronisieren.Check
+ wait 10
+ StilLinks.Select l
+ printlog "check if style is automatically applied for both ends"
+ if StilLinks.GetSelText<>StilRechts.GetSelText Then
+ WarnLog " Ends not synchronized. " + StilLinks.GetSelText + " Right: " + StilRechts.GetSelText
+ else
+ PrintLog " Left: " + StilLinks.GetSelText + " Right: " + StilRechts.GetSelText
+ end if
+ EndenSynchronisieren.UnCheck
next l
- ZentriertLinks.Check
+ZentriertLinks.Check
if ZentriertRechts.isChecked = True Then PrintLog " Centered right does work"
i = CornerStyle.GetItemCount
if i <> 4 then warnlog "CornerStyle should contain four options, but currently has: " + i
@@ -130,15 +149,18 @@ testcase tiFormatLine
Kontext
Active.SetPage TabLinienstile
Kontext "TabLinienstile"
- Hinzufuegen.Click '/// Add new line style ///'
+ printlog "Add new line style"
+ Hinzufuegen.Click
Kontext "NameDlg"
- Eingabefeld.SetText "Testlinie2" '/// insert name of style (Testlinie2) ///'
+ printlog "insert name of style (Testlinie2)"
+ Eingabefeld.SetText "Testlinie2"
NameDlg.OK
sleep 1
Kontext
Active.SetPage TabLinienstile
Kontext "TabLinienstile"
- Loeschen.Click '/// delete created style ///'
+ printlog "delete created style"
+ Loeschen.Click
Kontext "Active"
Active.Yes
Kontext
@@ -151,33 +173,41 @@ testcase tiFormatLine
LaengeLinks.More 3
LaengeRechts.More 3
Abstand.SetText "0,1"
- if AnLinienbreite.IsChecked = True Then AnLinienbreite.Click '/// all fields changed in TabLinienstile ///'
+ printlog "all fields changed in TabLinienstile"
+ if AnLinienbreite.IsChecked = True Then AnLinienbreite.Click
PrintLog " All controls could be manipulated."
TypLinks.Select 1
TypRechts.Select 1
- if LaengeLinks.IsEnabled And LaengeRechts.IsEnabled =True Then '/// check if its possible to apply a length to a point ///'
- WarnLog " A point where you can change its length is not a point anymore"
+ printlog "check if its possible to apply a length to a point"
+ if LaengeLinks.IsEnabled And LaengeRechts.IsEnabled =True Then
+ WarnLog " A point where you can change its length is not a point anymore"
else
- PrintLog " Line style pint tested" '/// All styles for points are changed ///'
+ printlog "All styles for points are changed "
+ PrintLog " Line style pint tested"
end if
sleep 1
try
- Linienstil.Select 1
+ Linienstil.Select 1
catch
- if Linienstil.GetItemCount = 0 then '/// check if style list is filled ///'
- Warnlog "- The list for line styles is empty"
- Hinzufuegen.Click '/// new style ///'
- Kontext "NameDlg"
- NameDlg.OK
- end if
+ printlog "check if style list is filled"
+ if Linienstil.GetItemCount = 0 then
+ Warnlog "- The list for line styles is empty"
+ printlog "new style"
+ Hinzufuegen.Click
+ Kontext "NameDlg"
+ NameDlg.OK
+ end if
endcatch
Kontext
Active.SetPage TabLinienstile
Kontext "TabLinienstile"
- Aendern.Click '/// change style ///'
+ printlog "change style"
+ Aendern.Click
Kontext "NameDlg"
- Eingabefeld.SetText Eingabefeld.GetText + "1" '/// new name for changed style ///'
- SetClipboard Eingabefeld.GetText '/// put name into clipboard ///'
+ printlog "new name for changed style"
+ Eingabefeld.SetText Eingabefeld.GetText + "1"
+ printlog "put name into clipboard"
+ SetClipboard Eingabefeld.GetText
NameDlg.OK
Kontext
Active.SetPage TabLinienstile
@@ -194,7 +224,8 @@ testcase tiFormatLine
Hinzufuegen.Click
endcatch
Kontext "NameDlg"
- if Eingabefeld.GetText <> GetClipboardText Then WarnLog "No changes for Line style" '/// check if changed style is in list ///'
+ printlog "check if changed style is in list"
+ if Eingabefeld.GetText <> GetClipboardText Then WarnLog "No changes for Line style"
NameDlg.Cancel
sleep 2
Kontext
@@ -202,18 +233,19 @@ testcase tiFormatLine
Kontext "TabLinienstile"
sleep 1
try
- Loeschen.Click '/// delete changed style ///'
- Kontext "Active"
- Active.Yes
- sleep 3
+ printlog "delete changed style"
+ Loeschen.Click
+ Kontext "Active"
+ Active.Yes
+ sleep 3
catch
- if Linienstile.GetItemCount = 0 Then
- Hinzufuegen.Click
- Kontext "NameDlg"
- sleep 1
- Eingabefeld.SetText "Delete"
- NameDlg.OK
- end if
+ if Linienstile.GetItemCount = 0 Then
+ Hinzufuegen.Click
+ Kontext "NameDlg"
+ sleep 1
+ Eingabefeld.SetText "Delete"
+ NameDlg.OK
+ end if
endcatch
Kontext
Active.SetPage TabLinienstile
@@ -222,7 +254,8 @@ testcase tiFormatLine
TabLinienstile.OK
'--------------------------------------------
sleep 2
- Call hRechteckErstellen (40,40,80,50) '/// create rectangle ///'
+ printlog "create rectangle"
+ Call hRechteckErstellen (40,40,80,50)
sleep 2
FormatLine
Kontext
@@ -230,7 +263,8 @@ testcase tiFormatLine
Kontext "TabLinienenden"
sleep 2
Kontext "Linienstil"
- if Linienstil.Exists then Aendern.Click '/// change style ///'
+ printlog "change style"
+ if Linienstil.Exists then Aendern.Click
sleep 1
Kontext
Active.SetPage TabLinienenden
@@ -238,14 +272,16 @@ testcase tiFormatLine
sleep 1
Liste.GetItemCount
Liste.Select 3
- Hinzufuegen.Click '/// add style ///'
+ printlog "add style"
+ Hinzufuegen.Click
Kontext "NameDlg"
NameDlg.OK
Kontext
Active.SetPage TabLinienenden
Kontext "TabLinienenden"
- Aendern.Click '/// change style ///'
+ printlog "change style"
+ Aendern.Click
Kontext "Active"
Printlog Active.GetText
Active.OK
@@ -256,20 +292,21 @@ testcase tiFormatLine
Kontext
if active.GetRt=304 then
- active.ok
- Kontext "NameDlg"
- Eingabefeld.SetText Eingabefeld.GetText + "1"
- PrintLog " Name inserted"
- NameDlg.OK
+ active.ok
+ Kontext "NameDlg"
+ Eingabefeld.SetText Eingabefeld.GetText + "1"
+ PrintLog " Name inserted"
+ NameDlg.OK
endif
if active.GetRt=304 then
- active.ok
- warnlog "still not a valid name :-("
+ active.ok
+ warnlog "still not a valid name :-("
endif
Kontext
Active.SetPage TabLinienenden
Kontext "TabLinienenden"
- Loeschen.Click '/// delete style ///'
+ printlog "delete style"
+ Loeschen.Click
Kontext "Active"
Active.Yes
@@ -277,7 +314,8 @@ testcase tiFormatLine
Active.SetPage TabLinienenden
Kontext "TabLinienenden"
sleep 1
- Speichern.Click '/// save style ///'
+ printlog "save style"
+ Speichern.Click
sleep 1
Kontext "SpeichernDlg"
sleep 1
@@ -288,12 +326,12 @@ testcase tiFormatLine
sleep 2
'///New part for line
- 'EditSelectAll '/// Select all objects in document ///'
+ 'EditSelectAll printlog "Select all objects in document"
'sleep 2
- 'hTypeKeys "<DELETE>" '/// Delete objects ///'
+ 'hTypeKeys "<DELETE>" printlog "Delete objects"
'sleep 2
- '/// Create line to test shadow tabpage in line dialog
+ 'printlog "Create line to test shadow tabpage in line dialog
'kontext "Toolbar"
'Kurven.Click
'sleep 1
@@ -311,7 +349,8 @@ testcase tiFormatLine
'Active.SetPage TabSchatten
' FormatLine.Cancel
- Call hCloseDocument '/// close document ///'
+ printlog "close document"
+ Call hCloseDocument
endcase 'tiFormatLine
'-------------------------------------------------------------------------------'
@@ -329,8 +368,9 @@ testcase tLineConnect
QaErrorLog "tLineConnect ends because Asian languages are not fully supported."
goto Endsub
end if
-
- Call hNewDocument '/// New Impress / Draw document ///'
+
+ printlog "New Impress / Draw document"
+ Call hNewDocument
Call sSelectEmptyLayout
sleep 3
kontext "GraphicObjectbar"
@@ -352,7 +392,7 @@ testcase tLineConnect
end if
endif
- '/// Create 2 lines ///'
+ printlog "Create 2 lines"
kontext "Toolbar"
Kurven.Click
sleep 1
@@ -376,7 +416,7 @@ testcase tLineConnect
printlog "'" + (gApplication) +"'"
- '/// Check the amount of objects ///'
+ printlog "Check the amount of objects"
gMouseClick (10, 10)
sleep 1
EditSelectAll
@@ -400,12 +440,12 @@ testcase tLineConnect
end if
end if
- '/// Connect the two objects selected ///'
+ printlog "Connect the two objects selected"
hOpenContextMenu
sleep 1
hMenuSelectNr(13)
sleep 1
- '/// Check the amount of objects ///'
+ printlog "Check the amount of objects"
gMouseClick (10, 10)
sleep 1
EditSelectAll
@@ -419,7 +459,7 @@ testcase tLineConnect
value2 = left(StatusBarText,1)
printlog "StatusBarText was: " + StatusBarText
- '/// if same as the first value = wrong ///'
+ printlog "if same as the first value = wrong"
if value1 = value2 then
warnlog "Expected to find one object, but found " + value2 + " instead."
endif
@@ -427,22 +467,22 @@ testcase tLineConnect
warnlog "Connect was not successful. We should have one object, but have " + value2 + " instead."
endif
- '/// unmark the objects, thereafter mark them again ///'
+ printlog "unmark the objects, thereafter mark them again"
gMouseClick (10, 10)
sleep 1
EditSelectAll
sleep 1
- '/// Break them from eachother ///'
+ printlog "Break them from eachother"
hOpenContextMenu
sleep 1
hMenuSelectNr(11)
sleep 1
- '/// unmark the objects, thereafter mark them again ///'
+ printlog "unmark the objects, thereafter mark them again"
gMouseClick (10, 10)
sleep 1
EditSelectAll
sleep 1
- '/// Check the amount of objects ///'
+ printlog "Check the amount of objects"
if (gApplication = "IMPRESS") then
StatusBarText = DocumentImpress.StatusGetText(DocumentImpress.StatusGetItemID(1))
else
@@ -453,19 +493,19 @@ testcase tLineConnect
printlog "StatusBarText was: " + StatusBarText
- '/// if the same as any of the ones before: Wrong ///'
+ printlog "if the same as any of the ones before: Wrong"
if (value3 = value1 OR value3 = value2) then
warnlog "Expected to find three objects, but found " + value3 + " instead."
endif
- '/// if 3 objects, then everything is ok ///'
+ printlog "if 3 objects, then everything is ok"
if value3 = 3 then
printlog "Found three objects. Means the test was successful."
else
warnlog "Wrong value, expected three objects, but found " + value3 + "."
endif
- '/// Go through the different Corner-styles ///'
+ printlog "Go through the different Corner-styles"
hOpenContextMenu
sleep 1
@@ -496,7 +536,7 @@ testcase tLineConnect
CornerStyle.Select cfirst
TabLinie.Ok
- '/// And a nice finish to make life a bit happier for anyone who looks at the test ///'
+ printlog "And a nice finish to make life a bit happier for anyone who looks at the test"
kontext "Toolbar"
Ellipsen.Click
if (gApplication = "DRAW") then
@@ -525,9 +565,9 @@ testcase tLineConnect
gMouseMove (48,43, 53,50)
endif
gMouseClick (10, 10)
- '/// Close the document ///'
+ printlog "Close the document"
hCloseDocument
- '/// Endcase ///'
+ printlog "Endcase"
endcase 'tiLineConnect
'-------------------------------------------------------------------------------'
diff --git a/testautomation/graphics/optional/includes/global/g_spellcheck.inc b/testautomation/graphics/optional/includes/global/g_spellcheck.inc
index bd9cf36bb814..c10239e69775 100644
--- a/testautomation/graphics/optional/includes/global/g_spellcheck.inc
+++ b/testautomation/graphics/optional/includes/global/g_spellcheck.inc
@@ -348,7 +348,7 @@ endcase 'tiToolsSpellcheckCheck_ChangeAll
function delete_all_added_words(aWords)
- '/// this function delete the words in sWords in all user dictionaries
+ 'this function delete the words in sWords in all user dictionaries
Dim iBookCounter as integer
Dim iWordCounter as integer
@@ -396,7 +396,7 @@ end function 'delete_all_added_words
function delete_word_from_dictionary(sWord as String, sDictionary as String)
- '/// this function delete the words in sWords in all user dictionaries
+ 'this function delete the words in sWords in all user dictionaries
Dim iBookCounter as integer
Dim iWordCounter as integer
diff --git a/testautomation/graphics/optional/includes/impress/i_headerfooter.inc b/testautomation/graphics/optional/includes/impress/i_headerfooter.inc
index 3e4c54551525..d69a6762f886 100644
--- a/testautomation/graphics/optional/includes/impress/i_headerfooter.inc
+++ b/testautomation/graphics/optional/includes/impress/i_headerfooter.inc
@@ -30,35 +30,31 @@
'* short description : Tests the header-footer-function in Impress
'*
'*******************************************************************
-'*
-' #1 tiHeaderFooterSlide
-' #1 tiHeaderFooterNotesHandout
-'*
-'\*******************************************************************
-dim numbervalue1 as integer
-dim value2 as String
-dim value3 as String
+testcase tiHeaderFooterSlide
-'------------------------------------------------------------------------------
+ dim numbervalue1 as integer
+ dim value2 as String
+ dim value3 as String
-testcase tiHeaderFooterSlide
- '/// This part checks the first Tabpage of the Header and Footer Dialog
-
- Call hNewDocument '/// Open New document
+ printlog "This part checks the first Tabpage of the Header and Footer Dialog"
+
+ printlog "Open New document"
+ Call hNewDocument
kontext "drawimpress"
try
- ViewHeaderAndFooter '/// View - Header And Footer
+ printlog "View - Header And Footer"
+ ViewHeaderAndFooter
sleep(1)
catch
- warnlog " Could'nt open ViewHeaderAndFooter!" '/// Warnlog for not opening dialog
+ warnlog " Could'nt open ViewHeaderAndFooter!"
endcatch
printlog " Testing TabHeaderFooterSlide."
kontext "TabHeaderFooterSlide"
- '/// Check Date And Time on first tab
- if DateTime.Exists = TRUE AND DateTimeFixed.isVisible = TRUE then '/// Testing date and time checkbox
+ printlog "Testing date and time checkbox"
+ if DateTime.Exists = TRUE AND DateTimeFixed.isVisible = TRUE then
DateTime.UnCheck
sleep(1)
DateTime.Check
@@ -74,7 +70,7 @@ testcase tiHeaderFooterSlide
warnlog "DateTime does not exist or is not visible."
endif
- '/// Checking if DateTime checkbox setting is remembered...
+ printlog "Checking if DateTime checkbox setting is remembered..."
DateTime.Uncheck
printlog " Date Time is unchecked now."
Apply.Click
@@ -87,7 +83,7 @@ testcase tiHeaderFooterSlide
endif
DateTime.Check
- '/// Check DateTimeFixed can be checked/unchecked
+ printlog "Check DateTimeFixed can be checked/unchecked"
if DateTimeFixed.Exists = TRUE AND DateTimeFixed.isVisible = TRUE then
DateTimeFixed.Check
sleep(1)
@@ -102,7 +98,7 @@ testcase tiHeaderFooterSlide
warnlog " DateTimeFixed doesnt exist or is not visible!"
endif
- '/// Can text be inserted in the "fixed"-field?
+ printlog "Can text be inserted in the fixed-field?"
if DateTimeFixedText.exists = TRUE AND DateTimeFixedText.isVisible = TRUE then
DateTimeFixedText.settext "lalala"
@@ -116,7 +112,7 @@ testcase tiHeaderFooterSlide
warnlog " DateTimeFixedText doesnt exist or is not visible!"
endif
- '/// Checking if DateTimeFixed and Text setting is remembered...
+ printlog "Checking if DateTimeFixed and Text setting is remembered..."
DateTime.Check
DateTimeFixed.Check
DateTimeFixedText.settext "lalala"
@@ -130,7 +126,7 @@ testcase tiHeaderFooterSlide
endif
DateTimeFixedText.settext ""
- '/// Can I change to "Variable" and check it?
+ printlog "Can I change to Variable and check it?"
if DateTimeVariable.exists = TRUE AND DateTimeVariable.isVisible = TRUE then
DateTimeVariable.Check
sleep(1)
@@ -145,7 +141,7 @@ testcase tiHeaderFooterSlide
warnlog " DateTimeVariable doesnt exist or is not visible!"
endif
- '/// Is the Variable setting saved?
+ printlog "Is the Variable setting saved?"
Apply.Click
ViewHeaderAndFooter
if DateTimeVariable.isChecked then
@@ -154,24 +150,30 @@ testcase tiHeaderFooterSlide
warnlog " Variable setting does not get saved!"
endif
- '/// Checking DateTimeFormat box
+ printlog "Checking DateTimeFormat box"
if DateTimeFormat.exists = TRUE AND DateTimeFormat.isVisible = TRUE then
- numbervalue1 = DateTimeFormat.getitemcount '/// Get the number of choices
+ printlog "Get the number of choices"
+ numbervalue1 = DateTimeFormat.getitemcount
printlog " DateTimeFormat equals: " + numbervalue1
- value2 = DateTimeFormat.getseltext '/// Get the text for the choosen entry
+ printlog "Get the text for the choosen entry"
+ value2 = DateTimeFormat.getseltext
printlog " Tries to get ", numbervalue1 & "."
- DateTimeFormat.select ( numbervalue1 - 1 ) '/// Select the last entry
- value3 = DateTimeFormat.getseltext '/// Get the text for the last entry
+ printlog "Select the last entry"
+ DateTimeFormat.select ( numbervalue1 - 1 )
+ printlog "Get the text for the last entry"
+ value3 = DateTimeFormat.getseltext
printlog " DateTimeFormat is: " + value3
- if value2 = value3 then
- errorlog " More options for Date should exist!" '/// Check if the first and last are the same.
- DateTimeFormat.select value2 '/// Choose the original state
+ if value2 = value3 then
+ printlog "Check if the first and last are the same."
+ errorlog " More options for Date should exist!"
+ printlog "Choose the original state"
+ DateTimeFormat.select value2
else
printlog " DateTimeFormat box works."
endif
- '/// Checking if settings of DateTimeFormat box get saved
+ printlog "Checking if settings of DateTimeFormat box get saved"
Apply. Click
ViewHeaderAndFooter
if DateTimeFormat.GetSelText = value3 then
@@ -184,23 +186,30 @@ testcase tiHeaderFooterSlide
warnlog " DateTimeFormat doesnt exist or is not visible."
endif
- '/// Checking DateTimeLanguage box
+ printlog "Checking DateTimeLanguage box"
if DateTimeLanguage.exists = TRUE AND DateTimeLanguage.isVisible = TRUE then
- numbervalue1 = DateTimeLanguage.GetItemCount '/// Get the number of choices
- DateTimeFormat.select 1 '/// Choose the first entry
- value2 = DateTimeLanguage.GetSelText '/// Get the text for the choosen entry
- DateTimeLanguage.select ( numbervalue1 - 1 ) '/// Select the last entry
- value3 = DateTimeLanguage.GetSelText '/// Get the text for the last entry
+ printlog "Get the number of choices "
+ numbervalue1 = DateTimeLanguage.GetItemCount
+ printlog "Choose the first entry "
+ DateTimeFormat.select 1
+ printlog "Get the text for the choosen entry "
+ value2 = DateTimeLanguage.GetSelText
+ printlog "Select the last entry "
+ DateTimeLanguage.select ( numbervalue1 - 1 )
+ printlog "Get the text for the last entry "
+ value3 = DateTimeLanguage.GetSelText
if value2 = value3 then
- errorlog " More options for Date should exist!" '/// Check if the first and last aare the same.
- DateTimeLanguage.select value2 '/// Choose the original state
+ errorlog " More options for Date should exist!"
+ printlog "Check if the first and last are the same. "
+ printlog "Choose the original state "
+ DateTimeLanguage.select value2
value3 = DateTimeLanguage.GetSelText
else
printlog " DateTimeLanguage box works."
endif
- '/// Checking if language settings get saved
+ printlog "Checking if language settings get saved"
Apply.Click
ViewHeaderAndFooter
if DateTimeLanguage.GetSelText = value3 then
@@ -213,7 +222,7 @@ testcase tiHeaderFooterSlide
warnlog " DateTime doesnt exist or is not visible!"
endif
- '/// Checking Footer checkbox
+ printlog "Checking Footer checkbox "
if Footer.exists = TRUE AND Footer.isVisible = TRUE then
Footer.Check
sleep(1)
@@ -228,7 +237,7 @@ testcase tiHeaderFooterSlide
warnlog " Footer checkbox doesnt exist or is not visible!"
endif
- '/// Checking if Footer setting gest saved
+ printlog "Checking if Footer setting gest saved"
Footer.Uncheck
Apply.Click
ViewHeaderAndFooter
@@ -239,7 +248,7 @@ testcase tiHeaderFooterSlide
endif
Footer.Check
- '/// Checking if text can be inserted in FooterFixedText
+ printlog "Checking if text can be inserted in FooterFixedText "
if FooterFixedText.exists = TRUE AND FooterFixedText.isVisible = TRUE then
FooterFixedText.SetText "lalala"
@@ -253,7 +262,7 @@ testcase tiHeaderFooterSlide
warnlog " Footer doesnt exist or is not visible!"
endif
- '/// Checking if Footer text gets saved.
+ printlog "Checking if Footer text gets saved."
Apply.Click
ViewHeaderAndFooter
@@ -265,7 +274,7 @@ testcase tiHeaderFooterSlide
endif
FooterFixedText.SetText ""
- '/// Checking Slidenumber checkbox
+ printlog "Checking Slidenumber checkbox"
if Donotshowonfirstslide.exists = TRUE AND Donotshowonfirstslide.isVisible = TRUE then
Slidenumber.Check
sleep(1)
@@ -279,7 +288,7 @@ testcase tiHeaderFooterSlide
warnlog " Do not show on first slide doesnt exist or is not visible!"
endif
- '/// Checking if Slidenumber gets saved.
+ printlog "Checking if Slidenumber gets saved."
Apply.Click
ViewHeaderAndFooter
@@ -289,7 +298,7 @@ testcase tiHeaderFooterSlide
warnlog " Slidenumber setting is not remembered!"
endif
- '/// Checking "Do not show on first slide" checkbox
+ printlog "Checking Do not show on first slide checkbox"
if Donotshowonfirstslide.exists = TRUE AND Donotshowonfirstslide.isVisible = TRUE then
Donotshowonfirstslide.UnCheck
sleep(1)
@@ -303,7 +312,7 @@ testcase tiHeaderFooterSlide
warnlog " Do not show on first slide doesnt exist or is not visible!"
endif
- '/// Checking if Do not show on first slide is saved.
+ printlog "Checking if Do not show on first slide is saved."
Apply.Click
ViewHeaderAndFooter
@@ -313,34 +322,41 @@ testcase tiHeaderFooterSlide
warnlog " Do not show on first slide setting is not saved!"
endif
- '/// Closing dialog with cancel
+ printlog "Closing dialog with cancel"
sleep 1
TabHeaderFooterSlide.Cancel
sleep 1
kontext "drawimpress"
sleep 1
- '/// Close document
+ printlog "Close document"
Call hCloseDocument
-endcase
+endcase 'tiHeaderFooterSlide
'----------------------------------------------------------------------------
testcase tiHeaderFooterNotesHandout
- '/// This part checks the second Tabpage of the Header and Footer Dialog for notes and handout
- Call hNewDocument '/// Open New document
+ dim numbervalue1 as integer
+ dim value2 as String
+ dim value3 as String
+
+ printlog "This part checks the second Tabpage of the Header and Footer Dialog for notes and handout"
+
+ printlog "Open New document "
+ Call hNewDocument
kontext "drawimpress"
try
- ViewHeaderAndFooter '/// View - Header And Footer
+ printlog "View - Header And Footer "
+ ViewHeaderAndFooter
sleep(1)
catch
- warnlog " Could'nt open ViewHeaderAndFooter!" '/// Warnlog for not opening dialog
+ printlog "Warnlog for not opening dialog"
+ warnlog " Could'nt open ViewHeaderAndFooter!"
endcatch 'goto endcase
kontext " TabHeaderFooterSlide"
- '/// Change tabpage to HeaderFooterNotesHandout
printlog " Testing TabHeaderFooterNotesHandout."
sleep 2
kontext
@@ -348,7 +364,7 @@ testcase tiHeaderFooterNotesHandout
sleep 2
kontext "TabHeaderFooterNotesHandout"
- '/// Checking Header checkbox
+ printlog "Checking Header checkbox "
if Header.exists = TRUE AND Header.isVisible = TRUE then
Header.UnCheck
sleep(1)
@@ -365,7 +381,7 @@ testcase tiHeaderFooterNotesHandout
warnlog " Header doesnt exist or is not visible!"
endif
- '/// Checking if Header setting is saved.
+ printlog "Checking if Header setting is saved."
Header.Uncheck
ApplyToAll.Click
ViewHeaderAndFooter
@@ -380,7 +396,7 @@ testcase tiHeaderFooterNotesHandout
Header.Check
endif
- '/// Checking if header text can be inserted
+ printlog "Checking if header text can be inserted"
if HeaderFixedText.exists = TRUE AND HeaderFixedText.isVisible = TRUE then
HeaderFixedText.settext "lalala"
sleep(1)
@@ -394,7 +410,7 @@ testcase tiHeaderFooterNotesHandout
warnlog " HeaderFixedText doesnt exist or is not visible!"
endif
- '/// Checking if text is saved.
+ printlog "Checking if text is saved."
ApplyToAll.Click
ViewHeaderAndFooter
kontext
@@ -407,7 +423,7 @@ testcase tiHeaderFooterNotesHandout
endif
HeaderFixedText.SetText ""
- '/// Checking Date And Time checkbox
+ printlog "Checking Date And Time checkbox"
if DateTime.exists = TRUE AND DateTime.isVisible = TRUE then
DateTime.UnCheck
sleep(1)
@@ -424,7 +440,7 @@ testcase tiHeaderFooterNotesHandout
warnlog " DateTime doesnt exist or is not visible!"
endif
- '/// Checking if Date and Time setting is saved.
+ printlog "Checking if Date and Time setting is saved."
DateTime.Uncheck
ApplyToAll.Click
ViewHeaderAndFooter
@@ -439,7 +455,7 @@ testcase tiHeaderFooterNotesHandout
endif
DateTime.Check
- '/// Check DateTimeFixed can be checked/unchecked
+ printlog "Check DateTimeFixed can be checked/unchecked "
if DateTimeFixed.exists = TRUE AND DateTimeFixed.isVisible = TRUE then
if DateTimeFixed.isChecked then
@@ -464,7 +480,7 @@ testcase tiHeaderFooterNotesHandout
warnlog " DateTimeFixed doesnt exist or is not visible!"
endif
- '/// Can text be inserted in the "fixed"-field?
+ printlog "Can text be inserted in the fixed-field? "
if DateTimeFixedText.exists = TRUE AND DateTimeFixedText.isVisible = TRUE then
DateTimeFixedText.settext "lalala"
@@ -474,7 +490,7 @@ testcase tiHeaderFooterNotesHandout
printlog " DateTimeFixedText works."
endif
- '/// Checking if DateTimeFixedText gets saved.
+ printlog "Checking if DateTimeFixedText gets saved."
ApplyToAll.Click
ViewHeaderAndFooter
kontext
@@ -491,7 +507,7 @@ testcase tiHeaderFooterNotesHandout
warnlog "DateTimeFixedText doesnt exist or is not visible"
endif
- '/// Can it be changed to "Variable" and checked?
+ printlog "Can it be changed to Variable and checked? "
if DateTimeVariable.exists = TRUE AND DateTimeVariable.isVisible = TRUE then
DateTimeVariable.Check
sleep(1)
@@ -502,7 +518,7 @@ testcase tiHeaderFooterNotesHandout
warnlog " Something wrong with the DateTimeVariable-checkbox or DateTimeFormat is checked!"
endif
- '/// Checking if DateTimeVariable setting gets saved.
+ printlog "Checking if DateTimeVariable setting gets saved."
ApplyToAll.Click
ViewHeaderAndFooter
kontext
@@ -519,25 +535,31 @@ testcase tiHeaderFooterNotesHandout
warnlog " DateTimeVariable doesnt exist or is not visible"
endif
- '/// Checking format dropdown box
- numbervalue1 = DateTimeFormat.getitemcount '/// Get the number of choices
+ printlog "Checking format dropdown box"
+ printlog "Get the number of choices "
+ numbervalue1 = DateTimeFormat.getitemcount
printlog " DateTimeFormat equals: " + numbervalue1
- value2 = DateTimeFormat.getseltext '/// Get the text for the choosen entry
+ printlog "Get the text for the choosen entry "
+ value2 = DateTimeFormat.getseltext
printlog " Tries to get ", numbervalue1
if DateTimeFormat.exists = TRUE AND DateTimeFormat.isVisible = TRUE then
- DateTimeFormat.select ( numbervalue1 - 1 ) '/// Select the last entry
- value3 = DateTimeFormat.getseltext '/// Get the text for the last entry
+ printlog "Select the last entry "
+ DateTimeFormat.select ( numbervalue1 - 1 )
+ printlog "Get the text for the last entry "
+ value3 = DateTimeFormat.getseltext
printlog " DateTimeFormat is: " + value3
- if value2 = value3 then
- errorlog " More options for Date should exist." '/// Check if the first and last are the same.
- DateTimeFormat.select value2 '/// Choose the original state
+ if value2 = value3 then
+ printlog "Check if the first and last are the same. "
+ errorlog " More options for Date should exist."
+ printlog "Choose the original state "
+ DateTimeFormat.select value2
else
printlog " DateTimeFormat works."
endif
- '/// Checking if DateTimeFormat setting gets saved.
+ printlog "Checking if DateTimeFormat setting gets saved."
ApplyToAll.Click
ViewHeaderAndFooter
kontext
@@ -555,19 +577,25 @@ testcase tiHeaderFooterNotesHandout
endif
if DateTimeLanguage.exists = TRUE AND DateTimeLanguage.isVisible = TRUE then
- numbervalue1 = DateTimeLanguage.getitemcount '/// Get the number of choices
- DateTimeFormat.select 1 '/// Choose the first entry
- value2 = DateTimeLanguage.getseltext '/// Get the text for the choosen entry
- DateTimeLanguage.select ( numbervalue1 - 1 ) '/// Select the last entry
- value3 = DateTimeLanguage.getseltext '/// Get the text for the last entry
+ printlog "Get the number of choices "
+ numbervalue1 = DateTimeLanguage.getitemcount
+ printlog "Choose the first entry "
+ DateTimeFormat.select 1
+ printlog "Get the text for the choosen entry "
+ value2 = DateTimeLanguage.getseltext
+ printlog "Select the last entry "
+ DateTimeLanguage.select ( numbervalue1 - 1 )
+ printlog "Get the text for the last entry"
+ value3 = DateTimeLanguage.getseltext
- if value2 = value3 then
- errorlog " More options for Date should exist!" '/// Check if the first and last are the same.
+ if value2 = value3 then
+ printlog "Check if the first and last are the same. "
+ errorlog " More options for Date should exist!"
else
printlog " Footer works."
endif
- '/// Checking if DateTimeLanguage setting gets saved.
+ printlog "Checking if DateTimeLanguage setting gets saved."
ApplyToAll.Click
ViewHeaderAndFooter
kontext
@@ -583,7 +611,7 @@ testcase tiHeaderFooterNotesHandout
warnlog " DateTimeLanguage does not exist!"
endif
- '/// Checking Footer checkbox.
+ printlog "Checking Footer checkbox. "
if Footer.exists = TRUE AND Footer.isVisible = TRUE then
Footer.UnCheck
sleep(1)
@@ -597,7 +625,7 @@ testcase tiHeaderFooterNotesHandout
Footer.Check
endif
- '///Check if Footer setting is saved.
+ printlog "Check if Footer setting is saved."
Footer.Uncheck
ApplyToAll.Click
ViewHeaderAndFooter
@@ -611,10 +639,8 @@ testcase tiHeaderFooterNotesHandout
printlog " Footer is not checked."
endif
Footer.Check
-
-
- '/// Checking if Footer text can be inserted
+ printlog "Checking if Footer text can be inserted"
if FooterFixedText.exists = TRUE AND FooterFixedText.isVisible = TRUE then
FooterFixedText.SetText "lalala"
sleep(1)
@@ -629,7 +655,7 @@ testcase tiHeaderFooterNotesHandout
warnlog " FooterFixedText does not exists!"
endif
- '///Checking if Footer text is saved.
+ printlog "Checking if Footer text is saved."
ApplyToAll.Click
ViewHeaderAndFooter
kontext
@@ -642,7 +668,7 @@ testcase tiHeaderFooterNotesHandout
printlog " FooterFixedText gets saved."
endif
- '/// Checking Slidenumber checkbox
+ printlog "Checking Slidenumber checkbox"
if Slidenumber.exists = TRUE AND Slidenumber.isVisible = TRUE then
Slidenumber.UnCheck
sleep(1)
@@ -653,7 +679,7 @@ testcase tiHeaderFooterNotesHandout
Slidenumber.Check
endif
- '/// Checking if Slidenumber setting is saved.
+ printlog "Checking if Slidenumber setting is saved."
ApplyToAll.Click
ViewHeaderAndFooter
kontext
@@ -670,16 +696,16 @@ testcase tiHeaderFooterNotesHandout
warnlog " Slidenumber does'nt exist or is not visible!"
endif
- '/// Close dialog with cancel
+ printlog "Close dialog with cancel"
sleep 1
TabHeaderFooterNotesHandout.Cancel
sleep 1
kontext "drawimpress"
sleep 1
- '/// Close document
+ printlog "Close document "
Call hCloseDocument
-endcase
+endcase 'tiHeaderFooterNotesHandout
-'-------------------------------------------------------------------------------
+'------------------------------------------------------------------------------- \ No newline at end of file
diff --git a/testautomation/graphics/optional/includes/impress/i_pengine1.inc b/testautomation/graphics/optional/includes/impress/i_pengine1.inc
index 44f531c47fcd..ff4d2a035ef0 100644
--- a/testautomation/graphics/optional/includes/impress/i_pengine1.inc
+++ b/testautomation/graphics/optional/includes/impress/i_pengine1.inc
@@ -30,20 +30,9 @@
'* short description : Tests the Engine for Presentation
'*
'*******************************************************************
-'*
-' #1 tiPengineTabEntrance
-' #1 tiPengineTabEmphasis
-' #1 tiPengineTabExit
-' #1 tiPengineTabMotionPaths
-' #1 tiPengineSlideTransition
-' #1 tiPengineTabpageEntrance2
-' #1 tiPengineTabPageEmphasis2
-' #1 tiPengineTabPageExit2
-' #1 tiPengineTabPageMotionPaths2
-'*
-'\*******************************************************************
testcase tiPengineTabEntrance
+
dim bError as boolean
dim e as integer
dim d as integer
@@ -62,19 +51,19 @@ testcase tiPengineTabEntrance
dim UsedEffect as string
dim NewEffect as string
-'/// open application ///'
-Call hNewDocument
-'/// create textbox with text ///'
-Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
-'/// Slide Show->Custom Animation... ///'
-SlideShowCustomAnimation
- Kontext "Tasks"
- '/// click button 'Add...' ///'
- EffectAdd.click
- '/// Dialog 'Custom Animation' comes up ///'
- kontext
+ printlog "open application"
+ Call hNewDocument
+ printlog "create textbox with text"
+ Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
+ printlog "Slide Show->Custom Animation..."
+ SlideShowCustomAnimation
+ Kontext "Tasks"
+ printlog "click button 'Add...'"
+ EffectAdd.click
+ printlog "Dialog 'Custom Animation' comes up"
+ kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
@@ -183,7 +172,8 @@ SlideShowCustomAnimation
Printlog "Presentation didn't end. Error?"
endif
kontext "TabEntrance"
- Effects.TypeKeys "<DOWN>", e '/// Select the next entry ///'
+ printlog "Select the next entry"
+ Effects.TypeKeys "<DOWN>", e
p = Effects.GetSelIndex
If p = d Then e = i
Next e
@@ -206,12 +196,12 @@ SlideShowCustomAnimation
Next o
kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
Effects.Select 4
- '/// Close dialog 'Custom Animation' with 'OK' ///'
+ printlog "Close dialog 'Custom Animation' with 'OK'"
TabEntrance.OK
else
warnlog "Error when switching Tab"
@@ -223,15 +213,16 @@ SlideShowCustomAnimation
endif
kontext "Tasks"
EffectAutomaticPreview.Check
- '/// click button 'Remove' ///'
+ printlog "click button 'Remove'"
EffectRemove.Click
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
-endcase
+endcase 'tiPengineTabEntrance
-'------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+'-------------------------------------------------------------------------------
testcase tiPengineTabEmphasis
+
dim bError as boolean
dim e as integer
dim d as integer
@@ -250,19 +241,19 @@ testcase tiPengineTabEmphasis
dim UsedEffect as string
dim NewEffect as string
- '/// open application ///'
+ printlog "open application"
Call hNewDocument
- '/// create textbox with text ///'
+ printlog "create textbox with text"
Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
- '/// Slide Show->Custom Animation... ///'
+ printlog "Slide Show->Custom Animation..."
SlideShowCustomAnimation
Kontext "Tasks"
- '/// click button 'Add...' ///'
+ printlog "click button 'Add...'"
EffectAdd.click
- '/// Dialog 'Custom Animation' comes up ///'
+ printlog "Dialog 'Custom Animation' comes up"
kontext
- '/// Switch to TabPage: Emphasis ///'
+ printlog "Switch to TabPage: Emphasis"
kontext
active.setPage(TabEmphasis)
kontext "TabEmphasis"
@@ -347,11 +338,12 @@ testcase tiPengineTabEmphasis
else
Printlog "Presentation didn't end. Error?"
endif
- '/// Switch to TabPage: Emphasis ///'
+ printlog "Switch to TabPage: Emphasis"
kontext
active.setPage(TabEmphasis)
kontext "TabEmphasis"
- Effects.TypeKeys "<DOWN>", e + 1 '/// Select the next entry ///'
+ printlog "Select the next entry"
+ Effects.TypeKeys "<DOWN>", e + 1
p = Effects.GetSelIndex
If p = d Then e = i
Next e
@@ -375,12 +367,12 @@ testcase tiPengineTabEmphasis
endif
kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
Effects.Select 4
- '/// Close dialog 'Custom Animation' with 'OK' ///'
+ printlog "Close dialog 'Custom Animation' with 'OK'"
TabEntrance.OK
else
warnlog "Error when switching Tab"
@@ -388,15 +380,16 @@ testcase tiPengineTabEmphasis
bError = false
kontext "Tasks"
EffectAutomaticPreview.Check
- '/// click button 'Remove' ///'
+ printlog "click button 'Remove'"
EffectRemove.Click
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
-endcase
+endcase 'tiPengineTabEmphasis
-'------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+'-------------------------------------------------------------------------------
testcase tiPengineTabExit
+
dim bError as boolean
dim e as integer
dim d as integer
@@ -415,19 +408,19 @@ testcase tiPengineTabExit
dim UsedEffect as string
dim NewEffect as string
- '/// open application ///'
+ printlog "open application"
Call hNewDocument
- '/// create textbox with text ///'
+ printlog "create textbox with text"
Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
- '/// Slide Show->Custom Animation... ///'
+ printlog "Slide Show->Custom Animation..."
SlideShowCustomAnimation
Kontext "Tasks"
- '/// click button 'Add...' ///'
+ printlog "click button 'Add...'"
EffectAdd.click
- '/// Dialog 'Custom Animation' comes up ///'
+ printlog "Dialog 'Custom Animation' comes up"
kontext
- '/// Switch to TabPage: Exit ///'
+ printlog "Switch to TabPage: Exit"
active.setPage(TabExit)
kontext "TabExit"
if TabExit.exists(5) then
@@ -509,10 +502,11 @@ testcase tiPengineTabExit
Printlog "Presentation didn't end. Error?"
endif
kontext
- '/// Switch to TabPage: Exit ///'
+ printlog "Switch to TabPage: Exit"
active.setPage(TabExit)
kontext "TabExit"
- Effects.TypeKeys "<DOWN>", e + 1 '/// Select the next entry ///'
+ printlog "Select the next entry"
+ Effects.TypeKeys "<DOWN>", e + 1
p = Effects.GetSelIndex
If p = d Then e = i 'p > 2 AND
Next e
@@ -529,12 +523,12 @@ testcase tiPengineTabExit
endif
kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
Effects.Select 4
- '/// Close dialog 'Custom Animation' with 'OK' ///'
+ printlog "Close dialog 'Custom Animation' with 'OK'"
TabEntrance.OK
else
warnlog "Error when switching Tab"
@@ -542,15 +536,17 @@ testcase tiPengineTabExit
bError = false
kontext "Tasks"
EffectAutomaticPreview.Check
- '/// click button 'Remove' ///'
+ printlog "click button 'Remove'"
EffectRemove.Click
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
-endcase
-'------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+endcase 'tiPengineTabExit
+
+'-------------------------------------------------------------------------------
testcase tiPengineTabMotionPaths
+
dim bError as boolean
dim e as integer
dim d as integer
@@ -569,19 +565,19 @@ testcase tiPengineTabMotionPaths
dim UsedEffect as string
dim NewEffect as string
- '/// open application ///'
+ printlog "open application"
Call hNewDocument
- '/// create textbox with text ///'
+ printlog "create textbox with text"
Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
- '/// Slide Show->Custom Animation... ///'
+ printlog "Slide Show->Custom Animation..."
SlideShowCustomAnimation
Kontext "Tasks"
- '/// click button 'Add...' ///'
+ printlog "click button 'Add...'"
EffectAdd.click
- '/// Dialog 'Custom Animation' comes up ///'
+ printlog "Dialog 'Custom Animation' comes up"
kontext
- '/// Switch to TabPage: Motion Paths ///'
+ printlog "Switch to TabPage: Motion Paths"
active.setPage(TabMotionPaths)
kontext "TabMotionPaths"
if TabMotionPaths.exists(5) then
@@ -671,10 +667,11 @@ testcase tiPengineTabMotionPaths
Printlog "Presentation didn't end. Error?"
endif
kontext
- '/// Switch to TabPage: Motion Paths ///'
+ printlog "Switch to TabPage: Motion Paths"
active.setPage(TabMotionPaths)
kontext "TabMotionPaths"
- Effects.TypeKeys "<DOWN>", e + 1 '/// Select the next entry ///'
+ Effects.TypeKeys "<DOWN>", e + 1
+ printlog "Select the next entry"
' if p = 2 then Effects.TypeKeys "<DOWN>"
p = Effects.GetSelIndex
If p = d Then e = i 'p > 2 AND
@@ -691,12 +688,12 @@ testcase tiPengineTabMotionPaths
endif
kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
Effects.Select 4
- '/// Close dialog 'Custom Animation' with 'OK' ///'
+ printlog "Close dialog 'Custom Animation' with 'OK'"
TabEntrance.OK
else
warnlog "Error when switching Tab"
@@ -704,15 +701,16 @@ testcase tiPengineTabMotionPaths
bError = false
kontext "Tasks"
EffectAutomaticPreview.Check
- '/// click button 'Remove' ///'
+ printlog "click button 'Remove'"
EffectRemove.Click
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
-endcase
+endcase 'tiPengineTabMotionPaths
'--------------------------------------------------------------------------------------------------------------------------------------------------
testcase tiPengineSlideTransition
+
dim a as integer
dim b as integer
dim i as integer
@@ -720,31 +718,31 @@ testcase tiPengineSlideTransition
dim iCount as integer
dim Soundposition as integer
- '/// open application ///'
+ printlog "open application"
Call hNewDocument
- '/// create rectangle ///'
+ printlog "create rectangle"
Call hRechteckErstellen ( 10, 10, 20, 40 )
sleep 1
- '/// Insert a second slide ///'
+ printlog "Insert a second slide"
InsertSlide
sleep 2
- hTypekeys "<Pagedown>"
+ hTypeKeys "<Pagedown>"
sleep 2
- '/// create textframe with quotes; Simple: 39; Double: 34; ///'
+ printlog "create textframe with quotes; Simple: 39; Double: 34;"
hTextrahmenErstellen ( "Hallo",20,20,60,30)
- '/// Insert a third slide ///'
+ printlog "Insert a third slide"
InsertSlide
sleep 2
hTypekeys "<Pagedown>"
sleep 2
- '/// Slide Show->Slide Transition ///'
+ printlog "Slide Show->Slide Transition"
SlideShowSlideTransition
sleep 2
- '/// The 'Slide Transition' in the right 'Tasks' Pane has to come up ///'
+ printlog "The 'Slide Transition' in the right 'Tasks' Pane has to come up"
Kontext "Tasks"
- '/// Select every entry in the Listbox 'Apply to Selected Slides' ///'
- '/// Then select the next Speed for Transition and retest all the effects ///'
- '/// Redo until all effects has been tested with all speeds ///'
+ printlog "Select every entry in the Listbox 'Apply to Selected Slides'"
+ printlog "Then select the next Speed for Transition and retest all the effects"
+ printlog "Redo until all effects has been tested with all speeds"
lala = TransitionApplyToSelectedSlide.GetItemCount
Printlog "Count of effects : " + TransitionApplyToSelectedSlide.GetItemCount
Printlog "Count of Speeds : " + TransitionSpeed.GetItemCount
@@ -759,7 +757,7 @@ testcase tiPengineSlideTransition
Next iCount
Next b
Printlog "Count of Sounds : " + TransitionSound.GetItemCount
- '/// One Entry of the Listbox 'Sound' is 'Other sound...', select it ///'
+ printlog "One Entry of the Listbox 'Sound' is 'Other sound...', select it"
' iCount = TransitionSound.GetItemCount
TransitionSound.TypeKeys "<HOME>"
i = 0
@@ -770,11 +768,11 @@ testcase tiPengineSlideTransition
Soundposition = TransitionSound.GetSelIndex
kontext "OeffnenDlg"
if (OeffnenDlg.Exists (5)) then
- '/// Read all entries in Listbox 'File type' ///'
+ printlog "Read all entries in Listbox 'File type'"
for i = 1 to Dateityp.getItemCount
printlog "" + i + ":" + Dateityp.getItemText(i)
next i
- '/// cancel dialog 'Open' ///'
+ printlog "cancel dialog 'Open'"
sleep 1
OeffnenDlg.cancel
kontext "Tasks"
@@ -792,21 +790,21 @@ testcase tiPengineSlideTransition
sleep 5
kontext "Tasks"
- '/// check checkbox 'Automatically after' ///'
+ printlog "check checkbox 'Automatically after'"
TransitionAutomaticallyAfter.Check
sleep 5
- '/// press key 'Page Up' in box ///'
+ printlog "press key 'Page Up' in box"
TransitionAutomaticallyAfterTime.TypeKeys "<PageUp>"
sleep 5
- '/// check the standard checkbox 'On mouse click' ///'
+ printlog "check the standard checkbox 'On mouse click'"
TransitionOnMouseClick.Check
sleep 5
- '/// press button 'Apply to All Slides' ///'
+ printlog "press button 'Apply to All Slides'"
TransitionApplyToAllSlides.Click
sleep 5
- '/// press button 'Play' ///'
+ printlog "press button 'Play'"
TransitionPlay.Click
- '/// press button 'Slide Show' ///'
+ printlog "press button 'Slide Show'"
sleep (10)
TransitionSlideShow.Click
sleep (3)
@@ -827,17 +825,17 @@ testcase tiPengineSlideTransition
endif
kontext "Tasks"
- '/// uncheck and check Checkbox 'Automatic Preview' ///'
- '/// default is checked ///'
+ printlog "uncheck and check Checkbox 'Automatic Preview'"
+ printlog "default is checked"
if (NOT TransitionAutomaticPreview.IsChecked) then
warnlog "Impress:Tasks Pane:Slide Transition: Automatic preview has to be checked by default, wasn't!"
endif
TransitionAutomaticPreview.UnCheck
sleep 1
TransitionAutomaticPreview.Check
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
-endcase
+endcase 'tiPengineSlideTransition
'testcase
' Two different objects for two different effects. Does it work?
@@ -849,9 +847,10 @@ endcase
' Save file, close, open again and see if everything is as it were. (Random effects)
'Endcase
-'########################################################################
+'-------------------------------------------------------------------------------
testcase tiPengineTabpageEntrance2
+
dim bError as boolean
dim e as integer
dim d as integer
@@ -868,21 +867,21 @@ testcase tiPengineTabpageEntrance2
dim StartName1 as string
dim PropertyName1 as string
-'/// open application ///'
-Call hNewDocument
-'/// create textbox with text ///'
-Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
-'/// Slide Show->Custom Animation... ///'
-SlideShowCustomAnimation
- Kontext "Tasks"
- '/// Uncheck AutomaticPreview ///'
- EffectAutomaticPreview.UnCheck
- '/// click button 'Add...' ///'
- EffectAdd.click
- '/// Dialog 'Custom Animation' comes up ///'
- kontext
+ printlog "open application"
+ Call hNewDocument
+ printlog "create textbox with text"
+ Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
+ printlog "Slide Show->Custom Animation..."
+ SlideShowCustomAnimation
+ Kontext "Tasks"
+ printlog "Uncheck AutomaticPreview"
+ EffectAutomaticPreview.UnCheck
+ printlog "click button 'Add...'"
+ EffectAdd.click
+ printlog "Dialog 'Custom Animation' comes up"
+ kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
@@ -927,7 +926,8 @@ SlideShowCustomAnimation
Printlog "Presentation didn't end. Error?"
endif
kontext "TabEntrance"
- Effects.TypeKeys "<DOWN>", e '/// Select the next entry ///'
+ printlog "Select the next entry"
+ Effects.TypeKeys "<DOWN>", e
p = Effects.GetSelIndex
If p = d Then e = i
Next e
@@ -945,12 +945,12 @@ SlideShowCustomAnimation
Next o
kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
Effects.Select 4
- '/// Close dialog 'Custom Animation' with 'OK' ///'
+ printlog "Close dialog 'Custom Animation' with 'OK'"
TabEntrance.OK
else
warnlog "Error when switching Tab"
@@ -962,15 +962,16 @@ SlideShowCustomAnimation
endif
kontext "Tasks"
EffectAutomaticPreview.Check
- '/// click button 'Remove' ///'
+ printlog "click button 'Remove'"
EffectRemove.Click
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
-endcase
+endcase 'tiPengineTabpageEntrance2
'------------------------------------------------------------------------------------------------------------------------------------------------------
testcase tiPengineTabPageEmphasis2
+
dim bError as boolean
dim e as integer
dim d as integer
@@ -987,21 +988,21 @@ testcase tiPengineTabPageEmphasis2
dim StartName1 as string
dim PropertyName1 as string
-'/// open application ///'
-Call hNewDocument
-'/// create textbox with text ///'
-Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
-'/// Slide Show->Custom Animation... ///'
-SlideShowCustomAnimation
+ printlog "open application"
+ Call hNewDocument
+ printlog "create textbox with text"
+ Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
+ printlog "Slide Show->Custom Animation..."
+ SlideShowCustomAnimation
Kontext "Tasks"
- '/// Uncheck AutomaticPreview ///'
+ printlog "Uncheck AutomaticPreview"
EffectAutomaticPreview.UnCheck
- '/// click button 'Add...' ///'
+ printlog "click button 'Add...'"
EffectAdd.click
- '/// Dialog 'Custom Animation' comes up ///'
+ printlog "Dialog 'Custom Animation' comes up"
kontext
- '/// Switch to TabPage: Emphasis ///'
+ printlog "Switch to TabPage: Emphasis"
kontext
active.setPage(TabEmphasis)
kontext "TabEmphasis"
@@ -1049,7 +1050,8 @@ SlideShowCustomAnimation
active.setPage(TabEmphasis)
Printlog "Testing effects in - TabEmphasis"
kontext "TabEmphasis"
- Effects.TypeKeys "<DOWN>", e + 1 '/// Select the next entry ///'
+ printlog "Select the next entry"
+ Effects.TypeKeys "<DOWN>", e + 1
p = Effects.GetSelIndex
If p = d Then e = i 'p > 2 AND
Next e
@@ -1074,12 +1076,12 @@ SlideShowCustomAnimation
endif
kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
Effects.Select 4
- '/// Close dialog 'Custom Animation' with 'OK' ///'
+ printlog "Close dialog 'Custom Animation' with 'OK'"
TabEntrance.OK
else
warnlog "Error when switching Tab"
@@ -1087,15 +1089,16 @@ SlideShowCustomAnimation
bError = false
kontext "Tasks"
EffectAutomaticPreview.Check
- '/// click button 'Remove' ///'
+ printlog "click button 'Remove'"
EffectRemove.Click
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
-endcase
+endcase 'tiPengineTabPageEmphasis2
'------------------------------------------------------------------------------------
testcase tiPengineTabPageExit2
+
dim bError as boolean
dim e as integer
dim d as integer
@@ -1112,21 +1115,21 @@ testcase tiPengineTabPageExit2
dim StartName1 as string
dim PropertyName1 as string
-'/// open application ///'
+printlog "open application"
Call hNewDocument
-'/// create textbox with text ///'
+printlog "create textbox with text"
Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
-'/// Slide Show->Custom Animation... ///'
+printlog "Slide Show->Custom Animation..."
SlideShowCustomAnimation
Kontext "Tasks"
- '/// Uncheck AutomaticPreview ///'
+ printlog "Uncheck AutomaticPreview"
EffectAutomaticPreview.UnCheck
- '/// click button 'Add...' ///'
+ printlog "click button 'Add...'"
EffectAdd.click
- '/// Dialog 'Custom Animation' comes up ///'
+ printlog "Dialog 'Custom Animation' comes up"
kontext
- '/// Switch to TabPage: Exit ///'
+ printlog "Switch to TabPage: Exit"
active.setPage(TabExit)
kontext "TabExit"
if TabExit.exists(5) then
@@ -1178,15 +1181,16 @@ SlideShowCustomAnimation
Printlog "Presentation didn't end. Error?"
endif
kontext
- '/// Switch to TabPage: Exit ///'
+ printlog "Switch to TabPage: Exit"
active.setPage(TabExit)
kontext "TabExit"
- Effects.TypeKeys "<DOWN>", e + 1 '/// Select the next entry ///'
+ printlog "Select the next entry"
+ Effects.TypeKeys "<DOWN>", e + 1
p = Effects.GetSelIndex
If p = d Then e = i 'p > 2 AND
Next e
kontext
- '/// Switch to TabPage: Exit ///'
+ printlog "Switch to TabPage: Exit"
active.setPage(TabExit)
kontext "TabExit"
e = 0
@@ -1208,12 +1212,12 @@ SlideShowCustomAnimation
endif
kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
Effects.Select 4
- '/// Close dialog 'Custom Animation' with 'OK' ///'
+ printlog "Close dialog 'Custom Animation' with 'OK'"
TabEntrance.OK
else
warnlog "Error when switching Tab"
@@ -1221,15 +1225,16 @@ SlideShowCustomAnimation
bError = false
kontext "Tasks"
EffectAutomaticPreview.Check
- '/// click button 'Remove' ///'
+ printlog "click button 'Remove'"
EffectRemove.Click
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
-endcase
+endcase 'tiPengineTabPageExit2
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
testcase tiPengineTabPageMotionPaths2
+
dim bError as boolean
dim e as integer
dim d as integer
@@ -1246,21 +1251,21 @@ testcase tiPengineTabPageMotionPaths2
dim StartName1 as string
dim PropertyName1 as string
- '/// open application ///'
+ printlog "open application"
Call hNewDocument
- '/// create textbox with text ///'
+ printlog "create textbox with text"
Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
- '/// Slide Show->Custom Animation... ///'
+ printlog "Slide Show->Custom Animation..."
SlideShowCustomAnimation
Kontext "Tasks"
- '/// Uncheck AutomaticPreview ///'
+ printlog "Uncheck AutomaticPreview"
EffectAutomaticPreview.UnCheck
- '/// click button 'Add...' ///'
+ printlog "click button 'Add...'"
EffectAdd.click
- '/// Dialog 'Custom Animation' comes up ///'
+ printlog "Dialog 'Custom Animation' comes up"
kontext
- '/// Switch to TabPage: Motion Paths ///'
+ printlog "Switch to TabPage: Motion Paths"
active.setPage(TabMotionPaths)
kontext "TabMotionPaths"
if TabMotionPaths.exists(5) then
@@ -1302,15 +1307,16 @@ testcase tiPengineTabPageMotionPaths2
Printlog "Presentation didn't end. Error?"
endif
kontext
- '/// Switch to TabPage: Motion Paths ///'
+ printlog "Switch to TabPage: Motion Paths"
active.setPage(TabMotionPaths)
kontext "TabMotionPaths"
- Effects.TypeKeys "<DOWN>", e + 1 '/// Select the next entry ///'
+ printlog "Select the next entry"
+ Effects.TypeKeys "<DOWN>", e + 1
p = Effects.GetSelIndex
If p = d Then e = i 'p > 2 AND
Next e
kontext
- '/// Switch to TabPage: Motion Paths ///'
+ printlog "Switch to TabPage: Motion Paths"
active.setPage(TabMotionPaths)
kontext "TabMotionPaths"
@@ -1332,12 +1338,12 @@ testcase tiPengineTabPageMotionPaths2
warnlog "Impress:Tasks Pane:Custom Animation:TabMotionPaths tabPage doesn't work."
endif
kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
Effects.Select 4
- '/// Close dialog 'Custom Animation' with 'OK' ///'
+ printlog "Close dialog 'Custom Animation' with 'OK'"
TabEntrance.OK
else
warnlog "Error when switching Tab"
@@ -1345,12 +1351,10 @@ testcase tiPengineTabPageMotionPaths2
bError = false
kontext "Tasks"
EffectAutomaticPreview.Check
- '/// click button 'Remove' ///'
+ printlog "click button 'Remove'"
EffectRemove.Click
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
-endcase
-
-'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
+endcase 'tiPengineTabPageMotionPaths2
+'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file
diff --git a/testautomation/graphics/optional/includes/impress/i_pengine2.inc b/testautomation/graphics/optional/includes/impress/i_pengine2.inc
index f1fa908cf7b7..56d15f6eee37 100644
--- a/testautomation/graphics/optional/includes/impress/i_pengine2.inc
+++ b/testautomation/graphics/optional/includes/impress/i_pengine2.inc
@@ -30,48 +30,41 @@
'* short description : Tests the Presentation-Engines effects
'*
'*******************************************************************
-'*
-' #1 tiPengineAnimationEffectsPreview
-' #1 tiPengineAnimationEffectsOptions
-' #1 tiPengineAllShapesAndEffects
-' #1 tiPengine2ObjectsGetsEffects
-'*
-'\*******************************************************************
testcase tiPengineAnimationEffectsPreview
dim bError as boolean
- '/// open application ///'
+ printlog "open application"
Call hNewDocument
- '/// create textbox with text ///'
+ printlog "create textbox with text"
Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
- '/// Slide Show->Custom Animation... ///'
+ printlog "Slide Show->Custom Animation..."
SlideShowCustomAnimation
- Kontext "Tasks"
- '/// click button 'Add...' ///'
- EffectAdd.click
- '/// Dialog 'Custom Animation' comes up ///'
- kontext
- '/// Switch to TabPage: Entrance ///'
- active.setPage(TabEntrance)
- kontext "TabEntrance"
- if TabEntrance.exists(5) then
- DialogTest(TabEntrance)
- TestAnimations
- '/// Switch to TabPage: Emphasis ///'
- kontext
- active.setPage(TabEmphasis)
- kontext "TabEmphasis"
- if TabEmphasis.exists(5) then
- DialogTest(TabEmphasis)
- TestAnimations
- else
- bError = true
- warnlog "Impress:Tasks Pane:Custom Animation:TabEmphasis tabPage doesn't work."
- endif
- kontext
-
- '/// Switch to TabPage: Exit ///'
+ Kontext "Tasks"
+ printlog "click button 'Add...'"
+ EffectAdd.click
+ printlog "Dialog 'Custom Animation' comes up"
+ kontext
+ printlog "Switch to TabPage: Entrance"
+ active.setPage(TabEntrance)
+ kontext "TabEntrance"
+ if TabEntrance.exists(5) then
+ DialogTest(TabEntrance)
+ TestAnimations
+ printlog "Switch to TabPage: Emphasis"
+ kontext
+ active.setPage(TabEmphasis)
+ kontext "TabEmphasis"
+ if TabEmphasis.exists(5) then
+ DialogTest(TabEmphasis)
+ TestAnimations
+ else
+ bError = true
+ warnlog "Impress:Tasks Pane:Custom Animation:TabEmphasis tabPage doesn't work."
+ endif
+ kontext
+
+ printlog "Switch to TabPage: Exit"
active.setPage(TabExit)
kontext "TabExit"
if TabExit.exists(5) then
@@ -83,7 +76,7 @@ testcase tiPengineAnimationEffectsPreview
endif
kontext
- '/// Switch to TabPage: Motion Paths ///'
+ printlog "Switch to TabPage: Motion Paths"
active.setPage(TabMotionPaths)
kontext "TabMotionPaths"
if TabMotionPaths.exists(5) then
@@ -95,12 +88,12 @@ testcase tiPengineAnimationEffectsPreview
endif
kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if TabEntrance.exists(5) then
Effects.Select 4
- '/// Close dialog 'Custom Animation' with 'OK' ///'
+ printlog "Close dialog 'Custom Animation' with 'OK'"
TabEntrance.OK
else
warnlog "Error when switching Tab"
@@ -112,12 +105,12 @@ testcase tiPengineAnimationEffectsPreview
endif
Kontext "Tasks"
if (NOT bError) then
- '/// click button 'Change...' ///'
+ printlog "click button 'Change...'"
EffectChange.click
- '/// Dialog 'Custom Animation' comes up ///'
+ printlog "Dialog 'Custom Animation' comes up"
kontext
- '/// Switch to TabPage: Entrance ///'
+ printlog "Switch to TabPage: Entrance"
active.setPage(TabEntrance)
kontext "TabEntrance"
if (NOT TabEntrance.exists(5)) then
@@ -129,7 +122,7 @@ testcase tiPengineAnimationEffectsPreview
if EffectProperty.IsVisible then
EffectProperty.GetItemCount
endif
- '/// CLick on button '...' (Options) ///'
+ printlog "CLick on button '...' (Options)"
EffectOptions.Click
kontext "TabEffect"
if TabEffect.Exists(5) then
@@ -137,7 +130,7 @@ testcase tiPengineAnimationEffectsPreview
Sound.GetItemCount
AfterAnimation.GetItemCount
- '/// switch to TabPage 'Timing' ///'
+ printlog "switch to TabPage 'Timing'"
Kontext
Active.SetPage TabTiming
kontext "TabTiming"
@@ -155,7 +148,7 @@ testcase tiPengineAnimationEffectsPreview
warnlog "Impress:Tasks Pane:Custom Animation:Effect Options: Timing TabPage didn't work."
endif
- '/// switch to TabPage 'Timing' ///'
+ printlog "switch to TabPage 'Timing'"
Kontext
active.setPage TabTextAnimation
kontext "TabTextAnimation"
@@ -193,17 +186,18 @@ testcase tiPengineAnimationEffectsPreview
sleep (2)
kontext "Tasks"
EffectAutomaticPreview.Check
- '/// click button 'Remove' ///'
+ printlog "click button 'Remove'"
EffectRemove.Click
endif
sleep (2)
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
endcase 'tiPengineAnimationEffectsPreview
'------------------------------------------------------------------------------
testcase tiPengineAnimationEffectsOptions
+
dim bError as boolean
dim e as integer
dim d as integer
@@ -222,28 +216,28 @@ testcase tiPengineAnimationEffectsOptions
dim StartName1 as string
dim PropertyName1 as string
-'/// open application ///'
-Call hNewDocument
-'/// create textbox with text ///'
-Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
-'/// Slide Show->Custom Animation... ///'
-SlideShowCustomAnimation
- '/// Dialog 'Custom Animation' comes up ///'
- Kontext "Tasks"
- '/// Click button 'Add...' to add an effect to the text ///'
- EffectAdd.click
- kontext
- '/// Switch to TabPage: Entrance ///'
- active.setPage(TabEntrance)
- kontext "TabEntrance"
- if TabEntrance.exists(5) then
+ printlog "open application"
+ Call hNewDocument
+ printlog "create textbox with text"
+ Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
+ printlog "Slide Show->Custom Animation..."
+ SlideShowCustomAnimation
+ printlog "Dialog 'Custom Animation' comes up"
+ Kontext "Tasks"
+ printlog "Click button 'Add...' to add an effect to the text"
+ EffectAdd.click
+ kontext
+ printlog "Switch to TabPage: Entrance"
+ active.setPage(TabEntrance)
+ kontext "TabEntrance"
+ if TabEntrance.exists(5) then
AutomaticPreview.UnCheck
Printlog "Testing effects in - TabEntrance"
i = Effects.GetItemCount
p = 7555
Effects.TypeKeys "<HOME DOWN>"
Randomize
- '/// Choose ten random effects, and test them. ///'
+ printlog "Choose ten random effects, and test them."
For e = 1 to 10
randomize
for y = 1 to 1
@@ -270,7 +264,7 @@ SlideShowCustomAnimation
Warnlog "Something wrong when exiting Impress:Tasks Pane:Custom Animation: ... (options)"
endif
kontext "TabEntrance"
- '/// Select the next entry ///'
+ printlog "Select the next entry"
Effects.TypeKeys "<DOWN>", e
p = Effects.GetSelIndex
If p = d Then e = i
@@ -300,27 +294,28 @@ SlideShowCustomAnimation
endif
kontext "Tasks"
EffectAutomaticPreview.Check
- '/// click button 'Remove' ///'
+ printlog "click button 'Remove'"
EffectRemove.Click
- '/// close application ///'
+ printlog "close application"
Call hCloseDocument
endcase 'tiPengineAnimationEffectsOptions
-'------------------------------------------------------------------------------------------------------------------------------------------------------
+'-------------------------------------------------------------------------------
testcase tiPengineAllShapesAndEffects
- dim sFileName as string
-'/// the Presentation-Engine consists of showing the presentation, with all it's effects. ///'
+ dim sFileName as string
- '/// Create a new presentation. ///'
+ printlog "the Presentation-Engine consists of showing the presentation, with all it's effects."
+
+ printlog "Create a new presentation."
Call hNewDocument
Sleep (1)
- '/// Open the test-file. ///'
+ printlog "Open the test-file."
Call hFileOpen (gTesttoolpath + "graphics\required\input\allshapes2.odp") 'effects.odp")
- '/// Start the slideshow. ///'
+ printlog "Start the slideshow."
Call hTypeKeys "<F5>"
sleep (10)
kontext "DocumentPresentation"
@@ -339,14 +334,14 @@ testcase tiPengineAllShapesAndEffects
Call hCloseDocument
sleep (1)
- '/// Open the test-file. ///'
+ printlog "Open the test-file."
Call hFileOpen (gTesttoolpath + "graphics\required\input\effects.odp")
Sleep (10)
- '/// Start the slideshow. ///'
+ printlog "Start the slideshow."
CALL hTypeKeys "<F5>"
Sleep (10)
- '/// Press "Space" again, to continue with slide two. ///'
+ printlog "Press Space again, to continue with slide two."
kontext "DocumentPresentation"
while DocumentPresentation.exists()
DocumentPresentation.TypeKeys "<SPACE>"
@@ -362,14 +357,15 @@ testcase tiPengineAllShapesAndEffects
kontext "DocumentImpress"
end if
-'/// Close Application ///'
+printlog "Close Application"
Call hCloseDocument
Printlog "Finished Optional-test for Presentation-Engine"
endcase 'tiPengineAllShapesAndEffects
-'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+'-------------------------------------------------------------------------------
testcase tiPengine2ObjectsGetsEffects
+
dim i as integer
dim t as integer
dim q as integer
@@ -385,7 +381,6 @@ testcase tiPengine2ObjectsGetsEffects
kontext "Toolbar"
sleep (1)
- printlog "insert a Smiley."
printlog "From the toolbar: Insert three objects:"
printlog "insert a Smiley."
kontext "Toolbar"
@@ -469,9 +464,7 @@ testcase tiPengine2ObjectsGetsEffects
warnlog "Error when switching Tab"
end if
Kontext "Tasks"
-
printlog "Effect no 3"
-
printlog "Insert new slide"
InsertSlide
Printlog "Inserted new Slide"
@@ -507,7 +500,6 @@ testcase tiPengine2ObjectsGetsEffects
Kontext "Tasks"
printlog "Effect no 4"
-
printlog "Click button 'Add...'"
EffectAdd.click
printlog "Dialog 'Custom Animation' comes up"
@@ -570,16 +562,19 @@ testcase tiPengine2ObjectsGetsEffects
Printlog "Finished Optional-test for Presentation-Engine"
endcase 'tiPengine2ObjectsGetsEffects
-'------------------------------------------------------------------------------------------------------------------------------------------------------
+'-------------------------------------------------------------------------------
Function TestAnimations
- '/// select in the listbox 'Effects' the second entry///'
+
+ printlog "Function: TestAnimations: select in the listbox 'Effects' the second entry"
+
Dim i as Integer
Dim s as Integer
Dim q as Integer
Dim e as Integer
Dim o as Integer
Dim p as Integer
+
i = Effects.GetItemCount
s = Speed.GetItemCount
AutomaticPreview.Check
@@ -588,7 +583,7 @@ Function TestAnimations
If e <> p Then
if AutomaticPreview.isChecked = TRUE then sleep 1
Printlog "Effect has position Nr: " + Effects.GetSelIndex + ". Name of effect: " + Effects.GetSelText
- '/// Select the next entry ///'
+ printlog "Select the next entry"
Effects.TypeKeys "<DOWN>"
p = Effects.GetSelIndex
Else
@@ -606,4 +601,4 @@ Function TestAnimations
sleep 1
AutomaticPreview.Check
Kontext
-end Function
+end Function \ No newline at end of file
diff --git a/testautomation/graphics/optional/includes/impress/i_slidelayer.inc b/testautomation/graphics/optional/includes/impress/i_slidelayer.inc
index 441e0a323099..724aaa8b70a4 100644
--- a/testautomation/graphics/optional/includes/impress/i_slidelayer.inc
+++ b/testautomation/graphics/optional/includes/impress/i_slidelayer.inc
@@ -30,75 +30,69 @@
'* short description :
'*
'*********************************************************************
-' #1 tiInsertExpandSlide
-' #1 tiInsertSummarySlide
-' #1 tiFormatSeitenlayout
-' #1 t114174
-' #1 t111862
-'\********************************************************************
' Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\enter.bmp")
-' Inhalt.SetText ConvertPath (gTesttoolPath + "graphics\required\input\leer.sxd") '/// auto.sdd choosen ///'
+' Inhalt.SetText ConvertPath (gTesttoolPath + "graphics\required\input\leer.sxd")
'-------------------------------------------------------------------------------
testcase tiInsertExpandSlide
-
- dim i,x as integer
- dim sTemp as string
- dim b116350 as boolean
-
- '/// open application ///'
- Call hNewDocument
- Call sSelectEmptyLayout
- '/// create presupposition ///
- '///+ View->Master View->Outline View ///'
- ViewWorkspaceOutlineView
- Sleep 1
- Kontext "DocumentImpressOutlineView"
- '///+ create a slide with some levels...and some more slides with just one level... ///'
- '///+ it should look like this: ///'
- '///+-------------------------------------------------- ///'
- '///+ Slide 1///'
- '///+ - A ///'
- '///+ - - B///'
- '///+ - - - C///'
- '///+ - - - - D///'
- '///+ - - - - - - F///'
- '///+ - B///'
- '///+ - C///'
- '///+ - D///'
- '///+ Slide 2 ///'
- '///+ Slide 3 ///'
- '///+ Slide 4 ///'
- '///+ Slide 5 ///'
- '///+-------------------------------------------------- ///'
- DocumentImpressOutlineView.TypeKeys "Slide 1"
- for i = 1 to 6
- DocumentImpressOutlineView.TypeKeys "<return><tab>"
- DocumentImpressOutlineView.TypeKeys chr(64+i)
- next i
- DocumentImpressOutlineView.TypeKeys "<return>"
- DocumentImpressOutlineView.TypeKeys ("<shift tab>",5)
- for i = 1 to 3
- DocumentImpressOutlineView.TypeKeys chr(65+i)
- DocumentImpressOutlineView.TypeKeys "<return>"
- next i
- DocumentImpressOutlineView.TypeKeys ("<shift tab>")
- for i = 2 to 5
- DocumentImpressOutlineView.TypeKeys "Slide " + i
- DocumentImpressOutlineView.TypeKeys "<return>"
- next i
- DocumentImpressOutlineView.TypeKeys "<backspace>"
- '///+ View->Master View->Drawing View ///'
- ViewWorkspaceDrawingView
- Sleep 1
- '///+ there have to be 5 slides now ///'
- fGetSlideCount (5)
- '/// goto the first slide ///'
- hTypeKeys "<home>"
- '///<b> Insert->Expand Slide </b>///'
- InsertExpandSlide
+ dim i,x as integer
+ dim sTemp as string
+ dim b116350 as boolean
+
+ printlog "open application "
+ Call hNewDocument
+ Call sSelectEmptyLayout
+ printlog "create presupposition"
+ printlog "View->Master View->Outline View "
+ ViewWorkspaceOutlineView
+ Sleep 1
+ Kontext "DocumentImpressOutlineView"
+ '///+ create a slide with some levels...and some more slides with just one level... "
+ '///+ it should look like this: "
+ '///+-------------------------------------------------- "
+ '///+ Slide 1"
+ '///+ - A "
+ '///+ - - B"
+ '///+ - - - C"
+ '///+ - - - - D"
+ '///+ - - - - - - F"
+ '///+ - B"
+ '///+ - C"
+ '///+ - D"
+ '///+ Slide 2 "
+ '///+ Slide 3 "
+ '///+ Slide 4 "
+ '///+ Slide 5 "
+ '///+-------------------------------------------------- "
+ DocumentImpressOutlineView.TypeKeys "Slide 1"
+ for i = 1 to 6
+ DocumentImpressOutlineView.TypeKeys "<return><tab>"
+ DocumentImpressOutlineView.TypeKeys chr(64+i)
+ next i
+ DocumentImpressOutlineView.TypeKeys "<return>"
+ DocumentImpressOutlineView.TypeKeys ("<shift tab>",5)
+ for i = 1 to 3
+ DocumentImpressOutlineView.TypeKeys chr(65+i)
+ DocumentImpressOutlineView.TypeKeys "<return>"
+ next i
+ DocumentImpressOutlineView.TypeKeys ("<shift tab>")
+ for i = 2 to 5
+ DocumentImpressOutlineView.TypeKeys "Slide " + i
+ DocumentImpressOutlineView.TypeKeys "<return>"
+ next i
+ DocumentImpressOutlineView.TypeKeys "<backspace>"
+ printlog " View->Master View->Drawing View "
+ ViewWorkspaceDrawingView
+ Sleep 1
+ printlog "there have to be 5 slides now "
+ fGetSlideCount (5)
+
+ printlog "goto the first slide "
+ hTypeKeys "<home>"
+ printlog "Insert->Expand Slide"
+ InsertExpandSlide
' usually the content of the new pages is the same as the curren, there is a slide created for every part in the first outline level (gliederungsebene)
Sleep 1
if (8 = fGetSlideCount (8)) then
@@ -106,7 +100,7 @@ testcase tiInsertExpandSlide
else
warnLog "Bug with Insert Expand Slide"
endif
- '///+ check slide content ///'
+ printlog " check slide content "
hTypeKeys ("<TAB><F2>"
EditSelectAll
EditCopy
@@ -142,9 +136,9 @@ testcase tiInsertExpandSlide
next i
hTypeKeys "<escape><home>"
- '///<b> Insert->Expand Slide </b>///'
+ printlog "Insert->Expand Slide"
InsertExpandSlide
- '/// And since the Second slide now should be named "B", we check that first ///'
+ printlog "And since the Second slide now should be named B, we check that first "
hTypeKeys ("<TAB><F2>")
EditSelectAll
try
@@ -190,7 +184,7 @@ testcase tiInsertExpandSlide
EditSelectAll
next i
- '/// close application ///'
+ printlog "close application "
Call hCloseDocument
endcase 'tiInsertExpandSlide
@@ -285,23 +279,29 @@ testcase tiFormatSeitenlayout
qaerrorlog "outcommented due to bug"
goto endsub
- Printlog "Format/Page Layout"
- Call hNewDocument '/// new impress document ///'
-
- FormatPage '/// format page ///'
+ Printlog "Format/Page Layout"
+ printlog "new impress document "
+ Call hNewDocument
+
+ printlog "format page "
+ FormatPage
Kontext "Tasks"
sleep 5
- SetClipboard LayoutsPreview.GetText '/// get page name ///'
- SeitenName.SetText "Test" '/// change page name ///'
+ printlog "get page name "
+ SetClipboard LayoutsPreview.GetText
+ printlog "change page name "
+ SeitenName.SetText "Test"
sleep 1
- if Hintergrund.IsChecked=False Then '/// check background ///'
+ printlog "check background "
+ if Hintergrund.IsChecked=False Then
Hintergrund.Check
else
Hintergrund.UnCheck
if Hintergrund.IsChecked=False Then PrintLog " Background is deactivated"
end if
-
- if ObjekteAufDemHintergrund.IsChecked = True Then '/// change status of objects on background ///'
+
+ printlog "change status of objects on background "
+ if ObjekteAufDemHintergrund.IsChecked = True Then
PrintLog " Object on background is activated"
ObjekteAufDemHintergrund.UnCheck
if ObjekteAufDemHintergrund.IsChecked = False Then PrintLog " Objects on background are deactivated"
@@ -309,9 +309,11 @@ testcase tiFormatSeitenlayout
ObjekteAufDemHintegrund.Check
PrintLog " Object on background is activated"
end if
- Seitenlayout.OK '/// close dialog ///'
+ printlog "close dialog "
+ Seitenlayout.OK
sleep 1
- FormatPage '/// reopen dialog ///'
+ printlog "reopen dialog "
+ FormatPage
Kontext "LayoutsPreview"
sleep 2
if GetClipboardText <> SeitenName.GetText Then
@@ -320,7 +322,8 @@ testcase tiFormatSeitenlayout
WarnLog " Page name is not correct"
end if
sleep 2
- LayoutsPreview.TypeKeys "<TAB>" '/// assign different page layout ///'
+ printlog "assign different page layout "
+ LayoutsPreview.TypeKeys "<TAB>"
LayoutsPreview.TypeKeys "<DOWN>" ,2
LayoutsPreview.TypeKeys "<Return>"
sleep 2
@@ -338,7 +341,8 @@ testcase tiFormatSeitenlayout
sleep 3
DocumentImpress.MouseDoubleClick 25,60
sleep 3
- Kontext "GrafikEinfuegenDlg" '/// check in document if layout has changed ///'
+ printlog "check in document if layout has changed "
+ Kontext "GrafikEinfuegenDlg"
sleep 2
if GrafikEinfuegenDlg.exists (5) then
try
@@ -361,13 +365,14 @@ testcase tiFormatSeitenlayout
endif
sleep 3
Kontext "DocumentImpress"
- Call hCloseDocument '/// close document ///'
+ printlog "close document "
+ Call hCloseDocument
endcase 'tiFormatSeitenlayout
'------------------------------------------------------------------------------
testcase t114174
- '/// resulting from regression in #111862# ///'
+ printlog "resulting from regression in #111862# "
dim sReference(2) as string
dim sText(2) as string
dim i as integer
@@ -385,10 +390,10 @@ testcase t114174
sReference(1) = "Koelle"
sReference(2) = "Alaaf!"
- '/// open application ///'
+ printlog "open application "
Call hNewDocument
- '/// Format->Modify Layout ///'
+ printlog "Format->Modify Layout "
FormatPage
Kontext "Tasks"
LayoutsPreview.TypeKeys "<TAB>"
@@ -414,7 +419,7 @@ testcase t114174
endif
next i
- '/// deselect all by typing key 'ESCAPE' again ///'
+ printlog "deselect all by typing key 'ESCAPE' again "
hTypeKeys("<Escape>")
hFileSaveAsKill(sFile)
@@ -477,10 +482,10 @@ testcase t111862
sReference(1) = "Koelle"
sReference(2) = "Alaaf!"
- '/// open application ///'
+ printlog "open application "
Call hNewDocument
- '/// Format->Modify Layout ///'
+ printlog "Format->Modify Layout "
Formatpage
Kontext "Tasks"
LayoutsPreview.TypeKeys "<TAB>"
@@ -519,4 +524,4 @@ testcase t111862
hCloseDocument()
endcase 't111862
-'------------------------------------------------------------------------------
+'------------------------------------------------------------------------------ \ No newline at end of file
diff --git a/testautomation/graphics/optional/includes/impress/i_slideshow.inc b/testautomation/graphics/optional/includes/impress/i_slideshow.inc
index cfcc0fbd2e2f..2c51a83a509a 100644
--- a/testautomation/graphics/optional/includes/impress/i_slideshow.inc
+++ b/testautomation/graphics/optional/includes/impress/i_slideshow.inc
@@ -38,7 +38,7 @@ testcase tSlideShowSlideShow
dim testfile as string
dim localtestfile as string
- '/// open file 'graphics\\input\\diashow.odp' ///'
+ printlog "open file 'graphics\input\diashow.odp' "
testfile = ( gTesttoolPath + "graphics\required\input\diashow.odp" )
hFileOpenLocally( testfile )
sleep 30
@@ -48,11 +48,11 @@ testcase tSlideShowSlideShow
Kontext "Navigator"
if Navigator.Exists then Navigator.Close
- '/// Deactivate "Start with current page" in ToolsOptions ///'
+ printlog "Deactivate Start with current page in ToolsOptions "
setStartCurrentPage(FALSE)
try
- '/// SlideShow->Slide Show Settings... ///'
+ printlog "SlideShow->Slide Show Settings... "
SlideShowPresentationSettings
bLoaded = true
catch
@@ -61,17 +61,17 @@ testcase tSlideShowSlideShow
if bLoaded then
Kontext "Bildschirmpraesentation"
- '/// check Radio button 'Type': 'Window' ///'
+ printlog "check Radio button 'Type': 'Window' "
Fenster.Check
- '/// close dialog 'Slide Show' with OK ///'
+ printlog "close dialog 'Slide Show' with OK "
Bildschirmpraesentation.OK
sleep 3
- '/// start the slideshow with 'Slide Show->Slide Show' ///'
+ printlog "start the slideshow with 'Slide Show->Slide Show' "
SlideShowSlideshow
sleep 3
Kontext "DocumentPresentation"
sleep 5
- '/// end the presentation by typing [ESCAPE] ///'
+ printlog "end the presentation by typing [ESCAPE] "
DocumentPresentation.TypeKeys "<ESCAPE>"
sleep 3
try
@@ -83,7 +83,7 @@ testcase tSlideShowSlideShow
sleep 3
endcatch
- '/// start the slideshow with 'Slide Show->Slide Show' ///'
+ printlog "start the slideshow with 'Slide Show->Slide Show' "
SlideShowSlideshow
Kontext "DocumentPresentation"
Printlog "- Check if slideshow runs"
@@ -94,14 +94,14 @@ testcase tSlideShowSlideShow
Warnlog "Presentation is not running !"
endcatch
sleep 5
- '/// type the key [SHIFT + F5] to open the navigator ///'
+ printlog "type the key [SHIFT + F5] to open the navigator "
DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
Kontext "NavigatorDraw"
sleep 1
- '/// check in list, if the page changed ///'
+ printlog "check in list, if the page changed "
if Liste.GetSelIndex <> 2 Then Warnlog "- pagedown not working: '" + Liste.GetSelText+"'"
Kontext "DocumentPresentation"
- '/// press key [cursor right] 3 times ///'
+ printlog "press key [cursor right] 3 times "
for i = 1 to 3
sleep 3
DocumentPresentation.TypeKeys "<right>"
@@ -124,11 +124,11 @@ testcase tSlideShowSlideShow
warnlog "Document didn't get loaded"
endif
Kontext "DocumentImpress"
- '/// Close the Navigator ///'
+ printlog " Close the Navigator "
DocumentImpress.TypeKeys "<MOD1 SHIFT F5>"
- '/// Set "Start with current page" back to default = on, in ToolsOptions ///'
+ printlog "Set Start with current page back to default = on, in ToolsOptions "
setStartCurrentPage(TRUE)
- '/// close the application ///'
+ printlog "close the application "
Call hCloseDocument
localtestfile = hFileGetLocalPath( gTesttoolPath + "diashow.odp" )
printlog localtestfile
@@ -143,17 +143,19 @@ endcase 'tSlideShowSlideShow
'-------------------------------------------------------------------------------
testcase tSlideShowRehearseTimings
+
qaerrorlog "#i64783# - tSlideShowRehearseTimings outcommented due to bug"
goto endsub
+
dim bLoaded as boolean
dim i as integer
- '/// open file 'graphics\\input\\diashow.odp' ///'
+ printlog "open file 'graphics\input\diashow.odp' "
hFileOpen ConvertPath (gTesttoolPath + "graphics\required\input\diashow.odp")
sleep 10
- ' check if the document is writable
+ printlog "check if the document is writable"
if fIsDocumentWritable = false then
- ' make the document writable and check if it's succesfull
+ printlog "make the document writable and check if it's succesfull"
if fMakeDocumentWritable = false then
warnlog "The document can't be make writeable. Test stopped."
goto endsub
@@ -163,7 +165,7 @@ testcase tSlideShowRehearseTimings
if Navigator.Exists then Navigator.Close
bLoaded = false
try
- '/// SlideShow->Slide Show Settings... ///'
+ printlog "SlideShow->Slide Show Settings... "
SlideShowPresentationSettings
bLoaded = true
catch
@@ -171,12 +173,12 @@ testcase tSlideShowRehearseTimings
endcatch
if bLoaded then
Kontext "Bildschirmpraesentation"
- '/// check Radio button 'Type': 'Window' ///'
+ printlog "check Radio button 'Type': 'Window' "
Fenster.Check
- '/// close dialog 'Slide Show' with OK ///'
+ printlog "close dialog 'Slide Show' with OK "
Bildschirmpraesentation.OK
sleep 3
- '/// start the slideshow with 'Slide Show->Rehearse Timings' ///'
+ printlog "start the slideshow with 'Slide Show->Rehearse Timings' "
SlideShowRehearseTimings
Kontext "DocumentPresentation"
if DocumentPresentation.Exists then
@@ -184,7 +186,7 @@ testcase tSlideShowRehearseTimings
else
warnlog "bah"
endif
- '/// press key [return] 5 times ///'
+ printlog "press key [return] 5 times "
for i = 1 to 5
sleep 5
DocumentPresentation.TypeKeys "<return>"
@@ -204,15 +206,15 @@ testcase tSlideShowRehearseTimings
warnlog "Documnet didn't get loaded"
endif
- '/// check state of navigator ! expected: closed ///'
+ printlog " check state of navigator ! expected: closed "
Kontext "Navigator"
if Navigator.exists then
- '///+ close navigator ! ///'
+ printlog " close navigator ! "
Navigator.Close
else
printlog "Navigator: NOT available"
endif
- '/// close the application ///'
+ printlog "close the application "
Call hCloseDocument
endcase 'tSlideShowRehearseTimings
@@ -242,64 +244,64 @@ testcase tSlideShowSlideShowSettings
' the state of the navigator in the normal view is not affected
' the navigator that is open in normal view, is not visible in windows presenattions
- '/// open application ///'
+ printlog "open application "
Call hNewDocument
-'/// check state of navigator ! expected: closed ///'
+ printlog " check state of navigator ! expected: closed "
Kontext "Navigator"
if Navigator.exists then
- '///+ close navigator ! ///'
+ printlog "close navigator ! "
Navigator.Close
QaErrorLog "Navigator was open. Check earlier tests. Now closed."
else
printlog "Navigator: NOT available. Good."
endif
- '/// Slide Show -> Slide Show Settings ///'
+ printlog "Slide Show -> Slide Show Settings "
SlideShowPresentationSettings
Kontext "Bildschirmpraesentation"
- '/// check checkbox in section 'Range' - 'From: ///'
+ printlog "check checkbox in section 'Range' - 'From: "
AbDia.Check
- '/// get count of slides from listbox 'From:' ///'
+ printlog "get count of slides from listbox 'From:' "
x = AbDiaName.GetItemCount
- '/// check if count in listbox 'from' is '0' ///'
+ printlog "check if count in listbox 'from' is '0' "
if (x = 1) Then
Printlog " - Slide count in the list: '" + x + "'"
else
Warnlog " - unexpected slide count; should be '1'; is '" + x + "'"
end if
- '/// close dialog 'Slide Show' with OK ///'
+ printlog "close dialog 'Slide Show' with OK "
Bildschirmpraesentation.OK
- '/// Insert->Slide... ///'
+ printlog "Insert->Slide... "
InsertSlide
sleep 2
hTypekeys "<Pagedown>"
sleep 2
- '/// Slide Show -> Slide Show Settings ///'
+ printlog "Slide Show -> Slide Show Settings "
SlideShowPresentationSettings
Kontext "Bildschirmpraesentation"
- Printlog "'///<b> check if count in listbox 'from' increased </b>///'"
+ Printlog "check if count in listbox 'from' increased"
i = AbDiaName.GetItemCount
if ((i -1) = x) Then
Printlog " - Slide appears in the list; count : '" + i + "'"
else
Warnlog " - Slide not added; is '" + i + "' should: '" + x + "'"
end if
- '/// close dialog 'Slide Show' with CANCEL ///'
+ printlog "close dialog 'Slide Show' with CANCEL "
Bildschirmpraesentation.Cancel
- '/// close application ///'
+ printlog "close application "
Call hCloseDocument
sleep 5
bLoaded = false
- '/// open file 'graphics\\input\\diashow.odp' (Slide Show with 4 Slides) ///'
+ printlog "open file 'graphics\input\diashow.odp' (Slide Show with 4 Slides) "
sTestfile = ( gTesttoolPath + "graphics\required\input\diashow.odp" )
hFileOpenLocally( sTestfile )
sleep 10
try
Kontext "DocumentImpress"
- '/// Slide Show -> Slide Show Settings ///'
+ printlog "Slide Show -> Slide Show Settings "
Printlog "'--------------------------------------------------------------------------"
SlideShowPresentationSettings
bLoaded = true
@@ -317,19 +319,19 @@ testcase tSlideShowSlideShowSettings
if (NavigatorSichtbar.IsChecked) then
Warnlog "'Navigator visible' is checked :-("
endif
- '///<b> check checkbox 'All Slides' </b>///'
+ printlog "check checkbox 'All Slides'"
AlleDias.Check
- '///<b> check checkbox 'Window' </b>///'
+ printlog "check checkbox 'Window"
Fenster.Check
- '///<b> check checkbox 'Navigator visible' </b>///'
- NavigatorSichtbar.Check '--------------------------------------------------------------------------
- '/// close dialog 'Slide Show' with OK ///'
+ printlog "check checkbox 'Navigator visible"
+ NavigatorSichtbar.Check
+ printlog "close dialog 'Slide Show' with OK "
Bildschirmpraesentation.OK
- '/// start the slideshow with 'Slide Show->Slide Show' ///'
+ printlog "start the slideshow with 'Slide Show->Slide Show' "
SlideShowSlideshow
Printlog "'---------------------------- START P -- All -- Window -- Navigator -------------------------"
sleep 5
- '/// check state of navigator ! expected: open ///'
+ printlog " check state of navigator ! expected: open "
Kontext "Navigator"
if Navigator.exists then
Printlog "Navigator: open :-)"
@@ -341,7 +343,7 @@ testcase tSlideShowSlideShowSettings
sleep 1
Kontext "DocumentPresentation"
try
- '/// press pagedown ///'
+ printlog "press pagedown "
DocumentPresentation.TypeKeys "<pagedown>"
catch
Warnlog "presentation is not running !"
@@ -351,8 +353,8 @@ testcase tSlideShowSlideShowSettings
if Liste.GetSelIndex <> 2 Then
warnlog "Wrong slide."
endif
- '/// press the key [Page Down] 3 times ///'
- '///+ check in Navigator list, if the slide is number: (times key pressed) ///'
+ printlog "press the key [Page Down] 3 times "
+ printlog "check in Navigator list, if the slide is number: (times key pressed) "
for i = 2 to 4
Kontext "Navigator"
if Navigator.exists then
@@ -367,7 +369,7 @@ testcase tSlideShowSlideShowSettings
DocumentPresentation.TypeKeys "<pagedown>"
next i
sleep (2)
- '/// press the key [Page Down] to exit presentation ///'
+ printlog "press the key [Page Down] to exit presentation "
DocumentPresentation.TypeKeys "<pagedown>"
sleep (5)
try
@@ -378,20 +380,20 @@ testcase tSlideShowSlideShowSettings
DocumentPresentation.TypeKeys "<ESCAPE>"
endcatch
sleep 2
- '/// check state of navigator ! expected: open ///'
+ printlog " check state of navigator ! expected: open "
Kontext "Navigator"
if Navigator.exists then
- '///+ close navigator ! ///'
+ printlog "close navigator ! "
Navigator.Close
else
printlog "Navigator: NOT available"
endif
- Printlog "'--------------------------------------------------------------------------"
+ Printlog "'---------------------------------------------------------------"
Kontext "DocumentPresentation"
- '/// type the key [MOD1 SHIFT F5] to open the navigator ///' '--------------------------------------------------------------------------
+ printlog "type the key [MOD1 SHIFT F5] to open the navigator "
hTypeKeys "<MOD1 SHIFT F5>"
- '/// Slide Show -> Slide Show Settings ///'
+ printlog "Slide Show -> Slide Show Settings "
SlideShowPresentationSettings
Kontext "Bildschirmpraesentation"
if (AlleDias.IsChecked = FALSE) then
@@ -406,59 +408,59 @@ testcase tSlideShowSlideShowSettings
if (DiawechselAufHintergrund.IsChecked = FALSE) then
Warnlog "'Change slides by clicking on background' is not checked :-("
endif
- '///<b> check checkbox in section 'Range' - 'From: </b>///'
+ printlog "check checkbox in section 'Range' - 'From:"
AbDia.Check
- '/// select the 3rd item from the top from listbox 'From:' -> 2 slides to go ///'
+ printlog "select the 3rd item from the top from listbox 'From:' -> 2 slides to go "
AbDiaName.Select 3
sTemp = AbDiaName.GetSelText
Printlog " - From '" + sTemp + "' will be shown"
- '///<b> check checkbox 'Default' </b>///'
+ printlog "check checkbox 'Default'"
Standard.Check
- '/// UNcheck checkbox 'Navigator visible'///'
+ printlog "UNcheck checkbox 'Navigator visible'"
NavigatorSichtbar.UnCheck
- '/// UNcheck checkbox 'Change slides by clicking on background'///'
+ printlog "UNcheck checkbox 'Change slides by clicking on background'"
DiawechselAufHintergrund.UnCheck
- '/// close dialog 'Slide Show' with OK ///'
+ printlog "close dialog 'Slide Show' with OK "
Bildschirmpraesentation.OK
sleep 3
Kontext "DocumentPresentation"
- '/// start the slideshow with 'Slide Show->Slide Show' ///'
+ printlog "start the slideshow with 'Slide Show->Slide Show' "
SlideShowSlideshow
Printlog "'---------------------------- START P -- From -- Default -- Click on Bg -----------------------"
sleep 5
- '/// check state of navigator ! expected: closed ///'
+ printlog " check state of navigator ! expected: closed "
Kontext "Navigator"
if Navigator.exists then
- '///+ close navigator ! ///'
+ printlog "close navigator ! "
Navigator.Close
Warnlog "Navigator: closed"
else
Printlog "Navigator: NOT available. Good."
endif
sleep 1
- '/// type the key [MOD1 SHIFT F5] to open the navigator ///' '--------------------------------------------------------------------------
+ printlog "type the key [MOD1 SHIFT F5] to open the navigator "
Kontext "DocumentPresentation"
DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
sleep 3
- '/// check in Navigator list, if the page is THREE! ///'
+ printlog "check in Navigator list, if the page is THREE! "
fGetSlideName(S3)
- '/// click right mouse button ///'
+ printlog "click right mouse button "
sleep 5
DocumentPresentation.MouseDown 50,50
DocumentPresentation.MouseUp 50,50
- '/// check in Navigator list, if the page is still THREE. If so, change slide with PageDown ///'
+ printlog "check in Navigator list, if the page is still THREE. If so, change slide with PageDown "
if (fGetSlideName(S3) <> S3) then
Warnlog "'Change slides by clicking on background' disable did not work :-("
else
DocumentPresentation.TypeKeys "<PAGEDOWN>"
endif
- '/// check in Navigator list, if the page is FOUR ///'
+ printlog "check in Navigator list, if the page is FOUR "
fGetSlideName(S4)
sleep 5
- '/// press the key [Page Down] ///'
+ printlog "press the key [Page Down] "
DocumentPresentation.TypeKeys "<pagedown>"
sleep 5
- '/// press the key [Space] to exit presentation ///'
+ printlog "press the key [Space] to exit presentation "
DocumentPresentation.TypeKeys "<Space>"
sleep 10
try
@@ -470,10 +472,10 @@ testcase tSlideShowSlideShowSettings
DocumentPresentation.TypeKeys "<ESCAPE>"
Warnlog " - Program was still in slideshow mode - ended now ?"
endcatch
- '/// check state of navigator ! expected: open ///'
+ printlog " check state of navigator ! expected: open "
Kontext "Navigator"
if Navigator.exists then
- '///+ close navigator ! ///'
+ printlog "close navigator ! "
Navigator.Close
printlog "Navigator: closed"
else
@@ -481,7 +483,7 @@ testcase tSlideShowSlideShowSettings
endif
Printlog "'--------------------------------------------------------------------------"
- '/// Slide Show -> Slide Show Settings ///'
+ printlog "Slide Show -> Slide Show Settings "
SlideShowPresentationSettings
Kontext "Bildschirmpraesentation"
if (AbDia.IsChecked = FALSE) then
@@ -496,33 +498,33 @@ testcase tSlideShowSlideShowSettings
if (DiawechselAufHintergrund.IsChecked) then
Warnlog "'Change slides by clicking in background' is checked :-("
endif
- '/// check checkbox 'All Slides' ///'
+ printlog "check checkbox 'All Slides' "
AlleDias.Check
- '///<b> check check box 'Auto' -> implies looping of slideshow in fullscreen mode </b>///'
+ printlog "check check box 'Auto' -> implies looping of slideshow in fullscreen mode"
Auto.Check
- '/// set duration of pause to '00:00:05' ///'
+ printlog "set duration of pause to '00:00:05' "
Zeit.SetText "00:00:05"
- '/// check check box 'Show logo' ///'
+ printlog "check check box 'Show logo' "
LogoAnzeigen.Check
- '/// check checkbox 'Change slides by clicking on background'///'
+ printlog "check checkbox 'Change slides by clicking on background'"
DiawechselAufHintergrund.Check
- '/// close dialog 'Slide Show' with OK ///'
+ printlog "close dialog 'Slide Show' with OK "
Bildschirmpraesentation.OK
- '/// start the slideshow with 'Slide Show->Slide Show' ///'
+ printlog "start the slideshow with 'Slide Show->Slide Show' "
SlideShowSlideshow
Printlog "'---------------------------- START P -- All -- Auto -- :05 -- Logo -----------------------------"
sleep 3
Kontext "DocumentPresentation"
- '/// type the key [MOD1 SHIFT F5] to open the navigator ///' '--------------------------------------------------------------------------
+ printlog "type the key [MOD1 SHIFT F5] to open the navigator "
DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
- '/// press the key [Space] 4 times ///'
- '///+ check in Navigator list, if the slide is number: [(times key pressed) -1 ] ///'
+ printlog "press the key [Space] 4 times "
+ printlog "check in Navigator list, if the slide is number: [(times key pressed) -1 ] "
for i = 1 to 4
fGetSlideName(saSlideNames(i))
DocumentPresentation.TypeKeys "<Space>"
sleep 5
next i
- '/// wait until autopause ended (5 secs) ///'
+ printlog "wait until autopause ended (5 secs) "
sleep 10
if (fGetSlideName(saSlideNames(1)) = saSlideNames(1)) then
Printlog " - Enless loop works"
@@ -530,7 +532,7 @@ testcase tSlideShowSlideShowSettings
Warnlog " Enless loop does NOT work"
end if
sleep 2
- '/// type key [excape] to exit presentation ///'
+ printlog "type key [excape] to exit presentation "
Kontext "DocumentPresentation"
DocumentPresentation.TypeKeys "<ESCAPE>"
sleep 5
@@ -544,7 +546,7 @@ testcase tSlideShowSlideShowSettings
DocumentImpress.TypeKeys "<ESCAPE>"
sleep 5
endcatch
- '/// check state of navigator ! expected: closed ///'
+ printlog " check state of navigator ! expected: closed "
Kontext "Navigator"
if Navigator.exists then
Navigator.Close
@@ -555,56 +557,56 @@ testcase tSlideShowSlideShowSettings
Printlog "'--------------------------------------------------------------------------"
Kontext "DocumentImpress"
- '/// Slide Show -> Slide Show Settings ///'
+ printlog "Slide Show -> Slide Show Settings "
SlideShowPresentationSettings
Kontext "BildschirmPraesentation"
- '/// check checkbox 'default' ///'
+ printlog "check checkbox 'default' "
Standard.Check
- '///<b> check checkbox 'Change slides maually' </b>///'
- ' to check this i need an automatic transition somewhere in the presentation !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ printlog "check checkbox 'Change slides maually'"
+ ' to check this i need an automatic transition somewhere in the presentation !
DiawechselManuel.Check
- '///<b> check checkbox 'Mouse pointer as pen' </b>///'
+ printlog "check checkbox 'Mouse pointer as pen'"
MauszeigerAlsStift.Check
- '/// close dialog 'Slide Show' with OK ///'
+ printlog "close dialog 'Slide Show' with OK "
BildschirmPraesentation.Ok
sleep 1
- '/// goto the first slide by typing [strg home] ///'
+ printlog "goto the first slide by typing [strg home] "
hTypeKeys "<mod1 home>"
- '///+ - SlideShow->SlideTransition ///'
+ printlog "SlideShow->SlideTransition "
SlideShowSlideTransition
Kontext "Tasks"
- '///+ - click button 'Extras' ///'
+ printlog "click button 'Extras' "
sleep 1
- '///+ - + click button 'Automatic Transition' ///'
+ printlog "click button 'Automatic Transition' "
TransitionAutomaticallyAfter.Check 'click
- '///+ - + + Set Time to '00:00:01' ///'
+ printlog " Set Time to '00:00:01' "
TransitionAutomaticallyAfterTime.SetText "2"
- '///+ - click button 'Assign' ///'
+ printlog " click button 'Assign' "
TransitionApplyToAllSlides.Click
- '///+ - close dialog 'Slide Transition' ///'
+ printlog "close dialog 'Slide Transition' "
sleep 3
- '/// start the slideshow with keys [STRG F2] ///'
+ printlog "start the slideshow with keys [STRG F2] "
Kontext "DocumentImpress"
DocumentImpress.TypeKeys "<MOD1 F2>"
Printlog "'---------------------------- START P -- Default -- Manuel ------------------------------"
- '/// wait 10 seconds (to get the dia changed automatical has not to happen !) ///'
+ printlog "wait 10 seconds (to get the dia changed automatical has not to happen !) "
sleep 10
Kontext "DocumentPresentation"
- '/// type the key [MOD1 SHIFT F5] to open the navigator ///' '--------------------------------------------------------------------------
+ printlog "type the key [MOD1 SHIFT F5] to open the navigator "
DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
- '/// press key [cursor right] 3 times ///'
+ printlog "press key [cursor right] 3 times "
for i = 1 to 4
sleep 5
fGetSlideName(saSlideNames(i))
- '///+ use the left mouse button, to use the pen drawing function ///'
+ printlog "use the left mouse button, to use the pen drawing function "
DocumentPresentation.MouseDown (10, 10)
DocumentPresentation.MouseMove (10, 90)
DocumentPresentation.MouseUp (10, 90)
DocumentPresentation.TypeKeys "<right>"
next i
- '/// press the key [Page Down] to exit presentation ///'
+ printlog "press the key [Page Down] to exit presentation "
sleep (2)
DocumentPresentation.TypeKeys "<pagedown>"
sleep (2)
@@ -615,10 +617,10 @@ testcase tSlideShowSlideShowSettings
Printlog "- Slideshow ended at the right time"
endif
sleep 2
- '/// check state of navigator ! expected: closed ///'
+ printlog " check state of navigator ! expected: closed "
Kontext "Navigator"
if Navigator.exists then
- '///+ close navigator ! ///'
+ printlog "close navigator ! "
Navigator.Close
warnlog "Navigator: closed"
else
@@ -627,50 +629,50 @@ testcase tSlideShowSlideShowSettings
Printlog "'--------------------------------------------------------------------------"
Kontext "DocumentImpress"
- '/// Slide Show -> Slide Show Settings ///'
+ printlog "Slide Show -> Slide Show Settings "
SlideShowPresentationSettings
Kontext "BildschirmPraesentation"
- '/// check checkbox 'default' ///'
+ printlog "check checkbox 'default' "
Standard.Check
- '///<b> UNcheck checkbox 'Change slides manually' </b>///'
+ printlog "UNcheck checkbox 'Change slides manually'"
DiawechselManuel.UNCheck
- '/// UNcheck checkbox 'Mouse pointer as pen' ///'
+ printlog "UNcheck checkbox 'Mouse pointer as pen' "
MauszeigerAlsStift.UNCheck
- '/// close dialog 'Slide Show' with OK ///'
+ printlog "close dialog 'Slide Show' with OK "
BildschirmPraesentation.Ok
sleep 1
- '/// goto the first slide by typing [strg home] ///'
+ printlog "goto the first slide by typing [strg home] "
hTypeKeys "<MOD1 HOME>"
- '/// Set all slides to 'wait 10 seconds' to get the slide changed automatically ///'
- '///+ - SlideShow->SlideTransition ///'
+ printlog "Set all slides to 'wait 10 seconds' to get the slide changed automatically "
+ printlog "SlideShow->SlideTransition "
SlideShowSlideTransition
Kontext "Tasks"
- '///+ - click button 'Extras' ///'
+ printlog "click button 'Extras' "
sleep 1
- '///+ - + click button 'Automatic Transition' ///'
+ printlog "click button 'Automatic Transition' "
TransitionAutomaticallyAfter.Check 'click
- '///+ - + + Set Time to '10sec' ///'
+ printlog "Set Time to '10sec' "
TransitionAutomaticallyAfterTime.SetText "10"
- '///+ - click button 'Apply to all Slides' ///'
+ printlog "click button 'Apply to all Slides' "
TransitionApplyToAllSlides.Click
- '///+ - close dialog 'Slide Transition' ///'
+ printlog "close dialog 'Slide Transition' "
sleep (1)
- '/// start the slideshow with keys [STRG F2] ///'
+ printlog "start the slideshow with keys [STRG F2] "
Kontext "DocumentImpress"
DocumentImpress.TypeKeys "<MOD1 F2>"
Printlog "'---------------------------- START P -- Default -- Automatic -----------------------------"
- '/// Wait 6 seconds to see if the Automatic Transition changes the slide. ///'
+ printlog "Wait 6 seconds to see if the Automatic Transition changes the slide. "
sleep 6
Kontext "DocumentPresentation"
- '/// type the key [MOD1 SHIFT F5] to open the navigator ///' '--------------------------------------------------------------------------
+ printlog "type the key [MOD1 SHIFT F5] to open the navigator "
DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
- '/// press key [cursor right] 3 times ///'
+ printlog "press key [cursor right] 3 times "
for i = 2 to 4
sleep (5)
fGetSlideName(saSlideNames(i))
DocumentPresentation.TypeKeys "<right>"
next i
- '/// press the key [Page Down] to exit presentation ///'
+ printlog "press the key [Page Down] to exit presentation "
sleep (2)
DocumentPresentation.TypeKeys "<PAGEDOWN>"
sleep (2)
@@ -681,18 +683,18 @@ testcase tSlideShowSlideShowSettings
Printlog "- Slideshow ended at the right time"
endif
sleep 2
- '/// check state of navigator ! expected: closed ///'
+ printlog " check state of navigator ! expected: closed "
Kontext "Navigator"
if Navigator.exists then
- '///+ close navigator ! ///'
+ printlog "close navigator ! "
Navigator.Close
endif
else
warnlog "document didn't get loaded"
endif
- '/// Set "Start with current page" back to default = on, in ToolsOptions ///'
+ printlog "Set Start with current page back to default = on, in ToolsOptions "
setStartCurrentPage(TRUE)
- '/// Close the document ///'
+ printlog "Close the document "
call hCloseDocument
sLocaltestfile = hFileGetLocalPath( gTesttoolPath + "diashow.odp" )
printlog sLocaltestfile
@@ -714,110 +716,110 @@ testcase tSlideShowCustomSlideShow
dim sTemp as string
Seite = s1
- '/// open application ///'
+ printlog "open application "
Call hNewDocument
Kontext "Navigator"
if Navigator.Exists then Navigator.Close
- '/// Deactivate "Start with current page" in ToolsOptions ///'
+ printlog "Deactivate Start with current page in ToolsOptions "
setStartCurrentPage(FALSE)
- '/// create a rectangle ///'
+ printlog "create a rectangle "
hRechteckErstellen 30,30,60,60
- '/// do 2 times : ///'
+ printlog "do 2 times : "
for i = 1 to 2
- '///+ Insert->Slide... ///'
+ printlog "Insert->Slide... "
InsertSlide
sleep 2
hTypekeys "<Pagedown>"
sleep 2
- '///+ create a rectangle ///'
+ printlog "create a rectangle "
hRechteckErstellen 30,30,70,70
next i
- '/// Slide Show -> Slide Show Settings ///'
+ printlog "Slide Show -> Slide Show Settings "
SlideShowPresentationSettings
Kontext "Bildschirmpraesentation"
if (Fenster.IsChecked = False) Then Fenster.Check
- '/// close dialog 'Slide Show' with OK ///'
+ printlog "close dialog 'Slide Show' with OK "
Bildschirmpraesentation.OK
- '/// Slide Show -> Custom Slide Show... ///'
+ printlog "Slide Show -> Custom Slide Show... "
SlideShowCustomSlideshow
Kontext "IndividuellePraesentation"
- '///<b> click button 'New...' </b>///'
+ printlog "click button 'New...' "
Neu.Click
Kontext "IndividuellePraesentationDefinieren"
- '/// type something in 'Name' ///'
+ printlog "type something in 'Name' "
PraesentationName.SetText "Individually 1"
- '/// select the first entry in the list 'Existing Slides' ///'
+ printlog "select the first entry in the list 'Existing Slides' "
SeitenPraesentation.Select 1
- '/// click button '>>' ///'
+ printlog "click button '>>' "
Hinzufuegen.Click
i = SelectedSlides.GetItemCount
if (i <> 1) Then
Warnlog "- Number of slides 'Selected Slides' is not correct. It should be = '1', but it is = '" + i + "'"
endif
- '/// close dialog 'Define Custom Slide Show' with OK ///'
+ printlog "close dialog 'Define Custom Slide Show' with OK "
IndividuellePraesentationDefinieren.OK
Kontext "IndividuellePraesentation"
- '///<b> click button 'Edit...' </b>///'
+ printlog "click button 'Edit...'"
Bearbeiten.Click
Kontext "IndividuellePraesentationDefinieren"
- '/// select an entry in the list 'Selected Slides' ///'
+ printlog "select an entry in the list 'Selected Slides' "
SelectedSlides.TypeKeys "<pagedown>"
- '/// click button '<<' ///'
+ printlog "click button '<<' "
Entfernen.Click
i = SelectedSlides.GetItemCount
if (i <> 0) Then
Warnlog " Removing slides from list 'Selected Slides' does not work It should be = '1', but it is = '" + i + "'"
endif
- '/// select the first entry in the list 'Existing Slides' ///'
+ printlog "select the first entry in the list 'Existing Slides' "
SeitenPraesentation.Select 1
- '/// click button '>>' ///'
+ printlog "click button '>>' "
Hinzufuegen.Click
- '/// close dialog 'Define Custom Slide Show' with OK ///'
+ printlog "close dialog 'Define Custom Slide Show' with OK "
IndividuellePraesentationDefinieren.OK
Kontext "IndividuellePraesentation"
- '///<b> check checkbox 'Use Custom Slide Show' </b>///' '-------------------------------------------------------
+ printlog "check checkbox 'Use Custom Slide Show'"
IndividuellePraesentationBenutzen.Check
- '///<b> click button 'Start...' </b>///'
+ printlog "click button 'Start..."
Starten.Click
sleep 2
Kontext "DocumentPresentation"
- '/// press key [space] 2 times ///'
+ printlog "press key [space] 2 times "
DocumentPresentation.TypeKeys "<space>"
sleep 2
DocumentPresentation.TypeKeys "<space>"
sleep 5
try
Kontext "IndividuellePraesentation"
- '/// close dialog 'Custom Slide Shows' with button 'Close' ///'
+ printlog "close dialog 'Custom Slide Shows' with button 'Close' "
IndividuellePraesentation.Close
catch
Warnlog "- Slideshow did not end after slide 1"
DocumentPresentation.TypeKeys "<space>"
sleep 2
endcatch
- '/// Slide Show -> Custom Slide Show... ///'
+ printlog "Slide Show -> Custom Slide Show... "
SlideShowCustomSlideshow
Kontext "IndividuellePraesentation"
- '/// click button 'Edit...' ///'
+ printlog "click button 'Edit...' "
Bearbeiten.Click
Kontext "IndividuellePraesentationDefinieren"
- '/// select 1st entry in the list 'Selected Slides' ///'
+ printlog "select 1st entry in the list 'Selected Slides' "
SelectedSlides.Select 1
- '/// click button '<<' ///'
+ printlog "click button '<<' "
Entfernen.Click
i = SelectedSlides.GetItemCount
if (i <> 0) Then
Warnlog "- Add and remove slides does not work properly. It should be '0', but it is = '"+i+"'"
endif
- '/// select the first entry in the list 'Existing Slides' ///'
+ printlog "select the first entry in the list 'Existing Slides' "
SeitenPraesentation.Select 1
- '/// click button '>>' 4 times ///'
+ printlog "click button '>>' 4 times "
for i =1 to 4
Hinzufuegen.Click
next i
@@ -828,16 +830,16 @@ testcase tSlideShowCustomSlideShow
Warnlog "- Wrong slide added to individual slideshow. Instead of '" + Seite + "', '" + sTemp + "' was added"
endif
next i
- '/// close dialog 'Define Custom Slide Show' with OK ///'
+ printlog "close dialog 'Define Custom Slide Show' with OK "
IndividuellePraesentationDefinieren.OK
sleep 1
Kontext "IndividuellePraesentation"
- '///<b> UNcheck checkbox 'Use Custom Slide Show' </b>///'
+ printlog "UNcheck checkbox 'Use Custom Slide Show'"
IndividuellePraesentationBenutzen.UnCheck
- '/// click button 'Start...' ///'
- Starten.Click '---------------------------- START P ----------------------------------------------
- '/// press key [space] 4 times ///'
+ printlog "click button 'Start...' "
+ Starten.Click
+ printlog "press key [space] 4 times "
kontext "DocumentPresentation"
for i = 1 to 4
sleep 3
@@ -845,19 +847,19 @@ testcase tSlideShowCustomSlideShow
next i
sleep 10
kontext "IndividuellePraesentation"
- '/// close dialog 'Custom Slide Shows' with button 'Close' ///'
+ printlog "close dialog 'Custom Slide Shows' with button 'Close' "
if IndividuellePraesentation.exists then
IndividuellePraesentation.Close
else
Warnlog "'IndividuellePraesentation' was closed :-("
end if
- '/// Set "Start with current page" back to default = on, in ToolsOptions ///'
+ printlog "Set Start with current page back to default = on, in ToolsOptions "
setStartCurrentPage(TRUE)
- '/// close the application ///'
+ printlog "close the application "
Kontext "Navigator"
if Navigator.exists then
- '///+ close navigator ! ///'
+ printlog "close navigator ! "
Navigator.Close
else
printlog "Navigator: NOT available"
@@ -879,33 +881,33 @@ testcase tSlideShowSlideTransition
sFile = ConvertPath (gOfficePath + "user\work\diashow")
-' '/// open application ///'
+ printlog "open application "
call hNewDocument
- '/// close the navigator///'
+ printlog "close the navigator"
Kontext "Navigator"
if Navigator.Exists then Navigator.Close
WaitSlot (3000)
- '/// create 3 slides with a rectangle ///'
+ printlog "create 3 slides with a rectangle "
hRechteckErstellen (30,30,60,60)
for i = 1 to 2
- '///+ - Insert->Slide ///'
+ printlog " Insert->Slide "
WaitSlot (1000)
InsertSlide
WaitSlot (2000)
hTypekeys "<Pagedown>"
WaitSlot (2000)
- '///+ - insert rectangle///'
+ printlog " insert rectangle"
hRechteckErstellen (30,30,60,60)
next i
Printlog "created 3 slides"
- '/// for all 3 slides do: ///'
+ printlog "for all 3 slides do: "
for i = 1 to 3
- '///+ - open navigator with shortcutkey [MOD1 SHIFT F5] ///'
+ printlog "open navigator with shortcutkey [MOD1 SHIFT F5] "
hTypeKeys "<MOD1 SHIFT F5>"
Sleep (3)
Kontext "NavigatorDraw"
- '///+ - select the next slide in the list ///'
+ printlog "select the next slide in the list "
if Liste.GetItemCount < 3 then
warnlog "We have " + Liste.GetItemCount + " entries in the Navigator."
hTypeKeys "<MOD1 SHIFT F5>"
@@ -913,21 +915,21 @@ testcase tSlideShowSlideTransition
Kontext "NavigatorDraw"
end if
Liste.Select i
- '///+ - press key [return] ///'
+ printlog "press key [return] "
Liste.TypeKeys "<return>"
Kontext "Navigator"
- '///+ - close Navigator ///'
+ printlog "close Navigator "
Navigator.Close
- '///+ - SlideShow->SlideTransition ///'
+ printlog " SlideShow->SlideTransition "
SlideShowSlideTransition
Kontext "Tasks" '"SlideTransition"' "OL_DIA_Diawechsel" 'OL_DIA_Diawechsel
TransitionAutomaticPreview.UnCheck
- '///+ - click button 'Effects' ///'
+ printlog "click button 'Effects' "
TransitionApplyToSelectedSlide.typekeys "<pagedown>"
Sleep (1)
- '///+ - in the listbox 'speed' select the i. one from the top ///'
+ printlog "in the listbox 'speed' select the i. one from the top "
TransitionSpeed.Select i
- '///+ - Select an effect-group from the listbox ///'
+ printlog "Select an effect-group from the listbox "
TransitionApplyToSelectedSlide.typekeys "<home>"
for q= 1 to (i+2)
Sleep (2)
@@ -935,12 +937,13 @@ testcase tSlideShowSlideTransition
Sleep (2)
next q
sEffect(i) = TransitionApplyToSelectedSlide.GetSelText
- '///+ - click button 'Extras' ///'
+ printlog "click button 'Extras' "
Sleep (2)
+ printlog "click button 'Automatic Transition' "
select case i
- case 1: '///+ - + click button 'Automatic Transition' ///'
+ case 1:
TransitionAutomaticallyAfter.Check
- '///+ - + + Set Time to '00:00:01' OR ///'
+ printlog " Set Time to '00:00:01' OR "
TransitionAutomaticallyAfterTime.ToMin 'SetText "1" '"00:00:01"
TransitionAutomaticallyAfterTime.More
TransitionApplyToSelectedSlide.typekeys "<DOWN>"
@@ -948,8 +951,8 @@ testcase tSlideShowSlideTransition
TransitionAutomaticallyAfter.Check
Tasks.TypeKeys "<TAB><TAB><TAB>"
TimerValue = TransitionAutomaticallyAfterTime.GetText
- printlog " TimerValue is now: " + TimerValue
- case else: '///+ - + click button 'SemiAutomatic Transition' OR ///'
+ printlog "TimerValue is now: " + TimerValue
+ case else: printlog "click button 'SemiAutomatic Transition' OR "
TransitionOnMouseClick.Check
end select
Sleep (3)
@@ -958,26 +961,26 @@ testcase tSlideShowSlideTransition
Kontext "DocumentImpress"
Sleep (3)
- '/// SlideShow->Slide Show Settings... ///'
+ printlog "SlideShow->Slide Show Settings... "
SlideShowPresentationSettings
Kontext "Bildschirmpraesentation"
WaitSlot (2000)
- '/// check Radio button 'Type': 'Window' ///'
+ printlog "check Radio button 'Type': 'Window' "
Fenster.Check
- '/// close dialog 'Slide Show' ///'
+ printlog "close dialog 'Slide Show' "
Bildschirmpraesentation.OK
WaitSlot (5000)
Kontext "DocumentImpress"
- Printlog "'/// SlideShow->Slide Show ///'"
+ Printlog "printlog SlideShow->Slide Show"
SlideShowSlideshow
- '/// wait 10 sec ///'
- sleep (10) 'WaitSlot (10000)
+ printlog "wait 10 sec "
+ sleep (10)
Kontext "DocumentPresentation"
- '/// type key [ESCAPE] ///'
+ printlog "type key [ESCAPE] "
DocumentPresentation.TypeKeys "<ESCAPE>"
WaitSlot (3000)
try
- '/// type key [F11] to open the stylist (to check ending of presenation) ///'
+ printlog "type key [F11] to open the stylist (to check ending of presenation) "
if lcase(gPlatform) = "osx" then
hTypekeys "<mod1 t>"
else
@@ -986,7 +989,7 @@ testcase tSlideShowSlideTransition
Sleep (3)
Kontext "Gestalter"
Sleep (3)
- '/// close Stylist ///'
+ printlog "close Stylist "
Gestalter.Close
Printlog "- Slideshow worked"
catch
@@ -996,34 +999,33 @@ testcase tSlideShowSlideTransition
Sleep (2)
endcatch
- '/// close the navigator///'
+ printlog "close the navigator"
Kontext "Navigator"
if Navigator.Exists then Navigator.Close
- Printlog "'///+ check the settings in SlideView in the Dia object bar ///'"
+ Printlog "check the settings in SlideView in the Dia object bar "
for i = 1 to 3
Printlog " --------------------- " + i + " ---------------------------"
- '///+ - open navigator with shortcutkey [MOD1 SHIFT F5] ///'
+ printlog " open navigator with shortcutkey [MOD1 SHIFT F5] "
hTypeKeys "<MOD1 SHIFT F5>"
sleep (3)
Kontext "NavigatorDraw"
- '///+ - select the next slide in the list ///'
+ printlog " select the next slide in the list "
Liste.Select i
- '///+ - press key [return] ///'
+ printlog " press key [return] "
Liste.TypeKeys "<return>"
Kontext "Navigator"
- '///+ - close Navigator ///'
+ printlog " close Navigator "
Navigator.Close
- '///+ - View->Master View->Slides View ///'
-' ViewWorkspaceSlidesView
+ printlog " View->Master View->Slides View "
Sleep (2)
- Kontext "Tasks" 'SlideViewObjectbar"
- '///+ - check 'speed' ///'
+ Kontext "Tasks"
+ printlog " check 'speed' "
if Tasks.Exists = TRUE AND Tasks.IsVisible = TRUE then
x = TransitionSpeed.GetSelIndex 'TransitionSpeed
if (x <> i) then
Warnlog "Speed changed :-( is: '" + x + "' should be: '" + i + "'"
end if
- '///+ - check 'Transition' ///'
+ printlog " check 'Transition' "
x = TransitionApplyToSelectedSlide.GetSelIndex 'Diawechsel.GetSelIndex
if (x <> (i+3)) then
Warnlog "Transition changed :-( is: '" + x + "' should be: '" + (i+3) + "'"
@@ -1033,65 +1035,64 @@ testcase tSlideShowSlideTransition
end if
end if
- '///+ - check 'effect group' ///'
+ printlog " check 'effect group' "
sTemp = TransitionApplyToSelectedSlide.GetSelText
x = inStr (sTemp,sEffect(i))
Printlog " Effect tried :-) '" + x + "'"
if (x < 1) then
printlog "the string '" + sTemp + "' should contain the words(s): '" + sEffect(i) + "'"
end if
-' ViewWorkspaceDrawingView
else
warnlog " SlideViewObjectbar doesnt exists or isnt visible"
end if
next i
- '/// save file as presentation with name '"user\\work\\diashow")' ///'
+ printlog "save file as presentation with name 'user\work\diashow)' "
hFileSaveAsWithFilterKill ((sFile + ".odp") , "impress8" )
Printlog " saved presentation: '" + sFile + "'" '." + gImpressFilter + "
- '/// close application///'
+ printlog "close application"
hCloseDocument ()
WaitSlot (10000)
- '/// load file again ///'
+ printlog "load file again "
hFileOpen (sFile + ".odp")
WaitSlot (5000)
- Printlog " '/// check setings for every slide in the transition dialog ///'"
- '///+ for all 3 slides do: ///'
+ Printlog "check setings for every slide in the transition dialog "
+ printlog " for all 3 slides do: "
for i = 1 to 3
- Printlog " --------------------- " + i + " ---------------------------"
- '///+ - open navigator with shortcutkey [MOD1 SHIFT F5] ///'
- hTypeKeys "<MOD1 SHIFT F5>"
- Sleep (3)
- Kontext "NavigatorDraw"
- '///+ - select the next slide in the list ///'
- Liste.Select i
- '///+ - press key [return] ///'
- Liste.TypeKeys "<return>"
- Kontext "Navigator"
- '///+ - close Navigator ///'
- Navigator.Close
- '///+ - select the grafik with the key [TAB] ///'
- hTypeKeys ("<tab>")
- '///+ - SlideShow->SlideTransition ///'
- SlideShowSlideTransition
+ Printlog " --------------------- " + i + " ---------------------------"
+ printlog " open navigator with shortcutkey [MOD1 SHIFT F5] "
+ hTypeKeys "<MOD1 SHIFT F5>"
+ Sleep (3)
+ Kontext "NavigatorDraw"
+ printlog " select the next slide in the list "
+ Liste.Select i
+ printlog " press key [return] "
+ Liste.TypeKeys "<return>"
+ Kontext "Navigator"
+ printlog " close Navigator "
+ Navigator.Close
+ printlog " select the grafik with the key [TAB] "
+ hTypeKeys ("<tab>")
+ printlog " SlideShow->SlideTransition "
+ SlideShowSlideTransition
Kontext "Tasks"
Sleep (1)
- '///+ - check 'speed' ///'
+ printlog " check 'speed' "
x = TransitionSpeed.GetSelIndex
if (x <> i) then
Warnlog " Speed changed :-( is: '" + x + "' should: '" + i + "'"
end if
- '///+ - check 'effect group' ///'
+ printlog " check 'effect group' "
x = TransitionApplyToSelectedSlide.GetSelIndex
if (x <> (i+3)) then
Warnlog " Effect changed :-( is: '" + x + "' should: '" + (i+3) + "'"
end if
sleep (1)
select case i
- case 1: '///+ - click button 'Automatic Transition' ///'
+ case 1: printlog " click button 'Automatic Transition' "
if (TransitionAutomaticallyAfter.IsEnabled) then
- '///+ - + + Check Time '1' OR ///'
+ '///+ - + + Check Time '1' OR "
sTemp = TransitionAutomaticallyAfterTime.GetText
if (sTemp <> TimerValue) then
Warnlog " Time is different :-( is: '" + sTemp + "' should be: '" + TimerValue + "'" '"00:00:01"
@@ -1100,27 +1101,27 @@ testcase tSlideShowSlideTransition
Warnlog " button 'Automatic Transition' not pressed ?"
end if
case 2: if (TransitionAutomaticallyAfter.IsChecked <> FALSE) then
- '///+ - + check button 'SemiAutomatic Transition' OR ///'
+ '///+ - + check button 'SemiAutomatic Transition' OR "
Warnlog " button 'Automatic Transition' is pressed ?"
end if
case 3: if (TransitionAutomaticallyAfter.IsChecked <> FALSE) then
- '///+ - + click button 'Manual Transition' ///'
+ '///+ - + click button 'Manual Transition' "
Warnlog " button 'Automatic Transition' is pressed ?"
end if
end select
Sleep (3)
next i
TransitionAutomaticPreview.Check
- '/// Set "Start with current page" back to default = on, in ToolsOptions ///'
+ printlog "Set Start with current page back to default = on, in ToolsOptions "
setStartCurrentPage(TRUE)
Kontext "Navigator"
if Navigator.exists then
- '///+ close navigator ! ///'
+ printlog " close navigator ! "
Navigator.Close
else
printlog "Navigator: NOT available"
end if
- '/// Close the document ///'
+ printlog "Close the document "
call hCloseDocument
endcase 'tSlideShowSlideTransition
@@ -1140,7 +1141,7 @@ testcase tSlideShowShowHideSlide
saSlideNames(3) = S3
saSlideNames(4) = S4
- printlog "Open file 'graphics\\input\\diashow.odp' (Slide Show with 4 Slides)"
+ printlog "Open file 'graphics\input\diashow.odp' (Slide Show with 4 Slides)"
hFileOpen ConvertPath (gTesttoolPath + "graphics\required\input\diashow.odp")
sleep (10)
printlog "check if the document is writable"
@@ -1190,7 +1191,7 @@ testcase tSlideShowShowHideSlide
SlideShowSlideshow
sleep (1)
kontext "DocumentPresentation"
- printlog "type the key [MOD1 SHIFT F5] to open the navigator" '--------------------------------------------------------------------------
+ printlog "type the key [MOD1 SHIFT F5] to open the navigator"
DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
sleep (1)
kontext "NavigatorDraw"
@@ -1241,4 +1242,4 @@ testcase tSlideShowShowHideSlide
endcase 'tSlideShowShowHideSlide
-'------------------------------------------------------------------------------
+'------------------------------------------------------------------------------ \ No newline at end of file
diff --git a/testautomation/graphics/optional/includes/impress/i_slideshow2.inc b/testautomation/graphics/optional/includes/impress/i_slideshow2.inc
index b15beb28932d..2df33261c6f2 100644
--- a/testautomation/graphics/optional/includes/impress/i_slideshow2.inc
+++ b/testautomation/graphics/optional/includes/impress/i_slideshow2.inc
@@ -30,33 +30,29 @@
'* short description :
'*
'*******************************************************************
-'*
-' #1 tPraesentationAnimation
-' #1 tPraesentationEffekt
-' #1 tSlideShowInteraction
-' #1 tAendernObjektBenennen
-' #1 tSlideshowBackgroundAllSlides
-' #1 tSlideshowBackgroundSelectedSlide
-'*
-'\******************************************************************
testcase tPraesentationAnimation
+
Dim i
- Printlog "- Slideshow/Animation"
+ Printlog "- Slideshow/Animation"
+ printlog "new document "
Call hNewDocument
- Call sSelectEmptyLayout '/// new document ///'
- sleep 2
- InsertGraphicsFromFile '/// insert graphic ///'
- Kontext "OeffnenDlg"
- Dateiname.SetText ConvertPath (gTesttoolPath + "global/input/graf_inp/desp.bmp")
- sleep 2
- Oeffnen.Click
- sleep 2
+ Call sSelectEmptyLayout
+ sleep 2
+ printlog "insert graphic"
+ InsertGraphicsFromFile
+ Kontext "OeffnenDlg"
+ Dateiname.SetText ConvertPath (gTesttoolPath + "global/input/graf_inp/desp.bmp")
+ sleep 2
+ Oeffnen.Click
+ sleep 2
- gMouseClick 90,90 '/// deselect graphic ///'
+ printlog "deselect graphic"
+ gMouseClick 90,90
- InsertGraphicsFromFile '/// insert 2nd graphic ///'
+ printlog "insert 2nd graphic"
+ InsertGraphicsFromFile
Kontext "OeffnenDlg"
Dateiname.SetText ConvertPath (gTesttoolPath + "global/input/graf_inp/borabora.jpg")
sleep 2
@@ -65,15 +61,18 @@ testcase tPraesentationAnimation
Call hTypekeys "<TAB>"
- Opl_SD_EffekteZulassen '/// open animation dialogue ///'
+ printlog "open animation dialogue"
+ Opl_SD_EffekteZulassen
Kontext "Animation"
for i=1 to 10
- BildAufnehmen.Click '/// add graphic 10 times ///'
+ printlog "add graphic 10 times"
+ BildAufnehmen.Click
next i
sleep 1
- if AnzahlBilder.GetText <> "10" Then '/// get number of frames (should be 10) ///'
+ printlog "get number of frames (should be 10) "
+ if AnzahlBilder.GetText <> "10" Then
WarnLog " - Adding pictures did not work"
else
PrintLog " Pictures added"
@@ -81,52 +80,63 @@ testcase tPraesentationAnimation
if AlleAufnehmen.IsEnabled Then WarnLog " - Add all should not be enabled because only 1 object is selected"
- Kontext "DocumentImpress"
- EditSelectAll '/// select both graphics in document ///'
+ Kontext "DocumentImpress"
+ printlog "select both graphics in document "
+ EditSelectAll
- Kontext "Animation"
+ Kontext "Animation"
+ printlog "add them 5 times (10 frames)"
for i=1 to 5
- printlog i
- AlleAufnehmen.Click '/// add them 5 times (10 frames) ///'
+ printlog i
+ AlleAufnehmen.Click
next i
sleep 1
- if AnzahlBilder.GetText <> "20" Then '/// compare total numbers of frame ///'
+ printlog "compare total numbers of frame"
+ if AnzahlBilder.GetText <> "20" Then
WarnLog " - Adding pics does not work"
else
PrintLog " all pics added"
end if
- ErstesBild.Click '/// jump to 1st frame ///'
+ printlog "jump to 1st frame"
+ ErstesBild.Click
- if AnzahlBilder.GetText <> "1" Then '/// get number index of selected frame ///'
+ printlog "get number index of selected frame"
+ if AnzahlBilder.GetText <> "1" Then
WarnLog " - Jump back to beginning does not work"
else
PrintLog " Jump back to beginning works"
end if
- LetztesBild.Click '/// jump to last frame ///'
+ printlog "jump to last frame"
+ LetztesBild.Click
- if AnzahlBilder.GetText <> "20" Then '/// control number index of selected frame ///'
+ printlog "control number index of selected frame"
+ if AnzahlBilder.GetText <> "20" Then
WarnLog " - Jump to end does not work"
else
PrintLog " Jumped to end"
end if
sleep 1
- Abspielen.Click '/// play animation ///'
+ printlog "play animation"
+ Abspielen.Click
sleep 10
Kontext "DocumentImpress"
- EditSelectAll '/// delete graphics in document ///'
+ printlog "delete graphics in document "
+ EditSelectAll
DocumentImpress.TypeKeys "<DELETE>"
sleep 2
Kontext "Animation"
- Erstellen.Click '/// create animation ///'
+ printlog "create animation"
+ Erstellen.Click
sleep 10
Kontext "DocumentImpress"
try
- EditCopy '/// try to copy created animation to make sure it is created ///'
+ printlog "try to copy created animation to make sure it is created"
+ EditCopy
PrintLog " Animation created"
catch
WarnLog " - Animation not created"
@@ -134,7 +144,8 @@ testcase tPraesentationAnimation
Kontext "Animation"
- if AnimationsgruppeGruppenobjekt.IsChecked = True Then '/// set duration time of frames ///'
+ printlog "set duration time of frames"
+ if AnimationsgruppeGruppenobjekt.IsChecked = True Then
try
AnzeigedauerProBild.SetText "1"
WarnLog " - Control should be disabled"
@@ -143,11 +154,14 @@ testcase tPraesentationAnimation
endcatch
end if
- AnimationsgruppeBitmapobjekt.Check '/// check group object ///'
+ printlog "check group object"
+ AnimationsgruppeBitmapobjekt.Check
- AnzeigedauerProBild.SetText "3" '/// set frame visibility time to 3 ///'
+ printlog "set frame visibility time to 3"
+ AnzeigedauerProBild.SetText "3"
SetClipboard AnzeigedauerProBild.GetText
- AnzeigedauerProBild.More '/// raise value for frame time ///'
+ printlog "raise value for frame time"
+ AnzeigedauerProBild.More
if AnzeigedauerProBild.GetText<> GetClipboardText Then
PrintLog " Duration per frame works"
else
@@ -155,7 +169,8 @@ testcase tPraesentationAnimation
end if
Dim Zaehler
- Zaehler = AnzahlDurchlaeufe.GetItemCount '/// test different settings for pass amount ///'
+ printlog "test different settings for pass amount"
+ Zaehler = AnzahlDurchlaeufe.GetItemCount
for i=1 to Zaehler
AnzahlDurchlaeufe.Select i
next i
@@ -167,36 +182,43 @@ testcase tPraesentationAnimation
Anpassung.Select i
next i
- BildLoeschen.Click '/// delete 1 frame ///'
+ printlog "delete 1 frame"
+ BildLoeschen.Click
if AnzahlBilder = "20" Then
WarnLog " - Deleting pictures does not work"
else
PrintLog " Picture No.20 deleted"
end if
- AlleLoeschen.Click '/// delete all frames ///'
+ printlog "delete all frames"
+ AlleLoeschen.Click
Kontext "Active"
Active.Yes
sleep 3
Kontext "Animation"
- if Abspielen.IsEnabled = true Then '/// check if play button is still active ///'
+ printlog "check if play button is still active"
+ if Abspielen.IsEnabled = true Then
WarnLog " - Not all pics are deleted"
else
PrintLog " All pics deleted"
end if
sleep 2
- Animation.Close '/// close animation flyer ///'
+ printlog "close animation flyer"
+ Animation.Close
sleep 2
- Call hCloseDocument '/// close document ///'
-endcase
+ printlog "close document "
+ Call hCloseDocument
+endcase 'tPraesentationAnimation
'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
testcase tPraesentationEffekt
+
qaerrorlog "Test not yet ready."
goto endsub
- Printlog "- Slideshow/Effect"
+
+
Dim i
Dim j
Dim k
@@ -208,11 +230,14 @@ testcase tPraesentationEffekt
Dim ZaehlerText
Dim ZaehlerTon
Dim Zufall
- Call hNewDocument '/// new document ///'
- '/// check state of navigator ! expected: closed ///'
+
+ Printlog "- Slideshow/Effect"
+ printlog "new document "
+ Call hNewDocument
+ printlog " check state of navigator ! expected: closed"
Kontext "Navigator"
if Navigator.exists then
- '///+ close navigator ! ///'
+ printlog " close navigator !"
Navigator.Close
Warnlog "Navigator was open. Check earlier tests. Now closed."
else
@@ -221,17 +246,22 @@ testcase tPraesentationEffekt
sleep 2
kontext "DocumentImpress"
gMouseClick 50,50
- hRechteckErstellen (20,20,50,50) '/// create rectangle ///'
+ printlog "create rectangle"
+ hRechteckErstellen (20,20,50,50)
sleep 3
Kontext "Effekt"
Printlog " - Test effects"
- gMouseClick 90,90 '/// deselect rectangle ///'
+ printlog "deselect rectangle"
+ gMouseClick 90,90
sleep 1
- DocumentImpress.TypeKeys "<TAB>" '/// select rectangle ///'
+ printlog "select rectangle "
+ DocumentImpress.TypeKeys "<TAB>"
sleep 1
- DocumentImpress.TypeKeys "<F2>" '/// go into text edit mode (F2) ///'
+ printlog "go into text edit mode (F2)"
+ DocumentImpress.TypeKeys "<F2>"
sleep 1
- DocumentImpress.TypeKeys "test text to test text effects" '/// type text into the rectangle ///'
+ printlog "type text into the rectangle"
+ DocumentImpress.TypeKeys "test text to test text effects"
sleep 1
DocumentImpress.TypeKeys "<ESCAPE>"
sleep 2
@@ -242,7 +272,8 @@ testcase tPraesentationEffekt
sleep 3
Effekte.Click
Zaehler=Effekteliste.GetItemCount
- for i=2 to Zaehler '/// Start from the second entry since the first one is "No effect" ///'
+ printlog "Start from the second entry since the first one is No effect"
+ for i=2 to Zaehler
Effekteliste.Select i
SetClipboard Effekteliste.GetSelText
Effekt.TypeKeys "<TAB>"
@@ -398,7 +429,7 @@ testcase tPraesentationEffekt
Effekt.Close
sleep 1
Call hCloseDocument
-endcase
+endcase 'tPraesentationEffekt
'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -410,14 +441,15 @@ testcase tSlideShowInteraction
Datei$ = ConvertPath (gOfficePath + "user\work\interac.odp")
- '/// open application ///'
+ printlog "open application"
Call hNewDocument
Call sSelectEmptyLayout
sleep 5
- setStartCurrentPage(TRUE) '/// Set "start with current page to ON ///'
+ printlog "Set start with current page to ON"
+ setStartCurrentPage(TRUE)
- '/// call 'Insert->Slide' three times and name the slides 2, 3, 4 and create a rectangl� on it ///'
- '///+ we now have 4 slides ?! :-) ///'
+ printlog "call 'Insert->Slide' three times and name the slides 2, 3, 4 and create a rectangle on it "
+ printlog "we now have 4 slides"
Kontext "DocumentImpress"
for i = 2 to 4
InsertSlide
@@ -430,7 +462,7 @@ testcase tSlideShowInteraction
sleep 2
next i
- '/// check state of navigator ! expected: closed -> open navigator ///'
+ printlog " check state of navigator ! expected: closed -> open navigator"
Kontext "Navigator"
if Navigator.exists then
qaerrorlog "Navigator: already open :-("
@@ -442,7 +474,7 @@ testcase tSlideShowInteraction
endif
sleep 3
- '/// Slide Show->Interaction ///'
+ printlog "Slide Show->Interaction"
SlideShowInteraction
Kontext "TabInteraktion"
sleep 1
@@ -658,7 +690,7 @@ testcase tSlideShowInteraction
endif
sleep 6
- '/// Do Page down + Page up due to focusing-problems ///'
+ printlog "Do Page down + Page up due to focusing-problems"
kontext "Slides"
hTypeKeys "<PAGEDOWN>"
hTypeKeys "<PAGEUP>"
@@ -828,20 +860,21 @@ testcase tSlideShowInteraction
endcatch
Kontext "DocumentImpress"
- '/// Close the Navigator ///'
+ printlog "Close the Navigator"
DocumentImpress.TypeKeys "<MOD1 SHIFT F5>"
sleep 3
- '/// Set "start with current page to ON = Default ///'
+ printlog "Set start with current page to ON = Default"
setStartCurrentPage(TRUE)
Call hCloseDocument
-endcase
+endcase 'tSlideShowInteraction
'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
testcase tAendernObjektBenennen
Printlog "- Context/Name object"
+ printlog "new document "
Call hNewDocument
- Call sSelectEmptyLayout '/// new document ///'
+ Call sSelectEmptyLayout
sleep 1
Kontext "DocumentImpress"
@@ -900,7 +933,7 @@ testcase tAendernObjektBenennen
sleep 2
Call hCloseDocument
sleep 2
-endcase
+endcase 'tAendernObjektBenennen
'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -912,23 +945,23 @@ testcase tSlideshowBackgroundAllSlides
Background$ = ConvertPath(gOfficeBasisPath + "share\gallery\emoticons\grin.gif")
Datei$ = ConvertPath (gOfficePath + "user\work\background.odp")
- '/// Create a new document ///'
+ printlog "Create a new document"
Printlog "- SlideshowBackground"
Call hNewDocument
- '/// Insert a new Slide ///'
+ printlog "Insert a new Slide"
Kontext "DocumentImpress"
InsertSlide
- '/// Open the Contextmenu ///'
+ printlog "Open the Contextmenu"
DocumentImpress.OpenContextMenu
- '/// Select the entry "Slide" ///'
+ printlog "Select the entry Slide"
hMenuFindSelect (".uno:PageMenu", true, 1, true)
- '/// Select the entry "Background" ///'
+ printlog "Select the entry Background"
hMenuSelectNr (4)
- '/// In the open-file dialogue, choose and open a graphic-file you wish to have as a background ///'
+ printlog "In the open-file dialogue, choose and open a graphic-file you wish to have as a background"
kontext "GrafikEinfuegenDlg"
If GrafikEinfuegenDlg.Exists Then
DateiName.SetText (Background$)
@@ -937,7 +970,7 @@ testcase tSlideshowBackgroundAllSlides
warnlog "GrafikEinfuegenDlg not existent... check why."
End if
- '/// If an "active"-message shows up, press "yes" to apply this background to all slides. ///'
+ printlog "If an active-message shows up, press yes to apply this background to all slides."
kontext "Active"
if Active.Exists then
Active.Yes
@@ -945,43 +978,45 @@ testcase tSlideshowBackgroundAllSlides
QaErrorLog "No dialogue considering if we wish to apply the background to all slides."
end if
- '/// Save the document ///'
+ printlog "Save the document"
Call hFileSaveAsKill (Datei$)
- '/// Close the document ///'
+ printlog "Close the document"
Call hCloseDocument
- '/// Open the document ///'
+ printlog "Open the document"
Call hFileOpen (Datei$)
- '/// Close the document ///'
+ printlog "Close the document"
Call hCloseDocument
-endcase
+endcase 'tSlideshowBackgroundAllSlides
'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
testcase tSlideshowBackgroundSelectedSlide
+
Dim Datei$ as string
Dim Background$ as string
Dim i as integer
Dim Zaehler as integer
+
Background$ = ConvertPath(gOfficeBasisPath + "share\gallery\emoticons\grin.gif")
Datei$ = ConvertPath (gOfficePath + "user\work\background.odp")
- '/// Create a new document ///'
+ printlog "Create a new document"
Printlog "- SlideshowBackground"
Call hNewDocument
- '/// Insert a new Slide ///'
+ printlog "Insert a new Slide"
Kontext "DocumentImpress"
InsertSlide
- '/// Open the Contextmenu ///'
+ printlog "Open the Contextmenu"
DocumentImpress.OpenContextMenu
- '/// Select the entry "Slide" ///'
+ printlog "Select the entry Slide"
hMenuFindSelect (".uno:PageMenu", true, 1, true)
- '/// Select the entry "Background" ///'
+ printlog "Select the entry Background"
hMenuSelectNr (4)
- '/// In the open-file dialogue, choose and open a graphic-file you wish to have as a background ///'
+ printlog "In the open-file dialogue, choose and open a graphic-file you wish to have as a background"
kontext "GrafikEinfuegenDlg"
If GrafikEinfuegenDlg.Exists Then
DateiName.SetText (Background$)
@@ -990,7 +1025,7 @@ testcase tSlideshowBackgroundSelectedSlide
warnlog "GrafikEinfuegenDlg not existent... check why."
End if
- '/// If an "active"-message shows up, press "No" to only apply this background to the selected slide. ///'
+ printlog "If an active-message shows up, press No to only apply this background to the selected slide."
kontext "Active"
if Active.Exists then
Active.No
@@ -998,14 +1033,14 @@ testcase tSlideshowBackgroundSelectedSlide
QaErrorLog "No dialogue considering if we wish to apply the background to all slides."
end if
- '/// Save the document ///'
+ printlog "Save the document"
Call hFileSaveAsKill (Datei$)
- '/// Close the document ///'
+ printlog "Close the document"
Call hCloseDocument
- '/// Open the document ///'
+ printlog "Open the document"
Call hFileOpen (Datei$)
- '/// Close the document ///'
+ printlog "Close the document"
Call hCloseDocument
-endcase
+endcase 'tSlideshowBackgroundSelectedSlide
-'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file
diff --git a/testautomation/graphics/optional/includes/impress/i_slideshow3.inc b/testautomation/graphics/optional/includes/impress/i_slideshow3.inc
index bc138fef445d..07ac2f0d9def 100644
--- a/testautomation/graphics/optional/includes/impress/i_slideshow3.inc
+++ b/testautomation/graphics/optional/includes/impress/i_slideshow3.inc
@@ -30,125 +30,140 @@
'* short description :
'*
'*******************************************************************
-' #1 tExtrasInteraktion
-' #1 tExtrasEffekt
-' #1 tExtrasPraesentationseinstellungen
-' #1 tExtrasIndividuellePraesentation
-' #1 tExtrasInteraktion
-' #1 tSlideshowContextMenuOneSlide
-' #1 tSlideshowContextMenuMoreSlides
-' #1 tiMousePointerHides
-'\******************************************************************
testcase tExtrasInteraktion
+
+ Dim i
+ Dim Zaehler
+
+
Printlog " - SlideShow/Interaction"
- Call hNewDocument
- Call sSelectEmptyLayout
- sleep 1
- Call hTextrahmenErstellen ("Seite 1",10,10,40,40) '/// create textbox ///'
- SlideShowPresentationSettings '/// Set slide show settings ///'
- Kontext "Bildschirmpraesentation"
- NavigatorSichtbar.Check '/// Navigator visible ///'
- Bildschirmpraesentation.OK
- SlideShowInteraction '/// open Interaction ///'
- Kontext "Interaktion"
- if Interaktion.exists(5)then
- AktionBeiMausklick.Select 1 '/// Select "Go to previous slide" ///'
- else
- Print "Interaction doesnt exist, something is wrong here."
- endif
- Interaktion.OK
- Kontext "DocumentImpress"
- SlideShowSlideshow '/// Run slideshow ///'
- Sleep (2)
- Kontext "DokumentPraesentation"
- DokumentPraesentation.TypeKeys "<ESCAPE>"
- Sleep 2
- Kontext "DocumentImpress"
- gMouseClick 20,20
- EditSelectAll
- try
- EditCopy
- Printlog " Interaction ->No action works"
- Kontext "DocumentImpress"
- catch
- Warnlog " - Interaction->does not work properly: Should be: Page 2 but it is: " + GetClipboardText
- DocumentImpress.TypeKeys "<ESCAPE>"
- Kontext "DocumentImpress"
- endcatch
- hCloseDocument
- Call hNewDocument
- Call sSelectEmptyLayout
- Call hRechteckErstellen (50,50,80,80) '/// create rectangle ///'
- SlideShowInteraction
- Kontext "Interaktion"
- Dim i
- Dim Zaehler
- Zaehler=AktionBeiMausklick.GetItemCount
- For i=2 to Zaehler
- AktionBeiMausklick.Select i '/// select actions ///'
- SetClipboard AktionBeiMausklick.GetSelText
- Interaktion.OK
- Kontext "DocumentImpress"
- EditSelectAll
- SlideShowInteraction
- Kontext "Interaktion"
+ Call hNewDocument
+ Call sSelectEmptyLayout
+ sleep 1
+ printlog "create textbox"
+ Call hTextrahmenErstellen ("Seite 1",10,10,40,40)
+ printlog "Set slide show settings"
+ SlideShowPresentationSettings
+ Kontext "Bildschirmpraesentation"
+ printlog "Navigator visible"
+ NavigatorSichtbar.Check
+ Bildschirmpraesentation.OK
+ printlog "open Interaction"
+ SlideShowInteraction
+ Kontext "Interaktion"
+ if Interaktion.exists(5)then
+ printlog "Select Go to previous slide"
+ AktionBeiMausklick.Select 1
+ else
+ Print "Interaction doesnt exist, something is wrong here."
+ endif
+ Interaktion.OK
+ Kontext "DocumentImpress"
+ printlog "Run slideshow"
+ SlideShowSlideshow
+ Sleep (2)
+ Kontext "DokumentPraesentation"
+ DokumentPraesentation.TypeKeys "<ESCAPE>"
+ Sleep 2
+ Kontext "DocumentImpress"
+ gMouseClick 20,20
+ EditSelectAll
+ try
+ EditCopy
+ Printlog " Interaction ->No action works"
+ Kontext "DocumentImpress"
+ catch
+ Warnlog " - Interaction->does not work properly: Should be: Page 2 but it is: " + GetClipboardText
+ DocumentImpress.TypeKeys "<ESCAPE>"
+ Kontext "DocumentImpress"
+ endcatch
+ hCloseDocument
+
+ Call hNewDocument
+ Call sSelectEmptyLayout
+ printlog "create rectangle"
+ Call hRechteckErstellen (50,50,80,80)
+ SlideShowInteraction
+ Kontext "Interaktion"
+ Zaehler=AktionBeiMausklick.GetItemCount
+ For i=2 to Zaehler
+ printlog "select actions"
+ AktionBeiMausklick.Select i
+ SetClipboard AktionBeiMausklick.GetSelText
+ Interaktion.OK
+ Kontext "DocumentImpress"
+ EditSelectAll
+ SlideShowInteraction
+ Kontext "Interaktion"
+ printlog "control if action is saved (closing reopening dialog)"
if GetClipboardText<>AktionBeiMausklick.GetSelText Then
- Warnlog " Action at mouseclick - " + GetClipboardText + " - not taken" '/// control if action is saved (closing reopening dialog) ///'
+ Warnlog " Action at mouseclick - " + GetClipboardText + " - not taken"
else
- Printlog " Action at mouseclick - " + GetClipboardText + " - runs"
+ Printlog " Action at mouseclick - " + GetClipboardText + " - runs"
end if
- next i
- Interaktion.OK
- sleep 1
- Call hCloseDocument '/// close document ///'
-endcase
+ next i
+ Interaktion.OK
+ sleep 1
+ printlog "close document"
+ Call hCloseDocument
+endcase 'tExtrasInteraktion
+
+'-------------------------------------------------------------------------------
testcase tExtrasEffekt
qaerrorlog "Test not yet ready."
- goto endsub
- Dim i
- Dim j
- Dim k
- Dim l
- Dim m
- Dim n
- Dim Zaehler
- Dim ZaehlerKmh
- Dim ZaehlerText
- Dim ZaehlerTon
- Dim Zufall
- Call hNewDocument '/// New impress document ///'
-
- '/// check state of navigator ! expected: closed ///'
- Kontext "Navigator"
- if Navigator.exists then
- '///+ close navigator ! ///'
- Navigator.Close
- Warnlog "Navigator was open. Check earlier tests. Now closed."
- else
- printlog "Navigator: NOT available. Good."
- endif
-
- gMouseClick 50,50
- hRechteckErstellen (20,20,50,50) '/// create rectangle ///'
- sleep 2
- DocumentImpress.TypeKeys "<F2>"
- DocumentImpress.TypeKeys "- This is text to test the text effects of the Effects flyer"
- sleep 1
- gMouseClick 90,90 '/// deselect rectangle ///'
- DocumentImpress.TypeKeys "<TAB>" '/// reselect rectangle ///'
-
- sleep 1
- Kontext "Effekt"
+ goto endsub
+ Dim i
+ Dim j
+ Dim k
+ Dim l
+ Dim m
+ Dim n
+ Dim Zaehler
+ Dim ZaehlerKmh
+ Dim ZaehlerText
+ Dim ZaehlerTon
+ Dim Zufall
+
+ printlog "New impress document"
+ Call hNewDocument
+
+ printlog " check state of navigator ! expected: closed"
+ Kontext "Navigator"
+ if Navigator.exists then
+ printlog " close navigator !"
+ Navigator.Close
+ Warnlog "Navigator was open. Check earlier tests. Now closed."
+ else
+ printlog "Navigator: NOT available. Good."
+ endif
+
+ gMouseClick 50,50
+ printlog "create rectangle"
+ hRechteckErstellen (20,20,50,50)
+ sleep 2
+ DocumentImpress.TypeKeys "<F2>"
+ DocumentImpress.TypeKeys "- This is text to test the text effects of the Effects flyer"
+ sleep 1
+ printlog "deselect rectangle"
+ gMouseClick 90,90
+ printlog "reselect rectangle"
+ DocumentImpress.TypeKeys "<TAB>"
+
+ sleep 1
+ Kontext "Effekt"
Printlog " - Test effect flyer"
- SlideShowEffects '/// Open effect flyer ///'
- Kontext "ExtrasEffekt"
- sleep 1
- Effekte.Click
- Zaehler=Effekteliste.GetItemCount '/// select each effect 1 time, assign effect and close dialog ///'
- for i=1 to Zaehler '/// reopen dialog and check if the effect is still there ///'
+ printlog "Open effect flyer"
+ SlideShowEffects
+ Kontext "ExtrasEffekt"
+ sleep 1
+ Effekte.Click
+ printlog "select each effect 1 time, assign effect and close dialog"
+ Zaehler=Effekteliste.GetItemCount
+ printlog "reopen dialog and check if the effect is still there"
+ for i=1 to Zaehler
Effekteliste.Select i
SetClipboard Effekteliste.GetSelText
Effekt.TypeKeys "<TAB>"
@@ -159,15 +174,16 @@ testcase tExtrasEffekt
SlideShowEffects
Kontext "Effekt"
sleep 1
- if GetClipboardText<>Effekteliste.GetSelText Then Warnlog " - Invisible color not chosen"
- printlog GetClipboardText + " should be " + Effekteliste.GetSelText
+ if GetClipboardText<>Effekteliste.GetSelText Then Warnlog " - Invisible color not chosen"
+ printlog GetClipboardText + " should be " + Effekteliste.GetSelText
- sleep 1
+ sleep 1
next i
sleep 2
- Texteffekte.Click '/// test text effects ///'
- sleep 1
- ZaehlerKmh=Geschwindigkeit.GetItemCount
+ printlog "test text effects"
+ Texteffekte.Click
+ sleep 1
+ ZaehlerKmh=Geschwindigkeit.GetItemCount
for j=1 to ZaehlerKmh
Geschwindigkeit.Select j
SetClipboard Geschwindigkeit.GetSelText
@@ -176,14 +192,14 @@ testcase tExtrasEffekt
SlideShowEffects
Kontext "Effekt"
sleep 1
- if GetClipboardText<>Geschwindigkeit.GetSelText Then Warnlog " - Speed not taken over"
+ if GetClipboardText<>Geschwindigkeit.GetSelText Then Warnlog " - Speed not taken over"
next j
- Printlog " - Speed test ok"
+ Printlog " - Speed test ok"
- Printlog " - Test text effects"
- Texteffekte.Click
- sleep 1
- ZaehlerText=TexteffekteListe.GetItemCount
+ Printlog " - Test text effects"
+ Texteffekte.Click
+ sleep 1
+ ZaehlerText=TexteffekteListe.GetItemCount
for k=1 to ZaehlerText
TexteffekteListe.Select k
printlog TexteffekteListe.GetSelText + "-effect choosen"
@@ -199,19 +215,19 @@ testcase tExtrasEffekt
Texteffekte.Click
printlog "and when we closed the window and opened again... " + TexteffekteListe.GetSelText + " was choosen"
sleep 1
- if GetClipboardText<>TexteffekteListe.GetSelText Then Warnlog " - Texteffect did not changed"
- sleep 1
+ if GetClipboardText<>TexteffekteListe.GetSelText Then Warnlog " - Texteffect did not changed"
+ sleep 1
next k
Printlog " - Test invisible color"
- Effekte.Click
- Effekteliste.Select 1
- Effekteauswahl.TypeKeys "<RIGHT>",2
- Zuweisen.Click
- sleep 1
- Extras.Click
- sleep 1
- randomize
- Zufall=((2*Rnd)+1)
+ Effekte.Click
+ Effekteliste.Select 1
+ Effekteauswahl.TypeKeys "<RIGHT>",2
+ Zuweisen.Click
+ sleep 1
+ Extras.Click
+ sleep 1
+ randomize
+ Zufall=((2*Rnd)+1)
for l=1 to 4
UnsichtbarMachen.Click
sleep 1
@@ -222,14 +238,15 @@ testcase tExtrasEffekt
Kontext "Effekt"
sleep 1
Effekteauswahl.TypeKeys "<RIGHT>",2
- Extras.Click '/// test extras ///'
+ printlog "test extras"
+ Extras.Click
sleep 1
UnsichtbarMachen.Click
sleep 1
Zuweisen.Click
sleep 1
next l
- Printlog " - Blend with color"
+ Printlog " - Blend with color"
sleep 2
for m=1 to 5
MitFarbeAbblenden.Click
@@ -251,243 +268,271 @@ testcase tExtrasEffekt
sleep 1
' if GetClipboardText<>Abblendfarbe.GetSelText Then Warnlog " - Blendingcolor did not take over"
next m
- Printlog " - Test order"
- Effekte.Click
- sleep 1
- Effekteliste.Select 2
- Zuweisen.Click
- Reihenfolge.Click
- sleep 1
- sleep 1
- Printlog " - test preview window"
- Vorschaufenster.Click '/// open preview window ///'
- sleep 1
- Kontext "Vorschau"
- if Vorschau.Exists = False Then Warnlog " - Preview window not opened"
- Vorschau.Close
- Kontext "Effekt"
- Extras.Click
- if not Klangliste.IsEnabled Then Klang.Click '/// insert sound ///'
- sleep 1
-' ZaehlerTon=Klangliste.GetItemCount
- for n=1 to 5
- SetClipboard Klangliste.GetSelText
- Klangliste.Select n
- VollstaendigAbspielen.Click
- Effekt.Close
- SlideShowEffects
- Kontext "Effekt"
- sleep 1
- Extras.Click
- sleep 1
+ Printlog " - Test order"
+ Effekte.Click
+ sleep 1
+ Effekteliste.Select 2
+ Zuweisen.Click
+ Reihenfolge.Click
+ sleep 1
+ sleep 1
+ Printlog " - test preview window"
+ printlog "open preview window"
+ Vorschaufenster.Click
+ sleep 1
+ Kontext "Vorschau"
+ if Vorschau.Exists = False Then Warnlog " - Preview window not opened"
+ Vorschau.Close
+ Kontext "Effekt"
+ Extras.Click
+ printlog "insert sound"
+ if not Klangliste.IsEnabled Then Klang.Click
+ sleep 1
+ ' ZaehlerTon=Klangliste.GetItemCount
+ for n=1 to 5
+ SetClipboard Klangliste.GetSelText
+ Klangliste.Select n
+ VollstaendigAbspielen.Click
+ Effekt.Close
+ SlideShowEffects
+ Kontext "Effekt"
+ sleep 1
+ Extras.Click
+ sleep 1
if GetClipboardText<>Klangliste.GetSelText Then Warnlog " - sound did not change"
next n
- Effekt.Close
- sleep 1
- Call hCloseDocument '/// close document ///'
-endcase
+ Effekt.Close
+ sleep 1
+ printlog "close document"
+ Call hCloseDocument
+endcase 'tExtrasEffekt
+
+'-------------------------------------------------------------------------------
testcase tExtrasPraesentationseinstellungen
-dim waschecked as boolean
- Printlog " - SlideShow/Slideshow settings"
- Call hNewDocument '/// New impress document ///'
- setStartCurrentPage(FALSE) '/// Set ToolsOptions - Presentation - StartCurrentPage = off ///'
- '/// check state of navigator ! expected: closed ///'
- Kontext "Navigator"
- if Navigator.exists then
- '///+ close navigator ! ///'
- Navigator.Close
- Warnlog "Navigator was open. Check earlier tests. Now closed."
- else
- printlog "Navigator: NOT available. Good."
- endif
- Kontext "DocumentImpress"
- ExtrasPraesentationseinstellung
- Kontext "Bildschirmpraesentation"
- AbDia.Check
- SetClipboard AbDiaName.GetItemCount
- Bildschirmpraesentation.OK
- InsertSlide '/// insert slide ///'
- sleep 2
- hTypekeys "<Pagedown>"
- sleep 2
- SlideShowPresentationSettings '/// slideshow settings ///'
- Kontext "Bildschirmpraesentation"
- if AbDiaName.GetItemCount <> GetClipboardText Then
- Printlog " - Added page appears in list"
- else
- Warnlog " - Page not added to the list"
- end if
- AlleDias.Check '/// check all dias///'
- Printlog " - Test all slides"
- Bildschirmpraesentation.OK
- hCloseDocument '/// close document ///'
- DateiOeffnen '/// open document (diashow.odp) ///'
- Kontext "OeffnenDlg"
- if OeffnenDlg.Exists(10) then
- Dateiname.SetText ConvertPath (gTesttoolPath + "graphics\required\input\diashow.odp")
- else
- Warnlog "Took more then 10 seconds to get the file-open -dialogue open. Ending Test."
- goto endsub
- endif
- Oeffnen.Click
- sleep (60)
- ' check if the document is writable
- if fIsDocumentWritable = false then
- ' make the document writable and check if it's succesfull
- if fMakeDocumentWritable = false then
- warnlog "The document can't be make writeable. Test stopped."
+
+ dim waschecked as boolean
+
+ Printlog " - SlideShow/Slideshow settings"
+ printlog "New impress document"
+ Call hNewDocument
+ printlog "Set ToolsOptions - Presentation - StartCurrentPage = off"
+ setStartCurrentPage(FALSE)
+ printlog " check state of navigator ! expected: closed"
+ Kontext "Navigator"
+ if Navigator.exists then
+ printlog " close navigator !"
+ Navigator.Close
+ Warnlog "Navigator was open. Check earlier tests. Now closed."
+ else
+ printlog "Navigator: NOT available. Good."
+ endif
+ Kontext "DocumentImpress"
+ ExtrasPraesentationseinstellung
+ Kontext "Bildschirmpraesentation"
+ AbDia.Check
+ SetClipboard AbDiaName.GetItemCount
+ Bildschirmpraesentation.OK
+ printlog "insert slide"
+ InsertSlide
+ sleep 2
+ hTypekeys "<Pagedown>"
+ sleep 2
+ printlog "slideshow settings"
+ SlideShowPresentationSettings
+ Kontext "Bildschirmpraesentation"
+ if AbDiaName.GetItemCount <> GetClipboardText Then
+ Printlog " - Added page appears in list"
+ else
+ Warnlog " - Page not added to the list"
+ end if
+ printlog "check all dias"
+ AlleDias.Check
+ Printlog " - Test all slides"
+ Bildschirmpraesentation.OK
+ printlog "close document"
+ hCloseDocument
+ printlog "open document (diashow.odp)"
+ DateiOeffnen
+ Kontext "OeffnenDlg"
+ if OeffnenDlg.Exists(10) then
+ Dateiname.SetText ConvertPath (gTesttoolPath + "graphics\required\input\diashow.odp")
+ else
+ Warnlog "Took more then 10 seconds to get the file-open -dialogue open. Ending Test."
goto endsub
- endif
- endif
- Kontext "DocumentImpress"
- sleep 1
- SlideShowPresentationSettings
- Kontext "Bildschirmpraesentation"
- if Fenster.IsChecked = False Then '/// slideshow runs in window mode checked ///'
- Fenster.Check
- Printlog " - Slideshow in window mode"
- else
- Printlog " - Slideshow in window mode checked"
- end if
- Bildschirmpraesentation.OK
+ endif
+ Oeffnen.Click
+ sleep (60)
+ printlog "check if the document is writable"
+ if fIsDocumentWritable = false then
+ printlog "make the document writable and check if it's succesfull"
+ if fMakeDocumentWritable = false then
+ warnlog "The document can't be make writeable. Test stopped."
+ goto endsub
+ endif
+ endif
+ Kontext "DocumentImpress"
+ sleep 1
+ SlideShowPresentationSettings
+ Kontext "Bildschirmpraesentation"
+ printlog "slideshow runs in window mode checked"
+ if Fenster.IsChecked = False Then
+ Fenster.Check
+ Printlog " - Slideshow in window mode"
+ else
+ Printlog " - Slideshow in window mode checked"
+ end if
+ Bildschirmpraesentation.OK
Printlog " - Testing slide show"
- SlideShowSlideshow '/// run slideshow ///'
- sleep (3)
- Kontext "DocumentPresentation"
- DocumentPresentation.TypeKeys "<pagedown>"
- try
- Kontext "DocumentImpress"
- ViewZoom '/// try using menue entrees (should be disabled while slideshow is running) ///'
- Warnlog " - In slide show mode controls shouldn't be enabled"
- Kontext "Massstab"
- Massstab.OK
- catch
- Kontext "DocumentPresentation"
- Printlog " - Slideshow runs"
- endcatch
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>"
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>"
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>"
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>"
- sleep (5)
-
- kontext "DocumentPresentation"
- if DocumentPresentation.Exists(3) then '/// test if application is still in slideshow mode ///'
- warnlog " - We are still in slideshow mode"
- DocumentPresentation.TypeKeys "<ESCAPE>"
- else
- Printlog " - Test Abdia page 3 ended"
- endif
-
- Printlog " - From slides test"
- SlideShowPresentationSettings '/// open slideshow settings ///'
- Kontext "Bildschirmpraesentation"
- Fenster.Check '/// check slideshow in window mode ///'
- AbDia.Check
- AbDiaName.Select 3 '/// slideshow begins at dia 3///'
- Printlog " - From " + AbDiaName.GetSelText + " was the slides shown"
- Bildschirmpraesentation.OK
- SlideShowSlideshow '/// run slideshow ///'
- sleep (3)
- Kontext "DocumentPresentation"
- DocumentPresentation.TypeKeys "<pagedown>" 'to get to 4
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>" ' to get to the end
- sleep 2
- '/// Click once more to get out of presentation-mode ///'
- DocumentPresentation.TypeKeys "<pagedown>" 'out
- sleep (3)
- kontext "DocumentPresentation"
- if DocumentPresentation.Exists(3) then
- warnlog " - We are still in slideshow mode"
- DocumentPresentation.TypeKeys "<ESCAPE>"
+ printlog "run slideshow"
+ SlideShowSlideshow
+ sleep (3)
+ Kontext "DocumentPresentation"
+ DocumentPresentation.TypeKeys "<pagedown>"
+ try
+ Kontext "DocumentImpress"
+ printlog "try using menue entrees (should be disabled while slideshow is running)"
+ ViewZoom
+ Warnlog " - In slide show mode controls shouldn't be enabled"
+ Kontext "Massstab"
+ Massstab.OK
+ catch
+ Kontext "DocumentPresentation"
+ Printlog " - Slideshow runs"
+ endcatch
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>"
+ sleep (5)
+
+ kontext "DocumentPresentation"
+ printlog "test if application is still in slideshow mode"
+ if DocumentPresentation.Exists(3) then
+ warnlog " - We are still in slideshow mode"
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ else
+ Printlog " - Test Abdia page 3 ended"
+ endif
+
+ Printlog " - From slides test"
+ printlog "open slideshow settings"
+ SlideShowPresentationSettings
+ Kontext "Bildschirmpraesentation"
+ printlog "check slideshow in window mode"
+ Fenster.Check
+ AbDia.Check
+ printlog "slideshow begins at dia 3"
+ AbDiaName.Select 3
+ Printlog " - From " + AbDiaName.GetSelText + " was the slides shown"
+ Bildschirmpraesentation.OK
+ printlog "run slideshow"
+ SlideShowSlideshow
+ sleep (3)
+ Kontext "DocumentPresentation"
+ DocumentPresentation.TypeKeys "<pagedown>" 'to get to 4
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>" ' to get to the end
+ sleep 2
+ printlog "Click once more to get out of presentation-mode"
+ DocumentPresentation.TypeKeys "<pagedown>" 'out
+ sleep (3)
+ kontext "DocumentPresentation"
+ if DocumentPresentation.Exists(3) then
+ warnlog " - We are still in slideshow mode"
+ DocumentPresentation.TypeKeys "<ESCAPE>"
else
- Printlog " - Test Abdia page 3 ended"
- endif
- Printlog " - Repeat endless"
-
- Kontext "DocumentImpress"
- SlideShowPresentationSettings '/// open slideshow settings ///'
- Kontext "Bildschirmpraesentation"
- if AbDia.IsChecked=True Then AlleDias.Check
- if Auto.IsChecked=False Then Auto.Check
- Bildschirmpraesentation.OK
- sleep (1)
- SlideShowSlideshow 'start from 1
- sleep (3)
- Kontext "DocumentPresentation"
- DocumentPresentation.TypeKeys "<pagedown>" 'to 2
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>" 'to 3
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>" 'to 4
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>" 'to pause
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>" 'to 1
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>" 'to 2
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>" 'to 3
- sleep 2
- DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>" '/// Open the navigator ///'
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>" 'to 4
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>" 'to pause
- sleep 2
- DocumentPresentation.TypeKeys "<pagedown>" 'to 1
- sleep 3
- DocumentPresentation.TypeKeys "<pagedown>" 'to 2
- sleep 3
- DocumentPresentation.TypeKeys "<pagedown>" 'to 3
- sleep 3
- Kontext "NavigatorDraw"
- if NavigatorDraw.Exists then
- Printlog " The navigator is open. good."
- else
- Warnlog " The navigator should be accessable. Opening now."
- Kontext "DocumentImpress"
- DocumentImpress.TypeKeys "<MOD1 SHIFT F5>"
- Kontext "NavigatorDraw"
- end if
- sleep 2
- if Liste.GetSelIndex <> 3 then
- Warnlog " - Diashow not repeated: We should be at page no 3, but we are at page no: " + Liste.GetSelIndex
- Kontext "DocumentPresentation"
- DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>" '/// Close the Navigator-window ///'
- else
- Printlog " - Repeat endless does work"
- Kontext "DocumentPresentation"
- DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>" '/// Close the Navigator-window ///'
- sleep 2
- endif
- Kontext "DocumentPresentation"
- DocumentPresentation.TypeKeys "<ESCAPE>"
- sleep 2
- Kontext "DocumentImpress"
- gMouseClick 80,80
- try
- SlideShowPresentationSettings '/// test endless repeating setting ///'
- Kontext "Bildschirmpraesentation"
- Bildschirmpraesentation.OK
- Printlog " - Repeat endless"
- catch
- Warnlog " - We are still in slideshow mode"
- DocumentPresentation.TypeKeys "<ESCAPE>"
- sleep 5
+ Printlog " - Test Abdia page 3 ended"
+ endif
+ Printlog " - Repeat endless"
+
+ Kontext "DocumentImpress"
+ printlog "open slideshow settings"
+ SlideShowPresentationSettings
+ Kontext "Bildschirmpraesentation"
+ if AbDia.IsChecked=True Then AlleDias.Check
+ if Auto.IsChecked=False Then Auto.Check
+ Bildschirmpraesentation.OK
+ sleep (1)
+ SlideShowSlideshow 'start from 1
+ sleep (3)
+ Kontext "DocumentPresentation"
+ DocumentPresentation.TypeKeys "<pagedown>" 'to 2
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>" 'to 3
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>" 'to 4
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>" 'to pause
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>" 'to 1
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>" 'to 2
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>" 'to 3
+ sleep 2
+ printlog "Open the navigator"
+ DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>" 'to 4
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>" 'to pause
+ sleep 2
+ DocumentPresentation.TypeKeys "<pagedown>" 'to 1
+ sleep 3
+ DocumentPresentation.TypeKeys "<pagedown>" 'to 2
+ sleep 3
+ DocumentPresentation.TypeKeys "<pagedown>" 'to 3
+ sleep 3
+ Kontext "NavigatorDraw"
+ if NavigatorDraw.Exists then
+ Printlog " The navigator is open. good."
+ else
+ Warnlog " The navigator should be accessable. Opening now."
+ Kontext "DocumentImpress"
+ DocumentImpress.TypeKeys "<MOD1 SHIFT F5>"
+ Kontext "NavigatorDraw"
+ end if
+ sleep 2
+ if Liste.GetSelIndex <> 3 then
+ Warnlog " - Diashow not repeated: We should be at page no 3, but we are at page no: " + Liste.GetSelIndex
+ Kontext "DocumentPresentation"
+ printlog "Close the Navigator-window"
+ DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
+ else
+ Printlog " - Repeat endless does work"
+ Kontext "DocumentPresentation"
+ printlog "Close the Navigator-window"
+ DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
+ sleep 2
+ endif
+ Kontext "DocumentPresentation"
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ sleep 2
+ Kontext "DocumentImpress"
+ gMouseClick 80,80
+ try
+ printlog "test endless repeating setting"
+ SlideShowPresentationSettings
+ Kontext "Bildschirmpraesentation"
+ Bildschirmpraesentation.OK
+ Printlog " - Repeat endless"
+ catch
+ Warnlog " - We are still in slideshow mode"
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ sleep 5
endcatch
- Kontext "DocumentImpress"
+ Kontext "DocumentImpress"
SlideShowPresentationSettings
Kontext "BildschirmPraesentation"
Fenster.Check
- Printlog " - Test slide switching manually" '/// test dia switch manual ///'
+ printlog "test dia switch manual"
+ Printlog " - Test slide switching manually"
if DiawechselManuel.IsChecked = False Then DiawechselManuel.Check
BildschirmPraesentation.Ok
sleep 1
@@ -512,42 +557,49 @@ dim waschecked as boolean
Kontext "Navigator"
sleep 5
- '/// Check state of navigator ! Expected: closed ///'
- Kontext "Navigator"
- if Navigator.exists then
- '///+ Close Navigator ! ///'
- Navigator.Close
- Warnlog "Navigator: Should have been closed. Closing now."
- else
- printlog "Navigator: not available - Good"
- endif
- Kontext "DokumentPraesentation"
- DokumentPraesentation.TypeKeys "<ESCAPE>" '/// Exit presentation-mode ///'
- Kontext "DocumentImpress"
- Call hCloseDocument '/// close document ///'
-endcase
+ printlog " Check state of navigator ! Expected: closed"
+ Kontext "Navigator"
+ if Navigator.exists then
+ '///+ Close Navigator !"
+ Navigator.Close
+ Warnlog "Navigator: Should have been closed. Closing now."
+ else
+ printlog "Navigator: not available - Good"
+ endif
+ Kontext "DokumentPraesentation"
+ printlog "Exit presentation-mode"
+ DokumentPraesentation.TypeKeys "<ESCAPE>"
+ Kontext "DocumentImpress"
+ printlog "close document"
+ Call hCloseDocument
+endcase 'tExtrasPraesentationseinstellungen
+
+'-------------------------------------------------------------------------------
testcase tExtrasIndividuellePraesentation
Printlog "- Slideshow/Individual slideshow"
Call hNewDocument
- Call sSelectEmptyLayout '/// new impress document ///'
- '/// Deactivate "Start with current page" in ToolsOptions ///'
- setStartCurrentPage(FALSE)
- '/// check state of navigator ! expected: closed ///'
- Kontext "Navigator"
- if Navigator.exists then
- '///+ close navigator ! ///'
- Navigator.Close
- Warnlog "Navigator was open. Check earlier tests. Now closed."
- else
- printlog "Navigator: NOT available. Good."
- endif
- Printlog " - insert 3 slides for the individual slide show"
- SlideShowPresentationSettings '/// open slide show settings ///'
- Kontext "Bildschirmpraesentation"
- Fenster.Check
- Bildschirmpraesentation.OK
- InsertSlide '/// insert slide ///'
+ printlog "new impress document"
+ Call sSelectEmptyLayout
+ printlog "Deactivate Start with current page in ToolsOptions"
+ setStartCurrentPage(FALSE)
+ printlog " check state of navigator ! expected: closed"
+ Kontext "Navigator"
+ if Navigator.exists then
+ printlog " close navigator !"
+ Navigator.Close
+ Warnlog "Navigator was open. Check earlier tests. Now closed."
+ else
+ printlog "Navigator: NOT available. Good."
+ endif
+ Printlog " - insert 3 slides for the individual slide show"
+ printlog "open slide show settings"
+ SlideShowPresentationSettings
+ Kontext "Bildschirmpraesentation"
+ Fenster.Check
+ Bildschirmpraesentation.OK
+ printlog "insert slide"
+ InsertSlide
sleep 2
Call sSelectEmptyLayout
hTypekeys "<Pagedown>"
@@ -557,7 +609,8 @@ testcase tExtrasIndividuellePraesentation
Call sSelectEmptyLayout
hTypekeys "<Pagedown>"
sleep 2
- InsertSlide '/// insert another slide ///'
+ printlog "insert another slide"
+ InsertSlide
sleep 2
Call sSelectEmptyLayout
hTypekeys "<Pagedown>"
@@ -565,543 +618,575 @@ testcase tExtrasIndividuellePraesentation
Printlog " - Slides added"
sleep 1
Kontext "DocumentImpress"
- DocumentImpress.TypeKeys "<MOD1 SHIFT F5>" '/// open navigator ///'
+ printlog "open navigator"
+ DocumentImpress.TypeKeys "<MOD1 SHIFT F5>"
sleep 1
Kontext "NavigatorDraw"
if NavigatorDraw.Exists Then
- Printlog " - Navigator exists"
- Erste.Click '/// switch to 1st slide ///'
- Kontext "DocumentImpress"
- DocumentImpress.MouseDown ( 50, 50 ) '/// Make a click onto the slide to focus onto that ///'
- DocumentImpress.MouseUp ( 50, 50 )
- hRechteckErstellen (10,10,20,20) '/// create rectangle ///'
- Kontext "NavigatorDraw"
- Naechste.Click '/// switch to 2nd slide ///'
- Kontext "DocumentImpress"
- hRechteckErstellen (30,30,40,40) '/// create another rectangle ///'
- Kontext "NavigatorDraw"
- Naechste.Click '/// switch to 3rd slide ///'
- Kontext "DocumentImpress"
- hRechteckErstellen (40,40,50,50) '/// create rectangle ///'
- Kontext "NavigatorDraw"
- Naechste.Click '/// switch to next slide ///'
- Kontext "DocumentImpress"
- hRechteckErstellen (50,50,60,60) '/// create rectangle ///'
- Printlog " - Created rectangles on all slides"
- else
- Warnlog " No Navigator"
- end if
- sleep 1
- SlideShowCustomSlideshow '/// open custom slideshow ///'
- Kontext "IndividuellePraesentation"
- Printlog " - Create new slideshow"
- Neu.Click '/// create new individual slideshow ///'
- Kontext "IndividuellePraesentationDefinieren"
- PraesentationName.SetText "Test 1" '/// set name of individiual slideshow to Test 1 ///'
- Dim i
- Dim Zaehler
- Zaehler=SeitenPraesentation.GetItemCount '/// add slides to presentation ///'
- For i=1 to Zaehler
- SeitenPraesentation.SetNoSelection
- SeitenPraesentation.Select i
- Hinzufuegen.Click
- if SelectedSlides.GetItemCount=i Then
- Printlog " - slide added to slideshow"
- else
- Warnlog " Count does not match selection. Should be: "+ i + " but is: "+ IndividuellePraesentation.GetItemCount
- end if
- next i
- Printlog " - Add slides using multiple selections"
- SeitenPraesentation.Select 1
- Hinzufuegen.Click
- SeitenPraesentation.Select 2
- Hinzufuegen.Click
- SeitenPraesentation.Select 3
- Hinzufuegen.Click
- SeitenPraesentation.Select 4
- Hinzufuegen.Click
-
- if SelectedSlides.GetItemCount=8 Then '/// control number of added slides ///'
- Printlog " - slides has been added, multiple selection is working"
- else
- Warnlog " Multiple selection does not work"
- end if
-
- IndividuellePraesentationDefinieren.OK
- sleep 2
- Kontext "IndividuellePraesentation"
- if IndividuellePraesentationBenutzen.IsChecked=False Then IndividuellePraesentationBenutzen.Check
- sleep 2
- Starten.Click '/// run presentation ///'
- Printlog " - Individual slideshow started"
- sleep 5
- Kontext "Navigator" '/// Check if the navigator exists, if so - close it ///'
- if Navigator.Exists Then
- Printlog " - Navigator exists, we close it"
- Navigator.Close '/// close navigator ///'
- sleep 2
- end if
- Kontext "DocumentPresentation"
- sleep 3
- DocumentPresentation.TypeKeys "<RETURN>"
- sleep 2
- DocumentPresentation.TypeKeys "<RETURN>"
- sleep 2
- DocumentPresentation.TypeKeys "<RETURN>"
- sleep 2
- DocumentPresentation.TypeKeys "<RETURN>"
- sleep 2
- DocumentPresentation.TypeKeys "<RETURN>"
- sleep 2
- DocumentPresentation.TypeKeys "<RETURN>"
- sleep 2
- DocumentPresentation.TypeKeys "<RETURN>"
- sleep 2
- DocumentPresentation.TypeKeys "<RETURN>"
- sleep 2
- DocumentPresentation.TypeKeys "<ESCAPE>"
- sleep 5
+ Printlog " - Navigator exists"
+ printlog "switch to 1st slide"
+ Erste.Click
+ Kontext "DocumentImpress"
+ printlog "Make a click onto the slide to focus onto that"
+ DocumentImpress.MouseDown ( 50, 50 )
+ DocumentImpress.MouseUp ( 50, 50 )
+ printlog "create rectangle"
+ hRechteckErstellen (10,10,20,20)
+ Kontext "NavigatorDraw"
+ printlog "switch to 2nd slide"
+ Naechste.Click
+ Kontext "DocumentImpress"
+ printlog "create another rectangle"
+ hRechteckErstellen (30,30,40,40)
+ Kontext "NavigatorDraw"
+ printlog "switch to 3rd slide"
+ Naechste.Click
+ Kontext "DocumentImpress"
+ printlog "create rectangle"
+ hRechteckErstellen (40,40,50,50)
+ Kontext "NavigatorDraw"
+ printlog "switch to next slide"
+ Naechste.Click
+ Kontext "DocumentImpress"
+ printlog "create rectangle"
+ hRechteckErstellen (50,50,60,60)
+ Printlog " - Created rectangles on all slides"
+ else
+ Warnlog " No Navigator"
+ end if
+ sleep 1
+ printlog "open custom slideshow"
+ SlideShowCustomSlideshow
+ Kontext "IndividuellePraesentation"
+ printlog "create new individual slideshow"
+ Neu.Click
+ Kontext "IndividuellePraesentationDefinieren"
+ printlog "set name of individiual slideshow to Test 1"
+ PraesentationName.SetText "Test 1"
+ Dim i
+ Dim Zaehler
+ printlog "add slides to presentation"
+ Zaehler=SeitenPraesentation.GetItemCount
+ For i=1 to Zaehler
+ SeitenPraesentation.SetNoSelection
+ SeitenPraesentation.Select i
+ Hinzufuegen.Click
+ if SelectedSlides.GetItemCount=i Then
+ Printlog " - slide added to slideshow"
+ else
+ Warnlog " Count does not match selection. Should be: "+ i + " but is: "+ IndividuellePraesentation.GetItemCount
+ end if
+ next i
+ Printlog " - Add slides using multiple selections"
+ SeitenPraesentation.Select 1
+ Hinzufuegen.Click
+ SeitenPraesentation.Select 2
+ Hinzufuegen.Click
+ SeitenPraesentation.Select 3
+ Hinzufuegen.Click
+ SeitenPraesentation.Select 4
+ Hinzufuegen.Click
+
+ printlog "control number of added slides"
+ if SelectedSlides.GetItemCount=8 Then
+ Printlog " - slides has been added, multiple selection is working"
+ else
+ Warnlog " Multiple selection does not work"
+ end if
+
+ IndividuellePraesentationDefinieren.OK
+ sleep 2
Kontext "IndividuellePraesentation"
- if IndividuellePraesentation.IsVisible=False Then
- Warnlog " Slideshow should have ended"
- Kontext "DocumentPresentation"
- DocumentPresentation.TypeKeys "<ESCAPE>"
- else
- printlog " Presentation seems to have ended successfully"
- end if
+ if IndividuellePraesentationBenutzen.IsChecked=False Then IndividuellePraesentationBenutzen.Check
+ sleep 2
+ printlog "run presentation"
+ Starten.Click
+ Printlog " - Individual slideshow started"
+ sleep 5
+ printlog "Check if the navigator exists, if so - close it"
+ Kontext "Navigator"
+ if Navigator.Exists Then
+ Printlog " - Navigator exists, we close it"
+ printlog "close navigator"
+ Navigator.Close
+ sleep 2
+ end if
+ Kontext "DocumentPresentation"
+ sleep 3
+ DocumentPresentation.TypeKeys "<RETURN>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<RETURN>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<RETURN>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<RETURN>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<RETURN>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<RETURN>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<RETURN>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<RETURN>"
+ sleep 2
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ sleep 5
+ Kontext "IndividuellePraesentation"
+ if IndividuellePraesentation.IsVisible=False Then
+ Warnlog " Slideshow should have ended"
+ Kontext "DocumentPresentation"
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ else
+ printlog " Presentation seems to have ended successfully"
+ end if
- sleep 2
+ sleep 2
- Kontext "IndividuellePraesentation"
- IndividuellePraesentation.Close '/// Close custom slideshow ///'
-
- Kontext "NavigatorDraw" '/// Navigator: Control if right slide is displayed ///'
- printlog " Now we switch to the navigator again"
- if Liste.GetSelIndex <> 4 then '/// Unless -Start on first slide- is activated? Default = No ///'
- Warnlog " This is not the right slide, it should be 4 but is: " + Liste.GetSelIndex
- else
- Printlog " - Individual slideshow seems to work"
- end if
- SlideShowCustomSlideshow '/// open custom slideshow ///'
- '/// Set "Start with current page" back to default = on, in ToolsOptions ///'
- Kontext "IndividuellePraesentation"
- if IndividuellePraesentationBenutzen.IsChecked=False Then IndividuellePraesentationBenutzen.Check
- IndividuellePraesentation.Close
- sleep 2
- Kontext "Navigator" 'Draw
- if Navigator.exists then
- Navigator.Close '/// Close the Navigator ///'
- Kontext "NavigatorDraw"
- if NavigatorDraw.exists then
- NavigatorDraw.Close
- endif
- else
- printlog "Navigator: NOT available. Good."
- endif
- Kontext "DocumentImpress"
- setStartCurrentPage(TRUE)
- Call hCloseDocument '/// close document ///'
-endcase
-
-'****************************************************************************************************
+ Kontext "IndividuellePraesentation"
+ printlog "Close custom slideshow"
+ IndividuellePraesentation.Close
+
+ printlog "Navigator: Control if right slide is displayed"
+ Kontext "NavigatorDraw"
+ printlog " Now we switch to the navigator again"
+ printlog "Unless -Start on first slide- is activated? Default = No"
+ if Liste.GetSelIndex <> 4 then
+ Warnlog " This is not the right slide, it should be 4 but is: " + Liste.GetSelIndex
+ else
+ Printlog " - Individual slideshow seems to work"
+ end if
+ printlog "open custom slideshow"
+ SlideShowCustomSlideshow
+ printlog "Set Start with current page back to default = on, in ToolsOptions"
+ Kontext "IndividuellePraesentation"
+ if IndividuellePraesentationBenutzen.IsChecked=False Then IndividuellePraesentationBenutzen.Check
+ IndividuellePraesentation.Close
+ sleep 2
+ Kontext "Navigator" 'Draw
+ if Navigator.exists then
+ printlog "Close the Navigator"
+ Navigator.Close
+ Kontext "NavigatorDraw"
+ if NavigatorDraw.exists then
+ NavigatorDraw.Close
+ endif
+ else
+ printlog "Navigator: NOT available. Good."
+ endif
+ Kontext "DocumentImpress"
+ setStartCurrentPage(TRUE)
+ printlog "close document"
+ Call hCloseDocument
+endcase 'tExtrasIndividuellePraesentation
+
+'-------------------------------------------------------------------------------
testcase tSlideshowContextMenuOneSlide
+
qaerrorlog "Test not yet ready."
- goto endsub
- dim NumberOfEntries as Integer
- Printlog "- ContextMenu in Slideshow"
- '/// New Impress Document ///'
- Call hNewDocument
-
- '/// Start the Slideshow. ///'
- hTypeKeys "<F5>"
- '/// Check that the right mousebutton brings up the Context-Menu. ///'
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- '/// Check that the right-click brought up a Context-Menu. ///'
- '/// And check the number of Menu-Positions (there should be XXX of them ) ///'
- NumberOfEntries = 0
- sleep 2
- try
- NumberOfEntries = MenuGetItemCount
- catch
- warnlog " No ContextMenu found? Please inform the Automatic Tester"
- kontext "DocumentImpress"
- hOpenContextMenu
- NumberOfEntries = MenuGetItemCount
- endcatch
- if (NumberOfEntries = 0) then
- Warnlog " the Context-Menu doesnt contain any entries, or were not up. Test ends."
- Goto Endsub
- endif
- if NumberOfEntries <> 3 then
- warnlog " Expected three entries in this Menu, but found " + NumberOfEntries
-' if NumberOfEntries <> 6 then
-' warnlog " Expected six entries in this Menu, but found " + NumberOfEntries
- else
- printlog " Number of Entries was: " + NumberOfEntries
- endif
- '/// Check that every position contains the expected Undermenu. ("Screen": Black/White. and "End Slideshow") ///'
- '/// And check that Menu-Item one opens an undermenu. ///'
- Printlog " We open number one: " + MenuGetItemText(MenuGetItemID(1))
- hMenuSelectNr (1)
- sleep 2
- NumberOfEntries = MenuGetItemCount
- printlog " Menu-entries: " + MenuGetItemCount
- if (NumberOfEntries <> 2) then
- Warnlog " the third Context-Menu-entry was NOT 'Screen'."
- else
- Printlog " We open the next number one: " + MenuGetItemText(MenuGetItemID(1))
- hMenuSelectNr (1)
- endif
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- hMenuSelectNr (1) 'Open the Screen -menu.
- sleep 2
- Printlog " We open number two: " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
- hMenuSelectNr (2) 'Choose "White"
- sleep 2
-
- 'TODO - Due to existing bug, function not yet available.
- '/// Change to slideshow-ending. Check that the Context-Menu also comes up here. ///'
- 'DocumentPresentation.
- hTypeKeys "<SPACE>"
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
- NumberOfEntries = 0
- NumberOfEntries = MenuGetItemCount
- if NumberOfEntries <> 0 then
- printlog " Menu-entries: " + MenuGetItemCount
- else
- warnlog " No context-menu at Slideshow-endpage."
- DocumentPresentation.TypeKeys "<ESCAPE>"
- endif
-
- '/// And that one can go back. ///'
- hMenuSelectNr (1) 'Open the Goto Slide -menu.
- sleep 2
- Printlog " We open number one (should be 'Goto First Slide'): " + MenuGetItemText(MenuGetItemID(1))
- hMenuSelectNr (2) 'Choose "Back" 'TODO ;: but now we just end the slideshow
- sleep 2
-
- Kontext "DocumentPresentation"
- DocumentPresentation.TypeKeys "<ESCAPE>"
- DocumentPresentation.TypeKeys "<ESCAPE>"
- Kontext "DocumentImpress"
- InsertSlide
-
- '/// Start the Slideshow. ///'
- hTypeKeys "<F5>"
- '/// Check that the right mousebutton brings up the Context-Menu. ///'
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
-
- '/// Check that Menu-Item (three) really finishes the presentation. ///'
- Printlog " We open the last entry (End Show): " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
- hMenuSelectNr (4) 'MenuGetItemCount) 'End Slideshow
- if DocumentPresentation.Exists then
- Warnlog "either wrong position for 'End Slideshow', or the command didnt work."
- else
- printlog "The presentation was closed, good."
- endif
-
- '/// Check that one can step one step forward, even if there is no more than one slide. ///'
- '/// Start the Slideshow. ///'
- hTypeKeys "<F5>"
- '/// Check that the right mousebutton brings up the Context-Menu. ///'
- sleep (2)
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
-
- hMenuSelectNr (2) 'Open the Goto Slide -menu.
-
- '/// Select the 'one step forward' -entry ///'
- hMenuSelectNr (1)
-
- '/// Check that we're on the last slide ///'
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
-
- hMenuSelectNr (2) 'Open the Goto Slide -menu.
- if MenuIsItemEnabled (MenugetItemID(4)) then
- printlog "Jumped to the right slide"
- else
- warnlog "possibly the 'jump to slide' -menu didnt quite work"
- endif
-
- '/// Close the Context-Menu ///'
- hMenuSelectNr (0)
- Kontext "DocumentPresentation"
-
- '/// Check if the context-menu also comes up at the very last page (slideshow-ending) ///'
- DocumentPresentation.TypeKeys "<SPACE>"
-' DocumentPresentation.TypeKeys "<SPACE>"
- sleep 1
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
-
- if MenuGetItemText (MenuGetItemID(1)) <> "" then
- Printlog "Context-menu came up at the last page: correct."
- else
- Warnlog "Context-menu did NOT come up correctly at the last page: false."
- endif
-
- '/// Check if we from here, via the context menu, can go back to the first page ///'
- hMenuSelectNr (2) 'Open the Goto Slide -menu.
- sleep 1
- hMenuSelectNr (1) 'First Slide
-
- '/// Check that we're on the first slide ///'
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
-
- hMenuSelectNr (2) 'Open the Goto Slide -menu.
- if MenuIsItemEnabled (MenugetItemID(3)) then
- printlog "Jumped to the right slide"
- else
- warnlog "possibly the 'jump to slide' -menu didnt quite work from the last slide"
- endif
-
- '/// Close the Context-Menu ///'
- MenuSelect (0)
- '/// Close the Presentation ///'
- hTypeKeys "<ESCAPE>"
- '/// Close Document ///'
- Call hCloseDocument
+ goto endsub
+
+ dim NumberOfEntries as Integer
+
+ Printlog "- ContextMenu in Slideshow"
+ printlog "New Impress Document"
+ Call hNewDocument
+
+ printlog "Start the Slideshow."
+ hTypeKeys "<F5>"
+ printlog "Check that the right mousebutton brings up the Context-Menu."
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ printlog "Check that the right-click brought up a Context-Menu."
+ printlog "And check the number of Menu-Positions (there should be XXX of them )"
+ NumberOfEntries = 0
+ sleep 2
+ try
+ NumberOfEntries = MenuGetItemCount
+ catch
+ warnlog " No ContextMenu found? Please inform the Automatic Tester"
+ kontext "DocumentImpress"
+ hOpenContextMenu
+ NumberOfEntries = MenuGetItemCount
+ endcatch
+ if (NumberOfEntries = 0) then
+ Warnlog " the Context-Menu doesnt contain any entries, or were not up. Test ends."
+ Goto Endsub
+ endif
+ if NumberOfEntries <> 3 then
+ warnlog " Expected three entries in this Menu, but found " + NumberOfEntries
+ ' if NumberOfEntries <> 6 then
+ ' warnlog " Expected six entries in this Menu, but found " + NumberOfEntries
+ else
+ printlog " Number of Entries was: " + NumberOfEntries
+ endif
+ printlog "Check that every position contains the expected Undermenu. (Screen: Black/White. and End Slideshow)"
+ printlog "And check that Menu-Item one opens an undermenu."
+ Printlog " We open number one: " + MenuGetItemText(MenuGetItemID(1))
+ hMenuSelectNr (1)
+ sleep 2
+ NumberOfEntries = MenuGetItemCount
+ printlog " Menu-entries: " + MenuGetItemCount
+ if (NumberOfEntries <> 2) then
+ Warnlog " the third Context-Menu-entry was NOT 'Screen'."
+ else
+ Printlog " We open the next number one: " + MenuGetItemText(MenuGetItemID(1))
+ hMenuSelectNr (1)
+ endif
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ printlog "Open the Screen -menu."
+ hMenuSelectNr (1)
+ sleep 2
+ Printlog " We open number two: " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
+ printlog "Choose White"
+ hMenuSelectNr (2)
+ sleep 2
+
+ 'TODO - Due to existing bug, function not yet available.
+ printlog "Change to slideshow-ending. Check that the Context-Menu also comes up here."
+ 'DocumentPresentation.
+ hTypeKeys "<SPACE>"
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+ NumberOfEntries = 0
+ NumberOfEntries = MenuGetItemCount
+ if NumberOfEntries <> 0 then
+ printlog " Menu-entries: " + MenuGetItemCount
+ else
+ warnlog " No context-menu at Slideshow-endpage."
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ endif
+
+ printlog "And that one can go back."
+ hMenuSelectNr (1) 'Open the Goto Slide -menu.
+ sleep 2
+ Printlog " We open number one (should be 'Goto First Slide'): " + MenuGetItemText(MenuGetItemID(1))
+ hMenuSelectNr (2) 'Choose "Back" 'TODO ;: but now we just end the slideshow
+ sleep 2
+
+ Kontext "DocumentPresentation"
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ Kontext "DocumentImpress"
+ InsertSlide
+
+ printlog "Start the Slideshow."
+ hTypeKeys "<F5>"
+ printlog "Check that the right mousebutton brings up the Context-Menu."
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+
+ printlog "Check that Menu-Item (three) really finishes the presentation."
+ Printlog " We open the last entry (End Show): " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
+ hMenuSelectNr (4) 'MenuGetItemCount) 'End Slideshow
+ if DocumentPresentation.Exists then
+ Warnlog "either wrong position for 'End Slideshow', or the command didnt work."
+ else
+ printlog "The presentation was closed, good."
+ endif
+
+ printlog "Check that one can step one step forward, even if there is no more than one slide."
+ printlog "Start the Slideshow."
+ hTypeKeys "<F5>"
+ printlog "Check that the right mousebutton brings up the Context-Menu."
+ sleep (2)
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+
+ printlog "Open the Goto Slide -menu"
+ hMenuSelectNr (2)
+ printlog "Select the 'one step forward' -entry"
+ hMenuSelectNr (1)
+
+ printlog "Check that we're on the last slide"
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+
+ hMenuSelectNr (2)
+ if MenuIsItemEnabled (MenugetItemID(4)) then
+ printlog "Jumped to the right slide"
+ else
+ warnlog "possibly the 'jump to slide' -menu didnt quite work"
+ endif
+
+ printlog "Close the Context-Menu"
+ hMenuSelectNr (0)
+ Kontext "DocumentPresentation"
+
+ printlog "Check if the context-menu also comes up at the very last page (slideshow-ending)"
+ DocumentPresentation.TypeKeys "<SPACE>"
+ sleep 1
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+
+ if MenuGetItemText (MenuGetItemID(1)) <> "" then
+ Printlog "Context-menu came up at the last page: correct."
+ else
+ Warnlog "Context-menu did NOT come up correctly at the last page: false."
+ endif
+
+ printlog "Check if we from here, via the context menu, can go back to the first page"
+ hMenuSelectNr (2) 'Open the Goto Slide -menu.
+ sleep 1
+ hMenuSelectNr (1) 'First Slide
+
+ printlog "Check that we're on the first slide"
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+
+ hMenuSelectNr (2) 'Open the Goto Slide -menu.
+ if MenuIsItemEnabled (MenugetItemID(3)) then
+ printlog "Jumped to the right slide"
+ else
+ warnlog "possibly the 'jump to slide' -menu didnt quite work from the last slide"
+ endif
+
+ printlog "Close the Context-Menu"
+ MenuSelect (0)
+ printlog "Close the Presentation"
+ hTypeKeys "<ESCAPE>"
+ printlog "Close Document"
+ Call hCloseDocument
endcase 'tSlideshowContextMenuOneSlide
-'****************************************************************************************************
+'-------------------------------------------------------------------------------
testcase tSlideshowContextMenuMoreSlides
+
qaerrorlog "Test not yet ready."
- goto endsub
- dim NumberOfEntries as Integer
- Printlog "- ContextMenu in Slideshow"
- '/// New Impress Document ///'
- Call hNewDocument
- '/// Insert three new Slides ///'
- InsertSlide
- InsertSlide
- InsertSlide
- '/// Start the Slideshow. ///'
- hTypeKeys "<F5>"
- sleep (3)
- '/// Check that the right mousebutton brings up the Context-Menu. ///'
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- '/// Check that the right-click brought up a Context-Menu. ///'
- '/// And check the number of Menu-Positions (there should be XXX of them ) ///'
- NumberOfEntries = 0
- sleep 2
- try
- NumberOfEntries = MenuGetItemCount
- catch
- warnlog " No ContextMenu found? Please inform the Automatic Tester"
- kontext "DocumentImpress"
- hOpenContextMenu
- NumberOfEntries = MenuGetItemCount
- endcatch
- if (NumberOfEntries = 0) then
- Warnlog " the Context-Menu doesnt contain any entries, or were not up. Test ends."
- Goto Endsub
- endif
- if NumberOfEntries <> 6 then
- warnlog " Expected six entries in this Menu, but found " + NumberOfEntries
- else
- printlog " Number of Entries was: " + NumberOfEntries
- endif
- '/// Check that every position contains the expected Undermenu. ("Screen": Black/White. and "End Slideshow") ///'
- '/// And check that Menu-Item one opens an undermenu. ///'
- Printlog " We open number four: " + MenuGetItemText(MenuGetItemID(4))
- hMenuSelectNr (3)
- sleep 2
- NumberOfEntries = MenuGetItemCount
- printlog " Menu-entries: " + MenuGetItemCount
- if (NumberOfEntries <> 2) then
- Warnlog " the first Context-Menu-entry was NOT 'Screen'."
- else
- Printlog " We open the next number one: " + MenuGetItemText(MenuGetItemID(1))
- hMenuSelectNr (1)
- endif
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- hMenuSelectNr (3) 'Open the Screen -menu.
- sleep 2
- Printlog " We open number two: " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
- hMenuSelectNr (2) 'Choose "White"
- sleep 2
-
- 'TODO - Due to existing bug, function not yet available.
- '/// Change to slideshow-ending. Check that the Context-Menu also comes up here. ///'
- 'DocumentPresentation.
- hTypeKeys "<SPACE>"
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
- NumberOfEntries = 0
- NumberOfEntries = MenuGetItemCount
- if NumberOfEntries <> 0 then
- printlog " Menu-entries: " + MenuGetItemCount
- else
- warnlog " No context-menu at Slideshow-endpage."
- DocumentPresentation.TypeKeys "<ESCAPE>"
- endif
-
- '/// And that one can go back. ///'
- hMenuSelectNr (2) 'Open the Goto Slide -menu.
- sleep 2
- Printlog " We open number one (should be 'Goto First Slide'): " + MenuGetItemText(MenuGetItemID(1))
- hMenuSelectNr (2) 'Choose "Back" 'TODO ;: but now we just end the slideshow
- sleep 2
-
- Kontext "DocumentPresentation"
- DocumentPresentation.TypeKeys "<ESCAPE>"
- DocumentPresentation.TypeKeys "<ESCAPE>"
- Kontext "DocumentImpress"
-
- '/// Start the Slideshow. ///'
- hTypeKeys "<F5>"
- '/// Check that the right mousebutton brings up the Context-Menu. ///'
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
-
- '/// Check that Menu-Item (three) really finishes the presentation. ///'
- Printlog " We open the last entry (End Show): " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
- hMenuSelectNr (4)'MenuGetItemCount) 'End Slideshow
- sleep 4
- if DocumentPresentation.Exists then
- Warnlog "either wrong position for 'End Slideshow', or the command didnt work."
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
- Printlog " We open the last entry (End Show): " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
- hMenuSelectNr (4)'MenuGetItemCount) 'End Slideshow
- else
- printlog "The presentation was closed, good."
- endif
-
- '/// Check that one can step one step forward, even if there is no more than one slide. ///'
- '/// Start the Slideshow. ///'
- hTypeKeys "<F5>"
- sleep (3)
- '/// Check that the right mousebutton brings up the Context-Menu. ///'
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
-
- hMenuSelectNr (2) 'Open the Goto Slide -menu.
-
- '/// Select the 'one step forward' -entry ///'
- hMenuSelectNr (1)
-
- '/// Check that we're on the last slide ///'
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
-
- hMenuSelectNr (2) 'Open the Goto Slide -menu.
- if MenuIsItemEnabled (MenugetItemID(4)) then
- printlog "Jumped to the right slide"
- else
- warnlog "possibly the 'jump to slide' -menu didnt quite work"
- endif
-
- '/// Close the Context-Menu ///'
- hMenuSelectNr (0)
- Kontext "DocumentPresentation"
-
- '/// Check if the context-menu also comes up at the very last page (slideshow-ending) ///'
- DocumentPresentation.TypeKeys "<SPACE>"
- sleep 1
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
-
- if MenuGetItemText (MenuGetItemID(1)) <> "" then
- Printlog "Context-menu came up at the last page: correct."
- else
- Warnlog "Context-menu did NOT come up correctly at the last page: false."
- endif
-
- '/// Check if we from here, via the context menu, can go back to the first page ///'
- hMenuSelectNr (2) 'Open the Goto Slide -menu.
- sleep 1
- hMenuSelectNr (1) 'First Slide
-
- '/// Check that we're on the first slide ///'
- Kontext "DocumentPresentation"
- DocumentPresentation.MouseDown 50, 50, 3
- DocumentPresentation.MouseUp 50, 50, 3
- sleep 2
-
- hMenuSelectNr (2) 'Open the Goto Slide -menu.
- if MenuIsItemEnabled (MenugetItemID(3)) then
- printlog "Jumped to the right slide"
- else
- warnlog "possibly the 'jump to slide' -menu didnt quite work from the last slide"
- endif
-
- '/// Close the Context-Menu ///'
- MenuSelect (0)
- '/// Close the Presentation ///'
- hTypeKeys "<ESCAPE>"
- '/// Close Document ///'
- Call hCloseDocument
+ goto endsub
+
+ dim NumberOfEntries as Integer
+
+ Printlog "- ContextMenu in Slideshow"
+ printlog "New Impress Document"
+ Call hNewDocument
+ printlog "Insert three new Slides"
+ InsertSlide
+ InsertSlide
+ InsertSlide
+ printlog "Start the Slideshow."
+ hTypeKeys "<F5>"
+ sleep (3)
+ printlog "Check that the right mousebutton brings up the Context-Menu."
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ printlog "Check that the right-click brought up a Context-Menu."
+ printlog "And check the number of Menu-Positions (there should be XXX of them )"
+ NumberOfEntries = 0
+ sleep 2
+ try
+ NumberOfEntries = MenuGetItemCount
+ catch
+ warnlog " No ContextMenu found? Please inform the Automatic Tester"
+ kontext "DocumentImpress"
+ hOpenContextMenu
+ NumberOfEntries = MenuGetItemCount
+ endcatch
+ if (NumberOfEntries = 0) then
+ Warnlog " the Context-Menu doesnt contain any entries, or were not up. Test ends."
+ Goto Endsub
+ endif
+ if NumberOfEntries <> 6 then
+ warnlog " Expected six entries in this Menu, but found " + NumberOfEntries
+ else
+ printlog " Number of Entries was: " + NumberOfEntries
+ endif
+ printlog "Check that every position contains the expected Undermenu. (Screen: Black/White. and End Slideshow)"
+ printlog "And check that Menu-Item one opens an undermenu."
+ Printlog " We open number four: " + MenuGetItemText(MenuGetItemID(4))
+ hMenuSelectNr (3)
+ sleep 2
+ NumberOfEntries = MenuGetItemCount
+ printlog " Menu-entries: " + MenuGetItemCount
+ if (NumberOfEntries <> 2) then
+ Warnlog " the first Context-Menu-entry was NOT 'Screen'."
+ else
+ Printlog " We open the next number one: " + MenuGetItemText(MenuGetItemID(1))
+ hMenuSelectNr (1)
+ endif
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ hMenuSelectNr (3) 'Open the Screen -menu.
+ sleep 2
+ Printlog " We open number two: " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
+ hMenuSelectNr (2) 'Choose "White"
+ sleep 2
+
+ 'TODO - Due to existing bug, function not yet available.
+ printlog "Change to slideshow-ending. Check that the Context-Menu also comes up here."
+ 'DocumentPresentation.
+ hTypeKeys "<SPACE>"
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+ NumberOfEntries = 0
+ NumberOfEntries = MenuGetItemCount
+ if NumberOfEntries <> 0 then
+ printlog " Menu-entries: " + MenuGetItemCount
+ else
+ warnlog " No context-menu at Slideshow-endpage."
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ endif
+
+ printlog "And that one can go back."
+ hMenuSelectNr (2) 'Open the Goto Slide -menu.
+ sleep 2
+ Printlog " We open number one (should be 'Goto First Slide'): " + MenuGetItemText(MenuGetItemID(1))
+ hMenuSelectNr (2) 'Choose "Back" 'TODO ;: but now we just end the slideshow
+ sleep 2
+
+ Kontext "DocumentPresentation"
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ DocumentPresentation.TypeKeys "<ESCAPE>"
+ Kontext "DocumentImpress"
+
+ printlog "Start the Slideshow."
+ hTypeKeys "<F5>"
+ printlog "Check that the right mousebutton brings up the Context-Menu."
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+
+ printlog "Check that Menu-Item (three) really finishes the presentation."
+ Printlog " We open the last entry (End Show): " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
+ hMenuSelectNr (4)'MenuGetItemCount) 'End Slideshow
+ sleep 4
+ if DocumentPresentation.Exists then
+ Warnlog "either wrong position for 'End Slideshow', or the command didnt work."
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+ Printlog " We open the last entry (End Show): " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
+ hMenuSelectNr (4)'MenuGetItemCount) 'End Slideshow
+ else
+ printlog "The presentation was closed, good."
+ endif
+
+ printlog "Check that one can step one step forward, even if there is no more than one slide."
+ printlog "Start the Slideshow."
+ hTypeKeys "<F5>"
+ sleep (3)
+ printlog "Check that the right mousebutton brings up the Context-Menu."
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+
+ hMenuSelectNr (2) 'Open the Goto Slide -menu.
+
+ printlog "Select the 'one step forward' -entry"
+ hMenuSelectNr (1)
+
+ printlog "Check that we're on the last slide"
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+
+ hMenuSelectNr (2) 'Open the Goto Slide -menu.
+ if MenuIsItemEnabled (MenugetItemID(4)) then
+ printlog "Jumped to the right slide"
+ else
+ warnlog "possibly the 'jump to slide' -menu didnt quite work"
+ endif
+
+ printlog "Close the Context-Menu"
+ hMenuSelectNr (0)
+ Kontext "DocumentPresentation"
+
+ printlog "Check if the context-menu also comes up at the very last page (slideshow-ending)"
+ DocumentPresentation.TypeKeys "<SPACE>"
+ sleep 1
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+
+ if MenuGetItemText (MenuGetItemID(1)) <> "" then
+ Printlog "Context-menu came up at the last page: correct."
+ else
+ Warnlog "Context-menu did NOT come up correctly at the last page: false."
+ endif
+
+ printlog "Check if we from here, via the context menu, can go back to the first page"
+ hMenuSelectNr (2) 'Open the Goto Slide -menu.
+ sleep 1
+ hMenuSelectNr (1) 'First Slide
+
+ printlog "Check that we're on the first slide"
+ Kontext "DocumentPresentation"
+ DocumentPresentation.MouseDown 50, 50, 3
+ DocumentPresentation.MouseUp 50, 50, 3
+ sleep 2
+
+ hMenuSelectNr (2) 'Open the Goto Slide -menu.
+ if MenuIsItemEnabled (MenugetItemID(3)) then
+ printlog "Jumped to the right slide"
+ else
+ warnlog "possibly the 'jump to slide' -menu didnt quite work from the last slide"
+ endif
+
+ printlog "Close the Context-Menu"
+ MenuSelect (0)
+ printlog "Close the Presentation"
+ hTypeKeys "<ESCAPE>"
+ printlog "Close Document"
+ Call hCloseDocument
endcase 'tSlideshowContextMenuMoreSlides
-'****************************************************************************************************
+'-------------------------------------------------------------------------------
testcase tiMousePointerHides
+
qaerrorlog "Test not yet ready."
- goto endsub
- dim i as Integer
- Printlog "- ContextMenu in Slideshow"
- '/// New Impress Document ///'
- Call hNewDocument
-
- '/// Start the Slideshow. ///'
- hTypeKeys "<F5>"
- sleep 1
- i = 0
- while ((getMouseStyle = 0) AND (i<20))
- sleep 1
- inc (i)
- printlog getMouseStyle
- if (getMouseStyle <> 0) then i = 20
- wend
- if (getMouseStyle <> 0) then
- printlog "Mousepointer disappeared like it should have"
- else
- warnlog "the mousepointer was still visible, after 20 seconds."
- endif
-
- hTypeKeys "<ESCAPE>"
- hTypeKeys "<ESCAPE>"
-
- '/// Close Document ///'
- Call hCloseDocument
-endcase 'tSlideshowContextMenuMoreSlides
+ goto endsub
-'****************************************************************************************************
+ dim i as Integer
+ Printlog "- ContextMenu in Slideshow"
+ printlog "New Impress Document"
+ Call hNewDocument
+
+ printlog "Start the Slideshow."
+ hTypeKeys "<F5>"
+ sleep 1
+ i = 0
+ while ((getMouseStyle = 0) AND (i<20))
+ sleep 1
+ inc (i)
+ printlog getMouseStyle
+ if (getMouseStyle <> 0) then i = 20
+ wend
+ if (getMouseStyle <> 0) then
+ printlog "Mousepointer disappeared like it should have"
+ else
+ warnlog "the mousepointer was still visible, after 20 seconds."
+ endif
+
+ hTypeKeys "<ESCAPE>"
+ hTypeKeys "<ESCAPE>"
+
+ printlog "Close Document"
+ Call hCloseDocument
+endcase 'tiMousePointerHides
+
+'------------------------------------------------------------------------------- \ No newline at end of file
diff --git a/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc b/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc
index ea8efd09dd2c..38c25d41bde5 100644
--- a/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc
+++ b/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc
@@ -358,10 +358,10 @@ endcase
testcase tFileRecentDocuments
-'if gPlatform = "lin" then
-' warnlog "#110649# Due to bug this testcase is not available"
-' goto endsub
-'end if
+if gPlatform = "lin" then
+ warnlog "#110649# Due to bug this testcase is not available"
+ goto endsub
+end if
dim sTestFile as string
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index 335505de85ac..a355ff86d00e 100755
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -754,9 +754,10 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
// initial measurement of text break position
UniCharArrayOffset nBreakPos = mnMinCharPos;
const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth );
+ if( nATSUMaxWidth <= 0xFFFF ) // #i108584# avoid ATSU rejecting the parameter
+ return mnMinCharPos; // or do ATSUMaxWidth=0x10000;
OSStatus eStatus = ATSUBreakLine( maATSULayout, mnMinCharPos,
nATSUMaxWidth, false, &nBreakPos );
-
if( (eStatus != noErr) && (eStatus != kATSULineBreakInWord) )
return STRING_LEN;
@@ -781,7 +782,7 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
if( eStatus != noErr )
return nBreakPos;
const ATSUTextMeasurement nATSURemWidth = nATSUMaxWidth - (nRight - nLeft);
- if( nATSURemWidth <= 0 )
+ if( nATSURemWidth <= 0xFFFF ) // #i108584# avoid ATSU rejecting the parameter
return nBreakPos;
UniCharArrayOffset nBreakPosInWord = nBreakPos;
eStatus = ATSUBreakLine( maATSULayout, nBreakPos, nATSURemWidth, false, &nBreakPosInWord );
diff --git a/vcl/inc/vcl/arrange.hxx b/vcl/inc/vcl/arrange.hxx
index f98197231be9..327494b216e4 100644
--- a/vcl/inc/vcl/arrange.hxx
+++ b/vcl/inc/vcl/arrange.hxx
@@ -76,11 +76,13 @@ namespace vcl
Element( Window* i_pWin,
boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
- sal_Int32 i_nExpandPriority = 0
+ sal_Int32 i_nExpandPriority = 0,
+ const Size& i_rMinSize = Size()
)
: m_pElement( i_pWin )
, m_pChild( i_pChild )
, m_nExpandPriority( i_nExpandPriority )
+ , m_aMinSize( i_rMinSize )
, m_bHidden( false )
, m_nLeftBorder( 0 )
, m_nTopBorder( 0 )
@@ -101,12 +103,19 @@ namespace vcl
Rectangle m_aManagedArea;
long m_nOuterBorder;
+ rtl::OUString m_aIdentifier;
+
virtual Element* getElement( size_t i_nIndex ) = 0;
const Element* getConstElement( size_t i_nIndex ) const
{ return const_cast<WindowArranger*>(this)->getElement( i_nIndex ); }
public:
+ static long getDefaultBorder();
+
+ static long getBorderValue( long nBorder )
+ { return nBorder >= 0 ? nBorder : -nBorder * getDefaultBorder(); }
+
WindowArranger( WindowArranger* i_pParent = NULL )
: m_pParentWindow( i_pParent ? i_pParent->m_pParentWindow : NULL )
, m_pParentArranger( i_pParent )
@@ -141,6 +150,9 @@ namespace vcl
virtual bool isVisible() const; // true if any element is visible
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const;
+ virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
+
sal_Int32 getExpandPriority( size_t i_nIndex ) const
{
const Element* pEle = getConstElement( i_nIndex );
@@ -173,6 +185,19 @@ namespace vcl
}
}
+ void getBorders( size_t i_nIndex, long* i_pLeft = NULL, long* i_pTop = NULL, long* i_pRight = NULL, long* i_pBottom = NULL ) const
+ {
+ const Element* pEle = getConstElement( i_nIndex );
+ if( pEle )
+ {
+ if( i_pLeft ) *i_pLeft = pEle->m_nLeftBorder;
+ if( i_pTop ) *i_pTop = pEle->m_nTopBorder;
+ if( i_pRight ) *i_pRight = pEle->m_nRightBorder;
+ if( i_pBottom ) *i_pBottom = pEle->m_nBottomBorder;
+ }
+ }
+
+
void show( bool i_bShow = true, bool i_bImmediateUpdate = true );
void setManagedArea( const Rectangle& i_rArea )
@@ -187,6 +212,12 @@ namespace vcl
m_nOuterBorder = i_nBorder;
resize();
}
+
+ const rtl::OUString getIdentifier() const
+ { return m_aIdentifier; }
+
+ void setIdentifier( const rtl::OUString& i_rId )
+ { m_aIdentifier = i_rId; }
};
class VCL_DLLPUBLIC RowOrColumn : public WindowArranger
@@ -204,7 +235,7 @@ namespace vcl
public:
RowOrColumn( WindowArranger* i_pParent = NULL,
- bool bColumn = true, long i_nBorderWidth = 5 )
+ bool bColumn = true, long i_nBorderWidth = -1 )
: WindowArranger( i_pParent )
, m_nBorderWidth( i_nBorderWidth )
, m_bColumn( bColumn )
@@ -218,7 +249,7 @@ namespace vcl
// add a managed window at the given index
// an index smaller than zero means add the window at the end
- size_t addWindow( Window*, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 );
+ size_t addWindow( Window*, sal_Int32 i_nExpandPrio = 0, const Size& i_rMinSize = Size(), size_t i_nIndex = ~0 );
void remove( Window* );
size_t addChild( boost::shared_ptr<WindowArranger> const &, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 );
@@ -248,7 +279,7 @@ namespace vcl
}
public:
- LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = 5 )
+ LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = -1 )
: WindowArranger( i_pParent )
, m_nDistance( i_nDistance )
, m_nLabelColumnWidth( 0 )
@@ -278,7 +309,7 @@ namespace vcl
{
long getLabelWidth() const;
public:
- LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = 5 )
+ LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = -1 )
: RowOrColumn( i_pParent, true, i_nBorderWidth )
{}
virtual ~LabelColumn();
@@ -288,7 +319,7 @@ namespace vcl
// returns the index of the added label
size_t addRow( Window* i_pLabel, boost::shared_ptr<WindowArranger> const& i_rElement, long i_nIndent = 0 );
- size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0 );
+ size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0, const Size& i_rElementMinSize = Size() );
};
class VCL_DLLPUBLIC Indenter : public WindowArranger
@@ -301,7 +332,7 @@ namespace vcl
{ return i_nIndex == 0 ? &m_aElement : NULL; }
public:
- Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 15 )
+ Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 3*getDefaultBorder() )
: WindowArranger( i_pParent )
, m_nIndent( i_nIndent )
{}
@@ -370,9 +401,10 @@ namespace vcl
MatrixElement( Window* i_pWin,
sal_uInt32 i_nX, sal_uInt32 i_nY,
boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
- sal_Int32 i_nExpandPriority = 0
+ sal_Int32 i_nExpandPriority = 0,
+ const Size& i_rMinSize = Size()
)
- : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority )
+ : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority, i_rMinSize )
, m_nX( i_nX )
, m_nY( i_nY )
{
@@ -397,8 +429,8 @@ namespace vcl
public:
MatrixArranger( WindowArranger* i_pParent = NULL,
- long i_nBorderX = 5,
- long i_nBorderY = 5 )
+ long i_nBorderX = -1,
+ long i_nBorderY = -1 )
: WindowArranger( i_pParent )
, m_nBorderX( i_nBorderX )
, m_nBorderY( i_nBorderY )
@@ -411,7 +443,7 @@ namespace vcl
virtual size_t countElements() const { return m_aElements.size(); }
// add a managed window at the given matrix position
- size_t addWindow( Window*, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
+ size_t addWindow( Window*, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0, const Size& i_rMinSize = Size() );
void remove( Window* );
size_t addChild( boost::shared_ptr<WindowArranger> const &, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index 27dbbfc80c72..52e4b5014120 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -38,7 +38,8 @@
#include <vcl/font.hxx>
#include <vcl/graphictools.hxx>
-#include <com/sun/star/io/XOutputStream.hpp>
+#include "com/sun/star/io/XOutputStream.hpp"
+#include "com/sun/star/beans/XMaterialHolder.hpp"
#include <list>
#include <vector>
@@ -64,16 +65,6 @@ namespace vcl
class PDFExtOutDevData;
-struct PDFDocInfo
-{
- String Title; // document title
- String Author; // document author
- String Subject; // subject
- String Keywords; // keywords
- String Creator; // application that created the original document
- String Producer; // OpenOffice
-};
-
struct PDFNote
{
String Title; // optional title for the popup containing the note
@@ -471,7 +462,7 @@ public:
FitVisible,
ActionZoom
};
-// These emuns are treated as integer while reading/writing to configuration
+// These enums are treated as integer while reading/writing to configuration
enum PDFPageLayout
{
DefaultLayout,
@@ -492,20 +483,35 @@ public:
/*
The following structure describes the permissions used in PDF security
*/
- struct PDFSecPermissions
+ struct PDFEncryptionProperties
{
-//for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
- bool CanPrintTheDocument;
+
+ bool Security128bit; // true to select 128 bit encryption, false for 40 bit
+ //for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
+ bool CanPrintTheDocument;
bool CanModifyTheContent;
bool CanCopyOrExtract;
bool CanAddOrModify;
-//for revision 3 (bit 128 security) only
+ //for revision 3 (bit 128 security) only
bool CanFillInteractive;
bool CanExtractForAccessibility;
bool CanAssemble;
bool CanPrintFull;
-//permission default set for 128 bit, accessibility only
- PDFSecPermissions() :
+
+ // encryption will only happen if EncryptionKey is not empty
+ // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier
+ // if these do not match, behavior is undefined, most likely an invalid PDF will be produced
+ // OValue, UValue, EncryptionKey and DocumentIdentifier can be computed from
+ // PDFDocInfo, Owner password and User password used the InitEncryption method which
+ // implements the algorithms described in the PDF reference chapter 3.5: Encryption
+ std::vector<sal_uInt8> OValue;
+ std::vector<sal_uInt8> UValue;
+ std::vector<sal_uInt8> EncryptionKey;
+ std::vector<sal_uInt8> DocumentIdentifier;
+
+ //permission default set for 128 bit, accessibility only
+ PDFEncryptionProperties() :
+ Security128bit ( true ),
CanPrintTheDocument ( false ),
CanModifyTheContent ( false ),
CanCopyOrExtract ( false ),
@@ -515,6 +521,20 @@ The following structure describes the permissions used in PDF security
CanAssemble ( false ),
CanPrintFull ( false )
{}
+
+
+ bool Encrypt() const
+ { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
+ };
+
+ struct PDFDocInfo
+ {
+ String Title; // document title
+ String Author; // document author
+ String Subject; // subject
+ String Keywords; // keywords
+ String Creator; // application that created the original document
+ String Producer; // OpenOffice
};
struct PDFWriterContext
@@ -573,12 +593,8 @@ The following structure describes the permissions used in PDF security
sal_Int32 InitialPage;
sal_Int32 OpenBookmarkLevels; // -1 means all levels
- struct PDFSecPermissions AccessPermissions;
-
- bool Encrypt; // main encryption flag, must be true to encript
- bool Security128bit; // true to select 128 bit encryption, false for 40 bit
- rtl::OUString OwnerPassword; // owner password for PDF, in clear text
- rtl::OUString UserPassword; // user password for PDF, in clear text
+ PDFWriter::PDFEncryptionProperties Encryption;
+ PDFWriter::PDFDocInfo DocumentInfo;
com::sun::star::lang::Locale DocumentLocale; // defines the document default language
sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
@@ -609,15 +625,13 @@ The following structure describes the permissions used in PDF security
FirstPageLeft( false ),
InitialPage( 1 ),
OpenBookmarkLevels( -1 ),
- AccessPermissions( ),
- Encrypt( false ),
- Security128bit( true ),
+ Encryption(),
DPIx( 0 ),
DPIy( 0 )
{}
};
- PDFWriter( const PDFWriterContext& rContext );
+ PDFWriter( const PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
~PDFWriter();
/** Returns an OutputDevice for formatting
@@ -661,17 +675,6 @@ The following structure describes the permissions used in PDF security
};
void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
- /*
- * set document info; due to the use of document information in building the PDF document ID, must be called before
- * emitting anything.
- */
- void SetDocInfo( const PDFDocInfo& rInfo );
-
- /*
- * get currently set document info
- */
- const PDFDocInfo& GetDocInfo() const;
-
/* sets the document locale originally passed with the context to a new value
* only affects the output if used before calling <code>Emit/code>.
*/
@@ -689,6 +692,12 @@ The following structure describes the permissions used in PDF security
PDFVersion GetVersion() const;
+ static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+ InitEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ );
+
/* functions for graphics state */
/* flag values: see vcl/outdev.hxx */
void Push( USHORT nFlags = 0xffff );
diff --git a/vcl/inc/vcl/prndlg.hxx b/vcl/inc/vcl/prndlg.hxx
index d53354c40b4a..1d16a2241485 100644
--- a/vcl/inc/vcl/prndlg.hxx
+++ b/vcl/inc/vcl/prndlg.hxx
@@ -128,7 +128,6 @@ namespace vcl
// border around each page
CheckBox maBorderCB;
- vcl::RowOrColumn maLayout;
boost::shared_ptr< vcl::RowOrColumn > mxBrochureDep;
boost::shared_ptr< vcl::LabeledElement >mxPagesBtnLabel;
@@ -144,7 +143,7 @@ namespace vcl
void showAdvancedControls( bool );
- virtual void Resize();
+ // virtual void Resize();
};
class JobTabPage : public TabPage
@@ -176,7 +175,6 @@ namespace vcl
long mnCollateUIMode;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxPrintRange;
boost::shared_ptr<vcl::WindowArranger> mxDetails;
@@ -186,7 +184,7 @@ namespace vcl
void readFromSettings();
void storeToSettings();
- virtual void Resize();
+ // virtual void Resize();
void setupLayout();
};
@@ -199,7 +197,6 @@ namespace vcl
CheckBox maCollateSingleJobsBox;
CheckBox maReverseOrderBox;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxOptGroup;
OutputOptPage( Window*, const ResId& );
@@ -208,7 +205,7 @@ namespace vcl
void readFromSettings();
void storeToSettings();
- virtual void Resize();
+ // virtual void Resize();
void setupLayout();
};
@@ -253,7 +250,6 @@ namespace vcl
rtl::OUString maPrintText;
rtl::OUString maDefPrtText;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxPreviewCtrls;
Size maDetailsCollapsedSize;
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index a4ce806a7e8a..67aa6806be49 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -167,6 +167,8 @@ struct ImplSVAppData
BOOL mbDialogCancel; // TRUE: Alle Dialog::Execute()-Aufrufe werden mit return FALSE sofort beendet
BOOL mbNoYield; // Application::Yield will not wait for events if the queue is empty
// essentially that makes it the same as Application::Reschedule
+ long mnDefaultLayoutBorder; // default value in pixel for layout distances used
+ // in window arrangers
/** Controls whether showing any IME status window is toggled on or off.
diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h
index ff76874de11a..4a7f1c644400 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -99,7 +99,10 @@ namespace dnd {
class XDropTarget;
} } } } }
-namespace vcl { struct ControlLayoutData; }
+namespace vcl {
+ struct ControlLayoutData;
+ struct ExtWindowImpl;
+}
@@ -237,6 +240,7 @@ public:
ImplDelData* mpFirstDel;
void* mpUserData;
+ vcl::ExtWindowImpl* mpExtImpl;
Cursor* mpCursor;
Pointer maPointer;
Fraction maZoom;
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index d209becfb4ae..700a87695085 100644..100755
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -50,6 +50,7 @@
#include <rtl/ustring.hxx>
#include <cppuhelper/weakref.hxx>
#include <com/sun/star/uno/Reference.hxx>
+#include <boost/shared_ptr.hpp>
class VirtualDevice;
struct ImplDelData;
@@ -94,6 +95,13 @@ namespace accessibility {
namespace com {
namespace sun {
namespace star {
+namespace beans {
+ struct PropertyValue;
+}}}}
+
+namespace com {
+namespace sun {
+namespace star {
namespace rendering {
class XCanvas;
class XSpriteCanvas;
@@ -121,7 +129,11 @@ namespace dnd {
class XDropTarget;
} } } } }
-namespace vcl { struct ControlLayoutData; }
+namespace vcl {
+ struct ControlLayoutData;
+ class WindowArranger;
+ struct ExtWindowImpl;
+}
namespace svt { class PopupWindowControllerImpl; }
@@ -475,6 +487,10 @@ public:
SAL_DLLPRIVATE BOOL ImplUpdatePos();
SAL_DLLPRIVATE void ImplUpdateSysObjPos();
SAL_DLLPRIVATE WindowImpl* ImplGetWindowImpl() const { return mpWindowImpl; }
+ SAL_DLLPRIVATE void ImplFreeExtWindowImpl();
+ // creates ExtWindowImpl on demand, but may return NULL (e.g. if mbInDtor)
+ SAL_DLLPRIVATE vcl::ExtWindowImpl* ImplGetExtWindowImpl() const;
+ SAL_DLLPRIVATE void ImplDeleteOwnedChildren();
/** check whether a font is suitable for UI
The font to be tested will be checked whether it could display a
@@ -540,6 +556,7 @@ public:
SAL_DLLPRIVATE BOOL ImplRegisterAccessibleNativeFrame();
SAL_DLLPRIVATE void ImplRevokeAccessibleNativeFrame();
SAL_DLLPRIVATE void ImplCallResize();
+ SAL_DLLPRIVATE void ImplExtResize();
SAL_DLLPRIVATE void ImplCallMove();
SAL_DLLPRIVATE Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle& rRect ) const;
SAL_DLLPRIVATE void ImplMirrorFramePos( Point &pt ) const;
@@ -1099,6 +1116,56 @@ public:
virtual XubString GetSurroundingText() const;
virtual Selection GetSurroundingTextSelection() const;
+
+ // ExtImpl
+
+ // layouting
+ boost::shared_ptr< vcl::WindowArranger > getLayout();
+
+ /* add a child Window
+ addWindow will do the following things
+ - insert the passed window into the child list (equivalent to i_pWin->SetParent( this ))
+ - mark the window as "owned", meaning that the added Window will be destroyed by
+ the parent's desctructor.
+ This means: do not pass in member windows or stack objects here. Do not cause
+ the destructor of the added window to be called in any way.
+
+ to avoid ownership pass i_bTakeOwnership as "false"
+ */
+ void addWindow( Window* i_pWin, bool i_bTakeOwnership = true );
+
+ /* remove a child Window
+ the remove window functions will
+ - reparent the searched window (equivalent to i_pWin->SetParent( i_pNewParent ))
+ - return a pointer to the removed window or NULL if i_pWin was not found
+ caution: ownership passes to the new parent or the caller, if the new parent was NULL
+ */
+ Window* removeWindow( Window* i_pWin, Window* i_pNewParent = NULL );
+
+ /* return the identifier of this window
+ */
+ const rtl::OUString& getIdentifier() const;
+ /* set an identifier
+ identifiers have only loosely defined rules per se
+ in context of Window they must be unique over the window
+ hierarchy you'd like to find them again using the findWindow method
+ */
+ void setIdentifier( const rtl::OUString& );
+
+ /* returns the first found descendant that matches
+ the passed identifier or NULL
+ */
+ Window* findWindow( const rtl::OUString& ) const;
+
+ /* get/set properties
+ this will contain window properties (like visible, enabled)
+ as well as properties of derived classes (e.g. text of Edit fields)
+ */
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const;
+ /*
+ */
+ virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
+
};
diff --git a/vcl/inc/vcl/wpropset.hxx b/vcl/inc/vcl/wpropset.hxx
new file mode 100644
index 000000000000..409b629496e6
--- /dev/null
+++ b/vcl/inc/vcl/wpropset.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef VCL_WPROPSET_HXX
+#define VCL_WPROPSET_HXX
+
+#include "vcl/dllapi.h"
+
+#include "tools/link.hxx"
+#include "vcl/arrange.hxx"
+
+#include "com/sun/star/beans/XPropertySet.hpp"
+
+class VclWindowEvent;
+
+namespace vcl
+{
+ class WindowPropertySetData;
+ class WindowPropertySetListener;
+
+ class VCL_DLLPUBLIC WindowPropertySet
+ {
+ WindowPropertySetData* mpImpl;
+
+ void addWindowToSet( Window* );
+ void addLayoutToSet( const boost::shared_ptr<WindowArranger>& );
+ void setupProperties();
+
+ DECL_LINK( ChildEventListener, VclWindowEvent* );
+
+ void propertyChange( const com::sun::star::beans::PropertyChangeEvent& );
+ friend class vcl::WindowPropertySetListener;
+
+ public:
+ WindowPropertySet( Window* i_pTopWindow, bool i_bTakeOwnership );
+ ~WindowPropertySet();
+
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > getPropertySet() const;
+ };
+}
+
+#endif
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 9e6d39d925c0..6d452e8ee43f 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -154,4 +154,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\helper.hxx %_DEST%\inc%_EXT%\vcl\helper.hxx
..\inc\vcl\strhelper.hxx %_DEST%\inc%_EXT%\vcl\strhelper.hxx
..\inc\vcl\lazydelete.hxx %_DEST%\inc%_EXT%\vcl\lazydelete.hxx
+..\inc\vcl\arrange.hxx %_DEST%\inc%_EXT%\vcl\arrange.hxx
+..\inc\vcl\wpropset.hxx %_DEST%\inc%_EXT%\vcl\wpropset.hxx
..\%__SRC%\misc\vcl.component %_DEST%\xml%_EXT%\vcl.component
+
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 03b0365cff63..935d2c1894ea 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -129,6 +129,9 @@ void ImplInitSVData()
break;
}
}
+
+ // mark default layout border as unitialized
+ pImplSVData->maAppData.mnDefaultLayoutBorder = -1;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 8c1545758c3b..79d875542509 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1441,19 +1441,35 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
rIStm >> mnLen;
rIStm >> nAryLen;
+ if ( mnIndex > mnLen )
+ {
+ mnIndex = 0;
+ mpDXAry = 0;
+ return;
+ }
+
if( nAryLen )
{
// #i9762#, #106172# Ensure that DX array is at least mnLen entries long
- const ULONG nIntAryLen( Max(nAryLen, static_cast<sal_uInt32>(mnLen)) );
- mpDXAry = new sal_Int32[ nIntAryLen ];
-
- ULONG i;
- for( i = 0UL; i < nAryLen; i++ )
- rIStm >> mpDXAry[ i ];
+ if ( mnLen >= nAryLen )
+ {
+ mpDXAry = new (std::nothrow)sal_Int32[ mnLen ];
+ if ( mpDXAry )
+ {
+ ULONG i;
+ for( i = 0UL; i < nAryLen; i++ )
+ rIStm >> mpDXAry[ i ];
- // #106172# setup remainder
- for( ; i < nIntAryLen; i++ )
- mpDXAry[ i ] = 0;
+ // #106172# setup remainder
+ for( ; i < mnLen; i++ )
+ mpDXAry[ i ] = 0;
+ }
+ }
+ else
+ {
+ mpDXAry = NULL;
+ return;
+ }
}
else
mpDXAry = NULL;
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 969bc51b3cac..23ce1dfa6169 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -38,9 +38,9 @@ PDFWriter::AnyWidget::~AnyWidget()
{
}
-PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext )
+PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc )
:
- pImplementation( new PDFWriterImpl( rContext, *this ) )
+ pImplementation( new PDFWriterImpl( rContext, xEnc, *this ) )
{
}
@@ -69,16 +69,6 @@ PDFWriter::PDFVersion PDFWriter::GetVersion() const
return ((PDFWriterImpl*)pImplementation)->getVersion();
}
-void PDFWriter::SetDocInfo( const PDFDocInfo& rInfo )
-{
- ((PDFWriterImpl*)pImplementation)->setDocInfo( rInfo );
-}
-
-const PDFDocInfo& PDFWriter::GetDocInfo() const
-{
- return ((PDFWriterImpl*)pImplementation)->getDocInfo();
-}
-
void PDFWriter::SetDocumentLocale( const com::sun::star::lang::Locale& rLoc )
{
((PDFWriterImpl*)pImplementation)->setDocumentLocale( rLoc );
@@ -570,7 +560,17 @@ std::set< PDFWriter::ErrorCode > PDFWriter::GetErrors()
return ((PDFWriterImpl*)pImplementation)->getErrors();
}
+com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+PDFWriter::InitEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ )
+{
+ return PDFWriterImpl::initEncryption( i_rOwnerPassword, i_rUserPassword, b128Bit );
+}
+
void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData )
{
((PDFWriterImpl*)pImplementation)->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
}
+
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 5d75c829da8a..325ccef1c3a6 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -113,12 +113,10 @@ void doTestCode()
aContext.Version = PDFWriter::PDF_1_4;
aContext.Tagged = true;
aContext.InitialPage = 2;
+ aContext.DocumentInfo.Title = OUString( RTL_CONSTASCII_USTRINGPARAM( "PDF export test document" ) );
+ aContext.DocumentInfo.Producer = OUString( RTL_CONSTASCII_USTRINGPARAM( "VCL" ) );
PDFWriter aWriter( aContext );
- PDFDocInfo aDocInfo;
- aDocInfo.Title = OUString( RTL_CONSTASCII_USTRINGPARAM( "PDF export test document" ) );
- aDocInfo.Producer = OUString( RTL_CONSTASCII_USTRINGPARAM( "VCL" ) );
- aWriter.SetDocInfo( aDocInfo );
aWriter.NewPage( 595, 842 );
aWriter.BeginStructureElement( PDFWriter::Document );
// set duration of 3 sec for first page
@@ -496,6 +494,12 @@ static inline double pixelToPoint( sal_Int32 px ) { return double(px)/fDivisor;
static inline double pixelToPoint( double px ) { return px/fDivisor; }
static inline sal_Int32 pointToPixel( double pt ) { return sal_Int32(pt*fDivisor); }
+const sal_uInt8 PDFWriterImpl::s_nPadString[32] =
+{
+ 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
+ 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A
+};
+
static void appendHex( sal_Int8 nInt, OStringBuffer& rBuffer )
{
static const sal_Char pHexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7',
@@ -1693,7 +1697,9 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
* class PDFWriterImpl
*/
-PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, PDFWriter& i_rOuterFace )
+ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext,
+ const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc,
+ PDFWriter& i_rOuterFace)
:
m_pReferenceDevice( NULL ),
m_aMapMode( MAP_POINT, Point(), Fraction( 1L, pointToPixel(1) ), Fraction( 1L, pointToPixel(1) ) ),
@@ -1714,9 +1720,6 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, PDFWr
m_aCipher( (rtlCipher)NULL ),
m_aDigest( NULL ),
m_bEncryptThisStream( false ),
- m_aDocID( 32 ),
- m_aCreationDateString( 64 ),
- m_aCreationMetaDateString( 64 ),
m_pEncryptionBuffer( NULL ),
m_nEncryptionBufferSize( 0 ),
m_bIsPDF_A1( false ),
@@ -1759,14 +1762,37 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, PDFWr
m_bOpen = true;
-/* prepare the cypher engine, can be done in CTOR, free in DTOR */
+ // setup DocInfo
+ setupDocInfo();
+ /* prepare the cypher engine, can be done in CTOR, free in DTOR */
m_aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
m_aDigest = rtl_digest_createMD5();
-/* the size of the Codec default maximum */
+ /* the size of the Codec default maximum */
checkEncryptionBufferSize( 0x4000 );
+ if( xEnc.is() )
+ prepareEncryption( xEnc );
+
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ // sanity check
+ if( m_aContext.Encryption.OValue.size() != ENCRYPTED_PWD_SIZE ||
+ m_aContext.Encryption.UValue.size() != ENCRYPTED_PWD_SIZE ||
+ m_aContext.Encryption.EncryptionKey.size() != MAXIMUM_RC4_KEY_LENGTH
+ )
+ {
+ // the field lengths are invalid ? This was not setup by initEncryption.
+ // do not encrypt after all
+ m_aContext.Encryption.OValue.clear();
+ m_aContext.Encryption.UValue.clear();
+ OSL_ENSURE( 0, "encryption data failed sanity check, encryption disabled" );
+ }
+ else // setup key lengths
+ m_nAccessPermissions = computeAccessPermissions( m_aContext.Encryption, m_nKeyLength, m_nRC4KeyLength );
+ }
+
// write header
OStringBuffer aBuffer( 20 );
aBuffer.append( "%PDF-" );
@@ -1812,139 +1838,138 @@ PDFWriterImpl::~PDFWriterImpl()
rtl_freeMemory( m_pEncryptionBuffer );
}
-void PDFWriterImpl::setDocInfo( const PDFDocInfo& rInfo )
+void PDFWriterImpl::setupDocInfo()
{
- m_aDocInfo.Title = rInfo.Title;
- m_aDocInfo.Author = rInfo.Author;
- m_aDocInfo.Subject = rInfo.Subject;
- m_aDocInfo.Keywords = rInfo.Keywords;
- m_aDocInfo.Creator = rInfo.Creator;
- m_aDocInfo.Producer = rInfo.Producer;
+ std::vector< sal_uInt8 > aId;
+ computeDocumentIdentifier( aId, m_aContext.DocumentInfo, m_aCreationDateString, m_aCreationMetaDateString );
+ if( m_aContext.Encryption.DocumentIdentifier.empty() )
+ m_aContext.Encryption.DocumentIdentifier = aId;
+}
-//build the document id
+void PDFWriterImpl::computeDocumentIdentifier( std::vector< sal_uInt8 >& o_rIdentifier,
+ const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
+ rtl::OString& o_rCString1,
+ rtl::OString& o_rCString2
+ )
+{
+ o_rIdentifier.clear();
+
+ //build the document id
rtl::OString aInfoValuesOut;
OStringBuffer aID( 1024 );
- if( m_aDocInfo.Title.Len() )
- appendUnicodeTextString( m_aDocInfo.Title, aID );
- if( m_aDocInfo.Author.Len() )
- appendUnicodeTextString( m_aDocInfo.Author, aID );
- if( m_aDocInfo.Subject.Len() )
- appendUnicodeTextString( m_aDocInfo.Subject, aID );
- if( m_aDocInfo.Keywords.Len() )
- appendUnicodeTextString( m_aDocInfo.Keywords, aID );
- if( m_aDocInfo.Creator.Len() )
- appendUnicodeTextString( m_aDocInfo.Creator, aID );
- if( m_aDocInfo.Producer.Len() )
- appendUnicodeTextString( m_aDocInfo.Producer, aID );
+ if( i_rDocInfo.Title.Len() )
+ appendUnicodeTextString( i_rDocInfo.Title, aID );
+ if( i_rDocInfo.Author.Len() )
+ appendUnicodeTextString( i_rDocInfo.Author, aID );
+ if( i_rDocInfo.Subject.Len() )
+ appendUnicodeTextString( i_rDocInfo.Subject, aID );
+ if( i_rDocInfo.Keywords.Len() )
+ appendUnicodeTextString( i_rDocInfo.Keywords, aID );
+ if( i_rDocInfo.Creator.Len() )
+ appendUnicodeTextString( i_rDocInfo.Creator, aID );
+ if( i_rDocInfo.Producer.Len() )
+ appendUnicodeTextString( i_rDocInfo.Producer, aID );
TimeValue aTVal, aGMT;
oslDateTime aDT;
osl_getSystemTime( &aGMT );
osl_getLocalTimeFromSystemTime( &aGMT, &aTVal );
osl_getDateTimeFromTimeValue( &aTVal, &aDT );
- m_aCreationDateString.append( "D:" );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
-//--> i59651, we fill the Metadata date string as well, if PDF/A is requested
- if( m_bIsPDF_A1 )
- {
-// according to ISO 19005-1:2005 6.7.3 the date is corrected for
-// local time zone offset UTC only, whereas Acrobat 8 seems
-// to use the localtime notation only
-// according to a raccomandation in XMP Specification (Jan 2004, page 75)
-// the Acrobat way seems the right approach
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
- m_aCreationMetaDateString.append( "-" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
- m_aCreationMetaDateString.append( "-" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
- m_aCreationMetaDateString.append( "T" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
- }
+ rtl::OStringBuffer aCreationDateString(64), aCreationMetaDateString(64);
+ aCreationDateString.append( "D:" );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
+
+ //--> i59651, we fill the Metadata date string as well, if PDF/A is requested
+ // according to ISO 19005-1:2005 6.7.3 the date is corrected for
+ // local time zone offset UTC only, whereas Acrobat 8 seems
+ // to use the localtime notation only
+ // according to a raccomandation in XMP Specification (Jan 2004, page 75)
+ // the Acrobat way seems the right approach
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
+ aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
+ aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
+ aCreationMetaDateString.append( "T" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
+
sal_uInt32 nDelta = 0;
if( aGMT.Seconds > aTVal.Seconds )
{
- m_aCreationDateString.append( "-" );
+ aCreationDateString.append( "-" );
nDelta = aGMT.Seconds-aTVal.Seconds;
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( "-" );
}
else if( aGMT.Seconds < aTVal.Seconds )
{
- m_aCreationDateString.append( "+" );
+ aCreationDateString.append( "+" );
nDelta = aTVal.Seconds-aGMT.Seconds;
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "+" );
+ aCreationMetaDateString.append( "+" );
}
else
{
- m_aCreationDateString.append( "Z" );
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "Z" );
+ aCreationDateString.append( "Z" );
+ aCreationMetaDateString.append( "Z" );
}
if( nDelta )
{
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
- m_aCreationDateString.append( "'" );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
- if( m_bIsPDF_A1 )
- {
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
- }
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
+ aCreationDateString.append( "'" );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
+
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
}
- m_aCreationDateString.append( "'" );
- aID.append( m_aCreationDateString.getStr(), m_aCreationDateString.getLength() );
+ aCreationDateString.append( "'" );
+ aID.append( aCreationDateString.getStr(), aCreationDateString.getLength() );
aInfoValuesOut = aID.makeStringAndClear();
+ o_rCString1 = aCreationDateString.makeStringAndClear();
+ o_rCString2 = aCreationMetaDateString.makeStringAndClear();
- DBG_ASSERT( m_aDigest != NULL, "PDFWrite_Impl::setDocInfo: cannot obtain a digest object !" );
-
- m_aDocID.setLength( 0 );
- if( m_aDigest )
+ rtlDigest aDigest = rtl_digest_createMD5();
+ OSL_ENSURE( aDigest != NULL, "PDFWriterImpl::computeDocumentIdentifier: cannot obtain a digest object !" );
+ if( aDigest )
{
- osl_getSystemTime( &aGMT );
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, &aGMT, sizeof( aGMT ) );
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_aContext.URL.getStr(), m_aContext.URL.getLength()*sizeof(sal_Unicode) );
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, &aGMT, sizeof( aGMT ) );
if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, aInfoValuesOut.getStr(), aInfoValuesOut.getLength() );
+ nError = rtl_digest_updateMD5( aDigest, aInfoValuesOut.getStr(), aInfoValuesOut.getLength() );
if( nError == rtl_Digest_E_None )
{
-//the binary form of the doc id is needed for encryption stuff
- rtl_digest_getMD5( m_aDigest, m_nDocID, 16 );
- for( unsigned int i = 0; i < 16; i++ )
- appendHex( m_nDocID[i], m_aDocID );
+ o_rIdentifier = std::vector< sal_uInt8 >( 16, 0 );
+ //the binary form of the doc id is needed for encryption stuff
+ rtl_digest_getMD5( aDigest, &o_rIdentifier[0], 16 );
}
}
}
@@ -1957,7 +1982,7 @@ append the string as unicode hex, encrypted if needed
inline void PDFWriterImpl::appendUnicodeTextStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer )
{
rOutBuffer.append( "<" );
- if( m_aContext.Encrypt )
+ if( m_aContext.Encryption.Encrypt() )
{
const sal_Unicode* pStr = rInString.getStr();
sal_Int32 nLen = rInString.getLength();
@@ -1994,7 +2019,7 @@ inline void PDFWriterImpl::appendLiteralStringEncrypt( rtl::OStringBuffer& rInSt
rOutBuffer.append( "(" );
sal_Int32 nChars = rInString.getLength();
//check for encryption, if ok, encrypt the string, then convert with appndLiteralString
- if( m_aContext.Encrypt && checkEncryptionBufferSize( nChars ) )
+ if( m_aContext.Encryption.Encrypt() && checkEncryptionBufferSize( nChars ) )
{
//encrypt the string in a buffer, then append it
enableStringEncryption( nInObjectNumber );
@@ -2384,9 +2409,6 @@ SalLayout* PDFWriterImpl::GetTextLayout( ImplLayoutArgs& rArgs, ImplFontSelectDa
sal_Int32 PDFWriterImpl::newPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, PDFWriter::Orientation eOrientation )
{
- if( m_aContext.Encrypt && m_aPages.empty() )
- initEncryption();
-
endPage();
m_nCurrentPage = m_aPages.size();
m_aPages.push_back( PDFPage(this, nPageWidth, nPageHeight, eOrientation ) );
@@ -5881,7 +5903,7 @@ bool PDFWriterImpl::emitCatalog()
}
// viewer preferences, if we had some, then emit
if( m_aContext.HideViewerToolbar ||
- ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
+ ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aContext.DocumentInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
m_aContext.HideViewerMenubar ||
m_aContext.HideViewerWindowControls || m_aContext.FitWindow ||
m_aContext.CenterWindow || (m_aContext.FirstPageLeft && m_aContext.PageLayout == PDFWriter::ContinuousFacing ) ||
@@ -5898,7 +5920,7 @@ bool PDFWriterImpl::emitCatalog()
aLine.append( "/FitWindow true\n" );
if( m_aContext.CenterWindow )
aLine.append( "/CenterWindow true\n" );
- if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
+ if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aContext.DocumentInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
aLine.append( "/DisplayDocTitle true\n" );
if( m_aContext.FirstPageLeft && m_aContext.PageLayout == PDFWriter::ContinuousFacing )
aLine.append( "/Direction/R2L\n" );
@@ -6002,40 +6024,40 @@ sal_Int32 PDFWriterImpl::emitInfoDict( )
aLine.append( nObject );
aLine.append( " 0 obj\n"
"<<" );
- if( m_aDocInfo.Title.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() )
{
aLine.append( "/Title" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Title, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Title, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Author.Len() )
+ if( m_aContext.DocumentInfo.Author.Len() )
{
aLine.append( "/Author" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Author, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Author, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Subject.Len() )
{
aLine.append( "/Subject" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Subject, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Subject, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Keywords.Len() )
{
aLine.append( "/Keywords" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Keywords, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Keywords, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Creator.Len() )
+ if( m_aContext.DocumentInfo.Creator.Len() )
{
aLine.append( "/Creator" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Creator, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Creator, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Producer.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() )
{
aLine.append( "/Producer" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Producer, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Producer, nObject, aLine );
aLine.append( "\n" );
}
@@ -6281,45 +6303,45 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <pdfaid:conformance>A</pdfaid:conformance>\n" );
aMetadataStream.append( " </rdf:Description>\n" );
//... Dublin Core properties go here
- if( m_aDocInfo.Title.Len() ||
- m_aDocInfo.Author.Len() ||
- m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() ||
+ m_aContext.DocumentInfo.Author.Len() ||
+ m_aContext.DocumentInfo.Subject.Len() )
{
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n" );
- if( m_aDocInfo.Title.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() )
{
// this is according to PDF/A-1, technical corrigendum 1 (2007-04-01)
aMetadataStream.append( " <dc:title>\n" );
aMetadataStream.append( " <rdf:Alt>\n" );
aMetadataStream.append( " <rdf:li xml:lang=\"x-default\">" );
rtl::OUString aTitle;
- escapeStringXML( m_aDocInfo.Title, aTitle );
+ escapeStringXML( m_aContext.DocumentInfo.Title, aTitle );
aMetadataStream.append( OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
aMetadataStream.append( " </dc:title>\n" );
}
- if( m_aDocInfo.Author.Len() )
+ if( m_aContext.DocumentInfo.Author.Len() )
{
aMetadataStream.append( " <dc:creator>\n" );
aMetadataStream.append( " <rdf:Seq>\n" );
aMetadataStream.append( " <rdf:li>" );
rtl::OUString aAuthor;
- escapeStringXML( m_aDocInfo.Author, aAuthor );
+ escapeStringXML( m_aContext.DocumentInfo.Author, aAuthor );
aMetadataStream.append( OUStringToOString( aAuthor , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Seq>\n" );
aMetadataStream.append( " </dc:creator>\n" );
}
- if( m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Subject.Len() )
{
// this is according to PDF/A-1, technical corrigendum 1 (2007-04-01)
aMetadataStream.append( " <dc:description>\n" );
aMetadataStream.append( " <rdf:Alt>\n" );
aMetadataStream.append( " <rdf:li xml:lang=\"x-default\">" );
rtl::OUString aSubject;
- escapeStringXML( m_aDocInfo.Subject, aSubject );
+ escapeStringXML( m_aContext.DocumentInfo.Subject, aSubject );
aMetadataStream.append( OUStringToOString( aSubject , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
@@ -6329,24 +6351,24 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
}
//... PDF properties go here
- if( m_aDocInfo.Producer.Len() ||
- m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() ||
+ m_aContext.DocumentInfo.Keywords.Len() )
{
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\">\n" );
- if( m_aDocInfo.Producer.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() )
{
aMetadataStream.append( " <pdf:Producer>" );
rtl::OUString aProducer;
- escapeStringXML( m_aDocInfo.Producer, aProducer );
+ escapeStringXML( m_aContext.DocumentInfo.Producer, aProducer );
aMetadataStream.append( OUStringToOString( aProducer , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Producer>\n" );
}
- if( m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Keywords.Len() )
{
aMetadataStream.append( " <pdf:Keywords>" );
rtl::OUString aKeywords;
- escapeStringXML( m_aDocInfo.Keywords, aKeywords );
+ escapeStringXML( m_aContext.DocumentInfo.Keywords, aKeywords );
aMetadataStream.append( OUStringToOString( aKeywords , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Keywords>\n" );
}
@@ -6355,11 +6377,11 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\">\n" );
- if( m_aDocInfo.Creator.Len() )
+ if( m_aContext.DocumentInfo.Creator.Len() )
{
aMetadataStream.append( " <xmp:CreatorTool>" );
rtl::OUString aCreator;
- escapeStringXML( m_aDocInfo.Creator, aCreator );
+ escapeStringXML( m_aContext.DocumentInfo.Creator, aCreator );
aMetadataStream.append( OUStringToOString( aCreator , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</xmp:CreatorTool>\n" );
}
@@ -6415,7 +6437,7 @@ bool PDFWriterImpl::emitTrailer()
sal_Int32 nSecObject = 0;
- if( m_aContext.Encrypt == true )
+ if( m_aContext.Encryption.Encrypt() )
{
//emit the security information
//must be emitted as indirect dictionary object, since
@@ -6429,16 +6451,16 @@ bool PDFWriterImpl::emitTrailer()
aLineS.append( " 0 obj\n"
"<</Filter/Standard/V " );
// check the version
- if( m_aContext.Security128bit == true )
+ if( m_aContext.Encryption.Security128bit )
aLineS.append( "2/Length 128/R 3" );
else
aLineS.append( "1/R 2" );
// emit the owner password, must not be encrypted
aLineS.append( "/O(" );
- appendLiteralString( (const sal_Char*)m_nEncryptedOwnerPassword, 32, aLineS );
+ appendLiteralString( (const sal_Char*)&m_aContext.Encryption.OValue[0], sal_Int32(m_aContext.Encryption.OValue.size()), aLineS );
aLineS.append( ")/U(" );
- appendLiteralString( (const sal_Char*)m_nEncryptedUserPassword, 32, aLineS );
+ appendLiteralString( (const sal_Char*)&m_aContext.Encryption.UValue[0], sal_Int32(m_aContext.Encryption.UValue.size()), aLineS );
aLineS.append( ")/P " );// the permission set
aLineS.append( m_nAccessPermissions );
aLineS.append( ">>\nendobj\n\n" );
@@ -6504,13 +6526,21 @@ bool PDFWriterImpl::emitTrailer()
aLine.append( nDocInfoObject );
aLine.append( " 0 R\n" );
}
- if( m_aDocID.getLength() )
+ if( ! m_aContext.Encryption.DocumentIdentifier.empty() )
{
aLine.append( "/ID [ <" );
- aLine.append( m_aDocID.getStr(), m_aDocID.getLength() );
+ for( std::vector< sal_uInt8 >::const_iterator it = m_aContext.Encryption.DocumentIdentifier.begin();
+ it != m_aContext.Encryption.DocumentIdentifier.end(); ++it )
+ {
+ appendHex( sal_Int8(*it), aLine );
+ }
aLine.append( ">\n"
"<" );
- aLine.append( m_aDocID.getStr(), m_aDocID.getLength() );
+ for( std::vector< sal_uInt8 >::const_iterator it = m_aContext.Encryption.DocumentIdentifier.begin();
+ it != m_aContext.Encryption.DocumentIdentifier.end(); ++it )
+ {
+ appendHex( sal_Int8(*it), aLine );
+ }
aLine.append( "> ]\n" );
}
if( aDocChecksum.getLength() )
@@ -7403,7 +7433,14 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
// try to handle ligatures and such
if( i < nGlyphs-1 )
{
- pUnicodesPerGlyph[i] = nChars = pCharPosAry[i+1] - pCharPosAry[i];
+ nChars = pCharPosAry[i+1] - pCharPosAry[i];
+ // #i115618# fix for simple RTL+CTL cases
+ // TODO: sanitize for RTL ligatures, more complex CTL, etc.
+ if( nChars < 0 )
+ nChars = -nChars;
+ else if( nChars == 0 )
+ nChars = 1;
+ pUnicodesPerGlyph[i] = nChars;
for( int n = 1; n < nChars; n++ )
aUnicodes.push_back( rText.GetChar( sal::static_int_cast<xub_StrLen>(pCharPosAry[i]+n) ) );
}
@@ -9661,7 +9698,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
aLine.append( "[ /Indexed/DeviceRGB " );
aLine.append( (sal_Int32)(pAccess->GetPaletteEntryCount()-1) );
aLine.append( "\n<" );
- if( m_aContext.Encrypt )
+ if( m_aContext.Encryption.Encrypt() )
{
enableStringEncryption( rObject.m_nObject );
//check encryption buffer size
@@ -12047,268 +12084,5 @@ void PDFWriterImpl::addStream( const String& rMimeType, PDFOutputStream* pStream
}
}
-/*************************************************************
-begin i12626 methods
-
-Implements Algorithm 3.2, step 1 only
-*/
-void PDFWriterImpl::padPassword( rtl::OUString aPassword, sal_uInt8 *paPasswordTarget )
-{
-// get ansi-1252 version of the password string CHECKIT ! i12626
- rtl::OString aString = rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_MS_1252 );
-
-//copy the string to the target
- sal_Int32 nToCopy = ( aString.getLength() < 32 ) ? aString.getLength() : 32;
- sal_Int32 nCurrentChar;
-
- for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
- paPasswordTarget[nCurrentChar] = (sal_uInt8)( aString.getStr()[nCurrentChar] );
-
-//pad it
- if( nCurrentChar < 32 )
- {//fill with standard byte string
- sal_Int32 i,y;
- for( i = nCurrentChar, y = 0 ; i < 32; i++, y++ )
- paPasswordTarget[i] = m_nPadString[y];
- }
-}
-
-/**********************************
-Algorithm 3.2 Compute the encryption key used
-
-step 1 should already be done before calling, the paThePaddedPassword parameter should contain
-the padded password and must be 32 byte long, the encryption key is returned into the paEncryptionKey parameter,
-it will be 16 byte long for 128 bit security; for 40 bit security only the first 5 bytes are used
-
-TODO: in pdf ver 1.5 and 1.6 the step 6 is different, should be implemented. See spec.
-
-*/
-void PDFWriterImpl::computeEncryptionKey(sal_uInt8 *paThePaddedPassword, sal_uInt8 *paEncryptionKey )
-{
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, paThePaddedPassword, ENCRYPTED_PWD_SIZE );
-//step 3
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nEncryptedOwnerPassword , sizeof( m_nEncryptedOwnerPassword ) );
-//Step 4
- sal_uInt8 nPerm[4];
-
- nPerm[0] = (sal_uInt8)m_nAccessPermissions;
- nPerm[1] = (sal_uInt8)( m_nAccessPermissions >> 8 );
- nPerm[2] = (sal_uInt8)( m_nAccessPermissions >> 16 );
- nPerm[3] = (sal_uInt8)( m_nAccessPermissions >> 24 );
-
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, nPerm , sizeof( nPerm ) );
-
-//step 5, get the document ID, binary form
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nDocID , sizeof( m_nDocID ) );
-//get the digest
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- if( nError == rtl_Digest_E_None )
- {
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
-
-//step 6, only if 128 bit
- if( m_aContext.Security128bit )
- {
- for( sal_Int32 i = 0; i < 50; i++ )
- {
- nError = rtl_digest_updateMD5( m_aDigest, &nMD5Sum, sizeof( nMD5Sum ) );
- if( nError != rtl_Digest_E_None )
- break;
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- }
- }
- }
-//Step 7
- for( sal_Int32 i = 0; i < MD5_DIGEST_SIZE; i++ )
- paEncryptionKey[i] = nMD5Sum[i];
- }
-}
-
-/**********************************
-Algorithm 3.3 Compute the encryption dictionary /O value, save into the class data member
-the step numbers down here correspond to the ones in PDF v.1.4 specfication
-*/
-void PDFWriterImpl::computeODictionaryValue()
-{
-//step 1 already done, data is in m_nPaddedOwnerPassword
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, &m_nPaddedOwnerPassword, sizeof( m_nPaddedOwnerPassword ) );
- if( nError == rtl_Digest_E_None )
- {
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
-
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof(nMD5Sum) );
-//step 3, only if 128 bit
- if( m_aContext.Security128bit )
- {
- sal_Int32 i;
- for( i = 0; i < 50; i++ )
- {
- nError = rtl_digest_updateMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- if( nError != rtl_Digest_E_None )
- break;
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- }
- }
-//Step 4, the key is in nMD5Sum
-//step 5 already done, data is in m_nPaddedUserPassword
-//step 6
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nMD5Sum, m_nKeyLength , NULL, 0 );
-// encrypt the user password using the key set above
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nPaddedUserPassword, sizeof( m_nPaddedUserPassword ), // the data to be encrypted
- m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ) ); //encrypted data, stored in class data member
-//Step 7, only if 128 bit
- if( m_aContext.Security128bit )
- {
- sal_uInt32 i, y;
- sal_uInt8 nLocalKey[ SECUR_128BIT_KEY ]; // 16 = 128 bit key
- for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
- {
- for( y = 0; y < sizeof( nLocalKey ); y++ )
- nLocalKey[y] = (sal_uInt8)( nMD5Sum[y] ^ i );
-
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nLocalKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area, on init can be NULL
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ), // the data to be encrypted
- m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ) ); // encrypted data, can be the same as the input, encrypt "in place"
-//step 8, store in class data member
- }
- }
- }
- }
-}
-
-/**********************************
-Algorithms 3.4 and 3.5 Compute the encryption dictionary /U value, save into the class data member, revision 2 (40 bit) or 3 (128 bit)
-*/
-void PDFWriterImpl::computeUDictionaryValue()
-{
-//step 1, common to both 3.4 and 3.5
- computeEncryptionKey( m_nPaddedUserPassword , m_nEncryptionKey );
-
- if( m_aContext.Security128bit == false )
- {
-//3.4
-//step 2 and 3
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- m_nEncryptionKey, 5 , // key and key length
- NULL, 0 ); //destination data area
-// encrypt the user password using the key set above, save for later use
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nPadString, sizeof( m_nPadString ), // the data to be encrypted
- m_nEncryptedUserPassword, sizeof( m_nEncryptedUserPassword ) ); //encrypted data, stored in class data member
- }
- else
- {
-//or 3.5, for 128 bit security
-//step6, initilize the last 16 bytes of the encrypted user password to 0
- for(sal_uInt32 i = MD5_DIGEST_SIZE; i < sizeof( m_nEncryptedUserPassword ); i++)
- m_nEncryptedUserPassword[i] = 0;
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, m_nPadString, sizeof( m_nPadString ) );
-//step 3
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nDocID , sizeof(m_nDocID) );
-
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof(nMD5Sum) );
-//Step 4
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- m_nEncryptionKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area
- rtl_cipher_encodeARCFOUR( m_aCipher, nMD5Sum, sizeof( nMD5Sum ), // the data to be encrypted
- m_nEncryptedUserPassword, sizeof( nMD5Sum ) ); //encrypted data, stored in class data member
-//step 5
- sal_uInt32 i, y;
- sal_uInt8 nLocalKey[SECUR_128BIT_KEY];
-
- for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
- {
- for( y = 0; y < sizeof( nLocalKey ) ; y++ )
- nLocalKey[y] = (sal_uInt8)( m_nEncryptionKey[y] ^ i );
-
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nLocalKey, SECUR_128BIT_KEY, // key and key length
- NULL, 0 ); //destination data area, on init can be NULL
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nEncryptedUserPassword, SECUR_128BIT_KEY, // the data to be encrypted
- m_nEncryptedUserPassword, SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
- }
- }
- }
-}
-
-/* init the encryption engine
-1. init the document id, used both for building the document id and for building the encryption key(s)
-2. build the encryption key following algorithms described in the PDF specification
- */
-void PDFWriterImpl::initEncryption()
-{
- m_aOwnerPassword = m_aContext.OwnerPassword;
- m_aUserPassword = m_aContext.UserPassword;
-/* password stuff computing, before sending out anything */
- DBG_ASSERT( m_aCipher != NULL, "PDFWriterImpl::initEncryption: a cipher (ARCFOUR) object is not available !" );
- DBG_ASSERT( m_aDigest != NULL, "PDFWriterImpl::initEncryption: a digest (MD5) object is not available !" );
-
- if( m_aCipher && m_aDigest )
- {
-//if there is no owner password, force it to the user password
- if( m_aOwnerPassword.getLength() == 0 )
- m_aOwnerPassword = m_aUserPassword;
-
- initPadString();
-/*
-1) pad passwords
-*/
- padPassword( m_aOwnerPassword, m_nPaddedOwnerPassword );
- padPassword( m_aUserPassword, m_nPaddedUserPassword );
-/*
-2) compute the access permissions, in numerical form
-
-the default value depends on the revision 2 (40 bit) or 3 (128 bit security):
-- for 40 bit security the unused bit must be set to 1, since they are not used
-- for 128 bit security the same bit must be preset to 0 and set later if needed
-according to the table 3.15, pdf v 1.4 */
- m_nAccessPermissions = ( m_aContext.Security128bit ) ? 0xfffff0c0 : 0xffffffc0 ;
-
-/* check permissions for 40 bit security case */
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanPrintTheDocument ) ? 1 << 2 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanModifyTheContent ) ? 1 << 3 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanCopyOrExtract ) ? 1 << 4 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanAddOrModify ) ? 1 << 5 : 0;
- m_nKeyLength = SECUR_40BIT_KEY;
- m_nRC4KeyLength = SECUR_40BIT_KEY+5; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 5
-
- if( m_aContext.Security128bit )
- {
- m_nKeyLength = SECUR_128BIT_KEY;
- m_nRC4KeyLength = 16; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 16, thus maximum
- // permitted value is 16
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanFillInteractive ) ? 1 << 8 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanExtractForAccessibility ) ? 1 << 9 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanAssemble ) ? 1 << 10 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanPrintFull ) ? 1 << 11 : 0;
- }
- computeODictionaryValue();
- computeUDictionaryValue();
-
-//clear out exceding key values, prepares for generation number default to 0 as well
-// see checkAndEnableStreamEncryption in pdfwriter_impl.hxx
- sal_Int32 i, y;
- for( i = m_nKeyLength, y = 0; y < 5 ; y++ )
- m_nEncryptionKey[i++] = 0;
- }
- else //either no cipher or no digest or both, something is wrong with memory or something else
- m_aContext.Encrypt = false; //then turn the encryption off
-}
-/* end i12626 methods */
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 9457aea5f0c2..5702bee23ea5 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -58,6 +58,7 @@ class ImplFontSelectData;
class ImplFontMetricData;
class FontSubsetInfo;
class ZCodec;
+class EncHashTransporter;
// the maximum password length
#define ENCRYPTED_PWD_SIZE 32
@@ -595,7 +596,6 @@ private:
MapMode m_aMapMode; // PDFWriterImpl scaled units
std::vector< PDFPage > m_aPages;
- PDFDocInfo m_aDocInfo;
/* maps object numbers to file offsets (needed for xref) */
std::vector< sal_uInt64 > m_aObjects;
/* contains Bitmaps until they are written to the
@@ -796,116 +796,37 @@ i12626
/* used to cipher the stream data and for password management */
rtlCipher m_aCipher;
rtlDigest m_aDigest;
-/* pad string used for password in Standard security handler */
- sal_uInt8 m_nPadString[ENCRYPTED_PWD_SIZE];
-/* the owner password, in clear text */
- rtl::OUString m_aOwnerPassword;
-/* the padded owner password */
- sal_uInt8 m_nPaddedOwnerPassword[ENCRYPTED_PWD_SIZE];
-/* the encryption dictionary owner password, according to algorithm 3.3 */
- sal_uInt8 m_nEncryptedOwnerPassword[ENCRYPTED_PWD_SIZE];
-/* the user password, in clear text */
- rtl::OUString m_aUserPassword;
-/* the padded user password */
- sal_uInt8 m_nPaddedUserPassword[ENCRYPTED_PWD_SIZE];
-/* the encryption dictionary user password, according to algorithm 3.4 or 3.5 depending on the
- security handler revision */
- sal_uInt8 m_nEncryptedUserPassword[ENCRYPTED_PWD_SIZE];
-
-/* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2
- for 128 bit security */
- sal_uInt8 m_nEncryptionKey[MAXIMUM_RC4_KEY_LENGTH];
+ /* pad string used for password in Standard security handler */
+ static const sal_uInt8 s_nPadString[ENCRYPTED_PWD_SIZE];
+
+ /* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2
+ for 128 bit security */
sal_Int32 m_nKeyLength; // key length, 16 or 5
sal_Int32 m_nRC4KeyLength; // key length, 16 or 10, to be input to the algorith 3.1
-/* set to true if the following stream must be encrypted, used inside writeBuffer() */
+ /* set to true if the following stream must be encrypted, used inside writeBuffer() */
sal_Bool m_bEncryptThisStream;
-/* the numerical value of the access permissions, according to PDF spec, must be signed */
+ /* the numerical value of the access permissions, according to PDF spec, must be signed */
sal_Int32 m_nAccessPermissions;
-/* the document ID, the raw MD5 hash */
- sal_uInt8 m_nDocID[MD5_DIGEST_SIZE];
-/* string buffer to hold document ID, this is the output string */
- rtl::OStringBuffer m_aDocID;
-/* string to hold the PDF creation date */
- rtl::OStringBuffer m_aCreationDateString;
-/* string to hold the PDF creation date, for PDF/A metadata */
- rtl::OStringBuffer m_aCreationMetaDateString;
-/* the buffer where the data are encrypted, dynamically allocated */
+ /* string to hold the PDF creation date */
+ rtl::OString m_aCreationDateString;
+ /* string to hold the PDF creation date, for PDF/A metadata */
+ rtl::OString m_aCreationMetaDateString;
+ /* the buffer where the data are encrypted, dynamically allocated */
sal_uInt8 *m_pEncryptionBuffer;
-/* size of the buffer */
+ /* size of the buffer */
sal_Int32 m_nEncryptionBufferSize;
-/* check and reallocate the buffer for encryption */
- sal_Bool checkEncryptionBufferSize( register sal_Int32 newSize )
- {
- if( m_nEncryptionBufferSize < newSize )
- {
-/* reallocate the buffer, the used function allocate as rtl_allocateMemory
- if the pointer parameter is NULL */
- m_pEncryptionBuffer = (sal_uInt8*)rtl_reallocateMemory( m_pEncryptionBuffer, newSize );
- if( m_pEncryptionBuffer )
- m_nEncryptionBufferSize = newSize;
- else
- m_nEncryptionBufferSize = 0;
- }
- return ( m_nEncryptionBufferSize != 0 );
- }
-/* init the internal pad string */
- void initPadString()
- {
- static const sal_uInt8 nPadString[32] =
- {
- 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
- 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A
- };
-
- for(sal_uInt32 i = 0; i < sizeof( nPadString ); i++ )
- m_nPadString[i] = nPadString[i];
-
- };
-/* initialize the encryption engine */
- void initEncryption();
-
-/* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
- void checkAndEnableStreamEncryption( register sal_Int32 nObject )
- {
- if( m_aContext.Encrypt )
- {
- m_bEncryptThisStream = true;
- register sal_Int32 i = m_nKeyLength;
- m_nEncryptionKey[i++] = (sal_uInt8)nObject;
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
-//the other location of m_nEncryptionKey are already set to 0, our fixed generation number
-// do the MD5 hash
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- // the i+2 to take into account the generation number, always zero
- rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) );
-// initialize the RC4 with the key
-// key legth: see algoritm 3.1, step 4: (N+5) max 16
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
- }
- };
+ /* check and reallocate the buffer for encryption */
+ sal_Bool checkEncryptionBufferSize( register sal_Int32 newSize );
+ /* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
+ void checkAndEnableStreamEncryption( register sal_Int32 nObject );
void disableStreamEncryption() { m_bEncryptThisStream = false; };
-/* */
- void enableStringEncryption( register sal_Int32 nObject )
- {
- register sal_Int32 i = m_nKeyLength;
- m_nEncryptionKey[i++] = (sal_uInt8)nObject;
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
-//the other location of m_nEncryptionKey are already set to 0, our fixed generation number
-// do the MD5 hash
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- // the i+2 to take into account the generation number, always zero
- rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) );
-// initialize the RC4 with the key
-// key legth: see algoritm 3.1, step 4: (N+5) max 16
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
- };
+ /* */
+ void enableStringEncryption( register sal_Int32 nObject );
// test if the encryption is active, if yes than encrypt the unicode string and add to the OStringBuffer parameter
void appendUnicodeTextStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
@@ -1097,18 +1018,38 @@ i12626
sal_Bool m_bIsPDF_A1;
PDFWriter& m_rOuterFace;
-/*
-i12626
-methods for PDF security
-
- pad a password according algorithm 3.2, step 1 */
- void padPassword( const rtl::OUString aPassword, sal_uInt8 *paPasswordTarget );
-/* algorithm 3.2: compute an encryption key */
- void computeEncryptionKey( sal_uInt8 *paThePaddedPassword, sal_uInt8 *paEncryptionKey );
-/* algorithm 3.3: computing the encryption dictionary'ss owner password value ( /O ) */
- void computeODictionaryValue();
-/* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
- void computeUDictionaryValue();
+ /*
+ i12626
+ methods for PDF security
+
+ pad a password according algorithm 3.2, step 1 */
+ static void padPassword( const rtl::OUString& i_rPassword, sal_uInt8* o_pPaddedPW );
+ /* algorithm 3.2: compute an encryption key */
+ static bool computeEncryptionKey( EncHashTransporter*,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nAccessPermissions
+ );
+ /* algorithm 3.3: computing the encryption dictionary'ss owner password value ( /O ) */
+ static bool computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPassword, const sal_uInt8* i_pPaddedUserPassword,
+ std::vector< sal_uInt8 >& io_rOValue,
+ sal_Int32 i_nKeyLength
+ );
+ /* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
+ static bool computeUDictionaryValue( EncHashTransporter* i_pTransporter,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nKeyLength,
+ sal_Int32 i_nAccessPermissions
+ );
+
+ static void computeDocumentIdentifier( std::vector< sal_uInt8 >& o_rIdentifier,
+ const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
+ rtl::OString& o_rCString1,
+ rtl::OString& o_rCString2
+ );
+ static sal_Int32 computeAccessPermissions( const vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
+ sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength );
+ void setupDocInfo();
+ bool prepareEncryption( const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
// helper for playMetafile
void implWriteGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient,
@@ -1117,9 +1058,14 @@ methods for PDF security
VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
public:
- PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, PDFWriter& );
+ PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >&, PDFWriter& );
~PDFWriterImpl();
+ static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+ initEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit );
+
/* for OutputDevice so the reference device can have a list
* that contains only suitable fonts (subsettable or builtin)
* produces a new font list
@@ -1152,8 +1098,6 @@ public:
}
PDFWriter::PDFVersion getVersion() const { return m_aContext.Version; }
- void setDocInfo( const PDFDocInfo& rInfo );
- const PDFDocInfo& getDocInfo() const { return m_aDocInfo; }
void setDocumentLocale( const com::sun::star::lang::Locale& rLoc )
{ m_aContext.DocumentLocale = rLoc; }
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index c01b8a9771d8..ee1fe1cc6bc5 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -28,6 +28,7 @@
#include "precompiled_vcl.hxx"
#include "pdfwriter_impl.hxx"
+
#include "vcl/pdfextoutdevdata.hxx"
#include "vcl/virdev.hxx"
#include "vcl/gdimtf.hxx"
@@ -36,12 +37,16 @@
#include "vcl/svdata.hxx"
#include "unotools/streamwrap.hxx"
#include "unotools/processfactory.hxx"
-
#include "comphelper/processfactory.hxx"
+
#include "com/sun/star/beans/PropertyValue.hpp"
#include "com/sun/star/io/XSeekable.hpp"
#include "com/sun/star/graphic/XGraphicProvider.hpp"
+#include "cppuhelper/implbase1.hxx"
+
+#include <rtl/digest.h>
+
using namespace vcl;
using namespace rtl;
using namespace com::sun::star;
@@ -1032,4 +1037,504 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
delete pPrivateDevice;
}
+// Encryption methods
+
+/* a crutch to transport an rtlDigest safely though UNO API
+ this is needed for the PDF export dialog, which otherwise would have to pass
+ clear text passwords down till they can be used in PDFWriter. Unfortunately
+ the MD5 sum of the password (which is needed to create the PDF encryption key)
+ is not sufficient, since an rtl MD5 digest cannot be created in an arbitrary state
+ which would be needed in PDFWriterImpl::computeEncryptionKey.
+*/
+class EncHashTransporter : public cppu::WeakImplHelper1 < com::sun::star::beans::XMaterialHolder >
+{
+ rtlDigest maUDigest;
+ sal_IntPtr maID;
+ std::vector< sal_uInt8 > maOValue;
+
+ static std::map< sal_IntPtr, EncHashTransporter* > sTransporters;
+public:
+ EncHashTransporter()
+ : maUDigest( rtl_digest_createMD5() )
+ {
+ maID = reinterpret_cast< sal_IntPtr >(this);
+ while( sTransporters.find( maID ) != sTransporters.end() ) // paranoia mode
+ maID++;
+ sTransporters[ maID ] = this;
+ }
+
+ virtual ~EncHashTransporter()
+ {
+ sTransporters.erase( maID );
+ if( maUDigest )
+ rtl_digest_destroyMD5( maUDigest );
+ OSL_TRACE( "EncHashTransporter freed\n" );
+ }
+
+ rtlDigest getUDigest() const { return maUDigest; };
+ std::vector< sal_uInt8 >& getOValue() { return maOValue; }
+ void invalidate()
+ {
+ if( maUDigest )
+ {
+ rtl_digest_destroyMD5( maUDigest );
+ maUDigest = NULL;
+ }
+ }
+
+ // XMaterialHolder
+ virtual uno::Any SAL_CALL getMaterial() throw()
+ {
+ return uno::makeAny( sal_Int64(maID) );
+ }
+
+ static EncHashTransporter* getEncHashTransporter( const uno::Reference< beans::XMaterialHolder >& );
+
+};
+
+std::map< sal_IntPtr, EncHashTransporter* > EncHashTransporter::sTransporters;
+
+EncHashTransporter* EncHashTransporter::getEncHashTransporter( const uno::Reference< beans::XMaterialHolder >& xRef )
+{
+ EncHashTransporter* pResult = NULL;
+ if( xRef.is() )
+ {
+ uno::Any aMat( xRef->getMaterial() );
+ sal_Int64 nMat = 0;
+ if( aMat >>= nMat )
+ {
+ std::map< sal_IntPtr, EncHashTransporter* >::iterator it = sTransporters.find( static_cast<sal_IntPtr>(nMat) );
+ if( it != sTransporters.end() )
+ pResult = it->second;
+ }
+ }
+ return pResult;
+}
+
+sal_Bool PDFWriterImpl::checkEncryptionBufferSize( register sal_Int32 newSize )
+{
+ if( m_nEncryptionBufferSize < newSize )
+ {
+ /* reallocate the buffer, the used function allocate as rtl_allocateMemory
+ if the pointer parameter is NULL */
+ m_pEncryptionBuffer = (sal_uInt8*)rtl_reallocateMemory( m_pEncryptionBuffer, newSize );
+ if( m_pEncryptionBuffer )
+ m_nEncryptionBufferSize = newSize;
+ else
+ m_nEncryptionBufferSize = 0;
+ }
+ return ( m_nEncryptionBufferSize != 0 );
+}
+
+void PDFWriterImpl::checkAndEnableStreamEncryption( register sal_Int32 nObject )
+{
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ m_bEncryptThisStream = true;
+ sal_Int32 i = m_nKeyLength;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)nObject;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
+ //the other location of m_nEncryptionKey are already set to 0, our fixed generation number
+ // do the MD5 hash
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ // the i+2 to take into account the generation number, always zero
+ rtl_digest_MD5( &m_aContext.Encryption.EncryptionKey[0], i+2, nMD5Sum, sizeof(nMD5Sum) );
+ // initialize the RC4 with the key
+ // key legth: see algoritm 3.1, step 4: (N+5) max 16
+ rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
+ }
+}
+
+void PDFWriterImpl::enableStringEncryption( register sal_Int32 nObject )
+{
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ sal_Int32 i = m_nKeyLength;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)nObject;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
+ //the other location of m_nEncryptionKey are already set to 0, our fixed generation number
+ // do the MD5 hash
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ // the i+2 to take into account the generation number, always zero
+ rtl_digest_MD5( &m_aContext.Encryption.EncryptionKey[0], i+2, nMD5Sum, sizeof(nMD5Sum) );
+ // initialize the RC4 with the key
+ // key legth: see algoritm 3.1, step 4: (N+5) max 16
+ rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
+ }
+}
+
+/* init the encryption engine
+1. init the document id, used both for building the document id and for building the encryption key(s)
+2. build the encryption key following algorithms described in the PDF specification
+ */
+uno::Reference< beans::XMaterialHolder > PDFWriterImpl::initEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ )
+{
+ uno::Reference< beans::XMaterialHolder > xResult;
+ if( i_rOwnerPassword.getLength() || i_rUserPassword.getLength() )
+ {
+ EncHashTransporter* pTransporter = new EncHashTransporter;
+ xResult = pTransporter;
+
+ // get padded passwords
+ sal_uInt8 aPadUPW[ENCRYPTED_PWD_SIZE], aPadOPW[ENCRYPTED_PWD_SIZE];
+ padPassword( i_rOwnerPassword.getLength() ? i_rOwnerPassword : i_rUserPassword, aPadOPW );
+ padPassword( i_rUserPassword, aPadUPW );
+ sal_Int32 nKeyLength = SECUR_40BIT_KEY;
+ if( b128Bit )
+ nKeyLength = SECUR_128BIT_KEY;
+
+ if( computeODictionaryValue( aPadOPW, aPadUPW, pTransporter->getOValue(), nKeyLength ) )
+ {
+ rtlDigest aDig = pTransporter->getUDigest();
+ if( rtl_digest_updateMD5( aDig, aPadUPW, ENCRYPTED_PWD_SIZE ) != rtl_Digest_E_None )
+ xResult.clear();
+ }
+ else
+ xResult.clear();
+
+ // trash temporary padded cleartext PWDs
+ rtl_zeroMemory( aPadOPW, sizeof(aPadOPW) );
+ rtl_zeroMemory( aPadUPW, sizeof(aPadUPW) );
+
+ }
+ return xResult;
+}
+
+bool PDFWriterImpl::prepareEncryption( const uno::Reference< beans::XMaterialHolder >& xEnc )
+{
+ bool bSuccess = false;
+ EncHashTransporter* pTransporter = EncHashTransporter::getEncHashTransporter( xEnc );
+ if( pTransporter )
+ {
+ sal_Int32 nKeyLength = 0, nRC4KeyLength = 0;
+ sal_Int32 nAccessPermissions = computeAccessPermissions( m_aContext.Encryption, nKeyLength, nRC4KeyLength );
+ m_aContext.Encryption.OValue = pTransporter->getOValue();
+ bSuccess = computeUDictionaryValue( pTransporter, m_aContext.Encryption, nKeyLength, nAccessPermissions );
+ }
+ if( ! bSuccess )
+ {
+ m_aContext.Encryption.OValue.clear();
+ m_aContext.Encryption.UValue.clear();
+ m_aContext.Encryption.EncryptionKey.clear();
+ }
+ return bSuccess;
+}
+
+sal_Int32 PDFWriterImpl::computeAccessPermissions( const vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
+ sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength )
+{
+ /*
+ 2) compute the access permissions, in numerical form
+
+ the default value depends on the revision 2 (40 bit) or 3 (128 bit security):
+ - for 40 bit security the unused bit must be set to 1, since they are not used
+ - for 128 bit security the same bit must be preset to 0 and set later if needed
+ according to the table 3.15, pdf v 1.4 */
+ sal_Int32 nAccessPermissions = ( i_rProperties.Security128bit ) ? 0xfffff0c0 : 0xffffffc0 ;
+
+ /* check permissions for 40 bit security case */
+ nAccessPermissions |= ( i_rProperties.CanPrintTheDocument ) ? 1 << 2 : 0;
+ nAccessPermissions |= ( i_rProperties.CanModifyTheContent ) ? 1 << 3 : 0;
+ nAccessPermissions |= ( i_rProperties.CanCopyOrExtract ) ? 1 << 4 : 0;
+ nAccessPermissions |= ( i_rProperties.CanAddOrModify ) ? 1 << 5 : 0;
+ o_rKeyLength = SECUR_40BIT_KEY;
+ o_rRC4KeyLength = SECUR_40BIT_KEY+5; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 5
+
+ if( i_rProperties.Security128bit )
+ {
+ o_rKeyLength = SECUR_128BIT_KEY;
+ o_rRC4KeyLength = 16; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 16, thus maximum
+ // permitted value is 16
+ nAccessPermissions |= ( i_rProperties.CanFillInteractive ) ? 1 << 8 : 0;
+ nAccessPermissions |= ( i_rProperties.CanExtractForAccessibility ) ? 1 << 9 : 0;
+ nAccessPermissions |= ( i_rProperties.CanAssemble ) ? 1 << 10 : 0;
+ nAccessPermissions |= ( i_rProperties.CanPrintFull ) ? 1 << 11 : 0;
+ }
+ return nAccessPermissions;
+}
+
+/*************************************************************
+begin i12626 methods
+
+Implements Algorithm 3.2, step 1 only
+*/
+void PDFWriterImpl::padPassword( const rtl::OUString& i_rPassword, sal_uInt8* o_pPaddedPW )
+{
+ // get ansi-1252 version of the password string CHECKIT ! i12626
+ rtl::OString aString( rtl::OUStringToOString( i_rPassword, RTL_TEXTENCODING_MS_1252 ) );
+
+ //copy the string to the target
+ sal_Int32 nToCopy = ( aString.getLength() < ENCRYPTED_PWD_SIZE ) ? aString.getLength() : ENCRYPTED_PWD_SIZE;
+ sal_Int32 nCurrentChar;
+
+ for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
+ o_pPaddedPW[nCurrentChar] = (sal_uInt8)( aString.getStr()[nCurrentChar] );
+
+ //pad it with standard byte string
+ sal_Int32 i,y;
+ for( i = nCurrentChar, y = 0 ; i < ENCRYPTED_PWD_SIZE; i++, y++ )
+ o_pPaddedPW[i] = s_nPadString[y];
+
+ // trash memory of temporary clear text password
+ rtl_zeroMemory( (sal_Char*)aString.getStr(), aString.getLength() );
+}
+
+/**********************************
+Algorithm 3.2 Compute the encryption key used
+
+step 1 should already be done before calling, the paThePaddedPassword parameter should contain
+the padded password and must be 32 byte long, the encryption key is returned into the paEncryptionKey parameter,
+it will be 16 byte long for 128 bit security; for 40 bit security only the first 5 bytes are used
+
+TODO: in pdf ver 1.5 and 1.6 the step 6 is different, should be implemented. See spec.
+
+*/
+bool PDFWriterImpl::computeEncryptionKey( EncHashTransporter* i_pTransporter, vcl::PDFWriter::PDFEncryptionProperties& io_rProperties, sal_Int32 i_nAccessPermissions )
+{
+ bool bSuccess = true;
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+
+ // transporter contains an MD5 digest with the padded user password already
+ rtlDigest aDigest = i_pTransporter->getUDigest();
+ rtlDigestError nError = rtl_Digest_E_None;
+ if( aDigest )
+ {
+ //step 3
+ if( ! io_rProperties.OValue.empty() )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.OValue[0] , sal_Int32(io_rProperties.OValue.size()) );
+ else
+ bSuccess = false;
+ //Step 4
+ sal_uInt8 nPerm[4];
+
+ nPerm[0] = (sal_uInt8)i_nAccessPermissions;
+ nPerm[1] = (sal_uInt8)( i_nAccessPermissions >> 8 );
+ nPerm[2] = (sal_uInt8)( i_nAccessPermissions >> 16 );
+ nPerm[3] = (sal_uInt8)( i_nAccessPermissions >> 24 );
+
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, nPerm , sizeof( nPerm ) );
+
+ //step 5, get the document ID, binary form
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.DocumentIdentifier[0], sal_Int32(io_rProperties.DocumentIdentifier.size()) );
+ //get the digest
+ if( nError == rtl_Digest_E_None )
+ {
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+
+ //step 6, only if 128 bit
+ if( io_rProperties.Security128bit )
+ {
+ for( sal_Int32 i = 0; i < 50; i++ )
+ {
+ nError = rtl_digest_updateMD5( aDigest, &nMD5Sum, sizeof( nMD5Sum ) );
+ if( nError != rtl_Digest_E_None )
+ {
+ bSuccess = false;
+ break;
+ }
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ }
+ }
+ }
+ }
+ else
+ bSuccess = false;
+
+ i_pTransporter->invalidate();
+
+ //Step 7
+ if( bSuccess )
+ {
+ io_rProperties.EncryptionKey.resize( MAXIMUM_RC4_KEY_LENGTH );
+ for( sal_Int32 i = 0; i < MD5_DIGEST_SIZE; i++ )
+ io_rProperties.EncryptionKey[i] = nMD5Sum[i];
+ }
+ else
+ io_rProperties.EncryptionKey.clear();
+
+ return bSuccess;
+}
+
+/**********************************
+Algorithm 3.3 Compute the encryption dictionary /O value, save into the class data member
+the step numbers down here correspond to the ones in PDF v.1.4 specfication
+*/
+bool PDFWriterImpl::computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPassword,
+ const sal_uInt8* i_pPaddedUserPassword,
+ std::vector< sal_uInt8 >& io_rOValue,
+ sal_Int32 i_nKeyLength
+ )
+{
+ bool bSuccess = true;
+
+ io_rOValue.resize( ENCRYPTED_PWD_SIZE );
+
+ rtlDigest aDigest = rtl_digest_createMD5();
+ rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
+ if( aDigest && aCipher)
+ {
+ //step 1 already done, data is in i_pPaddedOwnerPassword
+ //step 2
+
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, i_pPaddedOwnerPassword, ENCRYPTED_PWD_SIZE );
+ if( nError == rtl_Digest_E_None )
+ {
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof(nMD5Sum) );
+//step 3, only if 128 bit
+ if( i_nKeyLength == SECUR_128BIT_KEY )
+ {
+ sal_Int32 i;
+ for( i = 0; i < 50; i++ )
+ {
+ nError = rtl_digest_updateMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ if( nError != rtl_Digest_E_None )
+ {
+ bSuccess = false;
+ break;
+ }
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ }
+ }
+ //Step 4, the key is in nMD5Sum
+ //step 5 already done, data is in i_pPaddedUserPassword
+ //step 6
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nMD5Sum, i_nKeyLength , NULL, 0 );
+ // encrypt the user password using the key set above
+ rtl_cipher_encodeARCFOUR( aCipher, i_pPaddedUserPassword, ENCRYPTED_PWD_SIZE, // the data to be encrypted
+ &io_rOValue[0], sal_Int32(io_rOValue.size()) ); //encrypted data
+ //Step 7, only if 128 bit
+ if( i_nKeyLength == SECUR_128BIT_KEY )
+ {
+ sal_uInt32 i, y;
+ sal_uInt8 nLocalKey[ SECUR_128BIT_KEY ]; // 16 = 128 bit key
+
+ for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
+ {
+ for( y = 0; y < sizeof( nLocalKey ); y++ )
+ nLocalKey[y] = (sal_uInt8)( nMD5Sum[y] ^ i );
+
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nLocalKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area, on init can be NULL
+ rtl_cipher_encodeARCFOUR( aCipher, &io_rOValue[0], sal_Int32(io_rOValue.size()), // the data to be encrypted
+ &io_rOValue[0], sal_Int32(io_rOValue.size()) ); // encrypted data, can be the same as the input, encrypt "in place"
+ //step 8, store in class data member
+ }
+ }
+ }
+ else
+ bSuccess = false;
+ }
+ else
+ bSuccess = false;
+
+ if( aDigest )
+ rtl_digest_destroyMD5( aDigest );
+ if( aCipher )
+ rtl_cipher_destroyARCFOUR( aCipher );
+
+ if( ! bSuccess )
+ io_rOValue.clear();
+ return bSuccess;
+}
+
+/**********************************
+Algorithms 3.4 and 3.5 Compute the encryption dictionary /U value, save into the class data member, revision 2 (40 bit) or 3 (128 bit)
+*/
+bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nKeyLength,
+ sal_Int32 i_nAccessPermissions
+ )
+{
+ bool bSuccess = true;
+
+ io_rProperties.UValue.resize( ENCRYPTED_PWD_SIZE );
+
+ rtlDigest aDigest = rtl_digest_createMD5();
+ rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
+ if( aDigest && aCipher )
+ {
+ //step 1, common to both 3.4 and 3.5
+ if( computeEncryptionKey( i_pTransporter, io_rProperties, i_nAccessPermissions ) )
+ {
+ // prepare encryption key for object
+ for( sal_Int32 i = i_nKeyLength, y = 0; y < 5 ; y++ )
+ io_rProperties.EncryptionKey[i++] = 0;
+
+ if( io_rProperties.Security128bit == false )
+ {
+ //3.4
+ //step 2 and 3
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ &io_rProperties.EncryptionKey[0], 5 , // key and key length
+ NULL, 0 ); //destination data area
+ // encrypt the user password using the key set above, save for later use
+ rtl_cipher_encodeARCFOUR( aCipher, s_nPadString, sizeof( s_nPadString ), // the data to be encrypted
+ &io_rProperties.UValue[0], sal_Int32(io_rProperties.UValue.size()) ); //encrypted data, stored in class data member
+ }
+ else
+ {
+ //or 3.5, for 128 bit security
+ //step6, initilize the last 16 bytes of the encrypted user password to 0
+ for(sal_uInt32 i = MD5_DIGEST_SIZE; i < sal_uInt32(io_rProperties.UValue.size()); i++)
+ io_rProperties.UValue[i] = 0;
+ //step 2
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, s_nPadString, sizeof( s_nPadString ) );
+ //step 3
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.DocumentIdentifier[0], sal_Int32(io_rProperties.DocumentIdentifier.size()) );
+ else
+ bSuccess = false;
+
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof(nMD5Sum) );
+ //Step 4
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ &io_rProperties.EncryptionKey[0], SECUR_128BIT_KEY, NULL, 0 ); //destination data area
+ rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum, sizeof( nMD5Sum ), // the data to be encrypted
+ &io_rProperties.UValue[0], sizeof( nMD5Sum ) ); //encrypted data, stored in class data member
+ //step 5
+ sal_uInt32 i, y;
+ sal_uInt8 nLocalKey[SECUR_128BIT_KEY];
+
+ for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
+ {
+ for( y = 0; y < sizeof( nLocalKey ) ; y++ )
+ nLocalKey[y] = (sal_uInt8)( io_rProperties.EncryptionKey[y] ^ i );
+
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nLocalKey, SECUR_128BIT_KEY, // key and key length
+ NULL, 0 ); //destination data area, on init can be NULL
+ rtl_cipher_encodeARCFOUR( aCipher, &io_rProperties.UValue[0], SECUR_128BIT_KEY, // the data to be encrypted
+ &io_rProperties.UValue[0], SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
+ }
+ }
+ }
+ else
+ bSuccess = false;
+ }
+ else
+ bSuccess = false;
+
+ if( aDigest )
+ rtl_digest_destroyMD5( aDigest );
+ if( aCipher )
+ rtl_cipher_destroyARCFOUR( aCipher );
+
+ if( ! bSuccess )
+ io_rProperties.UValue.clear();
+ return bSuccess;
+}
+
+/* end i12626 methods */
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index 11971db34378..df67c4974d47 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -411,7 +411,9 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
case PNGCHUNK_IDAT :
{
- if ( !mbIDAT ) // the gfx is finished, but there may be left a zlibCRC of about 4Bytes
+ if ( !mpInflateInBuf ) // taking care that the header has properly been read
+ mbStatus = FALSE;
+ else if ( !mbIDAT ) // the gfx is finished, but there may be left a zlibCRC of about 4Bytes
ImplReadIDAT();
}
break;
@@ -527,7 +529,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mbIDAT = mbAlphaChannel = mbTransparent = FALSE;
mbGrayScale = mbRGBTriple = FALSE;
mnTargetDepth = mnPngDepth;
- mnScansize = ( ( maOrigSize.Width() * mnPngDepth ) + 7 ) >> 3;
+ sal_uInt64 nScansize64 = ( ( static_cast< sal_uInt64 >( maOrigSize.Width() ) * mnPngDepth ) + 7 ) >> 3;
// valid color types are 0,2,3,4 & 6
switch ( mnColorType )
@@ -557,7 +559,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
case 2 : // each pixel is an RGB triple
{
mbRGBTriple = TRUE;
- mnScansize *= 3;
+ nScansize64 *= 3;
switch ( mnPngDepth )
{
case 16 : // we have to reduce the bitmap
@@ -590,7 +592,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
case 4 : // each pixel is a grayscale sample followed by an alpha sample
{
- mnScansize *= 2;
+ nScansize64 *= 2;
mbAlphaChannel = TRUE;
switch ( mnPngDepth )
{
@@ -608,7 +610,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
case 6 : // each pixel is an RGB triple followed by an alpha sample
{
mbRGBTriple = TRUE;
- mnScansize *= 4;
+ nScansize64 *= 4;
mbAlphaChannel = TRUE;
switch (mnPngDepth )
{
@@ -626,16 +628,24 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
return FALSE;
}
- mnBPP = mnScansize / maOrigSize.Width();
+ mnBPP = static_cast< sal_uInt32 >( nScansize64 / maOrigSize.Width() );
if ( !mnBPP )
mnBPP = 1;
- mnScansize++; // each scanline includes one filterbyte
+ nScansize64++; // each scanline includes one filterbyte
+
+ if ( nScansize64 > SAL_MAX_UINT32 )
+ return FALSE;
+
+ mnScansize = static_cast< sal_uInt32 >( nScansize64 );
// TODO: switch between both scanlines instead of copying
- mpInflateInBuf = new BYTE[ mnScansize ];
+ mpInflateInBuf = new (std::nothrow) BYTE[ mnScansize ];
mpScanCurrent = mpInflateInBuf;
- mpScanPrior = new BYTE[ mnScansize ];
+ mpScanPrior = new (std::nothrow) BYTE[ mnScansize ];
+
+ if ( !mpInflateInBuf || !mpScanPrior )
+ return FALSE;
// calculate target size from original size and the preview hint
if( rPreviewSizeHint.Width() || rPreviewSizeHint.Height() )
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 25ba80003fd7..5c2a742a10ba 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -407,6 +407,7 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
{
const MetaLineAction& rMetaLineAction = static_cast<const MetaLineAction&>(rAct);
aActionBounds = Rectangle( rMetaLineAction.GetStartPoint(), rMetaLineAction.GetEndPoint() );
+ aActionBounds.Justify();
const long nLineWidth(rMetaLineAction.GetLineInfo().GetWidth());
if(nLineWidth)
{
diff --git a/vcl/source/window/arrange.cxx b/vcl/source/window/arrange.cxx
index 9749299d4d6b..f016ef2c053b 100644
--- a/vcl/source/window/arrange.cxx
+++ b/vcl/source/window/arrange.cxx
@@ -29,15 +29,37 @@
#include "vcl/arrange.hxx"
#include "vcl/edit.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/svapp.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/awt/Rectangle.hpp"
#include "osl/diagnose.h"
using namespace vcl;
+using namespace com::sun::star;
// ----------------------------------------
// vcl::WindowArranger
//-----------------------------------------
+long WindowArranger::getDefaultBorder()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ long nResult = pSVData->maAppData.mnDefaultLayoutBorder;
+ if( nResult < 0 )
+ {
+ OutputDevice* pDefDev = Application::GetDefaultDevice();
+ if( pDefDev )
+ {
+ Size aBorder( pDefDev->LogicToPixel( Size( 3, 3 ), MapMode( MAP_APPFONT ) ) );
+ nResult = pSVData->maAppData.mnDefaultLayoutBorder = aBorder.Height();
+ }
+ }
+ return nResult > 0 ? nResult : 0;
+}
+
WindowArranger::~WindowArranger()
{}
@@ -156,16 +178,26 @@ Size WindowArranger::Element::getOptimalSize( WindowSizeType i_eType ) const
Size aResult;
if( ! m_bHidden )
{
+ bool bVisible = false;
if( m_pElement && m_pElement->IsVisible() )
+ {
aResult = m_pElement->GetOptimalSize( i_eType );
- else if( m_pChild )
+ bVisible = true;
+ }
+ else if( m_pChild && m_pChild->isVisible() )
+ {
aResult = m_pChild->getOptimalSize( i_eType );
- if( aResult.Width() < m_aMinSize.Width() )
- aResult.Width() = m_aMinSize.Width();
- if( aResult.Height() < m_aMinSize.Height() )
- aResult.Height() = m_aMinSize.Height();
- aResult.Width() += m_nLeftBorder + m_nRightBorder;
- aResult.Height() += m_nTopBorder + m_nBottomBorder;
+ bVisible = true;
+ }
+ if( bVisible )
+ {
+ if( aResult.Width() < m_aMinSize.Width() )
+ aResult.Width() = m_aMinSize.Width();
+ if( aResult.Height() < m_aMinSize.Height() )
+ aResult.Height() = m_aMinSize.Height();
+ aResult.Width() += getBorderValue( m_nLeftBorder ) + getBorderValue( m_nRightBorder );
+ aResult.Height() += getBorderValue( m_nTopBorder ) + getBorderValue( m_nBottomBorder );
+ }
}
return aResult;
@@ -175,16 +207,74 @@ void WindowArranger::Element::setPosSize( const Point& i_rPos, const Size& i_rSi
{
Point aPoint( i_rPos );
Size aSize( i_rSize );
- aPoint.X() += m_nLeftBorder;
- aPoint.Y() += m_nTopBorder;
- aSize.Width() -= m_nLeftBorder + m_nRightBorder;
- aSize.Height() -= m_nTopBorder + m_nBottomBorder;
+ aPoint.X() += getBorderValue( m_nLeftBorder );
+ aPoint.Y() += getBorderValue( m_nTopBorder );
+ aSize.Width() -= getBorderValue( m_nLeftBorder ) + getBorderValue( m_nRightBorder );
+ aSize.Height() -= getBorderValue( m_nTopBorder ) + getBorderValue( m_nBottomBorder );
if( m_pElement )
m_pElement->SetPosSizePixel( aPoint, aSize );
else if( m_pChild )
m_pChild->setManagedArea( Rectangle( aPoint, aSize ) );
}
+uno::Sequence< beans::PropertyValue > WindowArranger::getProperties() const
+{
+ uno::Sequence< beans::PropertyValue > aRet( 3 );
+ aRet[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OuterBorder" ) );
+ aRet[0].Value = uno::makeAny( sal_Int32( getBorderValue( m_nOuterBorder ) ) );
+ aRet[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ManagedArea" ) );
+ awt::Rectangle aArea( m_aManagedArea.getX(), m_aManagedArea.getY(), m_aManagedArea.getWidth(), m_aManagedArea.getHeight() );
+ aRet[1].Value = uno::makeAny( aArea );
+ aRet[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) );
+ aRet[2].Value = uno::makeAny( sal_Bool( isVisible() ) );
+ return aRet;
+}
+
+void WindowArranger::setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps )
+{
+ const beans::PropertyValue* pProps = i_rProps.getConstArray();
+ bool bResize = false;
+ for( sal_Int32 i = 0; i < i_rProps.getLength(); i++ )
+ {
+ if( pProps[i].Name.equalsAscii( "OuterBorder" ) )
+ {
+ sal_Int32 nVal = 0;
+ if( pProps[i].Value >>= nVal )
+ {
+ if( getBorderValue( m_nOuterBorder ) != nVal )
+ {
+ m_nOuterBorder = nVal;
+ bResize = true;
+ }
+ }
+ }
+ else if( pProps[i].Name.equalsAscii( "ManagedArea" ) )
+ {
+ awt::Rectangle aArea( 0, 0, 0, 0 );
+ if( pProps[i].Value >>= aArea )
+ {
+ m_aManagedArea.setX( aArea.X );
+ m_aManagedArea.setY( aArea.Y );
+ m_aManagedArea.setWidth( aArea.Width );
+ m_aManagedArea.setHeight( aArea.Height );
+ bResize = true;
+ }
+ }
+ else if( pProps[i].Name.equalsAscii( "Visible" ) )
+ {
+ sal_Bool bVal = sal_False;
+ if( pProps[i].Value >>= bVal )
+ {
+ show( bVal, false );
+ bResize = true;
+ }
+ }
+ }
+ if( bResize )
+ resize();
+}
+
+
// ----------------------------------------
// vcl::RowOrColumn
//-----------------------------------------
@@ -201,6 +291,7 @@ RowOrColumn::~RowOrColumn()
Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
{
Size aRet( 0, 0 );
+ long nDistance = getBorderValue( m_nBorderWidth );
for( std::vector< WindowArranger::Element >::const_iterator it = m_aElements.begin();
it != m_aElements.end(); ++it )
{
@@ -211,7 +302,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
if( m_bColumn )
{
// add the distance between elements
- aRet.Height() += m_nBorderWidth;
+ aRet.Height() += nDistance;
// check if the width needs adjustment
if( aRet.Width() < aElementSize.Width() )
aRet.Width() = aElementSize.Width();
@@ -220,7 +311,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
else
{
// add the distance between elements
- aRet.Width() += m_nBorderWidth;
+ aRet.Width() += nDistance;
// check if the height needs adjustment
if( aRet.Height() < aElementSize.Height() )
aRet.Height() = aElementSize.Height();
@@ -233,13 +324,14 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
{
// subtract the border for the first element
if( m_bColumn )
- aRet.Height() -= m_nBorderWidth;
+ aRet.Height() -= nDistance;
else
- aRet.Width() -= m_nBorderWidth;
+ aRet.Width() -= nDistance;
// add the outer border
- aRet.Width() += 2*m_nOuterBorder;
- aRet.Height() += 2*m_nOuterBorder;
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ aRet.Width() += 2*nOuterBorder;
+ aRet.Height() += 2*nOuterBorder;
}
return aRet;
@@ -344,7 +436,9 @@ void RowOrColumn::resize()
size_t nElements = m_aElements.size();
// get all element sizes for sizing
std::vector<Size> aElementSizes( nElements );
- long nUsedWidth = 2*m_nOuterBorder - (nElements ? m_nBorderWidth : 0);
+ long nDistance = getBorderValue( m_nBorderWidth );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nUsedWidth = 2*nOuterBorder - (nElements ? nDistance : 0);
for( size_t i = 0; i < nElements; i++ )
{
if( m_aElements[i].isVisible() )
@@ -352,13 +446,13 @@ void RowOrColumn::resize()
aElementSizes[i] = m_aElements[i].getOptimalSize( eType );
if( m_bColumn )
{
- aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2* m_nOuterBorder;
- nUsedWidth += aElementSizes[i].Height() + m_nBorderWidth;
+ aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2 * nOuterBorder;
+ nUsedWidth += aElementSizes[i].Height() + nDistance;
}
else
{
- aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2* m_nOuterBorder;
- nUsedWidth += aElementSizes[i].Width() + m_nBorderWidth;
+ aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2 * nOuterBorder;
+ nUsedWidth += aElementSizes[i].Width() + nDistance;
}
}
}
@@ -375,8 +469,8 @@ void RowOrColumn::resize()
// get starting position
Point aElementPos( m_aManagedArea.TopLeft() );
// outer border
- aElementPos.X() += m_nOuterBorder;
- aElementPos.Y() += m_nOuterBorder;
+ aElementPos.X() += nOuterBorder;
+ aElementPos.Y() += nOuterBorder;
// position managed windows
for( size_t i = 0; i < nElements; i++ )
@@ -386,27 +480,27 @@ void RowOrColumn::resize()
{
m_aElements[i].setPosSize( aElementPos, aElementSizes[i] );
if( m_bColumn )
- aElementPos.Y() += m_nBorderWidth + aElementSizes[i].Height();
+ aElementPos.Y() += nDistance + aElementSizes[i].Height();
else
- aElementPos.X() += m_nBorderWidth + aElementSizes[i].Width();
+ aElementPos.X() += nDistance + aElementSizes[i].Width();
}
}
}
-size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, size_t i_nIndex )
+size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, const Size& i_rMinSize, size_t i_nIndex )
{
size_t nIndex = i_nIndex;
if( i_nIndex >= m_aElements.size() )
{
nIndex = m_aElements.size();
- m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
else
{
std::vector< WindowArranger::Element >::iterator it = m_aElements.begin();
while( i_nIndex-- )
++it;
- m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
return nIndex;
}
@@ -479,14 +573,14 @@ Size LabeledElement::getOptimalSize( WindowSizeType i_eType ) const
if( m_nLabelColumnWidth != 0 )
aRet.Width() = m_nLabelColumnWidth;
else
- aRet.Width() += m_nDistance;
+ aRet.Width() += getBorderValue( m_nDistance );
}
Size aElementSize( m_aElement.getOptimalSize( i_eType ) );
aRet.Width() += aElementSize.Width();
if( aElementSize.Height() > aRet.Height() )
aRet.Height() = aElementSize.Height();
if( aRet.Height() != 0 )
- aRet.Height() += 2*m_nOuterBorder;
+ aRet.Height() += 2 * getBorderValue( m_nOuterBorder );
return aRet;
}
@@ -495,23 +589,25 @@ void LabeledElement::resize()
{
Size aLabelSize( m_aLabel.getOptimalSize( WINDOWSIZE_MINIMUM ) );
Size aElementSize( m_aElement.getOptimalSize( WINDOWSIZE_PREFERRED ) );
- if( m_nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() )
+ long nDistance = getBorderValue( m_nDistance );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ if( nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() )
aElementSize = m_aElement.getOptimalSize( WINDOWSIZE_MINIMUM );
// align label and element vertically in LabeledElement
- long nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aLabelSize.Height()) / 2;
+ long nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aLabelSize.Height()) / 2;
Point aPos( m_aManagedArea.Left(),
- m_aManagedArea.Top() + m_nOuterBorder + nYOff );
+ m_aManagedArea.Top() + nOuterBorder + nYOff );
Size aSize( aLabelSize );
if( m_nLabelColumnWidth != 0 )
aSize.Width() = m_nLabelColumnWidth;
m_aLabel.setPosSize( aPos, aSize );
- aPos.X() += aSize.Width() + m_nDistance;
- nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aElementSize.Height()) / 2;
- aPos.Y() = m_aManagedArea.Top() + m_nOuterBorder + nYOff;
+ aPos.X() += aSize.Width() + nDistance;
+ nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aElementSize.Height()) / 2;
+ aPos.Y() = m_aManagedArea.Top() + nOuterBorder + nYOff;
aSize.Width() = aElementSize.Width();
- aSize.Height() = m_aManagedArea.GetHeight() - 2*m_nOuterBorder;
+ aSize.Height() = m_aManagedArea.GetHeight() - 2*nOuterBorder;
// label style
// 0: position left and right
@@ -578,18 +674,22 @@ long LabelColumn::getLabelWidth() const
if( pLW )
{
Size aLabSize( pLW->GetOptimalSize( WINDOWSIZE_MINIMUM ) );
+ long nLB = 0;
+ pLabel->getBorders(0, &nLB);
+ aLabSize.Width() += getBorderValue( nLB );
if( aLabSize.Width() > nWidth )
nWidth = aLabSize.Width();
}
}
}
}
- return nWidth + getBorderWidth();
+ return nWidth + getBorderValue( getBorderWidth() );
}
Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const
{
long nWidth = getLabelWidth();
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
Size aColumnSize;
// every child is a LabeledElement
@@ -622,19 +722,19 @@ Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const
}
if( aElementSize.Width() )
{
- aElementSize.Width() += 2*m_nOuterBorder;
+ aElementSize.Width() += 2*nOuterBorder;
if( aElementSize.Width() > aColumnSize.Width() )
aColumnSize.Width() = aElementSize.Width();
}
if( aElementSize.Height() )
{
- aColumnSize.Height() += getBorderWidth() + aElementSize.Height();
+ aColumnSize.Height() += getBorderValue( getBorderWidth() ) + aElementSize.Height();
}
}
if( nEle > 0 && aColumnSize.Height() )
{
- aColumnSize.Height() -= getBorderWidth(); // for the first element
- aColumnSize.Height() += 2*m_nOuterBorder;
+ aColumnSize.Height() -= getBorderValue( getBorderWidth() ); // for the first element
+ aColumnSize.Height() += 2*nOuterBorder;
}
return aColumnSize;
}
@@ -667,12 +767,13 @@ size_t LabelColumn::addRow( Window* i_pLabel, boost::shared_ptr<WindowArranger>
return nIndex;
}
-size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent )
+size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent, const Size& i_rElementMinSize )
{
boost::shared_ptr< LabeledElement > xLabel( new LabeledElement( this, 1 ) );
xLabel->setLabel( i_pLabel );
xLabel->setBorders( 0, i_nIndent, 0, 0, 0 );
xLabel->setElement( i_pElement );
+ xLabel->setMinimumSize( 1, i_rElementMinSize );
size_t nIndex = addChild( xLabel );
resize();
return nIndex;
@@ -690,19 +791,23 @@ Indenter::~Indenter()
Size Indenter::getOptimalSize( WindowSizeType i_eType ) const
{
Size aSize( m_aElement.getOptimalSize( i_eType ) );
- aSize.Width() += 2*m_nOuterBorder + m_nIndent;
- aSize.Height() += 2*m_nOuterBorder;
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nIndent = getBorderValue( m_nIndent );
+ aSize.Width() += 2*nOuterBorder + nIndent;
+ aSize.Height() += 2*nOuterBorder;
return aSize;
}
void Indenter::resize()
{
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nIndent = getBorderValue( m_nIndent );
Point aPt( m_aManagedArea.TopLeft() );
- aPt.X() += m_nOuterBorder + m_nIndent;
- aPt.Y() += m_nOuterBorder;
+ aPt.X() += nOuterBorder + nIndent;
+ aPt.Y() += nOuterBorder;
Size aSz( m_aManagedArea.GetSize() );
- aSz.Width() -= 2*m_nOuterBorder + m_nIndent;
- aSz.Height() -= 2*m_nOuterBorder;
+ aSz.Width() -= 2*nOuterBorder + nIndent;
+ aSz.Height() -= 2*nOuterBorder;
m_aElement.setPosSize( aPt, aSz );
}
@@ -733,7 +838,8 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType,
std::vector<sal_Int32>& o_rColumnPrio, std::vector<sal_Int32>& o_rRowPrio
) const
{
- Size aMatrixSize( 2*m_nOuterBorder, 2*m_nOuterBorder );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ Size aMatrixSize( 2*nOuterBorder, 2*nOuterBorder );
// first find out the current number of rows and columns
sal_uInt32 nRows = 0, nColumns = 0;
@@ -768,15 +874,17 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType,
}
// add up sizes
+ long nDistanceX = getBorderValue( m_nBorderX );
+ long nDistanceY = getBorderValue( m_nBorderY );
for( sal_uInt32 i = 0; i < nColumns; i++ )
- aMatrixSize.Width() += o_rColumnWidths[i] + m_nBorderX;
+ aMatrixSize.Width() += o_rColumnWidths[i] + nDistanceX;
if( nColumns > 0 )
- aMatrixSize.Width() -= m_nBorderX;
+ aMatrixSize.Width() -= nDistanceX;
for( sal_uInt32 i = 0; i < nRows; i++ )
- aMatrixSize.Height() += o_rRowHeights[i] + m_nBorderY;
+ aMatrixSize.Height() += o_rRowHeights[i] + nDistanceY;
if( nRows > 0 )
- aMatrixSize.Height() -= m_nBorderY;
+ aMatrixSize.Height() -= nDistanceY;
return aMatrixSize;
}
@@ -860,15 +968,18 @@ void MatrixArranger::resize()
distributeExtraSize( aRowHeights, aRowPrio, nExtraSize );
// prepare offsets
+ long nDistanceX = getBorderValue( m_nBorderX );
+ long nDistanceY = getBorderValue( m_nBorderY );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
std::vector<long> aColumnX( aColumnWidths.size() );
- aColumnX[0] = m_aManagedArea.Left() + m_nOuterBorder;
+ aColumnX[0] = m_aManagedArea.Left() + nOuterBorder;
for( size_t i = 1; i < aColumnX.size(); i++ )
- aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + m_nBorderX;
+ aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + nDistanceX;
std::vector<long> aRowY( aRowHeights.size() );
- aRowY[0] = m_aManagedArea.Top() + m_nOuterBorder;
+ aRowY[0] = m_aManagedArea.Top() + nOuterBorder;
for( size_t i = 1; i < aRowY.size(); i++ )
- aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + m_nBorderY;
+ aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + nDistanceY;
// now iterate over the elements and assign their positions
for( std::vector< MatrixElement >::iterator it = m_aElements.begin();
@@ -880,7 +991,7 @@ void MatrixArranger::resize()
}
}
-size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio )
+size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio, const Size& i_rMinSize )
{
sal_uInt64 nMapValue = getMap( i_nX, i_nY );
std::map< sal_uInt64, size_t >::const_iterator it = m_aMatrixMap.find( nMapValue );
@@ -888,7 +999,7 @@ size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32
if( it == m_aMatrixMap.end() )
{
m_aMatrixMap[ nMapValue ] = nIndex = m_aElements.size();
- m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
else
{
@@ -896,6 +1007,7 @@ size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32
rEle.m_pElement = i_pWindow;
rEle.m_pChild.reset();
rEle.m_nExpandPriority = i_nExpandPrio;
+ rEle.m_aMinSize = i_rMinSize;
rEle.m_nX = i_nX;
rEle.m_nY = i_nY;
nIndex = it->second;
diff --git a/vcl/source/window/makefile.mk b/vcl/source/window/makefile.mk
index 82ce26f8e78e..1c63376dfda5 100644
--- a/vcl/source/window/makefile.mk
+++ b/vcl/source/window/makefile.mk
@@ -85,6 +85,8 @@ SLOFILES= \
$(SLO)$/winproc.obj \
$(SLO)$/window2.obj \
$(SLO)$/window3.obj \
+ $(SLO)$/window4.obj \
+ $(SLO)$/wpropset.obj \
$(SLO)$/wrkwin.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 5e4e0d59ccc6..73420e6ef8b5 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -533,22 +533,21 @@ void PrintDialog::NUpTabPage::showAdvancedControls( bool i_bShow )
maSheetMarginTxt2.Show( i_bShow );
maNupOrientationTxt.Show( i_bShow );
maNupOrientationBox.Show( i_bShow );
- maLayout.resize();
+ getLayout()->resize();
}
void PrintDialog::NUpTabPage::setupLayout()
{
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
Size aBorder( LogicToPixel( Size( 6, 6 ), MapMode( MAP_APPFONT ) ) );
/* According to OOo style guide, the horizontal indentation of child
elements to their parent element should always be 6 map units. */
long nIndent = aBorder.Width();
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
-
- maLayout.addWindow( &maNupLine );
- boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &maLayout, false ) );
- maLayout.addChild( xRow );
+ xLayout->addWindow( &maNupLine );
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xRow );
boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xRow.get() ) );
xRow->addChild( xIndent );
@@ -584,7 +583,7 @@ void PrintDialog::NUpTabPage::setupLayout()
xMainCol->addRow( &maNupOrderTxt, &maNupOrderBox, nIndent );
xMainCol->setBorders( xMainCol->addWindow( &maBorderCB ), nIndent, 0, 0, 0 );
- xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, aBorder.Width() ) ) );
+ xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, WindowArranger::getDefaultBorder() ) ) );
xMainCol->addChild( xSpacer );
xRow.reset( new vcl::RowOrColumn( xMainCol.get(), false ) );
@@ -596,11 +595,6 @@ void PrintDialog::NUpTabPage::setupLayout()
showAdvancedControls( false );
}
-void PrintDialog::NUpTabPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
-}
-
void PrintDialog::NUpTabPage::initFromMultiPageSetup( const vcl::PrinterController::MultiPageSetup& i_rMPS )
{
maSheetMarginEdt.SetValue( maSheetMarginEdt.Normalize( i_rMPS.nLeftMargin ), FUNIT_100TH_MM );
@@ -641,7 +635,6 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId )
, maNoCollateImg( VclResId( SV_PRINT_NOCOLLATE_IMG ) )
, maNoCollateHCImg( VclResId( SV_PRINT_NOCOLLATE_HC_IMG ) )
, mnCollateUIMode( 0 )
- , maLayout( NULL, true )
{
FreeResource();
@@ -681,39 +674,37 @@ void PrintDialog::JobTabPage::setupLayout()
// sets the results of GetOptimalSize in a normal ListBox
maPrinters.SetDropDownLineCount( 4 );
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
-
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
// add printer fixed line
- maLayout.addWindow( &maPrinterFL );
+ xLayout->addWindow( &maPrinterFL );
// add print LB
- maLayout.addWindow( &maPrinters, 3 );
+ xLayout->addWindow( &maPrinters, 3 );
// create a row for details button/text and properties button
- boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( &maLayout, false ) );
- maLayout.addChild( xDetRow );
+ boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xDetRow );
xDetRow->addWindow( &maDetailsBtn );
xDetRow->addChild( new vcl::Spacer( xDetRow.get(), 2 ) );
xDetRow->addWindow( &maSetupButton );
// create an indent for details
- boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( &maLayout ) );
- maLayout.addChild( xIndent );
+ boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xLayout.get() ) );
+ xLayout->addChild( xIndent );
// remember details controls
mxDetails = xIndent;
// create a column for the details
- boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get(), aBorder.Height() ) );
+ boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get() ) );
xIndent->setChild( xLabelCol );
xLabelCol->addRow( &maStatusLabel, &maStatusTxt );
xLabelCol->addRow( &maLocationLabel, &maLocationTxt );
xLabelCol->addRow( &maCommentLabel, &maCommentTxt );
// add print range and copies columns
- maLayout.addWindow( &maCopies );
- boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( &maLayout, false, aBorder.Width() ) );
- maLayout.addChild( xRangeRow );
+ xLayout->addWindow( &maCopies );
+ boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xRangeRow );
// create print range and add to range row
mxPrintRange.reset( new vcl::RowOrColumn( xRangeRow.get() ) );
@@ -780,11 +771,6 @@ void PrintDialog::JobTabPage::storeToSettings()
rtl::OUString::createFromAscii( maCollateBox.IsChecked() ? "true" : "false" ) );
}
-void PrintDialog::JobTabPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
-}
-
PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rResId )
: TabPage( i_pParent, i_rResId )
, maOptionsLine( this, VclResId( SV_PRINT_OPT_PRINT_FL ) )
@@ -808,15 +794,13 @@ PrintDialog::OutputOptPage::~OutputOptPage()
void PrintDialog::OutputOptPage::setupLayout()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
-
- maLayout.addWindow( &maOptionsLine );
- boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( &maLayout, aBorder.Width() ) );
- maLayout.addChild( xIndent );
- boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get(), aBorder.Height() ) );
+ xLayout->addWindow( &maOptionsLine );
+ boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( xLayout.get(), -1 ) );
+ xLayout->addChild( xIndent );
+ boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get() ) );
xIndent->setChild( xCol );
mxOptGroup = xCol;
xCol->addWindow( &maToFileBox );
@@ -844,12 +828,6 @@ void PrintDialog::OutputOptPage::storeToSettings()
rtl::OUString::createFromAscii( maToFileBox.IsChecked() ? "true" : "false" ) );
}
-void PrintDialog::OutputOptPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
-}
-
-
PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterController>& i_rController )
: ModalDialog( i_pParent, VclResId( SV_DLG_PRINT ) )
, maOKButton( this, VclResId( SV_PRINT_OK ) )
@@ -1057,13 +1035,14 @@ PrintDialog::~PrintDialog()
void PrintDialog::setupLayout()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
+ xLayout->setOuterBorder( 0 );
- maLayout.setParentWindow( this );
- boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( &maLayout, false ) );
- size_t nIndex = maLayout.addChild( xPreviewAndTab, 5 );
- maLayout.setBorders( nIndex, aBorder.Width(), aBorder.Width(), aBorder.Width(), 0 );
+ boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( xLayout.get(), false ) );
+ size_t nIndex = xLayout->addChild( xPreviewAndTab, 5 );
+ xLayout->setBorders( nIndex, -1, -1, -1, 0 );
// setup column for preview and sub controls
boost::shared_ptr< vcl::RowOrColumn > xPreview( new vcl::RowOrColumn( xPreviewAndTab.get() ) );
@@ -1087,12 +1066,12 @@ void PrintDialog::setupLayout()
xPreviewAndTab->addWindow( &maTabCtrl );
// add the button line
- maLayout.addWindow( &maButtonLine );
+ xLayout->addWindow( &maButtonLine );
// add the row for the buttons
- boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( &maLayout, false ) );
- nIndex = maLayout.addChild( xButtons );
- maLayout.setBorders( nIndex, aBorder.Width(), 0, aBorder.Width(), aBorder.Width() );
+ boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( xLayout.get(), false ) );
+ nIndex = xLayout->addChild( xButtons );
+ xLayout->setBorders( nIndex, -1, 0, -1, -1 );
Size aMinSize( maCancelButton.GetSizePixel() );
// insert help button
@@ -1210,17 +1189,15 @@ void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
void PrintDialog::setupOptionalUI()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
-
- std::vector<vcl::RowOrColumn*> aDynamicColumns;
- vcl::RowOrColumn* pCurColumn = 0;
+ std::vector< boost::shared_ptr<vcl::RowOrColumn> > aDynamicColumns;
+ boost::shared_ptr< vcl::RowOrColumn > pCurColumn;
Window* pCurParent = 0, *pDynamicPageParent = 0;
USHORT nOptPageId = 9, nCurSubGroup = 0;
bool bOnStaticPage = false;
bool bSubgroupOnStaticPage = false;
- std::multimap< rtl::OUString, vcl::RowOrColumn* > aPropertyToDependencyRowMap;
+ std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> > aPropertyToDependencyRowMap;
const Sequence< PropertyValue >& rOptions( maPController->getUIOptions() );
for( int i = 0; i < rOptions.getLength(); i++ )
@@ -1331,37 +1308,40 @@ void PrintDialog::setupOptionalUI()
{
// restore to dynamic
pCurParent = pDynamicPageParent;
- pCurColumn = aDynamicColumns.empty() ? NULL : aDynamicColumns.back();
+ if( ! aDynamicColumns.empty() )
+ pCurColumn = aDynamicColumns.back();
+ else
+ pCurColumn.reset();
bOnStaticPage = false;
bSubgroupOnStaticPage = false;
if( aGroupingHint.equalsAscii( "PrintRange" ) )
{
- pCurColumn = maJobPage.mxPrintRange.get();
+ pCurColumn = maJobPage.mxPrintRange;
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAscii( "OptionsPage" ) )
{
- pCurColumn = &maOptionsPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maOptionsPage.getLayout());
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAscii( "OptionsPageOptGroup" ) )
{
- pCurColumn = maOptionsPage.mxOptGroup.get();
+ pCurColumn = maOptionsPage.mxOptGroup;
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAscii( "LayoutPage" ) )
{
- pCurColumn = &maNUpPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maNUpPage.getLayout());
pCurParent = &maNUpPage; // set layout page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.getLength() )
{
- pCurColumn = &maJobPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maJobPage.getLayout());
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
@@ -1386,10 +1366,9 @@ void PrintDialog::setupOptionalUI()
// reset subgroup counter
nCurSubGroup = 0;
- aDynamicColumns.push_back( new vcl::RowOrColumn( NULL, true, aBorder.Width() ) );
+ aDynamicColumns.push_back( boost::dynamic_pointer_cast<vcl::RowOrColumn>(pNewGroup->getLayout()) );
pCurColumn = aDynamicColumns.back();
pCurColumn->setParentWindow( pNewGroup );
- pCurColumn->setOuterBorder( aBorder.Width() );
bSubgroupOnStaticPage = false;
bOnStaticPage = false;
}
@@ -1419,10 +1398,10 @@ void PrintDialog::setupOptionalUI()
}
// add an indent to the current column
- vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, aBorder.Width() );
+ vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), -1 );
pCurColumn->addChild( pIndent );
// and create a column inside the indent
- pCurColumn = new vcl::RowOrColumn( pIndent );
+ pCurColumn.reset( new vcl::RowOrColumn( pIndent ) );
pIndent->setChild( pCurColumn );
}
// EVIL
@@ -1446,17 +1425,17 @@ void PrintDialog::setupOptionalUI()
maPropertyToWindowMap[ aPropertyName ].push_back( &maNUpPage.maBrochureBtn );
maControlToPropertyMap[&maNUpPage.maBrochureBtn] = aPropertyName;
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, maNUpPage.mxBrochureDep.get() ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, maNUpPage.mxBrochureDep ) );
}
else
{
- vcl::RowOrColumn* pSaveCurColumn = pCurColumn;
+ boost::shared_ptr<vcl::RowOrColumn> pSaveCurColumn( pCurColumn );
if( bUseDependencyRow )
{
// find the correct dependency row (if any)
- std::pair< std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator,
- std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator > aDepRange;
+ std::pair< std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator,
+ std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator > aDepRange;
aDepRange = aPropertyToDependencyRowMap.equal_range( aDependsOnName );
if( aDepRange.first != aDepRange.second )
{
@@ -1495,16 +1474,16 @@ void PrintDialog::setupOptionalUI()
// set help text
setHelpText( pNewBox, aHelpTexts, 0 );
- vcl::RowOrColumn* pDependencyRow = new vcl::RowOrColumn( pCurColumn, false );
+ boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pCurColumn.get(), false ) );
pCurColumn->addChild( pDependencyRow );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) );
// add checkbox to current column
pDependencyRow->addWindow( pNewBox );
}
else if( aCtrlType.equalsAscii( "Radio" ) && pCurParent )
{
- vcl::RowOrColumn* pRadioColumn = pCurColumn;
+ boost::shared_ptr<vcl::RowOrColumn> pRadioColumn( pCurColumn );
if( aText.getLength() )
{
// add a FixedText:
@@ -1520,10 +1499,10 @@ void PrintDialog::setupOptionalUI()
// add fixed text to current column
pCurColumn->addWindow( pHeading );
// add an indent to the current column
- vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, 15 );
+ vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), 15 );
pCurColumn->addChild( pIndent );
// and create a column inside the indent
- pRadioColumn = new vcl::RowOrColumn( pIndent );
+ pRadioColumn.reset( new vcl::RowOrColumn( pIndent ) );
pIndent->setChild( pRadioColumn );
}
// iterate options
@@ -1533,11 +1512,11 @@ void PrintDialog::setupOptionalUI()
pVal->Value >>= nSelectVal;
for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
{
- boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn, 1 ) );
+ boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn.get(), 1 ) );
pRadioColumn->addChild( pLabel );
boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pLabel.get(), false ) );
pLabel->setElement( pDependencyRow );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow.get() ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) );
RadioButton* pBtn = new RadioButton( pCurParent, m == 0 ? WB_GROUP : 0 );
maControls.push_front( pBtn );
@@ -1565,9 +1544,9 @@ void PrintDialog::setupOptionalUI()
) && pCurParent )
{
// create a row in the current column
- vcl::RowOrColumn* pFieldColumn = new vcl::RowOrColumn( pCurColumn, false );
+ boost::shared_ptr<vcl::RowOrColumn> pFieldColumn( new vcl::RowOrColumn( pCurColumn.get(), false ) );
pCurColumn->addChild( pFieldColumn );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pFieldColumn ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pFieldColumn ) );
vcl::LabeledElement* pLabel = NULL;
if( aText.getLength() )
@@ -1582,7 +1561,7 @@ void PrintDialog::setupOptionalUI()
setSmartId( pHeading, "FixedText", -1, aPropertyName );
// add to row
- pLabel = new vcl::LabeledElement( pFieldColumn, 2 );
+ pLabel = new vcl::LabeledElement( pFieldColumn.get(), 2 );
pFieldColumn->addChild( pLabel );
pLabel->setLabel( pHeading );
}
@@ -1717,11 +1696,11 @@ void PrintDialog::setupOptionalUI()
// FIXME: the GetNativeControlRegion call on Windows has some issues
// (which skew the results of GetOptimalSize())
// however fixing this thoroughly needs to take interaction with paint into
- // acoount, making the right fix less simple. Fix this the right way
+ // account, making the right fix less simple. Fix this the right way
// at some point. For now simply add some space at the lowest element
- size_t nIndex = maJobPage.maLayout.countElements();
+ size_t nIndex = maJobPage.getLayout()->countElements();
if( nIndex > 0 ) // sanity check
- maJobPage.maLayout.setBorders( nIndex-1, 0, 0, 0, aBorder.Width() );
+ maJobPage.getLayout()->setBorders( nIndex-1, 0, 0, 0, -1 );
#endif
// create auto mnemomnics now so they can be calculated in layout
@@ -1731,13 +1710,13 @@ void PrintDialog::setupOptionalUI()
ImplWindowAutoMnemonic( this );
// calculate job page
- Size aMaxSize = maJobPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
+ Size aMaxSize = maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
// and layout page
- updateMaxSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
+ updateMaxSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
// and options page
- updateMaxSize( maOptionsPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
+ updateMaxSize( maOptionsPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
- for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin();
+ for( std::vector< boost::shared_ptr<vcl::RowOrColumn> >::iterator it = aDynamicColumns.begin();
it != aDynamicColumns.end(); ++it )
{
Size aPageSize( (*it)->getOptimalSize( WINDOWSIZE_PREFERRED ) );
@@ -1765,19 +1744,7 @@ void PrintDialog::setupOptionalUI()
maTabCtrl.SetMinimumSizePixel( maTabCtrl.GetSizePixel() );
}
- // and finally arrange controls
- for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin();
- it != aDynamicColumns.end(); ++it )
- {
- (*it)->setManagedArea( Rectangle( Point(), aTabSize ) );
- delete *it;
- *it = NULL;
- }
- maJobPage.Resize();
- maNUpPage.Resize();
- maOptionsPage.Resize();
-
- Size aSz = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
+ Size aSz = getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
SetOutputSizePixel( aSz );
}
@@ -1812,7 +1779,7 @@ void PrintDialog::checkControlDependencies()
maJobPage.maCollateImage.SetSizePixel( aImgSize );
maJobPage.maCollateImage.SetImage( bHC ? aHCImg : aImg );
maJobPage.maCollateImage.SetModeImage( aHCImg, BMP_COLOR_HIGHCONTRAST );
- maJobPage.maLayout.resize();
+ maJobPage.getLayout()->resize();
// enable setup button only for printers that can be setup
bool bHaveSetup = maPController->getPrinter()->HasSupport( SUPPORT_SETUPDIALOG );
@@ -1827,7 +1794,7 @@ void PrintDialog::checkControlDependencies()
aPrinterSize.Width() = aSetupPos.X() - aPrinterPos.X() - LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ).Width();
maJobPage.maPrinters.SetSizePixel( aPrinterSize );
maJobPage.maSetupButton.Show();
- maLayout.resize();
+ getLayout()->resize();
}
}
else
@@ -1841,7 +1808,7 @@ void PrintDialog::checkControlDependencies()
aPrinterSize.Width() = aSetupPos.X() + aSetupSize.Width() - aPrinterPos.X();
maJobPage.maPrinters.SetSizePixel( aPrinterSize );
maJobPage.maSetupButton.Hide();
- maLayout.resize();
+ getLayout()->resize();
}
}
}
@@ -2082,7 +2049,7 @@ void PrintDialog::updateNupFromPages()
if( bCustom )
{
// see if we have to enlarge the dialog to make the tab page fit
- Size aCurSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ) );
+ Size aCurSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ) );
Size aTabSize( maTabCtrl.GetTabPageSizePixel() );
if( aTabSize.Height() < aCurSize.Height() )
{
@@ -2205,7 +2172,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
else if( pButton == &maOptionsPage.maToFileBox )
{
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
- maLayout.resize();
+ getLayout()->resize();
}
else if( pButton == &maNUpPage.maBrochureBtn )
{
@@ -2241,7 +2208,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
{
maDetailsCollapsedSize = GetOutputSizePixel();
// enlarge dialog if necessary
- Size aMinSize( maJobPage.maLayout.getOptimalSize( WINDOWSIZE_MINIMUM ) );
+ Size aMinSize( maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_MINIMUM ) );
Size aCurSize( maJobPage.GetSizePixel() );
if( aCurSize.Height() < aMinSize.Height() )
{
@@ -2515,7 +2482,7 @@ void PrintDialog::Command( const CommandEvent& rEvt )
void PrintDialog::Resize()
{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+ // maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
// and do the preview; however the metafile does not need to be gotten anew
preparePreview( false );
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 77da205131ea..f6bedc1bfa25 100755
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -295,6 +295,8 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
aTmpSt.SetHighContrastMode( FALSE );
rSettings.SetStyleSettings( aTmpSt );
ImplGetFrame()->UpdateSettings( rSettings );
+ // reset default border width for layouters
+ ImplGetSVData()->maAppData.mnDefaultLayoutBorder = -1;
// Verify availability of the configured UI font, otherwise choose "Andale Sans UI"
String aUserInterfaceFont;
@@ -599,6 +601,7 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mpDlgCtrlDownWindow = NULL; // window for dialog control
mpWindowImpl->mpFirstDel = NULL; // Dtor notification list
mpWindowImpl->mpUserData = NULL; // user data
+ mpWindowImpl->mpExtImpl = NULL; // extended implementation data
mpWindowImpl->mpCursor = NULL; // cursor
mpWindowImpl->mpControlFont = NULL; // font propertie
mpWindowImpl->mpVCLXWindow = NULL;
@@ -1129,6 +1132,8 @@ void Window::ImplCallResize()
// #88419# Most classes don't call the base class in Resize() and Move(),
// => Call ImpleResize/Move instead of Resize/Move directly...
ImplCallEventListeners( VCLEVENT_WINDOW_RESIZE );
+
+ ImplExtResize();
}
// -----------------------------------------------------------------------
@@ -4342,6 +4347,8 @@ namespace
Window::~Window()
{
+ ImplFreeExtWindowImpl();
+
vcl::LazyDeletor<Window>::Undelete( this );
DBG_DTOR( Window, ImplDbgCheckWindow );
diff --git a/vcl/source/window/window4.cxx b/vcl/source/window/window4.cxx
new file mode 100644
index 000000000000..577a573c2015
--- /dev/null
+++ b/vcl/source/window/window4.cxx
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "vcl/window.hxx"
+#include "vcl/window.h"
+#include "vcl/svdata.hxx"
+#include "vcl/arrange.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+
+#include <map>
+#include <vector>
+
+using namespace com::sun::star;
+
+namespace vcl
+{
+ struct ExtWindowImpl
+ {
+ ExtWindowImpl()
+ : mbOwnedByParent( false )
+ {}
+ ~ExtWindowImpl()
+ {}
+
+ boost::shared_ptr< WindowArranger > mxLayout;
+ bool mbOwnedByParent;
+ rtl::OUString maIdentifier;
+ };
+}
+
+void Window::ImplDeleteOwnedChildren()
+{
+ Window* pChild = mpWindowImpl->mpFirstChild;
+ while ( pChild )
+ {
+ Window* pDeleteCandidate = pChild;
+ pChild = pChild->mpWindowImpl->mpNext;
+ vcl::ExtWindowImpl* pDelImpl = pDeleteCandidate->ImplGetExtWindowImpl();
+ if( pDelImpl && pDelImpl->mbOwnedByParent )
+ delete pDeleteCandidate;
+ }
+}
+
+void Window::ImplFreeExtWindowImpl()
+{
+ ImplDeleteOwnedChildren();
+ if( mpWindowImpl )
+ {
+ delete mpWindowImpl->mpExtImpl;
+ mpWindowImpl->mpExtImpl = NULL;
+ }
+}
+
+vcl::ExtWindowImpl* Window::ImplGetExtWindowImpl() const
+{
+ vcl::ExtWindowImpl* pImpl = NULL;
+ if( mpWindowImpl )
+ {
+ if( ! mpWindowImpl->mpExtImpl && ! mpWindowImpl->mbInDtor )
+ mpWindowImpl->mpExtImpl = new vcl::ExtWindowImpl();
+ pImpl = mpWindowImpl->mpExtImpl;
+ }
+ return pImpl;
+}
+
+void Window::ImplExtResize()
+{
+ if( mpWindowImpl && mpWindowImpl->mpExtImpl )
+ {
+ if( mpWindowImpl->mpExtImpl->mxLayout.get() )
+ mpWindowImpl->mpExtImpl->mxLayout->setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+ }
+}
+
+boost::shared_ptr< vcl::WindowArranger > Window::getLayout()
+{
+ boost::shared_ptr< vcl::WindowArranger > xRet;
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ {
+ if( ! pImpl->mxLayout.get() )
+ {
+ pImpl->mxLayout.reset( new vcl::LabelColumn() );
+ pImpl->mxLayout->setParentWindow( this );
+ pImpl->mxLayout->setOuterBorder( -1 );
+ }
+ xRet = pImpl->mxLayout;
+ }
+
+ return xRet;
+}
+
+void Window::addWindow( Window* i_pWin, bool i_bTakeOwnership )
+{
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl && i_pWin )
+ {
+ vcl::ExtWindowImpl* pChildImpl = i_pWin->ImplGetExtWindowImpl();
+ if( pChildImpl )
+ {
+ i_pWin->SetParent( this );
+ pChildImpl->mbOwnedByParent = i_bTakeOwnership;
+ }
+ }
+}
+
+Window* Window::removeWindow( Window* i_pWin, Window* i_pNewParent )
+{
+ Window* pRet = NULL;
+ if( i_pWin )
+ {
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ {
+ vcl::ExtWindowImpl* pChildImpl = i_pWin->ImplGetExtWindowImpl();
+ if( pChildImpl )
+ {
+ if( ! i_pNewParent )
+ pChildImpl->mbOwnedByParent = false;
+ i_pWin->SetParent( i_pNewParent );
+ pRet = i_pWin;
+ }
+ }
+ }
+ return pRet;
+}
+
+Window* Window::findWindow( const rtl::OUString& i_rIdentifier ) const
+{
+ if( getIdentifier() == i_rIdentifier )
+ return const_cast<Window*>(this);
+
+ Window* pChild = mpWindowImpl->mpFirstChild;
+ while ( pChild )
+ {
+ Window* pResult = pChild->findWindow( i_rIdentifier );
+ if( pResult )
+ return pResult;
+ pChild = pChild->mpWindowImpl->mpNext;
+ }
+
+ return NULL;
+}
+
+const rtl::OUString& Window::getIdentifier() const
+{
+ static rtl::OUString aEmptyStr;
+
+ return (mpWindowImpl && mpWindowImpl->mpExtImpl) ? mpWindowImpl->mpExtImpl->maIdentifier : aEmptyStr;
+}
+
+void Window::setIdentifier( const rtl::OUString& i_rIdentifier )
+{
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ pImpl->maIdentifier = i_rIdentifier;
+}
+
+void Window::setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps )
+{
+ const beans::PropertyValue* pVals = i_rProps.getConstArray();
+ for( sal_Int32 i = 0; i < i_rProps.getLength(); i++ )
+ {
+ if( pVals[i].Name.equalsAscii( "Enabled" ) )
+ {
+ sal_Bool bVal = sal_True;
+ if( pVals[i].Value >>= bVal )
+ Enable( bVal );
+ }
+ else if( pVals[i].Name.equalsAscii( "Visible" ) )
+ {
+ sal_Bool bVal = sal_True;
+ if( pVals[i].Value >>= bVal )
+ Show( bVal );
+ }
+ else if( pVals[i].Name.equalsAscii( "Text" ) )
+ {
+ rtl::OUString aText;
+ if( pVals[i].Value >>= aText )
+ SetText( aText );
+ }
+ }
+}
+
+uno::Sequence< beans::PropertyValue > Window::getProperties() const
+{
+ uno::Sequence< beans::PropertyValue > aProps( 3 );
+ aProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) );
+ aProps[0].Value = uno::makeAny( sal_Bool( IsEnabled() ) );
+ aProps[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) );
+ aProps[1].Value = uno::makeAny( sal_Bool( IsVisible() ) );
+ aProps[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) );
+ aProps[2].Value = uno::makeAny( rtl::OUString( GetText() ) );
+
+ return aProps;
+}
+
diff --git a/vcl/source/window/wpropset.cxx b/vcl/source/window/wpropset.cxx
new file mode 100644
index 000000000000..4aaa3f987b77
--- /dev/null
+++ b/vcl/source/window/wpropset.cxx
@@ -0,0 +1,346 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "vcl/wpropset.hxx"
+#include "vcl/window.hxx"
+#include "vcl/vclevent.hxx"
+#include "vcl/svdata.hxx"
+
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/beans/PropertyAttribute.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertyContainer.hpp"
+#include "com/sun/star/beans/XPropertyAccess.hpp"
+
+#include "cppuhelper/basemutex.hxx"
+#include "cppuhelper/compbase1.hxx"
+
+#include <map>
+
+using namespace vcl;
+using namespace com::sun::star;
+
+/*
+
+TODO:
+- release solarmutex during outside UNO calls
+- in ChildEventListener protect against reentry by using PostUserEvent
+
+*/
+
+class vcl::WindowPropertySetListener :
+ public cppu::BaseMutex,
+ public cppu::WeakComponentImplHelper1< com::sun::star::beans::XPropertyChangeListener >,
+ private boost::noncopyable
+{
+ WindowPropertySet* mpParent;
+ bool mbSuspended;
+public:
+ WindowPropertySetListener( WindowPropertySet* pParent )
+ : cppu::WeakComponentImplHelper1< com::sun::star::beans::XPropertyChangeListener >( m_aMutex )
+ , mpParent( pParent )
+ , mbSuspended( false )
+ {}
+
+ virtual ~WindowPropertySetListener()
+ {
+ }
+
+ using cppu::WeakComponentImplHelperBase::disposing;
+ virtual void SAL_CALL disposing( const lang::EventObject& ) throw()
+ {
+ }
+
+ virtual void SAL_CALL propertyChange( const beans::PropertyChangeEvent& i_rEvent ) throw()
+ {
+ if( ! mbSuspended )
+ mpParent->propertyChange( i_rEvent );
+ }
+
+ void suspend( bool i_bSuspended )
+ {
+ mbSuspended = i_bSuspended;
+ }
+};
+
+class vcl::WindowPropertySetData
+{
+public:
+
+ struct PropertyMapEntry
+ {
+ Window* mpWindow;
+ boost::shared_ptr<WindowArranger> mpLayout;
+ uno::Sequence< beans::PropertyValue > maSavedValues;
+
+ PropertyMapEntry( Window* i_pWindow = NULL,
+ const boost::shared_ptr<WindowArranger>& i_pLayout = boost::shared_ptr<WindowArranger>() )
+ : mpWindow( i_pWindow )
+ , mpLayout( i_pLayout )
+ {}
+
+ uno::Sequence< beans::PropertyValue > getProperties() const
+ {
+ if( mpWindow )
+ return mpWindow->getProperties();
+ else if( mpLayout.get() )
+ return mpLayout->getProperties();
+ return uno::Sequence< beans::PropertyValue >();
+ }
+
+ void setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps ) const
+ {
+ if( mpWindow )
+ mpWindow->setProperties( i_rProps );
+ else if( mpLayout.get() )
+ mpLayout->setProperties( i_rProps );
+ }
+ };
+
+ Window* mpTopWindow;
+ bool mbOwner;
+ std::map< rtl::OUString, PropertyMapEntry > maProperties;
+ uno::Reference< beans::XPropertySet > mxPropSet;
+ uno::Reference< beans::XPropertyAccess > mxPropSetAccess;
+ uno::Reference< beans::XPropertyChangeListener > mxListener;
+ vcl::WindowPropertySetListener* mpListener;
+
+ WindowPropertySetData()
+ : mpTopWindow( NULL )
+ , mbOwner( false )
+ , mpListener( NULL )
+ {}
+
+ ~WindowPropertySetData()
+ {
+ // release layouters, possibly interface properties before destroying
+ // the involved parent to be on the safe side
+ maProperties.clear();
+ if( mbOwner )
+ delete mpTopWindow;
+ }
+};
+
+static rtl::OUString getIdentifiedPropertyName( const rtl::OUString& i_rIdentifier, const rtl::OUString& i_rName )
+{
+ rtl::OUStringBuffer aBuf( i_rIdentifier.getLength() + 1 + i_rName.getLength() );
+ aBuf.append( i_rIdentifier );
+ aBuf.append( sal_Unicode( '#' ) );
+ aBuf.append( i_rName );
+ return aBuf.makeStringAndClear();
+}
+
+static void spliceIdentifiedPropertyName( const rtl::OUString& i_rIdentifiedPropName,
+ rtl::OUString& o_rIdentifier,
+ rtl::OUString& o_rPropName )
+{
+ sal_Int32 nIndex = 0;
+ o_rIdentifier = i_rIdentifiedPropName.getToken( 0, sal_Unicode( '#' ), nIndex );
+ if( nIndex != -1 )
+ o_rPropName = i_rIdentifiedPropName.copy( nIndex );
+ else
+ o_rPropName = rtl::OUString();
+}
+
+WindowPropertySet::WindowPropertySet( Window* i_pTopWindow, bool i_bTakeOwnership )
+: mpImpl( new vcl::WindowPropertySetData )
+{
+ mpImpl->mpTopWindow = i_pTopWindow;
+ mpImpl->mbOwner = i_bTakeOwnership;
+
+ mpImpl->mpTopWindow->AddChildEventListener( LINK( this, WindowPropertySet, ChildEventListener ) );
+
+ mpImpl->mxPropSet = uno::Reference< beans::XPropertySet >(
+ ImplGetSVData()->maAppData.mxMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.PropertyBag" ) ) ),
+ uno::UNO_QUERY );
+ OSL_ENSURE( mpImpl->mxPropSet.is(), "could not create instance of com.sun.star.beans.PropertyBag" );
+ mpImpl->mxPropSetAccess = uno::Reference< beans::XPropertyAccess >( mpImpl->mxPropSet, uno::UNO_QUERY );
+ OSL_ENSURE( mpImpl->mxPropSet.is(), "could not query XPropertyAccess interface" );
+ if( ! mpImpl->mxPropSetAccess.is() )
+ mpImpl->mxPropSet.clear();
+
+ addWindowToSet( i_pTopWindow );
+
+ setupProperties();
+
+ if( mpImpl->mxPropSet.is() )
+ {
+ mpImpl->mxListener.set( mpImpl->mpListener = new WindowPropertySetListener( this ) );
+ }
+}
+
+WindowPropertySet::~WindowPropertySet()
+{
+ mpImpl->mpTopWindow->RemoveChildEventListener( LINK( this, WindowPropertySet, ChildEventListener ) );
+
+ delete mpImpl;
+ mpImpl = NULL;
+}
+
+uno::Reference< beans::XPropertySet > WindowPropertySet::getPropertySet() const
+{
+ return mpImpl->mxPropSet;
+}
+
+void WindowPropertySet::addLayoutToSet( const boost::shared_ptr< WindowArranger >& i_pLayout )
+{
+ if( i_pLayout.get() )
+ {
+ if( i_pLayout->getIdentifier().getLength() )
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = mpImpl->maProperties[ i_pLayout->getIdentifier() ];
+ OSL_ENSURE( rEntry.mpWindow == 0 && rEntry.mpLayout.get() == 0, "inserted layout has duplicate name" );
+ rEntry.mpWindow = NULL;
+ rEntry.mpLayout = i_pLayout;
+ rEntry.maSavedValues = i_pLayout->getProperties();
+ }
+ // insert child layouts
+ size_t nChildren = i_pLayout->countElements();
+ for( size_t i = 0; i < nChildren; i++ )
+ addLayoutToSet( i_pLayout->getChild( i ) );
+ }
+}
+
+void WindowPropertySet::addWindowToSet( Window* i_pWindow )
+{
+ if( i_pWindow->getIdentifier().getLength() ) // no name, no properties
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = mpImpl->maProperties[ i_pWindow->getIdentifier() ];
+ OSL_ENSURE( rEntry.mpWindow == 0 && rEntry.mpLayout.get() == 0, "inserted window has duplicate name" );
+ rEntry.mpWindow = i_pWindow;
+ rEntry.mpLayout.reset();
+ rEntry.maSavedValues = i_pWindow->getProperties();
+ }
+ addLayoutToSet( i_pWindow->getLayout() );
+
+ Window* pWin = i_pWindow->GetWindow( WINDOW_FIRSTCHILD );
+ while( pWin )
+ {
+ addWindowToSet( pWin );
+ pWin = pWin->GetWindow( WINDOW_NEXT );
+ }
+}
+
+void WindowPropertySet::setupProperties()
+{
+ uno::Reference< beans::XPropertyContainer > xCont( mpImpl->mxPropSet, uno::UNO_QUERY );
+ OSL_ENSURE( xCont.is(), "could not get XPropertyContainer interface" );
+ if( ! xCont.is() )
+ return;
+
+ for( std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it
+ = mpImpl->maProperties.begin(); it != mpImpl->maProperties.end(); ++it )
+ {
+ uno::Sequence< beans::PropertyValue > aOutsideValues( it->second.maSavedValues );
+ beans::PropertyValue* pVal = aOutsideValues.getArray();
+ for( sal_Int32 i = 0; i < aOutsideValues.getLength(); i++ )
+ {
+ pVal[i].Name = getIdentifiedPropertyName( it->first, pVal[i].Name );
+ xCont->addProperty( pVal[i].Name,
+ beans::PropertyAttribute::BOUND | beans:: PropertyAttribute::CONSTRAINED,
+ pVal[i].Value
+ );
+ }
+ }
+}
+
+void WindowPropertySet::propertyChange( const beans::PropertyChangeEvent& i_rEvent )
+{
+ rtl::OUString aIdentifier, aProperty;
+ spliceIdentifiedPropertyName( i_rEvent.PropertyName, aIdentifier, aProperty );
+ std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it =
+ mpImpl->maProperties.find( aIdentifier );
+ if( it != mpImpl->maProperties.end() )
+ {
+ uno::Sequence< beans::PropertyValue > aSet( 1 );
+ aSet[0].Name = aProperty;
+ aSet[0].Value = i_rEvent.NewValue;
+ it->second.setProperties( aSet );
+ }
+}
+
+IMPL_LINK( vcl::WindowPropertySet, ChildEventListener, VclWindowEvent*, pEvent )
+{
+ // find window in our properties
+ std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it
+ = mpImpl->maProperties.find( pEvent->GetWindow()->getIdentifier() );
+ if( it != mpImpl->maProperties.end() ) // this is valid, some unnamed child may have sent an event
+ {
+ ULONG nId = pEvent->GetId();
+ // check if anything interesting happened
+ if(
+ // general windowy things
+ nId == VCLEVENT_WINDOW_SHOW ||
+ nId == VCLEVENT_WINDOW_HIDE ||
+ nId == VCLEVENT_WINDOW_ENABLED ||
+ nId == VCLEVENT_WINDOW_DISABLED ||
+ // button thingies
+ nId == VCLEVENT_BUTTON_CLICK ||
+ nId == VCLEVENT_PUSHBUTTON_TOGGLE ||
+ nId == VCLEVENT_RADIOBUTTON_TOGGLE ||
+ nId == VCLEVENT_CHECKBOX_TOGGLE ||
+ // listbox
+ nId == VCLEVENT_LISTBOX_SELECT ||
+ // edit
+ nId == VCLEVENT_EDIT_MODIFY
+ )
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = it->second;
+ // collect changes
+ uno::Sequence< beans::PropertyValue > aNewProps( rEntry.getProperties() );
+ uno::Sequence< beans::PropertyValue > aNewPropsOut( aNewProps );
+
+ // translate to identified properties
+ beans::PropertyValue* pValues = aNewPropsOut.getArray();
+ for( sal_Int32 i = 0; i < aNewPropsOut.getLength(); i++ )
+ pValues[i].Name = getIdentifiedPropertyName( it->first, pValues[i].Name );
+
+ // broadcast changes
+ bool bWasVeto = false;
+ mpImpl->mpListener->suspend( true );
+ try
+ {
+ mpImpl->mxPropSetAccess->setPropertyValues( aNewPropsOut );
+ }
+ catch( beans::PropertyVetoException& )
+ {
+ bWasVeto = true;
+ }
+ mpImpl->mpListener->suspend( false );
+
+ if( ! bWasVeto ) // changes accepted ?
+ rEntry.maSavedValues = rEntry.getProperties();
+ else // no, reset
+ rEntry.setProperties( rEntry.maSavedValues );
+ }
+ }
+
+ return 0;
+}
diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx
index 417704eb3b69..ece724d717cb 100644
--- a/vcl/unx/source/gdi/salprnpsp.cxx
+++ b/vcl/unx/source/gdi/salprnpsp.cxx
@@ -1187,14 +1187,12 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam
aContext.Version = vcl::PDFWriter::PDF_1_4;
aContext.Tagged = false;
aContext.EmbedStandardFonts = true;
- aContext.Encrypt = false;
aContext.DocumentLocale = Application::GetSettings().GetLocale();
// prepare doc info
- vcl::PDFDocInfo aDocInfo;
- aDocInfo.Title = i_rJobName;
- aDocInfo.Creator = i_rAppName;
- aDocInfo.Producer = i_rAppName;
+ aContext.DocumentInfo.Title = i_rJobName;
+ aContext.DocumentInfo.Creator = i_rAppName;
+ aContext.DocumentInfo.Producer = i_rAppName;
// define how we handle metafiles in PDFWriter
vcl::PDFWriter::PlayMetafileContext aMtfContext;
@@ -1271,11 +1269,10 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam
#if defined __SUNPRO_CC
#pragma disable_warn
#endif
- pWriter.reset( new vcl::PDFWriter( aContext ) );
+ pWriter.reset( new vcl::PDFWriter( aContext, uno::Reference< beans::XMaterialHolder >() ) );
#if defined __SUNPRO_CC
#pragma enable_warn
#endif
- pWriter->SetDocInfo( aDocInfo );
}
pWriter->NewPage( TenMuToPt( aNewParm.maPageSize.Width() ),
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java
index 26aa9d2d8486..bc09829daea1 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java
@@ -213,7 +213,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog
try {
sTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard");
sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", "");
- sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/wizard/bitmap");
+ sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/../wizard/bitmap");
} catch (NoValidPathException e) {
e.printStackTrace();
}
@@ -302,7 +302,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog
try {
sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user");
- sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/wizard/bitmap");
+ sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/../wizard/bitmap");
} catch (NoValidPathException e) {
e.printStackTrace();
}
diff --git a/wizards/com/sun/star/wizards/common/Desktop.java b/wizards/com/sun/star/wizards/common/Desktop.java
index c9292b58c1b4..8902696c37b4 100644
--- a/wizards/com/sun/star/wizards/common/Desktop.java
+++ b/wizards/com/sun/star/wizards/common/Desktop.java
@@ -378,7 +378,7 @@ public class Desktop
{
TemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard");
UserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", "");
- BitmapPath = FileAccess.combinePaths(xMSF, TemplatePath, "/wizard/bitmap");
+ BitmapPath = FileAccess.combinePaths(xMSF, TemplatePath, "/../wizard/bitmap");
WorkPath = FileAccess.getOfficePath(xMSF, "Work", "", "");
}
catch (NoValidPathException nopathexception)
@@ -417,7 +417,7 @@ public class Desktop
{
try
{
- String sBitmapPath = FileAccess.combinePaths(_xMSF, getTemplatePath(_xMSF), "/wizard/bitmap");
+ String sBitmapPath = FileAccess.combinePaths(_xMSF, getTemplatePath(_xMSF), "/../wizard/bitmap");
return sBitmapPath;
}
catch (NoValidPathException nopathexception)
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java
index 0cc5268accc0..6163cd143894 100644
--- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java
@@ -381,7 +381,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
{
sTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard");
sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", "");
- sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/wizard/bitmap");
+ sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/../wizard/bitmap");
}
catch (NoValidPathException e)
{
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
index f992ef98b56b..7cc587a2c63c 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
@@ -1294,7 +1294,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
sTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard");
sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", "");
- sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/wizard/bitmap");
+ sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/../wizard/bitmap");
}
catch (NoValidPathException e)
{
diff --git a/wizards/com/sun/star/wizards/web/FTPDialog.java b/wizards/com/sun/star/wizards/web/FTPDialog.java
index 2085704cf359..ca6f70add7b6 100644
--- a/wizards/com/sun/star/wizards/web/FTPDialog.java
+++ b/wizards/com/sun/star/wizards/web/FTPDialog.java
@@ -187,7 +187,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID
publish = p;
- imagesDirectory = FileAccess.connectURLs(((CGSettings) (publish.root)).soTemplateDir, "wizard/bitmap/");
+ imagesDirectory = FileAccess.connectURLs(((CGSettings) (publish.root)).soTemplateDir, "../wizard/bitmap/");
//Load Resources
resources = new FTPDialogResources(xmsf);
diff --git a/wizards/com/sun/star/wizards/web/WWD_Startup.java b/wizards/com/sun/star/wizards/web/WWD_Startup.java
index 818781cd0bf3..200f70a32383 100644
--- a/wizards/com/sun/star/wizards/web/WWD_Startup.java
+++ b/wizards/com/sun/star/wizards/web/WWD_Startup.java
@@ -241,7 +241,7 @@ public abstract class WWD_Startup extends WWD_General
String soTemplateDir = FileAccess.getOfficePath(xmsf, "Template", "share", "/wizard");
- String exclamationURL = FileAccess.connectURLs(soTemplateDir, "wizard/bitmap/caution_16.png");
+ String exclamationURL = FileAccess.connectURLs(soTemplateDir, "../wizard/bitmap/caution_16.png");
this.drawNaviBar();
this.buildStep1();
this.buildStep2();
diff --git a/wizards/source/euro/Init.xba b/wizards/source/euro/Init.xba
index 45fdafdbafe5..2de1252c7e48 100644
--- a/wizards/source/euro/Init.xba
+++ b/wizards/source/euro/Init.xba
@@ -550,7 +550,7 @@ Dim Isthere as Boolean
InitializeLocales(oLocale)
InitializeCurrencies()
InitializeControls()
- BitmapDir = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/bitmap&quot;)
+ BitmapDir = GetOfficeSubPath(&quot;Template&quot;, &quot;../wizard/bitmap&quot;)
If BitmapDir = &quot;&quot; Then
Stop
End If
diff --git a/wizards/source/formwizard/tools.xba b/wizards/source/formwizard/tools.xba
index 174987e35971..8b40b8379c10 100644
--- a/wizards/source/formwizard/tools.xba
+++ b/wizards/source/formwizard/tools.xba
@@ -304,7 +304,7 @@ End Function
Function GetFormWizardPaths() as Boolean
- FormPath = GetOfficeSubPath(&quot;Template&quot;,&quot;wizard/bitmap&quot;)
+ FormPath = GetOfficeSubPath(&quot;Template&quot;,&quot;../wizard/bitmap&quot;)
If FormPath &lt;&gt; &quot;&quot; Then
WebWizardPath = GetOfficeSubPath(&quot;Template&quot;,&quot;wizard/web&quot;)
If WebWizardPath &lt;&gt; &quot;&quot; Then
diff --git a/wizards/source/importwizard/Main.xba b/wizards/source/importwizard/Main.xba
index 2c25c6abebd0..3415d0ee8dd8 100644
--- a/wizards/source/importwizard/Main.xba
+++ b/wizards/source/importwizard/Main.xba
@@ -274,7 +274,7 @@ End Sub
Function GetImportWizardPaths() as Boolean
- SOBitmapPath = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/bitmap&quot;)
+ SOBitmapPath = GetOfficeSubPath(&quot;Template&quot;, &quot;../wizard/bitmap&quot;)
If SOBitmapPath &lt;&gt; &quot;&quot; Then
SOWorkPath = GetPathSettings(&quot;Work&quot;, False)
If SOWorkPath &lt;&gt; &quot;&quot; Then
diff --git a/wizards/source/schedule/CalendarMain.xba b/wizards/source/schedule/CalendarMain.xba
index bfe49121dbd3..2deb51cca84d 100644
--- a/wizards/source/schedule/CalendarMain.xba
+++ b/wizards/source/schedule/CalendarMain.xba
@@ -82,7 +82,7 @@ Dim iThisMonth as Integer
DlgCalModel = DlgCalendar.Model
LoadLanguage(sCurLangLocale)
CalInitGlobalVariablesDate()
- BitmapDir = GetOfficeSubPath(&quot;Template&quot;,&quot;wizard/bitmap&quot;)
+ BitmapDir = GetOfficeSubPath(&quot;Template&quot;,&quot;../wizard/bitmap&quot;)
DlgCalModel.imgCountry.ImageURL = BitmapDir &amp; sBitmapFilename
CalChoosenLand = -2
CalLoadOwnData()
diff --git a/wizards/source/template/Samples.xba b/wizards/source/template/Samples.xba
index b64ddc12db17..118fb37d0c49 100644
--- a/wizards/source/template/Samples.xba
+++ b/wizards/source/template/Samples.xba
@@ -86,7 +86,7 @@ Dim MaxIndex as Integer
DialogModel = StylesDialog.Model
TemplateDir = GetPathSettings(&quot;Template&quot;, False, 0)
StylesDir = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/styles/&quot;)
- sQueryPath = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/bitmap/&quot;)
+ sQueryPath = GetOfficeSubPath(&quot;Template&quot;, &quot;../wizard/bitmap/&quot;)
DialogModel.Title = GetResText(STYLES)
DialogModel.cmdCancel.Label = GetResText(STYLES+2)
DialogModel.cmdOk.Label = GetResText(STYLES+3)
diff --git a/wizards/source/tutorials/Functions.xba b/wizards/source/tutorials/Functions.xba
index 6524ec19338c..c1b464acaf9d 100644
--- a/wizards/source/tutorials/Functions.xba
+++ b/wizards/source/tutorials/Functions.xba
@@ -78,15 +78,15 @@ Sub setMaxMinImage(param As String)
iPos = InStr(templatePath,&quot;/&quot;)
If(iPos &gt; 0) Then
If(param = &quot;MAX&quot;) Then
- bitmapPath = templatePath &amp; &quot;/wizard/bitmap/maximize.bmp&quot;
+ bitmapPath = templatePath &amp; &quot;../wizard/bitmap/maximize.bmp&quot;
ElseIf(param = &quot;MIN&quot;) Then
- bitmapPath = templatePath &amp; &quot;/wizard/bitmap/minimize.bmp&quot;
+ bitmapPath = templatePath &amp; &quot;../wizard/bitmap/minimize.bmp&quot;
End If
Else
If(param = &quot;MAX&quot;) Then
- bitmapPath = templatePath &amp; &quot;\wizard\bitmap\maximize.bmp&quot;
+ bitmapPath = templatePath &amp; &quot;..\wizard\bitmap\maximize.bmp&quot;
ElseIf(param = &quot;MIN&quot;) Then
- bitmapPath = templatePath &amp; &quot;\wizard\bitmap\minimize.bmp&quot;
+ bitmapPath = templatePath &amp; &quot;..\wizard\bitmap\minimize.bmp&quot;
End If
End If
&apos;printdbgInfo oCommandButton.Model
diff --git a/wizards/source/tutorials/ShowInfoDialog.xba b/wizards/source/tutorials/ShowInfoDialog.xba
index 4bb0f608d9b6..61c2ed96731f 100644
--- a/wizards/source/tutorials/ShowInfoDialog.xba
+++ b/wizards/source/tutorials/ShowInfoDialog.xba
@@ -148,9 +148,9 @@ sub setImage(whatever as Object)
Dim bitmapPath As String
iPos = InStr(templatePath,&quot;/&quot;)
if(iPos &gt; 0) Then
- bitmapPath = templatePath &amp; &quot;/wizard/bitmap/tutorial_background.gif&quot;
+ bitmapPath = templatePath &amp; &quot;../wizard/bitmap/tutorial_background.gif&quot;
Else
- bitmapPath = templatePath &amp; &quot;\wizard\bitmap\tutorial_background.gif&quot;
+ bitmapPath = templatePath &amp; &quot;..\wizard\bitmap\tutorial_background.gif&quot;
End If
dim props(0) as new com.sun.star.beans.PropertyValue
diff --git a/wizards/source/webwizard/Language.xba b/wizards/source/webwizard/Language.xba
index 1aa26fac30cb..1c6b8c194e98 100644
--- a/wizards/source/webwizard/Language.xba
+++ b/wizards/source/webwizard/Language.xba
@@ -30,7 +30,7 @@ Dim TemplatePath as String
If PhotosDir &lt;&gt; &quot;&quot; Then
TemplatePath = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/web/&quot;)
If TemplatePath &lt;&gt; &quot;&quot; Then
- SOBitmapPath = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/bitmap&quot;)
+ SOBitmapPath = GetOfficeSubPath(&quot;Template&quot;, &quot;../wizard/bitmap&quot;)
If SOBitmapPath &lt;&gt; &quot;&quot; Then
GetWebwizardPaths() = True
Exit Function
diff --git a/writerfilter/util/writerfilter.component b/writerfilter/util/writerfilter.component
index 5d4c628df978..7a81b6cc3a2b 100644
--- a/writerfilter/util/writerfilter.component
+++ b/writerfilter/util/writerfilter.component
@@ -35,4 +35,8 @@
<implementation name="com.sun.star.comp.Writer.WriterFilterDetector">
<service name="com.sun.star.document.ExtendedTypeDetection"/>
</implementation>
+ <implementation name="com.sun.star.comp.Writer.RtfFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
</component>
diff --git a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
index 4b8bcf429057..af3a0ce941e5 100644
--- a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
+++ b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
@@ -104,6 +104,24 @@ void XMLGraphicsDefaultStyle::SetDefaults()
Reference< XPropertySet > xDefaults( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Defaults") ) ), UNO_QUERY );
if( !xDefaults.is() )
return;
+ // SJ: #i114750#
+ sal_Bool bWordWrapDefault = sal_True; // initializing with correct odf fo:wrap-option default
+ sal_Int32 nUPD( 0 );
+ sal_Int32 nBuild( 0 );
+ const bool bBuildIdFound = GetImport().getBuildIds( nUPD, nBuild );
+ if ( bBuildIdFound && (
+ ((nUPD >= 600) && (nUPD < 700))
+ ||
+ ((nUPD == 300) && (nBuild <= 9535))
+ ||
+ ((nUPD > 300) && (nUPD <= 330))
+ ) )
+ bWordWrapDefault = sal_False;
+
+ const OUString sTextWordWrap( RTL_CONSTASCII_USTRINGPARAM( "TextWordWrap" ) );
+ Reference< XPropertySetInfo > xInfo( xDefaults->getPropertySetInfo() );
+ if ( xInfo->hasPropertyByName( sTextWordWrap ) )
+ xDefaults->setPropertyValue( sTextWordWrap, Any( bWordWrapDefault ) );
FillPropertySet( xDefaults );
}
diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx
index b1b9f039c6b4..f7cbe73acd1b 100644
--- a/xmloff/source/text/XMLTextListAutoStylePool.cxx
+++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx
@@ -185,7 +185,15 @@ XMLTextListAutoStylePool::XMLTextListAutoStylePool( SvXMLExport& rExp ) :
XMLTextListAutoStylePool::~XMLTextListAutoStylePool()
{
+ // The XMLTextListAutoStylePoolEntry_Impl object in the pool need delete explicitly in dtor.
+ ULONG nCount = pPool->Count();
+ while ( nCount-- )
+ delete pPool->Remove(nCount);
delete pPool;
+
+ nCount = pNames->Count();
+ while ( nCount-- )
+ delete pNames->Remove(nCount);
delete pNames;
}