diff options
author | Michael Stahl <mst@openoffice.org> | 2010-01-26 14:45:09 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-01-26 14:45:09 +0100 |
commit | b64f5b9cbdb1e0b508eb0f6a0c4e90815c9b3e18 (patch) | |
tree | b1ea2f184d48d8e39ecaf4e792af04848a12c9a0 | |
parent | e832b802d33f63a8ae62df1ce053d978cbd1b908 (diff) | |
parent | 6adbd7aec7e0a5dc76ee62ba91ba4660c3896290 (diff) |
merge DEV300_m70
690 files changed, 9126 insertions, 9293 deletions
diff --git a/starmath/inc/action.hxx b/starmath/inc/action.hxx index 221b3a579d..33e5a7f4f5 100644 --- a/starmath/inc/action.hxx +++ b/starmath/inc/action.hxx @@ -30,7 +30,7 @@ #ifndef ACTION_HXX #define ACTION_HXX -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #include "format.hxx" class SmDocShell; diff --git a/starmath/inc/config.hxx b/starmath/inc/config.hxx index 7bc3b848ac..2af382d399 100644 --- a/starmath/inc/config.hxx +++ b/starmath/inc/config.hxx @@ -30,8 +30,8 @@ #ifndef CONFIG_HXX #define CONFIG_HXX -#include <svtools/brdcst.hxx> -#include <svtools/lstner.hxx> +#include <svl/brdcst.hxx> +#include <svl/lstner.hxx> #include "format.hxx" #include "cfgitem.hxx" diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index 3f015a924e..2ddf7fcf92 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -35,14 +35,13 @@ #include <sot/storage.hxx> #include <sot/sotref.hxx> #include <sfx2/objsh.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <sfx2/docfac.hxx> #include <vcl/virdev.hxx> + #include "format.hxx" #include "parse.hxx" -#ifndef SMMOD_HXX #include "smmod.hxx" -#endif #include <vcl/jobset.hxx> @@ -84,6 +83,8 @@ class Printer; class SmDocShell; class EditEngine; +//////////////////////////////////////////////////////////// + class SmPrinterAccess { Printer* pPrinter; diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx index 326b2159cb..4d30b5252e 100644 --- a/starmath/inc/format.hxx +++ b/starmath/inc/format.hxx @@ -31,8 +31,8 @@ #define FORMAT_HXX -#include <svtools/smplhint.hxx> -#include <svtools/brdcst.hxx> +#include <svl/smplhint.hxx> +#include <svl/brdcst.hxx> #include "utility.hxx" #include <types.hxx> diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx index ced91cc7f6..e7d947cf27 100644 --- a/starmath/inc/smmod.hxx +++ b/starmath/inc/smmod.hxx @@ -34,7 +34,7 @@ #ifndef _SV_RESARY_HXX #include <tools/resary.hxx> #endif -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <svtools/colorcfg.hxx> #include <tools/shl.hxx> @@ -44,6 +44,8 @@ #include "starmath.hrc" #endif +#include <unotools/options.hxx> + class SvxErrorHandler; class SfxObjectFactory; class SmConfig; @@ -124,7 +126,7 @@ public: ///////////////////////////////////////////////////////////////// -class SmModule : public SfxModule, public SfxListener +class SmModule : public SfxModule, utl::ConfigurationListener { svtools::ColorConfig *pColorConfig; SmConfig *pConfig; @@ -145,8 +147,7 @@ public: SmModule(SfxObjectFactory* pObjFact); virtual ~SmModule(); - // SfxListener - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ); svtools::ColorConfig & GetColorConfig(); diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index 854584e11d..0de1c6d023 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -31,7 +31,7 @@ #define _STARMATH_HRC #ifndef _SVX_SVXIDS_HRC -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #endif #ifndef _SFXSIDS_HRC //autogen #include <sfx2/sfxsids.hrc> @@ -103,6 +103,8 @@ #define RID_SYMBOLDIALOG (RID_APP_START + 8) #define RID_SYMDEFINEDIALOG (RID_APP_START + 9) #define RID_EXTRAOPTIONPAGE (RID_APP_START + 10) +#define RID_PRINTUIOPTIONS (RID_APP_START + 11) + #define RID_MATH_TOOLBOX (RID_APP_START + 50) // wegen #58705# entfernt //#define RID_DRAW_OBJECTBAR (RID_APP_START + 51) diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index 2be59e453c..f2949aa5f5 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -37,8 +37,8 @@ #include <tools/list.hxx> #include <tools/debug.hxx> #include <tools/dynary.hxx> -#include <svtools/lstner.hxx> -#include <svtools/svarray.hxx> +#include <svl/lstner.hxx> +#include <svl/svarray.hxx> #include "utility.hxx" #include <smmod.hxx> diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx index 22ce518003..781ce9b19d 100644 --- a/starmath/inc/types.hxx +++ b/starmath/inc/types.hxx @@ -31,9 +31,9 @@ #define TYPES_HXX #include <sal/types.h> +#include <tools/debug.hxx> -#define FONTNAME_MATH "StarSymbol" -#define FONTNAME_MATH2 "OpenSymbol" +#define FONTNAME_MATH "OpenSymbol" ///////////////////////////////////////////////////////////////// @@ -54,19 +54,8 @@ inline sal_Bool IsInPrivateUseArea( sal_Unicode cChar ) { return 0xE000 <= cChar inline sal_Bool IsGreekChar( sal_Unicode cChar ) { return 0x0370 <= cChar && cChar <= 0x03FF; } sal_Unicode ConvertMathPrivateUseAreaToUnicode( sal_Unicode cChar ); -#ifdef TL_NOT_YET_USED -sal_Unicode ConvertUnicodeToMathPrivateUseArea( sal_Unicode cChar ); - -sal_Unicode ConvertMathToMathType( sal_Unicode cChar ); -sal_Unicode ConvertMathTypeToMath( sal_Unicode cChar ); -#endif //TL_NOT_YET_USED sal_Unicode ConvertMathToMathML( sal_Unicode cChar ); -#ifdef TL_NOT_YET_USED -sal_Unicode ConvertMathMLToMath( sal_Unicode cChar ); - -sal_Unicode GetTokenChar( sal_Unicode cChar, sal_Bool bConvertForExport ); -#endif //TL_NOT_YET_USED ///////////////////////////////////////////////////////////////// // enum definitions for characters from the 'StarSymbol' font @@ -84,14 +73,14 @@ enum MathSymbol MS_DRARROW = (sal_Unicode) 0x21D2, MS_DLARROW = (sal_Unicode) 0x21D0, MS_DLRARROW = (sal_Unicode) 0x21D4, - MS_UNDERBRACE = (sal_Unicode) 0xE081, - MS_OVERBRACE = (sal_Unicode) 0xE082, - MS_CIRC = (sal_Unicode) 0x00B0, + MS_OVERBRACE = (sal_Unicode) 0x23DE, + MS_UNDERBRACE = (sal_Unicode) 0x23DF, + MS_CIRC = (sal_Unicode) 0x2218, MS_ASSIGN = (sal_Unicode) 0x003D, MS_ERROR = (sal_Unicode) 0x00BF, MS_NEQ = (sal_Unicode) 0x2260, - MS_PLUS = (sal_Unicode) 0xE083, + MS_PLUS = (sal_Unicode) 0x002B, MS_MINUS = (sal_Unicode) 0x2212, MS_MULTIPLY = (sal_Unicode) 0x2217, MS_TIMES = (sal_Unicode) 0x00D7, @@ -107,23 +96,23 @@ enum MathSymbol MS_UNION = (sal_Unicode) 0x222A, MS_INTERSECT = (sal_Unicode) 0x2229, - MS_LT = (sal_Unicode) 0xE084, - MS_GT = (sal_Unicode) 0xE085, + MS_LT = (sal_Unicode) 0x003C, + MS_GT = (sal_Unicode) 0x003E, MS_LE = (sal_Unicode) 0x2264, MS_GE = (sal_Unicode) 0x2265, - MS_LESLANT = (sal_Unicode) 0xE086, - MS_GESLANT = (sal_Unicode) 0xE087, + MS_LESLANT = (sal_Unicode) 0x2A7D, + MS_GESLANT = (sal_Unicode) 0x2A7E, MS_LL = (sal_Unicode) 0x226A, MS_GG = (sal_Unicode) 0x226B, - MS_SIM = (sal_Unicode) 0x007E, + MS_SIM = (sal_Unicode) 0x223C, MS_SIMEQ = (sal_Unicode) 0x2243, MS_APPROX = (sal_Unicode) 0x2248, MS_DEF = (sal_Unicode) 0x225D, MS_EQUIV = (sal_Unicode) 0x2261, MS_PROP = (sal_Unicode) 0x221D, MS_PARTIAL = (sal_Unicode) 0x2202, - MS_SUBSET = (sal_Unicode) 0x2282, + MS_SUBSET = (sal_Unicode) 0x2282, MS_SUPSET = (sal_Unicode) 0x2283, MS_SUBSETEQ = (sal_Unicode) 0x2286, MS_SUPSETEQ = (sal_Unicode) 0x2287, @@ -143,70 +132,69 @@ enum MathSymbol MS_LINE = (sal_Unicode) 0x2223, MS_DLINE = (sal_Unicode) 0x2225, MS_ORTHO = (sal_Unicode) 0x22A5, - MS_DOTSLOW = (sal_Unicode) 0xE08B, + MS_DOTSLOW = (sal_Unicode) 0x2026, MS_DOTSAXIS = (sal_Unicode) 0x22EF, MS_DOTSVERT = (sal_Unicode) 0x22EE, MS_DOTSUP = (sal_Unicode) 0x22F0, MS_DOTSDOWN = (sal_Unicode) 0x22F1, MS_TRANSR = (sal_Unicode) 0x22B6, MS_TRANSL = (sal_Unicode) 0x22B7, - MS_RIGHTARROW = (sal_Unicode) 0xE08C, MS_BACKSLASH = (sal_Unicode) 0x2216, MS_NEG = (sal_Unicode) 0x00AC, + MS_FORALL = (sal_Unicode) 0x2200, + MS_NABLA = (sal_Unicode) 0x2207, + MS_PROD = (sal_Unicode) 0x220F, + MS_COPROD = (sal_Unicode) 0x2210, + MS_SUM = (sal_Unicode) 0x2211, + MS_SQRT = (sal_Unicode) 0x221A, MS_INT = (sal_Unicode) 0x222B, MS_IINT = (sal_Unicode) 0x222C, MS_IIINT = (sal_Unicode) 0x222D, MS_LINT = (sal_Unicode) 0x222E, MS_LLINT = (sal_Unicode) 0x222F, MS_LLLINT = (sal_Unicode) 0x2230, - MS_SQRT = (sal_Unicode) 0xE08D, - MS_COPROD = (sal_Unicode) 0x2210, - MS_PROD = (sal_Unicode) 0x220F, - MS_SUM = (sal_Unicode) 0x2211, - MS_NABLA = (sal_Unicode) 0x2207, - MS_FORALL = (sal_Unicode) 0x2200, - MS_HAT = (sal_Unicode) 0xE091, - MS_CHECK = (sal_Unicode) 0xE092, - MS_BREVE = (sal_Unicode) 0xE093, - MS_ACUTE = (sal_Unicode) 0xE094, - MS_GRAVE = (sal_Unicode) 0xE095, - MS_TILDE = (sal_Unicode) 0xE096, - MS_BAR = (sal_Unicode) 0xE097, - MS_VEC = (sal_Unicode) 0xE098, + MS_GRAVE = (sal_Unicode) 0x0300, + MS_ACUTE = (sal_Unicode) 0x0301, + MS_HAT = (sal_Unicode) 0x0302, + MS_TILDE = (sal_Unicode) 0x0303, + MS_BAR = (sal_Unicode) 0x0304, + MS_BREVE = (sal_Unicode) 0x0306, + MS_CIRCLE = (sal_Unicode) 0x030A, + MS_CHECK = (sal_Unicode) 0x030C, + MS_VEC = (sal_Unicode) 0x20D7, MS_DOT = (sal_Unicode) 0x02D9, MS_DDOT = (sal_Unicode) 0x00A8, - MS_DDDOT = (sal_Unicode) 0xE09B, - MS_CIRCLE = (sal_Unicode) 0x02DA, + MS_DDDOT = (sal_Unicode) 0x20DB, MS_AND = (sal_Unicode) 0x2227, MS_OR = (sal_Unicode) 0x2228, MS_NI = (sal_Unicode) 0x220B, MS_EMPTYSET = (sal_Unicode) 0x2205, - MS_LBRACE = (sal_Unicode) 0x007B, - MS_RBRACE = (sal_Unicode) 0x007D, - MS_LPARENT = (sal_Unicode) 0xE09E, - MS_RPARENT = (sal_Unicode) 0xE09F, - MS_LANGLE = (sal_Unicode) 0x2329, - MS_RANGLE = (sal_Unicode) 0x232A, + MS_LPARENT = (sal_Unicode) 0x0028, + MS_RPARENT = (sal_Unicode) 0x0029, MS_LBRACKET = (sal_Unicode) 0x005B, MS_RBRACKET = (sal_Unicode) 0x005D, - - MS_LDBRACKET = (sal_Unicode) 0x301A, - MS_RDBRACKET = (sal_Unicode) 0x301B, - MS_PLACE = (sal_Unicode) 0xE0AA, - + MS_LBRACE = (sal_Unicode) 0x007B, + MS_RBRACE = (sal_Unicode) 0x007D, MS_LCEIL = (sal_Unicode) 0x2308, - MS_LFLOOR = (sal_Unicode) 0x230A, MS_RCEIL = (sal_Unicode) 0x2309, + MS_LFLOOR = (sal_Unicode) 0x230A, MS_RFLOOR = (sal_Unicode) 0x230B, + MS_LANGLE = (sal_Unicode) 0x2329, + MS_RANGLE = (sal_Unicode) 0x232A, + MS_LDBRACKET = (sal_Unicode) 0x27E6, + MS_RDBRACKET = (sal_Unicode) 0x27E7, + + MS_PLACE = (sal_Unicode) 0x2751, - MS_HBAR = (sal_Unicode) 0x210F, MS_LAMBDABAR = (sal_Unicode) 0x019B, - MS_LEFTARROW = (sal_Unicode) 0xE0DB, - MS_UPARROW = (sal_Unicode) 0xE0DC, - MS_DOWNARROW = (sal_Unicode) 0xE0DD, + MS_HBAR = (sal_Unicode) 0x210F, + MS_LEFTARROW = (sal_Unicode) 0x2190, + MS_UPARROW = (sal_Unicode) 0x2191, + MS_RIGHTARROW = (sal_Unicode) 0x2192, + MS_DOWNARROW = (sal_Unicode) 0x2193, MS_SETN = (sal_Unicode) 0x2115, MS_SETZ = (sal_Unicode) 0x2124, MS_SETQ = (sal_Unicode) 0x211A, diff --git a/starmath/inc/unomodel.hxx b/starmath/inc/unomodel.hxx index 3b53fe7e39..5cd53723dd 100644 --- a/starmath/inc/unomodel.hxx +++ b/starmath/inc/unomodel.hxx @@ -35,11 +35,30 @@ #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/view/XRenderable.hpp> + #include <sfx2/sfxbasemodel.hxx> #include <comphelper/propertysethelper.hxx> +#include <vcl/print.hxx> class SmFormat; +//////////////////////////////////////////////////////////// + +#define PRTUIOPT_TITLE_ROW "TitleRow" +#define PRTUIOPT_FORMULA_TEXT "FormulaText" +#define PRTUIOPT_BORDER "Border" +#define PRTUIOPT_PRINT_FORMAT "PrintFormat" +#define PRTUIOPT_PRINT_SCALE "PrintScale" + +class SmPrintUIOptions : public vcl::PrinterOptionsHelper +{ +public: + SmPrintUIOptions(); +}; + + +//////////////////////////////////////////////////////////// + #define A2OU(pText) rtl::OUString::createFromAscii(pText) //----------------------------------------------------------------------------- @@ -48,6 +67,7 @@ class SmModel : public SfxBaseModel, public com::sun::star::lang::XServiceInfo, public com::sun::star::view::XRenderable { + SmPrintUIOptions* m_pPrintUIOptions; protected: virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); @@ -86,4 +106,7 @@ public: static ::rtl::OUString getImplementationName_Static(); }; +//////////////////////////////////////////////////////////// + #endif + diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index 8ccc39fdd0..ef277013da 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -47,6 +47,7 @@ class DataChangedEvent; class SmClipboardChangeListener; class SmDocShell; class SmViewShell; +class SmPrintUIOptions; /**************************************************************************/ @@ -292,8 +293,8 @@ public: virtual void Execute( SfxRequest& rReq ); virtual void GetState(SfxItemSet &); - void Impl_Print( OutputDevice &rOutDev, const SmPrintSize ePrintSize, - Rectangle aOutRect, Point aZeroPoint ); + void Impl_Print( OutputDevice &rOutDev, const SmPrintUIOptions &rPrintUIOptions, + Rectangle aOutRect, Point aZeroPoint ); }; #endif diff --git a/starmath/sdi/makefile.mk b/starmath/sdi/makefile.mk index 768280af97..f868756f59 100644 --- a/starmath/sdi/makefile.mk +++ b/starmath/sdi/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -46,8 +46,12 @@ SVSDIINC=$(PRJ)$/inc SDI1NAME=$(TARGET) SVSDI1DEPEND= \ - $(SOLARINCDIR)$/svxslots.ilb \ - smath.sdi \ + $(SOLARINCXDIR)$/sfx2/sfx.sdi \ + $(SOLARINCXDIR)$/sfx2/sfxitems.sdi \ + $(SOLARINCXDIR)$/svx/svx.sdi \ + $(SOLARINCXDIR)$/svx/svxitems.sdi \ + $(SOLARINCXDIR)$/svx/xoitems.sdi \ + smath.sdi \ smslots.sdi \ $(SVSDIINC)$/starmath.hrc diff --git a/starmath/sdi/svxitems.sdi b/starmath/sdi/smitems.sdi index a071a52f83..a071a52f83 100644 --- a/starmath/sdi/svxitems.sdi +++ b/starmath/sdi/smitems.sdi diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi index d0ae79a7f5..88bd108bdd 100644 --- a/starmath/sdi/smslots.sdi +++ b/starmath/sdi/smslots.sdi @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -28,8 +28,6 @@ * ************************************************************************/ -import "svxslots.ilb" - module "312C4240-35E7-101C-B12A-04021C007002" "58216740-35E7-101C-B12A-04021C007002" @@ -39,9 +37,13 @@ StarMath SlotIdFile ( "starmath.hrc" ) SlotIdFile ( "sfx2/sfxsids.hrc" ) SlotIdFile ( "svx/svxids.hrc" ) - TypeLibFile ( "smslots.tlb" ) ] { + include "sfx2/sfxitems.sdi" + include "sfx2/sfx.sdi" + include "svx/svxitems.sdi" + include "svx/xoitems.sdi" + include "svx/svx.sdi" include "smath.sdi" interface StarMath [ @@ -59,7 +61,7 @@ shell SmModule import StarMath[Automation]; } -interface FormulaDocument : OfficeDocument +interface FormulaDocument [ uuid ( "815CBB20-2FC3-11CF-89CA-008029E4B0B1" ) ] @@ -149,13 +151,13 @@ interface FormulaDocument : OfficeDocument ] } -shell SmDocShell : SfxObjectShell +shell SmDocShell { import FormulaDocument[Automation]; } -interface FormulaView : View +interface FormulaView [ uuid ( "CE1A6C00-2FC3-11CF-89CA-008029E4B0B1" ) ] @@ -323,7 +325,7 @@ interface FormulaView : View ] } -shell SmViewShell : SfxViewShell +shell SmViewShell { import FormulaView[Automation]; } diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index 355a2baab2..ec5c005d68 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -51,7 +51,7 @@ #include <vcl/unohelp2.hxx> #include <tools/gen.hxx> #include <vos/mutex.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <svx/editobj.hxx> #include <svx/editdata.hxx> diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx index 335551aa5d..3c0c3fcc63 100644 --- a/starmath/source/accessibility.hxx +++ b/starmath/source/accessibility.hxx @@ -52,7 +52,7 @@ #include <cppuhelper/interfacecontainer.h> #include <cppuhelper/implbase5.hxx> #include <cppuhelper/implbase6.hxx> -#include <svtools/brdcst.hxx> +#include <svl/brdcst.hxx> #include <svx/editeng.hxx> #include <svx/unoedsrc.hxx> // SvxEditSource, SvxTextForwarder, SvxViewForwarder, SvxEditViewForwarder diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 9d34209aff..693fe32fa2 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -1279,6 +1279,8 @@ void SmMathConfig::SetShowFormulaCursor( BOOL bVal ) SetOtherIfNotEqual( pOther->bFormulaCursor, bVal ); } +void SmMathConfig::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& ) +{} ///////////////////////////////////////////////////////////////// diff --git a/starmath/source/cfgitem.hxx b/starmath/source/cfgitem.hxx index 7b5029f990..bc62a7a6d3 100644 --- a/starmath/source/cfgitem.hxx +++ b/starmath/source/cfgitem.hxx @@ -44,7 +44,7 @@ #include <tools/solar.h> #include <rtl/ustring.hxx> #include <unotools/configitem.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <vcl/timer.hxx> #include <symbol.hxx> @@ -174,7 +174,7 @@ public: virtual ~SmMathConfig(); // utl::ConfigItem - //virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames ); + virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames ); virtual void Commit(); // make some protected functions of utl::ConfigItem public diff --git a/starmath/source/config.cxx b/starmath/source/config.cxx index 1ebd6d65bf..3a8034f51f 100644 --- a/starmath/source/config.cxx +++ b/starmath/source/config.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,15 +32,15 @@ #include "precompiled_starmath.hxx" -#include <svtools/itemset.hxx> -#include <svtools/hint.hxx> -#include <svtools/smplhint.hxx> -#include <svtools/pathoptions.hxx> +#include <svl/itemset.hxx> +#include <svl/hint.hxx> +#include <svl/smplhint.hxx> +#include <unotools/pathoptions.hxx> #include <sfx2/sfxsids.hrc> -#include <svtools/eitem.hxx> -#include <svtools/itempool.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/itempool.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> #include <tools/stream.hxx> diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index fc67ff976b..fe16822b6e 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -34,9 +34,9 @@ #define SMDLL 1 #include "tools/rcid.h" -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> #include <sfx2/app.hxx> #include <vcl/msgbox.hxx> #include <svtools/ctrltool.hxx> diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 78d989081d..c7ea88fd0c 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,22 +55,22 @@ #include <sot/exchange.hxx> #include <sot/formats.hxx> #include <sot/storage.hxx> -#include <svtools/eitem.hxx> -#include <svtools/fstathelper.hxx> -#include <svtools/intitem.hxx> -#include <svtools/itempool.hxx> -#include <svtools/lingucfg.hxx> -#include <svtools/linguprops.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/ptitem.hxx> +#include <svl/eitem.hxx> +#include <svl/fstathelper.hxx> +#include <svl/intitem.hxx> +#include <svl/itempool.hxx> +#include <unotools/lingucfg.hxx> +#include <unotools/linguprops.hxx> +#include <unotools/pathoptions.hxx> +#include <svl/ptitem.hxx> #include <svtools/sfxecode.hxx> -#include <svtools/slstitm.hxx> -#include <svtools/smplhint.hxx> -#include <svtools/stritem.hxx> +#include <svl/slstitm.hxx> +#include <svl/smplhint.hxx> +#include <svl/stritem.hxx> #include <svtools/transfer.hxx> -#include <svtools/undo.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/whiter.hxx> +#include <svl/undo.hxx> +#include <svl/urihelper.hxx> +#include <svl/whiter.hxx> #include <svx/editeng.hxx> #include <svx/editstat.hxx> #include <svx/eeitem.hxx> @@ -111,17 +111,12 @@ using namespace ::com::sun::star::uno; static const char __FAR_DATA pStarMathDoc[] = "StarMathDocument"; - -/**************************************************************************/ -/* -** -** CLASS IMPLEMENTATION -** -**/ - #define SmDocShell #include "smslots.hxx" +//////////////////////////////////////////////////////////// + + TYPEINIT1( SmDocShell, SfxObjectShell ); SFX_IMPL_INTERFACE(SmDocShell, SfxObjectShell, SmResId(0)) @@ -823,7 +818,7 @@ BOOL SmDocShell::Load( SfxMedium& rMedium ) xStorage->isStreamElement( C2S( "content.xml" ) ) ) || ( - xAccess->hasByName( C2S( "Content.xml" ) ) && + xAccess->hasByName( C2S( "Content.xml" ) ) && xStorage->isStreamElement( C2S( "Content.xml" ) ) ) ) diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 0e4542b96e..6e9a1827f3 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -52,13 +52,13 @@ #include <svx/editstat.hxx> #include <svx/eeitem.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/intitem.hxx> -#include <svtools/itempool.hxx> -#include <svtools/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/itempool.hxx> +#include <svl/stritem.hxx> #include <svx/fhgtitem.hxx> #include <svx/wghtitem.hxx> #include <svx/lrspitem.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <svx/fontitem.hxx> #include <sfx2/viewfrm.hxx> diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx index 11309efb98..c187a9e65b 100644 --- a/starmath/source/format.cxx +++ b/starmath/source/format.cxx @@ -49,7 +49,7 @@ static const USHORT aLatinDefFnts[FNT_END] = DEFAULTFONT_SERIF, // FNT_SERIF DEFAULTFONT_SANS, // FNT_SANS DEFAULTFONT_FIXED // FNT_FIXED - //StarSymbol, // FNT_MATH + //OpenSymbol, // FNT_MATH }; // CJK default-fonts @@ -65,7 +65,7 @@ static const USHORT aCJKDefFnts[FNT_END] = DEFAULTFONT_CJK_TEXT, // FNT_SERIF DEFAULTFONT_CJK_DISPLAY, // FNT_SANS DEFAULTFONT_CJK_TEXT // FNT_FIXED - //StarSymbol, // FNT_MATH + //OpenSymbol, // FNT_MATH }; // CTL default-fonts @@ -78,7 +78,7 @@ static const USHORT aCTLDefFnts[FNT_END] = DEFAULTFONT_CTL_TEXT, // FNT_SERIF DEFAULTFONT_CTL_TEXT, // FNT_SANS DEFAULTFONT_CTL_TEXT // FNT_FIXED - //StarSymbol, // FNT_MATH + //OpenSymbol, // FNT_MATH }; diff --git a/starmath/source/math_pch.cxx b/starmath/source/math_pch.cxx index 89d129b81c..7a58e8aa62 100644 --- a/starmath/source/math_pch.cxx +++ b/starmath/source/math_pch.cxx @@ -48,11 +48,11 @@ #include <tools/rtti.hxx> #include <tools/ref.hxx> #include <tools/link.hxx> -#include <svtools/brdcst.hxx> -#include <svtools/svarray.hxx> +#include <svl/brdcst.hxx> +#include <svl/svarray.hxx> #include <tools/debug.hxx> -#include <svtools/hint.hxx> -#include <svtools/smplhint.hxx> +#include <svl/hint.hxx> +#include <svl/smplhint.hxx> #include <sot/sotref.hxx> #include <tools/globname.hxx> #include <sot/factory.hxx> @@ -130,9 +130,9 @@ #include <smdll.hxx> #include <sfx2/sfxsids.hrc> #include <chaos/cntids.hrc> -#include <svtools/cntwids.hrc> -#include <svtools/solar.hrc> -#include <svtools/lstner.hxx> +#include <svl/cntwids.hrc> +#include <svl/solar.hrc> +#include <svl/lstner.hxx> #include <starmath.hrc> #include <basic/sbx.hxx> #include <basic/sbxform.hxx> @@ -143,7 +143,7 @@ #include <basic/sbxmeth.hxx> #include <tools/unqid.hxx> #include <tools/unqidx.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <svtools/args.hxx> #include <smmod.hxx> #include <vos/thread.hxx> @@ -156,7 +156,7 @@ #include <vcl/timer.hxx> #include <sfx2/app.hxx> #include <sfx2/sfx.hrc> -#include <svtools/memberid.hrc> +#include <svl/memberid.hrc> #include <vcl/syswin.hxx> #include <vcl/virdev.hxx> #include <tools/datetime.hxx> @@ -736,7 +736,7 @@ #endif #include <usr/refl.hxx> #include <sfx2/msg.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <sfx2/basedlgs.hxx> #include <vcl/floatwin.hxx> #include <vcl/dialog.hxx> @@ -745,10 +745,10 @@ #include <sfx2/frame.hxx> #include <sfx2/objface.hxx> #include <vcl/event.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> #include <symbol.hxx> -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> #include <vcl/image.hxx> #include <vcl/metric.hxx> #include <sfx2/inimgr.hxx> @@ -756,14 +756,14 @@ #include <tools/pstm.hxx> #include <tools/table.hxx> #include <sfx2/docfac.hxx> -#include <svtools/ownlist.hxx> +#include <svl/ownlist.hxx> #include <sfx2/objsh.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <vcl/mapmod.hxx> #include <sfx2/ipfrm.hxx> #include <vcl/dialog.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <sfx2/bindings.hxx> #include <dialog.hxx> #include <vcl/button.hxx> @@ -822,9 +822,9 @@ #include <vcl/toolbox.hxx> #include <vcl/dockwin.hxx> #include <smslots.hxx> -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #include <sfx2/request.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <vcl/prntypes.hxx> #include <vcl/jobset.hxx> #include <vcl/gdimtf.hxx> diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 9ddabab9c3..c9b12abcdb 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -1,7 +1,7 @@ /*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -61,9 +61,9 @@ #include <tools/debug.hxx>
#include <tools/urlobj.hxx>
#include <svtools/sfxecode.hxx>
-#include <svtools/saveopt.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/itemprop.hxx>
+#include <unotools/saveopt.hxx>
+#include <svl/stritem.hxx>
+#include <svl/itemprop.hxx>
#include <unotools/processfactory.hxx>
#include <unotools/streamwrap.hxx>
#include <xmloff/xmlnmspe.hxx>
@@ -403,8 +403,8 @@ SmXMLExport::SmXMLExport( {
}
-sal_Int64 SAL_CALL SmXMLExport::getSomething(
- const uno::Sequence< sal_Int8 >& rId )
+sal_Int64 SAL_CALL SmXMLExport::getSomething(
+ const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
if ( rId.getLength() == 16 &&
@@ -833,7 +833,7 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel) if (nSize >= 1 && pNode->GetSubNode(nSize-1)->GetNumSubNodes() == 0)
--nSize;
- // try to avoid creating a mtable element when the formula consists only
+ // try to avoid creating a mtable element when the formula consists only
// of a single output line
if (nLevel || (nSize >1))
pTable = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MTABLE, sal_True, sal_True);
@@ -902,7 +902,7 @@ void SmXMLExport::ExportText(const SmNode *pNode, int /*nLevel*/) void SmXMLExport::ExportBlank(const SmNode * /*pNode*/, int /*nLevel*/)
{
- //!! exports an empty <mi> tag since for example "~_~" is allowed in
+ //!! exports an empty <mi> tag since for example "~_~" is allowed in
//!! Math (so it has no sense at all) but must not result in an empty
//!! <msub> tag in MathML !!
@@ -910,7 +910,7 @@ void SmXMLExport::ExportBlank(const SmNode * /*pNode*/, int /*nLevel*/) //const SmBlankNode *pTemp = static_cast<const SmBlankNode *>(pNode);
pText = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MI, sal_True, sal_False);
-
+
GetDocHandler()->characters( OUString() );
delete pText;
}
@@ -1203,10 +1203,10 @@ void SmXMLExport::ExportAttributes(const SmNode *pNode, int nLevel) static bool lcl_HasEffectOnMathvariant( const SmTokenType eType )
{
- return eType == TBOLD || eType == TNBOLD ||
+ return eType == TBOLD || eType == TNBOLD ||
eType == TITALIC || eType == TNBOLD ||
eType == TSANS || eType == TSERIF || eType == TFIXED;
-}
+}
void SmXMLExport::ExportFont(const SmNode *pNode, int nLevel)
{
@@ -1480,7 +1480,7 @@ void SmXMLExport::ExportNodes(const SmNode *pNode, int nLevel) // thus at least it will not vanish into nothing
ExportText(pNode, nLevel);
}
- else
+ else
{
//To fully handle generic MathML we need to implement the full
//operator dictionary, we will generate MathML with explicit
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index 1f7336db6d..56b35a96c6 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -1,3189 +1,3190 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: x $
- * $Revision: 1.00 $
- *
- * 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_starmath.hxx"
-
-/*todo: Change characters and tcharacters to accumulate the characters together
-into one string, xml parser hands them to us line by line rather than all in
-one go*/
-
-#include <com/sun/star/xml/sax/XErrorHandler.hpp>
-#include <com/sun/star/xml/sax/XEntityResolver.hpp>
-#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <com/sun/star/xml/sax/XDTDHandler.hpp>
-#include <com/sun/star/xml/sax/XParser.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/io/XActiveDataControl.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/packages/zip/ZipIOException.hpp>
-#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/uno/Any.h>
-
-#include <rtl/math.hxx>
-#include <sfx2/frame.hxx>
-#include <sfx2/docfile.hxx>
-#include <tools/debug.hxx>
-#include <tools/urlobj.hxx>
-#include <svtools/sfxecode.hxx>
-#include <svtools/saveopt.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/itemprop.hxx>
-#include <unotools/processfactory.hxx>
-#include <unotools/streamwrap.hxx>
-#include <xmloff/xmlnmspe.hxx>
-#include <xmloff/xmltoken.hxx>
-#include <xmloff/nmspmap.hxx>
-#include <xmloff/attrlist.hxx>
-#include <xmloff/xmluconv.hxx>
-#include <xmloff/xmlmetai.hxx>
-#include <osl/mutex.hxx>
-#include <comphelper/genericpropertyset.hxx>
-
-#include <memory>
-
-#include "mathmlimport.hxx"
-#include "mathtype.hxx"
-#include <starmath.hrc>
-#include <unomodel.hxx>
-#include <document.hxx>
-#include <utility.hxx>
-
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star;
-using namespace ::xmloff::token;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
-#define IMPORT_SVC_NAME RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.XMLImportFilter")
-
-#undef WANTEXCEPT
-
-////////////////////////////////////////////////////////////
-
-ULONG SmXMLImportWrapper::Import(SfxMedium &rMedium)
-{
- ULONG nError = ERRCODE_SFX_DOLOADFAILED;
-
- uno::Reference<lang::XMultiServiceFactory> xServiceFactory(
- utl::getProcessServiceFactory());
- DBG_ASSERT(xServiceFactory.is(), "XMLReader::Read: got no service manager");
- if ( !xServiceFactory.is() )
- return nError;
-
- //Make a model component from our SmModel
- uno::Reference< lang::XComponent > xModelComp( xModel, uno::UNO_QUERY );
- DBG_ASSERT( xModelComp.is(), "XMLReader::Read: got no model" );
-
- // try to get an XStatusIndicator from the Medium
- uno::Reference<task::XStatusIndicator> xStatusIndicator;
-
- sal_Bool bEmbedded = sal_False;
- uno::Reference <lang::XUnoTunnel> xTunnel;
- xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
- SmModel *pModel = reinterpret_cast<SmModel *>
- (xTunnel->getSomething(SmModel::getUnoTunnelId()));
-
- SmDocShell *pDocShell = pModel ?
- static_cast<SmDocShell*>(pModel->GetObjectShell()) : 0;
- if (pDocShell)
- {
-// if (pDocShell->GetMedium())
- {
- DBG_ASSERT( pDocShell->GetMedium() == &rMedium,
- "different SfxMedium found" );
-
- SfxItemSet* pSet = rMedium.GetItemSet();
- if (pSet)
- {
- const SfxUnoAnyItem* pItem = static_cast<const SfxUnoAnyItem*>(
- pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) );
- if (pItem)
- pItem->GetValue() >>= xStatusIndicator;
- }
- }
-
- if ( SFX_CREATE_MODE_EMBEDDED == pDocShell->GetCreateMode() )
- bEmbedded = sal_True;
- }
-
- comphelper::PropertyMapEntry aInfoMap[] =
- {
- { "PrivateData", sizeof("PrivateData")-1, 0,
- &::getCppuType( (Reference<XInterface> *)0 ),
- beans::PropertyAttribute::MAYBEVOID, 0 },
- { "BaseURI", sizeof("BaseURI")-1, 0,
- &::getCppuType( (OUString *)0 ),
- beans::PropertyAttribute::MAYBEVOID, 0 },
- { "StreamRelPath", sizeof("StreamRelPath")-1, 0,
- &::getCppuType( (OUString *)0 ),
- beans::PropertyAttribute::MAYBEVOID, 0 },
- { "StreamName", sizeof("StreamName")-1, 0,
- &::getCppuType( (OUString *)0 ),
- beans::PropertyAttribute::MAYBEVOID, 0 },
- { NULL, 0, 0, NULL, 0, 0 }
- };
- uno::Reference< beans::XPropertySet > xInfoSet(
- comphelper::GenericPropertySet_CreateInstance(
- new comphelper::PropertySetInfo( aInfoMap ) ) );
-
- // Set base URI
- OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI") );
- xInfoSet->setPropertyValue( sPropName, makeAny( rMedium.GetBaseURL() ) );
-
- sal_Int32 nSteps=3;
- if ( !(rMedium.IsStorage()))
- nSteps = 1;
-
- sal_Int32 nProgressRange(nSteps);
- if (xStatusIndicator.is())
- {
- xStatusIndicator->start(String(SmResId(STR_STATSTR_READING)),
- nProgressRange);
- }
-
- nSteps=0;
- if (xStatusIndicator.is())
- xStatusIndicator->setValue(nSteps++);
-
- if ( rMedium.IsStorage())
- {
- // TODO/LATER: handle the case of embedded links gracefully
- if ( bEmbedded ) // && !rMedium.GetStorage()->IsRoot() )
- {
- OUString aName( RTL_CONSTASCII_USTRINGPARAM( "dummyObjName" ) );
- if ( rMedium.GetItemSet() )
- {
- const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>(
- rMedium.GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) );
- if ( pDocHierarchItem )
- aName = pDocHierarchItem->GetValue();
- }
-
- if ( aName.getLength() )
- {
- sPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath"));
- xInfoSet->setPropertyValue( sPropName, makeAny( aName ) );
- }
- }
-
- sal_Bool bOASIS = ( SotStorage::GetVersion( rMedium.GetStorage() ) > SOFFICE_FILEFORMAT_60 );
- if (xStatusIndicator.is())
- xStatusIndicator->setValue(nSteps++);
-
- ULONG nWarn = ReadThroughComponent(
- rMedium.GetStorage(), xModelComp, "meta.xml", "Meta.xml",
- xServiceFactory, xInfoSet,
- (bOASIS ? "com.sun.star.comp.Math.XMLOasisMetaImporter"
- : "com.sun.star.comp.Math.XMLMetaImporter") );
-
- if ( nWarn != ERRCODE_IO_BROKENPACKAGE )
- {
- if (xStatusIndicator.is())
- xStatusIndicator->setValue(nSteps++);
-
- nWarn = ReadThroughComponent(
- rMedium.GetStorage(), xModelComp, "settings.xml", 0,
- xServiceFactory, xInfoSet,
- (bOASIS ? "com.sun.star.comp.Math.XMLOasisSettingsImporter"
- : "com.sun.star.comp.Math.XMLSettingsImporter" ) );
-
- if ( nWarn != ERRCODE_IO_BROKENPACKAGE )
- {
- if (xStatusIndicator.is())
- xStatusIndicator->setValue(nSteps++);
-
- nError = ReadThroughComponent(
- rMedium.GetStorage(), xModelComp, "content.xml", "Content.xml",
- xServiceFactory, xInfoSet, "com.sun.star.comp.Math.XMLImporter" );
- }
- else
- nError = ERRCODE_IO_BROKENPACKAGE;
- }
- else
- nError = ERRCODE_IO_BROKENPACKAGE;
- }
- else
- {
- Reference<io::XInputStream> xInputStream =
- new utl::OInputStreamWrapper(rMedium.GetInStream());
-
- if (xStatusIndicator.is())
- xStatusIndicator->setValue(nSteps++);
-
- nError = ReadThroughComponent( xInputStream, xModelComp,
- xServiceFactory, xInfoSet, "com.sun.star.comp.Math.XMLImporter", FALSE );
- }
-
- if (xStatusIndicator.is())
- xStatusIndicator->end();
- return nError;
-}
-
-
-/// read a component (file + filter version)
-ULONG SmXMLImportWrapper::ReadThroughComponent(
- Reference<io::XInputStream> xInputStream,
- Reference<XComponent> xModelComponent,
- Reference<lang::XMultiServiceFactory> & rFactory,
- Reference<beans::XPropertySet> & rPropSet,
- const sal_Char* pFilterName,
- sal_Bool bEncrypted )
-{
- ULONG nError = ERRCODE_SFX_DOLOADFAILED;
- DBG_ASSERT(xInputStream.is(), "input stream missing");
- DBG_ASSERT(xModelComponent.is(), "document missing");
- DBG_ASSERT(rFactory.is(), "factory missing");
- DBG_ASSERT(NULL != pFilterName,"I need a service name for the component!");
-
- // prepare ParserInputSrouce
- xml::sax::InputSource aParserInput;
- aParserInput.aInputStream = xInputStream;
-
- // get parser
- Reference< xml::sax::XParser > xParser(
- rFactory->createInstance(
- OUString::createFromAscii("com.sun.star.xml.sax.Parser") ),
- UNO_QUERY );
- DBG_ASSERT( xParser.is(), "Can't create parser" );
- if ( !xParser.is() )
- return nError;
-
- Sequence<Any> aArgs( 1 );
- aArgs[0] <<= rPropSet;
-
- // get filter
- Reference< xml::sax::XDocumentHandler > xFilter(
- rFactory->createInstanceWithArguments(
- OUString::createFromAscii(pFilterName), aArgs ),
- UNO_QUERY );
- DBG_ASSERT( xFilter.is(), "Can't instantiate filter component." );
- if ( !xFilter.is() )
- return nError;
-
- // connect parser and filter
- xParser->setDocumentHandler( xFilter );
-
- // connect model and filter
- Reference < XImporter > xImporter( xFilter, UNO_QUERY );
- xImporter->setTargetDocument( xModelComponent );
-
- // finally, parser the stream
- try
- {
- xParser->parseStream( aParserInput );
-
- uno::Reference<lang::XUnoTunnel> xFilterTunnel;
- xFilterTunnel = uno::Reference<lang::XUnoTunnel>
- ( xFilter, uno::UNO_QUERY );
- SmXMLImport *pFilter = reinterpret_cast< SmXMLImport * >(
- sal::static_int_cast< sal_uIntPtr >(
- xFilterTunnel->getSomething( SmXMLImport::getUnoTunnelId() )));
- if ( pFilter && pFilter->GetSuccess() )
- nError = 0;
- }
- catch( xml::sax::SAXParseException& r )
- {
- // sax parser sends wrapped exceptions,
- // try to find the original one
- xml::sax::SAXException aSaxEx = *(xml::sax::SAXException*)(&r);
- sal_Bool bTryChild = sal_True;
-
- while( bTryChild )
- {
- xml::sax::SAXException aTmp;
- if ( aSaxEx.WrappedException >>= aTmp )
- aSaxEx = aTmp;
- else
- bTryChild = sal_False;
- }
-
- packages::zip::ZipIOException aBrokenPackage;
- if ( aSaxEx.WrappedException >>= aBrokenPackage )
- return ERRCODE_IO_BROKENPACKAGE;
-
- if ( bEncrypted )
- nError = ERRCODE_SFX_WRONGPASSWORD;
- }
- catch( xml::sax::SAXException& r )
- {
- packages::zip::ZipIOException aBrokenPackage;
- if ( r.WrappedException >>= aBrokenPackage )
- return ERRCODE_IO_BROKENPACKAGE;
-
- if ( bEncrypted )
- nError = ERRCODE_SFX_WRONGPASSWORD;
- }
- catch( packages::zip::ZipIOException& )
- {
- nError = ERRCODE_IO_BROKENPACKAGE;
- }
- catch( io::IOException& )
- {
- }
-
- return nError;
-}
-
-
-ULONG SmXMLImportWrapper::ReadThroughComponent(
- const uno::Reference< embed::XStorage >& xStorage,
- Reference<XComponent> xModelComponent,
- const sal_Char* pStreamName,
- const sal_Char* pCompatibilityStreamName,
- Reference<lang::XMultiServiceFactory> & rFactory,
- Reference<beans::XPropertySet> & rPropSet,
- const sal_Char* pFilterName )
-{
- DBG_ASSERT(xStorage.is(), "Need storage!");
- DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!");
-
- // open stream (and set parser input)
- OUString sStreamName = OUString::createFromAscii(pStreamName);
- uno::Reference < container::XNameAccess > xAccess( xStorage, uno::UNO_QUERY );
- if ( !xAccess->hasByName(sStreamName) || !xStorage->isStreamElement(sStreamName) )
- {
- // stream name not found! Then try the compatibility name.
- // do we even have an alternative name?
- if ( pCompatibilityStreamName )
- sStreamName = OUString::createFromAscii(pCompatibilityStreamName);
- }
-
- // get input stream
- try
- {
- uno::Reference < io::XStream > xEventsStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
-
- // determine if stream is encrypted or not
- uno::Reference < beans::XPropertySet > xProps( xEventsStream, uno::UNO_QUERY );
- Any aAny = xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ) );
- sal_Bool bEncrypted = sal_False;
- if ( aAny.getValueType() == ::getBooleanCppuType() )
- aAny >>= bEncrypted;
-
- // set Base URL
- if ( rPropSet.is() )
- {
- OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") );
- rPropSet->setPropertyValue( sPropName, makeAny( sStreamName ) );
- }
-
-
- Reference < io::XInputStream > xStream = xEventsStream->getInputStream();
- return ReadThroughComponent( xStream, xModelComponent, rFactory, rPropSet, pFilterName, bEncrypted );
- }
- catch ( packages::WrongPasswordException& )
- {
- return ERRCODE_SFX_WRONGPASSWORD;
- }
- catch( packages::zip::ZipIOException& )
- {
- return ERRCODE_IO_BROKENPACKAGE;
- }
- catch ( uno::Exception& )
- {
- }
-
- return ERRCODE_SFX_DOLOADFAILED;
-}
-
-////////////////////////////////////////////////////////////
-
-SmXMLImport::SmXMLImport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
- sal_uInt16 nImportFlags)
-: SvXMLImport( xServiceFactory, nImportFlags ),
- pPresLayoutElemTokenMap(0),
- pPresLayoutAttrTokenMap(0),
- pFencedAttrTokenMap(0),
- pOperatorAttrTokenMap(0),
- pAnnotationAttrTokenMap(0),
- pPresElemTokenMap(0),
- pPresScriptEmptyElemTokenMap(0),
- pPresTableElemTokenMap(0),
- pColorTokenMap(0),
- bSuccess(sal_False)
-{
-}
-
-const uno::Sequence< sal_Int8 > & SmXMLImport::getUnoTunnelId() throw()
-{
- static uno::Sequence< sal_Int8 > * pSeq = 0;
- if ( !pSeq )
- {
- osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
- if ( !pSeq )
- {
- static uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
-}
-
-OUString SAL_CALL SmXMLImport_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLImporter" ) );
-}
-
-uno::Sequence< OUString > SAL_CALL SmXMLImport_getSupportedServiceNames()
- throw()
-{
- const OUString aServiceName( IMPORT_SVC_NAME );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SmXMLImport_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
- throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SmXMLImport(IMPORT_ALL);
- return (cppu::OWeakObject*)new SmXMLImport(rSMgr, IMPORT_ALL);
-}
-
-////////////////////////////////////////////////////////////
-
-OUString SAL_CALL SmXMLImportMeta_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLOasisMetaImporter" ) );
-}
-
-uno::Sequence< OUString > SAL_CALL SmXMLImportMeta_getSupportedServiceNames()
-throw()
-{
- const OUString aServiceName( IMPORT_SVC_NAME );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SmXMLImportMeta_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
-throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SmXMLImport( IMPORT_META );
- return (cppu::OWeakObject*)new SmXMLImport( rSMgr, IMPORT_META );
-}
-
-////////////////////////////////////////////////////////////
-
-OUString SAL_CALL SmXMLImportSettings_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLOasisSettingsImporter" ) );
-}
-
-uno::Sequence< OUString > SAL_CALL SmXMLImportSettings_getSupportedServiceNames()
- throw()
-{
- const OUString aServiceName( IMPORT_SVC_NAME );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SmXMLImportSettings_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
- throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SmXMLImport( IMPORT_SETTINGS );
- return (cppu::OWeakObject*)new SmXMLImport( rSMgr, IMPORT_SETTINGS );
-}
-
-////////////////////////////////////////////////////////////
-
-// XServiceInfo
-// override empty method from parent class
-rtl::OUString SAL_CALL SmXMLImport::getImplementationName()
- throw(uno::RuntimeException)
-{
- OUString aTxt;
- switch( getImportFlags() )
- {
- case IMPORT_META:
- aTxt = SmXMLImportMeta_getImplementationName();
- break;
- case IMPORT_SETTINGS:
- aTxt = SmXMLImportSettings_getImplementationName();
- break;
- case IMPORT_ALL:
- default:
- aTxt = SmXMLImport_getImplementationName();
- break;
- }
- return aTxt;
-}
-
-
-sal_Int64 SAL_CALL SmXMLImport::getSomething(
- const uno::Sequence< sal_Int8 >&rId )
-throw(uno::RuntimeException)
-{
- if ( rId.getLength() == 16 &&
- 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
- return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_uIntPtr >(this));
-
- return SvXMLImport::getSomething( rId );
-}
-
-void SmXMLImport::endDocument(void)
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
- //Set the resulted tree into the SmDocShell where it belongs
- SmNode *pTree;
- if (NULL != (pTree = GetTree()))
- {
- uno::Reference <frame::XModel> xModel = GetModel();
- uno::Reference <lang::XUnoTunnel> xTunnel;
- xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
- SmModel *pModel = reinterpret_cast<SmModel *>
- (xTunnel->getSomething(SmModel::getUnoTunnelId()));
-
- if (pModel)
- {
- SmDocShell *pDocShell =
- static_cast<SmDocShell*>(pModel->GetObjectShell());
- pDocShell->SetFormulaTree(pTree);
- if (0 == aText.Len()) //If we picked up no annotation text
- {
- //Make up some editable text
- aText = pDocShell->GetText();
- pTree->CreateTextFromNode(aText);
- aText.EraseTrailingChars();
- if ((aText.GetChar(0) == '{') &&
- (aText.GetChar(aText.Len()-1) == '}'))
- {
- aText.Erase(0,1);
- aText.Erase(aText.Len()-1,1);
- }
- }
- pDocShell->SetText( String() );
-
- // Convert symbol names
- SmParser &rParser = pDocShell->GetParser();
- BOOL bVal = rParser.IsImportSymbolNames();
- rParser.SetImportSymbolNames( TRUE );
- SmNode *pTmpTree = rParser.Parse( aText );
- aText = rParser.GetText();
- delete pTmpTree;
- rParser.SetImportSymbolNames( bVal );
-
- pDocShell->SetText( aText );
- }
- DBG_ASSERT(pModel,"So there *was* a uno problem after all");
-
- bSuccess = sal_True;
- }
-
- SvXMLImport::endDocument();
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLImportContext: public SvXMLImportContext
-{
-public:
- SmXMLImportContext( SmXMLImport &rImport, sal_uInt16 nPrfx,
- const OUString& rLName)
- : SvXMLImportContext(rImport, nPrfx, rLName) {}
-
- const SmXMLImport& GetSmImport() const
- {
- return (const SmXMLImport&)GetImport();
- }
-
- SmXMLImport& GetSmImport()
- {
- return (SmXMLImport&)GetImport();
- }
-
- virtual void TCharacters(const OUString & /*rChars*/);
- virtual void Characters(const OUString &rChars);
- virtual SvXMLImportContext *CreateChildContext(sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/, const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/);
-};
-
-void SmXMLImportContext::TCharacters(const OUString & /*rChars*/)
-{
-}
-
-void SmXMLImportContext::Characters(const OUString &rChars)
-{
- /*
- Whitespace occurring within the content of token elements is "trimmed"
- from the ends (i.e. all whitespace at the beginning and end of the
- content is removed), and "collapsed" internally (i.e. each sequence of
- 1 or more whitespace characters is replaced with one blank character).
- */
- //collapsing not done yet!
- const OUString &rChars2 = rChars.trim();
- if (rChars2.getLength())
- TCharacters(rChars2/*.collapse()*/);
-}
-
-SvXMLImportContext * SmXMLImportContext::CreateChildContext(sal_uInt16 /*nPrefix*/,
- const OUString& /*rLocalName*/,
- const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/)
-{
- return 0;
-}
-
-////////////////////////////////////////////////////////////
-
-struct SmXMLContext_Helper
-{
- sal_Int8 nIsBold;
- sal_Int8 nIsItalic;
- double nFontSize;
- sal_Bool bFontNodeNeeded;
- OUString sFontFamily;
- OUString sColor;
-
- SmXMLImportContext rContext;
-
- SmXMLContext_Helper(SmXMLImportContext &rImport) :
- nIsBold(-1), nIsItalic(-1), nFontSize(0.0), rContext(rImport) {}
-
- void RetrieveAttrs(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
- void ApplyAttrs();
-};
-
-void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- sal_Int8 nOldIsBold=nIsBold;
- sal_Int8 nOldIsItalic=nIsItalic;
- double nOldFontSize=nFontSize;
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- OUString sOldFontFamily = sFontFamily;
- for (sal_Int16 i=0;i<nAttrCount;i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = rContext.GetSmImport().GetNamespaceMap().
- GetKeyByAttrName(sAttrName,&aLocalName);
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap &rAttrTokenMap =
- rContext.GetSmImport().GetPresLayoutAttrTokenMap();
- switch(rAttrTokenMap.Get(nPrefix,aLocalName))
- {
- case XML_TOK_FONTWEIGHT:
- nIsBold = sValue.equals(GetXMLToken(XML_BOLD));
- break;
- case XML_TOK_FONTSTYLE:
- nIsItalic = sValue.equals(GetXMLToken(XML_ITALIC));
- break;
- case XML_TOK_FONTSIZE:
- SvXMLUnitConverter::convertDouble(nFontSize,sValue);
- rContext.GetSmImport().GetMM100UnitConverter().
- setXMLMeasureUnit(MAP_POINT);
- if (-1 == sValue.indexOf(GetXMLToken(XML_UNIT_PT)))
- {
- if (-1 == sValue.indexOf('%'))
- nFontSize=0.0;
- else
- {
- rContext.GetSmImport().GetMM100UnitConverter().
- setXMLMeasureUnit(MAP_RELATIVE);
- }
- }
- break;
- case XML_TOK_FONTFAMILY:
- sFontFamily = sValue;
- break;
- case XML_TOK_COLOR:
- sColor = sValue;
- break;
- default:
- break;
- }
- }
-
- if ((nOldIsBold!=nIsBold) || (nOldIsItalic!=nIsItalic) ||
- (nOldFontSize!=nFontSize) || (sOldFontFamily!=sFontFamily)
- || sColor.getLength())
- bFontNodeNeeded=sal_True;
- else
- bFontNodeNeeded=sal_False;
-}
-
-void SmXMLContext_Helper::ApplyAttrs()
-{
- SmNodeStack &rNodeStack = rContext.GetSmImport().GetNodeStack();
-
- if (bFontNodeNeeded)
- {
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
-
- if (nIsBold != -1)
- {
- if (nIsBold)
- aToken.eType = TBOLD;
- else
- aToken.eType = TNBOLD;
- SmStructureNode *pFontNode = static_cast<SmStructureNode *>
- (new SmFontNode(aToken));
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (nIsItalic != -1)
- {
- if (nIsItalic)
- aToken.eType = TITALIC;
- else
- aToken.eType = TNITALIC;
- SmStructureNode *pFontNode = static_cast<SmStructureNode *>
- (new SmFontNode(aToken));
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (nFontSize != 0.0)
- {
- aToken.eType = TSIZE;
- SmFontNode *pFontNode = new SmFontNode(aToken);
-
- if (MAP_RELATIVE == rContext.GetSmImport().GetMM100UnitConverter().
- getXMLMeasureUnit())
- {
- if (nFontSize < 100.00)
- pFontNode->SetSizeParameter(Fraction(100.00/nFontSize),
- FNTSIZ_DIVIDE);
- else
- pFontNode->SetSizeParameter(Fraction(nFontSize/100.00),
- FNTSIZ_MULTIPLY);
- }
- else
- pFontNode->SetSizeParameter(Fraction(nFontSize),FNTSIZ_ABSOLUT);
-
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (sFontFamily.getLength())
- {
- if (sFontFamily.equalsIgnoreAsciiCase(GetXMLToken(XML_FIXED)))
- aToken.eType = TFIXED;
- else if (sFontFamily.equalsIgnoreAsciiCase(OUString(
- RTL_CONSTASCII_USTRINGPARAM("sans"))))
- aToken.eType = TSANS;
- else if (sFontFamily.equalsIgnoreAsciiCase(OUString(
- RTL_CONSTASCII_USTRINGPARAM("serif"))))
- aToken.eType = TSERIF;
- else //Just give up, we need to extend our font mechanism to be
- //more general
- return;
-
- aToken.aText = sFontFamily;
- SmFontNode *pFontNode = new SmFontNode(aToken);
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (sColor.getLength())
- {
- //Again we can only handle a small set of colours in
- //StarMath for now.
- const SvXMLTokenMap& rTokenMap =
- rContext.GetSmImport().GetColorTokenMap();
- aToken.eType = static_cast<SmTokenType>(rTokenMap.Get(
- XML_NAMESPACE_MATH, sColor));
- if (aToken.eType != -1)
- {
- SmFontNode *pFontNode = new SmFontNode(aToken);
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- }
-
- }
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLDocContext_Impl : public SmXMLImportContext
-{
-public:
- SmXMLDocContext_Impl( SmXMLImport &rImport, sal_uInt16 nPrfx,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrfx,rLName) {}
-
- virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-/*avert thy gaze from the proginator*/
-class SmXMLRowContext_Impl : public SmXMLDocContext_Impl
-{
-protected:
- ULONG nElementCount;
-
-public:
- SmXMLRowContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLDocContext_Impl(rImport,nPrefix,rLName)
- { nElementCount = GetSmImport().GetNodeStack().Count(); }
-
- virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-
- SvXMLImportContext *StrictCreateChildContext(sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLFracContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLFracContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLSqrtContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLSqrtContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLRootContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLRootContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLStyleContext_Impl : public SmXMLRowContext_Impl
-{
-protected:
- SmXMLContext_Helper aStyleHelper;
-
-public:
- /*Right now the style tag is completely ignored*/
- SmXMLStyleContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) : SmXMLRowContext_Impl(rImport,nPrefix,rLName),
- aStyleHelper(*this) {}
-
- void EndElement();
- void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
-};
-
-void SmXMLStyleContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
-#if 1
- aStyleHelper.RetrieveAttrs(xAttrList);
-#else
- sal_Int8 nOldIsBold=nIsBold;
- sal_Int8 nOldIsItalic=nIsItalic;
- double nOldFontSize=nFontSize;
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- OUString sOldFontFamily = sFontFamily;
- for (sal_Int16 i=0;i<nAttrCount;i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName(sAttrName,&aLocalName);
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap &rAttrTokenMap =
- GetSmImport().GetPresLayoutAttrTokenMap();
- switch(rAttrTokenMap.Get(nPrefix,aLocalName))
- {
- case XML_TOK_FONTWEIGHT:
- nIsBold = sValue.equals(GetXMLToken(XML_BOLD));
- break;
- case XML_TOK_FONTSTYLE:
- nIsItalic = sValue.equals(GetXMLToken(XML_ITALIC));
- break;
- case XML_TOK_FONTSIZE:
- SvXMLUnitConverter::convertDouble(nFontSize,sValue);
- GetSmImport().GetMM100UnitConverter().
- setXMLMeasureUnit(MAP_POINT);
- if (-1 == sValue.indexOf(GetXMLToken(XML_UNIT_PT)))
- if (-1 == sValue.indexOf('%'))
- nFontSize=0.0;
- else
- {
- GetSmImport().GetMM100UnitConverter().
- setXMLMeasureUnit(MAP_RELATIVE);
- }
- break;
- case XML_TOK_FONTFAMILY:
- sFontFamily = sValue;
- break;
- case XML_TOK_COLOR:
- sColor = sValue;
- break;
- default:
- break;
- }
- }
-
- if ((nOldIsBold!=nIsBold) || (nOldIsItalic!=nIsItalic) ||
- (nOldFontSize!=nFontSize) || (sOldFontFamily!=sFontFamily)
- || sColor.getLength())
- bFontNodeNeeded=sal_True;
- else
- bFontNodeNeeded=sal_False;
-#endif
-}
-
-
-void SmXMLStyleContext_Impl::EndElement()
-{
- /*
- <mstyle> accepts any number of arguments; if this number is not 1, its
- contents are treated as a single "inferred <mrow>" containing its
- arguments
- */
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- if (rNodeStack.Count() - nElementCount > 1)
- SmXMLRowContext_Impl::EndElement();
-#if 1
- aStyleHelper.ApplyAttrs();
-#else
- if (bFontNodeNeeded)
- {
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
-
- if (nIsBold != -1)
- {
- if (nIsBold)
- aToken.eType = TBOLD;
- else
- aToken.eType = TNBOLD;
- SmStructureNode *pFontNode = static_cast<SmStructureNode *>
- (new SmFontNode(aToken));
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (nIsItalic != -1)
- {
- if (nIsItalic)
- aToken.eType = TITALIC;
- else
- aToken.eType = TNITALIC;
- SmStructureNode *pFontNode = static_cast<SmStructureNode *>
- (new SmFontNode(aToken));
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (nFontSize != 0.0)
- {
- aToken.eType = TSIZE;
- SmFontNode *pFontNode = new SmFontNode(aToken);
-
- if (MAP_RELATIVE == GetSmImport().GetMM100UnitConverter().
- getXMLMeasureUnit())
- {
- if (nFontSize < 100.00)
- pFontNode->SetSizeParameter(Fraction(100.00/nFontSize),
- FNTSIZ_DIVIDE);
- else
- pFontNode->SetSizeParameter(Fraction(nFontSize/100.00),
- FNTSIZ_MULTIPLY);
- }
- else
- pFontNode->SetSizeParameter(Fraction(nFontSize),FNTSIZ_ABSOLUT);
-
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (sFontFamily.getLength())
- {
- if (sFontFamily.equalsIgnoreCase(GetXMLToken(XML_FIXED)))
- aToken.eType = TFIXED;
- else if (sFontFamily.equalsIgnoreCase(OUString(
- RTL_CONSTASCII_USTRINGPARAM("sans"))))
- aToken.eType = TSANS;
- else if (sFontFamily.equalsIgnoreCase(OUString(
- RTL_CONSTASCII_USTRINGPARAM("serif"))))
- aToken.eType = TSERIF;
- else //Just give up, we need to extend our font mechanism to be
- //more general
- return;
-
- aToken.aText = sFontFamily;
- SmFontNode *pFontNode = new SmFontNode(aToken);
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (sColor.getLength())
- {
- //Again we can only handle a small set of colours in
- //StarMath for now.
- const SvXMLTokenMap& rTokenMap =
- GetSmImport().GetColorTokenMap();
- aToken.eType = static_cast<SmTokenType>(rTokenMap.Get(
- XML_NAMESPACE_MATH, sColor));
- if (aToken.eType != -1)
- {
- SmFontNode *pFontNode = new SmFontNode(aToken);
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- }
-
- }
-#endif
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLPaddedContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- /*Right now the style tag is completely ignored*/
- SmXMLPaddedContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-void SmXMLPaddedContext_Impl::EndElement()
-{
- /*
- <mpadded> accepts any number of arguments; if this number is not 1, its
- contents are treated as a single "inferred <mrow>" containing its
- arguments
- */
- if (GetSmImport().GetNodeStack().Count() - nElementCount > 1)
- SmXMLRowContext_Impl::EndElement();
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLPhantomContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- /*Right now the style tag is completely ignored*/
- SmXMLPhantomContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-void SmXMLPhantomContext_Impl::EndElement()
-{
- /*
- <mphantom> accepts any number of arguments; if this number is not 1, its
- contents are treated as a single "inferred <mrow>" containing its
- arguments
- */
- if (GetSmImport().GetNodeStack().Count() - nElementCount > 1)
- SmXMLRowContext_Impl::EndElement();
-
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TPHANTOM;
-
- SmStructureNode *pPhantom = static_cast<SmStructureNode *>
- (new SmFontNode(aToken));
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- pPhantom->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pPhantom);
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLFencedContext_Impl : public SmXMLRowContext_Impl
-{
-protected:
- sal_Unicode cBegin;
- sal_Unicode cEnd;
-
-public:
- SmXMLFencedContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName),
- cBegin('('), cEnd(')') {}
-
- void StartElement(const uno::Reference< xml::sax::XAttributeList > & xAttrList );
- void EndElement();
-};
-
-
-void SmXMLFencedContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for (sal_Int16 i=0;i<nAttrCount;i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName(sAttrName,&aLocalName);
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap &rAttrTokenMap =
- GetSmImport().GetFencedAttrTokenMap();
- switch(rAttrTokenMap.Get(nPrefix,aLocalName))
- {
- //temp, starmath cannot handle multichar brackets (I think)
- case XML_TOK_OPEN:
- cBegin = sValue[0];
- break;
- case XML_TOK_CLOSE:
- cEnd = sValue[0];
- break;
- default:
- /*Go to superclass*/
- break;
- }
- }
-}
-
-
-void SmXMLFencedContext_Impl::EndElement()
-{
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.aText = ',';
- aToken.eType = TLEFT;
- aToken.nLevel = 5;
-
- aToken.eType = TLPARENT;
- aToken.cMathChar = cBegin;
- SmStructureNode *pSNode = new SmBraceNode(aToken);
- SmNode *pLeft = new SmMathSymbolNode(aToken);
-
- aToken.cMathChar = cEnd;
- aToken.eType = TRPARENT;
- SmNode *pRight = new SmMathSymbolNode(aToken);
-
- SmNodeArray aRelationArray;
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
-
- aToken.cMathChar = '\0';
- aToken.aText = ',';
- aToken.eType = TIDENT;
-
- ULONG i = rNodeStack.Count() - nElementCount;
- if (rNodeStack.Count() - nElementCount > 1)
- i += rNodeStack.Count() - 1 - nElementCount;
- aRelationArray.resize(i);
- while (rNodeStack.Count() > nElementCount)
- {
- aRelationArray[--i] = rNodeStack.Pop();
- if (i > 1 && rNodeStack.Count() > 1)
- aRelationArray[--i] = new SmGlyphSpecialNode(aToken);
- }
-
- SmToken aDummy;
- SmStructureNode *pBody = new SmExpressionNode(aDummy);
- pBody->SetSubNodes(aRelationArray);
-
-
- pSNode->SetSubNodes(pLeft,pBody,pRight);
- pSNode->SetScaleMode(SCALE_HEIGHT);
- GetSmImport().GetNodeStack().Push(pSNode);
-}
-
-
-////////////////////////////////////////////////////////////
-
-class SmXMLErrorContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLErrorContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-void SmXMLErrorContext_Impl::EndElement()
-{
- /*Right now the error tag is completely ignored, what
- can I do with it in starmath, ?, maybe we need a
- report window ourselves, do a test for validity of
- the xml input, use merrors, and then generate
- the markup inside the merror with a big red colour
- of something. For now just throw them all away.
- */
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- while (rNodeStack.Count() > nElementCount)
- {
- SmNode *pNode = rNodeStack.Pop();
- delete pNode;
- }
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLNumberContext_Impl : public SmXMLImportContext
-{
-protected:
- SmToken aToken;
-
-public:
- SmXMLNumberContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName)
- {
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TNUMBER;
- }
-
- virtual void TCharacters(const OUString &rChars);
-
- void EndElement();
-};
-
-void SmXMLNumberContext_Impl::TCharacters(const OUString &rChars)
-{
- aToken.aText = rChars;
-}
-
-void SmXMLNumberContext_Impl::EndElement()
-{
- GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_NUMBER));
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLAnnotationContext_Impl : public SmXMLImportContext
-{
- sal_Bool bIsStarMath;
-
-public:
- SmXMLAnnotationContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName), bIsStarMath(sal_False) {}
-
- virtual void Characters(const OUString &rChars);
-
- void StartElement(const uno::Reference<xml::sax::XAttributeList > & xAttrList );
-};
-
-void SmXMLAnnotationContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for (sal_Int16 i=0;i<nAttrCount;i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName(sAttrName,&aLocalName);
-
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap &rAttrTokenMap =
- GetSmImport().GetAnnotationAttrTokenMap();
- switch(rAttrTokenMap.Get(nPrefix,aLocalName))
- {
- case XML_TOK_ENCODING:
- bIsStarMath= sValue.equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("StarMath 5.0")));
- break;
- default:
- break;
- }
- }
-}
-
-void SmXMLAnnotationContext_Impl::Characters(const OUString &rChars)
-{
- if (bIsStarMath)
- GetSmImport().GetText().Append(String(rChars));
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLTextContext_Impl : public SmXMLImportContext
-{
-protected:
- SmToken aToken;
-
-public:
- SmXMLTextContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName)
- {
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TTEXT;
- }
-
- virtual void TCharacters(const OUString &rChars);
-
- void EndElement();
-};
-
-void SmXMLTextContext_Impl::TCharacters(const OUString &rChars)
-{
- aToken.aText = rChars;
-}
-
-void SmXMLTextContext_Impl::EndElement()
-{
- GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_TEXT));
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLStringContext_Impl : public SmXMLImportContext
-{
-protected:
- SmToken aToken;
-
-public:
- SmXMLStringContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName)
- {
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TTEXT;
- }
-
- virtual void TCharacters(const OUString &rChars);
-
- void EndElement();
-};
-
-void SmXMLStringContext_Impl::TCharacters(const OUString &rChars)
-{
- /*
- The content of <ms> elements should be rendered with visible "escaping" of
- certain characters in the content, including at least "double quote"
- itself, and preferably whitespace other than individual blanks. The intent
- is for the viewer to see that the expression is a string literal, and to
- see exactly which characters form its content. For example, <ms>double
- quote is "</ms> might be rendered as "double quote is \"".
-
- Obviously this isn't fully done here.
- */
- aToken.aText.Erase();
- aToken.aText += '\"';
- aToken.aText += String(rChars);
- aToken.aText += '\"';
-}
-
-void SmXMLStringContext_Impl::EndElement()
-{
- GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_FIXED));
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLIdentifierContext_Impl : public SmXMLImportContext
-{
-protected:
- SmXMLContext_Helper aStyleHelper;
- SmToken aToken;
-
-public:
- SmXMLIdentifierContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName),aStyleHelper(*this)
- {
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TIDENT;
- }
-
- void TCharacters(const OUString &rChars);
- void StartElement(const uno::Reference< xml::sax::XAttributeList > & xAttrList )
- {
- aStyleHelper.RetrieveAttrs(xAttrList);
- };
- void EndElement();
-};
-
-void SmXMLIdentifierContext_Impl::EndElement()
-{
- SmTextNode *pNode = 0;
- //we will handle identifier italic/normal here instead of with a standalone
- //font node
- if (((aStyleHelper.nIsItalic == -1) && (aToken.aText.Len() > 1))
- || ((aStyleHelper.nIsItalic == 0) && (aToken.aText.Len() == 1)))
- {
- pNode = new SmTextNode(aToken,FNT_FUNCTION);
- pNode->GetFont().SetItalic(ITALIC_NONE);
- aStyleHelper.nIsItalic = -1;
- }
- else
- pNode = new SmTextNode(aToken,FNT_VARIABLE);
- if (aStyleHelper.bFontNodeNeeded && aStyleHelper.nIsItalic != -1)
- {
- if (aStyleHelper.nIsItalic)
- pNode->GetFont().SetItalic(ITALIC_NORMAL);
- else
- pNode->GetFont().SetItalic(ITALIC_NONE);
- }
-
- if ((-1!=aStyleHelper.nIsBold) || (0.0!=aStyleHelper.nFontSize) ||
- (aStyleHelper.sFontFamily.getLength()) ||
- aStyleHelper.sColor.getLength())
- aStyleHelper.bFontNodeNeeded=sal_True;
- else
- aStyleHelper.bFontNodeNeeded=sal_False;
- if (aStyleHelper.bFontNodeNeeded)
- aStyleHelper.ApplyAttrs();
- GetSmImport().GetNodeStack().Push(pNode);
-}
-
-void SmXMLIdentifierContext_Impl::TCharacters(const OUString &rChars)
-{
- aToken.aText = rChars;
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLOperatorContext_Impl : public SmXMLImportContext
-{
- sal_Bool bIsStretchy;
-
-protected:
- SmToken aToken;
-
-public:
- SmXMLOperatorContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName), bIsStretchy(sal_False)
- {
- aToken.nGroup = 0;
- aToken.eType = TSPECIAL;
- aToken.nLevel = 5;
- }
-
- void TCharacters(const OUString &rChars);
- void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
- void EndElement();
-};
-
-void SmXMLOperatorContext_Impl::TCharacters(const OUString &rChars)
-{
- aToken.cMathChar = rChars[0];
-}
-
-void SmXMLOperatorContext_Impl::EndElement()
-{
- SmMathSymbolNode *pNode = new SmMathSymbolNode(aToken);
- //For stretchy scaling the scaling must be retrieved from this node
- //and applied to the expression itself so as to get the expression
- //to scale the operator to the height of the expression itself
- if (bIsStretchy)
- pNode->SetScaleMode(SCALE_HEIGHT);
- GetSmImport().GetNodeStack().Push(pNode);
-}
-
-
-
-void SmXMLOperatorContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for (sal_Int16 i=0;i<nAttrCount;i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName(sAttrName,&aLocalName);
-
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap &rAttrTokenMap =
- GetSmImport().GetOperatorAttrTokenMap();
- switch(rAttrTokenMap.Get(nPrefix,aLocalName))
- {
- case XML_TOK_STRETCHY:
- bIsStretchy = sValue.equals(
- GetXMLToken(XML_TRUE));
- break;
- default:
- break;
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-
-class SmXMLSpaceContext_Impl : public SmXMLImportContext
-{
-public:
- SmXMLSpaceContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName) {}
-
- void StartElement(const uno::Reference< xml::sax::XAttributeList >& xAttrList );
-};
-
-void SmXMLSpaceContext_Impl::StartElement(
- const uno::Reference<xml::sax::XAttributeList > & /*xAttrList*/ )
-{
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.eType = TBLANK;
- aToken.nLevel = 5;
- SmBlankNode *pBlank = new SmBlankNode(aToken);
- pBlank->IncreaseBy(aToken);
- GetSmImport().GetNodeStack().Push(pBlank);
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLSubContext_Impl : public SmXMLRowContext_Impl
-{
-protected:
- void GenericEndElement(SmTokenType eType,SmSubSup aSubSup);
-
-public:
- SmXMLSubContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement()
- {
- GenericEndElement(TRSUB,RSUB);
- }
-};
-
-
-void SmXMLSubContext_Impl::GenericEndElement(SmTokenType eType, SmSubSup eSubSup)
-{
- /*The <msub> element requires exactly 2 arguments.*/
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Sub has not two arguments");
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = eType;
- SmSubSupNode *pNode = new SmSubSupNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
-
- // initialize subnodes array
- SmNodeArray aSubNodes;
- aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
- for (ULONG i = 1; i < aSubNodes.size(); i++)
- aSubNodes[i] = NULL;
-
- aSubNodes[eSubSup+1] = rNodeStack.Pop();
- aSubNodes[0] = rNodeStack.Pop();
- pNode->SetSubNodes(aSubNodes);
- rNodeStack.Push(pNode);
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLSupContext_Impl : public SmXMLSubContext_Impl
-{
-public:
- SmXMLSupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLSubContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement()
- {
- GenericEndElement(TRSUP,RSUP);
- }
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLSubSupContext_Impl : public SmXMLRowContext_Impl
-{
-protected:
- void GenericEndElement(SmTokenType eType, SmSubSup aSub,SmSubSup aSup);
-
-public:
- SmXMLSubSupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement()
- {
- GenericEndElement(TRSUB,RSUB,RSUP);
- }
-};
-
-void SmXMLSubSupContext_Impl::GenericEndElement(SmTokenType eType,
- SmSubSup aSub,SmSubSup aSup)
-{
- /*The <msub> element requires exactly 3 arguments.*/
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 3,
- "SubSup has not three arguments");
-
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = eType;
- SmSubSupNode *pNode = new SmSubSupNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
-
- // initialize subnodes array
- SmNodeArray aSubNodes;
- aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
- for (ULONG i = 1; i < aSubNodes.size(); i++)
- aSubNodes[i] = NULL;
-
- aSubNodes[aSup+1] = rNodeStack.Pop();
- aSubNodes[aSub+1] = rNodeStack.Pop();
- aSubNodes[0] = rNodeStack.Pop();
- pNode->SetSubNodes(aSubNodes);
- rNodeStack.Push(pNode);
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLUnderContext_Impl : public SmXMLSubContext_Impl
-{
-protected:
- sal_Int16 nAttrCount;
-
-public:
- SmXMLUnderContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLSubContext_Impl(rImport,nPrefix,rLName) {}
-
- void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
- void EndElement();
- void HandleAccent();
-};
-
-void SmXMLUnderContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
-}
-
-void SmXMLUnderContext_Impl::HandleAccent()
-{
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Sub has not two arguments");
-
- /*Just one special case for the underline thing*/
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- SmNode *pTest = rNodeStack.Pop();
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TUNDERLINE;
-
-
- SmNodeArray aSubNodes;
- aSubNodes.resize(2);
-
- SmStructureNode *pNode = new SmAttributNode(aToken);
- if ((pTest->GetToken().cMathChar & 0x0FFF) == 0x0332)
- {
- aSubNodes[0] = new SmRectangleNode(aToken);
- delete pTest;
- }
- else
- aSubNodes[0] = pTest;
-
- aSubNodes[1] = rNodeStack.Pop();
- pNode->SetSubNodes(aSubNodes);
- pNode->SetScaleMode(SCALE_WIDTH);
- rNodeStack.Push(pNode);
-}
-
-
-void SmXMLUnderContext_Impl::EndElement()
-{
- if (!nAttrCount)
- GenericEndElement(TCSUB,CSUB);
- else
- HandleAccent();
-#if 0
- //UnderBrace trick
- SmStructureNode *pNode = rNodeStack.Pop();
- if (pNode->GetSubNode(1)->GetToken().cMathChar == (0x0332|0xf000))
- if (pNode->GetSubNode(0)->GetToken().cMathChar == (0x0332|0xf000))
-#endif
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLOverContext_Impl : public SmXMLSubContext_Impl
-{
-protected:
- sal_Int16 nAttrCount;
-
-public:
- SmXMLOverContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLSubContext_Impl(rImport,nPrefix,rLName), nAttrCount(0) {}
-
- void EndElement();
- void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
- void HandleAccent();
-};
-
-
-void SmXMLOverContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
-}
-
-
-void SmXMLOverContext_Impl::EndElement()
-{
- if (!nAttrCount)
- GenericEndElement(TCSUP,CSUP);
- else
- HandleAccent();
-}
-
-
-void SmXMLOverContext_Impl::HandleAccent()
-{
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Sub has not two arguments");
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TACUTE;
-
- SmAttributNode *pNode = new SmAttributNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
-
- SmNodeArray aSubNodes;
- aSubNodes.resize(2);
- aSubNodes[0] = rNodeStack.Pop();
- aSubNodes[1] = rNodeStack.Pop();
- pNode->SetSubNodes(aSubNodes);
- pNode->SetScaleMode(SCALE_WIDTH);
- rNodeStack.Push(pNode);
-
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLUnderOverContext_Impl : public SmXMLSubSupContext_Impl
-{
-public:
- SmXMLUnderOverContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLSubSupContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement()
- {
- GenericEndElement(TCSUB,CSUB,CSUP);
- }
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLMultiScriptsContext_Impl : public SmXMLSubSupContext_Impl
-{
- sal_Bool bHasPrescripts;
-
-public:
- SmXMLMultiScriptsContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLSubSupContext_Impl(rImport,nPrefix,rLName),
- bHasPrescripts(FALSE) {}
-
- void EndElement();
- void MiddleElement();
- SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLNoneContext_Impl : public SmXMLImportContext
-{
-public:
- SmXMLNoneContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-
-void SmXMLNoneContext_Impl::EndElement(void)
-{
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.aText.Erase();
- aToken.nLevel = 5;
- aToken.eType = TIDENT;
- GetSmImport().GetNodeStack().Push(
- new SmTextNode(aToken,FNT_VARIABLE));
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLPrescriptsContext_Impl : public SmXMLImportContext
-{
-public:
- SmXMLPrescriptsContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName) {}
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLTableRowContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLTableRowContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLRowContext_Impl(rImport,nPrefix,rLName)
- {}
-
- SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-};
-
-
-////////////////////////////////////////////////////////////
-
-class SmXMLTableContext_Impl : public SmXMLTableRowContext_Impl
-{
-public:
- SmXMLTableContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLTableRowContext_Impl(rImport,nPrefix,rLName)
- {}
-
- void EndElement();
- SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-};
-
-
-////////////////////////////////////////////////////////////
-
-class SmXMLTableCellContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLTableCellContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLRowContext_Impl(rImport,nPrefix,rLName)
- {}
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLAlignGroupContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLAlignGroupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLRowContext_Impl(rImport,nPrefix,rLName)
- {}
-
- /*Don't do anything with alignment for now*/
- void EndElement()
- {
- }
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLActionContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLActionContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLRowContext_Impl(rImport,nPrefix,rLName)
- {}
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-// NB: virtually inherit so we can multiply inherit properly
-// in SmXMLFlatDocContext_Impl
-class SmXMLOfficeContext_Impl : public virtual SvXMLImportContext
-{
-public:
- SmXMLOfficeContext_Impl( SmXMLImport &rImport, sal_uInt16 nPrfx,
- const OUString& rLName)
- : SvXMLImportContext(rImport,nPrfx,rLName) {}
-
- virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-};
-
-SvXMLImportContext *SmXMLOfficeContext_Impl::CreateChildContext(sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > &xAttrList)
-{
- SvXMLImportContext *pContext = 0;
- if ( XML_NAMESPACE_OFFICE == nPrefix &&
- rLocalName == GetXMLToken(XML_META) )
- {
- DBG_WARNING("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
- }
- else if ( XML_NAMESPACE_OFFICE == nPrefix &&
- rLocalName == GetXMLToken(XML_SETTINGS) )
- {
- pContext = new XMLDocumentSettingsContext( GetImport(),
- XML_NAMESPACE_OFFICE, rLocalName,
- xAttrList );
- }
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-////////////////////////////////////////////////////////////
-
-// context for flat file xml format
-class SmXMLFlatDocContext_Impl
- : public SmXMLOfficeContext_Impl, public SvXMLMetaDocumentContext
-{
-public:
- SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport,
- USHORT i_nPrefix, const OUString & i_rLName,
- const uno::Reference<document::XDocumentProperties>& i_xDocProps,
- const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder);
-
- virtual ~SmXMLFlatDocContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext(USHORT i_nPrefix, const OUString& i_rLocalName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList);
-};
-
-SmXMLFlatDocContext_Impl::SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport,
- USHORT i_nPrefix, const OUString & i_rLName,
- const uno::Reference<document::XDocumentProperties>& i_xDocProps,
- const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder) :
- SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
- SmXMLOfficeContext_Impl(i_rImport, i_nPrefix, i_rLName),
- SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
- i_xDocProps, i_xDocBuilder)
-{
-}
-
-SmXMLFlatDocContext_Impl::~SmXMLFlatDocContext_Impl()
-{
-}
-
-SvXMLImportContext *SmXMLFlatDocContext_Impl::CreateChildContext(
- USHORT i_nPrefix, const OUString& i_rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& i_xAttrList)
-{
- // behave like meta base class iff we encounter office:meta
- if ( XML_NAMESPACE_OFFICE == i_nPrefix &&
- i_rLocalName == GetXMLToken(XML_META) )
- {
- return SvXMLMetaDocumentContext::CreateChildContext(
- i_nPrefix, i_rLocalName, i_xAttrList );
- }
- else
- {
- return SmXMLOfficeContext_Impl::CreateChildContext(
- i_nPrefix, i_rLocalName, i_xAttrList );
- }
-}
-
-////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry aPresLayoutElemTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_SEMANTICS, XML_TOK_SEMANTICS },
- { XML_NAMESPACE_MATH, XML_MATH, XML_TOK_MATH },
- { XML_NAMESPACE_MATH, XML_MSTYLE, XML_TOK_MSTYLE },
- { XML_NAMESPACE_MATH, XML_MERROR, XML_TOK_MERROR },
- { XML_NAMESPACE_MATH, XML_MPHANTOM, XML_TOK_MPHANTOM },
- { XML_NAMESPACE_MATH, XML_MROW, XML_TOK_MROW },
- { XML_NAMESPACE_MATH, XML_MFRAC, XML_TOK_MFRAC },
- { XML_NAMESPACE_MATH, XML_MSQRT, XML_TOK_MSQRT },
- { XML_NAMESPACE_MATH, XML_MROOT, XML_TOK_MROOT },
- { XML_NAMESPACE_MATH, XML_MSUB, XML_TOK_MSUB },
- { XML_NAMESPACE_MATH, XML_MSUP, XML_TOK_MSUP },
- { XML_NAMESPACE_MATH, XML_MSUBSUP, XML_TOK_MSUBSUP },
- { XML_NAMESPACE_MATH, XML_MUNDER, XML_TOK_MUNDER },
- { XML_NAMESPACE_MATH, XML_MOVER, XML_TOK_MOVER },
- { XML_NAMESPACE_MATH, XML_MUNDEROVER, XML_TOK_MUNDEROVER },
- { XML_NAMESPACE_MATH, XML_MMULTISCRIPTS, XML_TOK_MMULTISCRIPTS },
- { XML_NAMESPACE_MATH, XML_MTABLE, XML_TOK_MTABLE },
- { XML_NAMESPACE_MATH, XML_MACTION, XML_TOK_MACTION },
- { XML_NAMESPACE_MATH, XML_MFENCED, XML_TOK_MFENCED },
- { XML_NAMESPACE_MATH, XML_MPADDED, XML_TOK_MPADDED },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPresLayoutAttrTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_FONTWEIGHT, XML_TOK_FONTWEIGHT },
- { XML_NAMESPACE_MATH, XML_FONTSTYLE, XML_TOK_FONTSTYLE },
- { XML_NAMESPACE_MATH, XML_FONTSIZE, XML_TOK_FONTSIZE },
- { XML_NAMESPACE_MATH, XML_FONTFAMILY, XML_TOK_FONTFAMILY },
- { XML_NAMESPACE_MATH, XML_COLOR, XML_TOK_COLOR },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aFencedAttrTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_OPEN, XML_TOK_OPEN },
- { XML_NAMESPACE_MATH, XML_CLOSE, XML_TOK_CLOSE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aOperatorAttrTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_STRETCHY, XML_TOK_STRETCHY },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aAnnotationAttrTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_ENCODING, XML_TOK_ENCODING },
- XML_TOKEN_MAP_END
-};
-
-
-static __FAR_DATA SvXMLTokenMapEntry aPresElemTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_ANNOTATION, XML_TOK_ANNOTATION },
- { XML_NAMESPACE_MATH, XML_MI, XML_TOK_MI },
- { XML_NAMESPACE_MATH, XML_MN, XML_TOK_MN },
- { XML_NAMESPACE_MATH, XML_MO, XML_TOK_MO },
- { XML_NAMESPACE_MATH, XML_MTEXT, XML_TOK_MTEXT },
- { XML_NAMESPACE_MATH, XML_MSPACE,XML_TOK_MSPACE },
- { XML_NAMESPACE_MATH, XML_MS, XML_TOK_MS },
- { XML_NAMESPACE_MATH, XML_MALIGNGROUP, XML_TOK_MALIGNGROUP },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPresScriptEmptyElemTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_MPRESCRIPTS, XML_TOK_MPRESCRIPTS },
- { XML_NAMESPACE_MATH, XML_NONE, XML_TOK_NONE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPresTableElemTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_MTR, XML_TOK_MTR },
- { XML_NAMESPACE_MATH, XML_MTD, XML_TOK_MTD },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aColorTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_BLACK, TBLACK},
- { XML_NAMESPACE_MATH, XML_WHITE, TWHITE},
- { XML_NAMESPACE_MATH, XML_RED, TRED},
- { XML_NAMESPACE_MATH, XML_GREEN, TGREEN},
- { XML_NAMESPACE_MATH, XML_BLUE, TBLUE},
- { XML_NAMESPACE_MATH, XML_AQUA, TCYAN},
- { XML_NAMESPACE_MATH, XML_FUCHSIA, TMAGENTA},
- { XML_NAMESPACE_MATH, XML_YELLOW, TYELLOW},
- XML_TOKEN_MAP_END
-};
-
-
-////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SmXMLImport::GetPresLayoutElemTokenMap()
-{
- if (!pPresLayoutElemTokenMap)
- pPresLayoutElemTokenMap = new SvXMLTokenMap(aPresLayoutElemTokenMap);
- return *pPresLayoutElemTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetPresLayoutAttrTokenMap()
-{
- if (!pPresLayoutAttrTokenMap)
- pPresLayoutAttrTokenMap = new SvXMLTokenMap(aPresLayoutAttrTokenMap);
- return *pPresLayoutAttrTokenMap;
-}
-
-
-const SvXMLTokenMap& SmXMLImport::GetFencedAttrTokenMap()
-{
- if (!pFencedAttrTokenMap)
- pFencedAttrTokenMap = new SvXMLTokenMap(aFencedAttrTokenMap);
- return *pFencedAttrTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetOperatorAttrTokenMap()
-{
- if (!pOperatorAttrTokenMap)
- pOperatorAttrTokenMap = new SvXMLTokenMap(aOperatorAttrTokenMap);
- return *pOperatorAttrTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetAnnotationAttrTokenMap()
-{
- if (!pAnnotationAttrTokenMap)
- pAnnotationAttrTokenMap = new SvXMLTokenMap(aAnnotationAttrTokenMap);
- return *pAnnotationAttrTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetPresElemTokenMap()
-{
- if (!pPresElemTokenMap)
- pPresElemTokenMap = new SvXMLTokenMap(aPresElemTokenMap);
- return *pPresElemTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetPresScriptEmptyElemTokenMap()
-{
- if (!pPresScriptEmptyElemTokenMap)
- pPresScriptEmptyElemTokenMap = new
- SvXMLTokenMap(aPresScriptEmptyElemTokenMap);
- return *pPresScriptEmptyElemTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetPresTableElemTokenMap()
-{
- if (!pPresTableElemTokenMap)
- pPresTableElemTokenMap = new SvXMLTokenMap(aPresTableElemTokenMap);
- return *pPresTableElemTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetColorTokenMap()
-{
- if (!pColorTokenMap)
- pColorTokenMap = new SvXMLTokenMap(aColorTokenMap);
- return *pColorTokenMap;
-}
-
-////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SmXMLDocContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSmImport().GetPresLayoutElemTokenMap();
-
- //UINT32 nTest = rTokenMap.Get(nPrefix, rLocalName);
-
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- //Consider semantics a dummy except for any starmath annotations
- case XML_TOK_SEMANTICS:
- pContext = GetSmImport().CreateRowContext(nPrefix,rLocalName,
- xAttrList);
- break;
- /*General Layout Schemata*/
- case XML_TOK_MROW:
- pContext = GetSmImport().CreateRowContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MFRAC:
- pContext = GetSmImport().CreateFracContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MSQRT:
- pContext = GetSmImport().CreateSqrtContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MROOT:
- pContext = GetSmImport().CreateRootContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MSTYLE:
- pContext = GetSmImport().CreateStyleContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MERROR:
- pContext = GetSmImport().CreateErrorContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MPADDED:
- pContext = GetSmImport().CreatePaddedContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MPHANTOM:
- pContext = GetSmImport().CreatePhantomContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MFENCED:
- pContext = GetSmImport().CreateFencedContext(nPrefix,rLocalName,
- xAttrList);
- break;
- /*Script and Limit Schemata*/
- case XML_TOK_MSUB:
- pContext = GetSmImport().CreateSubContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MSUP:
- pContext = GetSmImport().CreateSupContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MSUBSUP:
- pContext = GetSmImport().CreateSubSupContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MUNDER:
- pContext = GetSmImport().CreateUnderContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MOVER:
- pContext = GetSmImport().CreateOverContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MUNDEROVER:
- pContext = GetSmImport().CreateUnderOverContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MMULTISCRIPTS:
- pContext = GetSmImport().CreateMultiScriptsContext(nPrefix,
- rLocalName, xAttrList);
- break;
- case XML_TOK_MTABLE:
- pContext = GetSmImport().CreateTableContext(nPrefix,
- rLocalName, xAttrList);
- break;
- case XML_TOK_MACTION:
- pContext = GetSmImport().CreateActionContext(nPrefix,
- rLocalName, xAttrList);
- break;
- default:
- /*Basically theres an implicit mrow around certain bare
- *elements, use a RowContext to see if this is one of
- *those ones*/
- SmXMLRowContext_Impl aTempContext(GetSmImport(),nPrefix,
- GetXMLToken(XML_MROW));
-
- pContext = aTempContext.StrictCreateChildContext(nPrefix,
- rLocalName, xAttrList);
- break;
- }
- return pContext;
-}
-
-void SmXMLDocContext_Impl::EndElement()
-{
- SmNodeArray ContextArray;
- ContextArray.resize(1);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
-
- for (ULONG i=0;i< 1;i++)
- ContextArray[i] = rNodeStack.Pop();
-
- SmToken aDummy;
- SmStructureNode *pSNode = new SmLineNode(aDummy);
- pSNode->SetSubNodes(ContextArray);
- rNodeStack.Push(pSNode);
-
- SmNodeArray LineArray;
- ULONG n = rNodeStack.Count();
- LineArray.resize(n);
- for (ULONG j = 0; j < n; j++)
- LineArray[n - (j + 1)] = rNodeStack.Pop();
- SmStructureNode *pSNode2 = new SmTableNode(aDummy);
- pSNode2->SetSubNodes(LineArray);
- rNodeStack.Push(pSNode2);
-}
-
-void SmXMLFracContext_Impl::EndElement()
-{
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TOVER;
- SmStructureNode *pSNode = new SmBinVerNode(aToken);
- SmNode *pOper = new SmRectangleNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- DBG_ASSERT(rNodeStack.Count() - nElementCount == 2,
- "Fraction (mfrac) tag is missing component");
- if (rNodeStack.Count() - nElementCount == 2)
- {
- SmNode *pSecond = rNodeStack.Pop();
- SmNode *pFirst = rNodeStack.Pop();
- pSNode->SetSubNodes(pFirst,pOper,pSecond);
- rNodeStack.Push(pSNode);
- }
-}
-
-void SmXMLRootContext_Impl::EndElement()
-{
- /*The <mroot> element requires exactly 2 arguments.*/
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Root tag is missing component");
-
- SmToken aToken;
- aToken.cMathChar = MS_SQRT; //Temporary: alert, based on StarSymbol font
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TNROOT;
- SmStructureNode *pSNode = new SmRootNode(aToken);
- SmNode *pOper = new SmRootSymbolNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- SmNode *pIndex = rNodeStack.Pop();
- SmNode *pBase = rNodeStack.Pop();
- pSNode->SetSubNodes(pIndex,pOper,pBase);
- rNodeStack.Push(pSNode);
-}
-
-void SmXMLSqrtContext_Impl::EndElement()
-{
- /*
- <msqrt> accepts any number of arguments; if this number is not 1, its
- contents are treated as a single "inferred <mrow>" containing its
- arguments
- */
- if (GetSmImport().GetNodeStack().Count() - nElementCount > 1)
- SmXMLRowContext_Impl::EndElement();
-
- SmToken aToken;
- aToken.cMathChar = MS_SQRT; //Temporary: alert, based on StarSymbol font
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TSQRT;
- SmStructureNode *pSNode = new SmRootNode(aToken);
- SmNode *pOper = new SmRootSymbolNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- pSNode->SetSubNodes(0,pOper,rNodeStack.Pop());
- rNodeStack.Push(pSNode);
-}
-
-void SmXMLRowContext_Impl::EndElement()
-{
- SmNodeArray aRelationArray;
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- ULONG nSize = rNodeStack.Count()-nElementCount;
-
- if (nSize > 0)
- {
- aRelationArray.resize(nSize);
- for (ULONG j=rNodeStack.Count()-nElementCount;j > 0;j--)
- aRelationArray[j-1] = rNodeStack.Pop();
-
-
- //If the first or last element is an operator with stretchyness
- //set then we must create a brace node here from those elements,
- //removing the stretchness from the operators and applying it to
- //ourselves, and creating the appropiate dummy StarMath none bracket
- //to balance the arrangement
- if (((aRelationArray[0]->GetScaleMode() == SCALE_HEIGHT)
- && (aRelationArray[0]->GetType() == NMATH))
- || ((aRelationArray[nSize-1]->GetScaleMode() == SCALE_HEIGHT)
- && (aRelationArray[nSize-1]->GetType() == NMATH)))
- {
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
-
- int nLeft=0,nRight=0;
- if ((aRelationArray[0]->GetScaleMode() == SCALE_HEIGHT)
- && (aRelationArray[0]->GetType() == NMATH))
- {
- aToken = aRelationArray[0]->GetToken();
- nLeft=1;
- }
- else
- aToken.cMathChar = '\0';
-
- aToken.eType = TLPARENT;
- SmNode *pLeft = new SmMathSymbolNode(aToken);
-
- if ((aRelationArray[nSize-1]->GetScaleMode() == SCALE_HEIGHT)
- && (aRelationArray[nSize-1]->GetType() == NMATH))
- {
- aToken = aRelationArray[nSize-1]->GetToken();
- nRight=1;
- }
- else
- aToken.cMathChar = '\0';
-
- aToken.eType = TRPARENT;
- SmNode *pRight = new SmMathSymbolNode(aToken);
-
- SmNodeArray aRelationArray2;
-
- //!! nSize-nLeft-nRight may be < 0 !!
- int nRelArrSize = nSize-nLeft-nRight;
- if (nRelArrSize > 0)
- {
- aRelationArray2.resize(nRelArrSize);
- for (int i=0;i < nRelArrSize;i++)
- aRelationArray2[i] = aRelationArray[i+nLeft];
- }
-
- SmToken aDummy;
- SmStructureNode *pSNode = new SmBraceNode(aToken);
- SmStructureNode *pBody = new SmExpressionNode(aDummy);
- pBody->SetSubNodes(aRelationArray2);
-
- pSNode->SetSubNodes(pLeft,pBody,pRight);
- pSNode->SetScaleMode(SCALE_HEIGHT);
- rNodeStack.Push(pSNode);
- return;
- }
- }
- else //Multiple newlines result in empty row elements
- {
- aRelationArray.resize(1);
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TNEWLINE;
- aRelationArray[0] = new SmLineNode(aToken);
- }
-
- SmToken aDummy;
- SmStructureNode *pSNode = new SmExpressionNode(aDummy);
- pSNode->SetSubNodes(aRelationArray);
- rNodeStack.Push(pSNode);
-}
-
-
-SvXMLImportContext *SmXMLRowContext_Impl::StrictCreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSmImport().GetPresElemTokenMap();
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- /*Note that these should accept malignmark subelements, but do not*/
- case XML_TOK_MN:
- pContext = GetSmImport().CreateNumberContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MI:
- pContext = GetSmImport().CreateIdentifierContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MO:
- pContext = GetSmImport().CreateOperatorContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MTEXT:
- pContext = GetSmImport().CreateTextContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MSPACE:
- pContext = GetSmImport().CreateSpaceContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MS:
- pContext = GetSmImport().CreateStringContext(nPrefix,rLocalName,
- xAttrList);
- break;
-
- /*Note: The maligngroup should only be seen when the row
- * (or decendants) are in a table*/
- case XML_TOK_MALIGNGROUP:
- pContext = GetSmImport().CreateAlignGroupContext(nPrefix,rLocalName,
- xAttrList);
- break;
-
- case XML_TOK_ANNOTATION:
- pContext = GetSmImport().CreateAnnotationContext(nPrefix,rLocalName,
- xAttrList);
- break;
-
- default:
- break;
- }
- return pContext;
-}
-
-
-SvXMLImportContext *SmXMLRowContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = StrictCreateChildContext(nPrefix,
- rLocalName, xAttrList);
-
- if (!pContext)
- {
- //Hmm, unrecognized for this level, check to see if its
- //an element that can have an implicit schema around it
- pContext = SmXMLDocContext_Impl::CreateChildContext(nPrefix,
- rLocalName,xAttrList);
- }
- return pContext;
-}
-
-
-SvXMLImportContext *SmXMLMultiScriptsContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSmImport().
- GetPresScriptEmptyElemTokenMap();
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_MPRESCRIPTS:
- MiddleElement();
- pContext = GetSmImport().CreatePrescriptsContext(nPrefix,
- rLocalName, xAttrList);
- break;
- case XML_TOK_NONE:
- pContext = GetSmImport().CreateNoneContext(nPrefix,rLocalName,
- xAttrList);
- break;
- default:
- pContext = SmXMLRowContext_Impl::CreateChildContext(nPrefix,
- rLocalName,xAttrList);
- break;
- }
- return pContext;
-}
-
-void SmXMLMultiScriptsContext_Impl::MiddleElement()
-{
- bHasPrescripts=sal_True;
-
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount > 0,
- "Sub has no arguments");
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- if (rNodeStack.Count()-nElementCount > 1)
- {
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TRSUB;
- ULONG nFinalCount = rNodeStack.Count()-nElementCount-1;
-
- SmNodeStack aReverseStack;
- while (rNodeStack.Count()-nElementCount)
- {
- SmNode *pThing = rNodeStack.Pop();
- aReverseStack.Push(pThing);
- }
-
- for (ULONG nCount=0;nCount < nFinalCount;nCount+=2)
- {
- SmSubSupNode *pNode = new SmSubSupNode(aToken);
-
- // initialize subnodes array
- SmNodeArray aSubNodes;
- aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
- for (ULONG i = 1; i < aSubNodes.size(); i++)
- aSubNodes[i] = NULL;
-
- /*On each loop the base and its sub sup pair becomes the
- base for the next loop to which the next sub sup pair is
- attached, i.e. wheels within wheels*/
- //if (nCount == 0)
- aSubNodes[0] = aReverseStack.Pop();
-
- SmNode *pScriptNode = aReverseStack.Pop();
-
- if (pScriptNode && ((pScriptNode->GetToken().eType != TIDENT) ||
- (pScriptNode->GetToken().aText.Len())))
- aSubNodes[RSUB+1] = pScriptNode;
- pScriptNode = aReverseStack.Pop();
- if (pScriptNode && ((pScriptNode->GetToken().eType != TIDENT) ||
- (pScriptNode->GetToken().aText.Len())))
- aSubNodes[RSUP+1] = pScriptNode;
-
- pNode->SetSubNodes(aSubNodes);
- aReverseStack.Push(pNode);
- }
- rNodeStack.Push(aReverseStack.Pop());
- }
-}
-
-
-void SmXMLTableContext_Impl::EndElement()
-{
- SmNodeArray aExpressionArray;
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- SmNodeStack aReverseStack;
- aExpressionArray.resize(rNodeStack.Count()-nElementCount);
-
- ULONG nRows = rNodeStack.Count()-nElementCount;
- USHORT nCols = 0;
-
- SmStructureNode *pArray;
- for (ULONG i=rNodeStack.Count()-nElementCount;i > 0;i--)
- {
- pArray = (SmStructureNode *)rNodeStack.Pop();
- if (pArray->GetNumSubNodes() == 0)
- {
- //This is a little tricky, it is possible that there was
- //be elements that were not inside a <mtd> pair, in which
- //case they will not be in a row, i.e. they will not have
- //SubNodes, so we have to wait until here before we can
- //resolve the situation. Implicitsurrounding tags are
- //surprisingly difficult to get right within this
- //architecture
-
- SmNodeArray aRelationArray;
- aRelationArray.resize(1);
- aRelationArray[0] = pArray;
- SmToken aDummy;
- pArray = new SmExpressionNode(aDummy);
- pArray->SetSubNodes(aRelationArray);
- }
-
- if (pArray->GetNumSubNodes() > nCols)
- nCols = pArray->GetNumSubNodes();
- aReverseStack.Push(pArray);
- }
- aExpressionArray.resize(nCols*nRows);
- ULONG j=0;
- while (aReverseStack.Count())
- {
- pArray = (SmStructureNode *)aReverseStack.Pop();
- for (USHORT i=0;i<pArray->GetNumSubNodes();i++)
- aExpressionArray[j++] = pArray->GetSubNode(i);
- }
-
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = TRGROUP;
- aToken.nLevel = 0;
- aToken.eType = TMATRIX;
- SmMatrixNode *pSNode = new SmMatrixNode(aToken);
- pSNode->SetSubNodes(aExpressionArray);
- pSNode->SetRowCol(static_cast<USHORT>(nRows),nCols);
- rNodeStack.Push(pSNode);
-}
-
-SvXMLImportContext *SmXMLTableRowContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSmImport().
- GetPresTableElemTokenMap();
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_MTD:
- pContext = GetSmImport().CreateTableCellContext(nPrefix,
- rLocalName, xAttrList);
- break;
- default:
- pContext = SmXMLRowContext_Impl::CreateChildContext(nPrefix,
- rLocalName,xAttrList);
- break;
- }
- return pContext;
-}
-
-SvXMLImportContext *SmXMLTableContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSmImport().
- GetPresTableElemTokenMap();
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_MTR:
- pContext = GetSmImport().CreateTableRowContext(nPrefix,rLocalName,
- xAttrList);
- break;
- default:
- pContext = SmXMLTableRowContext_Impl::CreateChildContext(nPrefix,
- rLocalName,xAttrList);
- break;
- }
- return pContext;
-}
-
-void SmXMLMultiScriptsContext_Impl::EndElement()
-{
- if (!bHasPrescripts)
- MiddleElement();
-
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- if (rNodeStack.Count()-nElementCount > 1)
- {
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TLSUB;
- ULONG nFinalCount = rNodeStack.Count()-nElementCount-1;
-
- SmNodeStack aReverseStack;
- while (rNodeStack.Count()-nElementCount)
- aReverseStack.Push(rNodeStack.Pop());
- for (ULONG nCount=0;nCount < nFinalCount;nCount+=2)
- {
- SmSubSupNode *pNode = new SmSubSupNode(aToken);
-
- // initialize subnodes array
- SmNodeArray aSubNodes;
- aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
- for (ULONG i = 1; i < aSubNodes.size(); i++)
- aSubNodes[i] = NULL;
-
- /*On each loop the base and its sub sup pair becomes the
- base for the next loop to which the next sub sup pair is
- attached, i.e. wheels within wheels*/
- //if (nCount == 0)
- aSubNodes[0] = aReverseStack.Pop();
-
- SmNode *pScriptNode = aReverseStack.Pop();
- if (pScriptNode->GetToken().aText.Len())
- aSubNodes[LSUB+1] = pScriptNode;
- pScriptNode = aReverseStack.Pop();
- if (pScriptNode->GetToken().aText.Len())
- aSubNodes[LSUP+1] = pScriptNode;
-
- pNode->SetSubNodes(aSubNodes);
- aReverseStack.Push(pNode);
- }
- rNodeStack.Push(aReverseStack.Pop());
- }
-
-}
-void SmXMLActionContext_Impl::EndElement()
-{
- /*For now we will just assume that the
- selected attribute is one, and then just display
- that expression alone, i.e. remove all expect the
- first pushed one*/
-
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- for (ULONG i=rNodeStack.Count()-nElementCount;i > 1;i--)
- {
- delete rNodeStack.Pop();
- }
-}
-
-SvXMLImportContext *SmXMLImport::CreateContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- if ( XML_NAMESPACE_OFFICE == nPrefix )
- {
- if ( (IsXMLToken(rLocalName, XML_DOCUMENT) ||
- IsXMLToken(rLocalName, XML_DOCUMENT_META)))
- {
- uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
- mxServiceFactory->createInstance(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.xml.dom.SAXDocumentBuilder")),
- uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- GetModel(), uno::UNO_QUERY_THROW);
- return IsXMLToken(rLocalName, XML_DOCUMENT_META)
- ? new SvXMLMetaDocumentContext(*this,
- XML_NAMESPACE_OFFICE, rLocalName,
- xDPS->getDocumentProperties(), xDocBuilder)
- // flat OpenDocument file format -- this has not been tested...
- : new SmXMLFlatDocContext_Impl( *this, nPrefix, rLocalName,
- xDPS->getDocumentProperties(), xDocBuilder);
- }
- else
- {
- return new SmXMLOfficeContext_Impl( *this,nPrefix,rLocalName);
- }
- }
- else
- return new SmXMLDocContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateRowContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLRowContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateTextContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLTextContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateAnnotationContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLAnnotationContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateStringContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLStringContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateNumberContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLNumberContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateIdentifierContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLIdentifierContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateOperatorContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLOperatorContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateSpaceContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLSpaceContext_Impl(*this,nPrefix,rLocalName);
-}
-
-
-SvXMLImportContext *SmXMLImport::CreateFracContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLFracContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateSqrtContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLSqrtContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateRootContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLRootContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateStyleContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLStyleContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreatePaddedContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLPaddedContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreatePhantomContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLPhantomContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateFencedContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLFencedContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateErrorContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLErrorContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateSubContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLSubContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateSubSupContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLSubSupContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateSupContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLSupContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateUnderContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLUnderContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateOverContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLOverContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateUnderOverContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLUnderOverContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateMultiScriptsContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLMultiScriptsContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateTableContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLTableContext_Impl(*this,nPrefix,rLocalName);
-}
-SvXMLImportContext *SmXMLImport::CreateTableRowContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLTableRowContext_Impl(*this,nPrefix,rLocalName);
-}
-SvXMLImportContext *SmXMLImport::CreateTableCellContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLTableCellContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateNoneContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLNoneContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreatePrescriptsContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLPrescriptsContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateAlignGroupContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLAlignGroupContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateActionContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLActionContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SmXMLImport::~SmXMLImport() throw ()
-{
- delete pPresLayoutElemTokenMap;
- delete pPresElemTokenMap;
- delete pPresScriptEmptyElemTokenMap;
- delete pPresTableElemTokenMap;
- delete pPresLayoutAttrTokenMap;
- delete pFencedAttrTokenMap;
- delete pColorTokenMap;
- delete pOperatorAttrTokenMap;
- delete pAnnotationAttrTokenMap;
-}
-
-void SmXMLImport::SetViewSettings(const Sequence<PropertyValue>& aViewProps)
-{
- uno::Reference <frame::XModel> xModel = GetModel();
- if ( !xModel.is() )
- return;
-
- uno::Reference <lang::XUnoTunnel> xTunnel;
- xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
- SmModel *pModel = reinterpret_cast<SmModel *>
- (xTunnel->getSomething(SmModel::getUnoTunnelId()));
-
- if ( !pModel )
- return;
-
- SmDocShell *pDocShell =
- static_cast<SmDocShell*>(pModel->GetObjectShell());
- if ( !pDocShell )
- return;
-
- Rectangle aRect( pDocShell->GetVisArea() );
-
- sal_Int32 nCount = aViewProps.getLength();
- const PropertyValue *pValue = aViewProps.getConstArray();
-
- long nTmp = 0;
- //sal_Bool bShowDeletes = sal_False, bShowInserts = sal_False, bShowFooter = sal_False, bShowHeader = sal_False;
-
- for (sal_Int32 i = 0; i < nCount ; i++)
- {
- if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaTop" ) ) )
- {
- pValue->Value >>= nTmp;
- aRect.setY( nTmp );
- }
- else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaLeft" ) ) )
- {
- pValue->Value >>= nTmp;
- aRect.setX( nTmp );
- }
- else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaWidth" ) ) )
- {
- pValue->Value >>= nTmp;
- Size aSize( aRect.GetSize() );
- aSize.Width() = nTmp;
- aRect.SetSize( aSize );
- }
- else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaHeight" ) ) )
- {
- pValue->Value >>= nTmp;
- Size aSize( aRect.GetSize() );
- aSize.Height() = nTmp;
- aRect.SetSize( aSize );
- }
- pValue++;
- }
-
- pDocShell->SetVisArea ( aRect );
-}
-
-void SmXMLImport::SetConfigurationSettings(const Sequence<PropertyValue>& aConfProps)
-{
- uno::Reference < XPropertySet > xProps ( GetModel(), UNO_QUERY );
- if ( xProps.is() )
- {
- Reference < XPropertySetInfo > xInfo ( xProps->getPropertySetInfo() );
- if (xInfo.is() )
- {
- sal_Int32 nCount = aConfProps.getLength();
- const PropertyValue* pValues = aConfProps.getConstArray();
-
- const OUString sFormula ( RTL_CONSTASCII_USTRINGPARAM ( "Formula" ) );
- const OUString sBasicLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "BasicLibraries" ) );
- const OUString sDialogLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "DialogLibraries" ) );
- while ( nCount-- )
- {
- if (pValues->Name != sFormula &&
- pValues->Name != sBasicLibraries &&
- pValues->Name != sDialogLibraries)
- {
- try
- {
- if ( xInfo->hasPropertyByName( pValues->Name ) )
- xProps->setPropertyValue( pValues->Name, pValues->Value );
- }
- catch( Exception& )
- {
- DBG_ERROR( "SmXMLImport::SetConfigurationSettings: Exception!" );
- }
- }
-
- pValues++;
- }
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-
+/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: x $ + * $Revision: 1.00 $ + * + * 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_starmath.hxx" + +/*todo: Change characters and tcharacters to accumulate the characters together +into one string, xml parser hands them to us line by line rather than all in +one go*/ + +#include <com/sun/star/xml/sax/XErrorHandler.hpp> +#include <com/sun/star/xml/sax/XEntityResolver.hpp> +#include <com/sun/star/xml/sax/InputSource.hpp> +#include <com/sun/star/xml/sax/XDTDHandler.hpp> +#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/io/XActiveDataSource.hpp> +#include <com/sun/star/io/XActiveDataControl.hpp> +#include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <com/sun/star/packages/zip/ZipIOException.hpp> +#include <com/sun/star/task/XStatusIndicatorFactory.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/uno/Any.h> + +#include <rtl/math.hxx> +#include <sfx2/frame.hxx> +#include <sfx2/docfile.hxx> +#include <tools/debug.hxx> +#include <tools/urlobj.hxx> +#include <svtools/sfxecode.hxx> +#include <unotools/saveopt.hxx> +#include <svl/stritem.hxx> +#include <svl/itemprop.hxx> +#include <unotools/processfactory.hxx> +#include <unotools/streamwrap.hxx> +#include <xmloff/xmlnmspe.hxx> +#include <xmloff/xmltoken.hxx> +#include <xmloff/nmspmap.hxx> +#include <xmloff/attrlist.hxx> +#include <xmloff/xmluconv.hxx> +#include <xmloff/xmlmetai.hxx> +#include <osl/mutex.hxx> +#include <comphelper/genericpropertyset.hxx> + +#include <memory> + +#include "mathmlimport.hxx" +#include "mathtype.hxx" +#include <starmath.hrc> +#include <unomodel.hxx> +#include <document.hxx> +#include <utility.hxx> + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::document; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star; +using namespace ::xmloff::token; + +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +#define IMPORT_SVC_NAME RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.XMLImportFilter") + +#undef WANTEXCEPT + +//////////////////////////////////////////////////////////// + +ULONG SmXMLImportWrapper::Import(SfxMedium &rMedium) +{ + ULONG nError = ERRCODE_SFX_DOLOADFAILED; + + uno::Reference<lang::XMultiServiceFactory> xServiceFactory( + utl::getProcessServiceFactory()); + DBG_ASSERT(xServiceFactory.is(), "XMLReader::Read: got no service manager"); + if ( !xServiceFactory.is() ) + return nError; + + //Make a model component from our SmModel + uno::Reference< lang::XComponent > xModelComp( xModel, uno::UNO_QUERY ); + DBG_ASSERT( xModelComp.is(), "XMLReader::Read: got no model" ); + + // try to get an XStatusIndicator from the Medium + uno::Reference<task::XStatusIndicator> xStatusIndicator; + + sal_Bool bEmbedded = sal_False; + uno::Reference <lang::XUnoTunnel> xTunnel; + xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY); + SmModel *pModel = reinterpret_cast<SmModel *> + (xTunnel->getSomething(SmModel::getUnoTunnelId())); + + SmDocShell *pDocShell = pModel ? + static_cast<SmDocShell*>(pModel->GetObjectShell()) : 0; + if (pDocShell) + { +// if (pDocShell->GetMedium()) + { + DBG_ASSERT( pDocShell->GetMedium() == &rMedium, + "different SfxMedium found" ); + + SfxItemSet* pSet = rMedium.GetItemSet(); + if (pSet) + { + const SfxUnoAnyItem* pItem = static_cast<const SfxUnoAnyItem*>( + pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) ); + if (pItem) + pItem->GetValue() >>= xStatusIndicator; + } + } + + if ( SFX_CREATE_MODE_EMBEDDED == pDocShell->GetCreateMode() ) + bEmbedded = sal_True; + } + + comphelper::PropertyMapEntry aInfoMap[] = + { + { "PrivateData", sizeof("PrivateData")-1, 0, + &::getCppuType( (Reference<XInterface> *)0 ), + beans::PropertyAttribute::MAYBEVOID, 0 }, + { "BaseURI", sizeof("BaseURI")-1, 0, + &::getCppuType( (OUString *)0 ), + beans::PropertyAttribute::MAYBEVOID, 0 }, + { "StreamRelPath", sizeof("StreamRelPath")-1, 0, + &::getCppuType( (OUString *)0 ), + beans::PropertyAttribute::MAYBEVOID, 0 }, + { "StreamName", sizeof("StreamName")-1, 0, + &::getCppuType( (OUString *)0 ), + beans::PropertyAttribute::MAYBEVOID, 0 }, + { NULL, 0, 0, NULL, 0, 0 } + }; + uno::Reference< beans::XPropertySet > xInfoSet( + comphelper::GenericPropertySet_CreateInstance( + new comphelper::PropertySetInfo( aInfoMap ) ) ); + + // Set base URI + OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI") ); + xInfoSet->setPropertyValue( sPropName, makeAny( rMedium.GetBaseURL() ) ); + + sal_Int32 nSteps=3; + if ( !(rMedium.IsStorage())) + nSteps = 1; + + sal_Int32 nProgressRange(nSteps); + if (xStatusIndicator.is()) + { + xStatusIndicator->start(String(SmResId(STR_STATSTR_READING)), + nProgressRange); + } + + nSteps=0; + if (xStatusIndicator.is()) + xStatusIndicator->setValue(nSteps++); + + if ( rMedium.IsStorage()) + { + // TODO/LATER: handle the case of embedded links gracefully + if ( bEmbedded ) // && !rMedium.GetStorage()->IsRoot() ) + { + OUString aName( RTL_CONSTASCII_USTRINGPARAM( "dummyObjName" ) ); + if ( rMedium.GetItemSet() ) + { + const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>( + rMedium.GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) ); + if ( pDocHierarchItem ) + aName = pDocHierarchItem->GetValue(); + } + + if ( aName.getLength() ) + { + sPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")); + xInfoSet->setPropertyValue( sPropName, makeAny( aName ) ); + } + } + + sal_Bool bOASIS = ( SotStorage::GetVersion( rMedium.GetStorage() ) > SOFFICE_FILEFORMAT_60 ); + if (xStatusIndicator.is()) + xStatusIndicator->setValue(nSteps++); + + ULONG nWarn = ReadThroughComponent( + rMedium.GetStorage(), xModelComp, "meta.xml", "Meta.xml", + xServiceFactory, xInfoSet, + (bOASIS ? "com.sun.star.comp.Math.XMLOasisMetaImporter" + : "com.sun.star.comp.Math.XMLMetaImporter") ); + + if ( nWarn != ERRCODE_IO_BROKENPACKAGE ) + { + if (xStatusIndicator.is()) + xStatusIndicator->setValue(nSteps++); + + nWarn = ReadThroughComponent( + rMedium.GetStorage(), xModelComp, "settings.xml", 0, + xServiceFactory, xInfoSet, + (bOASIS ? "com.sun.star.comp.Math.XMLOasisSettingsImporter" + : "com.sun.star.comp.Math.XMLSettingsImporter" ) ); + + if ( nWarn != ERRCODE_IO_BROKENPACKAGE ) + { + if (xStatusIndicator.is()) + xStatusIndicator->setValue(nSteps++); + + nError = ReadThroughComponent( + rMedium.GetStorage(), xModelComp, "content.xml", "Content.xml", + xServiceFactory, xInfoSet, "com.sun.star.comp.Math.XMLImporter" ); + } + else + nError = ERRCODE_IO_BROKENPACKAGE; + } + else + nError = ERRCODE_IO_BROKENPACKAGE; + } + else + { + Reference<io::XInputStream> xInputStream = + new utl::OInputStreamWrapper(rMedium.GetInStream()); + + if (xStatusIndicator.is()) + xStatusIndicator->setValue(nSteps++); + + nError = ReadThroughComponent( xInputStream, xModelComp, + xServiceFactory, xInfoSet, "com.sun.star.comp.Math.XMLImporter", FALSE ); + } + + if (xStatusIndicator.is()) + xStatusIndicator->end(); + return nError; +} + + +/// read a component (file + filter version) +ULONG SmXMLImportWrapper::ReadThroughComponent( + Reference<io::XInputStream> xInputStream, + Reference<XComponent> xModelComponent, + Reference<lang::XMultiServiceFactory> & rFactory, + Reference<beans::XPropertySet> & rPropSet, + const sal_Char* pFilterName, + sal_Bool bEncrypted ) +{ + ULONG nError = ERRCODE_SFX_DOLOADFAILED; + DBG_ASSERT(xInputStream.is(), "input stream missing"); + DBG_ASSERT(xModelComponent.is(), "document missing"); + DBG_ASSERT(rFactory.is(), "factory missing"); + DBG_ASSERT(NULL != pFilterName,"I need a service name for the component!"); + + // prepare ParserInputSrouce + xml::sax::InputSource aParserInput; + aParserInput.aInputStream = xInputStream; + + // get parser + Reference< xml::sax::XParser > xParser( + rFactory->createInstance( + OUString::createFromAscii("com.sun.star.xml.sax.Parser") ), + UNO_QUERY ); + DBG_ASSERT( xParser.is(), "Can't create parser" ); + if ( !xParser.is() ) + return nError; + + Sequence<Any> aArgs( 1 ); + aArgs[0] <<= rPropSet; + + // get filter + Reference< xml::sax::XDocumentHandler > xFilter( + rFactory->createInstanceWithArguments( + OUString::createFromAscii(pFilterName), aArgs ), + UNO_QUERY ); + DBG_ASSERT( xFilter.is(), "Can't instantiate filter component." ); + if ( !xFilter.is() ) + return nError; + + // connect parser and filter + xParser->setDocumentHandler( xFilter ); + + // connect model and filter + Reference < XImporter > xImporter( xFilter, UNO_QUERY ); + xImporter->setTargetDocument( xModelComponent ); + + // finally, parser the stream + try + { + xParser->parseStream( aParserInput ); + + uno::Reference<lang::XUnoTunnel> xFilterTunnel; + xFilterTunnel = uno::Reference<lang::XUnoTunnel> + ( xFilter, uno::UNO_QUERY ); + SmXMLImport *pFilter = reinterpret_cast< SmXMLImport * >( + sal::static_int_cast< sal_uIntPtr >( + xFilterTunnel->getSomething( SmXMLImport::getUnoTunnelId() ))); + if ( pFilter && pFilter->GetSuccess() ) + nError = 0; + } + catch( xml::sax::SAXParseException& r ) + { + // sax parser sends wrapped exceptions, + // try to find the original one + xml::sax::SAXException aSaxEx = *(xml::sax::SAXException*)(&r); + sal_Bool bTryChild = sal_True; + + while( bTryChild ) + { + xml::sax::SAXException aTmp; + if ( aSaxEx.WrappedException >>= aTmp ) + aSaxEx = aTmp; + else + bTryChild = sal_False; + } + + packages::zip::ZipIOException aBrokenPackage; + if ( aSaxEx.WrappedException >>= aBrokenPackage ) + return ERRCODE_IO_BROKENPACKAGE; + + if ( bEncrypted ) + nError = ERRCODE_SFX_WRONGPASSWORD; + } + catch( xml::sax::SAXException& r ) + { + packages::zip::ZipIOException aBrokenPackage; + if ( r.WrappedException >>= aBrokenPackage ) + return ERRCODE_IO_BROKENPACKAGE; + + if ( bEncrypted ) + nError = ERRCODE_SFX_WRONGPASSWORD; + } + catch( packages::zip::ZipIOException& ) + { + nError = ERRCODE_IO_BROKENPACKAGE; + } + catch( io::IOException& ) + { + } + + return nError; +} + + +ULONG SmXMLImportWrapper::ReadThroughComponent( + const uno::Reference< embed::XStorage >& xStorage, + Reference<XComponent> xModelComponent, + const sal_Char* pStreamName, + const sal_Char* pCompatibilityStreamName, + Reference<lang::XMultiServiceFactory> & rFactory, + Reference<beans::XPropertySet> & rPropSet, + const sal_Char* pFilterName ) +{ + DBG_ASSERT(xStorage.is(), "Need storage!"); + DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!"); + + // open stream (and set parser input) + OUString sStreamName = OUString::createFromAscii(pStreamName); + uno::Reference < container::XNameAccess > xAccess( xStorage, uno::UNO_QUERY ); + if ( !xAccess->hasByName(sStreamName) || !xStorage->isStreamElement(sStreamName) ) + { + // stream name not found! Then try the compatibility name. + // do we even have an alternative name? + if ( pCompatibilityStreamName ) + sStreamName = OUString::createFromAscii(pCompatibilityStreamName); + } + + // get input stream + try + { + uno::Reference < io::XStream > xEventsStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ ); + + // determine if stream is encrypted or not + uno::Reference < beans::XPropertySet > xProps( xEventsStream, uno::UNO_QUERY ); + Any aAny = xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ) ); + sal_Bool bEncrypted = sal_False; + if ( aAny.getValueType() == ::getBooleanCppuType() ) + aAny >>= bEncrypted; + + // set Base URL + if ( rPropSet.is() ) + { + OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") ); + rPropSet->setPropertyValue( sPropName, makeAny( sStreamName ) ); + } + + + Reference < io::XInputStream > xStream = xEventsStream->getInputStream(); + return ReadThroughComponent( xStream, xModelComponent, rFactory, rPropSet, pFilterName, bEncrypted ); + } + catch ( packages::WrongPasswordException& ) + { + return ERRCODE_SFX_WRONGPASSWORD; + } + catch( packages::zip::ZipIOException& ) + { + return ERRCODE_IO_BROKENPACKAGE; + } + catch ( uno::Exception& ) + { + } + + return ERRCODE_SFX_DOLOADFAILED; +} + +//////////////////////////////////////////////////////////// + +SmXMLImport::SmXMLImport( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, + sal_uInt16 nImportFlags) +: SvXMLImport( xServiceFactory, nImportFlags ), + pPresLayoutElemTokenMap(0), + pPresLayoutAttrTokenMap(0), + pFencedAttrTokenMap(0), + pOperatorAttrTokenMap(0), + pAnnotationAttrTokenMap(0), + pPresElemTokenMap(0), + pPresScriptEmptyElemTokenMap(0), + pPresTableElemTokenMap(0), + pColorTokenMap(0), + bSuccess(sal_False) +{ +} + +const uno::Sequence< sal_Int8 > & SmXMLImport::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if ( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if ( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +OUString SAL_CALL SmXMLImport_getImplementationName() throw() +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLImporter" ) ); +} + +uno::Sequence< OUString > SAL_CALL SmXMLImport_getSupportedServiceNames() + throw() +{ + const OUString aServiceName( IMPORT_SVC_NAME ); + const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL SmXMLImport_createInstance( + const uno::Reference< lang::XMultiServiceFactory > & rSMgr) + throw( uno::Exception ) +{ + // #110680# + // return (cppu::OWeakObject*)new SmXMLImport(IMPORT_ALL); + return (cppu::OWeakObject*)new SmXMLImport(rSMgr, IMPORT_ALL); +} + +//////////////////////////////////////////////////////////// + +OUString SAL_CALL SmXMLImportMeta_getImplementationName() throw() +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLOasisMetaImporter" ) ); +} + +uno::Sequence< OUString > SAL_CALL SmXMLImportMeta_getSupportedServiceNames() +throw() +{ + const OUString aServiceName( IMPORT_SVC_NAME ); + const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL SmXMLImportMeta_createInstance( + const uno::Reference< lang::XMultiServiceFactory > & rSMgr) +throw( uno::Exception ) +{ + // #110680# + // return (cppu::OWeakObject*)new SmXMLImport( IMPORT_META ); + return (cppu::OWeakObject*)new SmXMLImport( rSMgr, IMPORT_META ); +} + +//////////////////////////////////////////////////////////// + +OUString SAL_CALL SmXMLImportSettings_getImplementationName() throw() +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLOasisSettingsImporter" ) ); +} + +uno::Sequence< OUString > SAL_CALL SmXMLImportSettings_getSupportedServiceNames() + throw() +{ + const OUString aServiceName( IMPORT_SVC_NAME ); + const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL SmXMLImportSettings_createInstance( + const uno::Reference< lang::XMultiServiceFactory > & rSMgr) + throw( uno::Exception ) +{ + // #110680# + // return (cppu::OWeakObject*)new SmXMLImport( IMPORT_SETTINGS ); + return (cppu::OWeakObject*)new SmXMLImport( rSMgr, IMPORT_SETTINGS ); +} + +//////////////////////////////////////////////////////////// + +// XServiceInfo +// override empty method from parent class +rtl::OUString SAL_CALL SmXMLImport::getImplementationName() + throw(uno::RuntimeException) +{ + OUString aTxt; + switch( getImportFlags() ) + { + case IMPORT_META: + aTxt = SmXMLImportMeta_getImplementationName(); + break; + case IMPORT_SETTINGS: + aTxt = SmXMLImportSettings_getImplementationName(); + break; + case IMPORT_ALL: + default: + aTxt = SmXMLImport_getImplementationName(); + break; + } + return aTxt; +} + + +sal_Int64 SAL_CALL SmXMLImport::getSomething( + const uno::Sequence< sal_Int8 >&rId ) +throw(uno::RuntimeException) +{ + if ( rId.getLength() == 16 && + 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + rId.getConstArray(), 16 ) ) + return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_uIntPtr >(this)); + + return SvXMLImport::getSomething( rId ); +} + +void SmXMLImport::endDocument(void) + throw(xml::sax::SAXException, uno::RuntimeException) +{ + //Set the resulted tree into the SmDocShell where it belongs + SmNode *pTree; + if (NULL != (pTree = GetTree())) + { + uno::Reference <frame::XModel> xModel = GetModel(); + uno::Reference <lang::XUnoTunnel> xTunnel; + xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY); + SmModel *pModel = reinterpret_cast<SmModel *> + (xTunnel->getSomething(SmModel::getUnoTunnelId())); + + if (pModel) + { + SmDocShell *pDocShell = + static_cast<SmDocShell*>(pModel->GetObjectShell()); + pDocShell->SetFormulaTree(pTree); + if (0 == aText.Len()) //If we picked up no annotation text + { + //Make up some editable text + aText = pDocShell->GetText(); + pTree->CreateTextFromNode(aText); + aText.EraseTrailingChars(); + if ((aText.GetChar(0) == '{') && + (aText.GetChar(aText.Len()-1) == '}')) + { + aText.Erase(0,1); + aText.Erase(aText.Len()-1,1); + } + } + pDocShell->SetText( String() ); + + // Convert symbol names + SmParser &rParser = pDocShell->GetParser(); + BOOL bVal = rParser.IsImportSymbolNames(); + rParser.SetImportSymbolNames( TRUE ); + SmNode *pTmpTree = rParser.Parse( aText ); + aText = rParser.GetText(); + delete pTmpTree; + rParser.SetImportSymbolNames( bVal ); + + pDocShell->SetText( aText ); + } + DBG_ASSERT(pModel,"So there *was* a uno problem after all"); + + bSuccess = sal_True; + } + + SvXMLImport::endDocument(); +} + +//////////////////////////////////////////////////////////// + +class SmXMLImportContext: public SvXMLImportContext +{ +public: + SmXMLImportContext( SmXMLImport &rImport, sal_uInt16 nPrfx, + const OUString& rLName) + : SvXMLImportContext(rImport, nPrfx, rLName) {} + + const SmXMLImport& GetSmImport() const + { + return (const SmXMLImport&)GetImport(); + } + + SmXMLImport& GetSmImport() + { + return (SmXMLImport&)GetImport(); + } + + virtual void TCharacters(const OUString & /*rChars*/); + virtual void Characters(const OUString &rChars); + virtual SvXMLImportContext *CreateChildContext(sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/, const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/); +}; + +void SmXMLImportContext::TCharacters(const OUString & /*rChars*/) +{ +} + +void SmXMLImportContext::Characters(const OUString &rChars) +{ + /* + Whitespace occurring within the content of token elements is "trimmed" + from the ends (i.e. all whitespace at the beginning and end of the + content is removed), and "collapsed" internally (i.e. each sequence of + 1 or more whitespace characters is replaced with one blank character). + */ + //collapsing not done yet! + const OUString &rChars2 = rChars.trim(); + if (rChars2.getLength()) + TCharacters(rChars2/*.collapse()*/); +} + +SvXMLImportContext * SmXMLImportContext::CreateChildContext(sal_uInt16 /*nPrefix*/, + const OUString& /*rLocalName*/, + const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/) +{ + return 0; +} + +//////////////////////////////////////////////////////////// + +struct SmXMLContext_Helper +{ + sal_Int8 nIsBold; + sal_Int8 nIsItalic; + double nFontSize; + sal_Bool bFontNodeNeeded; + OUString sFontFamily; + OUString sColor; + + SmXMLImportContext rContext; + + SmXMLContext_Helper(SmXMLImportContext &rImport) : + nIsBold(-1), nIsItalic(-1), nFontSize(0.0), rContext(rImport) {} + + void RetrieveAttrs(const uno::Reference< xml::sax::XAttributeList > &xAttrList ); + void ApplyAttrs(); +}; + +void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference< + xml::sax::XAttributeList > & xAttrList ) +{ + sal_Int8 nOldIsBold=nIsBold; + sal_Int8 nOldIsItalic=nIsItalic; + double nOldFontSize=nFontSize; + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + OUString sOldFontFamily = sFontFamily; + for (sal_Int16 i=0;i<nAttrCount;i++) + { + OUString sAttrName = xAttrList->getNameByIndex(i); + OUString aLocalName; + sal_uInt16 nPrefix = rContext.GetSmImport().GetNamespaceMap(). + GetKeyByAttrName(sAttrName,&aLocalName); + OUString sValue = xAttrList->getValueByIndex(i); + const SvXMLTokenMap &rAttrTokenMap = + rContext.GetSmImport().GetPresLayoutAttrTokenMap(); + switch(rAttrTokenMap.Get(nPrefix,aLocalName)) + { + case XML_TOK_FONTWEIGHT: + nIsBold = sValue.equals(GetXMLToken(XML_BOLD)); + break; + case XML_TOK_FONTSTYLE: + nIsItalic = sValue.equals(GetXMLToken(XML_ITALIC)); + break; + case XML_TOK_FONTSIZE: + SvXMLUnitConverter::convertDouble(nFontSize,sValue); + rContext.GetSmImport().GetMM100UnitConverter(). + setXMLMeasureUnit(MAP_POINT); + if (-1 == sValue.indexOf(GetXMLToken(XML_UNIT_PT))) + { + if (-1 == sValue.indexOf('%')) + nFontSize=0.0; + else + { + rContext.GetSmImport().GetMM100UnitConverter(). + setXMLMeasureUnit(MAP_RELATIVE); + } + } + break; + case XML_TOK_FONTFAMILY: + sFontFamily = sValue; + break; + case XML_TOK_COLOR: + sColor = sValue; + break; + default: + break; + } + } + + if ((nOldIsBold!=nIsBold) || (nOldIsItalic!=nIsItalic) || + (nOldFontSize!=nFontSize) || (sOldFontFamily!=sFontFamily) + || sColor.getLength()) + bFontNodeNeeded=sal_True; + else + bFontNodeNeeded=sal_False; +} + +void SmXMLContext_Helper::ApplyAttrs() +{ + SmNodeStack &rNodeStack = rContext.GetSmImport().GetNodeStack(); + + if (bFontNodeNeeded) + { + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 5; + + if (nIsBold != -1) + { + if (nIsBold) + aToken.eType = TBOLD; + else + aToken.eType = TNBOLD; + SmStructureNode *pFontNode = static_cast<SmStructureNode *> + (new SmFontNode(aToken)); + pFontNode->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pFontNode); + } + if (nIsItalic != -1) + { + if (nIsItalic) + aToken.eType = TITALIC; + else + aToken.eType = TNITALIC; + SmStructureNode *pFontNode = static_cast<SmStructureNode *> + (new SmFontNode(aToken)); + pFontNode->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pFontNode); + } + if (nFontSize != 0.0) + { + aToken.eType = TSIZE; + SmFontNode *pFontNode = new SmFontNode(aToken); + + if (MAP_RELATIVE == rContext.GetSmImport().GetMM100UnitConverter(). + getXMLMeasureUnit()) + { + if (nFontSize < 100.00) + pFontNode->SetSizeParameter(Fraction(100.00/nFontSize), + FNTSIZ_DIVIDE); + else + pFontNode->SetSizeParameter(Fraction(nFontSize/100.00), + FNTSIZ_MULTIPLY); + } + else + pFontNode->SetSizeParameter(Fraction(nFontSize),FNTSIZ_ABSOLUT); + + pFontNode->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pFontNode); + } + if (sFontFamily.getLength()) + { + if (sFontFamily.equalsIgnoreAsciiCase(GetXMLToken(XML_FIXED))) + aToken.eType = TFIXED; + else if (sFontFamily.equalsIgnoreAsciiCase(OUString( + RTL_CONSTASCII_USTRINGPARAM("sans")))) + aToken.eType = TSANS; + else if (sFontFamily.equalsIgnoreAsciiCase(OUString( + RTL_CONSTASCII_USTRINGPARAM("serif")))) + aToken.eType = TSERIF; + else //Just give up, we need to extend our font mechanism to be + //more general + return; + + aToken.aText = sFontFamily; + SmFontNode *pFontNode = new SmFontNode(aToken); + pFontNode->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pFontNode); + } + if (sColor.getLength()) + { + //Again we can only handle a small set of colours in + //StarMath for now. + const SvXMLTokenMap& rTokenMap = + rContext.GetSmImport().GetColorTokenMap(); + aToken.eType = static_cast<SmTokenType>(rTokenMap.Get( + XML_NAMESPACE_MATH, sColor)); + if (aToken.eType != -1) + { + SmFontNode *pFontNode = new SmFontNode(aToken); + pFontNode->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pFontNode); + } + } + + } +} + +//////////////////////////////////////////////////////////// + +class SmXMLDocContext_Impl : public SmXMLImportContext +{ +public: + SmXMLDocContext_Impl( SmXMLImport &rImport, sal_uInt16 nPrfx, + const OUString& rLName) + : SmXMLImportContext(rImport,nPrfx,rLName) {} + + virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList); + + void EndElement(); +}; + +//////////////////////////////////////////////////////////// + +/*avert thy gaze from the proginator*/ +class SmXMLRowContext_Impl : public SmXMLDocContext_Impl +{ +protected: + ULONG nElementCount; + +public: + SmXMLRowContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLDocContext_Impl(rImport,nPrefix,rLName) + { nElementCount = GetSmImport().GetNodeStack().Count(); } + + virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList); + + SvXMLImportContext *StrictCreateChildContext(sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList > &xAttrList); + + void EndElement(); +}; + +//////////////////////////////////////////////////////////// + +class SmXMLFracContext_Impl : public SmXMLRowContext_Impl +{ +public: + SmXMLFracContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {} + + void EndElement(); +}; + +//////////////////////////////////////////////////////////// + +class SmXMLSqrtContext_Impl : public SmXMLRowContext_Impl +{ +public: + SmXMLSqrtContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {} + + void EndElement(); +}; + +//////////////////////////////////////////////////////////// + +class SmXMLRootContext_Impl : public SmXMLRowContext_Impl +{ +public: + SmXMLRootContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {} + + void EndElement(); +}; + +//////////////////////////////////////////////////////////// + +class SmXMLStyleContext_Impl : public SmXMLRowContext_Impl +{ +protected: + SmXMLContext_Helper aStyleHelper; + +public: + /*Right now the style tag is completely ignored*/ + SmXMLStyleContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) : SmXMLRowContext_Impl(rImport,nPrefix,rLName), + aStyleHelper(*this) {} + + void EndElement(); + void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList ); +}; + +void SmXMLStyleContext_Impl::StartElement(const uno::Reference< + xml::sax::XAttributeList > & xAttrList ) +{ +#if 1 + aStyleHelper.RetrieveAttrs(xAttrList); +#else + sal_Int8 nOldIsBold=nIsBold; + sal_Int8 nOldIsItalic=nIsItalic; + double nOldFontSize=nFontSize; + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + OUString sOldFontFamily = sFontFamily; + for (sal_Int16 i=0;i<nAttrCount;i++) + { + OUString sAttrName = xAttrList->getNameByIndex(i); + OUString aLocalName; + sal_uInt16 nPrefix = GetImport().GetNamespaceMap(). + GetKeyByAttrName(sAttrName,&aLocalName); + OUString sValue = xAttrList->getValueByIndex(i); + const SvXMLTokenMap &rAttrTokenMap = + GetSmImport().GetPresLayoutAttrTokenMap(); + switch(rAttrTokenMap.Get(nPrefix,aLocalName)) + { + case XML_TOK_FONTWEIGHT: + nIsBold = sValue.equals(GetXMLToken(XML_BOLD)); + break; + case XML_TOK_FONTSTYLE: + nIsItalic = sValue.equals(GetXMLToken(XML_ITALIC)); + break; + case XML_TOK_FONTSIZE: + SvXMLUnitConverter::convertDouble(nFontSize,sValue); + GetSmImport().GetMM100UnitConverter(). + setXMLMeasureUnit(MAP_POINT); + if (-1 == sValue.indexOf(GetXMLToken(XML_UNIT_PT))) + if (-1 == sValue.indexOf('%')) + nFontSize=0.0; + else + { + GetSmImport().GetMM100UnitConverter(). + setXMLMeasureUnit(MAP_RELATIVE); + } + break; + case XML_TOK_FONTFAMILY: + sFontFamily = sValue; + break; + case XML_TOK_COLOR: + sColor = sValue; + break; + default: + break; + } + } + + if ((nOldIsBold!=nIsBold) || (nOldIsItalic!=nIsItalic) || + (nOldFontSize!=nFontSize) || (sOldFontFamily!=sFontFamily) + || sColor.getLength()) + bFontNodeNeeded=sal_True; + else + bFontNodeNeeded=sal_False; +#endif +} + + +void SmXMLStyleContext_Impl::EndElement() +{ + /* + <mstyle> accepts any number of arguments; if this number is not 1, its + contents are treated as a single "inferred <mrow>" containing its + arguments + */ + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + if (rNodeStack.Count() - nElementCount > 1) + SmXMLRowContext_Impl::EndElement(); +#if 1 + aStyleHelper.ApplyAttrs(); +#else + if (bFontNodeNeeded) + { + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 5; + + if (nIsBold != -1) + { + if (nIsBold) + aToken.eType = TBOLD; + else + aToken.eType = TNBOLD; + SmStructureNode *pFontNode = static_cast<SmStructureNode *> + (new SmFontNode(aToken)); + pFontNode->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pFontNode); + } + if (nIsItalic != -1) + { + if (nIsItalic) + aToken.eType = TITALIC; + else + aToken.eType = TNITALIC; + SmStructureNode *pFontNode = static_cast<SmStructureNode *> + (new SmFontNode(aToken)); + pFontNode->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pFontNode); + } + if (nFontSize != 0.0) + { + aToken.eType = TSIZE; + SmFontNode *pFontNode = new SmFontNode(aToken); + + if (MAP_RELATIVE == GetSmImport().GetMM100UnitConverter(). + getXMLMeasureUnit()) + { + if (nFontSize < 100.00) + pFontNode->SetSizeParameter(Fraction(100.00/nFontSize), + FNTSIZ_DIVIDE); + else + pFontNode->SetSizeParameter(Fraction(nFontSize/100.00), + FNTSIZ_MULTIPLY); + } + else + pFontNode->SetSizeParameter(Fraction(nFontSize),FNTSIZ_ABSOLUT); + + pFontNode->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pFontNode); + } + if (sFontFamily.getLength()) + { + if (sFontFamily.equalsIgnoreCase(GetXMLToken(XML_FIXED))) + aToken.eType = TFIXED; + else if (sFontFamily.equalsIgnoreCase(OUString( + RTL_CONSTASCII_USTRINGPARAM("sans")))) + aToken.eType = TSANS; + else if (sFontFamily.equalsIgnoreCase(OUString( + RTL_CONSTASCII_USTRINGPARAM("serif")))) + aToken.eType = TSERIF; + else //Just give up, we need to extend our font mechanism to be + //more general + return; + + aToken.aText = sFontFamily; + SmFontNode *pFontNode = new SmFontNode(aToken); + pFontNode->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pFontNode); + } + if (sColor.getLength()) + { + //Again we can only handle a small set of colours in + //StarMath for now. + const SvXMLTokenMap& rTokenMap = + GetSmImport().GetColorTokenMap(); + aToken.eType = static_cast<SmTokenType>(rTokenMap.Get( + XML_NAMESPACE_MATH, sColor)); + if (aToken.eType != -1) + { + SmFontNode *pFontNode = new SmFontNode(aToken); + pFontNode->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pFontNode); + } + } + + } +#endif +} + +//////////////////////////////////////////////////////////// + +class SmXMLPaddedContext_Impl : public SmXMLRowContext_Impl +{ +public: + /*Right now the style tag is completely ignored*/ + SmXMLPaddedContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {} + + void EndElement(); +}; + +void SmXMLPaddedContext_Impl::EndElement() +{ + /* + <mpadded> accepts any number of arguments; if this number is not 1, its + contents are treated as a single "inferred <mrow>" containing its + arguments + */ + if (GetSmImport().GetNodeStack().Count() - nElementCount > 1) + SmXMLRowContext_Impl::EndElement(); +} + +//////////////////////////////////////////////////////////// + +class SmXMLPhantomContext_Impl : public SmXMLRowContext_Impl +{ +public: + /*Right now the style tag is completely ignored*/ + SmXMLPhantomContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {} + + void EndElement(); +}; + +void SmXMLPhantomContext_Impl::EndElement() +{ + /* + <mphantom> accepts any number of arguments; if this number is not 1, its + contents are treated as a single "inferred <mrow>" containing its + arguments + */ + if (GetSmImport().GetNodeStack().Count() - nElementCount > 1) + SmXMLRowContext_Impl::EndElement(); + + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 5; + aToken.eType = TPHANTOM; + + SmStructureNode *pPhantom = static_cast<SmStructureNode *> + (new SmFontNode(aToken)); + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + pPhantom->SetSubNodes(0,rNodeStack.Pop()); + rNodeStack.Push(pPhantom); +} + +//////////////////////////////////////////////////////////// + +class SmXMLFencedContext_Impl : public SmXMLRowContext_Impl +{ +protected: + sal_Unicode cBegin; + sal_Unicode cEnd; + +public: + SmXMLFencedContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLRowContext_Impl(rImport,nPrefix,rLName), + cBegin('('), cEnd(')') {} + + void StartElement(const uno::Reference< xml::sax::XAttributeList > & xAttrList ); + void EndElement(); +}; + + +void SmXMLFencedContext_Impl::StartElement(const uno::Reference< + xml::sax::XAttributeList > & xAttrList ) +{ + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + for (sal_Int16 i=0;i<nAttrCount;i++) + { + OUString sAttrName = xAttrList->getNameByIndex(i); + OUString aLocalName; + sal_uInt16 nPrefix = GetImport().GetNamespaceMap(). + GetKeyByAttrName(sAttrName,&aLocalName); + OUString sValue = xAttrList->getValueByIndex(i); + const SvXMLTokenMap &rAttrTokenMap = + GetSmImport().GetFencedAttrTokenMap(); + switch(rAttrTokenMap.Get(nPrefix,aLocalName)) + { + //temp, starmath cannot handle multichar brackets (I think) + case XML_TOK_OPEN: + cBegin = sValue[0]; + break; + case XML_TOK_CLOSE: + cEnd = sValue[0]; + break; + default: + /*Go to superclass*/ + break; + } + } +} + + +void SmXMLFencedContext_Impl::EndElement() +{ + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.aText = ','; + aToken.eType = TLEFT; + aToken.nLevel = 5; + + aToken.eType = TLPARENT; + aToken.cMathChar = cBegin; + SmStructureNode *pSNode = new SmBraceNode(aToken); + SmNode *pLeft = new SmMathSymbolNode(aToken); + + aToken.cMathChar = cEnd; + aToken.eType = TRPARENT; + SmNode *pRight = new SmMathSymbolNode(aToken); + + SmNodeArray aRelationArray; + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + + aToken.cMathChar = '\0'; + aToken.aText = ','; + aToken.eType = TIDENT; + + ULONG i = rNodeStack.Count() - nElementCount; + if (rNodeStack.Count() - nElementCount > 1) + i += rNodeStack.Count() - 1 - nElementCount; + aRelationArray.resize(i); + while (rNodeStack.Count() > nElementCount) + { + aRelationArray[--i] = rNodeStack.Pop(); + if (i > 1 && rNodeStack.Count() > 1) + aRelationArray[--i] = new SmGlyphSpecialNode(aToken); + } + + SmToken aDummy; + SmStructureNode *pBody = new SmExpressionNode(aDummy); + pBody->SetSubNodes(aRelationArray); + + + pSNode->SetSubNodes(pLeft,pBody,pRight); + pSNode->SetScaleMode(SCALE_HEIGHT); + GetSmImport().GetNodeStack().Push(pSNode); +} + + +//////////////////////////////////////////////////////////// + +class SmXMLErrorContext_Impl : public SmXMLRowContext_Impl +{ +public: + SmXMLErrorContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {} + + void EndElement(); +}; + +void SmXMLErrorContext_Impl::EndElement() +{ + /*Right now the error tag is completely ignored, what + can I do with it in starmath, ?, maybe we need a + report window ourselves, do a test for validity of + the xml input, use merrors, and then generate + the markup inside the merror with a big red colour + of something. For now just throw them all away. + */ + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + while (rNodeStack.Count() > nElementCount) + { + SmNode *pNode = rNodeStack.Pop(); + delete pNode; + } +} + +//////////////////////////////////////////////////////////// + +class SmXMLNumberContext_Impl : public SmXMLImportContext +{ +protected: + SmToken aToken; + +public: + SmXMLNumberContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLImportContext(rImport,nPrefix,rLName) + { + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 5; + aToken.eType = TNUMBER; + } + + virtual void TCharacters(const OUString &rChars); + + void EndElement(); +}; + +void SmXMLNumberContext_Impl::TCharacters(const OUString &rChars) +{ + aToken.aText = rChars; +} + +void SmXMLNumberContext_Impl::EndElement() +{ + GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_NUMBER)); +} + +//////////////////////////////////////////////////////////// + +class SmXMLAnnotationContext_Impl : public SmXMLImportContext +{ + sal_Bool bIsStarMath; + +public: + SmXMLAnnotationContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLImportContext(rImport,nPrefix,rLName), bIsStarMath(sal_False) {} + + virtual void Characters(const OUString &rChars); + + void StartElement(const uno::Reference<xml::sax::XAttributeList > & xAttrList ); +}; + +void SmXMLAnnotationContext_Impl::StartElement(const uno::Reference< + xml::sax::XAttributeList > & xAttrList ) +{ + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + for (sal_Int16 i=0;i<nAttrCount;i++) + { + OUString sAttrName = xAttrList->getNameByIndex(i); + OUString aLocalName; + sal_uInt16 nPrefix = GetImport().GetNamespaceMap(). + GetKeyByAttrName(sAttrName,&aLocalName); + + OUString sValue = xAttrList->getValueByIndex(i); + const SvXMLTokenMap &rAttrTokenMap = + GetSmImport().GetAnnotationAttrTokenMap(); + switch(rAttrTokenMap.Get(nPrefix,aLocalName)) + { + case XML_TOK_ENCODING: + bIsStarMath= sValue.equals( + OUString(RTL_CONSTASCII_USTRINGPARAM("StarMath 5.0"))); + break; + default: + break; + } + } +} + +void SmXMLAnnotationContext_Impl::Characters(const OUString &rChars) +{ + if (bIsStarMath) + GetSmImport().GetText().Append(String(rChars)); +} + +//////////////////////////////////////////////////////////// + +class SmXMLTextContext_Impl : public SmXMLImportContext +{ +protected: + SmToken aToken; + +public: + SmXMLTextContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLImportContext(rImport,nPrefix,rLName) + { + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 5; + aToken.eType = TTEXT; + } + + virtual void TCharacters(const OUString &rChars); + + void EndElement(); +}; + +void SmXMLTextContext_Impl::TCharacters(const OUString &rChars) +{ + aToken.aText = rChars; +} + +void SmXMLTextContext_Impl::EndElement() +{ + GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_TEXT)); +} + +//////////////////////////////////////////////////////////// + +class SmXMLStringContext_Impl : public SmXMLImportContext +{ +protected: + SmToken aToken; + +public: + SmXMLStringContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLImportContext(rImport,nPrefix,rLName) + { + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 5; + aToken.eType = TTEXT; + } + + virtual void TCharacters(const OUString &rChars); + + void EndElement(); +}; + +void SmXMLStringContext_Impl::TCharacters(const OUString &rChars) +{ + /* + The content of <ms> elements should be rendered with visible "escaping" of + certain characters in the content, including at least "double quote" + itself, and preferably whitespace other than individual blanks. The intent + is for the viewer to see that the expression is a string literal, and to + see exactly which characters form its content. For example, <ms>double + quote is "</ms> might be rendered as "double quote is \"". + + Obviously this isn't fully done here. + */ + aToken.aText.Erase(); + aToken.aText += '\"'; + aToken.aText += String(rChars); + aToken.aText += '\"'; +} + +void SmXMLStringContext_Impl::EndElement() +{ + GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_FIXED)); +} + +//////////////////////////////////////////////////////////// + +class SmXMLIdentifierContext_Impl : public SmXMLImportContext +{ +protected: + SmXMLContext_Helper aStyleHelper; + SmToken aToken; + +public: + SmXMLIdentifierContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLImportContext(rImport,nPrefix,rLName),aStyleHelper(*this) + { + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 5; + aToken.eType = TIDENT; + } + + void TCharacters(const OUString &rChars); + void StartElement(const uno::Reference< xml::sax::XAttributeList > & xAttrList ) + { + aStyleHelper.RetrieveAttrs(xAttrList); + }; + void EndElement(); +}; + +void SmXMLIdentifierContext_Impl::EndElement() +{ + SmTextNode *pNode = 0; + //we will handle identifier italic/normal here instead of with a standalone + //font node + if (((aStyleHelper.nIsItalic == -1) && (aToken.aText.Len() > 1)) + || ((aStyleHelper.nIsItalic == 0) && (aToken.aText.Len() == 1))) + { + pNode = new SmTextNode(aToken,FNT_FUNCTION); + pNode->GetFont().SetItalic(ITALIC_NONE); + aStyleHelper.nIsItalic = -1; + } + else + pNode = new SmTextNode(aToken,FNT_VARIABLE); + if (aStyleHelper.bFontNodeNeeded && aStyleHelper.nIsItalic != -1) + { + if (aStyleHelper.nIsItalic) + pNode->GetFont().SetItalic(ITALIC_NORMAL); + else + pNode->GetFont().SetItalic(ITALIC_NONE); + } + + if ((-1!=aStyleHelper.nIsBold) || (0.0!=aStyleHelper.nFontSize) || + (aStyleHelper.sFontFamily.getLength()) || + aStyleHelper.sColor.getLength()) + aStyleHelper.bFontNodeNeeded=sal_True; + else + aStyleHelper.bFontNodeNeeded=sal_False; + if (aStyleHelper.bFontNodeNeeded) + aStyleHelper.ApplyAttrs(); + GetSmImport().GetNodeStack().Push(pNode); +} + +void SmXMLIdentifierContext_Impl::TCharacters(const OUString &rChars) +{ + aToken.aText = rChars; +} + +//////////////////////////////////////////////////////////// + +class SmXMLOperatorContext_Impl : public SmXMLImportContext +{ + sal_Bool bIsStretchy; + +protected: + SmToken aToken; + +public: + SmXMLOperatorContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLImportContext(rImport,nPrefix,rLName), bIsStretchy(sal_False) + { + aToken.nGroup = 0; + aToken.eType = TSPECIAL; + aToken.nLevel = 5; + } + + void TCharacters(const OUString &rChars); + void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList ); + void EndElement(); +}; + +void SmXMLOperatorContext_Impl::TCharacters(const OUString &rChars) +{ + aToken.cMathChar = rChars[0]; +} + +void SmXMLOperatorContext_Impl::EndElement() +{ + SmMathSymbolNode *pNode = new SmMathSymbolNode(aToken); + //For stretchy scaling the scaling must be retrieved from this node + //and applied to the expression itself so as to get the expression + //to scale the operator to the height of the expression itself + if (bIsStretchy) + pNode->SetScaleMode(SCALE_HEIGHT); + GetSmImport().GetNodeStack().Push(pNode); +} + + + +void SmXMLOperatorContext_Impl::StartElement(const uno::Reference< + xml::sax::XAttributeList > & xAttrList ) +{ + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + for (sal_Int16 i=0;i<nAttrCount;i++) + { + OUString sAttrName = xAttrList->getNameByIndex(i); + OUString aLocalName; + sal_uInt16 nPrefix = GetImport().GetNamespaceMap(). + GetKeyByAttrName(sAttrName,&aLocalName); + + OUString sValue = xAttrList->getValueByIndex(i); + const SvXMLTokenMap &rAttrTokenMap = + GetSmImport().GetOperatorAttrTokenMap(); + switch(rAttrTokenMap.Get(nPrefix,aLocalName)) + { + case XML_TOK_STRETCHY: + bIsStretchy = sValue.equals( + GetXMLToken(XML_TRUE)); + break; + default: + break; + } + } +} + + +//////////////////////////////////////////////////////////// + +class SmXMLSpaceContext_Impl : public SmXMLImportContext +{ +public: + SmXMLSpaceContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLImportContext(rImport,nPrefix,rLName) {} + + void StartElement(const uno::Reference< xml::sax::XAttributeList >& xAttrList ); +}; + +void SmXMLSpaceContext_Impl::StartElement( + const uno::Reference<xml::sax::XAttributeList > & /*xAttrList*/ ) +{ + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.eType = TBLANK; + aToken.nLevel = 5; + SmBlankNode *pBlank = new SmBlankNode(aToken); + pBlank->IncreaseBy(aToken); + GetSmImport().GetNodeStack().Push(pBlank); +} + +//////////////////////////////////////////////////////////// + +class SmXMLSubContext_Impl : public SmXMLRowContext_Impl +{ +protected: + void GenericEndElement(SmTokenType eType,SmSubSup aSubSup); + +public: + SmXMLSubContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {} + + void EndElement() + { + GenericEndElement(TRSUB,RSUB); + } +}; + + +void SmXMLSubContext_Impl::GenericEndElement(SmTokenType eType, SmSubSup eSubSup) +{ + /*The <msub> element requires exactly 2 arguments.*/ + DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2, + "Sub has not two arguments"); + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 0; + aToken.eType = eType; + SmSubSupNode *pNode = new SmSubSupNode(aToken); + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + + // initialize subnodes array + SmNodeArray aSubNodes; + aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES); + for (ULONG i = 1; i < aSubNodes.size(); i++) + aSubNodes[i] = NULL; + + aSubNodes[eSubSup+1] = rNodeStack.Pop(); + aSubNodes[0] = rNodeStack.Pop(); + pNode->SetSubNodes(aSubNodes); + rNodeStack.Push(pNode); +} + +//////////////////////////////////////////////////////////// + +class SmXMLSupContext_Impl : public SmXMLSubContext_Impl +{ +public: + SmXMLSupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLSubContext_Impl(rImport,nPrefix,rLName) {} + + void EndElement() + { + GenericEndElement(TRSUP,RSUP); + } +}; + +//////////////////////////////////////////////////////////// + +class SmXMLSubSupContext_Impl : public SmXMLRowContext_Impl +{ +protected: + void GenericEndElement(SmTokenType eType, SmSubSup aSub,SmSubSup aSup); + +public: + SmXMLSubSupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {} + + void EndElement() + { + GenericEndElement(TRSUB,RSUB,RSUP); + } +}; + +void SmXMLSubSupContext_Impl::GenericEndElement(SmTokenType eType, + SmSubSup aSub,SmSubSup aSup) +{ + /*The <msub> element requires exactly 3 arguments.*/ + DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 3, + "SubSup has not three arguments"); + + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 0; + aToken.eType = eType; + SmSubSupNode *pNode = new SmSubSupNode(aToken); + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + + // initialize subnodes array + SmNodeArray aSubNodes; + aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES); + for (ULONG i = 1; i < aSubNodes.size(); i++) + aSubNodes[i] = NULL; + + aSubNodes[aSup+1] = rNodeStack.Pop(); + aSubNodes[aSub+1] = rNodeStack.Pop(); + aSubNodes[0] = rNodeStack.Pop(); + pNode->SetSubNodes(aSubNodes); + rNodeStack.Push(pNode); +} + +//////////////////////////////////////////////////////////// + +class SmXMLUnderContext_Impl : public SmXMLSubContext_Impl +{ +protected: + sal_Int16 nAttrCount; + +public: + SmXMLUnderContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLSubContext_Impl(rImport,nPrefix,rLName) {} + + void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList ); + void EndElement(); + void HandleAccent(); +}; + +void SmXMLUnderContext_Impl::StartElement(const uno::Reference< + xml::sax::XAttributeList > & xAttrList ) +{ + nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; +} + +void SmXMLUnderContext_Impl::HandleAccent() +{ + DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2, + "Sub has not two arguments"); + + /*Just one special case for the underline thing*/ + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + SmNode *pTest = rNodeStack.Pop(); + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 0; + aToken.eType = TUNDERLINE; + + + SmNodeArray aSubNodes; + aSubNodes.resize(2); + + SmStructureNode *pNode = new SmAttributNode(aToken); + if ((pTest->GetToken().cMathChar & 0x0FFF) == 0x0332) + { + aSubNodes[0] = new SmRectangleNode(aToken); + delete pTest; + } + else + aSubNodes[0] = pTest; + + aSubNodes[1] = rNodeStack.Pop(); + pNode->SetSubNodes(aSubNodes); + pNode->SetScaleMode(SCALE_WIDTH); + rNodeStack.Push(pNode); +} + + +void SmXMLUnderContext_Impl::EndElement() +{ + if (!nAttrCount) + GenericEndElement(TCSUB,CSUB); + else + HandleAccent(); +#if 0 + //UnderBrace trick + SmStructureNode *pNode = rNodeStack.Pop(); + if (pNode->GetSubNode(1)->GetToken().cMathChar == (0x0332|0xf000)) + if (pNode->GetSubNode(0)->GetToken().cMathChar == (0x0332|0xf000)) +#endif +} + +//////////////////////////////////////////////////////////// + +class SmXMLOverContext_Impl : public SmXMLSubContext_Impl +{ +protected: + sal_Int16 nAttrCount; + +public: + SmXMLOverContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLSubContext_Impl(rImport,nPrefix,rLName), nAttrCount(0) {} + + void EndElement(); + void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList ); + void HandleAccent(); +}; + + +void SmXMLOverContext_Impl::StartElement(const uno::Reference< + xml::sax::XAttributeList > & xAttrList ) +{ + nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; +} + + +void SmXMLOverContext_Impl::EndElement() +{ + if (!nAttrCount) + GenericEndElement(TCSUP,CSUP); + else + HandleAccent(); +} + + +void SmXMLOverContext_Impl::HandleAccent() +{ + DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2, + "Sub has not two arguments"); + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 0; + aToken.eType = TACUTE; + + SmAttributNode *pNode = new SmAttributNode(aToken); + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + + SmNodeArray aSubNodes; + aSubNodes.resize(2); + aSubNodes[0] = rNodeStack.Pop(); + aSubNodes[1] = rNodeStack.Pop(); + pNode->SetSubNodes(aSubNodes); + pNode->SetScaleMode(SCALE_WIDTH); + rNodeStack.Push(pNode); + +} + +//////////////////////////////////////////////////////////// + +class SmXMLUnderOverContext_Impl : public SmXMLSubSupContext_Impl +{ +public: + SmXMLUnderOverContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLSubSupContext_Impl(rImport,nPrefix,rLName) {} + + void EndElement() + { + GenericEndElement(TCSUB,CSUB,CSUP); + } +}; + +//////////////////////////////////////////////////////////// + +class SmXMLMultiScriptsContext_Impl : public SmXMLSubSupContext_Impl +{ + sal_Bool bHasPrescripts; + +public: + SmXMLMultiScriptsContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) : + SmXMLSubSupContext_Impl(rImport,nPrefix,rLName), + bHasPrescripts(FALSE) {} + + void EndElement(); + void MiddleElement(); + SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList > &xAttrList); +}; + +//////////////////////////////////////////////////////////// + +class SmXMLNoneContext_Impl : public SmXMLImportContext +{ +public: + SmXMLNoneContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLImportContext(rImport,nPrefix,rLName) {} + + void EndElement(); +}; + + +void SmXMLNoneContext_Impl::EndElement(void) +{ + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.aText.Erase(); + aToken.nLevel = 5; + aToken.eType = TIDENT; + GetSmImport().GetNodeStack().Push( + new SmTextNode(aToken,FNT_VARIABLE)); +} + +//////////////////////////////////////////////////////////// + +class SmXMLPrescriptsContext_Impl : public SmXMLImportContext +{ +public: + SmXMLPrescriptsContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) + : SmXMLImportContext(rImport,nPrefix,rLName) {} +}; + +//////////////////////////////////////////////////////////// + +class SmXMLTableRowContext_Impl : public SmXMLRowContext_Impl +{ +public: + SmXMLTableRowContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) : + SmXMLRowContext_Impl(rImport,nPrefix,rLName) + {} + + SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList > &xAttrList); +}; + + +//////////////////////////////////////////////////////////// + +class SmXMLTableContext_Impl : public SmXMLTableRowContext_Impl +{ +public: + SmXMLTableContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) : + SmXMLTableRowContext_Impl(rImport,nPrefix,rLName) + {} + + void EndElement(); + SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList > &xAttrList); +}; + + +//////////////////////////////////////////////////////////// + +class SmXMLTableCellContext_Impl : public SmXMLRowContext_Impl +{ +public: + SmXMLTableCellContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) : + SmXMLRowContext_Impl(rImport,nPrefix,rLName) + {} +}; + +//////////////////////////////////////////////////////////// + +class SmXMLAlignGroupContext_Impl : public SmXMLRowContext_Impl +{ +public: + SmXMLAlignGroupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) : + SmXMLRowContext_Impl(rImport,nPrefix,rLName) + {} + + /*Don't do anything with alignment for now*/ + void EndElement() + { + } +}; + +//////////////////////////////////////////////////////////// + +class SmXMLActionContext_Impl : public SmXMLRowContext_Impl +{ +public: + SmXMLActionContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix, + const OUString& rLName) : + SmXMLRowContext_Impl(rImport,nPrefix,rLName) + {} + + void EndElement(); +}; + +//////////////////////////////////////////////////////////// + +// NB: virtually inherit so we can multiply inherit properly +// in SmXMLFlatDocContext_Impl +class SmXMLOfficeContext_Impl : public virtual SvXMLImportContext +{ +public: + SmXMLOfficeContext_Impl( SmXMLImport &rImport, sal_uInt16 nPrfx, + const OUString& rLName) + : SvXMLImportContext(rImport,nPrfx,rLName) {} + + virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList); +}; + +SvXMLImportContext *SmXMLOfficeContext_Impl::CreateChildContext(sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList > &xAttrList) +{ + SvXMLImportContext *pContext = 0; + if ( XML_NAMESPACE_OFFICE == nPrefix && + rLocalName == GetXMLToken(XML_META) ) + { + DBG_WARNING("XML_TOK_DOC_META: should not have come here, maybe document is invalid?"); + } + else if ( XML_NAMESPACE_OFFICE == nPrefix && + rLocalName == GetXMLToken(XML_SETTINGS) ) + { + pContext = new XMLDocumentSettingsContext( GetImport(), + XML_NAMESPACE_OFFICE, rLocalName, + xAttrList ); + } + else + pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); + + return pContext; +} + +//////////////////////////////////////////////////////////// + +// context for flat file xml format +class SmXMLFlatDocContext_Impl + : public SmXMLOfficeContext_Impl, public SvXMLMetaDocumentContext +{ +public: + SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport, + USHORT i_nPrefix, const OUString & i_rLName, + const uno::Reference<document::XDocumentProperties>& i_xDocProps, + const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder); + + virtual ~SmXMLFlatDocContext_Impl(); + + virtual SvXMLImportContext *CreateChildContext(USHORT i_nPrefix, const OUString& i_rLocalName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList); +}; + +SmXMLFlatDocContext_Impl::SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport, + USHORT i_nPrefix, const OUString & i_rLName, + const uno::Reference<document::XDocumentProperties>& i_xDocProps, + const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder) : + SvXMLImportContext(i_rImport, i_nPrefix, i_rLName), + SmXMLOfficeContext_Impl(i_rImport, i_nPrefix, i_rLName), + SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName, + i_xDocProps, i_xDocBuilder) +{ +} + +SmXMLFlatDocContext_Impl::~SmXMLFlatDocContext_Impl() +{ +} + +SvXMLImportContext *SmXMLFlatDocContext_Impl::CreateChildContext( + USHORT i_nPrefix, const OUString& i_rLocalName, + const uno::Reference<xml::sax::XAttributeList>& i_xAttrList) +{ + // behave like meta base class iff we encounter office:meta + if ( XML_NAMESPACE_OFFICE == i_nPrefix && + i_rLocalName == GetXMLToken(XML_META) ) + { + return SvXMLMetaDocumentContext::CreateChildContext( + i_nPrefix, i_rLocalName, i_xAttrList ); + } + else + { + return SmXMLOfficeContext_Impl::CreateChildContext( + i_nPrefix, i_rLocalName, i_xAttrList ); + } +} + +//////////////////////////////////////////////////////////// + +static __FAR_DATA SvXMLTokenMapEntry aPresLayoutElemTokenMap[] = +{ + { XML_NAMESPACE_MATH, XML_SEMANTICS, XML_TOK_SEMANTICS }, + { XML_NAMESPACE_MATH, XML_MATH, XML_TOK_MATH }, + { XML_NAMESPACE_MATH, XML_MSTYLE, XML_TOK_MSTYLE }, + { XML_NAMESPACE_MATH, XML_MERROR, XML_TOK_MERROR }, + { XML_NAMESPACE_MATH, XML_MPHANTOM, XML_TOK_MPHANTOM }, + { XML_NAMESPACE_MATH, XML_MROW, XML_TOK_MROW }, + { XML_NAMESPACE_MATH, XML_MFRAC, XML_TOK_MFRAC }, + { XML_NAMESPACE_MATH, XML_MSQRT, XML_TOK_MSQRT }, + { XML_NAMESPACE_MATH, XML_MROOT, XML_TOK_MROOT }, + { XML_NAMESPACE_MATH, XML_MSUB, XML_TOK_MSUB }, + { XML_NAMESPACE_MATH, XML_MSUP, XML_TOK_MSUP }, + { XML_NAMESPACE_MATH, XML_MSUBSUP, XML_TOK_MSUBSUP }, + { XML_NAMESPACE_MATH, XML_MUNDER, XML_TOK_MUNDER }, + { XML_NAMESPACE_MATH, XML_MOVER, XML_TOK_MOVER }, + { XML_NAMESPACE_MATH, XML_MUNDEROVER, XML_TOK_MUNDEROVER }, + { XML_NAMESPACE_MATH, XML_MMULTISCRIPTS, XML_TOK_MMULTISCRIPTS }, + { XML_NAMESPACE_MATH, XML_MTABLE, XML_TOK_MTABLE }, + { XML_NAMESPACE_MATH, XML_MACTION, XML_TOK_MACTION }, + { XML_NAMESPACE_MATH, XML_MFENCED, XML_TOK_MFENCED }, + { XML_NAMESPACE_MATH, XML_MPADDED, XML_TOK_MPADDED }, + XML_TOKEN_MAP_END +}; + +static __FAR_DATA SvXMLTokenMapEntry aPresLayoutAttrTokenMap[] = +{ + { XML_NAMESPACE_MATH, XML_FONTWEIGHT, XML_TOK_FONTWEIGHT }, + { XML_NAMESPACE_MATH, XML_FONTSTYLE, XML_TOK_FONTSTYLE }, + { XML_NAMESPACE_MATH, XML_FONTSIZE, XML_TOK_FONTSIZE }, + { XML_NAMESPACE_MATH, XML_FONTFAMILY, XML_TOK_FONTFAMILY }, + { XML_NAMESPACE_MATH, XML_COLOR, XML_TOK_COLOR }, + XML_TOKEN_MAP_END +}; + +static __FAR_DATA SvXMLTokenMapEntry aFencedAttrTokenMap[] = +{ + { XML_NAMESPACE_MATH, XML_OPEN, XML_TOK_OPEN }, + { XML_NAMESPACE_MATH, XML_CLOSE, XML_TOK_CLOSE }, + XML_TOKEN_MAP_END +}; + +static __FAR_DATA SvXMLTokenMapEntry aOperatorAttrTokenMap[] = +{ + { XML_NAMESPACE_MATH, XML_STRETCHY, XML_TOK_STRETCHY }, + XML_TOKEN_MAP_END +}; + +static __FAR_DATA SvXMLTokenMapEntry aAnnotationAttrTokenMap[] = +{ + { XML_NAMESPACE_MATH, XML_ENCODING, XML_TOK_ENCODING }, + XML_TOKEN_MAP_END +}; + + +static __FAR_DATA SvXMLTokenMapEntry aPresElemTokenMap[] = +{ + { XML_NAMESPACE_MATH, XML_ANNOTATION, XML_TOK_ANNOTATION }, + { XML_NAMESPACE_MATH, XML_MI, XML_TOK_MI }, + { XML_NAMESPACE_MATH, XML_MN, XML_TOK_MN }, + { XML_NAMESPACE_MATH, XML_MO, XML_TOK_MO }, + { XML_NAMESPACE_MATH, XML_MTEXT, XML_TOK_MTEXT }, + { XML_NAMESPACE_MATH, XML_MSPACE,XML_TOK_MSPACE }, + { XML_NAMESPACE_MATH, XML_MS, XML_TOK_MS }, + { XML_NAMESPACE_MATH, XML_MALIGNGROUP, XML_TOK_MALIGNGROUP }, + XML_TOKEN_MAP_END +}; + +static __FAR_DATA SvXMLTokenMapEntry aPresScriptEmptyElemTokenMap[] = +{ + { XML_NAMESPACE_MATH, XML_MPRESCRIPTS, XML_TOK_MPRESCRIPTS }, + { XML_NAMESPACE_MATH, XML_NONE, XML_TOK_NONE }, + XML_TOKEN_MAP_END +}; + +static __FAR_DATA SvXMLTokenMapEntry aPresTableElemTokenMap[] = +{ + { XML_NAMESPACE_MATH, XML_MTR, XML_TOK_MTR }, + { XML_NAMESPACE_MATH, XML_MTD, XML_TOK_MTD }, + XML_TOKEN_MAP_END +}; + +static __FAR_DATA SvXMLTokenMapEntry aColorTokenMap[] = +{ + { XML_NAMESPACE_MATH, XML_BLACK, TBLACK}, + { XML_NAMESPACE_MATH, XML_WHITE, TWHITE}, + { XML_NAMESPACE_MATH, XML_RED, TRED}, + { XML_NAMESPACE_MATH, XML_GREEN, TGREEN}, + { XML_NAMESPACE_MATH, XML_BLUE, TBLUE}, + { XML_NAMESPACE_MATH, XML_AQUA, TCYAN}, + { XML_NAMESPACE_MATH, XML_FUCHSIA, TMAGENTA}, + { XML_NAMESPACE_MATH, XML_YELLOW, TYELLOW}, + XML_TOKEN_MAP_END +}; + + +//////////////////////////////////////////////////////////// + +const SvXMLTokenMap& SmXMLImport::GetPresLayoutElemTokenMap() +{ + if (!pPresLayoutElemTokenMap) + pPresLayoutElemTokenMap = new SvXMLTokenMap(aPresLayoutElemTokenMap); + return *pPresLayoutElemTokenMap; +} + +const SvXMLTokenMap& SmXMLImport::GetPresLayoutAttrTokenMap() +{ + if (!pPresLayoutAttrTokenMap) + pPresLayoutAttrTokenMap = new SvXMLTokenMap(aPresLayoutAttrTokenMap); + return *pPresLayoutAttrTokenMap; +} + + +const SvXMLTokenMap& SmXMLImport::GetFencedAttrTokenMap() +{ + if (!pFencedAttrTokenMap) + pFencedAttrTokenMap = new SvXMLTokenMap(aFencedAttrTokenMap); + return *pFencedAttrTokenMap; +} + +const SvXMLTokenMap& SmXMLImport::GetOperatorAttrTokenMap() +{ + if (!pOperatorAttrTokenMap) + pOperatorAttrTokenMap = new SvXMLTokenMap(aOperatorAttrTokenMap); + return *pOperatorAttrTokenMap; +} + +const SvXMLTokenMap& SmXMLImport::GetAnnotationAttrTokenMap() +{ + if (!pAnnotationAttrTokenMap) + pAnnotationAttrTokenMap = new SvXMLTokenMap(aAnnotationAttrTokenMap); + return *pAnnotationAttrTokenMap; +} + +const SvXMLTokenMap& SmXMLImport::GetPresElemTokenMap() +{ + if (!pPresElemTokenMap) + pPresElemTokenMap = new SvXMLTokenMap(aPresElemTokenMap); + return *pPresElemTokenMap; +} + +const SvXMLTokenMap& SmXMLImport::GetPresScriptEmptyElemTokenMap() +{ + if (!pPresScriptEmptyElemTokenMap) + pPresScriptEmptyElemTokenMap = new + SvXMLTokenMap(aPresScriptEmptyElemTokenMap); + return *pPresScriptEmptyElemTokenMap; +} + +const SvXMLTokenMap& SmXMLImport::GetPresTableElemTokenMap() +{ + if (!pPresTableElemTokenMap) + pPresTableElemTokenMap = new SvXMLTokenMap(aPresTableElemTokenMap); + return *pPresTableElemTokenMap; +} + +const SvXMLTokenMap& SmXMLImport::GetColorTokenMap() +{ + if (!pColorTokenMap) + pColorTokenMap = new SvXMLTokenMap(aColorTokenMap); + return *pColorTokenMap; +} + +//////////////////////////////////////////////////////////// + +SvXMLImportContext *SmXMLDocContext_Impl::CreateChildContext( + sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference<xml::sax::XAttributeList>& xAttrList) +{ + SvXMLImportContext* pContext = 0L; + + const SvXMLTokenMap& rTokenMap = GetSmImport().GetPresLayoutElemTokenMap(); + + //UINT32 nTest = rTokenMap.Get(nPrefix, rLocalName); + + switch(rTokenMap.Get(nPrefix, rLocalName)) + { + //Consider semantics a dummy except for any starmath annotations + case XML_TOK_SEMANTICS: + pContext = GetSmImport().CreateRowContext(nPrefix,rLocalName, + xAttrList); + break; + /*General Layout Schemata*/ + case XML_TOK_MROW: + pContext = GetSmImport().CreateRowContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MFRAC: + pContext = GetSmImport().CreateFracContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MSQRT: + pContext = GetSmImport().CreateSqrtContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MROOT: + pContext = GetSmImport().CreateRootContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MSTYLE: + pContext = GetSmImport().CreateStyleContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MERROR: + pContext = GetSmImport().CreateErrorContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MPADDED: + pContext = GetSmImport().CreatePaddedContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MPHANTOM: + pContext = GetSmImport().CreatePhantomContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MFENCED: + pContext = GetSmImport().CreateFencedContext(nPrefix,rLocalName, + xAttrList); + break; + /*Script and Limit Schemata*/ + case XML_TOK_MSUB: + pContext = GetSmImport().CreateSubContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MSUP: + pContext = GetSmImport().CreateSupContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MSUBSUP: + pContext = GetSmImport().CreateSubSupContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MUNDER: + pContext = GetSmImport().CreateUnderContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MOVER: + pContext = GetSmImport().CreateOverContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MUNDEROVER: + pContext = GetSmImport().CreateUnderOverContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MMULTISCRIPTS: + pContext = GetSmImport().CreateMultiScriptsContext(nPrefix, + rLocalName, xAttrList); + break; + case XML_TOK_MTABLE: + pContext = GetSmImport().CreateTableContext(nPrefix, + rLocalName, xAttrList); + break; + case XML_TOK_MACTION: + pContext = GetSmImport().CreateActionContext(nPrefix, + rLocalName, xAttrList); + break; + default: + /*Basically theres an implicit mrow around certain bare + *elements, use a RowContext to see if this is one of + *those ones*/ + SmXMLRowContext_Impl aTempContext(GetSmImport(),nPrefix, + GetXMLToken(XML_MROW)); + + pContext = aTempContext.StrictCreateChildContext(nPrefix, + rLocalName, xAttrList); + break; + } + return pContext; +} + +void SmXMLDocContext_Impl::EndElement() +{ + SmNodeArray ContextArray; + ContextArray.resize(1); + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + + for (ULONG i=0;i< 1;i++) + ContextArray[i] = rNodeStack.Pop(); + + SmToken aDummy; + SmStructureNode *pSNode = new SmLineNode(aDummy); + pSNode->SetSubNodes(ContextArray); + rNodeStack.Push(pSNode); + + SmNodeArray LineArray; + ULONG n = rNodeStack.Count(); + LineArray.resize(n); + for (ULONG j = 0; j < n; j++) + LineArray[n - (j + 1)] = rNodeStack.Pop(); + SmStructureNode *pSNode2 = new SmTableNode(aDummy); + pSNode2->SetSubNodes(LineArray); + rNodeStack.Push(pSNode2); +} + +void SmXMLFracContext_Impl::EndElement() +{ + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 0; + aToken.eType = TOVER; + SmStructureNode *pSNode = new SmBinVerNode(aToken); + SmNode *pOper = new SmRectangleNode(aToken); + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + DBG_ASSERT(rNodeStack.Count() - nElementCount == 2, + "Fraction (mfrac) tag is missing component"); + if (rNodeStack.Count() - nElementCount == 2) + { + SmNode *pSecond = rNodeStack.Pop(); + SmNode *pFirst = rNodeStack.Pop(); + pSNode->SetSubNodes(pFirst,pOper,pSecond); + rNodeStack.Push(pSNode); + } +} + +void SmXMLRootContext_Impl::EndElement() +{ + /*The <mroot> element requires exactly 2 arguments.*/ + DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2, + "Root tag is missing component"); + + SmToken aToken; + aToken.cMathChar = MS_SQRT; //Temporary: alert, based on StarSymbol font + aToken.nGroup = 0; + aToken.nLevel = 0; + aToken.eType = TNROOT; + SmStructureNode *pSNode = new SmRootNode(aToken); + SmNode *pOper = new SmRootSymbolNode(aToken); + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + SmNode *pIndex = rNodeStack.Pop(); + SmNode *pBase = rNodeStack.Pop(); + pSNode->SetSubNodes(pIndex,pOper,pBase); + rNodeStack.Push(pSNode); +} + +void SmXMLSqrtContext_Impl::EndElement() +{ + /* + <msqrt> accepts any number of arguments; if this number is not 1, its + contents are treated as a single "inferred <mrow>" containing its + arguments + */ + if (GetSmImport().GetNodeStack().Count() - nElementCount > 1) + SmXMLRowContext_Impl::EndElement(); + + SmToken aToken; + aToken.cMathChar = MS_SQRT; //Temporary: alert, based on StarSymbol font + aToken.nGroup = 0; + aToken.nLevel = 0; + aToken.eType = TSQRT; + SmStructureNode *pSNode = new SmRootNode(aToken); + SmNode *pOper = new SmRootSymbolNode(aToken); + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + pSNode->SetSubNodes(0,pOper,rNodeStack.Pop()); + rNodeStack.Push(pSNode); +} + +void SmXMLRowContext_Impl::EndElement() +{ + SmNodeArray aRelationArray; + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + ULONG nSize = rNodeStack.Count()-nElementCount; + + if (nSize > 0) + { + aRelationArray.resize(nSize); + for (ULONG j=rNodeStack.Count()-nElementCount;j > 0;j--) + aRelationArray[j-1] = rNodeStack.Pop(); + + + //If the first or last element is an operator with stretchyness + //set then we must create a brace node here from those elements, + //removing the stretchness from the operators and applying it to + //ourselves, and creating the appropiate dummy StarMath none bracket + //to balance the arrangement + if (((aRelationArray[0]->GetScaleMode() == SCALE_HEIGHT) + && (aRelationArray[0]->GetType() == NMATH)) + || ((aRelationArray[nSize-1]->GetScaleMode() == SCALE_HEIGHT) + && (aRelationArray[nSize-1]->GetType() == NMATH))) + { + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 5; + + int nLeft=0,nRight=0; + if ((aRelationArray[0]->GetScaleMode() == SCALE_HEIGHT) + && (aRelationArray[0]->GetType() == NMATH)) + { + aToken = aRelationArray[0]->GetToken(); + nLeft=1; + } + else + aToken.cMathChar = '\0'; + + aToken.eType = TLPARENT; + SmNode *pLeft = new SmMathSymbolNode(aToken); + + if ((aRelationArray[nSize-1]->GetScaleMode() == SCALE_HEIGHT) + && (aRelationArray[nSize-1]->GetType() == NMATH)) + { + aToken = aRelationArray[nSize-1]->GetToken(); + nRight=1; + } + else + aToken.cMathChar = '\0'; + + aToken.eType = TRPARENT; + SmNode *pRight = new SmMathSymbolNode(aToken); + + SmNodeArray aRelationArray2; + + //!! nSize-nLeft-nRight may be < 0 !! + int nRelArrSize = nSize-nLeft-nRight; + if (nRelArrSize > 0) + { + aRelationArray2.resize(nRelArrSize); + for (int i=0;i < nRelArrSize;i++) + aRelationArray2[i] = aRelationArray[i+nLeft]; + } + + SmToken aDummy; + SmStructureNode *pSNode = new SmBraceNode(aToken); + SmStructureNode *pBody = new SmExpressionNode(aDummy); + pBody->SetSubNodes(aRelationArray2); + + pSNode->SetSubNodes(pLeft,pBody,pRight); + pSNode->SetScaleMode(SCALE_HEIGHT); + rNodeStack.Push(pSNode); + return; + } + } + else //Multiple newlines result in empty row elements + { + aRelationArray.resize(1); + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 5; + aToken.eType = TNEWLINE; + aRelationArray[0] = new SmLineNode(aToken); + } + + SmToken aDummy; + SmStructureNode *pSNode = new SmExpressionNode(aDummy); + pSNode->SetSubNodes(aRelationArray); + rNodeStack.Push(pSNode); +} + + +SvXMLImportContext *SmXMLRowContext_Impl::StrictCreateChildContext( + sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference<xml::sax::XAttributeList>& xAttrList) +{ + SvXMLImportContext* pContext = 0L; + + const SvXMLTokenMap& rTokenMap = GetSmImport().GetPresElemTokenMap(); + switch(rTokenMap.Get(nPrefix, rLocalName)) + { + /*Note that these should accept malignmark subelements, but do not*/ + case XML_TOK_MN: + pContext = GetSmImport().CreateNumberContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MI: + pContext = GetSmImport().CreateIdentifierContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MO: + pContext = GetSmImport().CreateOperatorContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MTEXT: + pContext = GetSmImport().CreateTextContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MSPACE: + pContext = GetSmImport().CreateSpaceContext(nPrefix,rLocalName, + xAttrList); + break; + case XML_TOK_MS: + pContext = GetSmImport().CreateStringContext(nPrefix,rLocalName, + xAttrList); + break; + + /*Note: The maligngroup should only be seen when the row + * (or decendants) are in a table*/ + case XML_TOK_MALIGNGROUP: + pContext = GetSmImport().CreateAlignGroupContext(nPrefix,rLocalName, + xAttrList); + break; + + case XML_TOK_ANNOTATION: + pContext = GetSmImport().CreateAnnotationContext(nPrefix,rLocalName, + xAttrList); + break; + + default: + break; + } + return pContext; +} + + +SvXMLImportContext *SmXMLRowContext_Impl::CreateChildContext( + sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference<xml::sax::XAttributeList>& xAttrList) +{ + SvXMLImportContext* pContext = StrictCreateChildContext(nPrefix, + rLocalName, xAttrList); + + if (!pContext) + { + //Hmm, unrecognized for this level, check to see if its + //an element that can have an implicit schema around it + pContext = SmXMLDocContext_Impl::CreateChildContext(nPrefix, + rLocalName,xAttrList); + } + return pContext; +} + + +SvXMLImportContext *SmXMLMultiScriptsContext_Impl::CreateChildContext( + sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference<xml::sax::XAttributeList>& xAttrList) +{ + SvXMLImportContext* pContext = 0L; + + const SvXMLTokenMap& rTokenMap = GetSmImport(). + GetPresScriptEmptyElemTokenMap(); + switch(rTokenMap.Get(nPrefix, rLocalName)) + { + case XML_TOK_MPRESCRIPTS: + MiddleElement(); + pContext = GetSmImport().CreatePrescriptsContext(nPrefix, + rLocalName, xAttrList); + break; + case XML_TOK_NONE: + pContext = GetSmImport().CreateNoneContext(nPrefix,rLocalName, + xAttrList); + break; + default: + pContext = SmXMLRowContext_Impl::CreateChildContext(nPrefix, + rLocalName,xAttrList); + break; + } + return pContext; +} + +void SmXMLMultiScriptsContext_Impl::MiddleElement() +{ + bHasPrescripts=sal_True; + + DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount > 0, + "Sub has no arguments"); + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + if (rNodeStack.Count()-nElementCount > 1) + { + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 0; + aToken.eType = TRSUB; + ULONG nFinalCount = rNodeStack.Count()-nElementCount-1; + + SmNodeStack aReverseStack; + while (rNodeStack.Count()-nElementCount) + { + SmNode *pThing = rNodeStack.Pop(); + aReverseStack.Push(pThing); + } + + for (ULONG nCount=0;nCount < nFinalCount;nCount+=2) + { + SmSubSupNode *pNode = new SmSubSupNode(aToken); + + // initialize subnodes array + SmNodeArray aSubNodes; + aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES); + for (ULONG i = 1; i < aSubNodes.size(); i++) + aSubNodes[i] = NULL; + + /*On each loop the base and its sub sup pair becomes the + base for the next loop to which the next sub sup pair is + attached, i.e. wheels within wheels*/ + //if (nCount == 0) + aSubNodes[0] = aReverseStack.Pop(); + + SmNode *pScriptNode = aReverseStack.Pop(); + + if (pScriptNode && ((pScriptNode->GetToken().eType != TIDENT) || + (pScriptNode->GetToken().aText.Len()))) + aSubNodes[RSUB+1] = pScriptNode; + pScriptNode = aReverseStack.Pop(); + if (pScriptNode && ((pScriptNode->GetToken().eType != TIDENT) || + (pScriptNode->GetToken().aText.Len()))) + aSubNodes[RSUP+1] = pScriptNode; + + pNode->SetSubNodes(aSubNodes); + aReverseStack.Push(pNode); + } + rNodeStack.Push(aReverseStack.Pop()); + } +} + + +void SmXMLTableContext_Impl::EndElement() +{ + SmNodeArray aExpressionArray; + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + SmNodeStack aReverseStack; + aExpressionArray.resize(rNodeStack.Count()-nElementCount); + + ULONG nRows = rNodeStack.Count()-nElementCount; + USHORT nCols = 0; + + SmStructureNode *pArray; + for (ULONG i=rNodeStack.Count()-nElementCount;i > 0;i--) + { + pArray = (SmStructureNode *)rNodeStack.Pop(); + if (pArray->GetNumSubNodes() == 0) + { + //This is a little tricky, it is possible that there was + //be elements that were not inside a <mtd> pair, in which + //case they will not be in a row, i.e. they will not have + //SubNodes, so we have to wait until here before we can + //resolve the situation. Implicitsurrounding tags are + //surprisingly difficult to get right within this + //architecture + + SmNodeArray aRelationArray; + aRelationArray.resize(1); + aRelationArray[0] = pArray; + SmToken aDummy; + pArray = new SmExpressionNode(aDummy); + pArray->SetSubNodes(aRelationArray); + } + + if (pArray->GetNumSubNodes() > nCols) + nCols = pArray->GetNumSubNodes(); + aReverseStack.Push(pArray); + } + aExpressionArray.resize(nCols*nRows); + ULONG j=0; + while (aReverseStack.Count()) + { + pArray = (SmStructureNode *)aReverseStack.Pop(); + for (USHORT i=0;i<pArray->GetNumSubNodes();i++) + aExpressionArray[j++] = pArray->GetSubNode(i); + } + + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = TRGROUP; + aToken.nLevel = 0; + aToken.eType = TMATRIX; + SmMatrixNode *pSNode = new SmMatrixNode(aToken); + pSNode->SetSubNodes(aExpressionArray); + pSNode->SetRowCol(static_cast<USHORT>(nRows),nCols); + rNodeStack.Push(pSNode); +} + +SvXMLImportContext *SmXMLTableRowContext_Impl::CreateChildContext( + sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference<xml::sax::XAttributeList>& xAttrList) +{ + SvXMLImportContext* pContext = 0L; + + const SvXMLTokenMap& rTokenMap = GetSmImport(). + GetPresTableElemTokenMap(); + switch(rTokenMap.Get(nPrefix, rLocalName)) + { + case XML_TOK_MTD: + pContext = GetSmImport().CreateTableCellContext(nPrefix, + rLocalName, xAttrList); + break; + default: + pContext = SmXMLRowContext_Impl::CreateChildContext(nPrefix, + rLocalName,xAttrList); + break; + } + return pContext; +} + +SvXMLImportContext *SmXMLTableContext_Impl::CreateChildContext( + sal_uInt16 nPrefix, + const OUString& rLocalName, + const uno::Reference<xml::sax::XAttributeList>& xAttrList) +{ + SvXMLImportContext* pContext = 0L; + + const SvXMLTokenMap& rTokenMap = GetSmImport(). + GetPresTableElemTokenMap(); + switch(rTokenMap.Get(nPrefix, rLocalName)) + { + case XML_TOK_MTR: + pContext = GetSmImport().CreateTableRowContext(nPrefix,rLocalName, + xAttrList); + break; + default: + pContext = SmXMLTableRowContext_Impl::CreateChildContext(nPrefix, + rLocalName,xAttrList); + break; + } + return pContext; +} + +void SmXMLMultiScriptsContext_Impl::EndElement() +{ + if (!bHasPrescripts) + MiddleElement(); + + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + if (rNodeStack.Count()-nElementCount > 1) + { + SmToken aToken; + aToken.cMathChar = '\0'; + aToken.nGroup = 0; + aToken.nLevel = 0; + aToken.eType = TLSUB; + ULONG nFinalCount = rNodeStack.Count()-nElementCount-1; + + SmNodeStack aReverseStack; + while (rNodeStack.Count()-nElementCount) + aReverseStack.Push(rNodeStack.Pop()); + for (ULONG nCount=0;nCount < nFinalCount;nCount+=2) + { + SmSubSupNode *pNode = new SmSubSupNode(aToken); + + // initialize subnodes array + SmNodeArray aSubNodes; + aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES); + for (ULONG i = 1; i < aSubNodes.size(); i++) + aSubNodes[i] = NULL; + + /*On each loop the base and its sub sup pair becomes the + base for the next loop to which the next sub sup pair is + attached, i.e. wheels within wheels*/ + //if (nCount == 0) + aSubNodes[0] = aReverseStack.Pop(); + + SmNode *pScriptNode = aReverseStack.Pop(); + if (pScriptNode->GetToken().aText.Len()) + aSubNodes[LSUB+1] = pScriptNode; + pScriptNode = aReverseStack.Pop(); + if (pScriptNode->GetToken().aText.Len()) + aSubNodes[LSUP+1] = pScriptNode; + + pNode->SetSubNodes(aSubNodes); + aReverseStack.Push(pNode); + } + rNodeStack.Push(aReverseStack.Pop()); + } + +} +void SmXMLActionContext_Impl::EndElement() +{ + /*For now we will just assume that the + selected attribute is one, and then just display + that expression alone, i.e. remove all expect the + first pushed one*/ + + SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); + for (ULONG i=rNodeStack.Count()-nElementCount;i > 1;i--) + { + delete rNodeStack.Pop(); + } +} + +SvXMLImportContext *SmXMLImport::CreateContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + if ( XML_NAMESPACE_OFFICE == nPrefix ) + { + if ( (IsXMLToken(rLocalName, XML_DOCUMENT) || + IsXMLToken(rLocalName, XML_DOCUMENT_META))) + { + uno::Reference<xml::sax::XDocumentHandler> xDocBuilder( + mxServiceFactory->createInstance( + ::rtl::OUString::createFromAscii( + "com.sun.star.xml.dom.SAXDocumentBuilder")), + uno::UNO_QUERY_THROW); + uno::Reference<document::XDocumentPropertiesSupplier> xDPS( + GetModel(), uno::UNO_QUERY_THROW); + return IsXMLToken(rLocalName, XML_DOCUMENT_META) + ? new SvXMLMetaDocumentContext(*this, + XML_NAMESPACE_OFFICE, rLocalName, + xDPS->getDocumentProperties(), xDocBuilder) + // flat OpenDocument file format -- this has not been tested... + : new SmXMLFlatDocContext_Impl( *this, nPrefix, rLocalName, + xDPS->getDocumentProperties(), xDocBuilder); + } + else + { + return new SmXMLOfficeContext_Impl( *this,nPrefix,rLocalName); + } + } + else + return new SmXMLDocContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateRowContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLRowContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateTextContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLTextContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateAnnotationContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLAnnotationContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateStringContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLStringContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateNumberContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLNumberContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateIdentifierContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLIdentifierContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateOperatorContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLOperatorContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateSpaceContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLSpaceContext_Impl(*this,nPrefix,rLocalName); +} + + +SvXMLImportContext *SmXMLImport::CreateFracContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLFracContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateSqrtContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLSqrtContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateRootContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLRootContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateStyleContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLStyleContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreatePaddedContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLPaddedContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreatePhantomContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLPhantomContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateFencedContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLFencedContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateErrorContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLErrorContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateSubContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLSubContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateSubSupContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLSubSupContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateSupContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLSupContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateUnderContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLUnderContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateOverContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLOverContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateUnderOverContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLUnderOverContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateMultiScriptsContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLMultiScriptsContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateTableContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLTableContext_Impl(*this,nPrefix,rLocalName); +} +SvXMLImportContext *SmXMLImport::CreateTableRowContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLTableRowContext_Impl(*this,nPrefix,rLocalName); +} +SvXMLImportContext *SmXMLImport::CreateTableCellContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLTableCellContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateNoneContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLNoneContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreatePrescriptsContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLPrescriptsContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateAlignGroupContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLAlignGroupContext_Impl(*this,nPrefix,rLocalName); +} + +SvXMLImportContext *SmXMLImport::CreateActionContext(sal_uInt16 nPrefix, + const OUString &rLocalName, + const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/) +{ + return new SmXMLActionContext_Impl(*this,nPrefix,rLocalName); +} + +SmXMLImport::~SmXMLImport() throw () +{ + delete pPresLayoutElemTokenMap; + delete pPresElemTokenMap; + delete pPresScriptEmptyElemTokenMap; + delete pPresTableElemTokenMap; + delete pPresLayoutAttrTokenMap; + delete pFencedAttrTokenMap; + delete pColorTokenMap; + delete pOperatorAttrTokenMap; + delete pAnnotationAttrTokenMap; +} + +void SmXMLImport::SetViewSettings(const Sequence<PropertyValue>& aViewProps) +{ + uno::Reference <frame::XModel> xModel = GetModel(); + if ( !xModel.is() ) + return; + + uno::Reference <lang::XUnoTunnel> xTunnel; + xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY); + SmModel *pModel = reinterpret_cast<SmModel *> + (xTunnel->getSomething(SmModel::getUnoTunnelId())); + + if ( !pModel ) + return; + + SmDocShell *pDocShell = + static_cast<SmDocShell*>(pModel->GetObjectShell()); + if ( !pDocShell ) + return; + + Rectangle aRect( pDocShell->GetVisArea() ); + + sal_Int32 nCount = aViewProps.getLength(); + const PropertyValue *pValue = aViewProps.getConstArray(); + + long nTmp = 0; + //sal_Bool bShowDeletes = sal_False, bShowInserts = sal_False, bShowFooter = sal_False, bShowHeader = sal_False; + + for (sal_Int32 i = 0; i < nCount ; i++) + { + if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaTop" ) ) ) + { + pValue->Value >>= nTmp; + aRect.setY( nTmp ); + } + else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaLeft" ) ) ) + { + pValue->Value >>= nTmp; + aRect.setX( nTmp ); + } + else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaWidth" ) ) ) + { + pValue->Value >>= nTmp; + Size aSize( aRect.GetSize() ); + aSize.Width() = nTmp; + aRect.SetSize( aSize ); + } + else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaHeight" ) ) ) + { + pValue->Value >>= nTmp; + Size aSize( aRect.GetSize() ); + aSize.Height() = nTmp; + aRect.SetSize( aSize ); + } + pValue++; + } + + pDocShell->SetVisArea ( aRect ); +} + +void SmXMLImport::SetConfigurationSettings(const Sequence<PropertyValue>& aConfProps) +{ + uno::Reference < XPropertySet > xProps ( GetModel(), UNO_QUERY ); + if ( xProps.is() ) + { + Reference < XPropertySetInfo > xInfo ( xProps->getPropertySetInfo() ); + if (xInfo.is() ) + { + sal_Int32 nCount = aConfProps.getLength(); + const PropertyValue* pValues = aConfProps.getConstArray(); + + const OUString sFormula ( RTL_CONSTASCII_USTRINGPARAM ( "Formula" ) ); + const OUString sBasicLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "BasicLibraries" ) ); + const OUString sDialogLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "DialogLibraries" ) ); + while ( nCount-- ) + { + if (pValues->Name != sFormula && + pValues->Name != sBasicLibraries && + pValues->Name != sDialogLibraries) + { + try + { + if ( xInfo->hasPropertyByName( pValues->Name ) ) + xProps->setPropertyValue( pValues->Name, pValues->Value ); + } + catch( Exception& ) + { + DBG_ERROR( "SmXMLImport::SetConfigurationSettings: Exception!" ); + } + } + + pValues++; + } + } + } +} + + +//////////////////////////////////////////////////////////// + + diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 051542c473..1ed55a5514 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -1651,7 +1651,7 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) "Sm : unterschiedliche Fontgroessen"); aTmpSize.Width() = Min((long) nBraceHeight * 60L / 100L, rFormat.GetBaseSize().Height() * 3L / 2L); - // correction factor since change from StarMath to StarSymbol font + // correction factor since change from StarMath to OpenSymbol font // because of the different font width in the FontMetric aTmpSize.Width() *= 182; aTmpSize.Width() /= 267; @@ -2694,7 +2694,7 @@ void SmMathSymbolNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocSh DBG_ASSERT(GetFont().GetCharSet() == RTL_TEXTENCODING_SYMBOL || GetFont().GetCharSet() == RTL_TEXTENCODING_UNICODE, - "incorrect charset for character from StarMath/StarSymbol font"); + "incorrect charset for character from StarMath/OpenSymbol font"); Flags() |= FLG_FONT | FLG_ITALIC; }; diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index 87f3d17049..b48e7541aa 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -40,7 +40,7 @@ #include <i18npool/lang.h> #include <unotools/charclass.hxx> #include <svx/unolingu.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include "parse.hxx" #ifndef _STARMATH_HRC #include "starmath.hrc" diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index 3f766b9b1f..789c3bcd05 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -150,8 +150,7 @@ void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat, aSize = Size(rDev.GetTextWidth(rText), rDev.GetTextHeight()); const FontMetric aFM (rDev.GetFontMetric()); - BOOL bIsMath = aFM.GetName().EqualsIgnoreCaseAscii( FONTNAME_MATH ) || - aFM.GetName().EqualsIgnoreCaseAscii( FONTNAME_MATH2 ); + BOOL bIsMath = aFM.GetName().EqualsIgnoreCaseAscii( FONTNAME_MATH ); BOOL bAllowSmaller = bIsMath && !SmIsMathAlpha(rText); const long nFontHeight = rDev.GetFont().GetSize().Height(); diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx index 8898721237..0fcc3f61da 100644 --- a/starmath/source/smdetect.cxx +++ b/starmath/source/smdetect.cxx @@ -60,10 +60,10 @@ #include <rtl/ustring.h> #include <rtl/logfile.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <vcl/window.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <tools/urlobj.hxx> #include <vos/mutex.hxx> #include <svtools/sfxecode.hxx> diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx index 6351b7ba75..bc6c0ba57d 100644 --- a/starmath/source/smmod.cxx +++ b/starmath/source/smmod.cxx @@ -37,7 +37,7 @@ #include <sfx2/msg.hxx> #include <sfx2/app.hxx> #include <sfx2/objface.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <sfx2/request.hxx> #include <sfx2/sfx.hrc> #include <sfx2/viewsh.hxx> @@ -47,7 +47,7 @@ #endif #include <vcl/msgbox.hxx> #include <vcl/virdev.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include <tools/rtti.hxx> #include "smmod.hxx" #include "symbol.hxx" @@ -251,6 +251,8 @@ SmModule::SmModule(SfxObjectFactory* pObjFact) : SmModule::~SmModule() { delete pConfig; + if (pColorConfig) + pColorConfig->RemoveListener(this); delete pColorConfig; delete pLocSymbolData; delete pSysLocale; @@ -295,19 +297,14 @@ svtools::ColorConfig & SmModule::GetColorConfig() { pColorConfig = new svtools::ColorConfig; ApplyColorConfigValues( *pColorConfig ); - StartListening( *pColorConfig ); + pColorConfig->AddListener(this); } return *pColorConfig; } -void SmModule::Notify( SfxBroadcaster & /*rBC*/, const SfxHint &rHint ) +void SmModule::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ) { - if (rHint.ISA(SfxSimpleHint)) - { - ULONG nHintId = ((SfxSimpleHint&)rHint).GetId(); - if (SFX_HINT_COLORS_CHANGED == nHintId) - ApplyColorConfigValues(*pColorConfig); - } + ApplyColorConfigValues(*pColorConfig); } SmConfig * SmModule::GetConfig() diff --git a/starmath/source/smres.src b/starmath/source/smres.src index c8890a2824..841c5746b9 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -114,14 +114,14 @@ ModalDialog RID_FONTSIZEDIALOG SVLook = TRUE ; HelpID = SID_FONTSIZE ; Size = MAP_APPFONT ( 171 , 120 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Schriftgrößen : Schriftgrößen */ + /* ### ACHTUNG: Neuer Text in Resource? Schriftgr��en : Schriftgr��en */ Text [ en-US ] = "Font Sizes" ; FixedText 1 { Left = TRUE ; Pos = MAP_APPFONT ( 12 , 7 ) ; Size = MAP_APPFONT ( 40 , 10 ) ; - /* ### ACHTUNG: Neuer Text in Resource? ~Basisgröße: : ~Basisgröße: */ + /* ### ACHTUNG: Neuer Text in Resource? ~Basisgr��e: : ~Basisgr��e: */ Text [ en-US ] = "Base ~size"; }; MetricField 1 @@ -246,7 +246,7 @@ ModalDialog RID_FONTSIZEDIALOG { Pos = MAP_APPFONT ( 6 , 24 ) ; Size = MAP_APPFONT ( 99 , 8 ) ; - /* ### ACHTUNG: Neuer Text in Resource? relative Größen : relative Größen */ + /* ### ACHTUNG: Neuer Text in Resource? relative Gr��en : relative Gr��en */ Text [ en-US ] = "Relative sizes" ; }; OKButton 1 @@ -433,7 +433,7 @@ ModalDialog RID_DISTANCEDIALOG SVLook = TRUE ; HelpID = SID_DISTANCE ; Size = MAP_APPFONT ( 240 , 90 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Abstände : Abstände */ + /* ### ACHTUNG: Neuer Text in Resource? Abst�nde : Abst�nde */ Text [ en-US ] = "Spacing" ; FixedText 1 { @@ -564,7 +564,7 @@ ModalDialog RID_DISTANCEDIALOG { String 1 { - /* ### ACHTUNG: Neuer Text in Resource? Abstände : Abstände */ + /* ### ACHTUNG: Neuer Text in Resource? Abst�nde : Abst�nde */ Text [ en-US ] = "Spacing" ; }; String 2 @@ -639,12 +639,12 @@ ModalDialog RID_DISTANCEDIALOG { String 1 { - /* ### ACHTUNG: Neuer Text in Resource? Brüche : Br³che */ + /* ### ACHTUNG: Neuer Text in Resource? Br�che : Br�che */ Text [ en-US ] = "Fractions" ; }; String 2 { - /* ### ACHTUNG: Neuer Text in Resource? ~Zählerhöhe: : ~Zählerhöhe: */ + /* ### ACHTUNG: Neuer Text in Resource? ~Z�hlerh�he: : ~Z�hlerh�he: */ Text [ en-US ] = "~Numerator"; }; Bitmap 20 @@ -676,7 +676,7 @@ ModalDialog RID_DISTANCEDIALOG }; String 2 { - /* ### ACHTUNG: Neuer Text in Resource? ~Überlänge: : ~šberlänge: */ + /* ### ACHTUNG: Neuer Text in Resource? ~�berl�nge: : ~�berl�nge: */ Text [ en-US ] = "~Excess length"; }; Bitmap 20 @@ -689,7 +689,7 @@ ModalDialog RID_DISTANCEDIALOG }; String 3 { - /* ### ACHTUNG: Neuer Text in Resource? ~Strichstärke: : ~Strichstärke: */ + /* ### ACHTUNG: Neuer Text in Resource? ~Strichst�rke: : ~Strichst�rke: */ Text [ en-US ] = "~Weight"; }; Bitmap 30 @@ -709,7 +709,7 @@ ModalDialog RID_DISTANCEDIALOG }; String 2 { - /* ### ACHTUNG: Neuer Text in Resource? Grenz~höhe: : Grenz~höhe: */ + /* ### ACHTUNG: Neuer Text in Resource? Grenz~h�he: : Grenz~h�he: */ Text [ en-US ] = "~Upper limit"; }; Bitmap 20 @@ -815,7 +815,7 @@ ModalDialog RID_DISTANCEDIALOG }; String 2 { - /* ### ACHTUNG: Neuer Text in Resource? ~Primärhöhe: : ~Primärhöhe: */ + /* ### ACHTUNG: Neuer Text in Resource? ~Prim�rh�he: : ~Prim�rh�he: */ Text [ en-US ] = "~Primary height"; }; Bitmap 20 @@ -847,7 +847,7 @@ ModalDialog RID_DISTANCEDIALOG }; String 2 { - /* ### ACHTUNG: Neuer Text in Resource? ~Übergröße: : ~šbergröße: */ + /* ### ACHTUNG: Neuer Text in Resource? ~�bergr��e: : ~�bergr��e: */ Text [ en-US ] = "~Excess size"; }; Bitmap 20 @@ -1127,7 +1127,7 @@ ModalDialog RID_SYMBOLDIALOG Pos = MAP_APPFONT ( 177 , 6 ) ; Size = MAP_APPFONT ( 56 , 14 ) ; DefButton = TRUE ; - /* ### ACHTUNG: Neuer Text in Resource? ~Übernehmen : ~šbernehmen */ + /* ### ACHTUNG: Neuer Text in Resource? ~�bernehmen : ~�bernehmen */ Text [ en-US ] = "~Insert" ; }; PushButton 3 @@ -1372,7 +1372,7 @@ QueryBox RID_DEFAULTSAVEQUERY { Buttons = WB_YES_NO ; DefButton = WB_DEF_YES ; - /* ### ACHTUNG: Neuer Text in Resource? Sollen die Änderungen als Standard gespeichert werden ?\n\nDiese Änderungen wirken sich auf alle neuen Formeln aus. : Sollen die Žnderungen als Standard gespeichert werden ?\n\nDiese Žnderungen wirken sich auf alle neuen Formeln aus. */ + /* ### ACHTUNG: Neuer Text in Resource? Sollen die �nderungen als Standard gespeichert werden ?\n\nDiese �nderungen wirken sich auf alle neuen Formeln aus. : Sollen die �nderungen als Standard gespeichert werden ?\n\nDiese �nderungen wirken sich auf alle neuen Formeln aus. */ Message [ en-US ] = "Should the changes be saved as defaults?\n\nThese changes will apply for all new formulas." ; }; @@ -1438,7 +1438,7 @@ Menu RID_VIEWMENU { Identifier = SID_ZOOMIN ; HelpID = SID_ZOOMIN ; - /* ### ACHTUNG: Neuer Text in Resource? Vergrößern : Vergrößern */ + /* ### ACHTUNG: Neuer Text in Resource? Vergr��ern : Vergr��ern */ Text [ en-US ] = "~Zoom In" ; }; MenuItem @@ -1759,7 +1759,7 @@ FloatingWindow RID_TOOLBOXWINDOW { Identifier = RID_XSIMEQY ; HelpId = HID_SMA_XSIMEQY ; - /* ### ACHTUNG: Neuer Text in Resource? ist ähnlich oder gleich : ist ähnlich oder glech */ + /* ### ACHTUNG: Neuer Text in Resource? ist �hnlich oder gleich : ist �hnlich oder glech */ Text [ en-US ] = "Is Similar Or Equal" ; }; ToolBoxItem @@ -1782,7 +1782,7 @@ FloatingWindow RID_TOOLBOXWINDOW { Identifier = RID_XLESLANTY ; HelpId = HID_SMA_XLESLANTY ; - /* ### ACHTUNG: Neuer Text in Resource? ist kleiner gleich (schräg) : ist keiner gleich */ + /* ### ACHTUNG: Neuer Text in Resource? ist kleiner gleich (schr�g) : ist keiner gleich */ Text [ en-US ] = "Is Less Than Or Equal To" ; }; ToolBoxItem @@ -2051,7 +2051,7 @@ FloatingWindow RID_TOOLBOXWINDOW { Identifier = RID_EX ; HelpId = HID_SMA_EX ; - /* ### ACHTUNG: Neuer Text in Resource? Exponentialfunktion : natürliche Exponentialfunktion */ + /* ### ACHTUNG: Neuer Text in Resource? Exponentialfunktion : nat�rliche Exponentialfunktion */ Text [ en-US ] = "Exponential Function" ; }; ToolBoxItem @@ -3456,13 +3456,13 @@ String RID_ERR_FUNCEXPECTED String RID_ERR_UNOPEREXPECTED { - /* ### ACHTUNG: Neuer Text in Resource? Unärer Operator erwartet : Un§rer Operator erwartet */ + /* ### ACHTUNG: Neuer Text in Resource? Un�rer Operator erwartet : Un�rer Operator erwartet */ Text [ en-US ] = "Unary operator expected" ; }; String RID_ERR_BINOPEREXPECTED { - /* ### ACHTUNG: Neuer Text in Resource? Binärer Operator erwartet : Bin§rer Operator erwartet */ + /* ### ACHTUNG: Neuer Text in Resource? Bin�rer Operator erwartet : Bin�rer Operator erwartet */ Text [ en-US ] = "Binary operator expected" ; }; @@ -3526,9 +3526,9 @@ ToolBox RID_MATH_TOOLBOX { Identifier = SID_ZOOMIN ; HelpID = SID_ZOOMIN ; - /* ### ACHTUNG: Neuer Text in Resource? Größer : Größer */ + /* ### ACHTUNG: Neuer Text in Resource? Gr��er : Gr��er */ Text [ en-US ] = "Zoom In" ; - /* ### ACHTUNG: Neuer Text in Resource? Stellt den Ausschnitt vergrößert dar : Stellt den Ausschnitt vergrößert dar */ + /* ### ACHTUNG: Neuer Text in Resource? Stellt den Ausschnitt vergr��ert dar : Stellt den Ausschnitt vergr��ert dar */ }; ToolBoxItem { @@ -3541,7 +3541,7 @@ ToolBox RID_MATH_TOOLBOX Identifier = SID_VIEW100 ; HelpID = SID_VIEW100 ; Text [ en-US ] = "Zoom 100%" ; - /* ### ACHTUNG: Neuer Text in Resource? Stellt den Ausschnitt in tatsächlicher Größe dar : Stellt den Ausschnitt in tatsächlicher GröÃe dar */ + /* ### ACHTUNG: Neuer Text in Resource? Stellt den Ausschnitt in tats�chlicher Gr��e dar : Stellt den Ausschnitt in tats�chlicher Gr��e dar */ }; ToolBoxItem { @@ -3570,7 +3570,7 @@ ToolBox RID_MATH_TOOLBOX Identifier = SID_SYMBOLS_CATALOGUE ; HelpID = SID_SYMBOLS_CATALOGUE ; Text [ en-US ] = "Symbols" ; - /* ### ACHTUNG: Neuer Text in Resource? Symbole einfügen und bearbeiten : Symbole einf³gen und bearbeiten */ + /* ### ACHTUNG: Neuer Text in Resource? Symbole einf�gen und bearbeiten : Symbole einf�gen und bearbeiten */ }; }; }; @@ -3580,189 +3580,28 @@ String RID_MATH_TOOLBOX Text [ en-US ] = "Main Toolbar" ; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +StringArray RID_PRINTUIOPTIONS +{ + ItemList [en-US] = + { + < "%PRODUCTNAME %s"; >; + < "Contents"; >; + < "~Title row"; >; + < "Specifies whether you want the name of the document to be included in the printout"; >; + < "~Formula text"; >; + < "Specifies whether to include the contents of the \"Commands\" window at the bottom of the printout."; >; + < "B~orders"; >; + < "Applies a thin border to the formula area in the printout."; >; + < "Size"; >; + < "O~riginal size"; >; + < "Prints the formula without adjusting the current font size."; >; + < "Fit to ~page"; >; + < "Adjusts the formula to the page format used in the printout."; >; + < "~Scaling"; >; + < "Reduces or enlarges the size of the printed formula by a specified enlargement factor."; >; + < "Miscellaneous options"; >; + < "Ig~nore ~~ and ` at the end of the line"; >; + < "Specfies that these space wildcards will be removed if they are at the end of a line."; >; + }; +}; diff --git a/starmath/source/toolbox.cxx b/starmath/source/toolbox.cxx index de8e4d3673..64be515246 100644 --- a/starmath/source/toolbox.cxx +++ b/starmath/source/toolbox.cxx @@ -33,9 +33,9 @@ #include <rtl/logfile.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <sfx2/app.hxx> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <svtools/imgdef.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/imgmgr.hxx> diff --git a/starmath/source/typemap.cxx b/starmath/source/typemap.cxx index e4b4c7e37f..a76a819f7d 100644 --- a/starmath/source/typemap.cxx +++ b/starmath/source/typemap.cxx @@ -141,10 +141,10 @@ #define SvxCellVerJustifyEnumItem SfxVoidItem #define SvxCellOrientationEnumItem SfxVoidItem #include <sfx2/msg.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <svx/zoomitem.hxx> -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #define SFX_TYPEMAP #include "smslots.hxx" diff --git a/starmath/source/types.cxx b/starmath/source/types.cxx index 8312311257..eb5b06920a 100644 --- a/starmath/source/types.cxx +++ b/starmath/source/types.cxx @@ -35,227 +35,21 @@ #include <types.hxx> -//!! no official unicode code point for these in non-private-area -//!! (even MathMl uses the code points listed on the right which are -//!! from the private-use-area as well) -// MS_UNDERBRACE = (xub_Unicode) 0xE081, 0xF613 ? -// MS_OVERBRACE = (xub_Unicode) 0xE082, 0xF612 ? - -struct MathConversionEntry -{ - sal_Unicode cMath; // code point of the character from the - // StarSymbol/OpenSymbol private-use-area - sal_Unicode cUnicode; // 'official' Unicode code point the above - // character should be matched to and vice versa. - // See http://www.w3.org/TR/2000/WD-MathML2-20000211/bycodes.html - // for most of them. -// const sal_Unicode *pFontName; - sal_Unicode cMathType; // 0 if the same value of cUnicode is to be used -}; - -static MathConversionEntry aMathConvTbl[] = -{ -// MS_UNDERBRACE, 0xF613, // only Math-ML code-point available ! -// MS_OVERBRACE, 0xF612, // only Math-ML code-point available ! - { MS_PLUS, 0x002B, 0 }, - { MS_LT, 0x003C, 0 }, - { MS_GT, 0x003E, 0 }, - { MS_LESLANT, 0x2264, 0 }, - { MS_GESLANT, 0x2265, 0 }, - { MS_DOTSLOW, 0x2026, 0 }, - { MS_RIGHTARROW, 0x2192, 0 }, - { MS_SQRT, 0x221A, 0 }, - { MS_HAT, 0x02C6, 0 }, - { MS_CHECK, 0x02C7, 0 }, - { MS_BREVE, 0x02D8, 0 }, - { MS_ACUTE, 0x00B4, 0 }, - { MS_GRAVE, 0x0060, 0 }, - { MS_TILDE, 0x02DC, 0 }, - { MS_BAR, 0x02C9, 0 }, - { MS_VEC, 0x2192, 0 }, - { MS_DDDOT, 0x22EF, 0 }, - { MS_LPARENT, 0x0028, 0 }, - { MS_RPARENT, 0x0029, 0 }, - { MS_PLACE, 0x25A1, 0 }, - { MS_LEFTARROW, 0x2190, 0 }, - { MS_UPARROW, 0x2191, 0 }, - { MS_DOWNARROW, 0x2193, 0 }, - { MS_PLACE, 0x2751, 0 }, - - // predefined-user-defined symbols - // (code-points on the left as defined in 'officecfg' for SO8, - // non-private-use-area characters uncommented): - -// 0x0041, 0x0391, 0, // %ALPHA -// 0x0042, 0x0392, 0, // %BETA - { 0xE0AC, 0x0393, 0 }, // %GAMMA - { 0xE0AD, 0x0394, 0 }, // %DELTA -// 0x0045, 0x0395, 0, // %EPSILON -// 0x005A, 0x0396, 0, // %ZETA -// 0x0048, 0x0397, 0, // %ETA - { 0xE0AE, 0x0398, 0 }, // %THETA -// 0x0049, 0x0399, 0, // %IOTA -// 0x004B, 0x039A, 0, // %KAPPA - { 0xE0AF, 0x039B, 0 }, // %LAMBDA -// 0x004D, 0x039C, 0, // %MU -// 0x004E, 0x039D, 0, // %NU - { 0xE0B0, 0x039E, 0 }, // %XI -// 0x004F, 0x039F, 0, // %OMICRON - { 0xE0B1, 0x03A0, 0 }, // %PI -// 0x0050, 0x03A1, 0, // %RHO - { 0xE0B2, 0x03A3, 0 }, // %SIGMA -// 0x0054, 0x03A4, 0, // %TAU - { 0xE0B3, 0x03A5, 0 }, // %UPSILON - { 0xE0B4, 0x03A6, 0 }, // %PHI -// 0x0058, 0x03A7, 0, // %CHI - { 0xE0B5, 0x03A8, 0 }, // %PSI - { 0xE0B6, 0x03A9, 0 }, // %OMEGA - - { 0xE0B7, 0x03B1, 0 }, // %alpha - { 0xE0B8, 0x03B2, 0 }, // %beta - { 0xE0B9, 0x03B3, 0 }, // %gamma - { 0xE0BA, 0x03B4, 0 }, // %delta - { 0xE0BB, 0x03B5, 0 }, // %epsilon - { 0xE0BC, 0x03B6, 0 }, // %zeta - { 0xE0BD, 0x03B7, 0 }, // %eta - { 0xE0BE, 0x03B8, 0 }, // %theta - { 0xE0BF, 0x03B9, 0 }, // %iota - { 0xE0C0, 0x03BA, 0 }, // %kappa - { 0xE0C1, 0x03BB, 0 }, // %lambda - { 0xE0C2, 0x03BC, 0 }, // %mu - { 0xE0C3, 0x03BD, 0 }, // %nu - { 0xE0C4, 0x03BE, 0 }, // %xi - { 0xE0C5, 0x03BF, 0 }, // %omicron - { 0xE0C6, 0x03C0, 0 }, // %pi - { 0xE0C7, 0x03C1, 0 }, // %rho - { 0xE0C8, 0x03C3, 0 }, // %sigma - { 0xE0C9, 0x03C4, 0 }, // %tau - { 0xE0CA, 0x03C5, 0 }, // %upsilon - { 0xE0CB, 0x03C6, 0 }, // %phi - { 0xE0CC, 0x03C7, 0 }, // %chi - { 0xE0CD, 0x03C8, 0 }, // %psi - { 0xE0CE, 0x03C9, 0 }, // %omega - - { 0xE0CF, 0x025B, 0,/*x03B5*/}, // %varepsilon - { 0xE0D0, 0x03D1, 0 }, // %vartheta - { 0xE0D4, 0x03D5, 0 }, // %varphi - { 0xE0D1, 0x03D6, 0 }, // %varpi -// 0x03F1, 0x03F1, 0/*x03C1*/, // %varrho - { 0xE0D3, 0x03C2, 0 }, // %varsigma - -// 0x2227, 0x2227, 0, // %and -// 0x2228, 0x2228, 0, // %or -// 0x2208, 0x2208, 0, // %element -// 0x2209, 0x2209, 0, // %noelement -// 0x226B, 0x226B, 0, // %strictlygreaterthan -// 0x226A, 0x226A, 0, // %strictlylessthan -// 0x2261, 0x2261, 0, // %identical -// 0x221E, 0x221E, 0, // %infinite -// 0x2260, 0x2260, 0, // %notequal - { 0xE080, 0x2030, 0 }, // %perthousand -// 0x2222, 0x2222, 0, // %angle - { 0xE08C, 0x2192, 0 } // %tendto -}; - - -static int nMathToUnicodeLen = sizeof(aMathConvTbl) / sizeof(aMathConvTbl[0]); - sal_Unicode ConvertMathPrivateUseAreaToUnicode( sal_Unicode cChar ) { - sal_Unicode cRes = 0; + sal_Unicode cRes = cChar; if (IsInPrivateUseArea( cChar )) { - for (int i = 0; i < nMathToUnicodeLen && cRes == 0; ++i) - { - if (aMathConvTbl[i].cMath == cChar) - cRes = aMathConvTbl[i].cUnicode; - } - } - return cRes; -} - -#ifdef TL_NOT_YET_USED -sal_Unicode ConvertUnicodeToMathPrivateUseArea( sal_Unicode cChar ) -{ - sal_Unicode cRes = 0; - for (int i = 0; i < nMathToUnicodeLen && cRes == 0; ++i) - { - if (aMathConvTbl[i].cUnicode == cChar) - cRes = aMathConvTbl[i].cMath; + DBG_ASSERT( 0, "Error: private use area characters should no longer be in use!" ); + cRes = (sal_Unicode) '&'; // just some character that should easily be notice as odd in the context } return cRes; } -sal_Unicode ConvertMathToMathType( sal_Unicode cChar ) -{ - sal_Unicode cRes = 0; - for (int i = 0; i < nMathToUnicodeLen && cRes == 0; ++i) - { - const MathConversionEntry &rEntry = aMathConvTbl[i]; - if (rEntry.cMath == cChar) - { - cRes = rEntry.cMathType; - if (cRes == 0) - cRes = rEntry.cUnicode; - } - } - return cRes; -} - -sal_Unicode ConvertMathTypeToMath( sal_Unicode cChar ) -{ - sal_Unicode cRes = 0; - for (int i = 0; i < nMathToUnicodeLen && cRes == 0; ++i) - { - const MathConversionEntry &rEntry = aMathConvTbl[i]; - sal_Unicode cTmp = rEntry.cMathType; - if (cTmp == 0) - cTmp = rEntry.cUnicode; - if (cTmp == cChar) - cRes = rEntry.cMath; - } - return cRes; -} -#endif //TL_NOT_YET_USED - sal_Unicode ConvertMathToMathML( sal_Unicode cChar ) { - sal_Unicode cRes = 0; - if (cChar == MS_OVERBRACE) - cRes = 0xF612; // Math-ML code-point (there is no official unicode-point) - else if (cChar == MS_UNDERBRACE) - cRes = 0xF613; // Math-ML code-point (there is no official unicode-point) - else - cRes = ConvertMathPrivateUseAreaToUnicode( cChar ); - return cRes; -} - -#ifdef TL_NOT_YET_USED -sal_Unicode ConvertMathMLToMath( sal_Unicode cChar ) -{ - sal_Unicode cRes = 0; - if (cChar == 0xF612) - cRes = MS_OVERBRACE; // Math-ML code-point (there is no official unicode-point) - else if (cChar == 0xF613) - cRes = MS_UNDERBRACE; // Math-ML code-point (there is no official unicode-point) - else - cRes = ConvertUnicodeToMathPrivateUseArea( cChar ); - return cRes; -} - - -sal_Unicode GetTokenChar( sal_Unicode cChar, sal_Bool bConvertForExport ) -{ - sal_Unicode cRes = cChar; - if (bConvertForExport) - { - sal_Unicode cTmp = ConvertMathPrivateUseAreaToUnicode( cChar ); - if (cTmp != 0) - cRes = cTmp; - } + sal_Unicode cRes = ConvertMathPrivateUseAreaToUnicode( cChar ); return cRes; } -#endif //TL_NOT_YET_USED - diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 8339e4ed66..be3e274a5f 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -37,11 +37,12 @@ #include <sfx2/printer.hxx> #include <vcl/svapp.hxx> #include <svtools/ctrltool.hxx> -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> #include <unotools/localedatawrapper.hxx> #include <unotools/processfactory.hxx> #include <svx/paperinf.hxx> #include <vcl/settings.hxx> +#include <vcl/print.hxx> #include <toolkit/awt/vclxdevice.hxx> #include <com/sun/star/beans/PropertyState.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -51,15 +52,14 @@ #include <xmloff/xmluconv.hxx> #include <rtl/ustrbuf.hxx> #include <comphelper/propertysetinfo.hxx> +#include <unotools/moduleoptions.hxx> + #include <unomodel.hxx> #include <document.hxx> #include <view.hxx> #include <symbol.hxx> -#ifndef STARMATH_HRC #include <starmath.hrc> -#endif #include <config.hxx> - #include <smdll.hxx> using namespace ::vos; @@ -75,11 +75,102 @@ using namespace ::com::sun::star::formula; using namespace ::com::sun::star::view; using namespace ::com::sun::star::script; + #define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) #define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L)) +//////////////////////////////////////////////////////////// + +SmPrintUIOptions::SmPrintUIOptions() +{ + ResStringArray aLocalizedStrings( SmResId( RID_PRINTUIOPTIONS ) ); + DBG_ASSERT( aLocalizedStrings.Count() >= 18, "resource incomplete" ); + if( aLocalizedStrings.Count() < 18 ) // bad resource ? + return; + + SmModule *pp = SM_MOD1(); + SmConfig *pConfig = pp->GetConfig(); + DBG_ASSERT( pConfig, "SmConfig not found" ); + if (!pConfig) + return; + + // create sequence of print UI options + // (Actually IsIgnoreSpacesRight is a parser option. Without it we need only 8 properties here.) + m_aUIProperties.realloc( 9 ); + + // create Section for formula (results in an extra tab page in dialog) + SvtModuleOptions aOpt; + String aAppGroupname( aLocalizedStrings.GetString( 0 ) ); + aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), + aOpt.GetModuleName( SvtModuleOptions::E_SMATH ) ); + m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() ); + + // create subgroup for print options + m_aUIProperties[1].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 1 ), rtl::OUString() ); + + // create a bool option for title row (matches to SID_PRINTTITLE) + m_aUIProperties[2].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ), + aLocalizedStrings.GetString( 3 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_TITLE_ROW ) ), + pConfig->IsPrintTitle() ); + // create a bool option for formula text (matches to SID_PRINTTEXT) + m_aUIProperties[3].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ), + aLocalizedStrings.GetString( 5 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_FORMULA_TEXT ) ), + pConfig->IsPrintFormulaText() ); + // create a bool option for border (matches to SID_PRINTFRAME) + m_aUIProperties[4].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ), + aLocalizedStrings.GetString( 7 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_BORDER ) ), + pConfig->IsPrintFrame() ); + + // create subgroup for print format + m_aUIProperties[5].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 8 ), rtl::OUString() ); + + // create a radio button group for print format (matches to SID_PRINTSIZE) + Sequence< rtl::OUString > aChoices( 3 ); + aChoices[0] = aLocalizedStrings.GetString( 9 ); + aChoices[1] = aLocalizedStrings.GetString( 11 ); + aChoices[2] = aLocalizedStrings.GetString( 13 ); + Sequence< rtl::OUString > aHelpTexts( 3 ); + aHelpTexts[0] = aLocalizedStrings.GetString( 10 ); + aHelpTexts[1] = aLocalizedStrings.GetString( 12 ); + aHelpTexts[2] = aLocalizedStrings.GetString( 14 ); + OUString aPrintFormatProp( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_PRINT_FORMAT ) ); + m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(), + aHelpTexts, + aPrintFormatProp, + aChoices, static_cast< sal_Int32 >(pConfig->GetPrintSize()) + ); + + // create a numeric box for scale dependent on PrintFormat = "Scaling" (matches to SID_PRINTZOOM) + vcl::PrinterOptionsHelper::UIControlOptions aRangeOpt( aPrintFormatProp, 2, sal_True ); + m_aUIProperties[ 7 ].Value = getRangeControlOpt( rtl::OUString(), + aLocalizedStrings.GetString( 14 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_PRINT_SCALE ) ), + pConfig->GetPrintZoomFactor(), // initial value + 10, // min value + 1000, // max value + aRangeOpt ); + + Sequence< PropertyValue > aHintNoLayoutPage( 1 ); + aHintNoLayoutPage[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HintNoLayoutPage" ) ); + aHintNoLayoutPage[0].Value = makeAny( sal_True ); + m_aUIProperties[8].Value <<= aHintNoLayoutPage; + +// IsIgnoreSpacesRight is a parser option! Thus we don't add it to the printer UI. +// +// // create subgroup for misc options +// m_aUIProperties[8].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 9 ) ); +// +// // create a bool option for ignore spacing (matches to SID_NO_RIGHT_SPACES) +// m_aUIProperties[9].Value = getBoolControlOpt( aLocalizedStrings.GetString( 10 ), +// rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_NO_RIGHT_SPACE ) ), +// pConfig->IsIgnoreSpacesRight() ); +} + -//////////////////////////////////////// +//////////////////////////////////////////////////////////// // // class SmModel // @@ -229,11 +320,14 @@ PropertySetInfo * lcl_createModelPropertyInfo () SmModel::SmModel( SfxObjectShell *pObjSh ) : SfxBaseModel(pObjSh) , PropertySetHelper ( lcl_createModelPropertyInfo () ) +, m_pPrintUIOptions( NULL ) + { } //----------------------------------------------------------------------- SmModel::~SmModel() throw () { + delete m_pPrintUIOptions; } /*-- 28.03.00 14:18:17--------------------------------------------------- @@ -862,10 +956,33 @@ sal_Int32 SAL_CALL SmModel::getRendererCount( return 1; } + +static Size lcl_GuessPaperSize() +{ + Size aRes; + Reference< XMultiServiceFactory > xMgr( getProcessServiceFactory() ); + LocaleDataWrapper aLocWrp( xMgr, AllSettings().GetLocale() ); + if( MEASURE_METRIC == aLocWrp.getMeasurementSystemEnum() ) + { + // in 100th mm + PaperInfo aInfo( PAPER_A4 ); + aRes.Width() = aInfo.getWidth(); + aRes.Height() = aInfo.getHeight(); + } + else + { + // in 100th mm + PaperInfo aInfo( PAPER_LETTER ); + aRes.Width() = aInfo.getWidth(); + aRes.Height() = aInfo.getHeight(); + } + return aRes; +} + uno::Sequence< beans::PropertyValue > SAL_CALL SmModel::getRenderer( sal_Int32 nRenderer, const uno::Any& /*rSelection*/, - const uno::Sequence< beans::PropertyValue >& /*xOptions*/ ) + const uno::Sequence< beans::PropertyValue >& /*rxOptions*/ ) throw (IllegalArgumentException, RuntimeException) { ::vos::OGuard aGuard(Application::GetSolarMutex()); @@ -885,7 +1002,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SmModel::getRenderer( // if paper size is 0 (usually if no 'real' printer is found), // guess the paper size if (aPrtPaperSize.Height() == 0 || aPrtPaperSize.Width() == 0) - aPrtPaperSize = SvxPaperInfo::GetDefaultPaperSize(MAP_100TH_MM); + aPrtPaperSize = lcl_GuessPaperSize(); awt::Size aPageSize( aPrtPaperSize.Width(), aPrtPaperSize.Height() ); uno::Sequence< beans::PropertyValue > aRenderer(1); @@ -893,6 +1010,10 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SmModel::getRenderer( rValue.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ); rValue.Value <<= aPageSize; + if (!m_pPrintUIOptions) + m_pPrintUIOptions = new SmPrintUIOptions(); + m_pPrintUIOptions->appendPrintUIOptions( aRenderer ); + return aRenderer; } @@ -954,7 +1075,7 @@ void SAL_CALL SmModel::render( // no real printer ?? if (aPrtPaperSize.Height() == 0 || aPrtPaperSize.Width() == 0) { - aPrtPaperSize = SvxPaperInfo::GetDefaultPaperSize(MAP_100TH_MM); + aPrtPaperSize = lcl_GuessPaperSize(); // factors from Windows DIN A4 aOutputSize = Size( (long)(aPrtPaperSize.Width() * 0.941), (long)(aPrtPaperSize.Height() * 0.961)); @@ -979,8 +1100,18 @@ void SAL_CALL SmModel::render( OutputRect.Right() -= 1500 - (aPrtPaperSize.Width() - (aPrtPageOffset.X() + OutputRect.Right())); - pView->Impl_Print( *pOut, PRINT_SIZE_NORMAL, - Rectangle( OutputRect ), Point() ); + if (!m_pPrintUIOptions) + m_pPrintUIOptions = new SmPrintUIOptions(); + m_pPrintUIOptions->processProperties( rxOptions ); + + pView->Impl_Print( *pOut, *m_pPrintUIOptions, Rectangle( OutputRect ), Point() ); + + // release SmPrintUIOptions when everything is done. + // That way, when SmPrintUIOptions is needed again it will read the latest configuration settings in its c-tor. + if (m_pPrintUIOptions->getBoolValue( "IsLastPage", sal_False )) + { + delete m_pPrintUIOptions; m_pPrintUIOptions = 0; + } } } } diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 888bbcd96c..c26d210447 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -51,15 +51,15 @@ #include <sfx2/objface.hxx> #include <sfx2/printer.hxx> #include <sfx2/request.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/itemset.hxx> -#include <svtools/poolitem.hxx> -#include <svtools/ptitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/itemset.hxx> +#include <svl/poolitem.hxx> +#include <svl/ptitem.hxx> +#include <svl/stritem.hxx> #include <svtools/transfer.hxx> -#include <svtools/undo.hxx> -#include <svtools/whiter.hxx> +#include <svl/undo.hxx> +#include <svl/whiter.hxx> #include <svx/dialogs.hrc> #include <svx/editeng.hxx> #include <svx/svxdlg.hxx> @@ -69,6 +69,7 @@ #include <vcl/msgbox.hxx> #include <vcl/wrkwin.hxx> +#include "unomodel.hxx" #include "view.hxx" #include "config.hxx" #include "dialog.hxx" @@ -89,8 +90,6 @@ #define SmViewShell #include "smslots.hxx" - - using namespace com::sun::star; using namespace com::sun::star::accessibility; using namespace com::sun::star::uno; @@ -1010,18 +1009,25 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const } void SmViewShell::Impl_Print( - OutputDevice &rOutDev, const SmPrintSize ePrintSize, + OutputDevice &rOutDev, + const SmPrintUIOptions &rPrintUIOptions, Rectangle aOutRect, Point aZeroPoint ) { RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::Impl_Print" ); - SmModule *pp = SM_MOD1(); + const bool bIsPrintTitle = rPrintUIOptions.getBoolValue( PRTUIOPT_TITLE_ROW, sal_True ); + const bool bIsPrintFrame = rPrintUIOptions.getBoolValue( PRTUIOPT_BORDER, sal_True ); + const bool bIsPrintFormulaText = rPrintUIOptions.getBoolValue( PRTUIOPT_FORMULA_TEXT, sal_True ); + SmPrintSize ePrintSize( static_cast< SmPrintSize >( rPrintUIOptions.getIntValue( PRTUIOPT_PRINT_FORMAT, PRINT_SIZE_NORMAL ) )); + const USHORT nZoomFactor = static_cast< USHORT >(rPrintUIOptions.getIntValue( PRTUIOPT_PRINT_SCALE, 100 )); +// IsIgnoreSpacesRight is a parser option! Thus it does not get evaluated here anymore (too late). +// const bool bNoRightSpaces = rPrintUIOptions.getBoolValue( PRTUIOPT_NO_RIGHT_SPACE, sal_True ); rOutDev.Push(); rOutDev.SetLineColor( Color(COL_BLACK) ); // output text on top - if (pp->GetConfig()->IsPrintTitle()) + if (bIsPrintTitle) { Size aSize600 (0, 600); Size aSize650 (0, 650); @@ -1041,7 +1047,7 @@ void SmViewShell::Impl_Print( Size aDescSize (GetTextSize(rOutDev, GetDoc()->GetComment(), aOutRect.GetWidth() - 200)); - if (pp->GetConfig()->IsPrintFrame()) + if (bIsPrintFrame) rOutDev.DrawRect(Rectangle(aOutRect.TopLeft(), Size(aOutRect.GetWidth(), 100 + aTitleSize.Height() + 200 + aDescSize.Height() + 100))); aOutRect.Top() += 200; @@ -1068,11 +1074,9 @@ void SmViewShell::Impl_Print( } // output text on bottom - if (pp->GetConfig()->IsPrintFormulaText()) + if (bIsPrintFormulaText) { -// Font aFont(FAMILY_DONTKNOW, Size(0, 600)); - Font aFont; - + Font aFont(FAMILY_DONTKNOW, Size(0, 600)); aFont.SetAlign(ALIGN_TOP); aFont.SetColor( Color(COL_BLACK) ); @@ -1083,7 +1087,7 @@ void SmViewShell::Impl_Print( aOutRect.Bottom() -= aSize.Height() + 600; - if (pp->GetConfig()->IsPrintFrame()) + if (bIsPrintFrame) rOutDev.DrawRect(Rectangle(aOutRect.BottomLeft(), Size(aOutRect.GetWidth(), 200 + aSize.Height() + 200))); @@ -1094,7 +1098,7 @@ void SmViewShell::Impl_Print( aOutRect.Bottom() -= 200; } - if (pp->GetConfig()->IsPrintFrame()) + if (bIsPrintFrame) rOutDev.DrawRect(aOutRect); aOutRect.Top() += 100; @@ -1105,6 +1109,9 @@ void SmViewShell::Impl_Print( Size aSize (GetDoc()->GetSize()); MapMode OutputMapMode; + // PDF export should always use PRINT_SIZE_NORMAL ... + if (!rPrintUIOptions.getBoolValue( "IsPrinter", sal_False ) ) + ePrintSize = PRINT_SIZE_NORMAL; switch (ePrintSize) { case PRINT_SIZE_NORMAL: @@ -1129,7 +1136,7 @@ void SmViewShell::Impl_Print( case PRINT_SIZE_ZOOMED: { - Fraction aFraction (pp->GetConfig()->GetPrintZoomFactor(), 100); + Fraction aFraction( nZoomFactor, 100 ); OutputMapMode = MapMode(MAP_100TH_MM, aZeroPoint, aFraction, aFraction); break; @@ -1155,44 +1162,10 @@ void SmViewShell::Impl_Print( rOutDev.Pop(); } -USHORT SmViewShell::Print(SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pPrintDialog) +USHORT SmViewShell::Print(SfxProgress & /*rProgress*/, BOOL /*bIsAPI*/, PrintDialog * /*pPrintDialog*/) { RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::Print" ); - - SmPrinterAccess aPrinterAccess( *GetDoc() ); - Printer *pPrinter = aPrinterAccess.GetPrinter(); - //OutputDevice *pOutDev = pPrinter; - - SfxViewShell::Print (rProgress, bIsAPI, pPrintDialog); - - pPrinter->StartPage(); - - Point aZeroPoint; - Rectangle OutputRect( aZeroPoint, pPrinter->GetOutputSize() ); - - Point aPrtPageOffset( pPrinter->GetPageOffset() ); - Size aPrtPaperSize ( pPrinter->GetPaperSize() ); - - // set minimum top and bottom border - if (aPrtPageOffset.Y() < 2000) - OutputRect.Top() += 2000 - aPrtPageOffset.Y(); - if ((aPrtPaperSize.Height() - (aPrtPageOffset.Y() + OutputRect.Bottom())) < 2000) - OutputRect.Bottom() -= 2000 - (aPrtPaperSize.Height() - - (aPrtPageOffset.Y() + OutputRect.Bottom())); - - // set minimum left and right border - if (aPrtPageOffset.X() < 2500) - OutputRect.Left() += 2500 - aPrtPageOffset.X(); - if ((aPrtPaperSize.Width() - (aPrtPageOffset.X() + OutputRect.Right())) < 1500) - OutputRect.Right() -= 1500 - (aPrtPaperSize.Width() - - (aPrtPageOffset.X() + OutputRect.Right())); - - SmModule *pp = SM_MOD1(); - Impl_Print( *pPrinter, pp->GetConfig()->GetPrintSize(), - OutputRect, aZeroPoint ); - - pPrinter->EndPage(); - + DBG_ASSERT( 0, "SmViewShell::Print: no longer usewd with new UI print dialog. Should be removed!!" ); return 0; } @@ -1653,7 +1626,7 @@ void SmViewShell::Execute(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aSet, RID_SVXDLG_ZOOM); + pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aSet); DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001 } pDlg->SetLimits( MINZOOM, MAXZOOM ); diff --git a/starmath/util/makefile.mk b/starmath/util/makefile.mk index 978cb6cff4..0e11dc46aa 100644 --- a/starmath/util/makefile.mk +++ b/starmath/util/makefile.mk @@ -65,6 +65,7 @@ SHL1STDLIBS= \ $(TKLIB) \ $(VCLLIB) \ $(SVLLIB) \ + $(I18NPAPERLIB) \ $(SOTLIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ diff --git a/sw/inc/IDocumentDeviceAccess.hxx b/sw/inc/IDocumentDeviceAccess.hxx index 271bdbcc22..0ac8c3951c 100755 --- a/sw/inc/IDocumentDeviceAccess.hxx +++ b/sw/inc/IDocumentDeviceAccess.hxx @@ -33,7 +33,7 @@ class SfxPrinter; class JobSetup; - struct SwPrintData; + class SwPrintData; class VirtualDevice; class OutputDevice; diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index f71c0f3e23..e2060e83d4 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -31,8 +31,6 @@ #ifndef _POSTITMGR_HXX #define _POSTITMGR_HXX -#include <svtools/lstner.hxx> - #include <list> #include <vector> #include <svx/outlobj.hxx> @@ -41,8 +39,10 @@ #include <tools/debug.hxx> #include <swrect.hxx> #include <unotools/configitem.hxx> +#include <unotools/options.hxx> #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/uno/Any.hxx> +#include <svl/lstner.hxx> class SwWrtShell; class SwDoc; @@ -139,6 +139,9 @@ class SwNoteProps: public utl::ConfigItem } return aNames; } + + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); }; class SwPostItMgr: public SfxListener diff --git a/sw/inc/SwAppletImpl.hxx b/sw/inc/SwAppletImpl.hxx index e99886aa49..051bc5b174 100644 --- a/sw/inc/SwAppletImpl.hxx +++ b/sw/inc/SwAppletImpl.hxx @@ -46,9 +46,9 @@ #include <vcl/wrkwin.hxx> #endif #include <sot/storage.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> -#include <svtools/ownlist.hxx> +#include <svl/ownlist.hxx> class SfxItemSet; diff --git a/sw/inc/SwNumberTree.hxx b/sw/inc/SwNumberTree.hxx index 03815a265c..7f4c88b608 100644 --- a/sw/inc/SwNumberTree.hxx +++ b/sw/inc/SwNumberTree.hxx @@ -385,7 +385,7 @@ public: // RTL_TEXTENCODING_ASCII_US), // int nDepth = -1) const; -#ifndef PRODUCT +#ifdef DBG_UTIL static unsigned long GetInstances(); unsigned long GetSerial(); #endif @@ -494,7 +494,7 @@ protected: */ mutable tSwNumberTreeChildren::iterator mItLastValid; -#ifndef PRODUCT +#ifdef DBG_UTIL /** Counter for the number of created instances. */ diff --git a/sw/inc/acmplwrd.hxx b/sw/inc/acmplwrd.hxx index f9439f3b53..0167fdbaae 100644 --- a/sw/inc/acmplwrd.hxx +++ b/sw/inc/acmplwrd.hxx @@ -32,7 +32,7 @@ #define _SVSTDARR_STRINGSISORTDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> class SwDoc; class SwAutoCompleteWord_Impl; diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx index cb8ac0733b..d1fb7475a1 100644 --- a/sw/inc/authfld.hxx +++ b/sw/inc/authfld.hxx @@ -35,7 +35,7 @@ #include <toxe.hxx> #define _SVSTDARR_LONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> class SwAuthDataArr; /* -----------------21.09.99 13:32------------------- diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx index 5a97eba019..476f0ccadc 100644 --- a/sw/inc/calc.hxx +++ b/sw/inc/calc.hxx @@ -30,7 +30,7 @@ #ifndef _CALC_HXX #define _CALC_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #ifndef __SBX_SBXVALUE //autogen #include <basic/sbxvar.hxx> diff --git a/sw/inc/ccoll.hxx b/sw/inc/ccoll.hxx index 5b6f9953e7..ac731756c8 100644 --- a/sw/inc/ccoll.hxx +++ b/sw/inc/ccoll.hxx @@ -30,7 +30,7 @@ #ifndef _CCOLL_HXX #define _CCOLL_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <tools/string.hxx> #include <sfx2/tabdlg.hxx> diff --git a/sw/inc/cellatr.hxx b/sw/inc/cellatr.hxx index ad9ae500af..27521f5e40 100644 --- a/sw/inc/cellatr.hxx +++ b/sw/inc/cellatr.hxx @@ -31,8 +31,8 @@ #ifndef _CELLATR_HXX #define _CELLATR_HXX -#include <svtools/intitem.hxx> -#include <svtools/zforlist.hxx> +#include <svl/intitem.hxx> +#include <svl/zforlist.hxx> #include "swdllapi.h" #include "format.hxx" #include "cellfml.hxx" diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 0ea79539fc..a87925bb84 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -323,7 +323,6 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr #define FN_GLOBAL_OPEN (FN_VIEW + 47) /* oeffnen */ #define FN_GLOBAL_SAVE_CONTENT (FN_VIEW + 48) /* Inhalt der Verknuepfung mitspeichern */ #define FN_CREATE_NAVIGATION (FN_VIEW + 49) /* Navigations-Controller erzeugen */ -#define FN_PREVIEW_PRINT_OPTIONS (FN_VIEW + 50) /* Optionsdialog Preview drucken */ #define FN_PREVIEW_ZOOM (FN_VIEW + 51) /* der Tabellencontroller fuer den Zoom */ #define FN_SET_MODOPT_TBLNUMFMT (FN_VIEW + 52) /* Zahlenerkennung in Tabellen */ diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 692184be2d..a98e7c69a0 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -111,7 +111,7 @@ struct SwContentAtPos SW_NUMLABEL = 0x0200, // #i23726# SW_CONTENT_CHECK = 0x0400, // --> FME 2005-05-13 #i43742# <-- SW_SMARTTAG = 0x0800 -#ifndef PRODUCT +#ifdef DBG_UTIL ,SW_CURR_ATTRS = 0x4000 // nur zum Debuggen ,SW_TABLEBOXVALUE = 0x8000 // nur zum Debuggen #endif @@ -465,7 +465,7 @@ public: */ void Combine(); -#if defined( PRODUCT ) +#if !defined(DBG_UTIL) void SttCrsrMove() { ++nCrsrMove; StartAction(); } void EndCrsrMove( const BOOL bIdleEnd = FALSE ) { EndAction( bIdleEnd ); --nCrsrMove; } diff --git a/sw/inc/dbfld.hxx b/sw/inc/dbfld.hxx index 8f3bf051aa..a98c1e2d17 100644 --- a/sw/inc/dbfld.hxx +++ b/sw/inc/dbfld.hxx @@ -52,6 +52,7 @@ class SW_DLLPUBLIC SwDBFieldType : public SwValueFieldType public: SwDBFieldType(SwDoc* pDocPtr, const String& rColumnName, const SwDBData& rDBData); + ~SwDBFieldType(); virtual const String& GetName() const; virtual SwFieldType* Copy() const; diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx index dc464837b5..7ad83d658c 100644 --- a/sw/inc/dbmgr.hxx +++ b/sw/inc/dbmgr.hxx @@ -33,7 +33,7 @@ #include <tools/string.hxx> #include <tools/link.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <com/sun/star/util/Date.hpp> #include "swdllapi.h" #include <swdbdata.hxx> @@ -184,7 +184,7 @@ struct SwMergeDescriptor rDescriptor(rDesc), bSendAsHTML( sal_True ), bSendAsAttachment( sal_False ), - bPrintAsync( sal_True ), + bPrintAsync( sal_False ), bCreateSingleFile( sal_False ), pMailMergeConfigItem(0) {} @@ -252,12 +252,6 @@ public: // Mischen von Datensaetzen in Felder BOOL MergeNew( const SwMergeDescriptor& rMergeDesc ); BOOL Merge(SwWrtShell* pSh); - // Mischen von Datensaetzen in Felder, dann drucken - BOOL MergePrint( SwView& rView, - SwPrtOptions& rOpt, SfxProgress& rProgress, BOOL bIsAPI ); - // printing parts of a merge result document - BOOL MergePrintDocuments( SwView& rView, - SwPrtOptions& rOpt, SfxProgress& rProgress, BOOL bIsAPI ); // Datenbankfelder mit fehlendem Datenbankname initialisieren inline BOOL IsInitDBFields() const { return bInitDBFields; } diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index eccdcf2815..c5c31bf721 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -60,7 +60,7 @@ class SwList; // <-- #include <IDocumentExternalData.hxx> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/embed/XStorage.hpp> #include <vcl/timer.hxx> @@ -77,7 +77,7 @@ class SwList; #include <com/sun/star/linguistic2/XHyphenatedWord.hpp> #include <vos/ref.hxx> #include <svx/svdtypes.hxx> -#include <svtools/style.hxx> +#include <svl/style.hxx> #include <svx/numitem.hxx> #include "comphelper/implementationreference.hxx" #include <com/sun/star/chart2/data/XDataProvider.hpp> @@ -88,6 +88,8 @@ class SwList; #include <svtools/embedhlp.hxx> #include <vector> +#include <set> +#include <map> #include <memory> #include <boost/scoped_ptr.hpp> @@ -206,7 +208,8 @@ struct SwDocStat; struct SwHash; struct SwSortOptions; struct SwDefTOXBase_Impl; -struct SwPrintData; +class SwPrintData; +class SwPrintUIOptions; class SdrPageView; struct SwConversionArgs; class SwRewriter; @@ -214,6 +217,10 @@ class SwMsgPoolItem; class SwChartDataProvider; class SwChartLockController_Helper; class IGrammarContact; +class SwPrintData; +class SwRenderData; +class SwPageFrm; +class SwViewOption; namespace sw { namespace mark { class MarkManager; @@ -491,7 +498,7 @@ private: bool mbColumnSelection : 1; // true: this content has bee created by a column selection // (clipboard docs only) -#ifndef PRODUCT +#ifdef DBG_UTIL bool mbXMLExport : 1; // TRUE: during XML export #endif @@ -1065,7 +1072,7 @@ public: inline void SetOLEPrtNotifyPending( bool bSet = true ); void PrtOLENotify( sal_Bool bAll ); //Alle oder nur Markierte -#ifndef PRODUCT +#ifdef DBG_UTIL bool InXMLExport() const { return mbXMLExport; } void SetXMLExport( bool bFlag ) { mbXMLExport = bFlag; } #endif @@ -1360,6 +1367,15 @@ public: sal_Bool InsertGlossary( SwTextBlocks& rBlock, const String& rEntry, SwPaM& rPaM, SwCrsrShell* pShell = 0); + // get the set of printable pages for the XRenderable API by + // evaluating the respective settings (see implementation) + void CalculatePagesForPrinting( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, + sal_Int32 nDocPageCount ); + void UpdatePagesForPrintingWithPostItData( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, + sal_Int32 nDocPageCount ); + void CalculatePagePairsForProspectPrinting( SwRenderData &rData, const SwPrintUIOptions &rOptions, + sal_Int32 nDocPageCount ); + sal_uInt16 GetPageCount() const; const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const; diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx index 9152f8064f..bc237c4d3a 100644 --- a/sw/inc/docary.hxx +++ b/sw/inc/docary.hxx @@ -51,7 +51,7 @@ namespace com { namespace sun { namespace star { namespace i18n { #include <tools/table.hxx> #endif #include <swtypes.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> typedef SwFieldType* SwFldTypePtr; #define GROW_FLDTYPES 16 diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 62b484809e..fb2c78a2e2 100644..100755 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -39,7 +39,7 @@ #include <swdll.hxx> #include <shellid.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <svtools/embedhlp.hxx> class SwDoc; @@ -183,6 +183,7 @@ public: // Doc rausreichen aber VORSICHT inline SwDoc* GetDoc() { return pDoc; } + inline const SwDoc* GetDoc() const { return pDoc; } IDocumentDeviceAccess* getIDocumentDeviceAccess(); const IDocumentSettingAccess* getIDocumentSettingAccess() const; IDocumentChartDataProviderAccess* getIDocumentChartDataProviderAccess(); diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx index 169339fb07..fa2d2fc760 100644 --- a/sw/inc/docstyle.hxx +++ b/sw/inc/docstyle.hxx @@ -34,10 +34,10 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/style.hxx> -#include <svtools/itemset.hxx> +#include <svl/style.hxx> +#include <svl/itemset.hxx> #include "swdllapi.h" class SwDoc; diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index 181162ca24..a6c7fa320a 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -35,7 +35,7 @@ #include <tools/datetime.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include "fldbas.hxx" #include "numrule.hxx" diff --git a/sw/inc/edglbldc.hxx b/sw/inc/edglbldc.hxx index 82974fdabc..9b4f22f24d 100644 --- a/sw/inc/edglbldc.hxx +++ b/sw/inc/edglbldc.hxx @@ -30,7 +30,7 @@ #ifndef _EDGLBLDC_HXX #define _EDGLBLDC_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> class SwSection; class SwTOXBase; diff --git a/sw/inc/edimp.hxx b/sw/inc/edimp.hxx index 26db46cac9..08e23418e4 100644 --- a/sw/inc/edimp.hxx +++ b/sw/inc/edimp.hxx @@ -32,7 +32,7 @@ #define _EDIMP_HXX #include <tools/solar.h> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> class SwPaM; class SwNodeIndex; diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index e858334fd5..0a67b971fd 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -33,7 +33,7 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <tools/string.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <vcl/font.hxx> #include <svx/swafopt.hxx> #include "swdllapi.h" diff --git a/sw/inc/errhdl.hxx b/sw/inc/errhdl.hxx index 646c1dab7f..5ecc797ab5 100644 --- a/sw/inc/errhdl.hxx +++ b/sw/inc/errhdl.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -30,7 +30,7 @@ #ifndef _ERRHDL_HXX #define _ERRHDL_HXX -#ifndef PRODUCT +#ifdef DBG_UTIL #include <tools/solar.h> #include <sal/types.h> diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index e878b44602..d9f51852b8 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -30,7 +30,7 @@ #ifndef _EXPFLD_HXX #define _EXPFLD_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include "swdllapi.h" #include <fldbas.hxx> #include <cellfml.hxx> diff --git a/sw/inc/extinput.hxx b/sw/inc/extinput.hxx index 3e041d346a..818b8ce797 100644 --- a/sw/inc/extinput.hxx +++ b/sw/inc/extinput.hxx @@ -32,7 +32,7 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <pam.hxx> #include <i18npool/lang.h> diff --git a/sw/inc/fchrfmt.hxx b/sw/inc/fchrfmt.hxx index fe7d30c254..a21b642d24 100644 --- a/sw/inc/fchrfmt.hxx +++ b/sw/inc/fchrfmt.hxx @@ -31,7 +31,7 @@ #define _FCHRFMT_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <calbck.hxx> #include <format.hxx> diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index f4753a176e..6490164812 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -278,7 +278,7 @@ protected: public: -#ifndef PRODUCT +#ifdef DBG_UTIL virtual ~SwFieldType(); #endif static const String& GetTypeStr( USHORT nTypeId ); @@ -337,7 +337,7 @@ public: // ResId USHORT Which() const -#ifdef PRODUCT +#ifndef DBG_UTIL { return pType->Which(); } #else ; // in fldbas.cxx implementiert diff --git a/sw/inc/flypos.hxx b/sw/inc/flypos.hxx index 72a5f414eb..43ee823fa1 100644 --- a/sw/inc/flypos.hxx +++ b/sw/inc/flypos.hxx @@ -31,7 +31,7 @@ #define _FLYPOS_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <swdllapi.h> class SwFrmFmt; diff --git a/sw/inc/fmtanchr.hxx b/sw/inc/fmtanchr.hxx index 80f35111ef..d2f6d76c12 100644 --- a/sw/inc/fmtanchr.hxx +++ b/sw/inc/fmtanchr.hxx @@ -34,7 +34,7 @@ #include <hintids.hxx> #include <swtypes.hxx> #include <format.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> struct SwPosition; class IntlWrapper; diff --git a/sw/inc/fmtautofmt.hxx b/sw/inc/fmtautofmt.hxx index 928c02d2be..590d770547 100644 --- a/sw/inc/fmtautofmt.hxx +++ b/sw/inc/fmtautofmt.hxx @@ -31,7 +31,7 @@ #define _FMTAUTOFMT_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <format.hxx> #include <boost/shared_ptr.hpp> diff --git a/sw/inc/fmtclbl.hxx b/sw/inc/fmtclbl.hxx index a8a78dbcf5..a3e8fa442e 100644 --- a/sw/inc/fmtclbl.hxx +++ b/sw/inc/fmtclbl.hxx @@ -31,7 +31,7 @@ #define _FMTCLBL_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <hintids.hxx> #include <format.hxx> #include "swdllapi.h" diff --git a/sw/inc/fmtclds.hxx b/sw/inc/fmtclds.hxx index 1868eaaa7e..d70b241b60 100644 --- a/sw/inc/fmtclds.hxx +++ b/sw/inc/fmtclds.hxx @@ -31,7 +31,7 @@ #define _FMTCLDS_HXX #include <tools/color.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include "swdllapi.h" #include <hintids.hxx> #include <format.hxx> diff --git a/sw/inc/fmtcnct.hxx b/sw/inc/fmtcnct.hxx index 2e648a5664..bb1e7aadc3 100644 --- a/sw/inc/fmtcnct.hxx +++ b/sw/inc/fmtcnct.hxx @@ -31,7 +31,7 @@ #define _FMTCNCT_HXX #include <hintids.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <format.hxx> #include <calbck.hxx> diff --git a/sw/inc/fmtcntnt.hxx b/sw/inc/fmtcntnt.hxx index 405f1cef86..0adec4eedd 100644 --- a/sw/inc/fmtcntnt.hxx +++ b/sw/inc/fmtcntnt.hxx @@ -30,7 +30,7 @@ #ifndef _FMTCNTNT_HXX #define _FMTCNTNT_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <hintids.hxx> #include <format.hxx> diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx index 2d86ec79fd..b10707cd09 100644 --- a/sw/inc/fmtcol.hxx +++ b/sw/inc/fmtcol.hxx @@ -30,7 +30,7 @@ #ifndef _FMTCOL_HXX #define _FMTCOL_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include "swdllapi.h" #include <format.hxx> #include <swtypes.hxx> // fuer MAXLEVEL diff --git a/sw/inc/fmteiro.hxx b/sw/inc/fmteiro.hxx index 61a498ec5e..6de1fc8603 100644 --- a/sw/inc/fmteiro.hxx +++ b/sw/inc/fmteiro.hxx @@ -31,7 +31,7 @@ #define _FMTEIRO_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <hintids.hxx> #include <format.hxx> #include "swdllapi.h" diff --git a/sw/inc/fmtflcnt.hxx b/sw/inc/fmtflcnt.hxx index f251580a25..b4c21d7315 100644 --- a/sw/inc/fmtflcnt.hxx +++ b/sw/inc/fmtflcnt.hxx @@ -31,7 +31,7 @@ #define _FMTFLCNT_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> class SwFrmFmt; class SwTxtFlyCnt; diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx index 7edbb77a0f..f311530079 100644 --- a/sw/inc/fmtfld.hxx +++ b/sw/inc/fmtfld.hxx @@ -30,9 +30,9 @@ #ifndef _FMTFLD_HXX #define _FMTFLD_HXX -#include <svtools/poolitem.hxx> -#include <svtools/brdcst.hxx> -#include <svtools/smplhint.hxx> +#include <svl/poolitem.hxx> +#include <svl/brdcst.hxx> +#include <svl/smplhint.hxx> #include "swdllapi.h" #include <calbck.hxx> diff --git a/sw/inc/fmtfollowtextflow.hxx b/sw/inc/fmtfollowtextflow.hxx index dc89b2b392..9738eb26d2 100644 --- a/sw/inc/fmtfollowtextflow.hxx +++ b/sw/inc/fmtfollowtextflow.hxx @@ -31,7 +31,7 @@ #define _FMTFOLLOWTEXTFLOW_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <hintids.hxx> #include <format.hxx> #include "swdllapi.h" diff --git a/sw/inc/fmtfordr.hxx b/sw/inc/fmtfordr.hxx index abf52ac6ec..3d6353d140 100644 --- a/sw/inc/fmtfordr.hxx +++ b/sw/inc/fmtfordr.hxx @@ -30,7 +30,7 @@ #ifndef _FMTFORDR_HXX #define _FMTFORDR_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <hintids.hxx> #include <format.hxx> diff --git a/sw/inc/fmtfsize.hxx b/sw/inc/fmtfsize.hxx index 7cf2338e24..e3b365ef00 100644 --- a/sw/inc/fmtfsize.hxx +++ b/sw/inc/fmtfsize.hxx @@ -31,7 +31,7 @@ #define _FMTFSIZE_HXX #include <tools/gen.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include "swdllapi.h" #include <hintids.hxx> #include <swtypes.hxx> diff --git a/sw/inc/fmtftn.hxx b/sw/inc/fmtftn.hxx index 4fe37c153a..0f903e375a 100644 --- a/sw/inc/fmtftn.hxx +++ b/sw/inc/fmtftn.hxx @@ -31,7 +31,7 @@ #define _FMTFTN_HXX #include <tools/string.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include "swdllapi.h" class SwDoc; diff --git a/sw/inc/fmtftntx.hxx b/sw/inc/fmtftntx.hxx index 927f51f7bf..2648a3489f 100644 --- a/sw/inc/fmtftntx.hxx +++ b/sw/inc/fmtftntx.hxx @@ -30,7 +30,7 @@ #ifndef _FMTFTNTX_HXX #define _FMTFTNTX_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <hintids.hxx> #include <format.hxx> #include <numrule.hxx> diff --git a/sw/inc/fmthdft.hxx b/sw/inc/fmthdft.hxx index e5e5b0b68f..743200f92a 100644 --- a/sw/inc/fmthdft.hxx +++ b/sw/inc/fmthdft.hxx @@ -32,7 +32,7 @@ #include <hintids.hxx> #include <format.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <calbck.hxx> class SwFrmFmt; diff --git a/sw/inc/fmtinfmt.hxx b/sw/inc/fmtinfmt.hxx index 835c221bb2..0031d03b0a 100644 --- a/sw/inc/fmtinfmt.hxx +++ b/sw/inc/fmtinfmt.hxx @@ -31,7 +31,7 @@ #define _FMTINFMT_HXX #include <tools/string.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include "swdllapi.h" class SvxMacro; diff --git a/sw/inc/fmtline.hxx b/sw/inc/fmtline.hxx index 878806a3ce..e38cd780b5 100644 --- a/sw/inc/fmtline.hxx +++ b/sw/inc/fmtline.hxx @@ -31,7 +31,7 @@ #define SW_FMTLINE_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <hintids.hxx> #include <format.hxx> #include "swdllapi.h" diff --git a/sw/inc/fmtlsplt.hxx b/sw/inc/fmtlsplt.hxx index c186eb5706..bd5cf11b1a 100644 --- a/sw/inc/fmtlsplt.hxx +++ b/sw/inc/fmtlsplt.hxx @@ -30,7 +30,7 @@ #ifndef _FMTTSPLT_HXX #define _FMTTSPLT_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <hintids.hxx> #include <format.hxx> #include "swdllapi.h" diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx index 792a7d8374..616c4cddc1 100755 --- a/sw/inc/fmtmeta.hxx +++ b/sw/inc/fmtmeta.hxx @@ -33,7 +33,7 @@ #include <cppuhelper/weakref.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <sfx2/Metadatable.hxx> #include <boost/shared_ptr.hpp> diff --git a/sw/inc/fmtornt.hxx b/sw/inc/fmtornt.hxx index 26d5fc3d66..f1bc3a3088 100644 --- a/sw/inc/fmtornt.hxx +++ b/sw/inc/fmtornt.hxx @@ -37,7 +37,7 @@ #include <hintids.hxx> #include <swtypes.hxx> #include <format.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> class IntlWrapper; diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx index 5c75ecdef7..d0aaec8a2e 100644 --- a/sw/inc/fmtpdsc.hxx +++ b/sw/inc/fmtpdsc.hxx @@ -31,7 +31,7 @@ #define _FMTPDSC_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include "swdllapi.h" #include <hintids.hxx> #include <format.hxx> diff --git a/sw/inc/fmtrfmrk.hxx b/sw/inc/fmtrfmrk.hxx index 4c277e41c8..3a163bc5d7 100644 --- a/sw/inc/fmtrfmrk.hxx +++ b/sw/inc/fmtrfmrk.hxx @@ -32,7 +32,7 @@ #include <tools/string.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> class SwTxtRefMark; diff --git a/sw/inc/fmtrowsplt.hxx b/sw/inc/fmtrowsplt.hxx index 30df01bd99..627663b8ec 100644 --- a/sw/inc/fmtrowsplt.hxx +++ b/sw/inc/fmtrowsplt.hxx @@ -30,7 +30,7 @@ #ifndef _FMTROWSPLT_HXX #define _FMTROWSPLT_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include "swdllapi.h" #include <hintids.hxx> #include <format.hxx> diff --git a/sw/inc/fmtruby.hxx b/sw/inc/fmtruby.hxx index ceb7c87f86..49bcdb8bad 100644 --- a/sw/inc/fmtruby.hxx +++ b/sw/inc/fmtruby.hxx @@ -32,7 +32,7 @@ #include <tools/string.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> class SwTxtRuby; diff --git a/sw/inc/fmtsrnd.hxx b/sw/inc/fmtsrnd.hxx index feeef7aa37..643e4f6293 100644 --- a/sw/inc/fmtsrnd.hxx +++ b/sw/inc/fmtsrnd.hxx @@ -33,7 +33,7 @@ #include "swdllapi.h" #include <hintids.hxx> #include <format.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> // --> OD 2006-08-15 #i68520# - refactoring // separate enumeration <SwSurround> in own header file diff --git a/sw/inc/fmturl.hxx b/sw/inc/fmturl.hxx index f2744ebf66..be9c08fde3 100644 --- a/sw/inc/fmturl.hxx +++ b/sw/inc/fmturl.hxx @@ -30,7 +30,7 @@ #ifndef _FMTURL_HXX #define _FMTURL_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include "swdllapi.h" #include <hintids.hxx> #include <format.hxx> diff --git a/sw/inc/fmtwrapinfluenceonobjpos.hxx b/sw/inc/fmtwrapinfluenceonobjpos.hxx index 473135708e..072dab4a25 100644 --- a/sw/inc/fmtwrapinfluenceonobjpos.hxx +++ b/sw/inc/fmtwrapinfluenceonobjpos.hxx @@ -32,7 +32,7 @@ #include <hintids.hxx> #include <format.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <com/sun/star/text/WrapInfluenceOnPosition.hpp> class SW_DLLPUBLIC SwFmtWrapInfluenceOnObjPos: public SfxPoolItem diff --git a/sw/inc/ftnidx.hxx b/sw/inc/ftnidx.hxx index c3a8b5c84c..e4e119439f 100644 --- a/sw/inc/ftnidx.hxx +++ b/sw/inc/ftnidx.hxx @@ -32,7 +32,7 @@ #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> class SwTxtFtn; class SwNodeIndex; diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc index 22162493a7..452b563d60 100644 --- a/sw/inc/globals.hrc +++ b/sw/inc/globals.hrc @@ -54,6 +54,7 @@ #define STR_DOC_STAT (RC_GLOBALS_BEGIN + 10) #define STR_PAGE (RC_GLOBALS_BEGIN + 14) +#define STR_PRINTOPTUI (RC_GLOBALS_BEGIN + 15) //EventStrings diff --git a/sw/inc/grfatr.hxx b/sw/inc/grfatr.hxx index 9f52a00675..f329184436 100644 --- a/sw/inc/grfatr.hxx +++ b/sw/inc/grfatr.hxx @@ -32,8 +32,8 @@ #include <hintids.hxx> // fuer die WhichIds @@@ must be included first @@@ #include <tools/gen.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> #include <svx/grfcrop.hxx> #include "swdllapi.h" #include <swatrset.hxx> // fuer inlines diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index 3172447029..f471ed217b 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -28,7 +28,7 @@ * ************************************************************************/ #ifndef _SOLAR_HRC -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #endif #define HID_BASE HID_APP_START diff --git a/sw/inc/hfspacingitem.hxx b/sw/inc/hfspacingitem.hxx index 04b9690b33..269834eaf4 100644 --- a/sw/inc/hfspacingitem.hxx +++ b/sw/inc/hfspacingitem.hxx @@ -31,7 +31,7 @@ #define _SW_HF_EAT_SPACINGITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <hintids.hxx> #include <format.hxx> diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx index 731791b881..615ba6dec3 100644 --- a/sw/inc/hints.hxx +++ b/sw/inc/hints.hxx @@ -88,14 +88,6 @@ public: }; -class SwInsChr: public SwMsgPoolItem -{ -public: - xub_StrLen nPos; - - SwInsChr( USHORT nP ); -}; - class SwInsTxt: public SwMsgPoolItem { public: @@ -214,7 +206,7 @@ public: USHORT Count() const { return pChgSet->Count(); } void ClearItem( USHORT nWhichL = 0 ) -#ifdef PRODUCT +#ifndef DBG_UTIL { pChgSet->ClearItem( nWhichL ); } #else ; @@ -270,17 +262,6 @@ public: //}; // <-- -class SwNRuleLowerLevel : public SwMsgPoolItem -{ - const String& rName; - BYTE nLvl; -public: - SwNRuleLowerLevel( const String& rRuleName, BYTE nLevel ); - - const String& GetName() const { return rName; } - BYTE GetLevel() const { return nLvl; } -}; - class SwFindNearestNode : public SwMsgPoolItem { const SwNode *pNd, *pFnd; diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx index 755f3694f1..d6b15660f0 100644 --- a/sw/inc/index.hxx +++ b/sw/inc/index.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,7 +43,7 @@ class SwIndex; class SwIndexReg; struct SwPosition; -#ifdef PRODUCT +#ifndef DBG_UTIL #define INLINE inline #else #define INLINE @@ -53,7 +53,7 @@ class SW_DLLPUBLIC SwIndex { friend class SwIndexReg; -#ifndef PRODUCT +#ifdef DBG_UTIL static int nSerial; int MySerial; #endif @@ -150,7 +150,7 @@ public: void MoveTo( SwIndexReg& rArr ); }; -#ifdef PRODUCT +#ifndef DBG_UTIL inline xub_StrLen SwIndex::operator++() { diff --git a/sw/inc/istyleaccess.hxx b/sw/inc/istyleaccess.hxx index 9bdfc4be2a..dffced6c25 100644 --- a/sw/inc/istyleaccess.hxx +++ b/sw/inc/istyleaccess.hxx @@ -31,7 +31,7 @@ #define _ISTYLEACCESS_HXX #include <vector> -#include <svtools/stylepool.hxx> +#include <svl/stylepool.hxx> /*-------------------------------------------------------------------- Management of (automatic) styles diff --git a/sw/inc/makefile.mk b/sw/inc/makefile.mk index 36aa661026..16adca8192 100644 --- a/sw/inc/makefile.mk +++ b/sw/inc/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -44,10 +44,10 @@ TARGET=inc .INCLUDE : target.mk -.IF "$(ENABLE_PCH)"!="" && ( "$(PRJNAME)"!="sw" || "$(BUILD_SPECIAL)"!="TRUE" ) +.IF "$(ENABLE_PCH)"!="" # && ( "$(PRJNAME)"!="sw" || "$(BUILD_SPECIAL)"!="TRUE" ) ALLTAR : \ $(SLO)$/precompiled.pch \ $(SLO)$/precompiled_ex.pch - + .ENDIF # "$(ENABLE_PCH)"!="" diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx index 8b5b1c73d9..f46de58ff6 100644 --- a/sw/inc/modcfg.hxx +++ b/sw/inc/modcfg.hxx @@ -33,7 +33,7 @@ #include <tools/string.hxx> #include <vcl/wintypes.hxx> #include <vcl/field.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <unotools/configitem.hxx> #include "swdllapi.h" #include "authratr.hxx" @@ -78,6 +78,7 @@ class SwRevisionConfig : public utl::ConfigItem ~SwRevisionConfig(); virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); void Load(); void SetModified(){ConfigItem::SetModified();} }; @@ -108,6 +109,7 @@ class SwInsertConfig : public utl::ConfigItem ~SwInsertConfig(); virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); void Load(); void SetModified(){ConfigItem::SetModified();} }; @@ -134,6 +136,7 @@ class SwTableConfig : public utl::ConfigItem ~SwTableConfig(); virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); void Load(); void SetModified(){ConfigItem::SetModified();} }; @@ -163,6 +166,7 @@ class SwMiscConfig : public utl::ConfigItem ~SwMiscConfig(); virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); void Load(); void SetModified(){ConfigItem::SetModified();} }; diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index d479fc9e78..7edfad173a 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -32,7 +32,7 @@ #define _NDARR_HXX #include <com/sun/star/embed/XEmbeddedObject.hpp> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #ifndef _BPARR_HXX #include <bparr.hxx> diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx index 620d8a0c2f..67cb843675 100644 --- a/sw/inc/ndhints.hxx +++ b/sw/inc/ndhints.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #define _NDHINTS_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <tools/mempool.hxx> #include "swtypes.hxx" @@ -117,7 +117,7 @@ public: { return m_HintStarts[nIdx]; } inline USHORT Count() const { return m_HintStarts.Count(); } -#ifndef PRODUCT +#ifdef DBG_UTIL bool Check() const; #endif }; diff --git a/sw/inc/ndindex.hxx b/sw/inc/ndindex.hxx index fa4fd28e82..6326b490b6 100644 --- a/sw/inc/ndindex.hxx +++ b/sw/inc/ndindex.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,7 +45,7 @@ class SW_DLLPUBLIC SwNodeIndex friend void SwNodes::DeRegisterIndex( SwNodeIndex& ); friend void SwNodes::RemoveNode( ULONG, ULONG, BOOL ); -#ifndef PRODUCT +#ifdef DBG_UTIL static int nSerial; int MySerial; #endif diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index f65252e0ce..42d9fecd74 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -89,7 +89,7 @@ class SW_DLLPUBLIC SwNode : private /* public*/ BigPtrEntry { friend class SwNodes; -#ifndef PRODUCT +#ifdef DBG_UTIL static long nSerial; long nMySerial; #endif @@ -114,7 +114,7 @@ protected: public: virtual ~SwNode(); -#ifndef PRODUCT +#ifdef DBG_UTIL long int GetSerial() const { return nMySerial; } #endif diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx index 77d0044dbf..1035cb9fe5 100644 --- a/sw/inc/numrule.hxx +++ b/sw/inc/numrule.hxx @@ -116,7 +116,7 @@ public: private: friend void _FinitCore(); -#ifndef PRODUCT +#ifdef DBG_UTIL long int nSerial; static long int nInstances; #endif diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx index 1a1cb98b52..2041e91d10 100644 --- a/sw/inc/pam.hxx +++ b/sw/inc/pam.hxx @@ -192,8 +192,8 @@ public: m_pMark = m_pPoint; } } +#ifndef DBG_UTIL -#ifdef PRODUCT void Exchange() { if (m_pPoint != m_pMark) diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx index dc0ca08366..cdc2a16b85 100644 --- a/sw/inc/paratr.hxx +++ b/sw/inc/paratr.hxx @@ -29,8 +29,8 @@ ************************************************************************/ #ifndef _PARATR_HXX #define _PARATR_HXX -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include "swdllapi.h" #include <hintids.hxx> #include <calbck.hxx> diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index 0a43d2c73d..e8aadd472a 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -33,6 +33,7 @@ #ifdef PRECOMPILED_HEADERS //---MARKER--- + #include "sal/config.h" #include "sal/types.h" @@ -511,8 +512,6 @@ #include "cppuhelper/weak.hxx" #include "cppuhelper/weakref.hxx" -#include "cppunit/simpleheader.hxx" - #include "framework/interaction.hxx" #include "goodies/grfmgr.hxx" @@ -613,99 +612,99 @@ #include "sot/storinfo.hxx" #include "svtools/FilterConfigItem.hxx" -#include "svtools/PasswordHelper.hxx" +#include "svl/PasswordHelper.hxx" #include "svtools/accessibilityoptions.hxx" -#include "svtools/aeitem.hxx" -#include "svtools/cjkoptions.hxx" -#include "svtools/cmdoptions.hxx" -#include "svtools/cntnrsrt.hxx" +#include "svl/aeitem.hxx" +#include "svl/cjkoptions.hxx" +#include "unotools/cmdoptions.hxx" +#include "svl/cntnrsrt.hxx" #include "svtools/collatorres.hxx" #include "svtools/colorcfg.hxx" -#include "svtools/compatibility.hxx" +#include "unotools/compatibility.hxx" #include "svtools/controldims.hrc" -#include "svtools/ctloptions.hxx" +#include "svl/ctloptions.hxx" #include "svtools/ctrlbox.hxx" #include "svtools/ctrltool.hxx" #include "svtools/editbrowsebox.hxx" #include "svtools/ehdl.hxx" -#include "svtools/eitem.hxx" +#include "svl/eitem.hxx" #include "svtools/embedhlp.hxx" #include "svtools/embedtransfer.hxx" #include "svtools/filter.hxx" -#include "svtools/flagitem.hxx" -#include "svtools/fltrcfg.hxx" -#include "svtools/fstathelper.hxx" -#include "svtools/globalnameitem.hxx" +#include "svl/flagitem.hxx" +#include "unotools/fltrcfg.hxx" +#include "svl/fstathelper.hxx" +#include "svl/globalnameitem.hxx" #include "svtools/headbar.hxx" #include "svtools/htmlkywd.hxx" #include "svtools/htmltokn.h" -#include "svtools/imageitm.hxx" +#include "svl/imageitm.hxx" #include "svtools/imap.hxx" #include "svtools/indexentryres.hxx" -#include "svtools/inethist.hxx" +#include "svl/inethist.hxx" #include "svtools/inetimg.hxx" #include "svtools/insdlg.hxx" -#include "svtools/intitem.hxx" -#include "svtools/isethint.hxx" -#include "svtools/itemiter.hxx" -#include "svtools/itempool.hxx" -#include "svtools/itemprop.hxx" -#include "svtools/itemset.hxx" -#include "svtools/languageoptions.hxx" -#include "svtools/lckbitem.hxx" -#include "svtools/lingucfg.hxx" -#include "svtools/linguprops.hxx" -#include "svtools/lstner.hxx" -#include "svtools/misccfg.hxx" -#include "svtools/moduleoptions.hxx" -#include "svtools/numuno.hxx" -#include "svtools/ownlist.hxx" +#include "svl/intitem.hxx" +#include "svl/isethint.hxx" +#include "svl/itemiter.hxx" +#include "svl/itempool.hxx" +#include "svl/itemprop.hxx" +#include "svl/itemset.hxx" +#include "svl/languageoptions.hxx" +#include "svl/lckbitem.hxx" +#include "unotools/lingucfg.hxx" +#include "unotools/linguprops.hxx" +#include "svl/lstner.hxx" +#include "unotools/misccfg.hxx" +#include "unotools/moduleoptions.hxx" +#include "svl/numuno.hxx" +#include "svl/ownlist.hxx" #include "svtools/parhtml.hxx" -#include "svtools/pathoptions.hxx" -#include "svtools/poolitem.hxx" +#include "unotools/pathoptions.hxx" +#include "svl/poolitem.hxx" #include "svtools/prgsbar.hxx" #include "svtools/printdlg.hxx" #include "svtools/prnsetup.hxx" -#include "svtools/ptitem.hxx" -#include "svtools/rectitem.hxx" +#include "svl/ptitem.hxx" +#include "svl/rectitem.hxx" #include "svtools/rtfkeywd.hxx" #include "svtools/rtfout.hxx" #include "svtools/rtftoken.h" #include "svtools/ruler.hxx" -#include "svtools/saveopt.hxx" +#include "unotools/saveopt.hxx" #include "svtools/scriptedtext.hxx" #include "svtools/sfxecode.hxx" -#include "svtools/slstitm.hxx" -#include "svtools/smplhint.hxx" +#include "svl/slstitm.hxx" +#include "svl/smplhint.hxx" #include "svtools/soerr.hxx" -#include "svtools/solar.hrc" -#include "svtools/sourceviewconfig.hxx" +#include "svl/solar.hrc" +#include "unotools/sourceviewconfig.hxx" #include "svtools/stdctrl.hxx" -#include "svtools/stritem.hxx" -#include "svtools/style.hrc" -#include "svtools/style.hxx" -#include "svtools/svarray.hxx" +#include "svl/stritem.hxx" +#include "svl/style.hrc" +#include "svl/style.hxx" +#include "svl/svarray.hxx" #include "svtools/svmedit.hxx" #include "svtools/svparser.hxx" -#include "svtools/svstdarr.hxx" +#include "svl/svstdarr.hxx" #include "svtools/svtabbx.hxx" #include "svtools/svtreebx.hxx" -#include "svtools/syslocale.hxx" +#include "unotools/syslocale.hxx" #include "svtools/templdlg.hxx" #include "svtools/textview.hxx" #include "svtools/transfer.hxx" #include "svtools/txtattr.hxx" #include "svtools/txtcmp.hxx" -#include "svtools/undo.hxx" -#include "svtools/undoopt.hxx" +#include "svl/undo.hxx" +#include "unotools/undoopt.hxx" #include "svtools/unoevent.hxx" #include "svtools/unoimap.hxx" -#include "svtools/urihelper.hxx" -#include "svtools/urlbmk.hxx" -#include "svtools/useroptions.hxx" +#include "svl/urihelper.hxx" +#include "svl/urlbmk.hxx" +#include "unotools/useroptions.hxx" #include "svtools/valueset.hxx" -#include "svtools/visitem.hxx" -#include "svtools/whiter.hxx" +#include "svl/visitem.hxx" +#include "svl/whiter.hxx" #include "svtools/xtextedt.hxx" #include "svx/IAccessibleParent.hxx" @@ -731,7 +730,7 @@ #include "svx/editstat.hxx" #include "svx/editview.hxx" #include "svx/eeitem.hxx" -#include "svx/escherex.hxx" +#include "filter/msfilter/escherex.hxx" #include "svx/extrusionbar.hxx" #include "svx/extrusioncontrols.hxx" #include "svx/fillctrl.hxx" @@ -766,11 +765,11 @@ #include "svx/lboxctrl.hxx" #include "svx/linectrl.hxx" #include "svx/linkmgr.hxx" -#include "svx/mscodec.hxx" -#include "svx/msdffimp.hxx" -#include "svx/msfiltertracer.hxx" -#include "svx/msocximex.hxx" -#include "svx/msoleexp.hxx" +#include "filter/msfilter/mscodec.hxx" +#include "filter/msfilter/msdffimp.hxx" +#include "filter/msfilter/msfiltertracer.hxx" +#include "filter/msfilter/msocximex.hxx" +#include "filter/msfilter/msoleexp.hxx" #include "svx/numitem.hxx" #include "svx/numvset.hxx" #include "svx/objfac3d.hxx" @@ -921,7 +920,7 @@ #include "vcl/fixed.hxx" #include "vcl/fldunit.hxx" #include "vcl/font.hxx" -#include "vcl/fontcvt.hxx" +#include "unotools/fontcvt.hxx" #include "vcl/graph.hxx" #include "vcl/group.hxx" #include "vcl/help.hxx" diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx index 992377ceb2..5ff4bbbab4 100644 --- a/sw/inc/postithelper.hxx +++ b/sw/inc/postithelper.hxx @@ -35,7 +35,7 @@ #include <redline.hxx> #include <vector> #include <vcl/window.hxx> -#include <svtools/brdcst.hxx> +#include <svl/brdcst.hxx> class SwTxtFld; class SwRootFrm; diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 7ecfe08ec5..3c77e72639 100644..100755 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -33,15 +33,45 @@ #include <sal/types.h> #include <rtl/ustring.hxx> +#include <vcl/print.hxx> -struct SwPrintData +#include <set> +#include <map> +#include <vector> +#include <utility> + +class SwPageFrm; +class SwDoc; +class SwDocShell; +class ViewShell; +class _SetGetExpFlds; +class SwViewOption; +class OutputDevice; +class SwViewOptionAdjust_Impl; +class SwPrtOptions; +class SwWrtShell; +class SfxViewShell; + +// forward declarations +class SwPrintUIOptions; +class SwRenderData; + +//////////////////////////////////////////////////////////// + + +class SwPrintData { + const SwPrintUIOptions * m_pPrintUIOptions; // not owner + const SwRenderData * m_pRenderData; // not owner + +public: + sal_Bool bPrintGraphic, bPrintTable, bPrintDraw, bPrintControl, bPrintPageBackground, bPrintBlackFont, //#i81434# - printing of hidden text bPrintHiddenText, bPrintTextPlaceholder, - bPrintLeftPage, bPrintRightPage, bPrintReverse, bPrintProspect, - bPrintProspect_RTL, + bPrintLeftPages, bPrintRightPages, bPrintReverse, bPrintProspect, + bPrintProspectRTL, bPrintSingleJobs, bPaperFromSetup, // --> FME 2005-12-13 #b6354161# Print empty pages bPrintEmptyPages, @@ -55,12 +85,15 @@ struct SwPrintData SwPrintData() { + m_pPrintUIOptions = NULL; + m_pRenderData = NULL; + bPrintGraphic = bPrintTable = bPrintDraw = bPrintControl = - bPrintLeftPage = - bPrintRightPage = + bPrintLeftPages = + bPrintRightPages = bPrintPageBackground = bPrintEmptyPages = bUpdateFieldsInPrinting = sal_True; @@ -68,11 +101,11 @@ struct SwPrintData bPaperFromSetup = bPrintReverse = bPrintProspect = - bPrintProspect_RTL = + bPrintProspectRTL = bPrintSingleJobs = - bModified = + bModified = bPrintBlackFont = - bPrintHiddenText = + bPrintHiddenText = bPrintTextPlaceholder = sal_False; nPrintPostIts = 0; @@ -83,64 +116,202 @@ struct SwPrintData sal_Bool operator==(const SwPrintData& rData)const { return - bPrintGraphic == rData.bPrintGraphic && - bPrintTable == rData.bPrintTable && - bPrintDraw == rData.bPrintDraw && - bPrintControl == rData.bPrintControl && - bPrintPageBackground== rData.bPrintPageBackground&& - bPrintBlackFont == rData.bPrintBlackFont && - bPrintLeftPage == rData.bPrintLeftPage && - bPrintRightPage == rData.bPrintRightPage && - bPrintReverse == rData.bPrintReverse && - bPrintProspect == rData.bPrintProspect && - bPrintProspect_RTL == rData.bPrintProspect_RTL && - bPrintSingleJobs == rData.bPrintSingleJobs && - bPaperFromSetup == rData.bPaperFromSetup && - bPrintEmptyPages == rData.bPrintEmptyPages && + bPrintGraphic == rData.bPrintGraphic && + bPrintTable == rData.bPrintTable && + bPrintDraw == rData.bPrintDraw && + bPrintControl == rData.bPrintControl && + bPrintPageBackground== rData.bPrintPageBackground && + bPrintBlackFont == rData.bPrintBlackFont && + bPrintLeftPages == rData.bPrintLeftPages && + bPrintRightPages == rData.bPrintRightPages && + bPrintReverse == rData.bPrintReverse && + bPrintProspect == rData.bPrintProspect && + bPrintProspectRTL == rData.bPrintProspectRTL && + bPrintSingleJobs == rData.bPrintSingleJobs && + bPaperFromSetup == rData.bPaperFromSetup && + bPrintEmptyPages == rData.bPrintEmptyPages && bUpdateFieldsInPrinting == rData.bUpdateFieldsInPrinting && - nPrintPostIts == rData.nPrintPostIts && - sFaxName == rData.sFaxName && - bPrintHiddenText == rData.bPrintHiddenText && + nPrintPostIts == rData.nPrintPostIts && + sFaxName == rData.sFaxName && + bPrintHiddenText == rData.bPrintHiddenText && bPrintTextPlaceholder == rData.bPrintTextPlaceholder; } - sal_Bool IsPrintGraphic() const { return bPrintGraphic; } - sal_Bool IsPrintTable() const { return bPrintTable; } - sal_Bool IsPrintDraw() const { return bPrintDraw; } - sal_Bool IsPrintControl() const { return bPrintControl; } - sal_Bool IsPrintLeftPage() const { return bPrintLeftPage; } - sal_Bool IsPrintRightPage() const { return bPrintRightPage; } - sal_Bool IsPrintReverse() const { return bPrintReverse; } - sal_Bool IsPaperFromSetup() const { return bPaperFromSetup; } - sal_Bool IsPrintEmptyPages() const{ return bPrintEmptyPages; } - sal_Bool IsPrintProspect() const { return bPrintProspect; } - sal_Bool IsPrintProspect_RTL() const { return bPrintProspect_RTL; } - sal_Bool IsPrintPageBackground() const { return bPrintPageBackground; } - sal_Bool IsPrintBlackFont() const { return bPrintBlackFont;} - sal_Bool IsPrintSingleJobs() const { return bPrintSingleJobs;} - sal_Int16 GetPrintPostIts() const { return nPrintPostIts; } - const rtl::OUString GetFaxName() const{return sFaxName;} - sal_Bool IsPrintHiddenText() const {return bPrintHiddenText;} - sal_Bool IsPrintTextPlaceholder() const {return bPrintTextPlaceholder;} - - void SetPrintGraphic ( sal_Bool b ) { doSetModified(); bPrintGraphic = b;} - void SetPrintTable ( sal_Bool b ) { doSetModified(); bPrintTable = b;} - void SetPrintDraw ( sal_Bool b ) { doSetModified(); bPrintDraw = b;} - void SetPrintControl ( sal_Bool b ) { doSetModified(); bPrintControl = b; } - void SetPrintLeftPage ( sal_Bool b ) { doSetModified(); bPrintLeftPage = b;} - void SetPrintRightPage( sal_Bool b ) { doSetModified(); bPrintRightPage = b;} - void SetPrintReverse ( sal_Bool b ) { doSetModified(); bPrintReverse = b;} - void SetPaperFromSetup( sal_Bool b ) { doSetModified(); bPaperFromSetup = b;} - void SetPrintEmptyPages(sal_Bool b ) { doSetModified(); bPrintEmptyPages = b;} - void SetPrintPostIts ( sal_Int16 n){ doSetModified(); nPrintPostIts = n; } - void SetPrintProspect ( sal_Bool b ) { doSetModified(); bPrintProspect = b; } - void SetPrintProspect_RTL ( sal_Bool b ) { doSetModified(); bPrintProspect_RTL = b; } - void SetPrintPageBackground(sal_Bool b){ doSetModified(); bPrintPageBackground = b;} - void SetPrintBlackFont(sal_Bool b){ doSetModified(); bPrintBlackFont = b;} - void SetPrintSingleJobs(sal_Bool b){ doSetModified(); bPrintSingleJobs = b;} - void SetFaxName(const rtl::OUString& rSet){sFaxName = rSet;} - void SetPrintHiddenText(sal_Bool b){ doSetModified(); bPrintHiddenText = b;} - void SetPrintTextPlaceholder(sal_Bool b){ doSetModified(); bPrintTextPlaceholder = b;} + + // Note: in the context where this class ist used the pointers should always be valid + // during the lifetime of this object + const SwPrintUIOptions & GetPrintUIOptions() const { return *m_pPrintUIOptions; } + const SwRenderData & GetRenderData() const { return *m_pRenderData; } + void SetPrintUIOptions( const SwPrintUIOptions *pOpt ) { m_pPrintUIOptions = pOpt; } + void SetRenderData( const SwRenderData *pData ) { m_pRenderData = pData; } + + sal_Bool IsPrintGraphic() const { return bPrintGraphic; } + sal_Bool IsPrintTable() const { return bPrintTable; } + sal_Bool IsPrintDraw() const { return bPrintDraw; } + sal_Bool IsPrintControl() const { return bPrintControl; } + sal_Bool IsPrintLeftPage() const { return bPrintLeftPages; } + sal_Bool IsPrintRightPage() const { return bPrintRightPages; } + sal_Bool IsPrintReverse() const { return bPrintReverse; } + sal_Bool IsPaperFromSetup() const { return bPaperFromSetup; } + sal_Bool IsPrintEmptyPages() const { return bPrintEmptyPages; } + sal_Bool IsPrintProspect() const { return bPrintProspect; } + sal_Bool IsPrintProspectRTL() const { return bPrintProspectRTL; } + sal_Bool IsPrintPageBackground() const { return bPrintPageBackground; } + sal_Bool IsPrintBlackFont() const { return bPrintBlackFont; } + sal_Bool IsPrintSingleJobs() const { return bPrintSingleJobs; } + sal_Int16 GetPrintPostIts() const { return nPrintPostIts; } + const rtl::OUString GetFaxName() const { return sFaxName; } + sal_Bool IsPrintHiddenText() const { return bPrintHiddenText; } + sal_Bool IsPrintTextPlaceholder() const { return bPrintTextPlaceholder; } + + void SetPrintGraphic( sal_Bool b ) { doSetModified(); bPrintGraphic = b; } + void SetPrintTable( sal_Bool b ) { doSetModified(); bPrintTable = b; } + void SetPrintDraw( sal_Bool b ) { doSetModified(); bPrintDraw = b; } + void SetPrintControl( sal_Bool b ) { doSetModified(); bPrintControl = b; } + void SetPrintLeftPage( sal_Bool b ) { doSetModified(); bPrintLeftPages = b; } + void SetPrintRightPage( sal_Bool b ) { doSetModified(); bPrintRightPages = b; } + void SetPrintReverse( sal_Bool b ) { doSetModified(); bPrintReverse = b; } + void SetPaperFromSetup( sal_Bool b ) { doSetModified(); bPaperFromSetup = b; } + void SetPrintEmptyPages( sal_Bool b ) { doSetModified(); bPrintEmptyPages = b; } + void SetPrintPostIts( sal_Int16 n ) { doSetModified(); nPrintPostIts = n; } + void SetPrintProspect( sal_Bool b ) { doSetModified(); bPrintProspect = b; } + void SetPrintProspect_RTL( sal_Bool b ) { doSetModified(); bPrintProspectRTL = b; } + void SetPrintPageBackground( sal_Bool b ) { doSetModified(); bPrintPageBackground = b; } + void SetPrintBlackFont( sal_Bool b ) { doSetModified(); bPrintBlackFont = b; } + void SetPrintSingleJobs( sal_Bool b ) { doSetModified(); bPrintSingleJobs = b; } + void SetFaxName( const rtl::OUString& rSet ) { sFaxName = rSet; } + void SetPrintHiddenText( sal_Bool b ) { doSetModified(); bPrintHiddenText = b; } + void SetPrintTextPlaceholder( sal_Bool b ) { doSetModified(); bPrintTextPlaceholder = b; } + virtual void doSetModified () { bModified = sal_True;} }; + +//////////////////////////////////////////////////////////// + + +class SwPrintUIOptions : public vcl::PrinterOptionsHelper +{ + OutputDevice* m_pLast; + const SwPrintData & m_rDefaultPrintData; + +public: + SwPrintUIOptions( bool bWeb, bool bSwSrcView, bool bHasSelection, bool bHasPostIts, const SwPrintData &rDefaultPrintData ); + virtual ~SwPrintUIOptions(); + + bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); + + bool IsPrintFormControls() const { return getBoolValue( "PrintControls", m_rDefaultPrintData.bPrintControl ); } + bool IsPrintPageBackground() const { return getBoolValue( "PrintPageBackground", m_rDefaultPrintData.bPrintPageBackground ); } + bool IsPrintProspect() const { return getBoolValue( "PrintProspect", m_rDefaultPrintData.bPrintProspect ); } + bool IsPrintProspectRTL() const { return getIntValue( "PrintProspectRTL", m_rDefaultPrintData.bPrintProspectRTL ) ? true : false; } + bool IsPrintTextPlaceholders() const { return getBoolValue( "PrintTextPlaceholder", m_rDefaultPrintData.bPrintTextPlaceholder ); } + bool IsPrintHiddenText() const { return getBoolValue( "PrintHiddenText", m_rDefaultPrintData.bPrintHiddenText ); } + bool IsPrintWithBlackTextColor() const { return getBoolValue( "PrintBlackFonts", m_rDefaultPrintData.bPrintBlackFont ); } + sal_Int16 GetPrintPostItsType() const { return static_cast< sal_Int16 >(getIntValue( "PrintAnnotationMode", m_rDefaultPrintData.nPrintPostIts )); } + bool IsPaperFromSetup() const { return getBoolValue( "PrintPaperFromSetup", m_rDefaultPrintData.bPaperFromSetup ); } + bool IsPrintReverse() const { return false; /*handled by print dialog now*/ /*getBoolValue( "PrintReversed", m_rDefaultPrintData.bPrintReverse );*/ } + + bool IsPrintLeftPages() const; + bool IsPrintRightPages() const; + bool IsPrintEmptyPages( bool bIsPDFExport ) const; + bool IsPrintTables() const; + bool IsPrintGraphics() const; + bool IsPrintDrawings() const; +}; + + +//////////////////////////////////////////////////////////// + +// A class that stores temporary data that is needed for rendering the document. +// Usually this data is created when 'getRendererCount' is called and +// and it is used in the 'render' function of that same interface +class SwRenderData +{ + // pages valid for printing (according to the current settings) + // and their respective start frames (see getRendererCount in unotxdoc.cxx) + // This set of pages does NOT depend on the 'PageRange' that is used as a printing option! + std::set< sal_Int32 > m_aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) + std::map< sal_Int32, const SwPageFrm * > m_aValidStartFrames; // the map of start frames for those pages + + // vector of pages and their order to be printed (duplicates and any order allowed!) + // (see 'render' in unotxdoc.cxx) + std::vector< sal_Int32 > m_aPagesToPrint; + + std::vector< const SwPageFrm * > m_aPostItStartFrames; + + // for prospect printing: the pairs of pages to be printed together on a single prospect page. + // -1 indicates a half page to be left empty. + std::vector< std::pair< sal_Int32, sal_Int32 > > m_aPagePairs; + + rtl::OUString m_aPageRange; + + // the view options to be applied for printing + SwViewOptionAdjust_Impl * m_pViewOptionAdjust; + + SwPrtOptions * m_pPrtOptions; + +public: + + // PostIt relevant data + _SetGetExpFlds * m_pPostItFields; // an array of "_SetGetExpFld *" sorted by page and line numbers + SwDoc * m_pPostItDoc; + ViewShell * m_pPostItShell; + +public: + SwRenderData(); + ~SwRenderData(); + + + bool HasPostItData() const { return m_pPostItShell != 0 && m_pPostItDoc != 0 && m_pPostItShell != 0; } + void CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev ); + void DeletePostItData(); + + bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; } + void ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions ); + void ViewOptionAdjust( const SwPrtOptions *pPrtOptions ); + void ViewOptionAdjustStop(); + + bool HasSwPrtOptions() const { return m_pPrtOptions != 0; } + void SetSwPrtOptions( SwPrtOptions * pOpt ) { m_pPrtOptions = pOpt; } + const SwPrtOptions * GetSwPrtOptions() const { return m_pPrtOptions; } + SwPrtOptions & GetSwPrtOptionsRef() { return *m_pPrtOptions; } + void MakeSwPrtOptions( SwPrtOptions &rOptions, const SwDocShell *pDocShell, + const SwPrintUIOptions *pOpt, const SwRenderData *pData, bool bIsPDFExport ); + + + typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; + typedef std::vector< std::pair< sal_Int32, sal_Int32 > > PagePairsVec_t; + + std::set< sal_Int32 > & GetValidPagesSet() { return m_aValidPages; } + const std::set< sal_Int32 > & GetValidPagesSet() const { return m_aValidPages; } + ValidStartFramesMap_t & GetValidStartFrames() { return m_aValidStartFrames; } + const ValidStartFramesMap_t & GetValidStartFrames() const { return m_aValidStartFrames; } + + // used for 'normal' printing + // A page value of 0 as entry indicates that this page is not from the document but + // from the post-it document. (See also GetPostItStartFrame below) + std::vector< sal_Int32 > & GetPagesToPrint() { return m_aPagesToPrint; } + const std::vector< sal_Int32 > & GetPagesToPrint() const { return m_aPagesToPrint; } + + // used for 'normal' printing with post-its + // - if the map entry will be NULL then the respective page to be printed is from + // the document. In that case use the value from GetPagesToPrint at the same index to + // get the phys. page number to be printed, and then retrieve the start frame to use + // from GetValidStartFrms. + // - If the entry is not NULL it is the start frame of the page from the post-it document + // that is to be printed + std::vector< const SwPageFrm * > & GetPostItStartFrames() { return m_aPostItStartFrames; } + const std::vector< const SwPageFrm * > & GetPostItStartFrames() const { return m_aPostItStartFrames; } + + // used for prospect printing only + PagePairsVec_t & GetPagePairsForProspectPrinting() { return m_aPagePairs; } + const PagePairsVec_t & GetPagePairsForProspectPrinting() const { return m_aPagePairs; } + + rtl::OUString GetPageRange() const { return m_aPageRange; } + void SetPageRange( const rtl::OUString &rRange ) { m_aPageRange = rRange; } +}; + + +//////////////////////////////////////////////////////////// + #endif //_SW_PRINTDATA_HXX diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index 0e3c4670c4..9840c23f66 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -34,12 +34,12 @@ #include <tools/string.hxx> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <pam.hxx> #include <IDocumentRedlineAccess.hxx> -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> class SfxItemSet; class SwView; diff --git a/sw/inc/rolbck.hxx b/sw/inc/rolbck.hxx index f910a44ca8..c8f8561138 100644 --- a/sw/inc/rolbck.hxx +++ b/sw/inc/rolbck.hxx @@ -34,9 +34,9 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS #define _SVSTDARR_USHORTSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> //Nur die History anziehen, um das docnew.cxx gegen die CLOOK's zu behaupten. @@ -78,8 +78,7 @@ class SwCharFmt; #include <memory> - -#ifndef PRODUCT +#ifdef DBG_UTIL class Writer; #define OUT_HSTR_HINT( name ) \ friend Writer& OutUndo_Hstr_ ## name( Writer&, const SwHistoryHint& ); @@ -164,8 +163,11 @@ public: class SwHistorySetTxtFld : public SwHistoryHint { + //!! beware of the order for the declation of thje auto_ptrs. + //!! If they get destroyed in the wrong order sw may crash (namely mail-merge as well) ::std::auto_ptr<SwFieldType> m_pFldType; const ::std::auto_ptr<SwFmtFld> m_pFld; + ULONG m_nNodeIndex; xub_StrLen m_nPos; USHORT m_nFldWhich; diff --git a/sw/inc/rubylist.hxx b/sw/inc/rubylist.hxx index db60d35a6b..cbd023286e 100644 --- a/sw/inc/rubylist.hxx +++ b/sw/inc/rubylist.hxx @@ -30,7 +30,7 @@ #ifndef _RUBYLIST_HXX #define _RUBYLIST_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <swtypes.hxx> #include <fmtruby.hxx> diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index 47633d4208..9c290e55b1 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -38,7 +38,7 @@ #ifndef _TOOLS_REF_HXX #include <tools/ref.hxx> #endif -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <frmfmt.hxx> diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index d1ffa05e95..375036631a 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -538,7 +538,7 @@ public: inline SvStream& OutULong( ULONG nVal ) { return OutULong( Strm(), nVal ); } void SetStrm( SvStream& rStrm ) { pStrm = &rStrm; } -#ifdef PRODUCT +#ifndef DBG_UTIL SvStream& Strm() { return *pStrm; } #else SvStream& Strm(); @@ -637,6 +637,8 @@ public: typedef Reader* (*FnGetReader)(); typedef void (*FnGetWriter)(const String&, const String& rBaseURL, WriterRef&); +ULONG SaveOrDelMSVBAStorage( SfxObjectShell&, SotStorage&, BOOL, const String& ); +ULONG GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS ); struct SwReaderWriterEntry { diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx index 78b5f7ff61..4080e32418 100644 --- a/sw/inc/shellres.hxx +++ b/sw/inc/shellres.hxx @@ -39,7 +39,7 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif struct SW_DLLPUBLIC ShellResource : public Resource @@ -72,6 +72,8 @@ struct SW_DLLPUBLIC ShellResource : public Resource String aStrNone; // fuer Felder, die Fixiert sind String aFixedStr; + // custom fields of type css::util::Duration + String sDurationFormat; //names of TOXs String aTOXIndexName; diff --git a/sw/inc/sortopt.hxx b/sw/inc/sortopt.hxx index 15c6ec56a0..245f8ea94a 100644 --- a/sw/inc/sortopt.hxx +++ b/sw/inc/sortopt.hxx @@ -31,7 +31,7 @@ #define _SORTOPT_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <tools/string.hxx> #include "swdllapi.h" diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx index ef9ce118a2..35f18717db 100644 --- a/sw/inc/swatrset.hxx +++ b/sw/inc/swatrset.hxx @@ -31,8 +31,8 @@ #define _SWATRSET_HXX #include <tools/solar.h> #include <tools/mempool.hxx> -#include <svtools/itemset.hxx> -#include <svtools/itempool.hxx> +#include <svl/itemset.hxx> +#include <svl/itempool.hxx> #include <swdllapi.h> class SwModify; diff --git a/sw/inc/swfltopt.hxx b/sw/inc/swfltopt.hxx index 9413e9e0ec..be51b02bc8 100644 --- a/sw/inc/swfltopt.hxx +++ b/sw/inc/swfltopt.hxx @@ -40,6 +40,8 @@ public: void GetValues( sal_uInt16 nCnt, const sal_Char** ppNames, sal_uInt32* pValues ); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); }; #endif diff --git a/sw/inc/swhints.hxx b/sw/inc/swhints.hxx index 6ae503bf7d..1b7fd9b27a 100644 --- a/sw/inc/swhints.hxx +++ b/sw/inc/swhints.hxx @@ -30,7 +30,7 @@ #ifndef SW_HINTS_HXX #define SW_HINTS_HXX -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> #define SW_BROADCASTID_START SFX_HINT_USER00 #define SW_BROADCAST_DRAWVIEWS_CREATED SW_BROADCASTID_START diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index f22dc9f569..d8de7b5c50 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,11 +32,12 @@ #include <tools/link.hxx> #include <tools/string.hxx> #include <vcl/fldunit.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> +#include <unotools/options.hxx> #include <sfx2/module.hxx> #include <tools/shl.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include "swdllapi.h" #include "shellid.hxx" #include <fldupde.hxx> @@ -77,7 +78,7 @@ namespace com{ namespace sun{ namespace star{ namespace scanner{ class XScannerManager; }}}} -class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener +class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::ConfigurationListener { String sActAuthor; @@ -126,6 +127,8 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener // Hint abfangen fuer DocInfo virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ); + protected: // Briefumschlaege, Etiketten void InsertEnv(SfxRequest&); @@ -165,8 +168,8 @@ public: void ApplyRulerMetric( FieldUnit eMetric, BOOL bHorizontal, BOOL bWeb ); void ApplyFldUpdateFlags(SwFldUpdateFlags eFldFlags); void ApplyLinkMode(sal_Int32 nNewLinkMode); - - //default page mode for text grid + + //default page mode for text grid void ApplyDefaultPageMode(sal_Bool bIsSquaredPageMode); // ConfigItems erzeugen diff --git a/sw/inc/swprtopt.hxx b/sw/inc/swprtopt.hxx index 0511fcbfba..b45856591d 100644 --- a/sw/inc/swprtopt.hxx +++ b/sw/inc/swprtopt.hxx @@ -34,11 +34,24 @@ #include <tools/multisel.hxx> #include <printdata.hxx> +#include <set> +#include <map> +#include <vector> +#include <utility> + #define POSTITS_NONE 0 #define POSTITS_ONLY 1 #define POSTITS_ENDDOC 2 #define POSTITS_ENDPAGE 3 + +class PrintDialog; +class SfxPrinter; + + +//////////////////////////////////////////////////////////// + + class SwPrtOptions : public SwPrintData { USHORT nJobNo; @@ -75,27 +88,18 @@ public: #endif - SwPrtOptions& operator=(const SwPrintData& rData) - { - SwPrintData::operator=(rData); - return *this; - } -}; - - -#endif //_SWPRTOPT_HXX - - - - - - - - - - + SwPrtOptions& operator=(const SwPrintData& rData) + { + SwPrintData::operator=(rData); + return *this; + } + // get print options + void MakeOptions( BOOL bWeb ); +}; +//////////////////////////////////////////////////////////// +#endif //_SWPRTOPT_HXX diff --git a/sw/inc/swregion.hxx b/sw/inc/swregion.hxx index 2ae70060ae..1dd2c5aa70 100644 --- a/sw/inc/swregion.hxx +++ b/sw/inc/swregion.hxx @@ -30,7 +30,7 @@ #ifndef _SWREGION_HXX #define _SWREGION_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include "swrect.hxx" diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index a49bcf6f61..e506bbe0fe 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,12 +33,12 @@ #ifndef _TOOLS_REF_HXX #include <tools/ref.hxx> #endif -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <tblenum.hxx> #include <swtypes.hxx> #include <calbck.hxx> #include <swrect.hxx> -#ifdef PRODUCT +#ifndef DBG_UTIL #include <node.hxx> // fuer StartNode->GetMyIndex #else class SwStartNode; @@ -111,7 +111,7 @@ protected: BOOL bModifyLocked :1; BOOL bNewModel :1; // FALSE: old SubTableModel; TRUE: new RowSpanModel -#ifndef PRODUCT +#ifdef DBG_UTIL bool bDontChangeModel; // This is set by functions (like Merge()) to forbid a laet model change #endif @@ -210,7 +210,7 @@ public: BOOL Merge( SwDoc* pDoc, const SwSelBoxes& rBoxes, const SwSelBoxes& rMerged, SwTableBox* pMergeBox, SwUndoTblMerge* pUndo = 0 ) { -#ifndef PRODUCT +#ifdef DBG_UTIL bDontChangeModel = true; #endif return bNewModel ? NewMerge( pDoc, rBoxes, rMerged, pMergeBox, pUndo ) : @@ -219,7 +219,7 @@ public: BOOL SplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt=1, BOOL bSameHeight = FALSE ) { -#ifndef PRODUCT +#ifdef DBG_UTIL bDontChangeModel = true; #endif return bNewModel ? NewSplitRow( pDoc, rBoxes, nCnt, bSameHeight ) : @@ -323,7 +323,7 @@ public: SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo ); BOOL SetRowHeight( SwTableBox& rAktBox, USHORT eType, SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo ); -#ifndef PRODUCT +#ifdef DBG_UTIL void CheckConsistency() const; #endif }; @@ -412,7 +412,7 @@ public: const SwStartNode *GetSttNd() const { return pSttNd; } ULONG GetSttIdx() const -#ifdef PRODUCT +#ifndef DBG_UTIL { return pSttNd ? pSttNd->GetIndex() : 0; } #else ; diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx index 51eea3343d..6e98953205 100644 --- a/sw/inc/swundo.hxx +++ b/sw/inc/swundo.hxx @@ -30,7 +30,7 @@ #ifndef _SWUNDO_HXX #define _SWUNDO_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> // die Ids fuer StdAktionen enum SwUndoId diff --git a/sw/inc/tabcol.hxx b/sw/inc/tabcol.hxx index 97a1215aa5..55f474e810 100644 --- a/sw/inc/tabcol.hxx +++ b/sw/inc/tabcol.hxx @@ -33,7 +33,7 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_LONGS #define _SVSTDARR_BOOLS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #ifndef INCLUDED_VECTOR diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx index 100ca2d9da..ececf6e0c4 100644 --- a/sw/inc/tblafmt.hxx +++ b/sw/inc/tblafmt.hxx @@ -47,7 +47,7 @@ JP 20.07.95: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! **************************************************************************/ -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include "hintids.hxx" //_immmer_ vor den solar-items! #include <svx/algitem.hxx> #include <svx/fontitem.hxx> @@ -65,7 +65,7 @@ JP 20.07.95: #include <svx/brshitem.hxx> #include <svx/adjitem.hxx> #include <svx/rotmodit.hxx> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <svx/bolnitem.hxx> #include "swdllapi.h" diff --git a/sw/inc/tblsel.hxx b/sw/inc/tblsel.hxx index 5b1b4161cf..71b32a77a9 100644 --- a/sw/inc/tblsel.hxx +++ b/sw/inc/tblsel.hxx @@ -30,7 +30,7 @@ #ifndef _TBLSEL_HXX #define _TBLSEL_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <swtable.hxx> #include <swrect.hxx> #include "swdllapi.h" diff --git a/sw/inc/tgrditem.hxx b/sw/inc/tgrditem.hxx index e18dc78d3a..b5995249cf 100644 --- a/sw/inc/tgrditem.hxx +++ b/sw/inc/tgrditem.hxx @@ -31,7 +31,7 @@ #define SW_TGRDITEM_HXX #include <tools/color.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include "swdllapi.h" #include <hintids.hxx> #include <format.hxx> diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index 07810f6b63..88ab5c3010 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -36,8 +36,8 @@ #include <tools/string.hxx> #include <svx/svxenum.hxx> -#include <svtools/svarray.hxx> -#include <svtools/poolitem.hxx> +#include <svl/svarray.hxx> +#include <svl/poolitem.hxx> #include "swdllapi.h" #include <swtypes.hxx> #include <toxe.hxx> diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx index 706e481763..01014b424b 100644 --- a/sw/inc/txatbase.hxx +++ b/sw/inc/txatbase.hxx @@ -31,7 +31,7 @@ #define _TXATBASE_HXX #include <tools/solar.h> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <hintids.hxx> #include <errhdl.hxx> diff --git a/sw/inc/txatritr.hxx b/sw/inc/txatritr.hxx index 9717a1325f..1c78f134c6 100644 --- a/sw/inc/txatritr.hxx +++ b/sw/inc/txatritr.hxx @@ -32,7 +32,7 @@ #include <tools/solar.h> #include <sal/types.h> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <svx/langitem.hxx> #include <hintids.hxx> diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 9a86b86475..9c5f337460 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -36,9 +36,9 @@ #define _SVSTDARR_BOOLS #define _SVSTDARR_BYTES #define _SVSTDARR_USHORTSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <com/sun/star/uno/Sequence.h> #include <numrule.hxx> #include <itabenum.hxx> @@ -115,7 +115,7 @@ namespace utl { class TransliterationWrapper; } -#ifndef PRODUCT +#ifdef DBG_UTIL class Writer; class SwUndo; #define OUT_UNDOBJ( name ) \ diff --git a/sw/inc/unoatxt.hxx b/sw/inc/unoatxt.hxx index 281abb76db..d9194cebd5 100644 --- a/sw/inc/unoatxt.hxx +++ b/sw/inc/unoatxt.hxx @@ -41,8 +41,8 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> -#include <svtools/itemprop.hxx> -#include <svtools/lstner.hxx> +#include <svl/itemprop.hxx> +#include <svl/lstner.hxx> #include <cppuhelper/implbase3.hxx> // helper for implementations #include <cppuhelper/implbase4.hxx> // helper for implementations #include <cppuhelper/implbase5.hxx> // helper for implementations diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx index 682f034da5..3112d11a81 100644 --- a/sw/inc/unodraw.hxx +++ b/sw/inc/unodraw.hxx @@ -48,7 +48,7 @@ #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/drawing/HomogenMatrix3.hpp> // <-- -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> class SdrMarkList; class SdrView; diff --git a/sw/inc/unoevent.hxx b/sw/inc/unoevent.hxx index 8f63bf4c30..912197d6ac 100644 --- a/sw/inc/unoevent.hxx +++ b/sw/inc/unoevent.hxx @@ -31,7 +31,7 @@ #define _UNOEVENT_HXX #include <svtools/unoevent.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> class SvxMacroItem; diff --git a/sw/inc/unoevtlstnr.hxx b/sw/inc/unoevtlstnr.hxx index f9804061aa..c19197e13a 100644 --- a/sw/inc/unoevtlstnr.hxx +++ b/sw/inc/unoevtlstnr.hxx @@ -30,7 +30,7 @@ #ifndef _UNOEVTLSTNR_HXX #define _UNOEVTLSTNR_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <com/sun/star/uno/Reference.h> namespace com{namespace sun{namespace star{ diff --git a/sw/inc/unomailmerge.hxx b/sw/inc/unomailmerge.hxx index a9710a2e32..67f6429e95 100644 --- a/sw/inc/unomailmerge.hxx +++ b/sw/inc/unomailmerge.hxx @@ -43,7 +43,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/beans/PropertyChangeEvent.hpp> #include <com/sun/star/text/XMailMergeBroadcaster.hpp> -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> #include <sfx2/objsh.hxx> // SfxObjectShellRef #include <functional> diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx index d9be0a6876..2ca6e80b6d 100644 --- a/sw/inc/unomap.hxx +++ b/sw/inc/unomap.hxx @@ -30,7 +30,7 @@ #ifndef _UNOMAP_HXX #define _UNOMAP_HXX -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> #define PROPERTY_NONE 0 diff --git a/sw/inc/unomod.hxx b/sw/inc/unomod.hxx index b68859e06c..088bb1b1b4 100644 --- a/sw/inc/unomod.hxx +++ b/sw/inc/unomod.hxx @@ -45,7 +45,7 @@ class SwView; class SwViewOption; -struct SwPrintData; +class SwPrintData; class SwDoc; /****************************************************************************** diff --git a/sw/inc/unoport.hxx b/sw/inc/unoport.hxx index b395d1c107..70accec12f 100644 --- a/sw/inc/unoport.hxx +++ b/sw/inc/unoport.hxx @@ -48,7 +48,7 @@ #include <com/sun/star/lang/XUnoTunnel.hpp> #include <cppuhelper/implbase8.hxx> #include <cppuhelper/implbase3.hxx> -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> #include <memory> #include <deque> diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx index f0b9c6c1c2..423d9639e2 100644 --- a/sw/inc/unosett.hxx +++ b/sw/inc/unosett.hxx @@ -44,7 +44,7 @@ #include <cppuhelper/implbase4.hxx> #include <cppuhelper/implbase5.hxx> #include <tools/string.hxx> -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> class SwDoc; class SwFmtCol; diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx index dc0fdc382d..f2f48add60 100644 --- a/sw/inc/unostyle.hxx +++ b/sw/inc/unostyle.hxx @@ -31,8 +31,8 @@ #define _UNOSTYLE_HXX #include <boost/shared_ptr.hpp> -#include <svtools/style.hxx> -#include <svtools/lstner.hxx> +#include <svl/style.hxx> +#include <svl/lstner.hxx> #include <unocoll.hxx> #include <unomap.hxx> #include <com/sun/star/style/XStyle.hpp> diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 1af8e747c0..e12eb89cfa 100644..100755 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -29,9 +29,11 @@ ************************************************************************/ #ifndef _UNOTXDOC_HXX #define _UNOTXDOC_HXX + #include "swdllapi.h" -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <sfx2/sfxbasemodel.hxx> + #include <com/sun/star/beans/PropertyValues.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/style/XAutoStylesSupplier.hpp> @@ -61,6 +63,7 @@ #include <com/sun/star/util/XLinkUpdate.hpp> #include <com/sun/star/view/XRenderable.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/frame/XController.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/i18n/XForbiddenCharacters.hpp> @@ -70,7 +73,7 @@ #include <com/sun/star/text/XFlatParagraphIteratorProvider.hpp> #include <com/sun/star/document/XDocumentLanguages.hpp> #include <com/sun/star/util/XCloneable.hpp> -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> #include <svx/fmdmod.hxx> #include <svx/UnoForbiddenCharsTable.hxx> #include <cppuhelper/weak.hxx> @@ -78,6 +81,8 @@ #include <cppuhelper/implbase4.hxx> // helper for implementations #include <RefreshListenerContainer.hxx> +#include <viewopt.hxx> + #define __IFC32 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13, Ifc14, Ifc15, Ifc16, \ Ifc17, Ifc18, Ifc19, Ifc20, Ifc21, Ifc22, Ifc23, Ifc24, Ifc25, Ifc26, Ifc27, Ifc28, Ifc29, Ifc30, Ifc31, Ifc32 @@ -114,6 +119,8 @@ public Ifc31, public Ifc32 __DEF_IMPLHELPER_EX( 32 ) +namespace css = ::com::sun::star; + class SwDoc; class SwDocShell; class UnoActionContext; @@ -122,10 +129,17 @@ class SwXDrawPage; class SwUnoCrsr; class SwXDocumentPropertyHelper; class SfxViewFrame; +class SwPrintUIOptions; +class SwPrintData; +class SwRenderData; +class SwPrtOptions; +class SwWrtShell; + typedef UnoActionContext* UnoActionContextPtr; SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4) + /****************************************************************************** * ******************************************************************************/ @@ -133,38 +147,38 @@ SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4) typedef cppu::WeakImplHelper32 < - ::com::sun::star::text::XTextDocument, - ::com::sun::star::text::XLineNumberingProperties, - ::com::sun::star::text::XChapterNumberingSupplier, - ::com::sun::star::text::XNumberingRulesSupplier, - ::com::sun::star::text::XFootnotesSupplier, - ::com::sun::star::text::XEndnotesSupplier, - ::com::sun::star::util::XReplaceable, - ::com::sun::star::text::XPagePrintable, - ::com::sun::star::text::XReferenceMarksSupplier, - ::com::sun::star::text::XTextTablesSupplier, - ::com::sun::star::text::XTextFramesSupplier, - ::com::sun::star::text::XBookmarksSupplier, - ::com::sun::star::text::XTextSectionsSupplier, - ::com::sun::star::text::XTextGraphicObjectsSupplier, - ::com::sun::star::text::XTextEmbeddedObjectsSupplier, - ::com::sun::star::text::XTextFieldsSupplier, - ::com::sun::star::style::XStyleFamiliesSupplier, - ::com::sun::star::style::XAutoStylesSupplier, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::drawing::XDrawPageSupplier, - ::com::sun::star::text::XDocumentIndexesSupplier, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::beans::XPropertyState, - ::com::sun::star::document::XLinkTargetSupplier, - ::com::sun::star::document::XRedlinesSupplier, - ::com::sun::star::util::XRefreshable, - ::com::sun::star::util::XLinkUpdate, - ::com::sun::star::view::XRenderable, - ::com::sun::star::xforms::XFormsSupplier, - ::com::sun::star::text::XFlatParagraphIteratorProvider, - ::com::sun::star::document::XDocumentLanguages, - ::com::sun::star::util::XCloneable + css::text::XTextDocument, + css::text::XLineNumberingProperties, + css::text::XChapterNumberingSupplier, + css::text::XNumberingRulesSupplier, + css::text::XFootnotesSupplier, + css::text::XEndnotesSupplier, + css::util::XReplaceable, + css::text::XPagePrintable, + css::text::XReferenceMarksSupplier, + css::text::XTextTablesSupplier, + css::text::XTextFramesSupplier, + css::text::XBookmarksSupplier, + css::text::XTextSectionsSupplier, + css::text::XTextGraphicObjectsSupplier, + css::text::XTextEmbeddedObjectsSupplier, + css::text::XTextFieldsSupplier, + css::style::XStyleFamiliesSupplier, + css::style::XAutoStylesSupplier, + css::lang::XServiceInfo, + css::drawing::XDrawPageSupplier, + css::text::XDocumentIndexesSupplier, + css::beans::XPropertySet, + css::beans::XPropertyState, + css::document::XLinkTargetSupplier, + css::document::XRedlinesSupplier, + css::util::XRefreshable, + css::util::XLinkUpdate, + css::view::XRenderable, + css::xforms::XFormsSupplier, + css::text::XFlatParagraphIteratorProvider, + css::document::XDocumentLanguages, + css::util::XCloneable > SwXTextDocumentBaseClass; @@ -181,47 +195,51 @@ class SW_DLLPUBLIC SwXTextDocument : public SwXTextDocumentBaseClass, sal_Bool bObjectValid; SwXDrawPage* pDrawPage; - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > * pxXDrawPage; + css::uno::Reference< css::drawing::XDrawPage > * pxXDrawPage; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xBodyText; + css::uno::Reference< css::text::XText > xBodyText; SwXBodyText* pBodyText; - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > xNumFmtAgg; - - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXNumberingRules; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXFootnotes; - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxXFootnoteSettings; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXEndnotes; - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxXEndnoteSettings; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXReferenceMarks; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > * pxXTextFieldTypes; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextFieldMasters; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextSections; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXBookmarks; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextTables; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextFrames; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXGraphicObjects; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXEmbeddedObjects; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXStyleFamilies; - mutable ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyles > * pxXAutoStyles; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > * pxXChapterNumbering; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXDocumentIndexes; - - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxXLineNumberingProperties; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxLinkTargetSupplier; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess >* pxXRedlines; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer> xXFormsContainer; + css::uno::Reference< css::uno::XAggregation > xNumFmtAgg; + + css::uno::Reference< css::container::XIndexAccess > * pxXNumberingRules; + css::uno::Reference< css::container::XIndexAccess > * pxXFootnotes; + css::uno::Reference< css::beans::XPropertySet > * pxXFootnoteSettings; + css::uno::Reference< css::container::XIndexAccess > * pxXEndnotes; + css::uno::Reference< css::beans::XPropertySet > * pxXEndnoteSettings; + css::uno::Reference< css::container::XNameAccess > * pxXReferenceMarks; + css::uno::Reference< css::container::XEnumerationAccess > * pxXTextFieldTypes; + css::uno::Reference< css::container::XNameAccess > * pxXTextFieldMasters; + css::uno::Reference< css::container::XNameAccess > * pxXTextSections; + css::uno::Reference< css::container::XNameAccess > * pxXBookmarks; + css::uno::Reference< css::container::XNameAccess > * pxXTextTables; + css::uno::Reference< css::container::XNameAccess > * pxXTextFrames; + css::uno::Reference< css::container::XNameAccess > * pxXGraphicObjects; + css::uno::Reference< css::container::XNameAccess > * pxXEmbeddedObjects; + css::uno::Reference< css::container::XNameAccess > * pxXStyleFamilies; + mutable css::uno::Reference< css::style::XAutoStyles > * pxXAutoStyles; + css::uno::Reference< css::container::XIndexReplace > * pxXChapterNumbering; + css::uno::Reference< css::container::XIndexAccess > * pxXDocumentIndexes; + + css::uno::Reference< css::beans::XPropertySet > * pxXLineNumberingProperties; + css::uno::Reference< css::container::XNameAccess > * pxLinkTargetSupplier; + css::uno::Reference< css::container::XEnumerationAccess >* pxXRedlines; + css::uno::Reference< css::container::XNameContainer> xXFormsContainer; //temporary frame to enable PDF export if no valid view is available - SfxViewFrame* m_pHiddenViewFrame; - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xPropertyHelper; - SwXDocumentPropertyHelper* pPropertyHelper; + SfxViewFrame* m_pHiddenViewFrame; + css::uno::Reference< css::uno::XInterface> xPropertyHelper; + SwXDocumentPropertyHelper* pPropertyHelper; + + SwPrintUIOptions * m_pPrintUIOptions; + SwRenderData * m_pRenderData; void GetBodyText(); void GetNumberFormatter(); // used for XRenderable implementation - SfxViewShell * GuessViewShell(); - SwDoc * GetRenderDoc( SfxViewShell *&rpView, const ::com::sun::star::uno::Any& rSelection ); + SfxViewShell * GuessViewShell( /* out */ bool &rbIsSwSrcView, const css::uno::Reference< css::frame::XController > xController = css::uno::Reference< css::frame::XController >() ); + SwDoc * GetRenderDoc( SfxViewShell *&rpView, const css::uno::Any& rSelection, bool bIsPDFExport ); + SfxViewShell * GetRenderView( bool &rbIsSwSrcView, const css::uno::Sequence< css::beans::PropertyValue >& rxOptions, bool bIsPDFExport ); rtl::OUString maBuildId; @@ -234,173 +252,173 @@ public: SwXTextDocument(SwDocShell* pShell); inline void notifyRefreshListeners() { aRefreshCont.Refreshed(); } - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw(css::uno::RuntimeException); virtual void SAL_CALL acquire( ) throw(); virtual void SAL_CALL release( ) throw(); //XWeak - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAdapter > SAL_CALL queryAdapter( ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter( ) throw(css::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException); - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) throw(css::uno::RuntimeException); //XTextDocument - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL reformat(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::text::XText > SAL_CALL getText(void) throw( css::uno::RuntimeException ); + virtual void SAL_CALL reformat(void) throw( css::uno::RuntimeException ); //XModel - virtual sal_Bool SAL_CALL attachResource( const ::rtl::OUString& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs ) throw(::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getArgs( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL connectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL disconnectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL lockControllers( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL unlockControllers( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasControllersLocked( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > SAL_CALL getCurrentController( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setCurrentController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getCurrentSelection( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL attachResource( const ::rtl::OUString& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) throw(css::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getURL( ) throw(css::uno::RuntimeException); + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::uno::RuntimeException); + virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::uno::RuntimeException); + virtual void SAL_CALL lockControllers( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL unlockControllers( ) throw(css::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasControllersLocked( ) throw(css::uno::RuntimeException); + virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::container::NoSuchElementException, css::uno::RuntimeException); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection( ) throw(css::uno::RuntimeException); //XComponent - virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL dispose(void) throw( css::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) throw( css::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) throw( css::uno::RuntimeException ); //XCloseable - virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw (::com::sun::star::util::CloseVetoException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw (css::util::CloseVetoException, css::uno::RuntimeException); //XLineNumberingProperties - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getLineNumberingProperties(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getLineNumberingProperties(void) throw( css::uno::RuntimeException ); //XChapterNumberingSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > SAL_CALL getChapterNumberingRules(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XIndexReplace > SAL_CALL getChapterNumberingRules(void) throw( css::uno::RuntimeException ); //XNumberingRulesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getNumberingRules() throw (::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getNumberingRules() throw (css::uno::RuntimeException); //XFootnotesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getFootnotes(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getFootnoteSettings(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getFootnotes(void) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getFootnoteSettings(void) throw( css::uno::RuntimeException ); //XEndnotesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getEndnotes(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getEndnoteSettings(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getEndnotes(void) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getEndnoteSettings(void) throw( css::uno::RuntimeException ); //XReplaceable - virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XReplaceDescriptor > SAL_CALL createReplaceDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_Int32 SAL_CALL replaceAll(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::util::XReplaceDescriptor > SAL_CALL createReplaceDescriptor(void) throw( css::uno::RuntimeException ); + virtual sal_Int32 SAL_CALL replaceAll(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException ); //XSearchable - virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > SAL_CALL createSearchDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL findAll(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL findFirst(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL findNext(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xStartAt, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::util::XSearchDescriptor > SAL_CALL createSearchDescriptor(void) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL findAll(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL findFirst(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL findNext(const css::uno::Reference< css::uno::XInterface > & xStartAt, const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException ); //XPagePrintable - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getPagePrintSettings(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setPagePrintSettings(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aSettings) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL printPages(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPagePrintSettings(void) throw( css::uno::RuntimeException ); + virtual void SAL_CALL setPagePrintSettings(const css::uno::Sequence< css::beans::PropertyValue >& aSettings) throw( css::uno::RuntimeException ); + virtual void SAL_CALL printPages(const css::uno::Sequence< css::beans::PropertyValue >& xOptions) throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ); //XReferenceMarksSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getReferenceMarks(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getReferenceMarks(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextFieldsSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL getTextFields(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextFieldMasters(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextFieldsSupplier + virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getTextFields(void) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextFieldMasters(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextEmbeddedObjectsSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getEmbeddedObjects(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextEmbeddedObjectsSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getEmbeddedObjects(void) throw( css::uno::RuntimeException ); -// // ::com::sun::star::text::XTextShapesSupplier -// virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > getShapes(void) throw( ::com::sun::star::uno::RuntimeException ); +// // css::text::XTextShapesSupplier +// virtual css::uno::Reference< css::container::XIndexAccess > getShapes(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XBookmarksSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getBookmarks(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XBookmarksSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getBookmarks(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextSectionsSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextSections(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextSectionsSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextSections(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextTablesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextTables(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextTablesSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextTables(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextGraphicObjectsSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getGraphicObjects(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextGraphicObjectsSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getGraphicObjects(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextFramesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextFrames(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextFramesSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextFrames(void) throw( css::uno::RuntimeException ); //XStyleFamiliesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getStyleFamilies(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getStyleFamilies(void) throw( css::uno::RuntimeException ); //XAutoStylesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyles > SAL_CALL getAutoStyles( ) throw (::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::style::XAutoStyles > SAL_CALL getAutoStyles( ) throw (css::uno::RuntimeException); //XMultiServiceFactory - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance(const rtl::OUString& ServiceSpecifier) - throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments(const rtl::OUString& ServiceSpecifier, - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) - throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void) - throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const rtl::OUString& ServiceSpecifier) + throw( css::uno::Exception, css::uno::RuntimeException ); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const rtl::OUString& ServiceSpecifier, + const css::uno::Sequence< css::uno::Any >& Arguments) + throw( css::uno::Exception, css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void) + throw( css::uno::RuntimeException ); //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::drawing::XDrawPageSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL getDrawPage(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::drawing::XDrawPageSupplier + virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getDrawPage(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XDocumentIndexesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getDocumentIndexes(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XDocumentIndexesSupplier + virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getDocumentIndexes(void) throw( css::uno::RuntimeException ); //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); //XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual css::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException); + virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< ::rtl::OUString >& rPropertyNames ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); //XLinkTargetSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getLinks(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLinks(void) throw( css::uno::RuntimeException ); //XRedlinesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL getRedlines( ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getRedlines( ) throw(css::uno::RuntimeException); - // ::com::sun::star::util::XRefreshable - virtual void SAL_CALL refresh(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addRefreshListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener > & l) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeRefreshListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener > & l) throw( ::com::sun::star::uno::RuntimeException ); + // css::util::XRefreshable + virtual void SAL_CALL refresh(void) throw( css::uno::RuntimeException ); + virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > & l) throw( css::uno::RuntimeException ); + virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > & l) throw( css::uno::RuntimeException ); - // ::com::sun::star::util::XLinkUpdate, - virtual void SAL_CALL updateLinks( ) throw(::com::sun::star::uno::RuntimeException); + // css::util::XLinkUpdate, + virtual void SAL_CALL updateLinks( ) throw(css::uno::RuntimeException); - // ::com::sun::star::view::XRenderable - virtual sal_Int32 SAL_CALL getRendererCount( const ::com::sun::star::uno::Any& aSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRenderer( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL render( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + // css::view::XRenderable + virtual sal_Int32 SAL_CALL getRendererCount( const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getRenderer( sal_Int32 nRenderer, const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); + virtual void SAL_CALL render( sal_Int32 nRenderer, const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); - // ::com::sun::star::xforms::XFormsSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > SAL_CALL getXForms( ) throw (::com::sun::star::uno::RuntimeException); + // css::xforms::XFormsSupplier + virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getXForms( ) throw (css::uno::RuntimeException); - // ::com::sun::star::document::XDocumentLanguages - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getDocumentLanguages( ::sal_Int16 nScriptTypes, ::sal_Int16 nCount ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + // css::document::XDocumentLanguages + virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getDocumentLanguages( ::sal_Int16 nScriptTypes, ::sal_Int16 nCount ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); - // ::com::sun::star::text::XFlatParagraphIteratorProvider: - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XFlatParagraphIterator > SAL_CALL getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic ) throw (::com::sun::star::uno::RuntimeException); + // css::text::XFlatParagraphIteratorProvider: + virtual css::uno::Reference< css::text::XFlatParagraphIterator > SAL_CALL getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic ) throw (css::uno::RuntimeException); // ::com::sun::star::util::XCloneable virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException); @@ -414,15 +432,16 @@ public: void InitNewDoc(); - SwUnoCrsr* CreateCursorForSearch(::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > & xCrsr); - SwUnoCrsr* FindAny(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc, - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > & xCrsr, sal_Bool bAll, + SwUnoCrsr* CreateCursorForSearch(css::uno::Reference< css::text::XTextCursor > & xCrsr); + SwUnoCrsr* FindAny(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc, + css::uno::Reference< css::text::XTextCursor > & xCrsr, sal_Bool bAll, sal_Int32& nResult, - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xLastResult); + css::uno::Reference< css::uno::XInterface > xLastResult); SwXDrawPage* GetDrawPage(); SwDocShell* GetDocShell() {return pDocShell;} + void * SAL_CALL operator new( size_t ) throw(); void SAL_CALL operator delete( void * ) throw(); @@ -432,8 +451,8 @@ public: --------------------------------------------------*/ class SwXLinkTargetSupplier : public cppu::WeakImplHelper2 < - ::com::sun::star::container::XNameAccess, - ::com::sun::star::lang::XServiceInfo + css::container::XNameAccess, + css::lang::XServiceInfo > { SwXTextDocument* pxDoc; @@ -450,18 +469,18 @@ public: ~SwXLinkTargetSupplier(); //XNameAccess - virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( css::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( css::uno::RuntimeException ); //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Type SAL_CALL getElementType( ) throw(css::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(css::uno::RuntimeException); //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException ); // void Invalidate() {pxDoc = 0;} @@ -471,52 +490,52 @@ public: --------------------------------------------------*/ class SwXLinkNameAccessWrapper : public cppu::WeakImplHelper4 < - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::container::XNameAccess, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::document::XLinkTargetSupplier + css::beans::XPropertySet, + css::container::XNameAccess, + css::lang::XServiceInfo, + css::document::XLinkTargetSupplier > { - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xRealAccess; + css::uno::Reference< css::container::XNameAccess > xRealAccess; const SfxItemPropertySet* pPropSet; const String sLinkSuffix; const String sLinkDisplayName; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument > xDoc; + css::uno::Reference< css::text::XTextDocument > xDoc; SwXTextDocument* pxDoc; public: - SwXLinkNameAccessWrapper(::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xAccess, + SwXLinkNameAccessWrapper(css::uno::Reference< css::container::XNameAccess > xAccess, const String& rLinkDisplayName, String sSuffix); SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc, const String& rLinkDisplayName, String sSuffix); ~SwXLinkNameAccessWrapper(); //XNameAccess - virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( css::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( css::uno::RuntimeException ); //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Type SAL_CALL getElementType( ) throw(css::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(css::uno::RuntimeException); //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); //XLinkTargetSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getLinks(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLinks(void) throw( css::uno::RuntimeException ); //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException ); }; /* -----------------26.10.99 15:46------------------- @@ -524,8 +543,8 @@ public: --------------------------------------------------*/ class SwXOutlineTarget : public cppu::WeakImplHelper2 < - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceInfo + css::beans::XPropertySet, + css::lang::XServiceInfo > { const SfxItemPropertySet* pPropSet; @@ -536,37 +555,61 @@ public: ~SwXOutlineTarget(); //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException ); }; #endif class SwXDocumentPropertyHelper : public SvxUnoForbiddenCharsTable { - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xDashTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xGradientTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xHatchTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xBitmapTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xTransGradientTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xMarkerTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xDrawDefaults; + css::uno::Reference < css::uno::XInterface > xDashTable; + css::uno::Reference < css::uno::XInterface > xGradientTable; + css::uno::Reference < css::uno::XInterface > xHatchTable; + css::uno::Reference < css::uno::XInterface > xBitmapTable; + css::uno::Reference < css::uno::XInterface > xTransGradientTable; + css::uno::Reference < css::uno::XInterface > xMarkerTable; + css::uno::Reference < css::uno::XInterface > xDrawDefaults; SwDoc* m_pDoc; public: SwXDocumentPropertyHelper(SwDoc& rDoc); ~SwXDocumentPropertyHelper(); - com::sun::star::uno::Reference<com::sun::star::uno::XInterface> GetDrawTable(short nWhich); + css::uno::Reference<css::uno::XInterface> GetDrawTable(short nWhich); void Invalidate(); virtual void onChange(); }; + + +/*-- 06.01.2004 15:08:34--------------------------------------------------- + The class SwViewOptionAdjust_Impl is used to adjust the SwViewOption of + the current ViewShell so that fields are not printed as commands and + hidden characters are always invisible. Hidden text and place holders + should be printed according to the current print options. + After printing the view options are restored + -----------------------------------------------------------------------*/ +class SwViewOptionAdjust_Impl +{ + SwWrtShell & m_rShell; + SwViewOption m_aOldViewOptions; +// SwViewOption m_aRenderViewOptions; // view options to use when rendering for PDF export or printing +// bool m_bRestoreViewOptions; + +public: + SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions ); + ~SwViewOptionAdjust_Impl(); + + void AdjustViewOptions( const SwPrtOptions *pPrtOptions ); +}; + + diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 98d88b87b3..e7e3baa02c 100644..100755 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -82,8 +82,7 @@ namespace svtools{ class ColorConfig;} #define VIEWOPT_CORE2_SMOOTHSCROLL 0x00000004L #define VIEWOPT_CORE2_CRSR_IN_PROT 0x00000008L #define VIEWOPT_CORE2_PDF_EXPORT 0x00000010L - - +#define VIEWOPT_CORE2_PRINTING 0x00000020L #define VIEWOPT_CORE2_BIGMARKHDL 0x00000040L #define VIEWOPT_2_UNUSED1 0x00000100L @@ -175,7 +174,7 @@ protected: BYTE nTblDest; // Ziel fuer Tabellenhintergrund -#ifndef PRODUCT +#ifdef DBG_UTIL // korrespondieren zu den Angaben in ui/config/cfgvw.src BOOL bTest1 :1; // Test-Flag "Layout not loading" BOOL bTest2 :1; // Test-Flag "WYSIWYG++" @@ -381,6 +380,12 @@ public: inline void SetPDFExport(BOOL b) { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_PDF_EXPORT) : (nCore2Options &= ~VIEWOPT_CORE2_PDF_EXPORT);} + inline BOOL IsPrinting() const + {return nCore2Options & VIEWOPT_CORE2_PRINTING ? TRUE : FALSE;} + + inline void SetPrinting(BOOL b) + { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_PRINTING) : (nCore2Options &= ~VIEWOPT_CORE2_PRINTING);} + /*--------------------------------------------------------------------------- ----------------------------------------------------------------------------*/ @@ -417,7 +422,7 @@ public: USHORT GetViewLayoutColumns() const { return mnViewLayoutColumns; } void SetViewLayoutColumns( USHORT nNew ) { mnViewLayoutColumns = nNew; } -#ifndef PRODUCT +#ifdef DBG_UTIL // korrespondieren zu den Angaben in ui/config/cfgvw.src inline BOOL IsTest1() const { return bTest1; } inline void SetTest1( BOOL b ) { bTest1 = b; } @@ -450,7 +455,8 @@ public: SwViewOption& operator=( const SwViewOption &rOpt ); // Vergleichsmethoden BOOL IsEqualFlags ( const SwViewOption &rOpt ) const; - inline BOOL operator==( const SwViewOption &rOpt ) const; + inline BOOL operator == ( const SwViewOption &rOpt ) const; + inline BOOL operator != ( const SwViewOption &rOpt ) const { return !(*this == rOpt); } /*--------------------------------------------------------------------------- diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 36fe5919ed..74a32626cc 100644..100755 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -32,13 +32,14 @@ #include <com/sun/star/embed/XClassifiedObject.hpp> #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <tools/rtti.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include "swdllapi.h" #include <swtypes.hxx> #include <ring.hxx> #include <swrect.hxx> #include <errhdl.hxx> #include <vcl/mapmod.hxx> +#include <vcl/print.hxx> namespace com { namespace sun { namespace star { namespace accessibility { class XAccessible; } } } } @@ -70,6 +71,7 @@ class SfxViewShell; class SwViewOption; class SwViewImp; class SwPrtOptions; +class SwPrintData; class SwPagePreViewPrtData; class Window; class OutputDevice; @@ -92,12 +94,19 @@ class SwPostItMgr; // #i74769# class SdrPaintWindow; +namespace vcl +{ + class OldStylePrintAdaptor; +} + + //JP 19.07.98: - Bug 52312 // define fuer Flags, die im CTOR oder den darunter liegenden Schichten // benoetigt werden. // Zur Zeit wird fuer die DrawPage das PreView Flag benoetigt #define VSHELLFLAG_ISPREVIEW ((long)0x1) + class SW_DLLPUBLIC ViewShell : public Ring { friend void SetOutDev( ViewShell *pSh, OutputDevice *pOut ); @@ -186,7 +195,7 @@ class SW_DLLPUBLIC ViewShell : public Ring SW_DLLPRIVATE void Scroll(); //Scrollen wenn sich aus der LayAction Scrollmoeglichkeiten //ergaben. - SW_DLLPRIVATE void PrepareForPrint( const SwPrtOptions &rOptions ); + SW_DLLPRIVATE void PrepareForPrint( const SwPrintData &rOptions ); SW_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt ); @@ -209,8 +218,7 @@ public: const SwNodes& GetNodes() const; //Nach Druckerwechsel, vom Doc - //pPDFOut != NULL is used for PDF export. - void InitPrt( SfxPrinter * , OutputDevice *pPDFOut = NULL ); + void InitPrt( OutputDevice *pOutDev ); //Klammerung von zusammengehoerenden Aktionen. inline void StartAction(); @@ -361,22 +369,25 @@ public: void ChgAllPageOrientation( sal_uInt16 eOri ); void ChgAllPageSize( Size &rSz ); - //Druckauftrag abwickeln. - // pPDFOut != Null is: do PDF Export (no printing!) - sal_Bool Prt( SwPrtOptions& rOptions, SfxProgress* pProgress, - OutputDevice* pPDFOut = NULL ); + // printing of one page. + // bIsPDFExport == true is: do PDF Export (no printing!) + sal_Bool PrintOrPDFExport( OutputDevice *pOutDev, const SwPrtOptions &rPrintData, + sal_Int32 nRenderer /* offset in vector of pages to print */ ); + + // printing of one brochure page + void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData, + sal_Int32 nRenderer /* offset in vector of page pairs for prospect printing */ ); - //"Drucken" fuer OLE 2.0 - static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, SwPrtOptions& rOptions, + // printing for OLE 2.0 + static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions, OutputDevice* pOleOut, const Rectangle& rRect ); // creates temporary doc with selected text for PDF export - SwDoc * CreatePrtDoc( SfxPrinter* pPrt, SfxObjectShellRef& ); + SwDoc * CreatePrtDoc( SfxObjectShellRef& ); SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt ); //Wird intern fuer die Shell gerufen die Druckt. Formatiert die Seiten. - void CalcPagesForPrint( sal_uInt16 nMax, SfxProgress* pProgress = 0, - const String* pStr = NULL, ULONG nMergeAct = 0, ULONG nMergeCnt = 0 ); + void CalcPagesForPrint( sal_uInt16 nMax ); //All about fields. void UpdateFlds(sal_Bool bCloseDB = sal_False); @@ -475,14 +486,6 @@ public: */ void AdjustOptionsForPagePreview( const SwPrtOptions &_rPrintOptions ); - // print page/print preview - void PrintPreViewPage( SwPrtOptions& rOptions, sal_uInt16 nRowCol, - SfxProgress& rProgress, - const SwPagePreViewPrtData* = 0 ); - - // Prospekt-Format drucken - void PrintProspect( SwPrtOptions&, SfxProgress& , BOOL bRTL); - sal_Bool IsViewLocked() const { return bViewLocked; } void LockView( sal_Bool b ) { bViewLocked = b; } diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx index 34c11f2393..7988aaf209 100644 --- a/sw/inc/viscrs.hxx +++ b/sw/inc/viscrs.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -169,7 +169,7 @@ public: // TRUE: an die Position kann der Cursor gesetzt werden virtual BOOL IsAtValidPos( BOOL bPoint = TRUE ) const; -#ifndef PRODUCT +#ifdef DBG_UTIL // JP 05.03.98: zum Testen des UNO-Crsr Verhaltens hier die Implementierung // am sichtbaren Cursor virtual BOOL IsSelOvr( int eFlags = @@ -213,7 +213,7 @@ public: // TRUE: an die Position kann der Cursor gesetzt werden virtual BOOL IsAtValidPos( BOOL bPoint = TRUE ) const; -#ifndef PRODUCT +#ifdef DBG_UTIL // JP 05.03.98: zum Testen des UNO-Crsr Verhaltens hier die Implementierung // am sichtbaren Cursor virtual BOOL IsSelOvr( int eFlags = diff --git a/sw/prj/build.lst b/sw/prj/build.lst index 426a9f0403..6fd49c1d77 100644 --- a/sw/prj/build.lst +++ b/sw/prj/build.lst @@ -1,4 +1,4 @@ -sw sw : l10n connectivity OOo:writerperfect svx stoc uui writerfilter vbahelper NULL +sw sw : filter l10n connectivity OOo:writerperfect vbahelper svx stoc writerfilter NULL sw sw usr1 - all sw_mkout NULL sw sw\inc nmake - all sw_inc NULL sw sw\uiconfig\layout nmake - all sw_layout NULL diff --git a/sw/qa/complex/checkColor/makefile.mk b/sw/qa/complex/checkColor/makefile.mk index 0541b44e1d..d9f7060a83 100755 --- a/sw/qa/complex/checkColor/makefile.mk +++ b/sw/qa/complex/checkColor/makefile.mk @@ -40,7 +40,7 @@ PACKAGE = complex$/checkColor #----- compile .java files ----------------------------------------- -JARFILES = mysql.jar sandbox.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar mysql.jar +JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar mysql.jar JAVAFILES = CheckChangeColor.java JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) diff --git a/sw/qa/complex/indeterminateState/makefile.mk b/sw/qa/complex/indeterminateState/makefile.mk index 5261e70667..731822e032 100755 --- a/sw/qa/complex/indeterminateState/makefile.mk +++ b/sw/qa/complex/indeterminateState/makefile.mk @@ -40,7 +40,7 @@ PACKAGE = complex$/indeterminateState #----- compile .java files ----------------------------------------- -JARFILES = mysql.jar sandbox.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar +JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar JAVAFILES = CheckIndeterminateState.java JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) diff --git a/sw/qa/complex/writer/makefile.mk b/sw/qa/complex/writer/makefile.mk index de5200d471..9aa7e95c9a 100755 --- a/sw/qa/complex/writer/makefile.mk +++ b/sw/qa/complex/writer/makefile.mk @@ -40,7 +40,7 @@ PACKAGE = complex$/writer #----- compile .java files ----------------------------------------- -JARFILES = mysql.jar sandbox.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar +JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar JAVAFILES = CheckIndexedPropertyValues.java CheckNamedPropertyValues.java CheckCrossReferences.java CheckBookmarks.java CheckFlies.java TextPortionEnumerationTest.java JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) diff --git a/sw/qa/core/Test-BigPtrArray.cxx b/sw/qa/core/Test-BigPtrArray.cxx index 4b0f9a53cc..965f71224c 100644 --- a/sw/qa/core/Test-BigPtrArray.cxx +++ b/sw/qa/core/Test-BigPtrArray.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" #define TIMELOG -#include <cppunit/simpleheader.hxx> +#include <testshl/simpleheader.hxx> #include <bparr.hxx> #include <string> #include <stdlib.h> @@ -45,37 +45,37 @@ using namespace std; namespace /* private */ { - const int NUM_ENTRIES = 100000; - + const int NUM_ENTRIES = 100000; + class BigPtrEntryMock : public BigPtrEntry { public: BigPtrEntryMock(int count) : count_(count) { } - + ~BigPtrEntryMock() { #ifdef ENABLE_DEBUG_OUTPUT printf("Destructor called (%i)\n", count_); #endif } - + int getCount() const { return count_; } - + void setCount(int newCount) { count_ = newCount; } - + ULONG Position() const { return GetPos(); } - + private: int count_; }; @@ -86,30 +86,30 @@ namespace /* private */ pbem->setCount(pbem->getCount() + *((int*)pArgs)); return true; } - + void dumpBigPtrArray(const BigPtrArray& bparr) { #ifdef ENABLE_DEBUG_OUTPUT - for (int i = 0; i < bparr.Count(); i++) + for (int i = 0; i < bparr.Count(); i++) printf("bparr[%i,%i]: %i\n", i, static_cast<BigPtrEntryMock*>(bparr[i])->Position(), static_cast<BigPtrEntryMock*>(bparr[i])->getCount()); - - printf("\n"); + + printf("\n"); #endif } - + void fillBigPtrArray(BigPtrArray& bparr, ULONG numEntries) - { + { for (int i = 0; i < numEntries; i++) bparr.Insert(new BigPtrEntryMock(i), bparr.Count()); } - + void printMethodName(const char* name) { #ifdef ENABLE_DEBUG_OUTPUT printf(name); #endif } - + bool checkElementPositions(const BigPtrArray& bparr) { for (int i = 0; i < bparr.Count(); i++) @@ -118,12 +118,12 @@ namespace /* private */ return false; } return true; - } - + } + void releaseBigPtrArrayContent(BigPtrArray& bparr) { for (int i = 0; i < bparr.Count(); i++) - delete bparr[i]; + delete bparr[i]; } RTL_LOGFILE_CONTEXT(logFile, "BigPtrArray performance measures" ); @@ -132,37 +132,37 @@ namespace /* private */ class BigPtrArrayUnittest : public CppUnit::TestFixture { public: - + BigPtrArrayUnittest() { } - + /** Test constructor/destructor - The size of the BigPtrArray - aka the 'Count' should be 0 + The size of the BigPtrArray + aka the 'Count' should be 0 initially. */ void test_ctor() - { - printMethodName("test_ctor\n"); - - BigPtrArray bparr; - + { + printMethodName("test_ctor\n"); + + BigPtrArray bparr; + CPPUNIT_ASSERT_MESSAGE ( - "BigPtrArray ctor failed", + "BigPtrArray ctor failed", bparr.Count() == 0 - ); - } - + ); + } + void test_insert_entries_at_front() - { + { printMethodName("test_insert_entries_at_front\n"); - + RTL_LOGFILE_CONTEXT_TRACE(logFile, "START: test_insert_entries_at_front"); - - BigPtrArray bparr; - + + BigPtrArray bparr; + for (int i = 0; i < NUM_ENTRIES; i++) { ULONG oldCount = bparr.Count(); @@ -173,9 +173,9 @@ public: (bparr.Count() == oldCount + 1) ) } - + RTL_LOGFILE_CONTEXT_TRACE(logFile, "END: test_insert_entries_at_front"); - + for (int i = 0, j = NUM_ENTRIES - 1; i < NUM_ENTRIES; i++, j--) { CPPUNIT_ASSERT_MESSAGE @@ -184,17 +184,17 @@ public: static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == j ) } - + CPPUNIT_ASSERT_MESSAGE ( "test_insert_entries_at_front failed", checkElementPositions(bparr) ) - + releaseBigPtrArrayContent(bparr); - dumpBigPtrArray(bparr); + dumpBigPtrArray(bparr); } - + void test_insert_entries_in_the_middle() { printMethodName("test_insert_entries_in_the_middle\n"); diff --git a/sw/qa/core/makefile.mk b/sw/qa/core/makefile.mk index 66308d1eed..3982536b28 100644 --- a/sw/qa/core/makefile.mk +++ b/sw/qa/core/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -42,7 +42,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk # BEGIN ---------------------------------------------------------------- -# auto generated Target:testjob by codegen.pl +# auto generated Target:testjob by codegen.pl .IF "$(GUI)" == "WNT" CFLAGS+=/Ob1 @@ -52,17 +52,7 @@ SHL1OBJS=$(SLO)$/Test-BigPtrArray.obj \ $(SLO)$/bparr.obj SHL1TARGET=$(TARGET) -SHL1STDLIBS=$(SALLIB) $(TOOLSLIB) - -.IF "$(GUI)" == "WNT" -SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib -.ENDIF -.IF "$(GUI)" == "UNX" -SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a -# .IF "$(OS)" == "SOLARIS" -# SHL1STDLIBS += -lrt -laio -# .ENDIF -.ENDIF +SHL1STDLIBS=$(SALLIB) $(TOOLSLIB) $(CPPUNITLIB) $(TESTSHL2LIB) SHL1IMPLIB= i$(SHL1TARGET) diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi index cf71e18bd8..de0be1f9a5 100644 --- a/sw/sdi/_docsh.sdi +++ b/sw/sdi/_docsh.sdi @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -28,7 +28,7 @@ * ************************************************************************/ -interface BaseTextDocument : OfficeDocument +interface BaseTextDocument [ Automation = FALSE; ] @@ -72,7 +72,7 @@ interface BaseTextDocument : OfficeDocument [ ExecMethod = Execute ; ] - + SID_SPELLCHECKER_CHANGED [ ExecMethod = Execute ; @@ -122,7 +122,7 @@ interface BaseTextDocument : OfficeDocument ExecMethod = Execute ; StateMethod = GetState; ] - + SID_ATTR_CHAR_FONTLIST [ StateMethod = GetState ; diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 27c8cb4d85..5e5316fc61 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -29,7 +29,7 @@ ************************************************************************/ -interface BaseTextEditView : View +interface BaseTextEditView [ Automation = FALSE; ] diff --git a/sw/sdi/docsh.sdi b/sw/sdi/docsh.sdi index ca6fb62396..d1619df2f1 100644 --- a/sw/sdi/docsh.sdi +++ b/sw/sdi/docsh.sdi @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -68,7 +68,7 @@ interface TextDocument : BaseTextDocument ] } -shell SwDocShell : SfxObjectShell +shell SwDocShell { import TextDocument[Automation]; } diff --git a/sw/sdi/makefile.mk b/sw/sdi/makefile.mk index 25b75feea0..016b0df6cb 100644 --- a/sw/sdi/makefile.mk +++ b/sw/sdi/makefile.mk @@ -53,7 +53,12 @@ SDI1EXPORT=swriter # --- Files -------------------------------------------------------- SVSDI1DEPEND= \ - switems.sdi\ + $(SOLARINCXDIR)$/sfx2/sfx.sdi \ + $(SOLARINCXDIR)$/sfx2/sfxitems.sdi \ + $(SOLARINCXDIR)$/svx/svx.sdi \ + $(SOLARINCXDIR)$/svx/svxitems.sdi \ + $(SOLARINCXDIR)$/svx/xoitems.sdi \ + switems.sdi\ swriter.sdi\ _docsh.sdi\ docsh.sdi\ @@ -97,8 +102,7 @@ SVSDI1DEPEND= \ annotsh.sdi\ swslots.hrc \ $(INC)$/globals.hrc \ - $(INC)$/cmdid.h \ - $(SOLARINCXDIR)$/svxslots.ilb + $(INC)$/cmdid.h .ENDIF # --- Targets ------------------------------------------------------- diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 315d341977..aede24688e 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -6509,31 +6509,6 @@ SfxVoidItem PageUpSel FN_PAGEUP_SEL ] //-------------------------------------------------------------------------- -SfxVoidItem PreviewPrintOptions FN_PREVIEW_PRINT_OPTIONS -() -[ - /* flags: */ - AutoUpdate = TRUE, - Cachable = Cachable, - FastCall = TRUE, - HasCoreId = FALSE, - HasDialog = TRUE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_DOC; -] - -//-------------------------------------------------------------------------- SfxVoidItem PreviewZoom FN_PREVIEW_ZOOM ( SfxUInt16Item PreviewZoom FN_PREVIEW_ZOOM ) [ diff --git a/sw/sdi/swslots.sdi b/sw/sdi/swslots.sdi index 789301f418..8eea2b6903 100644 --- a/sw/sdi/swslots.sdi +++ b/sw/sdi/swslots.sdi @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -28,8 +28,6 @@ * ************************************************************************/ -import "svxslots.ilb" - module "9F76B581-23DD-101C-80B6-000024021835" "A1810F00-23DE-101C-80B6-000024021835" @@ -37,10 +35,15 @@ StarWriter [ HelpText( "StarWriter Application" ) SlotIdFile( "swslots.hrc" ) -TypeLibFile( "swslots.tlb" ) ModulePrefix( "Sw" ) ] { + include "sfx2/sfxitems.sdi" + include "sfx2/sfx.sdi" + include "svx/svxitems.sdi" + include "svx/xoitems.sdi" + include "svx/svx.sdi" + item String TbxDummyItem; /* item String XFillAttrSetItem; @@ -116,7 +119,7 @@ ModulePrefix( "Sw" ) include "_mediash.sdi" include "mediash.sdi" - + include "_annotsh.sdi" include "annotsh.sdi" diff --git a/sw/sdi/swslots.src b/sw/sdi/swslots.src index c5c6122136..d22f32ae37 100644 --- a/sw/sdi/swslots.src +++ b/sw/sdi/swslots.src @@ -902,10 +902,6 @@ SfxSlotInfo FN_PREV_WORD_SEL { Slotname [ en-US ] = "Select to Begin of Word"; }; -SfxSlotInfo FN_PREVIEW_PRINT_OPTIONS -{ - Slotname [ en-US ] = "Print options page view"; -}; SfxSlotInfo FN_PREVIEW_ZOOM { Slotname [ en-US ] = "Preview Zoom"; @@ -916,7 +912,7 @@ SfxSlotInfo FN_PRINT_LAYOUT }; SfxSlotInfo FN_PRINT_PAGEPREVIEW { - Slotname [ en-US ] = "Print page view"; + Slotname [ en-US ] = "Print document"; }; SfxSlotInfo FN_MAILMERGE_WIZARD { diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi index 3d7ccb7f66..87d8b906a5 100644 --- a/sw/sdi/viewsh.sdi +++ b/sw/sdi/viewsh.sdi @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -145,7 +145,7 @@ interface TextEditView : BaseTextEditView } //========================================================================= -shell SwView : SfxViewShell +shell SwView { import TextEditView [Automation]; @@ -155,7 +155,7 @@ shell SwView : SfxViewShell // import ReplaceAttributes; } -interface TextPrintPreview : View +interface TextPrintPreview [ uuid = "1622A480-111A-101D-9757-6E74207A7520" ] { SID_BROWSER_MODE @@ -226,10 +226,6 @@ interface TextPrintPreview : View ExecMethod = Execute ; StateMethod = GetState ; ] - FN_PREVIEW_PRINT_OPTIONS //status() - [ - ExecMethod = Execute ; - ] FN_PRINT_PAGEPREVIEW // status() [ ExecMethod = Execute ; @@ -325,7 +321,7 @@ interface TextPrintPreview : View //========================================================================= -shell SwPagePreView : SfxViewShell +shell SwPagePreView { import TextPrintPreview[Automation]; } diff --git a/sw/sdi/wdocsh.sdi b/sw/sdi/wdocsh.sdi index 478023ac52..711bb4620f 100644 --- a/sw/sdi/wdocsh.sdi +++ b/sw/sdi/wdocsh.sdi @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,7 +47,7 @@ interface WebDocument : BaseTextDocument ] } -shell SwWebDocShell : SfxObjectShell +shell SwWebDocShell { import WebDocument[Automation]; } diff --git a/sw/sdi/wviewsh.sdi b/sw/sdi/wviewsh.sdi index f4b2bb2e91..c65183d7db 100644 --- a/sw/sdi/wviewsh.sdi +++ b/sw/sdi/wviewsh.sdi @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -63,7 +63,7 @@ interface WebEditView : BaseTextEditView ] } -shell SwWebView : SfxViewShell +shell SwWebView { import WebEditView [Automation]; // import SearchSettings; @@ -73,7 +73,7 @@ shell SwWebView : SfxViewShell } -interface WebSourceView : View +interface WebSourceView [ uuid = "95069CE0-69D8-101D-9757-C667E8298000"] { SID_TABLE_CELL // status() @@ -195,7 +195,7 @@ interface WebSourceView : View ] } -shell SwSrcView : SfxViewShell +shell SwSrcView { import WebSourceView [Automation]; diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx index 0c6106461f..8f9caf5f02 100644 --- a/sw/source/core/SwNumberTree/SwNumberTree.cxx +++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx @@ -39,7 +39,7 @@ using std::vector; using std::find; -#ifndef PRODUCT +#ifdef DBG_UTIL unsigned long SwNumberTreeNode::nInstances = 0; #endif @@ -55,7 +55,7 @@ SwNumberTreeNode::SwNumberTreeNode() { mItLastValid = mChildren.end(); -#ifndef PRODUCT +#ifdef DBG_UTIL mnSerial = nInstances; nInstances++; #endif @@ -80,7 +80,7 @@ SwNumberTreeNode::~SwNumberTreeNode() ASSERT( IsPhantom() || mpParent == NULL, ": I'm not supposed to have a parent."); -#ifndef PRODUCT +#ifdef DBG_UTIL nInstances--; #endif @@ -1108,7 +1108,7 @@ SwNumberTreeNode::GetIterator(const SwNumberTreeNode * pChild) const // return aStr; //} -#ifndef PRODUCT +#ifdef DBG_UTIL unsigned long SwNumberTreeNode::GetInstances() { return nInstances; diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 4e3b9e7047..e59faa3f38 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -100,12 +100,12 @@ class SwAccessibleContextMap_Impl: public _SwAccessibleContextMap_Impl { public: -#ifndef PRODUCT +#ifdef DBG_UTIL sal_Bool mbLocked; #endif SwAccessibleContextMap_Impl() -#ifndef PRODUCT +#ifdef DBG_UTIL : mbLocked( sal_False ) #endif {} @@ -227,11 +227,11 @@ class SwAccessibleShapeMap_Impl: public _SwAccessibleShapeMap_Impl public: -#ifndef PRODUCT +#ifdef DBG_UTIL sal_Bool mbLocked; #endif SwAccessibleShapeMap_Impl( SwAccessibleMap *pMap ) -#ifndef PRODUCT +#ifdef DBG_UTIL : mbLocked( sal_False ) #endif { @@ -1009,7 +1009,7 @@ SwAccessibleMap::~SwAccessibleMap() { vos::OGuard aGuard( maMutex ); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( !mpFrmMap || mpFrmMap->empty(), "Frame map should be empty after disposing the root frame" ); if( mpFrmMap ) @@ -1062,7 +1062,7 @@ SwAccessibleMap::~SwAccessibleMap() { vos::OGuard aGuard( maEventMutex ); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( !(mpEvents || mpEventMap), "pending events" ); if( mpEvents ) { @@ -1101,12 +1101,12 @@ uno::Reference< XAccessible > SwAccessibleMap::_GetDocumentView( if( !mpFrmMap ) { mpFrmMap = new SwAccessibleContextMap_Impl; -#ifndef PRODUCT +#ifdef DBG_UTIL mpFrmMap->mbLocked = sal_False; #endif } -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( !mpFrmMap->mbLocked, "Map is locked" ); mpFrmMap->mbLocked = sal_True; #endif @@ -1138,7 +1138,7 @@ uno::Reference< XAccessible > SwAccessibleMap::_GetDocumentView( } } -#ifndef PRODUCT +#ifdef DBG_UTIL mpFrmMap->mbLocked = sal_False; #endif } diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx index 7bc480f511..bba991661b 100644 --- a/sw/source/core/access/accpage.cxx +++ b/sw/source/core/access/accpage.cxx @@ -129,8 +129,9 @@ void SwAccessiblePage::_InvalidateFocus() } SwAccessiblePage::SwAccessiblePage( SwAccessibleMap* pInitMap, - const SwFrm* pFrame ) : - SwAccessibleContext( pInitMap, AccessibleRole::PANEL, pFrame ) + const SwFrm* pFrame ) + : SwAccessibleContext( pInitMap, AccessibleRole::PANEL, pFrame ) + , bIsSelected( sal_False ) { DBG_ASSERT( pFrame != NULL, "need frame" ); DBG_ASSERT( pInitMap != NULL, "need map" ); diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index b125f1f71c..860178c5b9 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,7 @@ #include <swcache.hxx> #include <swfntcch.hxx> -#ifndef PRODUCT +#ifdef DBG_UTIL #include <unotextmarkup.hxx> #endif @@ -211,7 +211,7 @@ void SwModify::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) LockModify(); -#ifdef PRODUCT +#ifndef DBG_UTIL bInModify = TRUE; #else if( !pOldValue ) @@ -287,7 +287,7 @@ void SwModify::Add(SwClient *pDepend) // nur wenn das hier noch nicht eingetragen ist einfuegen if(pDepend->pRegisteredIn != this ) { -#ifndef PRODUCT +#ifdef DBG_UTIL SwClientIter* pTmp = pClientIters; while( pTmp ) { diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx index a1725667fe..8351496ecb 100644 --- a/sw/source/core/attr/hints.cxx +++ b/sw/source/core/attr/hints.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,12 +47,6 @@ SwFmtChg::SwFmtChg( SwFmt *pFmt ) {} -SwInsChr::SwInsChr( xub_StrLen nP ) - : SwMsgPoolItem( RES_INS_CHR ), - nPos( nP ) -{} - - SwInsTxt::SwInsTxt( xub_StrLen nP, xub_StrLen nL ) : SwMsgPoolItem( RES_INS_TXT ), @@ -147,7 +141,7 @@ SwAttrSetChg::~SwAttrSetChg() } -#ifndef PRODUCT +#ifdef DBG_UTIL void SwAttrSetChg::ClearItem( USHORT nWhch ) { @@ -183,7 +177,7 @@ SfxPoolItem* SwMsgPoolItem::Clone( SfxItemPool* ) const * Ist keines vorhanden, returnt ein 0-Pointer !!! * Used to be inlined (hintids.hxx) in PRODUCT. ******************************************************************************/ -#ifdef PRODUCT +#ifndef DBG_UTIL const SfxPoolItem* GetDfltAttr( USHORT nWhich ) { return aAttrTab[ nWhich - POOLATTR_BEGIN ]; @@ -227,12 +221,6 @@ SwVirtPageNumInfo::SwVirtPageNumInfo( const SwPageFrm *pPg ) : // aList.Insert(rNd.GetIndex(), &rNd); //} -SwNRuleLowerLevel::SwNRuleLowerLevel( const String& rRuleName, BYTE nSrchLvl ) - : SwMsgPoolItem( RES_GETLOWERNUMLEVEL ), rName( rRuleName ), - nLvl(nSrchLvl) -{ -} - SwFindNearestNode::SwFindNearestNode( const SwNode& rNd ) : SwMsgPoolItem( RES_FINDNEARESTNODE ), pNd( &rNd ), pFnd( 0 ) diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index 2388a1ae09..23a2d4772d 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -33,7 +33,7 @@ #include <hintids.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <svx/colritem.hxx> #include <svx/brshitem.hxx> #include <svx/bolnitem.hxx> @@ -387,7 +387,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const // <-- } } -#ifndef PRODUCT +#ifdef DBG_UTIL else ASSERT( !this, "weder Format noch ContentNode - keine Attribute kopiert"); #endif diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx index c97265254c..c5c83fb764 100644 --- a/sw/source/core/bastyp/bparr.cxx +++ b/sw/source/core/bastyp/bparr.cxx @@ -41,7 +41,7 @@ // immer ~ 20 * MAXENTRY == 20000 Eintraege const USHORT nBlockGrowSize = 20; -#ifdef PRODUCT +#ifndef DBG_UTIL #define CHECKIDX( p, n, i, c ) diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index bb81f9116c..dae28acc73 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,9 +49,9 @@ #include <unotools/charclass.hxx> #include <svx/unolingu.hxx> #include <svx/scripttypeitem.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/useroptions.hxx> #include <tools/datetime.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <swmodule.hxx> #include <doc.hxx> #include <viewsh.hxx> @@ -1142,7 +1142,7 @@ else case CALC_DATE : eCurrListOper = CALC_MONTH; break; default : - break; + break; } return eCurrOper; } diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx index 84302c65c4..d05cf8d72a 100644 --- a/sw/source/core/bastyp/index.cxx +++ b/sw/source/core/bastyp/index.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ #include "index.hxx" #include "error.h" // fuers ASSERT -#ifndef PRODUCT +#ifdef DBG_UTIL int SwIndex::nSerial = 0; #endif @@ -103,7 +103,7 @@ SwIndex::SwIndex( SwIndexReg* pArr, xub_StrLen nIdx ) else ChgValue( *pArray->pFirst, nIdx ); -#ifndef PRODUCT +#ifdef DBG_UTIL MySerial = ++nSerial; // nur in der nicht PRODUCT-Version #endif IDX_CHK_ARRAY @@ -115,7 +115,7 @@ SwIndex::SwIndex( const SwIndex& rIdx, short nIdx ) { ChgValue( rIdx, rIdx.nIndex + nIdx ); -#ifndef PRODUCT +#ifdef DBG_UTIL MySerial = ++nSerial; // nur in der nicht PRODUCT-Version #endif IDX_CHK_ARRAY @@ -126,7 +126,7 @@ SwIndex::SwIndex( const SwIndex& rIdx ) : nIndex( rIdx.nIndex ), pArray( rIdx.pArray ), pNext( 0 ), pPrev( 0 ) { ChgValue( rIdx, rIdx.nIndex ); -#ifndef PRODUCT +#ifdef DBG_UTIL MySerial = ++nSerial; // nur in der nicht PRODUCT-Version #endif IDX_CHK_ARRAY @@ -371,7 +371,7 @@ void SwIndexReg::Update( SwIndex const & rIdx, const xub_StrLen nDiff, ARR_CHK_ARRAY } -#ifndef PRODUCT +#ifdef DBG_UTIL #ifndef CFRONT /************************************************************************* diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index b78699fa6e..6f9fdb7546 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ #include <tools/globname.hxx> #include <vcl/mapmod.hxx> #include <svx/xmlcnitm.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <svx/pbinitem.hxx> #include <svx/keepitem.hxx> #include <svx/nlbkitem.hxx> @@ -83,7 +83,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> #include <unotools/collatorwrapper.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include <com/sun/star/i18n/CollatorOptions.hpp> #include <unotools/transliterationwrapper.hxx> #include <svx/acorrcfg.hxx> @@ -780,7 +780,7 @@ void _FinitCore() delete SwEditShell::pAutoFmtFlags; -#ifndef PRODUCT +#ifdef DBG_UTIL //Defaultattribut freigeben lassen um asserts zu vermeiden. if ( aAttrTab[0]->GetRefCount() ) SfxItemPool::ReleaseDefaults( aAttrTab, POOLATTR_END-POOLATTR_BEGIN, FALSE); diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx index 3d24c327f2..67383227ca 100644 --- a/sw/source/core/bastyp/swcache.cxx +++ b/sw/source/core/bastyp/swcache.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,7 @@ SV_IMPL_PTRARR(SwCacheObjArr,SwCacheObj*); -#ifdef PRODUCT +#ifndef DBG_UTIL #define INCREMENT( nVar ) #else #define INCREMENT( nVar ) ++nVar @@ -53,7 +53,7 @@ SV_IMPL_PTRARR(SwCacheObjArr,SwCacheObj*); |* |*************************************************************************/ -#ifndef PRODUCT +#ifdef DBG_UTIL void SwCache::Check() { @@ -90,7 +90,7 @@ void SwCache::Check() } #endif -#if !defined(PRODUCT) && defined(MADEBUG) +#if defined(DBG_UTIL) && defined(MADEBUG) #define CHECK Check(); #else #define CHECK @@ -107,7 +107,7 @@ void SwCache::Check() SwCache::SwCache( const USHORT nInitSize, const USHORT nGrowSize -#ifndef PRODUCT +#ifdef DBG_UTIL , const ByteString &rNm #endif ) : @@ -118,7 +118,7 @@ SwCache::SwCache( const USHORT nInitSize, const USHORT nGrowSize pLast( 0 ), nMax( nInitSize ), nCurMax( nInitSize ) -#ifndef PRODUCT +#ifdef DBG_UTIL , aName( rNm ), nAppend( 0 ), nInsertFree( 0 ), @@ -137,7 +137,7 @@ SwCache::SwCache( const USHORT nInitSize, const USHORT nGrowSize { } -#ifndef PRODUCT +#ifdef DBG_UTIL SwCache::~SwCache() @@ -197,7 +197,7 @@ void SwCache::Flush( const BYTE ) SwCacheObj *pTmp; while ( pObj ) { -#ifndef PRODUCT +#ifdef DBG_UTIL if ( pObj->IsLocked() ) { ASSERT( TRUE, "Flushing locked objects." ); @@ -322,7 +322,7 @@ SwCacheObj *SwCache::Get( const void *pOwner, const USHORT nIndex, ToTop( pRet ); } -#ifndef PRODUCT +#ifdef DBG_UTIL if ( pRet ) ++nGetSuccess; else @@ -346,7 +346,7 @@ SwCacheObj *SwCache::Get( const void *pOwner, const BOOL bToTop ) if ( bToTop && pRet && pRet != pFirst ) ToTop( pRet ); -#ifndef PRODUCT +#ifdef DBG_UTIL if ( pRet ) ++nGetSuccess; else @@ -588,7 +588,7 @@ SwCacheObj::~SwCacheObj() |* |*************************************************************************/ -#ifndef PRODUCT +#ifdef DBG_UTIL diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx index bbf03673f0..25580a96e4 100644 --- a/sw/source/core/bastyp/swrect.cxx +++ b/sw/source/core/bastyp/swrect.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" -#ifndef PRODUCT +#ifdef DBG_UTIL #ifndef _STREAM_HXX //autogen #include <tools/stream.hxx> #endif @@ -321,7 +321,7 @@ void SwRect::SetUpperRightCorner( const Point& rNew ) void SwRect::SetLowerLeftCorner( const Point& rNew ) { m_Point = Point(rNew.nA, rNew.nB - m_Size.getHeight()); } -#ifndef PRODUCT +#ifdef DBG_UTIL /************************************************************************* * operator<<( ostream&, SwRect&) *************************************************************************/ diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index ec0a07b306..bf99e590b2 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -332,7 +332,7 @@ if( GetWin() ) } -#if !defined( PRODUCT ) +#if defined(DBG_UTIL) void SwCrsrShell::SttCrsrMove() { @@ -1459,7 +1459,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) Point aCentrPt( aCharRect.Center() ); aTmpState.bSetInReadOnly = IsReadOnlyAvailable(); pTblFrm->GetCrsrOfst( pTblCrsr->GetPoint(), aCentrPt, &aTmpState ); -#ifdef PRODUCT +#ifndef DBG_UTIL pTblFrm->GetCharRect( aCharRect, *pTblCrsr->GetPoint() ); #else if ( !pTblFrm->GetCharRect( aCharRect, *pTblCrsr->GetPoint() ) ) @@ -2014,7 +2014,7 @@ void SwCrsrShell::Combine() SwCrsrSaveState aSaveState( *pCurCrsr ); if( pCrsrStk->HasMark() ) // nur wenn GetMark gesetzt wurde { -#ifdef PRODUCT +#ifndef DBG_UTIL CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, TRUE ); #else if( !CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, TRUE )) diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index d788c1e66e..a39ccb99c9 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -33,7 +33,7 @@ #include <hintids.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/lrspitem.hxx> #include <svx/adjitem.hxx> #include <svx/brkitem.hxx> @@ -1337,7 +1337,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, if( !bRet && ( SwContentAtPos::SW_TABLEBOXFML & rCntntAtPos.eCntntAtPos -#ifndef PRODUCT +#ifdef DBG_UTIL || SwContentAtPos::SW_TABLEBOXVALUE & rCntntAtPos.eCntntAtPos #endif )) @@ -1349,7 +1349,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, if( pSttNd && 0 != ( pTblNd = pTxtNd->FindTableNode()) && 0 != ( pBox = pTblNd->GetTable().GetTblBox( pSttNd->GetIndex() )) && -#ifndef PRODUCT +#ifdef DBG_UTIL ( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState( RES_BOXATR_FORMULA, FALSE, &pItem ) || SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState( @@ -1383,7 +1383,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, // erzeuge aus der internen (fuer CORE) // die externe (fuer UI) Formel rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_TABLEBOXFML; -#ifndef PRODUCT +#ifdef DBG_UTIL if( RES_BOXATR_VALUE == pItem->Which() ) rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_TABLEBOXVALUE; else @@ -1417,7 +1417,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, } } -#ifndef PRODUCT +#ifdef DBG_UTIL if( !bRet && SwContentAtPos::SW_CURR_ATTRS & rCntntAtPos.eCntntAtPos ) { xub_StrLen n = aPos.nContent.GetIndex(); diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 61fefca669..2808184f8c 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -38,8 +38,8 @@ #include <i18npool/mslangid.hxx> #include <hintids.hxx> #include <vcl/svapp.hxx> -#include <svtools/itemiter.hxx> -#include <svtools/whiter.hxx> +#include <svl/itemiter.hxx> +#include <svl/whiter.hxx> #include <svx/brkitem.hxx> #include <svx/colritem.hxx> #include <svx/fontitem.hxx> diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index ab93dee334..d715f78e33 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -37,7 +37,7 @@ #define _SVSTDARR_USHORTS #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <vcl/svapp.hxx> #include <txatritr.hxx> #include <fldbas.hxx> diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index d80f1a2465..d7823ec532 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -550,7 +550,7 @@ void SwPaM::SetMark() (*m_pMark) = (*m_pPoint); } -#ifndef PRODUCT +#ifdef DBG_UTIL void SwPaM::Exchange() { @@ -1218,12 +1218,12 @@ String SwPaM::GetTxt() const return aResult; } -BOOL SwPaM::Overlap(const SwPaM & a, const SwPaM & b) +BOOL SwPaM::Overlap(const SwPaM & a, const SwPaM & b) { return !(*b.End() <= *a.Start() || *a.End() <= *b.End()); } BOOL SwPaM::LessThan(const SwPaM & a, const SwPaM & b) { - return (*a.Start() < *b.Start()) || (*a.Start() == *b.Start() && *a.End() < *b.End()); + return (*a.Start() < *b.Start()) || (*a.Start() == *b.Start() && *a.End() < *b.End()); } diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 749046780b..b938d5ace5 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -39,7 +39,7 @@ #include <com/sun/star/i18n/CharType.hdl> #include <unotools/charclass.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/ctloptions.hxx> #include <swmodule.hxx> #include <fmtcntnt.hxx> #include <swtblfmt.hxx> diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index 0f14a62bed..76bdb74d5b 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -307,7 +307,7 @@ BOOL SwCrsrShell::SelTblBox() const SwStartNode* pStartNode = pCurCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); -#ifndef PRODUCT +#ifdef DBG_UTIL // the old code checks whether we're in a table by asking the // frame. This should yield the same result as searching for the // table box start node, right? diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 8f31456292..1e0d6b3703 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -34,7 +34,7 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <vcl/dialog.hxx> @@ -77,42 +77,42 @@ MapMode* SwSelPaintRects::pMapMode = 0; #ifdef SHOW_BOOKMARKS // #include <IMark.hxx> -// +// // class SwBookmarkRects : public SwSelPaintRects // { // virtual void Paint( const Rectangle& rRect ); // virtual void FillRects(); -// +// // public: // SwBookmarkRects( const SwCrsrShell& rSh ) : SwSelPaintRects( rSh ) {} // }; -// +// // void SwBookmarkRects::Paint( const Rectangle& rRect ) // { // Window* pWin = GetShell()->GetWin(); -// +// // RasterOp eOld( pWin->GetRasterOp() ); // BOOL bLCol = pWin->IsLineColor(); // Color aLCol( pWin->GetLineColor() ); // BOOL bFCol = pWin->IsFillColor(); // Color aFCol( pWin->GetFillColor() ); -// +// // pWin->SetRasterOp( ROP_XOR ); // Color aCol( RGB_COLORDATA( 0xF0, 0xC8, 0xF0 ) ^ COL_WHITE ); // pWin->SetFillColor( aCol ); // pWin->SetLineColor( aCol ); -// +// // pWin->DrawRect( rRect ); -// +// // if( bLCol ) pWin->SetLineColor( aLCol ); else pWin->SetLineColor(); // if( bFCol ) pWin->SetFillColor( aFCol ); else pWin->SetFillColor(); // pWin->SetRasterOp( eOld ); // } -// +// // void SwBookmarkRects::FillRects() // { // SwRegionRects aReg( GetShell()->VisArea() ); -// +// // const SwBookmarks& rBkmkTbl = GetShell()->getIDocumentMarkAccess()->getBookmarks(); // SwShellCrsr* pCrsr = 0; // for( USHORT n = 0; n < rBkmkTbl.Count(); ++n ) @@ -131,23 +131,23 @@ MapMode* SwSelPaintRects::pMapMode = 0; // pCrsr->FillRects(); // for( USHORT i = 0; i < pCrsr->Count(); ++i ) // aReg -= (*pCrsr)[ i ]; -// +// // pCrsr->Remove( 0, i ); // } // } // if( pCrsr ) delete pCrsr; -// +// // aReg.Invert(); // SwRects::Insert( &aReg, 0 ); // } -// +// // SwBookmarkRects* pBookMarkRects = 0; -// +// // void ShowBookmarks( const SwCrsrShell* pSh, int nAction, const SwRect* pRect = 0 ) // { // if( !pBookMarkRects && pSh->getIDocumentMarkAccess()->getBookmarks().Count() ) // pBookMarkRects = new SwBookmarkRects( *pSh ); -// +// // if( pBookMarkRects ) // { // switch( nAction ) @@ -156,12 +156,12 @@ MapMode* SwSelPaintRects::pMapMode = 0; // case 2: pBookMarkRects->Hide(); break; // case 3: pBookMarkRects->Invalidate( *pRect ); break; // } -// +// // if( !pBookMarkRects->Count() ) // delete pBookMarkRects, pBookMarkRects = 0; // } // } -// +// // #define SHOWBOOKMARKS1( nAct ) ShowBookmarks( GetShell(),nAct ); // #define SHOWBOOKMARKS2( nAct, pRect ) ShowBookmarks( GetShell(),nAct, pRect ); @@ -517,7 +517,7 @@ void SwVisCrsr::_SetPosAndShow() ////////////////////////////////////////////////////////////////////////////// SwSelPaintRects::SwSelPaintRects( const SwCrsrShell& rCSh ) -: SwRects( 0 ), +: SwRects( 0 ), pCShell( &rCSh ), mpCursorOverlay(0) { @@ -575,7 +575,7 @@ void SwSelPaintRects::Show() const Rectangle aPntRect(aNextRect.SVRect()); aNewRanges.push_back(basegfx::B2DRange( - aPntRect.Left(), aPntRect.Top(), + aPntRect.Left(), aPntRect.Top(), aPntRect.Right() + 1, aPntRect.Bottom() + 1)); } @@ -862,7 +862,7 @@ BOOL SwShellCrsr::UpDown( BOOL bUp, USHORT nCnt ) &GetPtPos(), GetShell()->GetUpDownX() ); } -#ifndef PRODUCT +#ifdef DBG_UTIL // JP 05.03.98: zum Testen des UNO-Crsr Verhaltens hier die Implementierung // am sichtbaren Cursor @@ -1001,7 +1001,7 @@ BOOL SwShellTableCrsr::IsInside( const Point& rPt ) const return FALSE; } -#ifndef PRODUCT +#ifdef DBG_UTIL // JP 05.03.98: zum Testen des UNO-Crsr Verhaltens hier die Implementierung // am sichtbaren Cursor diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx index 3e48b5ab4b..691b966521 100644 --- a/sw/source/core/doc/SwStyleNameMapper.cxx +++ b/sw/source/core/doc/SwStyleNameMapper.cxx @@ -34,7 +34,7 @@ #include <SwStyleNameMapper.hxx> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <tools/resmgr.hxx> #include <poolfmt.hxx> #ifndef _RDIC_HRC diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index 2fb1676d5b..de37b13d76 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,8 +33,8 @@ #ifdef DEBUG #include <tools/string.hxx> -#include <svtools/poolitem.hxx> -#include <svtools/itemiter.hxx> +#include <svl/poolitem.hxx> +#include <svl/itemiter.hxx> #include <string> #include <map> #include <node.hxx> @@ -551,7 +551,7 @@ String lcl_dbg_out(const SwNode & rNode) aTmpStr += String::CreateFromInt32(rNode.GetIndex()); aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US); -#ifndef PRODUCT +#ifdef DBG_UTIL aTmpStr += String(" serial=\"", RTL_TEXTENCODING_ASCII_US); aTmpStr += String::CreateFromInt32(rNode.GetSerial()); aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US); @@ -743,7 +743,7 @@ void lcl_dbg_nodes_inner(String & aStr, SwNodes & rNodes, ULONG & nIndex) SwNode * pEndNode = NULL; if (pStartNode != NULL) pEndNode = pStartNode->EndOfSectionNode(); - + ULONG nCount = rNodes.Count(); ULONG nStartIndex = nIndex; diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index c52b387ba9..7789021939 100644..100755 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -46,8 +46,11 @@ #include <comphelper/processfactory.hxx> #include <tools/urlobj.hxx> #include <tools/poly.hxx> +#include <tools/multisel.hxx> +#include <rtl/ustring.hxx> #include <vcl/virdev.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> +#include <unotools/syslocale.hxx> #include <sfx2/printer.hxx> #include <svx/keepitem.hxx> #include <svx/cscoitem.hxx> @@ -56,6 +59,8 @@ #include <svx/forbiddencharacterstable.hxx> #include <svx/svdmodel.hxx> #include <unotools/charclass.hxx> +#include <unotools/localedatawrapper.hxx> + #include <swmodule.hxx> #include <fmtpdsc.hxx> #include <fmtanchr.hxx> @@ -95,18 +100,22 @@ #include <fldupde.hxx> #include <swbaslnk.hxx> #include <printdata.hxx> +#include <swprtopt.hxx> #include <cmdid.h> // fuer den dflt - Printer in SetJob -#ifndef _STATSTR_HRC #include <statstr.hrc> // StatLine-String -#endif #include <comcore.hrc> #include <SwUndoTOXChange.hxx> #include <SwUndoFmt.hxx> #include <unocrsr.hxx> #include <docsh.hxx> -#include <docufld.hxx> +#include <docfld.hxx> // _SetGetExpFld +#include <docufld.hxx> // SwPostItField +#include <viewsh.hxx> +#include <shellres.hxx> +#include <txtfrm.hxx> #include <vector> +#include <map> #include <osl/diagnose.h> #include <osl/interlck.h> @@ -119,6 +128,8 @@ // <-- using namespace ::com::sun::star; +using ::rtl::OUString; + // Seiten-Deskriptoren SV_IMPL_PTRARR(SwPageDescs,SwPageDescPtr); @@ -1026,6 +1037,625 @@ const SwDocStat& SwDoc::GetDocStat() const return *pDocStat; } +/*************************************************************************/ + + +struct _PostItFld : public _SetGetExpFld +{ + _PostItFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld, const SwIndex* pIdx = 0 ) + : _SetGetExpFld( rNdIdx, pFld, pIdx ) {} + + USHORT GetPageNo( const StringRangeEnumerator &rRangeEnum, + const std::set< sal_Int32 > &rPossiblePages, + USHORT& rVirtPgNo, USHORT& rLineNo ); + + SwPostItField* GetPostIt() const + { + return (SwPostItField*) GetFld()->GetFld().GetFld(); + } +}; + + +USHORT _PostItFld::GetPageNo( + const StringRangeEnumerator &rRangeEnum, + const std::set< sal_Int32 > &rPossiblePages, + /* out */ USHORT& rVirtPgNo, /* out */ USHORT& rLineNo ) +{ + //Problem: Wenn ein PostItFld in einem Node steht, der von mehr als + //einer Layout-Instanz repraesentiert wird, steht die Frage im Raum, + //ob das PostIt nur ein- oder n-mal gedruck werden soll. + //Wahrscheinlich nur einmal, als Seitennummer soll hier keine Zufaellige + //sondern die des ersten Auftretens des PostIts innerhalb des selektierten + //Bereichs ermittelt werden. + rVirtPgNo = 0; + USHORT nPos = GetCntnt(); + SwClientIter aIter( (SwModify &)GetFld()->GetTxtNode() ); + for( SwTxtFrm* pFrm = (SwTxtFrm*)aIter.First( TYPE( SwFrm )); + pFrm; pFrm = (SwTxtFrm*)aIter.Next() ) + { + if( pFrm->GetOfst() > nPos || + (pFrm->HasFollow() && pFrm->GetFollow()->GetOfst() <= nPos) ) + continue; + USHORT nPgNo = pFrm->GetPhyPageNum(); + if( rRangeEnum.hasValue( nPgNo, &rPossiblePages )) + { + rLineNo = (USHORT)(pFrm->GetLineCount( nPos ) + + pFrm->GetAllLines() - pFrm->GetThisLines()); + rVirtPgNo = pFrm->GetVirtPageNum(); + return nPgNo; + } + } + return 0; +} + + +bool lcl_GetPostIts( + IDocumentFieldsAccess* pIDFA, + _SetGetExpFlds * pSrtLst ) +{ + bool bHasPostIts = false; + + SwFieldType* pFldType = pIDFA->GetSysFldType( RES_POSTITFLD ); + DBG_ASSERT( pFldType, "kein PostItType ? "); + + if( pFldType->GetDepends() ) + { + // Modify-Object gefunden, trage alle Felder ins Array ein + SwClientIter aIter( *pFldType ); + SwClient* pLast; + const SwTxtFld* pTxtFld; + + for( pLast = aIter.First( TYPE(SwFmtFld)); pLast; pLast = aIter.Next() ) + { + if( 0 != ( pTxtFld = ((SwFmtFld*)pLast)->GetTxtFld() ) && + pTxtFld->GetTxtNode().GetNodes().IsDocNodes() ) + { + bHasPostIts = true; + if (pSrtLst) + { + SwNodeIndex aIdx( pTxtFld->GetTxtNode() ); + _PostItFld* pNew = new _PostItFld( aIdx, pTxtFld ); + pSrtLst->Insert( pNew ); + } + else + break; // we just wanted to check for the existence of postits ... + } + } + } + + return bHasPostIts; +} + + +static void lcl_FormatPostIt( + IDocumentContentOperations* pIDCO, + SwPaM& aPam, + SwPostItField* pField, + bool bNewPage, bool bIsFirstPostIt, + USHORT nPageNo, USHORT nLineNo ) +{ + static char __READONLY_DATA sTmp[] = " : "; + + DBG_ASSERT( ViewShell::GetShellRes(), "missing ShellRes" ); + + if (bNewPage) + { + pIDCO->InsertPoolItem( aPam, SvxFmtBreakItem( SVX_BREAK_PAGE_AFTER, RES_BREAK ), 0 ); + pIDCO->SplitNode( *aPam.GetPoint(), false ); + } + else if (!bIsFirstPostIt) + { + // add an empty line between different notes + pIDCO->SplitNode( *aPam.GetPoint(), false ); + pIDCO->SplitNode( *aPam.GetPoint(), false ); + } + + String aStr( ViewShell::GetShellRes()->aPostItPage ); + aStr.AppendAscii(sTmp); + + aStr += XubString::CreateFromInt32( nPageNo ); + aStr += ' '; + if( nLineNo ) + { + aStr += ViewShell::GetShellRes()->aPostItLine; + aStr.AppendAscii(sTmp); + aStr += XubString::CreateFromInt32( nLineNo ); + aStr += ' '; + } + aStr += ViewShell::GetShellRes()->aPostItAuthor; + aStr.AppendAscii(sTmp); + aStr += pField->GetPar1(); + aStr += ' '; + SvtSysLocale aSysLocale; + aStr += /*(LocaleDataWrapper&)*/aSysLocale.GetLocaleData().getDate( pField->GetDate() ); + pIDCO->InsertString( aPam, aStr ); + + pIDCO->SplitNode( *aPam.GetPoint(), false ); + aStr = pField->GetPar2(); +#if defined( WIN ) || defined( WNT ) || defined( PM2 ) + // Bei Windows und Co alle CR rausschmeissen + aStr.EraseAllChars( '\r' ); +#endif + pIDCO->InsertString( aPam, aStr ); +} + + +void SwDoc::CalculatePagesForPrinting( + /* out */ SwRenderData &rData, + const SwPrintUIOptions &rOptions, + bool bIsPDFExport, + sal_Int32 nDocPageCount ) +{ + DBG_ASSERT( pLayout, "no layout present" ); + if (!pLayout) + return; + + // properties to take into account when calcualting the set of pages + // (PDF export UI does not allow for selecting left or right pages only) + bool bPrintLeftPages = bIsPDFExport ? true : rOptions.IsPrintLeftPages(); + bool bPrintRightPages = bIsPDFExport ? true : rOptions.IsPrintRightPages(); + bool bPrintEmptyPages = rOptions.IsPrintEmptyPages( bIsPDFExport ); + + Range aPages( 1, nDocPageCount ); + + MultiSelection aMulti( aPages ); + aMulti.SetTotalRange( Range( 0, RANGE_MAX ) ); + aMulti.Select( aPages ); + + const SwPageFrm *pStPage = (SwPageFrm*)pLayout->Lower(); + const SwFrm *pEndPage = pStPage; + + USHORT nFirstPageNo = 0; + USHORT nLastPageNo = 0; + USHORT nPageNo = 1; + + for( USHORT i = 1; i <= (USHORT)aPages.Max(); ++i ) + { + if( i < (USHORT)aPages.Min() ) + { + if( !pStPage->GetNext() ) + break; + pStPage = (SwPageFrm*)pStPage->GetNext(); + pEndPage= pStPage; + } + else if( i == (USHORT)aPages.Min() ) + { + nFirstPageNo = i; + nLastPageNo = nFirstPageNo; + if( !pStPage->GetNext() || (i == (USHORT)aPages.Max()) ) + break; + pEndPage = pStPage->GetNext(); + } + else if( i > (USHORT)aPages.Min() ) + { + nLastPageNo = i; + if( !pEndPage->GetNext() || (i == (USHORT)aPages.Max()) ) + break; + pEndPage = pEndPage->GetNext(); + } + } + + DBG_ASSERT( nFirstPageNo, "first page not found! Should not happen!" ); + if (nFirstPageNo) + { +// HACK: Hier muss von der MultiSelection noch eine akzeptable Moeglichkeit +// geschaffen werden, alle Seiten von Seite x an zu deselektieren. +// Z.B. durch SetTotalRange .... + +// aMulti.Select( Range( nLastPageNo+1, SELECTION_MAX ), FALSE ); + MultiSelection aTmpMulti( Range( 1, nLastPageNo ) ); + long nTmpIdx = aMulti.FirstSelected(); + static long nEndOfSelection = SFX_ENDOFSELECTION; + while ( nEndOfSelection != nTmpIdx && nTmpIdx <= long(nLastPageNo) ) + { + aTmpMulti.Select( nTmpIdx ); + nTmpIdx = aMulti.NextSelected(); + } + aMulti = aTmpMulti; +// Ende des HACKs + + nPageNo = nFirstPageNo; + + std::set< sal_Int32 > &rValidPages = rData.GetValidPagesSet(); + std::map< sal_Int32, const SwPageFrm * > &rValidStartFrms = rData.GetValidStartFrames(); + rValidPages.clear(); + rValidStartFrms.clear(); + while ( pStPage ) + { + const BOOL bRightPg = pStPage->OnRightPage(); + if ( aMulti.IsSelected( nPageNo ) && + ( (bRightPg && bPrintRightPages) || + (!bRightPg && bPrintLeftPages) ) ) + { + // --> FME 2005-12-12 #b6354161# Feature - Print empty pages + if ( bPrintEmptyPages || pStPage->Frm().Height() ) + // <-- + { + // pStPage->GetUpper()->Paint( pStPage->Frm() ); + rValidPages.insert( nPageNo ); + rValidStartFrms[ nPageNo ] = pStPage; + } + } + + if ( pStPage == pEndPage ) + { + pStPage = 0; + } + else + { ++nPageNo; + pStPage = (SwPageFrm*)pStPage->GetNext(); + } + } + } + + + // + // now that we have identified the valid pages for printing according + // to the print settings we need to get the PageRange to use and + // use both results to get the actual pages to be printed + // (post-it settings need to be taken into account later on!) + // + + // get PageRange value to use + OUString aPageRange; + if (bIsPDFExport) + { + // ?? rOptions.getValue( C2U("Selection") ); + aPageRange = rOptions.getStringValue( "PageRange", OUString() ); + } + else + { + // PageContent : + // 0 -> print all pages (default if aPageRange is empty) + // 1 -> print range according to PageRange + // 2 -> print selection + const sal_Int32 nContent = rOptions.getIntValue( "PrintContent", 0 ); + if (1 == nContent) + aPageRange = rOptions.getStringValue( "PageRange", OUString() ); + if (2 == nContent) + { + // note that printing selections is actually implemented by copying + // the selection to a new temporary document and printing all of that one. + // Thus for Writer "PrintContent" must never be 2. + // See SwXTextDocument::GetRenderDoc for evaluating if a selection is to be + // printed and for creating the temporary document. + } + + // please note + } + if (aPageRange.getLength() == 0) // empty string -> print all + { + // set page range to print to 'all pages' + aPageRange = OUString::valueOf( (sal_Int32)1 ); + aPageRange += OUString::valueOf( (sal_Unicode)'-'); + aPageRange += OUString::valueOf( nDocPageCount ); + } + rData.SetPageRange( aPageRange ); + + // get vector of pages to print according to PageRange and valid pages set from above + // (result may be an empty vector, for example if the range string is not correct) + StringRangeEnumerator::getRangesFromString( + aPageRange, rData.GetPagesToPrint(), + 1, nDocPageCount, 0, &rData.GetValidPagesSet() ); +} + + +void SwDoc::UpdatePagesForPrintingWithPostItData( + /* out */ SwRenderData &rData, + const SwPrintUIOptions &rOptions, + bool /*bIsPDFExport*/, + sal_Int32 nDocPageCount ) +{ + + sal_Int16 nPostItMode = (sal_Int16) rOptions.getIntValue( "PrintAnnotationMode", 0 ); + DBG_ASSERT(nPostItMode == POSTITS_NONE || rData.HasPostItData(), + "print post-its without post-it data?" ); + const USHORT nPostItCount = rData.HasPostItData() ? rData.m_pPostItFields->Count() : 0; + if (nPostItMode != POSTITS_NONE && nPostItCount > 0) + { + SET_CURR_SHELL( rData.m_pPostItShell ); + + // clear document and move to end of it + SwPaM aPam( rData.m_pPostItDoc->GetNodes().GetEndOfContent() ); + aPam.Move( fnMoveBackward, fnGoDoc ); + aPam.SetMark(); + aPam.Move( fnMoveForward, fnGoDoc ); + rData.m_pPostItDoc->DeleteRange( aPam ); + + const StringRangeEnumerator aRangeEnum( rData.GetPageRange(), 1, nDocPageCount, 0 ); + + // For mode POSTITS_ENDPAGE: + // maps a physical page number to the page number in post-it document that holds + // the first post-it for that physical page . Needed to relate the correct start frames + // from the post-it doc to the physical page of the document + std::map< sal_Int32, sal_Int32 > aPostItLastStartPageNum; + + // add all post-its on valid pages within the the page range to the + // temporary post-it document. + // Since the array of post-it fileds is sorted by page and line number we will + // already get them in the correct order + USHORT nVirtPg = 0, nLineNo = 0, nLastPageNum = 0, nPhyPageNum = 0; + bool bIsFirstPostIt = true; + for (USHORT i = 0; i < nPostItCount; ++i) + { + _PostItFld& rPostIt = (_PostItFld&)*(*rData.m_pPostItFields)[ i ]; + nLastPageNum = nPhyPageNum; + nPhyPageNum = rPostIt.GetPageNo( + aRangeEnum, rData.GetValidPagesSet(), nVirtPg, nLineNo ); + if (nPhyPageNum) + { + // need to insert a page break? + // In POSTITS_ENDPAGE mode for each document page the following + // post-it page needs to start on a new page + const bool bNewPage = nPostItMode == POSTITS_ENDPAGE && + !bIsFirstPostIt && nPhyPageNum != nLastPageNum; + + lcl_FormatPostIt( rData.m_pPostItShell->GetDoc(), aPam, + rPostIt.GetPostIt(), bNewPage, bIsFirstPostIt, nVirtPg, nLineNo ); + bIsFirstPostIt = false; + + if (nPostItMode == POSTITS_ENDPAGE) + { + // get the correct number of current pages for the post-it document + rData.m_pPostItShell->CalcLayout(); + const sal_Int32 nPages = rData.m_pPostItDoc->GetPageCount(); + aPostItLastStartPageNum[ nPhyPageNum ] = nPages; + } + } + } + + // format post-it doc to get correct number of pages + rData.m_pPostItShell->CalcLayout(); + const sal_Int32 nPostItDocPageCount = rData.m_pPostItDoc->GetPageCount(); + + if (nPostItMode == POSTITS_ONLY || nPostItMode == POSTITS_ENDDOC) + { + // now add those post-it pages to the vector of pages to print + // or replace them if only post-its should be printed + + rData.GetPostItStartFrames().clear(); + if (nPostItMode == POSTITS_ENDDOC) + { + // set all values up to number of pages to print currently known to NULL, + // meaning none of the pages currently in the vector is from the + // post-it document, they are the documents pages. + rData.GetPostItStartFrames().resize( rData.GetPagesToPrint().size() ); + } + else if (nPostItMode == POSTITS_ONLY) + { + // no document page to be printed + rData.GetPagesToPrint().clear(); + } + + // now we just need to add the post-it pages to be printed to the end + // of the vector of pages to print and keep the GetValidStartFrames + // data conform with it + sal_Int32 nPageNum = 0; + const SwPageFrm * pPageFrm = (SwPageFrm*)rData.m_pPostItShell->GetLayout()->Lower(); + while( pPageFrm && nPageNum < nPostItDocPageCount ) + { + DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" ); + ++nPageNum; + rData.GetPagesToPrint().push_back( 0 ); // a page number of 0 indicates this page is from the post-it doc + DBG_ASSERT( pPageFrm, "pPageFrm is NULL!" ); + rData.GetPostItStartFrames().push_back( pPageFrm ); + pPageFrm = (SwPageFrm*)pPageFrm->GetNext(); + } + DBG_ASSERT( nPageNum == nPostItDocPageCount, "unexpected number of pages" ); + } + else if (nPostItMode == POSTITS_ENDPAGE) + { + // the next step is to find all the start frames from the post-it + // document that should be printed for a given physical page of the document + std::map< sal_Int32, std::vector< const SwPageFrm * > > aPhysPageToPostItFrames; + + // ... thus, first collect all post-it doc start frames in a vector + sal_Int32 nPostItPageNum = 0; + std::vector< const SwPageFrm * > aAllPostItStartFrames; + const SwPageFrm * pPageFrm = (SwPageFrm*)rData.m_pPostItShell->GetLayout()->Lower(); + while( pPageFrm && sal_Int32(aAllPostItStartFrames.size()) < nPostItDocPageCount ) + { + DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" ); + ++nPostItPageNum; + aAllPostItStartFrames.push_back( pPageFrm ); + pPageFrm = (SwPageFrm*)pPageFrm->GetNext(); + } + DBG_ASSERT( sal_Int32(aAllPostItStartFrames.size()) == nPostItDocPageCount, + "unexpected number of frames; does not match number of pages" ); + + // get a map that holds all post-it frames to be printed for a + // given physical page from the document + sal_Int32 nLastStartPageNum = 0; + std::map< sal_Int32, sal_Int32 >::const_iterator aIt; + for (aIt = aPostItLastStartPageNum.begin(); aIt != aPostItLastStartPageNum.end(); ++aIt) + { + const sal_Int32 nFrames = aIt->second - nLastStartPageNum; + const sal_Int32 nFirstStartPageNum = aIt == aPostItLastStartPageNum.begin() ? + 1 : aIt->second - nFrames + 1; + DBG_ASSERT( 1 <= nFirstStartPageNum && nFirstStartPageNum <= nPostItDocPageCount, + "page number for first frame out of range" ); + std::vector< const SwPageFrm * > aStartFrames; + for (sal_Int32 i = 0; i < nFrames; ++i) + { + const sal_Int32 nIdx = nFirstStartPageNum - 1 + i; // -1 because lowest page num is 1 + DBG_ASSERT( 0 <= nIdx && nIdx < sal_Int32(aAllPostItStartFrames.size()), + "index out of range" ); + aStartFrames.push_back( aAllPostItStartFrames[ nIdx ] ); + } + aPhysPageToPostItFrames[ aIt->first /* phys page num */ ] = aStartFrames; + nLastStartPageNum = aIt->second; + } + + + // ok, now that aPhysPageToPostItFrames can give the start frames for all + // post-it pages to be printed we need to merge those at the correct + // position into the GetPagesToPrint vector and build and maintain the + // GetValidStartFrames vector as well. + // Since inserting a larger number of entries in the middle of a vector + // isn't that efficient we will create new vectors by copying the required data + std::vector< sal_Int32 > aTmpPagesToPrint; + std::vector< const SwPageFrm * > aTmpPostItStartFrames; + const size_t nNum = rData.GetPagesToPrint().size(); + for (size_t i = 0 ; i < nNum; ++i) + { + // add the physical page to print from the document + const sal_Int32 nPhysPage = rData.GetPagesToPrint()[i]; + aTmpPagesToPrint.push_back( nPhysPage ); + aTmpPostItStartFrames.push_back( NULL ); + + // add the post-it document pages to print, i.e those + // post-it pages that have the data for the above physical page + const std::vector< const SwPageFrm * > &rPostItFrames = aPhysPageToPostItFrames[ nPhysPage ]; + const size_t nPostItFrames = rPostItFrames.size(); + for (size_t k = 0; k < nPostItFrames; ++k) + { + aTmpPagesToPrint.push_back( 0 ); + aTmpPostItStartFrames.push_back( rPostItFrames[k] ); + } + } + + // finally we need to assign those vectors to the resulting ones. + // swapping the data should be more efficient than assigning since + // we won't need the temporary vectors anymore + rData.GetPagesToPrint().swap( aTmpPagesToPrint ); + rData.GetPostItStartFrames().swap( aTmpPostItStartFrames ); + } + } +} + + +void SwDoc::CalculatePagePairsForProspectPrinting( + /* out */ SwRenderData &rData, + const SwPrintUIOptions &rOptions, + sal_Int32 nDocPageCount ) +{ + std::set< sal_Int32 > &rValidPagesSet = rData.GetValidPagesSet(); + std::map< sal_Int32, const SwPageFrm * > &rValidStartFrms = rData.GetValidStartFrames(); + std::vector< std::pair< sal_Int32, sal_Int32 > > &rPagePairs = rData.GetPagePairsForProspectPrinting(); + + rPagePairs.clear(); + rValidPagesSet.clear(); + rValidStartFrms.clear(); + + rtl::OUString aPageRange = rOptions.getStringValue( "PageRange", rtl::OUString() ); + StringRangeEnumerator aRange( aPageRange, 1, nDocPageCount, 0 ); + + DBG_ASSERT( pLayout, "no layout present" ); + if (!pLayout || aRange.size() <= 0) + return; + + const SwPageFrm *pStPage = (SwPageFrm*)pLayout->Lower(); + sal_Int32 i = 0; + for ( i = 1; pStPage && i < nDocPageCount; ++i ) + pStPage = (SwPageFrm*)pStPage->GetNext(); + if ( !pStPage ) // dann wars das + return; + + // currently for prospect printing all pages are valid to be printed + // thus we add them all to the respective map and set for later use + sal_Int32 nPageNum = 0; + const SwPageFrm *pPageFrm = (SwPageFrm*)pLayout->Lower(); + while( pPageFrm && nPageNum < nDocPageCount ) + { + DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" ); + ++nPageNum; + rValidPagesSet.insert( nPageNum ); + rValidStartFrms[ nPageNum ] = pPageFrm; + pPageFrm = (SwPageFrm*)pPageFrm->GetNext(); + } + DBG_ASSERT( nPageNum == nDocPageCount, "unexpected number of pages" ); + + // properties to take into account when calcualting the set of pages + // Note: here bPrintLeftPages and bPrintRightPages refer to the (virtual) resulting pages + // of the prospect! + bool bPrintLeftPages = rOptions.IsPrintLeftPages(); + bool bPrintRightPages = rOptions.IsPrintRightPages(); + bool bPrintProspectRTL = rOptions.getIntValue( "PrintProspectRTL", 0 ) ? true : false; + + // get pages for prospect printing according to the 'PageRange' + // (duplicates and any order allowed!) + std::vector< sal_Int32 > aPagesToPrint; + StringRangeEnumerator::getRangesFromString( + aPageRange, aPagesToPrint, 1, nDocPageCount, 0 ); + + // now fill the vector for calculating the page pairs with the start frames + // from the above obtained vector + std::vector< const SwPageFrm * > aVec; + for ( i = 0; i < sal_Int32(aPagesToPrint.size()); ++i) + { + const sal_Int32 nPage = aPagesToPrint[i]; + const SwPageFrm *pFrm = rValidStartFrms[ nPage ]; + aVec.push_back( pFrm ); + } + + // just one page is special ... + if ( 1 == aVec.size() ) + aVec.insert( aVec.begin() + 1, 0 ); // insert a second empty page + else + { + // now extend the number of pages to fit a multiple of 4 + // (4 'normal' pages are needed for a single prospect paper + // with back and front) + while( aVec.size() & 3 ) + aVec.push_back( 0 ); + } + + // dann sorge mal dafuer, das alle Seiten in der richtigen + // Reihenfolge stehen: + USHORT nSPg = 0, nEPg = aVec.size(), nStep = 1; + if ( 0 == (nEPg & 1 )) // ungerade gibt es nicht! + --nEPg; + + if ( !bPrintLeftPages ) + ++nStep; + else if ( !bPrintRightPages ) + { + ++nStep; + ++nSPg, --nEPg; + } + + // the number of 'virtual' pages to be printed + sal_Int32 nCntPage = (( nEPg - nSPg ) / ( 2 * nStep )) + 1; + + for ( USHORT nPrintCount = 0; nSPg < nEPg && + nPrintCount < nCntPage; ++nPrintCount ) + { + pStPage = aVec[ nSPg ]; + const SwPageFrm* pNxtPage = nEPg < aVec.size() ? aVec[ nEPg ] : 0; + + short nRtlOfs = bPrintProspectRTL ? 1 : 0; + if ( 0 == (( nSPg + nRtlOfs) & 1 ) ) // switch for odd number in LTR, even number in RTL + { + const SwPageFrm* pTmp = pStPage; + pStPage = pNxtPage; + pNxtPage = pTmp; + } + + sal_Int32 nFirst = -1, nSecond = -1; + for ( int nC = 0; nC < 2; ++nC ) + { + sal_Int32 nPage = -1; + if ( pStPage ) + nPage = pStPage->GetPhyPageNum(); + if (nC == 0) + nFirst = nPage; + else + nSecond = nPage; + + pStPage = pNxtPage; + } + rPagePairs.push_back( std::pair< sal_Int32, sal_Int32 >(nFirst, nSecond) ); + + nSPg = nSPg + nStep; + nEPg = nEPg - nStep; + } + DBG_ASSERT( size_t(nCntPage) == rPagePairs.size(), "size mismatch for number of page pairs" ); + + // luckily prospect printing does not make use of post-its so far, + // thus we are done here. +} + + sal_uInt16 SwDoc::GetPageCount() const { return GetRootFrm() ? GetRootFrm()->GetPageNum() : 0; diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx index a6c6d2ab8a..e5e0aa84a7 100644 --- a/sw/source/core/doc/docdde.cxx +++ b/sw/source/core/doc/docdde.cxx @@ -41,7 +41,7 @@ #include <tools/urlobj.hxx> #define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svx/linkmgr.hxx> // LinkManager #include <unotools/charclass.hxx> #include <fmtcntnt.hxx> diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 88176f79c8..91cca2add7 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -39,6 +39,7 @@ #include "svx/frmdiritem.hxx" #include <tools/urlobj.hxx> #include <sfx2/docfile.hxx> +#include <sfx2/printer.hxx> #include <unotools/localedatawrapper.hxx> #include <com/sun/star/document/PrinterIndependentLayout.hpp> #include <fmtfsize.hxx> @@ -70,7 +71,7 @@ #include <fldbas.hxx> #include <swwait.hxx> #include <GetMetricVal.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #ifndef _STATSTR_HRC #include <statstr.hrc> #endif diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index a73f274b48..048b87904d 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -250,7 +250,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView ) SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj); // --> OD 2005-08-16 #i53320# -#ifndef PRODUCT +#ifdef DBG_UTIL SwAnchoredDrawObject* pAnchoredDrawObj = static_cast<SwAnchoredDrawObject*>(pContact->GetAnchoredObj( pObj )); ASSERT( bGroupMembersNotPositioned == pAnchoredDrawObj->NotYetPositioned(), diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index fbe304a9a8..50baa4b4a9 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ #include <tools/datetime.hxx> #ifndef _SVSTDARR_HXX #define _SVSTDARR_ULONGS -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #endif #include <vcl/svapp.hxx> #include <vcl/svapp.hxx> @@ -596,7 +596,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) { if( aPara.CalcWithStackOverflow() ) pFld->CalcField( aPara ); -#ifndef PRODUCT +#ifdef DBG_UTIL else { // mind. ein ASSERT @@ -664,7 +664,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) { if( aPara.CalcWithStackOverflow() ) pFml->Calc( aPara, nValue ); -#ifndef PRODUCT +#ifdef DBG_UTIL else { // mind. ein ASSERT @@ -902,7 +902,7 @@ void _SetGetExpFld::SetBodyPos( const SwCntntFrm& rFrm ) SwNodeIndex aIdx( *rFrm.GetNode() ); SwDoc& rDoc = *aIdx.GetNodes().GetDoc(); SwPosition aPos( aIdx ); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( ::GetBodyTxtNode( rDoc, aPos, rFrm ), "wo steht das Feld" ); #else ::GetBodyTxtNode( rDoc, aPos, rFrm ); @@ -2546,7 +2546,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, USHORT nFldWhich ) { // einen Index fuers bestimmen vom TextNode anlegen SwPosition aPos( rDoc.GetNodes().GetEndOfPostIts() ); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" ); #else GetBodyTxtNode( rDoc, aPos, *pFrm ); @@ -2594,7 +2594,7 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd ) if( !pFrm ) break; -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" ); #else GetBodyTxtNode( rDoc, aPos, *pFrm ); diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 4f8f40af3e..21fdff6df1 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -33,7 +33,7 @@ #include <hintids.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/svdobj.hxx> #include <svx/svdpage.hxx> #include <svx/svdmodel.hxx> @@ -679,7 +679,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // Continue with next selected object and assert, if this isn't excepted. if ( !pContact ) { -#ifndef PRODUCT +#ifdef DBG_UTIL bool bNoUserCallExcepted = pObj->ISA(SwDrawVirtObj) && !static_cast<SwDrawVirtObj*>(pObj)->IsConnected(); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 2f091671f0..3033eaf9a2 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -37,20 +37,20 @@ #define _SVSTDARR_USHORTS #include <hintids.hxx> #include <rtl/logfile.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <sfx2/app.hxx> -#include <svtools/misccfg.hxx> #include <svx/tstpitem.hxx> #include <svx/eeitem.hxx> #include <svx/langitem.hxx> #include <svx/lrspitem.hxx> #include <svx/brkitem.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #ifndef _ZFORLIST_HXX //autogen #define _ZFORLIST_DECLARE_TABLE -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #endif #include <comphelper/processfactory.hxx> +#include <unotools/misccfg.hxx> #include <com/sun/star/i18n/WordType.hdl> #include <fmtpdsc.hxx> #include <fmthdft.hxx> @@ -2453,7 +2453,7 @@ void SwDoc::_CreateNumberFormatter() Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); pNumberFormatter = new SvNumberFormatter( xMSF, eLang ); pNumberFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL ); - pNumberFormatter->SetYear2000(static_cast<USHORT>(SFX_APP()->GetMiscConfig()->GetYear2000())); + pNumberFormatter->SetYear2000(static_cast<USHORT>(::utl::MiscCfg().GetYear2000())); } diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index a57b60c370..d3f3cbf535 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -34,9 +34,9 @@ #include <hintids.hxx> #include <unotools/tempfile.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/urihelper.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <sfx2/app.hxx> #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 7f52ac0115..ed6ba6187b 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -31,8 +31,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include <svtools/linguprops.hxx> -#include <svtools/lingucfg.hxx> +#include <unotools/linguprops.hxx> +#include <unotools/lingucfg.hxx> #include <com/sun/star/embed/EmbedStates.hpp> #include <hintids.hxx> #include <com/sun/star/util/XCloseable.hpp> @@ -208,7 +208,7 @@ SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet ) } break; -#ifndef PRODUCT +#ifdef DBG_UTIL case FLY_AT_PAGE: case FLY_AT_CHAR: case FLY_AT_FLY: @@ -1693,7 +1693,7 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt, SwTxtAttr * const pHnt = pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT, "Missing FlyInCnt-Hint." ); ASSERT( pHnt && ((SwFmtFlyCnt&)pHnt->GetFlyCnt()). @@ -1878,7 +1878,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) if (GetRootFrm()->IsNeedGrammarCheck()) { BOOL bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell(); - + sal_Bool bIsAutoGrammar = sal_False; SvtLinguConfig().GetProperty( ::rtl::OUString::createFromAscii( UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar; @@ -1886,7 +1886,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) if (bIsOnlineSpell && bIsAutoGrammar) StartGrammarChecking( *this ); } - + sal_uInt16 nFldUpdFlag; if( GetRootFrm()->IsIdleFormat() ) GetRootFrm()->GetCurrShell()->LayoutIdle(); diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 1944579c45..4fbc5f3b7d 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -46,15 +46,16 @@ #include <sfx2/printer.hxx> #include <sfx2/docfile.hxx> #include <sfx2/frame.hxx> +#include <sfx2/viewfrm.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <svx/svxids.hrc> #include <svx/svdogrp.hxx> #include <svx/linkmgr.hxx> #include <svx/forbiddencharacterstable.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/compatibility.hxx> -#include <svtools/lingucfg.hxx> +#include <svl/zforlist.hxx> +#include <unotools/compatibility.hxx> +#include <unotools/lingucfg.hxx> #include <svx/svdpage.hxx> #include <paratr.hxx> #include <fchrfmt.hxx> @@ -168,15 +169,33 @@ SV_IMPL_PTRARR( SwGrfFmtColls, SwGrfFmtCollPtr) void StartGrammarChecking( SwDoc &rDoc ) { - uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( rDoc.GetGCIterator() ); - if ( xGCIterator.is() ) + // check for a visible view + bool bVisible = false; + const SwDocShell *pDocShell = rDoc.GetDocShell(); + SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocShell, 0, sal_False ); + while (pFrame && !bVisible) { - uno::Reference< lang::XComponent > xDoc( rDoc.GetDocShell()->GetBaseModel(), uno::UNO_QUERY ); - uno::Reference< text::XFlatParagraphIteratorProvider > xFPIP( xDoc, uno::UNO_QUERY ); + if (pFrame->IsVisible()) + bVisible = true; + pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, 0, sal_False ); + } + + //!! only documents with visible views need to be checked + //!! (E.g. don't check temporary documents created for printing, see printing of notes and selections. + //!! Those get created on the fly and get hard deleted a bit later as well, and no one should have + //!! a uno reference to them) + if (bVisible) + { + uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( rDoc.GetGCIterator() ); + if ( xGCIterator.is() ) + { + uno::Reference< lang::XComponent > xDoc( rDoc.GetDocShell()->GetBaseModel(), uno::UNO_QUERY ); + uno::Reference< text::XFlatParagraphIteratorProvider > xFPIP( xDoc, uno::UNO_QUERY ); - // start automatic background checking if not active already - if ( xFPIP.is() && !xGCIterator->isProofreading( xDoc ) ) - xGCIterator->startProofreading( xDoc, xFPIP ); + // start automatic background checking if not active already + if ( xFPIP.is() && !xGCIterator->isProofreading( xDoc ) ) + xGCIterator->startProofreading( xDoc, xFPIP ); + } } } @@ -318,7 +337,7 @@ SwDoc::SwDoc() : mbInsOnlyTxtGlssry = mbContains_MSVBasic = mbKernAsianPunctuation = -#ifndef PRODUCT +#ifdef DBG_UTIL mbXMLExport = #endif // --> OD 2006-03-21 #b6375613# @@ -373,7 +392,7 @@ SwDoc::SwDoc() : // pMacroTable = new SvxMacroTableDtor; - + mpGrammarContact = ::createGrammarContact(); /* @@ -473,7 +492,7 @@ SwDoc::~SwDoc() // this assures that dipose gets called if there is need for it. aChartDataProviderImplRef.reset(); delete pChartControllerHelper; - + delete mpGrammarContact; mpGrammarContact = 0; @@ -1046,7 +1065,7 @@ SwDoc::GetMetaFieldManager() return *m_pMetaFieldManager; } -void SwDoc::InitTOXTypes() +void SwDoc::InitTOXTypes() { ShellResource* pShellRes = ViewShell::GetShellRes(); SwTOXType * pNew = new SwTOXType(TOX_CONTENT, pShellRes->aTOXContentName ); @@ -1103,7 +1122,7 @@ SwDoc* SwDoc::CreateCopy() const } if( aNewDefaults.Count() ) pRet->SetDefault( aNewDefaults ); - + /* pDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ), pEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, pDfltFrmFmt ) ), @@ -1240,7 +1259,7 @@ SwDoc* SwDoc::CreateCopy() const // by asking SvtCompatibilityOptions, see below. // const SvtCompatibilityOptions aOptions; - */ + */ pRet->mbParaSpaceMax = mbParaSpaceMax ; pRet->mbParaSpaceMaxAtPages = mbParaSpaceMaxAtPages ; pRet->mbTabCompat = mbTabCompat ; @@ -1266,20 +1285,20 @@ SwDoc* SwDoc::CreateCopy() const pRet->mbOldPrinterMetrics = mbOldPrinterMetrics ; pRet->mbTabRelativeToIndent = mbTabRelativeToIndent ; pRet->mbTabAtLeftIndentForParagraphsInList = mbTabAtLeftIndentForParagraphsInList ; - - // + + // // COMPATIBILITY FLAGS END // /* pMacroTable = new SvxMacroTableDtor; - + mpGrammarContact = ::createGrammarContact(); // Formate pFrmFmtTbl->Insert(pDfltFrmFmt, 0 ); pCharFmtTbl->Insert(pDfltCharFmt, 0 ); - // FmtColls + // FmtColls // TXT pTxtFmtCollTbl->Insert(pDfltTxtFmtColl, 0 ); // GRF @@ -1352,6 +1371,7 @@ SwDoc* SwDoc::CreateCopy() const ResetModified(); */ + pRet->ReplaceStyles( *(SwDoc*)this ); //copy content pRet->Paste( *this ); return pRet; @@ -1416,7 +1436,7 @@ void SwDoc::Paste( const SwDoc& rSource ) SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() ); if (FLY_AT_PAGE == aAnchor.GetAnchorId()) { - aAnchor.SetPageNum( aAnchor.GetPageNum() + /*nStartPageNumber - */1 ); + aAnchor.SetPageNum( aAnchor.GetPageNum() /*+ nStartPageNumber - */); } else continue; diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index e5a5e35f81..b1cbd29eb7 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -35,7 +35,7 @@ #include <hintids.hxx> #include <tools/shl.hxx> #ifndef _SFX_ITEMITER_HXX //autogen -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #endif #include <sfx2/app.hxx> #include <svx/colritem.hxx> @@ -59,7 +59,7 @@ using namespace com::sun::star; TYPEINIT1(SwRedlineHint, SfxHint); -#ifdef PRODUCT +#ifndef DBG_UTIL #define _CHECK_REDLINE( pDoc ) #define _DEBUG_REDLINE( pDoc ) @@ -310,7 +310,7 @@ Verhalten von Delete-Redline: bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) { #if 0 -// #i93179# disabled: ASSERT in ~SwIndexReg #ifndef PRODUCT +// #i93179# disabled: ASSERT in ~SwIndexReg #ifdef DBG_UTIL SwRedline aCopy( *pNewRedl ); #endif bool bError = true; @@ -3698,7 +3698,7 @@ void SwRedline::SetContentIdx( const SwNodeIndex* pIdx ) delete pCntntSect, pCntntSect = 0; bIsVisible = FALSE; } -#ifndef PRODUCT +#ifdef DBG_UTIL else ASSERT( !this, "das ist keine gueltige Operation" ); #endif diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index a117df7d1c..67fd5c7288 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -36,7 +36,7 @@ #include <hintids.hxx> #define _SVSTDARR_STRINGSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svx/langitem.hxx> #include <svx/brkitem.hxx> #include <svx/tstpitem.hxx> diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 8a5115ca14..372dbba83e 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -48,7 +48,7 @@ //--> #outlinelevel added by zhaojianwei #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif //<--end diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 836ab14104..8d21b72435 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -397,7 +397,7 @@ USHORT SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc ) */ ASSERT( nWidth, "No browse width available" ); } -#ifndef PRODUCT +#ifdef DBG_UTIL else { // und wenn das auch nicht klappt, gibt es zur Zeit keine Breite @@ -1660,13 +1660,13 @@ static BOOL lcl_ResizeBox( const SwTableBox*& rpBox, void* pPara ) static BOOL lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara ) { USHORT *pWidth = (USHORT *)pPara; -#ifndef PRODUCT +#ifdef DBG_UTIL USHORT nOldWidth = *pWidth; #endif *pWidth = 0; ((SwTableLine *)rpLine)->GetTabBoxes().ForEach( &lcl_ResizeBox, pWidth ); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( !nOldWidth || Abs(*pWidth-nOldWidth) < COLFUZZY, "Zeilen einer Box sind unterschiedlich lang" ); #endif @@ -1777,7 +1777,7 @@ void SwHTMLTableLayout::SetWidths( BOOL bCallPass2, USHORT nAbsAvail, } } -#ifndef PRODUCT +#ifdef DBG_UTIL { // steht im tblrwcl.cxx extern void _CheckBoxWidth( const SwTableLine&, SwTwips ); diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 8784290172..2e9bfcb732 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -39,7 +39,7 @@ #include <vcl/svapp.hxx> #include <svtools/imapobj.hxx> #include <svtools/imap.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <svtools/soerr.hxx> #include <sfx2/progress.hxx> #include <sfx2/docfile.hxx> @@ -269,7 +269,7 @@ void lcl_ClearArea( const SwFrm &rFrm, |* *************************************************************************/ -void SwNoTxtFrm::Paint( const SwRect &rRect ) const +void SwNoTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ ) const { if ( Frm().IsEmpty() ) return; @@ -804,27 +804,27 @@ void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, Out { if(!pOut) return; - Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() );
- Rectangle aNewPxRect( aPxRect );
- while( aNewPxRect.Left() < aPxRect.Left() )
- {
- rAlignedGrfArea.Left( rAlignedGrfArea.Left()+1 );
- aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
- }
- while( aNewPxRect.Top() < aPxRect.Top() )
- {
- rAlignedGrfArea.Top( rAlignedGrfArea.Top()+1 );
- aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
- }
- while( aNewPxRect.Bottom() > aPxRect.Bottom() )
- {
- rAlignedGrfArea.Bottom( rAlignedGrfArea.Bottom()-1 );
- aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
- }
- while( aNewPxRect.Right() > aPxRect.Right() )
- {
- rAlignedGrfArea.Right( rAlignedGrfArea.Right()-1 );
- aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
+ Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() ); + Rectangle aNewPxRect( aPxRect ); + while( aNewPxRect.Left() < aPxRect.Left() ) + { + rAlignedGrfArea.Left( rAlignedGrfArea.Left()+1 ); + aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() ); + } + while( aNewPxRect.Top() < aPxRect.Top() ) + { + rAlignedGrfArea.Top( rAlignedGrfArea.Top()+1 ); + aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() ); + } + while( aNewPxRect.Bottom() > aPxRect.Bottom() ) + { + rAlignedGrfArea.Bottom( rAlignedGrfArea.Bottom()-1 ); + aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() ); + } + while( aNewPxRect.Right() > aPxRect.Right() ) + { + rAlignedGrfArea.Right( rAlignedGrfArea.Right()-1 ); + aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() ); } } @@ -861,13 +861,13 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons ::SwAlignGrfRect( &aAlignedGrfArea, *pOut ); } else //if( bIsChart ) - {
- //#i78025# charts own borders are not completely visible
- //the above pixel correction is not correct - at least not for charts
- //so a different pixel correction is choosen here
- //this might be a good idea for all other OLE objects also,
- //but as I cannot oversee the consequences I fix it only for charts for now
- lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
+ { + //#i78025# charts own borders are not completely visible + //the above pixel correction is not correct - at least not for charts + //so a different pixel correction is choosen here + //this might be a good idea for all other OLE objects also, + //but as I cannot oversee the consequences I fix it only for charts for now + lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut ); } if( pGrfNd ) diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 27c0145b35..7d45261f9c 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -64,7 +64,7 @@ #include <algorithm> // <-- // --> OD 2008-06-06 #i89178# -#include <svtools/saveopt.hxx> +#include <unotools/saveopt.hxx> // <-- // --> OD 2008-07-08 #i91400# #include <IDocumentListsAccess.hxx> @@ -478,7 +478,7 @@ const SwFmtVertOrient* SwNumFmt::GetGraphicOrientation() const } } -#ifndef PRODUCT +#ifdef DBG_UTIL long int SwNumRule::nInstances = 0; #endif @@ -512,7 +512,7 @@ SwNumRule::SwNumRule( const String& rNm, msDefaultListId() // <-- { -#ifndef PRODUCT +#ifdef DBG_UTIL nSerial = nInstances++; #endif @@ -632,7 +632,7 @@ SwNumRule::SwNumRule( const SwNumRule& rNumRule ) msDefaultListId( rNumRule.msDefaultListId ) // <-- { -#ifndef PRODUCT +#ifdef DBG_UTIL nSerial = nInstances++; #endif @@ -1317,6 +1317,7 @@ namespace numfunc @author OD */ virtual void Notify( const uno::Sequence<rtl::OUString>& aPropertyNames ); + virtual void Commit(); static SwDefBulletConfig* mpInstance; @@ -1487,6 +1488,10 @@ namespace numfunc InitFont(); } + void SwDefBulletConfig::Commit() + { + } + const String& GetDefBulletFontname() { return SwDefBulletConfig::getInstance()->GetFontname(); @@ -1562,6 +1567,7 @@ namespace numfunc @author OD */ virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames ); + virtual void Commit(); static SwNumberingUIBehaviorConfig* mpInstance; @@ -1596,6 +1602,8 @@ namespace numfunc return aPropNames; } + void SwNumberingUIBehaviorConfig::Commit() {} + void SwNumberingUIBehaviorConfig::LoadConfig() { com::sun::star::uno::Sequence<rtl::OUString> aPropNames = GetPropNames(); diff --git a/sw/source/core/doc/swstylemanager.cxx b/sw/source/core/doc/swstylemanager.cxx index 99fa615419..f2be9ef5ab 100644 --- a/sw/source/core/doc/swstylemanager.cxx +++ b/sw/source/core/doc/swstylemanager.cxx @@ -34,7 +34,7 @@ #include "swstylemanager.hxx" #include <hash_map> -#include <svtools/stylepool.hxx> +#include <svl/stylepool.hxx> #include <doc.hxx> #include <charfmt.hxx> #include <docary.hxx> diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 2dc28332f3..32beedc352 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,10 +37,10 @@ #include <tools/shl.hxx> #include <vcl/svapp.hxx> #include <sfx2/docfile.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/zformat.hxx> -#include <svtools/pathoptions.hxx> +#include <svl/urihelper.hxx> +#include <svl/zforlist.hxx> +#include <svl/zformat.hxx> +#include <unotools/pathoptions.hxx> #include <sfx2/app.hxx> #include <svx/dialmgr.hxx> #ifndef _SVX_DIALOGS_HRC diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index d41ac2ddbd..0982e9ade9 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -35,7 +35,7 @@ #include <hintids.hxx> #define _ZFORLIST_DECLARE_TABLE -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <frmfmt.hxx> #include <doc.hxx> #include <cntfrm.hxx> diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index e07062d5de..2f3fb01501 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -74,7 +74,7 @@ using namespace com::sun::star::uno; using namespace ::com::sun::star; -#ifdef PRODUCT +#ifndef DBG_UTIL #define CHECK_TABLE(t) #else #ifdef DEBUG @@ -197,7 +197,7 @@ BOOL lcl_DelOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam, typedef BOOL (*FN_lcl_SetBoxWidth)(SwTableLine*, CR_SetBoxWidth&, SwTwips, BOOL ); -#if !defined( PRODUCT ) || defined( JP_DEBUG ) +#if defined(DBG_UTIL) || defined( JP_DEBUG ) void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize ); @@ -3506,7 +3506,7 @@ void lcl_AjustLines( SwTableLine* pLine, CR_SetBoxWidth& rParam ) } } -#if !defined( PRODUCT ) || defined( JP_DEBUG ) +#if defined(DBG_UTIL) || defined( JP_DEBUG ) void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize ) { diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx index 4b194cb410..8cb750ea4a 100644 --- a/sw/source/core/doc/visiturl.cxx +++ b/sw/source/core/doc/visiturl.cxx @@ -33,7 +33,7 @@ #include <sfx2/docfile.hxx> -#include <svtools/inethist.hxx> +#include <svl/inethist.hxx> #include <fmtinfmt.hxx> #include <txtinet.hxx> #include <doc.hxx> diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 6adb15c039..68f1559055 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -59,7 +59,7 @@ #include <pagedesc.hxx> #include <poolfmt.hxx> #include <SwNodeNum.hxx> -#ifdef PRODUCT +#ifndef DBG_UTIL #define CHECK_TABLE(t) #else #ifdef DEBUG @@ -1327,7 +1327,7 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndConte aRedlRest.Restore(); -#ifndef PRODUCT +#ifdef DBG_UTIL { //JP 17.06.99: Bug 66973 - check count only if the selection is in // the same (or no) section. Becaus not full selected diff --git a/sw/source/core/docnode/ndindex.cxx b/sw/source/core/docnode/ndindex.cxx index 8e7c933b99..5d0e64f890 100644 --- a/sw/source/core/docnode/ndindex.cxx +++ b/sw/source/core/docnode/ndindex.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ #include "error.h" // fuers ASSERT #include "ndindex.hxx" -#ifndef PRODUCT +#ifdef DBG_UTIL int SwNodeIndex::nSerial = 0; #endif @@ -71,7 +71,7 @@ SwNodeIndex::SwNodeIndex( SwNodes& rNds, ULONG nIdx ) { rNds.RegisterIndex( *this ); -#ifndef PRODUCT +#ifdef DBG_UTIL MySerial = ++nSerial; // nur in der nicht PRODUCT-Version #endif } @@ -86,7 +86,7 @@ SwNodeIndex::SwNodeIndex( const SwNodeIndex& rIdx, long nDiff ) pNd = rIdx.pNd; pNd->GetNodes().RegisterIndex( *this ); -#ifndef PRODUCT +#ifdef DBG_UTIL MySerial = ++nSerial; // nur in der nicht PRODUCT-Version #endif } @@ -101,7 +101,7 @@ SwNodeIndex::SwNodeIndex( const SwNode& rNd, long nDiff ) pNd = (SwNode*)&rNd; pNd->GetNodes().RegisterIndex( *this ); -#ifndef PRODUCT +#ifdef DBG_UTIL MySerial = ++nSerial; // nur in der nicht PRODUCT-Version #endif } diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx index 4b94c1bf12..7bc5b9e721 100644 --- a/sw/source/core/docnode/ndnotxt.cxx +++ b/sw/source/core/docnode/ndnotxt.cxx @@ -34,7 +34,7 @@ #include <hintids.hxx> #include <tools/poly.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <svx/contdlg.hxx> #include <vcl/svapp.hxx> #include <docary.hxx> diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx index ef07ac70f6..15996c48a9 100644 --- a/sw/source/core/docnode/ndnum.cxx +++ b/sw/source/core/docnode/ndnum.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,7 +50,7 @@ BOOL SwOutlineNodes::Seek_Entry( const SwNodePtr rSrch, USHORT* pFndPos ) const //JP 17.03.98: aufgrund des Bug 48592 - wo unter anderem nach Undo/Redo // Nodes aus dem falschen NodesArray im OutlineArray standen, // jetzt mal einen Check eingebaut. -#ifndef PRODUCT +#ifdef DBG_UTIL { for( USHORT n = 1; n < nO; ++n ) if( &(*this)[ n-1 ]->GetNodes() != @@ -125,7 +125,7 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd) // die Gliederungs-Felder Updaten GetDoc()->GetSysFldType( RES_CHAPTERFLD )->UpdateFlds(); } -} +} //void SwNodes::UpdateOutlineNode( const SwNode& rNd, BYTE nOldLevel, //#outline level,removed by zhaojianwei // BYTE nNewLevel ) diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 5da8c44c3a..0b3bbc0b43 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -34,7 +34,7 @@ #include <hintids.hxx> #include <svx/linkmgr.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <tools/resid.hxx> #include <fmtcntnt.hxx> #include <fmtanchr.hxx> diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 18f1c50ae3..a98ec01f95 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -104,7 +104,7 @@ #include <fldupde.hxx> -#ifdef PRODUCT +#ifndef DBG_UTIL #define CHECK_TABLE(t) #else #ifdef DEBUG diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 94afa3dba5..84d709538a 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -339,7 +339,7 @@ USHORT SwNode::GetSectionLevel() const |* *******************************************************************/ -#ifndef PRODUCT +#ifdef DBG_UTIL long SwNode::nSerial = 0; #endif @@ -371,7 +371,7 @@ SwNode::SwNode( const SwNodeIndex &rWhere, const BYTE nNdType ) pStartOfSection = (SwStartNode*)this; } -#ifndef PRODUCT +#ifdef DBG_UTIL nMySerial = nSerial; nSerial++; #endif @@ -404,7 +404,7 @@ SwNode::SwNode( SwNodes& rNodes, ULONG nPos, const BYTE nNdType ) pStartOfSection = (SwStartNode*)this; } -#ifndef PRODUCT +#ifdef DBG_UTIL nMySerial = nSerial; nSerial++; #endif @@ -1477,7 +1477,6 @@ SwCntntNode *SwCntntNode::JoinPrev() // erfrage vom Modify Informationen BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const { - const SwNumRuleItem* pItem; switch( rInfo.Which() ) { case RES_AUTOFMT_DOCNODE: @@ -1507,18 +1506,6 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const // return TRUE; // <-- - case RES_GETLOWERNUMLEVEL: - if( IsTxtNode() && - 0 != ( pItem = (SwNumRuleItem*)GetNoCondAttr( - RES_PARATR_NUMRULE, TRUE )) && pItem->GetValue().Len() && - pItem->GetValue() == ((SwNRuleLowerLevel&)rInfo).GetName() && - ((SwTxtNode*)this)->GetActualListLevel() - > ((SwNRuleLowerLevel&)rInfo).GetLevel() ) - { - return FALSE; - } - break; - case RES_FINDNEARESTNODE: if( ((SwFmtPageDesc&)GetAttr( RES_PAGEDESC )).GetPageDesc() ) ((SwFindNearestNode&)rInfo).CheckNode( *this ); @@ -1570,7 +1557,7 @@ BOOL SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) } return bRet; } -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> BOOL SwCntntNode::SetAttr( const SfxItemSet& rSet ) { diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 069ea638bd..e437493f54 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -51,7 +51,7 @@ #include <tox.hxx> // InvalidateTOXMark #include <docsh.hxx> -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> extern BOOL CheckNodesRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd, BOOL bChkSection ); @@ -415,7 +415,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz, if( pFrmNd && !((SwCntntNode*)pFrmNd)->GetDepends() ) pFrmNd = 0; -#ifndef PRODUCT +#ifdef DBG_UTIL if( !pFrmNd ) ASSERT( !this, "ChgNode() - kein FrameNode gefunden" ); #endif diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 2d92d0e5b7..0706e3d888 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -34,8 +34,8 @@ #include <stdlib.h> #include <hintids.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> #include <svx/protitem.hxx> diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 589b745998..9ee5b8305c 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -44,7 +44,6 @@ #include <svx/svdviter.hxx> #include <svx/svdview.hxx> #include <svx/shapepropertynotifier.hxx> -// AW, OD 2004-04-30 #i28501# #include <svx/sdr/contact/objectcontactofobjlistpainter.hxx> #include <svx/sdr/contact/displayinfo.hxx> #include <fmtornt.hxx> @@ -67,23 +66,17 @@ #include <txtfrm.hxx> #include <editsh.hxx> #include <docary.hxx> - -// OD 2004-02-11 #110582#-2 #include <flyfrms.hxx> - -// OD 18.06.2003 #108784# -#include <algorithm> -// OD 2004-05-24 #i28701# #include <sortedobjs.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> - -// AW: For VCOfDrawVirtObj and stuff +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <svx/sdr/contact/viewcontactofvirtobj.hxx> #include <drawinglayer/primitive2d/transformprimitive2d.hxx> #include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> - #include <com/sun/star/text/WritingMode2.hpp> +#include <algorithm> + using namespace ::com::sun::star; @@ -2595,9 +2588,7 @@ void SwDrawVirtObj::RecalcBoundRect() basegfx::B2DPolyPolygon SwDrawVirtObj::TakeXorPoly() const { basegfx::B2DPolyPolygon aRetval(rRefObj.TakeXorPoly()); - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate(GetOffset().X(), GetOffset().Y()); - aRetval.transform(aMatrix); + aRetval.transform(basegfx::tools::createTranslateB2DHomMatrix(GetOffset().X(), GetOffset().Y())); return aRetval; } @@ -2605,9 +2596,7 @@ basegfx::B2DPolyPolygon SwDrawVirtObj::TakeXorPoly() const basegfx::B2DPolyPolygon SwDrawVirtObj::TakeContour() const { basegfx::B2DPolyPolygon aRetval(rRefObj.TakeContour()); - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate(GetOffset().X(), GetOffset().Y()); - aRetval.transform(aMatrix); + aRetval.transform(basegfx::tools::createTranslateB2DHomMatrix(GetOffset().X(), GetOffset().Y())); return aRetval; } diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index ce2c6067f3..1e4d252f06 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -196,7 +196,7 @@ namespace drawinglayer { namespace primitive2d { - class SwVirtFlyDrawObjPrimitive : public BasePrimitive2D + class SwVirtFlyDrawObjPrimitive : public BufferedDecompositionPrimitive2D { private: const SwVirtFlyDrawObj& mrSwVirtFlyDrawObj; @@ -204,13 +204,13 @@ namespace drawinglayer protected: // method which is to be used to implement the local decomposition of a 2D primitive - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: SwVirtFlyDrawObjPrimitive( const SwVirtFlyDrawObj& rSwVirtFlyDrawObj, const basegfx::B2DRange &rOuterRange) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), mrSwVirtFlyDrawObj(rSwVirtFlyDrawObj), maOuterRange(rOuterRange) { @@ -239,7 +239,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SwVirtFlyDrawObjPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence SwVirtFlyDrawObjPrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { Primitive2DSequence aRetval; @@ -269,7 +269,7 @@ namespace drawinglayer bool SwVirtFlyDrawObjPrimitive::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SwVirtFlyDrawObjPrimitive& rCompare = (SwVirtFlyDrawObjPrimitive&)rPrimitive; @@ -295,7 +295,7 @@ namespace drawinglayer getSwVirtFlyDrawObj().wrap_DoPaintObject(); // call parent - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } // provide unique ID diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index 3b03da30d0..11fb6bad6b 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,8 +32,8 @@ #include "precompiled_sw.hxx" #include <basic/basmgr.hxx> #include <svtools/imapobj.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/securityoptions.hxx> +#include <svl/urihelper.hxx> +#include <unotools/securityoptions.hxx> #include <vcl/help.hxx> #include <svx/svdview.hxx> #include <fmturl.hxx> diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx index af52b77336..ddafb79647 100644 --- a/sw/source/core/draw/drawdoc.cxx +++ b/sw/source/core/draw/drawdoc.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,9 +35,9 @@ #include <svx/svxids.hrc> #endif #include <tools/stream.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <sot/storage.hxx> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <svx/forbiddencharacterstable.hxx> #include <unotools/ucbstreamhelper.hxx> diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 70395b2fe4..48ab1530a4 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -38,7 +38,7 @@ #include <ctype.h> #include <hintids.hxx> -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <unotools/charclass.hxx> #include <svx/boxitem.hxx> #include <svx/lrspitem.hxx> diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index f12766f6ae..431887c0bf 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -60,7 +60,7 @@ #include <crsskip.hxx> #include <txtfrm.hxx> // SwTxtFrm #include <scriptinfo.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/ctloptions.hxx> #include <charfmt.hxx> // #i27615# #include <numrule.hxx> diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index 41879086d0..980bc00080 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -34,7 +34,7 @@ #include <osl/endian.h> #include <hintids.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <tools/cachestr.hxx> #include <doc.hxx> #include <pam.hxx> diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index b7c272f456..e2bf9d439e 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -283,7 +283,7 @@ const Graphic* SwEditShell::GetGraphic( BOOL bWait ) const if( pGrf->IsSwapOut() || ( pGrfNode->IsLinkedFile() && GRAPHIC_DEFAULT == pGrf->GetType() ) ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" ); #else pGrfNode->SwapIn( bWait ); @@ -294,7 +294,7 @@ const Graphic* SwEditShell::GetGraphic( BOOL bWait ) const { if ( pGrf->IsSwapOut() && !pGrfNode->IsLinkedFile() ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" ); #else pGrfNode->SwapIn( bWait ); @@ -726,7 +726,7 @@ Graphic SwEditShell::GetIMapGraphic() const if( rGrf.IsSwapOut() || ( ((SwGrfNode*)pNd)->IsLinkedFile() && GRAPHIC_DEFAULT == rGrf.GetType() ) ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( ((SwGrfNode*)pNd)->SwapIn( TRUE ) || !TRUE, "Grafik konnte nicht geladen werden" ); #else ((SwGrfNode*)pNd)->SwapIn( TRUE ); diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index b9d4523edb..e04d62c4f5 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -585,7 +585,7 @@ BOOL SwEditShell::IsProtectedOutlinePara() const } } } -#ifndef PRODUCT +#ifdef DBG_UTIL else { ASSERT(!this, "Cursor not on an outline node" ); diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index b4e6ceb991..7bc8f0e310 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -36,7 +36,7 @@ #include <hints.hxx> #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #ifndef _APP_HXX //autogen #include <vcl/svapp.hxx> diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index c4b81facd8..aade7c6041 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -38,7 +38,7 @@ #include <tools/urlobj.hxx> #include <svtools/txtcmp.hxx> #ifndef SVTOOLS_FSTATHELPER_HXX -#include <svtools/fstathelper.hxx> +#include <svl/fstathelper.hxx> #endif #include <sfx2/docfile.hxx> #include "svx/unolingu.hxx" diff --git a/sw/source/core/except/dbgloop.cxx b/sw/source/core/except/dbgloop.cxx index 2998d7728e..4d45f84001 100644 --- a/sw/source/core/except/dbgloop.cxx +++ b/sw/source/core/except/dbgloop.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#ifdef PRODUCT +#ifndef DBG_UTIL #error Wer fummelt denn an den makefiles rum? #endif #include <tools/stream.hxx> diff --git a/sw/source/core/except/makefile.mk b/sw/source/core/except/makefile.mk index 1000bcaab8..660eb8faf5 100644 --- a/sw/source/core/except/makefile.mk +++ b/sw/source/core/except/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -49,8 +49,7 @@ PRJPCH= CXXFILES = -.IF "$(product)"=="" -.IF "$(cap)"=="" +.IF "$(dbgutil)"!="" CXXFILES += \ errhdl.cxx \ dbgloop.cxx @@ -59,7 +58,6 @@ SLOFILES += \ $(SLO)$/errhdl.obj \ $(SLO)$/dbgloop.obj .ENDIF -.ENDIF # --- Tagets ------------------------------------------------------- .INCLUDE : target.mk diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 281de8b636..be59f24541 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -38,7 +38,7 @@ #define _SVSTDARR_ULONGS #include <hintids.hxx> -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svx/unolingu.hxx> #include <svx/langitem.hxx> #include <swtypes.hxx> diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index 442cbd5d1e..cd0b383173 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -34,7 +34,7 @@ #include <float.h> #include <sfx2/app.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <svx/pageitem.hxx> #include <svx/dataaccessdescriptor.hxx> #include <com/sun/star/sdbc/DataType.hpp> @@ -96,6 +96,10 @@ SwDBFieldType::SwDBFieldType(SwDoc* pDocPtr, const String& rNam, const SwDBData& sName += GetColumnName(); } //------------------------------------------------------------------------------ +SwDBFieldType::~SwDBFieldType() +{ +} +//------------------------------------------------------------------------------ SwFieldType* SwDBFieldType::Copy() const { diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 3d54971e41..35b4bf6331 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,31 +47,32 @@ #include <com/sun/star/text/UserFieldFormat.hpp> #include <com/sun/star/text/PageNumberType.hpp> #include <com/sun/star/text/ReferenceFieldPart.hpp> -#ifndef _COM_SUN_STAR_TEXT_FilenameDisplayFormat_HPP_ #include <com/sun/star/text/FilenameDisplayFormat.hpp> -#endif #include <com/sun/star/text/XDependentTextField.hpp> #include <com/sun/star/text/DocumentStatistic.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/util/Date.hpp> +#include <com/sun/star/util/Duration.hpp> #include <unotools/localedatawrapper.hxx> #include <svx/unolingu.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/types.hxx> #include <comphelper/string.hxx> #include <tools/urlobj.hxx> -#ifndef _APP_HXX //autogen #include <vcl/svapp.hxx> -#endif -#include <svtools/urihelper.hxx> -#include <svtools/useroptions.hxx> -#include <svtools/syslocale.hxx> +#include <svl/urihelper.hxx> +#include <unotools/useroptions.hxx> +#include <unotools/syslocale.hxx> +#include <svl/zforlist.hxx> #include <tools/time.hxx> #include <tools/datetime.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/util/Date.hpp> +#include <com/sun/star/util/DateTime.hpp> +#include <com/sun/star/util/Time.hpp> #include <tools/shl.hxx> #include <swmodule.hxx> @@ -90,9 +91,7 @@ #include <cntfrm.hxx> // #include <pam.hxx> #include <viewsh.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <shellres.hxx> #include <docufld.hxx> #include <flddat.hxx> @@ -100,18 +99,12 @@ #include <ndtxt.hxx> #include <expfld.hxx> #include <poolfmt.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif -#ifndef _UNOFLDMID_H #include <unofldmid.h> -#endif #include <swunohelper.hxx> -#ifndef _COMCORE_HRC #include <comcore.hrc> -#endif -#include <svx/outliner.hxx> +#include <svx/outliner.hxx> #include <svx/outlobj.hxx> #define URL_DECODE INetURLObject::DECODE_UNAMBIGUOUS @@ -1114,6 +1107,21 @@ SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const /* --------------------------------------------------------------------------- ---------------------------------------------------------------------------*/ +template<class T> +double lcl_TimeToDouble( const T& rTime ) +{ + const double fMilliSecondsPerDay = 86400000.0; + return ((rTime.Hours*3600000)+(rTime.Minutes*60000)+(rTime.Seconds*1000)+(rTime.HundredthSeconds*10)) / fMilliSecondsPerDay; +} + +template<class D> +double lcl_DateToDouble( const D& rDate, const Date& rNullDate ) +{ + long nDate = Date::DateToDays( rDate.Day, rDate.Month, rDate.Year ); + long nNullDate = Date::DateToDays( rNullDate.GetDay(), rNullDate.GetMonth(), rNullDate.GetYear() ); + return double( nDate - nNullDate ); +} + String SwDocInfoField::Expand() const { if ( ( nSubType & 0xFF ) == DI_CUSTOM ) @@ -1145,9 +1153,41 @@ String SwDocInfoField::Expand() const ::rtl::OUString sVal; uno::Reference < script::XTypeConverter > xConverter( comphelper::getProcessServiceFactory() ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), uno::UNO_QUERY ); - uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING ); - aNew >>= sVal; - const_cast<SwDocInfoField*>(this)->aContent = sVal; + util::Date aDate; + util::DateTime aDateTime; + util::Duration aDuration; + if( aAny >>= aDate) + { + SvNumberFormatter* pFormatter = pDocShell->GetDoc()->GetNumberFormatter(); + Date* pNullDate = pFormatter->GetNullDate(); + sVal = ExpandValue( lcl_DateToDouble<util::Date>( aDate, *pNullDate ), GetFormat(), GetLanguage()); + } + else if( aAny >>= aDateTime ) + { + double fDateTime = lcl_TimeToDouble<util::DateTime>( aDateTime ); + SvNumberFormatter* pFormatter = pDocShell->GetDoc()->GetNumberFormatter(); + Date* pNullDate = pFormatter->GetNullDate(); + fDateTime += lcl_DateToDouble<util::DateTime>( aDateTime, *pNullDate ); + sVal = ExpandValue( fDateTime, GetFormat(), GetLanguage()); + } + else if( aAny >>= aDuration ) + { + String sText(aDuration.Negative ? '-' : '+'); + sText += ViewShell::GetShellRes()->sDurationFormat; + sText.SearchAndReplace(String::CreateFromAscii( "%1"), String::CreateFromInt32( aDuration.Years ) ); + sText.SearchAndReplace(String::CreateFromAscii( "%2"), String::CreateFromInt32( aDuration.Months ) ); + sText.SearchAndReplace(String::CreateFromAscii( "%3"), String::CreateFromInt32( aDuration.Days ) ); + sText.SearchAndReplace(String::CreateFromAscii( "%4"), String::CreateFromInt32( aDuration.Hours ) ); + sText.SearchAndReplace(String::CreateFromAscii( "%5"), String::CreateFromInt32( aDuration.Minutes) ); + sText.SearchAndReplace(String::CreateFromAscii( "%6"), String::CreateFromInt32( aDuration.Seconds) ); + sVal = sText; + } + else + { + uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING ); + aNew >>= sVal; + } + ((SwDocInfoField*)this)->aContent = sVal; } } } @@ -1328,7 +1368,8 @@ BOOL SwDocInfoField::PutValue( const uno::Any& rAny, USHORT nWhichId ) SwHiddenTxtFieldType::SwHiddenTxtFieldType( sal_Bool bSetHidden ) : SwFieldType( RES_HIDDENTXTFLD ), bHidden( bSetHidden ) -{} +{ +} SwFieldType* SwHiddenTxtFieldType::Copy() const { @@ -1880,7 +1921,7 @@ sal_uInt32 SwPostItField::GetNumberOfParagraphs() const --------------------------------------------------*/ BOOL SwPostItField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { - switch( nWhichId ) + switch( nWhichId ) { case FIELD_PROP_PAR1: rAny <<= OUString(sAuthor); @@ -2318,7 +2359,7 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst ) { // einen sdbcx::Index fuers bestimmen vom TextNode anlegen SwPosition aPos( pDoc->GetNodes().GetEndOfPostIts() ); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( GetBodyTxtNode( *pDoc, aPos, *pFrm ), "wo steht das Feld" ); #else diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 930394256f..33861fb8de 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,8 +35,8 @@ // #include <math.h> #include <float.h> #include <rtl/math.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/zformat.hxx> +#include <svl/zforlist.hxx> +#include <svl/zformat.hxx> #include <svx/unolingu.hxx> #ifndef _UNOFLDMID_H #include <unofldmid.h> @@ -167,7 +167,7 @@ SwFieldType::SwFieldType( USHORT nWhichId ) DBG_CTOR( SwFieldType, 0 ); } -#ifndef PRODUCT +#ifdef DBG_UTIL SwFieldType::~SwFieldType() { @@ -213,7 +213,7 @@ SwField::~SwField() Beschreibung: Statt Umweg ueber den Typ --------------------------------------------------------------------*/ -#ifndef PRODUCT +#ifdef DBG_UTIL USHORT SwField::Which() const { ASSERT(pType, "Kein Typ vorhanden"); diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx index 648fb63539..f5d15510d8 100644 --- a/sw/source/core/fields/flddat.cxx +++ b/sw/source/core/fields/flddat.cxx @@ -33,7 +33,7 @@ // #include <math.h> #include <tools/datetime.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <com/sun/star/util/DateTime.hpp> #include <doc.hxx> #include <fldbas.hxx> diff --git a/sw/source/core/fields/flddropdown.cxx b/sw/source/core/fields/flddropdown.cxx index 357e1c842e..af36690bda 100644 --- a/sw/source/core/fields/flddropdown.cxx +++ b/sw/source/core/fields/flddropdown.cxx @@ -37,7 +37,7 @@ #include <algorithm> #define INCLUDED_ALGORITHM #endif -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #ifndef _UNOFLDMID_H #include <unofldmid.h> diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 7204947d1a..12062bb3fb 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -34,7 +34,7 @@ #define _SVSTDARR_USHORTSSORT #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <com/sun/star/text/ReferenceFieldPart.hpp> #include <com/sun/star/text/ReferenceFieldSource.hpp> #include <unotools/localedatawrapper.hxx> diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx index 870881dc21..32227567a7 100644 --- a/sw/source/core/fields/usrfld.cxx +++ b/sw/source/core/fields/usrfld.cxx @@ -32,8 +32,8 @@ #include "precompiled_sw.hxx" -#include <svtools/zforlist.hxx> -#include <svtools/zformat.hxx> +#include <svl/zforlist.hxx> +#include <svl/zformat.hxx> #include <svx/svdmodel.hxx> diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index faf212862b..e606befaf2 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ #include <vcl/graph.hxx> #include <sot/formats.hxx> #include <sot/storage.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/viewsh.hxx> #include <svx/xexch.hxx> diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx index 1e304cca24..8cca232fb4 100644 --- a/sw/source/core/frmedt/fedesc.cxx +++ b/sw/source/core/frmedt/fedesc.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -70,7 +70,7 @@ USHORT SwFEShell::GetPageDescCnt() const void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc ) { -#ifndef PRODUCT +#ifdef DBG_UTIL //Die SS veraendert keinen PageDesc, sondern setzt nur das Attribut. //Der Pagedesc muss im Dokument vorhanden sein! BOOL bFound = FALSE; diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 430962ff4e..267ec0eb09 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" #include <hintids.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svtools/imapobj.hxx> #include <svtools/soerr.hxx> #include <svx/protitem.hxx> @@ -218,7 +218,7 @@ sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet ) SwDoc* pDoc = (SwDoc*)rFmt.GetDoc(); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( !(nNew == FLY_AT_PAGE && (FLY_AT_PARA==nOld || FLY_AT_CHAR==nOld || FLY_AS_CHAR==nOld ) && pDoc->IsInHeaderFooter( rOldAnch.GetCntntAnchor()->nNode )), @@ -608,7 +608,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) SwRect aTmpRect( aRet, rAbsPos ); if( aTmpRect.HasArea() ) MakeVisible( aTmpRect ); -#ifndef PRODUCT +#ifdef DBG_UTIL //TODO: That doesn't seem to be intended if( Color(COL_TRANSPARENT) != GetOut()->GetLineColor() ) { diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx index d477118795..caabbee173 100644 --- a/sw/source/core/frmedt/feflyole.cxx +++ b/sw/source/core/frmedt/feflyole.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ #endif #include <sfx2/viewsh.hxx> #include <sfx2/app.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <sfx2/viewfrm.hxx> #include <sot/exchange.hxx> diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 6626da2420..f4efffd15a 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -33,9 +33,9 @@ #include <hintids.hxx> #include <vcl/salbtype.hxx> // FRound #include <tools/urlobj.hxx> -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #ifndef SVTOOLS_FSTATHELPER_HXX -#include <svtools/fstathelper.hxx> +#include <svl/fstathelper.hxx> #endif #include <svtools/imap.hxx> #include <svtools/filter.hxx> diff --git a/sw/source/core/inc/SwXTextDefaults.hxx b/sw/source/core/inc/SwXTextDefaults.hxx index 58d4567510..7a7426cbf6 100644 --- a/sw/source/core/inc/SwXTextDefaults.hxx +++ b/sw/source/core/inc/SwXTextDefaults.hxx @@ -36,7 +36,7 @@ #ifndef _COM_SUN_STAR_BEANS_XSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> #endif -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> class SwDoc; diff --git a/sw/source/core/inc/blink.hxx b/sw/source/core/inc/blink.hxx index 382a761fb1..8ca7dbbc99 100644 --- a/sw/source/core/inc/blink.hxx +++ b/sw/source/core/inc/blink.hxx @@ -37,7 +37,7 @@ class SwTxtFrm; #include <vcl/timer.hxx> #include <tools/gen.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> class SwBlinkPortion { diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx index b5740a9d36..f23470bb7c 100644 --- a/sw/source/core/inc/cellfrm.hxx +++ b/sw/source/core/inc/cellfrm.hxx @@ -51,7 +51,7 @@ public: virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - virtual void Paint( const SwRect& ) const; + virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; virtual void CheckDirection( BOOL bVert ); const SwTableBox *GetTabBox() const { return pTabBox; } diff --git a/sw/source/core/inc/dbg_lay.hxx b/sw/source/core/inc/dbg_lay.hxx index 16b778fc1d..f2be6d6d8c 100644 --- a/sw/source/core/inc/dbg_lay.hxx +++ b/sw/source/core/inc/dbg_lay.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -66,7 +66,7 @@ #define SNAP_FLYFRAMES 0x00000002 #define SNAP_TABLECONT 0x00000004 -#ifndef PRODUCT +#ifdef DBG_UTIL #include "swtypes.hxx" diff --git a/sw/source/core/inc/dbgloop.hxx b/sw/source/core/inc/dbgloop.hxx index 4c66bdd82f..eb446bb4df 100644 --- a/sw/source/core/inc/dbgloop.hxx +++ b/sw/source/core/inc/dbgloop.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #ifndef _DBGLOOP_HXX #define _DBGLOOP_HXX -#ifndef PRODUCT +#ifdef DBG_UTIL #include <tools/solar.h> diff --git a/sw/source/core/inc/docsort.hxx b/sw/source/core/inc/docsort.hxx index 8b3428fceb..d67ee8c102 100644 --- a/sw/source/core/inc/docsort.hxx +++ b/sw/source/core/inc/docsort.hxx @@ -30,7 +30,7 @@ #ifndef _SORT_HXX #define _SORT_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <ndindex.hxx> diff --git a/sw/source/core/inc/doctxm.hxx b/sw/source/core/inc/doctxm.hxx index 8db243ce3b..174c6225fa 100644 --- a/sw/source/core/inc/doctxm.hxx +++ b/sw/source/core/inc/doctxm.hxx @@ -31,7 +31,7 @@ #define _DOCTXM_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <tools/gen.hxx> #include <tox.hxx> #include <section.hxx> diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx index 9fc27ae2d0..d1144b0076 100644 --- a/sw/source/core/inc/drawfont.hxx +++ b/sw/source/core/inc/drawfont.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -97,11 +97,11 @@ class SwDrawTextInfo SwDrawTextInfo(); // nicht zulaessig public: -#ifndef PRODUCT +#ifdef DBG_UTIL BOOL bPos : 1; // These flags should control, that the appropriate BOOL bWrong : 1; // Set-function has been called before calling BOOL bGrammarCheck : 1; // the Get-function of a member - BOOL bSize : 1; + BOOL bSize : 1; BOOL bFnt : 1; BOOL bHyph : 1; BOOL bLeft : 1; @@ -160,7 +160,7 @@ public: bUpper = FALSE; bDrawSpace = FALSE; -#ifndef PRODUCT +#ifdef DBG_UTIL // these flags control, whether the matching member variables have // been set by using the Set-function before they may be accessed // by their Get-function: @@ -383,7 +383,7 @@ public: void SetPos( const Point &rNew ) { pPos = &rNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bPos = TRUE; #endif } @@ -391,7 +391,7 @@ public: void SetHyphPos( xub_StrLen *pNew ) { pHyphPos = pNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bHyph = TRUE; #endif } @@ -404,7 +404,7 @@ public: void SetWrong( const SwWrongList* pNew ) { pWrong = pNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bWrong = TRUE; #endif } @@ -412,7 +412,7 @@ public: void SetGrammarCheck( const SwWrongList* pNew ) { pGrammarCheck = pNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bGrammarCheck = TRUE; #endif } @@ -425,7 +425,7 @@ public: void SetSize( const Size &rNew ) { pSize = &rNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bSize = TRUE; #endif } @@ -433,7 +433,7 @@ public: void SetFont( SwFont* pNew ) { pFnt = pNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bFnt = TRUE; #endif } @@ -451,7 +451,7 @@ public: void SetOfst( xub_StrLen nNew ) { nOfst = nNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bOfst = TRUE; #endif } @@ -459,7 +459,7 @@ public: void SetLeft( long nNew ) { nLeft = nNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bLeft = TRUE; #endif } @@ -467,7 +467,7 @@ public: void SetRight( long nNew ) { nRight = nNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bRight = TRUE; #endif } @@ -475,7 +475,7 @@ public: void SetKanaDiff( long nNew ) { nKanaDiff = nNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bKana = TRUE; #endif } @@ -488,7 +488,7 @@ public: void SetAscent( USHORT nNew ) { nAscent = nNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bAscent = TRUE; #endif } @@ -510,7 +510,7 @@ public: nSpace = nNew; nSperren = 0; } -#ifndef PRODUCT +#ifdef DBG_UTIL bSpace = TRUE; bSperr = TRUE; #endif @@ -518,7 +518,7 @@ public: void SetNumberOfBlanks( xub_StrLen nNew ) { -#ifndef PRODUCT +#ifdef DBG_UTIL bNumberOfBlanks = TRUE; #endif nNumberOfBlanks = nNew; @@ -547,7 +547,7 @@ public: void SetUpper( BOOL bNew ) { bUpper = bNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bUppr = TRUE; #endif } @@ -555,7 +555,7 @@ public: void SetDrawSpace( BOOL bNew ) { bDrawSpace = bNew; -#ifndef PRODUCT +#ifdef DBG_UTIL bDrawSp = TRUE; #endif } diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index ed19901729..4de6f3d3d2 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -161,14 +161,14 @@ public: virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // erfrage vom Client Informationen virtual BOOL GetInfo( SfxPoolItem& ) const; - virtual void Paint( const SwRect& ) const; + virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; virtual Size ChgSize( const Size& aNewSize ); virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; virtual void CheckDirection( BOOL bVert ); virtual void Cut(); -#ifndef PRODUCT +#ifdef DBG_UTIL virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ); #endif diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx index 740ef9b992..d5d1c38494 100644 --- a/sw/source/core/inc/fntcache.hxx +++ b/sw/source/core/inc/fntcache.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ class SwFntCache : public SwCache public: inline SwFntCache() : SwCache(50,50 -#ifndef PRODUCT +#ifdef DBG_UTIL , ByteString( RTL_CONSTASCII_STRINGPARAM( "Globaler Font-Cache pFntCache" )) #endif diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 9a3503014a..5b84b1600a 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -29,7 +29,7 @@ ************************************************************************/ #ifndef _FRAME_HXX #define _FRAME_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include "swtypes.hxx" // fuer SwTwips #include "swrect.hxx" #include "calbck.hxx" // fuer SwClient @@ -56,6 +56,7 @@ class SvxBrushItem; class SwSelectionList; struct SwPosition; struct SwCrsrMoveState; +class SwPrtOptions; // --> OD 2004-07-06 #i28701# class SwSortedObjs; @@ -828,7 +829,7 @@ public: SwCrsrMoveState* = 0 ) const; virtual BOOL GetCharRect( SwRect &, const SwPosition&, SwCrsrMoveState* = 0 ) const; - virtual void Paint( const SwRect& ) const; + virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; // der "kurze Dienstweg" zwischen den Frames und der Formatierung. // Wer den void* falsch Casted ist selbst schuld! diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx index 0a1ac9c63f..8702569b98 100644 --- a/sw/source/core/inc/ftnfrm.hxx +++ b/sw/source/core/inc/ftnfrm.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -74,7 +74,7 @@ class SwFtnFrm: public SwLayoutFrm // --> OD 2005-05-18 #i49383# - control unlock of position of lower anchored objects. bool mbUnlockPosOfLowerObjs : 1; // <-- -#ifndef PRODUCT +#ifdef DBG_UTIL protected: virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); @@ -89,7 +89,7 @@ public: BOOL operator<( const SwTxtFtn* pTxtFtn ) const; -#ifdef PRODUCT +#ifndef DBG_UTIL const SwCntntFrm *GetRef() const { return pRef; } SwCntntFrm *GetRef() { return pRef; } #else diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx index 0a4be4c763..439c2e8b28 100644 --- a/sw/source/core/inc/layact.hxx +++ b/sw/source/core/inc/layact.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -218,13 +218,13 @@ class SwLayIdle BOOL bPageValid; // Konnte die Seite alles validiert werden? BOOL bAllValid; // Konnte alles validiert werden? -#ifndef PRODUCT +#ifdef DBG_UTIL BOOL bIndicator; #endif #ifdef _LAYACT_CXX -#ifndef PRODUCT +#ifdef DBG_UTIL void ShowIdle( ColorData eName ); #endif diff --git a/sw/source/core/inc/laycache.hxx b/sw/source/core/inc/laycache.hxx index 60414797b5..336d680835 100644 --- a/sw/source/core/inc/laycache.hxx +++ b/sw/source/core/inc/laycache.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -72,7 +72,7 @@ public: return pImpl; } void UnlockImpl() { --nLockCount; } -#ifndef PRODUCT +#ifdef DBG_UTIL sal_Bool CompareLayout( const SwDoc& rDoc ) const; #endif }; diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx index 840c1d0719..579acf1882 100644 --- a/sw/source/core/inc/layfrm.hxx +++ b/sw/source/core/inc/layfrm.hxx @@ -108,7 +108,7 @@ public: SwLayoutFrm( SwFrmFmt* ); ~SwLayoutFrm(); - virtual void Paint( const SwRect& ) const; + virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; const SwFrm *Lower() const { return pLower; } SwFrm *Lower() { return pLower; } const SwCntntFrm *ContainsCntnt() const; diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index dac9783874..9efae5c769 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -35,7 +35,7 @@ #ifndef _KEYCOD_HXX //autogen #include <vcl/keycod.hxx> #endif -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <IDocumentMarkAccess.hxx> #include <vector> diff --git a/sw/source/core/inc/noteurl.hxx b/sw/source/core/inc/noteurl.hxx index f39c1564d6..68909e562e 100644 --- a/sw/source/core/inc/noteurl.hxx +++ b/sw/source/core/inc/noteurl.hxx @@ -32,7 +32,7 @@ #define _NOTEURL_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <tools/string.hxx> #include "swrect.hxx" diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx index 5a61c352d5..10a9af2812 100644 --- a/sw/source/core/inc/notxtfrm.hxx +++ b/sw/source/core/inc/notxtfrm.hxx @@ -59,7 +59,7 @@ public: ~SwNoTxtFrm(); virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - virtual void Paint(const SwRect& ) const; + virtual void Paint(const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; virtual BOOL GetCharRect( SwRect &, const SwPosition&, SwCrsrMoveState* = 0) const; BOOL GetCrsrOfst(SwPosition* pPos, Point& aPoint, diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 38f0b8a723..fb9da90497 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -31,7 +31,7 @@ #define _PAGEFRM_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include "ftnboss.hxx" #include <tools/mempool.hxx> diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx index ee925015c5..899995a7df 100644 --- a/sw/source/core/inc/rootfrm.hxx +++ b/sw/source/core/inc/rootfrm.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -200,10 +200,10 @@ public: virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; - virtual void Paint( const SwRect& ) const; + virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); -#ifndef PRODUCT +#ifdef DBG_UTIL virtual void Cut(); virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ); #endif @@ -313,7 +313,7 @@ public: void InsertEmptySct( SwSectionFrm* pDel ); void DeleteEmptySct() { if( pDestroy ) _DeleteEmptySct(); } void RemoveFromList( SwSectionFrm* pSct ) { if( pDestroy ) _RemoveFromList( pSct ); } -#ifndef PRODUCT +#ifdef DBG_UTIL // Wird zur Zeit nur fuer ASSERTs benutzt: BOOL IsInDelList( SwSectionFrm* pSct ) const; // Ist der SectionFrm in der Liste enthalten? #endif diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx index 2724613464..9c875a8a70 100644 --- a/sw/source/core/inc/scriptinfo.hxx +++ b/sw/source/core/inc/scriptinfo.hxx @@ -34,7 +34,7 @@ #define _SVSTDARR_BYTES #define _SVSTDARR_USHORTS #define _SVSTDARR_XUB_STRLEN -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <i18npool/lang.h> #include <list> diff --git a/sw/source/core/inc/scrrect.hxx b/sw/source/core/inc/scrrect.hxx index 4031c1e967..e3827e1d17 100644 --- a/sw/source/core/inc/scrrect.hxx +++ b/sw/source/core/inc/scrrect.hxx @@ -30,7 +30,7 @@ #ifndef _SCRRECT_HXX #define _SCRRECT_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include "swrect.hxx" #include <swtypes.hxx> diff --git a/sw/source/core/inc/swblocks.hxx b/sw/source/core/inc/swblocks.hxx index a48ba1493f..c994dc8be9 100644 --- a/sw/source/core/inc/swblocks.hxx +++ b/sw/source/core/inc/swblocks.hxx @@ -35,7 +35,7 @@ #ifndef _DATE_HXX //autogen #include <tools/datetime.hxx> #endif -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> class SfxMedium; diff --git a/sw/source/core/inc/swcache.hxx b/sw/source/core/inc/swcache.hxx index cb356f871a..bc4f5d34ac 100644 --- a/sw/source/core/inc/swcache.hxx +++ b/sw/source/core/inc/swcache.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -60,7 +60,7 @@ * */ -#ifndef PRODUCT +#ifdef DBG_UTIL #ifndef _STRING_HXX //autogen #include <tools/string.hxx> #endif @@ -68,7 +68,7 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif class SwCacheObj; @@ -94,7 +94,7 @@ class SwCache : public SwCacheObjArr void DeleteObj( SwCacheObj *pObj ); -#ifndef PRODUCT +#ifdef DBG_UTIL ByteString aName; long nAppend; //Anzahl der Eintragungen durch Erweiterung. long nInsertFree; //Anzahl der Eintragungen auf freie Plaetze. @@ -116,7 +116,7 @@ class SwCache : public SwCacheObjArr public: //nur BYTE hineinstecken!!! -#ifndef PRODUCT +#ifdef DBG_UTIL SwCache( const USHORT nInitSize, const USHORT nGrowSize, const ByteString &rNm ); ~SwCache(); @@ -197,7 +197,7 @@ public: inline BOOL IsLocked() const { return 0 != nLock; } -#ifdef PRODUCT +#ifndef DBG_UTIL inline void Lock() { ++nLock; } inline void Unlock() { --nLock; } #else @@ -249,7 +249,7 @@ public: inline void SwCache::IncreaseMax( const USHORT nAdd ) { nCurMax = nCurMax + sal::static_int_cast< USHORT >(nAdd); -#ifndef PRODUCT +#ifdef DBG_UTIL ++nIncreaseMax; #endif } @@ -257,7 +257,7 @@ inline void SwCache::DecreaseMax( const USHORT nSub ) { if ( nCurMax > nSub ) nCurMax = nCurMax - sal::static_int_cast< USHORT >(nSub); -#ifndef PRODUCT +#ifdef DBG_UTIL ++nDecreaseMax; #endif } diff --git a/sw/source/core/inc/swfntcch.hxx b/sw/source/core/inc/swfntcch.hxx index e6e9859b9d..3f5c861d60 100644 --- a/sw/source/core/inc/swfntcch.hxx +++ b/sw/source/core/inc/swfntcch.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,7 +49,7 @@ class SwFontCache : public SwCache public: inline SwFontCache() : SwCache(50,50 -#ifndef PRODUCT +#ifdef DBG_UTIL , "Globaler AttributSet/Font-Cache pSwFontCache" #endif ) {} diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 68d031dab5..9cd9e16ac7 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -848,7 +848,7 @@ public: * class SvStatistics *************************************************************************/ -#ifdef PRODUCT +#ifndef DBG_UTIL #define SV_STAT(nWhich) #else diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx index b5ea4c82bc..7620848a9f 100644 --- a/sw/source/core/inc/tabfrm.hxx +++ b/sw/source/core/inc/tabfrm.hxx @@ -132,7 +132,7 @@ public: virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual BOOL GetInfo( SfxPoolItem &rHnt ) const; - virtual void Paint( const SwRect& ) const; + virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; virtual void CheckDirection( BOOL bVert ); virtual void Cut(); diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx index 62e71094ed..a909a02fd9 100644 --- a/sw/source/core/inc/tblrwcl.hxx +++ b/sw/source/core/inc/tblrwcl.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #define _TBLRWCL_HXX #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <vector> #include <swtypes.hxx> @@ -69,7 +69,7 @@ BOOL lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* pPara ); BOOL lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* pPara ); -#ifndef PRODUCT +#ifdef DBG_UTIL void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize ); #endif @@ -100,7 +100,7 @@ public: : aPosArr( 16, 16 ), aBoxes( 16, 16 ), pHst( pHist ), nMode( nMd ), nWidth( 0 ), bGetFromTop( bTop ), bGetValues( TRUE ) - + {} void AddBox( const SwTableBox& rBox ); diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index d5a6f67912..fa57b4aacf 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -296,7 +296,7 @@ public: void PaintExtraData( const SwRect & rRect ) const; //Seitennummer usw. SwRect Paint(); - virtual void Paint( const SwRect & ) const; + virtual void Paint( const SwRect &, const SwPrtOptions *pPrintData = NULL ) const; virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual sal_Bool GetInfo( SfxPoolItem & ) const; @@ -405,7 +405,7 @@ public: inline sal_Bool IsSwapped() const { return bIsSwapped; } // Hat der Frm eine lokale Fussnote (in diesem Frm bzw. Follow)? -#ifdef PRODUCT +#ifndef DBG_UTIL void CalcFtnFlag(); #else void CalcFtnFlag( xub_StrLen nStop = STRING_LEN );//Fuer den Test von SplitFrm diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index e4735c0e5c..84d0ac738d 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -57,6 +57,7 @@ struct SdrPaintProcRec; class SwAccessibleMap; class SdrObject; class Fraction; +class SwPrtOptions; // OD 12.12.2002 #103492# class SwPagePreviewLayout; // OD 15.01.2003 #103492# @@ -270,10 +271,11 @@ public: // direction at the outliner of the draw view for painting layers <hell> // and <heaven>. // OD 25.06.2003 #108784# - correct type of 1st parameter - void PaintLayer ( const SdrLayerID _nLayerID, - const SwRect& _rRect, - const Color* _pPageBackgrdColor = 0, - const bool _bIsPageRightToLeft = false ) const; + void PaintLayer( const SdrLayerID _nLayerID, + const SwPrtOptions *pPrintData, + const SwRect& _rRect, + const Color* _pPageBackgrdColor = 0, + const bool _bIsPageRightToLeft = false ) const; //wird als Link an die DrawEngine uebergeben, entscheidet was wie //gepaintet wird oder nicht. diff --git a/sw/source/core/inc/visiturl.hxx b/sw/source/core/inc/visiturl.hxx index 9b71ffeee8..59c7239959 100644 --- a/sw/source/core/inc/visiturl.hxx +++ b/sw/source/core/inc/visiturl.hxx @@ -33,7 +33,7 @@ -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> class SwDoc; class SwURLStateChanged : public SfxListener diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index ead6b57f1d..a8519847d2 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -118,7 +118,7 @@ // --> OD 2006-03-06 #125892# #include <HandleAnchorNodeChg.hxx> // <-- -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> using namespace ::com::sun::star; using ::rtl::OUString; @@ -683,7 +683,7 @@ void SwFmtPageDesc::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) //mich also bei meinem Format aus. //Dabei werden ich Deletet!!! if( IS_TYPE( SwFmt, pDefinedIn )) -#ifndef PRODUCT +#ifdef DBG_UTIL { sal_Bool bDel = ((SwFmt*)pDefinedIn)->ResetFmtAttr( RES_PAGEDESC ); ASSERT( bDel, ";-) FmtPageDesc nicht zerstoert." ); @@ -692,7 +692,7 @@ void SwFmtPageDesc::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) ((SwFmt*)pDefinedIn)->ResetFmtAttr( RES_PAGEDESC ); #endif else if( IS_TYPE( SwCntntNode, pDefinedIn )) -#ifndef PRODUCT +#ifdef DBG_UTIL { sal_Bool bDel = ((SwCntntNode*)pDefinedIn)->ResetAttr( RES_PAGEDESC ); ASSERT( bDel, ";-) FmtPageDesc nicht zerstoert." ); diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index ac438bf36c..02f901a3fc 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -849,7 +849,7 @@ void SwPageFrm::MakeAll() if ( Frm() != aOldRect && GetUpper() ) static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 ); -#ifndef PRODUCT +#ifdef DBG_UTIL //Der Upper (Root) muss mindestens so breit //sein, dass er die breiteste Seite aufnehmen kann. if ( GetUpper() ) @@ -1139,7 +1139,7 @@ void SwCntntFrm::MakeAll() // <-- PROTOCOL_ENTER( this, PROT_MAKEALL, 0, 0 ) -#ifndef PRODUCT +#ifdef DBG_UTIL const SwDoc *pDoc = GetAttrSet()->GetDoc(); if( pDoc ) { @@ -1695,7 +1695,7 @@ void SwCntntFrm::MakeAll() ( !bSct || !FindSctFrm()->IsColLocked() ) ) bMoveOrFit = TRUE; } -#ifndef PRODUCT +#ifdef DBG_UTIL else { ASSERT( FALSE, "+TxtFrm hat WouldFit-Versprechen nicht eingehalten." ); diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx index 6c5d9e6b66..35cf44542f 100644 --- a/sw/source/core/layout/dbg_lay.cxx +++ b/sw/source/core/layout/dbg_lay.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -106,7 +106,7 @@ * * --------------------------------------------------*/ -#ifdef PRODUCT +#ifndef DBG_UTIL #error Wer fummelt denn an den makefiles rum? #endif @@ -119,7 +119,7 @@ #define _SVSTDARR_USHORTS #define _SVSTDARR_USHORTSSORT #define _SVSTDARR_LONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <stdio.h> @@ -139,7 +139,7 @@ SwImplProtocol* SwProtocol::pImpl = NULL; ULONG lcl_GetFrameId( const SwFrm* pFrm ) { -#ifndef PRODUCT +#ifdef DBG_UTIL static BOOL bFrameId = FALSE; if( bFrameId ) return pFrm->GetFrmId(); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index cce759e58f..83909c17ed 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" #include "hintids.hxx" -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svtools/imap.hxx> #include <vcl/graph.hxx> #include <tools/poly.hxx> diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index b36cd2c176..61654a68c2 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -277,7 +277,7 @@ void SwFlyFreeFrm::MakeAll() } Unlock(); -#ifndef PRODUCT +#ifdef DBG_UTIL SWRECTFN( this ) ASSERT( bHeightClipped || ( (Frm().*fnRect->fnGetHeight)() > 0 && (Prt().*fnRect->fnGetHeight)() > 0), @@ -966,7 +966,7 @@ void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj ) } if ( !pSortedObjs->Insert( _rNewObj ) ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( pSortedObjs->Contains( _rNewObj ), "Drawing object not appended into list <pSortedObjs>." ); #endif diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index faa0122ba0..8593e53dee 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1695,7 +1695,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, delete pPageMaker; if( pDoc->GetLayoutCache() ) { -#ifndef PRODUCT +#ifdef DBG_UTIL #if OSL_DEBUG_LEVEL > 1 pDoc->GetLayoutCache()->CompareLayout( *pDoc ); #endif diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index be92d50f6a..d413deeb86 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -356,7 +356,7 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL ) //moeglich. //Wenn die Seite eine spezielle Fussnotenseite ist, so nehmen wir uns auch //soviel Platz wie eben moeglich. -#ifndef PRODUCT +#ifdef DBG_UTIL if ( !GetUpper() || !GetUpper()->IsFtnBossFrm() ) { ASSERT( !this, "Keine FtnBoss." ); return 0; @@ -562,7 +562,7 @@ void SwFtnFrm::InvalidateNxtFtnCnts( SwPageFrm *pPage ) } } -#ifndef PRODUCT +#ifdef DBG_UTIL SwTwips SwFtnFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) { @@ -711,7 +711,7 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) pDel->Cut(); delete pDel; } -#ifndef PRODUCT +#ifdef DBG_UTIL SwDoc *pDoc = GetFmt()->GetDoc(); if ( GetPrev() ) { @@ -1142,7 +1142,7 @@ SwFtnContFrm *SwFtnBossFrm::MakeFtnCont() //immer direkt hinter dem Bodytext. //Sein FrmFmt ist immer das DefaultFrmFmt. -#ifndef PRODUCT +#ifdef DBG_UTIL if ( FindFtnCont() ) { ASSERT( !this, "Fussnotencontainer bereits vorhanden." ); return 0; @@ -1171,7 +1171,7 @@ SwFtnContFrm *SwFtnBossFrm::FindFtnCont() while( pFrm && !pFrm->IsFtnContFrm() ) pFrm = pFrm->GetNext(); -#ifndef PRODUCT +#ifdef DBG_UTIL if ( pFrm ) { SwFrm *pFtn = pFrm->GetLower(); @@ -1416,7 +1416,7 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck ) void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew ) { -#if (OSL_DEBUG_LEVEL > 1) && !defined(PRODUCT) +#if (OSL_DEBUG_LEVEL > 1) && defined(DBG_UTIL) static USHORT nStop = 0; if ( nStop == pNew->GetFrmId() ) { @@ -3278,7 +3278,7 @@ SwSaveFtnHeight::~SwSaveFtnHeight() } -#ifndef PRODUCT +#ifdef DBG_UTIL //JP 15.10.2001: in a non pro version test if the attribute has the same // meaning which his reference is diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 2718e15a6c..5eb767a656 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -69,7 +69,7 @@ #include <SwSmartTagMgr.hxx> #define _SVSTDARR_BOOLS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #define _LAYACT_CXX #include "layact.hxx" @@ -116,7 +116,7 @@ //Sparen von Schreibarbeit um den Zugriff auf zerstoerte Seiten zu vermeiden. -#ifndef PRODUCT +#ifdef DBG_UTIL static void BreakPoint() { @@ -2808,7 +2808,7 @@ BOOL SwLayIdle::DoIdleJob( IdleJobType eJob, BOOL bVisAreaOnly ) } -#ifndef PRODUCT +#ifdef DBG_UTIL #if OSL_DEBUG_LEVEL > 1 /************************************************************************* @@ -2857,7 +2857,7 @@ void SwLayIdle::ShowIdle( ColorData eColorData ) SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) : pRoot( pRt ), pImp( pI ) -#ifndef PRODUCT +#ifdef DBG_UTIL #if OSL_DEBUG_LEVEL > 1 , bIndicator( FALSE ) #endif @@ -3041,7 +3041,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) : if( pImp->IsAccessible() ) pImp->FireAccessibleEvents(); -#ifndef PRODUCT +#ifdef DBG_UTIL #if OSL_DEBUG_LEVEL > 1 if ( bIndicator && pImp->GetShell()->GetWin() ) { diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index c4038bc414..767a16abb3 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -347,7 +347,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc ) } } -#ifndef PRODUCT +#ifdef DBG_UTIL sal_Bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const { sal_Bool bRet = sal_True; diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx index d488cfdbf4..0d8c5feaf1 100644 --- a/sw/source/core/layout/layhelp.hxx +++ b/sw/source/core/layout/layhelp.hxx @@ -34,7 +34,7 @@ #define _SVSTDARR_ULONGS #define _SVSTDARR_BYTES #define _SVSTDARR_XUB_STRLEN -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <swrect.hxx> diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx index ea3d8bfd91..99bb2a5763 100644 --- a/sw/source/core/layout/layouter.cxx +++ b/sw/source/core/layout/layouter.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -201,7 +201,7 @@ void SwLooping::Control( SwPageFrm* pPage ) } else if( ++nCount > LOOP_DETECT ) { -#ifndef PRODUCT +#ifdef DBG_UTIL #if OSL_DEBUG_LEVEL > 1 static BOOL bNoLouie = FALSE; if( bNoLouie ) diff --git a/sw/source/core/layout/makefile.mk b/sw/source/core/layout/makefile.mk index e2e8a2c282..234ee77c55 100644 --- a/sw/source/core/layout/makefile.mk +++ b/sw/source/core/layout/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -105,12 +105,10 @@ SLOFILES = \ $(SLO)$/virtoutp.obj \ $(SLO)$/wsfrm.obj -.IF "$(product)"=="" -.IF "$(cap)"=="" +.IF "$(dbgutil)"!="" SLOFILES += \ $(SLO)$/dbg_lay.obj .ENDIF -.ENDIF # --- Targets ------------------------------------------------------- diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 8ccadcf1de..3abc28b7e2 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -311,7 +311,7 @@ void _FrmInit() { SwRootFrm::pVout = new SwLayVout(); SwCache *pNew = new SwCache( 100, 100 -#ifndef PRODUCT +#ifdef DBG_UTIL , "static SwBorderAttrs::pCache" #endif ); @@ -322,7 +322,7 @@ void _FrmInit() void _FrmFinit() { -#ifndef PRODUCT +#ifdef DBG_UTIL // im Chache duerfen nur noch 0-Pointer stehen for( USHORT n = SwFrm::GetCachePtr()->Count(); n; ) if( (*SwFrm::GetCachePtr())[ --n ] ) diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index c36cb678a5..42f9208d6a 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -34,7 +34,7 @@ #include <com/sun/star/embed/EmbedStates.hpp> #include <ndole.hxx> #include <docary.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <fmtfsize.hxx> #include <fmthdft.hxx> #include <fmtclds.hxx> @@ -1194,7 +1194,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields ) if ( pPage->GetFmt() != pFmtWish ) pPage->SetFrmFmt( pFmtWish ); } -#ifndef PRODUCT +#ifdef DBG_UTIL else { ASSERT( FALSE, "CheckPageDescs, missing solution" ); @@ -1237,7 +1237,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields ) pDoc->UpdatePageFlds( &aMsgHnt ); } -#ifndef PRODUCT +#ifdef DBG_UTIL //Ein paar Pruefungen muessen schon erlaubt sein. //1. Keine zwei EmptyPages hintereinander. @@ -1668,7 +1668,7 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage ) { //Umhaengen kann er sich selbst, indem wir ihm //einfach ein Modify mit seinem AnkerAttr schicken. -#ifdef PRODUCT +#ifndef DBG_UTIL rFmt.SwModify::Modify( 0, (SwFmtAnchor*)&rAnch ); #else const sal_uInt32 nCnt = pPage->GetSortedObjs()->Count(); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 34b94415d5..3a2948a8be 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -41,7 +41,7 @@ #endif #include <tools/poly.hxx> #define _SVSTDARR_LONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svx/xoutbmp.hxx> #include <sfx2/progress.hxx> #include <svx/brshitem.hxx> @@ -1366,7 +1366,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage, continue; -#ifndef PRODUCT +#ifdef DBG_UTIL //Flys, die innerhalb des eigenen verankert sind, muessen eine //groessere OrdNum haben oder Zeichengebunden sein. if ( pSelfFly && bLowerOfSelf ) @@ -2052,7 +2052,7 @@ void lcl_AdjustRectToPixelSize( SwRect& io_aSwRect, const OutputDevice &aOut ) io_aSwRect = SwRect( aSizedRect ); -#ifndef PRODUCT +#ifdef DBG_UTIL Rectangle aTestOrgPxRect = aOut.LogicToPixel( io_aSwRect.SVRect() ); Rectangle aTestNewPxRect = aOut.LogicToPixel( aSizedRect ); ASSERT( aTestOrgPxRect == aTestNewPxRect, @@ -2740,7 +2740,7 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori ) |* |*************************************************************************/ -void SwRootFrm::Paint( const SwRect& rRect ) const +void SwRootFrm::Paint( const SwRect& rRect, const SwPrtOptions *pPrintData ) const { ASSERT( Lower() && Lower()->IsPageFrm(), "Lower der Root keine Seite." ); @@ -2939,7 +2939,7 @@ void SwRootFrm::Paint( const SwRect& rRect ) const // OD 29.08.2002 #102450# - add 3rd parameter // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess(); - pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), aPaintRect, + pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), pPrintData, aPaintRect, &aPageBackgrdColor, (pPage->IsRightToLeft() ? true : false) ); pLines->PaintLines( pSh->GetOut() ); pLines->LockLines( FALSE ); @@ -2972,7 +2972,7 @@ void SwRootFrm::Paint( const SwRect& rRect ) const { /// OD 29.08.2002 #102450# - add 3rd parameter // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. - pSh->Imp()->PaintLayer( pSh->GetDoc()->GetHeavenId(), aPaintRect, + pSh->Imp()->PaintLayer( pSh->GetDoc()->GetHeavenId(), pPrintData, aPaintRect, &aPageBackgrdColor, (pPage->IsRightToLeft() ? true : false) ); } @@ -3190,7 +3190,7 @@ SwShortCut::SwShortCut( const SwFrm& rFrm, const SwRect& rRect ) } } -void SwLayoutFrm::Paint( const SwRect& rRect ) const +void SwLayoutFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ ) const { ViewShell *pSh = GetShell(); @@ -3478,7 +3478,7 @@ BOOL SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh ) /************************************************************************* |* SwCellFrm::Paint( const SwRect& ) const |*************************************************************************/ -void SwCellFrm::Paint( const SwRect& rRect ) const +void SwCellFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ ) const { if ( GetLayoutRowSpan() >= 1 ) SwLayoutFrm::Paint( rRect ); @@ -3497,7 +3497,7 @@ void SwCellFrm::Paint( const SwRect& rRect ) const void MA_FASTCALL lcl_PaintLowerBorders( const SwLayoutFrm *pLay, const SwRect &rRect, const SwPageFrm *pPage ); -void SwFlyFrm::Paint( const SwRect& rRect ) const +void SwFlyFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ ) const { //wegen der Ueberlappung von Rahmen und Zeichenobjekten muessen die //Flys ihre Umrandung (und die der Innenliegenden) direkt ausgeben. @@ -3732,7 +3732,7 @@ void SwFlyFrm::Paint( const SwRect& rRect ) const |* |*************************************************************************/ -void SwTabFrm::Paint( const SwRect& rRect ) const +void SwTabFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ ) const { if ( pGlobalShell->GetViewOptions()->IsTable() ) { @@ -6438,10 +6438,10 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess(); - pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), + pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), 0, aRetouchePart, &aPageBackgrdColor, (pPage->IsRightToLeft() ? true : false) ); - pSh->Imp()->PaintLayer( pIDDMA->GetHeavenId(), + pSh->Imp()->PaintLayer( pIDDMA->GetHeavenId(), 0, aRetouchePart, &aPageBackgrdColor, (pPage->IsRightToLeft() ? true : false) ); } @@ -6691,14 +6691,14 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap ) // OD 30.08.2002 #102450# - add 3rd parameter // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess(); - pImp->PaintLayer( pIDDMA->GetHellId(), aOut, &aPageBackgrdColor, + pImp->PaintLayer( pIDDMA->GetHellId(), 0, aOut, &aPageBackgrdColor, (pFlyPage->IsRightToLeft() ? true : false) ); pLines->PaintLines( &aDev ); if ( pFly->IsFlyInCntFrm() ) pFly->Paint( aOut ); pLines->PaintLines( &aDev ); /// OD 30.08.2002 #102450# - add 3rd parameter - pImp->PaintLayer( pIDDMA->GetHeavenId(), aOut, &aPageBackgrdColor, + pImp->PaintLayer( pIDDMA->GetHeavenId(), 0, aOut, &aPageBackgrdColor, (pFlyPage->IsRightToLeft() ? true : false) ); pLines->PaintLines( &aDev ); DELETEZ( pLines ); diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 1c53fea46d..e06b2751b3 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <hints.hxx> #include <txtftn.hxx> #include <fmtftn.hxx> @@ -2781,7 +2781,7 @@ void SwRootFrm::_RemoveFromList( SwSectionFrm* pSct ) pDestroy->Remove( nPos ); } -#ifndef PRODUCT +#ifdef DBG_UTIL BOOL SwRootFrm::IsInDelList( SwSectionFrm* pSct ) const { diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 736070142c..21b78c69eb 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -411,7 +411,7 @@ SwFrm::~SwFrm() delete pDrawObjs; } -#ifndef PRODUCT +#ifdef DBG_UTIL // JP 15.10.2001: for detection of access to deleted frames pDrawObjs = (SwSortedObjs*)0x33333333; #endif diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index a7459e4818..ed95d13c43 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -48,7 +48,7 @@ #include "dbg_lay.hxx" #include <ftnidx.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <docary.hxx> #include <svx/keepitem.hxx> #include <svx/ulspitem.hxx> @@ -3648,7 +3648,7 @@ SwCntntFrm *SwTabFrm::FindLastCntnt() // Spalten abklappern, dies erledigt SwSectionFrm::FindLastCntnt if( pRet->IsColBodyFrm() ) { -#ifndef PRODUCT +#ifdef DBG_UTIL SwSectionFrm* pSect = pRet->FindSctFrm(); ASSERT( pSect, "Wo kommt denn die Spalte her?") ASSERT( IsAnLower( pSect ), "Gespaltene Zelle?" ); @@ -4615,7 +4615,7 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs ) { bValidSize = TRUE; -#ifndef PRODUCT +#ifdef DBG_UTIL if ( HasFixSize() ) { const SwFmtFrmSize &rFrmSize = GetFmt()->GetFrmSize(); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 0e7256351a..ba43b3a096 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1286,7 +1286,7 @@ const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint, break; } -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( pActual, "Keinen Cntnt gefunden." ); if ( bBodyOnly ) ASSERT( pActual->IsInDocBody(), "Cnt nicht im Body." ); diff --git a/sw/source/core/layout/unusedf.cxx b/sw/source/core/layout/unusedf.cxx index d501f6ea5d..bbbf10a090 100644 --- a/sw/source/core/layout/unusedf.cxx +++ b/sw/source/core/layout/unusedf.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,7 +44,7 @@ void SwFrm::Format( const SwBorderAttrs * ) ASSERT( FALSE, "Format() der Basisklasse gerufen." ); } -void SwFrm::Paint(const SwRect &) const +void SwFrm::Paint(const SwRect &, const SwPrtOptions * ) const { ASSERT( FALSE, "Paint() der Basisklasse gerufen." ); } @@ -67,7 +67,7 @@ BOOL SwFrm::GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* ) const return FALSE; } -#ifndef PRODUCT +#ifdef DBG_UTIL void SwRootFrm::Cut() { diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx index d7fef3a404..61877ab397 100644 --- a/sw/source/core/layout/virtoutp.cxx +++ b/sw/source/core/layout/virtoutp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,7 +42,7 @@ // OD 12.11.2002 #96272# - include declaration for <SetMappingForVirtDev> #include "setmapvirtdev.hxx" -#ifndef PRODUCT +#ifdef DBG_UTIL /************************************************************************* * class DbgRect @@ -186,7 +186,7 @@ void SwLayVout::Enter( ViewShell *pShell, SwRect &rRect, BOOL bOn ) { Flush(); -#ifndef PRODUCT +#ifdef DBG_UTIL if( pShell->GetViewOptions()->IsTest3() ) { ++nCount; diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 07eb1d2410..f2e0671866 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,7 +36,7 @@ #include <hints.hxx> #include <tools/pstm.hxx> #include <vcl/outdev.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/brshitem.hxx> #include <svx/keepitem.hxx> #include <svx/brkitem.hxx> @@ -99,8 +99,13 @@ SwFrm::SwFrm( SwModify *pMod ) : pNext( 0 ), pPrev( 0 ), pDrawObjs( 0 ) + , bInfBody( FALSE ) + , bInfTab ( FALSE ) + , bInfFly ( FALSE ) + , bInfFtn ( FALSE ) + , bInfSct ( FALSE ) { -#ifndef PRODUCT +#ifdef DBG_UTIL bFlag01 = bFlag02 = bFlag03 = bFlag04 = bFlag05 = 0; #endif @@ -3864,7 +3869,7 @@ void lcl_InvalidateCntnt( SwCntntFrm *pCnt, BYTE nInv ) if( pLastSctCnt == pCnt ) pLastSctCnt = NULL; } -#ifndef PRODUCT +#ifdef DBG_UTIL else ASSERT( !pLastSctCnt, "Where's the last SctCntnt?" ); #endif @@ -3892,7 +3897,7 @@ void lcl_InvalidateCntnt( SwCntntFrm *pCnt, BYTE nInv ) pLastSctCnt = NULL; } } -#ifndef PRODUCT +#ifdef DBG_UTIL else ASSERT( !pLastTabCnt, "Where's the last TabCntnt?" ); #endif diff --git a/sw/source/core/makefile.mk b/sw/source/core/makefile.mk index d9ea1102e3..d87e67b218 100644 --- a/sw/source/core/makefile.mk +++ b/sw/source/core/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -73,7 +73,7 @@ SUBLIBS3= \ $(SLB)$/SwNumberTree.lib \ $(SLB)$/tablecore.lib -.IF "$(PRODUCT)" == "" +.IF "$(dbgutil)"!="" SUBLIBS3+= \ $(SLB)$/except.lib .ENDIF diff --git a/sw/source/core/sw3io/sw3convert.cxx b/sw/source/core/sw3io/sw3convert.cxx index a6bafcce75..35a72dc8e2 100644 --- a/sw/source/core/sw3io/sw3convert.cxx +++ b/sw/source/core/sw3io/sw3convert.cxx @@ -38,15 +38,15 @@ #include <stdio.h> #include "hintids.hxx" #include <tools/resid.hxx> -#include <svtools/macitem.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/zformat.hxx> -#include <svtools/urihelper.hxx> +#include <svl/macitem.hxx> +#include <svl/zforlist.hxx> +#include <svl/zformat.hxx> +#include <svl/urihelper.hxx> #include <sfx2/linkmgr.hxx> #ifndef _SVSTDARR_USHORTS_DECL #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <svx/lrspitem.hxx> #include <svx/tstpitem.hxx> diff --git a/sw/source/core/swg/SwXMLSectionList.cxx b/sw/source/core/swg/SwXMLSectionList.cxx index ab1e097102..07a1781116 100644 --- a/sw/source/core/swg/SwXMLSectionList.cxx +++ b/sw/source/core/swg/SwXMLSectionList.cxx @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" #define _SVSTDARR_STRINGSDTOR #define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <SwXMLSectionList.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmlnmspe.hxx> diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx index 0c329ee5b3..8fff214edd 100644 --- a/sw/source/core/swg/SwXMLTextBlocks1.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <svtools/unoevent.hxx> #include <sfx2/docfile.hxx> #include <unotools/streamwrap.hxx> diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx index 9dae3794ba..f9f8f07f1c 100644 --- a/sw/source/core/swg/swblocks.cxx +++ b/sw/source/core/swg/swblocks.cxx @@ -36,9 +36,9 @@ #include <sot/storage.hxx> #include <tools/urlobj.hxx> #ifndef SVTOOLS_FSTATHELPER_HXX -#include <svtools/fstathelper.hxx> +#include <svl/fstathelper.hxx> #endif -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <unotools/charclass.hxx> #include <frmfmt.hxx> #include <doc.hxx> diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index 587914ae0b..cf1d6a8ed2 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,7 +50,7 @@ #include <svx/protitem.hxx> #include <swtblfmt.hxx> -#ifdef PRODUCT +#ifndef DBG_UTIL #define CHECK_TABLE(t) #else #ifdef DEBUG @@ -779,7 +779,7 @@ BOOL SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, aFndBox.MakeFrms( *this ); // aFndBox.RestoreChartData( *this ); -#ifndef PRODUCT +#ifdef DBG_UTIL { const SwTableBoxes &rTabBoxes = aLines[0]->GetTabBoxes(); long nNewWidth = 0; @@ -2147,7 +2147,7 @@ void SwTable::CleanUpBottomRowSpan( USHORT nDelLines ) } } -#ifndef PRODUCT +#ifdef DBG_UTIL struct RowSpanCheck { @@ -2181,7 +2181,7 @@ void SwTable::CheckConsistency() const if( nRowSp < 0 ) { ASSERT( aIter != aRowSpanCells.end(), "Missing master box" ) -#ifndef PRODUCT +#ifdef DBG_UTIL //RowSpanCheck &rCheck = *aIter; #endif ASSERT( aIter->nLeft == nWidth && aIter->nRight == nNewWidth, diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 0c4d018c51..edfacd4107 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -74,7 +74,7 @@ #include <redline.hxx> #include <list> -#ifdef PRODUCT +#ifndef DBG_UTIL #define CHECK_TABLE(t) #else #ifdef DEBUG @@ -876,7 +876,7 @@ void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm ) // Last line check: if ( pBox->GetUpper()->GetUpper() && pBox->GetUpper() != pBox->GetUpper()->GetUpper()->GetTabLines() - [pBox->GetUpper()->GetUpper()->GetTabLines().Count()-1]) + [pBox->GetUpper()->GetUpper()->GetTabLines().Count()-1]) { pBox = 0; } @@ -1090,7 +1090,7 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld, } } -#ifndef PRODUCT +#ifdef DBG_UTIL { // steht im tblrwcl.cxx extern void _CheckBoxWidth( const SwTableLine&, SwTwips ); @@ -1197,7 +1197,7 @@ static void lcl_CalcNewWidths( std::list<USHORT> &rSpanPos, ChangeList& rChanges USHORT nPos = (USHORT)nSum; while( pCurr != rChanges.end() && pCurr->first < nPos ) { -#ifndef PRODUCT +#ifdef DBG_UTIL USHORT nTemp = pCurr->first; nTemp = pCurr->second; #endif @@ -1297,7 +1297,7 @@ static void lcl_CalcNewWidths( std::list<USHORT> &rSpanPos, ChangeList& rChanges void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew, const SwTabCols &rOld, const SwTableBox *pStart, BOOL bCurRowOnly ) { -#ifndef PRODUCT +#ifdef DBG_UTIL static int nCallCount = 0; ++nCallCount; #endif @@ -2013,7 +2013,7 @@ BOOL SwTableBox::IsInHeadline( const SwTable* pTbl ) const return pTbl->GetTabLines()[ 0 ] == pLine; } -#ifndef PRODUCT +#ifdef DBG_UTIL ULONG SwTableBox::GetSttIdx() const { diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 77fd669521..5dd37c429e 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -42,7 +42,7 @@ #include <svx/langitem.hxx> #include <svx/scripttypeitem.hxx> #include <tools/urlobj.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <swatrset.hxx> #include <frmatr.hxx> #include <paratr.hxx> @@ -102,7 +102,7 @@ FrmTagIdMap SwEnhancedPDFExportHelper::aFrmTagIdMap; LanguageType SwEnhancedPDFExportHelper::eLanguageDefault = 0; -#ifndef PRODUCT +#ifdef DBG_UTIL static std::vector< USHORT > aStructStack; @@ -291,7 +291,7 @@ SwTaggedPDFHelper::SwTaggedPDFHelper( const Num_Info* pNumInfo, if ( mpPDFExtOutDevData && mpPDFExtOutDevData->GetIsExportTaggedPDF() ) { -#ifndef PRODUCT +#ifdef DBG_UTIL sal_Int32 nCurrentStruct = mpPDFExtOutDevData->GetCurrentStructureElement(); lcl_DBGCheckStack(); #endif @@ -304,7 +304,7 @@ SwTaggedPDFHelper::SwTaggedPDFHelper( const Num_Info* pNumInfo, else BeginTag( vcl::PDFWriter::NonStructElement, aEmptyString ); -#ifndef PRODUCT +#ifdef DBG_UTIL nCurrentStruct = mpPDFExtOutDevData->GetCurrentStructureElement(); lcl_DBGCheckStack(); #endif @@ -319,13 +319,13 @@ SwTaggedPDFHelper::~SwTaggedPDFHelper() { if ( mpPDFExtOutDevData && mpPDFExtOutDevData->GetIsExportTaggedPDF() ) { -#ifndef PRODUCT +#ifdef DBG_UTIL sal_Int32 nCurrentStruct = mpPDFExtOutDevData->GetCurrentStructureElement(); lcl_DBGCheckStack(); #endif EndStructureElements(); -#ifndef PRODUCT +#ifdef DBG_UTIL nCurrentStruct = mpPDFExtOutDevData->GetCurrentStructureElement(); lcl_DBGCheckStack(); #endif @@ -394,7 +394,7 @@ bool SwTaggedPDFHelper::CheckReopenTag() const bool bSuccess = mpPDFExtOutDevData->SetCurrentStructureElement( nReopenTag ); ASSERT( bSuccess, "Failed to reopen tag" ) -#ifndef PRODUCT +#ifdef DBG_UTIL aStructStack.push_back( 99 ); #endif @@ -417,7 +417,7 @@ bool SwTaggedPDFHelper::CheckRestoreTag() const (void)bSuccess; ASSERT( bSuccess, "Failed to restore reopened tag" ) -#ifndef PRODUCT +#ifdef DBG_UTIL aStructStack.pop_back(); #endif @@ -437,7 +437,7 @@ void SwTaggedPDFHelper::BeginTag( vcl::PDFWriter::StructElement eType, const Str const sal_Int32 nId = mpPDFExtOutDevData->BeginStructureElement( eType, rtl::OUString( rString ) ); ++nEndStructureElement; -#ifndef PRODUCT +#ifdef DBG_UTIL aStructStack.push_back( static_cast<USHORT>(eType) ); #endif @@ -497,7 +497,7 @@ void SwTaggedPDFHelper::EndTag() { mpPDFExtOutDevData->EndStructureElement(); -#ifndef PRODUCT +#ifdef DBG_UTIL aStructStack.pop_back(); #endif } @@ -973,7 +973,7 @@ void SwTaggedPDFHelper::BeginNumberedListStructureElements() nRestoreCurrentTag = mpPDFExtOutDevData->GetCurrentStructureElement(); mpPDFExtOutDevData->SetCurrentStructureElement( nReopenTag ); -#ifndef PRODUCT +#ifdef DBG_UTIL aStructStack.push_back( 99 ); #endif } @@ -1525,7 +1525,7 @@ SwEnhancedPDFExportHelper::SwEnhancedPDFExportHelper( SwEditShell& rSh, aNumListBodyIdMap.clear(); aFrmTagIdMap.clear(); -#ifndef PRODUCT +#ifdef DBG_UTIL aStructStack.clear(); #endif diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx index 4e89d45a19..23e2a0e8e2 100644 --- a/sw/source/core/text/atrstck.cxx +++ b/sw/source/core/text/atrstck.cxx @@ -34,7 +34,7 @@ #include <errhdl.hxx> // ASSERT #include <atrhndl.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <vcl/outdev.hxx> #include <svx/cmapitem.hxx> #include <svx/colritem.hxx> diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 2fb972d2be..33abb7b176 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -887,7 +887,7 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset, aCharBox.Pos().X() = aCharBox.Pos().X() - 150; // siehe Kommentar in SwTxtFrm::GetCrsrOfst() -#ifndef PRODUCT +#ifdef DBG_UTIL const ULONG nOldNode = pPam->GetPoint()->nNode.GetIndex(); #endif // Der Node soll nicht gewechselt werden @@ -1253,7 +1253,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, if( pNextLine || bFirstOfDouble ) { aCharBox.SSize().Width() /= 2; -#ifndef PRODUCT +#ifdef DBG_UTIL // siehe Kommentar in SwTxtFrm::GetCrsrOfst() const ULONG nOldNode = pPam->GetPoint()->nNode.GetIndex(); #endif diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 55ddcdadd9..d396a7e247 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -248,7 +248,7 @@ sal_Bool SwTxtFrm::CalcFollow( const xub_StrLen nTxtOfst ) ( pMyFollow->IsVertical() && !pMyFollow->Prt().Width() ) || ( ! pMyFollow->IsVertical() && !pMyFollow->Prt().Height() ) ) { -#ifndef PRODUCT +#ifdef DBG_UTIL const SwFrm *pOldUp = GetUpper(); #endif @@ -377,7 +377,7 @@ sal_Bool SwTxtFrm::CalcFollow( const xub_StrLen nTxtOfst ) pPage->ValidateCntnt(); } -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( pOldUp == GetUpper(), "SwTxtFrm::CalcFollow: heavy follow" ); #endif @@ -667,7 +667,7 @@ SwCntntFrm *SwTxtFrm::JoinFrm() } } -#ifndef PRODUCT +#ifdef DBG_UTIL else if ( pFoll->GetValidPrtAreaFlag() || pFoll->GetValidSizeFlag() ) { @@ -767,7 +767,7 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos ) } } -#ifndef PRODUCT +#ifdef DBG_UTIL else { CalcFtnFlag( nTxtPos-1 ); @@ -1843,7 +1843,7 @@ void SwTxtFrm::Format( const SwBorderAttrs * ) const SwFrm *pDbgFtnCont = (const SwFrm*)(FindPageFrm()->FindFtnCont()); (void)pDbgFtnCont; -#ifndef PRODUCT +#ifdef DBG_UTIL // nStopAt laesst sich vom CV bearbeiten. static MSHORT nStopAt = 0; if( nStopAt == GetFrmId() ) @@ -2089,7 +2089,7 @@ sal_Bool SwTxtFrm::FormatQuick( bool bForceQuickFormat ) const XubString aXXX = GetTxtNode()->GetTxt(); const SwTwips nDbgY = Frm().Top(); (void)nDbgY; -#ifndef PRODUCT +#ifdef DBG_UTIL // nStopAt laesst sich vom CV bearbeiten. static MSHORT nStopAt = 0; if( nStopAt == GetFrmId() ) @@ -2135,7 +2135,7 @@ sal_Bool SwTxtFrm::FormatQuick( bool bForceQuickFormat ) //DBG_LOOP; shadows declaration above. //resolved into: #if OSL_DEBUG_LEVEL > 1 -#ifndef PRODUCT +#ifdef DBG_UTIL DbgLoop aDbgLoop2( (const void*) this ); #endif #endif diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index d1f2416958..dde34d4215 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -600,7 +600,7 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const * SwTxtFrm::Paint() *************************************************************************/ -void SwTxtFrm::Paint( const SwRect &rRect ) const +void SwTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ ) const { ResetRepaint(); @@ -728,7 +728,7 @@ void SwTxtFrm::Paint( const SwRect &rRect ) const //DBG_LOOP; shadows declaration above. //resolved into: #if OSL_DEBUG_LEVEL > 1 -#ifndef PRODUCT +#ifdef DBG_UTIL DbgLoop aDbgLoop2( (const void*) this ); #endif #endif diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx index 049ea79078..b1c2eaefb5 100644 --- a/sw/source/core/text/guess.cxx +++ b/sw/source/core/text/guess.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -176,7 +176,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf, { nCutPos = rInf.GetTxtBreak( nLineWidth, nMaxLen, nMaxComp ); -#ifndef PRODUCT +#ifdef DBG_UTIL if ( STRING_LEN != nCutPos ) { rInf.GetTxtSize( &rSI, rInf.GetIdx(), nCutPos - rInf.GetIdx(), diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index b27a551ff7..f374020964 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -33,8 +33,8 @@ #include <com/sun/star/uno/Sequence.h> -#include <svtools/linguprops.hxx> -#include <svtools/lingucfg.hxx> +#include <unotools/linguprops.hxx> +#include <unotools/lingucfg.hxx> #include <hintids.hxx> #include <sfx2/printer.hxx> #include <svx/hyznitem.hxx> @@ -114,13 +114,13 @@ namespace numfunc } // <-- -#ifndef PRODUCT +#ifdef DBG_UTIL // Test2: WYSIWYG++ // Test4: WYSIWYG debug static sal_Bool bDbgLow = sal_False; #endif -#ifndef PRODUCT +#ifdef DBG_UTIL sal_Bool SwTxtSizeInfo::IsOptCalm() const { return !GetOpt().IsTest3(); } @@ -236,7 +236,7 @@ SwTxtInfo::SwTxtInfo( const SwTxtInfo &rInf ) { } -#ifndef PRODUCT +#ifdef DBG_UTIL /************************************************************************* * ChkOutDev() *************************************************************************/ @@ -288,7 +288,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew ) bSnapToGrid( rNew.SnapToGrid() ), nDirection( rNew.GetDirection() ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ChkOutDev( *this ); #endif } @@ -325,7 +325,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt, pRef = pOut; } -#ifndef PRODUCT +#ifdef DBG_UTIL ChkOutDev( *this ); #endif @@ -412,7 +412,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew, const XubString &rTxt, bSnapToGrid( rNew.SnapToGrid() ), nDirection( rNew.GetDirection() ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ChkOutDev( *this ); #endif SetLen( GetMinLen( *this ) ); @@ -570,7 +570,7 @@ void SwTxtPaintInfo::CtorInitTxtPaintInfo( SwTxtFrm *pFrame, const SwRect &rPain pGrammarCheckList = NULL; pSmartTags = NULL; // SMARTTAGS -#ifdef PRODUCT +#ifndef DBG_UTIL pBrushItem = 0; #else pBrushItem = ((SvxBrushItem*)-1); @@ -1156,7 +1156,7 @@ void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) } const int delta=10; Rectangle r(aIntersect.Left()+delta, aIntersect.Top()+delta, aIntersect.Right()-delta, aIntersect.Bottom()-delta); - pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); + pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); pOut->SetLineColor( Color(0, 0, 0)); pOut->SetFillColor(); pOut->DrawRect( r ); diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 450bb16947..c03a94d090 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -79,7 +79,7 @@ class SwWrongList; #define DIR_RIGHT2LEFT 2 #define DIR_TOP2BOTTOM 3 -#ifndef PRODUCT +#ifdef DBG_UTIL #define OPTCALM( rInf ) (rInf).IsOptCalm() #define OPTLOW( rInf ) (rInf).IsOptLow() #define OPTDBG( rInf ) (rInf).IsOptDbg() @@ -380,7 +380,7 @@ public: { return ( pKanaComp && nKanaIdx < pKanaComp->Count() ) ? (*pKanaComp)[nKanaIdx] : 0; } -#ifndef PRODUCT +#ifdef DBG_UTIL sal_Bool IsOptCalm() const; sal_Bool IsOptLow() const; sal_Bool IsOptDbg() const; @@ -415,7 +415,7 @@ class SwTxtPaintInfo : public SwTxtSizeInfo void _DrawText( const XubString &rText, const SwLinePortion &rPor, const xub_StrLen nIdx, const xub_StrLen nLen, const sal_Bool bKern, const sal_Bool bWrong = sal_False, - const sal_Bool bSmartTag = sal_False, + const sal_Bool bSmartTag = sal_False, const sal_Bool bGrammarCheck = sal_False ); // SMARTTAGS SwTxtPaintInfo &operator=(const SwTxtPaintInfo&); @@ -423,7 +423,7 @@ class SwTxtPaintInfo : public SwTxtSizeInfo void _DrawBackBrush( const SwLinePortion &rPor ) const; protected: -#ifdef PRODUCT +#ifndef DBG_UTIL SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pWrongList = 0; pSmartTags = 0; pSpaceAdd = 0; pBrushItem = 0;} #else SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pSmartTags = 0; pSpaceAdd = 0; @@ -508,7 +508,7 @@ public: inline void SetWrongList( const SwWrongList *pNew ){ pWrongList = pNew; } inline const SwWrongList* GetpWrongList() const { return pWrongList; } - + inline void SetGrammarCheckList( const SwWrongList *pNew ){ pGrammarCheckList = pNew; } inline const SwWrongList* GetGrammarCheckList() const { return pGrammarCheckList; } diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx index 2d7a670c85..80e877dccf 100644 --- a/sw/source/core/text/itratr.hxx +++ b/sw/source/core/text/itratr.hxx @@ -37,7 +37,7 @@ #define _SVSTDARR_XUB_STRLEN #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> class OutputDevice; class SwFont; diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 57dacd703a..40c5b05cd5 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -66,7 +66,7 @@ #include <doc.hxx> // SwDoc #include <pormulti.hxx> // SwMultiPortion #define _SVSTDARR_LONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <unotools/charclass.hxx> #if OSL_DEBUG_LEVEL > 1 @@ -101,6 +101,7 @@ void SwTxtFormatter::CtorInitTxtFormatter( SwTxtFrm *pNewFrm, SwTxtFormatInfo *p pMulti = NULL; bOnceMore = sal_False; + bFlyInCntBase = sal_False; bChanges = sal_False; bTruncLines = sal_False; nCntEndHyph = 0; @@ -2106,7 +2107,10 @@ long SwTxtFormatter::CalcOptRepaint( xub_StrLen nOldLineEnd, bool lcl_BuildHiddenPortion( const SwTxtSizeInfo& rInf, xub_StrLen &rPos ) { // Only if hidden text should not be shown: - if ( rInf.GetVsh() && rInf.GetVsh()->GetWin() && rInf.GetOpt().IsShowHiddenChar() ) +// if ( rInf.GetVsh() && rInf.GetVsh()->GetWin() && rInf.GetOpt().IsShowHiddenChar() ) + const bool bShowInDocView = rInf.GetVsh() && rInf.GetVsh()->GetWin() && rInf.GetOpt().IsShowHiddenChar(); + const bool bShowForPrinting = rInf.GetOpt().IsShowHiddenChar( TRUE ) && rInf.GetOpt().IsPrinting(); + if (bShowInDocView || bShowForPrinting) return false; const SwScriptInfo& rSI = rInf.GetParaPortion()->GetScriptInfo(); diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index 550b8fb291..3bed270774 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -103,7 +103,7 @@ void SwTxtPainter::CtorInitTxtPainter( SwTxtFrm *pNewFrm, SwTxtPaintInfo *pNewIn pInf = pNewInf; SwFont *pMyFnt = GetFnt(); GetInfo().SetFont( pMyFnt ); -#ifndef PRODUCT +#ifdef DBG_UTIL if( ALIGN_BASELINE != pMyFnt->GetAlign() ) { ASSERT( ALIGN_BASELINE == pMyFnt->GetAlign(), diff --git a/sw/source/core/text/makefile.mk b/sw/source/core/text/makefile.mk index fbc000002e..d710c97979 100644 --- a/sw/source/core/text/makefile.mk +++ b/sw/source/core/text/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -50,13 +50,6 @@ CFLAGS+=-DENABLE_GRAPHITE .ENDIF # --- Files -------------------------------------------------------- -.IF "$(product)$(cap)" == "" -CXXFILES += \ - txtio.cxx -.ENDIF - - - SLOFILES = \ $(SLO)$/atrstck.obj \ $(SLO)$/EnhancedPDFExportHelper.obj \ @@ -100,7 +93,7 @@ SLOFILES = \ $(SLO)$/SwGrammarMarkUp.obj \ $(SLO)$/wrong.obj -.IF "$(product)$(cap)" == "" +.IF "$(dbgutil)"!="" SLOFILES += \ $(SLO)$/txtio.obj .ENDIF diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx index b5a1372893..f207c80ad8 100644 --- a/sw/source/core/text/porglue.cxx +++ b/sw/source/core/text/porglue.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -114,7 +114,7 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const if( rInf.OnWin() && rInf.GetOpt().IsBlank() && rInf.IsNoSymbol() ) { -#ifndef PRODUCT +#ifdef DBG_UTIL const xub_Unicode cChar = rInf.GetChar( rInf.GetIdx() ); ASSERT( CH_BLANK == cChar || CH_BULLET == cChar, "SwGluePortion::Paint: blank expected" ); diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index b0e331db47..73ad538c74 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -195,7 +195,7 @@ sal_Bool lcl_ConnectToPrev( xub_Unicode cCh, xub_Unicode cPrevCh ) // to the left. So we look for the characters that are actually connectable // to the left. Here is the complete list of WH: - // (hennerdrewes): + // (hennerdrewes): // added lam forms 0x06B5..0x06B8 // added 0x6FA..0x6FC, according to unicode documentation, although not present in my fonts // added heh goal 0x6C1 @@ -210,7 +210,7 @@ sal_Bool lcl_ConnectToPrev( xub_Unicode cCh, xub_Unicode cPrevCh ) ( 0x6FA <= cPrevCh && cPrevCh <= 0x6FC ) ; // check for ligatures cPrevChar + cChar - if( bRet ) + if( bRet ) bRet = !lcl_IsLigature( cPrevCh, cCh ); return bRet; } @@ -1163,7 +1163,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) // after a Seen or Sad if (nPriorityLevel >= 1 && nIdx < nWordLen - 1) { - if( isSeenOrSadChar( cCh ) + if( isSeenOrSadChar( cCh ) && (rWord.GetChar( nIdx+1 ) != 0x200C) ) // #i98410#: prevent ZWNJ expansion { nKashidaPos = aScanner.GetBegin() + nIdx; @@ -1293,7 +1293,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) nLastKashida = nChg; }; -#ifndef PRODUCT +#ifdef DBG_UTIL // check kashida data long nTmpKashidaPos = -1; sal_Bool bWrongKash = sal_False; diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx index 4d757c7061..e2345e5ecf 100644 --- a/sw/source/core/text/porlay.hxx +++ b/sw/source/core/text/porlay.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -258,7 +258,7 @@ public: const SwLinePortion* _pDontConsiderPortion = NULL, const bool _bNoFlyCntPorAndLinePor = false ) const; -#ifndef PRODUCT +#ifdef DBG_UTIL void DebugPortions( SvStream &rOs, const XubString &rTxt, const xub_StrLen nStart ); //$ ostream #endif diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx index 1e866c8323..ba32938900 100644 --- a/sw/source/core/text/porlin.cxx +++ b/sw/source/core/text/porlin.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,7 +47,7 @@ #include "porglue.hxx" #include "inftxt.hxx" #include "blink.hxx" -#ifndef PRODUCT +#ifdef DBG_UTIL sal_Bool ChkChain( SwLinePortion *pStart ) { @@ -216,7 +216,7 @@ SwLinePortion *SwLinePortion::Insert( SwLinePortion *pIns ) { pIns->FindLastPortion()->SetPortion( pPortion ); SetPortion( pIns ); -#ifndef PRODUCT +#ifdef DBG_UTIL ChkChain( this ); #endif return pIns; @@ -247,7 +247,7 @@ SwLinePortion *SwLinePortion::Append( SwLinePortion *pIns ) SwLinePortion *pPos = FindLastPortion(); pPos->SetPortion( pIns ); pIns->SetPortion( 0 ); -#ifndef PRODUCT +#ifdef DBG_UTIL ChkChain( this ); #endif return pIns; @@ -307,7 +307,7 @@ SwPosSize SwLinePortion::GetTxtSize( const SwTxtSizeInfo & ) const return SwPosSize(); } -#ifndef PRODUCT +#ifdef DBG_UTIL /************************************************************************* * virtual SwLinePortion::Check() diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx index 9beb401c93..e21d07b9f4 100644 --- a/sw/source/core/text/porlin.hxx +++ b/sw/source/core/text/porlin.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,7 +42,7 @@ class SwPortionHandler; // Das CLASSIO-Makro implementiert die 'freischwebende' Funktion. // Auf diese Weise erhaelt man beide Vorteile: virtuelle Ausgabeoperatoren // und allgemeine Verwendbarkeit. -#ifndef PRODUCT +#ifdef DBG_UTIL #define OUTPUT_OPERATOR virtual SvStream &operator<<( SvStream & aOs ) const; #else #define OUTPUT_OPERATOR @@ -177,7 +177,7 @@ public: virtual void Paint( const SwTxtPaintInfo &rInf ) const = 0; void PrePaint( const SwTxtPaintInfo &rInf, const SwLinePortion *pLast ) const; -#ifndef PRODUCT +#ifdef DBG_UTIL virtual sal_Bool Check( SvStream &rOs, SwTxtSizeInfo &rInfo ); //$ ostream #endif diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 99aeaa49d7..0fa509e517 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -219,6 +219,7 @@ SwArrowPortion::SwArrowPortion( const SwTxtPaintInfo &rInf ) rInf.GetTxtFrm()->Prt().Right(); aPos.Y() = rInf.GetTxtFrm()->Frm().Top() + rInf.GetTxtFrm()->Prt().Bottom(); + SetWhichPor( POR_ARROW ); } void SwArrowPortion::Paint( const SwTxtPaintInfo &rInf ) const diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index 3a9a7a1072..2563b10615 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -33,7 +33,7 @@ #include "hintids.hxx" -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <tools/shl.hxx> #ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include <com/sun/star/i18n/ScriptType.hdl> diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx index 1a7316b61e..f172b4fa3e 100644 --- a/sw/source/core/text/redlnitr.hxx +++ b/sw/source/core/text/redlnitr.hxx @@ -39,7 +39,7 @@ #include "swfont.hxx" #ifndef _SVSTDARR_USHORTS #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif class SwTxtNode; diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index bea44790dc..4604129abf 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -85,7 +85,7 @@ #include <svx/svdoedge.hxx> #include "doc.hxx" -#ifndef PRODUCT +#ifdef DBG_UTIL #include "viewopt.hxx" // SwViewOptions, nur zum Testen (Test2) #endif @@ -1807,7 +1807,7 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt, delete pPolyPolygon; // UPPER_LOWER_TEST -#ifndef PRODUCT +#ifdef DBG_UTIL const SwRootFrm* pTmpRootFrm = pFmt->getIDocumentLayoutAccess()->GetRootFrm(); if( pTmpRootFrm->GetCurrShell() ) { @@ -1880,7 +1880,7 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt, * SwContourCache::ShowContour() * zeichnet die PolyPolygone des Caches zu Debugzwecken. *************************************************************************/ -#ifndef PRODUCT +#ifdef DBG_UTIL void SwContourCache::ShowContour( OutputDevice* pOut, const SdrObject* pObj, const Color& rClosedColor, const Color& rOpenColor ) @@ -1931,7 +1931,7 @@ void SwContourCache::ShowContour( OutputDevice* pOut, const SdrObject* pObj, * SwTxtFly::ShowContour() * zeichnet die PolyPolygone des Caches zu Debugzwecken. *************************************************************************/ -#ifndef PRODUCT +#ifdef DBG_UTIL void SwTxtFly::ShowContour( OutputDevice* pOut ) { diff --git a/sw/source/core/text/txtfly.hxx b/sw/source/core/text/txtfly.hxx index 6849cefb95..899d260902 100644 --- a/sw/source/core/text/txtfly.hxx +++ b/sw/source/core/text/txtfly.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -29,7 +29,7 @@ ************************************************************************/ #ifndef _TXTFLY_HXX #define _TXTFLY_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include "swtypes.hxx" #include "swrect.hxx" @@ -102,7 +102,7 @@ public: const long nXPos, const sal_Bool bRight ); // <-- -#ifndef PRODUCT +#ifdef DBG_UTIL void ShowContour( OutputDevice* pOut, const SdrObject* pObj, const Color& rClosedColor, const Color& rOpenColor ); #endif @@ -235,7 +235,7 @@ public: } // <-- -#ifndef PRODUCT +#ifdef DBG_UTIL void ShowContour( OutputDevice* pOut ); #endif }; diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index aadb27e4b6..d7a82edd16 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" #include <hintids.hxx> #include <hints.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/ctloptions.hxx> #include <sfx2/printer.hxx> #include <sfx2/sfxuno.hxx> #include <svx/langitem.hxx> @@ -938,17 +938,6 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) InvalidateLineNum(); } break; - case RES_INS_CHR: - { - nPos = ((SwInsChr*)pNew)->nPos; - InvalidateRange( SwCharRange( nPos, 1 ), 1 ); - SET_WRONG( nPos, 1, true ) - SET_SCRIPT_INVAL( nPos ) - bSetFldsDirty = sal_True; - if( HasFollow() ) - lcl_ModifyOfst( this, nPos, 1 ); - } - break; case RES_INS_TXT: { nPos = ((SwInsTxt*)pNew)->nPos; diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 4b3befe53a..83ecf7a7ec 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -106,7 +106,7 @@ SwTxtFrm *SwTxtFrm::FindFtnRef( const SwTxtFtn *pFtn ) * CalcFtnFlag() *************************************************************************/ -#ifdef PRODUCT +#ifndef DBG_UTIL void SwTxtFrm::CalcFtnFlag() #else void SwTxtFrm::CalcFtnFlag( xub_StrLen nStop )//Fuer den Test von SplitFrm @@ -120,7 +120,7 @@ void SwTxtFrm::CalcFtnFlag( xub_StrLen nStop )//Fuer den Test von SplitFrm const USHORT nSize = pHints->Count(); -#ifdef PRODUCT +#ifndef DBG_UTIL const xub_StrLen nEnd = GetFollow() ? GetFollow()->GetOfst() : STRING_LEN; #else const xub_StrLen nEnd = nStop != STRING_LEN ? nStop @@ -364,7 +364,7 @@ SwTwips SwTxtFrm::_GetFtnFrmHeight() const SwTwips nTmp = (*fnRect->fnYDiff)( (pCont->*fnRect->fnGetPrtBottom)(), (Frm().*fnRect->fnGetTop)() ); -#ifndef PRODUCT +#ifdef DBG_UTIL if( nTmp < 0 ) { sal_Bool bInvalidPos = sal_False; diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index 602cc4803d..722cae6b04 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,7 +47,7 @@ #include <guess.hxx> // #include <splargs.hxx> // SwInterHyphInfo -#ifndef PRODUCT +#ifdef DBG_UTIL extern const sal_Char *GetLangName( const MSHORT nLang ); #endif diff --git a/sw/source/core/text/txtinit.cxx b/sw/source/core/text/txtinit.cxx index 4730568fbb..f7f6091377 100644 --- a/sw/source/core/text/txtinit.cxx +++ b/sw/source/core/text/txtinit.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -79,7 +79,7 @@ void _TextInit() pFntCache = new SwFntCache; // Cache for SwSubFont -> SwFntObj = { Font aFont, Font* pScrFont, Font* pPrtFont, OutputDevice* pPrinter, ... } pSwFontCache = new SwFontCache; // Cache for SwTxtFmtColl -> SwFontObj = { SwFont aSwFont, SfxPoolItem* pDefaultArray } SwCache *pTxtCache = new SwCache( 250, 100 // Cache for SwTxtFrm -> SwTxtLine = { SwParaPortion* pLine } -#ifndef PRODUCT +#ifdef DBG_UTIL , "static SwTxtFrm::pTxtCache" #endif ); diff --git a/sw/source/core/text/txtio.cxx b/sw/source/core/text/txtio.cxx index 0d461f4311..890c67ab4f 100644 --- a/sw/source/core/text/txtio.cxx +++ b/sw/source/core/text/txtio.cxx @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" -#ifdef PRODUCT +#ifndef DBG_UTIL #error Wer fummelt denn an den makefiles? #endif diff --git a/sw/source/core/text/txtpaint.cxx b/sw/source/core/text/txtpaint.cxx index 0c0ed86b4f..2b3cabec23 100644 --- a/sw/source/core/text/txtpaint.cxx +++ b/sw/source/core/text/txtpaint.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -122,7 +122,7 @@ void SwSaveClip::_ChgClip( const SwRect &rRect, const SwTxtFrm* pFrm, #endif } #if OSL_DEBUG_LEVEL > 1 -#ifndef PRODUCT +#ifdef DBG_UTIL static sal_Bool bDbg = sal_False; if( bDbg ) { diff --git a/sw/source/core/text/txtpaint.hxx b/sw/source/core/text/txtpaint.hxx index 81b92bfabd..e997858351 100644 --- a/sw/source/core/text/txtpaint.hxx +++ b/sw/source/core/text/txtpaint.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -71,7 +71,7 @@ inline SwSaveClip::~SwSaveClip() Reset(); } -#ifndef PRODUCT +#ifdef DBG_UTIL /************************************************************************* * class SwDbgOut diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index b299cae970..ed4f7059a0 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -328,7 +328,7 @@ SwTabPortion::SwTabPortion( const KSHORT nTabPosition, const xub_Unicode cFillCh : SwFixPortion( 0, 0 ), nTabPos(nTabPosition), cFill(cFillChar) { nLineLength = 1; -#ifndef PRODUCT +#ifdef DBG_UTIL if( IsFilled() ) { ASSERT( ' ' != cFill, "SwTabPortion::CTOR: blanks ?!" ); @@ -563,7 +563,7 @@ sal_Bool SwTabPortion::PostFormat( SwTxtFormatInfo &rInf ) void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const { -#ifndef PRODUCT +#ifdef DBG_UTIL // Wir wollen uns die Fixbreite anzeigen if( rInf.OnWin() && OPTDBG( rInf ) && !rInf.GetOpt().IsPagePreview() && \ diff --git a/sw/source/core/tox/toxhlp.cxx b/sw/source/core/tox/toxhlp.cxx index eab3d53c7b..69aefa9f66 100644 --- a/sw/source/core/tox/toxhlp.cxx +++ b/sw/source/core/tox/toxhlp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -62,12 +62,12 @@ IndexEntrySupplierWrapper::IndexEntrySupplierWrapper() } } catch ( UNO_NMSPC::Exception& -#ifndef PRODUCT +#ifdef DBG_UTIL e #endif ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ByteString aMsg( "IndexEntrySupplierWrapper: Exception caught\n" ); aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); DBG_ERRORFILE( aMsg.GetBuffer() ); @@ -88,12 +88,12 @@ String IndexEntrySupplierWrapper::GetIndexKey( const String& rTxt, sRet = xIES->getIndexKey( rTxt, rTxtReading, rLocale ); } catch ( UNO_NMSPC::Exception& -#ifndef PRODUCT +#ifdef DBG_UTIL e #endif ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ByteString aMsg( "getIndexKey: Exception caught\n" ); aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); DBG_ERRORFILE( aMsg.GetBuffer() ); @@ -109,12 +109,12 @@ String IndexEntrySupplierWrapper::GetFollowingText( BOOL bMorePages ) const sRet = xIES->getIndexFollowPageWord( bMorePages, aLcl ); } catch ( UNO_NMSPC::Exception& -#ifndef PRODUCT +#ifdef DBG_UTIL e #endif ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ByteString aMsg( "getIndexFollowPageWord: Exception caught\n" ); aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); DBG_ERRORFILE( aMsg.GetBuffer() ); @@ -132,12 +132,12 @@ IndexEntrySupplierWrapper::GetAlgorithmList( const STAR_NMSPC::lang::Locale& rLc sRet = xIES->getAlgorithmList( rLcl ); } catch ( UNO_NMSPC::Exception& -#ifndef PRODUCT +#ifdef DBG_UTIL e #endif ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ByteString aMsg( "getAlgorithmList: Exception caught\n" ); aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); DBG_ERRORFILE( aMsg.GetBuffer() ); @@ -155,12 +155,12 @@ sal_Bool IndexEntrySupplierWrapper::LoadAlgorithm( bRet = xIES->loadAlgorithm( rLcl, sSortAlgorithm, nOptions ); } catch ( UNO_NMSPC::Exception& -#ifndef PRODUCT +#ifdef DBG_UTIL e #endif ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ByteString aMsg( "loadAlgorithm: Exception caught\n" ); aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); DBG_ERRORFILE( aMsg.GetBuffer() ); @@ -181,12 +181,12 @@ sal_Int16 IndexEntrySupplierWrapper::CompareIndexEntry( rTxt2, rTxtReading2, rLocale2 ); } catch ( UNO_NMSPC::Exception& -#ifndef PRODUCT +#ifdef DBG_UTIL e #endif ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ByteString aMsg( "compareIndexEntry: Exception caught\n" ); aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); DBG_ERRORFILE( aMsg.GetBuffer() ); diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 5a128fbf8a..63e551e8c8 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -191,7 +191,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd, { SwPosition aPos( *pNd ); const SwDoc& rDoc = *pNd->GetDoc(); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht der Absatz" ); #else diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 5248100afd..4ddfae6a0b 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -46,7 +46,7 @@ #include "hints.hxx" #include <IDocumentFieldsAccess.hxx> -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> TYPEINIT3( SwFmtFld, SfxPoolItem, SwClient,SfxBroadcaster) TYPEINIT1(SwFmtFldHint, SfxHint); diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index 73640e2ba6..8beccc1cfa 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -35,7 +35,7 @@ #define _SVSTDARR_USHORTS #define _SVSTDARR_USHORTSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <doc.hxx> #include <cntfrm.hxx> // ASSERT in ~SwTxtFtn() #include <pagefrm.hxx> // RemoveFtn() diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 686b4a67af..54e73302aa 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -35,9 +35,9 @@ #include "unomid.h" #include <basic/sbxvar.hxx> -#include <svtools/macitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/stylepool.hxx> +#include <svl/macitem.hxx> +#include <svl/stritem.hxx> +#include <svl/stylepool.hxx> #include <fmtautofmt.hxx> #include <fchrfmt.hxx> #include <fmtinfmt.hxx> @@ -58,7 +58,7 @@ #include <doc.hxx> // for meta #include <unometa.hxx> #include <docsh.hxx> -#include <svtools/zforlist.hxx> // GetNumberFormat +#include <svl/zforlist.hxx> // GetNumberFormat #include <boost/bind.hpp> #include <algorithm> diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 114c5b4e92..2b30826062 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1044,7 +1044,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) // a window. Therefore bUseSrcFont is always 0 in this case. // -#ifndef PRODUCT +#ifdef DBG_UTIL const BOOL bNoAdjust = bPrt || ( pWin && diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index 9f32dd7975..0ad7ca6278 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -707,7 +707,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) if( nPos == STRING_LEN || nPos > nMaxPos ) nPos = nMaxPos; ASSERT( nPos, "nextCharBlock not implemented?" ); -#ifndef PRODUCT +#ifdef DBG_UTIL if( !nPos ) nPos = nMaxPos; #endif @@ -821,7 +821,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) if( nPos == STRING_LEN || nPos > nMaxPos ) nPos = nMaxPos; ASSERT( nPos, "endOfCharBlock not implemented?" ); -#ifndef PRODUCT +#ifdef DBG_UTIL if( !nPos ) nPos = nMaxPos; #endif diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx index 1cb509fd3e..79c66ba8b7 100644 --- a/sw/source/core/txtnode/ndhints.cxx +++ b/sw/source/core/txtnode/ndhints.cxx @@ -1,6 +1,8 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * * * Copyright 2008 by Sun Microsystems, Inc. * @@ -50,7 +52,7 @@ _SV_IMPL_SORTAR_ALG( SwpHtEnd, SwTxtAttr* ) void DumpHints( const SwpHtStart &rHtStart, const SwpHtEnd &rHtEnd ) { -#ifndef PRODUCT +#ifdef DBG_UTIL aDbstream << "DumpHints:" << endl; (aDbstream << "\tStarts:" ).WriteNumber(rHtStart.Count()) << endl; for( USHORT i = 0; i < rHtStart.Count(); ++i ) @@ -247,7 +249,7 @@ BOOL SwpHtEnd::Seek_Entry( const SwTxtAttr *pElement, USHORT *pPos ) const void SwpHintsArray::Insert( const SwTxtAttr *pHt ) { Resort(); -#ifndef PRODUCT +#ifdef DBG_UTIL USHORT nPos; ASSERT(!m_HintStarts.Seek_Entry( pHt, &nPos ), "Insert: hint already in HtStart"); @@ -256,7 +258,7 @@ void SwpHintsArray::Insert( const SwTxtAttr *pHt ) #endif m_HintStarts.Insert( pHt ); m_HintEnds.Insert( pHt ); -#ifndef PRODUCT +#ifdef DBG_UTIL #ifdef NIE (aDbstream << "Insert: " ).WriteNumber( long( pHt ) ) << endl; DumpHints( m_HintStarts, m_HintEnds ); @@ -275,7 +277,7 @@ void SwpHintsArray::DeleteAtPos( const USHORT nPos ) USHORT nEndPos; m_HintEnds.Seek_Entry( pHt, &nEndPos ); m_HintEnds.Remove( nEndPos ); -#ifndef PRODUCT +#ifdef DBG_UTIL #ifdef NIE (aDbstream << "DeleteAtPos: " ).WriteNumber( long( pHt ) ) << endl; DumpHints( m_HintStarts, m_HintEnds ); @@ -283,7 +285,7 @@ void SwpHintsArray::DeleteAtPos( const USHORT nPos ) #endif } -#ifndef PRODUCT +#ifdef DBG_UTIL /************************************************************************* * SwpHintsArray::Check() @@ -441,7 +443,7 @@ bool SwpHintsArray::Resort() if( pLast && !lcl_IsLessStart( *pLast, *pHt ) ) { #ifdef NIE -#ifndef PRODUCT +#ifdef DBG_UTIL // ASSERT( bResort, "!Resort/Start: correcting hints-array" ); aDbstream << "Resort: Starts" << endl; DumpHints( m_HintStarts, m_HintEnds ); @@ -464,7 +466,7 @@ bool SwpHintsArray::Resort() if( pLast && !lcl_IsLessEnd( *pLast, *pHt ) ) { #ifdef NIE -#ifndef PRODUCT +#ifdef DBG_UTIL aDbstream << "Resort: Ends" << endl; DumpHints( m_HintStarts, m_HintEnds ); #endif @@ -480,7 +482,7 @@ bool SwpHintsArray::Resort() } pLast = pHt; } -#ifndef PRODUCT +#ifdef DBG_UTIL #ifdef NIE aDbstream << "Resorted:" << endl; DumpHints( m_HintStarts, m_HintEnds ); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 713bc64f15..ee663716f0 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -40,12 +40,12 @@ // --> OD 2008-01-17 #newlistlevelattrs# #include <svx/tstpitem.hxx> // <-- -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #ifndef _SVSTDARR_HXX #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/ctloptions.hxx> +#include <svl/ctloptions.hxx> #include <swmodule.hxx> #include <txtfld.hxx> #include <txtinet.hxx> @@ -92,13 +92,13 @@ #include <numrule.hxx> //--> #outlinelevel added by zhaojianwei -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> //<--end #include <swtable.hxx> #include <docsh.hxx> #include <SwNodeNum.hxx> // --> OD 2008-02-25 #refactorlists# -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <list.hxx> // <-- @@ -111,7 +111,7 @@ SV_DECL_PTRARR(SwpHts,SwTxtAttr*,1,1) // Leider ist das SwpHints nicht ganz wasserdicht: // Jeder darf an den Hints rumfummeln, ohne die Sortierreihenfolge // und Verkettung sicherstellen zu muessen. -#ifndef PRODUCT +#ifdef DBG_UTIL #define CHECK_SWPHINTS(pNd) { if( pNd->GetpSwpHints() && \ !pNd->GetDoc()->IsInReading() ) \ pNd->GetpSwpHints()->Check(); } @@ -372,7 +372,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode ) ((SwTxtFrm*)pFrm)->SetFtn( TRUE ); } } -#ifndef PRODUCT +#ifdef DBG_UTIL while( 0 != (pCntnt = (SwCntntFrm*)aIter.Next()) ) { SwFtnFrm *pDbgFtn = pCntnt->FindFtnFrm(); diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 5a4d720489..15a973b122 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -88,7 +88,7 @@ #define FNT_ATM_HACK #endif -#ifndef PRODUCT +#ifdef DBG_UTIL // globale Variable SvStatistics aSvStat; #endif @@ -825,7 +825,7 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) rInf.SetText( aNewText ); rInf.SetIdx( 0 ); rInf.SetLen( aNewText.Len() ); - aTxtSize = pLastFont->GetTextSize( rInf ); + aTxtSize = pLastFont->GetTextSize( rInf ); rInf.SetIdx( nOldIdx ); rInf.SetLen( nOldLen ); } @@ -837,9 +837,9 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) rInf.SetText( aNewText ); rInf.SetIdx( 0 ); rInf.SetLen( aNewText.Len() ); - aTxtSize = pLastFont->GetTextSize( rInf ); + aTxtSize = pLastFont->GetTextSize( rInf ); rInf.SetIdx( nOldIdx ); - rInf.SetLen( nOldLen ); + rInf.SetLen( nOldLen ); } return aTxtSize; diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 7819ecd496..5384f4f73b 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -35,9 +35,9 @@ #include <hintids.hxx> #include <sot/factory.hxx> #include <svx/xmlcnitm.hxx> -#include <svtools/whiter.hxx> -#include <svtools/itemiter.hxx> -#include <svtools/stylepool.hxx> +#include <svl/whiter.hxx> +#include <svl/itemiter.hxx> +#include <svl/stylepool.hxx> #include <svx/fontitem.hxx> #include <svx/langitem.hxx> #include <svx/emphitem.hxx> @@ -84,11 +84,11 @@ // OD 26.06.2003 #108784# #include <dcontact.hxx> #include <docsh.hxx> -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> #include <algorithm> #include <map> -#ifndef PRODUCT +#ifdef DBG_UTIL #define CHECK Check(); #else #define CHECK @@ -666,7 +666,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, } } -#ifndef PRODUCT +#ifdef DBG_UTIL if( !rNode.GetDoc()->IsInReading() ) CHECK; #endif @@ -1422,11 +1422,11 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) // FussNote im Redline-Bereich NICHT ins FtnArray einfuegen! if( StartOfSectionIndex() > rNodes.GetEndOfRedlines().GetIndex() ) { -#ifndef PRODUCT +#ifdef DBG_UTIL const BOOL bSuccess = #endif pDoc->GetFtnIdxs().Insert( pTxtFtn ); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( bSuccess, "FtnIdx nicht eingetragen." ); #endif } @@ -2626,7 +2626,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, { SwpHintsArray::Insert( pHint ); CalcFlags(); -#ifndef PRODUCT +#ifdef DBG_UTIL if( !rNode.GetDoc()->IsInReading() ) CHECK; #endif @@ -2719,7 +2719,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, rNode.Modify( 0, &aHint ); } -#ifndef PRODUCT +#ifdef DBG_UTIL if( !bNoHintAdjustMode && !rNode.GetDoc()->IsInReading() ) CHECK; #endif diff --git a/sw/source/core/txtnode/txatbase.cxx b/sw/source/core/txtnode/txatbase.cxx index 61b425ccce..5617ba35b0 100644 --- a/sw/source/core/txtnode/txatbase.cxx +++ b/sw/source/core/txtnode/txatbase.cxx @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> #include <txatbase.hxx> #include <fmtfld.hxx> #include <docufld.hxx> diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 464af6183a..104d6d457f 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 15f98f4d1f..6677d2b647 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -41,7 +41,7 @@ #endif #include <hintids.hxx> #include <vcl/svapp.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/splwrap.hxx> #include <svx/langitem.hxx> #include <svx/fontitem.hxx> @@ -368,7 +368,6 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess, return bRet; } - inline BOOL InRange(xub_StrLen nIdx, xub_StrLen nStart, xub_StrLen nEnd) { return ((nIdx >=nStart) && (nIdx <= nEnd)); } diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx index 35c09ac23b..ab797b488e 100644 --- a/sw/source/core/undo/docundo.cxx +++ b/sw/source/core/undo/docundo.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -203,9 +203,9 @@ void SwDoc::AppendUndo( SwUndo* pUndo ) USHORT nEnde = UNDO_ACTION_LIMIT; // nur zum Testen der neuen DOC-Member -#ifndef PRODUCT +#ifdef DBG_UTIL { - SwUndoId nId = UNDO_EMPTY; + SwUndoId nId = UNDO_EMPTY; USHORT nUndosCnt = 0, nSttEndCnt = 0; for( USHORT nCnt = 0; nCnt < nUndoPos; ++nCnt ) { @@ -551,7 +551,7 @@ SwUndoId SwDoc::EndUndo(SwUndoId eUndoId, const SwRewriter * pRewriter) pUndoEnd->SetSttOffset( nSize ); // nur zum Testen der Start/End-Verpointerung vom Start/End Undo -#ifndef PRODUCT +#ifdef DBG_UTIL { USHORT nEndCnt = 1, nCnt = pUndos->Count(); SwUndoId nTmpId = UNDO_EMPTY; diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 1ab0e90993..4540a7dcd0 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -33,7 +33,7 @@ #include <hintids.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <fmtftn.hxx> #include <fchrfmt.hxx> #include <fmtflcnt.hxx> diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 6c5ca25ee4..de590d974d 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -39,7 +39,7 @@ #include <svx/svdmodel.hxx> #include <svx/tstpitem.hxx> #include <svx/svdpage.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <fmtflcnt.hxx> diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 71f98b82a5..83c4713e84 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -68,7 +68,7 @@ public: SwNodeIndex* GetMvSttIdx() const { return SwUndoSaveSection::GetMvSttIdx(); } -#ifndef PRODUCT +#ifdef DBG_UTIL USHORT nRedlineCount; #endif }; @@ -1089,7 +1089,7 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos, ASSERT( !this, "keine gueltigen Daten!" ) } -#ifndef PRODUCT +#ifdef DBG_UTIL nRedlineCount = rSttPos.nNode.GetNode().GetDoc()->GetRedlineTbl().Count(); #endif } diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index bc5effe016..dc2fc49eae 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,7 +33,7 @@ #include <hintids.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <fmtflcnt.hxx> #include <fmtanchr.hxx> #include <fmtcntnt.hxx> diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 7e18b59a7f..b6249bd0c6 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -66,8 +66,7 @@ #include <comcore.hrc> #include <unochart.hxx> - -#ifdef PRODUCT +#ifndef DBG_UTIL #define CHECK_TABLE(t) #else #ifdef DEBUG @@ -77,7 +76,7 @@ #endif #endif -#ifdef PRODUCT +#ifndef DBG_UTIL #define _DEBUG_REDLINE( pDoc ) #else void lcl_DebugRedline( const SwDoc* pDoc ); @@ -195,7 +194,7 @@ public: void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos = 0 ); void InsertSort( SvULongs& rArr, ULONG nIdx, USHORT* pInsPos = 0 ); -#if defined( JP_DEBUG ) && !defined( PRODUCT ) +#if defined( JP_DEBUG ) && defined(DBG_UTIL) #include "shellio.hxx" void DumpDoc( SwDoc* pDoc, const String& rFileNm ); void CheckTable( const SwTable& ); @@ -3253,7 +3252,7 @@ void InsertSort( SvULongs& rArr, ULONG nIdx, USHORT* pInsPos ) *pInsPos = nU; } -#if defined( JP_DEBUG ) && !defined( PRODUCT ) +#if defined( JP_DEBUG ) && defined(DBG_UTIL) void DumpDoc( SwDoc* pDoc, const String& rFileNm ) diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx index 0a269e7aa7..f954b79827 100644 --- a/sw/source/core/unocore/swunohelper.cxx +++ b/sw/source/core/unocore/swunohelper.cxx @@ -52,7 +52,7 @@ #include <ucbhelper/contentidentifier.hxx> #include <ucbhelper/contentbroker.hxx> #include <ucbhelper/content.hxx> -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <swunohelper.hxx> #include <swunodef.hxx> #include <errhdl.hxx> diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index ef7817ebb5..218d7e1e63 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -40,7 +40,7 @@ #include <vos/mutex.hxx> #include <osl/mutex.hxx> #include <vcl/svapp.hxx> -#include <svtools/zforlist.hxx> // SvNumberFormatter +#include <svl/zforlist.hxx> // SvNumberFormatter #include <svtools/chartprettypainter.hxx> #include <tools/link.hxx> diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 71f4ce5b25..8bb33a4fdb 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -57,7 +57,7 @@ #include <com/sun/star/text/XTextTablesSupplier.hpp> #include <com/sun/star/text/TableColumnSeparator.hpp> #include <com/sun/star/text/XTextTable.hpp> -#include <svtools/PasswordHelper.hxx> +#include <svl/PasswordHelper.hxx> #include <svtools/unoimap.hxx> #include <svtools/unoevent.hxx> #include <unotbl.hxx> diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 725c287111..a48e37a8f5 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -64,7 +64,7 @@ #include <swundo.hxx> #include <cntfrm.hxx> #include <pagefrm.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <tools/urlobj.hxx> #include <docary.hxx> #include <swtable.hxx> @@ -76,11 +76,11 @@ #include <svtools/ctrltool.hxx> #define _SVSTDARR_USHORTS #define _SVSTDARR_USHORTSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <sfx2/docfilt.hxx> #include <sfx2/docfile.hxx> #include <sfx2/fcontnr.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <com/sun/star/beans/PropertyState.hpp> #include <SwStyleNameMapper.hxx> #include <redline.hxx> diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 00e129efc4..7d685b6e9c 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -79,19 +79,12 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> #include <basegfx/numeric/ftools.hxx> -// OD 2004-05-05 #i28701# +#include <algorithm> #include <fmtwrapinfluenceonobjpos.hxx> -// --> OD 2004-11-10 #i35007# #include <com/sun/star/text/TextContentAnchorType.hpp> -// <-- -// --> OD 2005-03-10 #i44334#, #i44681# -// --> OD 2007-01-03 #i73079# - use correct matrix type #include <basegfx/matrix/b2dhommatrix.hxx> -// <-- -// --> OD 2009-01-16 #i59051 +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <com/sun/star/drawing/PointSequence.hpp> -// <-- - #include <vcl/svapp.hxx> #include <slist> #include <iterator> @@ -2763,12 +2756,14 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition ) rtl::OUString aHoriOrientPropStr( RTL_CONSTASCII_USTRINGPARAM("HoriOrient") ); uno::Any aHoriOrient( getPropertyValue( aHoriOrientPropStr ) ); sal_Int16 eHoriOrient; - aHoriOrient >>= eHoriOrient; - if ( eHoriOrient != text::HoriOrientation::NONE ) + if (aHoriOrient >>= eHoriOrient) // may be void { - eHoriOrient = text::HoriOrientation::NONE; - aHoriOrient <<= eHoriOrient; - setPropertyValue( aHoriOrientPropStr, aHoriOrient ); + if ( eHoriOrient != text::HoriOrientation::NONE ) + { + eHoriOrient = text::HoriOrientation::NONE; + aHoriOrient <<= eHoriOrient; + setPropertyValue( aHoriOrientPropStr, aHoriOrient ); + } } // set x-position attribute aHoriPos <<= _aPosition.X; @@ -2791,12 +2786,14 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition ) rtl::OUString aVertOrientPropStr( RTL_CONSTASCII_USTRINGPARAM("VertOrient") ); uno::Any aVertOrient( getPropertyValue( aVertOrientPropStr ) ); sal_Int16 eVertOrient; - aVertOrient >>= eVertOrient; - if ( eVertOrient != text::VertOrientation::NONE ) + if (aVertOrient >>= eVertOrient) // may be void { - eVertOrient = text::VertOrientation::NONE; - aVertOrient <<= eVertOrient; - setPropertyValue( aVertOrientPropStr, aVertOrient ); + if ( eVertOrient != text::VertOrientation::NONE ) + { + eVertOrient = text::VertOrientation::NONE; + aVertOrient <<= eVertOrient; + setPropertyValue( aVertOrientPropStr, aVertOrient ); + } } // set y-position attribute aVertPos <<= _aPosition.Y; @@ -2879,8 +2876,8 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition ) // apply translation difference to PolyPolygonBezier. if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 ) { - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate( aTranslateDiff.X, aTranslateDiff.Y ); + const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix( + aTranslateDiff.X, aTranslateDiff.Y)); const sal_Int32 nOuterSequenceCount(aConvertedPath.Coordinates.getLength()); drawing::PointSequence* pInnerSequence = aConvertedPath.Coordinates.getArray(); diff --git a/sw/source/core/unocore/unoevent.cxx b/sw/source/core/unocore/unoevent.cxx index cfec12bfb7..af6d731aa1 100644 --- a/sw/source/core/unocore/unoevent.cxx +++ b/sw/source/core/unocore/unoevent.cxx @@ -43,7 +43,7 @@ #include <svx/svxids.hrc> #endif #include "fmtinfmt.hxx" -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <rtl/ustrbuf.hxx> #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP #include <com/sun/star/beans/PropertyValue.hpp> diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 161a71136b..8105d65bff 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -89,7 +89,7 @@ #include <tools/urlobj.hxx> #include <svx/dataaccessdescriptor.hxx> #define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <vos/mutex.hxx> #include <vcl/svapp.hxx> #include <textapi.hxx> diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 4d535f1262..4e7789b27f 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -2250,6 +2250,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s {SW_PROP_NMID(UNO_NAME_NAME), FIELD_PROP_PAR4, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_IS_FIXED), FIELD_PROP_BOOL1, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE,0}, + {SW_PROP_NMID(UNO_NAME_NUMBER_FORMAT), FIELD_PROP_FORMAT, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, 0}, + {SW_PROP_NMID(UNO_NAME_IS_FIXED_LANGUAGE), FIELD_PROP_BOOL4, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 1cb0d4f660..f046719f85 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -115,7 +115,7 @@ #include <fmtflcnt.hxx> #define _SVSTDARR_USHORTS #define _SVSTDARR_USHORTSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svx/brshitem.hxx> #include <svx/unolingu.hxx> #include <fmtclds.hxx> diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index cef43782d4..accb3c2991 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -112,7 +112,7 @@ #define _SVSTDARR_USHORTS #define _SVSTDARR_USHORTSSORT #define _SVSTDARR_XUB_STRLEN -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svx/brshitem.hxx> #include <fmtclds.hxx> #include <dcontact.hxx> diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 1913c3ba6b..93051e05f0 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -50,7 +50,7 @@ #define _SVSTDARR_USHORTS #define _SVSTDARR_USHORTSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <com/sun/star/beans/SetPropertyTolerantFailed.hpp> #include <com/sun/star/beans/GetPropertyTolerantResult.hpp> diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index a8e879f56a..c2094ffae7 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -35,7 +35,7 @@ #include <cmdid.h> #include <vos/mutex.hxx> #include <vcl/svapp.hxx> -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> #include <unocrsrhelper.hxx> #include <unoport.hxx> diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx index fc0cddd250..3c75ee9af9 100644 --- a/sw/source/core/unocore/unoprnms.cxx +++ b/sw/source/core/unocore/unoprnms.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" #include <tools/debug.hxx> -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> #include <unoprnms.hxx> diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 6eeb9757e4..d4ab7f0813 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -36,8 +36,7 @@ #include <cmdid.h> #include <hintids.hxx> -#include <tools/link.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <svx/brshitem.hxx> #include <svx/xmlcnitm.hxx> #include <sfx2/linkmgr.hxx> diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 2b648ec87a..979d542a75 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -34,10 +34,10 @@ #include <hintids.hxx> #include <vos/mutex.hxx> #include <vcl/svapp.hxx> -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> #include <svtools/ctrltool.hxx> -#include <svtools/style.hxx> -#include <svtools/itemiter.hxx> +#include <svl/style.hxx> +#include <svl/itemiter.hxx> #include <svx/pageitem.hxx> #include <svx/sizeitem.hxx> #include <svx/ulspitem.hxx> diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index a6e9b8cd10..1fcc59f1da 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -59,7 +59,7 @@ #include <fmtpdsc.hxx> #include <pagedesc.hxx> #define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <viewsh.hxx> #include <tabfrm.hxx> #include <redline.hxx> @@ -86,7 +86,7 @@ #include <unotextrange.hxx> #include <unotextcursor.hxx> #include <unoparagraph.hxx> -#include <svtools/zforlist.hxx> // SvNumberFormatter +#include <svl/zforlist.hxx> // SvNumberFormatter #include <svx/brkitem.hxx> #include <svx/shaditem.hxx> #include <svx/lrspitem.hxx> diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index 94bc6beaa3..201bd24b03 100644 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,7 +45,7 @@ /// include <svx/svdoutl.hxx> #include <svx/svdoutl.hxx> -#ifndef PRODUCT +#ifdef DBG_UTIL #include <svx/fmglob.hxx> #endif @@ -55,6 +55,7 @@ #include "viewimp.hxx" #include "dflyobj.hxx" #include "viewopt.hxx" +#include "swprtopt.hxx" #include "dcontact.hxx" #include "dview.hxx" #include "flyfrm.hxx" @@ -181,6 +182,7 @@ void SwViewImp::UnlockPaint() // outliner of the draw view for painting layers <hell> and <heaven>. // OD 25.06.2003 #108784# - correct type of 1st parameter void SwViewImp::PaintLayer( const SdrLayerID _nLayerID, + const SwPrtOptions * _pPrintData, const SwRect& , const Color* _pPageBackgrdColor, const bool _bIsPageRightToLeft ) const @@ -227,6 +229,12 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID, } pOutDev->Push( PUSH_LINECOLOR ); // #114231# + if (_pPrintData) + { + // hide drawings but not form controls (form controls are handled elsewhere) + SdrView &rSdrView = const_cast< SdrView & >(GetPageView()->GetView()); + rSdrView.setHideDraw( !_pPrintData->IsPrintDraw() ); + } GetPageView()->DrawLayer(_nLayerID, pOutDev); pOutDev->Pop(); diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx index a3c3482a8e..5fd28d45be 100644..100755 --- a/sw/source/core/view/viewpg.cxx +++ b/sw/source/core/view/viewpg.cxx @@ -31,9 +31,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include <com/sun/star/uno/Sequence.hxx> #include <hintids.hxx> #include <vcl/window.hxx> +#include <vcl/oldprintadaptor.hxx> #include <sfx2/printer.hxx> #include <sfx2/progress.hxx> #include <pvprtdat.hxx> @@ -59,6 +61,10 @@ #include <IDocumentFieldsAccess.hxx> #include <IDocumentDeviceAccess.hxx> + +using namespace ::com::sun::star; + + // OD 12.12.2002 #103492# SwPagePreviewLayout* ViewShell::PagePreviewLayout() { @@ -87,671 +93,173 @@ void ViewShell::AdjustOptionsForPagePreview( const SwPrtOptions &_rPrintOptions return; } -// output print preview on printer -// OD 05.05.2003 #i14016# - consider empty pages on calculation of scaling -// and on calculation of paint offset. -void ViewShell::PrintPreViewPage( SwPrtOptions& rOptions, - USHORT nRowCol, SfxProgress& rProgress, - const SwPagePreViewPrtData* pPrtData ) -{ - if( !rOptions.aMulti.GetSelectCount() ) - return; - // wenn kein Drucker vorhanden ist, wird nicht gedruckt - SfxPrinter* pPrt = getIDocumentDeviceAccess()->getPrinter(false); - if( !pPrt || !pPrt->GetName().Len() ) +// print brochure +// OD 05.05.2003 #i14016# - consider empty pages on calculation of the scaling +// for a page to be printed. +void ViewShell::PrintProspect(
+ OutputDevice *pOutDev,
+ const SwPrintData &rPrintData, + sal_Int32 nRenderer // the index in the vector of prospect pages to be printed + )
+{ + const sal_Int32 nMaxRenderer = rPrintData.GetRenderData().GetPagePairsForProspectPrinting().size() - 1; +#if OSL_DEBUG_LEVEL > 1 + DBG_ASSERT( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds"); +#endif + Printer *pPrinter = dynamic_cast< Printer * >(pOutDev); + if (!pPrinter || nMaxRenderer < 0 || nRenderer < 0 || nRenderer > nMaxRenderer) return; -// schoen waers gewesen !!! const MultiSelection& rMulti = rOptions.aMulti; - MultiSelection aMulti( rOptions.aMulti ); - Range aPages( aMulti.FirstSelected(), aMulti.LastSelected() ); - if ( aPages.Max() > USHRT_MAX ) - aPages.Max() = USHRT_MAX; - - ASSERT( aPages.Min() > 0, - "Seite 0 Drucken?" ); - ASSERT( aPages.Min() <= aPages.Max(), - "MinSeite groesser MaxSeite." ); + // save settings of OutputDevice (should be done always since the + // output device is now provided by a call from outside the Writer) + pPrinter->Push(); + + std::pair< sal_Int32, sal_Int32 > rPagesToPrint = + rPrintData.GetRenderData().GetPagePairsForProspectPrinting()[ nRenderer ]; +// const USHORT nPageMax = static_cast< USHORT >(rPagesToPrint.first > rPagesToPrint.second ? +// rPagesToPrint.first : rPagesToPrint.second); +#if OSL_DEBUG_LEVEL > 1 + DBG_ASSERT( rPagesToPrint.first == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.first ) == 1, "first Page not valid" ); + DBG_ASSERT( rPagesToPrint.second == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.second ) == 1, "second Page not valid" ); +#endif // eine neue Shell fuer den Printer erzeugen - ViewShell aShell( *this, 0 ); - if ( &GetRefDev() == pPrt ) - aShell.mpTmpRef = new SfxPrinter( *pPrt ); - + ViewShell aShell( *this, 0, pPrinter ); + SET_CURR_SHELL( &aShell ); - aShell.PrepareForPrint( rOptions ); - - // gibt es versteckte Absatzfelder, unnoetig wenn die Absaetze bereits - // ausgeblendet sind. - int bHiddenFlds = FALSE; - SwFieldType* pFldType = 0; - if ( GetViewOptions()->IsShowHiddenPara() ) - { - pFldType = getIDocumentFieldsAccess()->GetSysFldType( RES_HIDDENPARAFLD ); - bHiddenFlds = 0 != pFldType->GetDepends(); - if( bHiddenFlds ) - { - SwMsgPoolItem aHnt( RES_HIDDENPARA_PRINT ); - pFldType->Modify( &aHnt, 0); - } - } + aShell.PrepareForPrint( rPrintData ); - // Seiten fuers Drucken formatieren - aShell.CalcPagesForPrint( (USHORT)aPages.Max(), &rProgress ); + //!! applying view options and formatting the dcoument should now only be done in getRendererCount! - USHORT nCopyCnt = rOptions.bCollate ? rOptions.nCopyCount : 1; - BOOL bStartJob = FALSE; + MapMode aMapMode( MAP_TWIP ); + Size aPrtSize( pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), aMapMode ) ); - const bool bPrintEmptyPages = rOptions.IsPrintEmptyPages(); + SwTwips nMaxRowSz, nMaxColSz; - for ( USHORT nCnt = 0; nCnt < nCopyCnt; nCnt++ ) + const SwPageFrm *pStPage = 0; + const SwPageFrm *pNxtPage = 0; + const SwRenderData::ValidStartFramesMap_t &rFrms = rPrintData.GetRenderData().GetValidStartFrames(); + if (rPagesToPrint.first > 0) { - if( rOptions.IsPrintSingleJobs() && rOptions.GetJobName().Len() && - ( bStartJob || rOptions.bJobStartet ) ) - { - pPrt->EndJob(); - rOptions.bJobStartet = TRUE; - - // Reschedule statt Yield, da Yield keine Events abarbeitet - // und es sonst eine Endlosschleife gibt. - while( pPrt->IsPrinting() ) - rProgress.Reschedule(); - - rOptions.MakeNextJobName(); - bStartJob = pPrt->StartJob( rOptions.GetJobName() ); - } - - const SwPageFrm *pStPage = (SwPageFrm*)GetLayout()->Lower(); - const SwFrm *pEndPage = pStPage; - USHORT i; - - for( i = 1; pStPage && i < (USHORT)aPages.Min(); ++i ) - pStPage = (SwPageFrm*)pStPage->GetNext(); - - if( !pStPage ) // dann wars das - { - if( bHiddenFlds ) - { - SwMsgPoolItem aHnt( RES_HIDDENPARA_PRINT ); - pFldType->Modify( &aHnt, 0); - CalcPagesForPrint( (USHORT)aPages.Max() ); - } - return; - } - - // unsere SttPage haben wir, dann die EndPage suchen - USHORT nFirstPageNo = i; - USHORT nLastPageNo = i; - USHORT nPageNo = 1; - - pEndPage = pStPage; - - if( pStPage->GetNext() && (i != (USHORT)aPages.Max()) ) - { - pEndPage = pEndPage->GetNext(); - for( ++i,++nLastPageNo; - pEndPage->GetNext() && i < (USHORT)aPages.Max(); ++i ) - { - pEndPage = pEndPage->GetNext(); - ++nLastPageNo; - } - } + SwRenderData::ValidStartFramesMap_t::const_iterator aIt( rFrms.find( rPagesToPrint.first ) ); + DBG_ASSERT( aIt != rFrms.end(), "failed to find start frame" ); + pStPage = aIt->second; + } + if (rPagesToPrint.second > 0) + { + SwRenderData::ValidStartFramesMap_t::const_iterator aIt( rFrms.find( rPagesToPrint.second ) ); + DBG_ASSERT( aIt != rFrms.end(), "failed to find start frame" ); + pNxtPage = aIt->second; + } - if( rOptions.bPrintReverse ) + // OD 05.05.2003 #i14016# - consider empty pages on calculation + // of page size, used for calculation of scaling. + Size aSttPageSize; + if ( pStPage ) + { + if ( pStPage->IsEmptyPage() ) { - const SwFrm *pTmp = pStPage; - pStPage = (SwPageFrm*)pEndPage; - pEndPage = pTmp; - nPageNo = nLastPageNo; + if ( pStPage->GetPhyPageNum() % 2 == 0 ) + aSttPageSize = pStPage->GetPrev()->Frm().SSize(); + else + aSttPageSize = pStPage->GetNext()->Frm().SSize(); } else - nPageNo = nFirstPageNo; - - // ein Array fuer die Seiten anlegen, die auf eine Drucker-Seite - // gedruckt werden sollen. - BYTE nRow = BYTE(nRowCol >> 8), nCol = BYTE(nRowCol & 0xff); - USHORT nPages = nRow * nCol; - SwPageFrm** aPageArr = new SwPageFrm* [ nPages ]; - memset( aPageArr, 0, sizeof( SwPageFrm* ) * nPages ); - USHORT nCntPage = 0; - - SwTwips nCalcW = 0, nCalcH = 0, nMaxRowSz = 0, nMaxColSz = 0; - - MapMode aOld( pPrt->GetMapMode() ); - MapMode aMapMode( MAP_TWIP ); - Size aPrtSize( pPrt->PixelToLogic( pPrt->GetPaperSizePixel(), aMapMode )); - if( pPrtData ) { - aPrtSize.Width() -= pPrtData->GetLeftSpace() + - pPrtData->GetRightSpace() + - ( pPrtData->GetHorzSpace() * (nCol - 1)); - aPrtSize.Height() -= pPrtData->GetTopSpace() + - pPrtData->GetBottomSpace() + - ( pPrtData->GetVertSpace() * (nRow - 1)); + aSttPageSize = pStPage->Frm().SSize(); } - - aMulti.Select( Range( nLastPageNo+1, USHRT_MAX ), FALSE ); - USHORT nSelCount = USHORT((aMulti.GetSelectCount()+nPages-1) / nPages); - nSelCount = nSelCount * nCopyCnt; - USHORT nPrintCount = 1; - - const XubString aTmp( SW_RES( STR_STATSTR_PRINT ) ); - rProgress.SetText( aTmp ); - //HACK, damit die Anzeige nicht durcheinander kommt: - rProgress.SetState( 1, nSelCount ); - rProgress.SetText( aTmp ); - bStartJob = TRUE; - - while( pStPage ) + } + Size aNxtPageSize; + if ( pNxtPage ) + { + if ( pNxtPage->IsEmptyPage() ) { - // Mag der Anwender noch ? - rProgress.Reschedule(); - - if ( !pPrt->IsJobActive() ) - break; - - // --> FME 2005-12-12 #b6354161# Feature - Print empty pages - // --> OD 2007-10-22 #i79738# - correct condition: - // always consider, if page is selected for print. - if( aMulti.IsSelected( nPageNo ) && - ( bPrintEmptyPages || !pStPage->IsEmptyPage() ) ) - // <-- - { - if( rOptions.bPrintReverse ) - aPageArr[ nPages - ++nCntPage ] = (SwPageFrm*)pStPage; - else - aPageArr[ nCntPage++ ] = (SwPageFrm*)pStPage; - - // OD 05.05.2003 #i14016# - consider empty pages on calculation - // of page size, used for calculation of scaling. - Size aPageSize; - if ( pStPage->IsEmptyPage() ) - { - if ( pStPage->GetPhyPageNum() % 2 == 0 ) - aPageSize = pStPage->GetPrev()->Frm().SSize(); - else - aPageSize = pStPage->GetNext()->Frm().SSize(); - } - else - { - aPageSize = pStPage->Frm().SSize(); - } - nCalcW += aPageSize.Width(); - if( nCalcH < aPageSize.Height() ) - nCalcH = aPageSize.Height(); - - if( 0 == (nCntPage % nCol ) || // neue Zeile - nCntPage == nPages || pStPage == pEndPage ) - { - // sollte die Seite nicht gefuellt sein, so erweiter - // anhand der letzen Seite. Dadurch hat auch die - // letze Seite die richtigen Spalten/Reihen. - // BUG: 17695 - if( pStPage == pEndPage && nCntPage != nPages ) - { - // dann Werte mit der letzen Seite auffuellen - if( nCntPage < nCol ) - nCalcW += aPageSize.Width() * (nCol - nCntPage); - - BYTE nRows = (BYTE) ( nCntPage / nCol + 1 ); - if( nRows < nRow ) - nCalcH += ( nRow - nRows ) * nCalcH; - } - - if( nMaxColSz < nCalcW ) - nMaxColSz = nCalcW; - nCalcW = 0; - nMaxRowSz += nCalcH; - } - - if( nCntPage == nPages || pStPage == pEndPage ) - { - // den MapMode einstellen - aMapMode.SetOrigin( Point() ); - { - Fraction aScX( aPrtSize.Width(), nMaxColSz ); - Fraction aScY( aPrtSize.Height(), nMaxRowSz ); - - { - if( aScX < aScY ) - aScY = aScX; - - // fuer Drawing, damit diese ihre Objecte vernuenftig Painten - // koennen, auf "glatte" Prozentwerte setzen - aScY *= Fraction( 1000, 1 ); - long nTmp = (long)aScY; - if( 1 < nTmp ) - --nTmp; - else - nTmp = 1; - aScY = Fraction( nTmp, 1000 ); - aScX = aScY; - } - - aMapMode.SetScaleY( aScY ); - aMapMode.SetScaleX( aScX ); - } - - Point aPrtOff( pPrt->PixelToLogic( - pPrt->GetPageOffsetPixel(), aMapMode ) ); - long nPageHeight = (nMaxRowSz / nRow); - - // dann kann das drucken losgehen - rProgress.SetState( nPrintCount++, nSelCount ); - - pPrt->StartPage(); - Point aCalcPt; - SwPageFrm** ppTmpPg = aPageArr; - - // ist das Array nicht vollsteandig gefuellt ? - if( rOptions.bPrintReverse && nCntPage != nPages ) - { - // beim Rueckwaertsdruck alle Seiten nach vorne - // verschieben! - memmove( ppTmpPg, ppTmpPg + (nPages - nCntPage), - nCntPage * sizeof( SwPageFrm*) ); - aPageArr[ nCntPage ] = 0; // Endekennung - } - - long nHOffs = 0, nVOffs = 0, nXStt = 0; - if( pPrtData ) - { - const Fraction& rScaleX = aMapMode.GetScaleX(); - const Fraction& rScaleY = aMapMode.GetScaleY(); - Fraction aF( pPrtData->GetTopSpace(), 1 ); - aCalcPt.Y() = aF /= rScaleY; - aF = Fraction( pPrtData->GetLeftSpace(), 1 ); - nXStt = aF /= rScaleX; - aF = Fraction( pPrtData->GetVertSpace(), 1 ); - nVOffs = aF /= rScaleY; - aF = Fraction( pPrtData->GetHorzSpace(), 1 ); - nHOffs = aF /= rScaleX; - } - - for( BYTE nR = 0; *ppTmpPg && nR < nRow; ++nR ) - { - aCalcPt.X() = nXStt; - for( BYTE nC = 0; *ppTmpPg && nC < nCol; ++nC ) - { - aShell.Imp()->SetFirstVisPageInvalid(); - aShell.aVisArea = (*ppTmpPg)->Frm(); - - Point aPos( aCalcPt ); - aPos -= aShell.aVisArea.Pos(); - aPos -= aPrtOff; - aMapMode.SetOrigin( aPos ); - pPrt->SetMapMode( aMapMode ); - (*ppTmpPg)->GetUpper()->Paint( (*ppTmpPg)->Frm() ); - // OD 05.05.2003 #i14016# - consider empty pages - // on calculation of the paint offset for the next page. - aCalcPt.X() += nHOffs; - if ( (*ppTmpPg)->IsEmptyPage() ) - { - if ( (*ppTmpPg)->GetPhyPageNum() % 2 == 0 ) - aCalcPt.X() += (*ppTmpPg)->GetPrev()->Frm().SSize().Width(); - else - aCalcPt.X() += (*ppTmpPg)->GetNext()->Frm().SSize().Width(); - } - else - { - aCalcPt.X() += (*ppTmpPg)->Frm().Width(); - } - ++ppTmpPg; - } - aCalcPt.Y() += nVOffs + nPageHeight; - } - pPrt->EndPage(); - SwPaintQueue::Repaint(); - - memset( aPageArr, 0, sizeof( SwPageFrm* ) * nPages ); - nCntPage = 0; - nMaxRowSz = nMaxColSz = nCalcH = nCalcW = 0; - } - } - - if( pStPage == pEndPage ) - pStPage = 0; - else if( rOptions.bPrintReverse ) - { - --nPageNo; - pStPage = (SwPageFrm*)pStPage->GetPrev(); - } + if ( pNxtPage->GetPhyPageNum() % 2 == 0 ) + aNxtPageSize = pNxtPage->GetPrev()->Frm().SSize(); else - { - ++nPageNo; - pStPage = (SwPageFrm*)pStPage->GetNext(); - } + aNxtPageSize = pNxtPage->GetNext()->Frm().SSize(); } - pPrt->SetMapMode( aOld ); - - if( bHiddenFlds ) + else { - SwMsgPoolItem aHnt( RES_HIDDENPARA_PRINT ); - pFldType->Modify( &aHnt, 0); - CalcPagesForPrint( (USHORT)aPages.Max() ); + aNxtPageSize = pNxtPage->Frm().SSize(); } - delete[] aPageArr; - - if( bStartJob ) - rOptions.bJobStartet = TRUE; } - pFntCache->Flush(); -} -// print brochure -// OD 05.05.2003 #i14016# - consider empty pages on calculation of the scaling -// for a page to be printed. -void ViewShell::PrintProspect( SwPrtOptions& rOptions, - SfxProgress& rProgress , BOOL bRTL) -{ - if( !rOptions.aMulti.GetSelectCount() ) - return; - - // wenn kein Drucker vorhanden ist, wird nicht gedruckt - SfxPrinter* pPrt = getIDocumentDeviceAccess()->getPrinter(false); - if( !pPrt || !pPrt->GetName().Len() || - ( !rOptions.bPrintLeftPage && !rOptions.bPrintRightPage )) - return; - - MultiSelection aMulti( rOptions.aMulti ); - Range aPages( aMulti.FirstSelected(), aMulti.LastSelected() ); - if ( aPages.Max() > USHRT_MAX ) - aPages.Max() = USHRT_MAX; - - ASSERT( aPages.Min() > 0, - "Seite 0 Drucken?" ); - ASSERT( aPages.Min() <= aPages.Max(), - "MinSeite groesser MaxSeite." ); - - // eine neue Shell fuer den Printer erzeugen - ViewShell aShell( *this, 0 ); - if ( &GetRefDev() == pPrt ) - aShell.mpTmpRef = new SfxPrinter( *pPrt ); - - SET_CURR_SHELL( &aShell ); - - aShell.PrepareForPrint( rOptions ); - - // gibt es versteckte Absatzfelder, unnoetig wenn die Absaetze bereits - // ausgeblendet sind. - int bHiddenFlds = FALSE; - SwFieldType* pFldType = 0; - if ( GetViewOptions()->IsShowHiddenPara() ) + if( !pStPage ) { - pFldType = getIDocumentFieldsAccess()->GetSysFldType( RES_HIDDENPARAFLD ); - bHiddenFlds = 0 != pFldType->GetDepends(); - if( bHiddenFlds ) - { - SwMsgPoolItem aHnt( RES_HIDDENPARA_PRINT ); - pFldType->Modify( &aHnt, 0); - } + nMaxColSz = 2 * aNxtPageSize.Width(); + nMaxRowSz = aNxtPageSize.Height(); } - - // Seiten fuers Drucken formatieren - aShell.CalcPagesForPrint( (USHORT)aPages.Max(), &rProgress ); - - USHORT nCopyCnt = rOptions.bCollate ? rOptions.nCopyCount : 1; - - const SwPageFrm *pStPage = (SwPageFrm*)GetLayout()->Lower(); - USHORT i; - - for( i = 1; pStPage && i < (USHORT)aPages.Min(); ++i ) - pStPage = (SwPageFrm*)pStPage->GetNext(); - - if( !pStPage ) // dann wars das + else if( !pNxtPage ) { - if( bHiddenFlds ) - { - SwMsgPoolItem aHnt( RES_HIDDENPARA_PRINT ); - pFldType->Modify( &aHnt, 0); - CalcPagesForPrint( (USHORT)aPages.Max() ); - } - return; + nMaxColSz = 2 * aSttPageSize.Width(); + nMaxRowSz = aSttPageSize.Height(); } - - // unsere SttPage haben wir, dann die EndPage suchen - SvPtrarr aArr( 255, 255 ); - aArr.Insert( (void*)pStPage, aArr.Count() ); - - while( pStPage->GetNext() && i < (USHORT)aPages.Max() ) + else { - pStPage = (SwPageFrm*)pStPage->GetNext(); - if( aMulti.IsSelected( ++i ) ) - aArr.Insert( (void*)pStPage, aArr.Count() ); + nMaxColSz = aNxtPageSize.Width() + aSttPageSize.Width(); + nMaxRowSz = Max( aNxtPageSize.Height(), aSttPageSize.Height() ); } - // auf Doppelseiten auffuellen - if( 1 == aArr.Count() ) // eine Seite ist ein Sonderfall - aArr.Insert( (void*)0, 1 ); - else + // den MapMode einstellen + aMapMode.SetOrigin( Point() ); { - while( aArr.Count() & 3 ) - aArr.Insert( (void*)0, aArr.Count() ); + Fraction aScX( aPrtSize.Width(), nMaxColSz ); + Fraction aScY( aPrtSize.Height(), nMaxRowSz ); + if( aScX < aScY ) + aScY = aScX; - if( rOptions.bPrintReverse && 4 < aArr.Count() ) { - // das Array umsortieren - // Array: 1 2 3 4 5 6 7 8 - // soll: 3 4 1 2 7 8 5 6 - // Algorhytmus: - // vordere Haelfte: Austausch von 2 Pointer von Vorne vor die Haelfte - // hintere Haelfte: Austausch von 2 Pointer von der Haelfte nach hinten - - USHORT nHalf = aArr.Count() / 2; - USHORT nSwapCount = nHalf / 4; - - VoidPtr* ppArrStt = (VoidPtr*)aArr.GetData(); - VoidPtr* ppArrHalf = (VoidPtr*)aArr.GetData() + nHalf; - - for( int nLoop = 0; nLoop < 2; ++nLoop ) - { - for( USHORT n = 0; n < nSwapCount; ++n ) - { - void* pTmp = *ppArrStt; - *ppArrStt++ = *(ppArrHalf-2); - *(ppArrHalf-2) = pTmp; - - pTmp = *ppArrStt; - *ppArrStt++ = *--ppArrHalf; - *ppArrHalf-- = pTmp; - } - ppArrStt = (VoidPtr*)aArr.GetData() + nHalf; - ppArrHalf = (VoidPtr*)aArr.GetData() + aArr.Count(); - } + // fuer Drawing, damit diese ihre Objecte vernuenftig Painten + // koennen, auf "glatte" Prozentwerte setzen + aScY *= Fraction( 1000, 1 ); + long nTmp = (long)aScY; + if( 1 < nTmp ) + --nTmp; + else + nTmp = 1; + aScY = Fraction( nTmp, 1000 ); } + + aMapMode.SetScaleY( aScY ); + aMapMode.SetScaleX( aScY ); } - BOOL bStartJob = FALSE; + Size aTmpPrtSize( pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), aMapMode ) ); - for( USHORT nCnt = 0; nCnt < nCopyCnt; nCnt++ ) + // calculate start point for equal border on all sides + Point aSttPt( (aTmpPrtSize.Width() - nMaxColSz) / 2, + (aTmpPrtSize.Height() - nMaxRowSz) / 2 ); + for( int nC = 0; nC < 2; ++nC ) { - if( rOptions.IsPrintSingleJobs() && rOptions.GetJobName().Len() && - ( bStartJob || rOptions.bJobStartet ) ) - { - pPrt->EndJob(); - rOptions.bJobStartet = TRUE; - - // Reschedule statt Yield, da Yield keine Events abarbeitet - // und es sonst eine Endlosschleife gibt. - while( pPrt->IsPrinting() ) - rProgress.Reschedule(); - - rOptions.MakeNextJobName(); - bStartJob = pPrt->StartJob( rOptions.GetJobName() ); - } - - // dann sorge mal dafuer, das alle Seiten in der richtigen - // Reihenfolge stehen: - USHORT nSPg = 0, nEPg = aArr.Count(), nStep = 1; - if( 0 == (nEPg & 1 )) // ungerade gibt es nicht! - --nEPg; - - if( !rOptions.bPrintLeftPage ) - ++nStep; - else if( !rOptions.bPrintRightPage ) + if( pStPage ) { - ++nStep; - ++nSPg, --nEPg; + aShell.Imp()->SetFirstVisPageInvalid(); + aShell.aVisArea = pStPage->Frm(); + + Point aPos( aSttPt ); + aPos -= aShell.aVisArea.Pos(); +// aPos -= aPrtOff; + aMapMode.SetOrigin( aPos ); + pPrinter->SetMapMode( aMapMode ); + pStPage->GetUpper()->Paint( pStPage->Frm() ); } - USHORT nCntPage = (( nEPg - nSPg ) / ( 2 * nStep )) + 1; + pStPage = pNxtPage; + aSttPt.X() += aTmpPrtSize.Width() / 2; + } - MapMode aOld( pPrt->GetMapMode() ); - MapMode aMapMode( MAP_TWIP ); - Size aPrtSize( pPrt->PixelToLogic( pPrt->GetPaperSizePixel(), aMapMode ) ); + SwPaintQueue::Repaint(); - const XubString aTmp( SW_RES( STR_STATSTR_PRINT ) ); - rProgress.SetText( aTmp ); - //HACK, damit die Anzeige nicht durcheinander kommt: - rProgress.SetState( 1, nCntPage ); - rProgress.SetText( aTmp ); + //!! applying/modifying view options and formatting the dcoument should now only be done in getRendererCount! + + pFntCache->Flush(); - for( USHORT nPrintCount = 0; nSPg < nEPg && - nPrintCount < nCntPage; ++nPrintCount ) - { - // Mag der Anwender noch ? - rProgress.Reschedule(); - - if ( !pPrt->IsJobActive() ) - break; - - SwTwips nMaxRowSz, nMaxColSz; - pStPage = (SwPageFrm*)aArr[ nSPg ]; - const SwPageFrm* pNxtPage = nEPg < aArr.Count() - ? (SwPageFrm*)aArr[ nEPg ] - : 0; - - // OD 05.05.2003 #i14016# - consider empty pages on calculation - // of page size, used for calculation of scaling. - Size aSttPageSize; - if ( pStPage ) - { - if ( pStPage->IsEmptyPage() ) - { - if ( pStPage->GetPhyPageNum() % 2 == 0 ) - aSttPageSize = pStPage->GetPrev()->Frm().SSize(); - else - aSttPageSize = pStPage->GetNext()->Frm().SSize(); - } - else - { - aSttPageSize = pStPage->Frm().SSize(); - } - } - Size aNxtPageSize; - if ( pNxtPage ) - { - if ( pNxtPage->IsEmptyPage() ) - { - if ( pNxtPage->GetPhyPageNum() % 2 == 0 ) - aNxtPageSize = pNxtPage->GetPrev()->Frm().SSize(); - else - aNxtPageSize = pNxtPage->GetNext()->Frm().SSize(); - } - else - { - aNxtPageSize = pNxtPage->Frm().SSize(); - } - } - - if( !pStPage ) - { - nMaxColSz = 2 * aNxtPageSize.Width(); - nMaxRowSz = aNxtPageSize.Height(); - } - else if( !pNxtPage ) - { - nMaxColSz = 2 * aSttPageSize.Width(); - nMaxRowSz = aSttPageSize.Height(); - } - else - { - nMaxColSz = aNxtPageSize.Width() + - aSttPageSize.Width(); - nMaxRowSz = Max( aNxtPageSize.Height(), - aSttPageSize.Height() ); - } - - short nRtlOfs = bRTL ? 1 : 0; - if( 0 == (( nSPg + nRtlOfs) & 1 ) ) // switch for odd number in LTR, even number in RTL - { - const SwPageFrm* pTmp = pStPage; - pStPage = pNxtPage; - pNxtPage = pTmp; - } - - // den MapMode einstellen - aMapMode.SetOrigin( Point() ); - { - Fraction aScX( aPrtSize.Width(), nMaxColSz ); - Fraction aScY( aPrtSize.Height(), nMaxRowSz ); - if( aScX < aScY ) - aScY = aScX; - - { - // fuer Drawing, damit diese ihre Objecte vernuenftig Painten - // koennen, auf "glatte" Prozentwerte setzen - aScY *= Fraction( 1000, 1 ); - long nTmp = (long)aScY; - if( 1 < nTmp ) - --nTmp; - else - nTmp = 1; - aScY = Fraction( nTmp, 1000 ); - } - - aMapMode.SetScaleY( aScY ); - aMapMode.SetScaleX( aScY ); - } - - Point aPrtOff( pPrt->PixelToLogic( - pPrt->GetPageOffsetPixel(), aMapMode ) ); - Size aTmpPrtSize( pPrt->PixelToLogic( - pPrt->GetPaperSizePixel(), aMapMode ) ); - - // dann kann das drucken losgehen - bStartJob = TRUE; - rProgress.SetState( nPrintCount, nCntPage ); - - pPrt->StartPage(); - - Point aSttPt; - for( int nC = 0; nC < 2; ++nC ) - { - if( pStPage ) - { - aShell.Imp()->SetFirstVisPageInvalid(); - aShell.aVisArea = pStPage->Frm(); - - Point aPos( aSttPt ); - aPos -= aShell.aVisArea.Pos(); - aPos -= aPrtOff; - aMapMode.SetOrigin( aPos ); - pPrt->SetMapMode( aMapMode ); - pStPage->GetUpper()->Paint( pStPage->Frm() ); - } - - pStPage = pNxtPage; - aSttPt.X() += aTmpPrtSize.Width() / 2; - } - - pPrt->EndPage(); - SwPaintQueue::Repaint(); - nSPg = nSPg + nStep; - nEPg = nEPg - nStep; - } - pPrt->SetMapMode( aOld ); + // restore settings of OutputDevice (should be done always now since the + // output device is now provided by a call from outside the Writer) + pPrinter->Pop(); +} - if( bHiddenFlds ) - { - SwMsgPoolItem aHnt( RES_HIDDENPARA_PRINT ); - pFldType->Modify( &aHnt, 0); - CalcPagesForPrint( (USHORT)aPages.Max() ); - } - if( bStartJob ) - rOptions.bJobStartet = TRUE; - } - pFntCache->Flush(); -} diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index c0a45fbb4e..7d280ff1b6 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -376,6 +376,37 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd ) // #i75172# end DrawingLayer paint DLPostPaint2(true); } + + // --> OD 2009-12-03 #i107365# + // Direct paint has been performed. Thus, take care of + // transparent child windows. + if ( GetWin() ) + { + Window& rWindow = *(GetWin()); + if(rWindow.IsChildTransparentModeEnabled() && rWindow.GetChildCount()) + { + const Rectangle aRectanglePixel(rWindow.LogicToPixel(aRect.SVRect())); + + for ( sal_uInt16 a(0); a < rWindow.GetChildCount(); a++ ) + { + Window* pCandidate = rWindow.GetChild(a); + + if ( pCandidate && pCandidate->IsPaintTransparent() ) + { + const Rectangle aCandidatePosSizePixel( + pCandidate->GetPosPixel(), + pCandidate->GetSizePixel()); + + if ( aCandidatePosSizePixel.IsOver(aRectanglePixel) ) + { + pCandidate->Invalidate( INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN ); + pCandidate->Update(); + } + } + } + } + } + // <-- } delete pVout; @@ -407,7 +438,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd ) UISizeNotify(); ++nStartAction; -#ifndef PRODUCT +#ifdef DBG_UTIL // test option 'No Scroll' suppresses the automatic repair of the scrolled area if ( !GetViewOptions()->IsTest8() ) #endif @@ -589,7 +620,7 @@ void ViewShell::MakeVisible( const SwRect &rRect ) EndAction(); } while( nOldH != pRoot->Frm().Height() && nLoopCnt-- ); } -#ifndef PRODUCT +#ifdef DBG_UTIL else { //MA: 04. Nov. 94, braucht doch keiner oder?? @@ -746,7 +777,7 @@ void ViewShell::LayoutIdle() SET_CURR_SHELL( this ); -#ifndef PRODUCT +#ifdef DBG_UTIL // Wenn Test5 gedrueckt ist, wird der IdleFormatierer abgeknipst. if( pOpt->IsTest5() ) return; @@ -1146,7 +1177,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect) if ( rRect == VisArea() ) return; -#ifndef PRODUCT +#ifdef DBG_UTIL if ( bInEndAction ) { //Da Rescheduled doch schon wieder irgendwo einer? diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index afae44310b..b10bae4795 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -116,11 +116,8 @@ void ViewShell::Init( const SwViewOption *pNewOpt ) // Only setup the printer if we need one: const IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); const bool bBrowseMode = pIDSA->get(IDocumentSettingAccess::BROWSE_MODE); - const bool bCreatePrinter = !bBrowseMode && - !pIDSA->get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE); - SfxPrinter* pPrinter = getIDocumentDeviceAccess()->getPrinter( bCreatePrinter ); - if( pPrinter ) - InitPrt( pPrinter, pPDFOut ); + if( pPDFOut ) + InitPrt( pPDFOut ); // <-- // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 3ae5a3b5ba..b90e3f666b 100644..100755 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -33,11 +33,19 @@ #include "precompiled_sw.hxx" +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/uno/Any.hxx> + #include <hintids.hxx> +#include <vcl/oldprintadaptor.hxx> #include <sfx2/printer.hxx> #include <sfx2/objsh.hxx> +#include <tools/resary.hxx> +#include <tools/debug.hxx> +#include <rtl/ustring.hxx> +#include <toolkit/awt/vclxdevice.hxx> +#include <toolkit/awt/vclxdevice.hxx> -// #include <tools/intn.hxx> #include <sfx2/progress.hxx> #include <sfx2/app.hxx> #include <sfx2/prnmon.hxx> @@ -45,7 +53,17 @@ #include <svx/pbinitem.hxx> #include <svx/svdview.hxx> #include <unotools/localedatawrapper.hxx> -#include <svtools/syslocale.hxx> + +#include <unotools/moduleoptions.hxx> +#include <svl/languageoptions.hxx> + +#include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/view/XRenderable.hpp> + +#include <unotxdoc.hxx> + +#include <docsh.hxx> +#include <unotools/syslocale.hxx> #include <txtfld.hxx> #include <fmtfld.hxx> #include <fmtfsize.hxx> @@ -54,14 +72,15 @@ #include <pagefrm.hxx> #include <cntfrm.hxx> #include <doc.hxx> +#include <wdocsh.hxx> #include <fesh.hxx> #include <pam.hxx> #include <viewimp.hxx> // Imp->SetFirstVisPageInvalid() #include <layact.hxx> #include <ndtxt.hxx> #include <fldbas.hxx> -#include <docufld.hxx> // PostItFld /-Type #include <docfld.hxx> // _SetGetExpFld +#include <docufld.hxx> // PostItFld /-Type #include <shellres.hxx> #include <viewopt.hxx> #include <swprtopt.hxx> // SwPrtOptions @@ -76,11 +95,18 @@ #include <txtfrm.hxx> // MinPrtLine #include <viscrs.hxx> // SwShellCrsr #include <fmtpdsc.hxx> // SwFmtPageDesc +#include <globals.hrc> #define JOBSET_ERR_DEFAULT 0 #define JOBSET_ERR_ERROR 1 #define JOBSET_ERR_ISSTARTET 2 + +extern bool lcl_GetPostIts( IDocumentFieldsAccess* pIDFA, _SetGetExpFlds * pSrtLst ); + + +using namespace ::com::sun::star; + //-------------------------------------------------------------------- //Klasse zum Puffern von Paints class SwQueuedPaint @@ -99,19 +125,6 @@ public: SwQueuedPaint *SwPaintQueue::pQueue = 0; -//Klasse zum Speichern einiger Druckereinstellungen -class SwPrtOptSave -{ - Printer *pPrt; - Size aSize; - Paper ePaper; - Orientation eOrientation; - USHORT nPaperBin; -public: - SwPrtOptSave( Printer *pPrinter ); - ~SwPrtOptSave(); -}; - // saves some settings from the draw view class SwDrawViewSave { @@ -201,6 +214,7 @@ void SwPaintQueue::Remove( ViewShell *pSh ) } } +/*****************************************************************************/ const XubString& SwPrtOptions::MakeNextJobName() { @@ -214,340 +228,538 @@ const XubString& SwPrtOptions::MakeNextJobName() return sJobName += XubString::CreateFromInt32( ++nJobNo ); } -/****************************************************************************** - * Methode : void SetSwVisArea( ViewShell *pSh, Point aPrtOffset, ... - * Beschreibung: - * Erstellt : OK 04.11.94 16:27 - * Aenderung : - ******************************************************************************/ +/*****************************************************************************/ -void SetSwVisArea( ViewShell *pSh, const SwRect &rRect, BOOL bPDFExport ) +SwRenderData::SwRenderData() { - ASSERT( !pSh->GetWin(), "Drucken mit Window?" ); - pSh->aVisArea = rRect; - pSh->Imp()->SetFirstVisPageInvalid(); - Point aPt( rRect.Pos() ); - - if (!bPDFExport) - aPt += pSh->aPrtOffst; - aPt.X() = -aPt.X(); aPt.Y() = -aPt.Y(); + m_pPostItFields = 0; + m_pPostItDoc = 0; + m_pPostItShell = 0; - OutputDevice *pOut = bPDFExport ? - pSh->GetOut() : - pSh->getIDocumentDeviceAccess()->getPrinter( false ); - - MapMode aMapMode( pOut->GetMapMode() ); - aMapMode.SetOrigin( aPt ); - pOut->SetMapMode( aMapMode ); + m_pViewOptionAdjust = 0; + m_pPrtOptions = 0; } -/****************************************************************************** - * Methode : struct _PostItFld : public _SetGetExpFld - * Beschreibung: Update an das PostItFeld - * Erstellt : OK 07.11.94 10:18 - * Aenderung : - ******************************************************************************/ -struct _PostItFld : public _SetGetExpFld + +SwRenderData::~SwRenderData() { - _PostItFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld, - const SwIndex* pIdx = 0 ) - : _SetGetExpFld( rNdIdx, pFld, pIdx ) {} - - USHORT GetPageNo( MultiSelection &rMulti, BOOL bRgt, BOOL bLft, - USHORT& rVirtPgNo, USHORT& rLineNo ); - SwPostItField* GetPostIt() const - { return (SwPostItField*) GetFld()->GetFld().GetFld(); } -}; + delete m_pViewOptionAdjust; m_pViewOptionAdjust = 0; + delete m_pPrtOptions; m_pPrtOptions = 0; + DBG_ASSERT( !m_pPostItShell, "m_pPostItShell should already have been deleted" ); + DBG_ASSERT( !m_pPostItDoc, "m_pPostItDoc should already have been deleted" ); + DBG_ASSERT( !m_pPostItFields, " should already have been deleted" ); +} +void SwRenderData::CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev ) +{ + DBG_ASSERT( !m_pPostItFields && !m_pPostItDoc && !m_pPostItShell, "some post-it data already exists" ); + m_pPostItFields = new _SetGetExpFlds; + lcl_GetPostIts( pDoc, m_pPostItFields ); + m_pPostItDoc = new SwDoc; + + //!! Disable spell and grammar checking in the temporary document. + //!! Otherwise the grammar checker might process it and crash if we later on + //!! simply delete this document while he is still at it. + SwViewOption aViewOpt( *pViewOpt ); + aViewOpt.SetOnlineSpell( FALSE ); + + m_pPostItShell = new ViewShell( *m_pPostItDoc, 0, &aViewOpt, pOutDev ); +} + -USHORT _PostItFld::GetPageNo( MultiSelection &rMulti, BOOL bRgt, BOOL bLft, - USHORT& rVirtPgNo, USHORT& rLineNo ) +void SwRenderData::DeletePostItData() { - //Problem: Wenn ein PostItFld in einem Node steht, der von mehr als - //einer Layout-Instanz repraesentiert wird, steht die Frage im Raum, - //ob das PostIt nur ein- oder n-mal gedruck werden soll. - //Wahrscheinlich nur einmal, als Seitennummer soll hier keine Zufaellige - //sondern die des ersten Auftretens des PostIts innerhalb des selektierten - //Bereichs ermittelt werden. - rVirtPgNo = 0; - USHORT nPos = GetCntnt(); - SwClientIter aIter( (SwModify &)GetFld()->GetTxtNode() ); - for( SwTxtFrm* pFrm = (SwTxtFrm*)aIter.First( TYPE( SwFrm )); - pFrm; pFrm = (SwTxtFrm*)aIter.Next() ) + if (HasPostItData()) { - if( pFrm->GetOfst() > nPos || - (pFrm->HasFollow() && pFrm->GetFollow()->GetOfst() <= nPos) ) - continue; - USHORT nPgNo = pFrm->GetPhyPageNum(); - BOOL bRight = pFrm->OnRightPage(); - if( rMulti.IsSelected( nPgNo ) && - ( (bRight && bRgt) || (!bRight && bLft) ) ) - { - rLineNo = (USHORT)(pFrm->GetLineCount( nPos ) + - pFrm->GetAllLines() - pFrm->GetThisLines()); - rVirtPgNo = pFrm->GetVirtPageNum(); - return nPgNo; - } + m_pPostItDoc->setPrinter( 0, false, false ); //damit am echten DOC der Drucker bleibt + delete m_pPostItShell; //Nimmt das PostItDoc mit ins Grab. + delete m_pPostItFields; + m_pPostItDoc = 0; + m_pPostItShell = 0; + m_pPostItFields = 0; } - return 0; -} - -/****************************************************************************** - * Methode : void lcl_GetPostIts( IDocumentFieldsAccess* pIDFA, _SetGetExpFlds& ... - * Beschreibung: - * Erstellt : OK 07.11.94 10:20 - * Aenderung : - ******************************************************************************/ +} -void lcl_GetPostIts( IDocumentFieldsAccess* pIDFA, _SetGetExpFlds& rSrtLst ) +void SwRenderData::ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions ) { - SwFieldType* pFldType = pIDFA->GetSysFldType( RES_POSTITFLD ); - ASSERT( pFldType, "kein PostItType ? "); - - if( pFldType->GetDepends() ) + if (m_pViewOptionAdjust) { - // Modify-Object gefunden, trage alle Felder ins Array ein - SwClientIter aIter( *pFldType ); - SwClient* pLast; - const SwTxtFld* pTxtFld; - - for( pLast = aIter.First( TYPE(SwFmtFld)); pLast; pLast = aIter.Next() ) - if( 0 != ( pTxtFld = ((SwFmtFld*)pLast)->GetTxtFld() ) && - pTxtFld->GetTxtNode().GetNodes().IsDocNodes() ) - { - SwNodeIndex aIdx( pTxtFld->GetTxtNode() ); - _PostItFld* pNew = new _PostItFld( aIdx, pTxtFld ); - rSrtLst.Insert( pNew ); - } + DBG_ASSERT( 0, "error: there should be no ViewOptionAdjust active when calling this function" ); } + m_pViewOptionAdjust = new SwViewOptionAdjust_Impl( rSh, rViewOptions ); } + -/****************************************************************************** - * Methode : void lcl_FormatPostIt( IDocumentContentOperations* pIDCO, SwPaM& aPam, ... - * Beschreibung: - * Erstellt : OK 07.11.94 10:20 - * Aenderung : - ******************************************************************************/ - - -void lcl_FormatPostIt( IDocumentContentOperations* pIDCO, SwPaM& aPam, SwPostItField* pField, - USHORT nPageNo, USHORT nLineNo ) +void SwRenderData::ViewOptionAdjust( const SwPrtOptions *pPrtOptions ) { - static char __READONLY_DATA sTmp[] = " : "; - - ASSERT( ViewShell::GetShellRes(), "missing ShellRes" ); + m_pViewOptionAdjust->AdjustViewOptions( pPrtOptions ); +} - String aStr( ViewShell::GetShellRes()->aPostItPage ); - aStr.AppendAscii(sTmp); - aStr += XubString::CreateFromInt32( nPageNo ); - aStr += ' '; - if( nLineNo ) +void SwRenderData::ViewOptionAdjustStop() +{ + if (m_pViewOptionAdjust) { - aStr += ViewShell::GetShellRes()->aPostItLine; - aStr.AppendAscii(sTmp); - aStr += XubString::CreateFromInt32( nLineNo ); - aStr += ' '; - } - aStr += ViewShell::GetShellRes()->aPostItAuthor; - aStr.AppendAscii(sTmp); - aStr += pField->GetPar1(); - aStr += ' '; - aStr += SvtSysLocale().GetLocaleData().getDate( pField->GetDate() ); - pIDCO->InsertString( aPam, aStr ); - - pIDCO->SplitNode( *aPam.GetPoint(), false ); - aStr = pField->GetPar2(); -#if defined( WIN ) || defined( WNT ) || defined( PM2 ) - // Bei Windows und Co alle CR rausschmeissen - aStr.EraseAllChars( '\r' ); -#endif - pIDCO->InsertString( aPam, aStr ); - pIDCO->SplitNode( *aPam.GetPoint(), false ); - pIDCO->SplitNode( *aPam.GetPoint(), false ); + delete m_pViewOptionAdjust; + m_pViewOptionAdjust = 0; + } } -/****************************************************************************** - * Methode : void lcl_PrintPostIts( ViewShell* pPrtShell ) - * Beschreibung: - * Erstellt : OK 07.11.94 10:21 - * Aenderung : MA 10. May. 95 - ******************************************************************************/ +void SwRenderData::MakeSwPrtOptions( + SwPrtOptions &rOptions, + const SwDocShell *pDocShell, + const SwPrintUIOptions *pOpt, + const SwRenderData *pData, + bool bIsPDFExport ) +{ + if (!pDocShell || !pOpt || !pData) + return; + + // get default print options + const TypeId aSwWebDocShellTypeId = TYPE(SwWebDocShell); + BOOL bWeb = pDocShell->IsA( aSwWebDocShellTypeId ); + rOptions.MakeOptions( bWeb ); + + // get print options to use from provided properties + rOptions.bPrintGraphic = pOpt->IsPrintGraphics(); + rOptions.bPrintTable = pOpt->IsPrintTables(); + rOptions.bPrintDraw = pOpt->IsPrintDrawings(); + rOptions.bPrintControl = pOpt->IsPrintFormControls(); + rOptions.bPrintLeftPages = pOpt->IsPrintLeftPages(); + rOptions.bPrintRightPages = pOpt->IsPrintRightPages(); + rOptions.bPrintPageBackground = pOpt->IsPrintPageBackground(); + rOptions.bPrintEmptyPages = pOpt->IsPrintEmptyPages( bIsPDFExport ); + // bUpdateFieldsInPrinting <-- not set here; mail merge only + rOptions.bPaperFromSetup = pOpt->IsPaperFromSetup(); + rOptions.bPrintReverse = pOpt->IsPrintReverse(); + rOptions.bPrintProspect = pOpt->IsPrintProspect(); + rOptions.bPrintProspectRTL = pOpt->IsPrintProspectRTL(); + // bPrintSingleJobs <-- not set here; mail merge and or configuration + // bModified <-- not set here; mail merge only + rOptions.bPrintBlackFont = pOpt->IsPrintWithBlackTextColor(); + rOptions.bPrintHiddenText = pOpt->IsPrintHiddenText(); + rOptions.bPrintTextPlaceholder = pOpt->IsPrintTextPlaceholders(); + rOptions.nPrintPostIts = pOpt->GetPrintPostItsType(); + + //! needs to be set after MakeOptions since the assignment operation in that + //! function will destroy the pointers + rOptions.SetPrintUIOptions( pOpt ); + rOptions.SetRenderData( pData ); + + // rOptions.aMulti is not used anymore in the XRenderable API + // Thus we set it to a dummy value here. + rOptions.aMulti = MultiSelection( Range( 1, 1 ) ); -void lcl_PrintPostIts( ViewShell* pPrtShell, const XubString& rJobName, - BOOL& rStartJob, int& rJobStartError, BOOL bReverse) + //! Note: Since for PDF export of (multi-)selection a temporary + //! document is created that contains only the selects parts, + //! and thus that document is to printed in whole the, + //! rOptions.bPrintSelection parameter will be false. + if (bIsPDFExport) + rOptions.bPrintSelection = FALSE; +} + + +/*****************************************************************************/ + +SwPrintUIOptions::SwPrintUIOptions( + bool bWeb, + bool bSwSrcView, + bool bHasSelection, + bool bHasPostIts, + const SwPrintData &rDefaultPrintData ) : + m_pLast( NULL ), + m_rDefaultPrintData( rDefaultPrintData ) { - // Formatieren und Ausdrucken - pPrtShell->CalcLayout(); + ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) ); - SfxPrinter* pPrn = pPrtShell->getIDocumentDeviceAccess()->getPrinter( false ); + DBG_ASSERT( aLocalizedStrings.Count() >= 44, "resource incomplete" ); + if( aLocalizedStrings.Count() < 44 ) // bad resource ? + return; + + // printing HTML sources does not have any valid UI options. + // Its just the source code that gets printed ... + if (bSwSrcView) + { + m_aUIProperties.realloc( 0 ); + return; + } + + // check if CTL is enabled + SvtLanguageOptions aLangOpt; + bool bCTL = aLangOpt.IsCTLFontEnabled(); + + // create sequence of print UI options + // (5 options are not available for Writer-Web) + const int nCTLOpts = bCTL ? 1 : 0; + const int nNumProps = nCTLOpts + (bWeb ? 14 : 20); + m_aUIProperties.realloc( nNumProps ); + int nIdx = 0; + + // create "writer" section (new tab page in dialog) + SvtModuleOptions aModOpt; + String aAppGroupname( aLocalizedStrings.GetString( 0 ) ); + aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), + aModOpt.GetModuleName( SvtModuleOptions::E_SWRITER ) ); + m_aUIProperties[ nIdx++ ].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() ); + + // create sub section for Contents + m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 1 ), rtl::OUString() ); + + // create a bool option for background + bool bDefaultVal = rDefaultPrintData.IsPrintPageBackground(); + m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ), + aLocalizedStrings.GetString( 3 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPageBackground" ) ), + bDefaultVal ); + + // create a bool option for pictures/graphics AND OLE and drawing objects as well + bDefaultVal = rDefaultPrintData.IsPrintGraphic() || rDefaultPrintData.IsPrintDraw(); + m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ), + aLocalizedStrings.GetString( 5 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPicturesAndObjects" ) ), + bDefaultVal ); + if (!bWeb) + { + // create a bool option for hidden text + bDefaultVal = rDefaultPrintData.IsPrintHiddenText(); + m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ), + aLocalizedStrings.GetString( 7 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintHiddenText" ) ), + bDefaultVal ); + + // create a bool option for place holder + bDefaultVal = rDefaultPrintData.IsPrintTextPlaceholder(); + m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 8 ), + aLocalizedStrings.GetString( 9 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintTextPlaceholder" ) ), + bDefaultVal ); + } - //Das Druckdokument ist ein default Dokument, mithin arbeitet es auf der - //StandardSeite. - SwFrm *pPage = pPrtShell->GetLayout()->Lower(); + // create a bool option for controls + bDefaultVal = rDefaultPrintData.IsPrintControl(); + m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 10 ), + aLocalizedStrings.GetString( 11 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintControls" ) ), + bDefaultVal ); - SwPrtOptSave aPrtSave( pPrn ); + // create sub section for Color + m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 12 ), rtl::OUString() ); - pPrn->SetOrientation( ORIENTATION_PORTRAIT ); - pPrn->SetPaperBin( pPage->GetAttrSet()->GetPaperBin().GetValue() ); + // create a bool option for printing text with black font color + bDefaultVal = rDefaultPrintData.IsPrintBlackFont(); + m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 13 ), + aLocalizedStrings.GetString( 14 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBlackFonts" ) ), + bDefaultVal ); - if( !rStartJob && JOBSET_ERR_DEFAULT == rJobStartError && - rJobName.Len() ) + if (!bWeb) { - if( !pPrn->IsJobActive() ) - { - rStartJob = pPrn->StartJob( rJobName ); - if( !rStartJob ) - { - rJobStartError = JOBSET_ERR_ERROR; - return; - } - } - pPrtShell->InitPrt( pPrn ); - rJobStartError = JOBSET_ERR_ISSTARTET; + // create subgroup for misc options + m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 15 ) ), rtl::OUString() ); + + // create a bool option for printing automatically inserted blank pages + bDefaultVal = rDefaultPrintData.IsPrintEmptyPages(); + m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 16 ), + aLocalizedStrings.GetString( 17 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintEmptyPages" ) ), + bDefaultVal ); } - // Wir koennen auch rueckwaerts: - if ( bReverse ) - pPage = pPrtShell->GetLayout()->GetLastPage(); - - while( pPage ) + // create a bool option for paper tray + bDefaultVal = rDefaultPrintData.IsPaperFromSetup(); + vcl::PrinterOptionsHelper::UIControlOptions aPaperTrayOpt; + aPaperTrayOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OptionsPageOptGroup" ) ); + m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 18 ), + aLocalizedStrings.GetString( 19 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPaperFromSetup" ) ), + bDefaultVal, + aPaperTrayOpt + ); + + // print range selection + vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt; + aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) ); + aPrintRangeOpt.mbInternalOnly = sal_True; + m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 37 ) ), + rtl::OUString(), + aPrintRangeOpt + ); + + // create a choice for the content to create + rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ); + uno::Sequence< rtl::OUString > aChoices( bHasSelection ? 3 : 2 ); + uno::Sequence< rtl::OUString > aHelpText( bHasSelection ? 3 : 2 ); + aChoices[0] = aLocalizedStrings.GetString( 38 ); + aHelpText[0] = aLocalizedStrings.GetString( 39 ); + aChoices[1] = aLocalizedStrings.GetString( 40 ); + aHelpText[1] = aLocalizedStrings.GetString( 41 ); + if (bHasSelection) { - //Mag der Anwender noch?, Abbruch erst in Prt() - GetpApp()->Reschedule(); - ::SetSwVisArea( pPrtShell, pPage->Frm() ); - pPrn->StartPage(); - pPage->GetUpper()->Paint( pPage->Frm() ); -// SFX_APP()->SpoilDemoOutput( *pPrtShell->GetOut(), pPage->Frm().SVRect()); - SwPaintQueue::Repaint(); - pPrn->EndPage(); - pPage = bReverse ? pPage->GetPrev() : pPage->GetNext(); + aChoices[2] = aLocalizedStrings.GetString( 42 ); + aHelpText[2] = aLocalizedStrings.GetString( 43 ); } -} + m_aUIProperties[nIdx++].Value = getChoiceControlOpt( rtl::OUString(), + aHelpText, + aPrintRangeName, + aChoices, + bHasSelection ? 2 /*enable 'Selection' radio button*/ : 0 /* enable 'All pages' */); + // create a an Edit dependent on "Pages" selected + vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True ); + m_aUIProperties[nIdx++].Value = getEditControlOpt( rtl::OUString(), + rtl::OUString(), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), + rtl::OUString(), + aPageRangeOpt + ); + // print content selection + vcl::PrinterOptionsHelper::UIControlOptions aContentsOpt; + aContentsOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobPage" ) ); + m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 20 ) ), + rtl::OUString(), + aContentsOpt + ); + // create a list box for notes content + const sal_Int16 nPrintPostIts = rDefaultPrintData.GetPrintPostIts(); + aChoices.realloc( 4 ); + aChoices[0] = aLocalizedStrings.GetString( 21 ); + aChoices[1] = aLocalizedStrings.GetString( 22 ); + aChoices[2] = aLocalizedStrings.GetString( 23 ); + aChoices[3] = aLocalizedStrings.GetString( 24 ); + aHelpText.realloc( 2 ); + aHelpText[0] = aLocalizedStrings.GetString( 25 ); + aHelpText[1] = aLocalizedStrings.GetString( 25 ); + vcl::PrinterOptionsHelper::UIControlOptions aAnnotOpt( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ), 0, sal_False ); + aAnnotOpt.mbEnabled = bHasPostIts; + m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 26 ), + aHelpText, + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintAnnotationMode" ) ), + aChoices, + nPrintPostIts, + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ), + aAnnotOpt + ); + + // create subsection for Page settings + vcl::PrinterOptionsHelper::UIControlOptions aPageSetOpt; + aPageSetOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutPage" ) ); + + if (!bWeb) + { + m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 27 ) ), + rtl::OUString(), + aPageSetOpt + ); + uno::Sequence< rtl::OUString > aRLChoices( 3 ); + aRLChoices[0] = aLocalizedStrings.GetString( 28 ); + aRLChoices[1] = aLocalizedStrings.GetString( 29 ); + aRLChoices[2] = aLocalizedStrings.GetString( 30 ); + uno::Sequence< rtl::OUString > aRLHelp( 1 ); + aRLHelp[0] = aLocalizedStrings.GetString( 31 ); + // create a choice option for all/left/right pages + // 0 : all pages (left & right) + // 1 : left pages + // 2 : right pages + DBG_ASSERT( rDefaultPrintData.IsPrintLeftPage() || rDefaultPrintData.IsPrintRightPage(), + "unexpected value combination" ); + sal_Int16 nPagesChoice = 0; + if (rDefaultPrintData.IsPrintLeftPage() && !rDefaultPrintData.IsPrintRightPage()) + nPagesChoice = 1; + else if (!rDefaultPrintData.IsPrintLeftPage() && rDefaultPrintData.IsPrintRightPage()) + nPagesChoice = 2; + m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 32 ), + aRLHelp, + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintLeftRightPages" ) ), + aRLChoices, + nPagesChoice, + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ) + ); + } + + // create a bool option for brochure + bDefaultVal = rDefaultPrintData.IsPrintProspect(); + rtl::OUString aBrochurePropertyName( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ); + m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 33 ), + aLocalizedStrings.GetString( 34 ), + aBrochurePropertyName, + bDefaultVal, + aPageSetOpt + ); + + if (bCTL) + { + // create a bool option for brochure RTL dependent on brochure + uno::Sequence< rtl::OUString > aBRTLChoices( 2 ); + aBRTLChoices[0] = aLocalizedStrings.GetString( 35 ); + aBRTLChoices[1] = aLocalizedStrings.GetString( 36 ); + vcl::PrinterOptionsHelper::UIControlOptions aBrochureRTLOpt( aBrochurePropertyName, -1, sal_True ); + aBrochureRTLOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutPage" ) ); + // RTL brochure choices + // 0 : left-to-right + // 1 : right-to-left + const sal_Int16 nBRTLChoice = rDefaultPrintData.IsPrintProspectRTL() ? 1 : 0; + m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( rtl::OUString(), + uno::Sequence< rtl::OUString >(), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspectRTL" ) ), + aBRTLChoices, + nBRTLChoice, + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ), + aBrochureRTLOpt + ); + } + -/****************************************************************************** - * Methode : void lcl_PrintPostItsEndDoc( ViewShell* pPrtShell, ... - * Beschreibung: - * Erstellt : OK 07.11.94 10:21 - * Aenderung : MA 10. May. 95 - ******************************************************************************/ + DBG_ASSERT( nIdx == nNumProps, "number of added properties is not as expected" ); +} -void lcl_PrintPostItsEndDoc( ViewShell* pPrtShell, - _SetGetExpFlds& rPostItFields, MultiSelection &rMulti, - const XubString& rJobName, BOOL& rStartJob, int& rJobStartError, - BOOL bRgt, BOOL bLft, BOOL bRev ) +SwPrintUIOptions::~SwPrintUIOptions() { - USHORT nPostIts = rPostItFields.Count(); - if( !nPostIts ) - // Keine Arbeit - return; +} + +bool SwPrintUIOptions::IsPrintLeftPages() const +{ + // take care of different property names for the option. + // for compatibility the old name should win (may still be used for PDF export or via Uno API) + + // 0: left and right pages + // 1: left pages only + // 2: right pages only + sal_Int64 nLRPages = getIntValue( "PrintLeftRightPages", 0 /* default: all */ ); + bool bRes = nLRPages == 0 || nLRPages == 1; + bRes = getBoolValue( "PrintLeftPages", bRes /* <- default value if property is not found */ ); + return bRes; +} - SET_CURR_SHELL( pPrtShell ); +bool SwPrintUIOptions::IsPrintRightPages() const +{ + // take care of different property names for the option. + // for compatibility the old name should win (may still be used for PDF export or via Uno API) - SwDoc* pPrtDoc = pPrtShell->GetDoc(); + sal_Int64 nLRPages = getIntValue( "PrintLeftRightPages", 0 /* default: all */ ); + bool bRes = nLRPages == 0 || nLRPages == 2; + bRes = getBoolValue( "PrintRightPages", bRes /* <- default value if property is not found */ ); + return bRes; +} - // Dokument leeren und ans Dokumentende gehen - SwPaM aPam( pPrtDoc->GetNodes().GetEndOfContent() ); - aPam.Move( fnMoveBackward, fnGoDoc ); - aPam.SetMark(); - aPam.Move( fnMoveForward, fnGoDoc ); - pPrtDoc->DeleteRange( aPam ); +bool SwPrintUIOptions::IsPrintEmptyPages( bool bIsPDFExport ) const +{ + // take care of different property names for the option. - for( USHORT i = 0, nVirtPg, nLineNo; i < nPostIts; ++i ) - { - _PostItFld& rPostIt = (_PostItFld&)*rPostItFields[ i ]; - if( rPostIt.GetPageNo( rMulti, bRgt, bLft, nVirtPg, nLineNo ) ) - lcl_FormatPostIt( pPrtShell->GetDoc(), aPam, - rPostIt.GetPostIt(), nVirtPg, nLineNo ); - } + bool bRes = bIsPDFExport ? + !getBoolValue( "IsSkipEmptyPages", sal_True ) : + getBoolValue( "PrintEmptyPages", sal_True ); + return bRes; +} - lcl_PrintPostIts( pPrtShell, rJobName, rStartJob, rJobStartError, bRev ); +bool SwPrintUIOptions::IsPrintTables() const +{ + // take care of different property names currently in use for this option. + // for compatibility the old name should win (may still be used for PDF export or via Uno API) + +// bool bRes = getBoolValue( "PrintTablesGraphicsAndDiagrams", sal_True ); +// bRes = getBoolValue( "PrintTables", bRes ); +// return bRes; + // for now it was decided that tables should always be printed + return true; } -/****************************************************************************** - * Methode : void lcl_PrintPostItsEndPage( ViewShell* pPrtShell, ... - * Beschreibung: - * Erstellt : OK 07.11.94 10:22 - * Aenderung : - ******************************************************************************/ +bool SwPrintUIOptions::IsPrintGraphics() const +{ + // take care of different property names for the option. + // for compatibility the old name should win (may still be used for PDF export or via Uno API) + bool bRes = getBoolValue( "PrintPicturesAndObjects", sal_True ); + bRes = getBoolValue( "PrintGraphics", bRes ); + return bRes; +} -void lcl_PrintPostItsEndPage( ViewShell* pPrtShell, - _SetGetExpFlds& rPostItFields, USHORT nPageNo, MultiSelection &rMulti, - const XubString& rJobName, BOOL& rStartJob, int& rJobStartError, - BOOL bRgt, BOOL bLft, BOOL bRev ) +bool SwPrintUIOptions::IsPrintDrawings() const { - USHORT nPostIts = rPostItFields.Count(); - if( !nPostIts ) - // Keine Arbeit - return; + // take care of different property names for the option. + // for compatibility the old name should win (may still be used for PDF export or via Uno API) - SET_CURR_SHELL( pPrtShell ); - - USHORT i = 0, nVirtPg, nLineNo; - while( ( i < nPostIts ) && - ( nPageNo != ((_PostItFld&)*rPostItFields[ i ]). - GetPageNo( rMulti,bRgt, bLft, nVirtPg, nLineNo ))) - ++i; - if(i == nPostIts) - // Nix zu drucken - return; + bool bRes = getBoolValue( "PrintPicturesAndObjects", sal_True ); + bRes = getBoolValue( "PrintDrawings", bRes ); + return bRes; +} - SwDoc* pPrtDoc = pPrtShell->GetDoc(); +bool SwPrintUIOptions::processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ) +{ + bool bChanged = processProperties( i_rNewProp ); - // Dokument leeren und ans Dokumentende gehen - SwPaM aPam( pPrtDoc->GetNodes().GetEndOfContent() ); - aPam.Move( fnMoveBackward, fnGoDoc ); - aPam.SetMark(); - aPam.Move( fnMoveForward, fnGoDoc ); - pPrtDoc->DeleteRange( aPam ); + uno::Reference< awt::XDevice > xRenderDevice; + uno::Any aVal( getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ) ) ); + aVal >>= xRenderDevice; - while( i < nPostIts ) + OutputDevice* pOut = 0; + if (xRenderDevice.is()) { - _PostItFld& rPostIt = (_PostItFld&)*rPostItFields[ i ]; - if( nPageNo == rPostIt.GetPageNo( rMulti, bRgt, bLft, nVirtPg, nLineNo ) ) - lcl_FormatPostIt( pPrtShell->GetDoc(), aPam, - rPostIt.GetPostIt(), nVirtPg, nLineNo ); - ++i; + VCLXDevice* pDevice = VCLXDevice::GetImplementation( xRenderDevice ); + pOut = pDevice ? pDevice->GetOutputDevice() : 0; } - lcl_PrintPostIts( pPrtShell, rJobName, rStartJob, rJobStartError, bRev ); + bChanged = bChanged || (pOut != m_pLast); + if( pOut ) + m_pLast = pOut; + + return bChanged; } + /****************************************************************************** - * Methode : void ViewShell::InitPrt( SfxPrinter *pNew, OutputDevice *pPDFOut ) + * Methode : void SetSwVisArea( ViewShell *pSh, Point aPrtOffset, ... * Beschreibung: - * Erstellt : OK 07.11.94 10:22 + * Erstellt : OK 04.11.94 16:27 * Aenderung : ******************************************************************************/ -void ViewShell::InitPrt( SfxPrinter *pPrt, OutputDevice *pPDFOut ) +void SetSwVisArea( ViewShell *pSh, const SwRect &rRect, BOOL /*bPDFExport*/ ) +{ + ASSERT( !pSh->GetWin(), "Drucken mit Window?" ); + pSh->aVisArea = rRect; + pSh->Imp()->SetFirstVisPageInvalid(); + Point aPt( rRect.Pos() ); + + // calculate an offset for the rectangle of the n-th page to + // move the start point of the output operation to a position + // such that in the output device all pages will be painted + // at the same position + aPt.X() = -aPt.X(); aPt.Y() = -aPt.Y(); + + OutputDevice *pOut = pSh->GetOut(); + + MapMode aMapMode( pOut->GetMapMode() ); + aMapMode.SetOrigin( aPt ); + pOut->SetMapMode( aMapMode ); +} + +/******************************************************************************/ + +void ViewShell::InitPrt( OutputDevice *pOutDev ) { //Fuer den Printer merken wir uns einen negativen Offset, der //genau dem Offset de OutputSize entspricht. Das ist notwendig, //weil unser Ursprung der linken ober Ecke der physikalischen //Seite ist, die Ausgaben (SV) aber den Outputoffset als Urstprung //betrachten. - OutputDevice *pTmpDev = pPDFOut ? pPDFOut : (OutputDevice *) pPrt; - if ( pTmpDev ) + if ( pOutDev ) { - aPrtOffst = pPrt ? pPrt->GetPageOffset() : Point(); + aPrtOffst = Point(); - aPrtOffst += pTmpDev->GetMapMode().GetOrigin(); - MapMode aMapMode( pTmpDev->GetMapMode() ); + aPrtOffst += pOutDev->GetMapMode().GetOrigin(); + MapMode aMapMode( pOutDev->GetMapMode() ); aMapMode.SetMapUnit( MAP_TWIP ); - pTmpDev->SetMapMode( aMapMode ); - pTmpDev->SetLineColor(); - pTmpDev->SetFillColor(); + pOutDev->SetMapMode( aMapMode ); + pOutDev->SetLineColor(); + pOutDev->SetFillColor(); } else aPrtOffst.X() = aPrtOffst.Y() = 0; if ( !pWin ) - pOut = pTmpDev; //Oder was sonst? + pOut = pOutDev; //Oder was sonst? } /****************************************************************************** @@ -638,14 +850,6 @@ void ViewShell::ChgAllPageSize( Size &rSz ) } } -/****************************************************************************** - * Methode : void ViewShell::CalcPagesForPrint( short nMax, BOOL ... - * Beschreibung: - * Erstellt : OK 04.11.94 15:33 - * Aenderung : MA 07. Jun. 95 - ******************************************************************************/ - - void lcl_SetState( SfxProgress& rProgress, ULONG nPage, ULONG nMax, const XubString *pStr, ULONG nAct, ULONG nCnt, ULONG nOffs, ULONG nPageNo ) @@ -674,50 +878,19 @@ void lcl_SetState( SfxProgress& rProgress, ULONG nPage, ULONG nMax, -void ViewShell::CalcPagesForPrint( USHORT nMax, SfxProgress* pProgress, - const XubString* pStr, ULONG nMergeAct, ULONG nMergeCnt ) +void ViewShell::CalcPagesForPrint( USHORT nMax ) { SET_CURR_SHELL( this ); - //Seitenweise durchformatieren, by the way kann die Statusleiste - //angetriggert werden, damit der Anwender sieht worauf er wartet. - //Damit der Vorgang moeglichst transparent gestaltet werden kann - //Versuchen wir mal eine Schaetzung. - SfxPrinter* pPrt = getIDocumentDeviceAccess()->getPrinter( false ); - BOOL bPrtJob = pPrt ? pPrt->IsJobActive() : FALSE; SwRootFrm* pLayout = GetLayout(); - ULONG nStatMax = pLayout->GetPageNum(); + // ULONG nStatMax = pLayout->GetPageNum(); const SwFrm *pPage = pLayout->Lower(); SwLayAction aAction( pLayout, Imp() ); - if( pProgress ) - { - // HACK, damit die Anzeige sich nicht verschluckt. - const XubString aTmp( SW_RES( STR_STATSTR_FORMAT ) ); - pProgress->SetText( aTmp ); - lcl_SetState( *pProgress, 1, nStatMax, pStr, nMergeAct, nMergeCnt, 0, 1 ); - pProgress->Reschedule(); //Mag der Anwender noch oder hat er genug? - aAction.SetProgress(pProgress); - } - pLayout->StartAllAction(); for ( USHORT i = 1; pPage && i <= nMax; pPage = pPage->GetNext(), ++i ) { - if ( ( bPrtJob && !pPrt->IsJobActive() ) || Imp()->IsStopPrt() ) - break; - - if( pProgress ) - { - //HACK, damit die Anzeige sich nicht verschluckt. - if ( i > nStatMax ) nStatMax = i; - lcl_SetState( *pProgress, i, nStatMax, pStr, nMergeAct, nMergeCnt, 0, i ); - pProgress->Reschedule(); //Mag der Anwender noch oder hat er genug? - } - - if ( ( bPrtJob && !pPrt->IsJobActive() ) || Imp()->IsStopPrt() ) - break; - pPage->Calc(); SwRect aOldVis( VisArea() ); aVisArea = pPage->Frm(); @@ -731,34 +904,23 @@ void ViewShell::CalcPagesForPrint( USHORT nMax, SfxProgress* pProgress, aVisArea = aOldVis; //Zuruecksetzen wg. der Paints! Imp()->SetFirstVisPageInvalid(); - SwPaintQueue::Repaint(); - - if ( pProgress ) - pProgress->Reschedule(); //Mag der Anwender noch oder hat er genug? +// SwPaintQueue::Repaint(); } - - if (pProgress) - aAction.SetProgress( NULL ); - pLayout->EndAllAction(); } /******************************************************************************/ -SwDoc * ViewShell::CreatePrtDoc( SfxPrinter* pPrt, SfxObjectShellRef &rDocShellRef) +SwDoc * ViewShell::CreatePrtDoc( SfxObjectShellRef &rDocShellRef) { ASSERT( this->IsA( TYPE(SwFEShell) ),"ViewShell::Prt for FEShell only"); SwFEShell* pFESh = (SwFEShell*)this; // Wir bauen uns ein neues Dokument SwDoc *pPrtDoc = new SwDoc; pPrtDoc->acquire(); - pPrtDoc->SetRefForDocShell( boost::addressof(rDocShellRef) ); + pPrtDoc->SetRefForDocShell( (SfxObjectShellRef*)&(long&)rDocShellRef ); pPrtDoc->LockExpFlds(); - // Der Drucker wird uebernommen - if (pPrt) - pPrtDoc->setPrinter( pPrt, true, true ); - const SfxPoolItem* pCpyItem; const SfxItemPool& rPool = GetAttrPool(); for( USHORT nWh = POOLATTR_BEGIN; nWh < POOLATTR_END; ++nWh ) @@ -776,16 +938,32 @@ SwDoc * ViewShell::CreatePrtDoc( SfxPrinter* pPrt, SfxObjectShellRef &rDocShellR pActCrsr = dynamic_cast<SwShellCrsr*>(pActCrsr->GetPrev()); } - // Die Y-Position der ersten Selektion - const Point aSelPoint = pFESh->IsTableMode() ? - pFESh->GetTableCrsr()->GetSttPos() : - pFirstCrsr->GetSttPos(); + Point aSelPoint; + if( pFESh->IsTableMode() ) + { + SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr(); + + const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode(); + const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0; + if( pCntntFrm ) + { + SwRect aCharRect; + SwCrsrMoveState aTmpState( MV_NONE ); + pCntntFrm->GetCharRect( aCharRect, *pShellTblCrsr->Start(), &aTmpState ); + aSelPoint = Point( aCharRect.Left(), aCharRect.Top() ); + } + } + else + { + aSelPoint = pFirstCrsr->GetSttPos(); + } const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aSelPoint ); + ASSERT( pPage, "no page found!" ); - // und ihren Seitendescribtor - const SwPageDesc* pPageDesc = pPrtDoc->FindPageDescByName( - pPage->GetPageDesc()->GetName() ); + // get page descriptor - fall back to the first one if pPage could not be found + const SwPageDesc* pPageDesc = pPage ? pPrtDoc->FindPageDescByName( + pPage->GetPageDesc()->GetName() ) : &pPrtDoc->_GetPageDesc( (sal_uInt16)0 ); if( !pFESh->IsTableMode() && pActCrsr->HasMark() ) { // Am letzten Absatz die Absatzattribute richten: @@ -833,6 +1011,7 @@ SwDoc * ViewShell::CreatePrtDoc( SfxPrinter* pPrt, SfxObjectShellRef &rDocShellR } return pPrtDoc; } + SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt) { ASSERT( this->IsA( TYPE(SwFEShell) ),"ViewShell::Prt for FEShell only"); @@ -840,7 +1019,7 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt) // Wir bauen uns ein neues Dokument // SwDoc *pPrtDoc = new SwDoc; // pPrtDoc->acquire(); -// pPrtDoc->SetRefForDocShell( boost::addressof(rDocShellRef) ); +// pPrtDoc->SetRefForDocShell( (SvEmbeddedObjectRef*)&(long&)rDocShellRef ); pPrtDoc->LockExpFlds(); // Der Drucker wird uebernommen @@ -868,15 +1047,32 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt) // Die Y-Position der ersten Selektion // Die Y-Position der ersten Selektion - const Point aSelPoint = pFESh->IsTableMode() ? - pFESh->GetTableCrsr()->GetSttPos() : - pFirstCrsr->GetSttPos(); + Point aSelPoint; + if( pFESh->IsTableMode() ) + { + SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr(); + + const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode(); + const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0; + if( pCntntFrm ) + { + SwRect aCharRect; + SwCrsrMoveState aTmpState( MV_NONE ); + pCntntFrm->GetCharRect( aCharRect, *pShellTblCrsr->Start(), &aTmpState ); + aSelPoint = Point( aCharRect.Left(), aCharRect.Top() ); + } + } + else + { + aSelPoint = pFirstCrsr->GetSttPos(); + } const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aSelPoint ); + ASSERT( pPage, "no page found!" ); - // und ihren Seitendescribtor - const SwPageDesc* pPageDesc = pPrtDoc->FindPageDescByName( - pPage->GetPageDesc()->GetName() ); + // get page descriptor - fall back to the first one if pPage could not be found + const SwPageDesc* pPageDesc = pPage ? pPrtDoc->FindPageDescByName( + pPage->GetPageDesc()->GetName() ) : &pPrtDoc->_GetPageDesc( (sal_uInt16)0 ); if( !pFESh->IsTableMode() && pActCrsr->HasMark() ) { // Am letzten Absatz die Absatzattribute richten: @@ -925,76 +1121,41 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt) return pPrtDoc; } -/****************************************************************************** - * Methode : void ViewShell::Prt( const SwPrtOptions& rOptions, - * SfxProgress* pProgress, - * OutputDevice* pPDFOut ) - * Beschreibung: - * Erstellt : OK 04.11.94 15:33 - * Aenderung : MA 10. May. 95 - ******************************************************************************/ - -BOOL ViewShell::Prt( SwPrtOptions& rOptions, SfxProgress* pProgress, - OutputDevice* pPDFOut ) +sal_Bool ViewShell::PrintOrPDFExport( + OutputDevice *pOutDev, + const SwPrtOptions &rPrintData, + sal_Int32 nRenderer /* the index in the vector of pages to be printed */ ) { -//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -//Immer die Druckroutine in viewpg.cxx (fuer Seitenvorschau) mitpflegen!! -//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ASSERT( pPDFOut || pProgress, "Printing without progress bar!" ) - - BOOL bStartJob = FALSE; - - //! Note: Since for PDF export of (multi-)selection a temporary - //! document is created that contains only the selects parts, - //! and thus that document is to printed in whole the, - //! rOptions.bPrintSelection parameter will be false. - BOOL bSelection = rOptions.bPrintSelection; - - MultiSelection aMulti( rOptions.aMulti ); - - if ( !aMulti.GetSelectCount() ) - return bStartJob; - - Range aPages( aMulti.FirstSelected(), aMulti.LastSelected() ); - if ( aPages.Max() > USHRT_MAX ) - aPages.Max() = USHRT_MAX; - - ASSERT( aPages.Min() > 0, - "Seite 0 Drucken?" ); - ASSERT( aPages.Min() <= aPages.Max(), - "MinSeite groesser MaxSeite." ); - - SfxPrinter* pPrt = 0; //!! will be 0 for PDF export !! - if (pPDFOut) - pPDFOut->Push(); - else - { - // wenn kein Drucker vorhanden ist, wird nicht gedruckt - pPrt = getIDocumentDeviceAccess()->getPrinter( false ); - if( !pPrt || !pPrt->GetName().Len() ) - { - ASSERT( FALSE, "Drucken ohne Drucker?" ); - return bStartJob; - } +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +//Immer die Druckroutinen in viewpg.cxx (PrintProspect) mitpflegen!! +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if( !rOptions.GetJobName().Len() && !pPrt->IsJobActive() ) - return bStartJob; - } - - // Einstellungen am Drucker merken - SwPrtOptSave aPrtSave( pPrt ); + const sal_Int32 nMaxRenderer = rPrintData.GetRenderData().GetPagesToPrint().size() - 1; +#if OSL_DEBUG_LEVEL > 1 + DBG_ASSERT( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds"); +#endif + if (!pOutDev || nMaxRenderer < 0 || nRenderer < 0 || nRenderer > nMaxRenderer) + return sal_False; - OutputDevice *pPrtOrPDFOut = pPDFOut ? pPDFOut : (OutputDevice *) pPrt; + // save settings of OutputDevice (should be done always since the + // output device is now provided by a call from outside the Writer) + pOutDev->Push(); // eine neue Shell fuer den Printer erzeugen ViewShell *pShell; - SwDoc *pPrtDoc; + SwDoc *pOutDevDoc; //!! muss warum auch immer hier in diesem scope existieren !! //!! (h?ngt mit OLE Objekten im Dokument zusammen.) SfxObjectShellRef aDocShellRef; + //! Note: Since for PDF export of (multi-)selection a temporary + //! document is created that contains only the selects parts, + //! and thus that document is to printed in whole the, + //! rPrintData.bPrintSelection parameter will be false. + BOOL bSelection = rPrintData.bPrintSelection; + // PDF export for (multi-)selection has already generated a temporary document // with the selected text. (see XRenderable implementation in unotxdoc.cxx) // Thus we like to go in the 'else' part here in that case. @@ -1003,443 +1164,100 @@ BOOL ViewShell::Prt( SwPrtOptions& rOptions, SfxProgress* pProgress, // to be created that often here in the 'then' part. if ( bSelection ) { - pPrtDoc = CreatePrtDoc( pPrt, aDocShellRef ); + pOutDevDoc = CreatePrtDoc( aDocShellRef ); // eine ViewShell darauf - OutputDevice *pTmpDev = pPDFOut ? pPDFOut : 0; - pShell = new ViewShell( *pPrtDoc, 0, pOpt, pTmpDev ); - pPrtDoc->SetRefForDocShell( 0 ); + pShell = new ViewShell( *pOutDevDoc, 0, pOpt, pOutDev ); + pOutDevDoc->SetRefForDocShell( 0 ); } else { - pPrtDoc = GetDoc(); - OutputDevice *pTmpDev = pPDFOut ? pPDFOut : 0; - pShell = new ViewShell( *this, 0, pTmpDev ); + pOutDevDoc = GetDoc(); + pShell = new ViewShell( *this, 0, pOutDev ); + } + + SdrView *pDrawView = pShell->GetDrawView(); + if (pDrawView) + { + pDrawView->SetBufferedOutputAllowed( false ); + pDrawView->SetBufferedOverlayAllowed( false ); } { //Zusaetzlicher Scope, damit die CurrShell vor dem zerstoeren der //Shell zurueckgesetzt wird. - SET_CURR_SHELL( pShell ); - - if ( pProgress ) - { - Link aLnk = LINK(pShell->Imp(), SwViewImp, SetStopPrt); - ((SfxPrintProgress *)pProgress)->SetCancelHdl(aLnk); - } + SET_CURR_SHELL( pShell ); - //JP 01.02.99: das ReadOnly Flag wird NIE mitkopiert; Bug 61335 - if( pOpt->IsReadonly() ) - pShell->pOpt->SetReadonly( TRUE ); + //JP 01.02.99: das ReadOnly Flag wird NIE mitkopiert; Bug 61335 + if( pOpt->IsReadonly() ) + pShell->pOpt->SetReadonly( TRUE ); - // save options at draw view: - SwDrawViewSave aDrawViewSave( pShell->GetDrawView() ); + // save options at draw view: + SwDrawViewSave aDrawViewSave( pShell->GetDrawView() ); - pShell->PrepareForPrint( rOptions ); + pShell->PrepareForPrint( rPrintData ); - XubString* pStr = 0; - ULONG nMergeAct = rOptions.nMergeAct, nMergeCnt = rOptions.nMergeCnt; - if ( pProgress ) - { - if( nMergeAct ) + const sal_Int32 nPage = rPrintData.GetRenderData().GetPagesToPrint()[ nRenderer ]; +#if OSL_DEBUG_LEVEL > 1 + DBG_ASSERT( nPage == 0 || rPrintData.GetRenderData().GetValidPagesSet().count( nPage ) == 1, "nPage not valid" ); +#endif + const SwPageFrm *pStPage = 0; + if (nPage > 0) // a 'regular' page, not one from the post-it document { - pStr = new SW_RESSTR(STR_STATSTR_LETTER); - *pStr += ' '; - *pStr += XubString::CreateFromInt64( nMergeAct ); - if( nMergeCnt ) - { - *pStr += '/'; - *pStr += XubString::CreateFromInt64( nMergeCnt ); - } + const SwRenderData::ValidStartFramesMap_t &rFrms = rPrintData.GetRenderData().GetValidStartFrames(); + SwRenderData::ValidStartFramesMap_t::const_iterator aIt( rFrms.find( nPage ) ); + DBG_ASSERT( aIt != rFrms.end(), "failed to find start frame" ); + if (aIt == rFrms.end()) + return sal_False; + pStPage = aIt->second; } - else + else // a page from the post-its document ... { - ++nMergeAct; + DBG_ASSERT( nPage == 0, "unexpected page number. 0 for post-it pages expected" ); + pStPage = rPrintData.GetRenderData().GetPostItStartFrames()[ nRenderer ]; } - } - - // Seiten fuers Drucken formatieren - pShell->CalcPagesForPrint( (USHORT)aPages.Max(), pProgress, pStr, - nMergeAct, nMergeCnt ); - - // Some field types, can require a valid layout - // (expression fields in tables). For these we do an UpdateFlds - // here after calculation of the pages. - // --> FME 2004-06-21 #i9684# For performance reasons, we do not update - // the fields during pdf export. - // #i56195# prevent update of fields (for mail merge) - if ( !pPDFOut && rOptions.bUpdateFieldsInPrinting ) - // <-- - pShell->UpdateFlds(TRUE); - - if( !pShell->Imp()->IsStopPrt() && - ( pPDFOut || rOptions.GetJobName().Len() || pPrt->IsJobActive()) ) - { - BOOL bStop = FALSE; - int nJobStartError = JOBSET_ERR_DEFAULT; + DBG_ASSERT( pStPage, "failed to get start page" ); - USHORT nCopyCnt = rOptions.bCollate ? rOptions.nCopyCount : 1; + //!! applying view options and formatting the dcoument should now only be done in getRendererCount! - USHORT nPrintCount = 1; - XubString sJobName( rOptions.GetJobName() ); + ViewShell *pViewSh2 = nPage == 0 ? /* post-it page? */ + rPrintData.GetRenderData().m_pPostItShell : pShell; + ::SetSwVisArea( pViewSh2, pStPage->Frm() ); - for ( USHORT nCnt = 0; !bStop && nCnt < nCopyCnt; nCnt++ ) + // wenn wir einen Umschlag drucken wird ein Offset beachtet + if( pStPage->GetFmt()->GetPoolFmtId() == RES_POOLPAGE_JAKET ) { - const SwPageFrm *pStPage = (SwPageFrm*)pShell->GetLayout()->Lower(); - const SwFrm *pEndPage = pStPage; - - USHORT nFirstPageNo = 0; - USHORT nLastPageNo = 0; - USHORT nPageNo = 1; - - if (pPrt) - { - if( rOptions.IsPrintSingleJobs() && sJobName.Len() && - ( bStartJob || rOptions.bJobStartet ) ) - { - pPrt->EndJob(); - bStartJob = FALSE; - rOptions.bJobStartet = TRUE; - - // Reschedule statt Yield, da Yield keine Events abarbeitet - // und es sonst eine Endlosschleife gibt. - while( pPrt->IsPrinting() && pProgress ) - pProgress->Reschedule(); - - sJobName = rOptions.MakeNextJobName(); - nJobStartError = JOBSET_ERR_DEFAULT; - } - } - - for( USHORT i = 1; i <= (USHORT)aPages.Max(); ++i ) - { - if( i < (USHORT)aPages.Min() ) - { - if( !pStPage->GetNext() ) - break; - pStPage = (SwPageFrm*)pStPage->GetNext(); - pEndPage= pStPage; - } - else if( i == (USHORT)aPages.Min() ) - { - nFirstPageNo = i; - nLastPageNo = nFirstPageNo; - if( !pStPage->GetNext() || (i == (USHORT)aPages.Max()) ) - break; - pEndPage = pStPage->GetNext(); - } - else if( i > (USHORT)aPages.Min() ) - { - nLastPageNo = i; - if( !pEndPage->GetNext() || (i == (USHORT)aPages.Max()) ) - break; - pEndPage = pEndPage->GetNext(); - } - } - - if( !nFirstPageNo ) - { - bStop = TRUE; - break; - } - -// HACK: Hier muss von der MultiSelection noch eine akzeptable Moeglichkeit -// geschaffen werden, alle Seiten von Seite x an zu deselektieren. -// Z.B. durch SetTotalRange .... - -// aMulti.Select( Range( nLastPageNo+1, SELECTION_MAX ), FALSE ); - MultiSelection aTmpMulti( Range( 1, nLastPageNo ) ); - long nTmpIdx = aMulti.FirstSelected(); - static long nEndOfSelection = SFX_ENDOFSELECTION; - while ( nEndOfSelection != nTmpIdx && nTmpIdx <= long(nLastPageNo) ) - { - aTmpMulti.Select( nTmpIdx ); - nTmpIdx = aMulti.NextSelected(); - } - aMulti = aTmpMulti; -// Ende des HACKs - - const USHORT nSelCount = USHORT(aMulti.GetSelectCount() - /* * nCopyCnt*/); - - if ( pProgress ) - { - pProgress->SetText( SW_RESSTR(STR_STATSTR_PRINT) ); - lcl_SetState( *pProgress, 1, nSelCount, pStr, - nMergeAct, nMergeCnt, nSelCount, 1 ); - } - - if ( rOptions.bPrintReverse ) - { - const SwFrm *pTmp = pStPage; - pStPage = (SwPageFrm*)pEndPage; - pEndPage = pTmp; - nPageNo = nLastPageNo; - } - else - nPageNo = nFirstPageNo; - - // PostitListe holen - _SetGetExpFlds aPostItFields; - SwDoc* pPostItDoc = 0; - ViewShell* pPostItShell = 0; - if( rOptions.nPrintPostIts != POSTITS_NONE ) - { - lcl_GetPostIts( pDoc, aPostItFields ); - pPostItDoc = new SwDoc; - if (pPrt) - pPostItDoc->setPrinter( pPrt, true, true ); - pPostItShell = new ViewShell( *pPostItDoc, 0, - pShell->GetViewOptions() ); - // Wenn PostIts am Dokumentenende gedruckt werden sollen, - // die Druckreihenfolge allerdings umgekehrt ist, dann hier - if ( ( rOptions.nPrintPostIts == POSTITS_ENDDOC ) && - rOptions.bPrintReverse ) - lcl_PrintPostItsEndDoc( pPostItShell, aPostItFields, - aMulti, sJobName, bStartJob, nJobStartError, - rOptions.bPrintRightPage, rOptions.bPrintLeftPage, TRUE ); - - } - - // aOldMapMode wird fuer das Drucken von Umschlaegen gebraucht. - MapMode aOldMapMode; - - const SwPageDesc *pLastPageDesc = NULL; - BOOL bSetOrient = FALSE; - BOOL bSetPaperSz = FALSE; - BOOL bSetPaperBin = FALSE; - BOOL bSetPrt = FALSE; - if (pPrt) - { - bSetOrient = pPrt->HasSupport( SUPPORT_SET_ORIENTATION ); - bSetPaperSz = pPrt->HasSupport( SUPPORT_SET_PAPERSIZE ); - bSetPaperBin = !rOptions.bPaperFromSetup && - pPrt->HasSupport( SUPPORT_SET_PAPERBIN ); - bSetPrt = bSetOrient || bSetPaperSz || bSetPaperBin; - } - - if ( rOptions.nPrintPostIts != POSTITS_ONLY ) - { - // --> FME 2005-01-05 #110536# This valiable is used to track - // the number of pages which actually have been printed. - // If nPagesPrinted is odd, we have to send an additional - // empty page to the printer if we are currently in collation - // and duplex mode and there are still some more copies of the - // document to print. - USHORT nPagesPrinted = 0; - // <-- - - while( pStPage && !bStop ) - { - // Mag der Anwender noch ? - if ( pProgress ) - pProgress->Reschedule(); - - if (pPrt) - { - if ( JOBSET_ERR_ERROR == nJobStartError || - ( !pPrt->IsJobActive() && ( !sJobName.Len() || bStartJob ) ) || - pShell->Imp()->IsStopPrt() ) - { - bStop = TRUE; - break; - } - } - - ::SetSwVisArea( pShell, pStPage->Frm(), 0 != pPDFOut ); - - // wenn wir einen Umschlag drucken wird ein Offset beachtet - if( pStPage->GetFmt()->GetPoolFmtId() == RES_POOLPAGE_JAKET ) - { - aOldMapMode = pPrtOrPDFOut->GetMapMode(); - Point aNewOrigin = pPrtOrPDFOut->GetMapMode().GetOrigin(); - aNewOrigin += rOptions.aOffset; - MapMode aTmp( pPrtOrPDFOut->GetMapMode() ); - aTmp.SetOrigin( aNewOrigin ); - pPrtOrPDFOut->SetMapMode( aTmp ); - } - - const BOOL bRightPg = pStPage->OnRightPage(); - if( aMulti.IsSelected( nPageNo ) && - ( (bRightPg && rOptions.bPrintRightPage) || - (!bRightPg && rOptions.bPrintLeftPage) ) ) - { - if ( bSetPrt ) - { - // check for empty page - const SwPageFrm& rFormatPage = pStPage->GetFormatPage(); - - if ( pLastPageDesc != rFormatPage.GetPageDesc() ) - { - pLastPageDesc = rFormatPage.GetPageDesc(); - - const BOOL bLandScp = rFormatPage.GetPageDesc()->GetLandscape(); - - if( bSetPaperBin ) // Schacht einstellen. - pPrt->SetPaperBin( rFormatPage.GetFmt()-> - GetPaperBin().GetValue() ); - - if (bSetOrient ) - { - // Orientation einstellen: Breiter als Hoch - // -> Landscape, sonst -> Portrait. - if( bLandScp ) - pPrt->SetOrientation(ORIENTATION_LANDSCAPE); - else - pPrt->SetOrientation(ORIENTATION_PORTRAIT); - } - - if (bSetPaperSz ) - { - Size aSize = pStPage->Frm().SSize(); - if ( bLandScp && bSetOrient ) - { - // landscape is always interpreted as a rotation by 90 degrees ! - // this leads to non WYSIWIG but at least it prints! - // #i21775# - long nWidth = aSize.Width(); - aSize.Width() = aSize.Height(); - aSize.Height() = nWidth; - } - Paper ePaper = SvxPaperInfo::GetSvxPaper(aSize,MAP_TWIP,TRUE); - if ( PAPER_USER == ePaper ) - pPrt->SetPaperSizeUser( aSize ); - else - pPrt->SetPaper( ePaper ); - } - } - } - - // Wenn PostIts nach Seite gedruckt werden sollen, - // jedoch Reverse eingestellt ist ... - if( rOptions.bPrintReverse && - rOptions.nPrintPostIts == POSTITS_ENDPAGE ) - lcl_PrintPostItsEndPage( pPostItShell, aPostItFields, - nPageNo, aMulti, sJobName, bStartJob, nJobStartError, - rOptions.bPrintRightPage, rOptions.bPrintLeftPage, - rOptions.bPrintReverse ); - - if ( pProgress ) - lcl_SetState( *pProgress, nPrintCount++, nSelCount, - pStr, nMergeAct, nMergeCnt, - nSelCount, nPageNo ); - - if( !bStartJob && JOBSET_ERR_DEFAULT == nJobStartError - && sJobName.Len() ) - { - if( pPrt && !pPrt->IsJobActive() ) - { - bStartJob = pPrt->StartJob( sJobName ); - if( !bStartJob ) - { - nJobStartError = JOBSET_ERR_ERROR; - continue; - } - } - - pShell->InitPrt( pPrt, pPDFOut ); - - ::SetSwVisArea( pShell, pStPage->Frm(), 0 != pPDFOut ); - nJobStartError = JOBSET_ERR_ISSTARTET; - } - // --> FME 2005-12-12 #b6354161# Feature - Print empty pages - if ( rOptions.bPrintEmptyPages || pStPage->Frm().Height() ) - // <-- - { - if (pPrt) - pPrt->StartPage(); - - pStPage->GetUpper()->Paint( pStPage->Frm() ); - ++nPagesPrinted; - - if (pPrt) - pPrt->EndPage(); - } - SwPaintQueue::Repaint(); - - // Wenn PostIts nach Seite gedruckt werden sollen ... - if( (!rOptions.bPrintReverse) && - rOptions.nPrintPostIts == POSTITS_ENDPAGE ) - lcl_PrintPostItsEndPage( pPostItShell, aPostItFields, - nPageNo, aMulti, sJobName, bStartJob, nJobStartError, - rOptions.bPrintRightPage, rOptions.bPrintLeftPage, - rOptions.bPrintReverse ); - } - - // den eventl. fuer Umschlaege modifizierte OutDevOffset wieder - // zuruecksetzen. - if( pStPage->GetFmt()->GetPoolFmtId() == RES_POOLPAGE_JAKET ) - pPrtOrPDFOut->SetMapMode( aOldMapMode ); - - if ( pStPage == pEndPage ) - { - // --> FME 2005-01-05 #110536# Print emtpy page if - // we are have an odd page count in collation/duplex - // mode and there are still some copies to print: - if ( pPrt && ( 1 == ( nPagesPrinted % 2 ) ) && - DUPLEX_ON == pPrt->GetDuplexMode() && - nCnt + 1 < nCopyCnt ) - { - pPrt->StartPage(); - pPrt->EndPage(); - } - // <-- - - pStPage = 0; - } - else if ( rOptions.bPrintReverse ) - { - --nPageNo; - pStPage = (SwPageFrm*)pStPage->GetPrev(); - } - else - { ++nPageNo; - pStPage = (SwPageFrm*)pStPage->GetNext(); - } - } - if ( bStop ) - break; - } - - // Wenn PostIts am Dokumentenende gedruckt werden sollen, dann hier machen - if( ((rOptions.nPrintPostIts == POSTITS_ENDDOC) && !rOptions.bPrintReverse) - || (rOptions.nPrintPostIts == POSTITS_ONLY) ) - lcl_PrintPostItsEndDoc( pPostItShell, aPostItFields, aMulti, - sJobName, bStartJob, nJobStartError, - rOptions.bPrintRightPage, rOptions.bPrintLeftPage, - rOptions.bPrintReverse ); - - if( pPostItShell ) - { - pPostItDoc->setPrinter( 0, false, false ); //damit am echten DOC der Drucker bleibt - delete pPostItShell; //Nimmt das PostItDoc mit ins Grab. - } - - if( bStartJob ) - rOptions.bJobStartet = TRUE; + Point aNewOrigin = pOutDev->GetMapMode().GetOrigin(); + aNewOrigin += rPrintData.aOffset; + MapMode aTmp( pOutDev->GetMapMode() ); + aTmp.SetOrigin( aNewOrigin ); + pOutDev->SetMapMode( aTmp ); } - } - delete pStr; + pShell->InitPrt( pOutDev ); + pViewSh2 = nPage == 0 ? /* post-it page? */ + rPrintData.GetRenderData().m_pPostItShell : pShell; + ::SetSwVisArea( pViewSh2, pStPage->Frm() ); + + pStPage->GetUpper()->Paint( pStPage->Frm(), &rPrintData ); + + SwPaintQueue::Repaint(); } //Zus. Scope wg. CurShell! delete pShell; if (bSelection ) { - // damit das Dokument nicht den Drucker mit ins Grab nimmt - pPrtDoc->setPrinter( 0, false, false ); - - if ( !pPrtDoc->release() ) - delete pPrtDoc; + if ( !pOutDevDoc->release() ) + delete pOutDevDoc; } - // restore settings of OutputDevicef - if (pPDFOut) - pPDFOut->Pop(); + // restore settings of OutputDevice (should be done always now since the + // output device is now provided by a call from outside the Writer) + pOutDev->Pop(); - return bStartJob; + return sal_True; } /****************************************************************************** @@ -1451,7 +1269,7 @@ BOOL ViewShell::Prt( SwPrtOptions& rOptions, SfxProgress* pProgress, -void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, SwPrtOptions& rOptions, +void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions, OutputDevice* pOleOut, const Rectangle& rRect ) { //Wir brauchen eine Shell fuer das Drucken. Entweder hat das Doc schon @@ -1529,52 +1347,6 @@ BOOL ViewShell::IsAnyFieldInDoc() const /****************************************************************************** - * Klasse : SwPrtOptSave - * Erstellt : AMA 12.07.95 - * Aenderung : AMA 12.07.95 - * Holt sich im Ctor folgende Einstellungen des Druckers, die im Dtor dann - * wieder im Drucker gesetzt werden (falls sie sich ueberhaupt geaendert haben) - * - PaperBin - Orientation - PaperSize - - ******************************************************************************/ - - - -SwPrtOptSave::SwPrtOptSave( Printer *pPrinter ) - : pPrt( pPrinter ) -{ - if ( pPrt ) - { - ePaper = pPrt->GetPaper(); - if ( PAPER_USER == ePaper ) - aSize = pPrt->GetPaperSize(); - eOrientation = pPrt->GetOrientation(); - nPaperBin = pPrt->GetPaperBin(); - - } -} - - - -SwPrtOptSave::~SwPrtOptSave() -{ - if ( pPrt ) - { - if ( PAPER_USER == ePaper ) - { - if( pPrt->GetPaperSize() != aSize ) - pPrt->SetPaperSizeUser( aSize ); - } - else if ( pPrt->GetPaper() != ePaper ) - pPrt->SetPaper( ePaper ); - if ( pPrt->GetOrientation() != eOrientation) - pPrt->SetOrientation( eOrientation ); - if ( pPrt->GetPaperBin() != nPaperBin ) - pPrt->SetPaperBin( nPaperBin ); - } -} - - -/****************************************************************************** * SwDrawViewSave * * Saves some settings at the draw view @@ -1600,7 +1372,7 @@ SwDrawViewSave::~SwDrawViewSave() // OD 09.01.2003 #i6467# - method also called for page preview -void ViewShell::PrepareForPrint( const SwPrtOptions &rOptions ) +void ViewShell::PrepareForPrint( const SwPrintData &rOptions ) { // Viewoptions fuer den Drucker setzen pOpt->SetGraphic ( TRUE == rOptions.bPrintGraphic ); diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 10e85b5c08..9b509a8eeb 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -34,7 +34,7 @@ #include <tools/stream.hxx> #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <svx/fontitem.hxx> #include <pam.hxx> diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 4e55ee6ce6..428e50da1f 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -39,7 +39,7 @@ #include <i18npool/mslangid.hxx> #include <vcl/msgbox.hxx> #include <svtools/parhtml.hxx> -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <sot/storage.hxx> #include <sot/clsids.hxx> #include <sfx2/app.hxx> @@ -418,6 +418,9 @@ void SwFilterOptions::GetValues( sal_uInt16 nCnt, const sal_Char** ppNames, pValues[ n ] = 0; } +void SwFilterOptions::Commit() {} +void SwFilterOptions::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + /* */ @@ -1008,3 +1011,24 @@ void GetWW8Writer( const String& rFltName, const String& rBaseURL, WriterRef& xR else xRet = WriterRef(0); } + +typedef ULONG ( __LOADONCALLAPI *SaveOrDel )( SfxObjectShell&, SotStorage&, BOOL, const String& ); +typedef ULONG ( __LOADONCALLAPI *GetSaveWarning )( SfxObjectShell& ); + +ULONG SaveOrDelMSVBAStorage( SfxObjectShell& rDoc, SotStorage& rStor, BOOL bSaveInto, const String& rStorageName ) +{ + SaveOrDel pFunction = reinterpret_cast<SaveOrDel>( GetMswordLibSymbol( "SaveOrDelMSVBAStorage_ww8" ) ); + if( pFunction ) + return pFunction( rDoc, rStor, bSaveInto, rStorageName ); + return ERRCODE_NONE; +} + +ULONG GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS ) +{ + GetSaveWarning pFunction = reinterpret_cast<GetSaveWarning>( GetMswordLibSymbol( "GetSaveWarningOfMSVBAStorage_ww8" ) ); + if( pFunction ) + return pFunction( rDocS ); + return ERRCODE_NONE; +} + + diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 95c0296551..d4483831d9 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -33,9 +33,9 @@ #include <hintids.hxx> #include <tools/date.hxx> #include <tools/time.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/fstathelper.hxx> -#include <svtools/moduleoptions.hxx> +#include <svl/urihelper.hxx> +#include <svl/fstathelper.hxx> +#include <unotools/moduleoptions.hxx> #include <sfx2/docfile.hxx> #include <svx/lrspitem.hxx> #include <svx/ulspitem.hxx> diff --git a/sw/source/filter/html/SwAppletImpl.cxx b/sw/source/filter/html/SwAppletImpl.cxx index 25b071ed6d..ab82fd2bd1 100644 --- a/sw/source/filter/html/SwAppletImpl.cxx +++ b/sw/source/filter/html/SwAppletImpl.cxx @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" #include <SwAppletImpl.hxx> #include <svtools/htmlkywd.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/embed/EmbedStates.hpp> diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 8bbfce70f7..3fd0513632 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -36,7 +36,7 @@ #include "hintids.hxx" #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <svx/boxitem.hxx> #include <svx/ulspitem.hxx> #include <svx/udlnitem.hxx> @@ -65,7 +65,7 @@ #include <svtools/htmlout.hxx> #include <svtools/htmlkywd.hxx> #include <svx/htmlmode.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <tools/urlobj.hxx> #include <tools/bigint.hxx> #include <unotools/charclass.hxx> diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 45e5ce7e55..3962ac7469 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -43,12 +43,12 @@ #if !defined _SVSTDARR_XUB_STRLEN_DECL || !defined _SVSTDARR_USHORTS_DECL #define _SVSTDARR_XUB_STRLEN #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <svtools/htmlout.hxx> #include <svtools/htmlkywd.hxx> #include <svtools/htmltokn.h> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <svx/htmlmode.hxx> #include <svx/escpitem.hxx> #include <svx/brkitem.hxx> diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx index 1eab2c7fbc..7bec01cd7c 100644 --- a/sw/source/filter/html/htmlbas.cxx +++ b/sw/source/filter/html/htmlbas.cxx @@ -37,7 +37,7 @@ #include <sfx2/sfx.hrc> #define _SVSTDARR_STRINGSSORTDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <basic/sbx.hxx> #include <basic/basmgr.hxx> #include <basic/sbmod.hxx> diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index d1d729bf02..51d3e62c82 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -34,9 +34,9 @@ #include "hintids.hxx" -#include <svtools/itemiter.hxx> -#include <svtools/whiter.hxx> -#include <svtools/urihelper.hxx> +#include <svl/itemiter.hxx> +#include <svl/whiter.hxx> +#include <svl/urihelper.hxx> #include <i18npool/mslangid.hxx> #include <sfx2/docfile.hxx> #include <vcl/svapp.hxx> diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index f23e852d09..bfde0b1db2 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -33,7 +33,7 @@ #include "hintids.hxx" -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/lrspitem.hxx> #include <svx/ulspitem.hxx> #include <svx/brshitem.hxx> diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx index 4f7a281631..51fd729c56 100644 --- a/sw/source/filter/html/htmldraw.cxx +++ b/sw/source/filter/html/htmldraw.cxx @@ -50,8 +50,8 @@ #include <svx/brshitem.hxx> #include <svx/lrspitem.hxx> #include <svx/ulspitem.hxx> -#include <svtools/itemiter.hxx> -#include <svtools/whiter.hxx> +#include <svl/itemiter.hxx> +#include <svl/whiter.hxx> #include <svtools/htmlout.hxx> #include <svtools/htmltokn.h> #include <svtools/htmlkywd.hxx> diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 0017b15db7..ec07acdfa0 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,8 +38,8 @@ #include "docsh.hxx" #include <svtools/htmltokn.h> -#include <svtools/zformat.hxx> -#include <svtools/useroptions.hxx> +#include <svl/zformat.hxx> +#include <unotools/useroptions.hxx> #include <fmtfld.hxx> #include <ndtxt.hxx> #include <doc.hxx> diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index c1b7a20424..22cd272d7e 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -38,7 +38,7 @@ #include "hintids.hxx" #include <tools/string.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <svtools/htmlkywd.hxx> diff --git a/sw/source/filter/html/htmlfly.hxx b/sw/source/filter/html/htmlfly.hxx index 5d4d86f648..fef71ea0b5 100644 --- a/sw/source/filter/html/htmlfly.hxx +++ b/sw/source/filter/html/htmlfly.hxx @@ -35,7 +35,7 @@ #include <tools/string.hxx> #ifndef _SVARRAY_H -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #endif class SdrObject; diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 0691f94fcf..9c35e6d4a3 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -40,7 +40,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <svtools/htmlkywd.hxx> #include <svtools/htmltokn.h> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <sfx2/request.hxx> #include <sfx2/docfile.hxx> #include <sfx2/viewfrm.hxx> @@ -70,6 +70,9 @@ #include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/awt/XTextLayoutConstrains.hpp> #include <com/sun/star/awt/XLayoutConstrains.hpp> +#include <com/sun/star/awt/XImageConsumer.hpp> +#include <com/sun/star/form/XImageProducerSupplier.hpp> +#include <com/sun/star/form/XForm.hpp> #include <doc.hxx> #include <pam.hxx> #include <swtable.hxx> diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index a0a2b7a862..7259f7456f 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -46,12 +46,12 @@ #include <hintids.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <tools/urlobj.hxx> #include <svtools/htmlout.hxx> #include <svtools/htmltokn.h> #include <svtools/htmlkywd.hxx> -#include "svtools/urihelper.hxx" +#include <svl/urihelper.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <svx/svdouno.hxx> #include <svx/fmglob.hxx> diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx index eb306d979c..e0051c67f3 100644 --- a/sw/source/filter/html/htmlftn.cxx +++ b/sw/source/filter/html/htmlftn.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -354,7 +354,7 @@ void SwHTMLWriter::OutFootEndNotes() if( !pFootEndNotes ) return; -#ifndef PRODUCT +#ifdef DBG_UTIL USHORT nFtn = nFootNote, nEn = nEndNote; #endif nFootNote = 0, nEndNote = 0; @@ -419,7 +419,7 @@ void SwHTMLWriter::OutFootEndNotes() } } -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( nFtn == nFootNote, "SwHTMLWriter::OutFootEndNotes: Anzahl Fussnoten stimmt nicht" ); ASSERT( nEn == nEndNote, diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index cadc0f27ac..b69d5fabc0 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -35,8 +35,8 @@ #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <i18npool/mslangid.hxx> -#include <svtools/stritem.hxx> -#include <svtools/urihelper.hxx> +#include <svl/stritem.hxx> +#include <svl/urihelper.hxx> #include <svx/fhgtitem.hxx> #include <svx/lrspitem.hxx> #include <svx/adjitem.hxx> @@ -51,7 +51,7 @@ #include <svtools/imap.hxx> #include <svtools/htmltokn.h> #include <svtools/htmlkywd.hxx> -#include <svtools/eventcfg.hxx> +#include <unotools/eventcfg.hxx> #include <fmtornt.hxx> #include <fmturl.hxx> diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx index 0499cfd863..bd70ff6d9c 100644 --- a/sw/source/filter/html/htmlnum.cxx +++ b/sw/source/filter/html/htmlnum.cxx @@ -37,7 +37,7 @@ #include <svtools/htmltokn.h> #include <svtools/htmlkywd.hxx> #include <svtools/htmlout.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <svx/brshitem.hxx> #include <svx/lrspitem.hxx> #include <vcl/svapp.hxx> diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 064866f2ca..fab6e845e0 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -34,9 +34,9 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include "hintids.hxx" -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <vcl/svapp.hxx> #include <sfx2/frmhtml.hxx> #include <sfx2/frmhtmlw.hxx> @@ -55,7 +55,7 @@ #include <fmtcntnt.hxx> #include <frmfmt.hxx> -#include <svtools/ownlist.hxx> +#include <svl/ownlist.hxx> #include "pam.hxx" #include "doc.hxx" #include "ndtxt.hxx" diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 293a7f8a64..e8ed0babd7 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -72,7 +72,7 @@ #include "viewsh.hxx" #include "swcss1.hxx" #include "swhtml.hxx" -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #define CONTEXT_FLAGS_MULTICOL (HTML_CNTXT_STRIP_PARA | \ HTML_CNTXT_KEEP_NUMRULE | \ diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 90489ff312..c4f47c68a9 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,7 +48,7 @@ #include <svx/spltitem.hxx> #include <svtools/htmltokn.h> #include <svtools/htmlkywd.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <fmtornt.hxx> @@ -912,7 +912,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells ) { ASSERT( nCells < pCells->Count(), "Anzahl Zellen falsch" ); -#ifndef PRODUCT +#ifdef DBG_UTIL sal_uInt16 nEnd = pCells->Count(); #endif // The colspan of empty cells at the end has to be fixed to the new @@ -930,7 +930,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells ) else break; } -#ifndef PRODUCT +#ifdef DBG_UTIL for( i=nCells; i<nEnd; i++ ) { HTMLTableCell *pCell = (*pCells)[i]; @@ -1790,7 +1790,7 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper, HTMLTableCell *pCell = GetCell(nTopRow,nCol); const sal_Bool bSplit = 1 == pCell->GetColSpan(); -#ifndef PRODUCT +#ifdef DBG_UTIL if( nCol == nRightCol-1 ) { ASSERT( bSplit, "Split-Flag falsch" ); @@ -3394,7 +3394,7 @@ void _CellSaveStruct::AddContents( HTMLTableCnts *pNewCnts ) void _CellSaveStruct::InsertCell( SwHTMLParser& rParser, HTMLTable *pCurTable ) { -#ifndef PRODUCT +#ifdef DBG_UTIL // Die Attribute muessen schon beim Auefrauemen des Kontext-Stacks // entfernt worden sein, sonst ist etwas schiefgelaufen. Das // Checken wir mal eben ... diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index d0d16334d8..38f8680372 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -67,7 +67,7 @@ #include <htmlnum.hxx> #include <wrthtml.hxx> #include <wrtswtbl.hxx> -#ifndef PRODUCT +#ifdef DBG_UTIL #ifndef _VIEWSH_HXX #include <viewsh.hxx> #endif @@ -1200,7 +1200,7 @@ Writer& OutHTML_SwTblNode( Writer& rWrt, SwTableNode & rNode, const SwHTMLTableLayout *pLayout = rTbl.GetHTMLTableLayout(); -#ifndef PRODUCT +#ifdef DBG_UTIL ViewShell *pSh; rWrt.pDoc->GetEditShell( &pSh ); if ( pSh && pSh->GetViewOptions()->IsTest1() ) diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index bda9ee26e0..d2f40c1253 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -39,7 +39,7 @@ #endif #include <i18npool/mslangid.hxx> #include <svtools/ctrltool.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <svx/udlnitem.hxx> #include <svx/adjitem.hxx> #include <svx/blnkitem.hxx> @@ -57,7 +57,7 @@ #include <svx/ulspitem.hxx> #include <svx/lrspitem.hxx> #include <svx/langitem.hxx> -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> #include <svx/spltitem.hxx> #include <svx/widwitem.hxx> #include <svx/frmdiritem.hxx> diff --git a/sw/source/filter/html/svxcss1.hxx b/sw/source/filter/html/svxcss1.hxx index 36ed19fc3a..c24b07bda4 100644 --- a/sw/source/filter/html/svxcss1.hxx +++ b/sw/source/filter/html/svxcss1.hxx @@ -31,12 +31,12 @@ #define _SVXCSS1_HXX #include <tools/string.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <svx/svxenum.hxx> #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <rtl/textenc.h> #include "parcss1.hxx" diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 9868404cc1..5f32140265 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,19 +36,19 @@ #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/i18n/ScriptType.hpp> -#ifndef PRODUCT +#ifdef DBG_UTIL #include <stdlib.h> #endif #include <hintids.hxx> #define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> -#include <svtools/stritem.hxx> +#include <svl/svstdarr.hxx> +#include <svl/stritem.hxx> #include <svtools/imap.hxx> #include <svtools/htmltokn.h> #include <svtools/htmlkywd.hxx> #include <svtools/ctrltool.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <sfx2/fcontnr.hxx> @@ -307,7 +307,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn, // <-- nOpenParaToken( 0 ), eJumpTo( JUMPTO_NONE ), -#ifndef PRODUCT +#ifdef DBG_UTIL nContinue( 0 ), #endif eParaAdjust( SVX_ADJUST_END ), @@ -437,7 +437,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn, __EXPORT SwHTMLParser::~SwHTMLParser() { -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( !nContinue, "DTOR im Continue - Das geht schief!!!" ); #endif BOOL bAsync = pDoc->IsInLoadAsynchron(); @@ -588,7 +588,7 @@ SvParserState __EXPORT SwHTMLParser::CallParser() void __EXPORT SwHTMLParser::Continue( int nToken ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( !nContinue, "Continue im Continue - Das sollte doch nicht sein, oder?" ); nContinue++; #endif @@ -603,7 +603,7 @@ void __EXPORT SwHTMLParser::Continue( int nToken ) // Die ViewShell vom Dokument holen, merken und als aktuelle setzen. ViewShell *pInitVSh = CallStartAction(); - + if( SVPAR_ERROR != eState && GetMedium() && !bViewCreated ) { // Beim ersten Aufruf erstmal returnen, Doc anzeigen @@ -614,7 +614,7 @@ void __EXPORT SwHTMLParser::Continue( int nToken ) bViewCreated = TRUE; pDoc->SetInLoadAsynchron( TRUE ); -#ifndef PRODUCT +#ifdef DBG_UTIL nContinue--; #endif @@ -724,7 +724,7 @@ void __EXPORT SwHTMLParser::Continue( int nToken ) pPam->GetPoint()->nContent.Assign( pTxtNode, nStt ); } -#ifndef PRODUCT +#ifdef DBG_UTIL // !!! sollte nicht moeglich sein, oder ?? ASSERT( pSttNdIdx->GetIndex()+1 != pPam->GetBound( TRUE ).nNode.GetIndex(), "Pam.Bound1 steht noch im Node" ); @@ -922,7 +922,7 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( FALSE ).nNode.GetIndex() ) // wieder rekonstruieren. CallEndAction( TRUE ); -#ifndef PRODUCT +#ifdef DBG_UTIL nContinue--; #endif } @@ -977,7 +977,7 @@ void __EXPORT SwHTMLParser::NextToken( int nToken ) return ; } -#ifndef PRODUCT +#ifdef DBG_UTIL if( pPendStack ) { switch( nToken ) @@ -2471,12 +2471,12 @@ ViewShell *SwHTMLParser::CallStartAction( ViewShell *pVSh, BOOL bChkPtr ) if( !pVSh || bChkPtr ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ViewShell *pOldVSh = pVSh; #endif pDoc->GetEditShell( &pVSh ); ASSERT( !pVSh || !pOldVSh || pOldVSh == pVSh, "CallStartAction: Wer hat die ViewShell ausgetauscht?" ); -#ifndef PRODUCT +#ifdef DBG_UTIL if( pOldVSh && !pVSh ) pVSh = 0; #endif @@ -2757,7 +2757,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable, switch( nWhich ) { - case RES_FLTR_BOOKMARK: // insert bookmark + case RES_FLTR_BOOKMARK: // insert bookmark { const String sName( ((SfxStringItem*)pAttr->pItem)->GetValue() ); IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); @@ -2771,7 +2771,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable, sName, IDocumentMarkAccess::BOOKMARK ); - // jump to bookmark + // jump to bookmark if( JUMPTO_MARK == eJumpTo && pNewMark->GetName() == ::rtl::OUString(sJmpMark) ) { bChkJumpMark = TRUE; @@ -3882,7 +3882,7 @@ void SwHTMLParser::EndPara( BOOL bReal ) { if( HTML_LI_ON==nOpenParaToken && pTable ) { -#ifndef PRODUCT +#ifdef DBG_UTIL const SwNumRule *pNumRule = pPam->GetNode()->GetTxtNode()->GetNumRule(); #endif ASSERT( pNumRule, "Wo ist die Numrule geblieben" ); diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 9ba812b62e..bb89c877dc 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,11 +44,11 @@ #ifndef _SVSTDARR_STRINGSDTOR_DECL #define _SVSTDARR_STRINGSDTOR #endif -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <tools/urlobj.hxx> #include <sfx2/sfxhtml.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <svx/svxenum.hxx> #include <fmtornt.hxx> #include <com/sun/star/drawing/XShape.hpp> @@ -453,7 +453,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient enum JumpToMarks { JUMPTO_NONE, JUMPTO_MARK, JUMPTO_TABLE, JUMPTO_FRAME, JUMPTO_REGION, JUMPTO_GRAPHIC } eJumpTo; -#ifndef PRODUCT +#ifdef DBG_UTIL sal_uInt16 nContinue; // Tiefe der Continue-Aufrufe #endif diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 26e150ad1a..1a74d5a129 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -34,7 +34,7 @@ #include <stdlib.h> #include <hintids.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <rtl/tencinfo.h> #include <vcl/wrkwin.hxx> #include <sfx2/linkmgr.hxx> @@ -51,7 +51,7 @@ #include <svx/fontitem.hxx> #include <svx/scripttypeitem.hxx> #include <svx/langitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <svx/frmdiritem.hxx> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index 477dd11dd5..d3f112ed8b 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -37,7 +37,7 @@ #define _SVSTDARR_STRINGSDTOR #define _SVSTDARR_STRINGSSORTDTOR #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <i18npool/lang.h> #include <tools/stream.hxx> diff --git a/sw/source/filter/inc/fltglbls.hxx b/sw/source/filter/inc/fltglbls.hxx index 9b5c349179..328a857f21 100644 --- a/sw/source/filter/inc/fltglbls.hxx +++ b/sw/source/filter/inc/fltglbls.hxx @@ -32,7 +32,7 @@ #include <tools/string.hxx> #include <i18npool/lang.h> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> class SfxPoolItem; diff --git a/sw/source/filter/inc/msfilter.hxx b/sw/source/filter/inc/msfilter.hxx index f7688da6ec..64c12c2840 100644 --- a/sw/source/filter/inc/msfilter.hxx +++ b/sw/source/filter/inc/msfilter.hxx @@ -45,7 +45,7 @@ #include <fltshell.hxx> // fuer den Attribut Stack #include <redline.hxx> #include <shellio.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #define CREATE_CONST_ASC(s) String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM(s)) diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx index 7edf77ba37..7797d227bf 100644 --- a/sw/source/filter/inc/wrtswtbl.hxx +++ b/sw/source/filter/inc/wrtswtbl.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,7 +32,7 @@ #include <tools/solar.h> #include <tools/color.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <swdllapi.h> @@ -262,7 +262,7 @@ protected: BOOL bRelWidths : 1; // Breiten relativ ausgeben? BOOL bUseLayoutHeights : 1; // Layout zur Hoehenbestimmung nehmen? -#ifndef PRODUCT +#ifdef DBG_UTIL BOOL bGetLineHeightCalled : 1; #endif diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx index ad8a6e1199..46426620b3 100644 --- a/sw/source/filter/rtf/rtfatr.cxx +++ b/sw/source/filter/rtf/rtfatr.cxx @@ -40,12 +40,12 @@ #include <com/sun/star/i18n/ScriptType.hdl> #include <vcl/cvtgrf.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/stritem.hxx> +#include <svl/urihelper.hxx> +#include <svl/stritem.hxx> #include <svtools/rtfkeywd.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <svtools/rtfout.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/fontitem.hxx> #include <svx/hyznitem.hxx> #include <svx/tstpitem.hxx> @@ -520,7 +520,7 @@ void OutRTF_SwFlyFrmFmt( SwRTFWriter& rRTFWrt ) rRTFWrt.SetStrm( *pSaveStrm ); // Stream-Pointer wieder zurueck - if( aTmpStrm.GetSize() ) // gibt es SWG spezifische Attribute ?? + if ( aTmpStrm.GetEndOfData() ) // gibt es SWG spezifische Attribute? { aTmpStrm.Seek( 0L ); rRTFWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << aTmpStrm << '}'; diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx index d891d53fd2..d273a129ca 100644 --- a/sw/source/filter/rtf/rtffld.cxx +++ b/sw/source/filter/rtf/rtffld.cxx @@ -41,9 +41,9 @@ #ifndef _GRAPH_HXX //autogen #include <vcl/graph.hxx> #endif -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <svtools/rtftoken.h> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <svx/fontitem.hxx> #include <svx/fhgtitem.hxx> #include <svx/langitem.hxx> diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx index 5c1f0debc0..0e3dffa2dc 100644 --- a/sw/source/filter/rtf/rtffly.cxx +++ b/sw/source/filter/rtf/rtffly.cxx @@ -35,7 +35,7 @@ #include <tools/list.hxx> #include <tools/cachestr.hxx> #include <svtools/rtftoken.h> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/prntitem.hxx> #include <svx/opaqitem.hxx> #include <svx/protitem.hxx> diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx index df96878b38..85954250bf 100644 --- a/sw/source/filter/rtf/rtfnum.cxx +++ b/sw/source/filter/rtf/rtfnum.cxx @@ -34,7 +34,7 @@ #include <tools/stream.hxx> #include <svtools/rtftoken.h> #include <svtools/rtfkeywd.hxx> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <svtools/rtfout.hxx> #include <svx/lrspitem.hxx> #include <svx/fontitem.hxx> @@ -734,7 +734,7 @@ void SwRTFParser::RemoveUnusedNumRule( SwNumRule* pRule ) } pDoc->DelNumRule( pRule->GetName() ); } -#ifndef PRODUCT +#ifdef DBG_UTIL else { ASSERT( pRule, "NumRulePointer 0 kann nicht geloescht werden" ); diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index a698afb4cc..1050ac0986 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -37,9 +37,9 @@ #include <tools/errinf.hxx> #include <tools/stream.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svtools/rtftoken.h> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <svx/fhgtitem.hxx> #include <svx/ulspitem.hxx> #include <svx/tstpitem.hxx> @@ -379,7 +379,7 @@ void SwRTFParser::Continue( int nToken ) pPam->GetPoint()->nContent.Assign( pTxtNode, nStt ); } -#ifndef PRODUCT +#ifdef DBG_UTIL // !!! sollte nicht moeglich sein, oder ?? ASSERT( pSttNdIdx->GetIndex()+1 != pPam->GetBound( TRUE ).nNode.GetIndex(), "Pam.Bound1 steht noch im Node" ); @@ -1053,7 +1053,7 @@ void rtfSections::InsertSegments(bool bNewDoc) namespace sw{ namespace util{ - + InsertedTableClient::InsertedTableClient(SwTableNode & rNode) { rNode.Add(this); @@ -1063,7 +1063,7 @@ SwTableNode * InsertedTableClient::GetTableNode() { return dynamic_cast<SwTableNode *> (pRegisteredIn); } - + InsertedTablesManager::InsertedTablesManager(const SwDoc &rDoc) : mbHasRoot(rDoc.GetRootFrm()) { @@ -1083,7 +1083,7 @@ void InsertedTablesManager::DelAndMakeTblFrms() if (pTable) { SwFrmFmt * pFrmFmt = pTable->GetTable().GetFrmFmt(); - + if (pFrmFmt != NULL) { SwNodeIndex *pIndex = aIter->second; @@ -1100,9 +1100,9 @@ void InsertedTablesManager::InsertTable(SwTableNode &rTableNode, SwPaM &rPaM) return; //Associate this tablenode with this after position, replace an //old //node association if necessary - + InsertedTableClient * pClient = new InsertedTableClient(rTableNode); - + maTables.insert(TblMap::value_type(pClient, &(rPaM.GetPoint()->nNode))); } } @@ -2199,7 +2199,7 @@ void SwRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) SwPaM aPam( *pPam->GetPoint() ); -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( nSNd <= nENd, "Start groesser als Ende" ); SwNode* pDebugNd = pDoc->GetNodes()[ nSNd ]; ASSERT( pDebugNd->IsCntntNode(), "Start kein ContentNode" ); @@ -2788,7 +2788,7 @@ void SwRTFParser::MakeStyleTab() for( USHORT n = rColls.Count(); n; ) //if( MAXLEVEL > (nLvl = rColls[ --n ]->GetOutlineLevel() ))//#outline level,zhaojianwei // nValidOutlineLevels |= 1 << nLvl; - if( rColls[ --n ]->IsAssignedToListLevelOfOutlineStyle()) + if( rColls[ --n ]->IsAssignedToListLevelOfOutlineStyle()) nValidOutlineLevels |= 1 << rColls[ n ]->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei } @@ -3969,7 +3969,7 @@ SwTxtFmtColl* SwRTFParser::MakeColl(const String& rName, USHORT nPos, { pColl = pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false ); //pColl->SetOutlineLevel( nOutlineLevel ); //#outline level,removed by zhaojianwei - if(nOutlineLevel < MAXLEVEL ) //->add by zhaojianwei + if(nOutlineLevel < MAXLEVEL ) //->add by zhaojianwei pColl->AssignToListLevelOfOutlineStyle( nOutlineLevel ); else pColl->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,zhaojianwei diff --git a/sw/source/filter/rtf/swparrtf.hxx b/sw/source/filter/rtf/swparrtf.hxx index 006c721698..77b7ed14a1 100644 --- a/sw/source/filter/rtf/swparrtf.hxx +++ b/sw/source/filter/rtf/swparrtf.hxx @@ -44,7 +44,7 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_BOOLS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <svx/svxrtf.hxx> #include <svx/numitem.hxx> diff --git a/sw/source/filter/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx index 275f421266..100c2ab209 100644 --- a/sw/source/filter/rtf/wrtrtf.cxx +++ b/sw/source/filter/rtf/wrtrtf.cxx @@ -36,7 +36,7 @@ #include <comphelper/string.hxx> #include <tools/stream.hxx> #include <tools/datetime.hxx> -#include <vcl/fontcvt.hxx> +#include <unotools/fontcvt.hxx> #include <rtl/tencinfo.h> #include <svtools/rtfkeywd.hxx> #include <svtools/rtfout.hxx> diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index e0a2067cfc..289b67670a 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,11 +33,11 @@ #include <hintids.hxx> #define _SVSTDARR_STRINGSSORTDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <sot/storage.hxx> #include <sfx2/docfile.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <svtools/filter.hxx> #include <svx/impgrf.hxx> #include <svx/fontitem.hxx> @@ -250,7 +250,7 @@ SwPaM* Writer::NewSwPaM( SwDoc & rDoc, ULONG nStartIdx, ULONG nEndIdx, ///////////////////////////////////////////////////////////////////////////// // Stream-spezifisches -#ifndef PRODUCT +#ifdef DBG_UTIL SvStream& Writer::Strm() { ASSERT( pStrm, "Oh-oh. Dies ist ein Storage-Writer. Gleich knallts!" ); diff --git a/sw/source/filter/writer/wrt_fn.cxx b/sw/source/filter/writer/wrt_fn.cxx index bac681a875..2b56c3c9e6 100644 --- a/sw/source/filter/writer/wrt_fn.cxx +++ b/sw/source/filter/writer/wrt_fn.cxx @@ -30,8 +30,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include <svtools/itemiter.hxx> -#include <svtools/whiter.hxx> +#include <svl/itemiter.hxx> +#include <svl/whiter.hxx> #include "shellio.hxx" diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx index 01e0690d9c..ce6aed9876 100644 --- a/sw/source/filter/writer/wrtswtbl.cxx +++ b/sw/source/filter/writer/wrtswtbl.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -114,7 +114,7 @@ long SwWriteTable::GetBoxWidth( const SwTableBox *pBox ) long SwWriteTable::GetLineHeight( const SwTableLine *pLine ) { -#ifndef PRODUCT +#ifdef DBG_UTIL BOOL bOldGetLineHeightCalled = bGetLineHeightCalled; bGetLineHeightCalled = TRUE; #endif @@ -135,7 +135,7 @@ long SwWriteTable::GetLineHeight( const SwTableLine *pLine ) // <-- bUseLayoutHeights = bLayoutAvailable; /*FALSE;*/ -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( bLayoutAvailable || !bOldGetLineHeightCalled, "Layout ungueltig?" ); #endif } @@ -431,7 +431,7 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, BOOL bSubExpanded = FALSE; USHORT nLines = rLines.Count(); -#ifndef PRODUCT +#ifdef DBG_UTIL USHORT nEndCPos = 0; #endif @@ -467,11 +467,11 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, } else { -#ifndef PRODUCT +#ifdef DBG_UTIL long nCheckPos = nRPos + GetLineHeight( pLine ); #endif nRPos = nStartRPos + nParentLineHeight; -#ifndef PRODUCT +#ifdef DBG_UTIL SwWriteTableRow aRow( nStartRPos + nParentLineHeight, bUseLayoutHeights ); ASSERT( aRows.Seek_Entry(&aRow), "Parent-Zeile nicht gefunden" ); @@ -514,7 +514,7 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, } else { -#ifndef PRODUCT +#ifdef DBG_UTIL USHORT nCheckPos = nCPos + (USHORT)GetBoxWidth( pBox ); if( !nEndCPos ) { @@ -528,7 +528,7 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, } #endif nCPos = nStartCPos + nParentLineWidth; -#ifndef PRODUCT +#ifdef DBG_UTIL SwWriteTableCol aCol( nStartCPos + nParentLineWidth ); ASSERT( aCols.Seek_Entry(&aCol), "Parent-Zelle nicht gefunden" ); @@ -594,7 +594,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, USHORT nStartRow, // Und ihren Index USHORT nOldRow = nRow; SwWriteTableRow aRow( nRPos,bUseLayoutHeights ); -#ifndef PRODUCT +#ifdef DBG_UTIL BOOL bFound = #endif aRows.Seek_Entry( &aRow, &nRow ); @@ -679,7 +679,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, USHORT nStartRow, // Und ihren Index USHORT nOldCol = nCol; SwWriteTableCol aCol( nCPos ); -#ifndef PRODUCT +#ifdef DBG_UTIL BOOL bFound2 = #endif aCols.Seek_Entry( &aCol, &nCol ); @@ -776,7 +776,7 @@ SwWriteTable::SwWriteTable(const SwTableLines& rLines, long nWidth, nInnerBorder(0), nBaseWidth(nBWidth), nHeadEndRow(USHRT_MAX), nLeftSub(nLSub), nRightSub(nRSub), nTabWidth(nWidth), bRelWidths(bRel), bUseLayoutHeights(true), -#ifndef PRODUCT +#ifdef DBG_UTIL bGetLineHeightCalled(false), #endif bColsOption(false), bColTags(true), bLayoutExport(false), @@ -803,7 +803,7 @@ SwWriteTable::SwWriteTable( const SwHTMLTableLayout *pLayoutInfo ) nInnerBorder(0), nBaseWidth(pLayoutInfo->GetWidthOption()), nHeadEndRow(0), nLeftSub(0), nRightSub(0), nTabWidth(pLayoutInfo->GetWidthOption()), bRelWidths(pLayoutInfo->HasPrcWidthOption()), bUseLayoutHeights(false), -#ifndef PRODUCT +#ifdef DBG_UTIL bGetLineHeightCalled(false), #endif bColsOption(pLayoutInfo->HasColsOption()), diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx index b1d19915f4..6e7097f97e 100644 --- a/sw/source/filter/ww1/fltshell.cxx +++ b/sw/source/filter/ww1/fltshell.cxx @@ -36,7 +36,7 @@ #include <hints.hxx> #include <vcl/graph.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <svx/impgrf.hxx> #include <svx/boxitem.hxx> #include <svx/boxitem.hxx> @@ -45,7 +45,7 @@ #include <svx/cntritem.hxx> #include <svx/postitem.hxx> #include <svx/crsditem.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <unotools/charclass.hxx> #include <txtftn.hxx> #include <fmtpdsc.hxx> @@ -1682,7 +1682,7 @@ SfxItemSet* SwFltOutBase::NewFlyDefaults() BOOL SwFltOutBase::BeginFly( RndStdIds eAnchor /*= FLY_AT_CNTNT*/, BOOL bAbsolutePos /*= FALSE*/, const SfxItemSet* -#ifndef PRODUCT +#ifdef DBG_UTIL pMoreAttrs /*= 0*/ #endif ) diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx index 29490aa1e3..b932a49c18 100644 --- a/sw/source/filter/ww1/w1filter.cxx +++ b/sw/source/filter/ww1/w1filter.cxx @@ -58,7 +58,7 @@ #ifndef _SVX_TSTPITEM_HXX //autogen #include <svx/tstpitem.hxx> #endif -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <fmtfsize.hxx> #include <doc.hxx> #include <pam.hxx> diff --git a/sw/source/filter/ww1/w1sprm.cxx b/sw/source/filter/ww1/w1sprm.cxx index eceaca80dd..83a8fd68ba 100644 --- a/sw/source/filter/ww1/w1sprm.cxx +++ b/sw/source/filter/ww1/w1sprm.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -261,7 +261,7 @@ void Ww1SingleSprmPBrc::Start( Ww1Shell& rOut, BYTE, W1_BRC10* pBrc, USHORT -#ifndef PRODUCT +#ifdef DBG_UTIL nSize #endif , @@ -461,7 +461,7 @@ void Ww1SingleSprmPFInTable::Start( void Ww1SingleSprmPFInTable::Stop( Ww1Shell& -#ifndef PRODUCT +#ifdef DBG_UTIL rOut #endif , diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 44a5c329a5..9480f67382 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -44,7 +44,7 @@ #include <hintids.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <svx/fontitem.hxx> #include <svx/tstpitem.hxx> diff --git a/sw/source/filter/ww8/dump/ww8scan.hxx b/sw/source/filter/ww8/dump/ww8scan.hxx index abec5069e7..e24f3a85b7 100644 --- a/sw/source/filter/ww8/dump/ww8scan.hxx +++ b/sw/source/filter/ww8/dump/ww8scan.hxx @@ -48,7 +48,7 @@ #define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #ifndef WW8STRUC_HXX #include <ww8struc.hxx> // FIB, STSHI, STD diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx index 6cd2f9b280..86c0357793 100644 --- a/sw/source/filter/ww8/escher.hxx +++ b/sw/source/filter/ww8/escher.hxx @@ -34,7 +34,7 @@ #define _ESCHER_HXX #ifndef _ESCHEREX_HXX -#include <svx/escherex.hxx> +#include <filter/msfilter/escherex.hxx> #endif const sal_uInt32 nInlineHack = 0x00010001; diff --git a/sw/source/filter/ww8/tracer.cxx b/sw/source/filter/ww8/tracer.cxx index 7e1e48b1f9..a8541139ef 100644 --- a/sw/source/filter/ww8/tracer.cxx +++ b/sw/source/filter/ww8/tracer.cxx @@ -34,7 +34,7 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ #include <tools/urlobj.hxx> //INetURLObject #include <sfx2/docfile.hxx> //SfxMedium -#include <svx/msfiltertracer.hxx> //MSFilterTracer +#include <filter/msfilter/msfiltertracer.hxx> //MSFilterTracer #include "tracer.hxx" //sw::log::Tracer using rtl::OUString; diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 2fe6b50663..6ead178825 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -42,7 +42,7 @@ #include <algorithm> //std::swap #include <functional> //std::binary_function -# include <svtools/itemiter.hxx> //SfxItemIter +# include <svl/itemiter.hxx> //SfxItemIter # include <svx/svdobj.hxx> //SdrObject # include <svx/svdoole2.hxx> //SdrOle2Obj # include <svx/fmglob.hxx> //FmFormInventor diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx index 18e73b1e2d..68a474b227 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -40,8 +40,8 @@ #include <sfx2/objsh.hxx> #include "types.hxx" -#include <svtools/itempool.hxx> //SfxItemPool -#include <svtools/itemset.hxx> //SfxItemSet +#include <svl/itempool.hxx> //SfxItemPool +#include <svl/itemset.hxx> //SfxItemSet #include <format.hxx> //SwFmt #include <node.hxx> //SwCntntNode #include <pam.hxx> //SwPaM diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index 8c77c6a3c7..071bc6dce1 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -48,7 +48,7 @@ #endif #ifndef SV_FONTCVT_HXX -# include <vcl/fontcvt.hxx> //GetSubsFontName +# include <unotools/fontcvt.hxx> //GetSubsFontName #endif # include <svx/paperinf.hxx> //lA0Width... # include <svx/lrspitem.hxx> //SvxLRSpaceItem diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 7cb6aa1386..27c0903e76 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1,6 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * * * Copyright 2008 by Sun Microsystems, Inc. * @@ -38,14 +39,14 @@ #define _SVSTDARR_ULONGSSORT #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <vcl/cvtgrf.hxx> #include <vcl/virdev.hxx> #include <com/sun/star/drawing/XShape.hpp> #include <vcl/svapp.hxx> #include <sot/storage.hxx> #include <svtools/filter.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/svdobj.hxx> #include <svx/svdotext.hxx> #include <svx/svdmodel.hxx> @@ -204,9 +205,9 @@ void WW8Export::DoComboBox(const rtl::OUString &rName, // write the refence to the "picture" structure ULONG nDataStt = pDataStrm->Tell(); pChpPlc->AppendFkpEntry( Strm().Tell() ); - + WriteChar( 0x01 ); - + static BYTE aArr1[] = { 0x03, 0x6a, 0,0,0,0, // sprmCPicLocation @@ -216,29 +217,29 @@ void WW8Export::DoComboBox(const rtl::OUString &rName, }; BYTE* pDataAdr = aArr1 + 2; Set_UInt32( pDataAdr, nDataStt ); - + pChpPlc->AppendFkpEntry(Strm().Tell(), sizeof(aArr1), aArr1); - + OutputField(0, ww::eFORMDROPDOWN, FieldString(ww::eFORMDROPDOWN), WRITEFIELD_CLOSE); - + ::sw::WW8FFData aFFData; - - aFFData.setType(2); + + aFFData.setType(2); aFFData.setName(rName); aFFData.setHelp(rHelp); aFFData.setStatus(rToolTip); - + sal_uInt32 nListItems = rListItems.getLength(); - + for (sal_uInt32 i = 0; i < nListItems; i++) { if (i < 0x20 && rSelected == rListItems[i]) aFFData.setResult(::sal::static_int_cast<sal_uInt8>(i)); aFFData.addListboxEntry(rListItems[i]); } - - aFFData.Write(pDataStrm); + + aFFData.Write(pDataStrm); } void WW8Export::DoCheckBox(uno::Reference<beans::XPropertySet> xPropSet) @@ -265,12 +266,12 @@ void WW8Export::DoCheckBox(uno::Reference<beans::XPropertySet> xPropSet) pChpPlc->AppendFkpEntry(Strm().Tell(), sizeof( aArr1 ), aArr1 ); - + ::sw::WW8FFData aFFData; - + aFFData.setType(1); aFFData.setCheckboxHeight(0x14); - + sal_Int16 nTemp = 0; xPropSet->getPropertyValue(C2U("DefaultState")) >>= nTemp; sal_uInt32 nIsDefaultChecked(nTemp); @@ -292,7 +293,7 @@ void WW8Export::DoCheckBox(uno::Reference<beans::XPropertySet> xPropSet) ASSERT(!this, "how did that happen"); } } - + ::rtl::OUString aStr; static ::rtl::OUString sName(C2U("Name")); if (xPropSetInfo->hasPropertyByName(sName)) @@ -342,7 +343,7 @@ void WW8Export::DoFormText(const SwInputField * pFld) sizeof( aArr1 ), aArr1 ); ::sw::WW8FFData aFFData; - + aFFData.setType(0); aFFData.setName(pFld->GetPar2()); aFFData.setHelp(pFld->GetHelp()); @@ -2018,7 +2019,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) if (bSwapInPage) (const_cast<SdrObject*>(pSdrObj))->SetPage(0); } -#ifndef PRODUCT +#ifdef DBG_UTIL else ASSERT( !this, "Where is the SDR-Object?" ); #endif diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 92da903191..05153480bd 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -53,8 +53,8 @@ #include <svx/brkitem.hxx> #include <svx/frmdiritem.hxx> #include <svx/tstpitem.hxx> -#include "svtools/urihelper.hxx" -#include <svtools/whiter.hxx> +#include "svl/urihelper.hxx" +#include <svl/whiter.hxx> #include <fmtpdsc.hxx> #include <fmtfsize.hxx> #include <fmtornt.hxx> diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index c6f6ce0b02..935bf36f00 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -72,6 +72,7 @@ #include <fmtline.hxx> #include <swtable.hxx> #include <msfilter.hxx> +#include <swmodule.hxx> #include <writerfilter/doctok/sprmids.hxx> @@ -1856,13 +1857,48 @@ void WW8_WrPlcFtnEdn::Append( WW8_CP nCp, const SwFmtFtn& rFtn ) aCntnt.Insert( p, aCntnt.Count() ); } -void WW8_WrPlcPostIt::Append( WW8_CP nCp, const SwPostItField& rPostIt ) +WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt) +{ + mpRichText = pPostIt->GetTextObject(); + if (!mpRichText) + msSimpleText = pPostIt->GetTxt(); + msOwner = pPostIt->GetPar1(); + maDateTime = DateTime(pPostIt->GetDate(), pPostIt->GetTime()); +} + +WW8_Annotation::WW8_Annotation(const SwRedlineData* pRedline) : mpRichText(0) +{ + msSimpleText = pRedline->GetComment(); + msOwner = SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor()); + maDateTime = pRedline->GetTimeStamp(); +} + +void WW8_WrPlcAnnotations::Append( WW8_CP nCp, const SwPostItField *pPostIt ) { aCps.Insert( nCp, aCps.Count() ); - void* p = (void*)&rPostIt; + WW8_Annotation* p = new WW8_Annotation(pPostIt); aCntnt.Insert( p, aCntnt.Count() ); } +void WW8_WrPlcAnnotations::Append( WW8_CP nCp, const SwRedlineData *pRedline ) +{ + maProcessedRedlines.insert(pRedline); + aCps.Insert( nCp, aCps.Count() ); + WW8_Annotation* p = new WW8_Annotation(pRedline); + aCntnt.Insert( p, aCntnt.Count() ); +} + +bool WW8_WrPlcAnnotations::IsNewRedlineComment( const SwRedlineData *pRedline ) +{ + return maProcessedRedlines.find(pRedline) == maProcessedRedlines.end(); +} + +WW8_WrPlcAnnotations::~WW8_WrPlcAnnotations() +{ + for( USHORT n=0; n < aCntnt.Count(); n++ ) + delete (WW8_Annotation*)aCntnt[n]; +} + bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, BYTE nTTyp, WW8_CP& rCount ) { @@ -1882,13 +1918,13 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, BYTE nTTyp, // Anfaenge fuer PlcfAtnTxt pTxtPos->Append( rWrt.Fc2Cp( rWrt.Strm().Tell() )); - const SwPostItField& rPFld = *(SwPostItField*)aCntnt[ i ]; rWrt.WritePostItBegin(); - if (const OutlinerParaObject* pOutliner = rPFld.GetTextObject()) - rWrt.WriteOutliner(*pOutliner, nTTyp); + const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i]; + if (rAtn.mpRichText) + rWrt.WriteOutliner(*rAtn.mpRichText, nTTyp); else { - String sTxt(rPFld.GetTxt()); + String sTxt(rAtn.msSimpleText); sTxt.SearchAndReplaceAll(0x0A, 0x0B); rWrt.WriteStringAsPara( sTxt ); } @@ -2015,8 +2051,8 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, BYTE nTTyp, // then write first the GrpXstAtnOwners for ( i = 0; i < nLen; ++i ) { - const SwPostItField& rPFld = *(SwPostItField*)aCntnt[ i ]; - aStrArr.push_back(rPFld.GetPar1()); + const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i]; + aStrArr.push_back(rAtn.msOwner); } //sort and remove duplicates @@ -2054,10 +2090,9 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, BYTE nTTyp, { for( i = 0; i < nLen; ++i ) { - const SwPostItField& rPFld = *(SwPostItField*)aCntnt[ i ]; + const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i]; - sal_uInt32 nDTTM = - sw::ms::DateTime2DTTM(DateTime(rPFld.GetDate(),rPFld.GetTime())); + sal_uInt32 nDTTM = sw::ms::DateTime2DTTM(rAtn.maDateTime); SwWW8Writer::WriteLong( *rWrt.pTableStrm, nDTTM ); SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0 ); @@ -2137,12 +2172,12 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, BYTE nTTyp, { for ( i = 0; i < nLen; ++i ) { - const SwPostItField& rPFld = *(SwPostItField*)aCntnt[ i ]; + const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i]; //aStrArr is sorted myiter aIter = ::std::lower_bound(aStrArr.begin(), - aStrArr.end(), rPFld.GetPar1()); - ASSERT(aIter != aStrArr.end() && *aIter == rPFld.GetPar1(), + aStrArr.end(), rAtn.msOwner); + ASSERT(aIter != aStrArr.end() && *aIter == rAtn.msOwner, "Impossible"); sal_uInt16 nFndPos = static_cast< sal_uInt16 >(aIter - aStrArr.begin()); String sAuthor(*aIter); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 9fc9d23efe..ccf8c0e741 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -46,20 +46,20 @@ #include <docsh.hxx> #define _SVSTDARR_BOOLS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> -#include <svtools/fltrcfg.hxx> +#include <unotools/fltrcfg.hxx> #include <vcl/salbtype.hxx> #include <sot/storage.hxx> -#include <svtools/zformat.hxx> +#include <svl/zformat.hxx> #include <sfx2/docinf.hxx> #include <svx/tstpitem.hxx> #include <svx/svdmodel.hxx> #include <svx/svdpage.hxx> #include <svx/hyznitem.hxx> #include <svx/langitem.hxx> -#include <svx/msoleexp.hxx> -#include <svx/msocximex.hxx> +#include <filter/msfilter/msoleexp.hxx> +#include <filter/msfilter/msocximex.hxx> #include <svx/lrspitem.hxx> #include <svx/boxitem.hxx> #include <svx/brshitem.hxx> @@ -112,9 +112,10 @@ #include "dbgoutsw.hxx" #include <sfx2/docfile.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <unotools/tempfile.hxx> -#include <svx/mscodec.hxx> +#include <filter/msfilter/mscodec.hxx> +#include <filter/msfilter/svxmsbas.hxx> #include <osl/time.h> #include <rtl/random.h> #include "WW8Sttbf.hxx" @@ -741,7 +742,7 @@ ULONG SwWW8Writer::FillUntil( SvStream& rStrm, ULONG nEndPos ) if( nEndPos > nCurPos ) SwWW8Writer::FillCount( rStrm, nEndPos - nCurPos ); -#ifndef PRODUCT +#ifdef DBG_UTIL else ASSERT( nEndPos == nCurPos, "Falsches FillUntil()" ); #endif @@ -2371,7 +2372,6 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t if ( m_rWW8Export.bWrtWW8 ) { sal_uInt32 aSprmIds[] = {NS_sprm::LN_TCellShd, NS_sprm::LN_TCellShadow}; - sal_uInt8 nBoxes0 = rTabBoxes.Count(); if (nBoxes0 > 21) nBoxes0 = 21; @@ -2388,25 +2388,25 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t const SwFrmFmt * pFrmFmt = pBox1->GetFrmFmt(); const SfxPoolItem * pI = NULL; Color aColor; - + if ( SFX_ITEM_ON == - pFrmFmt->GetAttrSet(). - GetItemState( RES_BACKGROUND, false, &pI ) ) + pFrmFmt->GetAttrSet(). + GetItemState( RES_BACKGROUND, false, &pI ) ) { aColor = dynamic_cast<const SvxBrushItem *>(pI)->GetColor(); } else aColor = COL_AUTO; - + WW8SHDLong aSHD; aSHD.setCvFore( 0xFF000000 ); - + sal_uInt32 nBgColor = aColor.GetColor(); if ( nBgColor == COL_AUTO ) aSHD.setCvBack( 0xFF000000 ); else aSHD.setCvBack( wwUtility::RGBToBGR( nBgColor ) ); - + aSHD.Write( m_rWW8Export ); } } @@ -2713,7 +2713,6 @@ void WW8Export::WriteFkpPlcUsw() // <-- { ::std::vector<String> aStrings; - ::ww8::StringVector_t & aSttbStrings = pSttbfAssoc->getStrings(); ::ww8::StringVector_t::const_iterator aItEnd = aSttbStrings.end(); for (::ww8::StringVector_t::const_iterator aIt = aSttbStrings.begin(); @@ -2726,14 +2725,12 @@ void WW8Export::WriteFkpPlcUsw() WriteAsStringTable(aStrings, pFib->fcSttbfAssoc, pFib->lcbSttbfAssoc); } - } Strm().Seek( 0 ); // Reclaim stored FIB data from document. ::ww8::WW8FibData * pFibData = dynamic_cast<ww8::WW8FibData *> (pDoc->getExternalData(::sw::FIB).get()); - // --> OD 2009-10-19 #i106057# if ( pFibData ) // <-- @@ -2745,6 +2742,7 @@ void WW8Export::WriteFkpPlcUsw() } pFib->Write( Strm() ); // FIB + } void WW8Export::StoreDoc1() @@ -2867,7 +2865,7 @@ namespace { const ULONG WW_BLOCKSIZE = 0x200; - void EncryptRC4(svx::MSCodec_Std97& rCtx, SvStream &rIn, SvStream &rOut) + void EncryptRC4(msfilter::MSCodec_Std97& rCtx, SvStream &rIn, SvStream &rOut) { rIn.Seek(STREAM_SEEK_TO_END); ULONG nLen = rIn.Tell(); @@ -3041,7 +3039,7 @@ void WW8Export::ExportDocument_Impl() pFtn = new WW8_WrPlcFtnEdn( TXT_FTN ); // Footnotes pEdn = new WW8_WrPlcFtnEdn( TXT_EDN ); // Endnotes - pAtn = new WW8_WrPlcPostIt; // PostIts + pAtn = new WW8_WrPlcAnnotations; // PostIts pTxtBxs = new WW8_WrPlcTxtBoxes( TXT_TXTBOX ); pHFTxtBxs = new WW8_WrPlcTxtBoxes( TXT_HFTXTBOX ); @@ -3103,7 +3101,7 @@ void WW8Export::ExportDocument_Impl() for (xub_StrLen nChar = 0; nChar < nLen; ++nChar ) aPassword[nChar] = sUniPassword.GetChar(nChar); - svx::MSCodec_Std97 aCtx; + msfilter::MSCodec_Std97 aCtx; aCtx.InitKey(aPassword, aDocId); SvStream *pStrmTemp, *pTableStrmTemp, *pDataStrmTemp; @@ -3397,11 +3395,23 @@ SwWW8Writer::~SwWW8Writer() { } +extern "C" SAL_DLLPUBLIC_EXPORT ULONG SAL_CALL SaveOrDelMSVBAStorage_ww8( SfxObjectShell& rDoc, SotStorage& rStor, BOOL bSaveInto, const String& rStorageName ) +{ + SvxImportMSVBasic aTmp( rDoc, rStor ); + return aTmp.SaveOrDelMSVBAStorage( bSaveInto, rStorageName ); +} + extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ExportDOC( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) { xRet = new SwWW8Writer( rFltName, rBaseURL ); } + +extern "C" SAL_DLLPUBLIC_EXPORT ULONG SAL_CALL GetSaveWarningOfMSVBAStorage_ww8( SfxObjectShell &rDocS ) +{ + return SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( rDocS ); +} + bool WW8_WrPlcFtnEdn::WriteTxt( WW8Export& rWrt ) { bool bRet = false; @@ -3438,7 +3448,7 @@ void WW8_WrPlcFtnEdn::WritePlc( WW8Export& rWrt ) const } -bool WW8_WrPlcPostIt::WriteTxt( WW8Export& rWrt ) +bool WW8_WrPlcAnnotations::WriteTxt( WW8Export& rWrt ) { bool bRet = WriteGenericTxt( rWrt, TXT_ATN, rWrt.pFib->ccpAtn ); rWrt.pFldAtn->Finish( rWrt.Fc2Cp( rWrt.Strm().Tell() ), @@ -3447,7 +3457,7 @@ bool WW8_WrPlcPostIt::WriteTxt( WW8Export& rWrt ) return bRet; } -void WW8_WrPlcPostIt::WritePlc( WW8Export& rWrt ) const +void WW8_WrPlcAnnotations::WritePlc( WW8Export& rWrt ) const { WriteGenericPlc( rWrt, TXT_ATN, rWrt.pFib->fcPlcfandTxt, rWrt.pFib->lcbPlcfandTxt, rWrt.pFib->fcPlcfandRef, diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index a96a2e5e17..dee667b1a1 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -36,7 +36,7 @@ #include <tools/gen.hxx> #ifndef _SVSTDARR_HXX #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <map> @@ -44,7 +44,7 @@ #include <shellio.hxx> #include <wrt_fn.hxx> -#include <svx/msocximex.hxx> +#include <filter/msfilter/msocximex.hxx> #include "ww8struc.hxx" #include "ww8scan.hxx" @@ -109,7 +109,7 @@ class WW8_WrPlcFld; class WW8_WrMagicTable; class WW8_WrPlcFtnEdn; class WW8_WrPlcPn; -class WW8_WrPlcPostIt; +class WW8_WrPlcAnnotations; class MSWordSections; class WW8_WrPlcTxtBoxes; class WW8_WrPct; // Verwaltung @@ -488,7 +488,7 @@ public: WW8_WrPlcPn* pChpPlc; MSWordAttrIter* pChpIter; MSWordStyles* pStyles; - WW8_WrPlcPostIt* pAtn; + WW8_WrPlcAnnotations* pAtn; WW8_WrPlcTxtBoxes *pTxtBxs, *pHFTxtBxs; const sw::Frame *mpParentFrame; //If set we are exporting content inside @@ -1149,16 +1149,30 @@ public: void Append( WW8_CP nCp, const SwFmtFtn& rFtn ); }; -class WW8_WrPlcPostIt : public WW8_WrPlcSubDoc // Doppel-Plc fuer PostIts +struct WW8_Annotation +{ + const OutlinerParaObject* mpRichText; + String msSimpleText; + String msOwner; + DateTime maDateTime; + WW8_Annotation(const SwPostItField* pPostIt); + WW8_Annotation(const SwRedlineData* pRedline); +}; + +class WW8_WrPlcAnnotations : public WW8_WrPlcSubDoc // Doppel-Plc fuer PostIts { private: //No copying - WW8_WrPlcPostIt(const WW8_WrPlcPostIt&); - WW8_WrPlcPostIt& operator=(WW8_WrPlcPostIt&); + WW8_WrPlcAnnotations(const WW8_WrPlcAnnotations&); + WW8_WrPlcAnnotations& operator=(WW8_WrPlcAnnotations&); + std::set<const SwRedlineData*> maProcessedRedlines; public: - WW8_WrPlcPostIt() {} + WW8_WrPlcAnnotations() {} + ~WW8_WrPlcAnnotations(); - void Append( WW8_CP nCp, const SwPostItField& rPostIt ); + void Append( WW8_CP nCp, const SwPostItField* pPostIt ); + void Append( WW8_CP nCp, const SwRedlineData* pRedLine ); + bool IsNewRedlineComment( const SwRedlineData* pRedLine ); bool WriteTxt( WW8Export& rWrt ); void WritePlc( WW8Export& rWrt ) const; }; diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index b8ed5cf3e3..f1f5781555 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -37,8 +37,8 @@ #include <com/sun/star/embed/Aspects.hpp> #include <rtl/math.hxx> #include <svtools/filter.hxx> -#include <svtools/itemiter.hxx> -#include "svtools/urihelper.hxx" +#include <svl/itemiter.hxx> +#include "svl/urihelper.hxx" #include <svtools/embedhlp.hxx> @@ -49,7 +49,7 @@ #include <svx/boxitem.hxx> #include <svx/shaditem.hxx> #include <svx/shaditem.hxx> -#include <svx/msoleexp.hxx> +#include <filter/msfilter/msoleexp.hxx> #include <svx/lrspitem.hxx> // SvxLRSpaceItem #include <svx/ulspitem.hxx> #include <svx/fhgtitem.hxx> diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index d03bfa5eb7..b0a40f6b54 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -41,9 +41,9 @@ #include <vcl/svapp.hxx> #include <vcl/salbtype.hxx> -#include <svtools/zformat.hxx> -#include <svtools/itemiter.hxx> -#include <svtools/whiter.hxx> +#include <svl/zformat.hxx> +#include <svl/itemiter.hxx> +#include <svl/whiter.hxx> #include <svx/fontitem.hxx> #include <svx/tstpitem.hxx> #include <svx/adjitem.hxx> @@ -980,6 +980,24 @@ void WW8AttributeOutput::StartRunProperties() m_nFieldResults = pCurrentFields ? pCurrentFields->ResultCount() : 0; } + +void WW8AttributeOutput::StartRun( const SwRedlineData* pRedlineData ) +{ + if (pRedlineData) + { + const String &rComment = pRedlineData->GetComment(); + //Only possible to export to main text + if (rComment.Len() && (m_rWW8Export.nTxtTyp == TXT_MAINTEXT)) + { + if (m_rWW8Export.pAtn->IsNewRedlineComment(pRedlineData)) + { + m_rWW8Export.pAtn->Append( m_rWW8Export.Fc2Cp( m_rWW8Export.Strm().Tell() ), pRedlineData ); + m_rWW8Export.WritePostItBegin( m_rWW8Export.pO ); + } + } + } +} + void WW8AttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) { Redline( pRedlineData ); @@ -2553,8 +2571,8 @@ void WW8AttributeOutput::SetField( const SwField& rFld, ww::eField eType, const void WW8AttributeOutput::PostitField( const SwField* pFld ) { - const SwPostItField& rPFld = *(SwPostItField*)pFld; - m_rWW8Export.pAtn->Append( m_rWW8Export.Fc2Cp( m_rWW8Export.Strm().Tell() ), rPFld ); + const SwPostItField *pPFld = (const SwPostItField*)pFld; + m_rWW8Export.pAtn->Append( m_rWW8Export.Fc2Cp( m_rWW8Export.Strm().Tell() ), pPFld ); m_rWW8Export.WritePostItBegin( m_rWW8Export.pO ); } @@ -3580,7 +3598,7 @@ ULONG WW8Export::ReplaceCr( BYTE nChar ) pChpPlc->AppendFkpEntry(rStrm.Tell()); nRetPos = rStrm.Tell(); } -#ifdef PRODUCT +#ifndef DBG_UTIL else { ASSERT( nRetPos || nPos == (ULONG)pFib->fcMin, diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index 608dfc17d2..f0fcfce991 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -57,8 +57,7 @@ public: /// Start of the text run. /// - /// No-op for binary filters. - virtual void StartRun( const SwRedlineData* /*pRedlineData*/ ) {} + virtual void StartRun( const SwRedlineData* pRedlineData ); /// End of the text run. /// diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index 9c04cb7524..429e62ce83 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -33,7 +33,7 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ #include <tools/urlobj.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <rtl/tencinfo.h> #include <swerror.h> #include <ndtxt.hxx> diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index cc17df6256..f8f6303e81 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <hintids.hxx> #include <osl/endian.h> #include <svx/fmglob.hxx> @@ -73,7 +73,7 @@ #include <svx/outliner.hxx> // #79453# #include <svx/frmdiritem.hxx> #include <svx/xfltrit.hxx> -#include <svx/msdffimp.hxx> +#include <filter/msfilter/msdffimp.hxx> #include <grfatr.hxx> // class SwCropGrf #include <fmtornt.hxx> #include <fmtcntnt.hxx> @@ -504,14 +504,15 @@ ESelection SwWW8ImplReader::GetESelection( long nCpStart, long nCpEnd ) // ItemSet gestopft. void SwWW8ImplReader::InsertTxbxStyAttrs( SfxItemSet& rS, USHORT nColl ) { - if( nColl < nColls && pCollA[nColl].pFmt && pCollA[nColl].bColl ) + SwWW8StyInf * pStyInf = GetStyle(nColl); + if( pStyInf != NULL && pStyInf->pFmt && pStyInf->bColl ) { const SfxPoolItem* pItem; for( USHORT i = POOLATTR_BEGIN; i < POOLATTR_END; i++ ) { //If we are set in the source and not set in the destination //then add it in. - if ( SFX_ITEM_SET == pCollA[nColl].pFmt->GetItemState( + if ( SFX_ITEM_SET == pStyInf->pFmt->GetItemState( i, true, &pItem ) ) { SfxItemPool *pEditPool = rS.GetPool(); diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index a6a19629f6..d6db64e57d 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -35,14 +35,14 @@ #include <iterator> #include <hintids.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <svx/impgrf.hxx> #include <svx/svdpage.hxx> #include <svx/svdmodel.hxx> #include <svx/svdograf.hxx> #include <svx/svdoole2.hxx> #include <svx/opaqitem.hxx> -#include <svx/msdffimp.hxx> +#include <filter/msfilter/msdffimp.hxx> #include <sfx2/app.hxx> #include <sfx2/docfile.hxx> #include <sfx2/fcontnr.hxx> diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 9bb61645b4..2120fee8fa 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -57,21 +57,20 @@ #include <svx/lrspitem.hxx> // SvxLRSpaceItem #include <svx/ulspitem.hxx> #include <svx/langitem.hxx> -// --> OD 2005-02-28 #i43427# #include <svx/opaqitem.hxx> -// <-- -#include <svx/svxmsbas.hxx> +#include <svx/charhiddenitem.hxx> +#include <filter/msfilter/svxmsbas.hxx> #include <svx/unoapi.hxx> #include <svx/svdoole2.hxx> -#include <svx/msdffimp.hxx> +#include <filter/msfilter/msdffimp.hxx> #include <svx/svdoashp.hxx> #include <svx/svxerr.hxx> -#include <svx/mscodec.hxx> +#include <filter/msfilter/mscodec.hxx> #include <svx/svdmodel.hxx> #include <svx/svdogrp.hxx> #include <svx/xflclit.hxx> -#include <svtools/fltrcfg.hxx> +#include <unotools/fltrcfg.hxx> #include <fmtfld.hxx> #include <fmturl.hxx> #include <fmtinfmt.hxx> @@ -129,7 +128,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> -#include <svtools/itemiter.hxx> //SfxItemIter +#include <svl/itemiter.hxx> //SfxItemIter #include <stdio.h> @@ -989,7 +988,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFmtAttr(const SwPosition& rPos, SfxItemState eState = SFX_ITEM_DEFAULT; if (const SfxItemSet *pSet = pNd->GetpSwAttrSet()) eState = pSet->GetItemState(RES_LR_SPACE, false); - if (eState != SFX_ITEM_SET) + if (eState != SFX_ITEM_SET && rReader.pCollA != NULL) pItem = &(rReader.pCollA[rReader.nAktColl].maWordLR); } @@ -1630,7 +1629,9 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) sTxt, aDate ); aPostIt.SetTextObject(pOutliner); + pCtrlStck->NewAttr(*pPaM->GetPoint(), SvxCharHiddenItem(false, RES_CHRATR_HIDDEN)); rDoc.InsertPoolItem(*pPaM, SwFmtFld(aPostIt), 0); + pCtrlStck->SetAttr(*pPaM->GetPoint(), RES_CHRATR_HIDDEN); return 0; } @@ -2163,7 +2164,7 @@ CharSet SwWW8ImplReader::GetCurrentCharSet() eSrcCharSet = maFontSrcCharSets.top(); if ((eSrcCharSet == RTL_TEXTENCODING_DONTKNOW) && (nCharFmt != -1)) eSrcCharSet = pCollA[nCharFmt].GetCharSet(); - if (eSrcCharSet == RTL_TEXTENCODING_DONTKNOW) + if ((eSrcCharSet == RTL_TEXTENCODING_DONTKNOW) && StyleExists(nAktColl)) eSrcCharSet = pCollA[nAktColl].GetCharSet(); if (eSrcCharSet == RTL_TEXTENCODING_DONTKNOW) { // patch from cmc for #i52786# @@ -2221,10 +2222,13 @@ CharSet SwWW8ImplReader::GetCurrentCJKCharSet() { if (!maFontSrcCJKCharSets.empty()) eSrcCharSet = maFontSrcCJKCharSets.top(); - if ((eSrcCharSet == RTL_TEXTENCODING_DONTKNOW) && (nCharFmt != -1)) - eSrcCharSet = pCollA[nCharFmt].GetCJKCharSet(); - if (eSrcCharSet == RTL_TEXTENCODING_DONTKNOW) - eSrcCharSet = pCollA[nAktColl].GetCJKCharSet(); + if (pCollA != NULL) + { + if ((eSrcCharSet == RTL_TEXTENCODING_DONTKNOW) && (nCharFmt != -1)) + eSrcCharSet = pCollA[nCharFmt].GetCJKCharSet(); + if (eSrcCharSet == RTL_TEXTENCODING_DONTKNOW) + eSrcCharSet = pCollA[nAktColl].GetCJKCharSet(); + } if (eSrcCharSet == RTL_TEXTENCODING_DONTKNOW) { // patch from cmc for #i52786# /* @@ -4216,7 +4220,7 @@ namespace #define WW_BLOCKSIZE 0x200 - void DecryptRC4(svx::MSCodec_Std97& rCtx, SvStream &rIn, SvStream &rOut) + void DecryptRC4(msfilter::MSCodec_Std97& rCtx, SvStream &rIn, SvStream &rOut) { rIn.Seek(STREAM_SEEK_TO_END); ULONG nLen = rIn.Tell(); @@ -4233,7 +4237,7 @@ namespace } } - void DecryptXOR(svx::MSCodec_XorWord95 &rCtx, SvStream &rIn, SvStream &rOut) + void DecryptXOR(msfilter::MSCodec_XorWord95 &rCtx, SvStream &rIn, SvStream &rOut) { ULONG nSt = rIn.Tell(); rIn.Seek(STREAM_SEEK_TO_END); @@ -4366,7 +4370,7 @@ ULONG SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss) for (xub_StrLen nChar = 0; nChar < sPassword.Len(); ++nChar ) aPassword[nChar] = sPassword.GetChar(nChar); - svx::MSCodec_XorWord95 aCtx; + msfilter::MSCodec_XorWord95 aCtx; aCtx.InitKey(aPassword); if (aCtx.VerifyKey(pWwFib->nKey, pWwFib->nHash)) { @@ -4424,7 +4428,7 @@ ULONG SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss) sal_uInt8 aSaltHash[ 16 ]; pTableStream->Read(aSaltHash, 16); - svx::MSCodec_Std97 aCtx; + msfilter::MSCodec_Std97 aCtx; aCtx.InitKey(aPassword, aDocId); if (aCtx.VerifyKey(aSaltData, aSaltHash)) { diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index a377602b87..662b6d36f3 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -33,8 +33,8 @@ #define _WW8PAR_HXX #include <tools/string.hxx> -#include <svx/msdffimp.hxx> -#include <svx/msocximex.hxx> +#include <filter/msfilter/msdffimp.hxx> +#include <filter/msfilter/msocximex.hxx> #include <svx/frmdir.hxx> #include <fltshell.hxx> // fuer den Attribut Stack diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 858fabd14a..24e69665c0 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -285,7 +285,7 @@ void sw::util::RedlineStack::close( const SwPosition& rPos, { if( pTabDesc && pTabDesc->getOldRedlineStack() ) { -#ifndef PRODUCT +#ifdef DBG_UTIL ASSERT( pTabDesc->getOldRedlineStack()->close(rPos, eType), "close without open!"); #else pTabDesc->getOldRedlineStack()->close( rPos, eType ); @@ -827,7 +827,8 @@ void SwWW8ImplReader::Read_ANLevelNo( USHORT, const BYTE* pData, short nLen ) { // nur fuer SwTxtFmtColl, nicht CharFmt // WW: 0 = no Numbering - if (pCollA[nAktColl].bColl && *pData) + SwWW8StyInf * pColl = GetStyle(nAktColl); + if (pColl != NULL && pColl->bColl && *pData) { // Bereich WW:1..9 -> SW:0..8 keine Aufzaehlung / Nummerierung @@ -861,12 +862,16 @@ void SwWW8ImplReader::Read_ANLevelNo( USHORT, const BYTE* pData, short nLen ) void SwWW8ImplReader::Read_ANLevelDesc( USHORT, const BYTE* pData, short nLen ) // Sprm 12 { - if( !pAktColl || nLen <= 0 // nur bei Styledef - || !pCollA[nAktColl].bColl // CharFmt -> ignorieren - || ( nIniFlags & WW8FL_NO_OUTLINE ) ){ - nSwNumLevel = 0xff; - return; + { + SwWW8StyInf * pStyInf = GetStyle(nAktColl); + if( !pAktColl || nLen <= 0 // nur bei Styledef + || (pStyInf && !pStyInf->bColl) // CharFmt -> ignorieren + || ( nIniFlags & WW8FL_NO_OUTLINE ) ){ + nSwNumLevel = 0xff; + return; + } } + if( nSwNumLevel <= MAXLEVEL // Bereich WW:1..9 -> SW:0..8 && nSwNumLevel <= 9 ){ // keine Aufzaehlung / Nummerierung @@ -892,7 +897,10 @@ void SwWW8ImplReader::Read_ANLevelDesc( USHORT, const BYTE* pData, short nLen ) SwNumRule* pNR = GetStyRule(); SetAnld(pNR, (WW8_ANLD*)pData, 0, false); pAktColl->SetFmtAttr( SwNumRuleItem( pNR->GetName() ) ); - pCollA[nAktColl].bHasStyNumRule = true; + + SwWW8StyInf * pStyInf = GetStyle(nAktColl); + if (pStyInf != NULL) + pStyInf->bHasStyNumRule = true; } } @@ -1007,9 +1015,10 @@ void SwWW8ImplReader::StartAnl(const BYTE* pSprm13) } } - if (!sNumRule.Len() && pCollA[nAktColl].bHasStyNumRule) + SwWW8StyInf * pStyInf = GetStyle(nAktColl); + if (!sNumRule.Len() && pStyInf->bHasStyNumRule) { - sNumRule = pCollA[nAktColl].pFmt->GetNumRule().GetValue(); + sNumRule = pStyInf->pFmt->GetNumRule().GetValue(); pNumRule = rDoc.FindNumRulePtr(sNumRule); if (!pNumRule) sNumRule.Erase(); @@ -1502,7 +1511,7 @@ void WW8TabBandDesc::ProcessSpacing(const BYTE* pParams) if (nLen != 6) return; mbHasSpacing=true; -#ifndef PRODUCT +#ifdef DBG_UTIL BYTE nWhichCell = #endif *pParams++; @@ -1556,7 +1565,7 @@ void WW8TabBandDesc::ProcessSpecificSpacing(const BYTE* pParams) ASSERT(nOverrideSpacing[nWhichCell] < 0x10, "Unexpected value for nSideBits"); -#ifndef PRODUCT +#ifdef DBG_UTIL BYTE nUnknown2 = #endif *pParams++; @@ -1890,7 +1899,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : const BYTE b0 = pParams[0]; const BYTE b1 = pParams[1]; const BYTE b2 = pParams[2]; - if (b0 == 3) // Twips + if (b0 == 3) // Twips nPreferredWidth = b2 * 0x100 + b1; } break; @@ -3636,9 +3645,9 @@ void SwWW8ImplReader::TabCellEnd() { pTableDesc->TableCellEnd(); - if (bReadTable - && pWFlyPara == NULL - && mpTableEndPaM.get() != NULL + if (bReadTable + && pWFlyPara == NULL + && mpTableEndPaM.get() != NULL && (! SwPaM::Overlap(*pPaM, *mpTableEndPaM)) && SwPaM::LessThan(*mpTableEndPaM, *pPaM) && mpTableEndPaM->GetPoint()->nNode.GetNode().IsTxtNode() @@ -3648,7 +3657,7 @@ void SwWW8ImplReader::TabCellEnd() rDoc.DelFullPara(*mpTableEndPaM); } } - + bFirstPara = true; // We have come to the end of a cell so FirstPara flag bReadTable = false; mpTableEndPaM.reset(); @@ -3703,7 +3712,7 @@ void SwWW8ImplReader::StopTable() maTracer.EnterEnvironment(sw::log::eTable, rtl::OUString::valueOf( static_cast<sal_Int32>(maTableStack.size()))); } - + bReadTable = true; // --> OD 2009-04-16 #i101116# // Keep PaM on table end only for nested tables @@ -3919,8 +3928,8 @@ WW8RStyle::WW8RStyle(WW8Fib& _rFib, SwWW8ImplReader* pI) : WW8Style(*pI->pTableStream, _rFib), maSprmParser(_rFib.GetFIBVersion()), pIo(pI), pStStrm(pI->pTableStream), pStyRule(0), nWwNumLevel(0) { - pIo->pCollA = new SwWW8StyInf[ cstd ]; // Style-UEbersetzung WW->SW pIo->nColls = cstd; + pIo->pCollA = cstd ? new SwWW8StyInf[ cstd ] : NULL; // Style-UEbersetzung WW->SW } void WW8RStyle::Set1StyleDefaults() @@ -4692,7 +4701,7 @@ void WW8RStyle::Import() // // fuer z.B. Tabellen wird ein immer gueltiger Std-Style gebraucht - if( pIo->pCollA[0].pFmt && pIo->pCollA[0].bColl && pIo->pCollA[0].bValid ) + if( pIo->StyleExists(0) && pIo->pCollA[0].pFmt && pIo->pCollA[0].bColl && pIo->pCollA[0].bValid ) pIo->pDfltTxtFmtColl = (SwTxtFmtColl*)pIo->pCollA[0].pFmt; else pIo->pDfltTxtFmtColl = pIo->rDoc.GetDfltTxtFmtColl(); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index aed92130ee..5925751f3c 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -33,7 +33,7 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <vcl/svapp.hxx> #include <vcl/outdev.hxx> @@ -75,7 +75,7 @@ #include <svx/crsditem.hxx> #include <svx/udlnitem.hxx> #include <svx/postitem.hxx> -#include <svx/msocximex.hxx> +#include <filter/msfilter/msocximex.hxx> #include <errhdl.hxx> #include <unotextrange.hxx> #include <doc.hxx> @@ -95,7 +95,7 @@ #include "ww8par2.hxx" // wg. Listen-Attributen in Styles #include <IMark.hxx> -#include <svtools/fltrcfg.hxx> +#include <unotools/fltrcfg.hxx> #include <stdio.h> @@ -255,7 +255,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr ) sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields()); if (!bUseEnhFields) { - pFormImpl->InsertFormula(aFormula); + pFormImpl->InsertFormula(aFormula); return FLD_OK; } else { String aBookmarkName; @@ -267,7 +267,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr ) USHORT bkmFindIdx; String aBookmarkFind=pB->GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx); - if (aBookmarkFind.Len()>0) { + if (aBookmarkFind.Len()>0) { pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark as consumed by field if (aBookmarkFind.Len()>0) { aBookmarkName=aBookmarkFind; @@ -280,7 +280,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr ) } if (aBookmarkName.Len()>0) { - ::sw::mark::ICheckboxFieldmark* pFieldmark = + ::sw::mark::ICheckboxFieldmark* pFieldmark = dynamic_cast< ::sw::mark::ICheckboxFieldmark*>(rDoc.getIDocumentMarkAccess()->makeMark( *pPaM, aBookmarkName, diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index 0251f12081..75f7554179 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -42,10 +42,10 @@ #include <com/sun/star/drawing/XShape.hpp> #include <hintids.hxx> #include <svx/svdoole2.hxx> -#include <svx/msdffimp.hxx> +#include <filter/msfilter/msdffimp.hxx> #include <svx/impgrf.hxx> #include <svx/unoapi.hxx> -#include <svx/msocximex.hxx> +#include <filter/msfilter/msocximex.hxx> #include <sot/exchange.hxx> #include <swtypes.hxx> diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index df8df85699..4dca5848aa 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -40,9 +40,9 @@ #include <tools/solar.h> #include <com/sun/star/ucb/XCommandEnvironment.hpp> -#include <svtools/urihelper.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/zformat.hxx> +#include <svl/urihelper.hxx> +#include <svl/zforlist.hxx> +#include <svl/zformat.hxx> #include <sfx2/linkmgr.hxx> #include <ucbhelper/content.hxx> diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 202286bde1..90530c310f 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ #include <stdlib.h> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <rtl/tencinfo.h> @@ -3276,7 +3276,7 @@ void SwWW8ImplReader::Read_SubSuperProp( USHORT, const BYTE* pData, short nLen ) const SvxFontHeightItem* pF = (const SvxFontHeightItem*)GetFmtAttr(RES_CHRATR_FONTSIZE); ASSERT(pF, "Expected to have the fontheight available here"); - + // #i59022: Check ensure nHeight != 0. Div by zero otherwise. INT32 nHeight = 240; if (pF != NULL && pF->GetHeight() != 0) @@ -4667,7 +4667,7 @@ void SwWW8ImplReader::Read_ParaBackColor(USHORT, const BYTE* pData, short nLen) sal_uInt32 SwWW8ImplReader::ExtractColour(const BYTE* &rpData, bool -#ifndef PRODUCT +#ifdef DBG_UTIL bVer67 #endif ) diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index d559608d86..f5e62d7aad 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -2281,22 +2281,48 @@ WW8PLCF::WW8PLCF( SvStream* pSt, WW8_FC nFilePos, INT32 nPLCF, int nStruct, void WW8PLCF::ReadPLCF( SvStream* pSt, WW8_FC nFilePos, INT32 nPLCF ) { + bool failure = false; + // Pointer auf Pos-Array pPLCF_PosArray = new WW8_CP[ ( nPLCF + 3 ) / 4 ]; sal_Size nOldPos = pSt->Tell(); pSt->Seek( nFilePos ); - pSt->Read( pPLCF_PosArray, nPLCF ); + failure = pSt->GetError(); + + if (!failure) + { + pSt->Read( pPLCF_PosArray, nPLCF ); + failure = pSt->GetError(); + } + + if (!failure) + { #ifdef OSL_BIGENDIAN - for( nIdx = 0; nIdx <= nIMax; nIdx++ ) - pPLCF_PosArray[nIdx] = SWAPLONG( pPLCF_PosArray[nIdx] ); - nIdx = 0; + for( nIdx = 0; nIdx <= nIMax; nIdx++ ) + pPLCF_PosArray[nIdx] = SWAPLONG( pPLCF_PosArray[nIdx] ); + nIdx = 0; #endif // OSL_BIGENDIAN - // Pointer auf Inhalts-Array - pPLCF_Contents = (BYTE*)&pPLCF_PosArray[nIMax + 1]; + // Pointer auf Inhalts-Array + pPLCF_Contents = (BYTE*)&pPLCF_PosArray[nIMax + 1]; + } pSt->Seek( nOldPos ); + + ASSERT( !failure, "Document has corrupt PLCF, ignoring it" ); + + if (failure) + MakeFailedPLCF(); +} + +void WW8PLCF::MakeFailedPLCF() +{ + nIMax = 0; + delete[] pPLCF_PosArray; + pPLCF_PosArray = new INT32[2]; + pPLCF_PosArray[0] = pPLCF_PosArray[1] = WW8_CP_MAX; + pPLCF_Contents = (BYTE*)&pPLCF_PosArray[nIMax + 1]; } void WW8PLCF::GeneratePLCF( SvStream* pSt, INT32 nPN, INT32 ncpN ) @@ -2359,13 +2385,7 @@ void WW8PLCF::GeneratePLCF( SvStream* pSt, INT32 nPN, INT32 ncpN ) ASSERT( !failure, "Document has corrupt PLCF, ignoring it" ); if (failure) - { - nIMax = 0; - delete[] pPLCF_PosArray; - pPLCF_PosArray = new INT32[2]; - pPLCF_PosArray[0] = pPLCF_PosArray[1] = WW8_CP_MAX; - pPLCF_Contents = (BYTE*)&pPLCF_PosArray[nIMax + 1]; - } + MakeFailedPLCF(); } bool WW8PLCF::SeekPos(WW8_CP nPos) @@ -4390,15 +4410,16 @@ WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, ManTypes nType, long nStartCp, pBkm = &aD[1]; pEdn = &aD[2]; pFtn = &aD[3]; + pAnd = &aD[4]; - - pPcd = ( pBase->pPLCFx_PCD ) ? &aD[4] : 0; + pPcd = ( pBase->pPLCFx_PCD ) ? &aD[5] : 0; //pPcdA index == pPcd index + 1 - pPcdA = ( pBase->pPLCFx_PCDAttrs ) ? &aD[5] : 0; - pChp = &aD[6]; - pAnd = &aD[7]; + pPcdA = ( pBase->pPLCFx_PCDAttrs ) ? &aD[6] : 0; + + pChp = &aD[7]; pPap = &aD[8]; pSep = &aD[9]; + pSep->pPLCFx = pBase->pSepPLCF; pFtn->pPLCFx = pBase->pFtnPLCF; pEdn->pPLCFx = pBase->pEdnPLCF; @@ -6240,8 +6261,11 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib ) rSt.Seek( rFib.fcSttbfffn ); + INT32 nFFn = rFib.lcbSttbfffn - 2; + // allocate Font Array - BYTE* pA = new BYTE[ rFib.lcbSttbfffn - 2 ]; + BYTE* pA = new BYTE[ nFFn ]; + memset(pA, 0, nFFn); WW8_FFN* p = (WW8_FFN*)pA; ww::WordVersion eVersion = rFib.GetFIBVersion(); @@ -6258,13 +6282,13 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib ) rSt.SeekRel( 2 ); // read all font information - rSt.Read( pA, rFib.lcbSttbfffn - 2 ); + nFFn = rSt.Read( pA, nFFn ); if( eVersion < ww::eWW8 ) { // try to figure out how many fonts are defined here nMax = 0; - long nLeft = rFib.lcbSttbfffn - 2; + long nLeft = nFFn; for(;;) { short nNextSiz; diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 9d3d0af1f6..107bde4aa4 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -295,6 +295,8 @@ private: machen wir uns hiermit einen PLC: */ void GeneratePLCF( SvStream* pSt, INT32 nPN, INT32 ncpN ); + + void MakeFailedPLCF(); public: WW8PLCF( SvStream* pSt, WW8_FC nFilePos, INT32 nPLCF, int nStruct, WW8_CP nStartPos = -1 ); diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index b3318dbe9b..c0f195a1a4 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -687,7 +687,7 @@ void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo) if( nPoint < pRedlineInfo->pContentIndex->GetIndex() || nPoint > pRedlineInfo->pContentIndex->GetNode().EndOfSectionIndex() ) pRedline->SetContentIdx(pRedlineInfo->pContentIndex); -#ifndef PRODUCT +#ifdef DBG_UTIL else ASSERT( false, "Recursive change tracking" ); #endif diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index 986c76b229..af5caae2ee 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -55,10 +55,10 @@ #include <com/sun/star/packages/zip/ZipIOException.hpp> #include <com/sun/star/packages/WrongPasswordException.hpp> #include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp> -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <sfx2/docfile.hxx> #include <svtools/sfxecode.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <unotools/streamwrap.hxx> #include <svx/xmlgrhlp.hxx> #include <svx/xmleohlp.hxx> diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 87e4246504..b67efcd4fd 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,9 +46,9 @@ #include <unotools/streamwrap.hxx> #include <svx/xmlgrhlp.hxx> #include <svx/xmleohlp.hxx> -#include <svtools/saveopt.hxx> +#include <unotools/saveopt.hxx> #include <tools/urlobj.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <sfx2/frame.hxx> #include <sfx2/docfile.hxx> #include <pam.hxx> diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 2135be52ea..37f906d66f 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -34,9 +34,9 @@ #include <xmloff/xmluconv.hxx> #include <rtl/ustrbuf.hxx> -#include <svtools/itempool.hxx> -#include <svtools/poolitem.hxx> -#include <svtools/itemset.hxx> +#include <svl/itempool.hxx> +#include <svl/poolitem.hxx> +#include <svl/itemset.hxx> #include <xmloff/attrlist.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmlnmspe.hxx> @@ -45,7 +45,7 @@ #ifndef _SVSTDARR_USHORTS #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index 92fa625296..c3f19af3d2 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -37,7 +37,7 @@ #ifndef _SVSTDARR_STRINGSSORT_DECL #define _SVSTDARR_STRINGSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <xmloff/nmspmap.hxx> #include <format.hxx> diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index a561791253..3136f7b2fd 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -83,7 +83,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily ) if( eFamily != XML_TOKEN_INVALID ) AddAttribute( XML_NAMESPACE_STYLE, XML_FAMILY, eFamily ); -#ifndef PRODUCT +#ifdef DBG_UTIL // style:parent-style-name="..." (if its not the default only) const SwFmt* pParent = rFmt.DerivedFrom(); // Parent-Namen nur uebernehmen, wenn kein Default diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 42815039db..b7c76dafd8 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -64,7 +64,7 @@ #include <sfx2/printer.hxx> #include <ForbiddenCharactersEnum.hxx> #include <xmloff/xmluconv.hxx> -#include <svtools/saveopt.hxx> +#include <unotools/saveopt.hxx> #include <tools/diagnose_ex.h> #include <hash_set> #include <stringhash.hxx> @@ -178,7 +178,7 @@ SvXMLImportContext *SwXMLBodyContext_Impl::CreateChildContext( // --> OD 2006-10-11 #i69629# // enhance class <SwXMLDocContext_Impl> in order to be able to create subclasses // NB: virtually inherit so we can multiply inherit properly -// in SwXMLOfficeDocContext_Impl +// in SwXMLOfficeDocContext_Impl class SwXMLDocContext_Impl : public virtual SvXMLImportContext { // --> OD 2006-10-11 #i69629# @@ -384,7 +384,7 @@ void SwXMLDocStylesContext_Impl::EndElement() // assign paragraph styles to list levels of outline style after all styles // are imported and finished. SwXMLImport& rSwImport = dynamic_cast<SwXMLImport&>( GetImport()); - GetImport().GetTextImport()->SetOutlineStyles( + GetImport().GetTextImport()->SetOutlineStyles( (rSwImport.GetStyleFamilyMask() & SFX_STYLE_FAMILY_PARA ) ? sal_True : sal_False); // <-- } @@ -841,7 +841,7 @@ void SwXMLImport::endDocument( void ) pTxtNode->GetTxt().Len() ); } -#ifndef PRODUCT +#ifdef DBG_UTIL // !!! This should be impossible !!!! ASSERT( pSttNdIdx->GetIndex()+1 != pPaM->GetBound( sal_True ).nNode.GetIndex(), diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index fd17a1c222..2f452eb807 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -32,9 +32,9 @@ #include "precompiled_sw.hxx" #include "xmlimpit.hxx" #include <xmloff/xmluconv.hxx> -#include <svtools/itempool.hxx> -#include <svtools/poolitem.hxx> -#include <svtools/itemset.hxx> +#include <svl/itempool.hxx> +#include <svl/poolitem.hxx> +#include <svl/itemset.hxx> #include <xmloff/attrlist.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmlnmspe.hxx> diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 0b4783e2e4..4378eb99df 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -40,8 +40,8 @@ #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/numehelp.hxx> -#include <svtools/cntnrsrt.hxx> -#include <svtools/zforlist.hxx> +#include <svl/cntnrsrt.hxx> +#include <svl/zforlist.hxx> #include <svx/brshitem.hxx> #include <svx/boxitem.hxx> #include <fmtrowsplt.hxx> @@ -140,7 +140,7 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) : pLines( &rLines ), nWidth( 0UL ) { -#ifndef PRODUCT +#ifdef DBG_UTIL sal_uInt16 nEndCPos = 0U; #endif sal_uInt16 nLines = rLines.Count(); @@ -174,7 +174,7 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) : } else { -#ifndef PRODUCT +#ifdef DBG_UTIL sal_uInt16 nCheckPos = nCPos + (sal_uInt16)SwWriteTable::GetBoxWidth( pBox ); if( !nEndCPos ) @@ -191,7 +191,7 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) : } #endif nCPos = (sal_uInt16)nWidth; -#ifndef PRODUCT +#ifdef DBG_UTIL SwXMLTableColumn_Impl aCol( (sal_uInt16)nWidth ); ASSERT( aCols.Seek_Entry(&aCol), "couldn't find last column" ); ASSERT( SwXMLTableColumn_Impl(nCheckPos) == @@ -697,7 +697,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, // Und ihren Index sal_uInt16 nOldCol = nCol; SwXMLTableColumn_Impl aCol( nCPos ); -#ifndef PRODUCT +#ifdef DBG_UTIL sal_Bool bFound = #endif pLines->GetColumns().Seek_Entry( &aCol, &nCol ); @@ -987,7 +987,7 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine, const sal_uInt16 nOldCol = nCol; { SwXMLTableColumn_Impl aCol( nCPos ); -#ifndef PRODUCT +#ifdef DBG_UTIL const sal_Bool bFound = #endif rLines.GetColumns().Seek_Entry( &aCol, &nCol ); diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 95cf0ddfda..2af534923e 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -38,8 +38,8 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/table/XCellRange.hpp> -#include <svtools/itemset.hxx> -#include <svtools/zformat.hxx> +#include <svl/itemset.hxx> +#include <svl/zformat.hxx> #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmltkmap.hxx> #include <xmloff/nmspmap.hxx> @@ -2315,7 +2315,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, bSplit = 1UL == pCell->GetColSpan(); } -#ifndef PRODUCT +#ifdef DBG_UTIL if( nCol == nRightCol-1UL ) { ASSERT( bSplit, "Split-Flag falsch" ); diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx index b6477044ac..1fceac3718 100644 --- a/sw/source/filter/xml/xmltbli.hxx +++ b/sw/source/filter/xml/xmltbli.hxx @@ -40,7 +40,7 @@ #define _SVSTDARR_USHORTS #define _SVSTDARR_BOOLS #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif class SwXMLImport; diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index 40775b9f70..04387b13e8 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -58,8 +58,8 @@ #include <SwAppletImpl.hxx> #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> -#include "svtools/urihelper.hxx" +#include <svl/svstdarr.hxx> +#include "svl/urihelper.hxx" #include <sfx2/frmdescr.hxx> #include <SwStyleNameMapper.hxx> diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 3373bfa75d..00534cd5e5 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -73,7 +73,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <svtools/embedhlp.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> using ::rtl::OUString; diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src index 76b853f149..985d4ddc95 100644 --- a/sw/source/ui/app/app.src +++ b/sw/source/ui/app/app.src @@ -30,7 +30,7 @@ -#include <svtools/style.hrc> +#include <svl/style.hrc> #include <sfx2/sfx.hrc> #include <svx/dialogs.hrc> #include <svx/globlmn.hrc> diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index f4b4a4838d..c9ca781e7c 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,10 +37,10 @@ #include <tools/link.hxx> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/undoopt.hxx> -#include <svtools/pathoptions.hxx> +#include <svl/svstdarr.hxx> +#include <svl/urihelper.hxx> +#include <unotools/undoopt.hxx> +#include <unotools/pathoptions.hxx> #include <svtools/accessibilityoptions.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/event.hxx> @@ -48,15 +48,15 @@ #include <svx/dataaccessdescriptor.hxx> #include <svx/srchitem.hxx> #include <svtools/colorcfg.hxx> -#include <svtools/eitem.hxx> -#include <svtools/whiter.hxx> -#include <svtools/isethint.hxx> +#include <svl/eitem.hxx> +#include <svl/whiter.hxx> +#include <svl/isethint.hxx> #include <svx/hyprlink.hxx> #include <sfx2/request.hxx> #include <sfx2/fcontnr.hxx> -#include <svtools/stritem.hxx> -#include <svtools/ctloptions.hxx> -#include <svtools/useroptions.hxx> +#include <svl/stritem.hxx> +#include <svl/ctloptions.hxx> +#include <unotools/useroptions.hxx> #include <vcl/msgbox.hxx> #include <vcl/wrkwin.hxx> #include <svx/insctrl.hxx> @@ -753,82 +753,8 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) } else if(rHint.ISA(SfxSimpleHint)) { - ULONG nHintId = ((SfxSimpleHint&)rHint).GetId(); - if(SFX_HINT_COLORS_CHANGED == nHintId || - SFX_HINT_ACCESSIBILITY_CHANGED == nHintId ) - { - sal_Bool bAccessibility = sal_False; - if(SFX_HINT_COLORS_CHANGED == nHintId) - SwViewOption::ApplyColorConfigValues(*pColorConfig); - else - bAccessibility = sal_True; - - //invalidate all edit windows - const TypeId aSwViewTypeId = TYPE(SwView); - const TypeId aSwPreViewTypeId = TYPE(SwPagePreView); - const TypeId aSwSrcViewTypeId = TYPE(SwSrcView); - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while(pViewShell) - { - if(pViewShell->GetWindow()) - { - if((pViewShell->IsA(aSwViewTypeId) || - pViewShell->IsA(aSwPreViewTypeId) || - pViewShell->IsA(aSwSrcViewTypeId))) - { - if(bAccessibility) - { - if(pViewShell->IsA(aSwViewTypeId)) - ((SwView*)pViewShell)->ApplyAccessiblityOptions(*pAccessibilityOptions); - else if(pViewShell->IsA(aSwPreViewTypeId)) - ((SwPagePreView*)pViewShell)->ApplyAccessiblityOptions(*pAccessibilityOptions); - } - pViewShell->GetWindow()->Invalidate(); - } - } - pViewShell = SfxViewShell::GetNext( *pViewShell ); - } - } - else if( SFX_HINT_CTL_SETTINGS_CHANGED == nHintId ) - { - const SfxObjectShell* pObjSh = SfxObjectShell::GetFirst(); - while( pObjSh ) - { - if( pObjSh->IsA(TYPE(SwDocShell)) ) - { - const SwDoc* pDoc = ((SwDocShell*)pObjSh)->GetDoc(); - ViewShell* pVSh = 0; - pDoc->GetEditShell( &pVSh ); - if ( pVSh ) - pVSh->ChgNumberDigits(); - } - pObjSh = SfxObjectShell::GetNext(*pObjSh); - } - } - else if(SFX_HINT_USER_OPTIONS_CHANGED == nHintId) - { - bAuthorInitialised = FALSE; - } - else if(SFX_HINT_UNDO_OPTIONS_CHANGED == nHintId) - { - const int nNew = GetUndoOptions().GetUndoCount(); - const int nOld = SwEditShell::GetUndoActionCount(); - if(!nNew || !nOld) - { - sal_Bool bUndo = nNew != 0; - //ueber DocShells iterieren und Undo umschalten - - TypeId aType(TYPE(SwDocShell)); - SwDocShell* pDocShell = (SwDocShell*)SfxObjectShell::GetFirst(&aType); - while( pDocShell ) - { - pDocShell->GetDoc()->DoUndo( bUndo ); - pDocShell = (SwDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType); - } - } - SwEditShell::SetUndoActionCount( static_cast< USHORT >(nNew)); - } - else if(SFX_HINT_DEINITIALIZING == nHintId) + USHORT nHintId = ((SfxSimpleHint&)rHint).GetId(); + if(SFX_HINT_DEINITIALIZING == nHintId) { DELETEZ(pWebUsrPref); DELETEZ(pUsrPref) ; @@ -842,20 +768,98 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) DELETEZ(pWebToolbarConfig) ; DELETEZ(pAuthorNames) ; DELETEZ(pDBConfig); - EndListening(*pColorConfig); + pColorConfig->RemoveListener(this); DELETEZ(pColorConfig); - EndListening(*pAccessibilityOptions); + pAccessibilityOptions->RemoveListener(this); DELETEZ(pAccessibilityOptions); - EndListening(*pCTLOptions); + pCTLOptions->RemoveListener(this); DELETEZ(pCTLOptions); - EndListening(*pUserOptions); + pUserOptions->RemoveListener(this); DELETEZ(pUserOptions); - EndListening(*pUndoOptions); + pUndoOptions->RemoveListener(this); DELETEZ(pUndoOptions); } } } +void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal_uInt32 ) +{ + if( pBrdCst == pUserOptions ) + { + bAuthorInitialised = FALSE; + } + else if( pBrdCst == pUndoOptions ) + { + const int nNew = GetUndoOptions().GetUndoCount(); + const int nOld = SwEditShell::GetUndoActionCount(); + if(!nNew || !nOld) + { + sal_Bool bUndo = nNew != 0; + //ueber DocShells iterieren und Undo umschalten + + TypeId aType(TYPE(SwDocShell)); + SwDocShell* pDocShell = (SwDocShell*)SfxObjectShell::GetFirst(&aType); + while( pDocShell ) + { + pDocShell->GetDoc()->DoUndo( bUndo ); + pDocShell = (SwDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType); + } + } + SwEditShell::SetUndoActionCount( static_cast< USHORT >(nNew)); + } + else if ( pBrdCst == pColorConfig || pBrdCst == pAccessibilityOptions ) + { + sal_Bool bAccessibility = sal_False; + if( pBrdCst == pColorConfig ) + SwViewOption::ApplyColorConfigValues(*pColorConfig); + else + bAccessibility = sal_True; + + //invalidate all edit windows + const TypeId aSwViewTypeId = TYPE(SwView); + const TypeId aSwPreViewTypeId = TYPE(SwPagePreView); + const TypeId aSwSrcViewTypeId = TYPE(SwSrcView); + SfxViewShell* pViewShell = SfxViewShell::GetFirst(); + while(pViewShell) + { + if(pViewShell->GetWindow()) + { + if((pViewShell->IsA(aSwViewTypeId) || + pViewShell->IsA(aSwPreViewTypeId) || + pViewShell->IsA(aSwSrcViewTypeId))) + { + if(bAccessibility) + { + if(pViewShell->IsA(aSwViewTypeId)) + ((SwView*)pViewShell)->ApplyAccessiblityOptions(*pAccessibilityOptions); + else if(pViewShell->IsA(aSwPreViewTypeId)) + ((SwPagePreView*)pViewShell)->ApplyAccessiblityOptions(*pAccessibilityOptions); + } + pViewShell->GetWindow()->Invalidate(); + } + } + pViewShell = SfxViewShell::GetNext( *pViewShell ); + } + } + else if( pBrdCst == pCTLOptions ) + { + const SfxObjectShell* pObjSh = SfxObjectShell::GetFirst(); + while( pObjSh ) + { + if( pObjSh->IsA(TYPE(SwDocShell)) ) + { + const SwDoc* pDoc = ((SwDocShell*)pObjSh)->GetDoc(); + ViewShell* pVSh = 0; + pDoc->GetEditShell( &pVSh ); + if ( pVSh ) + pVSh->ChgNumberDigits(); + } + pObjSh = SfxObjectShell::GetNext(*pObjSh); + } + } + +} + /* -----------------------------20.02.01 12:43-------------------------------- ---------------------------------------------------------------------------*/ @@ -874,7 +878,7 @@ svtools::ColorConfig& SwModule::GetColorConfig() { pColorConfig = new svtools::ColorConfig; SwViewOption::ApplyColorConfigValues(*pColorConfig); - StartListening(*pColorConfig); + pColorConfig->AddListener(this); } return *pColorConfig; } @@ -886,7 +890,7 @@ SvtAccessibilityOptions& SwModule::GetAccessibilityOptions() if(!pAccessibilityOptions) { pAccessibilityOptions = new SvtAccessibilityOptions; - StartListening(*pAccessibilityOptions); + pAccessibilityOptions->AddListener(this); } return *pAccessibilityOptions; } @@ -898,7 +902,7 @@ SvtCTLOptions& SwModule::GetCTLOptions() if(!pCTLOptions) { pCTLOptions = new SvtCTLOptions; - StartListening(*pCTLOptions); + pCTLOptions->AddListener(this); } return *pCTLOptions; } @@ -910,7 +914,7 @@ SvtUserOptions& SwModule::GetUserOptions() if(!pUserOptions) { pUserOptions = new SvtUserOptions; - StartListening(*pUserOptions); + pUserOptions->AddListener(this); } return *pUserOptions; } @@ -922,7 +926,7 @@ SvtUndoOptions& SwModule::GetUndoOptions() if(!pUndoOptions) { pUndoOptions = new SvtUndoOptions; - StartListening(*pUndoOptions); + pUndoOptions->AddListener(this); } return *pUndoOptions; } diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index 26dbff2f8e..dd95c398eb 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,12 +38,12 @@ #include <com/sun/star/i18n/ScriptType.hpp> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <sfx2/request.hxx> #include <sfx2/app.hxx> #include <sfx2/printer.hxx> @@ -87,14 +87,14 @@ #include <glosdoc.hxx> #include <uiitems.hxx> #include <svx/langitem.hxx> -#include <svtools/lingucfg.hxx> +#include <unotools/lingucfg.hxx> #include <svx/unolingu.hxx> #ifndef _GLOBALS_HRC #include <globals.hrc> #endif #include <globals.h> // globale Konstanten z.B. -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #include "swabstdlg.hxx" #include <swwrtshitem.hxx> @@ -151,7 +151,7 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) SID_ATTR_LANGUAGE, SID_ATTR_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE, -#ifndef PRODUCT +#ifdef DBG_UTIL FN_PARAM_SWTEST, FN_PARAM_SWTEST, #endif 0); @@ -285,7 +285,7 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) pRet->Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND)); } -#ifndef PRODUCT +#ifdef DBG_UTIL /*-----------------01.02.97 13.02------------------- Test-Optionen --------------------------------------------------*/ @@ -491,7 +491,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) } -#ifndef PRODUCT +#ifdef DBG_UTIL /*-------------------------------------------------------------------------- Writer Testseite auswerten ----------------------------------------------------------------------------*/ @@ -614,7 +614,7 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemS } } break; -#ifndef PRODUCT +#ifdef DBG_UTIL case RID_SW_TP_OPTTEST_PAGE: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index ec29858041..8cb2cdb66c 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -38,16 +38,15 @@ #include <vcl/wrkwin.hxx> #include <vcl/jobset.hxx> #include <tools/urlobj.hxx> -#include <svtools/whiter.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/whiter.hxx> +#include <svl/zforlist.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <svx/adjitem.hxx> #include <basic/sbx.hxx> -#include <svtools/moduleoptions.hxx> -#include <sfx2/app.hxx> +#include <unotools/moduleoptions.hxx> +#include <unotools/misccfg.hxx> #include <sfx2/request.hxx> -#include <svtools/misccfg.hxx> #include <sfx2/passwd.hxx> #include <sfx2/bindings.hxx> #include <sfx2/docfile.hxx> @@ -58,7 +57,6 @@ #include <svx/srchitem.hxx> #include <svx/flstitem.hxx> #include <svx/htmlmode.hxx> -#include <svx/svxmsbas.hxx> #include <svtools/soerr.hxx> #include <sot/clsids.hxx> #include <basic/basmgr.hxx> @@ -111,8 +109,8 @@ #include "warnpassword.hxx" #include <cfgid.h> -#include <svtools/moduleoptions.hxx> -#include <svtools/fltrcfg.hxx> +#include <unotools/moduleoptions.hxx> +#include <unotools/fltrcfg.hxx> #include <svx/htmlcfg.hxx> #include <sfx2/fcontnr.hxx> #include <sfx2/objface.hxx> @@ -382,8 +380,7 @@ BOOL SwDocShell::Save() //SvxImportMSVBasic aTmp( *this, pIo->GetStorage() ); //aTmp.SaveOrDelMSVBAStorage( FALSE, aEmptyStr ); if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() ) - nVBWarning = SvxImportMSVBasic:: - GetSaveWarningOfMSVBAStorage( *this ); + nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) (*this) ); pDoc->SetContainsMSVBasic( FALSE ); } @@ -501,8 +498,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) //SvxImportMSVBasic aTmp( *this, pIo->GetStorage() ); //aTmp.SaveOrDelMSVBAStorage( FALSE, aEmptyStr ); if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() ) - nVBWarning = SvxImportMSVBasic:: - GetSaveWarningOfMSVBAStorage( *this ); + nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) *this ); pDoc->SetContainsMSVBasic( FALSE ); } @@ -599,8 +595,7 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) DBG_ASSERT( !xStg->GetError(), "No storage available for storing VBA macros!" ); if ( !xStg->GetError() ) { - SvxImportMSVBasic aTmp( *this, *xStg ); - nVBWarning = aTmp.SaveOrDelMSVBAStorage( bSave, String::CreateFromAscii("Macros") ); + nVBWarning = SaveOrDelMSVBAStorage( (SfxObjectShell&) *this, *xStg, bSave, String::CreateFromAscii("Macros") ); xStg->Commit(); pDoc->SetContainsMSVBasic( TRUE ); } @@ -1134,7 +1129,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) rSet.Put( SfxUInt16Item( nWhich, static_cast< sal_uInt16 >( pFmtr ? pFmtr->GetYear2000() - : SFX_APP()->GetMiscConfig()->GetYear2000() ))); + : ::utl::MiscCfg().GetYear2000() ))); } break; case SID_ATTR_CHAR_FONTLIST: diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 050c0bacca..d614c74673 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,11 +41,11 @@ #include <unotools/tempfile.hxx> #include <vcl/wrkwin.hxx> #include <vcl/msgbox.hxx> -#include <svtools/lckbitem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/zformat.hxx> -#include <svtools/pathoptions.hxx> +#include <svl/lckbitem.hxx> +#include <svl/eitem.hxx> +#include <svl/zforlist.hxx> +#include <svl/zformat.hxx> +#include <unotools/pathoptions.hxx> #include <svtools/transfer.hxx> #ifndef _SFXSIDS_HRC //autogen #include <sfx2/dialogs.hrc> @@ -151,8 +151,6 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog( Window *pParent, const SfxItemSet &rSet) { SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog(pParent, rSet); -// const SfxDocumentInfoItem& rItem = (const SfxDocumentInfoItem&)rSet.Get(SID_DOCINFO); -// if(rItem.IsOwnFormat()) //nur mit Statistik, wenn dieses Doc auch angezeigt wird, nicht //aus dem Doc-Manager SwDocShell* pDocSh = (SwDocShell*) SfxObjectShell::Current(); @@ -612,7 +610,7 @@ void SwDocShell::Execute(SfxRequest& rReq) SvStringsISortDtor aTmpLst; aTmpLst.Insert( &rACW.GetWordList() ); pAFlags->pAutoCmpltList = &aTmpLst; - + SfxApplication* pApp = SFX_APP(); SfxRequest aAppReq(SID_AUTO_CORRECT_DLG, SFX_CALLMODE_SYNCHRON, pApp->GetPool()); SfxBoolItem aSwOptions( SID_AUTO_CORRECT_DLG, TRUE ); @@ -1105,7 +1103,7 @@ void SwDocShell::Execute(SfxRequest& rReq) xRef( pClipCntnr ); pClipCntnr->CopyAnyData( FORMAT_RTF, (sal_Char*) - pStrm->GetData(), pStrm->GetSize() ); + pStrm->GetData(), pStrm->GetEndOfData() ); pClipCntnr->CopyToClipboard( GetView()? (Window*)&GetView()->GetEditWin() : 0 ); delete pStrm; @@ -1201,7 +1199,7 @@ void SwDocShell::Execute(SfxRequest& rReq) { bDone = FALSE; BOOL bCreateHtml = FN_NEW_HTML_DOC == nWhich; - + BOOL bCreateByOutlineLevel = false; //#outline level,add by zhaojianwei sal_Int32 nTemplateOutlineLevel = 0 ; //#outline level,add by zhaojianwei @@ -1313,7 +1311,7 @@ void SwDocShell::Execute(SfxRequest& rReq) // aListBoxEntries.realloc(nIdx); //<-end,zhaojianwei - + //#outline level,add by zhaojianwei ///////////////////////////////////////////////////////////////////// @@ -1323,7 +1321,7 @@ void SwDocShell::Execute(SfxRequest& rReq) { int nLevel; for(USHORT n = 0; n < rOutlNds.Count(); ++n ) - if( ( nLevel = rOutlNds[n]->GetTxtNode()->GetAttrOutlineLevel()) > 0 && + if( ( nLevel = rOutlNds[n]->GetTxtNode()->GetAttrOutlineLevel()) > 0 && ! bOutline[nLevel-1] ) { bOutline[nLevel-1] = true; @@ -1421,7 +1419,7 @@ void SwDocShell::Execute(SfxRequest& rReq) if( PrepareClose( FALSE ) ) { SwWait aWait( *this, TRUE ); - + //bDone = bCreateHtml //#outline level,removed by zhaojianwei // ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl ) // : pDoc->GenerateGlobalDoc( aFileName, pSplitColl ); @@ -1580,7 +1578,7 @@ void SwDocShell::SetModified( BOOL bSet ) { if (!pDoc->IsInCallModified() ) { - EnableSetModified( FALSE ); + EnableSetModified( FALSE ); if( bSet ) { BOOL bOld = pDoc->IsModified(); @@ -1784,7 +1782,7 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) } while ( pTmpFrm ); const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions(); - + // set view columns before toggling: if ( bSet ) { diff --git a/sw/source/ui/app/docshdrw.cxx b/sw/source/ui/app/docshdrw.cxx index b91f9183bf..ab1d4d4f62 100644 --- a/sw/source/ui/app/docshdrw.cxx +++ b/sw/source/ui/app/docshdrw.cxx @@ -45,7 +45,7 @@ -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <svx/drawitem.hxx> #include <svx/svdmodel.hxx> #include <svx/svdoutl.hxx> diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index b2ce3411c4..7853c7f8fd 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,19 +40,16 @@ #include <i18npool/mslangid.hxx> #include <sot/storinfo.hxx> #include <sot/storage.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <svtools/ctrltool.hxx> -#include <svtools/lingucfg.hxx> +#include <unotools/lingucfg.hxx> #include <sfx2/docfile.hxx> -#ifndef _OFA_MISCCFG_HXX //autogen -#include <svtools/misccfg.hxx> -#endif #include <sfx2/printer.hxx> #include <sfx2/bindings.hxx> #include <svx/asiancfg.hxx> #include <svx/unolingu.hxx> #include <sfx2/request.hxx> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <svx/adjitem.hxx> #ifndef _SVX_AKRNTEM_HXX #include <svx/akrnitem.hxx> @@ -655,7 +652,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) pDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true); } } -#ifndef PRODUCT +#ifdef DBG_UTIL else ASSERT( !this, "ohne Sw3Reader geht nichts" ); #endif @@ -824,7 +821,7 @@ void SwDocShell::SubInitNew() sal_Bool bSquaredPageMode = SW_MOD()->GetUsrPref(FALSE)->IsSquaredPageMode(); pDoc->SetDefaultPageMode( bSquaredPageMode ); } - + pDoc->ResetModified(); } diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index 5168264a93..eb8b090d3f 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -36,16 +36,17 @@ #include <hintids.hxx> #include <sfx2/app.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <sfx2/templdlg.hxx> #include <sfx2/tplpitem.hxx> #include <sfx2/request.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/newstyle.hxx> -#include <svtools/macitem.hxx> +#include <sfx2/printer.hxx> +#include <svl/macitem.hxx> #include <svx/brshitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/languageoptions.hxx> +#include <svl/stritem.hxx> +#include <svl/languageoptions.hxx> #include <svx/eeitem.hxx> #include <svx/htmlmode.hxx> #include <swmodule.hxx> diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index db72c86319..e4c324ce3e 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -33,11 +33,11 @@ #define _SVSTDARR_USHORTS -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> #include <hintids.hxx> -#include <svtools/itemiter.hxx> -#include <svtools/eitem.hxx> -#include <svtools/syslocale.hxx> +#include <svl/itemiter.hxx> +#include <svl/eitem.hxx> +#include <unotools/syslocale.hxx> #include <svx/boxitem.hxx> #include <svx/numitem.hxx> // --> OD 2008-02-13 #newlistlevelattrs# @@ -68,7 +68,7 @@ #endif #include <paratr.hxx> #include <SwStyleNameMapper.hxx> -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> #include <comphelper/processfactory.hxx> #include <unotools/localedatawrapper.hxx> #include <unotools/intlwrapper.hxx> diff --git a/sw/source/ui/app/mainwn.cxx b/sw/source/ui/app/mainwn.cxx index c86509835b..486d4d0c54 100644 --- a/sw/source/ui/app/mainwn.cxx +++ b/sw/source/ui/app/mainwn.cxx @@ -37,7 +37,7 @@ #include <tools/shl.hxx> #include <tools/string.hxx> #ifndef _SVARRAY_HXX -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <sfx2/progress.hxx> #ifndef _RESID_HXX //autogen diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src index f1f210f1a4..bebfd0fa1c 100644 --- a/sw/source/ui/app/mn.src +++ b/sw/source/ui/app/mn.src @@ -1065,12 +1065,6 @@ Menu MN_PPREVIEW_POPUPMENU HelpID = FN_PRINT_PAGEPREVIEW ; Text [ en-US ] = "Print" ; }; - MenuItem - { - Identifier = FN_PREVIEW_PRINT_OPTIONS; - HelpID = FN_PREVIEW_PRINT_OPTIONS; - Text [ en-US ] = "Print Options"; - }; SEPARATOR ; MenuItem { diff --git a/sw/source/ui/app/swdll.cxx b/sw/source/ui/app/swdll.cxx index d26756eaae..965708ca15 100644 --- a/sw/source/ui/app/swdll.cxx +++ b/sw/source/ui/app/swdll.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,7 +51,7 @@ #include <dobjfac.hxx> #include <cfgid.h> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #ifndef _FM_FMOBJFAC_HXX #include <svx/fmobjfac.hxx> diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index 50e28709d4..50d2e81697 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,7 +36,7 @@ #include <sfx2/request.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/childwin.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/useroptions.hxx> #include <cppuhelper/weak.hxx> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> @@ -294,7 +294,7 @@ void SwModule::ApplyRulerMetric( FieldUnit eMetric, BOOL bHorizontal, BOOL bWeb } if( bHorizontal ) pPref->SetHScrollMetric(eMetric); - else + else pPref->SetVScrollMetric(eMetric); SwView* pTmpView = SwModule::GetFirstView(); diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index 779add8526..fe2c630dcb 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -154,7 +154,7 @@ #include <svtools/colorcfg.hxx> #include <svx/acorrcfg.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #ifndef _AVMEDIA_MEDIAPPLAYER_HXX #include <avmedia/mediaplayer.hxx> diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx index d21b3340a0..39445817f1 100644 --- a/sw/source/ui/chrdlg/break.cxx +++ b/sw/source/ui/chrdlg/break.cxx @@ -37,7 +37,7 @@ #include <sfx2/request.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif diff --git a/sw/source/ui/chrdlg/ccoll.cxx b/sw/source/ui/chrdlg/ccoll.cxx index 6045cf87b5..c76e64381b 100644 --- a/sw/source/ui/chrdlg/ccoll.cxx +++ b/sw/source/ui/chrdlg/ccoll.cxx @@ -209,11 +209,7 @@ int SwCondCollItem::operator==( const SfxPoolItem& rItem) const const String& SwCondCollItem::GetStyle(USHORT nPos) const { -#ifndef IRIX return nPos < COND_COMMAND_COUNT ? sStyles[nPos] : aEmptyStr; -#else - return nPos < COND_COMMAND_COUNT ? (String)sStyles[nPos] : aEmptyStr; -#endif } /**************************************************************************** @@ -224,11 +220,7 @@ const String& SwCondCollItem::GetStyle(USHORT nPos) const void SwCondCollItem::SetStyle(const String* pStyle, USHORT nPos) { if( nPos < COND_COMMAND_COUNT ) -#ifndef IRIX sStyles[nPos] = pStyle ? *pStyle : aEmptyStr; -#else - sStyles[nPos] = pStyle ? (String)*pStyle : aEmptyStr; -#endif } diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index 033d96e955..44ee430c60 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -41,11 +41,11 @@ #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/urihelper.hxx> -#include <svtools/stritem.hxx> +#include <svl/urihelper.hxx> +#include <svl/stritem.hxx> #include <svx/flstitem.hxx> #include <svx/htmlmode.hxx> -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> #ifndef _CMDID_H #include <cmdid.h> diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 37913b4da4..4fc483c056 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -39,7 +39,7 @@ #include <hintids.hxx> #define _SVSTDARR_STRINGSDTOR #define _SVSTDARR_STRINGSISORTDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include "cmdid.h" #include "swmodule.hxx" @@ -51,7 +51,7 @@ #ifndef _METRIC_HXX //autogen #include <vcl/metric.hxx> #endif -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <svx/fontitem.hxx> #include <svx/htmlmode.hxx> #include <sfx2/objsh.hxx> @@ -68,7 +68,7 @@ #define _SVSTDARR_XUB_STRLEN #define _SVSTDARR_USHORTS #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include "charatr.hxx" #include "viewopt.hxx" diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index 61816c9e81..1f6dd1e124 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -47,9 +47,9 @@ #ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> #endif -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> #include <fmtline.hxx> #include <numpara.hxx> #include <numpara.hrc> diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index d23a482187..e7189fd524 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -38,15 +38,15 @@ #include "hintids.hxx" #include <svx/htmlmode.hxx> -#include <svtools/style.hxx> +#include <svl/style.hxx> #include <svx/htmlcfg.hxx> #ifndef _SVSTDARR_STRINGSSORTDTOR #define _SVSTDARR_STRINGSSORTDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> #include "docsh.hxx" #include "wrtsh.hxx" #include "frmatr.hxx" @@ -62,8 +62,8 @@ #include "chrdlg.hrc" #include "poolfmt.hrc" #include <svx/svxids.hrc> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> #include <svx/flagsdef.hxx> diff --git a/sw/source/ui/chrdlg/tblnumfm.cxx b/sw/source/ui/chrdlg/tblnumfm.cxx index 8dc40898e8..350b5bf049 100644 --- a/sw/source/ui/chrdlg/tblnumfm.cxx +++ b/sw/source/ui/chrdlg/tblnumfm.cxx @@ -51,7 +51,7 @@ #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <sfx2/tabdlg.hxx> SwNumFmtDlg::SwNumFmtDlg(Window* pParent, const SfxItemSet& rSet) diff --git a/sw/source/ui/config/barcfg.cxx b/sw/source/ui/config/barcfg.cxx index 79b92b9a7a..6686652bd9 100644 --- a/sw/source/ui/config/barcfg.cxx +++ b/sw/source/ui/config/barcfg.cxx @@ -151,3 +151,5 @@ void SwToolbarConfigItem::Commit() PutProperties(aNames, aValues); } +void SwToolbarConfigItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + diff --git a/sw/source/ui/config/cfgitems.cxx b/sw/source/ui/config/cfgitems.cxx index f0245d958b..43702e834c 100644 --- a/sw/source/ui/config/cfgitems.cxx +++ b/sw/source/ui/config/cfgitems.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -407,7 +407,7 @@ void SwShadowCursorItem::FillViewOptions( SwViewOption& rVOpt ) const rVOpt.SetShdwCrsrFillMode( eMode ); } -#ifndef PRODUCT +#ifdef DBG_UTIL /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ diff --git a/sw/source/ui/config/dbconfig.cxx b/sw/source/ui/config/dbconfig.cxx index 9ed37142d6..e87cc6dc9f 100644 --- a/sw/source/ui/config/dbconfig.cxx +++ b/sw/source/ui/config/dbconfig.cxx @@ -140,5 +140,7 @@ const SwDBData& SwDBConfig::GetBibliographySource() return *pBibImpl; } +void SwDBConfig::Commit() {} +void SwDBConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} diff --git a/sw/source/ui/config/fontcfg.cxx b/sw/source/ui/config/fontcfg.cxx index 533a3869e8..348244774e 100644 --- a/sw/source/ui/config/fontcfg.cxx +++ b/sw/source/ui/config/fontcfg.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ #include <fontcfg.hxx> #include <i18npool/mslangid.hxx> #include <vcl/outdev.hxx> -#include <svtools/lingucfg.hxx> +#include <unotools/lingucfg.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/i18n/ScriptType.hpp> @@ -358,3 +358,5 @@ sal_Int32 SwStdFontConfig::GetFontHeight( sal_uInt8 nFont, sal_uInt8 nScriptType return nRet; } +void SwStdFontConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + diff --git a/sw/source/ui/config/modcfg.cxx b/sw/source/ui/config/modcfg.cxx index 3f004af143..fa89402682 100644 --- a/sw/source/ui/config/modcfg.cxx +++ b/sw/source/ui/config/modcfg.cxx @@ -50,7 +50,7 @@ #include <modcfg.hxx> #endif #include <fldupde.hxx> -#include <svtools/syslocaleoptions.hxx> +#include <unotools/syslocaleoptions.hxx> #include <caption.hxx> #include <com/sun/star/uno/Any.hxx> @@ -336,6 +336,8 @@ sal_Int32 lcl_ConvertAttrToCfg(const AuthorCharAttr& rAttr) return nRet; } //----------------------------------------------------------------------------- +void SwRevisionConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + void SwRevisionConfig::Commit() { const Sequence<OUString>& aNames = GetPropertyNames(); @@ -691,6 +693,8 @@ void lcl_WriteOpt(const InsCaptionOpt& rOpt, Any* pValues, sal_Int32 nProp, sal_ } } //----------------------------------------------------------------------------- +void SwInsertConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + void SwInsertConfig::Commit() { const Sequence<OUString>& aNames = GetPropertyNames(); @@ -1207,6 +1211,8 @@ SwTableConfig::~SwTableConfig() /*-- 10.10.00 16:22:56--------------------------------------------------- -----------------------------------------------------------------------*/ +void SwTableConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + void SwTableConfig::Commit() { const Sequence<OUString>& aNames = GetPropertyNames(); @@ -1318,6 +1324,8 @@ const Sequence<OUString>& SwMiscConfig::GetPropertyNames() /*-- 18.01.01 17:02:47--------------------------------------------------- -----------------------------------------------------------------------*/ +void SwMiscConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + void SwMiscConfig::Commit() { const Sequence<OUString>& aNames = GetPropertyNames(); diff --git a/sw/source/ui/config/optdlg.hrc b/sw/source/ui/config/optdlg.hrc index 0045f2bfa2..462d0628cf 100644 --- a/sw/source/ui/config/optdlg.hrc +++ b/sw/source/ui/config/optdlg.hrc @@ -96,13 +96,13 @@ #define CB_CHAR_HIDDEN 61 // Print-Extra-Page #define CB_PGRF 61 -#define CB_PTAB 62 -#define CB_PDRAW 63 +//#define CB_PTAB 62 merged with CB_PGRF in printerpullpages +//#define CB_PDRAW 63 removed in printerpullpages #define CB_LEFTP 64 #define CB_RIGHTP 65 -#define CB_REVERSE 66 +//#define CB_REVERSE 66 removed in printerpullpages #define CB_PROSPECT 67 -#define CB_SINGLEJOBS 68 +//#define CB_SINGLEJOBS 68 removed in printerpullpages #define CB_CTRLFLD 69 #define CB_PAPERFROMSETUP 70 #define FL_1 71 diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src index 1a4c97061c..7170cbb247 100644..100755 --- a/sw/source/ui/config/optdlg.src +++ b/sw/source/ui/config/optdlg.src @@ -215,60 +215,66 @@ TabPage TP_OPTPRINT_PAGE Text [ en-US ] = "Contents" ; Group = TRUE ; }; - CheckBox CB_PGRF + CheckBox CB_PGRF /*functionally merged with CB_PDRAW*/ { Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "~Graphics" ; + Text [ en-US ] = "~Pictures and objects" ; TabStop = TRUE ; Group = TRUE ; }; +/* + removed, tables now always get printed CheckBox CB_PTAB { Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~Tables" ; }; +*/ +/* + functionally merged with CB_PGRF (pictures and graphics) CheckBox CB_PDRAW { Pos = MAP_APPFONT ( 12 , 40 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Dra~wings" ; }; +*/ CheckBox CB_CTRLFLD { - Pos = MAP_APPFONT ( 12 , 53 ) ; + Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "Control~s" ; + Text [ en-US ] = "Form control~s" ; }; CheckBox CB_BACKGROUND { - Pos = MAP_APPFONT ( 12 , 66 ) ; + Pos = MAP_APPFONT ( 12 , 40 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "Ba~ckground" ; + Text [ en-US ] = "Page ba~ckground" ; }; CheckBox CB_BLACK_FONT { - Pos = MAP_APPFONT ( 12 , 79 ) ; + Pos = MAP_APPFONT ( 12 , 53 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "Print blac~k" ; + Text [ en-US ] = "Print text in blac~k" ; }; CheckBox CB_HIDDEN_TEXT { - Pos = MAP_APPFONT ( 12 , 92 ) ; + Pos = MAP_APPFONT ( 12 , 66 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Hidden te~xt" ; }; CheckBox CB_TEXT_PLACEHOLDER { - Pos = MAP_APPFONT ( 12 , 105 ) ; + Pos = MAP_APPFONT ( 12 , 79 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Text ~placeholder" ; }; FixedLine FL_SEP_PRT_LEFT { Pos = MAP_APPFONT ( 85 , 14 ) ; - Size = MAP_APPFONT ( 4 , 104 ) ; + Size = MAP_APPFONT ( 4 , 78 ) ; Vert = TRUE; }; FixedLine FL_2 @@ -292,21 +298,24 @@ TabPage TP_OPTPRINT_PAGE Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~Right pages" ; }; +/* + removed, noe handled by the new print dialog (i.e. vcl) itself CheckBox CB_REVERSE { Pos = MAP_APPFONT ( 96 , 40 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Re~versed" ; }; +*/ CheckBox CB_PROSPECT { - Pos = MAP_APPFONT ( 96 , 53 ) ; + Pos = MAP_APPFONT ( 96 , 40 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Broch~ure" ; }; CheckBox CB_PROSPECT_RTL { - Pos = MAP_APPFONT ( 103 , 66 ) ; + Pos = MAP_APPFONT ( 103 , 53 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Right to Left" ; Text [ x-comment ] = " "; @@ -340,7 +349,7 @@ TabPage TP_OPTPRINT_PAGE FixedLine FL_SEP_PRT_RIGHT { Pos = MAP_APPFONT ( 169 , 14 ) ; - Size = MAP_APPFONT ( 4 , 104 ) ; + Size = MAP_APPFONT ( 4 , 78 ) ; Vert = TRUE; }; FixedLine FL_3 @@ -352,35 +361,37 @@ TabPage TP_OPTPRINT_PAGE }; FixedLine FL_4 { - Pos = MAP_APPFONT ( 6 , 121 ) ; + Pos = MAP_APPFONT ( 6 , 95 ) ; Size = MAP_APPFONT ( 248 , 8 ) ; Group = TRUE ; Text [ en-US ] = "Other"; }; CheckBox CB_PRINTEMPTYPAGES { - Pos = MAP_APPFONT ( 12 , 132 ) ; + Pos = MAP_APPFONT ( 12 , 106 ) ; Size = MAP_APPFONT ( 200 , 10 ) ; TabStop = TRUE ; Text [ en-US ] = "Print ~automatically inserted blank pages"; }; +/* CheckBox CB_SINGLEJOBS { - Pos = MAP_APPFONT ( 12 , 145 ) ; + Pos = MAP_APPFONT ( 12 , 119 ) ; Size = MAP_APPFONT ( 200 , 10 ) ; TabStop = TRUE ; Text [ en-US ] = "Create s~ingle print jobs" ; }; +*/ CheckBox CB_PAPERFROMSETUP { - Pos = MAP_APPFONT ( 12 , 158 ) ; + Pos = MAP_APPFONT ( 12 , 119 ) ; Size = MAP_APPFONT ( 200 , 10 ) ; TabStop = TRUE ; Text [ en-US ] = "~Paper tray from printer settings"; }; FixedText FT_FAX { - Pos = MAP_APPFONT ( 12 , 173 ) ; + Pos = MAP_APPFONT ( 12 , 134 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Group = TRUE ; Text [ en-US ] = "~Fax"; @@ -388,7 +399,7 @@ TabPage TP_OPTPRINT_PAGE ListBox LB_FAX { Border = TRUE ; - Pos = MAP_APPFONT ( 70 , 171 ) ; + Pos = MAP_APPFONT ( 70 , 132 ) ; Size = MAP_APPFONT ( 184 , 70 ) ; TabStop = TRUE ; DropDown = TRUE ; @@ -935,3 +946,55 @@ TabPage TP_OPTSHDWCRSR }; }; + +StringArray STR_PRINTOPTUI +{ + ItemList [en-US] = + { + < "%PRODUCTNAME %s"; >; + < "Contents"; >; + < "Page ba~ckground"; >; + < "Specifies whether to include colors and objects that are inserted to the background of the page (Format - Page - Background) in the printed document."; >; + < "~Pictures and objects"; >; + < "Specifies whether the graphics and drawing or OLE objects of your text document are printed"; >; + < "Hidden te~xt"; >; + < "Enable this option to print text that is marked as hidden."; >; + < "~Text placeholder"; >; + < "Enable this option to print text placeholders. Disable this option to leave the text placeholders blank in the printout."; >; + < "Form control~s"; >; + < "Specifies whether the form control fields of the text document are printed"; >; + < "Color"; >; + < "Print text in blac~k"; >; + < "Specifies whether to always print text in black."; >; + < "Pages"; >; + < "Print ~automatically inserted blank pages"; >; + < "If this option is enabled automatically inserted blank pages are printed. This is best if you are printing double-sided. For example, in a book, a \"chapter\" paragraph style has been set to always start with an odd numbered page. If the previous chapter ends on an odd page, %PRODUCTNAME inserts an even numbered blank page. This option controls whether to print that even numbered page or not"; >; + < "~Use only paper tray from printer preferences"; >; + < "For printers with multiple trays this option specifies whether the paper tray used is specified by the system settings of the printer."; >; + < "Print"; >; + < "None (document only)"; >; + < "Comments only"; >; + < "Place at end of document"; >; + < "Place at end of page"; >; + < "Specify where to print comments (if any)."; >; + < "~Comments"; >; + < "Page sides";>; + < "All pages"; >; + < "Back sides / left pages"; >; + < "Front sides / right pages"; >; + < "Specify which pages to include in the output"; >; + < "Include"; >; + < "Broch~ure"; >; + < "Select the Brochure option to print the document in brochure format."; >; + < "Left-to-right script"; >; + < "Right-to-left script"; >; + < "Ranges and copies"; >; + < "~All pages"; >; + < "Print the whole document."; >; + < "Pa~ges"; >; + < "Print a range of pages of the document."; >; + < "~Selection"; >; + < "Print only the selected parts of the document"; >; + }; +}; + diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 8943eec2ed..3898e5ca36 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -76,7 +76,7 @@ #include <SwNodeNum.hxx> #include <doc.hxx> -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> using namespace ::com::sun::star; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 3bec60cc30..81e887f90f 100644..100755 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,11 +42,11 @@ #include <vcl/svapp.hxx> #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> #include <svtools/ctrltool.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <svx/htmlmode.hxx> #include <sfx2/printer.hxx> #include <sfx2/bindings.hxx> @@ -97,10 +97,10 @@ #include <optdlg.hrc> #endif #include <svx/strarray.hxx> -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #include <sfx2/request.hxx> #include <swwrtshitem.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/ctloptions.hxx> #include <unomid.h> @@ -350,8 +350,8 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, SfxTabPage( pParent, SW_RES( TP_OPTPRINT_PAGE ), rCoreSet), aFL1 (this, SW_RES(FL_1)), aGrfCB (this, SW_RES(CB_PGRF)), - aTabCB (this, SW_RES(CB_PTAB)), - aDrawCB (this, SW_RES(CB_PDRAW)), +// aTabCB (this, SW_RES(CB_PTAB)), +// aDrawCB (this, SW_RES(CB_PDRAW)), aCtrlFldCB (this, SW_RES(CB_CTRLFLD)), aBackgroundCB (this, SW_RES(CB_BACKGROUND)), aBlackFontCB (this, SW_RES(CB_BLACK_FONT)), @@ -361,7 +361,7 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, aFL2 (this, SW_RES(FL_2)), aLeftPageCB (this, SW_RES(CB_LEFTP)), aRightPageCB (this, SW_RES(CB_RIGHTP)), - aReverseCB (this, SW_RES(CB_REVERSE)), +// aReverseCB (this, SW_RES(CB_REVERSE)), aProspectCB (this, SW_RES(CB_PROSPECT)), aProspectCB_RTL (this, SW_RES(CB_PROSPECT_RTL)), aSeparatorRFL (this, SW_RES(FL_SEP_PRT_RIGHT)), @@ -372,7 +372,7 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, aFL3 (this, SW_RES(FL_3)), aFL4 (this, SW_RES(FL_4)), aPrintEmptyPagesCB(this, SW_RES(CB_PRINTEMPTYPAGES)), - aSingleJobsCB (this, SW_RES(CB_SINGLEJOBS)), +// aSingleJobsCB (this, SW_RES(CB_SINGLEJOBS)), aPaperFromSetupCB(this, SW_RES(CB_PAPERFROMSETUP)), aFaxFT (this, SW_RES(FT_FAX)), aFaxLB (this, SW_RES(LB_FAX)), @@ -386,14 +386,14 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, aGrfCB.SetClickHdl( aLk ); aRightPageCB.SetClickHdl( aLk ); aLeftPageCB.SetClickHdl( aLk ); - aTabCB.SetClickHdl( aLk ); - aDrawCB.SetClickHdl( aLk ); +// aTabCB.SetClickHdl( aLk ); +// aDrawCB.SetClickHdl( aLk ); aCtrlFldCB.SetClickHdl( aLk ); aBackgroundCB.SetClickHdl( aLk ); aBlackFontCB.SetClickHdl( aLk ); aPrintHiddenTextCB.SetClickHdl( aLk ); aPrintTextPlaceholderCB.SetClickHdl( aLk ); - aReverseCB.SetClickHdl( aLk ); +// aReverseCB.SetClickHdl( aLk ); aProspectCB.SetClickHdl( aLk ); aProspectCB_RTL.SetClickHdl( aLk ); aPaperFromSetupCB.SetClickHdl( aLk ); @@ -402,27 +402,40 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, aEndRB.SetClickHdl( aLk ); aOnlyRB.SetClickHdl( aLk ); aNoRB.SetClickHdl( aLk ); - aSingleJobsCB.SetClickHdl( aLk ); +// aSingleJobsCB.SetClickHdl( aLk ); aFaxLB.SetSelectHdl( LINK( this, SwAddPrinterTabPage, SelectHdl ) ); const SfxPoolItem* pItem; if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_HTML_MODE, FALSE, &pItem ) && ((SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON) { - aDrawCB .Hide(); +// aDrawCB .Hide(); aLeftPageCB .Hide(); aRightPageCB .Hide(); aPrintHiddenTextCB.Hide(); aPrintTextPlaceholderCB.Hide(); - Point rPt(aReverseCB .GetPosPixel()); - rPt.setX(rPt.getX() + 15); // indent - aProspectCB_RTL.SetPosPixel(rPt); - aReverseCB.SetPosPixel(aLeftPageCB .GetPosPixel()); - aProspectCB.SetPosPixel(aRightPageCB .GetPosPixel()); - aPrintHiddenTextCB.SetPosPixel(aBlackFontCB.GetPosPixel()); - aBlackFontCB.SetPosPixel(aBackgroundCB.GetPosPixel()); - aBackgroundCB.SetPosPixel(aCtrlFldCB.GetPosPixel()); - aCtrlFldCB.SetPosPixel(aDrawCB.GetPosPixel()); +// aReverseCB.SetPosPixel(aLeftPageCB.GetPosPixel()); + aProspectCB.SetPosPixel(aLeftPageCB.GetPosPixel()); + Point aPt( aRightPageCB.GetPosPixel() ); + aPt.setX(aPt.getX() + 15); // indent + aProspectCB_RTL.SetPosPixel(aPt); +// aBlackFontCB.SetPosPixel(aBackgroundCB.GetPosPixel()); +// aPrintHiddenTextCB.SetPosPixel(aBlackFontCB.GetPosPixel()); +// aBackgroundCB.SetPosPixel(aCtrlFldCB.GetPosPixel()); +// aCtrlFldCB.SetPosPixel(aDrawCB.GetPosPixel()); + + // hide aPrintEmptyPagesCB and move everything below up accordingly + long nDeltaY = aPaperFromSetupCB.GetPosPixel().getY() - aPrintEmptyPagesCB.GetPosPixel().getY(); + aPrintEmptyPagesCB.Hide(); + aPt = aPaperFromSetupCB.GetPosPixel(); + aPt.setY( aPt.getY() - nDeltaY ); + aPaperFromSetupCB.SetPosPixel( aPt ); + aPt = aFaxFT.GetPosPixel(); + aPt.setY( aPt.getY() - nDeltaY ); + aFaxFT.SetPosPixel( aPt ); + aPt = aFaxLB.GetPosPixel(); + aPt.setY( aPt.getY() - nDeltaY ); + aFaxLB.SetPosPixel( aPt ); } aProspectCB_RTL.Disable(); SvtCTLOptions aCTLOptions; @@ -465,22 +478,22 @@ BOOL SwAddPrinterTabPage::FillItemSet( SfxItemSet& rCoreSet ) { SwAddPrinterItem aAddPrinterAttr (FN_PARAM_ADDPRINTER); aAddPrinterAttr.bPrintGraphic = aGrfCB.IsChecked(); - aAddPrinterAttr.bPrintTable = aTabCB.IsChecked(); - aAddPrinterAttr.bPrintDraw = aDrawCB.IsChecked(); + aAddPrinterAttr.bPrintTable = TRUE; // always enabled since CWS printerpullgpages /*aTabCB.IsChecked();*/ + aAddPrinterAttr.bPrintDraw = aGrfCB.IsChecked(); // UI merged with aGrfCB in CWS printerpullgpages /*aDrawCB.IsChecked()*/; aAddPrinterAttr.bPrintControl = aCtrlFldCB.IsChecked(); aAddPrinterAttr.bPrintPageBackground = aBackgroundCB.IsChecked(); aAddPrinterAttr.bPrintBlackFont = aBlackFontCB.IsChecked(); aAddPrinterAttr.bPrintHiddenText = aPrintHiddenTextCB.IsChecked(); aAddPrinterAttr.bPrintTextPlaceholder = aPrintTextPlaceholderCB.IsChecked(); - aAddPrinterAttr.bPrintLeftPage = aLeftPageCB.IsChecked(); - aAddPrinterAttr.bPrintRightPage = aRightPageCB.IsChecked(); - aAddPrinterAttr.bPrintReverse = aReverseCB.IsChecked(); - aAddPrinterAttr.bPrintProspect = aProspectCB.IsChecked(); - aAddPrinterAttr.bPrintProspect_RTL = aProspectCB_RTL.IsChecked(); - aAddPrinterAttr.bPaperFromSetup = aPaperFromSetupCB.IsChecked(); - aAddPrinterAttr.bPrintEmptyPages = aPrintEmptyPagesCB.IsChecked(); - aAddPrinterAttr.bPrintSingleJobs = aSingleJobsCB.IsChecked(); + aAddPrinterAttr.bPrintLeftPages = aLeftPageCB.IsChecked(); + aAddPrinterAttr.bPrintRightPages = aRightPageCB.IsChecked(); + aAddPrinterAttr.bPrintReverse = FALSE; // handled by vcl itself since CWS printerpullpages /*aReverseCB.IsChecked()*/; + aAddPrinterAttr.bPrintProspect = aProspectCB.IsChecked(); + aAddPrinterAttr.bPrintProspectRTL = aProspectCB_RTL.IsChecked(); + aAddPrinterAttr.bPaperFromSetup = aPaperFromSetupCB.IsChecked(); + aAddPrinterAttr.bPrintEmptyPages = aPrintEmptyPagesCB.IsChecked(); + aAddPrinterAttr.bPrintSingleJobs = TRUE; // handled by vcl in new print dialog since CWS printerpullpages /*aSingleJobsCB.IsChecked()*/; if (aNoRB.IsChecked()) aAddPrinterAttr.nPrintPostIts = POSTITS_NONE; @@ -508,22 +521,22 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& ) if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ADDPRINTER , FALSE, (const SfxPoolItem**)&pAddPrinterAttr )) { - aGrfCB.Check( pAddPrinterAttr->bPrintGraphic); - aTabCB.Check( pAddPrinterAttr->bPrintTable); - aDrawCB.Check( pAddPrinterAttr->bPrintDraw); + aGrfCB.Check( pAddPrinterAttr->bPrintGraphic || pAddPrinterAttr->bPrintDraw ); +// aTabCB.Check( pAddPrinterAttr->bPrintTable); +// aDrawCB.Check( pAddPrinterAttr->bPrintDraw); aCtrlFldCB.Check( pAddPrinterAttr->bPrintControl); aBackgroundCB.Check( pAddPrinterAttr->bPrintPageBackground); aBlackFontCB.Check( pAddPrinterAttr->bPrintBlackFont); aPrintHiddenTextCB.Check( pAddPrinterAttr->bPrintHiddenText); aPrintTextPlaceholderCB.Check(pAddPrinterAttr->bPrintTextPlaceholder); - aLeftPageCB.Check( pAddPrinterAttr->bPrintLeftPage); - aRightPageCB.Check( pAddPrinterAttr->bPrintRightPage); - aReverseCB.Check( pAddPrinterAttr->bPrintReverse); + aLeftPageCB.Check( pAddPrinterAttr->bPrintLeftPages); + aRightPageCB.Check( pAddPrinterAttr->bPrintRightPages); +// aReverseCB.Check( pAddPrinterAttr->bPrintReverse); aPaperFromSetupCB.Check(pAddPrinterAttr->bPaperFromSetup); aPrintEmptyPagesCB.Check(pAddPrinterAttr->bPrintEmptyPages); aProspectCB.Check( pAddPrinterAttr->bPrintProspect); - aProspectCB_RTL.Check( pAddPrinterAttr->bPrintProspect_RTL); - aSingleJobsCB.Check( pAddPrinterAttr->bPrintSingleJobs); + aProspectCB_RTL.Check( pAddPrinterAttr->bPrintProspectRTL); +// aSingleJobsCB.Check( pAddPrinterAttr->bPrintSingleJobs); aNoRB.Check (pAddPrinterAttr->nPrintPostIts== POSTITS_NONE ) ; aOnlyRB.Check (pAddPrinterAttr->nPrintPostIts== POSTITS_ONLY ) ; @@ -2445,7 +2458,7 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin) } -#ifndef PRODUCT +#ifdef DBG_UTIL /******************************************************* ******************************************************/ /*----------------- OS 11.01.95 ----------------------- diff --git a/sw/source/ui/config/prtopt.cxx b/sw/source/ui/config/prtopt.cxx index 6eed7fb1f8..de5f4ab93f 100644 --- a/sw/source/ui/config/prtopt.cxx +++ b/sw/source/ui/config/prtopt.cxx @@ -69,8 +69,8 @@ Sequence<OUString> SwPrintOptions::GetPropertyNames() "Page/LeftPage", // 13 not in SW/Web "Page/RightPage", // 14 not in SW/Web "EmptyPages", // 15 not in SW/Web - "Content/PrintPlaceholders", // 16 not in Sw/Web - "Content/PrintHiddenText" // 17 + "Content/PrintPlaceholders", // 16 not in Sw/Web + "Content/PrintHiddenText" // 17 not in Sw/Web }; const int nCount = bIsWeb ? 12 : 18; Sequence<OUString> aNames(nCount); @@ -92,6 +92,8 @@ SwPrintOptions::SwPrintOptions(sal_Bool bWeb) : bPrintPageBackground = !bWeb; bPrintBlackFont = bWeb; bPrintTextPlaceholder = bPrintHiddenText = sal_False; + if (bWeb) + bPrintEmptyPages = sal_False; Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); @@ -119,13 +121,13 @@ SwPrintOptions::SwPrintOptions(sal_Bool bWeb) : break; case 6: bPrintReverse = *(sal_Bool*)pValues[nProp].getValue(); break; case 7: bPrintProspect = *(sal_Bool*)pValues[nProp].getValue(); break; - case 8: bPrintProspect_RTL = *(sal_Bool*)pValues[nProp].getValue(); break; + case 8: bPrintProspectRTL = *(sal_Bool*)pValues[nProp].getValue(); break; case 9: bPrintSingleJobs = *(sal_Bool*)pValues[nProp].getValue(); break; case 10: pValues[nProp] >>= sFaxName; break; case 11: bPaperFromSetup = *(sal_Bool*)pValues[nProp].getValue(); break; case 12: bPrintDraw = *(sal_Bool*)pValues[nProp].getValue() ; break; - case 13: bPrintLeftPage = *(sal_Bool*)pValues[nProp].getValue(); break; - case 14: bPrintRightPage = *(sal_Bool*)pValues[nProp].getValue(); break; + case 13: bPrintLeftPages = *(sal_Bool*)pValues[nProp].getValue(); break; + case 14: bPrintRightPages = *(sal_Bool*)pValues[nProp].getValue(); break; case 15: bPrintEmptyPages = *(sal_Bool*)pValues[nProp].getValue(); break; case 16: bPrintTextPlaceholder = *(sal_Bool*)pValues[nProp].getValue(); break; case 17: bPrintHiddenText = *(sal_Bool*)pValues[nProp].getValue(); break; @@ -133,6 +135,12 @@ SwPrintOptions::SwPrintOptions(sal_Bool bWeb) : } } } + + // currently there is just one checkbox for print drawings and print graphics + // In the UI. (File/Print dialog and Tools/Options/.../Print) + // And since print graphics is the only available in Writer and WrtierWeb ... + + bPrintDraw = bPrintGraphic; } /* -----------------------------06.09.00 16:50-------------------------------- @@ -143,6 +151,9 @@ SwPrintOptions::~SwPrintOptions() /* -----------------------------06.09.00 16:43-------------------------------- ---------------------------------------------------------------------------*/ + +void SwPrintOptions::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + void SwPrintOptions::Commit() { Sequence<OUString> aNames = GetPropertyNames(); @@ -164,18 +175,24 @@ void SwPrintOptions::Commit() case 5: pValues[nProp] <<= (sal_Int32)nPrintPostIts ; break; case 6: bVal = bPrintReverse ; pValues[nProp].setValue(&bVal, rType); break; case 7: bVal = bPrintProspect ; pValues[nProp].setValue(&bVal, rType); break; - case 8: bVal = bPrintProspect_RTL ; pValues[nProp].setValue(&bVal, rType); break; + case 8: bVal = bPrintProspectRTL ; pValues[nProp].setValue(&bVal, rType); break; case 9: bVal = bPrintSingleJobs ; pValues[nProp].setValue(&bVal, rType); break; case 10: pValues[nProp] <<= sFaxName; break; case 11: bVal = bPaperFromSetup ; pValues[nProp].setValue(&bVal, rType); break; case 12: bVal = bPrintDraw ; pValues[nProp].setValue(&bVal, rType); break; - case 13: bVal = bPrintLeftPage ; pValues[nProp].setValue(&bVal, rType); break; - case 14: bVal = bPrintRightPage ; pValues[nProp].setValue(&bVal, rType); break; + case 13: bVal = bPrintLeftPages ; pValues[nProp].setValue(&bVal, rType); break; + case 14: bVal = bPrintRightPages ; pValues[nProp].setValue(&bVal, rType); break; case 15: bVal = bPrintEmptyPages ; pValues[nProp].setValue(&bVal, rType); break; case 16: bVal = bPrintTextPlaceholder; pValues[nProp].setValue(&bVal, rType); break; case 17: bVal = bPrintHiddenText; pValues[nProp].setValue(&bVal, rType); break; } } + + // currently there is just one checkbox for print drawings and print graphics + // In the UI. (File/Print dialog and Tools/Options/.../Print) + // And since print graphics is the only available in Writer and WrtierWeb ... + bPrintDraw = bPrintGraphic; + PutProperties(aNames, aValues); } diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx index f11ccd86fc..ce2e162685 100644 --- a/sw/source/ui/config/uinums.cxx +++ b/sw/source/ui/config/uinums.cxx @@ -35,13 +35,13 @@ #include <hintids.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/pathoptions.hxx> +#include <svl/urihelper.hxx> +#include <unotools/pathoptions.hxx> #include <tools/stream.hxx> #ifndef _SFX_INIMGR_HXX #endif #include <sfx2/docfile.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/brshitem.hxx> diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx index ad1285e3d0..44623ea8ad 100644 --- a/sw/source/ui/config/usrpref.cxx +++ b/sw/source/ui/config/usrpref.cxx @@ -33,7 +33,7 @@ #include <tools/stream.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include "swtypes.hxx" #include "hintids.hxx" @@ -427,6 +427,9 @@ void SwLayoutViewConfig::Load() } } } + +void SwLayoutViewConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + /* -----------------------------19.01.01 13:07-------------------------------- ---------------------------------------------------------------------------*/ @@ -531,6 +534,8 @@ void SwGridConfig::Load() } } +void SwGridConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + /* -----------------------------19.01.01 13:07-------------------------------- ---------------------------------------------------------------------------*/ @@ -621,6 +626,9 @@ void SwCursorConfig::Load() } } + +void SwCursorConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + /*-- 28.09.00 09:55:33--------------------------------------------------- -----------------------------------------------------------------------*/ @@ -654,6 +662,9 @@ void SwWebColorConfig::Commit() } PutProperties(aPropNames, aValues); } + +void SwWebColorConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + /*-- 28.09.00 09:55:34--------------------------------------------------- -----------------------------------------------------------------------*/ diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx index fed94bcba8..bfd650b8a4 100644 --- a/sw/source/ui/config/viewopt.cxx +++ b/sw/source/ui/config/viewopt.cxx @@ -58,11 +58,11 @@ #include <crstate.hxx> #include <svtools/colorcfg.hxx> #include <svtools/accessibilityoptions.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include <svx/acorrcfg.hxx> -#ifndef PRODUCT +#ifdef DBG_UTIL BOOL SwViewOption::bTest9 = FALSE; //DrawingLayerNotLoading #endif Color SwViewOption::aDocBoundColor(COL_LIGHTGRAY); @@ -115,7 +115,7 @@ BOOL SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const && bFormView == rOpt.IsFormView() && mbViewLayoutBookMode == rOpt.mbViewLayoutBookMode && bShowPlaceHolderFields == rOpt.bShowPlaceHolderFields -#ifndef PRODUCT +#ifdef DBG_UTIL // korrespondieren zu den Angaben in ui/config/cfgvw.src && bTest1 == rOpt.IsTest1() && bTest2 == rOpt.IsTest2() @@ -246,7 +246,7 @@ SwViewOption::SwViewOption() : bSelectionInReadonly = SW_MOD()->GetAccessibilityOptions().IsSelectionInReadonly(); -#ifndef PRODUCT +#ifdef DBG_UTIL // korrespondieren zu den Angaben in ui/config/cfgvw.src bTest1 = bTest2 = bTest3 = bTest4 = bTest5 = bTest6 = bTest7 = bTest8 = bTest10 = FALSE; @@ -281,7 +281,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt) mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode; bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields; -#ifndef PRODUCT +#ifdef DBG_UTIL bTest1 = rVOpt.bTest1 ; bTest2 = rVOpt.bTest2 ; bTest3 = rVOpt.bTest3 ; @@ -321,7 +321,7 @@ SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt ) mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode; bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields; -#ifndef PRODUCT +#ifdef DBG_UTIL bTest1 = rVOpt.bTest1 ; bTest2 = rVOpt.bTest2 ; bTest3 = rVOpt.bTest3 ; diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index ea75d3f558..ec8ad0dc14 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -67,8 +67,8 @@ #include <com/sun/star/frame/XStorable.hpp> #include <swunohelper.hxx> #include <vcl/waitobj.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/urihelper.hxx> +#include <unotools/pathoptions.hxx> +#include <svl/urihelper.hxx> #include <addresslistdialog.hrc> #include <dbui.hrc> @@ -271,7 +271,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) : m_xDBContext->getByName(pNames[nName]) >>= xSourceProperties; pUserData->sURL = lcl_getFlatURL( xSourceProperties ); bEnableEdit = pUserData->sURL.getLength() > 0 && - SWUnoHelper::UCB_IsFile( pUserData->sURL ) && //#i97577# + SWUnoHelper::UCB_IsFile( pUserData->sURL ) && //#i97577# !SWUnoHelper::UCB_IsReadOnlyFileName( pUserData->sURL ); } catch(const uno::Exception& ) diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 527847b39a..dc96002db7 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,7 +42,7 @@ #ifndef _SVT_CONTROLDIMS_HRC_ #include <svtools/controldims.hrc> #endif -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <sfx2/filedlghelper.hxx> #include <sfx2/docfilt.hxx> #include <sfx2/fcontnr.hxx> @@ -570,7 +570,7 @@ IMPL_LINK(SwCreateAddressListDialog, FindHdl_Impl, PushButton*, EMPTYARG) ++aHeaderIter) rColumnBox.InsertEntry(*aHeaderIter); rColumnBox.SelectEntryPos( 0 ); - } + } else m_pFindDlg->Show(!m_pFindDlg->IsVisible()); return 0; diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index ff140629c2..c4913d65f3 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -64,19 +64,19 @@ #include <com/sun/star/sdbc/XRowSet.hpp> #include <comphelper/processfactory.hxx> #include <svx/langitem.hxx> -#include <svtools/numuno.hxx> -#include <svtools/stritem.hxx> +#include <svl/numuno.hxx> +#include <svl/stritem.hxx> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> #ifndef __SV_MNEMONIC_HXX #include <vcl/mnemonic.hxx> #endif -#include <svtools/style.hxx> -#include <svtools/zformat.hxx> +#include <svl/style.hxx> +#include <svl/zformat.hxx> #include <svx/htmlmode.hxx> #include <svx/unolingu.hxx> #include <sfx2/app.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <svx/brshitem.hxx> #include <svx/boxitem.hxx> #include <svx/rulritem.hxx> @@ -1651,6 +1651,8 @@ static rtl::OUString lcl_CreateUniqueName(const Sequence<rtl::OUString>& aNames) /* -----------------------------05.12.00 15:00-------------------------------- ---------------------------------------------------------------------------*/ +void SwInsertDBColAutoPilot::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + void SwInsertDBColAutoPilot::Commit() { Sequence <rtl::OUString> aNames = GetNodeNames(rtl::OUString()); diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 36b79871f4..410d728431 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -63,17 +63,17 @@ #include <pagedesc.hxx> #include <vcl/lstbox.hxx> #include <unotools/tempfile.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/urihelper.hxx> +#include <unotools/pathoptions.hxx> +#include <svl/urihelper.hxx> #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/zforlist.hxx> -#include <svtools/zformat.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> -#include <sfx2/printer.hxx> +#include <svl/zforlist.hxx> +#include <svl/zformat.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> +#include <vcl/oldprintadaptor.hxx> #include <sfx2/docfile.hxx> #include <sfx2/progress.hxx> #include <sfx2/dispatch.hxx> @@ -120,7 +120,7 @@ #include <i18npool/mslangid.hxx> #include <com/sun/star/util/XNumberFormatTypes.hpp> #include <svx/langitem.hxx> -#include <svtools/numuno.hxx> +#include <svl/numuno.hxx> #include <unomailmerge.hxx> #include <sfx2/event.hxx> @@ -454,80 +454,7 @@ BOOL SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc ) bRet = Merge(&rMergeDesc.rSh); // Mischen break; - case DBMGR_MERGE_MAILMERGE: // Serienbrief - { - SwView& rView = rMergeDesc.rSh.GetView(); - SfxDispatcher *pDis = rView.GetViewFrame()->GetDispatcher(); - SfxItemSet aPrintArgs( rView.GetPool(), - SID_SILENT, SID_SILENT, //5528 - SID_ASYNCHRON, SID_ASYNCHRON, //5811 - SID_PRINT_FIRST_PAGE, SID_PRINT_FIRST_PAGE, // 5001 - SID_PRINT_LAST_PAGE, SID_PRINT_LAST_PAGE, // 5002 - SID_PRINT_COPIES, SID_PRINT_COPIES, // 5003 - SID_PRINTER_NAME, SID_PRINTER_NAME, //5322 - SID_SELECTION, SID_SELECTION, //5346 - SID_FILE_NAME, SID_FILE_NAME, // 5507 - SID_PRINT_PAGES, SID_PRINT_PAGES, //6589 - SID_PRINT_COLLATE, SID_PRINT_COLLATE, //6590 - FN_QRY_MERGE, FN_QRY_MERGE, - 0 ); - aPrintArgs.Put(SfxBoolItem(FN_QRY_MERGE, TRUE) ); - - // !! Currently (Jan-2003) silent is defined by supplying *any* - // !! item!! (Thus according to OS it would be silent even when - // !! other items then SID_SILENT would be supplied!) - // !! Therefore it has to be the 0 pointer when not silent. - if(IsMergeSilent()) - { - aPrintArgs.Put( SfxBoolItem(SID_SILENT, TRUE) ); - // #i25686# printing should be done asynchronously to prevent dangling offices - // when mail merge is called as command line macro - // #i52629# aynchronous printing should only be done in silent mode - otherwise - // the printer dialog does not come up - aPrintArgs.Put( SfxBoolItem( SID_ASYNCHRON, rMergeDesc.bPrintAsync )); - } - // convert PropertyValues - const beans::PropertyValue* pPrintOptions = rMergeDesc.aPrintOptions.getConstArray(); - for( sal_Int32 nOption = 0; nOption < rMergeDesc.aPrintOptions.getLength(); ++nOption) - { - if( pPrintOptions[nOption].Name.equalsAscii( "CopyCount" )) - { - sal_Int16 nCopies = 0; - if((pPrintOptions[nOption].Value >>= nCopies) && nCopies > 0) - aPrintArgs.Put( SfxInt16Item( SID_PRINT_COPIES, nCopies )); - } - else if( pPrintOptions[nOption].Name.equalsAscii( "FileName" )) - { - ::rtl::OUString sFileName; - if( (pPrintOptions[nOption].Value >>= sFileName) && sFileName.getLength() > 0) - aPrintArgs.Put( SfxStringItem( SID_FILE_NAME, sFileName )); - } - else if( pPrintOptions[nOption].Name.equalsAscii( "Collate" )) - { - sal_Bool bCollate = sal_False; - if( pPrintOptions[nOption].Value >>= bCollate ) - aPrintArgs.Put( SfxBoolItem( SID_PRINT_COLLATE, bCollate )); - } - else if( pPrintOptions[nOption].Name.equalsAscii( "Pages" )) - { - ::rtl::OUString sPages; - if( (pPrintOptions[nOption].Value >>= sPages) && sPages.getLength() ) - aPrintArgs.Put( SfxStringItem( SID_PRINT_PAGES, sPages )); - } - else if( pPrintOptions[nOption].Name.equalsAscii( "Wait" )) - { - sal_Bool bWait = sal_False; - if( pPrintOptions[nOption].Value >>= bWait ) - aPrintArgs.Put( SfxBoolItem( SID_ASYNCHRON, !bWait )); - } - - } - pDis->Execute( SID_PRINTDOC, - SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, - aPrintArgs ); - } - break; - + case DBMGR_MERGE_MAILMERGE: // printing merge from 'old' merge dialog or from UNO-component case DBMGR_MERGE_MAILING: case DBMGR_MERGE_MAILFILES: case DBMGR_MERGE_SINGLE_FILE: @@ -853,323 +780,6 @@ SwNewDBMgr::~SwNewDBMgr() } delete pImpl; } -/*-------------------------------------------------------------------- - Beschreibung: Serienbrief drucken - --------------------------------------------------------------------*/ - - -BOOL SwNewDBMgr::MergePrint( SwView& rView, - SwPrtOptions& rOpt, SfxProgress& rProgress, BOOL bIsAPI ) -{ - SwWrtShell* pSh = &rView.GetWrtShell(); - //check if the doc is synchronized and contains at least one linked section - BOOL bSynchronizedDoc = pSh->IsLabelDoc() && pSh->GetSectionFmtCount() > 1; - //merge source is already open - rOpt.nMergeCnt = 0; - //#i56195# no field update while printing mail merge documents - rOpt.bUpdateFieldsInPrinting = sal_False; - if(pImpl->pMergeData) - { - if(pImpl->pMergeData->aSelection.getLength()) - rOpt.nMergeCnt = pImpl->pMergeData->aSelection.getLength(); - else if(pImpl->pMergeData->xResultSet.is()) - { - sal_Int32 nCount; - if( lcl_getCountFromResultSet( nCount, pImpl->pMergeData->xResultSet ) ) - rOpt.nMergeCnt = (ULONG)nCount; - } - } - - SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); - pModOpt->SetSinglePrintJob(rOpt.IsPrintSingleJobs()); - - SfxPrinter *pPrt = pSh->getIDocumentDeviceAccess()->getPrinter( false ); - Link aSfxSaveLnk = pPrt->GetEndPrintHdl(); - if( rOpt.IsPrintSingleJobs() ) - pPrt->SetEndPrintHdl( Link() ); - - BOOL bUserBreak = FALSE, - bRet = FALSE; - long nStartRow, nEndRow; - //calculate number of data sets to be printed - - Sequence<PropertyValue> aViewProperties(16); - PropertyValue* pViewProperties = aViewProperties.getArray(); - pViewProperties[0].Name = C2U("MailMergeCount"); - pViewProperties[0].Value <<= (sal_Int32)rOpt.nMergeCnt; - pViewProperties[1].Name = C2U("PrintGraphics"); - pViewProperties[1].Value <<= (sal_Bool)rOpt.IsPrintGraphic(); - pViewProperties[2].Name = C2U("PrintTables"); - pViewProperties[2].Value <<= (sal_Bool)rOpt.IsPrintTable(); - pViewProperties[3].Name = C2U("PrintDrawings"); - pViewProperties[3].Value <<= (sal_Bool)rOpt.IsPrintDraw(); - pViewProperties[4].Name = C2U("PrintLeftPages"); - pViewProperties[4].Value <<= (sal_Bool)rOpt.IsPrintLeftPage(); - pViewProperties[5].Name = C2U("PrintRightPages"); - pViewProperties[5].Value <<= (sal_Bool)rOpt.IsPrintRightPage(); - pViewProperties[6].Name = C2U("PrintControls"); - pViewProperties[6].Value <<= (sal_Bool)rOpt.IsPrintControl(); - pViewProperties[7].Name = C2U("PrintReversed"); - pViewProperties[7].Value <<= (sal_Bool)rOpt.IsPrintReverse(); - pViewProperties[8].Name = C2U("PrintPaperFromSetup"); - pViewProperties[8].Value <<= (sal_Bool)rOpt.IsPaperFromSetup(); - pViewProperties[9].Name = C2U("PrintFaxName"); - pViewProperties[9].Value <<= rOpt.GetFaxName(); - pViewProperties[10].Name = C2U("PrintAnnotationMode"); - pViewProperties[10].Value <<= (text::NotePrintMode) rOpt.GetPrintPostIts(); - pViewProperties[11].Name = C2U("PrintProspect"); - pViewProperties[11].Value <<= (sal_Bool)rOpt.IsPrintProspect(); - pViewProperties[12].Name = C2U("PrintPageBackground"); - pViewProperties[12].Value <<= (sal_Bool)rOpt.IsPrintPageBackground(); - pViewProperties[13].Name = C2U("PrintBlackFonts"); - pViewProperties[13].Value <<= (sal_Bool)rOpt.IsPrintBlackFont(); - pViewProperties[14].Name = C2U("IsSinglePrintJob"); - pViewProperties[14].Value <<= (sal_Bool)rOpt.IsPrintSingleJobs(); - pViewProperties[15].Name = C2U("PrintEmptyPages"); - pViewProperties[15].Value <<= (sal_Bool)rOpt.IsPrintEmptyPages(); - - rView.SetAdditionalPrintOptions(aViewProperties); - do { - nStartRow = pImpl->pMergeData ? pImpl->pMergeData->xResultSet->getRow() : 0; - { - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE), pSh->GetView().GetViewFrame()->GetObjectShell())); - pSh->ViewShell::UpdateFlds(); - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE_FINISHED), pSh->GetView().GetViewFrame()->GetObjectShell())); - ++rOpt.nMergeAct; - - // launch MailMergeEvent if required - const SwXMailMerge *pEvtSrc = GetMailMergeEvtSrc(); - if (pEvtSrc) - { - uno::Reference< XInterface > xRef( (XMailMergeBroadcaster *) pEvtSrc ); - text::MailMergeEvent aEvt( xRef, rView.GetDocShell()->GetModel() ); - pEvtSrc->LaunchMailMergeEvent( aEvt ); - } - - rView.SfxViewShell::Print( rProgress, bIsAPI ); // ggf Basic-Macro ausfuehren - if( rOpt.IsPrintSingleJobs() && bRet ) - { - //rOpt.bJobStartet = FALSE; - bRet = FALSE; - } - - bMergeLock = TRUE; - if(rOpt.IsPrintProspect()) - { - if( ! pPrt->IsJobActive() ) - { - pPrt->SetJobValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ), - String( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) ); - pPrt->StartJob( rOpt.GetJobName() ); - } - if( pPrt->IsJobActive() ) - { - pSh->PrintProspect( rOpt, rProgress, rOpt.IsPrintProspect_RTL() ); - bRet = TRUE; - } - } - else if( pSh->Prt( rOpt, &rProgress ) ) - bRet = TRUE; - bMergeLock = FALSE; - - if( !pPrt->IsJobActive() ) - { - bUserBreak = TRUE; - bRet = FALSE; - break; - } - if( !rOpt.IsPrintSingleJobs() ) - { - String& rJNm = (String&)rOpt.GetJobName(); - rJNm.Erase(); - } - } - nEndRow = pImpl->pMergeData ? pImpl->pMergeData->xResultSet->getRow() : 0; - } while( bSynchronizedDoc && (nStartRow != nEndRow)? ExistsNextRecord() : ToNextMergeRecord()); - - if( rOpt.IsPrintSingleJobs() ) - { - SfxPrinter* pTmpPrinter = pSh->getIDocumentDeviceAccess()->getPrinter( true ); - pTmpPrinter->SetEndPrintHdl( aSfxSaveLnk ); - if ( !bUserBreak && !pTmpPrinter->IsJobActive() ) //Schon zu spaet? - aSfxSaveLnk.Call( pTmpPrinter ); - } - - rOpt.nMergeCnt = 0; - rOpt.nMergeAct = 0; - - nMergeType = DBMGR_INSERT; - - SwDocShell* pDocSh = rView.GetDocShell(); - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(pDocSh); - - while (pTmpFrm) // Alle Views Invalidieren - { - SwView *pVw = PTR_CAST(SwView, pTmpFrm->GetViewShell()); - if (pVw) - pVw->GetEditWin().Invalidate(); - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, pDocSh); - } - - return bRet; -} -/*-- 21.06.2004 09:08:16--------------------------------------------------- - - -----------------------------------------------------------------------*/ -BOOL SwNewDBMgr::MergePrintDocuments( SwView& rView, - SwPrtOptions& rOpt, SfxProgress& rProgress, BOOL bIsAPI ) -{ - SwWrtShell* pSh = &rView.GetWrtShell(); - //check if the doc is synchronized and contains at least one linked section - //merge source is already open - rOpt.nMergeCnt = 0; - rOpt.SetPrintSingleJobs( sal_True ); - - SfxPrinter *pPrt = pSh->getIDocumentDeviceAccess()->getPrinter( false ); - Link aSfxSaveLnk = pPrt->GetEndPrintHdl(); - if( rOpt.IsPrintSingleJobs() ) - pPrt->SetEndPrintHdl( Link() ); - - BOOL bUserBreak = FALSE, - bRet = FALSE; - //calculate number of data sets to be printed - - Sequence<PropertyValue> aViewProperties(16); - PropertyValue* pViewProperties = aViewProperties.getArray(); - pViewProperties[0].Name = C2U("MailMergeCount"); - pViewProperties[0].Value <<= (sal_Int32)rOpt.nMergeCnt; - pViewProperties[1].Name = C2U("PrintGraphics"); - pViewProperties[1].Value <<= (sal_Bool)rOpt.IsPrintGraphic(); - pViewProperties[2].Name = C2U("PrintTables"); - pViewProperties[2].Value <<= (sal_Bool)rOpt.IsPrintTable(); - pViewProperties[3].Name = C2U("PrintDrawings"); - pViewProperties[3].Value <<= (sal_Bool)rOpt.IsPrintDraw(); - pViewProperties[4].Name = C2U("PrintLeftPages"); - pViewProperties[4].Value <<= (sal_Bool)rOpt.IsPrintLeftPage(); - pViewProperties[5].Name = C2U("PrintRightPages"); - pViewProperties[5].Value <<= (sal_Bool)rOpt.IsPrintRightPage(); - pViewProperties[6].Name = C2U("PrintControls"); - pViewProperties[6].Value <<= (sal_Bool)rOpt.IsPrintControl(); - pViewProperties[7].Name = C2U("PrintReversed"); - pViewProperties[7].Value <<= (sal_Bool)rOpt.IsPrintReverse(); - pViewProperties[8].Name = C2U("PrintPaperFromSetup"); - pViewProperties[8].Value <<= (sal_Bool)rOpt.IsPaperFromSetup(); - pViewProperties[9].Name = C2U("PrintFaxName"); - pViewProperties[9].Value <<= rOpt.GetFaxName(); - pViewProperties[10].Name = C2U("PrintAnnotationMode"); - pViewProperties[10].Value <<= (text::NotePrintMode) rOpt.GetPrintPostIts(); - pViewProperties[11].Name = C2U("PrintProspect"); - pViewProperties[11].Value <<= (sal_Bool)rOpt.IsPrintProspect(); - pViewProperties[12].Name = C2U("PrintPageBackground"); - pViewProperties[12].Value <<= (sal_Bool)rOpt.IsPrintPageBackground(); - pViewProperties[13].Name = C2U("PrintBlackFonts"); - pViewProperties[13].Value <<= (sal_Bool)rOpt.IsPrintBlackFont(); - pViewProperties[14].Name = C2U("IsSinglePrintJob"); - pViewProperties[14].Value <<= (sal_Bool)rOpt.IsPrintSingleJobs(); - pViewProperties[15].Name = C2U("PrintEmptyPages"); - pViewProperties[15].Value <<= (sal_Bool)rOpt.IsPrintEmptyPages(); - - rView.SetAdditionalPrintOptions(aViewProperties); - - SwMailMergeConfigItem* pConfigItem = rView.GetMailMergeConfigItem(); - DBG_ASSERT(pConfigItem, "mail merge config item is missing"); - if(!pConfigItem) - return sal_False; - - USHORT nDocStart = pConfigItem->GetPrintRangeStart(); - USHORT nDocEnd = pConfigItem->GetPrintRangeEnd(); - DBG_ASSERT(nDocStart < nDocEnd && nDocEnd <= pConfigItem->GetMergedDocumentCount(), - "merge print settings are not correct"); - - for( sal_uInt32 nPrintDocument = nDocStart; nPrintDocument < nDocEnd; ++nPrintDocument) - { - SwDocMergeInfo& rDocInfo = pConfigItem->GetDocumentMergeInfo(nPrintDocument); - rOpt.aMulti.SelectAll(FALSE); - rOpt.aMulti.Select(Range( rDocInfo.nStartPageInTarget, rDocInfo.nEndPageInTarget ), TRUE ); - - ++rOpt.nMergeAct; - - // launch MailMergeEvent if required - const SwXMailMerge *pEvtSrc = GetMailMergeEvtSrc(); - if (pEvtSrc) - { - uno::Reference< XInterface > xRef( (XMailMergeBroadcaster *) pEvtSrc ); - text::MailMergeEvent aEvt( xRef, rView.GetDocShell()->GetModel() ); - pEvtSrc->LaunchMailMergeEvent( aEvt ); - } - - String aTmp; - aTmp += String::CreateFromInt32( rDocInfo.nStartPageInTarget ); - aTmp += '-'; - aTmp += String::CreateFromInt32( rDocInfo.nEndPageInTarget ); - - Sequence<PropertyValue> aAddViewProperties(1); - PropertyValue* pAddViewProperties = aAddViewProperties.getArray(); - pAddViewProperties[0].Name = C2U("Pages"); - pAddViewProperties[0].Value <<= ::rtl::OUString( aTmp ); - rView.SetAdditionalPrintOptions(aAddViewProperties); - - rView.SfxViewShell::Print( rProgress, bIsAPI ); // ggf Basic-Macro ausfuehren - if( rOpt.IsPrintSingleJobs() && bRet ) - { - //rOpt.bJobStartet = FALSE; - bRet = FALSE; - } - - bMergeLock = TRUE; - if(rOpt.IsPrintProspect()) - { - if( pPrt->IsJobActive() || pPrt->StartJob( rOpt.GetJobName() )) - { - pSh->PrintProspect( rOpt, rProgress, rOpt.IsPrintProspect_RTL() ); - bRet = TRUE; - } - } - else if( pSh->Prt( rOpt, &rProgress ) ) - bRet = TRUE; - bMergeLock = FALSE; - - if( !pPrt->IsJobActive() ) - { - bUserBreak = TRUE; - bRet = FALSE; - break; - } - if( !rOpt.IsPrintSingleJobs() ) - { - String& rJNm = (String&)rOpt.GetJobName(); - rJNm.Erase(); - } - } - - if( rOpt.IsPrintSingleJobs() ) - { - SfxPrinter* pTmpPrinter = pSh->getIDocumentDeviceAccess()->getPrinter( true ); - pTmpPrinter->SetEndPrintHdl( aSfxSaveLnk ); - if ( !bUserBreak && !pTmpPrinter->IsJobActive() ) //Schon zu spaet? - aSfxSaveLnk.Call( pTmpPrinter ); - } - - rOpt.nMergeCnt = 0; - rOpt.nMergeAct = 0; - - nMergeType = DBMGR_INSERT; - - SwDocShell* pDocSh = rView.GetDocShell(); - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(pDocSh); - - while (pTmpFrm) // Alle Views Invalidieren - { - SwView *pVw = PTR_CAST(SwView, pTmpFrm->GetViewShell()); - if (pVw) - pVw->GetEditWin().Invalidate(); - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, pDocSh); - } - - return bRet; -} - - /*-------------------------------------------------------------------- Beschreibung: Serienbriefe als einzelne Dokumente speichern @@ -1317,6 +927,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, // in case of creating a single resulting file this has to be created here SwWrtShell* pTargetShell = 0; SfxObjectShellRef xTargetDocShell; + SwView* pTargetView = 0; std::auto_ptr< utl::TempFile > aTempFile; String sModifiedStartingPageDesc; String sStartingPageDesc; @@ -1329,7 +940,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, xTargetDocShell->DoInitNew( 0 ); SfxViewFrame* pTargetFrame = SfxViewFrame::CreateViewFrame( *xTargetDocShell, 0, TRUE ); - SwView* pTargetView = static_cast<SwView*>( pTargetFrame->GetViewShell() ); + pTargetView = static_cast<SwView*>( pTargetFrame->GetViewShell() ); //initiate SelectShell() to create sub shells pTargetView->AttrChangedNotify( &pTargetView->GetWrtShell() ); @@ -1650,27 +1261,83 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, // save the single output document if(rMergeDescriptor.bCreateSingleFile || bAsSingleFile) { - DBG_ASSERT( aTempFile.get(), "Temporary file not available" ); - INetURLObject aTempFileURL(bAsSingleFile ? sSubject : aTempFile->GetURL()); - SfxMedium* pDstMed = new SfxMedium( - aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ), - STREAM_STD_READWRITE, TRUE ); - pDstMed->SetFilter( pStoreToFilter ); - if(pDstMed->GetItemSet()) + if( rMergeDescriptor.nMergeType != DBMGR_MERGE_MAILMERGE ) { - if(pStoreToFilterOptions ) - pDstMed->GetItemSet()->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, *pStoreToFilterOptions)); - if(rMergeDescriptor.aSaveToFilterData.getLength()) - pDstMed->GetItemSet()->Put(SfxUsrAnyItem(SID_FILTER_DATA, makeAny(rMergeDescriptor.aSaveToFilterData))); - } + DBG_ASSERT( aTempFile.get(), "Temporary file not available" ); + INetURLObject aTempFileURL(bAsSingleFile ? sSubject : aTempFile->GetURL()); + SfxMedium* pDstMed = new SfxMedium( + aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ), + STREAM_STD_READWRITE, TRUE ); + pDstMed->SetFilter( pStoreToFilter ); + if(pDstMed->GetItemSet()) + { + if(pStoreToFilterOptions ) + pDstMed->GetItemSet()->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, *pStoreToFilterOptions)); + if(rMergeDescriptor.aSaveToFilterData.getLength()) + pDstMed->GetItemSet()->Put(SfxUsrAnyItem(SID_FILTER_DATA, makeAny(rMergeDescriptor.aSaveToFilterData))); + } - xTargetDocShell->DoSaveAs(*pDstMed); - xTargetDocShell->DoSaveCompleted(pDstMed); - if( xTargetDocShell->GetError() ) + xTargetDocShell->DoSaveAs(*pDstMed); + xTargetDocShell->DoSaveCompleted(pDstMed); + if( xTargetDocShell->GetError() ) + { + // error message ?? + ErrorHandler::HandleError( xTargetDocShell->GetError() ); + bLoop = FALSE; + } + } + else if( pTargetView ) // must be available! { - // error message ?? - ErrorHandler::HandleError( xTargetDocShell->GetError() ); - bLoop = FALSE; + //print the target document + #if OSL_DEBUG_LEVEL > 1 + sal_Bool _bVal; + sal_Int16 _nVal; + rtl::OUString _sVal; + const beans::PropertyValue* pDbgPrintOptions = rMergeDescriptor.aPrintOptions.getConstArray(); + for( sal_Int32 nOption = 0; nOption < rMergeDescriptor.aPrintOptions.getLength(); ++nOption) + { + rtl::OUString aName( pDbgPrintOptions[nOption].Name ); + uno::Any aVal( pDbgPrintOptions[nOption].Value ); + aVal >>= _bVal; + aVal >>= _nVal; + aVal >>= _sVal; + } + #endif + // printing should be done synchronously otherwise the document + // might already become invalid during the process + uno::Sequence< beans::PropertyValue > aOptions( rMergeDescriptor.aPrintOptions ); + const sal_Int32 nOpts = aOptions.getLength(); + aOptions.realloc( nOpts + 1 ); + aOptions[ nOpts ].Name = rtl::OUString::createFromAscii( "Wait" ); + aOptions[ nOpts ].Value <<= sal_True ; +// aPrintArgs.Put(SfxBoolItem(FN_QRY_MERGE, TRUE) ); +// // #i52629# aynchronous printing should only be done in silent mode - otherwise +// // the printer dialog does not come up +// aPrintArgs.Put( SfxBoolItem( SID_ASYNCHRON, rMergeDescriptor.bPrintAsync )); + // move print options + const beans::PropertyValue* pPrintOptions = rMergeDescriptor.aPrintOptions.getConstArray(); + for( sal_Int32 nOption = 0; nOption < rMergeDescriptor.aPrintOptions.getLength(); ++nOption) + { + if( pPrintOptions[nOption].Name.equalsAscii( "CopyCount" ) + ||( pPrintOptions[nOption].Name.equalsAscii( "FileName" )) + ||( pPrintOptions[nOption].Name.equalsAscii( "Collate" )) + ||( pPrintOptions[nOption].Name.equalsAscii( "Pages" )) + ||( pPrintOptions[nOption].Name.equalsAscii( "Wait" ))) + { + aOptions.realloc( nOpts + 1 ); + aOptions[ nOpts ].Name = pPrintOptions[nOption].Name; + aOptions[ nOpts ].Value = pPrintOptions[nOption].Value ; + } + } + +// const SwModuleOptions * pModOpt = SW_MOD()->GetModuleConfig(); +// if (pModOpt->IsSinglePrintJob()) +// { +// } +// else +// { + pTargetView->ExecPrint( aOptions, IsMergeSilent(), rMergeDescriptor.bPrintAsync ); +// } } xTargetDocShell->DoClose(); } @@ -2901,7 +2568,8 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, pWorkDoc->SetNewDBMgr( this ); SwMergeDescriptor aMergeDesc( pImpl->pMergeDialog->GetMergeType(), pView->GetWrtShell(), aDescriptor ); - aMergeDesc.sSaveToFilter = pImpl->pMergeDialog->GetSaveFilter(); + aMergeDesc.sSaveToFilter = pImpl->pMergeDialog->GetSaveFilter(); + aMergeDesc.bCreateSingleFile= true; MergeNew(aMergeDesc); pWorkDoc->SetNewDBMgr( pWorkDBMgr ); @@ -3233,7 +2901,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, if(nDocNo == 1 ) { uno::Reference< util::XCloneable > xClone( rSourceView.GetDocShell()->GetModel(), uno::UNO_QUERY); - uno::Reference< lang::XUnoTunnel > xWorkDocShell( xClone->createClone(), uno::UNO_QUERY); + uno::Reference< lang::XUnoTunnel > xWorkDocShell( xClone->createClone(), uno::UNO_QUERY); SwXTextDocument* pWorkModel = reinterpret_cast<SwXTextDocument*>(xWorkDocShell->getSomething(SwXTextDocument::getUnoTunnelId())); xWorkDocSh = pWorkModel->GetDocShell(); } @@ -3242,7 +2910,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, SwDoc* pNewDoc = rSourceView.GetDocShell()->GetDoc()->CreateCopy(); xWorkDocSh = new SwDocShell( pNewDoc, SFX_CREATE_MODE_STANDARD ); xWorkDocSh->DoInitNew(); - } + } //create a ViewFrame SwView* pWorkView = static_cast< SwView* >( SfxViewFrame::CreateViewFrame( *xWorkDocSh, 0, sal_True )->GetViewShell() ); SwWrtShell& rWorkShell = pWorkView->GetWrtShell(); @@ -3255,8 +2923,8 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, pWorkDoc->EmbedAllLinks(); if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds()) rWorkShell.Undo(); - // #i69485# lock fields to prevent access to the result set while calculating layout
- rWorkShell.LockExpFlds();
+ // #i69485# lock fields to prevent access to the result set while calculating layout + rWorkShell.LockExpFlds(); // create a layout rWorkShell.CalcLayout(); rWorkShell.UnlockExpFlds(); @@ -3288,7 +2956,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, pTargetShell->GetDoc()->MakePageDesc( sNewPageDescName ); SwPageDesc* pTargetPageDesc = pTargetShell->FindPageDescByName( sNewPageDescName ); const SwPageDesc* pWorkPageDesc = rWorkShell.FindPageDescByName( sStartingPageDesc ); - + if(pWorkPageDesc && pTargetPageDesc) { pTargetDoc->CopyPageDesc( *pWorkPageDesc, *pTargetPageDesc, sal_False ); diff --git a/sw/source/ui/dbui/maildispatcher.cxx b/sw/source/ui/dbui/maildispatcher.cxx index 67f550acf5..183764a5b2 100644 --- a/sw/source/ui/dbui/maildispatcher.cxx +++ b/sw/source/ui/dbui/maildispatcher.cxx @@ -110,8 +110,7 @@ namespace /* private */ MailDispatcher::MailDispatcher(uno::Reference<mail::XSmtpService> mailserver) : mailserver_ (mailserver), run_(false), - shutdown_requested_(false), - bIsInRun(false) + shutdown_requested_(false) { wakening_call_.reset(); mail_dispatcher_active_.reset(); @@ -206,12 +205,6 @@ bool MailDispatcher::isStarted() const return run_; } -bool MailDispatcher::isRunning() const -{ - return bIsInRun; -} - - void MailDispatcher::addListener(::rtl::Reference<IMailDispatcherListener> listener) { OSL_PRECOND(!shutdown_requested_, "MailDispatcher thread is shuting down already"); @@ -267,7 +260,6 @@ void MailDispatcher::run() // signal that the mail dispatcher thread is now alive mail_dispatcher_active_.set(); - bIsInRun = true; for(;;) { wakening_call_.wait(); @@ -295,7 +287,6 @@ void MailDispatcher::run() std::for_each(listeners_cloned.begin(), listeners_cloned.end(), GenericEventNotifier(&IMailDispatcherListener::idle, this)); } } // end for SSH ALI - bIsInRun = false; } /*-- 27.08.2004 12:04:46--------------------------------------------------- diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx index 94f22278c7..f3f879debb 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.hxx +++ b/sw/source/ui/dbui/mmaddressblockpage.hxx @@ -43,7 +43,7 @@ #include <svtools/headbar.hxx> #include <svtools/svtreebx.hxx> #include <vcl/combobox.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> class SwMailMergeWizard; class SwMailMergeConfigItem; /*-- 13.04.2004 15:50:37--------------------------------------------------- diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx index 6605b2dbaf..dda498ab1d 100644 --- a/sw/source/ui/dbui/mmconfigitem.cxx +++ b/sw/source/ui/dbui/mmconfigitem.cxx @@ -63,7 +63,7 @@ #include <unomid.h> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> using namespace utl; using ::rtl::OUString; @@ -183,8 +183,8 @@ public: SwMailMergeConfigItem_Impl(); ~SwMailMergeConfigItem_Impl(); - virtual void Commit(); - + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); const Sequence< ::rtl::OUString> GetAddressBlocks(sal_Bool bConvertToConfig = sal_False) const; void SetAddressBlocks( @@ -538,6 +538,8 @@ const Sequence<OUString>& SwMailMergeConfigItem_Impl::GetPropertyNames() /*-- 15.04.2004 08:48:39--------------------------------------------------- -----------------------------------------------------------------------*/ +void SwMailMergeConfigItem_Impl::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + void SwMailMergeConfigItem_Impl::Commit() { Sequence<OUString> aNames = GetPropertyNames(); diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx index 1c479cb995..423185fb0b 100644 --- a/sw/source/ui/dbui/mmdocselectpage.cxx +++ b/sw/source/ui/dbui/mmdocselectpage.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ #endif -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <sfx2/filedlghelper.hxx> #include <sfx2/new.hxx> #include <sfx2/docfilt.hxx> @@ -214,7 +214,7 @@ sal_Bool SwMailMergeDocSelectPage::commitPage( CommitPageReason _eReason ) (m_aRecentDocRB.IsChecked() && (sReloadDocument = m_aRecentDocLB.GetSelectEntry()).getLength()); if( _eReason == eValidate ) m_pWizard->SetDocumentLoad(!m_aCurrentDocRB.IsChecked()); - + if(bNext && !m_aCurrentDocRB.IsChecked()) { if(sReloadDocument.getLength()) diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index c1f35143e8..05f38af1e7 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -45,7 +45,7 @@ #include <view.hxx> #include <swundo.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <sfx2/docfilt.hxx> #include <com/sun/star/text/XParagraphCursor.hpp> #include <com/sun/star/view/XViewSettingsSupplier.hpp> @@ -63,7 +63,7 @@ #include <fmtornt.hxx> #include <fmtfsize.hxx> #include <svx/boxitem.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <shellio.hxx> #include <osl/file.hxx> #include <unoprnms.hxx> diff --git a/sw/source/ui/dbui/mmmergepage.cxx b/sw/source/ui/dbui/mmmergepage.cxx index e57d4028ac..a8a0f48c27 100644 --- a/sw/source/ui/dbui/mmmergepage.cxx +++ b/sw/source/ui/dbui/mmmergepage.cxx @@ -44,7 +44,7 @@ #include <mmmergepage.hrc> #include <svx/srchitem.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <swabstdlg.hxx> /*-- 02.04.2004 16:38:45--------------------------------------------------- diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index eb1f75d579..f77ff57503 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -53,8 +53,8 @@ #include <hintids.hxx> #include <svx/scripttypeitem.hxx> #include <svx/langitem.hxx> -#include <svtools/itemset.hxx> -#include <svtools/stritem.hxx> +#include <svl/itemset.hxx> +#include <svl/stritem.hxx> #include <svtools/ehdl.hxx> #include <svtools/sfxecode.hxx> #include <vcl/msgbox.hxx> @@ -68,7 +68,7 @@ //#include <sfx2/docfilt.hxx> //#endif #include <tools/urlobj.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #ifndef _VCL_PRINT_HXX #include <vcl/print.hxx> #endif @@ -991,6 +991,13 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG) nEnd = rConfigItem.GetMergedDocumentCount(); } rConfigItem.SetPrintRange( (USHORT)nBegin, (USHORT)nEnd ); + SwDocMergeInfo& rStartInfo = rConfigItem.GetDocumentMergeInfo(nBegin); + SwDocMergeInfo& rEndInfo = rConfigItem.GetDocumentMergeInfo(nEnd - 1); + + rtl::OUString sPages(rtl::OUString::valueOf( rStartInfo.nStartPageInTarget )); + sPages += rtl::OUString::createFromAscii( " - "); + sPages += rtl::OUString::valueOf( rEndInfo.nEndPageInTarget ); + SwWrtShell& rSh = pTargetView->GetWrtShell(); pTargetView->SetMailMergeConfigItem(&rConfigItem, 0, sal_False); if(m_pTempPrinter) @@ -1002,11 +1009,17 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG) SfxObjectShell* pObjSh = pTargetView->GetViewFrame()->GetObjectShell(); SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), pObjSh)); rSh.GetNewDBMgr()->SetMergeType( DBMGR_MERGE_DOCUMENTS ); - SfxDispatcher *pDis = pTargetView->GetViewFrame()->GetDispatcher(); + //SfxDispatcher *pDis = pTargetView->GetViewFrame()->GetDispatcher(); SfxBoolItem aMergeSilent(SID_SILENT, sal_False); m_pWizard->enableButtons(WZB_CANCEL, sal_False); - pDis->Execute(SID_PRINTDOCDIRECT, - SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aMergeSilent, 0L); + + uno::Sequence < beans::PropertyValue > aProps( 2 ); + aProps[0]. Name = rtl::OUString::createFromAscii("MonitorVisible"); + aProps[0].Value <<= sal_True; + aProps[1]. Name = rtl::OUString::createFromAscii("Pages"); + aProps[1]. Value <<= sPages; + + pTargetView->ExecPrint( aProps, false, true ); SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), pObjSh)); pTargetView->SetMailMergeConfigItem(0, 0, sal_False); diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx index a5d9c75b39..6f8bd1f466 100644 --- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,8 +48,8 @@ #include <svx/svdview.hxx> #include <svx/svditer.hxx> #include <svx/svdogrp.hxx> -#include <svtools/linguprops.hxx> -#include <svtools/lingucfg.hxx> +#include <unotools/linguprops.hxx> +#include <unotools/lingucfg.hxx> #include <doc.hxx> #include <docsh.hxx> #include <docary.hxx> @@ -417,7 +417,7 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void) String sInfo(SW_RES(STR_SPELLING_COMPLETED)); //#i84610# Window* pTemp = GetWindow(); // temporary needed for g++ 3.3.5 - InfoBox(pTemp, sInfo ).Execute(); + InfoBox(pTemp, sInfo ).Execute(); LockFocusNotification( false ); //take care that the now valid selection is stored LoseFocus(); @@ -496,7 +496,7 @@ void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn) m_bIsGrammarCheckingOn = bOn; String aPropName( C2S(UPN_IS_GRAMMAR_INTERACTIVE ) ); SvtLinguConfig().SetProperty( aPropName, aVal ); - // set current spell position to the start of the current sentence to + // set current spell position to the start of the current sentence to // continue with this sentence after grammar checking state has been changed SwWrtShell* pWrtShell = GetWrtShell_Impl(); if(pWrtShell) @@ -520,7 +520,7 @@ void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn) pOutliner->PutSpellingToSentenceStart( pSdrView->GetTextEditOutlinerView()->GetEditView() ); } } - } + } } /*-- 28.10.2003 08:41:09--------------------------------------------------- diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index 34b04822c0..6907737855 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ #include <rtl/textenc.h> #include <i18npool/mslangid.hxx> #include <com/sun/star/i18n/ScriptType.hpp> -#include <svtools/lingucfg.hxx> +#include <unotools/lingucfg.hxx> #include <fontcfg.hxx> #include <swmodule.hxx> #include <svx/unolingu.hxx> diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx index 9a06a311e1..50e76dcfc5 100644 --- a/sw/source/ui/dialog/macassgn.cxx +++ b/sw/source/ui/dialog/macassgn.cxx @@ -39,7 +39,7 @@ #include "hintids.hxx" #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svx/htmlmode.hxx> #ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> diff --git a/sw/source/ui/dialog/regionsw.cxx b/sw/source/ui/dialog/regionsw.cxx index c674c1070a..9a35c75d0d 100644 --- a/sw/source/ui/dialog/regionsw.cxx +++ b/sw/source/ui/dialog/regionsw.cxx @@ -34,11 +34,11 @@ #include <hintids.hxx> #include <uitool.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/PasswordHelper.hxx> +#include <svl/urihelper.hxx> +#include <svl/PasswordHelper.hxx> #include <vcl/msgbox.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <sot/formats.hxx> #include <sfx2/passwd.hxx> #include <sfx2/docfilt.hxx> diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 4e27969016..10c153c484 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -36,7 +36,7 @@ #endif #include "swdlgfact.hxx" -#include <svtools/style.hxx> +#include <svl/style.hxx> #ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> #endif @@ -1698,7 +1698,7 @@ CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( USHORT nId ) break; case RID_SW_TP_OPTTEST_PAGE : case TP_OPTTEST_PAGE : -#ifndef PRODUCT +#ifdef DBG_UTIL pRet = SwTestTabPage::Create; #endif break; diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 88e3df03a2..e34dc9387e 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -36,12 +36,12 @@ #include <hintids.hxx> #include <regionsw.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/PasswordHelper.hxx> +#include <svl/urihelper.hxx> +#include <svl/PasswordHelper.hxx> #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <sfx2/passwd.hxx> #include <sfx2/docfilt.hxx> #include <sfx2/request.hxx> @@ -1480,14 +1480,16 @@ static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox ) uno::Reference < embed::XStorage > xStg; if( rMedium.IsStorage() && (xStg = rMedium.GetStorage()).is() ) { - SvStringsDtor aArr( 10, 10 ); + SvStrings aArr( 10, 10 ); sal_uInt32 nFormat = SotStorage::GetFormatID( xStg ); if ( nFormat == SOT_FORMATSTR_ID_STARWRITER_60 || nFormat == SOT_FORMATSTR_ID_STARWRITERGLOB_60 || nFormat == SOT_FORMATSTR_ID_STARWRITER_8 || nFormat == SOT_FORMATSTR_ID_STARWRITERGLOB_8) - SwGetReaderXML()->GetSectionList( rMedium, (SvStrings&) aArr ); + SwGetReaderXML()->GetSectionList( rMedium, aArr ); for( USHORT n = 0; n < aArr.Count(); ++n ) rBox.InsertEntry( *aArr[ n ] ); + + aArr.DeleteAndDestroy(0, aArr.Count()); } } /* -----------------21.05.99 10:16------------------- diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx index d8bb52b31e..c82bbb4d75 100644 --- a/sw/source/ui/dochdl/gloshdl.cxx +++ b/sw/source/ui/dochdl/gloshdl.cxx @@ -44,12 +44,12 @@ #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <sfx2/fcontnr.hxx> #include <sfx2/docfile.hxx> #define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> -#include <svtools/urihelper.hxx> +#include <svl/svstdarr.hxx> +#include <svl/urihelper.hxx> #include <unotools/transliterationwrapper.hxx> #include <poolfmt.hxx> #include <fmtcol.hxx> diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index e991938aad..a1589281d5 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -60,13 +60,13 @@ #include <vcl/msgbox.hxx> #endif #include <sfx2/dispatch.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <svtools/imap.hxx> #include <sot/storage.hxx> #ifndef _GRAPH_HXX #include <vcl/graph.hxx> #endif -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <svx/svdmodel.hxx> #include <svx/xexch.hxx> #include <svx/xmlexchg.hxx> @@ -75,7 +75,7 @@ #include <sfx2/mieclip.hxx> #include <svx/svdetc.hxx> #include <svx/xoutbmp.hxx> -#include <svtools/urlbmk.hxx> +#include <svl/urlbmk.hxx> #include <svtools/htmlout.hxx> #include <svx/hlnkitem.hxx> #include <svtools/inetimg.hxx> diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index 6681e755f1..17673cd387 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -70,9 +70,9 @@ #include <sfx2/srchitem.hxx> -#include <svtools/languageoptions.hxx> +#include <svl/languageoptions.hxx> #include <svtools/langtab.hxx> -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> #include <svx/svdview.hxx> #include <svx/eeitem.hxx> @@ -1948,3 +1948,7 @@ void SwPostItMgr::AssureStdModeAtShell() mpView->StopShellTimer(); } } + +void SwNoteProps::Commit() {} +void SwNoteProps::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 4433f0ca88..6a22daafde 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -48,19 +48,19 @@ #include <vcl/msgbox.hxx> #include <vcl/cmdevt.h> #include <sot/storage.hxx> -#include <svtools/macitem.hxx> -#include <svtools/securityoptions.hxx> +#include <svl/macitem.hxx> +#include <unotools/securityoptions.hxx> #include <basic/sbxvar.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/ctloptions.hxx> #include <basic/sbx.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <sfx2/ipclient.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/request.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/ptitem.hxx> +#include <svl/ptitem.hxx> #include <svx/sizeitem.hxx> #include <svx/langitem.hxx> #include <svx/htmlmode.hxx> @@ -145,7 +145,7 @@ #include "postit.hxx" //JP 11.10.2001: enable test code for bug fix 91313 -#if !defined( PRODUCT ) && (OSL_DEBUG_LEVEL > 1) +#if defined(DBG_UTIL) && (OSL_DEBUG_LEVEL > 1) //#define TEST_FOR_BUG91313 #endif @@ -1496,7 +1496,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) case KS_CheckKey: eKeyState = KS_KeyToView; // default weiter zur View -#ifndef PRODUCT +#ifdef DBG_UTIL //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // JP 19.01.99: zum Umschalten des Cursor Verhaltens in ReadOnly // Bereichen @@ -1758,7 +1758,7 @@ KEYINPUT_CHECKTABLE_INSDEL: !rSh.GetCurNumRule()->IsOutlineRule() && !rSh.HasSelection() && rSh.IsSttPara() && rSh.IsEndPara() ) - eKeyState = KS_NumOff, eNextKeyState = KS_OutlineLvOff; + eKeyState = KS_NumOff, eNextKeyState = KS_OutlineLvOff; //RETURN fuer neuen Absatz mit AutoFormatierung else if( pACfg && pACfg->IsAutoFmtByInput() && @@ -1892,7 +1892,7 @@ KEYINPUT_CHECKTABLE_INSDEL: #endif if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark() || rSh.GetChar(FALSE)==CH_TXT_ATR_FORMELEMENT) { - eKeyState=KS_GotoNextFieldMark; + eKeyState=KS_GotoNextFieldMark; } else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() && @@ -1947,7 +1947,7 @@ KEYINPUT_CHECKTABLE_INSDEL: BOOL bOld = rSh.ChgCrsrTimerFlag( FALSE ); #endif if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark()|| rSh.GetChar(FALSE)==CH_TXT_ATR_FORMELEMENT) { - eKeyState=KS_GotoPrevFieldMark; + eKeyState=KS_GotoPrevFieldMark; } else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() && !rSh.HasReadonlySel() ) @@ -1984,7 +1984,7 @@ KEYINPUT_CHECKTABLE_INSDEL: SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl(); //if( pColl && 0 < pColl->GetOutlineLevel() && //#outline level,zhaojianwei // MAXLEVEL - 1 >= pColl->GetOutlineLevel() ) - if( pColl && + if( pColl && pColl->IsAssignedToListLevelOfOutlineStyle() && 0 < pColl->GetAssignedOutlineStyleLevel()) eKeyState = KS_OutlineUp; @@ -2362,14 +2362,14 @@ KEYINPUT_CHECKTABLE_INSDEL: nKS_NUMINDENTINC_Count = 2; break; - case KS_GotoNextFieldMark: + case KS_GotoNextFieldMark: { ::sw::mark::IFieldmark const * const pFieldmark = rSh.GetFieldmarkAfter(); if(pFieldmark) rSh.GotoFieldmark(pFieldmark); } break; - case KS_GotoPrevFieldMark: + case KS_GotoPrevFieldMark: { ::sw::mark::IFieldmark const * const pFieldmark = rSh.GetFieldmarkBefore(); if(pFieldmark) rSh.GotoFieldmark(pFieldmark); @@ -4768,7 +4768,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) aEvent.ExecutePosition.X = aPixPos.X(); aEvent.ExecutePosition.Y = aPixPos.Y(); Menu* pMenu = 0; - ::rtl::OUString sMenuName = + ::rtl::OUString sMenuName = ::rtl::OUString::createFromAscii( "private:resource/ReadonlyContextMenu"); if( GetView().TryContextMenuInterception( *pROPopup, sMenuName, pMenu, aEvent ) ) { diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx index b277c13949..7771bd4058 100644 --- a/sw/source/ui/docvw/edtwin2.cxx +++ b/sw/source/ui/docvw/edtwin2.cxx @@ -34,26 +34,26 @@ #include <hintids.hxx> #include <doc.hxx> -#ifndef PRODUCT +#ifdef DBG_UTIL #include <stdio.h> #endif #ifndef _HELP_HXX //autogen #include <vcl/help.hxx> #endif -#include <svtools/stritem.hxx> -#include <svtools/securityoptions.hxx> +#include <svl/stritem.hxx> +#include <unotools/securityoptions.hxx> #include <tools/urlobj.hxx> #include <txtrfmrk.hxx> #include <fmtrfmrk.hxx> #include <svx/flditem.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <svx/svdotext.hxx> #ifndef _OUTLINER_HXX //autogen #define _EEITEMID_HXX #include <svx/outliner.hxx> #endif -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/svdview.hxx> #include <svx/svdpagv.hxx> #include <swmodule.hxx> @@ -162,7 +162,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) SwContentAtPos::SW_TOXMARK | SwContentAtPos::SW_REFMARK | SwContentAtPos::SW_SMARTTAG | -#ifndef PRODUCT +#ifdef DBG_UTIL SwContentAtPos::SW_TABLEBOXVALUE | ( bBalloon ? SwContentAtPos::SW_CURR_ATTRS : 0) | #endif @@ -176,7 +176,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) sTxt.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "= " )); sTxt += ((SwTblBoxFormula*)aCntntAtPos.aFnd.pAttr)->GetFormula(); break; -#ifndef PRODUCT +#ifdef DBG_UTIL case SwContentAtPos::SW_TABLEBOXVALUE: { sTxt = UniString( diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx index 157a6e1997..8972b68f2d 100644 --- a/sw/source/ui/docvw/postit.cxx +++ b/sw/source/ui/docvw/postit.cxx @@ -68,11 +68,11 @@ #include <svx/unolingu.hxx> #include <svtools/langtab.hxx> -#include <svtools/slstitm.hxx> -#include <svtools/securityoptions.hxx> -#include <svtools/useroptions.hxx> -#include <svtools/languageoptions.hxx> -#include <svtools/zforlist.hxx> +#include <svl/slstitm.hxx> +#include <unotools/securityoptions.hxx> +#include <unotools/useroptions.hxx> +#include <svl/languageoptions.hxx> +#include <svl/zforlist.hxx> #include <svtools/svmedit.hxx> #include <linguistic/lngprops.hxx> @@ -268,7 +268,7 @@ void PostItTxt::KeyInput( const KeyEvent& rKeyEvt ) ( (aStatus==SwPostItHelper::DELETED) && (!mpMarginWin->Engine()->GetEditEngine().DoesKeyChangeText(rKeyEvt))) ) */ bool bIsProtected = mpMarginWin->IsProtected(); - if (!bIsProtected || (bIsProtected && !mpMarginWin->Engine()->GetEditEngine().DoesKeyChangeText(rKeyEvt)) ) + if (!bIsProtected || (bIsProtected && !mpMarginWin->Engine()->GetEditEngine().DoesKeyChangeText(rKeyEvt)) ) bDone = mpOutlinerView->PostKeyEvent( rKeyEvt ); else InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute(); @@ -536,7 +536,7 @@ SwMarginWin::SwMarginWin(Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPost mpShadow = new SwPostItShadow(basegfx::B2DPoint(0,0),basegfx::B2DPoint(0,0),Color(0,0,0),SS_NORMAL); mpShadow->setVisible(false); pOverlayManager->add(*mpShadow); - } + } } SwMarginWin::~SwMarginWin() @@ -824,7 +824,7 @@ void SwMarginWin::Rescale() //aMode.SetScaleX( aMode.GetScaleX() * Fraction( 8, 10 ) ); //aMode.SetScaleY( aMode.GetScaleY() * Fraction( 8, 10 ) ); mpOutliner->SetRefMapMode( aMode ); - SetMapMode( aMode ); + SetMapMode( aMode ); mpPostItTxt->SetMapMode( aMode ); if ( mpMeta ) { @@ -886,7 +886,7 @@ void SwMarginWin::SetPosAndSize() basegfx::B2DPoint( mAnkorRect.Left(), mAnkorRect.Bottom()+2*15), basegfx::B2DPoint( mPageBorder ,mAnkorRect.Bottom()+2*15), basegfx::B2DPoint( aLineStart.X(),aLineStart.Y()), - basegfx::B2DPoint( aLineEnd.X(),aLineEnd.Y()) , + basegfx::B2DPoint( aLineEnd.X(),aLineEnd.Y()) , mColorAnkor, false, false); @@ -917,7 +917,7 @@ void SwMarginWin::SetPosAndSize() Point aEnd = EditWin()->PixelToLogic(GetPosPixel()+Point(GetSizePixel().Width()-1,GetSizePixel().Height())); mpShadow->SetPosition(basegfx::B2DPoint(aStart.X(),aStart.Y()), basegfx::B2DPoint(aEnd.X(),aEnd.Y())); } - + if (mpMgr->ShowNotes()) { if (IsFollow() && !HasChildPathFocus()) @@ -961,7 +961,7 @@ void SwMarginWin::DoResize() { mpVScrollbar->Hide(); } - + mpMeta->SetPosSizePixel(0,aHeight,GetSizePixel().Width()-GetMetaButtonAreaWidth(),GetMetaHeight()); mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ; mpOutlinerView->SetOutputArea( PixelToLogic( Rectangle(0,0,aWidth,aHeight) ) ); @@ -980,7 +980,7 @@ void SwMarginWin::DoResize() mpPostItTxt->SetPosSizePixel((aTextHeight > aHeight) && !IsPreview() ? GetScrollbarWidth() : 0 , 0, aWidth, aHeight); mpVScrollbar->SetPosSizePixel( 0, 0, GetScrollbarWidth(), aHeight); } - + mpVScrollbar->SetVisibleSize( PixelToLogic(Size(0,aHeight)).Height() ); mpVScrollbar->SetPageSize( PixelToLogic(Size(0,aHeight)).Height() * 8 / 10 ); mpVScrollbar->SetLineSize( mpOutliner->GetTextHeight() / 10 ); @@ -1176,7 +1176,7 @@ void SwMarginWin::HideNote() if (IsVisible()) Window::Hide(); if (mpAnkor) - { + { if (mpMgr->IsShowAnkor()) mpAnkor->SetAnkorState(AS_TRI); else @@ -1189,7 +1189,7 @@ void SwMarginWin::HideNote() void SwMarginWin::ActivatePostIt() { mpMgr->AssureStdModeAtShell(); - + mpOutliner->ClearModifyFlag(); mpOutliner->GetUndoManager().Clear(); @@ -1256,7 +1256,7 @@ void SwMarginWin::ExecuteCommand(USHORT nSlot) { case FN_POSTIT: case FN_REPLY: - { + { // if this note is empty, it will be deleted once losing the focus, so no reply, but only a new note // will be created SwView* pView = DocView(); @@ -1280,7 +1280,7 @@ void SwMarginWin::ExecuteCommand(USHORT nSlot) /* case FN_HIDE_NOTE: if ( Mgr()->GetActivePostIt() == this ) - { + { Mgr()->SetActivePostIt(0); // put the cursor back into the document SwitchToFieldPos(); @@ -1736,7 +1736,7 @@ void SwPostIt::MouseButtonDown( const MouseEvent& rMEvt ) if( !(sAuthor = aUserOpt.GetID()).Len() ) sAuthor = String( SW_RES( STR_REDLINE_UNKNOWN_AUTHOR )); // do not allow to reply to ourself and no answer possible if this note is in a protected section - if ((sAuthor == GetAuthor()) || (IsProtected())) + if ((sAuthor == GetAuthor()) || (IsProtected())) mpButtonPopup->EnableItem(FN_REPLY,false); else mpButtonPopup->EnableItem(FN_REPLY,true); @@ -1774,7 +1774,7 @@ void SwPostIt::InitAnswer(OutlinerParaObject* pText) // insert old, selected text or "..." // TOOD: iterate over all paragraphs, not only first one to find out if it is empty - if (pText->GetTextObject().GetText(0) != String(EMPTYSTRING)) + if (pText->GetTextObject().GetText(0) != String(EMPTYSTRING)) View()->GetEditView().InsertText(pText->GetTextObject()); else View()->InsertText(rtl::OUString::createFromAscii("..."),false); @@ -1786,7 +1786,7 @@ void SwPostIt::InitAnswer(OutlinerParaObject* pText) aAnswerSet.Put(SvxPostureItem(ITALIC_NORMAL,EE_CHAR_ITALIC)); View()->SetAttribs(aAnswerSet); View()->SetSelection(ESelection(0xFFFF,0xFFFF,0xFFFF,0xFFFF)); - + //remove all attributes and reset our standard ones View()->GetEditView().RemoveAttribsKeepLanguages(true); View()->SetAttribs(DefaultItem()); @@ -1824,7 +1824,7 @@ SvxLanguageItem SwPostIt::GetLanguage(void) bool SwPostIt::IsProtected() { bool aReturn; - aReturn = mpFmtFld ? (SwMarginWin::IsProtected() || (mStatus==SwPostItHelper::DELETED) || + aReturn = mpFmtFld ? (SwMarginWin::IsProtected() || (mStatus==SwPostItHelper::DELETED) || mpFmtFld->IsProtect()) : (SwMarginWin::IsProtected() || (mStatus==SwPostItHelper::DELETED)); return aReturn; } @@ -1860,12 +1860,12 @@ void SwRedComment::SetPostItText() { Engine()->SetModifyHdl( Link() ); Engine()->EnableUndo( FALSE ); - + Engine()->Clear(); View()->SetAttribs(DefaultItem()); View()->InsertText(pRedline->GetComment(),false); - Engine()->ClearModifyFlag(); + Engine()->ClearModifyFlag(); Engine()->GetUndoManager().Clear(); Engine()->EnableUndo( TRUE ); Engine()->SetModifyHdl( LINK( this, SwMarginWin, ModifyHdl ) ); @@ -1886,7 +1886,7 @@ void SwRedComment::ActivatePostIt() // do we want the redline selected? // otherwise, SwRedComment::ActivatePostIt() as well as SwRedComment::DeactivatePostIt() // can be thrown out completly - DocView()->GetDocShell()->GetWrtShell()->GotoRedline( + DocView()->GetDocShell()->GetWrtShell()->GotoRedline( DocView()->GetDocShell()->GetWrtShell()->FindRedlineOfData(pRedline->GetRedlineData()),true); } @@ -1910,9 +1910,9 @@ void SwRedComment::Delete() Mgr()->RemoveItem(pRedline); } -void SwRedComment::GotoPos() +void SwRedComment::GotoPos() { - DocView()->GetDocShell()->GetWrtShell()->GotoRedline( + DocView()->GetDocShell()->GetWrtShell()->GotoRedline( DocView()->GetDocShell()->GetWrtShell()->FindRedlineOfData(pRedline->GetRedlineData())); } @@ -1941,8 +1941,8 @@ bool SwRedComment::IsProtected() // helper SwPostItShadowPrimitive // // Used to allow view-dependent primitive definition. For that purpose, the -// initially created primitive (this one) always has to be view-independent, -// but the decomposition is made view-dependent. Very simple primitive which +// initially created primitive (this one) always has to be view-independent, +// but the decomposition is made view-dependent. Very simple primitive which // just remembers the discrete data and applies it at decomposition time. class SwPostItShadowPrimitive : public drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D @@ -1953,7 +1953,7 @@ private: ShadowState maShadowState; protected: - virtual drawinglayer::primitive2d::Primitive2DSequence createLocalDecomposition( + virtual drawinglayer::primitive2d::Primitive2DSequence create2DDecomposition( const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; public: @@ -1977,7 +1977,7 @@ public: DeclPrimitrive2DIDBlock() }; -drawinglayer::primitive2d::Primitive2DSequence SwPostItShadowPrimitive::createLocalDecomposition( +drawinglayer::primitive2d::Primitive2DSequence SwPostItShadowPrimitive::create2DDecomposition( const drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/) const { // get logic sizes in object coordinate system @@ -2131,7 +2131,7 @@ private: basegfx::B2DPolygon maLineTop; AnkorState maAnkorState; basegfx::BColor maColor; - + // discrete line width double mfLogicLineWidth; @@ -2140,7 +2140,7 @@ private: bool mbLineSolid : 1; protected: - virtual drawinglayer::primitive2d::Primitive2DSequence createLocalDecomposition( + virtual drawinglayer::primitive2d::Primitive2DSequence create2DDecomposition( const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; public: @@ -2179,7 +2179,7 @@ public: DeclPrimitrive2DIDBlock() }; -drawinglayer::primitive2d::Primitive2DSequence SwPostItAnkorPrimitive::createLocalDecomposition( +drawinglayer::primitive2d::Primitive2DSequence SwPostItAnkorPrimitive::create2DDecomposition( const drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/) const { drawinglayer::primitive2d::Primitive2DSequence aRetval; @@ -2219,11 +2219,11 @@ drawinglayer::primitive2d::Primitive2DSequence SwPostItAnkorPrimitive::createLoc aDotDashArray.push_back(fDashLen); aDotDashArray.push_back(fDistance); - + const drawinglayer::attribute::StrokeAttribute aStrokeAttribute( aDotDashArray, fDistance + fDashLen); - + const drawinglayer::primitive2d::Primitive2DReference aStrokedLine( new drawinglayer::primitive2d::PolygonStrokePrimitive2D( getLine(), @@ -2290,7 +2290,7 @@ drawinglayer::primitive2d::Primitive2DSequence SwPostItAnkorPrimitive::createLoc drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aLineTop); } - + return aRetval; } diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx index 7bd6e7f501..8d8451188f 100644 --- a/sw/source/ui/docvw/romenu.cxx +++ b/sw/source/ui/docvw/romenu.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,9 +37,9 @@ #include <vcl/graph.hxx> #include <vcl/msgbox.hxx> #include <sot/formats.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/pathoptions.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <unotools/pathoptions.hxx> #include <svtools/filter.hxx> #include <svtools/imap.hxx> #include <svtools/inetimg.hxx> diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index ac6786427e..ed2d42db0c 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,7 +49,7 @@ #include <sfx2/app.hxx> #include <svtools/htmltokn.h> #include <svtools/txtattr.hxx> -#include <svtools/sourceviewconfig.hxx> +#include <unotools/sourceviewconfig.hxx> #include <svtools/colorcfg.hxx> #include <svx/flstitem.hxx> #include <vcl/metric.hxx> @@ -248,7 +248,7 @@ SwSrcEditWindow::SwSrcEditWindow( Window* pParent, SwSrcView* pParentView ) : pVScrollbar(0), pSrcView(pParentView), - pSourceViewConfig(new svt::SourceViewConfig), + pSourceViewConfig(new utl::SourceViewConfig), nCurTextWidth(0), nStartLine(USHRT_MAX), @@ -258,14 +258,14 @@ SwSrcEditWindow::SwSrcEditWindow( Window* pParent, SwSrcView* pParentView ) : { SetHelpId(HID_SOURCE_EDITWIN); CreateTextEngine(); - StartListening(*pSourceViewConfig); + pSourceViewConfig->AddListener(this); } /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ SwSrcEditWindow::~SwSrcEditWindow() { - EndListening(*pSourceViewConfig); + pSourceViewConfig->RemoveListener(this); delete pSourceViewConfig; aSyntaxIdleTimer.Stop(); if ( pTextEngine ) @@ -819,7 +819,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) --------------------------------------------------*/ -void SwSrcEditWindow::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) +void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { if ( rHint.ISA( TextHint ) ) { @@ -842,7 +842,11 @@ void SwSrcEditWindow::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) DoDelayedSyntaxHighlight( (USHORT)rTextHint.GetValue() ); } } - else if(&rBC == pSourceViewConfig) +} + +void SwSrcEditWindow::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal_uInt32 ) +{ + if( pBrdCst == pSourceViewConfig) SetFont(); } diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index d10ceb30e5..7114470d0e 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -44,7 +44,7 @@ #define _SVSTDARR_LONGSSORT #define _SVSTDARR_LONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svx/paperinf.hxx> #ifndef _SVX_TSTPITEM_HXX //autogen #include <svx/tstpitem.hxx> diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx index 7363907e95..3478dde394 100644 --- a/sw/source/ui/envelp/envfmt.hxx +++ b/sw/source/ui/envelp/envfmt.hxx @@ -33,7 +33,7 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <svtools/stdctrl.hxx> #ifndef _FIELD_HXX //autogen diff --git a/sw/source/ui/envelp/envimg.cxx b/sw/source/ui/envelp/envimg.cxx index c81ef6cec9..fefe09f318 100644 --- a/sw/source/ui/envelp/envimg.cxx +++ b/sw/source/ui/envelp/envimg.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,7 @@ #include <sfx2/app.hxx> #include <svx/paperinf.hxx> #include <com/sun/star/uno/Sequence.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/useroptions.hxx> #include <tools/shl.hxx> #include <swmodule.hxx> #include <errhdl.hxx> @@ -293,6 +293,9 @@ void SwEnvCfgItem::Commit() } PutProperties(aNames, aValues); } + +void SwEnvCfgItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + /* -----------------------------26.09.00 14:04-------------------------------- ---------------------------------------------------------------------------*/ diff --git a/sw/source/ui/envelp/labelcfg.cxx b/sw/source/ui/envelp/labelcfg.cxx index 32ae96881b..a5b17d1256 100644 --- a/sw/source/ui/envelp/labelcfg.cxx +++ b/sw/source/ui/envelp/labelcfg.cxx @@ -65,6 +65,9 @@ void SwLabelConfig::Commit() { // the config item is not writable yet } + +void SwLabelConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + /* -----------------------------15.01.01 11:42-------------------------------- ---------------------------------------------------------------------------*/ diff --git a/sw/source/ui/envelp/labimg.cxx b/sw/source/ui/envelp/labimg.cxx index 2fe0e20539..63a21637b4 100644 --- a/sw/source/ui/envelp/labimg.cxx +++ b/sw/source/ui/envelp/labimg.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,7 @@ #endif #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/useroptions.hxx> #include <tools/shl.hxx> #include <swmodule.hxx> #include "labimg.hxx" @@ -410,6 +410,8 @@ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) : /* -----------------------------25.09.00 16:26-------------------------------- ---------------------------------------------------------------------------*/ +void SwLabCfgItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + void SwLabCfgItem::Commit() { Sequence<OUString> aNames = GetPropertyNames(); diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx index 2e4ef15bfd..0726587513 100644 --- a/sw/source/ui/envelp/labprt.cxx +++ b/sw/source/ui/envelp/labprt.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ #include <svtools/prnsetup.hxx> -#include <svtools/cmdoptions.hxx> +#include <unotools/cmdoptions.hxx> #include <vcl/print.hxx> #include <wrtsh.hxx> #include <label.hxx> @@ -137,7 +137,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton ) if ( bEnable ) aColField.GrabFocus(); -#ifndef PRODUCT +#ifdef DBG_UTIL else ASSERT( pButton == &aPageButton, "NewButton?" ); #endif diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index c5f63855b5..de4f58fb80 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,8 +38,8 @@ #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> #include <tools/urlobj.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/pathoptions.hxx> +#include <svl/urihelper.hxx> +#include <unotools/pathoptions.hxx> #include <goodies/mailenum.hxx> #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> @@ -193,7 +193,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, aColumnFT (this, SW_RES(FT_COLUMN)), aColumnLB (this, SW_RES(LB_COLUMN)), - + aPathFT (this, SW_RES(FT_PATH)), aPathED (this, SW_RES(ED_PATH)), aPathPB (this, SW_RES(PB_PATH)), @@ -227,6 +227,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, m_aDialogSize( GetSizePixel() ) { FreeResource(); + aSingleJobsCB.Show(sal_False); // not supported in since cws printerpullpages anymore //task #97066# mailing of form letters is currently not supported aMailingRB.Show(FALSE); aSubjectFT.Show(FALSE); @@ -268,7 +269,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, &aPathFT , &aPathED , &aPathPB , - &aFilterFT , + &aFilterFT , &aFilterLB , &aColumnLB , &aAddressFldLB, @@ -347,7 +348,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, pModOpt = SW_MOD()->GetModuleConfig(); - aSingleJobsCB.Check(pModOpt->IsSinglePrintJob()); + //aSingleJobsCB.Check(pModOpt->IsSinglePrintJob());// not supported in since cws printerpullpages anymore sal_Int16 nMailingMode(pModOpt->GetMailingFormats()); aFormatSwCB.Check((nMailingMode & TXTFORMAT_OFFICE) != 0); @@ -370,9 +371,9 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, //#i63267# printing might be disabled bool bIsPrintable = !Application::GetSettings().GetMiscSettings().GetDisablePrinting(); - aPrinterRB.Enable(bIsPrintable); + aPrinterRB.Enable(bIsPrintable); OutputTypeHdl(bIsPrintable ? &aPrinterRB : &aFileRB); - + aLk = LINK(this, SwMailMergeDlg, FilenameHdl); aGenerateFromDataBaseCB.SetClickHdl( aLk ); BOOL bColumn = pModOpt->IsNameFromColumn(); @@ -455,7 +456,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, { comphelper::SequenceAsHashMap aFilter(xList->nextElement()); OUString sFilter = aFilter.getUnpackedValueOrDefault(sName, OUString()); - + uno::Any aProps = xFilterFactory->getByName(sFilter); uno::Sequence< beans::PropertyValue > aFilterProperties; aProps >>= aFilterProperties; @@ -481,7 +482,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, } catch( const uno::Exception& ) { - } + } } /*------------------------------------------------------------------------ @@ -514,7 +515,7 @@ void SwMailMergeDlg::Apply() { } /*-- 01.06.2007 13:06:50--------------------------------------------------- - + -----------------------------------------------------------------------*/ void lcl_MoveControlY( Window* ppW, long nDiffSize ) { @@ -533,15 +534,15 @@ void lcl_ChangeWidth( Window* ppW, long nDiffSize ) Size aSize( ppW->GetSizePixel()); aSize.Width() += nDiffSize; ppW->SetSizePixel( aSize ); -} +} void SwMailMergeDlg::Resize() { //the only controls that profit from the resize is pBeamerWin // and aPathED, aFilenameED and aColumnLB - + Size aCurSize( GetSizePixel() ); - //find the difference - Size aDiffSize( aCurSize.Width() - m_aDialogSize.Width(), + //find the difference + Size aDiffSize( aCurSize.Width() - m_aDialogSize.Width(), aCurSize.Height() - m_aDialogSize.Height() ); m_aDialogSize = aCurSize; if( pBeamerWin->IsVisible() ) @@ -603,7 +604,7 @@ void SwMailMergeDlg::Resize() lcl_ChangeWidth( &aPathED, aDiffSize.Width() ); lcl_ChangeWidth( &aFilterLB, aDiffSize.Width() ); lcl_ChangeWidth( &aDestFL, aDiffSize.Width() ); - + Size aBeamerSize( pBeamerWin->GetSizePixel() ) ; aBeamerSize.Width() += aDiffSize.Width(); aBeamerSize.Height() += aDiffSize.Height(); @@ -662,7 +663,7 @@ IMPL_LINK( SwMailMergeDlg, OutputTypeHdl, RadioButton *, pBtn ) IMPL_LINK( SwMailMergeDlg, SaveTypeHdl, RadioButton*, pBtn ) { bool bIndividual = pBtn == &aSaveIndividualRB; - + aGenerateFromDataBaseCB.Enable( bIndividual ); if( bIndividual ) { @@ -730,7 +731,7 @@ bool SwMailMergeDlg::ExecQryShell() } else { - nMergeType = static_cast< USHORT >( aSaveSingleDocRB.IsChecked() ? + nMergeType = static_cast< USHORT >( aSaveSingleDocRB.IsChecked() ? DBMGR_MERGE_SINGLE_FILE : DBMGR_MERGE_MAILFILES ); SfxMedium* pMedium = rSh.GetView().GetDocShell()->GetMedium(); INetURLObject aAbs; @@ -755,7 +756,7 @@ bool SwMailMergeDlg::ExecQryShell() if( aFilterLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) m_sSaveFilter = *static_cast<const ::rtl::OUString*>(aFilterLB.GetEntryData( aFilterLB.GetSelectEntryPos() )); } - else + else { //#i97667# reset column name - otherwise it's remembered from the last run pMgr->SetEMailColumn(::rtl::OUString()); @@ -765,7 +766,7 @@ bool SwMailMergeDlg::ExecQryShell() if(!sPath.Len()) return false; m_sSaveFilter = sFilter; - } + } pMgr->SetSubject(sPath); } @@ -872,7 +873,7 @@ IMPL_LINK( SwMailMergeDlg, AttachFileHdl, PushButton *, EMPTYARG ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - AbstractSvxMultiFileDialog* pFileDlg = pFact->CreateSvxMultiFileDialog( this, RID_SVXDLG_MULTIPATH); + AbstractSvxMultiFileDialog* pFileDlg = pFact->CreateSvxMultiFileDialog( this ); DBG_ASSERT(pFileDlg, "Dialogdiet fail!"); pFileDlg->SetFiles(aAttachED.GetText()); pFileDlg->SetHelpId(HID_FILEDLG_MAILMRGE2); @@ -941,4 +942,3 @@ SwMailMergeFieldConnectionsDlg::~SwMailMergeFieldConnectionsDlg() { } - diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index a8432eb6b8..47f10db6fb 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -38,15 +38,12 @@ #include <sfx2/request.hxx> #include <sfx2/frame.hxx> #include <vcl/svapp.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> +#include <svl/zformat.hxx> -#ifndef _HELPID_H #include <helpid.h> -#endif #include <swtypes.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <fldbas.hxx> #include <docufld.hxx> #include <wrtsh.hxx> @@ -63,13 +60,16 @@ #ifndef _VIEW_HXX #include <view.hxx> #endif -#include <svtools/zformat.hxx> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/util/Time.hpp> +#include <com/sun/star/util/DateTime.hpp> +#include <com/sun/star/util/Date.hpp> #define USER_DATA_VERSION_1 "1" #define USER_DATA_VERSION USER_DATA_VERSION_1 using namespace nsSwDocInfoSubType; - +using namespace com::sun::star; /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ @@ -103,7 +103,7 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) : SFX_ITEMSET_ARG( &rCoreSet, pItem, SfxUnoAnyItem, SID_DOCINFO, FALSE ); if ( pItem ) - pItem->GetValue() >>= aPropertyNames; + pItem->GetValue() >>= xCustomPropertySet; } /*-------------------------------------------------------------------- @@ -168,24 +168,31 @@ void __EXPORT SwFldDokInfPage::Reset(const SfxItemSet& ) { if (DI_CUSTOM == i) { - if (aPropertyNames.getLength() ) + if(xCustomPropertySet.is() ) { + uno::Reference< beans::XPropertySetInfo > xSetInfo = xCustomPropertySet->getPropertySetInfo(); + const uno::Sequence< beans::Property > rProperties = xSetInfo->getProperties(); +// uno::Sequence< ::rtl::OUString > aPropertyNames(rProperties.getLength()); +// for (sal_Int32 i = 0; i < rProperties.getLength(); ++i) { +// aPropertyNames[i] = rProperties[i].Name; +// } //if ( !IsFldEdit() ) + if( rProperties.getLength() ) { pInfo = aTypeTLB.InsertEntry( String(SW_RES( STR_CUSTOM )) ); pInfo->SetUserData(reinterpret_cast<void*>(USHRT_MAX)); - } - for (sal_Int32 n=0; n<aPropertyNames.getLength(); n++) - { - rtl::OUString sEntry = aPropertyNames[n]; - pEntry = aTypeTLB.InsertEntry(sEntry, pInfo); - if(m_sOldCustomFieldName.equals( sEntry )) + for (sal_Int32 n=0; n < rProperties.getLength(); n++) { - pSelEntry = pEntry; - aTypeTLB.Expand( pInfo ); + rtl::OUString sEntry = rProperties[n].Name; + pEntry = aTypeTLB.InsertEntry(sEntry, pInfo); + if(m_sOldCustomFieldName.equals( sEntry )) + { + pSelEntry = pEntry; + aTypeTLB.Expand( pInfo ); + } + pEntry->SetUserData(reinterpret_cast<void*>(i)); } - pEntry->SetUserData(reinterpret_cast<void*>(i)); } } } @@ -263,12 +270,12 @@ IMPL_LINK( SwFldDokInfPage, TypeHdl, ListBox *, EMPTYARG ) /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ - IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG ) { USHORT nSubType = (USHORT)(ULONG)pSelEntry->GetUserData(); USHORT nPos = aSelectionLB.GetSelectEntryPos(); USHORT nExtSubType; + USHORT nNewType = 0; if (nSubType != DI_EDIT) { @@ -279,7 +286,33 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG ) aFormatLB.Clear(); aFormatLB.Enable(FALSE); aFormatFT.Enable(FALSE); - return 0; + if( nSubType == DI_CUSTOM ) + { + //find out which type the custom field has - for a start set to DATE format + ::rtl::OUString sName = aTypeTLB.GetEntryText(pSelEntry); + try + { + uno::Any aVal = xCustomPropertySet->getPropertyValue( sName ); + const uno::Type& rValueType = aVal.getValueType(); + if( rValueType == ::getCppuType( (util::DateTime*)0 )) + { + nNewType = NUMBERFORMAT_DATETIME; + } + else if( rValueType == ::getCppuType( (util::Date*)0 )) + { + nNewType = NUMBERFORMAT_DATE; + } + else if( rValueType == ::getCppuType( (util::Time*)0 )) + { + nNewType = NUMBERFORMAT_TIME; + } + } + catch( const uno::Exception& ) + { + } + } + else + return 0; } nPos = 0; } @@ -290,7 +323,6 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG ) nExtSubType = DI_SUB_TIME; USHORT nOldType = 0; - USHORT nNewType = 0; BOOL bEnable = FALSE; BOOL bOneArea = FALSE; @@ -312,7 +344,6 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG ) bOneArea = TRUE; break; } - if (!nNewType) { aFormatLB.Clear(); @@ -334,7 +365,7 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG ) if (IsFldEdit()) { nPos = aSelectionLB.GetSelectEntryPos(); - if (nPos != LISTBOX_ENTRY_NOTFOUND) + if (nPos != LISTBOX_ENTRY_NOTFOUND ) { nSubType = (USHORT)(ULONG)aSelectionLB.GetEntryData(nPos); @@ -346,18 +377,21 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG ) SwWrtShell *pSh = GetWrtShell(); if(pSh) { - SvNumberFormatter* pFormatter = pSh->GetNumberFormatter(); LanguageType eLang = aFormatLB.GetCurLanguage(); if (nNewType == NUMBERFORMAT_DATE) nFormat = pFormatter->GetFormatIndex( NF_DATE_SYSTEM_SHORT, eLang); else if (nNewType == NUMBERFORMAT_TIME) - nFormat = pFormatter->GetFormatIndex( NF_TIME_HHMM, eLang); + nFormat = pFormatter->GetFormatIndex( NF_TIME_HHMM, eLang); } } aFormatLB.SetDefFormat(nFormat); } } + else if( (nSubType == DI_CUSTOM) && (nNewType != 0) ) + { + aFormatLB.SetDefFormat(nFormat); + } } aFormatLB.Enable(bEnable); diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx index 9f57450577..66e78ae64c 100644 --- a/sw/source/ui/fldui/flddinf.hxx +++ b/sw/source/ui/fldui/flddinf.hxx @@ -33,15 +33,16 @@ #include <sfx2/tabdlg.hxx> #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/group.hxx> #include <svtools/svtreebx.hxx> #include "numfmtlb.hxx" #include "fldpage.hxx" +namespace com{namespace sun{ namespace star{ namespace beans{ + class XPropertySet; +}}}} /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ @@ -57,7 +58,7 @@ class SwFldDokInfPage : public SwFldPage CheckBox aFixedCB; SvLBoxEntry* pSelEntry; - com::sun::star::uno::Sequence < ::rtl::OUString > aPropertyNames; + com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > xCustomPropertySet; String aInfoStr; diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index fa4b55af69..c8ef4e7a33 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -56,7 +56,7 @@ #include <view.hxx> #endif #include <wrtsh.hxx> -#include <svtools/zformat.hxx> +#include <svl/zformat.hxx> #include <index.hrc> diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index 2826df5dd0..ffc3e84ba7 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -226,15 +226,15 @@ SfxTabPage* SwFldEditDlg::CreatePage(USHORT nGroup) uno::Reference< beans::XPropertySet > xUDProps( xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW); - uno::Reference< beans::XPropertySetInfo > xSetInfo - = xUDProps->getPropertySetInfo(); - const uno::Sequence< beans::Property > props - = xSetInfo->getProperties(); - uno::Sequence< ::rtl::OUString > names(props.getLength()); - for (sal_Int32 i = 0; i < props.getLength(); ++i) { - names[i] = props[i].Name; - } - pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(names) ) ); +// uno::Reference< beans::XPropertySetInfo > xSetInfo +// = xUDProps->getPropertySetInfo(); +// const uno::Sequence< beans::Property > props +// = xSetInfo->getProperties(); +// uno::Sequence< ::rtl::OUString > names(props.getLength()); +// for (sal_Int32 i = 0; i < props.getLength(); ++i) { +// names[i] = props[i].Name; +// } + pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) ); pTabPage = SwFldDokInfPage::Create(this, *pSet); nHelpId = HID_EDIT_FLD_DOKINF; break; diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 67c921f011..a767990c23 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -33,7 +33,7 @@ #include <cmdid.h> #include <hintids.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/text/XDefaultNumberingProvider.hpp> @@ -53,13 +53,13 @@ #include <sfx2/app.hxx> #include <basic/basmgr.hxx> #include <svx/langitem.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <basic/sbmod.hxx> #include <fmtrfmrk.hxx> #include <basic/sbmeth.hxx> #include <basic/sbx.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/zformat.hxx> +#include <svl/zforlist.hxx> +#include <svl/zformat.hxx> #include <vcl/mnemonic.hxx> #include <view.hxx> #include <wrtsh.hxx> // Actives Fenster diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index e3a286aa0e..1c293a75f4 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -37,7 +37,7 @@ #include <vcl/lstbox.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <sfx2/request.hxx> #include <svx/htmlmode.hxx> #include <dbfld.hxx> diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx index 3e2d031c0a..e594b04e8b 100644 --- a/sw/source/ui/fldui/fldtdlg.cxx +++ b/sw/source/ui/fldui/fldtdlg.cxx @@ -48,47 +48,23 @@ #include <vcl/msgbox.hxx> #include <svx/htmlmode.hxx> #include <viewopt.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <fldwrap.hxx> -#ifndef _FLDDB_HXX #include <flddb.hxx> -#endif -#ifndef _FLDDINF_HXX #include <flddinf.hxx> -#endif -#ifndef _FLDVAR_HXX #include <fldvar.hxx> -#endif -#ifndef _FLDDOK_HXX #include <flddok.hxx> -#endif -#ifndef _FLDFUNC_HXX #include <fldfunc.hxx> -#endif -#ifndef _FLDREF_HXX #include <fldref.hxx> -#endif #include <wrtsh.hxx> #include <view.hxx> -#ifndef _FLDTDLG_HXX #include <fldtdlg.hxx> -#endif #include <swmodule.hxx> -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _FLDTDLG_HRC #include <fldtdlg.hrc> -#endif #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> @@ -245,15 +221,7 @@ SfxItemSet* SwFldDlg::CreateInputItemSet( USHORT nID ) uno::Reference< beans::XPropertySet > xUDProps( xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW); - uno::Reference< beans::XPropertySetInfo > xSetInfo - = xUDProps->getPropertySetInfo(); - const uno::Sequence< beans::Property > props - = xSetInfo->getProperties(); - uno::Sequence< ::rtl::OUString > names(props.getLength()); - for (sal_Int32 i = 0; i < props.getLength(); ++i) { - names[i] = props[i].Name; - } - pISet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(names) ) ); + pISet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) ); return pISet; } else diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index 0c3a3e070a..99a63ab894 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -52,7 +52,7 @@ #include <fldvar.hxx> #endif #include <calc.hxx> -#include <svtools/zformat.hxx> +#include <svl/zformat.hxx> #ifndef _GLOBALS_HRC #include <globals.hrc> #endif diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index 4464ac59c8..8d721a48fe 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -46,7 +46,7 @@ #include <vcl/msgbox.hxx> #endif #include <vcl/svapp.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #ifndef _VIEW_HXX #include <view.hxx> #endif diff --git a/sw/source/ui/fldui/makefile.mk b/sw/source/ui/fldui/makefile.mk index a94fdaef17..23160cf80f 100644 --- a/sw/source/ui/fldui/makefile.mk +++ b/sw/source/ui/fldui/makefile.mk @@ -80,6 +80,7 @@ SLOFILES = \ EXCEPTIONSFILES = \ $(SLO)$/fldtdlg.obj \ $(SLO)$/fldedt.obj \ + $(SLO)$/flddinf.obj \ $(SLO)$/xfldui.obj LIB1TARGET = $(SLB)$/$(TARGET).lib diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index 026a59ade1..d8f316875a 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -40,7 +40,7 @@ #ifndef _SVSTDARR_STRINGSSORTDTOR #define _SVSTDARR_STRINGSSORTDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <vcl/msgbox.hxx> #include <sfx2/viewfrm.hxx> @@ -48,7 +48,7 @@ #include <svx/flstitem.hxx> #include <svx/htmlmode.hxx> #include <svx/htmlcfg.hxx> -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> #include <numpara.hxx> #include <fmtclds.hxx> #include <swtypes.hxx> @@ -95,11 +95,11 @@ #endif #include <SwStyleNameMapper.hxx> #include <svx/svxids.hrc> -#include <svtools/stritem.hxx> -#include <svtools/aeitem.hxx> -#include <svtools/slstitm.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> +#include <svl/stritem.hxx> +#include <svl/aeitem.hxx> +#include <svl/slstitm.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> #include <svx/flagsdef.hxx> diff --git a/sw/source/ui/frmdlg/colex.cxx b/sw/source/ui/frmdlg/colex.cxx index 8b06398c80..d042ce7dca 100644 --- a/sw/source/ui/frmdlg/colex.cxx +++ b/sw/source/ui/frmdlg/colex.cxx @@ -39,7 +39,7 @@ #include <algorithm> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <svx/lrspitem.hxx> #include <svx/ulspitem.hxx> #include <svx/sizeitem.hxx> diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 7e951d1b8e..c7298118cd 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -44,7 +44,7 @@ #include <svx/lrspitem.hxx> #include <svx/sizeitem.hxx> #include "svx/frmdiritem.hxx" -#include <svtools/ctloptions.hxx> +#include <svl/ctloptions.hxx> #include <sfx2/dispatch.hxx> #include <vcl/msgbox.hxx> #include <swmodule.hxx> diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx index 91f05dc18d..359b3a595b 100644 --- a/sw/source/ui/frmdlg/frmmgr.cxx +++ b/sw/source/ui/frmdlg/frmmgr.cxx @@ -34,7 +34,7 @@ #include "cmdid.h" #include "hintids.hxx" -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <svx/protitem.hxx> #include <svx/boxitem.hxx> #include <svx/opaqitem.hxx> diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 264e0c51c9..8908f1f4a3 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -42,8 +42,8 @@ #include <hintids.hxx> #include <vcl/msgbox.hxx> #include <vcl/mnemonic.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/stritem.hxx> +#include <svl/urihelper.hxx> +#include <svl/stritem.hxx> #include <svx/impgrf.hxx> #include <svx/htmlmode.hxx> #include <svx/sizeitem.hxx> diff --git a/sw/source/ui/frmdlg/uiborder.cxx b/sw/source/ui/frmdlg/uiborder.cxx index 199521c70f..6904621557 100644 --- a/sw/source/ui/frmdlg/uiborder.cxx +++ b/sw/source/ui/frmdlg/uiborder.cxx @@ -38,10 +38,10 @@ #include <svx/svxdlg.hxx> #include <svx/svxids.hrc> #include <svx/dialogs.hrc> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <svx/flagsdef.hxx> #include <sfx2/tabdlg.hxx> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include "swtypes.hxx" #include "uiborder.hxx" diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index 36f6ed7a00..8b4771ca69 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -40,7 +40,7 @@ #include <vcl/graph.hxx> #include <svx/htmlmode.hxx> #include <sfx2/objsh.hxx> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <svx/opaqitem.hxx> #include <svx/ulspitem.hxx> #include <svx/lrspitem.hxx> diff --git a/sw/source/ui/globdoc/globdoc.cxx b/sw/source/ui/globdoc/globdoc.cxx index 3321dff7df..d759144f02 100644 --- a/sw/source/ui/globdoc/globdoc.cxx +++ b/sw/source/ui/globdoc/globdoc.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ #include <sot/clsids.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <unomid.h> diff --git a/sw/source/ui/inc/barcfg.hxx b/sw/source/ui/inc/barcfg.hxx index ca2694da67..e214a772c6 100644 --- a/sw/source/ui/inc/barcfg.hxx +++ b/sw/source/ui/inc/barcfg.hxx @@ -41,7 +41,8 @@ public: SwToolbarConfigItem( sal_Bool bWeb ); ~SwToolbarConfigItem(); - virtual void Commit(); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); void SetTopToolbar( sal_Int32 nSelType, sal_Int32 nBarId ); }; diff --git a/sw/source/ui/inc/basesh.hxx b/sw/source/ui/inc/basesh.hxx index 3d32bb8b87..9bd2ed0af3 100644 --- a/sw/source/ui/inc/basesh.hxx +++ b/sw/source/ui/inc/basesh.hxx @@ -39,7 +39,7 @@ #include <vcl/timer.hxx> #include <sfx2/module.hxx> #include <sfx2/shell.hxx> -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <mdiexp.hxx> diff --git a/sw/source/ui/inc/cfgitems.hxx b/sw/source/ui/inc/cfgitems.hxx index ee9eebdd3f..0d2cfac506 100644 --- a/sw/source/ui/inc/cfgitems.hxx +++ b/sw/source/ui/inc/cfgitems.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #define _CFGITEMS_HXX #include <tools/color.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include "swdllapi.h" #include <printdata.hxx> @@ -39,7 +39,7 @@ class SwWriterApp; class SwModule; -#ifndef PRODUCT +#ifdef DBG_UTIL class SwTestTabPage; #endif class SwAddPrinterTabPage; @@ -155,22 +155,22 @@ public: BOOL IsPrintProspect() const { return bPrintProspect; } - BOOL IsPrintProspect_RTL() const { return bPrintProspect_RTL; } + BOOL IsPrintProspectRTL() const { return bPrintProspectRTL; } void SetPrintProspect(BOOL bFlag ){ bPrintProspect = bFlag; } - void SetPrintProspect_RTL(BOOL bFlag ){ bPrintProspect_RTL = bFlag; } + void SetPrintProspectRTL(BOOL bFlag ){ bPrintProspectRTL = bFlag; } BOOL IsPrintGraphic () const { return bPrintGraphic; } BOOL IsPrintTable () const { return bPrintTable; } BOOL IsPrintDraw () const { return bPrintDraw; } BOOL IsPrintControl () const { return bPrintControl; } - BOOL IsPrintLeftPage () const { return bPrintLeftPage; } - BOOL IsPrintRightPage() const { return bPrintRightPage; } + BOOL IsPrintLeftPage () const { return bPrintLeftPages; } + BOOL IsPrintRightPage() const { return bPrintRightPages; } BOOL IsPrintReverse () const { return bPrintReverse; } BOOL IsPaperFromSetup() const { return bPaperFromSetup; } BOOL IsPrintEmptyPages() const { return bPrintEmptyPages; } BOOL IsPrintPageBackground() const { return bPrintPageBackground; } BOOL IsPrintBlackFont() const { return bPrintBlackFont; } //#i81434# - printing of hidden text - sal_Bool IsPrintHiddenText() const { return bPrintHiddenText; } + sal_Bool IsPrintHiddenText() const { return bPrintHiddenText; } sal_Bool IsPrintTextPlaceholder() const { return bPrintTextPlaceholder; } BOOL IsPrintSingleJobs() const { return bPrintSingleJobs; } @@ -207,7 +207,7 @@ public: void SetOn( BOOL bFlag ) { bOn = bFlag; } }; -#ifndef PRODUCT +#ifdef DBG_UTIL /*--------OS 12.01.95 ----------------------------------- Item fuer Einstellungsdialog - Testeinstellungen --------------------------------------------------------- */ diff --git a/sw/source/ui/inc/dbconfig.hxx b/sw/source/ui/inc/dbconfig.hxx index a47ce7fbad..ea7431a8e5 100644 --- a/sw/source/ui/inc/dbconfig.hxx +++ b/sw/source/ui/inc/dbconfig.hxx @@ -49,6 +49,8 @@ public: void Load(); const SwDBData& GetAddressSource(); const SwDBData& GetBibliographySource(); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); }; #endif diff --git a/sw/source/ui/inc/dbinsdlg.hxx b/sw/source/ui/inc/dbinsdlg.hxx index 785858e921..d6b60f1734 100644 --- a/sw/source/ui/inc/dbinsdlg.hxx +++ b/sw/source/ui/inc/dbinsdlg.hxx @@ -47,7 +47,7 @@ #include <vcl/lstbox.hxx> #include <svtools/svmedit.hxx> #include <sfx2/basedlgs.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <unotools/configitem.hxx> #include <numfmtlb.hxx> #include <swdbdata.hxx> @@ -165,8 +165,8 @@ class SwInsertDBColAutoPilot : public SfxModalDialog, public utl::ConfigItem DECL_LINK( HeaderHdl, Button* ); BOOL SplitTextToColArr( const String& rTxt, _DB_Columns& rColArr, BOOL bInsField ); - - + using SfxModalDialog::Notify; + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); virtual void Commit(); void Load(); diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx index 467cbe7023..aa5bafbf6a 100644 --- a/sw/source/ui/inc/edtwin.hxx +++ b/sw/source/ui/inc/edtwin.hxx @@ -38,7 +38,7 @@ #include <swevent.hxx> #define _SVSTDARR_STRINGSISORTDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> class SwWrtShell; class SwView; diff --git a/sw/source/ui/inc/envimg.hxx b/sw/source/ui/inc/envimg.hxx index b3d16509f5..71dfe242b1 100644 --- a/sw/source/ui/inc/envimg.hxx +++ b/sw/source/ui/inc/envimg.hxx @@ -30,7 +30,7 @@ #ifndef _ENVIMG_HXX #define _ENVIMG_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <unotools/configitem.hxx> #include "swdllapi.h" @@ -97,6 +97,7 @@ public: SwEnvItem& GetItem() {return aEnvItem;} virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); }; #endif diff --git a/sw/source/ui/inc/fldmgr.hxx b/sw/source/ui/inc/fldmgr.hxx index 6b6396409f..b2989611a5 100644 --- a/sw/source/ui/inc/fldmgr.hxx +++ b/sw/source/ui/inc/fldmgr.hxx @@ -31,7 +31,7 @@ #define _FLDMGR_HXX #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <tools/string.hxx> #include "swdllapi.h" diff --git a/sw/source/ui/inc/fontcfg.hxx b/sw/source/ui/inc/fontcfg.hxx index b72b50763f..11b854ec77 100644 --- a/sw/source/ui/inc/fontcfg.hxx +++ b/sw/source/ui/inc/fontcfg.hxx @@ -87,6 +87,7 @@ public: ~SwStdFontConfig(); virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); const String& GetFontStandard(sal_uInt8 nFontGroup) const {return sDefaultFonts[FONT_STANDARD + FONT_PER_GROUP * nFontGroup];} const String& GetFontOutline(sal_uInt8 nFontGroup) const {return sDefaultFonts[FONT_OUTLINE + FONT_PER_GROUP * nFontGroup];} diff --git a/sw/source/ui/inc/formatclipboard.hxx b/sw/source/ui/inc/formatclipboard.hxx index 523e2b3662..5d3fbdd222 100644 --- a/sw/source/ui/inc/formatclipboard.hxx +++ b/sw/source/ui/inc/formatclipboard.hxx @@ -34,9 +34,9 @@ // header for class SwWrtShell #include <wrtsh.hxx> // header for class SfxItemSet -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> // header for class SfxStyleSheetBasePool -#include <svtools/style.hxx> +#include <svl/style.hxx> //----------------------------------------------------------------------------- /** This class acts as data container and execution class for the format paintbrush feature in writer. diff --git a/sw/source/ui/inc/glosdoc.hxx b/sw/source/ui/inc/glosdoc.hxx index 355078b6d7..53ff1d9947 100644 --- a/sw/source/ui/inc/glosdoc.hxx +++ b/sw/source/ui/inc/glosdoc.hxx @@ -31,7 +31,7 @@ #define _GLOSDOC_HXX #include <tools/string.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <com/sun/star/text/XAutoTextGroup.hpp> class SwTextBlocks; diff --git a/sw/source/ui/inc/gloslst.hxx b/sw/source/ui/inc/gloslst.hxx index 729a0def10..db50b3c70f 100644 --- a/sw/source/ui/inc/gloslst.hxx +++ b/sw/source/ui/inc/gloslst.hxx @@ -35,7 +35,7 @@ #include <tools/datetime.hxx> #include <tools/string.hxx> #include <vcl/timer.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> class SwGlossaries; class SvStringsISortDtor; diff --git a/sw/source/ui/inc/label.hxx b/sw/source/ui/inc/label.hxx index f5b74db370..6cee259003 100644 --- a/sw/source/ui/inc/label.hxx +++ b/sw/source/ui/inc/label.hxx @@ -33,7 +33,7 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <sfx2/tabdlg.hxx> #include <com/sun/star/frame/XModel.hpp> diff --git a/sw/source/ui/inc/labelcfg.hxx b/sw/source/ui/inc/labelcfg.hxx index c921b40107..b0e4e79c3b 100644 --- a/sw/source/ui/inc/labelcfg.hxx +++ b/sw/source/ui/inc/labelcfg.hxx @@ -46,7 +46,8 @@ public: SwLabelConfig(); virtual ~SwLabelConfig(); - virtual void Commit(); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); void FillLabels(const rtl::OUString& rManufacturer, SwLabRecs& rLabArr); const com::sun::star::uno::Sequence<rtl::OUString>& diff --git a/sw/source/ui/inc/labimg.hxx b/sw/source/ui/inc/labimg.hxx index 0b49f10f48..e5cd139236 100644 --- a/sw/source/ui/inc/labimg.hxx +++ b/sw/source/ui/inc/labimg.hxx @@ -31,7 +31,7 @@ #ifndef _LABIMG_HXX #define _LABIMG_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <unotools/configitem.hxx> #include "swdllapi.h" @@ -126,7 +126,8 @@ public: SwLabItem& GetItem() {return aItem;} - virtual void Commit(); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); }; #endif diff --git a/sw/source/ui/inc/maildispatcher.hxx b/sw/source/ui/inc/maildispatcher.hxx index 898e715470..b88569191f 100644 --- a/sw/source/ui/inc/maildispatcher.hxx +++ b/sw/source/ui/inc/maildispatcher.hxx @@ -131,7 +131,6 @@ public: /** returns if the thread is still running */ using osl::Thread::isRunning; - bool isRunning() const; /** returns if shutdown has already been called */ @@ -167,7 +166,6 @@ private: ::rtl::Reference<MailDispatcher> m_xSelfReference; bool run_; bool shutdown_requested_; - bool bIsInRun; }; #endif // INCLUDED_MAILDISPATCHER_HXX diff --git a/sw/source/ui/inc/navicfg.hxx b/sw/source/ui/inc/navicfg.hxx index 599f5c8458..af60f5dfe2 100644 --- a/sw/source/ui/inc/navicfg.hxx +++ b/sw/source/ui/inc/navicfg.hxx @@ -50,7 +50,8 @@ public: SwNavigationConfig(); ~SwNavigationConfig(); - virtual void Commit(); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); sal_Int32 GetRootType()const {return nRootType;} void SetRootType(sal_Int32 nSet){ diff --git a/sw/source/ui/inc/navipi.hxx b/sw/source/ui/inc/navipi.hxx index 0d065db253..012ed8c8dd 100644 --- a/sw/source/ui/inc/navipi.hxx +++ b/sw/source/ui/inc/navipi.hxx @@ -35,7 +35,7 @@ #ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> #endif -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <svtools/transfer.hxx> #include <sfx2/childwin.hxx> #include <sfx2/ctrlitem.hxx> diff --git a/sw/source/ui/inc/numfmtlb.hxx b/sw/source/ui/inc/numfmtlb.hxx index 5b9fb76cb8..62cc045fe5 100644 --- a/sw/source/ui/inc/numfmtlb.hxx +++ b/sw/source/ui/inc/numfmtlb.hxx @@ -31,7 +31,7 @@ #define _SWNUMFMTLB_HXX #include <vcl/lstbox.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include "swdllapi.h" class SwView; diff --git a/sw/source/ui/inc/optcomp.hxx b/sw/source/ui/inc/optcomp.hxx index b9daacb46a..b40f0a67a6 100644 --- a/sw/source/ui/inc/optcomp.hxx +++ b/sw/source/ui/inc/optcomp.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,7 +33,7 @@ #include <sfx2/tabdlg.hxx> #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> -#include <svtools/compatibility.hxx> +#include <unotools/compatibility.hxx> #include <svx/checklbx.hxx> // class SwCompatibilityOptPage ------------------------------------------ diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx index 050ea9f54d..519b0c0fc1 100644 --- a/sw/source/ui/inc/optpage.hxx +++ b/sw/source/ui/inc/optpage.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -119,8 +119,8 @@ class SwAddPrinterTabPage : public SfxTabPage { FixedLine aFL1; CheckBox aGrfCB; - CheckBox aTabCB; - CheckBox aDrawCB; +// CheckBox aTabCB; +// CheckBox aDrawCB; CheckBox aCtrlFldCB; CheckBox aBackgroundCB; CheckBox aBlackFontCB; @@ -132,7 +132,7 @@ class SwAddPrinterTabPage : public SfxTabPage FixedLine aFL2; CheckBox aLeftPageCB; CheckBox aRightPageCB; - CheckBox aReverseCB; +// CheckBox aReverseCB; CheckBox aProspectCB; CheckBox aProspectCB_RTL; @@ -145,7 +145,7 @@ class SwAddPrinterTabPage : public SfxTabPage FixedLine aFL3; FixedLine aFL4; CheckBox aPrintEmptyPagesCB; - CheckBox aSingleJobsCB; +// CheckBox aSingleJobsCB; CheckBox aPaperFromSetupCB; FixedText aFaxFT; ListBox aFaxLB; @@ -466,7 +466,7 @@ public: TabPage Testeinstellungen fuer SW --------------------------------------------------------- */ -#ifndef PRODUCT +#ifdef DBG_UTIL class SwTestTabPage : public SfxTabPage { diff --git a/sw/source/ui/inc/prtopt.hxx b/sw/source/ui/inc/prtopt.hxx index 87943bab40..47ffc772f9 100644 --- a/sw/source/ui/inc/prtopt.hxx +++ b/sw/source/ui/inc/prtopt.hxx @@ -42,7 +42,8 @@ public: SwPrintOptions(sal_Bool bWeb); virtual ~SwPrintOptions(); - virtual void Commit(); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); virtual void doSetModified( ) { bModified = sal_True; SetModified();} SwPrintOptions& operator=(const SwPrintData& rData) diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx index f266d4b6f2..38dcd6a40d 100644 --- a/sw/source/ui/inc/pview.hxx +++ b/sw/source/ui/inc/pview.hxx @@ -222,8 +222,6 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell SW_DLLPRIVATE int ChgPage( int eMvMode, int bUpdateScrollbar = TRUE ); - SW_DLLPRIVATE virtual USHORT Print( SfxProgress &rProgress, BOOL bIsAPI, - PrintDialog *pPrintDialog = 0 ); SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); SW_DLLPRIVATE virtual USHORT SetPrinter( SfxPrinter *pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); SW_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, diff --git a/sw/source/ui/inc/redlndlg.hxx b/sw/source/ui/inc/redlndlg.hxx index 74d99eaa78..e59d1519ec 100644 --- a/sw/source/ui/inc/redlndlg.hxx +++ b/sw/source/ui/inc/redlndlg.hxx @@ -35,9 +35,9 @@ #include <tools/datetime.hxx> #include <vcl/msgbox.hxx> #ifndef _SVSTDARR_HXX -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <sfx2/basedlgs.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> diff --git a/sw/source/ui/inc/srcedtw.hxx b/sw/source/ui/inc/srcedtw.hxx index 25adc176fa..0db95e3c71 100644 --- a/sw/source/ui/inc/srcedtw.hxx +++ b/sw/source/ui/inc/srcedtw.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,8 @@ #define _SRCEDTW_HXX #include <vcl/window.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> +#include <unotools/options.hxx> #include <vcl/timer.hxx> #ifndef _TABLE_HXX //autogen @@ -46,6 +47,11 @@ class TextEngine; class ExtTextView; class DataChangedEvent; +namespace utl +{ + class SourceViewConfig; +} + class TextViewOutWin : public Window { ExtTextView* pTextView; @@ -69,7 +75,7 @@ public: //------------------------------------------------------------ namespace svt{ class SourceViewConfig;} -class SwSrcEditWindow : public Window, public SfxListener +class SwSrcEditWindow : public Window, public SfxListener, public utl::ConfigurationListener { private: ExtTextView* pTextView; @@ -80,7 +86,7 @@ private: *pVScrollbar; SwSrcView* pSrcView; - svt::SourceViewConfig* pSourceViewConfig; + utl::SourceViewConfig* pSourceViewConfig; long nCurTextWidth; USHORT nStartLine; @@ -93,7 +99,7 @@ private: Table aSyntaxLineTable; void ImpDoHighlight( const String& rSource, USHORT nLineOff ); - + using OutputDevice::SetFont; void SetFont(); @@ -114,6 +120,7 @@ protected: void DoSyntaxHighlight( USHORT nPara ); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ); DECL_LINK(ScrollHdl, ScrollBar*); diff --git a/sw/source/ui/inc/srcview.hxx b/sw/source/ui/inc/srcview.hxx index 00fb8b2995..e0a093f099 100644..100755 --- a/sw/source/ui/inc/srcview.hxx +++ b/sw/source/ui/inc/srcview.hxx @@ -28,10 +28,12 @@ * ************************************************************************/ #ifndef _SRCVIEW_HXX -#define _SRCIEW_HXX +#define _SRCVIEW_HXX #include <sfx2/viewfac.hxx> #include <sfx2/viewsh.hxx> +#include <vcl/outdev.hxx> + #include "srcedtw.hxx" #include "shellid.hxx" @@ -92,10 +94,10 @@ public: void Load(SwDocShell* pDocShell); - virtual USHORT SetPrinter( SfxPrinter* pNew, - USHORT nDiff = SFX_PRINTER_ALL, bool bIsAPI=false ); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ); - virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); + virtual USHORT SetPrinter( SfxPrinter* pNew, USHORT nDiff = SFX_PRINTER_ALL, bool bIsAPI=false ); + virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); + + sal_Int32 PrintSource( OutputDevice *pOutDev, sal_Int32 nPage, bool bCalcNumPagesOnly ); void SourceSaved() {bSourceSaved = TRUE;} BOOL HasSourceSaved() const {return bSourceSaved;} diff --git a/sw/source/ui/inc/swlbox.hxx b/sw/source/ui/inc/swlbox.hxx index 0666dbdc39..fcd59427a9 100644 --- a/sw/source/ui/inc/swlbox.hxx +++ b/sw/source/ui/inc/swlbox.hxx @@ -30,7 +30,7 @@ #ifndef _SWLBOX_HXX #define _SWLBOX_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> diff --git a/sw/source/ui/inc/swwrtshitem.hxx b/sw/source/ui/inc/swwrtshitem.hxx index 7b232ff3cb..378461021e 100644 --- a/sw/source/ui/inc/swwrtshitem.hxx +++ b/sw/source/ui/inc/swwrtshitem.hxx @@ -29,7 +29,7 @@ ************************************************************************/ #ifndef _SW_WRTSHELLITEM_HXX #define _SW_WRTSHELLITEM_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include "swdllapi.h" class SwWrtShell; diff --git a/sw/source/ui/inc/uiitems.hxx b/sw/source/ui/inc/uiitems.hxx index 43237c4258..872f023208 100644 --- a/sw/source/ui/inc/uiitems.hxx +++ b/sw/source/ui/inc/uiitems.hxx @@ -30,7 +30,7 @@ #ifndef _UIITEMS_HXX #define _UIITEMS_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include "swdllapi.h" #include "cmdid.h" #include "pagedesc.hxx" diff --git a/sw/source/ui/inc/uinums.hxx b/sw/source/ui/inc/uinums.hxx index f3faf4b302..b7c053e83f 100644 --- a/sw/source/ui/inc/uinums.hxx +++ b/sw/source/ui/inc/uinums.hxx @@ -30,7 +30,7 @@ #ifndef _UINUMS_HXX #define _UINUMS_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <numrule.hxx> #include "swdllapi.h" diff --git a/sw/source/ui/inc/unotxvw.hxx b/sw/source/ui/inc/unotxvw.hxx index 7062a4b78e..eeaf98e92b 100644 --- a/sw/source/ui/inc/unotxvw.hxx +++ b/sw/source/ui/inc/unotxvw.hxx @@ -47,7 +47,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/datatransfer/XTransferableSupplier.hpp> #include <cppuhelper/implbase8.hxx> // helper for implementations -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> #include "calbck.hxx" #include "TextCursorHelper.hxx" #include <comphelper/uno3.hxx> @@ -109,7 +109,7 @@ public: virtual void SAL_CALL removeSelectionChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener > & xListener) throw( ::com::sun::star::uno::RuntimeException ); // XFormLayerAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController > SAL_CALL getFormController( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& Form ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > SAL_CALL getFormController( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& Form ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isFormDesignMode( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setFormDesignMode( ::sal_Bool DesignMode ) throw (::com::sun::star::uno::RuntimeException); diff --git a/sw/source/ui/inc/usrpref.hxx b/sw/source/ui/inc/usrpref.hxx index 38b7b2f99a..00a328d165 100644 --- a/sw/source/ui/inc/usrpref.hxx +++ b/sw/source/ui/inc/usrpref.hxx @@ -71,6 +71,7 @@ class SwLayoutViewConfig : public utl::ConfigItem SwLayoutViewConfig(BOOL bWeb, SwMasterUsrPref& rParent); ~SwLayoutViewConfig(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); virtual void Commit(); void Load(); void SetModified(){ConfigItem::SetModified();} @@ -88,7 +89,8 @@ class SwGridConfig : public utl::ConfigItem SwGridConfig(BOOL bWeb, SwMasterUsrPref& rParent); ~SwGridConfig(); - virtual void Commit(); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); void Load(); void SetModified(){ConfigItem::SetModified();} }; @@ -104,7 +106,8 @@ class SwCursorConfig : public utl::ConfigItem SwCursorConfig(SwMasterUsrPref& rParent); ~SwCursorConfig(); - virtual void Commit(); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); void Load(); void SetModified(){ConfigItem::SetModified();} }; @@ -120,7 +123,8 @@ class SwWebColorConfig : public utl::ConfigItem SwWebColorConfig(SwMasterUsrPref& rParent); ~SwWebColorConfig(); - virtual void Commit(); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); void Load(); void SetModified(){ConfigItem::SetModified();} }; diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index 459346df23..fcce44fc6f 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -88,7 +88,7 @@ class SwPrtOptions; class SwTransferable; class SwMailMergeConfigItem; class SwTxtNode; // #i23726# -struct SwPrintData; +class SwPrintData; class SwFormatClipboard; struct SwConversionArgs; class Graphic; @@ -424,8 +424,6 @@ public: virtual USHORT SetPrinter( SfxPrinter* pNew, USHORT nDiff = SFX_PRINTER_ALL, bool bIsAPI=false); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, - BOOL bSilent, BOOL bIsAPI ); ShellModes GetShellMode(); com::sun::star::view::XSelectionSupplier* GetUNOObject(); @@ -632,10 +630,6 @@ public: //apply Accessiblity options void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions); - // get print options (SwPrtOptions) - static void MakeOptions( PrintDialog* pDlg, SwPrtOptions& rOpts, - BOOL* pPrtProspect, BOOL* pPrtProspect_RTL, BOOL bWeb, SfxPrinter* pPrt, SwPrintData* pData ); - SwView(SfxViewFrame* pFrame, SfxViewShell*); ~SwView(); @@ -692,3 +686,4 @@ SfxTabPage* CreatePrintOptionsPage( Window *pParent, BOOL bPreview); #endif + diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 34312b19bc..502d54b2d7 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -38,9 +38,9 @@ #include <rsc/rscsfx.hxx> #include <vcl/msgbox.hxx> #include <vcl/help.hxx> -#include <svtools/stritem.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/pathoptions.hxx> +#include <svl/stritem.hxx> +#include <svl/urihelper.hxx> +#include <unotools/pathoptions.hxx> #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> diff --git a/sw/source/ui/index/idxmrk.cxx b/sw/source/ui/index/idxmrk.cxx index be9d1d0e4e..956754c5c7 100644 --- a/sw/source/ui/index/idxmrk.cxx +++ b/sw/source/ui/index/idxmrk.cxx @@ -37,7 +37,7 @@ #include <helpid.h> #endif #define _SVSTDARR_STRINGSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -45,15 +45,15 @@ #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/util/SearchFlags.hpp> #include <com/sun/star/i18n/TransliterationModules.hpp> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif #include <sfx2/dispatch.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <svtools/txtcmp.hxx> #include <svx/scripttypeitem.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <svx/langitem.hxx> #include <swtypes.hxx> #include <idxmrk.hxx> @@ -78,7 +78,7 @@ #include <fldbas.hxx> #include <utlui.hrc> #include <swcont.hxx> -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> #include <ndtxt.hxx> #include <breakit.hxx> diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index f65fe57f11..812d5f1e7f 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -40,7 +40,7 @@ #include <helpid.h> #endif #define _SVSTDARR_STRINGSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -48,15 +48,15 @@ #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/util/SearchFlags.hpp> #include <com/sun/star/i18n/TransliterationModules.hpp> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif #include <sfx2/dispatch.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <svtools/txtcmp.hxx> #include <svx/scripttypeitem.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <svx/langitem.hxx> #include "svx/unolingu.hxx" #include <swtypes.hxx> @@ -82,7 +82,7 @@ #include <fldbas.hxx> #include <utlui.hrc> #include <swcont.hxx> -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> #include <ndtxt.hxx> #include <breakit.hxx> #include <SwRewriter.hxx> diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 46394469a0..ddce0b731d 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,10 +35,10 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/lingucfg.hxx> -#include <svtools/linguprops.hxx> +#include <unotools/lingucfg.hxx> +#include <unotools/linguprops.hxx> #include <svtools/filter.hxx> #include <svx/impgrf.hxx> #include <svx/svxacorr.hxx> @@ -64,12 +64,12 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/i18n/ScriptType.hpp> #include <svx/dlgutil.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <svx/langitem.hxx> #include <svx/splwrap.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> -#include <svtools/lingucfg.hxx> +#include <unotools/lingucfg.hxx> #include <svx/acorrcfg.hxx> #include <swmodule.hxx> #include <cmdid.h> @@ -92,7 +92,7 @@ // <- #111827# #include <unomid.h> -#include <svtools/languageoptions.hxx> +#include <svl/languageoptions.hxx> #include <map> #include <svtools/langtab.hxx> #include <com/sun/star/document/XDocumentLanguages.hpp> @@ -101,7 +101,7 @@ #include "swabstdlg.hxx" #include "chrdlg.hrc" #include <svx/brshitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <viewopt.hxx> #include <uitool.hxx> @@ -645,7 +645,7 @@ aInfo16( SW_RES(IMG_INFO_16) ) } InsertSeparator( nPos++ ); } - + OUString aIgnoreSelection( String( SW_RES( STR_IGNORE_SELECTION ) ) ); OUString aSpellingAndGrammar = RetrieveLabelFromCommand( C2U(".uno:SpellingAndGrammarDialog") ); SetItemText( MN_SPELLING, aSpellingAndGrammar ); diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index b38c934b7c..146e75031e 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -37,7 +37,7 @@ #include <sfx2/request.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <vcl/msgbox.hxx> diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 004b08de43..9ae7ccbd15 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -36,7 +36,7 @@ #endif -#include <svtools/style.hxx> +#include <svl/style.hxx> #include <errhdl.hxx> #include <wrtsh.hxx> #ifndef _VIEW_HXX diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index 0b66dde4d5..17250df77b 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,8 +46,8 @@ #include <unotools/transliterationwrapper.hxx> #include <unotools/tempfile.hxx> -#include <svtools/svstdarr.hxx> -#include <svtools/pathoptions.hxx> +#include <svl/svstdarr.hxx> +#include <unotools/pathoptions.hxx> #include <swtypes.hxx> #include <glosbib.hxx> #include <gloshdl.hxx> diff --git a/sw/source/ui/misc/glosdoc.cxx b/sw/source/ui/misc/glosdoc.cxx index a34c374291..6dc1fd4fd0 100644 --- a/sw/source/ui/misc/glosdoc.cxx +++ b/sw/source/ui/misc/glosdoc.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,17 +38,17 @@ #define _SVSTDARR_STRINGS #include <unotools/transliterationwrapper.hxx> -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #ifndef __RSC //autogen #include <tools/errinf.hxx> #endif #include <tools/debug.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #ifndef SVTOOLS_FSTATHELPER_HXX -#include <svtools/fstathelper.hxx> +#include <svl/fstathelper.hxx> #endif -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <unotools/tempfile.hxx> #include <swtypes.hxx> #include <errhdl.hxx> // ASSERT diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 787a04af90..10a6a2bf6c 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,11 +43,11 @@ #include <vcl/msgbox.hxx> #include <vcl/help.hxx> #ifndef _SVSTDARR_HXX -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/stritem.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/lingucfg.hxx> +#include <svl/stritem.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/lingucfg.hxx> #include <sfx2/request.hxx> #include <sfx2/fcontnr.hxx> @@ -62,7 +62,7 @@ #include <com/sun/star/ui/dialogs/XFilePicker.hpp> #include <com/sun/star/ui/dialogs/XFilterManager.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <unotools/charclass.hxx> #include <swwait.hxx> #include <swtypes.hxx> @@ -1196,7 +1196,7 @@ IMPL_LINK( SwGlossaryDlg, PathHdl, Button *, pBtn ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - AbstractSvxMultiPathDialog* pDlg = pFact->CreateSvxMultiPathDialog( pBtn, RID_SVXDLG_MULTIPATH); + AbstractSvxMultiPathDialog* pDlg = pFact->CreateSvxMultiPathDialog( pBtn ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); SvtPathOptions aPathOpt; String sGlosPath( aPathOpt.GetAutoTextPath() ); diff --git a/sw/source/ui/misc/glshell.cxx b/sw/source/ui/misc/glshell.cxx index 4156650fdc..83a97bd4c1 100644 --- a/sw/source/ui/misc/glshell.cxx +++ b/sw/source/ui/misc/glshell.cxx @@ -34,13 +34,13 @@ #include <com/sun/star/frame/XTitle.hpp> #include <tools/list.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <sfx2/printer.hxx> #include <sfx2/request.hxx> #include <sfx2/sfxsids.hrc> #include <svx/srchitem.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <gloshdl.hxx> #include <svx/acorrcfg.hxx> @@ -154,10 +154,10 @@ BOOL lcl_Save( SwWrtShell& rSh, const String& rGroupName, --------------------------------------------------------------------*/ -SwGlosDocShell::SwGlosDocShell( sal_Bool bNewShow) - : - SwDocShell( bShow ? SFX_CREATE_MODE_STANDARD : SFX_CREATE_MODE_INTERNAL ) - ,bShow ( bNewShow ) +SwGlosDocShell::SwGlosDocShell(sal_Bool bNewShow) + : SwDocShell( (bNewShow) + ? SFX_CREATE_MODE_STANDARD : SFX_CREATE_MODE_INTERNAL ) + , bShow ( bNewShow ) { SetHelpId(SW_GLOSDOCSHELL); } diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index e0f21b11cf..ac45a05afb 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -36,8 +36,8 @@ #endif #include <hintids.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <sfx2/request.hxx> #include <svx/fontitem.hxx> #include <vcl/msgbox.hxx> diff --git a/sw/source/ui/misc/insrule.cxx b/sw/source/ui/misc/insrule.cxx index 87468ba50c..03facdece9 100644 --- a/sw/source/ui/misc/insrule.cxx +++ b/sw/source/ui/misc/insrule.cxx @@ -43,7 +43,7 @@ #include <vcl/msgbox.hxx> #endif #include <svx/brshitem.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <vcl/graph.hxx> #include "swtypes.hxx" diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx index c799cb9ec9..08918c0d2b 100644 --- a/sw/source/ui/misc/linenum.cxx +++ b/sw/source/ui/misc/linenum.cxx @@ -37,7 +37,7 @@ #include <sfx2/viewfrm.hxx> -#include <svtools/style.hxx> +#include <svl/style.hxx> #include <vcl/msgbox.hxx> #include <view.hxx> #include <wrtsh.hxx> diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index e413da5580..656f076800 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -93,9 +93,9 @@ #include <SwStyleNameMapper.hxx> #include <svx/svxids.hrc> #include <svx/dialogs.hrc> -#include <svtools/stritem.hxx> -#include <svtools/aeitem.hxx> -#include <svtools/slstitm.hxx> +#include <svl/stritem.hxx> +#include <svl/aeitem.hxx> +#include <svl/slstitm.hxx> static BOOL bLastRelative = FALSE; diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 8b24c0b2d8..4440cbcde3 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -65,7 +65,7 @@ #include <uinums.hxx> #include <poolfmt.hxx> #include <shellres.hxx> -#include <svtools/style.hxx> +#include <svl/style.hxx> #include <charfmt.hxx> #include <docstyle.hxx> #include <viewopt.hxx> diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index d684116f4e..2116375b9a 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -48,10 +48,10 @@ #include <vcl/field.hxx> #include <vcl/svapp.hxx> #include <unotools/localedatawrapper.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include <svx/sizeitem.hxx> #include <svx/pageitem.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <svx/ulspitem.hxx> #include <uitool.hxx> #include <pagedesc.hxx> diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx index 59f71f1379..4b29b408b1 100644 --- a/sw/source/ui/misc/redlndlg.cxx +++ b/sw/source/ui/misc/redlndlg.cxx @@ -41,9 +41,9 @@ #include <tools/datetime.hxx> #include <vcl/msgbox.hxx> #ifndef _SVSTDARR_HXX -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> #include <svx/ctredlin.hxx> @@ -1281,7 +1281,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG ) rRedline.GetRedlineData().GetTimeStamp() ), SID_ATTR_POSTIT_DATE )); - AbstractSvxPostItDialog* pDlg = pFact->CreateSvxPostItDialog( pParentDlg, aSet, RID_SVXDLG_POSTIT, FALSE ); + AbstractSvxPostItDialog* pDlg = pFact->CreateSvxPostItDialog( pParentDlg, aSet, FALSE ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); pDlg->HideAuthor(); diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index 52c7686dc9..306e99e7dd 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -39,8 +39,8 @@ #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/intitem.hxx> -#include <svtools/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> #include <sfx2/dispatch.hxx> #include <svx/svxids.hrc> #include <svx/unolingu.hxx> diff --git a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx index d2e7d3ed2e..710185118b 100644 --- a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx +++ b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx @@ -45,9 +45,9 @@ #include <tools/datetime.hxx> #include <vcl/msgbox.hxx> #ifndef _SVSTDARR_HXX -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> #include <svx/ctredlin.hxx> diff --git a/sw/source/ui/ribbar/concustomshape.cxx b/sw/source/ui/ribbar/concustomshape.cxx index a155f1c179..32059b83f9 100644 --- a/sw/source/ui/ribbar/concustomshape.cxx +++ b/sw/source/ui/ribbar/concustomshape.cxx @@ -61,7 +61,7 @@ #ifndef _FM_FMMODEL_HXX #include <svx/fmmodel.hxx> #endif -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> #include <svx/svdpage.hxx> #include <svx/svdoashp.hxx> #include <svx/adjitem.hxx> diff --git a/sw/source/ui/ribbar/drawbase.cxx b/sw/source/ui/ribbar/drawbase.cxx index 31c75c5699..89bfd4081d 100644 --- a/sw/source/ui/ribbar/drawbase.cxx +++ b/sw/source/ui/ribbar/drawbase.cxx @@ -34,7 +34,7 @@ #include <tools/list.hxx> #include <svx/svdview.hxx> #include <svx/svdobj.hxx> -#include <svtools/ptitem.hxx> +#include <svl/ptitem.hxx> #include <svx/sizeitem.hxx> #include <sfx2/request.hxx> #include <sfx2/bindings.hxx> diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index f6763f03b2..3f129b9848 100644 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -37,8 +37,8 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> #include <svx/ruler.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/stritem.hxx> +#include <svl/zforlist.hxx> +#include <svl/stritem.hxx> #include "swtypes.hxx" #include "cmdid.h" diff --git a/sw/source/ui/ribbar/tblctrl.cxx b/sw/source/ui/ribbar/tblctrl.cxx index dd39140585..99e8bb76b7 100644 --- a/sw/source/ui/ribbar/tblctrl.cxx +++ b/sw/source/ui/ribbar/tblctrl.cxx @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <vcl/toolbox.hxx> #include <sfx2/app.hxx> diff --git a/sw/source/ui/ribbar/tbxanchr.cxx b/sw/source/ui/ribbar/tbxanchr.cxx index 2deec94563..0448bc3b5a 100644 --- a/sw/source/ui/ribbar/tbxanchr.cxx +++ b/sw/source/ui/ribbar/tbxanchr.cxx @@ -37,7 +37,7 @@ #include <vcl/timer.hxx> #include <sfx2/app.hxx> #include <svx/htmlmode.hxx> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <sfx2/dispatch.hxx> #ifndef _TOOLBOX_HXX //autogen #include <vcl/toolbox.hxx> diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx index 47f7b715dd..e692364362 100644 --- a/sw/source/ui/ribbar/workctrl.cxx +++ b/sw/source/ui/ribbar/workctrl.cxx @@ -34,7 +34,7 @@ #include <string> // HACK: prevent conflict between STLPORT and Workshop headers -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <svx/htmlmode.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/bindings.hxx> @@ -65,7 +65,7 @@ #include <helpid.h> #endif #include <wrtsh.hxx> -#include <svtools/imageitm.hxx> +#include <svl/imageitm.hxx> #include <vcl/lstbox.hxx> #include <rtl/ustring.hxx> #include "swabstdlg.hxx" diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 68b8e87c3b..443b181cbc 100755 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -57,18 +57,18 @@ #include <svx/fontitem.hxx> #include <svx/fhgtitem.hxx> #include <svx/clipfmtitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/slstitm.hxx> +#include <svl/stritem.hxx> +#include <svl/slstitm.hxx> #include <svx/colritem.hxx> #include <svx/wghtitem.hxx> #include <svx/cntritem.hxx> #include <svx/postitem.hxx> #include <svx/frmdiritem.hxx> #include <svx/svdoutl.hxx> -#include <svtools/whiter.hxx> -#include <svtools/cjkoptions.hxx> -#include <svtools/ctloptions.hxx> -#include <svtools/useroptions.hxx> +#include <svl/whiter.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> +#include <unotools/useroptions.hxx> #include <vcl/msgbox.hxx> #include <svx/flditem.hxx> #include <svx/editstat.hxx> @@ -108,18 +108,18 @@ #include <svx/dialogs.hrc> #include <svx/svxids.hrc> -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> #include <svx/outliner.hxx> #include <svx/editeng.hxx> #include <svx/editview.hxx> -#include <svtools/languageoptions.hxx> +#include <svl/languageoptions.hxx> #include <svx/langitem.hxx> #include <svtools/langtab.hxx> -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #include <docsh.hxx> -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #include "swabstdlg.hxx" //CHINA001 #include "chrdlg.hrc" //CHINA001 #include "misc.hrc" diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index ab0b64b41a..50add375c8 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -32,8 +32,8 @@ #include "precompiled_sw.hxx" #include <sot/factory.hxx> #include <hintids.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/languageoptions.hxx> +#include <svl/urihelper.hxx> +#include <svl/languageoptions.hxx> #ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> @@ -45,8 +45,8 @@ #include <sfx2/docfile.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/request.hxx> -#include <svtools/whiter.hxx> -#include <svtools/visitem.hxx> +#include <svl/whiter.hxx> +#include <svl/visitem.hxx> #include <sfx2/objitem.hxx> #include <svtools/filter.hxx> #include <svx/gallery.hxx> @@ -55,11 +55,11 @@ #include <svx/contdlg.hxx> #include <vcl/graph.hxx> #include <svx/impgrf.hxx> -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #include <vcl/msgbox.hxx> -#include <svtools/ptitem.hxx> -#include <svtools/itemiter.hxx> -#include <svtools/stritem.hxx> +#include <svl/ptitem.hxx> +#include <svl/itemiter.hxx> +#include <svl/stritem.hxx> #include <svx/colritem.hxx> #include <svx/shaditem.hxx> #include <svx/boxitem.hxx> diff --git a/sw/source/ui/shells/beziersh.cxx b/sw/source/ui/shells/beziersh.cxx index 613f3b7327..c370ebdfbe 100644 --- a/sw/source/ui/shells/beziersh.cxx +++ b/sw/source/ui/shells/beziersh.cxx @@ -35,8 +35,8 @@ #include "cmdid.h" #include <svx/svdview.hxx> #include <svx/srchitem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/whiter.hxx> +#include <svl/eitem.hxx> +#include <svl/whiter.hxx> #include <svx/svdopath.hxx> #include <sfx2/request.hxx> #include <sfx2/dispatch.hxx> diff --git a/sw/source/ui/shells/drawdlg.cxx b/sw/source/ui/shells/drawdlg.cxx index 3d3b4e688a..464c1b4e59 100644 --- a/sw/source/ui/shells/drawdlg.cxx +++ b/sw/source/ui/shells/drawdlg.cxx @@ -83,7 +83,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - SfxAbstractTabDialog *pDlg = pFact->CreateTextTabDialog( NULL, &aNewAttr, RID_SVXDLG_TEXT, pView ); + SfxAbstractTabDialog *pDlg = pFact->CreateTextTabDialog( NULL, &aNewAttr, pView ); USHORT nResult = pDlg->Execute(); if (nResult == RET_OK) @@ -111,7 +111,6 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog( NULL, &aNewAttr, pDoc, - RID_SVXDLG_AREA, pView); DBG_ASSERT(pDlg, "Dialogdiet fail!"); const SvxColorTableItem* pColorItem = (const SvxColorTableItem*) @@ -154,7 +153,6 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) SfxAbstractTabDialog * pDlg = pFact->CreateSvxLineTabDialog( NULL, &aNewAttr, pDoc, - RID_SVXDLG_LINE, pObj, bHasMarked); DBG_ASSERT(pDlg, "Dialogdiet fail!"); diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx index 9dd27332aa..cd2c4c6a17 100644 --- a/sw/source/ui/shells/drawsh.cxx +++ b/sw/source/ui/shells/drawsh.cxx @@ -35,12 +35,12 @@ #include <tools/shl.hxx> #include <svx/svdview.hxx> #include <svx/svdotext.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <svx/fontwork.hxx> #include <sfx2/request.hxx> #include <sfx2/bindings.hxx> #include <sfx2/objface.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <svx/srchitem.hxx> #include <svx/xftsfit.hxx> #include <svx/extrusionbar.hxx> diff --git a/sw/source/ui/shells/drformsh.cxx b/sw/source/ui/shells/drformsh.cxx index 59586c2a53..6ec599bc6d 100644 --- a/sw/source/ui/shells/drformsh.cxx +++ b/sw/source/ui/shells/drformsh.cxx @@ -36,7 +36,7 @@ #include <hintids.hxx> #include <svx/hlnkitem.hxx> #include <svx/svdview.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <sfx2/request.hxx> #include <sfx2/objface.hxx> #include <sfx2/app.hxx> @@ -59,7 +59,7 @@ #include "shells.hrc" #include "drwbassh.hxx" #include "drformsh.hxx" -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <view.hxx> #include <sfx2/docfile.hxx> #include <docsh.hxx> diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx index 7b3b812fc4..c5f0cb2a35 100644 --- a/sw/source/ui/shells/drwbassh.cxx +++ b/sw/source/ui/shells/drwbassh.cxx @@ -39,11 +39,11 @@ #include <sfx2/objface.hxx> #include <sfx2/request.hxx> #include <sfx2/bindings.hxx> -#include <svtools/aeitem.hxx> +#include <svl/aeitem.hxx> #include <svx/svdview.hxx> #include <vcl/msgbox.hxx> #include <svx/srchitem.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <svx/swframevalidation.hxx> #include <svx/anchorid.hxx> #include <svx/htmlmode.hxx> @@ -236,7 +236,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) if ( pFact ) { AbstractSvxCaptionDialog* pCaptionDlg = - pFact->CreateCaptionDialog( NULL, pSdrView, RID_SVXDLG_CAPTION, nAllowedAnchors ); + pFact->CreateCaptionDialog( NULL, pSdrView, nAllowedAnchors ); pCaptionDlg->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) ); pDlg = pCaptionDlg; DBG_ASSERT(pDlg, "Dialogdiet fail!"); @@ -249,7 +249,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) { AbstractSvxTransformTabDialog* pTransform = - pFact->CreateSvxTransformTabDialog( NULL, NULL, pSdrView, RID_SVXDLG_TRANSFORM, nAllowedAnchors ); + pFact->CreateSvxTransformTabDialog( NULL, NULL, pSdrView, nAllowedAnchors ); pTransform->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) ); pDlg = pTransform; DBG_ASSERT(pDlg, "Dialogdiet fail!"); @@ -565,7 +565,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractSvxObjectNameDialog* pDlg = pFact->CreateSvxObjectNameDialog(NULL, aName, RID_SVXDLG_OBJECT_NAME); + AbstractSvxObjectNameDialog* pDlg = pFact->CreateSvxObjectNameDialog(NULL, aName); OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->SetCheckNameHdl(LINK(this, SwDrawBaseShell, CheckGroupShapeNameHdl)); @@ -597,7 +597,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractSvxObjectTitleDescDialog* pDlg = pFact->CreateSvxObjectTitleDescDialog(NULL, aTitle, aDescription, RID_SVXDLG_OBJECT_TITLE_DESC); + AbstractSvxObjectTitleDescDialog* pDlg = pFact->CreateSvxObjectTitleDescDialog(NULL, aTitle, aDescription); OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx index 60059cdeb1..784fcb1f84 100644 --- a/sw/source/ui/shells/drwtxtex.cxx +++ b/sw/source/ui/shells/drwtxtex.cxx @@ -59,9 +59,9 @@ #include <svx/frmdiritem.hxx> #include <svx/svdoutl.hxx> #include <sfx2/viewfrm.hxx> -#include <svtools/whiter.hxx> -#include <svtools/cjkoptions.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/whiter.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <sfx2/bindings.hxx> #include <vcl/msgbox.hxx> #include <sfx2/dispatch.hxx> @@ -99,10 +99,10 @@ #include "misc.hrc" //modified on Jul. 30th -#include <svtools/languageoptions.hxx> +#include <svl/languageoptions.hxx> #include <svx/langitem.hxx> #include <svtools/langtab.hxx> -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #include <string.h> #include <svx/eeitem.hxx> diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index 7118acd7e7..a1012eac8c 100644 --- a/sw/source/ui/shells/drwtxtsh.cxx +++ b/sw/source/ui/shells/drwtxtsh.cxx @@ -33,8 +33,8 @@ #include <hintids.hxx> #include <i18npool/lang.h> -#include <svtools/slstitm.hxx> -#include <svtools/cjkoptions.hxx> +#include <svl/slstitm.hxx> +#include <svl/cjkoptions.hxx> #include <svx/fontitem.hxx> #include <svx/langitem.hxx> #include <svx/svdview.hxx> @@ -50,7 +50,7 @@ #include <sfx2/bindings.hxx> #include <svx/fontwork.hxx> #include <sfx2/request.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <svx/outliner.hxx> #include <svx/editstat.hxx> #include <svx/svdoutl.hxx> @@ -573,7 +573,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) { SfxAbstractTabDialog *pDlg = pFact->CreateTextTabDialog( &(GetView().GetViewFrame()->GetWindow()), - &aNewAttr, RID_SVXDLG_TEXT, pSdrView ); + &aNewAttr, pSdrView ); USHORT nResult = pDlg->Execute(); if (nResult == RET_OK) diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx index 57f2babbfb..06f5231665 100644 --- a/sw/source/ui/shells/frmsh.cxx +++ b/sw/source/ui/shells/frmsh.cxx @@ -33,15 +33,15 @@ #include <hintids.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <svtools/imapobj.hxx> #include <svx/srchitem.hxx> #include <svtools/imap.hxx> #include <sfx2/viewfrm.hxx> #include <basic/sbstar.hxx> -#include <svtools/rectitem.hxx> -#include <svtools/ptitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/rectitem.hxx> +#include <svl/ptitem.hxx> +#include <svl/stritem.hxx> #include <svx/colritem.hxx> #include <svx/bolnitem.hxx> #include <svx/boxitem.hxx> @@ -618,8 +618,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) AbstractSvxObjectTitleDescDialog* pDlg = pFact->CreateSvxObjectTitleDescDialog( NULL, aTitle, - aDescription, - RID_SVXDLG_OBJECT_TITLE_DESC ); + aDescription ); OSL_ENSURE(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() == RET_OK ) diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index e0e5ec9178..b820b319a5 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -40,9 +40,9 @@ #include <hintids.hxx> #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> -#include <svtools/stritem.hxx> -#include <svtools/whiter.hxx> -#include <svtools/urihelper.hxx> +#include <svl/stritem.hxx> +#include <svl/whiter.hxx> +#include <svl/urihelper.hxx> #include <sfx2/docfile.hxx> #include <sfx2/dispatch.hxx> diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx index bb6d1bedbf..8cf626538a 100644 --- a/sw/source/ui/shells/grfshex.cxx +++ b/sw/source/ui/shells/grfshex.cxx @@ -51,7 +51,7 @@ #endif #include <caption.hxx> #define _SVSTDARR_STRINGSSORTDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svtools/filter.hxx> #include <svx/impgrf.hxx> #include <svx/htmlmode.hxx> @@ -81,7 +81,7 @@ #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <avmedia/mediawindow.hxx> #include <vcl/svapp.hxx> diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx index 7a3c424d27..3fa52625b2 100755 --- a/sw/source/ui/shells/langhelper.cxx +++ b/sw/source/ui/shells/langhelper.cxx @@ -48,11 +48,11 @@ #include <svx/scripttypeitem.hxx> #include <svx/langitem.hxx> -#include <svtools/languageoptions.hxx> +#include <svl/languageoptions.hxx> #include <svtools/langtab.hxx> -#include <svtools/slstitm.hxx> -#include <svtools/svstdarr.hxx> -#include <svtools/stritem.hxx> +#include <svl/slstitm.hxx> +#include <svl/svstdarr.hxx> +#include <svl/stritem.hxx> #include <ndtxt.hxx> #include <pam.hxx> diff --git a/sw/source/ui/shells/listsh.cxx b/sw/source/ui/shells/listsh.cxx index 1cc1d6a145..c5190449dd 100644 --- a/sw/source/ui/shells/listsh.cxx +++ b/sw/source/ui/shells/listsh.cxx @@ -40,11 +40,11 @@ #include <sfx2/request.hxx> #include <sfx2/objface.hxx> #include <sfx2/bindings.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <tools/urlobj.hxx> -#include <svtools/whiter.hxx> -#include <svtools/intitem.hxx> +#include <svl/whiter.hxx> +#include <svl/intitem.hxx> #include <tools/shl.hxx> #include <svx/srchitem.hxx> diff --git a/sw/source/ui/shells/mediash.cxx b/sw/source/ui/shells/mediash.cxx index a823568f05..3688b33269 100644 --- a/sw/source/ui/shells/mediash.cxx +++ b/sw/source/ui/shells/mediash.cxx @@ -40,9 +40,9 @@ #include <hintids.hxx> #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> -#include <svtools/stritem.hxx> -#include <svtools/whiter.hxx> -#include <svtools/urihelper.hxx> +#include <svl/stritem.hxx> +#include <svl/whiter.hxx> +#include <svl/urihelper.hxx> #include <sfx2/dispatch.hxx> #include <svx/sizeitem.hxx> #include <svx/protitem.hxx> diff --git a/sw/source/ui/shells/slotadd.cxx b/sw/source/ui/shells/slotadd.cxx index 393823521a..6668f61d12 100644 --- a/sw/source/ui/shells/slotadd.cxx +++ b/sw/source/ui/shells/slotadd.cxx @@ -35,12 +35,12 @@ #include "uiitems.hxx" #include "cmdid.h" -#include <svtools/globalnameitem.hxx> +#include <svl/globalnameitem.hxx> -#include <svtools/imageitm.hxx> -#include <svtools/aeitem.hxx> -#include <svtools/rectitem.hxx> +#include <svl/imageitm.hxx> +#include <svl/aeitem.hxx> +#include <svl/rectitem.hxx> #include <sfx2/objitem.hxx> #include <sfx2/objsh.hxx> #include <svx/rulritem.hxx> @@ -49,7 +49,7 @@ #include <svx/zoomslideritem.hxx> #include <svx/hlnkitem.hxx> #include <svx/SmartTagItem.hxx> -#include <svtools/ptitem.hxx> +#include <svl/ptitem.hxx> #include <svx/pageitem.hxx> #include <svx/srchitem.hxx> #include <sfx2/tplpitem.hxx> @@ -130,7 +130,7 @@ #include "fmtline.hxx" #include <svx/clipfmtitem.hxx> #include <svx/blnkitem.hxx> -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #include <svx/paravertalignitem.hxx> #include <svx/charreliefitem.hxx> #include <svx/charrotateitem.hxx> diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index 014d0d460c..d86a79f0e9 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,11 +34,11 @@ #ifndef _ZFORLIST_HXX #define _ZFORLIST_DECLARE_TABLE -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #endif -#include <svtools/stritem.hxx> -#include <svtools/whiter.hxx> -#include <svtools/moduleoptions.hxx> +#include <svl/stritem.hxx> +#include <svl/whiter.hxx> +#include <unotools/moduleoptions.hxx> #include <svx/rulritem.hxx> #include <svx/srchitem.hxx> #include <svx/lrspitem.hxx> @@ -55,7 +55,7 @@ #include <svx/numinf.hxx> #include <svx/svddef.hxx> #include <svx/svxdlg.hxx> -#include <svtools/zformat.hxx> +#include <svl/zformat.hxx> #include <sfx2/bindings.hxx> #include <vcl/msgbox.hxx> #include <sfx2/request.hxx> @@ -731,7 +731,7 @@ void SwTableShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); - SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(),aCoreSet, + SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(),aCoreSet, pView->GetViewFrame()->GetFrame()->GetFrameInterface(), RC_DLG_SWNUMFMTDLG ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); @@ -965,7 +965,7 @@ void SwTableShell::Execute(SfxRequest &rReq) case FN_TABLE_INSERT_ROW_DLG: { if ( FN_TABLE_INSERT_ROW_DLG != nSlot || !rSh.IsInRepeatedHeadline()) - { + { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ::std::auto_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( GetView().GetWindow(), nSlot == FN_TABLE_INSERT_COL_DLG, nSlot) : 0); @@ -1042,7 +1042,7 @@ void SwTableShell::Execute(SfxRequest &rReq) rSh.SplitTable(pType->GetValue()) ; default: ;//wrong parameter, do nothing } - } + } else { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); diff --git a/sw/source/ui/shells/textdrw.cxx b/sw/source/ui/shells/textdrw.cxx index 622a78e195..0cb414385a 100644 --- a/sw/source/ui/shells/textdrw.cxx +++ b/sw/source/ui/shells/textdrw.cxx @@ -51,7 +51,7 @@ #include <docsh.hxx> #include <sfx2/docfile.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <avmedia/mediawindow.hxx> #include <unomid.h> diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx index 529ac59604..b0238213d9 100644 --- a/sw/source/ui/shells/textfld.cxx +++ b/sw/source/ui/shells/textfld.cxx @@ -1,7 +1,7 @@ /************ ************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,11 +38,11 @@ #include <fmtfld.hxx> #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> -#include <svtools/itempool.hxx> -#include <svtools/useroptions.hxx> -#include <svtools/whiter.hxx> -#include <svtools/eitem.hxx> -#include <svtools/macitem.hxx> +#include <svl/itempool.hxx> +#include <unotools/useroptions.hxx> +#include <svl/whiter.hxx> +#include <svl/eitem.hxx> +#include <svl/macitem.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/request.hxx> #include <svx/postattr.hxx> @@ -391,8 +391,8 @@ void SwTextShell::ExecField(SfxRequest &rReq) } break; case FN_REDLINE_COMMENT: - { - /* this code can be used once we want redline comments in the margin, all other stuff can + { + /* this code can be used once we want redline comments in the margin, all other stuff can then be deleted String sComment; const SwRedline *pRedline = rSh.GetCurrRedline(); @@ -463,7 +463,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) SvxAbstractDialogFactory* pFact2 = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact2, "Dialogdiet fail!"); - AbstractSvxPostItDialog* pDlg = pFact2->CreateSvxPostItDialog( pMDI, aSet, RID_SVXDLG_POSTIT, bTravel, TRUE ); + AbstractSvxPostItDialog* pDlg = pFact2->CreateSvxPostItDialog( pMDI, aSet, bTravel, TRUE ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); pDlg->HideAuthor(); diff --git a/sw/source/ui/shells/textglos.cxx b/sw/source/ui/shells/textglos.cxx index 257ac55680..2135e33452 100644 --- a/sw/source/ui/shells/textglos.cxx +++ b/sw/source/ui/shells/textglos.cxx @@ -33,8 +33,8 @@ #include <sfx2/request.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include "errhdl.hxx" #include "view.hxx" diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx index 9804c49239..8e88eded78 100644 --- a/sw/source/ui/shells/textidx.cxx +++ b/sw/source/ui/shells/textidx.cxx @@ -35,8 +35,8 @@ #include <vcl/msgbox.hxx> #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <svx/sizeitem.hxx> #include <fmtfsize.hxx> #include <fldbas.hxx> diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 9188b6f177..fe9cda4f7c 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -35,24 +35,24 @@ #define _SW_FRMVALID_HXX #include <hintids.hxx> -#include <svtools/globalnameitem.hxx> +#include <svl/globalnameitem.hxx> #include <sfx2/objface.hxx> #include <sfx2/lnkbase.hxx> #include <tools/errinf.hxx> #include <svx/svdview.hxx> -#include <svtools/ptitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/moduleoptions.hxx> +#include <svl/ptitem.hxx> +#include <svl/stritem.hxx> +#include <unotools/moduleoptions.hxx> #include <vcl/msgbox.hxx> #include <sfx2/fcontnr.hxx> #include <svx/hlnkitem.hxx> #include <svx/srchitem.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/docfile.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <basic/sbxvar.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <sfx2/request.hxx> #include <svx/opaqitem.hxx> #include <svx/fontitem.hxx> @@ -826,7 +826,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) case SID_INSERT_SOUND: case SID_INSERT_VIDEO: /*!SvxPluginFileDlg::IsAvailable( nWhich ) || - + discussed with mba: for performance reasons we skip the IsAvailable call here */ if ( GetShell().IsSelFrmMode() || diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 3042101976..09ba7b28cc 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -38,30 +38,30 @@ #include <helpid.h> #include <i18npool/mslangid.hxx> -#include <svtools/languageoptions.hxx> +#include <svl/languageoptions.hxx> #include <svx/langitem.hxx> #include <svtools/langtab.hxx> -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #include <string.h> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <svx/htmlmode.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/objitem.hxx> #include <vcl/msgbox.hxx> #include <vcl/unohelp2.hxx> #include <sfx2/request.hxx> -#include <svtools/eitem.hxx> -#include <svtools/macitem.hxx> +#include <svl/eitem.hxx> +#include <svl/macitem.hxx> #include <svx/lrspitem.hxx> #include <svx/ulspitem.hxx> #include <svx/colritem.hxx> #include <svx/tstpitem.hxx> #include <svx/brshitem.hxx> #include <svx/svxacorr.hxx> -#include <svtools/cjkoptions.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <IDocumentSettingAccess.hxx> #include <charfmt.hxx> #include <svx/fontitem.hxx> @@ -116,13 +116,13 @@ #include <IDocumentStatistics.hxx> #include <sfx2/sfxdlg.hxx> -#include <svtools/languageoptions.hxx> -#include <svtools/lingucfg.hxx> +#include <svl/languageoptions.hxx> +#include <unotools/lingucfg.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/uno/Any.hxx> #include <svx/unolingu.hxx> -#include <svtools/syslocaleoptions.hxx> +#include <unotools/syslocaleoptions.hxx> #include <doc.hxx> #include <view.hxx> #include <ndtxt.hxx> diff --git a/sw/source/ui/shells/textsh2.cxx b/sw/source/ui/shells/textsh2.cxx index 6fa11897ef..a56889491b 100644 --- a/sw/source/ui/shells/textsh2.cxx +++ b/sw/source/ui/shells/textsh2.cxx @@ -38,16 +38,16 @@ #endif #include <svtools/svmedit.hxx> -#include <svtools/eitem.hxx> -#include <svtools/whiter.hxx> +#include <svl/eitem.hxx> +#include <svl/whiter.hxx> #include <sfx2/event.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/viewfrm.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/stritem.hxx> -#include <svtools/itemset.hxx> +#include <svl/stritem.hxx> +#include <svl/itemset.hxx> #include <sfx2/request.hxx> #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx index fc64a6c132..29fc07107a 100644 --- a/sw/source/ui/shells/txtattr.cxx +++ b/sw/source/ui/shells/txtattr.cxx @@ -37,10 +37,10 @@ #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/whiter.hxx> -#include <svtools/stritem.hxx> -#include <svtools/itemiter.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/whiter.hxx> +#include <svl/stritem.hxx> +#include <svl/itemiter.hxx> +#include <svl/ctloptions.hxx> #include <swmodule.hxx> #include <sfx2/bindings.hxx> #include <sfx2/request.hxx> diff --git a/sw/source/ui/shells/txtcrsr.cxx b/sw/source/ui/shells/txtcrsr.cxx index 66d48d6f3f..888f5560ec 100644 --- a/sw/source/ui/shells/txtcrsr.cxx +++ b/sw/source/ui/shells/txtcrsr.cxx @@ -33,7 +33,7 @@ #include <sfx2/request.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #ifndef __SBX_SBXVARIABLE_HXX //autogen #include <basic/sbxvar.hxx> #endif diff --git a/sw/source/ui/shells/txtnum.cxx b/sw/source/ui/shells/txtnum.cxx index 3bbee67624..6b4be8da6e 100644 --- a/sw/source/ui/shells/txtnum.cxx +++ b/sw/source/ui/shells/txtnum.cxx @@ -37,8 +37,8 @@ #include <vcl/msgbox.hxx> #endif #include <sfx2/request.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <svx/numitem.hxx> #include <svx/brshitem.hxx> #include <numrule.hxx> diff --git a/sw/source/ui/smartmenu/stmenu.cxx b/sw/source/ui/smartmenu/stmenu.cxx index 0b08a7d0b8..39bd1908f8 100644 --- a/sw/source/ui/smartmenu/stmenu.cxx +++ b/sw/source/ui/smartmenu/stmenu.cxx @@ -34,7 +34,7 @@ #include "precompiled_sw.hxx" #include <stmenu.hxx> #include <com/sun/star/uno/Sequence.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <sfx2/dispatch.hxx> #include <SwSmartTagMgr.hxx> diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx index 8b80758df6..d2f0e792dd 100644 --- a/sw/source/ui/table/convert.cxx +++ b/sw/source/ui/table/convert.cxx @@ -38,7 +38,7 @@ #include <vcl/msgbox.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <sfx2/viewfrm.hxx> #include <modcfg.hxx> #include <svx/htmlmode.hxx> diff --git a/sw/source/ui/table/convert.src b/sw/source/ui/table/convert.src index 4da05104ef..ea4b4c6e87 100644 --- a/sw/source/ui/table/convert.src +++ b/sw/source/ui/table/convert.src @@ -177,7 +177,7 @@ ModalDialog DLG_CONV_TEXT_TABLE PushButton BT_AUTOFORMAT { Pos = MAP_APPFONT ( 12 , 152 ) ; - Size = MAP_APPFONT ( 66 , 14 ) ; + Size = MAP_APPFONT ( 86 , 14 ) ; TabStop = TRUE ; Hide = TRUE ; Text [ en-US ] = "Auto~Format..." ; diff --git a/sw/source/ui/table/instable.src b/sw/source/ui/table/instable.src index 58b4bbb44d..11ea4ca90c 100644 --- a/sw/source/ui/table/instable.src +++ b/sw/source/ui/table/instable.src @@ -159,7 +159,7 @@ ModalDialog DLG_INSERT_TABLE PushButton BT_AUTOFORMAT { Pos = MAP_APPFONT ( 12 , 146 ) ; - Size = MAP_APPFONT ( 66 , 14 ) ; + Size = MAP_APPFONT ( 86 , 14 ) ; TabStop = TRUE ; Text [ en-US ] = "Auto~Format..." ; }; diff --git a/sw/source/ui/table/rowht.cxx b/sw/source/ui/table/rowht.cxx index edf6938c05..00cd7fc555 100644 --- a/sw/source/ui/table/rowht.cxx +++ b/sw/source/ui/table/rowht.cxx @@ -36,8 +36,8 @@ #endif -#include <svtools/intitem.hxx> -#include <svtools/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> #include <sfx2/dispatch.hxx> #include <svx/dlgutil.hxx> diff --git a/sw/source/ui/table/swtablerep.cxx b/sw/source/ui/table/swtablerep.cxx index 082004e70d..a2bcfcb920 100644 --- a/sw/source/ui/table/swtablerep.cxx +++ b/sw/source/ui/table/swtablerep.cxx @@ -35,14 +35,14 @@ #include <hintids.hxx> #include <tools/list.hxx> #include <vcl/msgbox.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> #include <svx/htmlmode.hxx> #include <svx/keepitem.hxx> #include <svx/brkitem.hxx> #include <svx/ulspitem.hxx> #include <svx/frmdiritem.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/ctloptions.hxx> #include <swmodule.hxx> #include <fmtornt.hxx> #include <fmtpdsc.hxx> diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index c7296b1e96..b7561449a4 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -39,14 +39,14 @@ #include <hintids.hxx> #include <tools/list.hxx> #include <vcl/msgbox.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> #include <svx/htmlmode.hxx> #include <svx/keepitem.hxx> #include <svx/brkitem.hxx> #include <svx/ulspitem.hxx> #include <svx/frmdiritem.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/ctloptions.hxx> #include <swmodule.hxx> #include <fmtornt.hxx> #include <fmtpdsc.hxx> diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 1b756f47ef..44b7d8ff04 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -45,7 +45,7 @@ #include <vcl/msgbox.hxx> #endif #include <vcl/svapp.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/i18n/XBreakIterator.hpp> #include <comphelper/processfactory.hxx> diff --git a/sw/source/ui/uiview/makefile.mk b/sw/source/ui/uiview/makefile.mk index 2aa5e12e26..28ab2271a8 100644 --- a/sw/source/ui/uiview/makefile.mk +++ b/sw/source/ui/uiview/makefile.mk @@ -54,6 +54,7 @@ EXCEPTIONSFILES= \ $(SLO)$/uivwimp.obj \ $(SLO)$/view.obj \ $(SLO)$/view2.obj \ + $(SLO)$/viewprt.obj \ $(SLO)$/viewling.obj \ $(SLO)$/viewmdi.obj \ diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 385cfdeee0..0f09427a72 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -41,10 +41,11 @@ #include <vcl/cmdevt.hxx> #include <vcl/button.hxx> #include <svtools/printdlg.hxx> -#include <svtools/whiter.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/whiter.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <sfx2/printer.hxx> +#include <sfx2/progress.hxx> #include <sfx2/app.hxx> #include <sfx2/topfrm.hxx> #include <sfx2/bindings.hxx> @@ -1376,7 +1377,7 @@ void SwPagePreView::Execute( SfxRequest &rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet, RID_SVXDLG_ZOOM); + pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet); DBG_ASSERT(pDlg, "Dialogdiet fail!"); } @@ -1520,12 +1521,6 @@ MOVEPAGE: rReq.SetSlot( FN_PRINT_PAGEPREVIEW ); return; } - case FN_PREVIEW_PRINT_OPTIONS : - { - SwPreviewPrintOptionsDialog aDlg(aViewWin, *this); - aDlg.Execute(); - } - break; case SID_PRINTDOCDIRECT: case SID_PRINTDOC: ::SetAppPrintOptions( aViewWin.GetViewShell(), FALSE ); @@ -1788,7 +1783,7 @@ void SwPagePreView::Init(const SwViewOption * pPrefs) // OD 09.01.2003 #i6467# - adjust view shell option to the same as for print SwPrtOptions aPrintOptions( GetViewFrame()->GetObjectShell()->GetTitle(0) ); - SwView::MakeOptions( 0, aPrintOptions, 0, 0, false, 0, 0 ); + aPrintOptions.MakeOptions( false ); GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions ); IDocumentSettingAccess* pIDSA = pESh->getIDocumentSettingAccess(); @@ -2416,72 +2411,6 @@ void SwPagePreView::ScrollDocSzChg() // alles zum Thema Drucken -USHORT SwPagePreView::Print( SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pDlg ) -{ - ViewShell* pSh = aViewWin.GetViewShell(); - SfxPrinter* pPrinter = GetPrinter(); - if( !pPrinter || !pPrinter->InitJob( &aViewWin, - pSh->HasDrawView() && !bIsAPI && pSh->GetDrawView()->GetModel()->HasTransparentObjects() )) - return ERRCODE_IO_ABORT; - - SwWait aWait( *GetDocShell(), TRUE ); - - USHORT nRowCol = ( aViewWin.GetRow() << 8 ) + - aViewWin.GetCol(); // Zeilen / DoppelSeiten - - { - // die Felder aktualisieren - // ACHTUNG: hochcasten auf die EditShell, um die SS zu nutzen. - // In den Methoden wird auf die akt. Shell abgefragt! - SwEditShell* pESh = (SwEditShell*)pSh; - SwDocStat aDocStat; - BOOL bIsModified = pESh->IsModified(); - - pESh->StartAllAction(); - pESh->UpdateDocStat( aDocStat ); - pSh->UpdateFlds(); - pESh->EndAllAction(); - - if( !bIsModified ) - pESh->ResetModified(); - } - - // Druckauftrag starten - SfxObjectShell *pObjShell = GetViewFrame()->GetObjectShell(); - SwPrtOptions aOpts( pObjShell->GetTitle(0) ); - - BOOL bPrtPros; - BOOL bPrtPros_RTL; - SwView::MakeOptions( pDlg, aOpts, &bPrtPros, &bPrtPros_RTL, FALSE, GetPrinter(), GetDocShell()->GetDoc()->getPrintData() ); - - if( bNormalPrint ) - { - if( bPrtPros ) - pSh->PrintProspect( aOpts, rProgress, bPrtPros_RTL ); - else - pSh->Prt( aOpts, &rProgress ); - } - else - { - const SwPagePreViewPrtData* pPPVPD = pSh->GetDoc()->GetPreViewPrtData(); - if( pPPVPD && pPPVPD->GetCol() && pPPVPD->GetRow() ) - { - // Zeilen / Seiten - nRowCol = ( pPPVPD->GetRow() << 8 ) + pPPVPD->GetCol(); - } - else - pPPVPD = 0; - pSh->PrintPreViewPage( aOpts, nRowCol, rProgress, pPPVPD ); - } - - return 0; // OK -} - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SfxPrinter* SwPagePreView::GetPrinter( BOOL bCreate ) { return aViewWin.GetViewShell()->getIDocumentDeviceAccess()->getPrinter( bCreate ); @@ -2531,7 +2460,7 @@ USHORT SwPagePreView::SetPrinter( SfxPrinter *pNew, USHORT nDiffFlags, bool ) SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE, SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0 }; -#ifndef PRODUCT +#ifdef DBG_UTIL { const USHORT* pPtr = aInval + 1; do { diff --git a/sw/source/ui/uiview/pview.src b/sw/source/ui/uiview/pview.src index fa2cfa47eb..ed778b5e31 100644 --- a/sw/source/ui/uiview/pview.src +++ b/sw/source/ui/uiview/pview.src @@ -453,11 +453,6 @@ ToolBox RID_PVIEW_TOOLBOX Identifier = FN_PRINT_PAGEPREVIEW ; HelpID = FN_PRINT_PAGEPREVIEW ; }; - ToolBoxItem - { - Identifier = FN_PREVIEW_PRINT_OPTIONS ; - HelpID = FN_PREVIEW_PRINT_OPTIONS ; - }; ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; ToolBoxItem { diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 5653071d84..57b7835c4e 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -43,14 +43,14 @@ #include <vcl/wrkwin.hxx> #include <vcl/metric.hxx> #include <svtools/ctrltool.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/undo.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> +#include <unotools/pathoptions.hxx> +#include <svl/undo.hxx> #include <svtools/txtcmp.hxx> -#include <svtools/eitem.hxx> -#include <svtools/whiter.hxx> -#include <svtools/saveopt.hxx> +#include <svl/eitem.hxx> +#include <svl/whiter.hxx> +#include <unotools/saveopt.hxx> #include <svtools/transfer.hxx> #include <svx/htmlcfg.hxx> @@ -152,23 +152,23 @@ TYPEINIT1(SwSrcView, SfxViewShell) --------------------------------------------------*/ -void lcl_PrintHeader( Printer* pPrinter, USHORT nPages, USHORT nCurPage, const String& rTitle ) +void lcl_PrintHeader( OutputDevice &rOutDev, USHORT nPages, USHORT nCurPage, const String& rTitle ) { short nLeftMargin = LMARGPRN; - Size aSz = pPrinter->GetOutputSize(); + Size aSz = rOutDev.GetOutputSize(); short nBorder = BORDERPRN; - Color aOldFillColor( pPrinter->GetFillColor() ); - Font aOldFont( pPrinter->GetFont() ); + Color aOldFillColor( rOutDev.GetFillColor() ); + Font aOldFont( rOutDev.GetFont() ); - pPrinter->SetFillColor( Color(COL_TRANSPARENT) ); + rOutDev.SetFillColor( Color(COL_TRANSPARENT) ); Font aFont( aOldFont ); aFont.SetWeight( WEIGHT_BOLD ); aFont.SetAlign( ALIGN_BOTTOM ); - pPrinter->SetFont( aFont ); + rOutDev.SetFont( aFont ); - long nFontHeight = pPrinter->GetTextHeight(); + long nFontHeight = rOutDev.GetTextHeight(); // 1.Border => Strich, 2+3 Border = Freiraum. long nYTop = TMARGPRN-3*nBorder-nFontHeight; @@ -176,34 +176,34 @@ void lcl_PrintHeader( Printer* pPrinter, USHORT nPages, USHORT nCurPage, const S long nXLeft = nLeftMargin-nBorder; long nXRight = aSz.Width()-RMARGPRN+nBorder; - pPrinter->DrawRect( Rectangle( + rOutDev.DrawRect( Rectangle( Point( nXLeft, nYTop ), Size( nXRight-nXLeft, aSz.Height() - nYTop - BMARGPRN + nBorder ) ) ); long nY = TMARGPRN-2*nBorder; Point aPos( nLeftMargin, nY ); - pPrinter->DrawText( aPos, rTitle ); + rOutDev.DrawText( aPos, rTitle ); if ( nPages != 1 ) { aFont.SetWeight( WEIGHT_NORMAL ); - pPrinter->SetFont( aFont ); + rOutDev.SetFont( aFont ); String aPageStr( C2S(" [") ); aPageStr += String( SW_RES( STR_PAGE ) ); aPageStr += ' '; aPageStr += String::CreateFromInt32( nCurPage ); aPageStr += ']'; - aPos.X() += pPrinter->GetTextWidth( rTitle ); - pPrinter->DrawText( aPos, aPageStr ); + aPos.X() += rOutDev.GetTextWidth( rTitle ); + rOutDev.DrawText( aPos, aPageStr ); } nY = TMARGPRN-nBorder; - pPrinter->DrawLine( Point( nXLeft, nY ), Point( nXRight, nY ) ); + rOutDev.DrawLine( Point( nXLeft, nY ), Point( nXRight, nY ) ); - pPrinter->SetFont( aOldFont ); - pPrinter->SetFillColor( aOldFillColor ); + rOutDev.SetFont( aOldFont ); + rOutDev.SetFillColor( aOldFillColor ); } /* -----------------13.11.2003 16:24----------------- @@ -717,6 +717,7 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem, if(!bApi) + { if(bNotFoundMessage) { InfoBox( 0, SW_RES(MSG_NOT_FOUND)).Execute(); @@ -728,20 +729,18 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem, pTextView->SetSelection( TextSelection( aPaM, aPaM ) ); StartSearchAndReplace( rSearchItem, FALSE, FALSE, TRUE ); } + } } return nFound; } -/*-----------------02.07.97 09:29------------------- +/*-------------------------------------------------------------------- + Beschreibung: + --------------------------------------------------------------------*/ ---------------------------------------------------*/ USHORT SwSrcView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool ) { SwDocShell* pDocSh = GetDocShell(); - SfxPrinter* pOld = pDocSh->GetDoc()->getPrinter( false ); - if ( pOld && pOld->IsPrinting() ) - return SFX_PRINTERROR_BUSY; - if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags ) { pDocSh->GetDoc()->setPrinter( pNew, true, true ); @@ -759,114 +758,93 @@ USHORT SwSrcView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool ) } return 0; } - + /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ -ErrCode SwSrcView::DoPrint( SfxPrinter *pPrinter, PrintDialog *pDlg, BOOL bSilent, BOOL bIsAPI ) +SfxPrinter* SwSrcView::GetPrinter( BOOL bCreate ) { - SfxPrintProgress *pProgress = new SfxPrintProgress( this, !bSilent ); - SfxPrinter *pDocPrinter = GetPrinter(TRUE); - if ( !pPrinter ) - pPrinter = pDocPrinter; - else if ( pDocPrinter != pPrinter ) - { - pProgress->RestoreOnEndPrint( pDocPrinter->Clone() ); - SetPrinter( pPrinter, SFX_PRINTER_PRINTER ); - } - pProgress->SetWaitMode(FALSE); + return GetDocShell()->GetDoc()->getPrinter( bCreate ); +} - // Drucker starten - PreparePrint( pDlg ); +/*-------------------------------------------------------------------- + Beschreibung: + --------------------------------------------------------------------*/ +sal_Int32 SwSrcView::PrintSource( + OutputDevice *pOutDev, + sal_Int32 nPage, + bool bCalcNumPagesOnly ) +{ + if (!pOutDev || nPage <= 0) + return 0; - SfxViewShell::Print(*pProgress, bIsAPI, pDlg ); //??? + //! this a lgorithm for printing the n-th page is very poor since it + //! needs to go over the text of all previous pages to get to the correct one. + //! But since HTML source code is expected to be just a small number of pages + //! even this poor algorithm should be enough... - MapMode eOldMapMode( pPrinter->GetMapMode() ); - Font aOldFont( pPrinter->Printer::GetFont() ); + pOutDev->Push(); TextEngine* pTextEngine = aEditWin.GetTextEngine(); - pPrinter->SetMapMode(MAP_100TH_MM); - Font aFont(aEditWin.GetOutWin()->GetFont()); - Size aSize(aFont.GetSize()); - aSize = aEditWin.GetOutWin()->PixelToLogic(aSize, MAP_100TH_MM); - aFont.SetSize(aSize); - aFont.SetColor(COL_BLACK); - pPrinter->SetFont( aFont ); + pOutDev->SetMapMode( MAP_100TH_MM ); + Font aFont( aEditWin.GetOutWin()->GetFont() ); + Size aSize( aFont.GetSize() ); + aSize = aEditWin.GetOutWin()->PixelToLogic( aSize, MAP_100TH_MM ); + aFont.SetSize( aSize ); + aFont.SetColor( COL_BLACK ); + pOutDev->SetFont( aFont ); String aTitle( GetViewFrame()->GetWindow().GetText() ); - USHORT nLineHeight = (USHORT) pPrinter->GetTextHeight(); // etwas mehr. + USHORT nLineHeight = (USHORT) pOutDev->GetTextHeight(); // etwas mehr. USHORT nParaSpace = 10; - Size aPaperSz = pPrinter->GetOutputSize(); - aPaperSz.Width() -= (LMARGPRN+RMARGPRN); - aPaperSz.Height() -= (TMARGPRN+BMARGPRN); + Size aPaperSz = pOutDev->GetOutputSize(); + aPaperSz.Width() -= (LMARGPRN + RMARGPRN); + aPaperSz.Height() -= (TMARGPRN + BMARGPRN); // nLinepPage stimmt nicht, wenn Zeilen umgebrochen werden muessen... - USHORT nLinespPage = (USHORT) (aPaperSz.Height()/nLineHeight); - USHORT nCharspLine = (USHORT) (aPaperSz.Width() / pPrinter->GetTextWidth( 'X' )); + USHORT nLinespPage = (USHORT) (aPaperSz.Height() / nLineHeight); + USHORT nCharspLine = (USHORT) (aPaperSz.Width() / pOutDev->GetTextWidth( 'X' )); USHORT nParas = static_cast< USHORT >( pTextEngine->GetParagraphCount() ); - USHORT nPages = (USHORT) (nParas/nLinespPage+1 ); + USHORT nPages = (USHORT) (nParas / nLinespPage + 1 ); USHORT nCurPage = 1; - BOOL bStartJob = pPrinter->StartJob( aTitle ); - if( bStartJob ) + // Header drucken... + if (!bCalcNumPagesOnly && nPage == nCurPage) + lcl_PrintHeader( *pOutDev, nPages, nCurPage, aTitle ); + const Point aStartPos( LMARGPRN, TMARGPRN ); + Point aPos( aStartPos ); + for ( USHORT nPara = 0; nPara < nParas; ++nPara ) { - pPrinter->StartPage(); - // Header drucken... - lcl_PrintHeader( pPrinter, nPages, nCurPage, aTitle ); - Point aPos( LMARGPRN, TMARGPRN ); - for ( USHORT nPara = 0; nPara < nParas; nPara++ ) + String aLine( pTextEngine->GetText( nPara ) ); + lcl_ConvertTabsToSpaces( aLine ); + USHORT nLines = aLine.Len() / nCharspLine + 1; + for ( USHORT nLine = 0; nLine < nLines; ++nLine ) { - String aLine( pTextEngine->GetText( nPara ) ); - lcl_ConvertTabsToSpaces( aLine ); - USHORT nLines = aLine.Len()/nCharspLine+1; - for ( USHORT nLine = 0; nLine < nLines; nLine++ ) + String aTmpLine( aLine, nLine * nCharspLine, nCharspLine ); + aPos.Y() += nLineHeight; + if ( aPos.Y() > ( aPaperSz.Height() + TMARGPRN - nLineHeight/2 ) ) { - String aTmpLine( aLine, nLine*nCharspLine, nCharspLine ); - aPos.Y() += nLineHeight; - if ( aPos.Y() > ( aPaperSz.Height()+TMARGPRN ) ) - { - nCurPage++; - pPrinter->EndPage(); - pPrinter->StartPage(); - lcl_PrintHeader( pPrinter, nPages, nCurPage, aTitle ); - aPos = Point( LMARGPRN, TMARGPRN+nLineHeight ); - } - pPrinter->DrawText( aPos, aTmpLine ); + ++nCurPage; + if (!bCalcNumPagesOnly && nPage == nCurPage) + lcl_PrintHeader( *pOutDev, nPages, nCurPage, aTitle ); + aPos = aStartPos; } - aPos.Y() += nParaSpace; + if (!bCalcNumPagesOnly && nPage == nCurPage) + pOutDev->DrawText( aPos, aTmpLine ); } - pPrinter->EndPage(); - } - - pPrinter->SetFont( aOldFont ); - pPrinter->SetMapMode( eOldMapMode ); - - if ( !bStartJob ) - { - // Printer konnte nicht gestartet werden - delete pProgress; - return ERRCODE_IO_ABORT; + aPos.Y() += nParaSpace; } + + pOutDev->Pop(); - pProgress->Stop(); - pProgress->DeleteOnEndPrint(); - pPrinter->EndJob(); - return pPrinter->GetError(); + DBG_ASSERT( bCalcNumPagesOnly || nPage <= nCurPage, "page number out of range" ); + return nCurPage; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - -SfxPrinter* SwSrcView::GetPrinter( BOOL bCreate ) -{ - return GetDocShell()->GetDoc()->getPrinter( bCreate ); -} /*-------------------------------------------------------------------- Beschreibung: diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 191ff8ac0d..0ccb309100 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -40,11 +40,11 @@ #include <vcl/graph.hxx> #include <vcl/inputctx.hxx> #include <basic/sbxobj.hxx> -#include <svtools/eitem.hxx> -#include <svtools/undoopt.hxx> -#include <svtools/lingucfg.hxx> +#include <svl/eitem.hxx> +#include <unotools/undoopt.hxx> +#include <unotools/lingucfg.hxx> #include <svtools/printdlg.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/useroptions.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/request.hxx> #include <sfx2/docfile.hxx> @@ -1920,53 +1920,6 @@ void SwView::NotifyDBChanged() Beschreibung: Drucken --------------------------------------------------------------------*/ -void SwView::MakeOptions( PrintDialog* pDlg, SwPrtOptions& rOpts, - BOOL* pPrtProspect, BOOL* pPrtProspect_RTL, BOOL bWeb, SfxPrinter* pPrt, SwPrintData* pData ) -{ - SwAddPrinterItem* pAddPrinterAttr; - if( pPrt && SFX_ITEM_SET == pPrt->GetOptions().GetItemState( - FN_PARAM_ADDPRINTER, FALSE, (const SfxPoolItem**)&pAddPrinterAttr )) - { - pData = pAddPrinterAttr; - } - else if(!pData) - { - pData = SW_MOD()->GetPrtOptions(bWeb); - } - rOpts = *pData; - if( pPrtProspect ) - *pPrtProspect = pData->bPrintProspect; - if( pPrtProspect_RTL ) - *pPrtProspect_RTL = pData->bPrintProspect_RTL; - rOpts.aMulti.SetTotalRange( Range( 0, RANGE_MAX ) ); - rOpts.aMulti.SelectAll( FALSE ); - rOpts.nCopyCount = 1; - rOpts.bCollate = FALSE; - rOpts.bPrintSelection = FALSE; - rOpts.bJobStartet = FALSE; - - if ( pDlg ) - { - rOpts.nCopyCount = pDlg->GetCopyCount(); - rOpts.bCollate = pDlg->IsCollateChecked(); - if ( pDlg->GetCheckedRange() == PRINTDIALOG_SELECTION ) - { - rOpts.aMulti.SelectAll(); - rOpts.bPrintSelection = TRUE; - } - else if ( PRINTDIALOG_ALL == pDlg->GetCheckedRange() ) - rOpts.aMulti.SelectAll(); - else - { - rOpts.aMulti = MultiSelection( pDlg->GetRangeText() ); - rOpts.aMulti.SetTotalRange( Range( 0, RANGE_MAX ) ); - } - } - else - rOpts.aMulti.SelectAll(); - rOpts.aMulti.Select( 0, FALSE ); -} - /* -----------------------------28.10.02 13:25-------------------------------- ---------------------------------------------------------------------------*/ @@ -1995,3 +1948,20 @@ void SwView::AddTransferable(SwTransferable& rTransferable) { GetViewImpl()->AddTransferable(rTransferable); } + +/* --------------------------------------------------*/ + +void SwPrtOptions::MakeOptions( BOOL bWeb ) +{ + *this = *SW_MOD()->GetPrtOptions(bWeb); + + nCopyCount = 1; + bCollate = FALSE; + bPrintSelection = FALSE; + bJobStartet = FALSE; + + aMulti.SetTotalRange( Range( 0, RANGE_MAX ) ); + aMulti.SelectAll(); + aMulti.Select( 0, FALSE ); +} + diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx index d005588603..bf8bf5a2b6 100644 --- a/sw/source/ui/uiview/view0.cxx +++ b/sw/source/ui/uiview/view0.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,14 +38,14 @@ #include <svx/galbrws.hxx> #include <svx/srchitem.hxx> #include <SwSpellDialogChildWindow.hxx> -#include <svtools/eitem.hxx> -#include <svtools/linguprops.hxx> -#include <svtools/lingucfg.hxx> +#include <svl/eitem.hxx> +#include <unotools/linguprops.hxx> +#include <unotools/lingucfg.hxx> #include <viewopt.hxx> #include <globals.h> #include <sfx2/app.hxx> #include <sfx2/request.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <svx/srchdlg.hxx> #include <sfx2/templdlg.hxx> #include <uivwimp.hxx> @@ -99,7 +99,7 @@ using namespace ::com::sun::star; using ::rtl::OUString; -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <IDocumentSettingAccess.hxx> @@ -275,7 +275,7 @@ void SwView::StateViewOptions(SfxItemSet &rSet) aBool.SetValue( SwViewOption::IsTableBoundaries() ); break; case FN_VIEW_NOTES: { - aBool.SetValue( pOpt->IsPostIts()); + aBool.SetValue( pOpt->IsPostIts()); if (!GetPostItMgr()->HasNotes()) { aBool.SetWhich( nWhich ); @@ -400,7 +400,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq) case FN_VIEW_NOTES: if ( STATE_TOGGLE == eState ) bFlag = !pOpt->IsPostIts(); - + GetPostItMgr()->SetLayout(); pOpt->SetPostIts( bFlag ); if (pOpt->IsPostIts()) @@ -502,7 +502,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq) if (pDoc && bIsAutoGrammar) StartGrammarChecking( *pDoc ); - } + } } break; case FN_SHADOWCURSOR: @@ -537,7 +537,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq) rSh.ResetModified(); pModule->ApplyUsrPref( *pOpt, this, bWebView ? VIEWOPT_DEST_WEB : VIEWOPT_DEST_TEXT ); - + //mod #i6193# let postits know about new spellcheck setting if ( nSlot == SID_AUTOSPELL_CHECK ) GetPostItMgr()->SetSpellChecking(); diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 82587eb23c..cac139f875 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -40,8 +40,8 @@ #define _SVSTDARR_STRINGSSORTDTOR -#include <svtools/svstdarr.hxx> -#include <svtools/aeitem.hxx> +#include <svl/svstdarr.hxx> +#include <svl/aeitem.hxx> #include <SwStyleNameMapper.hxx> #include <docary.hxx> @@ -50,8 +50,8 @@ #include <undobj.hxx> #include <swundo.hxx> #include <caption.hxx> -#include <svtools/PasswordHelper.hxx> -#include <svtools/urihelper.hxx> +#include <svl/PasswordHelper.hxx> +#include <svl/urihelper.hxx> #include <sfx2/passwd.hxx> #include <sfx2/sfxdlg.hxx> #include <sfx2/filedlghelper.hxx> @@ -78,8 +78,8 @@ #include <svx/sizeitem.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/topfrm.hxx> -#include <svtools/whiter.hxx> -#include <svtools/ptitem.hxx> +#include <svl/whiter.hxx> +#include <svl/ptitem.hxx> #include <svx/linkmgr.hxx> #include <tools/errinf.hxx> #include <tools/urlobj.hxx> @@ -1605,7 +1605,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet, RID_SVXDLG_ZOOM); + pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet); DBG_ASSERT(pDlg, "Dialogdiet fail!"); } diff --git a/sw/source/ui/uiview/viewcoll.cxx b/sw/source/ui/uiview/viewcoll.cxx index 08647e0b4a..1688c3dfe7 100644 --- a/sw/source/ui/uiview/viewcoll.cxx +++ b/sw/source/ui/uiview/viewcoll.cxx @@ -39,7 +39,7 @@ #include <vcl/window.hxx> #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <rsc/rscsfx.hxx> diff --git a/sw/source/ui/uiview/viewdlg.cxx b/sw/source/ui/uiview/viewdlg.cxx index 01df8db671..8b715474ce 100644 --- a/sw/source/ui/uiview/viewdlg.cxx +++ b/sw/source/ui/uiview/viewdlg.cxx @@ -36,7 +36,7 @@ #include "hintids.hxx" #include <sfx2/viewfrm.hxx> #include <svx/tstpitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <sfx2/request.hxx> diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx index 6be34b4953..9ab1df6a91 100644 --- a/sw/source/ui/uiview/viewdraw.cxx +++ b/sw/source/ui/uiview/viewdraw.cxx @@ -33,8 +33,8 @@ #include "hintids.hxx" -#include <svtools/aeitem.hxx> -#include <svtools/itempool.hxx> +#include <svl/aeitem.hxx> +#include <svl/itempool.hxx> #include <svx/svdobj.hxx> #include <svx/svdview.hxx> #include <svx/svdpage.hxx> diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx index 304457a828..92a6cc8fcb 100644 --- a/sw/source/ui/uiview/viewling.cxx +++ b/sw/source/ui/uiview/viewling.cxx @@ -36,7 +36,7 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/linguistic2/XThesaurus.hpp> @@ -47,7 +47,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <vcl/msgbox.hxx> #include <svtools/ehdl.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/request.hxx> #include <svx/dlgutil.hxx> diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx index 4f3870c559..46b7e12a2e 100644 --- a/sw/source/ui/uiview/viewprt.cxx +++ b/sw/source/ui/uiview/viewprt.cxx @@ -43,25 +43,27 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #include <sfx2/request.hxx> +#include <sfx2/progress.hxx> #include <sfx2/app.hxx> -#include <svtools/flagitem.hxx> +#include <svl/flagitem.hxx> #include <vcl/msgbox.hxx> +#include <vcl/oldprintadaptor.hxx> #include <svtools/printdlg.hxx> #include <sfx2/printer.hxx> #include <sfx2/prnmon.hxx> #include <svx/paperinf.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/misccfg.hxx> +#include <unotools/misccfg.hxx> #include <svx/prtqry.hxx> #include <svx/svdview.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/flagitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/flagitem.hxx> #include <svx/linkmgr.hxx> #include <modcfg.hxx> @@ -85,10 +87,10 @@ #include <globals.hrc> #include <view.hrc> #include <app.hrc> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <swwrtshitem.hxx> #include "swabstdlg.hxx" -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #include <unomid.h> @@ -175,284 +177,6 @@ USHORT __EXPORT SwView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool ) } /*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -ErrCode SwView::DoPrint( SfxPrinter *pPrinter, PrintDialog *pDlg, BOOL bSilent, BOOL bIsAPI ) -{ - // First test - SwWrtShell* pSh = &GetWrtShell(); - SwNewDBMgr* pMgr = pSh->GetNewDBMgr(); - - int bPrintSelection = -1; - USHORT nMergeType = pMgr->GetMergeType(); - if( DBMGR_MERGE_MAILMERGE != nMergeType && - DBMGR_MERGE_DOCUMENTS != nMergeType && - !pDlg && - !bIsAPI && ( pSh->IsSelection() || pSh->IsFrmSelected() || - pSh->IsObjSelected() ) ) - { - short nBtn = SvxPrtQryBox(&GetEditWin()).Execute(); - if( RET_CANCEL == nBtn ) - return ERRCODE_IO_ABORT; - - if( RET_OK == nBtn ) - bPrintSelection = 1; - else - bPrintSelection = 0; - } - -// Der PrintProgress stellt Handler am Printer der ViewShell ein. -// Das kann natuerlich erste nach dem evtl. Umschalten des Druckers korrekt -// funktionieren. #55210# -// SfxPrintProgress *pProgress = new SfxPrintProgress( this, !bSilent ); - SfxPrintProgress *pProgress = 0; - SfxPrinter *pDocPrinter = GetPrinter(TRUE); - if ( !pPrinter ) - pPrinter = pDocPrinter; - else if ( pDocPrinter != pPrinter ) - { - //Da der Doc-Drucker beim SetPrinter geloescht wird, - // muss man ihn vorher clonen - SfxPrinter* pClone = pDocPrinter->Clone(); - SetPrinter( pPrinter, SFX_PRINTER_PRINTER ); - pProgress = new SfxPrintProgress( this, !bSilent ); - pProgress->RestoreOnEndPrint( pClone ); - } - if(!pProgress) - pProgress = new SfxPrintProgress( this, !bSilent ); - pProgress->SetWaitMode(FALSE); - - BOOL bStartJob = pPrinter->InitJob( &GetEditWin(), - !bIsAPI && pSh->HasDrawView() && pSh->GetDrawView()->GetModel()->HasTransparentObjects()); - if( bStartJob ) - { - // Drucker starten - PreparePrint( pDlg ); - SfxObjectShell *pObjShell = GetViewFrame()->GetObjectShell(); - //#i82625# GetTitle( 0 ) doesn't work for 'embedded' documents like forms or reports - String sDocumentTitle( pObjShell->GetTitle(SFX_TITLE_APINAME)); - SwPrtOptions aOpts( sDocumentTitle ); - BOOL bWeb = 0 != PTR_CAST(SwWebView, this); - nMergeType = pMgr->GetMergeType(); - - BOOL bPrtPros; - BOOL bPrtPros_RTL; - SwView::MakeOptions( pDlg, aOpts, &bPrtPros, &bPrtPros_RTL, bWeb, GetPrinter(), - pSh->getIDocumentDeviceAccess()->getPrintData() ); - - //set the appropriate view options to print - //on silent mode the field commands have to be switched off always - //on default print the user is asked what to do - const SwViewOption* pCurrentViewOptions = pSh->GetViewOptions(); - bool bSwitchOff_IsFldName = pCurrentViewOptions->IsFldName() && pSh->IsAnyFieldInDoc(); - - if(!bSilent && bSwitchOff_IsFldName) - { - QueryBox aBox( &GetEditWin(), SW_RES( DLG_PRT_FIELDNAME ) ); - USHORT nRet = aBox.Execute(); - if( RET_CANCEL == nRet) - return ERRCODE_IO_ABORT; - // disable field commands - if( RET_NO != nRet ) - { - bSwitchOff_IsFldName = false; - } - } - bool bApplyViewOptions = bSwitchOff_IsFldName; - //switch off display of hidden characters if on and hidden characters are in use - const sal_Bool bOldShowHiddenChar = pCurrentViewOptions->IsShowHiddenChar(); - const sal_Bool bOldMetaChars = pCurrentViewOptions->IsViewMetaChars(); - if( bOldShowHiddenChar != aOpts.IsPrintHiddenText() - && pSh->GetDoc()->ContainsHiddenChars()) - bApplyViewOptions |= true; - //switch off display of hidden paragraphs if on and hidden paragraphs are in use - const sal_Bool bOldShowHiddenPara = pCurrentViewOptions->IsShowHiddenPara(); - if( aOpts.IsPrintHiddenText() != bOldShowHiddenPara ) - { - const SwFieldType* pFldType = pSh->GetDoc()->GetSysFldType(RES_HIDDENPARAFLD); - if( pFldType && pFldType->GetDepends()) - bApplyViewOptions |= true; - } - const sal_Bool bOldShowHiddenField = pCurrentViewOptions->IsShowHiddenField(); - if( aOpts.IsPrintHiddenText() != bOldShowHiddenField ) - { - const SwFieldType* pFldType = pSh->GetDoc()->GetSysFldType(RES_HIDDENTXTFLD); - if( pFldType || pFldType->GetDepends()) - bApplyViewOptions |= true; - } - - SwViewOption* pOrgViewOption = 0; - bApplyViewOptions |= !aOpts.IsPrintTextPlaceholder(); - if(bApplyViewOptions) - { - pOrgViewOption = new SwViewOption(*pSh->GetViewOptions()); - if(bSwitchOff_IsFldName) - pOrgViewOption->SetFldName(aOpts.IsPrintHiddenText()); - - pOrgViewOption->SetShowHiddenChar(aOpts.IsPrintHiddenText()); - pOrgViewOption->SetViewMetaChars(sal_True); - pOrgViewOption->SetShowHiddenPara(aOpts.IsPrintHiddenText()); - pOrgViewOption->SetShowHiddenField(aOpts.IsPrintHiddenText()); - pOrgViewOption->SetShowPlaceHolderFields( aOpts.bPrintTextPlaceholder ); - - SW_MOD()->ApplyUsrPref(*pOrgViewOption, this, VIEWOPT_DEST_VIEW_ONLY ); - } - - if( nMergeType == DBMGR_MERGE_MAILMERGE || - DBMGR_MERGE_DOCUMENTS == nMergeType ) - { - if(DBMGR_MERGE_DOCUMENTS == nMergeType) - bStartJob = pMgr->MergePrintDocuments( *this, aOpts, *pProgress, bIsAPI ); - else - bStartJob = pMgr->MergePrint( *this, aOpts, *pProgress, bIsAPI ); - } - else - { - const BOOL bLockedView = pSh->IsViewLocked(); - pSh->LockView( TRUE ); - - //BrowseView abschalten und die View gegen alle Paints locken. - BOOL bBrowse = pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); - SfxAllItemSet aSet( SFX_APP()->GetPool() ); - SfxBoolItem aBrowse( SID_BROWSER_MODE, FALSE ); - if ( bBrowse ) - { - if ( pSh->GetWin() ) - pSh->GetWin()->Update(); - pSh->LockPaint(); - aSet.Put( aBrowse, aBrowse.Which() ); - SfxRequest aReq( SID_BROWSER_MODE, 0, aSet ); - GetDocShell()->Execute( aReq ); - } - - // die Felder aktualisieren - BOOL bIsModified = pSh->IsModified(); - pSh->StartAllAction(); - SwDocStat aDocStat; - pSh->UpdateDocStat( aDocStat ); - pSh->EndAllTblBoxEdit(); - pSh->ViewShell::UpdateFlds(TRUE); - if( pSh->IsCrsrInTbl() ) - { - pSh->ClearTblBoxCntnt(); - pSh->SaveTblBoxCntnt(); - } - pSh->EndAllAction(); - - if( !bIsModified ) - pSh->ResetModified(); - - if( -1 != bPrintSelection ) - aOpts.bPrintSelection = 0 != bPrintSelection; - - uno::Sequence< beans::PropertyValue> aViewProperties(18); - beans::PropertyValue* pViewProperties = aViewProperties.getArray(); - pViewProperties[1].Name = C2U("PrintGraphics"); - pViewProperties[1].Value <<= (sal_Bool)aOpts.IsPrintGraphic(); - pViewProperties[2].Name = C2U("PrintTables"); - pViewProperties[2].Value <<= (sal_Bool)aOpts.IsPrintTable(); - pViewProperties[3].Name = C2U("PrintDrawings"); - pViewProperties[3].Value <<= (sal_Bool)aOpts.IsPrintDraw(); - pViewProperties[4].Name = C2U("PrintLeftPages"); - pViewProperties[4].Value <<= (sal_Bool)aOpts.IsPrintLeftPage(); - pViewProperties[5].Name = C2U("PrintRightPages"); - pViewProperties[5].Value <<= (sal_Bool)aOpts.IsPrintRightPage(); - pViewProperties[6].Name = C2U("PrintControls"); - pViewProperties[6].Value <<= (sal_Bool)aOpts.IsPrintControl(); - pViewProperties[7].Name = C2U("PrintReversed"); - pViewProperties[7].Value <<= (sal_Bool)aOpts.IsPrintReverse(); - pViewProperties[8].Name = C2U("PrintPaperFromSetup"); - pViewProperties[8].Value <<= (sal_Bool)aOpts.IsPaperFromSetup(); - pViewProperties[9].Name = C2U("PrintFaxName"); - pViewProperties[9].Value <<= aOpts.GetFaxName(); - pViewProperties[10].Name = C2U("PrintAnnotationMode"); - pViewProperties[10].Value <<= (text::NotePrintMode) aOpts.GetPrintPostIts(); - pViewProperties[11].Name = C2U("PrintProspect"); - pViewProperties[11].Value <<= (sal_Bool)aOpts.IsPrintProspect(); - pViewProperties[12].Name = C2U("PrintPageBackground"); - pViewProperties[12].Value <<= (sal_Bool)aOpts.IsPrintPageBackground(); - pViewProperties[13].Name = C2U("PrintBlackFonts"); - pViewProperties[13].Value <<= (sal_Bool)aOpts.IsPrintBlackFont(); - pViewProperties[0].Name = C2U("IsSinglePrintJob"); - pViewProperties[0].Value <<= (sal_Bool)aOpts.IsPrintSingleJobs(); - pViewProperties[14].Name = C2U("Selection"); - pViewProperties[14].Value <<= (sal_Bool)aOpts.bPrintSelection; - pViewProperties[15].Name = C2U("PrintEmptyPages"); - pViewProperties[15].Value <<= (sal_Bool)aOpts.bPrintEmptyPages; - pViewProperties[16].Name = C2U("PrintHiddenText"); - pViewProperties[16].Value <<= (sal_Bool)aOpts.bPrintHiddenText; - pViewProperties[17].Name = C2U("PrintTextPlaceholder"); - pViewProperties[17].Value <<= (sal_Bool)aOpts.bPrintTextPlaceholder; - SetAdditionalPrintOptions(aViewProperties); - - SfxViewShell::Print(*pProgress, bIsAPI ); - if ( !pProgress->IsAborted() ) - { - if( bPrtPros ) - { - bStartJob = pPrinter->StartJob( aOpts.GetJobName() ); - if( bStartJob ) - pSh->PrintProspect( aOpts, *pProgress, bPrtPros_RTL ); - } - else - bStartJob = pSh->Prt( aOpts, pProgress ); - - if ( bBrowse ) - { - aBrowse.SetValue( TRUE ); - aSet.Put( aBrowse, aBrowse.Which() ); - SfxRequest aReq( SID_BROWSER_MODE, 0, aSet ); - GetDocShell()->Execute( aReq ); - pSh->UnlockPaint(); - } - } - else - bStartJob = FALSE; - - pSh->LockView( bLockedView ); - } - if(pOrgViewOption) - { - if(bSwitchOff_IsFldName) - pOrgViewOption->SetFldName(TRUE); - pOrgViewOption->SetShowHiddenChar(bOldShowHiddenChar); - pOrgViewOption->SetViewMetaChars(bOldMetaChars); - pOrgViewOption->SetShowHiddenField(bOldShowHiddenField); - pOrgViewOption->SetShowHiddenPara(bOldShowHiddenPara); - //must to be set to sal_True anyway - pOrgViewOption->SetShowPlaceHolderFields( sal_True ); - SW_MOD()->ApplyUsrPref(*pOrgViewOption, this, VIEWOPT_DEST_VIEW_ONLY ); - delete pOrgViewOption; - } - } - - if( !bStartJob ) - { - // Printer konnte nicht gestartet werden - delete pProgress; - return pPrinter->GetError(); - } - - pProgress->Stop(); - if ( pPrinter->IsJobActive() ) - { - pProgress->DeleteOnEndPrint(); - pPrinter->EndJob(); - return pPrinter->GetError(); - } - else - { - // the next call might destroy pPrinter (in case it is not the usual document printer); so get the error before - ULONG nError = pPrinter->GetError(); - pProgress->DeleteOnEndPrint(); - return nError; - } -} - - - -/*-------------------------------------------------------------------- Beschreibung: TabPage fuer applikationsspezifische Druckoptionen --------------------------------------------------------------------*/ @@ -546,6 +270,7 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq) rReq.RemoveItem(FN_QRY_MERGE); BOOL bFromMerge = pPrintFromMergeItem ? pPrintFromMergeItem->GetValue() : FALSE; SwMiscConfig aMiscConfig; + bool bPrintSelection = false; if(!bSilent && !bFromMerge && SW_MOD()->GetModuleConfig()->IsAskForMailMerge() && pSh->IsAnyDatabaseFieldInDoc()) { @@ -560,12 +285,29 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq) return; } } + else if( rReq.GetSlot() == SID_PRINTDOCDIRECT && ! bSilent ) + { + if( /*!bIsAPI && */ + ( pSh->IsSelection() || pSh->IsFrmSelected() || pSh->IsObjSelected() ) ) + { + short nBtn = SvxPrtQryBox(&GetEditWin()).Execute(); + if( RET_CANCEL == nBtn ) + return;; + + if( RET_OK == nBtn ) + bPrintSelection = true; + } + } + //#i61455# if master documentes are printed silently without loaded links then update the links now if( bSilent && pSh->IsGlobalDoc() && !pSh->IsGlblDocSaveLinks() ) { pSh->GetLinkManager().UpdateAllLinks( sal_False, sal_False, sal_False, 0 ); } - SfxViewShell::ExecuteSlot( rReq, SfxViewShell::GetInterface() ); + SfxRequest aReq( rReq ); + SfxBoolItem aBool(SID_SELECTION, bPrintSelection); + aReq.AppendItem( aBool ); + SfxViewShell::ExecuteSlot( aReq, SfxViewShell::GetInterface() ); return; } default: @@ -618,20 +360,19 @@ void SetAppPrintOptions( ViewShell* pSh, BOOL bWeb ) SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, 0 ); - SfxMiscCfg* pMisc = SFX_APP()->GetMiscConfig(); + utl::MiscCfg aMisc; if(bWeb) aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(((SwWrtShell*)pSh)->GetView().GetDocShell()))); aSet.Put(SfxBoolItem(SID_PRINTER_NOTFOUND_WARN, - pMisc->IsNotFoundWarning() )); + aMisc.IsNotFoundWarning() )); aSet.Put(aAddPrinterItem); aSet.Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, - (pMisc->IsPaperSizeWarning() ? SFX_PRINTER_CHG_SIZE : 0) | - (pMisc->IsPaperOrientationWarning() ? SFX_PRINTER_CHG_ORIENTATION : 0 ))); + (aMisc.IsPaperSizeWarning() ? SFX_PRINTER_CHG_SIZE : 0) | + (aMisc.IsPaperOrientationWarning() ? SFX_PRINTER_CHG_ORIENTATION : 0 ))); pIDDA->getPrinter( true )->SetOptions( aSet ); } } - diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx index 1735041b3d..85c965ee65 100644 --- a/sw/source/ui/uiview/viewsrch.cxx +++ b/sw/source/ui/uiview/viewsrch.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,17 +35,17 @@ #include <string> // HACK: prevent conflict between STLPORT and Workshop headers #include <hintids.hxx> #include <com/sun/star/util/SearchOptions.hpp> -#include <svtools/cjkoptions.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <svx/pageitem.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #ifndef _T2XTCMP_HXX //autogen #include <svtools/txtcmp.hxx> #endif -#include <svtools/itempool.hxx> -#include <svtools/eitem.hxx> +#include <svl/itempool.hxx> +#include <svl/eitem.hxx> #include <svx/srchitem.hxx> #include <sfx2/request.hxx> #include <svx/srchdlg.hxx> @@ -157,7 +157,7 @@ void SwView::ExecSearch(SfxRequest& rReq, BOOL bNoMessage) break; case FID_SEARCH_OFF: - if(pArgs) + if(pArgs) { // Dialog abmelden delete pSrchItem; @@ -428,7 +428,7 @@ void SwView::ExecSearch(SfxRequest& rReq, BOOL bNoMessage) } break; default: -#ifndef PRODUCT +#ifdef DBG_UTIL if(nSlot) { ByteString sStr( "nSlot: " ); diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx index 9800c1ed63..183498c31c 100644 --- a/sw/source/ui/uiview/viewstat.cxx +++ b/sw/source/ui/uiview/viewstat.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,14 +33,14 @@ #include <hintids.hxx> #include <com/sun/star/linguistic2/XThesaurus.hpp> #include <com/sun/star/uno/Sequence.hxx> -#include <svtools/aeitem.hxx> -#include <svtools/whiter.hxx> -#include <svtools/cjkoptions.hxx> +#include <svl/aeitem.hxx> +#include <svl/whiter.hxx> +#include <svl/cjkoptions.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/objitem.hxx> -#include <svtools/imageitm.hxx> -#include <svtools/languageoptions.hxx> +#include <svl/imageitm.hxx> +#include <svl/languageoptions.hxx> #include <svx/protitem.hxx> #include <svx/linkmgr.hxx> #include <svx/langitem.hxx> @@ -67,9 +67,9 @@ #include <wview.hxx> #endif #include <globdoc.hxx> -#include <svtools/stritem.hxx> -#include <svtools/moduleoptions.hxx> -#include <svtools/visitem.hxx> +#include <svl/stritem.hxx> +#include <unotools/moduleoptions.hxx> +#include <svl/visitem.hxx> #ifndef _CMDID_H #include <cmdid.h> @@ -299,7 +299,7 @@ void SwView::GetState(SfxItemSet &rSet) break; case FN_REDLINE_ACCEPT_DIRECT: case FN_REDLINE_REJECT_DIRECT: - { + { SwContentAtPos aCntntAtPos( SwContentAtPos::SW_REDLINE ); Point aCrsrPos = pWrtShell->GetCrsrDocPos( sal_True ); if( !pWrtShell->GetContentAtPos( aCrsrPos, aCntntAtPos ) ) diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx index b131190e8f..c1f532748e 100644 --- a/sw/source/ui/uiview/viewtab.cxx +++ b/sw/source/ui/uiview/viewtab.cxx @@ -44,11 +44,11 @@ #include <svx/ulspitem.hxx> #include <svx/boxitem.hxx> #include <svx/frmdiritem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/whiter.hxx> +#include <svl/eitem.hxx> +#include <svl/whiter.hxx> #include <svx/ruler.hxx> #include <svx/protitem.hxx> -#include <svtools/rectitem.hxx> +#include <svl/rectitem.hxx> #include <sfx2/bindings.hxx> #include <fmtfsize.hxx> #include <fmthdft.hxx> diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index 8389d9d2f9..88b9e291a4 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -46,7 +46,7 @@ #include <sfx2/printer.hxx> #include <editsh.hxx> #include <drawdoc.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <unotxdoc.hxx> #include <cmdid.h> #include <svx/zoomitem.hxx> diff --git a/sw/source/ui/uno/dlelstnr.cxx b/sw/source/ui/uno/dlelstnr.cxx index 5453c721c0..d9b4c83795 100644 --- a/sw/source/ui/uno/dlelstnr.cxx +++ b/sw/source/ui/uno/dlelstnr.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ #include <com/sun/star/linguistic2/XProofreadingIterator.hpp> #include <com/sun/star/linguistic2/LinguServiceEventFlags.hpp> -#include <svtools/lingucfg.hxx> +#include <unotools/lingucfg.hxx> #include <com/sun/star/uno/Reference.h> #include <comphelper/processfactory.hxx> @@ -92,12 +92,12 @@ SwLinguServiceEventListener::SwLinguServiceEventListener() Reference< XLinguServiceEventBroadcaster > xBC( xGCIterator, UNO_QUERY ); if (xBC.is()) xBC->addLinguServiceEventListener( (XLinguServiceEventListener *) this ); - } + } } catch (uno::Exception &) { DBG_ASSERT(0, "exception caught in SwLinguServiceEventListener c-tor" ); - } + } } } /* -----------------------------17.03.00 09:07-------------------------------- diff --git a/sw/source/ui/uno/swdet2.cxx b/sw/source/ui/uno/swdet2.cxx index a385f542a8..4d369d2b7e 100644 --- a/sw/source/ui/uno/swdet2.cxx +++ b/sw/source/ui/uno/swdet2.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,7 +49,7 @@ #include <web.hrc> #include <globdoc.hrc> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <unomid.h> diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx index c48834b40d..d0fcf366ee 100644 --- a/sw/source/ui/uno/swdetect.cxx +++ b/sw/source/ui/uno/swdetect.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -53,10 +53,10 @@ #include <ucbhelper/simpleinteractionrequest.hxx> #include <rtl/ustring.h> #include <rtl/logfile.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <vcl/window.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <tools/urlobj.hxx> #include <vos/mutex.hxx> #include <svtools/sfxecode.hxx> @@ -72,7 +72,7 @@ #include <sfx2/brokenpackageint.hxx> #include <svx/impgrf.hxx> #include <svtools/FilterConfigItem.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <com/sun/star/util/XArchiver.hpp> #include <comphelper/ihwrapnofilter.hxx> @@ -298,7 +298,7 @@ SwFilterDetect::~SwFilterDetect() rtl::Reference< ::comphelper::OIHWrapNoFilterDialog > xHandler = new ::comphelper::OIHWrapNoFilterDialog( xInteraction ); if ( nIndexOfInteractionHandler != -1 ) lDescriptor[nIndexOfInteractionHandler].Value <<= uno::Reference< XInteractionHandler >( static_cast< task::XInteractionHandler* >( xHandler.get() ) ); - + aMedium.SetError( ERRCODE_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); } } diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index 481d366f4e..74158364f2 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -38,9 +38,9 @@ #include <vos/mutex.hxx> #include <tools/debug.hxx> #include <vcl/svapp.hxx> -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svtools/unoevent.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <sfx2/event.hxx> #include <swtypes.hxx> #include <glosdoc.hxx> @@ -61,8 +61,8 @@ #include <docsh.hxx> #include <swunodef.hxx> #include <swmodule.hxx> -#include <svtools/smplhint.hxx> -#include <svtools/macitem.hxx> +#include <svl/smplhint.hxx> +#include <svl/macitem.hxx> #include <svx/acorrcfg.hxx> diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx index ce1e099e83..d9966ac213 100644 --- a/sw/source/ui/uno/unomailmerge.cxx +++ b/sw/source/ui/uno/unomailmerge.cxx @@ -35,8 +35,8 @@ #include <vcl/svapp.hxx> #include <vos/mutex.hxx> #include <osl/mutex.hxx> -#include <svtools/itemprop.hxx> -#include <svtools/urihelper.hxx> +#include <svl/itemprop.hxx> +#include <svl/urihelper.hxx> #include <svx/dataaccessdescriptor.hxx> #include <tools/shl.hxx> // GetAppData #include <tools/tempfile.hxx> @@ -725,6 +725,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( // when mail merge is called as command line macro aMergeDesc.bPrintAsync = sal_False; aMergeDesc.aPrintOptions = aPrintSettings; + aMergeDesc.bCreateSingleFile = true; } else /* FILE and MAIL*/ { diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index 18cccf6d7b..4d077c5b9f 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -519,81 +519,75 @@ void SwXPrintSettings::_preGetValues () void SwXPrintSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, uno::Any & rValue ) throw(UnknownPropertyException, WrappedTargetException ) { - sal_Bool bBool = TRUE; - sal_Bool bBoolVal; switch( rInfo.mnHandle ) { case HANDLE_PRINTSET_LEFT_PAGES: - bBoolVal = mpPrtOpt->IsPrintLeftPage(); + rValue <<= mpPrtOpt->IsPrintLeftPage(); break; case HANDLE_PRINTSET_RIGHT_PAGES: - bBoolVal = mpPrtOpt->IsPrintRightPage(); + rValue <<= mpPrtOpt->IsPrintRightPage(); break; case HANDLE_PRINTSET_REVERSED: - bBoolVal = mpPrtOpt->IsPrintReverse(); + rValue <<= mpPrtOpt->IsPrintReverse(); break; case HANDLE_PRINTSET_PROSPECT: - bBoolVal = mpPrtOpt->IsPrintProspect(); + rValue <<= mpPrtOpt->IsPrintProspect(); break; case HANDLE_PRINTSET_GRAPHICS: - bBoolVal = mpPrtOpt->IsPrintGraphic(); + rValue <<= mpPrtOpt->IsPrintGraphic(); break; case HANDLE_PRINTSET_TABLES: - bBoolVal = mpPrtOpt->IsPrintTable(); + rValue <<= mpPrtOpt->IsPrintTable(); break; case HANDLE_PRINTSET_DRAWINGS: - bBoolVal = mpPrtOpt->IsPrintDraw(); + rValue <<= mpPrtOpt->IsPrintDraw(); break; case HANDLE_PRINTSET_CONTROLS: - bBoolVal = mpPrtOpt->IsPrintControl(); + rValue <<= mpPrtOpt->IsPrintControl(); break; case HANDLE_PRINTSET_PAGE_BACKGROUND: - bBoolVal = mpPrtOpt->IsPrintPageBackground(); + rValue <<= mpPrtOpt->IsPrintPageBackground(); break; case HANDLE_PRINTSET_BLACK_FONTS: - bBoolVal = mpPrtOpt->IsPrintBlackFont(); + rValue <<= mpPrtOpt->IsPrintBlackFont(); break; case HANDLE_PRINTSET_SINGLE_JOBS: - bBoolVal = mpPrtOpt->IsPrintSingleJobs(); + rValue <<= mpPrtOpt->IsPrintSingleJobs(); break; case HANDLE_PRINTSET_EMPTY_PAGES: - bBoolVal = mpPrtOpt->IsPrintEmptyPages(); + rValue <<= mpPrtOpt->IsPrintEmptyPages(); break; case HANDLE_PRINTSET_PAPER_FROM_SETUP: - bBoolVal = mpPrtOpt->IsPaperFromSetup(); + rValue <<= mpPrtOpt->IsPaperFromSetup(); break; case HANDLE_PRINTSET_ANNOTATION_MODE: { - bBool = FALSE; rValue <<= static_cast < sal_Int16 > ( mpPrtOpt->GetPrintPostIts() ); } break; case HANDLE_PRINTSET_FAX_NAME : { - bBool = FALSE; rValue <<= mpPrtOpt->GetFaxName(); } break; case HANDLE_PRINTSET_PROSPECT_RTL: { - bBoolVal = mpPrtOpt->IsPrintProspect_RTL(); + rValue <<= mpPrtOpt->IsPrintProspectRTL(); } break; case HANDLE_PRINTSET_PLACEHOLDER: { - bBoolVal = mpPrtOpt->IsPrintTextPlaceholder(); + rValue <<= mpPrtOpt->IsPrintTextPlaceholder(); } break; case HANDLE_PRINTSET_HIDDEN_TEXT: { - bBoolVal = mpPrtOpt->IsPrintHiddenText(); + rValue <<= mpPrtOpt->IsPrintHiddenText(); } break; default: throw UnknownPropertyException(); } - if(bBool) - rValue.setValue(&bBoolVal, ::getBooleanCppuType()); } void SwXPrintSettings::_postGetValues () throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index f2d43e070a..c46d668dac 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -1,5 +1,5 @@ /************************************************************************* - * + * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2008 by Sun Microsystems, Inc. @@ -31,13 +31,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include <cmdid.h> -#include <swtypes.hxx> +#include <vos/mutex.hxx> #include <vcl/image.hxx> #include <vcl/virdev.hxx> #include <vcl/svapp.hxx> +#include <vcl/print.hxx> #include <sfx2/viewfrm.hxx> +#include <sfx2/sfxbasecontroller.hxx> #include <toolkit/helper/vclunohelper.hxx> +#include <toolkit/awt/vclxdevice.hxx> +#include <cmdid.h> +#include <swtypes.hxx> #include <wdocsh.hxx> #include <wrtsh.hxx> #include <view.hxx> @@ -46,9 +50,9 @@ #include <viewsh.hxx> #include <pvprtdat.hxx> #include <swprtopt.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <unotxdoc.hxx> -#include <svtools/numuno.hxx> +#include <svl/numuno.hxx> #include <fldbas.hxx> #include <unotextbodyhf.hxx> #include <unotextrange.hxx> @@ -57,20 +61,20 @@ #include <unocoll.hxx> #include <unoredlines.hxx> #include <unosrch.hxx> -#include <toolkit/awt/vclxdevice.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/request.hxx> #include <sfx2/objsh.hxx> // SfxObjectShellRef <-> SV_DECL_REF(SfxObjectShell) #include <unoprnms.hxx> #include <unostyle.hxx> #include <unodraw.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <pagedesc.hxx> #include <svtools/txtcmp.hxx> #include <unocrsr.hxx> #include <unofield.hxx> #include <unoidx.hxx> #include <unoflatpara.hxx> +#include <unotxvw.hxx> #include <poolfmt.hxx> #include <globdoc.hxx> #include <viewopt.hxx> @@ -78,6 +82,8 @@ #include <doc.hxx> #include <charatr.hxx> #include <svx/xmleohlp.hxx> +#include <globals.hrc> +#include <unomid.h> #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/lang/ServiceNotRegisteredException.hpp> @@ -106,7 +112,7 @@ #include <SwXPrintPreviewSettings.hxx> #include <doc.hxx> #include <svx/forbiddencharacterstable.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <drawdoc.hxx> #include <SwStyleNameMapper.hxx> #include <osl/file.hxx> @@ -130,18 +136,21 @@ #include <unostyle.hxx> //SwAutoStyleFamily #include <istyleaccess.hxx> // handling of automatic styles -#include <svtools/stylepool.hxx> +#include <svl/stylepool.hxx> #include <swatrset.hxx> +#include <view.hxx> +#include <srcview.hxx> //#include <com/sun/star/i18n/ScriptType.hpp> #include <svtools/langtab.hxx> #include <map> #include <set> +#include <vector> #include <svx/eeitem.hxx> #include <svx/editeng.hxx> #include <svx/svdoutl.hxx> -#include <svtools/languageoptions.hxx> +#include <svl/languageoptions.hxx> #include <svx/svdview.hxx> // @@ -173,6 +182,32 @@ using ::osl::FileBase; /****************************************************************************** * ******************************************************************************/ + +extern bool lcl_GetPostIts( IDocumentFieldsAccess* pIDFA, _SetGetExpFlds * pSrtLst ); + +SwPrintUIOptions * lcl_GetPrintUIOptions( + SwDocShell * pDocShell, + const SfxViewShell * pView ) +{ + if (!pDocShell) + return NULL; + + const BOOL bWebDoc = NULL != dynamic_cast< const SwWebDocShell * >(pDocShell); + const bool bSwSrcView = NULL != dynamic_cast< const SwSrcView * >(pView); + const SwView * pSwView = dynamic_cast< const SwView * >(pView); + const bool bHasSelection = pSwView ? pSwView->HasSelection( sal_False ) : false; // check for any selection, not just text selection + const bool bHasPostIts = lcl_GetPostIts( pDocShell->GetDoc(), 0 ); + + // get default values to use in dialog from documents SwPrintData + const SwPrintData *pPrintData = pDocShell->GetDoc()->getPrintData(); + DBG_ASSERT( pPrintData, "failed to get SwPrintData from document" ); + + return new SwPrintUIOptions( bWebDoc, bSwSrcView, bHasSelection, bHasPostIts, *pPrintData ); +} + +//////////////////////////////////////////////////////////// + + SwTxtFmtColl *lcl_GetParaStyle(const String& rCollName, SwDoc* pDoc) { SwTxtFmtColl* pColl = pDoc->FindTxtFmtCollByName( rCollName ); @@ -367,7 +402,9 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell) : pxXLineNumberingProperties(0), pxLinkTargetSupplier(0), pxXRedlines(0), - m_pHiddenViewFrame(0) + m_pHiddenViewFrame(0), + m_pPrintUIOptions( NULL ), + m_pRenderData( NULL ) { } /*-- 18.12.98 11:53:00--------------------------------------------------- @@ -382,6 +419,8 @@ SwXTextDocument::~SwXTextDocument() xNumFmtAgg->setDelegator(x0); xNumFmtAgg = 0; } + delete m_pPrintUIOptions; + delete m_pRenderData; } @@ -2444,100 +2483,74 @@ Any SAL_CALL SwXTextDocument::getPropertyDefault( const OUString& rPropertyName } return aAny; } -/*-- 06.01.2004 15:08:34--------------------------------------------------- - The class SwViewOptionAdjust_Impl is used to adjust the SwViewOption of - the current ViewShell so that fields are not printed as commands and - hidden text and hidden characters are always invisible. - After printing the view options are restored - -----------------------------------------------------------------------*/ -class SwViewOptionAdjust_Impl -{ - bool m_bSwitchOff_IsFldName; - bool m_bSwitchOff_PlaceHolderView; - bool m_bSwitchOff_HiddenChar; - bool m_bSwitchOff_HiddenParagraphs; - bool m_bSwitchOff_IsShowHiddenField; - - SwViewOption* m_pViewOption; - SwWrtShell& m_rShell; -public: - SwViewOptionAdjust_Impl(SwWrtShell& rSh); - ~SwViewOptionAdjust_Impl(); -}; -/*-- 06.01.2004 15:08:34--------------------------------------------------- - - -----------------------------------------------------------------------*/ -SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl(SwWrtShell& rSh) : - m_pViewOption(0), - m_rShell(rSh) -{ - const SwViewOption* pCurrentViewOptions = m_rShell.GetViewOptions(); - m_bSwitchOff_IsFldName = pCurrentViewOptions->IsFldName() && m_rShell.IsAnyFieldInDoc(); - bool bApplyViewOptions = m_bSwitchOff_IsFldName; - //switch off painting of placeholder fields - m_bSwitchOff_PlaceHolderView = pCurrentViewOptions->IsShowPlaceHolderFields(); - //switch off display of hidden characters if on and hidden characters are in use - m_bSwitchOff_HiddenChar = pCurrentViewOptions->IsShowHiddenChar() && m_rShell.GetDoc()->ContainsHiddenChars(); - //switch off display of hidden paragraphs if on and hidden paragraphs are in use - m_bSwitchOff_HiddenParagraphs = pCurrentViewOptions->IsShowHiddenPara(); - if(m_bSwitchOff_HiddenParagraphs) - { - const SwFieldType* pFldType = m_rShell.GetDoc()->GetSysFldType(RES_HIDDENPARAFLD); - if(!pFldType || !pFldType->GetDepends()) - m_bSwitchOff_HiddenParagraphs = false; - } - m_bSwitchOff_IsShowHiddenField = pCurrentViewOptions->IsShowHiddenField(); - if(m_bSwitchOff_IsShowHiddenField) - { - const SwFieldType* pFldType = m_rShell.GetDoc()->GetSysFldType(RES_HIDDENTXTFLD); - if( !pFldType || !pFldType->GetDepends()) - m_bSwitchOff_IsShowHiddenField = false; - } - - bApplyViewOptions |= m_bSwitchOff_PlaceHolderView; - bApplyViewOptions |= m_bSwitchOff_HiddenChar; - bApplyViewOptions |= m_bSwitchOff_HiddenParagraphs; - bApplyViewOptions |= m_bSwitchOff_IsShowHiddenField; - if(bApplyViewOptions) - { - m_pViewOption = new SwViewOption(*m_rShell.GetViewOptions()); - if(m_bSwitchOff_IsFldName) - m_pViewOption->SetFldName(FALSE); - if(m_bSwitchOff_PlaceHolderView) - m_pViewOption->SetShowPlaceHolderFields(FALSE); - if(m_bSwitchOff_HiddenChar) - m_pViewOption->SetShowHiddenChar(FALSE); - if(m_bSwitchOff_HiddenParagraphs) - m_pViewOption->SetShowHiddenPara(FALSE); - if(m_bSwitchOff_IsShowHiddenField) - m_pViewOption->SetShowHiddenField(FALSE); - SW_MOD()->ApplyUsrPref(*m_pViewOption, &m_rShell.GetView(), VIEWOPT_DEST_VIEW_ONLY ); - } -} -/*-- 06.01.2004 15:08:34--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl() +static OutputDevice * lcl_GetOutputDevice( const SwPrintUIOptions &rPrintUIOptions ) +{ + OutputDevice *pOut = 0; + + uno::Any aAny( rPrintUIOptions.getValue( C2U( "RenderDevice" ) )); + uno::Reference< awt::XDevice > xRenderDevice; + aAny >>= xRenderDevice; + if (xRenderDevice.is()) + { + VCLXDevice* pDevice = VCLXDevice::GetImplementation( xRenderDevice ); + pOut = pDevice ? pDevice->GetOutputDevice() : 0; + } + + return pOut; +} + + +static bool lcl_SeqHasProperty( + const uno::Sequence< beans::PropertyValue >& rOptions, + const sal_Char *pPropName ) +{ + bool bRes = false; + const sal_Int32 nLen = rOptions.getLength(); + const beans::PropertyValue *pProps = rOptions.getConstArray(); + for (sal_Int32 i = 0; i < nLen && !bRes; ++i) + { + if (pProps[i].Name.equalsAscii( pPropName )) + bRes = true; + } + return bRes; +} + + +SfxViewShell * SwXTextDocument::GetRenderView( + bool &rbIsSwSrcView, + const uno::Sequence< beans::PropertyValue >& rOptions, + bool bIsPDFExport ) { - if(m_pViewOption) + // get view shell to use + SfxViewShell *pView = 0; + if (bIsPDFExport) + pView = GuessViewShell( rbIsSwSrcView ); + else { - if(m_bSwitchOff_IsFldName) - m_pViewOption->SetFldName(TRUE); - if(m_bSwitchOff_PlaceHolderView) - m_pViewOption->SetShowPlaceHolderFields(TRUE); - if(m_bSwitchOff_HiddenChar) - m_pViewOption->SetShowHiddenChar(TRUE); - if(m_bSwitchOff_HiddenParagraphs) - m_pViewOption->SetShowHiddenPara(TRUE); - if(m_bSwitchOff_IsShowHiddenField) - m_pViewOption->SetShowHiddenField(TRUE); - SW_MOD()->ApplyUsrPref(*m_pViewOption, &m_rShell.GetView(), VIEWOPT_DEST_VIEW_ONLY ); - delete m_pViewOption; + uno::Any aTmp; + const sal_Int32 nLen = rOptions.getLength(); + const beans::PropertyValue *pProps = rOptions.getConstArray(); + for (sal_Int32 i = 0; i < nLen; ++i) + { + if (pProps[i].Name.equalsAscii( "View" )) + { + aTmp = pProps[i].Value; + break; + } + } + + uno::Reference< frame::XController > xController; + if (aTmp >>= xController) + { + DBG_ASSERT( xController.is(), "controller is empty!" ); + pView = GuessViewShell( rbIsSwSrcView, xController ); + } } -} -/* -----------------------------23.08.02 16:00-------------------------------- + return pView; +} + - ---------------------------------------------------------------------------*/ /* * GetRenderDoc: * returns the document to be rendered, usually this will be the 'regular' @@ -2547,7 +2560,10 @@ SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl() * SfxViewShell. */ -SwDoc * SwXTextDocument::GetRenderDoc( SfxViewShell *&rpView, const uno::Any& rSelection ) +SwDoc * SwXTextDocument::GetRenderDoc( + SfxViewShell *&rpView, + const uno::Any& rSelection, + bool bIsPDFExport ) { SwDoc *pDoc = 0; @@ -2557,11 +2573,22 @@ SwDoc * SwXTextDocument::GetRenderDoc( SfxViewShell *&rpView, const uno::Any& rS pDoc = pDocShell->GetDoc(); else { - // used for PDF export of (multi-)selection + DBG_ASSERT( !xModel.is(), "unexpected model found" ); + if (rSelection.hasValue()) // is anything selected ? { + // this part should only be called when a temporary document needs to be created, + // for example for PDF export or printing of (multi-)selection only. + + bool bIsSwSrcView = false; if (!rpView) - rpView = GuessViewShell(); + { + (void) bIsPDFExport; + // aside from maybe PDF export the view should always have been provided! + DBG_ASSERT( bIsPDFExport, "view is missing, guessing one..." ); + + rpView = GuessViewShell( bIsSwSrcView ); + } DBG_ASSERT( rpView, "ViewShell missing" ); // the view shell should be SwView for documents PDF export. // for the page preview no selection should be possible @@ -2576,56 +2603,188 @@ SwDoc * SwXTextDocument::GetRenderDoc( SfxViewShell *&rpView, const uno::Any& rS rpView = pDoc->GetDocShell()->GetView(); } } - else { + else + { DBG_ERROR( "unexpected ViewShell" ); } } } return pDoc; } + /* -----------------------------23.08.02 16:00-------------------------------- ---------------------------------------------------------------------------*/ + +static void lcl_SavePrintUIOptionsToDocumentPrintData( + SwDoc &rDoc, + const SwPrintUIOptions &rPrintUIOptions, + bool bIsPDFEXport ) +{ + if (!rDoc.getPrintData()) + { + SwPrintData *pTmpData = new SwPrintData; + rDoc.setPrintData ( *pTmpData ); + delete pTmpData; // setPrintData does make its own copy! + } + + SwPrintData *pDocPrintData = rDoc.getPrintData(); + + pDocPrintData->SetPrintGraphic( rPrintUIOptions.IsPrintGraphics() ); + pDocPrintData->SetPrintTable( rPrintUIOptions.IsPrintTables() ); + pDocPrintData->SetPrintDraw( rPrintUIOptions.IsPrintDrawings() ); + pDocPrintData->SetPrintControl( rPrintUIOptions.IsPrintFormControls() ); + pDocPrintData->SetPrintLeftPage( rPrintUIOptions.IsPrintLeftPages() ); + pDocPrintData->SetPrintRightPage( rPrintUIOptions.IsPrintRightPages() ); + pDocPrintData->SetPrintReverse( rPrintUIOptions.IsPrintReverse() ); + pDocPrintData->SetPaperFromSetup( rPrintUIOptions.IsPaperFromSetup() ); + pDocPrintData->SetPrintEmptyPages( rPrintUIOptions.IsPrintEmptyPages( bIsPDFEXport ) ); + pDocPrintData->SetPrintPostIts( rPrintUIOptions.GetPrintPostItsType() ); + pDocPrintData->SetPrintProspect( rPrintUIOptions.IsPrintProspect() ); + pDocPrintData->SetPrintProspect_RTL( rPrintUIOptions.IsPrintProspectRTL() ); + pDocPrintData->SetPrintPageBackground( rPrintUIOptions.IsPrintPageBackground() ); + pDocPrintData->SetPrintBlackFont( rPrintUIOptions.IsPrintWithBlackTextColor() ); + // pDocPrintData->SetPrintSingleJobs( b ); handled by File/Print dialog itself + // pDocPrintData->SetFaxName( s ); n/a in File/Print dialog + pDocPrintData->SetPrintHiddenText( rPrintUIOptions.IsPrintHiddenText() ); + pDocPrintData->SetPrintTextPlaceholder( rPrintUIOptions.IsPrintTextPlaceholders() ); +} + + sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( const uno::Any& rSelection, - const uno::Sequence< beans::PropertyValue >& /*rxOptions*/ ) + const uno::Sequence< beans::PropertyValue >& rxOptions ) throw (IllegalArgumentException, RuntimeException) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); - SfxViewShell *pView = 0; - SwDoc *pDoc = GetRenderDoc( pView, rSelection ); - if (!pDoc) - throw RuntimeException(); - SwDocShell *pRenderDocShell = pDoc->GetDocShell(); - // #i38289 - if(pDoc->get(IDocumentSettingAccess::BROWSE_MODE)) - { - pRenderDocShell->ToggleBrowserMode(false,NULL); - } + const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); + bool bIsSwSrcView = false; + SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); + + if (!bIsSwSrcView && !m_pRenderData) + m_pRenderData = new SwRenderData; + if (!m_pPrintUIOptions) + m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView ); + bool bFormat = m_pPrintUIOptions->processPropertiesAndCheckFormat( rxOptions ); + // const bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); + + SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); + DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); + if (!pDoc || !pView) + return 0; - SwWrtShell *pWrtShell = pRenderDocShell->GetWrtShell(); + // save current UI options from the print dialog for the next call to that dialog + lcl_SavePrintUIOptionsToDocumentPrintData( *pDoc, *m_pPrintUIOptions, bIsPDFExport ); sal_Int32 nRet = 0; - if( !pWrtShell ) + if (bIsSwSrcView) { - //create a hidden view to be able to export as PDF also in print preview - m_pHiddenViewFrame = SfxViewFrame::CreateViewFrame( *pRenderDocShell, 2, TRUE ); - SwView* pSwView = (SwView*) m_pHiddenViewFrame->GetViewShell(); - pWrtShell = pSwView->GetWrtShellPtr(); + SwSrcView *pSwSrcView = dynamic_cast< SwSrcView * >(pView); + OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); + nRet = pSwSrcView->PrintSource( pOutDev, 1 /* dummy */, true /* get page count only */ ); } + else + { + SwDocShell *pRenderDocShell = pDoc->GetDocShell(); + SwWrtShell *pWrtShell = pRenderDocShell->GetWrtShell(); + if (bFormat) + { + // #i38289 + if(pDoc->get(IDocumentSettingAccess::BROWSE_MODE)) + { + pRenderDocShell->ToggleBrowserMode(false,NULL); + } + + if (!pWrtShell) + { + //create a hidden view to be able to export as PDF also in print preview + m_pHiddenViewFrame = SfxViewFrame::CreateViewFrame( *pRenderDocShell, 2, TRUE ); + SwView* pSwView = (SwView*) m_pHiddenViewFrame->GetViewShell(); + pWrtShell = pSwView->GetWrtShellPtr(); + } + + // reformating the document for printing will show the changes in the view + // which is likely to produce many unwanted and not nice to view actions. + // We don't want that! Thus we disable updating of the view. + pWrtShell->StartAction(); + + const TypeId aSwViewTypeId = TYPE(SwView); + if (pView->IsA(aSwViewTypeId)) + { + if (m_pRenderData && !m_pRenderData->IsViewOptionAdjust()) + m_pRenderData->ViewOptionAdjustStart( *pWrtShell, *pWrtShell->GetViewOptions() ); + } - SwViewOptionAdjust_Impl aAdjust(*pWrtShell); - pWrtShell->SetPDFExportOption( sal_True ); - // --> FME 2005-05-23 #122919# Force field update before PDF export: - pWrtShell->ViewShell::UpdateFlds(TRUE); - // <-- - pWrtShell->CalcLayout(); - pWrtShell->SetPDFExportOption( sal_False ); - nRet = pDoc->GetPageCount(); + m_pRenderData->SetSwPrtOptions( new SwPrtOptions( C2U( bIsPDFExport ? "PDF export" : "Printing" ) ) ); + m_pRenderData->MakeSwPrtOptions( m_pRenderData->GetSwPrtOptionsRef(), pRenderDocShell, + m_pPrintUIOptions, m_pRenderData, bIsPDFExport ); + + if (pView->IsA(aSwViewTypeId)) + { + // PDF export should not make use of the SwPrtOptions + const SwPrtOptions *pPrtOptions = bIsPDFExport? NULL : m_pRenderData->GetSwPrtOptions(); + m_pRenderData->ViewOptionAdjust( pPrtOptions ); + } + + // since printing now also use the API for PDF export this option + // should be set for printing as well ... + pWrtShell->SetPDFExportOption( sal_True ); + + // --> FME 2005-05-23 #122919# Force field update before PDF export: + pWrtShell->ViewShell::UpdateFlds(TRUE); + // <-- + + // there is some redundancy between those two function calls, but right now + // there is no time to sort this out. + //TODO: check what exatly needs to be done and make just one function for that + pWrtShell->CalcLayout(); + pWrtShell->CalcPagesForPrint( pDoc->GetPageCount() ); + + pWrtShell->SetPDFExportOption( sal_False ); + + + // enable view again + pWrtShell->EndAction(); + } + + const sal_Int32 nPageCount = pDoc->GetPageCount(); + + // + // get number of pages to be rendered + // + const bool bPrintProspect = m_pPrintUIOptions->getBoolValue( "PrintProspect", false ); + if (bPrintProspect) + { + pDoc->CalculatePagePairsForProspectPrinting( *m_pRenderData, *m_pPrintUIOptions, nPageCount ); + nRet = m_pRenderData->GetPagePairsForProspectPrinting().size(); + } + else + { + const sal_Int16 nPostItMode = (sal_Int16) m_pPrintUIOptions->getIntValue( "PrintAnnotationMode", 0 ); + if (nPostItMode != POSTITS_NONE) + { + OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); + m_pRenderData->CreatePostItData( pDoc, pWrtShell->GetViewOptions(), pOutDev ); + } + + // get set of valid document pages (according to the current settings) + // and their start frames + pDoc->CalculatePagesForPrinting( *m_pRenderData, *m_pPrintUIOptions, bIsPDFExport, nPageCount ); + + if (nPostItMode != POSTITS_NONE) + { + pDoc->UpdatePagesForPrintingWithPostItData( *m_pRenderData, + *m_pPrintUIOptions, bIsPDFExport, nPageCount ); + } + nRet = m_pRenderData->GetPagesToPrint().size(); + } + } + DBG_ASSERT( nRet >= 0, "negative number of pages???" ); + return nRet; } /* -----------------------------23.08.02 16:00-------------------------------- @@ -2640,41 +2799,110 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); - SfxViewShell *pView = 0; - SwDoc *pDoc = GetRenderDoc( pView, rSelection ); - if (!pDoc) - throw RuntimeException(); + + const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); + bool bIsSwSrcView = false; + SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); + + // m_pRenderData should NOT be created here! + // That should only be done in getRendererCount. If this function is called before + // getRendererCount was called then the caller will probably just retrieve the extra UI options + // and is not interested in getting valid information about the other data that would + // otherwise be provided here! +// if( ! m_pRenderData ) +// m_pRenderData = new SwRenderData; + if (!m_pPrintUIOptions) + m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView ); + m_pPrintUIOptions->processProperties( rxOptions ); + const bool bPrintProspect = m_pPrintUIOptions->getBoolValue( "PrintProspect", false ); + const bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); + + SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); + DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); + if (!pDoc || !pView) + return uno::Sequence< beans::PropertyValue >(); // due to #110067# (document page count changes sometimes during // PDF export/printing) we can not check for the upper bound properly. // Thus instead of throwing the exception we silently return. - if (!(0 <= nRenderer /* && nRenderer < pDoc->GetPageCount()*/)) + if (0 > nRenderer) throw IllegalArgumentException(); - if (nRenderer >= pDoc->GetPageCount()) - return uno::Sequence< beans::PropertyValue >(); - - bool bSkipEmptyPages = false; - for( sal_Int32 nProperty = 0, nPropertyCount = rxOptions.getLength(); nProperty < nPropertyCount; ++nProperty ) + sal_Int32 nMaxRenderer = 0; + if (!bIsSwSrcView && m_pRenderData) { - if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ) ) - rxOptions[ nProperty].Value >>= bSkipEmptyPages; + DBG_ASSERT( m_pRenderData, "m_pRenderData missing!!" ); + nMaxRenderer = bPrintProspect? + m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 : + m_pRenderData->GetPagesToPrint().size() - 1; } + // since SwSrcView::PrintSource is a poor implementation to get the number of pages to print + // we obmit checking of the upper bound in this case. + if (!bIsSwSrcView && m_pRenderData && nRenderer > nMaxRenderer) + return uno::Sequence< beans::PropertyValue >(); - Size aPgSize( pDoc->GetPageSize( sal_uInt16(nRenderer + 1), bSkipEmptyPages ) ); + uno::Sequence< beans::PropertyValue > aRenderer; + if (m_pRenderData) + { + awt::Size aPageSize; + Size aTmpSize; + if (bIsSwSrcView || bPrintProspect) + { + // for printing of HTML source code and prospect printing we should use + // the printers paper size since + // a) HTML source view has no page size + // b) prospect printing has a different page size from the documents page + // since two document pages will get rendered on one printer page + + // since PageIncludesNonprintableArea will be set to true we can return the + // printers paper size here. + // Sometimes 'getRenderer' is only called to get "ExtraPrintUIOptions", in this + // case we won't get an OutputDevice here, but then the caller also has no need + // for the correct PageSisze right now... + Printer *pPrinter = dynamic_cast< Printer * >(lcl_GetOutputDevice( *m_pPrintUIOptions )); + if (pPrinter) + { + if (bPrintProspect) + { + aTmpSize = pDoc->GetPageSize( USHORT(nRenderer + 1), bIsSkipEmptyPages ); + // we just state what output size we would need + // the rest is nowadays up to vcl + aPageSize = awt::Size ( TWIP_TO_MM100( 2 * aTmpSize.Width() ), + TWIP_TO_MM100( aTmpSize.Height() )); + } + else + { + // printing HTML source view + aTmpSize = pPrinter->GetPaperSize(); + aTmpSize = pPrinter->LogicToLogic( aTmpSize, + pPrinter->GetMapMode(), MapMode( MAP_100TH_MM )); + aPageSize = awt::Size( aTmpSize.Width(), aTmpSize.Height() ); + } + } + } + else + { + aTmpSize = pDoc->GetPageSize( USHORT(nRenderer + 1), bIsSkipEmptyPages ); + aPageSize = awt::Size ( TWIP_TO_MM100( aTmpSize.Width() ), + TWIP_TO_MM100( aTmpSize.Height() )); + } - awt::Size aPageSize( TWIP_TO_MM100( aPgSize.Width() ), - TWIP_TO_MM100( aPgSize.Height() )); - uno::Sequence< beans::PropertyValue > aRenderer(1); - PropertyValue &rValue = aRenderer.getArray()[0]; - rValue.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ); - rValue.Value <<= aPageSize; + aRenderer.realloc(2); + aRenderer[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ); + aRenderer[0].Value <<= aPageSize; + aRenderer[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageIncludesNonprintableArea" ) ); + aRenderer[1].Value <<= sal_True; + } + m_pPrintUIOptions->appendPrintUIOptions( aRenderer ); + return aRenderer; } /* -----------------------------28.10.02 16:00-------------------------------- ---------------------------------------------------------------------------*/ -SfxViewShell * SwXTextDocument::GuessViewShell() +SfxViewShell * SwXTextDocument::GuessViewShell( + /* out */ bool &rbIsSwSrcView, + const uno::Reference< css::frame::XController > xController ) { // #130810# SfxViewShell::Current() / SfxViewShell::GetObjectShell() // must not be used (see comment from MBA) @@ -2682,24 +2910,39 @@ SfxViewShell * SwXTextDocument::GuessViewShell() SfxViewShell *pView = 0; SwView *pSwView = 0; SwPagePreView *pSwPagePreView = 0; + SwSrcView *pSwSrcView = 0; SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocShell, 0, sal_False ); + + // look for the view shell with the same controller in use, + // otherwise look for a suitable view, preferably a SwView, + // if that one is not found use a SwPagePreView if found. while (pFrame) { pView = pFrame->GetViewShell(); pSwView = dynamic_cast< SwView * >(pView); - if (pSwView) - break; + pSwSrcView = dynamic_cast< SwSrcView * >(pView); if (!pSwPagePreView) pSwPagePreView = dynamic_cast< SwPagePreView * >(pView); + if (xController.is()) + { + if (pView && pView->GetController() == xController) + break; + } + else if (pSwView || pSwSrcView) + break; pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, 0, sal_False ); } - return pSwView ? pSwView : dynamic_cast< SwView * >(pSwPagePreView); + DBG_ASSERT( pSwView || pSwPagePreView || pSwSrcView, "failed to get view shell" ); + if (pView) + rbIsSwSrcView = pSwSrcView != 0; + return pView; +// return pSwView ? dynamic_cast< SfxViewShell * >(pSwView) : +// (pSwSrcView ? dynamic_cast< SfxViewShell * >(pSwSrcView) : +// dynamic_cast< SfxViewShell * >(pSwPagePreView) ); } -/* -----------------------------23.08.02 16:00-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextDocument::render( sal_Int32 nRenderer, const uno::Any& rSelection, @@ -2709,121 +2952,143 @@ void SAL_CALL SwXTextDocument::render( ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); - SfxViewShell *pView = GuessViewShell(); - SwDoc *pDoc = GetRenderDoc( pView, rSelection ); - if (!pDoc || !pView) - throw RuntimeException(); // due to #110067# (document page count changes sometimes during // PDF export/printing) we can not check for the upper bound properly. // Thus instead of throwing the exception we silently return. - if (!(0 <= nRenderer /* && nRenderer < pDoc->GetPageCount()*/)) + if (0 > nRenderer) throw IllegalArgumentException(); - if (nRenderer >= pDoc->GetPageCount()) - return; - // the view shell should be SwView for documents PDF export - // or SwPagePreView for PDF export of the page preview - //!! (check for SwView first as in GuessViewShell) !! - const TypeId aSwViewTypeId = TYPE(SwView); - ViewShell* pVwSh = pView->IsA(aSwViewTypeId) ? - ((SwView*)pView)->GetWrtShellPtr() : - ((SwPagePreView*)pView)->GetViewShell(); - - uno::Reference< awt::XDevice > xRenderDevice; - bool bFirstPage = false; - bool bLastPage = false; - rtl::OUString aPages; - bool bSkipEmptyPages = false; - - for( sal_Int32 nProperty = 0, nPropertyCount = rxOptions.getLength(); nProperty < nPropertyCount; ++nProperty ) - { - if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ) ) - rxOptions[ nProperty].Value >>= xRenderDevice; - else if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFirstPage" ) ) ) - rxOptions[ nProperty].Value >>= bFirstPage; - else if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "IsLastPage" ) ) ) - rxOptions[ nProperty].Value >>= bLastPage; - else if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ) ) - rxOptions[ nProperty].Value >>= aPages; - else if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ) ) - rxOptions[ nProperty].Value >>= bSkipEmptyPages; - } - - OutputDevice* pOut = 0; - if (xRenderDevice.is()) - { - VCLXDevice* pDevice = VCLXDevice::GetImplementation( xRenderDevice ); - pOut = pDevice ? pDevice->GetOutputDevice() : 0; - } - - if(pVwSh && pOut) + const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); + bool bIsSwSrcView = false; + SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); + + DBG_ASSERT( m_pRenderData, "data should have been created already in getRendererCount..." ); + DBG_ASSERT( m_pPrintUIOptions, "data should have been created already in getRendererCount..." ); + if (!bIsSwSrcView && !m_pRenderData) + m_pRenderData = new SwRenderData; + if (!m_pPrintUIOptions) + m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView ); + m_pPrintUIOptions->processProperties( rxOptions ); + const bool bPrintProspect = m_pPrintUIOptions->getBoolValue( "PrintProspect", false ); + const bool bLastPage = m_pPrintUIOptions->getBoolValue( "IsLastPage", sal_False ); + + SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); + DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); + if (pDoc && pView) { - SwPrtOptions aOptions( C2U("PDF export") ); - - const TypeId aSwWebDocShellTypeId = TYPE(SwWebDocShell); - BOOL bWeb = pDocShell->IsA( aSwWebDocShellTypeId ); - SwView::MakeOptions( NULL, aOptions, NULL, NULL, bWeb, NULL, NULL ); - - Range aPageRange( nRenderer+1, nRenderer+1 ); - MultiSelection aPage( aPageRange ); - aPage.SetTotalRange( Range( 0, RANGE_MAX ) ); - aPage.Select( aPageRange ); - aOptions.aMulti = aPage; - - //! Note: Since for PDF export of (multi-)selection a temporary - //! document is created that contains only the selects parts, - //! and thus that document is to printed in whole the, - //! aOptions.bPrintSelection parameter will be false. - aOptions.bPrintSelection = FALSE; - - SwViewOptionAdjust_Impl* pViewOptionAdjust = pView->IsA(aSwViewTypeId) ? - new SwViewOptionAdjust_Impl(*((SwView*)pView)->GetWrtShellPtr()) : 0; - - - pVwSh->SetPDFExportOption( sal_True ); - - // --> FME 2004-06-08 #i12836# enhanced pdf export - // - // First, we have to export hyperlinks, notes, and outline to pdf. - // During this process, additional information required for tagging - // the pdf file are collected, which are evaulated during painting. - // - SwWrtShell* pWrtShell = pView->IsA(aSwViewTypeId) ? - ((SwView*)pView)->GetWrtShellPtr() : - 0; - - if ( bFirstPage && pWrtShell ) - { - SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPages, bSkipEmptyPages, sal_False ); - } - // <-- - - pVwSh->Prt( aOptions, 0, pOut ); - - // --> FME 2004-10-08 #i35176# - // - // After printing the last page, we take care for the links coming - // from the EditEngine. The links are generated during the painting - // process, but the destinations are still missing. - // - if ( bLastPage && pWrtShell ) + sal_Int32 nMaxRenderer = 0; + if (!bIsSwSrcView) { - SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPages, bSkipEmptyPages, sal_True ); + DBG_ASSERT( m_pRenderData, "m_pRenderData missing!!" ); + nMaxRenderer = bPrintProspect? + m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 : + m_pRenderData->GetPagesToPrint().size() - 1; } - // <-- - - pVwSh->SetPDFExportOption( sal_False ); - // #i96167# haggai: delete pViewOptionsAdjust here because it makes use - // of the shell, which might get destroyed in lcl_DisposeView! - delete pViewOptionAdjust; - - if( bLastPage && m_pHiddenViewFrame) + // since SwSrcView::PrintSource is a poor implementation to get the number of pages to print + // we obmit checking of the upper bound in this case. + if (bIsSwSrcView || nRenderer <= nMaxRenderer) { - lcl_DisposeView( m_pHiddenViewFrame, pDocShell ); - m_pHiddenViewFrame = 0; + if (bIsSwSrcView) + { + SwSrcView *pSwSrcView = dynamic_cast< SwSrcView * >(pView); + OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); + pSwSrcView->PrintSource( pOutDev, nRenderer + 1, false ); + } + else + { + // the view shell should be SwView for documents PDF export + // or SwPagePreView for PDF export of the page preview + //!! (check for SwView first as in GuessViewShell) !! + DBG_ASSERT( pView, "!! view missing !!" ); + const TypeId aSwViewTypeId = TYPE(SwView); + ViewShell* pVwSh = 0; + if (pView) + { + pVwSh = pView->IsA(aSwViewTypeId) ? + ((SwView*)pView)->GetWrtShellPtr() : + ((SwPagePreView*)pView)->GetViewShell(); + } + + // get output device to use + OutputDevice * pOut = lcl_GetOutputDevice( *m_pPrintUIOptions ); + + if(pVwSh && pOut && m_pRenderData->HasSwPrtOptions()) + { + const rtl::OUString aPageRange = m_pPrintUIOptions->getStringValue( "PageRange", OUString() ); + const bool bFirstPage = m_pPrintUIOptions->getBoolValue( "IsFirstPage", sal_False ); + bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); + + DBG_ASSERT(( pView->IsA(aSwViewTypeId) && m_pRenderData->IsViewOptionAdjust()) + || (!pView->IsA(aSwViewTypeId) && !m_pRenderData->IsViewOptionAdjust()), + "SwView / SwViewOptionAdjust_Impl availability mismatch" ); + + // since printing now also use the API for PDF export this option + // should be set for printing as well ... + pVwSh->SetPDFExportOption( sal_True ); + + // --> FME 2004-06-08 #i12836# enhanced pdf export + // + // First, we have to export hyperlinks, notes, and outline to pdf. + // During this process, additional information required for tagging + // the pdf file are collected, which are evaulated during painting. + // + SwWrtShell* pWrtShell = pView->IsA(aSwViewTypeId) ? + ((SwView*)pView)->GetWrtShellPtr() : + 0; + + if (bIsPDFExport && bFirstPage && pWrtShell) + { + SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, sal_False ); + } + // <-- + + const SwPrtOptions &rSwPrtOptions = *m_pRenderData->GetSwPrtOptions(); + if (bPrintProspect) + pVwSh->PrintProspect( pOut, rSwPrtOptions, nRenderer ); + else // normal printing and PDF export + pVwSh->PrintOrPDFExport( pOut, rSwPrtOptions, nRenderer ); + + // --> FME 2004-10-08 #i35176# + // + // After printing the last page, we take care for the links coming + // from the EditEngine. The links are generated during the painting + // process, but the destinations are still missing. + // + if (bIsPDFExport && bLastPage && pWrtShell) + { + SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, sal_True ); + } + // <-- + + pVwSh->SetPDFExportOption( sal_False ); + + // last page to be rendered? (not necessarily the last page of the document) + // -> do clean-up of data + if (bLastPage) + { + // #i96167# haggai: delete ViewOptionsAdjust here because it makes use + // of the shell, which might get destroyed in lcl_DisposeView! + if (m_pRenderData && m_pRenderData->IsViewOptionAdjust()) + m_pRenderData->ViewOptionAdjustStop(); + + if (m_pRenderData && m_pRenderData->HasPostItData()) + m_pRenderData->DeletePostItData(); + if (m_pHiddenViewFrame) + { + lcl_DisposeView( m_pHiddenViewFrame, pDocShell ); + m_pHiddenViewFrame = 0; + } + } + } + } } } + if( bLastPage ) + { + delete m_pRenderData; m_pRenderData = NULL; + delete m_pPrintUIOptions; m_pPrintUIOptions = NULL; + } } /* -----------------------------03.10.04 ------------------------------------- @@ -3781,3 +4046,80 @@ void SwXDocumentPropertyHelper::onChange() if(m_pDoc) m_pDoc->SetModified(); } + + +/*****************************************************************************/ + +SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions ) : + m_rShell( rSh ), + m_aOldViewOptions( rViewOptions ) +{ +} + + +SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl() +{ + m_rShell.ApplyViewOptions( m_aOldViewOptions ); +} + + +void SwViewOptionAdjust_Impl::AdjustViewOptions( + const SwPrtOptions *pPrtOptions ) +{ + // to avoid unnecessary reformatting the view options related to the content + // below should only change if necessary, that is if respective content is present + const bool bContainsHiddenChars = m_rShell.GetDoc()->ContainsHiddenChars(); + const SwFieldType* pFldType = m_rShell.GetDoc()->GetSysFldType( RES_HIDDENTXTFLD ); + const bool bContainsHiddenFields = pFldType && pFldType->GetDepends(); + pFldType = m_rShell.GetDoc()->GetSysFldType( RES_HIDDENPARAFLD ); + const bool bContainsHiddenParagraphs = pFldType && pFldType->GetDepends(); + pFldType = m_rShell.GetDoc()->GetSysFldType( RES_JUMPEDITFLD ); + const bool bContainsPlaceHolders = pFldType && pFldType->GetDepends(); + const bool bContainsFields = m_rShell.IsAnyFieldInDoc(); + + SwViewOption aRenderViewOptions( m_aOldViewOptions ); + + // disable anything in the view that should not be printed (or exported to PDF) by default + // (see also dialog "Tools/Options - StarOffice Writer - Formatting Aids" + // in section "Display of ...") + aRenderViewOptions.SetParagraph( FALSE ); // paragraph end + aRenderViewOptions.SetSoftHyph( FALSE ); // aka custom hyphens + aRenderViewOptions.SetBlank( FALSE ); // spaces + aRenderViewOptions.SetHardBlank( FALSE ); // non-breaking spaces + aRenderViewOptions.SetTab( FALSE ); // tabs + aRenderViewOptions.SetLineBreak( FALSE ); // breaks (type 1) + aRenderViewOptions.SetPageBreak( FALSE ); // breaks (type 2) + aRenderViewOptions.SetColumnBreak( FALSE ); // breaks (type 3) + BOOL bVal = pPrtOptions? pPrtOptions->bPrintHiddenText : FALSE; + if (bContainsHiddenChars) + aRenderViewOptions.SetShowHiddenChar( bVal ); // hidden text + if (bContainsHiddenFields) + aRenderViewOptions.SetShowHiddenField( bVal ); + if (bContainsHiddenParagraphs) + aRenderViewOptions.SetShowHiddenPara( bVal ); + + if (bContainsPlaceHolders) + { + // should always be printed in PDF export! + bVal = pPrtOptions ? pPrtOptions->bPrintTextPlaceholder : TRUE; + aRenderViewOptions.SetShowPlaceHolderFields( bVal ); + } + + if (bContainsFields) + aRenderViewOptions.SetFldName( FALSE ); + + // we need to set this flag in order to get to see the visible effect of + // some of the above settings (needed for correct rendering) + aRenderViewOptions.SetViewMetaChars( TRUE ); + + if (m_aOldViewOptions != aRenderViewOptions) // check if reformatting is necessary + { + aRenderViewOptions.SetPrinting( pPrtOptions != NULL ); + m_rShell.ApplyViewOptions( aRenderViewOptions ); + } +} + + +/*****************************************************************************/ + + diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 3b7b10f516..e2b40a8a9e 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -705,7 +705,7 @@ uno::Reference< awt::XControl > SwXTextView::getControl(const uno::Reference< a /*-- 08.03.07 13:55------------------------------------------------------ -----------------------------------------------------------------------*/ -uno::Reference< form::XFormController > SAL_CALL SwXTextView::getFormController( const uno::Reference< form::XForm >& _Form ) throw (RuntimeException) +uno::Reference< form::runtime::XFormController > SAL_CALL SwXTextView::getFormController( const uno::Reference< form::XForm >& _Form ) throw (RuntimeException) { ::vos::OGuard aGuard( Application::GetSolarMutex() ); @@ -715,7 +715,7 @@ uno::Reference< form::XFormController > SAL_CALL SwXTextView::getFormController( Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : NULL; DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::GetControl: how could I?" ); - uno::Reference< form::XFormController > xController; + uno::Reference< form::runtime::XFormController > xController; if ( pFormShell && pDrawView && pWindow ) xController = pFormShell->GetFormController( _Form, *pDrawView, *pWindow ); return xController; @@ -2207,5 +2207,6 @@ void SAL_CALL SwXTextView::insertTransferable( const uno::Reference< datatransfe } } } + // ----------------------------------------------------------------------------- diff --git a/sw/source/ui/uno/warnpassword.cxx b/sw/source/ui/uno/warnpassword.cxx index 01d27b6360..1af8e77c25 100644 --- a/sw/source/ui/uno/warnpassword.cxx +++ b/sw/source/ui/uno/warnpassword.cxx @@ -33,7 +33,7 @@ // ============================================================================ #include "warnpassword.hxx" #include <com/sun/star/task/XInteractionHandler.hpp> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <sfx2/docfile.hxx> #include <sfx2/sfxsids.hrc> #include <ucbhelper/simpleinteractionrequest.hxx> diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx index e528b954e9..75b8b6188a 100644 --- a/sw/source/ui/utlui/attrdesc.cxx +++ b/sw/source/ui/utlui/attrdesc.cxx @@ -32,7 +32,7 @@ #include "precompiled_sw.hxx" -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #include <vcl/svapp.hxx> #include <svx/itemtype.hxx> #include <goodies/grfmgr.hxx> diff --git a/sw/source/ui/utlui/bookctrl.cxx b/sw/source/ui/utlui/bookctrl.cxx index 99e0849c78..40dc397900 100644 --- a/sw/source/ui/utlui/bookctrl.cxx +++ b/sw/source/ui/utlui/bookctrl.cxx @@ -35,10 +35,10 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> #include <sfx2/dispatch.hxx> #ifndef _EVENT_HXX //autogen #include <vcl/event.hxx> diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index 6c72511b85..c031c4f546 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -33,9 +33,9 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/urlbmk.hxx> +#include <svl/urlbmk.hxx> #include <tools/urlobj.hxx> #include <sfx2/docfile.hxx> #include <sfx2/dispatch.hxx> diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx index 1ef16d39d0..546b276a5b 100644 --- a/sw/source/ui/utlui/glbltree.cxx +++ b/sw/source/ui/utlui/glbltree.cxx @@ -33,23 +33,23 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <sfx2/fcontnr.hxx> #include <svx/linkmgr.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <sfx2/docfile.hxx> #ifndef _HELP_HXX //autogen #include <vcl/help.hxx> #endif #include <sot/filelist.hxx> -#include <svtools/eitem.hxx> -#include <svtools/urlbmk.hxx> +#include <svl/eitem.hxx> +#include <svl/urlbmk.hxx> #include <svtools/filter.hxx> #include <sfx2/docinsert.hxx> #include <sfx2/filedlghelper.hxx> diff --git a/sw/source/ui/utlui/gloslst.cxx b/sw/source/ui/utlui/gloslst.cxx index 3b1f9dd012..ce6143a817 100644 --- a/sw/source/ui/utlui/gloslst.cxx +++ b/sw/source/ui/utlui/gloslst.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,7 +36,7 @@ #define _SVSTDARR_STRINGSDTOR #define _SVSTDARR_STRINGSISORTDTOR #define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <tools/urlobj.hxx> #include <vcl/dialog.hxx> #include <vcl/msgbox.hxx> @@ -48,9 +48,9 @@ #endif #include <vcl/lstbox.hxx> #ifndef SVTOOLS_FSTATHELPER_HXX -#include <svtools/fstathelper.hxx> +#include <svl/fstathelper.hxx> #endif -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <unotools/transliterationwrapper.hxx> #include <swtypes.hxx> #include <swmodule.hxx> diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx index 9f90efe028..6a2c3f1f30 100644 --- a/sw/source/ui/utlui/initui.cxx +++ b/sw/source/ui/utlui/initui.cxx @@ -54,7 +54,7 @@ #ifndef _DBMGR_HXX #include <dbmgr.hxx> #endif -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include <unomid.h> @@ -169,6 +169,7 @@ ShellResource::ShellResource() aStrAllPageHeadFoot( SW_RES( STR_ALLPAGE_HEADFOOT ) ), aStrNone( SW_RES( STR_TEMPLATE_NONE )), aFixedStr( SW_RES( STR_FIELD_FIXED )), + sDurationFormat( SW_RES( STR_DURATION_FORMAT )), aTOXIndexName( SW_RES(STR_TOI)), aTOXUserName( SW_RES(STR_TOU)), diff --git a/sw/source/ui/utlui/initui.hrc b/sw/source/ui/utlui/initui.hrc index 571ee01134..cfeb63ebda 100644 --- a/sw/source/ui/utlui/initui.hrc +++ b/sw/source/ui/utlui/initui.hrc @@ -64,5 +64,6 @@ #define STR_PAGEDESC_FOLLOWNAME 27 #define STR_HYPERLINK_CLICK 28 #define STR_GETREFFLD_REFITEMNOTFOUND 29 +#define STR_DURATION_FORMAT 30 #endif diff --git a/sw/source/ui/utlui/initui.src b/sw/source/ui/utlui/initui.src index 8111f8259b..55f0a496b8 100644 --- a/sw/source/ui/utlui/initui.src +++ b/sw/source/ui/utlui/initui.src @@ -112,6 +112,10 @@ Resource RID_SW_SHELLRES { Text [ en-US ] = "(fixed)" ; }; + String STR_DURATION_FORMAT + { + Text [en-US] = " Y: %1 M: %2 D: %3 H: %4 M: %5 S: %6"; + }; String STR_TOI { Text [ en-US ] = "Alphabetical Index" ; diff --git a/sw/source/ui/utlui/navicfg.cxx b/sw/source/ui/utlui/navicfg.cxx index 044e5e6d27..7e5bcd7f92 100644 --- a/sw/source/ui/utlui/navicfg.cxx +++ b/sw/source/ui/utlui/navicfg.cxx @@ -139,3 +139,6 @@ void SwNavigationConfig::Commit() PutProperties(aNames, aValues); } +void SwNavigationConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + + diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx index 0338046bea..e42f5205ab 100644 --- a/sw/source/ui/utlui/navipi.cxx +++ b/sw/source/ui/utlui/navipi.cxx @@ -37,10 +37,10 @@ #include <string> // HACK: prevent conflict between STLPORT and Workshop headers #include <tools/list.hxx> -#include <svtools/urlbmk.hxx> -#include <svtools/stritem.hxx> +#include <svl/urlbmk.hxx> +#include <svl/stritem.hxx> #include <svtools/filter.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <sot/formats.hxx> #include <sot/filelist.hxx> #include <sfx2/event.hxx> diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx index d6ea01d58b..5d5bb06349 100644 --- a/sw/source/ui/utlui/numfmtlb.cxx +++ b/sw/source/ui/utlui/numfmtlb.cxx @@ -40,14 +40,14 @@ #include <i18npool/lang.h> #ifndef _ZFORMAT_HXX //autogen #define _ZFORLIST_DECLARE_TABLE -#include <svtools/zformat.hxx> +#include <svl/zformat.hxx> #endif -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <svx/svxids.hrc> #include <svx/numinf.hxx> #include <vcl/msgbox.hxx> #include <svx/flagsdef.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <docsh.hxx> #include <swtypes.hxx> #include <swmodule.hxx> diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx index d338cb6ebb..1cba05bef1 100644 --- a/sw/source/ui/utlui/swrenamexnameddlg.cxx +++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx @@ -57,7 +57,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <comphelper/processfactory.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <shellio.hxx> #include <docsh.hxx> #include <view.hxx> diff --git a/sw/source/ui/utlui/tmplctrl.cxx b/sw/source/ui/utlui/tmplctrl.cxx index 0ce43a8858..05cf66e911 100644 --- a/sw/source/ui/utlui/tmplctrl.cxx +++ b/sw/source/ui/utlui/tmplctrl.cxx @@ -34,11 +34,11 @@ // include --------------------------------------------------------------- -#include <svtools/style.hxx> +#include <svl/style.hxx> #ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> #endif -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <sfx2/dispatch.hxx> #ifndef _STATUS_HXX //autogen #include <vcl/status.hxx> diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index e9dcc6785a..755a07a058 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -37,9 +37,9 @@ #include <tools/datetime.hxx> #include <vcl/svapp.hxx> #include <unotools/collatorwrapper.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/stritem.hxx> -#include <svtools/syslocale.hxx> +#include <svl/urihelper.hxx> +#include <svl/stritem.hxx> +#include <unotools/syslocale.hxx> #include <sfx2/app.hxx> #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> @@ -51,7 +51,7 @@ #include <svx/sizeitem.hxx> #include <svx/pageitem.hxx> #include <svx/lrspitem.hxx> -#include <svtools/style.hxx> +#include <svl/style.hxx> #ifndef _VCL_LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> #endif diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx index a6cf3444a3..9e38253d32 100644 --- a/sw/source/ui/utlui/unotools.cxx +++ b/sw/source/ui/utlui/unotools.cxx @@ -53,7 +53,7 @@ #include <com/sun/star/frame/XLayoutManager.hpp> #include <comphelper/processfactory.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <shellio.hxx> #include <docsh.hxx> #include <view.hxx> diff --git a/sw/source/ui/utlui/viewlayoutctrl.cxx b/sw/source/ui/utlui/viewlayoutctrl.cxx index d4b6e20f7c..23478588f5 100644 --- a/sw/source/ui/utlui/viewlayoutctrl.cxx +++ b/sw/source/ui/utlui/viewlayoutctrl.cxx @@ -38,7 +38,7 @@ #include <vcl/status.hxx> #endif #include <vcl/image.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <svx/viewlayoutitem.hxx> #ifndef _UTLUI_HRC #include <utlui.hrc> diff --git a/sw/source/ui/utlui/zoomctrl.cxx b/sw/source/ui/utlui/zoomctrl.cxx index 26f7a9c2ce..7a49743b46 100644 --- a/sw/source/ui/utlui/zoomctrl.cxx +++ b/sw/source/ui/utlui/zoomctrl.cxx @@ -39,7 +39,7 @@ #include <vcl/status.hxx> #endif #include <sfx2/app.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <svx/zoomitem.hxx> #include "swtypes.hxx" diff --git a/sw/source/ui/vba/vbaaddins.cxx b/sw/source/ui/vba/vbaaddins.cxx index a450a1b6f2..351bda2830 100644 --- a/sw/source/ui/vba/vbaaddins.cxx +++ b/sw/source/ui/vba/vbaaddins.cxx @@ -30,7 +30,7 @@ #include "vbaaddins.hxx" #include "vbaaddin.hxx" #include <cppuhelper/implbase3.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <com/sun/star/lang/XMultiComponentFactory.hpp> #include <com/sun/star/ucb/XSimpleFileAccess.hpp> diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx index 583fc6a964..e7f0a00645 100644 --- a/sw/source/ui/wrtsh/select.cxx +++ b/sw/source/ui/wrtsh/select.cxx @@ -35,8 +35,8 @@ #include <limits.h> #include <hintids.hxx> #include <sfx2/bindings.hxx> -#include <svtools/eitem.hxx> -#include <svtools/macitem.hxx> +#include <svl/eitem.hxx> +#include <svl/macitem.hxx> #include <unotools/charclass.hxx> #include <svx/scripttypeitem.hxx> #include <cmdid.h> diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 6294722f46..f372bebac0 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -44,7 +44,7 @@ #include <hintids.hxx> #include <svx/svdview.hxx> #include <sot/factory.hxx> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #ifndef _SOUND_HXX //autogen #include <vcl/sound.hxx> #endif @@ -56,7 +56,7 @@ #include <svtools/ehdl.hxx> #include <svtools/soerr.hxx> #include <tools/cachestr.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <svx/sizeitem.hxx> #include <svx/brkitem.hxx> #include <svx/svxacorr.hxx> diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx index 0927372db9..6738faa0d5 100644 --- a/sw/source/ui/wrtsh/wrtsh2.cxx +++ b/sw/source/ui/wrtsh/wrtsh2.cxx @@ -32,12 +32,12 @@ #include "precompiled_sw.hxx" #include <hintids.hxx> // define ITEMIDs -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <sfx2/frame.hxx> #include <vcl/msgbox.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/urihelper.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <sfx2/docfile.hxx> #include <sfx2/fcontnr.hxx> #include <sfx2/dispatch.hxx> diff --git a/sw/source/ui/wrtsh/wrtundo.cxx b/sw/source/ui/wrtsh/wrtundo.cxx index 63aa5bfb42..f90dd3606a 100644 --- a/sw/source/ui/wrtsh/wrtundo.cxx +++ b/sw/source/ui/wrtsh/wrtundo.cxx @@ -36,7 +36,7 @@ #define _SVSTDARR_STRINGSDTOR #include <tools/resid.hxx> #include <sfx2/app.hxx> -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #include <wrtsh.hxx> #include <swundo.hxx> // fuer Undo-Ids #include <swdtflvr.hxx> diff --git a/sw/uiconfig/sglobal/toolbar/previewobjectbar.xml b/sw/uiconfig/sglobal/toolbar/previewobjectbar.xml index a1a2c2f84f..f0dc732d4e 100644 --- a/sw/uiconfig/sglobal/toolbar/previewobjectbar.xml +++ b/sw/uiconfig/sglobal/toolbar/previewobjectbar.xml @@ -19,7 +19,6 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FullScreen" toolbar:helpid="5627"/> <toolbar:toolbaritem xlink:href=".uno:PrintPagePreView" toolbar:helpid="21253"/> - <toolbar:toolbaritem xlink:href=".uno:PreviewPrintOptions" toolbar:helpid="20250"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:ClosePreview" toolbar:helpid="5325"/> </toolbar:toolbar> diff --git a/sw/uiconfig/sweb/toolbar/previewobjectbar.xml b/sw/uiconfig/sweb/toolbar/previewobjectbar.xml index a1c2fe8ded..5c6d305226 100644 --- a/sw/uiconfig/sweb/toolbar/previewobjectbar.xml +++ b/sw/uiconfig/sweb/toolbar/previewobjectbar.xml @@ -19,7 +19,6 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FullScreen" toolbar:helpid="5627"/> <toolbar:toolbaritem xlink:href=".uno:PrintPagePreView" toolbar:helpid="21253"/> - <toolbar:toolbaritem xlink:href=".uno:PreviewPrintOptions" toolbar:helpid="20250"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:ClosePreview" toolbar:helpid="5325"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swform/toolbar/previewobjectbar.xml b/sw/uiconfig/swform/toolbar/previewobjectbar.xml index 8278110f8e..435250b63a 100644 --- a/sw/uiconfig/swform/toolbar/previewobjectbar.xml +++ b/sw/uiconfig/swform/toolbar/previewobjectbar.xml @@ -19,7 +19,6 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FullScreen" toolbar:helpid="5627"/> <toolbar:toolbaritem xlink:href=".uno:PrintPagePreView" toolbar:helpid="21253"/> - <toolbar:toolbaritem xlink:href=".uno:PreviewPrintOptions" toolbar:helpid="20250"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:ClosePreview" toolbar:helpid="5325"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swreport/toolbar/previewobjectbar.xml b/sw/uiconfig/swreport/toolbar/previewobjectbar.xml index 8278110f8e..435250b63a 100644 --- a/sw/uiconfig/swreport/toolbar/previewobjectbar.xml +++ b/sw/uiconfig/swreport/toolbar/previewobjectbar.xml @@ -19,7 +19,6 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FullScreen" toolbar:helpid="5627"/> <toolbar:toolbaritem xlink:href=".uno:PrintPagePreView" toolbar:helpid="21253"/> - <toolbar:toolbaritem xlink:href=".uno:PreviewPrintOptions" toolbar:helpid="20250"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:ClosePreview" toolbar:helpid="5325"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swriter/toolbar/previewobjectbar.xml b/sw/uiconfig/swriter/toolbar/previewobjectbar.xml index 8278110f8e..435250b63a 100644 --- a/sw/uiconfig/swriter/toolbar/previewobjectbar.xml +++ b/sw/uiconfig/swriter/toolbar/previewobjectbar.xml @@ -19,7 +19,6 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FullScreen" toolbar:helpid="5627"/> <toolbar:toolbaritem xlink:href=".uno:PrintPagePreView" toolbar:helpid="21253"/> - <toolbar:toolbaritem xlink:href=".uno:PreviewPrintOptions" toolbar:helpid="20250"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:ClosePreview" toolbar:helpid="5325"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swxform/toolbar/previewobjectbar.xml b/sw/uiconfig/swxform/toolbar/previewobjectbar.xml index 8278110f8e..435250b63a 100644 --- a/sw/uiconfig/swxform/toolbar/previewobjectbar.xml +++ b/sw/uiconfig/swxform/toolbar/previewobjectbar.xml @@ -19,7 +19,6 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FullScreen" toolbar:helpid="5627"/> <toolbar:toolbaritem xlink:href=".uno:PrintPagePreView" toolbar:helpid="21253"/> - <toolbar:toolbaritem xlink:href=".uno:PreviewPrintOptions" toolbar:helpid="20250"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:ClosePreview" toolbar:helpid="5325"/> </toolbar:toolbar> diff --git a/sw/util/makefile.mk b/sw/util/makefile.mk index 013dd4a09a..08afadc106 100644 --- a/sw/util/makefile.mk +++ b/sw/util/makefile.mk @@ -43,10 +43,6 @@ USE_DEFFILE=TRUE # --- Allgemein ----------------------------------------------------------- -.IF "$(OS)"=="IRIX" -LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=40 -.ENDIF - sw_res_files= \ $(SRS)$/app.srs \ $(SRS)$/dialog.srs \ @@ -149,6 +145,7 @@ DEF2NAME= $(SHL2TARGET) SHL2STDLIBS= \ $(SFX2LIB) \ $(SVTOOLLIB) \ + $(UNOTOOLSLIB) \ $(SVLLIB) \ $(VCLLIB) \ $(SOTLIB) \ @@ -164,7 +161,7 @@ SHL2OBJS= $(SLO)$/swdetect.obj \ $(SLO)$/detreg.obj \ $(SLO)$/iodetect.obj -.IF "$(product)"=="" +.IF "$(dbgutil)"!="" SHL2OBJS+= \ $(SLO)$/errhdl.obj .ENDIF @@ -322,7 +319,7 @@ DEF4NAME=$(SHL4TARGET) SHL4STDLIBS= \ $(ISWLIB) \ $(SVXCORELIB) \ - $(SVXMSFILTERLIB) \ + $(MSFILTERLIB) \ $(SFXLIB) \ $(GOODIESLIB) \ $(BASEGFXLIB) \ diff --git a/sw/util/msword.map b/sw/util/msword.map index 53c3eaf213..db60fc5ce8 100644 --- a/sw/util/msword.map +++ b/sw/util/msword.map @@ -4,7 +4,8 @@ MSWORD_1_0 { ExportRTF; ImportDOC; ExportDOC; - + SaveOrDelMSVBAStorage_ww8; + GetSaveWarningOfMSVBAStorage_ww8; local: *; }; |