diff options
author | Michael Stahl <mst@openoffice.org> | 2010-04-28 17:52:28 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-04-28 17:52:28 +0200 |
commit | 27bf4a7f0b5b4b182ef40553189e040b0a852c38 (patch) | |
tree | 5794315c923f6d1bfcb5bddbe932dd245bca682c | |
parent | 5e4d820d2b55adc2f7e5a7e85b466cb77bdf88d6 (diff) | |
parent | 0cb776d2f4613762487a3d6f90e90d1cbd5ff389 (diff) |
merge DEV300_m77
176 files changed, 3065 insertions, 4154 deletions
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index ec2f41305e..fb2aa9d994 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -168,7 +168,7 @@ public: using SotObject::GetInterface; SFX_DECL_OBJECTFACTORY(); - SmDocShell(SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED, const sal_Bool _bScriptSupport = sal_True); + SmDocShell( const sal_uInt64 i_nSfxCreationFlags ); virtual ~SmDocShell(); void LoadSymbols(); diff --git a/starmath/prj/build.lst b/starmath/prj/build.lst index cb6fd93584..cbfff67724 100644 --- a/starmath/prj/build.lst +++ b/starmath/prj/build.lst @@ -6,3 +6,4 @@ sm starmath\res get - all sm_res NULL sm starmath\sdi nmake - all sm_sdi NULL sm starmath\source nmake - all sm_sorce sm_sdi sm_inc NULL sm starmath\util nmake - all sm_util sm_sorce NULL +sm starmath\qa\unoapi nmake - all sm_qa_unoapi NULL diff --git a/starmath/qa/unoapi/Test.java b/starmath/qa/unoapi/Test.java new file mode 100644 index 0000000000..520491da3a --- /dev/null +++ b/starmath/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.starmath.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "sm.sce", "-xcl", "knownissues.xcl", "-cs", + connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/starmath/qa/unoapi/makefile.mk b/starmath/qa/unoapi/makefile.mk index 93169ee517..68fcfe7448 100644 --- a/starmath/qa/unoapi/makefile.mk +++ b/starmath/qa/unoapi/makefile.mk @@ -1,7 +1,6 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -22,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=starmath -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = starmath +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/starmath/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce sm.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index 10ba6f9fbd..c9972a9702 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -1158,6 +1158,10 @@ XubString SmTextForwarder::CalcFieldValue( const SvxFieldItem& rField, USHORT nP return aTxt; } +void SmTextForwarder::FieldClicked(const SvxFieldItem&, USHORT, USHORT) +{ +} + USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, USHORT nWhich ) { EECharAttribArray aAttribs; diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx index f031f0d9b5..d50d181090 100644 --- a/starmath/source/accessibility.hxx +++ b/starmath/source/accessibility.hxx @@ -236,6 +236,7 @@ public: virtual SfxItemPool* GetPool() const; virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ); + virtual void FieldClicked(const SvxFieldItem&, USHORT, USHORT); virtual BOOL IsValid() const; virtual LanguageType GetLanguage( USHORT, USHORT ) const; diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index b01120bf2f..c4c1af898e 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -676,8 +676,8 @@ void SmDocShell::Repaint() } -SmDocShell::SmDocShell(SfxObjectCreateMode eMode,const sal_Bool _bScriptSupport) : - SfxObjectShell(eMode), +SmDocShell::SmDocShell( const sal_uInt64 i_nSfxCreationFlags ) : + SfxObjectShell( i_nSfxCreationFlags ), pTree ( 0 ), pEditEngineItemPool ( 0 ), pEditEngine ( 0 ), @@ -696,12 +696,7 @@ SmDocShell::SmDocShell(SfxObjectCreateMode eMode,const sal_Bool _bScriptSupport) StartListening(aFormat); StartListening(*pp->GetConfig()); - if ( !_bScriptSupport ) - SetHasNoBasic(); - - SetModel( new SmModel(this) ); //! das hier mit new erzeugte Model brauch - //! im Destruktor nicht explizit geloescht werden. - //! Dies erledigt das Sfx. + SetBaseModel( new SmModel(this) ); } diff --git a/starmath/source/makefile.mk b/starmath/source/makefile.mk index c3091423c1..a69a900107 100644 --- a/starmath/source/makefile.mk +++ b/starmath/source/makefile.mk @@ -85,6 +85,7 @@ SLOFILES = \ $(SLO2FILES) EXCEPTIONSFILES = \ + $(SLO)$/register.obj \ $(SLO)$/accessibility.obj \ $(SLO)$/cfgitem.obj \ $(SLO)$/document.obj \ diff --git a/starmath/source/smres.src b/starmath/source/smres.src index b14bcef63d..ae6bb31fd0 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -3559,7 +3559,7 @@ StringArray RID_PRINTUIOPTIONS { < "%PRODUCTNAME %s"; >; < "Contents"; >; - < "~Title row"; >; + < "~Title"; >; < "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."; >; diff --git a/starmath/source/unodoc.cxx b/starmath/source/unodoc.cxx index 180c3581cd..c857b44302 100644 --- a/starmath/source/unodoc.cxx +++ b/starmath/source/unodoc.cxx @@ -61,10 +61,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmDocument_createInstance( if ( !SM_MOD() ) SmDLL::Init(); - const SfxObjectCreateMode eCreateMode = ( _nCreationFlags & SFXMODEL_EMBEDDED_OBJECT ) ? SFX_CREATE_MODE_EMBEDDED : SFX_CREATE_MODE_STANDARD; - const bool bScriptSupport = ( _nCreationFlags & SFXMODEL_DISABLE_EMBEDDED_SCRIPTS ) == 0; - - SfxObjectShell* pShell = new SmDocShell( eCreateMode, bScriptSupport ); + SfxObjectShell* pShell = new SmDocShell( _nCreationFlags ); if( pShell ) return uno::Reference< uno::XInterface >( pShell->GetModel() ); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index ffd9413cec..d8d6c657b0 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -350,7 +350,7 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt) void SmGraphicWindow::Command(const CommandEvent& rCEvt) { BOOL bCallBase = TRUE; - if ( !pViewShell->GetViewFrame()->GetFrame()->IsInPlace() ) + if ( !pViewShell->GetViewFrame()->GetFrame().IsInPlace() ) { switch ( rCEvt.GetCommand() ) { @@ -1610,7 +1610,7 @@ void SmViewShell::Execute(SfxRequest& rReq) case SID_ATTR_ZOOM: { - if ( !GetViewFrame()->GetFrame()->IsInPlace() ) + if ( !GetViewFrame()->GetFrame().IsInPlace() ) { //CHINA001 SvxZoomDialog *pDlg = 0; AbstractSvxZoomDialog *pDlg = 0; @@ -1737,7 +1737,7 @@ void SmViewShell::GetState(SfxItemSet &rSet) case SID_ZOOMIN: case SID_ZOOMOUT: case SID_FITINWINDOW: - if ( GetViewFrame()->GetFrame()->IsInPlace() ) + if ( GetViewFrame()->GetFrame().IsInPlace() ) rSet.DisableItem( nWh ); break; @@ -1781,7 +1781,7 @@ void SmViewShell::GetState(SfxItemSet &rSet) SmViewShell::SmViewShell(SfxViewFrame *pFrame_, SfxViewShell *): - SfxViewShell(pFrame_, SFX_VIEW_DISABLE_ACCELS | SFX_VIEW_MAXIMIZE_FIRST | SFX_VIEW_HAS_PRINTOPTIONS | SFX_VIEW_CAN_PRINT), + SfxViewShell(pFrame_, SFX_VIEW_HAS_PRINTOPTIONS | SFX_VIEW_CAN_PRINT), aGraphic(this), aGraphicController(aGraphic, SID_GAPHIC_SM, pFrame_->GetBindings()), pImpl( new SmViewShell_Impl ) diff --git a/starmath/util/makefile.mk b/starmath/util/makefile.mk index 09e7382994..1ba52411d7 100644 --- a/starmath/util/makefile.mk +++ b/starmath/util/makefile.mk @@ -48,7 +48,7 @@ RESLIB1SRSFILES=\ SHL1TARGET= sm$(DLLPOSTFIX) SHL1IMPLIB= smimp -SHL1VERSIONMAP= sm.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) @@ -73,7 +73,7 @@ SHL1STDLIBS= \ SHL2TARGET= smd$(DLLPOSTFIX) SHL2IMPLIB= smdimp -SHL2VERSIONMAP= sm.map +SHL2VERSIONMAP=$(SOLARENV)/src/component.map SHL2DEF=$(MISC)$/$(SHL2TARGET).def DEF2NAME= $(SHL2TARGET) @@ -90,7 +90,7 @@ SHL2STDLIBS= \ $(SALLIB) SHL2DEPN= makefile.mk -SHL2VERSIONMAP= smd.map +SHL2VERSIONMAP=$(SOLARENV)/src/component.map SHL2OBJS= $(SLO)$/smdetect.obj \ $(SLO)$/detreg.obj \ $(SLO)$/eqnolefilehdr.obj diff --git a/starmath/util/sm.map b/starmath/util/sm.map deleted file mode 100644 index 62f014e12b..0000000000 --- a/starmath/util/sm.map +++ /dev/null @@ -1,8 +0,0 @@ -SM_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/starmath/util/smd.map b/starmath/util/smd.map deleted file mode 100644 index 62f014e12b..0000000000 --- a/starmath/util/smd.map +++ /dev/null @@ -1,8 +0,0 @@ -SM_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index 8239be80b8..3ac4ffb52c 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -83,6 +83,13 @@ class IDocumentMarkAccess const ::rtl::OUString& rProposedName, MarkType eMark) =0; + virtual sw::mark::IFieldmark* makeFieldBookmark( const SwPaM& rPaM, + const rtl::OUString& rName, + const rtl::OUString& rType) = 0; + virtual sw::mark::IFieldmark* makeNoTextFieldBookmark( const SwPaM& rPaM, + const rtl::OUString& rName, + const rtl::OUString& rType) = 0; + /** Returns a mark in the document for a paragraph. If there is none, a mark will be created. diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx index 7f7e8cf2e8..3700e4beb2 100644 --- a/sw/inc/IMark.hxx +++ b/sw/inc/IMark.hxx @@ -31,6 +31,7 @@ #include <calbck.hxx> #include <pam.hxx> #include <boost/operators.hpp> +#include <map> #ifndef SW_DECL_SWSERVEROBJECT_DEFINED #define SW_DECL_SWSERVEROBJECT_DEFINED @@ -76,6 +77,8 @@ namespace sw { namespace mark { return GetMarkEnd() < rPos; } bool EndsAfter(const SwPosition& rPos) const { return GetMarkEnd() > rPos; } + + virtual rtl::OUString ToString( ) const =0; }; class IBookmark @@ -92,13 +95,17 @@ namespace sw { namespace mark : virtual public IMark { public: + typedef ::std::map< ::rtl::OUString, ::com::sun::star::uno::Any> parameter_map_t; //getters virtual ::rtl::OUString GetFieldname() const =0; virtual ::rtl::OUString GetFieldHelptext() const =0; + virtual parameter_map_t* GetParameters() =0; + virtual const parameter_map_t* GetParameters() const =0; //setters virtual void SetFieldname(const ::rtl::OUString& rFieldname) =0; virtual void SetFieldHelptext(const ::rtl::OUString& rFieldHelptext) =0; + virtual void Invalidate() = 0; }; class ICheckboxFieldmark diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 6fb9794893..d8683707b7 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -31,13 +31,13 @@ #include <tools/link.hxx> #include <tools/rtti.hxx> #include "swdllapi.h" -#include <swtypes.hxx> // fuer SWPOSDOC -#include <viewsh.hxx> // fuer ViewShell -#include <calbck.hxx> // fuer SwClient -#include <cshtyp.hxx> // fuer die CursorShell Typen -#include <crstate.hxx> // fuer die CursorMove-Staties -#include <toxe.hxx> // SwTOXSearchDir -#include <tblsel.hxx> //SwTblSearchType +#include <swtypes.hxx> // fuer SWPOSDOC +#include <viewsh.hxx> // fuer ViewShell +#include <calbck.hxx> // fuer SwClient +#include <cshtyp.hxx> // fuer die CursorShell Typen +#include <crstate.hxx> // fuer die CursorMove-Staties +#include <toxe.hxx> // SwTOXSearchDir +#include <tblsel.hxx> //SwTblSearchType #include <viscrs.hxx> #include <node.hxx> #include <tblsel.hxx> @@ -107,10 +107,11 @@ struct SwContentAtPos SW_REFMARK = 0x0100, SW_NUMLABEL = 0x0200, // #i23726# SW_CONTENT_CHECK = 0x0400, // --> FME 2005-05-13 #i43742# <-- - SW_SMARTTAG = 0x0800 -#ifdef DBG_UTIL - ,SW_CURR_ATTRS = 0x4000 // nur zum Debuggen - ,SW_TABLEBOXVALUE = 0x8000 // nur zum Debuggen + SW_SMARTTAG = 0x0800, + SW_FORMCTRL = 0x1000 +#ifndef PRODUCT + ,SW_CURR_ATTRS = 0x4000 // nur zum Debuggen + ,SW_TABLEBOXVALUE = 0x8000 // nur zum Debuggen #endif } eCntntAtPos; @@ -119,6 +120,7 @@ struct SwContentAtPos const SfxPoolItem* pAttr; const SwRedline* pRedl; SwCntntNode * pNode; // #i23726# + const sw::mark::IFieldmark* pFldmark; } aFnd; int nDist; // #i23726# @@ -162,45 +164,45 @@ public: // public, damit defaultet werden kann !! /* ein enum fuer den Aufruf von UpdateCrsr */ enum CrsrFlag { - UPDOWN = (1 << 0), // Up/Down auf Spalte halten - SCROLLWIN = (1 << 1), // Window Scrollen - CHKRANGE = (1 << 2), // ueberpruefen von ueberlappenden PaM's - NOCALRECT = (1 << 3), // CharRect nicht neu berechnen - READONLY = (1 << 4) // Sichtbar machen trotz Readonly + UPDOWN = (1 << 0), // Up/Down auf Spalte halten + SCROLLWIN = (1 << 1), // Window Scrollen + CHKRANGE = (1 << 2), // ueberpruefen von ueberlappenden PaM's + NOCALRECT = (1 << 3), // CharRect nicht neu berechnen + READONLY = (1 << 4) // Sichtbar machen trotz Readonly }; private: - SwRect aCharRect; // Char-SRectangle auf dem der Cursor steht - Point aCrsrHeight; // Hohe&Offset von sichtbaren Cursor - Point aOldRBPos; // Right/Bottom von letzter VisArea + SwRect aCharRect; // Char-SRectangle auf dem der Cursor steht + Point aCrsrHeight; // Hohe&Offset von sichtbaren Cursor + Point aOldRBPos; // Right/Bottom von letzter VisArea // (wird im Invalidate vom Cursor benutzt) // um event. Macro was anhaengt auszufuehren. - Link aFlyMacroLnk; // Link will be called, if the Crsr is set + Link aFlyMacroLnk; // Link will be called, if the Crsr is set // into a fly. A macro can be then becalled - Link aChgLnk; // link will be called by every attribut/ + Link aChgLnk; // link will be called by every attribut/ // format changes at cursor position. - Link aGrfArrivedLnk; // Link calls to UI if a grafik is arrived + Link aGrfArrivedLnk; // Link calls to UI if a grafik is arrived - SwShellCrsr* pCurCrsr; // der aktuelle Cursor - SwShellCrsr* pCrsrStk; // Stack fuer den Cursor + SwShellCrsr* pCurCrsr; // der aktuelle Cursor + SwShellCrsr* pCrsrStk; // Stack fuer den Cursor SwVisCrsr *pVisCrsr; // der Sichtbare-Cursor IBlockCursor *pBlockCrsr; // interface of cursor for block (=rectangular) selection - SwShellTableCrsr* pTblCrsr; // Tabellen-Crsr; nur in Tabellen, wenn + SwShellTableCrsr* pTblCrsr; // Tabellen-Crsr; nur in Tabellen, wenn // die Selection ueber 2 Spalten liegt - SwNodeIndex* pBoxIdx; // fuers erkennen der veraenderten - SwTableBox* pBoxPtr; // Tabellen-Zelle + SwNodeIndex* pBoxIdx; // fuers erkennen der veraenderten + SwTableBox* pBoxPtr; // Tabellen-Zelle - long nUpDownX; // versuche den Cursor bei Up/Down immer in + long nUpDownX; // versuche den Cursor bei Up/Down immer in // der gleichen Spalte zu bewegen long nLeftFrmPos; - ULONG nAktNode; // save CursorPos at Start-Action + ULONG nAktNode; // save CursorPos at Start-Action xub_StrLen nAktCntnt; USHORT nAktNdTyp; bool bAktSelection; @@ -212,8 +214,8 @@ private: * Cursorbewegungen (ueber Find()) realisiert werden. */ USHORT nCrsrMove; - USHORT nBasicActionCnt; // Actions, die vom Basic geklammert wurden - CrsrMoveState eMvState; // Status fuers Crsr-Travelling - GetCrsrOfst + USHORT nBasicActionCnt; // Actions, die vom Basic geklammert wurden + CrsrMoveState eMvState; // Status fuers Crsr-Travelling - GetCrsrOfst // --> OD 2008-04-02 #refactorlists# String sMarkedListId; @@ -221,27 +223,27 @@ private: // <-- BOOL bHasFocus : 1; // Shell ist in einem Window "aktiv" - BOOL bSVCrsrVis : 1; // SV-Cursor Un-/Sichtbar - BOOL bChgCallFlag : 1; // Attributaenderung innerhalb von + BOOL bSVCrsrVis : 1; // SV-Cursor Un-/Sichtbar + BOOL bChgCallFlag : 1; // Attributaenderung innerhalb von // Start- und EndAction - BOOL bVisPortChgd : 1; // befindet sich im VisPortChg-Aufruf + BOOL bVisPortChgd : 1; // befindet sich im VisPortChg-Aufruf // (wird im Invalidate vom Cursor benutzt) - BOOL bCallChgLnk : 1; // Flag fuer abgeleitete Klassen: + BOOL bCallChgLnk : 1; // Flag fuer abgeleitete Klassen: // TRUE -> ChgLnk callen // Zugriff nur ueber SwChgLinkFlag - BOOL bAllProtect : 1; // Flag fuer Bereiche + BOOL bAllProtect : 1; // Flag fuer Bereiche // TRUE -> alles geschuetzt / versteckt - BOOL bInCMvVisportChgd : 1; // Flag fuer CrsrMoves + BOOL bInCMvVisportChgd : 1; // Flag fuer CrsrMoves // TRUE -> die Sicht wurde verschoben - BOOL bGCAttr : 1; // TRUE -> es existieren nichtaufgespannte Attr. - BOOL bIgnoreReadonly : 1; // TRUE -> Beim naechsten EndAction trotz + BOOL bGCAttr : 1; // TRUE -> es existieren nichtaufgespannte Attr. + BOOL bIgnoreReadonly : 1; // TRUE -> Beim naechsten EndAction trotz // Readonly den Crsr sichtbar machen. - BOOL bSelTblCells : 1; // TRUE -> Zellen uebers InputWin selektieren - BOOL bAutoUpdateCells : 1; // TRUE -> Zellen werden autoformatiert - BOOL bBasicHideCrsr : 1; // TRUE -> HideCrsr vom Basic + BOOL bSelTblCells : 1; // TRUE -> Zellen uebers InputWin selektieren + BOOL bAutoUpdateCells : 1; // TRUE -> Zellen werden autoformatiert + BOOL bBasicHideCrsr : 1; // TRUE -> HideCrsr vom Basic BOOL bSetCrsrInReadOnly : 1;// TRUE -> Cursor darf in ReadOnly-Bereiche - BOOL bOverwriteCrsr : 1; // TRUE -> show Overwrite Crsr + BOOL bOverwriteCrsr : 1; // TRUE -> show Overwrite Crsr // OD 11.02.2003 #100556# - flag to allow/avoid execution of marcos (default: true) bool mbMacroExecAllowed : 1; @@ -346,11 +348,11 @@ public: SwPaM* GetCrsr( BOOL bMakeTblCrsr = TRUE ) const; inline SwCursor* GetSwCrsr( BOOL bMakeTblCrsr = TRUE ) const; // nur den akt. Cursor returnen - SwShellCrsr* _GetCrsr() { return pCurCrsr; } - const SwShellCrsr* _GetCrsr() const { return pCurCrsr; } + SwShellCrsr* _GetCrsr() { return pCurCrsr; } + const SwShellCrsr* _GetCrsr() const { return pCurCrsr; } // uebergebenen Cursor anzeigen - fuer UNO - void SetSelection(const SwPaM& rCrsr); + void SetSelection(const SwPaM& rCrsr); // alle Cursor aus den ContentNodes entfernen und auf 0 setzen. // Wurde aus der FEShell hierher verschoben. @@ -366,7 +368,7 @@ public: void EndAction( const BOOL bIdleEnd = FALSE ); // Basiscursortravelling - long GetUpDownX() const { return nUpDownX; } + long GetUpDownX() const { return nUpDownX; } BOOL Left( USHORT nCnt, USHORT nMode, BOOL bAllowVisual = FALSE ) { return LeftRight( TRUE, nCnt, nMode, bAllowVisual ); } @@ -406,8 +408,8 @@ public: // Positionieren des Cursors // returnt - // CRSR_POSCHG: wenn der ob der SPoint vom Layout korrigiert wurde. - // CRSR_POSOLD: wenn der Crsr nicht veraendert wurde + // CRSR_POSCHG: wenn der ob der SPoint vom Layout korrigiert wurde. + // CRSR_POSOLD: wenn der Crsr nicht veraendert wurde int SetCrsr( const Point &rPt, BOOL bOnlyText = FALSE, bool bBlock = true ); @@ -442,18 +444,18 @@ public: void SwapPam(); BOOL ChgCurrPam( const Point & rPt, - BOOL bTstOnly = TRUE, //Nur testen, nicht setzen - BOOL bTstHit = FALSE ); //Nur genaue Treffer + BOOL bTstOnly = TRUE, //Nur testen, nicht setzen + BOOL bTstHit = FALSE ); //Nur genaue Treffer void KillPams(); // erzeuge eine Kopie vom Cursor und speicher diese im Stack void Push(); /* * Loescht einen Cursor (gesteuert durch bOldCrsr) - * - vom Stack oder ( bOldCrsr = TRUE ) - * - den aktuellen und der auf dem Stack stehende wird zum aktuellen + * - vom Stack oder ( bOldCrsr = TRUE ) + * - den aktuellen und der auf dem Stack stehende wird zum aktuellen * - * Return: es war auf dem Stack noch einer vorhanden + * Return: es war auf dem Stack noch einer vorhanden */ BOOL Pop( BOOL bOldCrsr = TRUE ); /* @@ -508,7 +510,7 @@ public: // Methoden fuer aFlyMacroLnk void SetFlyMacroLnk( const Link& rLnk ) { aFlyMacroLnk = rLnk; } - const Link& GetFlyMacroLnk() const { return aFlyMacroLnk; } + const Link& GetFlyMacroLnk() const { return aFlyMacroLnk; } // Methoden geben/aendern den Link fuer die Attribut/Format-Aenderungen void SetChgLnk( const Link &rLnk ) { aChgLnk = rLnk; } @@ -642,8 +644,8 @@ public: BOOL MakeOutlineSel( USHORT nSttPos, USHORT nEndPos, BOOL bWithChilds = FALSE ); - BOOL GotoNextOutline(); // naechster Node mit Outline-Num. - BOOL GotoPrevOutline(); // vorheriger Node mit Outline-Num. + BOOL GotoNextOutline(); // naechster Node mit Outline-Num. + BOOL GotoPrevOutline(); // vorheriger Node mit Outline-Num. /** Delivers the current shell cursor @@ -676,14 +678,14 @@ public: SwShellTableCrsr* GetTableCrsr() { return pTblCrsr; } USHORT UpdateTblSelBoxes(); - BOOL GotoFtnTxt(); // springe aus dem Content zur Fussnote - BOOL GotoFtnAnchor(); // springe aus der Fussnote zum Anker + BOOL GotoFtnTxt(); // springe aus dem Content zur Fussnote + BOOL GotoFtnAnchor(); // springe aus der Fussnote zum Anker BOOL GotoPrevFtnAnchor(); BOOL GotoNextFtnAnchor(); - BOOL GotoFlyAnchor(); // springe aus dem Rahmen zum Anker - BOOL GotoHeaderTxt(); // springe aus dem Content zum Header - BOOL GotoFooterTxt(); // springe aus dem Content zum Footer + BOOL GotoFlyAnchor(); // springe aus dem Rahmen zum Anker + BOOL GotoHeaderTxt(); // springe aus dem Content zum Header + BOOL GotoFooterTxt(); // springe aus dem Content zum Footer // springe in den Header/Footer des angegebenen oder akt. PageDesc BOOL SetCrsrInHdFt( USHORT nDescNo = USHRT_MAX, BOOL bInHeader = TRUE ); @@ -695,7 +697,7 @@ public: BOOL GotoNextTOXBase( const String* = 0 ); // springe zum vorherigen Verzeichnis [mit dem Namen] BOOL GotoPrevTOXBase( const String* = 0 ); - BOOL GotoTOXMarkBase(); // springe zum Verzeichnis vom TOXMark + BOOL GotoTOXMarkBase(); // springe zum Verzeichnis vom TOXMark // springe zum naechsten (vorherigen) Verzeichniseintrag BOOL GotoNxtPrvTOXMark( BOOL bNext = TRUE ); // Zur naechsten/ vorherigen Verzeichnismarke dieses Typs traveln @@ -779,7 +781,7 @@ public: BOOL ChgCrsrTimerFlag( BOOL bTimerOn = TRUE ); #endif - BOOL BasicActionPend() const { return nBasicActionCnt != nStartAction; } + BOOL BasicActionPend() const { return nBasicActionCnt != nStartAction; } // springe zum benannten Bereich BOOL GotoRegion( const String& rName ); @@ -828,9 +830,9 @@ public: virtual void NewCoreSelection(); void SetSelTblCells( BOOL bFlag ) { bSelTblCells = bFlag; } - BOOL IsSelTblCells() const { return bSelTblCells; } + BOOL IsSelTblCells() const { return bSelTblCells; } - BOOL IsAutoUpdateCells() const { return bAutoUpdateCells; } + BOOL IsAutoUpdateCells() const { return bAutoUpdateCells; } void SetAutoUpdateCells( BOOL bFlag ) { bAutoUpdateCells = bFlag; } BOOL GetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode, diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx index 7e2203ac1a..9415f14947 100644 --- a/sw/inc/dcontact.hxx +++ b/sw/inc/dcontact.hxx @@ -302,7 +302,7 @@ class SwDrawVirtObj : public SdrVirtObj using SdrVirtObj::GetPlusHdl; - private: + protected: // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is // not used but something own (top left of new SnapRect minus top left // of original SnapRect) diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 68511add6b..0f1a15be56 100644..100755 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -151,7 +151,8 @@ public: static rtl::OUString GetEventName( sal_Int32 nId ); //Das Doc wird fuer SO-Datenaustausch benoetigt! - SwDocShell( SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED, sal_Bool _bScriptingSupport = sal_True ); + SwDocShell( SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED ); + SwDocShell( const sal_uInt64 i_nSfxCreationFlags ); SwDocShell( SwDoc *pDoc, SfxObjectCreateMode eMode = SFX_CREATE_MODE_STANDARD ); ~SwDocShell(); diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index c027ffb1ba..e27024585f 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -41,6 +41,7 @@ #include <com/sun/star/linguistic2/ProofreadingResult.hpp> #include <fldupde.hxx> #include <tblenum.hxx> +#include <IMark.hxx> #include <vector> #include <swundo.hxx> @@ -414,6 +415,9 @@ public: const SwTOXType* GetTOXType(TOXTypes eTyp, USHORT nId) const; void InsertTOXType(const SwTOXType& rTyp); + // new field stuff + BOOL UpdateField(sw::mark::IFieldmark &fieldBM); + //AutoMark file const String& GetTOIAutoMarkURL() const; void SetTOIAutoMarkURL(const String& rSet); diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index b7a2b0cb53..b272292f82 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -536,10 +536,10 @@ public: const SfxItemSet* pFlyAttrSet = 0, const SfxItemSet* pGrfAttrSet = 0, SwFrmFmt* = 0 ); - //Einfuegen eines DrawObjectes. Das Object muss bereits im DrawModel - // angemeldet sein. - void Insert( SdrObject& rDrawObj, const SfxItemSet* pFlyAttrSet = 0, - SwFrmFmt* = 0, const Point* = 0 ); + + // Insertion of a drawing object which have to be already inserted in the DrawModel + void InsertDrawObj( SdrObject& rDrawObj, + const Point& rInsertPosition ); BOOL ReplaceSdrObj( const String& rGrfName, const String& rFltName, const Graphic* pGrf = 0 ); diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 8bfbe25919..584b4726f9 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -41,12 +41,8 @@ #define CH_TXT_ATR_FIELDEND ((sal_Unicode)0x05) #define CH_TXT_ATR_SUBST_FIELDSTART ("[") #define CH_TXT_ATR_SUBST_FIELDEND ("]") -//#define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)'#') #define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)0x06) -/* -#define FIELD_BOOKMARK_PREFIX "__" -#define FIELD_FORM_BOOKMARK_PREFIX "__FORM" -*/ + /* * Hier kommen erst mal die enums fuer die Hints */ diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index d7d384a244..82517d6942 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -135,6 +135,9 @@ protected: public: ~SwNodes(); + typedef ::std::vector<SwNodeRange> NodeRanges_t; + typedef ::std::vector<NodeRanges_t> TableRanges_t; + SwNodePtr operator[]( ULONG n ) const { return (SwNodePtr)BigPtrArray::operator[] ( n ); } @@ -276,8 +279,11 @@ public: SwTableBoxFmt* pBoxFmt, SwTxtFmtColl* pTxtColl, SwUndoTxtToTbl* pUndo = 0 ); + + SwNodeRange * ExpandRangeForTableBox(const SwNodeRange & rRange); + //create a table from a vector of NodeRanges - API support - SwTableNode* TextToTable( const std::vector< std::vector<SwNodeRange> >& rTableNodes, + SwTableNode* TextToTable( const TableRanges_t& rTableNodes, SwTableFmt* pTblFmt, SwTableLineFmt* pLineFmt, SwTableBoxFmt* pBoxFmt, diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx index b42496217d..417d6b2b09 100644 --- a/sw/inc/ndgrf.hxx +++ b/sw/inc/ndgrf.hxx @@ -208,10 +208,6 @@ public: BOOL GetFileFilterNms( String* pFileNm, String* pFilterNm ) const; void ReleaseLink(); - // Prioritaet beim Laden der Grafik setzen. Geht nur, wenn der Link - // ein FileObject gesetzt hat - void SetTransferPriority( USHORT nPrio ); - // Skalieren einer Image-Map: Die Image-Map wird um den Faktor // zwischen Grafik-Groesse und Rahmen-Groesse vergroessert/verkleinert void ScaleImageMap(); diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 90a85316eb..ccaab82beb 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -504,6 +504,10 @@ public: */ BOOL GetFirstLineOfsWithNum( short& rFirstOffset ) const; + // --> OD 2010-01-05 #b6884103# + SwTwips GetAdditionalIndentForStartingNewList() const; + // <-- + // --> OD 2008-12-02 #i96772# void ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const; // <-- diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx index 2d206e36b0..a764ee2261 100644 --- a/sw/inc/pam.hxx +++ b/sw/inc/pam.hxx @@ -269,6 +269,7 @@ public: DECL_FIXEDMEMPOOL_NEWDEL(SwPaM); String GetTxt() const; + void InvalidatePaM(); }; diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index 1c063cc8b4..8495ddd9f3 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -593,7 +593,6 @@ #include "sfx2/tabdlg.hxx" #include "sfx2/tbxctrl.hxx" #include "sfx2/templdlg.hxx" -#include "sfx2/topfrm.hxx" #include "sfx2/tplpitem.hxx" #include "sfx2/viewfac.hxx" #include "sfx2/viewfrm.hxx" diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 9ad0d46732..773fdaa3aa 100644..100755 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -230,6 +230,9 @@ class SwRenderData 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 + // printer paper tray to use for each of the m_aValidPages above + std::map< sal_Int32, sal_Int32 > m_aPrinterPaperTrays; + // 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; @@ -264,6 +267,7 @@ public: void DeletePostItData(); bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; } + bool NeedNewViewOptionAdjust( const SwWrtShell& ) const; void ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions ); void ViewOptionAdjust( const SwPrtOptions *pPrtOptions ); void ViewOptionAdjustStop(); @@ -283,13 +287,18 @@ public: const std::set< sal_Int32 > & GetValidPagesSet() const { return m_aValidPages; } ValidStartFramesMap_t & GetValidStartFrames() { return m_aValidStartFrames; } const ValidStartFramesMap_t & GetValidStartFrames() const { return m_aValidStartFrames; } + + // a map for printer paper tray numbers to use for each document page + // a value of -1 for the tray means that there is no specific tray defined + std::map< sal_Int32, sal_Int32 >& GetPrinterPaperTrays() { return m_aPrinterPaperTrays; } + const std::map< sal_Int32, sal_Int32 >& GetPrinterPaperTrays() const { return m_aPrinterPaperTrays; } // 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 diff --git a/sw/inc/unobookmark.hxx b/sw/inc/unobookmark.hxx index b53c0c8c98..d1062eb817 100644 --- a/sw/inc/unobookmark.hxx +++ b/sw/inc/unobookmark.hxx @@ -198,6 +198,34 @@ public: }; +class SwXFieldmarkParameters + : public ::cppu::WeakImplHelper1< ::com::sun::star::container::XNameContainer> + , private SwClient +{ + public: + SwXFieldmarkParameters(::sw::mark::IFieldmark* const pFieldmark) + { + pFieldmark->Add(this); + } + + // XNameContainer + virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + // XNameReplace + virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + // XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) 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( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::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); + //SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + private: + ::sw::mark::IFieldmark::parameter_map_t* getCoreParameters() throw (::com::sun::star::uno::RuntimeException); +}; + typedef cppu::ImplInheritanceHelper1< SwXBookmark, ::com::sun::star::text::XFormField > SwXFieldmark_Base; @@ -219,19 +247,11 @@ public: ::com::sun::star::text::XTextRange > & xTextRange) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - virtual ::rtl::OUString SAL_CALL getDescription() - throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL getType() - throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL getRes() - throw (::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL setDescription(const ::rtl::OUString& rDescription) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setType(::sal_Int16 fieldType) + virtual ::rtl::OUString SAL_CALL getFieldType(void) + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setFieldType(const ::rtl::OUString& description ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setRes(::sal_Int16 res) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > SAL_CALL getParameters( ) throw (::com::sun::star::uno::RuntimeException); }; diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index 5a99c386be..6015a5755d 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -60,12 +60,12 @@ class SwUnoInternalPaM private: SwUnoInternalPaM(const SwUnoInternalPaM&); - SwUnoInternalPaM& operator=(const SwPaM& rPaM); public: SwUnoInternalPaM(SwDoc& rDoc); virtual ~SwUnoInternalPaM(); + SwUnoInternalPaM& operator=(const SwPaM& rPaM); }; diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 145618c0f6..e9c1e38b76 100644..100755 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -607,6 +607,9 @@ public: ~SwViewOptionAdjust_Impl(); void AdjustViewOptions( const SwPrtOptions *pPrtOptions ); + + bool checkShell( const SwWrtShell& rCompare ) const + { return &rCompare == &m_rShell; } }; diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index c2ca76b45b..4ed3eab196 100644..100755 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -189,9 +189,6 @@ class SW_DLLPUBLIC ViewShell : public Ring SW_DLLPRIVATE sal_Bool CheckInvalidForPaint( const SwRect & );//Direkt Paint oder lieber //eine Aktion ausloesen. - SW_DLLPRIVATE void Scroll(); //Scrollen wenn sich aus der LayAction Scrollmoeglichkeiten - //ergaben. - SW_DLLPRIVATE void PrepareForPrint( const SwPrintData &rOptions ); SW_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt ); @@ -238,11 +235,7 @@ public: void ChgHyphenation() { Reformat(); } void ChgNumberDigits(); - //Methoden fuer Paint- und Scrollrects, die auf allen Shells im - //Ring arbeiten. sal_Bool AddPaintRect( const SwRect &rRect ); - void AddScrollRect( const SwFrm *pFrm, const SwRect &rRect, long nOffs ); - void SetNoNextScroll(); void InvalidateWindows( const SwRect &rRect ); @@ -368,11 +361,11 @@ public: // printing of one page. // bIsPDFExport == true is: do PDF Export (no printing!) - sal_Bool PrintOrPDFExport( OutputDevice *pOutDev, const SwPrtOptions &rPrintData, + 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, + void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData, sal_Int32 nRenderer /* offset in vector of page pairs for prospect printing */ ); // printing for OLE 2.0 diff --git a/sw/prj/build.lst b/sw/prj/build.lst index 6fd49c1d77..87d163d726 100755 --- a/sw/prj/build.lst +++ b/sw/prj/build.lst @@ -74,3 +74,4 @@ sw sw\source\ui nmake - all sw_ui sw_app sw sw\source\core nmake - all sw_core sw_attr sw_bast sw_crsr sw_dcnd sw_doc sw_draw sw_edit sw_excpt sw_fld sw_frmed sw_grph sw_layo sw_ole sw_para sw_sw3io sw_swg sw_text sw_tox sw_txtnd sw_uco sw_undo sw_view sw_acc sw_objpos sw_NumberTree sw_tablecore NULL sw sw\source\filter nmake - all sw_flt sw_ascii sw_bsflt sw_html sw_rtf sw_wrtr sw_ww1 sw_ww8 sw_xml NULL sw sw\util nmake - all sw_util sw_core sw_flt sw_sdi sw_ui NULL +sw sw\qa\unoapi nmake - all sw_qa_unoapi NULL diff --git a/sw/qa/core/export.map b/sw/qa/core/export.map index e9b19ca5b5..f313c44bd7 100644 --- a/sw/qa/core/export.map +++ b/sw/qa/core/export.map @@ -25,7 +25,7 @@ # #************************************************************************* -UDK_3.0 { +UDK_3_0_0 { global: registerAllTestFunction; diff --git a/sw/qa/core/makefile.mk b/sw/qa/core/makefile.mk index 02e69f45da..00ebfda884 100644 --- a/sw/qa/core/makefile.mk +++ b/sw/qa/core/makefile.mk @@ -37,6 +37,8 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:testjob by codegen.pl diff --git a/sw/qa/unoapi/Test.java b/sw/qa/unoapi/Test.java new file mode 100644 index 0000000000..e0311cc069 --- /dev/null +++ b/sw/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.sw.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "sw.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/sw/qa/unoapi/knownissues.xcl b/sw/qa/unoapi/knownissues.xcl index ee20559798..0c0ae3e506 100644 --- a/sw/qa/unoapi/knownissues.xcl +++ b/sw/qa/unoapi/knownissues.xcl @@ -150,4 +150,7 @@ sw.SwXTextEmbeddedObject::com::sun::star::text::BaseFrameProperties sw.SwXTextPortion::com::sun::star::style::CharacterProperties ### i94977 ### -sw.SwXTextGraphicObject::com::sun::star::text::BaseFrameProperties
\ No newline at end of file +sw.SwXTextGraphicObject::com::sun::star::text::BaseFrameProperties + +### i109917 ### +sw.SwXTextDocument::com::sun::star::document::XEventBroadcaster diff --git a/sw/qa/unoapi/makefile.mk b/sw/qa/unoapi/makefile.mk index 777c108c9e..f5102c2c9c 100644 --- a/sw/qa/unoapi/makefile.mk +++ b/sw/qa/unoapi/makefile.mk @@ -1,7 +1,6 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -22,18 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/.. +#***********************************************************************/ -PRJNAME=sw -TARGET=qa_unoapi +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -.INCLUDE: settings.mk +PRJ = ../.. +PRJNAME = sw +TARGET = qa_unoapi + +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/sw/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce sw.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi index 0d49499344..4de71ca760 100644 --- a/sw/sdi/_docsh.sdi +++ b/sw/sdi/_docsh.sdi @@ -75,10 +75,6 @@ interface BaseTextDocument ExecMethod = Execute ; ] - SID_MAIL_PREPAREEXPORT - [ - ExecMethod = Execute ; - ] SID_MAIL_EXPORT_FINISHED [ ExecMethod = Execute; diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx index 34820899d9..abcc7936b2 100644 --- a/sw/source/core/SwNumberTree/SwNodeNum.cxx +++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx @@ -37,6 +37,10 @@ // --> OD 2007-10-31 #i83479# #include <IDocumentListItems.hxx> // <-- +// --> OD 2010-01-13 #b6912256# +#include <svl/svstdarr.hxx> +#include <doc.hxx> +// <-- // --> OD 2008-02-19 #refactorlists# SwNodeNum::SwNodeNum( SwTxtNode* pTxtNode ) @@ -489,8 +493,21 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum ) SwTxtNode* pTxtNode( rNodeNum.GetTxtNode() ); if ( pTxtNode ) { - // --> OD 2008-03-13 #refactorlists# pTxtNode->RemoveFromList(); + // --> OD 2010-01-13 #b6912256# + // clear all list attributes and the list style + SvUShortsSort aResetAttrsArray; + aResetAttrsArray.Insert( RES_PARATR_LIST_ID ); + aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL ); + aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART ); + aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE ); + aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED ); + aResetAttrsArray.Insert( RES_PARATR_NUMRULE ); + SwPaM aPam( *pTxtNode ); + pTxtNode->GetDoc()->ResetAttrs( aPam, sal_False, + &aResetAttrsArray, + false ); + // <-- } } } diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 5268bed38b..5bca4c82e5 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -41,12 +41,14 @@ #include <undobj.hxx> #include <unobookmark.hxx> #include <rtl/random.h> +#include <xmloff/odffields.hxx> SV_IMPL_REF( SwServerObject ) using namespace ::sw::mark; using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; namespace { @@ -75,20 +77,20 @@ namespace const sal_Unicode aStartMark, const sal_Unicode aEndMark) { - const SwPosition& rStart = pField->GetMarkStart(); - const SwPosition& rEnd = pField->GetMarkEnd(); + SwPosition& rStart = pField->GetMarkStart(); + SwPosition& rEnd = pField->GetMarkEnd(); SwTxtNode const * const pStartTxtNode = io_pDoc->GetNodes()[rStart.nNode]->GetTxtNode(); SwTxtNode const * const pEndTxtNode = io_pDoc->GetNodes()[rEnd.nNode]->GetTxtNode(); const sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(rStart.nContent.GetIndex()); const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(rEnd.nContent.GetIndex()-1); - const SwPaM aStartPaM(rStart); - const SwPaM aEndPaM(rEnd); + SwPaM aStartPaM(rStart); + SwPaM aEndPaM(rEnd); io_pDoc->StartUndo(UNDO_UI_REPLACE, NULL); if(ch_start != aStartMark) { io_pDoc->InsertString(aStartPaM, aStartMark); } - if(aEndMark && ch_end != aEndMark) + if ( aEndMark && ( ch_end != aEndMark ) && ( rStart != rEnd ) ) { io_pDoc->InsertString(aEndPaM, aEndMark); } @@ -112,6 +114,11 @@ namespace sw { namespace mark } } + bool MarkBase::IsCoveringPosition(const SwPosition& rPos) const + { + return GetMarkStart() <= rPos && rPos <= GetMarkEnd(); + } + void MarkBase::SetMarkPos(const SwPosition& rNewPos) { ::boost::scoped_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos1); @@ -124,6 +131,17 @@ namespace sw { namespace mark //lcl_FixPosition(*m_pPos2); } + rtl::OUString MarkBase::ToString( ) const + { + rtl::OUStringBuffer buf; + buf.appendAscii( "Mark: ( Name, [ Node1, Index1 ] ): ( " ); + buf.append( m_aName ).appendAscii( ", [ " ); + buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " ); + buf.append( sal_Int32( GetMarkPos().nContent.GetIndex( ) ) ).appendAscii( " ] )" ); + + return buf.makeStringAndClear( ); + } + MarkBase::~MarkBase() { } @@ -145,7 +163,7 @@ namespace sw { namespace mark return aResult.append(nCount++).append(sUniquePostfix).makeStringAndClear(); } - // SwClient + void MarkBase::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) { SwModify::Modify(pOld, pNew); @@ -250,6 +268,7 @@ namespace sw { namespace mark uno::Reference< rdf::XMetadatable > Bookmark::MakeUnoObject() { + // create new SwXBookmark SwDoc *const pDoc( GetMarkPos().GetDoc() ); OSL_ENSURE(pDoc, "Bookmark::MakeUnoObject: no doc?"); const uno::Reference< rdf::XMetadatable> xMeta( @@ -265,6 +284,28 @@ namespace sw { namespace mark SetOtherMarkPos(GetMarkPos()); } + rtl::OUString Fieldmark::ToString( ) const + { + rtl::OUStringBuffer buf; + buf.appendAscii( "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " ); + buf.append( m_aName ).appendAscii( ", " ); + buf.append( m_aFieldname ).appendAscii( ", [ " ); + buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " ); + buf.append( sal_Int32( GetMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ], [" ); + buf.append( sal_Int32( GetOtherMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " ); + buf.append( sal_Int32( GetOtherMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ] ) " ); + + return buf.makeStringAndClear( ); + } + + void Fieldmark::Invalidate( ) + { + // @TODO: Does exist a better solution to trigger a format of the + // fieldmark portion? If yes, please use it. + SwPaM aPaM( this->GetMarkPos(), this->GetOtherMarkPos() ); + aPaM.InvalidatePaM(); + } + const ::rtl::OUString Fieldmark::our_sNamePrefix = ::rtl::OUString::createFromAscii("__Fieldmark__"); TextFieldmark::TextFieldmark(const SwPaM& rPaM) @@ -282,12 +323,24 @@ namespace sw { namespace mark void CheckboxFieldmark::InitDoc(SwDoc* const io_pDoc) { - lcl_AssureFieldMarksSet(this, io_pDoc, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND); - } + lcl_AssureFieldMarksSet(this, io_pDoc, CH_TXT_ATR_FORMELEMENT, CH_TXT_ATR_FIELDEND); + // For some reason the end mark is moved from 1 by the Insert: we don't + // want this for checkboxes + this->GetMarkEnd( ).nContent--; + } void CheckboxFieldmark::SetChecked(bool checked) - { m_isChecked = checked; } + { + (*GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_RESULT)] = makeAny(checked); + } bool CheckboxFieldmark::IsChecked() const - { return m_isChecked; } + { + bool bResult = false; + parameter_map_t::const_iterator pResult = GetParameters()->find(::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_RESULT)); + if(pResult != GetParameters()->end()) + pResult->second >>= bResult; + return bResult; + } + }} diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx index 64c37c9746..6299f9c14f 100644 --- a/sw/source/core/crsr/crossrefbookmark.cxx +++ b/sw/source/core/crsr/crossrefbookmark.cxx @@ -64,7 +64,7 @@ namespace sw { namespace mark MarkBase::SetMarkPos(rNewPos); } - const SwPosition& CrossRefBookmark::GetOtherMarkPos() const + SwPosition& CrossRefBookmark::GetOtherMarkPos() const { OSL_PRECOND(false, "<SwCrossRefBookmark::GetOtherMarkPos(..)>" diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index c499929cc4..5a032d6021 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -392,10 +392,18 @@ BOOL SwCrsrShell::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, else { const BOOL bSkipHidden = !GetViewOptions()->IsShowHiddenChar(); - bRet = SetInFrontOfLabel( FALSE ); + // --> OD 2009-12-30 #i107447# + // To avoid loop the reset of <bInFrontOfLabel> flag is no longer + // reflected in the return value <bRet>. + const bool bResetOfInFrontOfLabel = SetInFrontOfLabel( FALSE ); bRet = pShellCrsr->LeftRight( bLeft, nCnt, nMode, bVisualAllowed, - bSkipHidden, - !IsOverwriteCrsr() ) || bRet; + bSkipHidden, !IsOverwriteCrsr() ); + if ( !bRet && bLeft && bResetOfInFrontOfLabel ) + { + // undo reset of <bInFrontOfLabel> flag + SetInFrontOfLabel( TRUE ); + } + // <-- } if( bRet ) @@ -1770,13 +1778,6 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) } } - //Ggf. gescrollten Bereicht korrigieren (Alignment). - //Nur wenn gescrollt wurde, und wenn keine Selektion existiert. - if( pFrm && Imp()->IsScrolled() && - pShellCrsr->GetNext() == pShellCrsr && !pShellCrsr->HasMark() ) - Imp()->RefreshScrolledArea( aCharRect ); - - eMvState = MV_NONE; // Status fuers Crsr-Travelling - GetCrsrOfst if( pFrm && Imp()->IsAccessible() ) diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 4ed0d86e05..5f0c8a2979 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1006,9 +1006,9 @@ BOOL SwCrsrShell::IsPageAtPos( const Point &rPt ) const } BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, - SwContentAtPos& rCntntAtPos, - BOOL bSetCrsr, - SwRect* pFldRect ) + SwContentAtPos& rCntntAtPos, + BOOL bSetCrsr, + SwRect* pFldRect ) { SET_CURR_SHELL( this ); BOOL bRet = FALSE; @@ -1173,6 +1173,17 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, } } + if( !bRet && SwContentAtPos::SW_FORMCTRL & rCntntAtPos.eCntntAtPos ) + { + IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( ); + sw::mark::IFieldmark* pFldBookmark = pMarksAccess->getFieldmarkFor( aPos ); + if( bCrsrFoundExact && pTxtNd && pFldBookmark) { + rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FORMCTRL; + rCntntAtPos.aFnd.pFldmark = pFldBookmark; + bRet=TRUE; + } + } + if( !bRet && SwContentAtPos::SW_FTN & rCntntAtPos.eCntntAtPos ) { if( aTmpState.bFtnNoInfo ) diff --git a/sw/source/core/crsr/makefile.mk b/sw/source/core/crsr/makefile.mk index 6d579171dc..a2571901c0 100644 --- a/sw/source/core/crsr/makefile.mk +++ b/sw/source/core/crsr/makefile.mk @@ -47,6 +47,7 @@ CDEFS+=-Dmydebug EXCEPTIONSFILES= \ $(SLO)$/crbm.obj \ $(SLO)$/crsrsh.obj \ + $(SLO)$/bookmrk.obj \ $(SLO)$/viscrs.obj SLOFILES = \ diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 87140be03f..a31ae4c1a3 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -53,6 +53,7 @@ #include <ndtxt.hxx> // #111827# #include <IMark.hxx> +#include <hints.hxx> // fuer den dummen ?MSC-? Compiler inline xub_StrLen GetSttOrEnd( BOOL bCondition, const SwCntntNode& rNd ) @@ -62,11 +63,11 @@ inline xub_StrLen GetSttOrEnd( BOOL bCondition, const SwCntntNode& rNd ) /************************************************************************* |* -|* SwPosition +|* SwPosition |* -|* Beschreibung PAM.DOC -|* Ersterstellung VB 4.3.91 -|* Letzte Aenderung VB 4.3.91 +|* Beschreibung PAM.DOC +|* Ersterstellung VB 4.3.91 +|* Letzte Aenderung VB 4.3.91 |* *************************************************************************/ @@ -284,7 +285,7 @@ BOOL lcl_ChkOneRange( CHKSECTION eSec, BOOL bChkSections, pNd = pNd->StartOfSectionNode(); if( pNd == rNds[ nEnd ]->StartOfSectionNode() ) - return TRUE; // der gleiche StartNode, die selbe Section + return TRUE; // der gleiche StartNode, die selbe Section // steht schon auf einem GrundSection Node ? Fehler !!! if( !pNd->StartOfSectionIndex() ) @@ -328,7 +329,7 @@ BOOL CheckNodesRange( const SwNodeIndex& rStt, return lcl_ChkOneRange( eSec, bChkSection, rNds.GetEndOfRedlines(), nStt, nEnd ); - return FALSE; // liegt irgendwo dazwischen, FEHLER + return FALSE; // liegt irgendwo dazwischen, FEHLER } @@ -383,11 +384,11 @@ SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, BOOL bChk ) /************************************************************************* |* -|* SwPointAndMark +|* SwPointAndMark |* -|* Beschreibung PAM.DOC -|* Ersterstellung VB 4.3.91 -|* Letzte Aenderung JP 6.5.91 +|* Beschreibung PAM.DOC +|* Ersterstellung VB 4.3.91 +|* Letzte Aenderung JP 6.5.91 |* *************************************************************************/ @@ -575,20 +576,20 @@ BOOL SwPaM::Move( SwMoveFn fnMove, SwGoInDoc fnGo ) /************************************************************************* |* -|* void SwPaM::MakeRegion( SwMoveFn, SwPaM*, const SwPaM* ) +|* void SwPaM::MakeRegion( SwMoveFn, SwPaM*, const SwPaM* ) |* -|* Beschreibung Setzt den 1. SwPaM auf den uebergebenen SwPaM -|* oder setzt auf den Anfang oder Ende vom Document. -|* SPoint bleibt auf der Position stehen, GetMark aendert -|* sich entsprechend ! +|* Beschreibung Setzt den 1. SwPaM auf den uebergebenen SwPaM +|* oder setzt auf den Anfang oder Ende vom Document. +|* SPoint bleibt auf der Position stehen, GetMark aendert +|* sich entsprechend ! |* -|* Parameter SwDirection gibt an, ob an Anfang / Ende -|* SwPaM * der zu setzende Bereich -|* const SwPaM& der enventuell vorgegeben Bereich -|* Return-Werte SwPaM* der entsprehend neu gesetzte Bereich +|* Parameter SwDirection gibt an, ob an Anfang / Ende +|* SwPaM * der zu setzende Bereich +|* const SwPaM& der enventuell vorgegeben Bereich +|* Return-Werte SwPaM* der entsprehend neu gesetzte Bereich |* -|* Ersterstellung JP 26.04.91 -|* Letzte Aenderung JP 26.04.91 +|* Ersterstellung JP 26.04.91 +|* Letzte Aenderung JP 26.04.91 |* *************************************************************************/ @@ -599,17 +600,17 @@ SwPaM* SwPaM::MakeRegion( SwMoveFn fnMove, const SwPaM * pOrigRg ) if( pOrigRg == 0 ) { pPam = new SwPaM( *m_pPoint ); - pPam->SetMark(); // setze Anfang fest - pPam->Move( fnMove, fnGoSection); // an Anfang / Ende vom Node + pPam->SetMark(); // setze Anfang fest + pPam->Move( fnMove, fnGoSection); // an Anfang / Ende vom Node // stelle SPoint wieder auf alte Position, GetMark auf das "Ende" pPam->Exchange(); } else { - pPam = new SwPaM( *(SwPaM*)pOrigRg ); // die Suchregion ist vorgegeben + pPam = new SwPaM( *(SwPaM*)pOrigRg ); // die Suchregion ist vorgegeben // sorge dafuer, dass SPoint auf dem "echten" StartPunkt steht - // FORWARD --> SPoint immer kleiner als GetMark + // FORWARD --> SPoint immer kleiner als GetMark // BACKWARD --> SPoint immer groesser als GetMark if( (pPam->GetMark()->*fnMove->fnCmpOp)( *pPam->GetPoint() ) ) pPam->Exchange(); @@ -770,7 +771,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const if( nSttIdx <= nIdx && nEndIdx >= nIdx && rCntnt.GetCntntIdx()->GetNode().GetNodes().IsDocNodes() ) { -/* // ist es keine gelinkte Section, dann kann sie auch +/* // ist es keine gelinkte Section, dann kann sie auch // nicht mitselektiert werden const SwSection& rSect = *pFmt->GetSection(); if( CONTENT_SECTION == rSect.GetType() ) @@ -787,8 +788,8 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const #ifdef CHECK_CELL_READONLY //JP 22.01.99: bisher wurden Tabelle, die in der Text-Selektion standen -// nicht beachtet. Wollte man das haben, dann muss dieser -// Code freigeschaltet werden +// nicht beachtet. Wollte man das haben, dann muss dieser +// Code freigeschaltet werden if( !bRet ) { @@ -824,20 +825,25 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const } //FIXME FieldBk // TODO: Form Protection when Enhanced Fields are enabled -// if( !bRet ) -// { -// const SwDoc *pDoc=GetDoc(); -// SwBookmark *pA = ( pDoc && pPoint ? pDoc->getFieldmarkFor( *pPoint ) : NULL ); -// SwBookmark *pB = ( pDoc && pMark ? pDoc->getFieldmarkFor( *pMark ) : pA ); -// bRet = ( pA != pB ); -// bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM ); -// if( bProtectForm ) -// bRet |= ( pA==NULL || pB==NULL ); -// } + if (!bRet) { + const SwDoc *pDoc = GetDoc(); + sw::mark::IMark* pA = NULL; + sw::mark::IMark* pB = NULL; + if ( pDoc ) + { + const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( ); + pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL; + pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA; + bRet = ( pA != pB ); + } + bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM ); + if ( bProtectForm ) + bRet |= ( pA == NULL || pB == NULL ); + } return bRet; } -//-------------------- Suche nach Formaten( FormatNamen ) ----------------- +//-------------------- Suche nach Formaten( FormatNamen ) ----------------- // die Funktion gibt in Suchrichtung den folgenden Node zurueck. // Ist in der Richtung keiner mehr vorhanden oder ist dieser ausserhalb @@ -860,14 +866,14 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove, pNd = rPam.GetCntntNode(); if( pNd ) { - if( - ( + if( + ( 0 == ( pFrm = pNd->GetFrm()) || ( !bInReadOnly && pFrm->IsProtected() ) || - (pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow()) + (pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow()) ) || ( !bInReadOnly && pNd->FindSectionNode() && - pNd->FindSectionNode()->GetSection().IsProtect() + pNd->FindSectionNode()->GetSection().IsProtect() ) ) { @@ -876,7 +882,7 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove, } } - if( !pNd ) // steht Cursor auf keinem ContentNode ? + if( !pNd ) // steht Cursor auf keinem ContentNode ? { SwPosition aPos( *rPam.GetPoint() ); BOOL bSrchForward = fnMove == fnMoveForward; @@ -885,7 +891,7 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove, // zum naechsten / vorherigen ContentNode // Funktioniert noch alles, wenn die Uerbpruefung vom ueberspringen der // Sektions herausgenommen wird ?? -// if( (*fnMove->fnNds)( rNodes, &aPos.nNode ) ) +// if( (*fnMove->fnNds)( rNodes, &aPos.nNode ) ) while( TRUE ) { pNd = bSrchForward @@ -904,19 +910,19 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove, ( pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow() ) ) -// rNodes[ rNodes.EndOfAutotext ]->StartOfSection().GetIndex() -// < aPos.nNode.GetIndex() && aPos.nNode.GetIndex() -// < rNodes.EndOfAutotext.GetIndex() && -// 0 == ( pFrm = pNd->GetFrm()) && -// pFrm->IsProtected() ) +// rNodes[ rNodes.EndOfAutotext ]->StartOfSection().GetIndex() +// < aPos.nNode.GetIndex() && aPos.nNode.GetIndex() +// < rNodes.EndOfAutotext.GetIndex() && +// 0 == ( pFrm = pNd->GetFrm()) && +// pFrm->IsProtected() ) { pNd = 0; - continue; // suche weiter + continue; // suche weiter } *(SwPosition*)rPam.GetPoint() = aPos; } else - pNd = 0; // kein gueltiger Node + pNd = 0; // kein gueltiger Node break; } break; @@ -1108,14 +1114,14 @@ BOOL GoNextPara( SwPaM & rPam, SwPosPara aPosPara ) BOOL GoCurrSection( SwPaM & rPam, SwMoveFn fnMove ) { SwPosition& rPos = *rPam.GetPoint(); - SwPosition aSavePos( rPos ); // eine Vergleichsposition + SwPosition aSavePos( rPos ); // eine Vergleichsposition SwNodes& rNds = aSavePos.nNode.GetNodes(); (rNds.*fnMove->fnSection)( &rPos.nNode ); SwCntntNode *pNd; if( 0 == ( pNd = rPos.nNode.GetNode().GetCntntNode()) && 0 == ( pNd = (*fnMove->fnNds)( &rPos.nNode, TRUE )) ) { - rPos = aSavePos; // Cusror nicht veraendern + rPos = aSavePos; // Cusror nicht veraendern return FALSE; } @@ -1128,14 +1134,14 @@ BOOL GoCurrSection( SwPaM & rPam, SwMoveFn fnMove ) BOOL GoNextSection( SwPaM & rPam, SwMoveFn fnMove ) { SwPosition& rPos = *rPam.GetPoint(); - SwPosition aSavePos( rPos ); // eine Vergleichsposition + SwPosition aSavePos( rPos ); // eine Vergleichsposition SwNodes& rNds = aSavePos.nNode.GetNodes(); rNds.GoEndOfSection( &rPos.nNode ); // kein weiterer ContentNode vorhanden ? if( !GoInCntnt( rPam, fnMoveForward ) ) { - rPos = aSavePos; // Cusror nicht veraendern + rPos = aSavePos; // Cusror nicht veraendern return FALSE; } (rNds.*fnMove->fnSection)( &rPos.nNode ); @@ -1149,14 +1155,14 @@ BOOL GoNextSection( SwPaM & rPam, SwMoveFn fnMove ) BOOL GoPrevSection( SwPaM & rPam, SwMoveFn fnMove ) { SwPosition& rPos = *rPam.GetPoint(); - SwPosition aSavePos( rPos ); // eine Vergleichsposition + SwPosition aSavePos( rPos ); // eine Vergleichsposition SwNodes& rNds = aSavePos.nNode.GetNodes(); rNds.GoStartOfSection( &rPos.nNode ); // kein weiterer ContentNode vorhanden ? if( !GoInCntnt( rPam, fnMoveBackward )) { - rPos = aSavePos; // Cusror nicht veraendern + rPos = aSavePos; // Cusror nicht veraendern return FALSE; } (rNds.*fnMove->fnSection)( &rPos.nNode ); @@ -1220,6 +1226,20 @@ BOOL SwPaM::Overlap(const SwPaM & a, const SwPaM & b) return !(*b.End() <= *a.Start() || *a.End() <= *b.End()); } +void SwPaM::InvalidatePaM() +{ + const SwNode *_pNd=this->GetNode(); + const SwTxtNode *_pTxtNd=(_pNd!=NULL?_pNd->GetTxtNode():NULL); + if (_pTxtNd!=NULL) + { + // pretent that the PaM marks inserted text to recalc the portion... + SwInsTxt aHint( Start()->nContent.GetIndex(), + End()->nContent.GetIndex() - Start()->nContent.GetIndex() + 1 ); + SwModify *_pModify=(SwModify*)_pTxtNd; + _pModify->Modify( 0, &aHint); + } +} + BOOL SwPaM::LessThan(const SwPaM & a, const SwPaM & b) { return (*a.Start() < *b.Start()) || (*a.Start() == *b.Start() && *a.End() < *b.End()); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index dedb46c08e..4d428b4987 100644..100755 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -47,6 +47,7 @@ #include <rtl/ustring.hxx> #include <vcl/virdev.hxx> #include <svl/itemiter.hxx> +#include <svl/poolitem.hxx> #include <unotools/syslocale.hxx> #include <sfx2/printer.hxx> #include <editeng/keepitem.hxx> @@ -55,9 +56,11 @@ #include <sfx2/linkmgr.hxx> #include <editeng/forbiddencharacterstable.hxx> #include <svx/svdmodel.hxx> +#include <editeng/pbinitem.hxx> #include <unotools/charclass.hxx> #include <unotools/localedatawrapper.hxx> +#include <swatrset.hxx> #include <swmodule.hxx> #include <fmtpdsc.hxx> #include <fmtanchr.hxx> @@ -1177,6 +1180,23 @@ static void lcl_FormatPostIt( } +// provide the paper tray to use according to the page style in use, +// but do that only if the respective item is NOT just the default item +static sal_Int32 lcl_GetPaperBin( const SwPageFrm *pStartFrm ) +{ + sal_Int32 nRes = -1; + + const SwFrmFmt &rFmt = pStartFrm->GetPageDesc()->GetMaster(); + const SfxPoolItem *pItem = NULL; + SfxItemState eState = rFmt.GetItemState( RES_PAPER_BIN, FALSE, &pItem ); + const SvxPaperBinItem *pPaperBinItem = dynamic_cast< const SvxPaperBinItem * >(pItem); + if (eState > SFX_ITEM_DEFAULT && pPaperBinItem) + nRes = pPaperBinItem->GetValue(); + + return nRes; +} + + void SwDoc::CalculatePagesForPrinting( /* out */ SwRenderData &rData, const SwPrintUIOptions &rOptions, @@ -1187,11 +1207,15 @@ void SwDoc::CalculatePagesForPrinting( if (!pLayout) return; + const sal_Int32 nContent = rOptions.getIntValue( "PrintContent", 0 ); + const bool bPrintSelection = nContent == 2; + // 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 ); + // #i103700# printing selections should not allow for automatic inserting empty pages + bool bPrintEmptyPages = bPrintSelection ? false : rOptions.IsPrintEmptyPages( bIsPDFExport ); Range aPages( 1, nDocPageCount ); @@ -1253,6 +1277,7 @@ void SwDoc::CalculatePagesForPrinting( nPageNo = nFirstPageNo; + std::map< sal_Int32, sal_Int32 > &rPrinterPaperTrays = rData.GetPrinterPaperTrays(); std::set< sal_Int32 > &rValidPages = rData.GetValidPagesSet(); std::map< sal_Int32, const SwPageFrm * > &rValidStartFrms = rData.GetValidStartFrames(); rValidPages.clear(); @@ -1268,9 +1293,10 @@ void SwDoc::CalculatePagesForPrinting( if ( bPrintEmptyPages || pStPage->Frm().Height() ) // <-- { - // pStPage->GetUpper()->Paint( pStPage->Frm() ); rValidPages.insert( nPageNo ); rValidStartFrms[ nPageNo ] = pStPage; + + rPrinterPaperTrays[ nPageNo ] = lcl_GetPaperBin( pStPage ); } } @@ -1306,7 +1332,6 @@ void SwDoc::CalculatePagesForPrinting( // 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) @@ -1526,8 +1551,9 @@ void SwDoc::CalculatePagePairsForProspectPrinting( const SwPrintUIOptions &rOptions, sal_Int32 nDocPageCount ) { - std::set< sal_Int32 > &rValidPagesSet = rData.GetValidPagesSet(); - std::map< sal_Int32, const SwPageFrm * > &rValidStartFrms = rData.GetValidStartFrames(); + std::map< sal_Int32, sal_Int32 > &rPrinterPaperTrays = rData.GetPrinterPaperTrays(); + 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(); @@ -1535,6 +1561,18 @@ void SwDoc::CalculatePagePairsForProspectPrinting( rValidStartFrms.clear(); rtl::OUString aPageRange = rOptions.getStringValue( "PageRange", rtl::OUString() ); + // 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 (0 == nContent) + { + // set page range to print to 'all pages' + aPageRange = OUString::valueOf( (sal_Int32)1 ); + aPageRange += OUString::valueOf( (sal_Unicode)'-'); + aPageRange += OUString::valueOf( nDocPageCount ); + } StringRangeEnumerator aRange( aPageRange, 1, nDocPageCount, 0 ); DBG_ASSERT( pLayout, "no layout present" ); @@ -1559,6 +1597,8 @@ void SwDoc::CalculatePagePairsForProspectPrinting( rValidPagesSet.insert( nPageNum ); rValidStartFrms[ nPageNum ] = pPageFrm; pPageFrm = (SwPageFrm*)pPageFrm->GetNext(); + + rPrinterPaperTrays[ nPageNum ] = lcl_GetPaperBin( pStPage ); } DBG_ASSERT( nPageNum == nDocPageCount, "unexpected number of pages" ); diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 3a13c245f8..23ecd3feb5 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -37,6 +37,7 @@ #include <dcontact.hxx> #include <doc.hxx> #include <docary.hxx> +#include <xmloff/odffields.hxx> #include <editsh.hxx> #include <errhdl.hxx> #include <fmtanchr.hxx> @@ -305,6 +306,17 @@ namespace sw { namespace mark : m_pDoc(&rDoc) { } + void MarkManager::dumpFieldmarks( ) const + { + const_iterator_t pIt = m_vFieldmarks.begin(); + for (; pIt != m_vFieldmarks.end( ); pIt++) + { + rtl::OUString str = (*pIt)->ToString(); + OSL_TRACE("%s\n", + ::rtl::OUStringToOString(str, RTL_TEXTENCODING_UTF8).getStr()); + } + } + ::sw::mark::IMark* MarkManager::makeMark(const SwPaM& rPaM, const ::rtl::OUString& rName, const IDocumentMarkAccess::MarkType eType) @@ -410,6 +422,30 @@ namespace sw { namespace mark return pMark.get(); } + ::sw::mark::IFieldmark* MarkManager::makeFieldBookmark( const SwPaM& rPaM, + const rtl::OUString& rName, + const rtl::OUString& rType ) + { + sw::mark::IMark* pMark = makeMark( rPaM, rName, + IDocumentMarkAccess::TEXT_FIELDMARK ); + sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark ); + pFieldMark->SetFieldname( rType ); + + return pFieldMark; + } + + ::sw::mark::IFieldmark* MarkManager::makeNoTextFieldBookmark( const SwPaM& rPaM, + const rtl::OUString& rName, + const rtl::OUString& rType) + { + sw::mark::IMark* pMark = makeMark( rPaM, rName, + IDocumentMarkAccess::CHECKBOX_FIELDMARK ); + sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark ); + pFieldMark->SetFieldname( rType ); + + return pFieldMark; + } + ::sw::mark::IMark* MarkManager::getMarkForTxtNode(const SwTxtNode& rTxtNode, const IDocumentMarkAccess::MarkType eType) { @@ -763,12 +799,7 @@ namespace sw { namespace mark { const_iterator_t pFieldmark = find_if( m_vFieldmarks.begin(), - // we do not need to check marks starting behind the positon - lower_bound( - m_vFieldmarks.begin(), - m_vFieldmarks.end(), - rPos, - bind(&IMark::StartsAfter, _1, _2)), + m_vFieldmarks.end( ), bind(&IMark::IsCoveringPosition, _1, rPos)); if(pFieldmark == m_vFieldmarks.end()) return NULL; return dynamic_cast<IFieldmark*>(pFieldmark->get()); diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index bd5a675d09..1156f1b886 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -966,6 +966,29 @@ BOOL SwCompareLine::Compare( const CompareLine& rLine ) const return CompareNode( rNode, ((SwCompareLine&)rLine).rNode ); } +namespace +{ + static String SimpleTableToText(const SwNode &rNode) + { + String sRet; + const SwNode* pEndNd = rNode.EndOfSectionNode(); + SwNodeIndex aIdx( rNode ); + while (&aIdx.GetNode() != pEndNd) + { + if (aIdx.GetNode().IsTxtNode()) + { + if (sRet.Len()) + { + sRet.Append( '\n' ); + } + sRet.Append( aIdx.GetNode().GetTxtNode()->GetExpandTxt() ); + } + aIdx++; + } + return sRet; + } +} + BOOL SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ) { if( rSrcNd.GetNodeType() != rDstNd.GetNodeType() ) @@ -986,6 +1009,13 @@ BOOL SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ) bRet = ( rTSrcNd.EndOfSectionIndex() - rTSrcNd.GetIndex() ) == ( rTDstNd.EndOfSectionIndex() - rTDstNd.GetIndex() ); + + // --> #i107826#: compare actual table content + if (bRet) + { + bRet = (SimpleTableToText(rSrcNd) == SimpleTableToText(rDstNd)); + } + // <-- } break; @@ -1040,6 +1070,15 @@ BOOL SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ) case ND_ENDNODE: bRet = rSrcNd.StartOfSectionNode()->GetNodeType() == rDstNd.StartOfSectionNode()->GetNodeType(); + + // --> #i107826#: compare actual table content + if (bRet && rSrcNd.StartOfSectionNode()->GetNodeType() == ND_TABLENODE) + { + bRet = CompareNode( + *rSrcNd.StartOfSectionNode(), *rDstNd.StartOfSectionNode()); + } + // <-- + break; } return bRet; @@ -1056,18 +1095,7 @@ String SwCompareLine::GetText() const case ND_TABLENODE: { - const SwNode* pEndNd = rNode.EndOfSectionNode(); - SwNodeIndex aIdx( rNode ); - while( &aIdx.GetNode() != pEndNd ) - { - if( aIdx.GetNode().IsTxtNode() ) - { - if( sRet.Len() ) - sRet.Append( '\n' ); - sRet.Append( ((SwTxtNode&)rNode).GetExpandTxt() ); - } - aIdx++; - } + sRet = SimpleTableToText(rNode); sRet.InsertAscii( "Tabelle: ", 0 ); } break; diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 008751a003..ef72c98ce7 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -319,7 +319,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, pDoc->GetSpzFrmFmts()->Count() ) { /* SfxViewFrame* pFrame = */ - SfxViewFrame::CreateViewFrame( *xDocSh, 0, TRUE ); + SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 ); } xDocSh->DoSaveAs( *pTmpMed ); xDocSh->DoSaveCompleted( pTmpMed ); @@ -670,7 +670,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel ) pDoc->GetSpzFrmFmts()->Count() ) { /* SfxViewFrame* pFrame = */ - SfxViewFrame::CreateViewFrame( *xDocSh, 0, TRUE ); + SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 ); } xDocSh->DoSaveAs( *pTmpMed ); xDocSh->DoSaveCompleted( pTmpMed ); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index d30bf44689..98cb4114ce 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -651,14 +651,14 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, // Anker noch nicht gesetzt ? RndStdIds eAnchorId = pAnchor ? pAnchor->GetAnchorId() : pFmt->GetAnchor().GetAnchorId(); - if( !pAnchor || - ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && - //Nur Page und nicht: -// FLY_AT_CNTNT == pAnchor->GetAnchorId() || -// FLY_IN_CNTNT == pAnchor->GetAnchorId() || -// FLY_AT_FLY == pAnchor->GetAnchorId() || -// FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ) && - !pAnchor->GetCntntAnchor() )) + // --> OD 2010-01-07 #i107811# + // Assure that at-page anchored fly frames have a page num or a content anchor set. + if ( !pAnchor || + ( FLY_AT_PAGE != pAnchor->GetAnchorId() && + !pAnchor->GetCntntAnchor() ) || + ( FLY_AT_PAGE == pAnchor->GetAnchorId() && + !pAnchor->GetCntntAnchor() && + pAnchor->GetPageNum() == 0 ) ) { // dann setze ihn, wird im Undo gebraucht SwFmtAnchor aAnch( pFmt->GetAnchor() ); @@ -672,15 +672,20 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, { if( eRequestId != aAnch.GetAnchorId() && SFX_ITEM_SET != pFmt->GetItemState( RES_ANCHOR, sal_True ) ) + { aAnch.SetType( eRequestId ); + } eAnchorId = aAnch.GetAnchorId(); - if ( FLY_AT_PAGE != eAnchorId ) - //Nur Page und nicht: -// if( FLY_AT_CNTNT == eAnchorId || FLY_IN_CNTNT == eAnchorId || -// FLY_AT_FLY == eAnchorId || FLY_AUTO_CNTNT == eAnchorId ) + if ( FLY_AT_PAGE != eAnchorId || + ( FLY_AT_PAGE == eAnchorId && + ( !pAnchor || + aAnch.GetPageNum() == 0 ) ) ) + { aAnch.SetAnchor( &rAnchPos ); + } } + // <-- pFmt->SetFmtAttr( aAnch ); } else diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index a7c0edfc1c..fe85dab844 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -169,12 +169,12 @@ void StartGrammarChecking( SwDoc &rDoc ) // check for a visible view bool bVisible = false; const SwDocShell *pDocShell = rDoc.GetDocShell(); - SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocShell, 0, sal_False ); + SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocShell, sal_False ); while (pFrame && !bVisible) { if (pFrame->IsVisible()) bVisible = true; - pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, 0, sal_False ); + pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, sal_False ); } //!! only documents with visible views need to be checked diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 2652811c0a..3c1d88c700 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -295,14 +295,6 @@ void SwNoTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ // <-- StopAnimation(); - if ( pSh->Imp()->IsPaintInScroll() && pSh->GetWin() && rRect != Frm() && - HasAnimation() ) - { - pSh->GetWin()->Invalidate( Frm().SVRect() ); - return; - } - - SfxProgress::EnterLock(); //Keine Progress-Reschedules im Paint (SwapIn) OutputDevice *pOut = pSh->GetOut(); @@ -799,6 +791,7 @@ void SwNoTxtFrm::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, OutputDevice* pOut ) { + if(!pOut) return; Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() ); @@ -843,7 +836,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons pOut->GetConnectMetaFile(); const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() ); - + /// OD 25.09.2002 #99739# - calculate aligned rectangle from parameter <rGrfArea>. /// Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in /// the following code. @@ -865,7 +858,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons //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 ) { @@ -913,8 +906,9 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons else if( rGrfObj.IsCached( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr )) { - rGrfObj.Draw( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), - &aGrfAttr ); + rGrfObj.DrawWithPDFHandling( *pOut, + aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), + &aGrfAttr ); bContinue = FALSE; } } @@ -953,8 +947,9 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons 0, GRFMGR_DRAW_STANDARD, pVout ); } else - rGrfObj.Draw( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), - &aGrfAttr ); + rGrfObj.DrawWithPDFHandling( *pOut, + aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), + &aGrfAttr ); } else { diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 1f62d5f66d..77d98ab890 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -1265,10 +1265,72 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > return pNdTbl; } +SwNodeRange * SwNodes::ExpandRangeForTableBox(const SwNodeRange & rRange) +{ + SwNodeRange * pResult = NULL; + bool bChanged = false; + + SwNodeIndex aNewStart = rRange.aStart; + SwNodeIndex aNewEnd = rRange.aEnd; + + SwNodeIndex aEndIndex = rRange.aEnd; + SwNodeIndex aIndex = rRange.aStart; + + while (aIndex < aEndIndex) + { + SwNode& rNode = aIndex.GetNode(); + + if (rNode.IsStartNode()) + { + // advance aIndex to the end node of this start node + SwNode * pEndNode = rNode.EndOfSectionNode(); + aIndex = *pEndNode; + + if (aIndex > aNewEnd) + { + aNewEnd = aIndex; + bChanged = true; + } + } + else if (rNode.IsEndNode()) + { + SwNode * pStartNode = rNode.StartOfSectionNode(); + SwNodeIndex aStartIndex = *pStartNode; + + if (aStartIndex < aNewStart) + { + aNewStart = aStartIndex; + bChanged = true; + } + } + + if (aIndex < aEndIndex) + ++aIndex; + } + + SwNode * pNode = &aIndex.GetNode(); + while (pNode->IsEndNode()) + { + SwNode * pStartNode = pNode->StartOfSectionNode(); + SwNodeIndex aStartIndex(*pStartNode); + aNewStart = aStartIndex; + aNewEnd = aIndex; + bChanged = true; + + ++aIndex; + pNode = &aIndex.GetNode(); + } + + if (bChanged) + pResult = new SwNodeRange(aNewStart, aNewEnd); + + return pResult; +} + /*-- 18.05.2006 08:23:28--------------------------------------------------- -----------------------------------------------------------------------*/ -SwTableNode* SwNodes::TextToTable( const std::vector< std::vector<SwNodeRange> >& rTableNodes, +SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, SwTableFmt* pTblFmt, SwTableLineFmt* pLineFmt, SwTableBoxFmt* pBoxFmt, diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index f1108db65c..b5a446c457 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -68,10 +68,8 @@ using namespace ::com::sun::star; // AW: For VCOfDrawVirtObj and stuff #include <svx/sdr/contact/viewcontactofvirtobj.hxx> #include <drawinglayer/primitive2d/baseprimitive2d.hxx> -#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> #include <sw_primitivetypes2d.hxx> -#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> -#include <drawinglayer/primitive2d/hittestprimitive2d.hxx> +#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx> using namespace ::com::sun::star; @@ -243,20 +241,15 @@ namespace drawinglayer if(!getOuterRange().isEmpty()) { // currently this SW object has no primitive representation. As long as this is the case, - // create an invisible HitTestPrimitive to allow hitting the object. Use a filled primitive - // to get a HitTest which uses 'inside' as default object hit. The special cases from + // create invisible geometry to allow corfect HitTest and BoundRect calculations for the + // object. Use a filled primitive to get 'inside' as default object hit. The special cases from // the old SwVirtFlyDrawObj::CheckHit implementation are handled now in SwDrawView::PickObj; - // this removed the 'hack' to get a view from inside model data or to react on noll-tolerance + // this removed the 'hack' to get a view from inside model data or to react on null-tolerance // as it was done in the old implementation - const basegfx::B2DPolygon aOuterRangePolygon(basegfx::tools::createPolygonFromRect(getOuterRange())); - const basegfx::BColor aColor(0.0, 0.0, 0.0); - const Primitive2DReference aContentReference( - new PolyPolygonColorPrimitive2D( - basegfx::B2DPolyPolygon(aOuterRangePolygon), - aColor)); const Primitive2DReference aHitTestReference( - new HitTestPrimitive2D( - Primitive2DSequence(&aContentReference, 1))); + createHiddenGeometryPrimitives2D( + true, + getOuterRange())); aRetval = Primitive2DSequence(&aHitTestReference, 1); } @@ -302,9 +295,9 @@ namespace drawinglayer } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////////////// -// AW: own sdr::contact::ViewContact (VC) sdr::contact::ViewObjectContact (VOC) needed -// since offset is defined different from SdrVirtObj's sdr::contact::ViewContactOfVirtObj. -// For paint, that offset is used by setting at the OutputDevice; for primitives this is +// AW: own sdr::contact::ViewContact (VC) sdr::contact::ViewObjectContact (VOC) needed +// since offset is defined different from SdrVirtObj's sdr::contact::ViewContactOfVirtObj. +// For paint, that offset is used by setting at the OutputDevice; for primitives this is // not possible since we have no OutputDevice, but define the geometry itself. namespace sdr @@ -325,7 +318,7 @@ namespace sdr { } virtual ~VCOfSwVirtFlyDrawObj(); - + // access to SwVirtFlyDrawObj SwVirtFlyDrawObj& GetSwVirtFlyDrawObj() const { @@ -354,7 +347,7 @@ namespace sdr { const drawinglayer::primitive2d::Primitive2DReference xPrimitive( new drawinglayer::primitive2d::SwVirtFlyDrawObjPrimitive( - GetSwVirtFlyDrawObj(), + GetSwVirtFlyDrawObj(), aOuterRange)); xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xPrimitive, 1); @@ -385,8 +378,8 @@ basegfx::B2DRange SwVirtFlyDrawObj::getOuterBound() const { const Rectangle aOuterRectangle(pFlyFrame->Frm().Pos(), pFlyFrame->Frm().SSize()); - if(!aOuterRectangle.IsEmpty() - && RECT_EMPTY != aOuterRectangle.Right() + if(!aOuterRectangle.IsEmpty() + && RECT_EMPTY != aOuterRectangle.Right() && RECT_EMPTY != aOuterRectangle.Bottom()) { aOuterRange.expand(basegfx::B2DTuple(aOuterRectangle.Left(), aOuterRectangle.Top())); @@ -411,8 +404,8 @@ basegfx::B2DRange SwVirtFlyDrawObj::getInnerBound() const { const Rectangle aInnerRectangle(pFlyFrame->Frm().Pos() + pFlyFrame->Prt().Pos(), pFlyFrame->Prt().SSize()); - if(!aInnerRectangle.IsEmpty() - && RECT_EMPTY != aInnerRectangle.Right() + if(!aInnerRectangle.IsEmpty() + && RECT_EMPTY != aInnerRectangle.Right() && RECT_EMPTY != aInnerRectangle.Bottom()) { aInnerRange.expand(basegfx::B2DTuple(aInnerRectangle.Left(), aInnerRectangle.Top())); @@ -498,7 +491,7 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const if(bDrawObject) { - if(!pFlyFrm->IsFlyInCntFrm()) + if(!pFlyFrm->IsFlyInCntFrm()) { // it is also necessary to restore the VCL MapMode from ViewInformation since e.g. // the VCL PixelRenderer resets it at the used OutputDevice. Unfortunately, this @@ -507,10 +500,10 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const pOut->Push(PUSH_MAPMODE); pOut->SetMapMode(pShell->getPrePostMapMode()); - + // paint the FlyFrame (use standard VCL-Paint) pFlyFrm->Paint(GetFlyFrm()->Frm()); - + pOut->Pop(); } } @@ -563,6 +556,11 @@ const Rectangle& __EXPORT SwVirtFlyDrawObj::GetCurrentBoundRect() const return aOutRect; } +const Rectangle& __EXPORT SwVirtFlyDrawObj::GetLastBoundRect() const +{ + return GetCurrentBoundRect(); +} + void __EXPORT SwVirtFlyDrawObj::RecalcBoundRect() { diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index a9d7d2c390..a2c5cfd363 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -57,6 +57,9 @@ #ifndef _STATSTR_HRC #include <statstr.hrc> #endif +#include <bookmrk.hxx> +#include <xmloff/odffields.hxx> + using namespace ::com::sun::star; using namespace ::com::sun::star::i18n; @@ -231,6 +234,25 @@ BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) return bRet; } +BOOL SwEditShell::UpdateField( sw::mark::IFieldmark &fieldBM) +{ +// SwDocShell* pDocSh = pDoc->GetDocShell(); + //@TODO implement me...; add undo etc... + if ( pDoc && fieldBM.IsExpanded( ) ) { + SwPosition aSttPos = fieldBM.GetMarkStart( ); + aSttPos.nContent++; + + SwPosition aEndPos = fieldBM.GetMarkEnd( ); + aEndPos.nContent--; + + SwPaM aPaM( aSttPos, aEndPos ); + pDoc->DeleteRange(aPaM); + pDoc->InsertString(aPaM, String::CreateFromAscii("Implement me ;-)") ); + } + return TRUE; +} + + /*-------------------------------------------------------------------- Beschreibung: Aktuelles Verzeichnis vor oder in dem der Cursor steht diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 98fd9ae091..d0011f521e 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -72,9 +72,11 @@ // --> OD 2006-03-06 #125892# #include <HandleAnchorNodeChg.hxx> // <-- - #include <frmatr.hxx> - +// --> OD 2009-12-29 #i89920# +#include <fmtsrnd.hxx> +#include <editeng/opaqitem.hxx> +// <-- using ::rtl::OUString; using namespace ::com::sun::star; @@ -908,67 +910,50 @@ SwFlyFrmFmt* SwFEShell::InsertObject( const svt::EmbeddedObjectRef& xObj, } -void SwFEShell::Insert( SdrObject& rDrawObj, - const SfxItemSet* pFlyAttrSet, - SwFrmFmt* pFrmFmt, const Point* pPt ) +void SwFEShell::InsertDrawObj( SdrObject& rDrawObj, + const Point& rInsertPosition ) { - SwDrawFrmFmt* pFmt = 0; SET_CURR_SHELL( this ); - if( pPt ) - { - SfxItemSet* pSet = 0; - const SfxPoolItem* pItem; - if( !pFlyAttrSet || - !pFlyAttrSet->GetItemState( RES_ANCHOR, sal_False, &pItem ) || - (FLY_AT_PAGE != ((SwFmtAnchor*)pItem)->GetAnchorId())) - { - pSet = new SfxItemSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange ); - pSet->Put( SwFmtAnchor( FLY_AT_PARA )); - pFlyAttrSet = pSet; - } + SfxItemSet rFlyAttrSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange ); + rFlyAttrSet.Put( SwFmtAnchor( FLY_AT_PARA )); + // --> OD 2009-12-29 #i89920# + rFlyAttrSet.Put( SwFmtSurround( SURROUND_THROUGHT ) ); + rDrawObj.SetLayer( getIDocumentDrawModelAccess()->GetHeavenId() ); + // <-- + // find anchor position + SwPaM aPam( pDoc->GetNodes() ); + { SwCrsrMoveState aState( MV_SETONLYTEXT ); - SwPaM aPam( pDoc->GetNodes() ); - Point aTmpPt( *pPt ); + Point aTmpPt( rInsertPosition ); getIDocumentLayoutAccess()->GetRootFrm()->GetCrsrOfst( aPam.GetPoint(), aTmpPt, &aState ); - SwFrm* pFrm = aPam.GetCntntNode()->GetFrm( 0, 0, sal_False ); - const Point aRelPos( pPt->X() - pFrm->Frm().Left(), - pPt->Y() - pFrm->Frm().Top() ); - // OD 2004-04-05 #i26791# - direct object positioning for <SwDoc::Insert(..)> + const SwFrm* pFrm = aPam.GetCntntNode()->GetFrm( 0, 0, sal_False ); + const Point aRelPos( rInsertPosition.X() - pFrm->Frm().Left(), + rInsertPosition.Y() - pFrm->Frm().Top() ); rDrawObj.SetRelativePos( aRelPos ); - ::lcl_FindAnchorPos( *GetDoc(), *pPt, *pFrm, *(SfxItemSet*)pFlyAttrSet ); - pFmt = GetDoc()->Insert( aPam, rDrawObj, pFlyAttrSet, pFrmFmt ); - if( pSet ) - delete pSet; - } - else - { - StartAllAction(); - FOREACHPAM_START( this ) - pFmt = GetDoc()->Insert(*PCURCRSR, rDrawObj, - pFlyAttrSet, pFrmFmt ); - ASSERT( pFmt, "Doc->Insert(sdrobj) failed." ); - - FOREACHPAM_END() - EndAllAction(); + ::lcl_FindAnchorPos( *GetDoc(), rInsertPosition, *pFrm, rFlyAttrSet ); } + // insert drawing object into the document creating a new <SwDrawFrmFmt> instance + SwDrawFrmFmt* pFmt = GetDoc()->Insert( aPam, rDrawObj, &rFlyAttrSet, 0 ); - // --> OD 2005-01-07 #i40085# - follow-up of #i35635# // move object to visible layer SwContact* pContact = static_cast<SwContact*>(rDrawObj.GetUserCall()); if ( pContact ) { pContact->MoveObjToVisibleLayer( &rDrawObj ); } - // <-- - if( pFmt ) - // das DrawObject selektieren + if ( pFmt ) + { + // select drawing object Imp()->GetDrawView()->MarkObj( &rDrawObj, Imp()->GetPageView(), - sal_False, sal_False ); + sal_False, sal_False ); + } else + { GetLayout()->SetAssertFlyPages(); + } } /*********************************************************************** diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index e09b8066de..eecb8047c2 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1182,9 +1182,7 @@ bool SwFEShell::IsObjSelectable( const Point& rPt ) } // #107513# -// Test if there is a draw object at that position and if it should be selected. -// The 'should' is aimed at Writer text fly frames which may be in front of -// the draw object. +// Test if there is a object at that position and if it should be selected. sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt) { SET_CURR_SHELL(this); @@ -1201,39 +1199,79 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt) bRet = pDrawView->PickObj(rPt, pDrawView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMARKABLE); pDrawView->SetHitTolerancePixel(nOld); - if(bRet && pObj) + if ( bRet && pObj ) { const IDocumentDrawModelAccess* pIDDMA = getIDocumentDrawModelAccess(); - if( pObj->GetLayer() == pIDDMA->GetHellId() ) + // --> OD 2009-12-30 #i89920# + // Do not select object in background which is overlapping this text + // at the given position. + bool bObjInBackground( false ); { - const SwFrm *pPageFrm = GetLayout()->Lower(); - while( pPageFrm && !pPageFrm->Frm().IsInside( rPt ) ) + if ( pObj->GetLayer() == pIDDMA->GetHellId() ) { - if ( rPt.Y() < pPageFrm->Frm().Top() ) - pPageFrm = 0; - else - pPageFrm = pPageFrm->GetNext(); + const SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj ); + const SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt(); + const SwFmtSurround& rSurround = rFmt.GetSurround(); + if ( rSurround.GetSurround() == SURROUND_THROUGHT ) + { + bObjInBackground = true; + } } + } + if ( bObjInBackground ) + { + const SwPageFrm* pPageFrm = GetLayout()->GetPageAtPos( rPt ); if( pPageFrm ) { - SwRect aTmp( pPageFrm->Prt() ); - aTmp += pPageFrm->Frm().Pos(); - if( aTmp.IsInside( rPt ) ) - return sal_False; + const SwCntntFrm* pCntntFrm( pPageFrm->ContainsCntnt() ); + while ( pCntntFrm ) + { + if ( pCntntFrm->UnionFrm().IsInside( rPt ) ) + { + const SwTxtFrm* pTxtFrm = + dynamic_cast<const SwTxtFrm*>(pCntntFrm); + if ( pTxtFrm ) + { + SwPosition* pPos = + new SwPosition( *(pTxtFrm->GetTxtNode()) ); + Point aTmpPt( rPt ); + if ( pTxtFrm->GetKeyCrsrOfst( pPos, aTmpPt ) ) + { + SwRect aCursorCharRect; + if ( pTxtFrm->GetCharRect( aCursorCharRect, *pPos ) ) + { + if ( aCursorCharRect.IsOver( SwRect( pObj->GetLastBoundRect() ) ) ) + { + bRet = sal_False; + } + } + } + } + else + { + bRet = sal_False; + } + break; + } + + pCntntFrm = pCntntFrm->GetNextCntntFrm(); + } } } - - const SdrPage* pPage = pIDDMA->GetDrawModel()->GetPage(0); - // --> FME 2005-04-18 #i20965# Use GetOrdNum() instead of GetOrdNumDirect() - // because ordnums might be wrong - for(sal_uInt32 a(pObj->GetOrdNum() + 1); bRet && a < pPage->GetObjCount(); a++) - { // <-- - SdrObject *pCandidate = pPage->GetObj(a); - if(pCandidate->ISA(SwVirtFlyDrawObj) && ((SwVirtFlyDrawObj*)pCandidate)->GetCurrentBoundRect().IsInside(rPt)) + if ( bRet ) + { + const SdrPage* pPage = pIDDMA->GetDrawModel()->GetPage(0); + for(sal_uInt32 a(pObj->GetOrdNum() + 1); bRet && a < pPage->GetObjCount(); a++) { - bRet = sal_False; + SdrObject *pCandidate = pPage->GetObj(a); + + if (pCandidate->ISA(SwVirtFlyDrawObj) && + ( (SwVirtFlyDrawObj*)pCandidate)->GetCurrentBoundRect().IsInside(rPt) ) + { + bRet = sal_False; + } } } } diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 2414071ff4..3c2f958fa9 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -670,15 +670,6 @@ void SwGrfNode::SetTwipSize( const Size& rSz ) } } - // Prioritaet beim Laden der Grafik setzen. Geht nur, wenn der Link - // ein FileObject gesetzt hat -void SwGrfNode::SetTransferPriority( USHORT nPrio ) -{ - if( refLink.Is() && refLink->GetObj() ) - sfx2::LinkManager::SetTransferPriority( *refLink, nPrio ); -} - - void SwGrfNode::ScaleImageMap() { if( !nGrfSize.Width() || !nGrfSize.Height() ) diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx index 8cd6b19e91..c663844a9c 100644 --- a/sw/source/core/inc/MarkManager.hxx +++ b/sw/source/core/inc/MarkManager.hxx @@ -40,8 +40,18 @@ namespace sw { namespace mark public: MarkManager(/*[in/out]*/ SwDoc& rDoc); + void dumpFieldmarks( ) const; + // IDocumentMarkAccess virtual ::sw::mark::IMark* makeMark(const SwPaM& rPaM, const ::rtl::OUString& rName, IDocumentMarkAccess::MarkType eMark); + + virtual sw::mark::IFieldmark* makeFieldBookmark( const SwPaM& rPaM, + const rtl::OUString& rName, + const rtl::OUString& rType); + virtual sw::mark::IFieldmark* makeNoTextFieldBookmark( const SwPaM& rPaM, + const rtl::OUString& rName, + const rtl::OUString& rType); + virtual ::sw::mark::IMark* getMarkForTxtNode(const SwTxtNode& rTxtNode, IDocumentMarkAccess::MarkType eMark); virtual void repositionMark(::sw::mark::IMark* io_pMark, const SwPaM& rPaM); diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx index c5d48463bc..a47a0598c1 100644 --- a/sw/source/core/inc/bookmrk.hxx +++ b/sw/source/core/inc/bookmrk.hxx @@ -34,6 +34,7 @@ #include <boost/scoped_ptr.hpp> #include <boost/noncopyable.hpp> +#include <map> #include <IMark.hxx> @@ -53,26 +54,31 @@ namespace sw { namespace mark { public: //getters - virtual const SwPosition& GetMarkPos() const + virtual SwPosition& GetMarkPos() const { return *m_pPos1; } virtual const ::rtl::OUString& GetName() const { return m_aName; } - virtual bool IsCoveringPosition(const SwPosition& rPos) const - { return GetMarkStart() <= rPos && rPos <= GetMarkEnd(); }; - virtual const SwPosition& GetOtherMarkPos() const + virtual bool IsCoveringPosition(const SwPosition& rPos) const; + virtual SwPosition& GetOtherMarkPos() const { OSL_PRECOND(IsExpanded(), "<SwPosition::GetOtherMarkPos(..)> - I have no other Pos set." ); return *m_pPos2; } - virtual const SwPosition& GetMarkStart() const + virtual SwPosition& GetMarkStart() const { - if(!m_pPos2 /* !IsExpanded()*/) return *m_pPos1; - return *m_pPos1 < *m_pPos2 ? *m_pPos1 : *m_pPos2; + if( !IsExpanded() ) return GetMarkPos( ); + if ( GetMarkPos( ) < GetOtherMarkPos( ) ) + return GetMarkPos(); + else + return GetOtherMarkPos( ); } - virtual const SwPosition& GetMarkEnd() const + virtual SwPosition& GetMarkEnd() const { - if(!m_pPos2 /* !IsExpanded()*/ ) return *m_pPos1; - return *m_pPos1 > *m_pPos2 ? *m_pPos1 : *m_pPos2; + if( !IsExpanded() ) return GetMarkPos(); + if ( GetMarkPos( ) > GetOtherMarkPos( ) ) + return GetMarkPos( ); + else + return GetOtherMarkPos( ); } virtual bool IsExpanded() const { return m_pPos2; } @@ -85,6 +91,8 @@ namespace sw { namespace mark virtual void ClearOtherMarkPos() { m_pPos2.reset(); } + virtual rtl::OUString ToString( ) const; + virtual void Swap() { if(m_pPos2) @@ -120,7 +128,6 @@ namespace sw { namespace mark class NavigatorReminder : public MarkBase - , virtual public IMark { public: NavigatorReminder(const SwPaM& rPaM); @@ -204,24 +211,31 @@ namespace sw { namespace mark Fieldmark(const SwPaM& rPaM); // getters - ::rtl::OUString GetFieldname() const + virtual ::rtl::OUString GetFieldname() const { return m_aFieldname; } - ::rtl::OUString GetFieldHelptext() const + virtual ::rtl::OUString GetFieldHelptext() const { return m_aFieldHelptext; } + virtual IFieldmark::parameter_map_t* GetParameters() + { return &m_vParams; } + + virtual const IFieldmark::parameter_map_t* GetParameters() const + { return &m_vParams; } + // setters - void SetFieldname(const ::rtl::OUString& aFieldname) + virtual void SetFieldname(const ::rtl::OUString& aFieldname) { m_aFieldname = aFieldname; } - void SetFieldHelptext(const ::rtl::OUString& aFieldHelptext) + virtual void SetFieldHelptext(const ::rtl::OUString& aFieldHelptext) { m_aFieldHelptext = aFieldHelptext; } - private: - //int fftype; // Type: 0 = Text, 1 = Check Box, 2 = List - //bool ffprot; + virtual void Invalidate(); + virtual rtl::OUString ToString() const; + private: ::rtl::OUString m_aFieldname; ::rtl::OUString m_aFieldHelptext; - static const ::rtl::OUString our_sNamePrefix; + IFieldmark::parameter_map_t m_vParams; + static const ::rtl::OUString our_sNamePrefix; }; class TextFieldmark @@ -230,9 +244,6 @@ namespace sw { namespace mark public: TextFieldmark(const SwPaM& rPaM); virtual void InitDoc(SwDoc* const io_pDoc); - private: - //int fftypetxt; // Type of text field: 0 = Regular text, 1 = Number, 2 = Date, 3 = Current date, 4 = Current time, 5 = Calculation - //int ffmaxlen; // Number of characters for text field. Zero means unlimited. }; class CheckboxFieldmark @@ -244,11 +255,6 @@ namespace sw { namespace mark virtual void InitDoc(SwDoc* const io_pDoc); bool IsChecked() const; void SetChecked(bool checked); - private: - bool m_isChecked; - //bool ffsize; // 0 = Auto, 1=Exact (see ffhps) - //bool ffrecalc; - //int ffhps; // Check box size (half-point sizes). }; }} diff --git a/sw/source/core/inc/crossrefbookmark.hxx b/sw/source/core/inc/crossrefbookmark.hxx index 168f33f229..ab396cf4e9 100644 --- a/sw/source/core/inc/crossrefbookmark.hxx +++ b/sw/source/core/inc/crossrefbookmark.hxx @@ -45,10 +45,10 @@ namespace sw { namespace mark const ::rtl::OUString& rPrefix); // getters - virtual const SwPosition& GetOtherMarkPos() const; - virtual const SwPosition& GetMarkStart() const + virtual SwPosition& GetOtherMarkPos() const; + virtual SwPosition& GetMarkStart() const { return *m_pPos1; } - virtual const SwPosition& GetMarkEnd() const + virtual SwPosition& GetMarkEnd() const { return *m_pPos1; } virtual bool IsExpanded() const { return false; } diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx index c8b476d72e..6cd65bf6d9 100644 --- a/sw/source/core/inc/dflyobj.hxx +++ b/sw/source/core/inc/dflyobj.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,8 +44,10 @@ const UINT16 SwDrawFirst = 0x0001; class SwFlyDrawObj : public SdrObject { +private: virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); +protected: // #i95264# SwFlyDrawObj needs an own VC since createViewIndependentPrimitive2DSequence() // is called when RecalcBoundRect() is used virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); @@ -70,9 +72,10 @@ public: class SwVirtFlyDrawObj : public SdrVirtObj { +private: SwFlyFrm *pFlyFrm; -private: +protected: // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is // not used but something own (top left of new SnapRect minus top left // of original SnapRect) @@ -97,6 +100,7 @@ public: //Wir nehemen die Groessenbehandlung vollstaendig selbst in die Hand. virtual const Rectangle& GetCurrentBoundRect() const; + virtual const Rectangle& GetLastBoundRect() const; virtual void RecalcBoundRect(); virtual void RecalcSnapRect(); virtual const Rectangle& GetSnapRect() const; diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx index b7b360395d..25bc565727 100644 --- a/sw/source/core/inc/layact.hxx +++ b/sw/source/core/inc/layact.hxx @@ -105,14 +105,8 @@ class SwLayAction // OD 14.04.2003 #106346# - new flag for content formatting on interrupt. sal_Bool mbFormatCntntOnInterrupt; - // --> OD 2004-06-14 #i28701# - new flag, indicating, if scrolling is - // allowed during page format - bool mbScrollingAllowed; - #ifdef _LAYACT_CXX - void _AddScrollRect( const SwCntntFrm *, const SwPageFrm *, - const SwTwips, const SwTwips ); void PaintCntnt( const SwCntntFrm *, const SwPageFrm *, const SwRect &rOldRect, long nOldBottom ); BOOL PaintWithoutFlys( const SwRect &, const SwCntntFrm *, diff --git a/sw/source/core/inc/scrrect.hxx b/sw/source/core/inc/scrrect.hxx deleted file mode 100644 index b880f3ed33..0000000000 --- a/sw/source/core/inc/scrrect.hxx +++ /dev/null @@ -1,125 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SCRRECT_HXX -#define _SCRRECT_HXX - -#include <svl/svarray.hxx> -#include "swrect.hxx" -#include <swtypes.hxx> - -class SwStripe -{ - SwTwips nY; - SwTwips nHeight; -public: - inline SwStripe( SwTwips nPos, SwTwips nHght ) - : nY( nPos ), nHeight( nHght ) {} - inline SwTwips GetY() const { return nY; } - inline SwTwips& Y() { return nY; } - inline SwTwips GetHeight() const { return nHeight; } - inline SwTwips& Height() { return nHeight; } - inline SwTwips GetBottom() const { return nHeight ? nY + nHeight - 1 : nY; } - inline BOOL operator<( const SwStripe &rTst ) const - { return nY < rTst.nY || ( nY == rTst.nY && nHeight > rTst.nHeight ); } - inline BOOL operator==( const SwStripe& rTst ) const - { return nY == rTst.nY && nHeight == rTst.nHeight; } -}; - -SV_DECL_VARARR( SwStripeArr, SwStripe, 1, 4 ) - -class SwStripes : public SwStripeArr, public SwStripe -{ - SwTwips nMin; // Left minimum - SwTwips nMax; // Right maximum -public: - SwStripes( SwTwips nPos, SwTwips nSize, SwTwips nMn, SwTwips nMx ) - : SwStripe( nPos, nSize ), nMin( nMn ), nMax( nMx ) {} - SwStripes& Plus( const SwStripes& rOther, BOOL bVert ); - BOOL Recalc( BOOL bVert ); - - inline SwTwips GetMin() const { return nMin; } - inline SwTwips GetMax() const { return nMax; } - inline void SetMin( const SwTwips nNew ) { nMin = nNew; } - inline void SetMax( const SwTwips nNew ) { nMax = nNew; } - inline void ChkMin( const SwTwips nNew ) { if( nNew < nMin ) nMin = nNew; } - inline void ChkMax( const SwTwips nNew ) { if( nNew > nMax ) nMax = nNew; } - inline SwTwips GetRight() const { return nMax > nMin ? nMax - 1 : nMax; } - inline SwTwips GetWidth() const { return nMax - nMin; } -}; - -class SwScrollColumn -{ - SwTwips nX; - SwTwips nWidth; - SwTwips nOffs; - BOOL bVertical; -public: - inline SwScrollColumn( SwTwips nPos, SwTwips nSz, SwTwips nOff, BOOL bVert ) - : nX( nPos ), nWidth( nSz ), nOffs( nOff ), bVertical( bVert ) {} - inline SwScrollColumn( const SwScrollColumn& rCol ) - : nX( rCol.nX ), nWidth( rCol.nWidth ), - nOffs( rCol.nOffs ), bVertical( rCol.bVertical ) {} - BOOL IsVertical() const { return bVertical; } - inline BOOL operator<( const SwScrollColumn &rTst ) const - { return bVertical < rTst.bVertical || ( bVertical == rTst.bVertical && - ( nX < rTst.nX || ( nX == rTst.nX && ( nWidth < rTst.nWidth || - ( nWidth == rTst.nWidth && nOffs < rTst.nOffs ) ) ) ) ); } - inline BOOL operator==( const SwScrollColumn &rTst ) const - { return bVertical == rTst.bVertical && nX == rTst.nX && - nWidth == rTst.nWidth && nOffs == rTst.nOffs;} - inline SwTwips GetX() const { return nX; } - inline SwTwips GetWidth() const { return nWidth; } - inline SwTwips GetOffs() const { return nOffs; } - inline void ClrOffs() { nOffs = 0; } - inline SwTwips GetRight() const { return nWidth ? nX + nWidth - 1 : nX; } -}; - -typedef SwStripes* SwStripesPtr; -SV_DECL_PTRARR_SORT(SwScrollStripes, SwStripesPtr, 1, 4) - -class SwScrollArea : public SwScrollColumn, public SwScrollStripes -{ -public: - void SmartInsert( SwStripes* pStripes ); - void Add( SwScrollArea *pScroll ); - inline SwScrollArea( const SwScrollColumn &rCol, SwStripes* pStripes ) - : SwScrollColumn( rCol ) - { Insert( pStripes ); } - BOOL Compress(); -}; - -typedef SwScrollArea* SwScrollAreaPtr; -SV_DECL_PTRARR_SORT(SScrAreas,SwScrollAreaPtr,1,2) - -class SwScrollAreas : public SScrAreas -{ -public: - void InsertCol( const SwScrollColumn &rCol, SwStripes *pStripes ); -}; - - -#endif //_SCRRECT_HXX diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index bde145fc06..bdaadecf64 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -46,7 +46,6 @@ class SwBorderAttrs; class SwFrmFmt; class OutputDevice; class SwTestFormat; -class SwStripes; struct SwCrsrMoveState; struct SwFillData; class SwPortionHandler; @@ -544,8 +543,6 @@ public: // Stoppt Animationen innerhalb von Numerierungen void StopAnimation( OutputDevice *pOut ); - void CriticalLines(const OutputDevice& rOut,SwStripes &rStripes,long nOffs); - // visit all portions for Accessibility void VisitPortions( SwPortionHandler& rPH ) const; diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index 5092ede30e..5403ffe89d 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -42,7 +42,6 @@ class ViewShell; class SwFlyFrm; class SwViewOption; class SwRegionRects; -class SwScrollAreas; class SwFrm; class SwLayAction; class SwLayIdle; @@ -86,8 +85,6 @@ class SwViewImp SwPageFrm *pFirstVisPage;//Zeigt immer auf die erste sichtbare Seite. SwRegionRects *pRegion; //Sammler fuer Paintrects aus der LayAction. - SwScrollAreas *pScrollRects; //Sammler fuer Scrollrects aus der LayAction. - SwScrollAreas *pScrolledArea;//Sammler der gescrollten Rechtecke. SwLayAction *pLayAct; //Ist gesetzt wenn ein Action-Objekt existiert //Wird vom SwLayAction-CTor ein- und vom DTor @@ -99,17 +96,11 @@ class SwViewImp mutable const SdrObject * pSdrObjCached; mutable String sSdrObjCachedComment; - AutoTimer aScrollTimer; //Fuer das Aufraeumen nach dem Scrollen. - BOOL bFirstPageInvalid :1; //Pointer auf erste Seite ungueltig? - BOOL bNextScroll :1; //Scroll in der folgenden EndAction erlaubt? - BOOL bScroll :1; //Scroll in der aktuellen EndAction erlaubt? - BOOL bScrolled :1; //Wurde gescrolled? Dann im Idle aufraeumen. //BOOL bResetXorVisibility:1; //StartAction/EndAction //HMHBOOL bShowHdlPaint :1; //LockPaint/UnlockPaint BOOL bResetHdlHiddenPaint:1;// -- "" -- - BOOL bPaintInScroll :1; //Paint (Update() im ScrollHdl der ViewShell BOOL bSmoothUpdate :1; //Meber fuer SmoothScroll BOOL bStopSmooth :1; @@ -144,21 +135,6 @@ class SwViewImp void SetFirstVisPage(); //Neue Ermittlung der ersten sichtbaren Seite - void ResetNextScroll() { bNextScroll = FALSE; } - void SetNextScroll() { bNextScroll = TRUE; } - void SetScroll() { bScroll = TRUE; } - void ResetScrolled() { bScrolled = FALSE; } - void SetScrolled() { bScrolled = TRUE; } - - SwScrollAreas *GetScrollRects() { return pScrollRects; } - void FlushScrolledArea(); - BOOL _FlushScrolledArea( SwRect& rRect ); - BOOL FlushScrolledArea( SwRect& rRect ) - { if( !pScrolledArea ) return FALSE; return _FlushScrolledArea( rRect ); } - void _ScrolledRect( const SwRect& rRect, long nOffs ); - void ScrolledRect( const SwRect& rRect, long nOffs ) - { if( pScrolledArea ) _ScrolledRect( rRect, nOffs ); } - void StartAction(); //Henkel Anzeigen und verstecken. void EndAction(); //gerufen von ViewShell::ImplXXXAction void LockPaint(); //dito, gerufen von ViewShell::ImplLockPaint @@ -224,32 +200,9 @@ public: inline SwPageFrm *GetFirstVisPage(); void SetFirstVisPageInvalid() { bFirstPageInvalid = TRUE; } - //SS'en fuer Paint- und Scrollrects. BOOL AddPaintRect( const SwRect &rRect ); - void AddScrollRect( const SwFrm *pFrm, const SwRect &rRect, long nOffs ); - void MoveScrollArea(); SwRegionRects *GetRegion() { return pRegion; } - void DelRegions(); //Loescht Scroll- und PaintRects - - //Handler fuer das Refresh von gescrollten Bereichen (Korrektur des - //Alignments). Ruft das Refresh mit der ScrolledArea. - //RefreshScrolledArea kann z.B. beim Setzen des Crsr genutzt werden, es - //wird nur der Anteil des Rect refreshed, der mit der ScrolledArea - //ueberlappt. Das 'reingereichte Rechteck wird veraendert! - void RestartScrollTimer() { aScrollTimer.Start(); } - DECL_LINK( RefreshScrolledHdl, Timer * ); - void _RefreshScrolledArea( const SwRect &rRect ); - void RefreshScrolledArea( SwRect &rRect ); - - //Wird vom Layout ggf. waehrend einer Action gerufen, wenn der - //Verdacht besteht, dass es etwas drunter und drueber geht. - void ResetScroll() { bScroll = FALSE; } - - BOOL IsNextScroll() const { return bNextScroll; } - BOOL IsScroll() const { return bScroll; } - BOOL IsScrolled() const { return bScrolled; } - - BOOL IsPaintInScroll() const { return bPaintInScroll; } + void DelRegion(); // neues Interface fuer StarView Drawing inline BOOL HasDrawView() const { return 0 != pDrawView; } @@ -364,20 +317,6 @@ public: void FireAccessibleEvents(); }; -//Kann auf dem Stack angelegt werden, wenn etwas ausgegeben oder -//gescrolled wird. Handles und sontiges vom Drawing werden im CTor -//gehidet und im DTor wieder sichtbar gemacht. -//AW 06-Sep99: Hiding of handles is no longer necessary, removed -//class SwSaveHdl -//{ -// SwViewImp *pImp; -// BOOL bXorVis; -//public: -// SwSaveHdl( SwViewImp *pImp ); -// ~SwSaveHdl(); -//}; - - inline SwPageFrm *SwViewImp::GetFirstVisPage() { if ( bFirstPageInvalid ) diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index a1ad57fad5..3118e73c14 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2727,10 +2727,23 @@ void SwFlyFrmFmt::MakeFrms() //die Suche vom StartNode zum FrameFormat sein. SwNodeIndex aIdx( aAnchorAttr.GetCntntAnchor()->nNode ); SwCntntNode *pCNd = GetDoc()->GetNodes().GoNext( &aIdx ); - SwClientIter aIter( *pCNd ); - if ( aIter.First( TYPE(SwFrm) ) ) - pModify = pCNd; - else + // --> OD 2009-12-28 #i105535# + if ( pCNd == 0 ) + { + pCNd = aAnchorAttr.GetCntntAnchor()->nNode.GetNode().GetCntntNode(); + } + if ( pCNd ) + // <-- + { + SwClientIter aIter( *pCNd ); + if ( aIter.First( TYPE(SwFrm) ) ) + { + pModify = pCNd; + } + } + // --> OD 2009-12-28 #i105535# + if ( pModify == 0 ) + // <-- { const SwNodeIndex &rIdx = aAnchorAttr.GetCntntAnchor()->nNode; SwSpzFrmFmts& rFmts = *GetDoc()->GetSpzFrmFmts(); @@ -2802,7 +2815,24 @@ void SwFlyFrmFmt::MakeFrms() !((SwCntntFrm*)pFrm)->IsFollow(); if ( FLY_AT_FLY == aAnchorAttr.GetAnchorId() && !pFrm->IsFlyFrm() ) - pFrm = pFrm->FindFlyFrm(); + { + // --> OD 2009-12-28 #i105535# + // fallback to anchor type at-paragraph, if no fly frame is found. +// pFrm = pFrm->FindFlyFrm(); + SwFrm* pFlyFrm = pFrm->FindFlyFrm(); + if ( pFlyFrm ) + { + pFrm = pFlyFrm; + } + else + { + aAnchorAttr.SetType( FLY_AT_PARA ); + SetFmtAttr( aAnchorAttr ); + MakeFrms(); + return; + } + // <-- + } if( pFrm->GetDrawObjs() ) { diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index a742b97a45..d516598eca 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -510,10 +510,10 @@ BOOL SwFlowFrm::PasteTree( SwFrm *pStart, SwLayoutFrm *pParent, SwFrm *pSibling, pParent->pLower = pStart; else //Modified for #i100782#,04/03/2009 - //If the pParent has more than 1 child nodes, former design will - //ignore them directly without any collection work. It will make some + //If the pParent has more than 1 child nodes, former design will + //ignore them directly without any collection work. It will make some //dangling pointers. This lead the crash... - //The new design will find the last child of pParent in loop way, and + //The new design will find the last child of pParent in loop way, and //add the pStart after the last child. // pParent->Lower()->pNext = pStart; { @@ -2127,13 +2127,15 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways ) // OD 30.10.2002 #97265# - no <CheckPageDesc(..)> in online layout if ( !pNewPage->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) { - //Bei Sections kann es passieren, das wir gleich in den Follow geflutscht - //sind. Dadurch wird nicht vom GetLeaf fuer die richtige Seite gesorgt. - //Das muessen wir fuer diesen Fall pruefen. - if ( !bSamePage && pNewUpper->IsInSct() && + // --> OD 2009-12-31 #i106452# + // check page description not only in situation with sections. + if ( !bSamePage && ( rThis.GetAttrSet()->GetPageDesc().GetPageDesc() || pOldPage->GetPageDesc()->GetFollow() != pNewPage->GetPageDesc() ) ) + { SwFrm::CheckPageDescs( pNewPage, FALSE ); + } + // <-- } } return bSamePage; diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index ea7fbdecaf..32be148927 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -371,149 +371,6 @@ void SwLayAction::PaintCntnt( const SwCntntFrm *pCnt, /************************************************************************* |* -|* SwLayAction::_AddScrollRect() -|* -|* Ersterstellung MA 04. Mar. 94 -|* Letzte Aenderung MA 04. Mar. 94 -|* -|*************************************************************************/ -BOOL MA_FASTCALL lcl_IsOverObj( const SwFrm *pFrm, const SwPageFrm *pPage, - const SwRect &rRect1, const SwRect &rRect2, - const SwLayoutFrm *pLay ) -{ - const SwSortedObjs &rObjs = *pPage->GetSortedObjs(); - const SwFlyFrm *pSelfFly = pFrm->FindFlyFrm(); - const BOOL bInCnt = pSelfFly && pSelfFly->IsFlyInCntFrm() ? TRUE : FALSE; - - for ( sal_uInt32 j = 0; j < rObjs.Count(); ++j ) - { - // --> OD 2004-07-07 #i28701# - consider changed type of <SwSortedObjs> entries - const SwAnchoredObject* pAnchoredObj = rObjs[j]; - const SwRect aRect( pAnchoredObj->GetObjRect() ); - if ( !rRect1.IsOver( aRect ) && !rRect2.IsOver( aRect ) ) - continue; //Keine Ueberlappung, der naechste. - - const SwFlyFrm *pFly = pAnchoredObj->ISA(SwFlyFrm) - ? static_cast<const SwFlyFrm*>(pAnchoredObj) : 0; - - //Wenn der Rahmen innerhalb des LayFrm verankert ist, so darf er - //mitgescrollt werden, wenn er nicht seitlich aus dem Rechteck - //herausschaut. - if ( pLay && pFly && pFly->IsLowerOf( pLay ) ) - { - if ( pFly->Frm().Left() < rRect1.Left() || - pFly->Frm().Right()> rRect1.Right() ) - return TRUE; - continue; - } - - if ( !pSelfFly ) //Nur wenn der Frm in einem Fly steht kann - return TRUE; //es Einschraenkungen geben. - - if ( !pFly ) //Keine Einschraenkung fuer Zeichenobjekte. - return TRUE; - - if ( pFly != pSelfFly ) - { - //Flys unter dem eigenen nur dann abziehen, wenn sie innerhalb des - //eigenen stehen. - //Fuer inhaltsgebundene Flys alle Flys abziehen fuer die gilt, dass - //pSelfFly nicht innerhalb von ihnen steht. - if ( bInCnt ) - { - const SwFlyFrm *pTmp = pSelfFly->GetAnchorFrm()->FindFlyFrm(); - while ( pTmp ) - { - if ( pTmp == pFly ) - return FALSE; - else - pTmp = pTmp->GetAnchorFrm()->FindFlyFrm(); - } - } else if ( pAnchoredObj->GetDrawObj()->GetOrdNum() < - pSelfFly->GetVirtDrawObj()->GetOrdNum() ) - { - const SwFlyFrm *pTmp = pFly; - do - { if ( pTmp == pSelfFly ) - return TRUE; - else - pTmp = pTmp->GetAnchorFrm()->FindFlyFrm(); - } while ( pTmp ); - } else - return TRUE; - } - } - return FALSE; -} - -void SwLayAction::_AddScrollRect( const SwCntntFrm *pCntnt, - const SwPageFrm *pPage, - const SwTwips nOfst, - const SwTwips nOldBottom ) -{ - // --> OD 2004-07-01 #i28701# - determine, if scrolling is allowed. - bool bScroll = mbScrollingAllowed; - SwRect aPaintRect( pCntnt->PaintArea() ); - SWRECTFN( pCntnt ) - - // --> OD 2007-11-27 #notes2# - // if sidebar for notes is present, no scrolling is allowed - if ( bScroll ) - { - const SwPostItMgr* pPostItMgr = pImp->GetShell()->GetPostItMgr(); - if ( pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ) - { - bScroll = false; - } - } - // <-- - - //Wenn altes oder neues Rechteck mit einem Fly ueberlappen, in dem der - //Cntnt nicht selbst steht, so ist nichts mit Scrollen. - if ( bScroll && pPage->GetSortedObjs() ) - { - SwRect aRect( aPaintRect ); - if( bVert ) - aPaintRect.Pos().X() += nOfst; - else - aPaintRect.Pos().Y() -= nOfst; - - if ( ::lcl_IsOverObj( pCntnt, pPage, aPaintRect, aRect, 0 ) ) - bScroll = false; - - if( bVert ) - aPaintRect.Pos().X() -= nOfst; - else - aPaintRect.Pos().Y() += nOfst; - } - if ( bScroll && pPage->GetFmt()->GetBackground().GetGraphicPos() != GPOS_NONE ) - bScroll = false; - - if ( bScroll ) - { - if( aPaintRect.HasArea() ) - pImp->GetShell()->AddScrollRect( pCntnt, aPaintRect, nOfst ); - if ( pCntnt->IsRetouche() && !pCntnt->GetNext() ) - { - SwRect aRect( pCntnt->GetUpper()->PaintArea() ); - (aRect.*fnRect->fnSetTop)( (pCntnt->*fnRect->fnGetPrtBottom)() ); - if ( !pImp->GetShell()->AddPaintRect( aRect ) ) - pCntnt->ResetRetouche(); - } - pCntnt->ResetCompletePaint(); - } - else if( aPaintRect.HasArea() ) - { - if( bVert ) - aPaintRect.Pos().X() += nOfst; - else - aPaintRect.Pos().Y() -= nOfst; - PaintCntnt( pCntnt, pPage, aPaintRect, nOldBottom ); - } -} - -/************************************************************************* -|* |* SwLayAction::SwLayAction() |* |* Ersterstellung MA 30. Oct. 92 @@ -538,8 +395,6 @@ SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewImp *pI ) : bUpdateExpFlds = bBrowseActionStop = bActionInProgress = FALSE; // OD 14.04.2003 #106346# - init new flag <mbFormatCntntOnInterrupt>. mbFormatCntntOnInterrupt = sal_False; - // --> OD 2004-06-14 #i28701# - mbScrollingAllowed = true; pImp->pLayAct = this; //Anmelden } @@ -654,8 +509,6 @@ void SwLayAction::Action() pRoot->ResetTurboFlag(); pRoot->ResetTurbo(); - if ( IsInput() ) - pImp->GetShell()->SetNoNextScroll(); SetCheckPages( TRUE ); bActionInProgress = FALSE; @@ -735,34 +588,6 @@ class NotifyLayoutOfPageInProgress }; // <-- -// --> OD 2004-06-14 #i28701# - local method to determine, if scrolling during -// the format of the given page is allowed. -// Scrolling isn't allowed, if the wrapping style of floating screen objects -// is considered on object positioning and to-paragraph/to-character anchored -// floating screen objects are registered at the page. -bool lcl_ScrollingAllowed( const SwPageFrm& _rPageFrm ) -{ - bool bRetScrollAllowed = true; - - if ( _rPageFrm.GetSortedObjs() && - _rPageFrm.GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) ) - { - const SwSortedObjs* pObjs = _rPageFrm.GetSortedObjs(); - sal_uInt32 i = 0; - for ( ; i < pObjs->Count(); ++i ) - { - SwAnchoredObject* pObj = (*pObjs)[i]; - if ( pObj->ConsiderObjWrapInfluenceOnObjPos() ) - { - bRetScrollAllowed = false; - break; - } - } - } - - return bRetScrollAllowed; -} - void SwLayAction::InternalAction() { ASSERT( pRoot->Lower()->IsPageFrm(), ":-( Keine Seite unterhalb der Root."); @@ -864,8 +689,6 @@ void SwLayAction::InternalAction() // <NotifyLayoutOfPageInProgress> { NotifyLayoutOfPageInProgress aLayoutOfPageInProgress( *pPage ); - // --> OD 2004-07-01 #i28701# - determine, if scrolling is allowed. - mbScrollingAllowed = lcl_ScrollingAllowed( *pPage ); while ( !IsInterrupt() && !IsNextCycle() && ((IS_FLYS && IS_INVAFLY) || pPage->IsInvalid()) ) @@ -1838,219 +1661,6 @@ BOOL SwLayAction::FormatLayoutFly( SwFlyFrm* pFly ) return bChanged || bTabChanged; } -BOOL MA_FASTCALL lcl_AreLowersScrollable( const SwLayoutFrm *pLay ) -{ - const SwFrm *pLow = pLay->Lower(); - while ( pLow ) - { - if ( pLow->IsCompletePaint() || !pLow->IsValid() || pLow->IsCoveredCell() ) - return FALSE; - if ( pLow->IsLayoutFrm() && !::lcl_AreLowersScrollable( (SwLayoutFrm*)pLow )) - return FALSE; - pLow = pLow->GetNext(); - } - return TRUE; -} - -SwLayoutFrm * MA_FASTCALL lcl_IsTabScrollable( SwTabFrm *pTab ) -{ - //returnt die erste unveraenderte Zeile, oder 0 wenn nicht - //gescrollt werden darf. - if ( !pTab->IsCompletePaint() ) - { - SwLayoutFrm *pUnchgdRow = 0; - SwLayoutFrm *pRow = (SwLayoutFrm*)pTab->Lower(); - while ( pRow ) - { - if ( ::lcl_AreLowersScrollable( pRow ) ) - { - if ( !pUnchgdRow ) - pUnchgdRow = pRow; - } - else - { - pUnchgdRow = 0; - } - - pRow = (SwLayoutFrm*)pRow->GetNext(); - } - return pUnchgdRow; - } - return 0; -} - -// OD 2004-05-11 #i28701# -void lcl_ValidateLowerObjs( SwFrm* pFrm, - const SwTwips nOfst, - SwPageFrm *pPage, - bool bResetOnly ); - -// OD 2004-05-11 #i28701# - correction: floating screen objects, which are -// anchored at-fly, have also been to be considered. -void MA_FASTCALL lcl_ValidateLowers( SwLayoutFrm *pLay, const SwTwips nOfst, - SwLayoutFrm *pRow, SwPageFrm *pPage, - BOOL bResetOnly ) -{ - pLay->ResetCompletePaint(); - - // OD 2004-05-11 #i28701# - consider floating screen objects, which are - // anchored at-fly. - if ( pLay->IsFlyFrm() ) - { - ::lcl_ValidateLowerObjs( pLay, nOfst, pPage, bResetOnly ); - } - - SwFrm *pLow = pRow ? pRow : pLay->Lower(); - SwRootFrm *pRootFrm = 0; - - while ( pLow ) - { - if ( !bResetOnly ) - { - SwRect aOldFrm( pLow->Frm() ); - pLow->Frm().Pos().Y() += nOfst; - if( pLow->IsAccessibleFrm() ) - { - if( !pRootFrm ) - pRootFrm = pPage->FindRootFrm(); - if( pRootFrm && pRootFrm->IsAnyShellAccessible() && - pRootFrm->GetCurrShell() ) - { - pRootFrm->GetCurrShell()->Imp()->MoveAccessibleFrm( pLow, aOldFrm ); - } - } - } - if ( pLow->IsLayoutFrm() ) - { - ::lcl_ValidateLowers( (SwLayoutFrm*)pLow, nOfst, 0, pPage, bResetOnly); - } - else - { - pLow->ResetCompletePaint(); - // OD 2004-05-11 #i28701# - use new local helper method - // <lcl_ValidateLowerObjs(..)> - ::lcl_ValidateLowerObjs( pLow, nOfst, pPage, bResetOnly); - } - if ( !bResetOnly ) - pLow->Calc(); //#55435# Stabil halten. - pLow = pLow->GetNext(); - } -} - -// OD 2004-05-11 #i28701# - helper method for <lcl_ValidateLowers(..)> to -// 'ValidateLowers' for floating screen objects -void lcl_ValidateLowerObjs( SwFrm* pFrm, - const SwTwips nOfst, - SwPageFrm *pPage, - bool bResetOnly ) -{ - if ( pFrm->GetDrawObjs() ) - { - // --> OD 2004-10-15 #i26945# - consider layout direction - SWRECTFN( pFrm ) - // <-- - for ( USHORT i = 0; i < pFrm->GetDrawObjs()->Count(); ++i ) - { - SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i]; - // --> OD 2004-10-08 #i26945# - check, if the anchor frame, which - // contains the anchor position, is the given frame - if ( pAnchoredObj->GetAnchorFrmContainingAnchPos() != pFrm ) - { - continue; - } - if ( pAnchoredObj->ISA(SwFlyFrm) ) - { - SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj); - if ( !bResetOnly ) - { - // --> OD 2004-10-15 #i26945# - // - consider layout direction - // - consider condition for direct move - const bool bNoDirectMove = - WEIT_WECH == pFly->Frm().Top() || - pFly->ConsiderObjWrapInfluenceOnObjPos(); - if ( !bNoDirectMove ) - { - (pFly->Frm().*fnRect->fnSubTop)( -nOfst ); - (pFly->Frm().*fnRect->fnAddBottom)( nOfst ); - } - // <-- - pFly->GetVirtDrawObj()->SetRectsDirty(); - // --> OD 2004-08-17 - also notify view of <SdrObject> - // instance, which represents the Writer fly frame in the - // drawing layer - pFly->GetVirtDrawObj()->SetChanged(); - // <-- - if ( pFly->IsFlyInCntFrm() ) - ((SwFlyInCntFrm*)pFly)->AddRefOfst( nOfst ); - // --> OD 2004-10-15 #i26945# - consider at-character - // anchored Writer fly frames - else if( pFly->IsAutoPos() ) - { - pFly->AddLastCharY( nOfst ); - // OD 2004-05-18 #i28701# - follow-up of #i22341# - // <mnLastTopOfLine> has also been adjusted. - pFly->AddLastTopOfLineY( nOfst ); - } - // <-- - } - ::lcl_ValidateLowers( pFly, nOfst, 0, pPage, bResetOnly); - } - // --> OD 2004-10-15 #i26945# - consider drawing objects - else - { - if ( !bResetOnly ) - { - pAnchoredObj->AddLastCharY( nOfst ); - pAnchoredObj->AddLastTopOfLineY( nOfst ); - } - } - // <-- - pAnchoredObj->InvalidateObjPos(); - } - } -} - -void MA_FASTCALL lcl_AddScrollRectTab( SwTabFrm *pTab, SwLayoutFrm *pRow, - const SwRect &rRect, - const SwTwips nOfst) -{ - // --> OD 2007-11-27 #notes2# - // if sidebar for notes is present, no scrolling is allowed - const SwPageFrm* pPage = pTab->FindPageFrm(); - ASSERT( pPage, "<lcl_AddScrollRectTab(..)> - no page frame found at table frame -> crash" ); - ViewShell* pSh = pPage->GetShell(); - if ( pSh ) - { - const SwPostItMgr* pPostItMgr = pSh->GetPostItMgr(); - if ( pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ) - { - return; - } - } - // <-- - //Wenn altes oder neues Rechteck mit einem Fly ueberlappen, in dem der - //Frm nicht selbst steht, so ist nichts mit Scrollen. - SwRect aRect( rRect ); - // OD 04.11.2002 #104100# - <SWRECTFN( pTab )> not needed. - if( pTab->IsVertical() ) - aRect.Pos().X() -= nOfst; - else - aRect.Pos().Y() += nOfst; - if ( pPage->GetSortedObjs() ) - { - if ( ::lcl_IsOverObj( pTab, pPage, rRect, aRect, pTab ) ) - return; - } - if ( pPage->GetFmt()->GetBackground().GetGraphicPos() != GPOS_NONE ) - return; - - if ( pSh ) - pSh->AddScrollRect( pTab, aRect, nOfst ); - ::lcl_ValidateLowers( pTab, nOfst, pRow, pTab->FindPageFrm(), - pTab->IsLowersFormatted() ); -} - // OD 31.10.2002 #104100# // NOTE: no adjustments for vertical layout support necessary BOOL CheckPos( SwFrm *pFrm ) @@ -2093,76 +1703,27 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect ) if ( !pTab->IsValid() || pTab->IsCompletePaint() || pTab->IsComplete() ) { if ( pTab->GetPrev() && !pTab->GetPrev()->IsValid() ) - pTab->GetPrev()->SetCompletePaint(); - - //Potenzielles Scrollrect ist die ganze Tabelle. Da bereits ein - //Wachstum innerhalb der Tabelle - und damit der Tabelle selbst - - //stattgefunden haben kann, muss die untere Kante durch die - //Unterkante der letzten Zeile bestimmt werden. - SwLayoutFrm* pRow = 0L; - SwRect aScrollRect( pTab->PaintArea() ); - // --> OD 2004-07-01 #i28701# - check, if scrolling is allowed. - if ( mbScrollingAllowed && - ( IsPaint() || bAddRect ) ) { - pRow = static_cast<SwLayoutFrm*>(pTab->GetLastLower()); - // OD 31.10.2002 #104100# - vertical layout support - (aScrollRect.*fnRect->fnSetBottom)( (pRow->Frm().*fnRect->fnGetBottom)() ); - //Die Oberkante wird ggf. durch die erste unveraenderte Zeile bestimmt. - pRow = ::lcl_IsTabScrollable( pTab ); - if ( pRow && pRow != pTab->Lower() ) - // OD 31.10.2002 #104100# - vertical layout support - (aScrollRect.*fnRect->fnSetTop)( (pRow->Frm().*fnRect->fnGetTop)() ); + pTab->GetPrev()->SetCompletePaint(); } - const SwFrm *pOldUp = pTab->GetUpper(); - - SwRect aOldRect( pTab->Frm() ); + const SwRect aOldRect( pTab->Frm() ); pTab->SetLowersFormatted( FALSE ); pTab->Calc(); if ( aOldRect != pTab->Frm() ) + { bChanged = TRUE; - SwRect aPaintFrm = pTab->PaintArea(); + } + const SwRect aPaintFrm = pTab->PaintArea(); if ( IsPaint() && bAddRect ) { - // --> OD 2004-07-01 #i28701# - check, if scrolling is allowed - if ( mbScrollingAllowed && - pRow && pOldUp == pTab->GetUpper() && - pTab->Frm().SSize() == aOldRect.SSize() && - // OD 31.10.2002 #104100# - vertical layout support - (pTab->Frm().*fnRect->fnGetLeft)() == (aOldRect.*fnRect->fnGetLeft)() && - pTab->IsAnLower( pRow ) ) - { - SwTwips nOfst; - if ( pRow->GetPrev() ) - { - if ( pRow->GetPrev()->IsValid() || - ::CheckPos( pRow->GetPrev() ) ) - { - // OD 31.10.2002 #104100# - vertical layout support - nOfst = -(pRow->Frm().*fnRect->fnTopDist)( (pRow->GetPrev()->Frm().*fnRect->fnGetBottom)() ); - } - else - nOfst = 0; - } - else - // OD 31.10.2002 #104100# - vertical layout support - nOfst = (pTab->Frm().*fnRect->fnTopDist)( (aOldRect.*fnRect->fnGetTop)() ); - - if ( nOfst ) - { - ::lcl_AddScrollRectTab( pTab, pRow, aScrollRect, nOfst ); - bPainted = TRUE; - } - } - // OD 01.11.2002 #104100# - add condition <pTab->Frm().HasArea()> - if ( !pTab->IsCompletePaint() && pTab->IsComplete() && + if ( !pTab->IsCompletePaint() && + pTab->IsComplete() && ( pTab->Frm().SSize() != pTab->Prt().SSize() || // OD 31.10.2002 #104100# - vertical layout support - (pTab->*fnRect->fnGetLeftMargin)() - ) && + (pTab->*fnRect->fnGetLeftMargin)() ) && pTab->Frm().HasArea() ) { @@ -2478,13 +2039,6 @@ void SwLayAction::_FormatCntnt( const SwCntntFrm *pCntnt, SWRECTFN( pCntnt ) if ( !bDrawObjsOnly && IsPaint() ) { - const BOOL bPosOnly = !pCntnt->GetValidPosFlag() && - !pCntnt->IsCompletePaint() && - pCntnt->GetValidSizeFlag() && - pCntnt->GetValidPrtAreaFlag() && - ( !pCntnt->IsTxtFrm() || - !((SwTxtFrm*)pCntnt)->HasAnimation() ); - const SwFrm *pOldUp = pCntnt->GetUpper(); const SwRect aOldRect( pCntnt->UnionFrm() ); const long nOldBottom = (pCntnt->*fnRect->fnGetPrtBottom)(); pCntnt->OptCalc(); @@ -2492,23 +2046,10 @@ void SwLayAction::_FormatCntnt( const SwCntntFrm *pCntnt, return; if( (*fnRect->fnYDiff)( (pCntnt->Frm().*fnRect->fnGetBottom)(), (aOldRect.*fnRect->fnGetBottom)() ) < 0 ) - pCntnt->SetRetouche(); - const SwRect aNewRect( pCntnt->UnionFrm() ); - if ( bPosOnly && - (aNewRect.*fnRect->fnGetTop)() != (aOldRect.*fnRect->fnGetTop)() && - !pCntnt->IsInTab() && !pCntnt->IsInSct() && - ( !pCntnt->GetPrev() || !pCntnt->GetPrev()->IsTabFrm() ) && - pOldUp == pCntnt->GetUpper() && - (aNewRect.*fnRect->fnGetLeft)() == (aOldRect.*fnRect->fnGetLeft)() && - aNewRect.SSize() == aOldRect.SSize() - ) { - _AddScrollRect( pCntnt, pPage, (*fnRect->fnYDiff)( - (pCntnt->Frm().*fnRect->fnGetTop)(), - (aOldRect.*fnRect->fnGetTop)() ), nOldBottom ); + pCntnt->SetRetouche(); } - else - PaintCntnt( pCntnt, pCntnt->FindPageFrm(), aOldRect, nOldBottom); + PaintCntnt( pCntnt, pCntnt->FindPageFrm(), aOldRect, nOldBottom); } else { @@ -2907,7 +2448,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) : { --pSh->nStartAction; - if ( pSh->Imp()->GetRegion() || pSh->Imp()->GetScrollRects() ) + if ( pSh->Imp()->GetRegion() ) bActions = TRUE; else { @@ -2953,9 +2494,9 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) : //fix(18176): SwViewImp *pViewImp = pSh->Imp(); BOOL bUnlock = FALSE; - if ( pViewImp->GetRegion() || pViewImp->GetScrollRects() ) + if ( pViewImp->GetRegion() ) { - pViewImp->DelRegions(); + pViewImp->DelRegion(); //Fuer Repaint mit virtuellem Device sorgen. pSh->LockPaint(); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index d4ce26c6ae..c231312dc9 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1645,7 +1645,7 @@ void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut, /// Because for drawing a graphic left-top-corner and size coordinations are /// used, these coordinations have to be determined on pixel level. ::SwAlignGrfRect( &aAlignedGrfRect, *pOut ); - pGrf->Draw( pOut, aAlignedGrfRect.Pos(), aAlignedGrfRect.SSize() ); + pGrf->DrawWithPDFHandling( *pOut, aAlignedGrfRect.Pos(), aAlignedGrfRect.SSize() ); if ( bNotInside ) pOut->Pop(); @@ -2804,7 +2804,7 @@ void SwRootFrm::Paint( const SwRect& rRect, const SwPrtOptions *pPrintData ) con aAction.Action(); ((SwRootFrm*)this)->ResetTurboFlag(); if ( !pSh->ActionPend() ) - pSh->Imp()->DelRegions(); + pSh->Imp()->DelRegion(); } SwRect aRect( rRect ); diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 2e9ed33e49..e1ec505964 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2790,9 +2790,6 @@ void SwTabFrm::MakeAll() } else if ( GetFollow() == GetNext() ) ((SwTabFrm*)GetFollow())->MoveFwd( TRUE, FALSE ); - ViewShell *pSh; - if ( 0 != (pSh = GetShell()) ) - pSh->Imp()->ResetScroll(); } continue; } diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 36ebd8ee72..e8fc5b382b 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -59,7 +59,6 @@ #include <redlnitr.hxx> // SwRedlineItr #include <swmodule.hxx> // SW_MOD #include <tabfrm.hxx> // SwTabFrm (Redlining) -#include <scrrect.hxx> #include <SwGrammarMarkUp.hxx> // --> FME 2004-06-08 #i12836# enhanced pdf export @@ -748,70 +747,3 @@ void SwTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ ) } } -void SwTxtFrm::CriticalLines( const OutputDevice& rOut, SwStripes &rStripes, - long nOffs) -{ - ASSERT( ! IsVertical() || ! IsSwapped(), - "SwTxtFrm::CriticalLines with swapped frame" ); - SWRECTFN( this ) - long nFrmHeight; - - GetFormatted(); - if( HasPara() ) - { - const long nTopMargin = (this->*fnRect->fnGetTopMargin)(); - SwStripe aStripe( (Frm().*fnRect->fnGetTop)(), nTopMargin ); - if ( nTopMargin ) - { - rStripes.Insert( aStripe, rStripes.Count() ); - // OD 06.11.2002 #104171#,#103931# - consider vertical layout - if ( bVert ) - aStripe.Y() -= nTopMargin; - else - // OD 06.11.2002 #104171#,#103931# - *add* top margin to Y. - aStripe.Y() += nTopMargin; - } - SwLineLayout* pLay = GetPara(); - do - { - SwTwips nBase = aStripe.GetY() + - ( bVert ? -pLay->GetAscent() : pLay->GetAscent() ); - - long nLogToPixBase, nLogToPixSum, nLogToPixOffs; - - if ( bVert ) - { - nLogToPixBase = rOut.LogicToPixel( Point( nBase, 0 ) ).X(); - nLogToPixSum = rOut.LogicToPixel( Point( nBase + nOffs, 0 ) ).X(); - nLogToPixOffs = -rOut.LogicToPixel( Size( nOffs, 0 ) ).Width(); - } - else - { - nLogToPixBase = rOut.LogicToPixel( Point( 0, nBase ) ).Y(); - nLogToPixSum = rOut.LogicToPixel( Point( 0, nBase - nOffs ) ).Y(); - nLogToPixOffs = rOut.LogicToPixel( Size( 0, nOffs ) ).Height(); - } - - if( nLogToPixBase != nLogToPixSum + nLogToPixOffs ) - { - aStripe.Height() = pLay->GetRealHeight(); - rStripes.Insert( aStripe, rStripes.Count() ); - } - aStripe.Y() += ( bVert ? -pLay->GetRealHeight() : - pLay->GetRealHeight() ); - pLay = pLay->GetNext(); - } while( pLay ); - - const long nBottomMargin = (this->*fnRect->fnGetBottomMargin)(); - if( nBottomMargin ) - { - - aStripe.Height() = nBottomMargin; - rStripes.Insert( aStripe, rStripes.Count() ); - } - } - else if( 0 != (nFrmHeight = (Frm().*fnRect->fnGetHeight)() )) - rStripes.Insert( SwStripe( (Frm().*fnRect->fnGetTop)(), nFrmHeight ), - rStripes.Count() ); -} - diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index f002e123b8..235746a735 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -276,6 +276,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew ) bURLNotify( rNew.URLNotify() ), bStopUnderFlow( rNew.StopUnderFlow() ), bFtnInside( rNew.IsFtnInside() ), + bOtherThanFtnInside( rNew.IsOtherThanFtnInside() ), bMulti( rNew.IsMulti() ), bFirstMulti( rNew.IsFirstMulti() ), bRuby( rNew.IsRuby() ), @@ -373,7 +374,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt, nIdx = nNewIdx; nLen = nNewLen; bNotEOL = sal_False; - bStopUnderFlow = bFtnInside = sal_False; + bStopUnderFlow = bFtnInside = bOtherThanFtnInside = sal_False; bMulti = bFirstMulti = bRuby = bHanging = bScriptSpace = bForbiddenChars = sal_False; @@ -400,6 +401,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew, const XubString &rTxt, bURLNotify( rNew.URLNotify() ), bStopUnderFlow( rNew.StopUnderFlow() ), bFtnInside( rNew.IsFtnInside() ), + bOtherThanFtnInside( rNew.IsOtherThanFtnInside() ), bMulti( rNew.IsMulti() ), bFirstMulti( rNew.IsFirstMulti() ), bRuby( rNew.IsRuby() ), @@ -1142,27 +1144,30 @@ void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) { SwRect aIntersect; CalcRect( rPor, &aIntersect, 0 ); - if ( aIntersect.HasArea() ) { - if (OnWin()) { - OutputDevice* pOutDev = (OutputDevice*)GetOut(); - pOutDev->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); - pOutDev->SetLineColor( Color(220, 233, 245)); - pOutDev->SetFillColor( Color(220, 233, 245)); - pOutDev->DrawRect( aIntersect.SVRect() ); - pOutDev->Pop(); - } - 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->SetLineColor( Color(0, 0, 0)); - pOut->SetFillColor(); - pOut->DrawRect( r ); - if (checked) { - pOut->DrawLine(r.TopLeft(), r.BottomRight()); - pOut->DrawLine(r.TopRight(), r.BottomLeft()); + if ( aIntersect.HasArea() ) + { + if (OnWin() && SwViewOption::IsFieldShadings() && + !GetOpt().IsPagePreview()) + { + OutputDevice* pOut_ = (OutputDevice*)GetOut(); + pOut_->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); + pOut_->SetFillColor( SwViewOption::GetFieldShadingsColor() ); + pOut_->SetLineColor(); + pOut_->DrawRect( aIntersect.SVRect() ); + pOut_->Pop(); + } + 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->SetLineColor( Color(0, 0, 0)); + pOut->SetFillColor(); + pOut->DrawRect( r ); + if (checked) { + pOut->DrawLine(r.TopLeft(), r.BottomRight()); + pOut->DrawLine(r.TopRight(), r.BottomLeft()); + } pOut->Pop(); } - } } /************************************************************************* @@ -1216,14 +1221,22 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const } } bool bIsStartMark=(1==GetLen() && CH_TXT_ATR_FIELDSTART==GetTxt().GetChar(GetIdx())); - if(pFieldmark) OSL_TRACE("Found Fieldmark"); + if(pFieldmark) { + OSL_TRACE("Found Fieldmark"); +#if DEBUG + rtl::OUString str = pFieldmark->ToString( ); + fprintf( stderr, "%s\n", rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr( ) ); +#endif + } if(bIsStartMark) OSL_TRACE("Found StartMark"); - if (OnWin() && (pFieldmark!=NULL || bIsStartMark)) + if (OnWin() && (pFieldmark!=NULL || bIsStartMark) && + SwViewOption::IsFieldShadings() && + !GetOpt().IsPagePreview()) { OutputDevice* pOutDev = (OutputDevice*)GetOut(); pOutDev->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); - pOutDev->SetLineColor( Color(220, 233, 245)); - pOutDev->SetFillColor( Color(220, 233, 245)); + pOutDev->SetFillColor( SwViewOption::GetFieldShadingsColor() ); + pOutDev->SetLineColor( ); pOutDev->DrawRect( aIntersect.SVRect() ); pOutDev->Pop(); } diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 28218a737a..7d6fcc8f64 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -208,6 +208,8 @@ protected: sal_Bool bURLNotify : 1; sal_Bool bStopUnderFlow : 1;// Underflow gestoppt z.B. von einer FlyPortion sal_Bool bFtnInside : 1; // the current line contains a footnote + sal_Bool bOtherThanFtnInside : 1; // the current line contains another portion than a footnote portion. + // needed for checking keep together of footnote portion with previous portion sal_Bool bMulti : 1; // inside a multiportion sal_Bool bFirstMulti : 1; // this flag is used for two purposes: // - the multiportion is the first lineportion @@ -251,6 +253,8 @@ public: inline void SetStopUnderFlow( const sal_Bool bNew ) { bStopUnderFlow = bNew; } inline sal_Bool IsFtnInside() const { return bFtnInside; } inline void SetFtnInside( const sal_Bool bNew ) { bFtnInside = bNew; } + inline sal_Bool IsOtherThanFtnInside() const { return bOtherThanFtnInside; } + inline void SetOtherThanFtnInside( const sal_Bool bNew ) { bOtherThanFtnInside = bNew; } inline sal_Bool IsMulti() const { return bMulti; } inline void SetMulti( const sal_Bool bNew ) { bMulti = bNew; } inline sal_Bool IsFirstMulti() const { return bFirstMulti; } diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 833ace0a56..eb39c9edf2 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -349,6 +349,8 @@ void SwTxtFormatter::InsertPortion( SwTxtFormatInfo &rInf, } pLast->Insert( pPor ); + rInf.SetOtherThanFtnInside( rInf.IsOtherThanFtnInside() || !pPor->IsFtnPortion() ); + // Maxima anpassen: if( pCurr->Height() < pPor->Height() ) pCurr->Height( pPor->Height() ); @@ -1533,6 +1535,7 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos ) while( bBuild ) { GetInfo().SetFtnInside( sal_False ); + GetInfo().SetOtherThanFtnInside( sal_False ); // These values must not be reset by FormatReset(); sal_Bool bOldNumDone = GetInfo().IsNumDone(); diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 7a0e8ec6d1..b66a6e30a5 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -34,16 +34,16 @@ #ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include <com/sun/star/i18n/ScriptType.hdl> #endif -#include <hintids.hxx> // CH_TXTATR -#include <errhdl.hxx> // ASSERT +#include <hintids.hxx> // CH_TXTATR +#include <errhdl.hxx> // ASSERT #include <SwPortionHandler.hxx> #include <txtcfg.hxx> #include <porlay.hxx> #include <inftxt.hxx> -#include <guess.hxx> // SwTxtGuess, Zeilenumbruch +#include <guess.hxx> // SwTxtGuess, Zeilenumbruch #include <porglue.hxx> #include <portab.hxx> // pLastTab-> -#include <porfld.hxx> // SwFldPortion +#include <porfld.hxx> // SwFldPortion #include <wrong.hxx> #include <viewsh.hxx> #include <IDocumentSettingAccess.hxx> @@ -52,11 +52,13 @@ #include <IMark.hxx> #include <pam.hxx> #include <doc.hxx> +#include <xmloff/odffields.hxx> #if OSL_DEBUG_LEVEL > 1 const sal_Char *GetLangName( const MSHORT nLang ); #endif +using namespace ::sw::mark; using namespace ::com::sun::star; using namespace ::com::sun::star::i18n::ScriptType; @@ -227,7 +229,7 @@ USHORT lcl_AddSpace( const SwTxtSizeInfo &rInf, const XubString* pStr, } /************************************************************************* - * class SwTxtPortion + * class SwTxtPortion *************************************************************************/ SwTxtPortion::SwTxtPortion( const SwLinePortion &rPortion ) @@ -237,7 +239,7 @@ SwTxtPortion::SwTxtPortion( const SwLinePortion &rPortion ) } /************************************************************************* - * SwTxtPortion::BreakCut() + * SwTxtPortion::BreakCut() *************************************************************************/ void SwTxtPortion::BreakCut( SwTxtFormatInfo &rInf, const SwTxtGuess &rGuess ) @@ -286,7 +288,7 @@ void SwTxtPortion::BreakCut( SwTxtFormatInfo &rInf, const SwTxtGuess &rGuess ) } /************************************************************************* - * SwTxtPortion::BreakUnderflow() + * SwTxtPortion::BreakUnderflow() *************************************************************************/ void SwTxtPortion::BreakUnderflow( SwTxtFormatInfo &rInf ) @@ -300,7 +302,7 @@ void SwTxtPortion::BreakUnderflow( SwTxtFormatInfo &rInf ) } /************************************************************************* - * SwTxtPortion::_Format() + * SwTxtPortion::_Format() *************************************************************************/ sal_Bool lcl_HasContent( const SwFldPortion& rFld, SwTxtFormatInfo &rInf ) @@ -349,7 +351,7 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf ) // C2 break iterator does not found a possible line break at all: // ==> line break - // case A: line not yet full + // case A: line not yet full if ( !bFull ) { Width( aGuess.BreakWidth() ); @@ -392,12 +394,16 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf ) } // case C1 // - Footnote portions with fake line start (i.e., not at beginning of line) - // should keep together with the text portion. + // should keep together with the text portion. (Note: no keep together + // with only footnote portions. // - TabPortions not at beginning of line should keep together with the // text portion, if they are not followed by a blank // (work around different definition of tab stop character - breaking or // non breaking character - in compatibility mode) - else if ( ( IsFtnPortion() && rInf.IsFakeLineStart() ) || + else if ( ( IsFtnPortion() && rInf.IsFakeLineStart() && + // --> OD 2010-01-29 #b6921213# + rInf.IsOtherThanFtnInside() ) || + // <-- ( rInf.GetLast() && rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) && rInf.GetLast()->InTabGrp() && @@ -440,7 +446,7 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf ) Insert( pNew ); } } - else // case C2, last exit + else // case C2, last exit BreakCut( rInf, aGuess ); } // breakPos < index or no breakpos at all @@ -451,9 +457,9 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf ) aGuess.BreakPos() != rInf.GetLineStart() && ( !bFirstPor || rInf.GetFly() || rInf.GetLast()->IsFlyPortion() || rInf.IsFirstMulti() ) && - ( !rInf.GetLast()->IsBlankPortion() || ((SwBlankPortion*) + ( !rInf.GetLast()->IsBlankPortion() || ((SwBlankPortion*) rInf.GetLast())->MayUnderFlow( rInf, rInf.GetIdx()-1, sal_True ))) - { // case C1 (former BreakUnderflow()) + { // case C1 (former BreakUnderflow()) BreakUnderflow( rInf ); } else @@ -465,7 +471,7 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf ) } /************************************************************************* - * virtual SwTxtPortion::Format() + * virtual SwTxtPortion::Format() *************************************************************************/ @@ -494,7 +500,7 @@ sal_Bool SwTxtPortion::Format( SwTxtFormatInfo &rInf ) } /************************************************************************* - * virtual SwTxtPortion::FormatEOL() + * virtual SwTxtPortion::FormatEOL() *************************************************************************/ // Format end of line @@ -539,7 +545,7 @@ void SwTxtPortion::FormatEOL( SwTxtFormatInfo &rInf ) } /************************************************************************* - * virtual SwTxtPortion::GetCrsrOfst() + * virtual SwTxtPortion::GetCrsrOfst() *************************************************************************/ @@ -551,7 +557,7 @@ xub_StrLen SwTxtPortion::GetCrsrOfst( const KSHORT nOfst ) const } /************************************************************************* - * virtual SwTxtPortion::GetTxtSize() + * virtual SwTxtPortion::GetTxtSize() *************************************************************************/ // Das GetTxtSize() geht davon aus, dass die eigene Laenge korrekt ist @@ -561,7 +567,7 @@ SwPosSize SwTxtPortion::GetTxtSize( const SwTxtSizeInfo &rInf ) const } /************************************************************************* - * virtual SwTxtPortion::Paint() + * virtual SwTxtPortion::Paint() *************************************************************************/ @@ -605,7 +611,7 @@ void SwTxtPortion::Paint( const SwTxtPaintInfo &rInf ) const } /************************************************************************* - * virtual SwTxtPortion::GetExpTxt() + * virtual SwTxtPortion::GetExpTxt() *************************************************************************/ @@ -616,7 +622,7 @@ sal_Bool SwTxtPortion::GetExpTxt( const SwTxtSizeInfo &, XubString & ) const } /************************************************************************* - * xub_StrLen SwTxtPortion::GetSpaceCnt() + * xub_StrLen SwTxtPortion::GetSpaceCnt() * long SwTxtPortion::CalcSpacing() * sind fuer den Blocksatz zustaendig und ermitteln die Anzahl der Blanks * und den daraus resultierenden zusaetzlichen Zwischenraum @@ -655,7 +661,7 @@ xub_StrLen SwTxtPortion::GetSpaceCnt( const SwTxtSizeInfo &rInf, long SwTxtPortion::CalcSpacing( long nSpaceAdd, const SwTxtSizeInfo &rInf ) const { - xub_StrLen nCnt = 0; + xub_StrLen nCnt = 0; if ( InExpGrp() ) { @@ -713,7 +719,7 @@ void SwTxtPortion::HandlePortion( SwPortionHandler& rPH ) const } /************************************************************************* - * class SwHolePortion + * class SwHolePortion *************************************************************************/ @@ -730,7 +736,7 @@ SwHolePortion::SwHolePortion( const SwTxtPortion &rPor ) SwLinePortion *SwHolePortion::Compress() { return this; } /************************************************************************* - * virtual SwHolePortion::Paint() + * virtual SwHolePortion::Paint() *************************************************************************/ @@ -747,7 +753,7 @@ void SwHolePortion::Paint( const SwTxtPaintInfo &rInf ) const } /************************************************************************* - * virtual SwHolePortion::Format() + * virtual SwHolePortion::Format() *************************************************************************/ @@ -766,9 +772,10 @@ void SwHolePortion::HandlePortion( SwPortionHandler& rPH ) const rPH.Text( GetLen(), GetWhichPor() ); } -void SwFieldMarkPortion::Paint( const SwTxtPaintInfo & rInf) const +void SwFieldMarkPortion::Paint( const SwTxtPaintInfo & /*rInf*/) const { - SwTxtPortion::Paint(rInf); + // These shouldn't be painted! + // SwTxtPortion::Paint(rInf); } sal_Bool SwFieldMarkPortion::Format( SwTxtFormatInfo & ) @@ -778,38 +785,96 @@ sal_Bool SwFieldMarkPortion::Format( SwTxtFormatInfo & ) return ret; } +namespace { + static sal_Int32 getCurrentListIndex( IFieldmark* pBM, + ::rtl::OUString* io_pCurrentText = NULL ) + { + const IFieldmark::parameter_map_t* const pParameters = pBM->GetParameters(); + sal_Int32 nCurrentIdx = 0; + const IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT)); + if(pResult != pParameters->end()) + pResult->second >>= nCurrentIdx; + if(io_pCurrentText) + { + const IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)); + if(pListEntries != pParameters->end()) + { + uno::Sequence< ::rtl::OUString > vListEntries; + pListEntries->second >>= vListEntries; + if(nCurrentIdx < vListEntries.getLength()) + *io_pCurrentText = vListEntries[nCurrentIdx]; + } + } + return nCurrentIdx; + } +} //FIXME Fieldbk -//void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const -void SwFieldFormPortion::Paint( const SwTxtPaintInfo& ) const +void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const { -// SwTxtNode *pNd=const_cast<SwTxtNode*>(rInf.GetTxtFrm()->GetTxtNode()); -// const SwDoc *doc=pNd->GetDoc(); -// SwIndex aIndex( pNd, rInf.GetIdx() ); -// SwPosition aPosition(*pNd, aIndex); -// pMark = dynamic_cast< doc->getFieldmarkFor(aPosition); -// OSL_ENSURE(pMark, -// "SwFieldFormPortion::Paint(..)" -// " - Where is my form field bookmark???"); - -// bool checked=(pBM!=NULL?pBM->IsChecked():false); -// rInf.DrawCheckBox(*this , checked); -} + SwTxtNode* pNd = const_cast<SwTxtNode*>(rInf.GetTxtFrm()->GetTxtNode()); + const SwDoc *doc=pNd->GetDoc(); + SwIndex aIndex( pNd, rInf.GetIdx() ); + SwPosition aPosition(*pNd, aIndex); -sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo &rInf ) -{ - sal_Bool ret=0; -// ret=SwTxtPortion::Format(rInf); + IFieldmark* pBM = doc->getIDocumentMarkAccess( )->getFieldmarkFor( aPosition ); + + OSL_ENSURE( pBM, + "SwFieldFormPortion::Paint(..)" + " - Where is my form field bookmark???"); - Width(rInf.GetTxtHeight()); - Height(rInf.GetTxtHeight()); - SetAscent(rInf.GetAscent()); - //int h=rInf.GetTxtHeight(); + if ( pBM != NULL ) + { + if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) ) + { // a checkbox... + ICheckboxFieldmark* pCheckboxFm = dynamic_cast< ICheckboxFieldmark* >(pBM); + bool checked = pCheckboxFm->IsChecked(); + rInf.DrawCheckBox(*this, checked); + } + else if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) ) + { // a list... + rtl::OUString aTxt; + rInf.DrawViewOpt( *this, POR_FLD ); + rInf.DrawText( aTxt, *this, 0, 0/*aTxt.getLength()*/, false ); + } + else + { + assert(0); // unknown type... + } + } +} -/* - Height(100); - SetAscent(100); -*/ +sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo & rInf ) +{ + sal_Bool ret = 0; + SwTxtNode *pNd = const_cast < SwTxtNode * >( rInf.GetTxtFrm( )->GetTxtNode( ) ); + const SwDoc *doc = pNd->GetDoc( ); + SwIndex aIndex( pNd, rInf.GetIdx( ) ); + SwPosition aPosition( *pNd, aIndex ); + IFieldmark *pBM = doc->getIDocumentMarkAccess( )->getFieldmarkFor( aPosition ); + ASSERT( pBM != NULL, "Where is my form field bookmark???" ); + if ( pBM != NULL ) + { + if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) ) + { + Width( rInf.GetTxtHeight( ) ); + Height( rInf.GetTxtHeight( ) ); + SetAscent( rInf.GetAscent( ) ); + } + else if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) ) + { + ::rtl::OUString aTxt; + getCurrentListIndex( pBM, &aTxt ); + SwPosSize aPosSize = rInf.GetTxtSize( aTxt ); + Width( aPosSize.Width( ) ); + Height( aPosSize.Height( ) ); + SetAscent( rInf.GetAscent( ) ); + } + else + { + assert( 0 ); // unknown type... + } + } return ret; } diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 9d4b913cfb..0b7029065f 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -628,23 +628,34 @@ void SwTxtFrm::HideAndShowObjects() *************************************************************************/ xub_StrLen SwTxtFrm::FindBrk( const XubString &rTxt, - const xub_StrLen nStart, const xub_StrLen nEnd ) const + const xub_StrLen nStart, + const xub_StrLen nEnd ) const { - xub_StrLen nFound = nStart; + // --> OD 2009-12-28 #i104291# - applying patch to avoid overflow. + unsigned long nFound = nStart; const xub_StrLen nEndLine = Min( nEnd, rTxt.Len() ); // Wir ueberlesen erst alle Blanks am Anfang der Zeile (vgl. Bug 2235). - while( nFound <= nEndLine && ' ' == rTxt.GetChar( nFound ) ) - ++nFound; + while( nFound <= nEndLine && + ' ' == rTxt.GetChar( static_cast<xub_StrLen>(nFound) ) ) + { + nFound++; + } // Eine knifflige Sache mit den TxtAttr-Dummy-Zeichen (hier "$"): // "Dr.$Meyer" am Anfang der zweiten Zeile. Dahinter ein Blank eingegeben // und das Wort rutscht nicht in die erste Zeile, obwohl es ginge. // Aus diesem Grund nehmen wir das Dummy-Zeichen noch mit. - while( nFound <= nEndLine && ' ' != rTxt.GetChar( nFound ) ) - ++nFound; + while( nFound <= nEndLine && + ' ' != rTxt.GetChar( static_cast<xub_StrLen>(nFound) ) ) + { + nFound++; + } - return nFound; + return nFound <= STRING_LEN + ? static_cast<xub_StrLen>(nFound) + : STRING_LEN; + // <-- } /************************************************************************* diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 78a0f3bb5e..40b04898ba 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -481,6 +481,7 @@ static sal_Char __READONLY_DATA sStandardString[] = "Dies ist der Teststring"; pScrFont = pPrtFont; FontMetric aMet = pPrt->GetFontMetric( ); + bSymbol = RTL_TEXTENCODING_SYMBOL == aMet.GetCharSet(); if ( USHRT_MAX == nGuessedLeading ) @@ -2417,21 +2418,18 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf ) sal_uInt16 nItrMode = i18n::CharacterIteratorMode::SKIPCELL; sal_Int32 nDone = 0; LanguageType aLang = LANGUAGE_NONE; - sal_Bool bSkipCell = sal_False; + bool bSkipCharacterCells = false; xub_StrLen nIdx = rInf.GetIdx(); xub_StrLen nLastIdx = nIdx; const xub_StrLen nEnd = rInf.GetIdx() + rInf.GetLen(); - // skip character cells for complex scripts - // --> OD 2009-10-14 #i105571# - skip also character cells for CJK - if ( rInf.GetFont() && - ( SW_CTL == rInf.GetFont()->GetActual() || - SW_CJK == rInf.GetFont()->GetActual() ) && - pBreakIt->GetBreakIter().is() ) + // --> OD 2009-12-29 #i105901# + // skip character cells for all script types + if ( pBreakIt->GetBreakIter().is() ) // <-- { aLang = rInf.GetFont()->GetLanguage(); - bSkipCell = sal_True; + bSkipCharacterCells = true; } while ( ( nRight < long( rInf.GetOfst() ) ) && ( nIdx < nEnd ) ) @@ -2442,7 +2440,7 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf ) // go to next character (cell). nLastIdx = nIdx; - if ( bSkipCell ) + if ( bSkipCharacterCells ) { nIdx = (xub_StrLen)pBreakIt->GetBreakIter()->nextCharacters( rInf.GetText(), nIdx, pBreakIt->GetLocale( aLang ), nItrMode, 1, nDone ); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index fce8cd4f33..9ab267b32b 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2935,6 +2935,51 @@ BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const return bRet; } +// --> OD 2010-01-05 #b6884103# +SwTwips SwTxtNode::GetAdditionalIndentForStartingNewList() const +{ + SwTwips nAdditionalIndent = 0; + + const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L; + if ( pRule ) + { + const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetActualListLevel())); + if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) + { + nAdditionalIndent = GetSwAttrSet().GetLRSpace().GetLeft(); + + if (getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING)) + { + nAdditionalIndent = nAdditionalIndent - + GetSwAttrSet().GetLRSpace().GetTxtFirstLineOfst(); + } + } + else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) + { + if ( AreListLevelIndentsApplicable() ) + { + nAdditionalIndent = rFmt.GetIndentAt() + rFmt.GetFirstLineIndent(); + } + else + { + nAdditionalIndent = GetSwAttrSet().GetLRSpace().GetLeft(); + if (getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING)) + { + nAdditionalIndent = nAdditionalIndent - + GetSwAttrSet().GetLRSpace().GetTxtFirstLineOfst(); + } + } + } + } + else + { + nAdditionalIndent = GetSwAttrSet().GetLRSpace().GetLeft(); + } + + return nAdditionalIndent; +} +// <-- + // --> OD 2008-12-02 #i96772# void SwTxtNode::ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const { diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 3aad931525..19b77914df 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -49,6 +49,7 @@ #include <docsh.hxx> +using namespace ::sw::mark; using namespace ::com::sun::star; using ::rtl::OUString; @@ -520,67 +521,131 @@ SwXFieldmark::SwXFieldmark(bool _isReplacementObject, ::sw::mark::IMark* pBkm, S , isReplacementObject(_isReplacementObject) { } -void SwXFieldmark::attachToRange(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +void SwXFieldmarkParameters::insertByName(const OUString& aName, const uno::Any& aElement) + throw (lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException) { - attachToRangeEx(xTextRange, (isReplacementObject?IDocumentMarkAccess::CHECKBOX_FIELDMARK:IDocumentMarkAccess::TEXT_FIELDMARK)); + vos::OGuard aGuard(Application::GetSolarMutex()); + IFieldmark::parameter_map_t* pParameters = getCoreParameters(); + if(pParameters->find(aName) != pParameters->end()) + throw container::ElementExistException(); + (*pParameters)[aName] = aElement; } -::rtl::OUString SwXFieldmark::getDescription(void) throw( ::com::sun::star::uno::RuntimeException ) +void SwXFieldmarkParameters::removeByName(const OUString& aName) + throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); -// TODO implement... -// if(!GetBookmark()) - ::sw::mark::IFieldmark const * const pMark = - dynamic_cast< ::sw::mark::IFieldmark const * const>(GetBookmark()); - if(!pMark) - throw uno::RuntimeException(); - return pMark->GetFieldHelptext(); + if(!getCoreParameters()->erase(aName)) + throw container::NoSuchElementException(); } -::sal_Int16 SAL_CALL SwXFieldmark::getType() throw (::com::sun::star::uno::RuntimeException) +void SwXFieldmarkParameters::replaceByName(const OUString& aName, const uno::Any& aElement) + throw (lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - ::sw::mark::ICheckboxFieldmark const * const pAsCheckbox = - dynamic_cast< ::sw::mark::ICheckboxFieldmark const * const>(GetBookmark()); - if(pAsCheckbox) - return 1; - return 0; + IFieldmark::parameter_map_t* pParameters = getCoreParameters(); + IFieldmark::parameter_map_t::iterator pEntry = pParameters->find(aName); + if(pEntry == pParameters->end()) + throw container::NoSuchElementException(); + pEntry->second = aElement; } -::sal_Int16 SAL_CALL SwXFieldmark::getRes() throw (::com::sun::star::uno::RuntimeException) +uno::Any SwXFieldmarkParameters::getByName(const OUString& aName) + throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - ::sw::mark::ICheckboxFieldmark const * const pAsCheckbox = - dynamic_cast< ::sw::mark::ICheckboxFieldmark const * const>(GetBookmark()); - if(pAsCheckbox && pAsCheckbox->IsChecked()) - return 1; - return 0; + IFieldmark::parameter_map_t* pParameters = getCoreParameters(); + IFieldmark::parameter_map_t::iterator pEntry = pParameters->find(aName); + if(pEntry == pParameters->end()) + throw container::NoSuchElementException(); + return pEntry->second; +} + +uno::Sequence<OUString> SwXFieldmarkParameters::getElementNames() + throw (uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + IFieldmark::parameter_map_t* pParameters = getCoreParameters(); + uno::Sequence<OUString> vResult(pParameters->size()); + OUString* pOutEntry = vResult.getArray(); + for(IFieldmark::parameter_map_t::iterator pEntry = pParameters->begin(); pEntry!=pParameters->end(); ++pEntry, ++pOutEntry) + *pOutEntry = pEntry->first; + return vResult; +} + +::sal_Bool SwXFieldmarkParameters::hasByName(const OUString& aName) + throw (uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + IFieldmark::parameter_map_t* pParameters = getCoreParameters(); + return (pParameters->find(aName) != pParameters->end()); +} + +uno::Type SwXFieldmarkParameters::getElementType() + throw (uno::RuntimeException) +{ + return ::cppu::UnoType< ::cppu::UnoVoidType>::get(); +} + +::sal_Bool SwXFieldmarkParameters::hasElements() + throw (uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + return !getCoreParameters()->empty(); } -//FIXME Remove Method -void SAL_CALL SwXFieldmark::setType( ::sal_Int16 ) throw (::com::sun::star::uno::RuntimeException) +void SwXFieldmarkParameters::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); +} + + +IFieldmark::parameter_map_t* SwXFieldmarkParameters::getCoreParameters() + throw (uno::RuntimeException) +{ + const IFieldmark* pFieldmark = dynamic_cast< const IFieldmark* >(GetRegisteredIn()); + if(!pFieldmark) + throw uno::RuntimeException(); + return const_cast< IFieldmark* >(pFieldmark)->GetParameters(); +} + + +void SwXFieldmark::attachToRange( const uno::Reference < text::XTextRange >& xTextRange ) + throw(lang::IllegalArgumentException, uno::RuntimeException) +{ + attachToRangeEx( xTextRange, + ( isReplacementObject ? IDocumentMarkAccess::CHECKBOX_FIELDMARK : IDocumentMarkAccess::TEXT_FIELDMARK ) ); +} + +::rtl::OUString SwXFieldmark::getFieldType(void) + throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - throw uno::RuntimeException(); + const IFieldmark *pBkm = dynamic_cast<const IFieldmark*>(GetBookmark()); + if(!pBkm) + throw uno::RuntimeException(); + return pBkm->GetFieldname(); } -//FIXME Remove Method -void SAL_CALL SwXFieldmark::setRes( ::sal_Int16 ) throw (::com::sun::star::uno::RuntimeException) +void SwXFieldmark::setFieldType(const::rtl::OUString & fieldType) + throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - throw uno::RuntimeException(); + IFieldmark *pBkm = const_cast<IFieldmark*>( + dynamic_cast<const IFieldmark*>(GetBookmark())); + if(!pBkm) + throw uno::RuntimeException(); + pBkm->SetFieldname(fieldType); } -void SAL_CALL SwXFieldmark::setDescription( const ::rtl::OUString& description ) - throw (::com::sun::star::uno::RuntimeException) +uno::Reference<container::XNameContainer> SwXFieldmark::getParameters() + throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const ::sw::mark::IFieldmark* pMark = - dynamic_cast<const ::sw::mark::IFieldmark*>(GetBookmark()); - if(pMark) - const_cast< ::sw::mark::IFieldmark*>(pMark)->SetFieldHelptext(description); - else + IFieldmark *pBkm = const_cast<IFieldmark*>( + dynamic_cast<const IFieldmark*>(GetBookmark())); + if(!pBkm) throw uno::RuntimeException(); + return uno::Reference<container::XNameContainer>(new SwXFieldmarkParameters(pBkm)); } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 1d5d7b8128..35df91a570 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -269,13 +269,11 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry // <-- case FN_NUMBER_NEWSTART: { + // a multi selection is not considered const SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode(); - // --> OD 2006-10-19 #134160# - make code robust: - // consider case that PaM doesn't denote a text node - const SwNumRule* pRule = pTxtNd ? pTxtNd->GetNumRule() : 0; + // --> OD 2010-01-13 #b6912256# + if ( pTxtNd && pTxtNd->IsInList() ) // <-- - // hier wird Multiselektion nicht beruecksichtigt - if( pRule ) { if( pAny ) { diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 133ad4d278..089cba42ad 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1885,6 +1885,26 @@ void SwXText::Impl::ConvertCell( { throw lang::IllegalArgumentException(); } + + SwNodeRange aTmpRange(aStartCellPam.Start()->nNode, + aEndCellPam.End()->nNode); + SwNodeRange * pCorrectedRange = + m_pDoc->GetNodes().ExpandRangeForTableBox(aTmpRange); + + if (pCorrectedRange != NULL) + { + SwPaM aNewStartPaM(pCorrectedRange->aStart, 0); + aStartCellPam = aNewStartPaM; + + xub_StrLen nEndLen = 0; + SwTxtNode * pTxtNode = pCorrectedRange->aEnd.GetNode().GetTxtNode(); + if (pTxtNode != NULL) + nEndLen = pTxtNode->Len(); + + SwPaM aNewEndPaM(pCorrectedRange->aEnd, nEndLen); + aEndCellPam = aNewEndPaM; + } + /** check the nodes between start and end it is allowed to have pairs of StartNode/EndNodes */ diff --git a/sw/source/core/view/makefile.mk b/sw/source/core/view/makefile.mk index aa010e6b60..0ac0e0d106 100644..100755 --- a/sw/source/core/view/makefile.mk +++ b/sw/source/core/view/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -40,18 +40,20 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- SLOFILES = \ - $(SLO)$/scrrect.obj \ $(SLO)$/vdraw.obj \ $(SLO)$/viewimp.obj \ $(SLO)$/viewsh.obj \ - $(SLO)$/viewpg.obj \ - $(SLO)$/vnew.obj \ - $(SLO)$/vprint.obj \ - $(SLO)$/pagepreviewlayout.obj - + $(SLO)$/pagepreviewlayout.obj \ + $(SLO)$/printdata.obj \ + $(SLO)$/viewpg.obj \ + $(SLO)$/vnew.obj \ + $(SLO)$/vprint.obj + + + EXCEPTIONSFILES = \ $(SLO)$/pagepreviewlayout.obj - + # --- Targets ------------------------------------------------------- diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx new file mode 100755 index 0000000000..d67b820fc9 --- /dev/null +++ b/sw/source/core/view/printdata.cxx @@ -0,0 +1,546 @@ +/************************************************************************** + * + * + * 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: vprint.cxx,v $ + * $Revision: 1.46 $ + * + * 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_sw.hxx" + +#include <printdata.hxx> + +#include <globals.hrc> +#include <doc.hxx> +#include <unotxdoc.hxx> +#include <wdocsh.hxx> +#include <viewsh.hxx> +#include <docfld.hxx> +#include <swprtopt.hxx> + +#include <svl/languageoptions.hxx> +#include <toolkit/awt/vclxdevice.hxx> +#include <tools/string.hxx> +#include <tools/debug.hxx> +#include <tools/resary.hxx> +#include <unotools/moduleoptions.hxx> +#include <vcl/outdev.hxx> + + +extern bool lcl_GetPostIts( IDocumentFieldsAccess* pIDFA, _SetGetExpFlds * pSrtLst ); + + +using namespace ::com::sun::star; +using ::rtl::OUString; + + +////////////////////////////////////////////////////////////////////// + +SwRenderData::SwRenderData() +{ + m_pPostItFields = 0; + m_pPostItDoc = 0; + m_pPostItShell = 0; + + m_pViewOptionAdjust = 0; + m_pPrtOptions = 0; +} + + +SwRenderData::~SwRenderData() +{ + 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 ); +} + + +void SwRenderData::DeletePostItData() +{ + if (HasPostItData()) + { + 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; + } +} + +bool SwRenderData::NeedNewViewOptionAdjust( const SwWrtShell& rCompare ) const +{ + return m_pViewOptionAdjust ? ! m_pViewOptionAdjust->checkShell( rCompare ) : true; +} + + +void SwRenderData::ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions ) +{ + if (m_pViewOptionAdjust) + { + DBG_ASSERT( 0, "error: there should be no ViewOptionAdjust active when calling this function" ); + } + m_pViewOptionAdjust = new SwViewOptionAdjust_Impl( rSh, rViewOptions ); +} + + +void SwRenderData::ViewOptionAdjust( const SwPrtOptions *pPrtOptions ) +{ + m_pViewOptionAdjust->AdjustViewOptions( pPrtOptions ); +} + + +void SwRenderData::ViewOptionAdjustStop() +{ + if (m_pViewOptionAdjust) + { + delete m_pViewOptionAdjust; + m_pViewOptionAdjust = 0; + } +} + + +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 ) ); + + //! 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 ) +{ + ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) ); + + 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 ); + } + + // 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 ); + + // create sub section for Color + m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 12 ), rtl::OUString() ); + + // 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 (!bWeb) + { + // 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 ); + } + + // 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) + { + 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 + ); + } + + + DBG_ASSERT( nIdx == nNumProps, "number of added properties is not as expected" ); +} + + +SwPrintUIOptions::~SwPrintUIOptions() +{ +} + +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; +} + +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) + + 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; +} + +bool SwPrintUIOptions::IsPrintEmptyPages( bool bIsPDFExport ) const +{ + // take care of different property names for the option. + + bool bRes = bIsPDFExport ? + !getBoolValue( "IsSkipEmptyPages", sal_True ) : + getBoolValue( "PrintEmptyPages", sal_True ); + return bRes; +} + +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; +} + +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; +} + +bool SwPrintUIOptions::IsPrintDrawings() 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( "PrintDrawings", bRes ); + return bRes; +} + +bool SwPrintUIOptions::processPropertiesAndCheckFormat( const uno::Sequence< beans::PropertyValue >& i_rNewProp ) +{ + bool bChanged = processProperties( i_rNewProp ); + + uno::Reference< awt::XDevice > xRenderDevice; + uno::Any aVal( getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ) ) ); + aVal >>= xRenderDevice; + + OutputDevice* pOut = 0; + if (xRenderDevice.is()) + { + VCLXDevice* pDevice = VCLXDevice::GetImplementation( xRenderDevice ); + pOut = pDevice ? pDevice->GetOutputDevice() : 0; + } + bChanged = bChanged || (pOut != m_pLast); + if( pOut ) + m_pLast = pOut; + + return bChanged; +} + +////////////////////////////////////////////////////////////////////// + diff --git a/sw/source/core/view/scrrect.cxx b/sw/source/core/view/scrrect.cxx deleted file mode 100644 index b3d44821d2..0000000000 --- a/sw/source/core/view/scrrect.cxx +++ /dev/null @@ -1,1192 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" - - -#include <viewimp.hxx> -#include <viewsh.hxx> -#include <viewopt.hxx> -#include <vcl/window.hxx> -#include <scrrect.hxx> // SwScrollRect, SwScrollRects -// OD 18.02.2003 #107562# - <SwAlignRect> for <ViewShell::Scroll()> -#include <frmtool.hxx> -#ifndef _CURSOR_HXX //autogen -#include <vcl/cursor.hxx> -#endif -#include <vcl/virdev.hxx> -#ifndef _APP_HXX //autogen -#include <vcl/svapp.hxx> -#endif -#include <txtfrm.hxx> -#include "crsrsh.hxx" -#include "rootfrm.hxx" -#include "pagefrm.hxx" - -// OD 12.11.2002 #96272# - include declaration for <SetMappingForVirtDev> -#include "setmapvirtdev.hxx" -#include <IDocumentDrawModelAccess.hxx> - -// #i75172# -#include "dview.hxx" - -DBG_NAME(RefreshTimer) - -SV_IMPL_VARARR(SwStripeArr,SwStripe); -SV_IMPL_OP_PTRARR_SORT(SwScrollStripes, SwStripesPtr); -SV_IMPL_OP_PTRARR_SORT(SScrAreas, SwScrollAreaPtr); - -/***************************************************************************** -|* -|* ViewShell::AddScrollRect() -|* -|* Creation MA 07. Mar. 94 -|* Last change AMA 20. July 00 -|* -|* Description -|* ViewShell::AddScrollRect(..) passes a registration from a scrolling frame or -|* rectangle to all ViewShells and SwViewImps respectively. -|* -******************************************************************************/ - -void ViewShell::AddScrollRect( const SwFrm *pFrm, const SwRect &rRect, - long nOfs ) -{ - ASSERT( pFrm, "Where is my friend, the frame?" ); - BOOL bScrollOn = TRUE; - -#ifdef NOSCROLL - //Auch im Product per speziellem Compilat abschaltbar. - bScrollOn = FALSE; -#endif - - if( bScrollOn && Imp()->IsScroll() && nOfs <= SHRT_MAX && nOfs >= SHRT_MIN ) - { - ViewShell *pSh = this; - do - { - pSh->Imp()->AddScrollRect( pFrm, rRect, nOfs ); - pSh = (ViewShell*)pSh->GetNext(); - } while ( pSh != this ); - } - else - AddPaintRect( rRect ); -} - -/****************************************************************************** -|* -|* ViewShell::Scroll() -|* -|* Ersterstellung MA 07. Mar. 94 -|* Last change AMA 21. July 00 -|* -|* Description -|* ViewShell::Scroll() scrolls all rectangles in the pScrollRects-list and -|* transfers the critical lines by calling SwViewImp::MoveScrollArea(..). -|* -******************************************************************************/ -#include <svx/sdrpaintwindow.hxx> -#include <svx/sdr/overlay/overlaymanager.hxx> - -void ViewShell::Scroll() -{ - SwScrollAreas *pScrollRects = Imp()->GetScrollRects(); - if ( pScrollRects ) - { - bPaintWorks = FALSE; - ASSERT( pScrollRects->Count(), "ScrollRects ohne ScrollRects." ); - - //Abgleichen der Region mit den Scroll-Bereichen!!! - //Wenn eines der Scroll-Rechtecke ungueltig wird, so muss - //der PaintMode wahrscheinlich auf PAINT_BACKGROUND umgeschaltet - //werden. - - //Auf die Richtung kommt es an: - //- Bei einem pos. Ofst muss von hinten nach vorn gescrollt werden. - //- Bei einem neg. Ofst muss von vorn nach hinten gescrollt werden. - BOOL bPositive = (*pScrollRects)[0]->GetOffs() > 0; - if( (*pScrollRects)[0]->IsVertical() ) - bPositive = !bPositive; - int i = bPositive ? pScrollRects->Count()-1 : 0; - - for ( ; bPositive ? - i >= 0 : - i < (int)pScrollRects->Count(); - bPositive ? - --i : - ++i ) - { - const SwScrollArea &rScroll = *(*pScrollRects)[ sal::static_int_cast<USHORT>(i) ]; - if( rScroll.Count() ) - { - int j = bPositive ? rScroll.Count()-1 : 0; - for ( ; bPositive ? j >= 0 : j < (int)rScroll.Count(); - bPositive ? --j : ++j ) - { - const SwStripes& rStripes = *rScroll[ sal::static_int_cast<USHORT>(j) ]; - if( rScroll.IsVertical() ) - { - Rectangle aRectangle( rStripes.GetY() - - rStripes.GetHeight() + rScroll.GetOffs(), - rStripes.GetMin(), - rStripes.GetY() + rScroll.GetOffs(), - rStripes.GetMax() ); - // OD 18.02.2003 #107562# - align rectangle for scrolling - SwRect aAlignedScrollRect( aRectangle ); - ::SwAlignRect( aAlignedScrollRect, this ); - - // #i68597# when scrolling, let DrawingLayer know about refreshed areas, - // even when no DL objects are in the area. This is needed to allow - // fully buffered overlay. - const Rectangle aSourceRect(aAlignedScrollRect.SVRect()); - const Rectangle aTargetRect( - aSourceRect.Left() - rScroll.GetOffs(), aSourceRect.Top(), - aSourceRect.Right() - rScroll.GetOffs(), aSourceRect.Bottom()); - - if(GetWin()) - { - // SCROLL_NOWINDOWINVALIDATE okay since AddPaintRect below adds the to-be-invalidated region - GetWin()->Scroll( -rScroll.GetOffs(), 0, aSourceRect, SCROLL_CHILDREN | SCROLL_NOWINDOWINVALIDATE ); - } - - // #i68597# if buffered overlay, the buffered content needs to be scrolled directly - { - SdrPaintWindow* pPaintWindow = GetDrawView()->GetPaintWindow(0); - - if(pPaintWindow) - { - sdr::overlay::OverlayManager* pOverlayManager = pPaintWindow->GetOverlayManager(); - - if(pOverlayManager) - { - pOverlayManager->copyArea(aTargetRect.TopLeft(), aSourceRect.TopLeft(), aSourceRect.GetSize()); - } - } - } - - SwRect aRect( aRectangle ); - Imp()->ScrolledRect( aRect, -rScroll.GetOffs() ); - if ( bPositive ) - aRect.Right( aRect.Left() + rScroll.GetOffs()-1 ); - else - aRect.Left( aRect.Right() - rScroll.GetOffs() ); - Imp()->AddPaintRect( aRect ); - } - else - { - Rectangle aRectangle( rStripes.GetMin(), - rStripes.GetY() - rScroll.GetOffs(), - rStripes.GetRight(), - rStripes.GetBottom() - rScroll.GetOffs() ); - // OD 18.02.2003 #107562# - use aligned rectangle for scrolling - SwRect aAlignedScrollRect( aRectangle ); - ::SwAlignRect( aAlignedScrollRect, this ); - - // #i68597# when scrolling, let DrawingLayer know about refreshed areas, - // even when no DL objects are in the area. This is needed to allow - // fully buffered overlay. - const Rectangle aSourceRect(aAlignedScrollRect.SVRect()); - const Rectangle aTargetRect( - aSourceRect.Left(), aSourceRect.Top() + rScroll.GetOffs(), - aSourceRect.Right(), aSourceRect.Bottom() + rScroll.GetOffs()); - - if(GetWin()) - { - // SCROLL_NOWINDOWINVALIDATE okay since AddPaintRect below adds the to-be-invalidated region - GetWin()->Scroll( 0, rScroll.GetOffs(), aSourceRect, SCROLL_CHILDREN | SCROLL_NOWINDOWINVALIDATE ); - } - - // #i68597# if buffered overlay, the buffered content needs to be scrolled directly - { - SdrPaintWindow* pPaintWindow = GetDrawView()->GetPaintWindow(0); - - if(pPaintWindow) - { - sdr::overlay::OverlayManager* pOverlayManager = pPaintWindow->GetOverlayManager(); - - if(pOverlayManager) - { - pOverlayManager->copyArea(aTargetRect.TopLeft(), aSourceRect.TopLeft(), aSourceRect.GetSize()); - } - } - } - - SwRect aRect( aRectangle ); - Imp()->ScrolledRect( aRect, rScroll.GetOffs() ); - if ( bPositive ) - aRect.Bottom( aRect.Top() + rScroll.GetOffs()-1 ); - else - aRect.Top( aRect.Bottom() + rScroll.GetOffs() ); - Imp()->AddPaintRect( aRect ); - } - } - } - } - if ( !Imp()->IsScrolled() ) - Imp()->SetScrolled(); - - Imp()->MoveScrollArea(); - bPaintWorks = TRUE; - } -} - -/****************************************************************************** -|* -|* ViewShell::SetNoNextScroll() -|* -|* Ersterstellung MA 08. Mar. 94 -|* Letzte Aenderung MA 08. Mar. 94 -|* -******************************************************************************/ - -void ViewShell::SetNoNextScroll() -{ - ViewShell *pSh = this; - do - { pSh->Imp()->ResetNextScroll(); - pSh = (ViewShell*)pSh->GetNext(); - - } while ( pSh != this ); -} - -/****************************************************************************** -|* -|* SwViewImp::AddScrollRect() -|* -|* Ersterstellung MA 07. Mar. 94 -|* Last change AMA 21. July 00 -|* -|* Adds a scrollable rectangle and his critical lines to the list. -|* -******************************************************************************/ - -void SwViewImp::AddScrollRect( const SwFrm *pFrm, const SwRect &rRect, - long nOffs ) -{ - ASSERT( nOffs != 0, "Scrollen ohne Ofst." ); - SwRect aRect( rRect ); - BOOL bVert = pFrm->IsVertical(); - if( bVert ) - aRect.Pos().X() += nOffs; - else - aRect.Pos().Y() -= nOffs; - if( aRect.IsOver( pSh->VisArea() ) ) - { - ASSERT( pSh->GetWin(), "Scrolling without outputdevice" ); - aRect._Intersection( pSh->VisArea() ); - SwStripes *pStr; - if ( !pScrollRects ) - pScrollRects = new SwScrollAreas; - if( bVert ) - { - aRect.Pos().X() -= nOffs; - pStr = new SwStripes( aRect.Right(), aRect.Width(), - aRect.Top(), aRect.Bottom() ); - if( pFrm->IsTxtFrm() ) - ((SwTxtFrm*)pFrm)->CriticalLines(*pSh->GetWin(), *pStr, nOffs ); - else - pStr->Insert( SwStripe( aRect.Right(), aRect.Width() ), 0 ); - pScrollRects->InsertCol( SwScrollColumn( pFrm->Frm().Top(), - pFrm->Frm().Height(), nOffs, bVert ), pStr); - } - else - { - aRect.Pos().Y() += nOffs; - pStr = new SwStripes( aRect.Top(), aRect.Height(), - aRect.Left(), aRect.Right() ); - if( pFrm->IsTxtFrm() ) - ((SwTxtFrm*)pFrm)->CriticalLines(*pSh->GetWin(), *pStr, nOffs ); - else - pStr->Insert( SwStripe( aRect.Top(), aRect.Height() ), 0 ); - pScrollRects->InsertCol( SwScrollColumn( pFrm->Frm().Left(), - pFrm->Frm().Width(), nOffs, bVert ), pStr ); - } - } - else - AddPaintRect( rRect ); -} - -/****************************************************************************** -|* -|* SwViewImp::MoveScrollArea() -|* -|* Creation AMA 10. July 00 -|* Last change AMA 21. July 00 -|* -|* Transfers the areas after scrolling to the scrolled list, but only those -|* parts with critical lines. -|* -******************************************************************************/ - -void SwViewImp::MoveScrollArea() -{ - if( !pScrolledArea ) - pScrolledArea = new SwScrollAreas; - for( USHORT nIdx = 0; nIdx < pScrollRects->Count(); ++nIdx ) - { - SwScrollArea *pScr = (*pScrollRects)[ nIdx ]; - if( pScr->Compress() ) - delete pScr; - else - { - USHORT nIndx; - if( pScrolledArea->Seek_Entry( pScr, &nIndx ) ) - pScrolledArea->GetObject(nIndx)->Add( pScr ); - else - pScrolledArea->Insert( pScr ); - } - } - delete pScrollRects; - pScrollRects = NULL; -} - -/****************************************************************************** -|* -|* SwViewImp::FlushScrolledArea() -|* -|* Creation AMA 10. July 00 -|* Last change AMA 21. July 00 -|* -|* Flushes the scrolled critical lines, that is transfer them to AddPaintRect() -|* and remove them from the list. -|* -******************************************************************************/ - -void SwViewImp::FlushScrolledArea() -{ - USHORT nCount = pScrolledArea->Count(); - while( nCount ) - { - SwScrollArea* pScroll = (*pScrolledArea)[--nCount]; - USHORT nCnt = pScroll->Count(); - while( nCnt ) - { - SwStripes* pStripes = (*pScroll)[--nCnt]; - if( pScroll->IsVertical() ) - { - SwRect aRect( 0, pStripes->GetMin(), 0, pStripes->GetWidth() ); - for( USHORT i = 0; i < pStripes->Count(); ++i ) - { - long nWidth = (*pStripes)[i].GetHeight(); - aRect.Left( (*pStripes)[i].GetY() - nWidth + 1 ); - aRect.Width( nWidth ); - AddPaintRect( aRect ); - } - } - { - SwRect aRect( pStripes->GetMin(), 0, pStripes->GetWidth(), 0 ); - for( USHORT i = 0; i < pStripes->Count(); ++i ) - { - aRect.Top( (*pStripes)[i].GetY() ); - aRect.Height( (*pStripes)[i].GetHeight() ); - AddPaintRect( aRect ); - } - } - pScroll->Remove( nCnt ); - delete pStripes; - } - pScrolledArea->Remove( nCount ); - delete pScroll; - } - delete pScrolledArea; - pScrolledArea = NULL; -} - -/****************************************************************************** -|* -|* SwViewImp::_FlushScrolledArea(..) -|* -|* Creation AMA 10. July 00 -|* Last change AMA 21. July 00 -|* -|* The critical lines, which overlaps with the given rectangle, will be united -|* with the rectangle and removed from the list. -|* -******************************************************************************/ - -BOOL SwViewImp::_FlushScrolledArea( SwRect& rRect ) -{ - BOOL bRet = FALSE; - for( USHORT i = pScrolledArea->Count(); i; ) - { - SwScrollArea* pScroll = (*pScrolledArea)[--i]; - for( USHORT j = pScroll->Count(); j; ) - { - SwStripes* pStripes = (*pScroll)[--j]; - if( pStripes->Count() ) - { - if( pScroll->IsVertical() ) - { - SwRect aRect( pStripes->GetY() - pStripes->GetHeight(), - pStripes->GetMin(), pStripes->GetHeight(), - pStripes->GetWidth() ); - if( rRect.IsOver( aRect ) ) - { - for( USHORT nI = pStripes->Count(); nI; ) - { - long nWidth = (*pStripes)[--nI].GetHeight(); - aRect.Left( (*pStripes)[nI].GetY() - nWidth + 1 ); - aRect.Width( nWidth ); - if( rRect.IsOver( aRect ) ) - { - rRect.Union( aRect ); - bRet = TRUE; - pStripes->Remove( nI ); - nI = pStripes->Count(); - } - } - } - } - else - { - SwRect aRect( pStripes->GetMin(), pStripes->GetY(), - pStripes->GetWidth(), pStripes->GetHeight() ); - if( rRect.IsOver( aRect ) ) - { - for( USHORT nI = pStripes->Count(); nI; ) - { - aRect.Top( (*pStripes)[--nI].GetY() ); - aRect.Height( (*pStripes)[nI].GetHeight() ); - if( rRect.IsOver( aRect ) ) - { - rRect.Union( aRect ); - bRet = TRUE; - pStripes->Remove( nI ); - nI = pStripes->Count(); - } - } - } - } - } - if( !pStripes->Count() ) - { - pScroll->Remove( j ); - delete pStripes; - } - } - if( !pScroll->Count() ) - { - pScrolledArea->Remove( pScroll ); - delete pScroll; - } - } - if( !pScrolledArea->Count() ) - { - DELETEZ( pScrolledArea ); - SetNextScroll(); - } - return bRet; -} - -/****************************************************************************** -|* -|* SwViewImp::RefreshScrolledHdl(..) -|* -|* Creation MA 06. Oct. 94 -|* Last change AMA 21. July 00 -|* -|* Every timerstop one of the critical lines will be painted. -|* -******************************************************************************/ - -IMPL_LINK( SwViewImp, RefreshScrolledHdl, Timer *, EMPTYARG ) -{ - DBG_PROFSTART( RefreshTimer ); - - if ( !IsScrolled() ) - { DBG_PROFSTOP( RefreshTimer ); - return 0; - } - - SET_CURR_SHELL( GetShell() ); - - //Kein Refresh wenn eine Selektion besteht. - if ( GetShell()->IsA( TYPE(SwCrsrShell) ) && - (((SwCrsrShell*)GetShell())->HasSelection() || - ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1)) - { - DBG_PROFSTOP( RefreshTimer ); - return 0; - } - - if( pScrolledArea ) - { - const SwRect aRect( GetShell()->VisArea() ); - BOOL bNoRefresh = GetShell()->IsA( TYPE(SwCrsrShell) ) && - ( ((SwCrsrShell*)GetShell())->HasSelection() || - ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1 ); - if( pScrolledArea->Count() ) - { - SwScrollArea* pScroll = pScrolledArea->GetObject(0); - ASSERT( pScroll->Count(), "Empty scrollarea" ); - // OD 21.10.2003 #112616# - for savety reason: - // react, if precondition named in assertion isn't hold - if ( pScroll->Count() ) - { - SwStripes* pStripes = pScroll->GetObject(0); - // OD 20.10.2003 #112616# - consider also first stripe - ASSERT( pStripes->Count(), "Empty scrollstripes" ); - // OD 21.10.2003 #112616# - for savety reason: - // react, if precondition named in assertion isn't hold - if ( pStripes->Count() ) - { - const SwStripe &rStripe = pStripes->GetObject(0); - SwRect aTmpRect = pScroll->IsVertical() ? - SwRect( rStripe.GetY() - rStripe.GetHeight(), pScroll->GetX(), - rStripe.GetHeight(), pScroll->GetWidth() ) : - SwRect( pScroll->GetX(), rStripe.GetY(), - pScroll->GetWidth(), rStripe.GetHeight() ); - if( aTmpRect.IsOver( aRect ) ) - { - // SwSaveHdl aSaveHdl( this ); - if( !bNoRefresh ) - _RefreshScrolledArea( aTmpRect ); - } - // OD 20.10.2003 #112616# - consider also first stripe - pStripes->Remove( 0 ); - } - if( pStripes->Count() < 1 ) - { - pScroll->Remove( USHORT(0) ); - delete pStripes; - } - } - if( !pScroll->Count() ) - { - pScrolledArea->Remove( pScroll ); - delete pScroll; - } - } - if( !pScrolledArea->Count() ) - { - delete pScrolledArea; - pScrolledArea = 0; - } - } - - //All done? - if( !pScrolledArea || !pScrolledArea->Count() - ) - { - ResetScrolled(); - SetNextScroll(); - aScrollTimer.Stop(); - } - - DBG_PROFSTOP( RefreshTimer ); - return 0; -} - -/****************************************************************************** -|* -|* SwViewImp::_ScrolledRect(..) -|* -|* Creation AMA 20. July 00 -|* Last change AMA 21. July 00 -|* -|* handles the problem of scrolled criticals lines, when they are a part of -|* a scrolling area again. In this case, their rectangle has to move to the -|* right position. -|* -******************************************************************************/ - -void SwViewImp::_ScrolledRect( const SwRect& rRect, long nOffs ) -{ - for( USHORT i = pScrolledArea->Count(); i; ) - { - SwScrollArea* pScroll = (*pScrolledArea)[--i]; - ASSERT( pScroll->Count() == 1, "Missing scrollarea compression 1" ); - SwStripes* pStripes = (*pScroll)[0]; - if( pStripes->Count() ) - { - SwRect aRect = pScroll->IsVertical() ? - SwRect( pStripes->GetY() - pStripes->GetHeight(), - pStripes->GetMin(), pStripes->GetHeight(), - pStripes->GetWidth() ) : - SwRect( pStripes->GetMin(), pStripes->GetY(), - pStripes->GetWidth(), pStripes->GetHeight() ); - - if( rRect.IsOver( aRect ) ) - { - BOOL bRecalc = FALSE; - for( USHORT nI = pStripes->Count(); nI; ) - { - if( pScroll->IsVertical() ) - { - long nWidth = (*pStripes)[--nI].GetHeight(); - aRect.Left( (*pStripes)[nI].GetY() - nWidth + 1 ); - aRect.Width( nWidth ); - } - else - { - aRect.Top( (*pStripes)[--nI].GetY() ); - aRect.Height( (*pStripes)[nI].GetHeight() ); - } - if( rRect.IsInside( aRect ) ) - { - (*pStripes)[nI].Y() += nOffs; - bRecalc = TRUE; - } - } - if( bRecalc ) - pStripes->Recalc( pScroll->IsVertical() ); - } - } - } -} - -/****************************************************************************** -|* -|* SwViewImp::_RefreshScrolledArea() -|* -******************************************************************************/ - -//Berechnen der Hoehe fuer das virtuelle Device, Breite und maximaler -//Speicherbedarf sind vorgegeben. -#define MAXKB 180L - -static void lcl_CalcVirtHeight( OutputDevice *pOut, Size &rSz ) -{ - char nBytes; - const ULONG nColorCount = pOut->GetColorCount(); - if( 256 >= nColorCount ) // 2^8 - nBytes = 1; - else - if( USHRT_MAX >= nColorCount ) // 2^16 - nBytes = 2; - else - if( 16777216 >= nColorCount ) // 2^24 - nBytes = 3; - else - nBytes = 4; // 2^n - - rSz = pOut->LogicToPixel( rSz ); - - long nKB = MAXKB * 1000; - nKB /= nBytes; - if ( rSz.Width() > 0 ) - rSz.Height() = nKB / rSz.Width(); - else - rSz.Height() = nKB; - - rSz = pOut->PixelToLogic( rSz ); -} - -void SwViewImp::_RefreshScrolledArea( const SwRect &rRect ) -{ - SwRect aScRect( rRect ); - aScRect.Intersection( GetShell()->VisArea() ); - - if( aScRect.IsEmpty() ) - return; - - BOOL bShowCrsr = FALSE; - Window *pWin = GetShell()->GetWin(); - if ( pWin && pWin->GetCursor() && pWin->GetCursor()->IsVisible() ) - { - bShowCrsr = TRUE; - pWin->GetCursor()->Hide(); - } - - //Virtuelles Device erzeugen und einstellen. - // --> OD 2007-08-16 #i80720# - // rename variable <pOld> to <pCurrentOut> - OutputDevice* pCurrentOut = GetShell()->GetOut(); - VirtualDevice *pVout = new VirtualDevice( *pCurrentOut ); - MapMode aMapMode( pCurrentOut->GetMapMode() ); - pVout->SetMapMode( aMapMode ); - Size aSize( aScRect.Width(), 0 ); - lcl_CalcVirtHeight( pCurrentOut, aSize ); - if ( aSize.Height() > aScRect.Height() ) - aSize.Height() = aScRect.Height() + 50; - - //unten in der Schleife lassen wir die Rechtecke ein wenig ueberlappen, - //das muss auch bei der Groesse beruecksichtigt werden. - aSize = pCurrentOut->LogicToPixel( aSize ); - aSize.Width() += 4; aSize.Height() += 4; - aSize = pCurrentOut->PixelToLogic( aSize ); - // <-- - - const SwRootFrm* pLayout = GetShell()->GetLayout(); - - // #i75172# Avoid VDev if PreRendering is active - static bool bDoNotUseVDev(GetDrawView()->IsBufferedOutputAllowed()); - - // --> OD 2007-08-16 #i80720# - // Enlarge paint rectangle also in case that "own" virtual device <pVout> - // isn't used. Refactor code a little bit to achieve this. - const bool bApplyVDev = !bDoNotUseVDev && pVout->SetOutputSize( aSize ); - - { - if ( bApplyVDev ) - { - // --> OD 2007-08-16 #i80720# - // rename variable <pOld> to <pCurrentOut> - pVout->SetLineColor( pCurrentOut->GetLineColor() ); - pVout->SetFillColor( pCurrentOut->GetFillColor() ); - // <-- - } - - // #i72754# start Pre/PostPaint encapsulation before pOut is changed to the buffering VDev - const Region aRepaintRegion(aScRect.SVRect()); - GetShell()->DLPrePaint2(aRepaintRegion); - - //Virtuelles Device in die ViewShell 'selektieren' - // --> OD 2007-08-16 #i80720# - // remember current output device at this place - OutputDevice* pOldOut = GetShell()->GetOut(); - // <-- - if ( bApplyVDev ) - { - GetShell()->pOut = pVout; - } - - const SwFrm *pPg = GetFirstVisPage(); - do - { - SwRect aRect( pPg->Frm() ); - if ( aRect.IsOver( aScRect ) ) - { - aRect._Intersection( aScRect ); - do - { - Rectangle aTmp( aRect.SVRect() ); - long nTmp = aTmp.Top() + aSize.Height(); - if ( aTmp.Bottom() > nTmp ) - aTmp.Bottom() = nTmp; - - aTmp = pOldOut->LogicToPixel( aTmp ); - if( aRect.Top() > pPg->Frm().Top() ) - aTmp.Top() -= 2; - if( aRect.Top() + aRect.Height() < pPg->Frm().Top() - + pPg->Frm().Height() ) - aTmp.Bottom() += 2; - if( aRect.Left() > pPg->Frm().Left() ) - aTmp.Left() -= 2; - if( aRect.Left() + aRect.Width() < pPg->Frm().Left() - + pPg->Frm().Width() ) - aTmp.Right() += 2; - aTmp = pOldOut->PixelToLogic( aTmp ); - SwRect aTmp2( aTmp ); - - if ( bApplyVDev ) - { - // OD 12.11.2002 #96272# - use method to set mapping - //Point aOrigin( aTmp2.Pos() ); - //aOrigin.X() = -aOrigin.X(); aOrigin.Y() = -aOrigin.Y(); - //aMapMode.SetOrigin( aOrigin ); - ::SetMappingForVirtDev( aTmp2.Pos(), &aMapMode, pOldOut, pVout ); - pVout->SetMapMode( aMapMode ); - } - - pLayout->Paint( aTmp2 ); - if ( bApplyVDev ) - { - pOldOut->DrawOutDev( aTmp2.Pos(), aTmp2.SSize(), - aTmp2.Pos(), aTmp2.SSize(), *pVout ); - } - - aRect.Top( aRect.Top() + aSize.Height() ); - aScRect.Top( aRect.Top() ); - - } while ( aRect.Height() > 0 ); - } - pPg = pPg->GetNext(); - - } while ( pPg && pPg->Frm().IsOver( GetShell()->VisArea() ) ); - - if ( bApplyVDev ) - { - GetShell()->pOut = pOldOut; - } - delete pVout; - - // #i72754# end Pre/PostPaint encapsulation when pOut is back and content is painted - GetShell()->DLPostPaint2(true); - } - // <-- - - if ( bShowCrsr ) - pWin->GetCursor()->Show(); -} - -/****************************************************************************** -|* -|* SwViewImp::RefreshScrolledArea() -|* -|* Ersterstellung MA 06. Oct. 94 -|* Letzte Aenderung MA 19. Apr. 95 -|* -******************************************************************************/ - -void SwViewImp::RefreshScrolledArea( SwRect &rRect ) -{ - // --> OD 2007-07-24 #123003# - make code robust - // avoid recursive call - static bool bRunning( false ); - - if ( bRunning ) - { - ASSERT( false, "<SwViewImp::RefreshScrolledArea(..)> - recursive method call - please inform OD" ); - return; - } - // <-- - - //1. Wird auch von der CrsrShell gerufen, um ggf. den Bereich, in den der - //Crsr gesetzt wird (Absatz, ganze Zeile bei einer Tabelle) aufzufrischen. - //Allerdings kann es dann natuerlich sein, dass das Rechteck ueberhaupt - //nicht mit aufzufrischenden Bereichen ueberlappt. - //2. Kein Refresh wenn eine Selektion besteht. - if( (GetShell()->IsA( TYPE(SwCrsrShell) ) && - (((SwCrsrShell*)GetShell())->HasSelection() || - ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1))) - { - return; - } - - // --> OD 2007-07-27 #123003# - bRunning = true; - // <-- - - if( pScrolledArea && pScrolledArea->Count() && - !( ( GetShell()->IsA( TYPE(SwCrsrShell) ) && - ( ((SwCrsrShell*)GetShell())->HasSelection() || - ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1) ) ) ) - { - for( USHORT i = pScrolledArea->Count(); i; ) - { - SwScrollArea* pScroll = (*pScrolledArea)[--i]; - for( USHORT j = pScroll->Count(); j; ) - { - SwStripes* pStripes = (*pScroll)[--j]; - if( pStripes->Count() ) - { - SwRect aRect = pScroll->IsVertical() ? - SwRect( pStripes->GetY() - pStripes->GetHeight(), - pStripes->GetMin(), pStripes->GetHeight(), - pStripes->GetWidth() ) : - SwRect( pStripes->GetMin(), pStripes->GetY(), - pStripes->GetWidth(), pStripes->GetHeight() ); - if( rRect.IsOver( aRect ) ) - { - for( USHORT nI = pStripes->Count(); nI; ) - { - if( pScroll->IsVertical() ) - { - long nWidth = (*pStripes)[--nI].GetHeight(); - aRect.Left( (*pStripes)[nI].GetY() -nWidth +1 ); - aRect.Width( nWidth ); - } - else - { - aRect.Top( (*pStripes)[--nI].GetY() ); - aRect.Height( (*pStripes)[nI].GetHeight() ); - } - if( rRect.IsOver( aRect ) ) - { - pStripes->Remove( nI ); - _RefreshScrolledArea( aRect ); - } - } - } - } - if( !pStripes->Count() ) - { - pScroll->Remove( j ); - delete pStripes; - } - } - if( !pScroll->Count() ) - { - pScrolledArea->Remove( pScroll ); - delete pScroll; - } - //Ist da jemand ungeduldig? - //Nur Mouse und Keyboard, weil wir sonst von jeder billigen - //Uhr unterbrochen werden. - if( GetpApp()->AnyInput( INPUT_MOUSEANDKEYBOARD ) ) - break; - } - } - - //All done? - if( !pScrolledArea || !pScrolledArea->Count() ) - { - ResetScrolled(); - SetNextScroll(); - aScrollTimer.Stop(); - } - - // --> OD 2007-07-24 #123003# - bRunning = false; - // <-- -} - -SwStripes& SwStripes::Plus( const SwStripes& rOther, BOOL bVert ) -{ - if( !Count() ) - { - Insert( &rOther, 0 ); - SetMin( rOther.GetMin() ); - SetMax( rOther.GetMax() ); - return *this; - } - - long nCnt = rOther.Count(); - if( nCnt ) - { - ChkMin( rOther.GetMin() ); - ChkMax( rOther.GetMax() ); - USHORT nStart = 0; - if( bVert ) - for( USHORT nIdx = 0; nIdx < nCnt; ++nIdx ) - { - const SwStripe& rAdd = rOther[ nIdx ]; - long nBottom = rAdd.GetY() - rAdd.GetHeight(); - USHORT nCount = Count(); - USHORT nTmpY = nStart; - while( nTmpY < nCount ) - { - SwStripe& rChk = GetObject( nTmpY ); - if( rChk.GetY() - rChk.GetHeight() < rAdd.GetY() ) - break; - else - ++nTmpY; - } - USHORT nB = nTmpY; - while( nB < nCount ) - { - const SwStripe& rChk = GetObject( nB ); - if( rChk.GetY() <= nBottom ) - break; - else - ++nB; - } - nStart = nTmpY; - if( nTmpY == nB ) - Insert( rAdd, nTmpY ); - else - { - long nChkBottom = rAdd.GetY() - rAdd.GetHeight();; - const SwStripe& rChkB = GetObject( nB - 1 ); - long nTmp = rChkB.GetY() - rChkB.GetHeight(); - if( nTmp < nChkBottom ) - nChkBottom = nTmp; - SwStripe& rChk = GetObject( nTmpY ); - if( rAdd.GetY() > rChk.GetY() ) - rChk.Y() = rAdd.GetY(); - rChk.Height() = rChk.GetY() - nChkBottom; - nChkBottom = nB - nTmpY - 1; - if( nChkBottom ) - Remove( nTmpY + 1, (USHORT)nChkBottom ); - } - } - else - { - for( USHORT nIdx = 0; nIdx < nCnt; ++nIdx ) - { - const SwStripe& rAdd = rOther[ nIdx ]; - long nBottom = rAdd.GetY() + rAdd.GetHeight(); - USHORT nCount = Count(); - USHORT nTmpY = nStart; - while( nTmpY < nCount ) - { - SwStripe& rChk = GetObject( nTmpY ); - if( rChk.GetY() + rChk.GetHeight() > rAdd.GetY() ) - break; - else - ++nTmpY; - } - USHORT nB = nTmpY; - while( nB < nCount ) - { - const SwStripe& rChk = GetObject( nB ); - if( rChk.GetY() >= nBottom ) - break; - else - ++nB; - } - nStart = nTmpY; - if( nTmpY == nB ) - Insert( rAdd, nTmpY ); - else - { - long nChkBottom = rAdd.GetY() + rAdd.GetHeight();; - const SwStripe& rChkB = GetObject( nB - 1 ); - long nTmp = rChkB.GetY() + rChkB.GetHeight(); - if( nTmp > nChkBottom ) - nChkBottom = nTmp; - SwStripe& rChk = GetObject( nTmpY ); - if( rAdd.GetY() < rChk.GetY() ) - rChk.Y() = rAdd.GetY(); - rChk.Height() = nChkBottom - rChk.GetY(); - nChkBottom = nB - nTmpY - 1; - if( nChkBottom ) - Remove( nTmpY + 1, (USHORT)nChkBottom ); - } - } - } - } - return *this; -} - -BOOL SwStripes::Recalc( BOOL bVert ) -{ - if( !Count() ) - return TRUE; - Y() = GetObject(0).GetY(); - if( bVert ) - { - long nTmpMin = GetObject(0).GetY() - GetObject(0).Height(); - for( USHORT nIdx = 1; nIdx < Count(); ) - { - const SwStripe& rStr = GetObject(nIdx++); - if( GetY() < rStr.GetY() ) - Y() = rStr.GetY(); - if( nTmpMin > rStr.GetY() - rStr.GetHeight() ) - nTmpMin = rStr.GetY() - rStr.GetHeight(); - } - Height() = GetY() - nTmpMin; - } - else - { - long nTmpMax = GetObject(0).GetY() + GetObject(0).Height(); - for( USHORT nIdx = 1; nIdx < Count(); ) - { - const SwStripe& rStr = GetObject(nIdx++); - if( GetY() > rStr.GetY() ) - Y() = rStr.GetY(); - if( nTmpMax < rStr.GetY() + rStr.GetHeight() ) - nTmpMax = rStr.GetY() + rStr.GetHeight(); - } - Height() = nTmpMax - GetY(); - } - return FALSE; -} - -BOOL SwScrollArea::Compress() -{ - if( !Count() ) - return TRUE; - for( USHORT nIdx = Count() - 1; nIdx > 0; --nIdx ) - { - GetObject(0)->Plus( *GetObject(nIdx), IsVertical() ); - delete GetObject( nIdx ); - Remove( nIdx, 1 ); - } - ClrOffs(); - return GetObject(0)->Recalc( IsVertical() ); -} - -void SwScrollArea::Add( SwScrollArea *pScroll ) -{ - ASSERT( pScroll->Count() == 1, "Missing scrollarea compression 2" ); - ASSERT( Count() == 1, "Missing scrollarea compression 3" ); - GetObject(0)->Plus( *pScroll->GetObject(0), IsVertical() ); - GetObject(0)->Recalc( IsVertical() ); - delete pScroll->GetObject( 0 ); - pScroll->Remove( (USHORT)0, 1 ); - delete pScroll; -} - -/****************************************************************************** -|* -|* SwScrollAreas::Insert(..) -|* -******************************************************************************/ - -void SwScrollAreas::InsertCol( const SwScrollColumn &rCol, - SwStripes *pStripes ) -{ - SwScrollArea *pTmp = new SwScrollArea( rCol, pStripes ); - USHORT nIdx; - if( Seek_Entry( pTmp, &nIdx ) ) - { - GetObject( nIdx )->SmartInsert( pStripes ); - delete pTmp; - } - else - Insert( pTmp ); -} - - -void SwScrollArea::SmartInsert( SwStripes* pStripes ) -{ - ASSERT( pStripes, "Insert empty scrollstripe?" ); - BOOL bNotInserted = TRUE; - if( IsVertical() ) - for( USHORT nIdx = 0; nIdx < Count() && bNotInserted; ) - { - SwStripes* pTmp = GetObject( nIdx++ ); - if( pTmp->GetY() - pTmp->GetHeight() == pStripes->GetY() ) - { - pTmp->Height() += pStripes->GetHeight(); - pTmp->ChkMin( pStripes->GetMin() ); - pTmp->ChkMax( pStripes->GetMax() ); - if( pStripes->Count() ) - pTmp->Insert( (SwStripeArr*)pStripes, pTmp->Count(), 0 ); - bNotInserted = FALSE; - } - else if( pTmp->GetY() == pStripes->GetY() - pStripes->GetHeight() ) - { - pTmp->Height() += pStripes->GetHeight(); - pTmp->Y() = pStripes->GetY(); - pTmp->ChkMin( pStripes->GetMin() ); - pTmp->ChkMax( pStripes->GetMax() ); - if( pStripes->Count() ) - pTmp->Insert( (SwStripeArr*)pStripes, 0, 0 ); - bNotInserted = FALSE; - } - } - else - for( USHORT nIdx = 0; nIdx < Count() && bNotInserted; ) - { - SwStripes* pTmp = GetObject( nIdx++ ); - if( pTmp->GetY() + pTmp->GetHeight() == pStripes->GetY() ) - { - pTmp->Height() += pStripes->GetHeight(); - pTmp->ChkMin( pStripes->GetMin() ); - pTmp->ChkMax( pStripes->GetMax() ); - if( pStripes->Count() ) - pTmp->Insert( (SwStripeArr*)pStripes, pTmp->Count(), 0 ); - bNotInserted = FALSE; - } - else if( pTmp->GetY() == pStripes->GetY() + pStripes->GetHeight() ) - { - pTmp->Height() += pStripes->GetHeight(); - pTmp->Y() = pStripes->GetY(); - pTmp->ChkMin( pStripes->GetMin() ); - pTmp->ChkMax( pStripes->GetMax() ); - if( pStripes->Count() ) - pTmp->Insert( (SwStripeArr*)pStripes, 0, 0 ); - bNotInserted = FALSE; - } - } - if( !bNotInserted || !Insert( pStripes ) ) - delete pStripes; -} diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index ac63ccb5d7..ac92c83d85 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -29,7 +29,6 @@ #include "precompiled_sw.hxx" -#include "scrrect.hxx" #include "crsrsh.hxx" #include "rootfrm.hxx" #include "pagefrm.hxx" @@ -126,8 +125,6 @@ SwViewImp::SwViewImp( ViewShell *pParent ) : pSdrPageView( 0 ), pFirstVisPage( 0 ), pRegion( 0 ), - pScrollRects( 0 ), - pScrolledArea( 0 ), pLayAct( 0 ), pIdleAct( 0 ), pAccMap( 0 ), @@ -138,13 +135,9 @@ SwViewImp::SwViewImp( ViewShell *pParent ) : { //bResetXorVisibility = //HMHbShowHdlPaint = - bResetHdlHiddenPaint = bScrolled = - bPaintInScroll = bSmoothUpdate = bStopSmooth = bStopPrt = FALSE; - bFirstPageInvalid = bScroll = bNextScroll = TRUE; - - aScrollTimer.SetTimeout( 1500 ); - aScrollTimer.SetTimeoutHdl( LINK( this, SwViewImp, RefreshScrolledHdl)); - aScrollTimer.Stop(); + bResetHdlHiddenPaint = + bSmoothUpdate = bStopSmooth = bStopPrt = FALSE; + bFirstPageInvalid = TRUE; } /****************************************************************************** @@ -169,8 +162,7 @@ SwViewImp::~SwViewImp() delete pDrawView; - DelRegions(); - delete pScrolledArea; + DelRegion(); ASSERT( !pLayAct, "Have action for the rest of your life." ); ASSERT( !pIdleAct,"Be idle for the rest of your life." ); @@ -185,10 +177,9 @@ SwViewImp::~SwViewImp() |* ******************************************************************************/ -void SwViewImp::DelRegions() +void SwViewImp::DelRegion() { DELETEZ(pRegion); - DELETEZ(pScrollRects); } /****************************************************************************** diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 8236d0292f..c4b413bb6c 100644..100755 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -216,28 +216,18 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd ) Imp()->StartAction(); if ( Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() ) - Imp()->DelRegions(); + Imp()->DelRegion(); const BOOL bExtraData = ::IsExtraData( GetDoc() ); if ( !bIdleEnd ) { - if ( Imp()->IsNextScroll() && !bExtraData ) - Imp()->SetScroll(); - else - { - if ( bExtraData ) - Imp()->bScroll = FALSE; - Imp()->SetNextScroll(); - Imp()->ResetScroll(); - } SwLayAction aAction( GetLayout(), Imp() ); aAction.SetComplete( FALSE ); if ( nLockPaint ) aAction.SetPaint( FALSE ); aAction.SetInputType( INPUT_KEYBOARD ); aAction.Action(); - Imp()->SetScroll(); } if ( bIsShellForCheckViewLayout ) @@ -246,8 +236,9 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd ) //Wenn wir selbst keine Paints erzeugen, so warten wir auf das Paint //vom System. Dann ist das Clipping korrekt gesetzt; Beispiel: verschieben //eines DrawObjektes. - if ( Imp()->GetRegion() || Imp()->GetScrollRects() || - aInvalidRect.HasArea() || bExtraData ) + if ( Imp()->GetRegion() || + aInvalidRect.HasArea() || + bExtraData ) { if ( !nLockPaint ) { @@ -271,15 +262,10 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd ) // Mitte eine Selektion und mit einem anderen Cursor an linken // rechten Rand springen. Ohne ShowCrsr verschwindet die // Selektion - BOOL bShowCrsr = (pRegion || Imp()->GetScrollRects()) && - IsA( TYPE(SwCrsrShell) ); + BOOL bShowCrsr = pRegion && IsA( TYPE(SwCrsrShell) ); if( bShowCrsr ) ((SwCrsrShell*)this)->HideCrsrs(); - Scroll(); - if ( bPaintsFromSystem && Imp()->pScrolledArea ) - Imp()->FlushScrolledArea(); - if ( pRegion ) { SwRootFrm* pLayout = GetLayout(); @@ -408,14 +394,14 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd ) delete pVout; delete pRegion; - Imp()->DelRegions(); + Imp()->DelRegion(); } if( bShowCrsr ) ((SwCrsrShell*)this)->ShowCrsrs( TRUE ); } else { - Imp()->DelRegions(); + Imp()->DelRegion(); bPaintWorks = TRUE; } } @@ -435,13 +421,6 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd ) UISizeNotify(); ++nStartAction; -#ifdef DBG_UTIL - // test option 'No Scroll' suppresses the automatic repair of the scrolled area - if ( !GetViewOptions()->IsTest8() ) -#endif - if ( Imp()->IsScrolled() ) - Imp()->RestartScrollTimer(); - if( Imp()->IsAccessible() ) Imp()->FireAccessibleEvents(); } @@ -1196,12 +1175,10 @@ void ViewShell::VisPortChgd( const SwRect &rRect) //vom RootFrm::Paint erzeugt worden sein. if ( !bInEndAction && Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() ) - Imp()->DelRegions(); + Imp()->DelRegion(); SET_CURR_SHELL( this ); - //SwSaveHdl aSaveHdl( Imp() ); - bool bScrolled = false; SwPostItMgr* pPostItMgr = GetPostItMgr(); @@ -1331,9 +1308,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect) Imp()->GetDrawView()->VisAreaChanged( GetWin() ); Imp()->GetDrawView()->SetActualWin( GetWin() ); } - Imp()->bPaintInScroll = TRUE; GetWin()->Update(); - Imp()->bPaintInScroll = FALSE; if ( !bScrolled && pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ) pPostItMgr->CorrectPositions(); @@ -1833,9 +1808,8 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect ) //nicht ankommen. //Ergo: Alles selbst machen (siehe ImplEndAction()) if ( Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea()) - Imp()->DelRegions(); + Imp()->DelRegion(); - Imp()->ResetScroll(); SwLayAction aAction( GetLayout(), Imp() ); aAction.SetComplete( FALSE ); // We increment the action counter to avoid a recursive call of actions @@ -1861,7 +1835,7 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect ) } if ( bStop ) { - Imp()->DelRegions(); + Imp()->DelRegion(); pRegion = 0; } } @@ -1906,7 +1880,7 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect ) } else bRet = FALSE; - Imp()->DelRegions(); + Imp()->DelRegion(); } else bRet = FALSE; @@ -1957,17 +1931,7 @@ void ViewShell::Paint(const Rectangle &rRect) { if( GetWin() && GetWin()->IsVisible() ) { - //Wenn mit dem Paint ein Bereich betroffen ist, der vorher gescrolled - //wurde, so wiederholen wir das Paint mit dem Gesamtbereich. Nur so - //koennen wir sicherstellen, das (nicht mal kurzfristig) durch das Paint - //keine Alignmentfehler sichtbar werden. SwRect aRect( rRect ); - if ( Imp()->IsScrolled() && Imp()->FlushScrolledArea( aRect ) ) - { - GetWin()->Invalidate( aRect.SVRect() ); - return; - } - if ( bPaintInProgress ) //Schutz gegen doppelte Paints! { GetWin()->Invalidate( rRect ); @@ -2279,7 +2243,8 @@ void ViewShell::ApplyViewOptions( const SwViewOption &rOpt ) void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt ) { - ASSERT( !(*pOpt == rOpt), "ViewShell::ApplyViewOptions: "); + if (*pOpt == rOpt) + return; Window *pMyWin = GetWin(); if( !pMyWin ) diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 5b2898e577..c37036e42a 100644..100755 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -31,35 +31,27 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/view/XRenderable.hpp> #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 <sfx2/progress.hxx> #include <sfx2/app.hxx> +#include <sfx2/objsh.hxx> #include <sfx2/prnmon.hxx> +#include <svl/languageoptions.hxx> #include <editeng/paperinf.hxx> #include <editeng/pbinitem.hxx> #include <svx/svdview.hxx> +#include <toolkit/awt/vclxdevice.hxx> +#include <tools/debug.hxx> #include <unotools/localedatawrapper.hxx> - #include <unotools/moduleoptions.hxx> -#include <svl/languageoptions.hxx> - -#include <com/sun/star/uno/Any.hxx> -#include <com/sun/star/view/XRenderable.hpp> +#include <unotools/syslocale.hxx> +#include <vcl/oldprintadaptor.hxx> #include <unotxdoc.hxx> - #include <docsh.hxx> -#include <unotools/syslocale.hxx> #include <txtfld.hxx> #include <fmtfld.hxx> #include <fmtfsize.hxx> @@ -83,9 +75,7 @@ #include <pagedesc.hxx> #include <poolfmt.hxx> // fuer RES_POOLPAGE_JAKET #include <mdiexp.hxx> // Ansteuern der Statusleiste -#ifndef _STATSTR_HRC #include <statstr.hrc> // -- " -- -#endif #include <ptqueue.hxx> #include <tabfrm.hxx> #include <txtfrm.hxx> // MinPrtLine @@ -93,13 +83,6 @@ #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; @@ -210,500 +193,6 @@ void SwPaintQueue::Remove( ViewShell *pSh ) } } -/*****************************************************************************/ - -const XubString& SwPrtOptions::MakeNextJobName() -{ - static char __READONLY_DATA sDelim[] = " - "; - USHORT nDelim = sJobName.SearchAscii( sDelim ); - if( STRING_NOTFOUND == nDelim ) - sJobName.AppendAscii(sDelim); - else - sJobName.Erase( nDelim + 3/*Zeichen!*/ ); - - return sJobName += XubString::CreateFromInt32( ++nJobNo ); -} - -/*****************************************************************************/ - -SwRenderData::SwRenderData() -{ - m_pPostItFields = 0; - m_pPostItDoc = 0; - m_pPostItShell = 0; - - m_pViewOptionAdjust = 0; - m_pPrtOptions = 0; -} - - -SwRenderData::~SwRenderData() -{ - 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 ); -} - - -void SwRenderData::DeletePostItData() -{ - if (HasPostItData()) - { - 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; - } -} - - -void SwRenderData::ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions ) -{ - if (m_pViewOptionAdjust) - { - DBG_ASSERT( 0, "error: there should be no ViewOptionAdjust active when calling this function" ); - } - m_pViewOptionAdjust = new SwViewOptionAdjust_Impl( rSh, rViewOptions ); -} - - -void SwRenderData::ViewOptionAdjust( const SwPrtOptions *pPrtOptions ) -{ - m_pViewOptionAdjust->AdjustViewOptions( pPrtOptions ); -} - - -void SwRenderData::ViewOptionAdjustStop() -{ - if (m_pViewOptionAdjust) - { - delete m_pViewOptionAdjust; - m_pViewOptionAdjust = 0; - } -} - - -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 ) ); - - //! 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 ) -{ - ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) ); - - 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 ); - } - - // 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 ); - - // create sub section for Color - m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 12 ), rtl::OUString() ); - - // 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 (!bWeb) - { - // 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 ); - } - - // 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) - { - 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 - ); - } - - - DBG_ASSERT( nIdx == nNumProps, "number of added properties is not as expected" ); -} - - -SwPrintUIOptions::~SwPrintUIOptions() -{ -} - -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; -} - -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) - - 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; -} - -bool SwPrintUIOptions::IsPrintEmptyPages( bool bIsPDFExport ) const -{ - // take care of different property names for the option. - - bool bRes = bIsPDFExport ? - !getBoolValue( "IsSkipEmptyPages", sal_True ) : - getBoolValue( "PrintEmptyPages", sal_True ); - return bRes; -} - -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; -} - -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; -} - -bool SwPrintUIOptions::IsPrintDrawings() 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( "PrintDrawings", bRes ); - return bRes; -} - -bool SwPrintUIOptions::processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ) -{ - bool bChanged = processProperties( i_rNewProp ); - - uno::Reference< awt::XDevice > xRenderDevice; - uno::Any aVal( getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ) ) ); - aVal >>= xRenderDevice; - - OutputDevice* pOut = 0; - if (xRenderDevice.is()) - { - VCLXDevice* pDevice = VCLXDevice::GetImplementation( xRenderDevice ); - pOut = pDevice ? pDevice->GetOutputDevice() : 0; - } - bChanged = bChanged || (pOut != m_pLast); - if( pOut ) - m_pLast = pOut; - - return bChanged; -} - - /****************************************************************************** * Methode : void SetSwVisArea( ViewShell *pSh, Point aPrtOffset, ... * Beschreibung: @@ -847,33 +336,6 @@ void ViewShell::ChgAllPageSize( Size &rSz ) } -void lcl_SetState( SfxProgress& rProgress, ULONG nPage, ULONG nMax, - const XubString *pStr, ULONG nAct, ULONG nCnt, ULONG nOffs, ULONG nPageNo ) -{ - XubString aTmp = XubString::CreateFromInt64( nPageNo ); - if( pStr ) - { - aTmp += ' '; - aTmp += *pStr; - if( nCnt ) - { - nMax *= 2; - rProgress.SetStateText( (nAct-1)*nMax+nPage+nOffs, - aTmp, nCnt*nMax ); - } - else - rProgress.SetStateText( nPage, aTmp, nMax ); - } - else - { - aTmp += ' '; aTmp += '('; aTmp += XubString::CreateFromInt64( nPage ); - aTmp += '/'; aTmp += XubString::CreateFromInt64( nMax ); aTmp += ')'; - rProgress.SetStateText( nPage, aTmp, nMax ); - } -} - - - void ViewShell::CalcPagesForPrint( USHORT nMax ) { SET_CURR_SHELL( this ); @@ -1394,3 +856,4 @@ void ViewShell::PrepareForPrint( const SwPrintData &rOptions ) } } } + diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 500372ed66..b1e770edec 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -727,7 +727,7 @@ void SwHTMLParser::SetControlSize( const uno::Reference< drawing::XShape >& rSha bRemoveHidden = ( pHiddenItem == NULL || !pHiddenItem->GetValue() ); } - pTempViewFrame = SfxViewFrame::CreateViewFrame( *pDocSh, 0, sal_True ); + pTempViewFrame = SfxViewFrame::LoadHiddenDocument( *pDocSh, 0 ); CallStartAction(); pDoc->GetEditShell( &pVSh ); } diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 22f82236a4..707b62c2cf 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -806,7 +806,6 @@ IMAGE_SETEVENT: // gleich (synchron) angepasst wird (war bug #40983#) if( bRequestGrfNow ) { - pGrfNd->SetTransferPriority( SFX_TFPRIO_VISIBLE_LOWRES_GRAPHIC ); pGrfNd->SwapIn(); } diff --git a/sw/source/filter/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx index c5f40bd0a5..bf2b81e5b7 100644 --- a/sw/source/filter/rtf/wrtrtf.cxx +++ b/sw/source/filter/rtf/wrtrtf.cxx @@ -85,6 +85,7 @@ const sal_Char SwRTFWriter::sNewLine = '\012'; const sal_Char __FAR_DATA SwRTFWriter::sNewLine[] = "\015\012"; #endif +static ::rtl::OUString aEmpty; SV_DECL_VARARR( RTFColorTbl, Color, 5, 8 ) @@ -1299,8 +1300,16 @@ void SwRTFWriter::OutBookmarks( xub_StrLen nCntntPos) Strm() << '}'; } OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKEND ) << ' '; - RTFOutFuncs::Out_String( Strm(), pAsBookmark->GetName(), + + { + ::rtl::OUString & rBookmarkName = aEmpty; + + if (pAsBookmark) + rBookmarkName = pAsBookmark->GetName(); + + RTFOutFuncs::Out_String( Strm(), rBookmarkName, eDefaultEncoding, bWriteHelpFmt ) << '}'; + } if(++nBkmkTabPos >= pMarkAccess->getMarksCount()) nBkmkTabPos = -1; diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx index 7ccc875591..46aa1d0d71 100644 --- a/sw/source/filter/ww8/escher.hxx +++ b/sw/source/filter/ww8/escher.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -88,6 +88,20 @@ private: }; +class SwEscherExGlobal : public EscherExGlobal +{ +public: + explicit SwEscherExGlobal(); + virtual ~SwEscherExGlobal(); + +private: + /** Overloaded to create a new memory stream for picture data. */ + virtual SvStream* ImplQueryPictureStream(); + +private: + ::std::auto_ptr< SvStream > mxPicStrm; +}; + class SwBasicEscherEx : public EscherEx { private: @@ -95,7 +109,6 @@ private: protected: WW8Export& rWrt; SvStream* pEscherStrm; - SvStream* pPictStrm; long mnEmuMul, mnEmuDiv; virtual INT32 WriteFlyFrameAttr(const SwFrmFmt& rFmt, MSO_SPT eShapeType, @@ -112,13 +125,11 @@ protected: INT32 ToFract16(INT32 nVal, UINT32 nMax) const; - SvStream* QueryPicStream(); - virtual void SetPicId(const SdrObject &, UINT32, EscherPropertyContainer &); SdrLayerID GetInvisibleHellId() const; public: - SwBasicEscherEx(SvStream* pStrm, WW8Export& rWrt, UINT32 nDrawings = 1); + SwBasicEscherEx(SvStream* pStrm, WW8Export& rWrt); INT32 WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId); INT32 WriteOLEFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId); void WriteEmptyFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId); @@ -166,7 +177,7 @@ public: virtual void WriteFrmExtraData(const SwFrmFmt& rFmt); EscherExHostAppData* StartShape(const com::sun::star::uno::Reference< - com::sun::star::drawing::XShape > &) {return &aHostData;} + com::sun::star::drawing::XShape > &, const Rectangle*) {return &aHostData;} private: //No copying SwEscherEx(const SwEscherEx&); diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index b26494349a..6686ae5b13 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -1308,16 +1308,14 @@ void WW8Export::WriteEscher() void SwEscherEx::WritePictures() { - if (pPictStrm) + if( SvStream* pPicStrm = static_cast< SwEscherExGlobal& >( *mxGlobal ).GetPictureStream() ) { // set the blip - entries to the correct stream pos INT32 nEndPos = rWrt.Strm().Tell(); - SetNewBlipStreamOffset( nEndPos ); - - pPictStrm->Seek( 0 ); - rWrt.Strm() << *pPictStrm; + mxGlobal->SetNewBlipStreamOffset( nEndPos ); - delete pPictStrm, pPictStrm = 0; + pPicStrm->Seek( 0 ); + rWrt.Strm() << *pPicStrm; } Flush(); } @@ -1326,10 +1324,24 @@ void SwEscherEx::WritePictures() // Output- Routines for Escher Export -SwBasicEscherEx::SwBasicEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt, - UINT32 nDrawings) - : EscherEx(*pStrm, nDrawings), rWrt(rWW8Wrt), pEscherStrm(pStrm), - pPictStrm(0) +SwEscherExGlobal::SwEscherExGlobal() +{ +} + +SwEscherExGlobal::~SwEscherExGlobal() +{ +} + +SvStream* SwEscherExGlobal::ImplQueryPictureStream() +{ + // this function will be called exactly once + mxPicStrm.reset( new SvMemoryStream ); + mxPicStrm->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + return mxPicStrm.get(); +} + +SwBasicEscherEx::SwBasicEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) + : EscherEx( EscherExGlobalRef( new SwEscherExGlobal ), *pStrm), rWrt(rWW8Wrt), pEscherStrm(pStrm) { Init(); } @@ -1442,8 +1454,8 @@ INT32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId) Point aEmptyPoint = Point(); Rectangle aRect( aEmptyPoint, aSize ); - sal_uInt32 nBlibId = GetBlibID( *QueryPicStream(), aUniqueId, - aRect, NULL, 0 ); + sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(), + aUniqueId, aRect, NULL, 0 ); if (nBlibId) aPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True); } @@ -1651,8 +1663,8 @@ void SwBasicEscherEx::WriteBrushAttr(const SvxBrushItem &rBrush, Point aEmptyPoint = Point(); Rectangle aRect(aEmptyPoint, aSize); - sal_uInt32 nBlibId = GetBlibID(*QueryPicStream(), aUniqueId, - aRect, NULL, 0); + sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(), + aUniqueId, aRect, NULL, 0); if (nBlibId) rPropOpt.AddOpt(ESCHER_Prop_fillBlip,nBlibId,sal_True); } @@ -1894,16 +1906,6 @@ INT32 SwBasicEscherEx::ToFract16(INT32 nVal, UINT32 nMax) const return 0; } -SvStream* SwBasicEscherEx::QueryPicStream() -{ - if (!pPictStrm) - { - pPictStrm = new SvMemoryStream; - pPictStrm->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); - } - return pPictStrm; -} - SdrLayerID SwBasicEscherEx::GetInvisibleHellId() const { return rWrt.pDoc->GetInvisibleHellId(); @@ -1911,22 +1913,19 @@ SdrLayerID SwBasicEscherEx::GetInvisibleHellId() const void SwBasicEscherEx::WritePictures() { - ASSERT(pPictStrm, "no picture!"); - if (pPictStrm) + if( SvStream* pPicStrm = static_cast< SwEscherExGlobal& >( *mxGlobal ).GetPictureStream() ) { // set the blip - entries to the correct stream pos - INT32 nEndPos = pPictStrm->Tell(); - WriteBlibStoreEntry(*pEscherStrm, 1, sal_True, nEndPos); - - pPictStrm->Seek(0); - *pEscherStrm << *pPictStrm; + INT32 nEndPos = pPicStrm->Tell(); + mxGlobal->WriteBlibStoreEntry(*pEscherStrm, 1, sal_True, nEndPos); - delete pPictStrm, pPictStrm = 0; + pPicStrm->Seek(0); + *pEscherStrm << *pPicStrm; } } SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) - : SwBasicEscherEx(pStrm, rWW8Wrt, rWW8Wrt.pHFSdrObjs->size() ? 2 : 1), + : SwBasicEscherEx(pStrm, rWW8Wrt), pTxtBxs(0) { aHostData.SetClientData(&aWinwordAnchoring); @@ -1964,7 +1963,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) EnterGroup( 0 ); - ULONG nSecondShapeId = pSdrObjs == rWrt.pSdrObjs ? GetShapeID() : 0; + ULONG nSecondShapeId = pSdrObjs == rWrt.pSdrObjs ? GenerateShapeId() : 0; // write now all Writer-/DrawObjects DrawObjPointerVector aSorted; @@ -1990,7 +1989,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) nBorderThick = WriteFlyFrm(*pObj, nShapeId, aSorted); break; case sw::Frame::eFormControl: - WriteOCXControl(rFmt, nShapeId=GetShapeID()); + WriteOCXControl(rFmt, nShapeId = GenerateShapeId()); break; case sw::Frame::eDrawing: aWinwordAnchoring.SetAnchoring(rFmt); @@ -2560,10 +2559,10 @@ INT32 SwEscherEx::WriteFlyFrm(const DrawObj &rObj, UINT32 &rShapeId, switch( aIdx.GetNode().GetNodeType() ) { case ND_GRFNODE: - nBorderThick = WriteGrfFlyFrame( rFmt, rShapeId = GetShapeID() ); + nBorderThick = WriteGrfFlyFrame( rFmt, rShapeId = GenerateShapeId() ); break; case ND_OLENODE: - nBorderThick = WriteOLEFlyFrame( rFmt, rShapeId = GetShapeID() ); + nBorderThick = WriteOLEFlyFrame( rFmt, rShapeId = GenerateShapeId() ); break; default: if (const SdrObject* pObj = rFmt.FindRealSdrObject()) @@ -2702,7 +2701,8 @@ void SwBasicEscherEx::WriteOLEPicture(EscherPropertyContainer &rPropOpt, aRect.SetPos(Point(0,0)); aRect.Right() = DrawModelToEmu(aRect.Right()); aRect.Bottom() = DrawModelToEmu(aRect.Bottom()); - sal_uInt32 nBlibId = GetBlibID(*QueryPicStream(), aId, aRect, pVisArea, 0); // SJ: the fourth parameter (VisArea) should be set.. + sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(), + aId, aRect, pVisArea, 0); // SJ: the fourth parameter (VisArea) should be set.. if (nBlibId) rPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True); } @@ -2774,7 +2774,7 @@ void SwEscherEx::MakeZOrderArrAndFollowIds( bNeedsShapeId = true; } - ULONG nShapeId = bNeedsShapeId ? GetShapeID() : 0; + ULONG nShapeId = bNeedsShapeId ? GenerateShapeId() : 0; aFollowShpIds.Insert(nShapeId, n); } @@ -2789,12 +2789,12 @@ UINT32 SwEscherEx::GetFlyShapeId(const SwFrmFmt& rFmt, { if (0 == (nShapeId = aFollowShpIds[nPos])) { - nShapeId = GetShapeID(); + nShapeId = GenerateShapeId(); aFollowShpIds[ nPos ] = nShapeId; } } else - nShapeId = GetShapeID(); + nShapeId = GenerateShapeId(); return nShapeId; } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 2dd93088a7..96ae026c1d 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -103,12 +103,53 @@ #include <ndgrf.hxx> #include <ndole.hxx> + using namespace ::com::sun::star; using namespace ::com::sun::star::i18n; using namespace sw::util; using namespace sw::types; +using namespace sw::mark; using namespace nsFieldFlags; + +static String lcl_getFieldCode( const IFieldmark* pFieldmark ) { + ASSERT(pFieldmark!=NULL, "where is my fieldmark???"); + if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMTEXT ) ) { + return String::CreateFromAscii(" FORMTEXT "); + } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) ) { + return String::CreateFromAscii(" FORMDROPDOWN "); + } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) ) { + return String::CreateFromAscii(" FORMCHECKBOX "); + } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_TOC ) ) { + return String::CreateFromAscii(" TOC "); + } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_HYPERLINK ) ) { + return String::CreateFromAscii(" HYPERLINK "); + } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_PAGEREF ) ) { + return String::CreateFromAscii(" PAGEREF "); + } else { + return pFieldmark->GetFieldname(); + } +} + +ww::eField lcl_getFieldId( const IFieldmark* pFieldmark ) { + ASSERT(pFieldmark!=NULL, "where is my fieldmark???"); + if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMTEXT ) ) { + return ww::eFORMTEXT; + } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) ) { + return ww::eFORMDROPDOWN; + } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) ) { + return ww::eFORMCHECKBOX; + } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_TOC ) ) { + return ww::eTOC; + } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_HYPERLINK ) ) { + return ww::eHYPERLINK; + } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_PAGEREF ) ) { + return ww::ePAGEREF; + } else { + return ww::eUNKNOWN; + } +} + /* */ MSWordAttrIter::MSWordAttrIter( MSWordExportBase& rExport ) @@ -259,22 +300,40 @@ SwAttrIter::SwAttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) : nAktSwPos = SearchNext(1); } +xub_StrLen lcl_getMinPos( xub_StrLen pos1, xub_StrLen pos2 ) +{ + xub_StrLen min = STRING_NOTFOUND; + if ( pos1 == STRING_NOTFOUND && pos2 != STRING_NOTFOUND ) + min = pos2; + else if ( pos2 == STRING_NOTFOUND && pos1 != STRING_NOTFOUND ) + min = pos1; + else if ( pos2 != STRING_NOTFOUND && pos2 != STRING_NOTFOUND ) + { + if ( pos1 < pos2 ) + min = pos1; + else + min = pos2; + } + + return min; +} + xub_StrLen SwAttrIter::SearchNext( xub_StrLen nStartPos ) { xub_StrLen nPos; xub_StrLen nMinPos = STRING_MAXLEN; + xub_StrLen i=0; + const String aTxt = rNd.GetTxt(); - xub_StrLen pos = aTxt.Search(CH_TXT_ATR_FIELDSTART, nStartPos); - if( pos==STRING_NOTFOUND ) - { - pos = aTxt.Search(CH_TXT_ATR_FIELDEND, nStartPos); - if( pos==STRING_NOTFOUND ) - pos = aTxt.Search(CH_TXT_ATR_FORMELEMENT, nStartPos); - } - if( pos!=STRING_NOTFOUND ) - nMinPos=pos; + xub_StrLen fieldEndPos = aTxt.Search(CH_TXT_ATR_FIELDEND, nStartPos); + xub_StrLen fieldStartPos = aTxt.Search(CH_TXT_ATR_FIELDSTART, nStartPos); + xub_StrLen formElementPos = aTxt.Search(CH_TXT_ATR_FORMELEMENT, nStartPos); - xub_StrLen i=0; + xub_StrLen pos = lcl_getMinPos( fieldEndPos, fieldStartPos ); + pos = lcl_getMinPos( pos, formElementPos ); + + if (pos!=STRING_NOTFOUND) + nMinPos=pos; // first the redline, then the attributes if( pCurRedline ) @@ -1692,12 +1751,14 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition ); OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" ); - if ( pFieldmark ) - AppendBookmark( pFieldmark->GetName(), true ); - OutputField( NULL, ww::eFORMTEXT, String::CreateFromAscii( " FORMTEXT " ), WRITEFIELD_START | WRITEFIELD_CMD_START ); - if ( pFieldmark ) + if ( pFieldmark->GetFieldname().equalsAscii( ODF_FORMTEXT ) ) + AppendBookmark( pFieldmark->GetName(), false ); + OutputField( NULL, lcl_getFieldId( pFieldmark ), lcl_getFieldCode( pFieldmark ), WRITEFIELD_START | WRITEFIELD_CMD_START ); + if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMTEXT ) ) WriteFormData( *pFieldmark ); - OutputField( NULL, ww::eFORMTEXT, String(), WRITEFIELD_CMD_END ); + else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_HYPERLINK ) ) + WriteHyperlinkData( *pFieldmark ); + OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CMD_END ); } else if ( ch == CH_TXT_ATR_FIELDEND ) { @@ -1705,8 +1766,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition ); OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" ); - OutputField( NULL, ww::eFORMTEXT, String(), WRITEFIELD_CLOSE ); - if ( pFieldmark ) + OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CLOSE ); + if ( pFieldmark->GetFieldname().equalsAscii( ODF_FORMTEXT ) ) AppendBookmark( pFieldmark->GetName(), false ); } else if ( ch == CH_TXT_ATR_FORMELEMENT ) @@ -1715,13 +1776,18 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition ); OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" ); - if ( pFieldmark ) - AppendBookmark( pFieldmark->GetName(), true ); - OutputField( NULL, ww::eFORMCHECKBOX, String::CreateFromAscii( " FORMCHECKBOX " ), WRITEFIELD_START | WRITEFIELD_CMD_START ); - if ( pFieldmark ) + bool isDropdownOrCheckbox = pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) || + pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ); + + if ( isDropdownOrCheckbox ) + AppendBookmark( pFieldmark->GetName(), 0 ); + OutputField( NULL, lcl_getFieldId( pFieldmark ), + lcl_getFieldCode( pFieldmark ), + WRITEFIELD_START | WRITEFIELD_CMD_START ); + if ( isDropdownOrCheckbox ) WriteFormData( *pFieldmark ); - OutputField( NULL, ww::eFORMCHECKBOX, String(), WRITEFIELD_CMD_END | WRITEFIELD_CLOSE ); - if ( pFieldmark ) + OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CLOSE ); + if ( isDropdownOrCheckbox ) AppendBookmark( pFieldmark->GetName(), false ); } nLen -= static_cast< USHORT >( ofs ); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 004fe4826c..916ad970df 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -94,7 +94,7 @@ #include <fmtline.hxx> #include <fmtfsize.hxx> #include <comphelper/extract.hxx> - +#include <comphelper/stlunosequence.hxx> #include <writerfilter/doctok/sprmids.hxx> #include "writerhelper.hxx" @@ -102,6 +102,7 @@ #include "ww8attributeoutput.hxx" #include <IDocumentMarkAccess.hxx> +#include <xmloff/odffields.hxx> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> @@ -1604,7 +1605,7 @@ void SwWW8Writer::WriteString_xstz(SvStream& rStrm, const String& rStr, bool bAd ww::bytes aBytes; SwWW8Writer::InsUInt16(aBytes, rStr.Len()); SwWW8Writer::InsAsString16(aBytes, rStr); - if (bAddZero) + if (bAddZero) SwWW8Writer::InsUInt16(aBytes, 0); rStrm.Write(&aBytes[0], aBytes.size()); } @@ -1692,7 +1693,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, if( nStt || nLen != rStr.Len() ) { String sOut( rStr.Copy( nStt, nLen ) ); - + #ifdef DEBUG ::std::clog << ::rtl::OUStringToOString(sOut, RTL_TEXTENCODING_ASCII_US).getStr() << ::std::endl; #endif @@ -1702,7 +1703,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, else SwWW8Writer::WriteString8(Strm(), sOut, false, eChrSet); } - else + else { #ifdef DEBUG ::std::clog << ::rtl::OUStringToOString(rStr, RTL_TEXTENCODING_ASCII_US).getStr() << ::std::endl; @@ -1714,9 +1715,9 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, SwWW8Writer::WriteString8(Strm(), rStr, false, eChrSet); } } - + #ifdef DEBUG - ::std::clog << "</OutSwString>" << ::std::endl; + ::std::clog << "</OutSwString>" << ::std::endl; #endif } @@ -1726,7 +1727,7 @@ void WW8Export::WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo WriteChar('\007'); else WriteChar( '\015' ); - + pPiece->SetParaBreak(); } @@ -1858,12 +1859,12 @@ void WW8AttributeOutput::TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pT if ( nDepth > 0 ) { - /* Cell */ + /* Cell */ m_rWW8Export.InsUInt16( NS_sprm::LN_PFInTable ); m_rWW8Export.pO->Insert( (BYTE)0x1, m_rWW8Export.pO->Count() ); m_rWW8Export.InsUInt16( NS_sprm::LN_PTableDepth ); m_rWW8Export.InsUInt32( nDepth ); - + if ( nDepth > 1 && pTableTextNodeInfoInner->isEndOfCell() ) { m_rWW8Export.InsUInt16( NS_sprm::LN_PCell ); @@ -1943,15 +1944,15 @@ static sal_uInt16 lcl_TCFlags(const SwTableBox * pBox) void WW8AttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) { const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox(); - const SwTableLine * pTabLine = pTabBox->GetUpper(); + const SwTableLine * pTabLine = pTabBox->GetUpper(); const SwTableBoxes & rTblBoxes = pTabLine->GetTabBoxes(); - + sal_uInt8 nBoxes = rTblBoxes.Count(); for ( sal_uInt8 n = 0; n < nBoxes; n++ ) { const SwTableBox * pTabBox1 = rTblBoxes[n]; const SwFrmFmt * pFrmFmt = pTabBox1->GetFrmFmt(); - + if ( FRMDIR_VERT_TOP_RIGHT == m_rWW8Export.TrueFrameDirection( *pFrmFmt ) ) { m_rWW8Export.InsUInt16( NS_sprm::LN_TTextFlow ); @@ -1965,7 +1966,7 @@ void WW8AttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_ void WW8AttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) { const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox(); - const SwTableLine * pTabLine = pTabBox->GetUpper(); + const SwTableLine * pTabLine = pTabBox->GetUpper(); const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt(); /* @@ -1973,7 +1974,7 @@ void WW8AttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pT feature equivalent to this, Word stores 1 for fCantSplit if the row cannot be split, we set true if we can split it. An example is #i4569# */ - + const SwFmtRowSplit& rSplittable = pLineFmt->GetRowSplit(); BYTE nCantSplit = (!rSplittable.GetValue()) ? 1 : 0; if ( m_rWW8Export.bWrtWW8 ) @@ -1993,7 +1994,7 @@ void WW8AttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTable { const SwTable * pTable = pTableTextNodeInfoInner->getTable(); const SwFrmFmt * pFrmFmt = pTable->GetFrmFmt(); - + if ( m_rWW8Export.bWrtWW8 ) { if ( m_rWW8Export.TrueFrameDirection(*pFrmFmt) == FRMDIR_HORI_RIGHT_TOP ) @@ -2007,10 +2008,10 @@ void WW8AttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTable void WW8AttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) { const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox(); - const SwTableLine * pTabLine = pTabBox->GetUpper(); + const SwTableLine * pTabLine = pTabBox->GetUpper(); const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt(); -#if 0 +#if 0 const SwTable * pTable = pTableTextNodeInfo->getTable(); bool bNewTableModel = pTable->IsNewModel(); bool bFixRowHeight = false; @@ -2018,7 +2019,7 @@ void WW8AttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTab if (! bNewModel) { sal_uInt32 nBoxes = rTabBoxes.Count(); - + for (sal_uInt32 n = 0; n < nBoxes; n++) { SwTableBox * pBox1 = rTabBoxes[n]; @@ -2050,21 +2051,21 @@ void WW8AttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTab m_rWW8Export.pO->Insert( 189, m_rWW8Export.pO->Count() ); m_rWW8Export.InsUInt16( (USHORT)nHeight ); } - + } void WW8AttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) { const SwTable * pTable = pTableTextNodeInfoInner->getTable(); - + const SwFrmFmt *pFmt = pTable->GetFrmFmt(); ASSERT(pFmt,"Impossible"); if (!pFmt) return; - + const SwFmtHoriOrient &rHori = pFmt->GetHoriOrient(); const SwFmtVertOrient &rVert = pFmt->GetVertOrient(); - + if ( (text::RelOrientation::PRINT_AREA == rHori.GetRelationOrient() || text::RelOrientation::FRAME == rHori.GetRelationOrient()) @@ -2096,7 +2097,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t const SwTableLine * pTabLine = pTabBox->GetUpper(); const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes(); const SwTable * pTable = pTableTextNodeInfoInner->getTable(); - + if ( pTable->GetRowsToRepeat() > pTableTextNodeInfoInner->getRow() ) { if( m_rWW8Export.bWrtWW8 ) @@ -2110,7 +2111,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t sal_uInt32 nBoxes = rTabBoxes.Count(); if ( nBoxes > 32 ) nBoxes = 32; - + // sprm header m_rWW8Export.InsUInt16( NS_sprm::LN_TDefTable ); sal_uInt16 nSprmSize = 2 + (nBoxes + 1) * 2 + nBoxes * 20; @@ -2119,7 +2120,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t // number of boxes m_rWW8Export.pO->Insert( static_cast<BYTE>(nBoxes), m_rWW8Export.pO->Count() ); - /* cellxs */ + /* cellxs */ /* ALWAYS relative when text::HoriOrientation::NONE (nPageSize + ( nPageSize / 10 )) < nTblSz, in that case the cell width's and table width's are not real. The table @@ -2134,9 +2135,9 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t const SwFmtHoriOrient &rHori = pFmt->GetHoriOrient(); const SwFmtVertOrient &rVert = pFmt->GetVertOrient(); - + sal_uInt16 nTblOffset = 0; - + if ( (text::RelOrientation::PRINT_AREA == rHori.GetRelationOrient() || text::RelOrientation::FRAME == rHori.GetRelationOrient()) @@ -2159,36 +2160,36 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t break; } } - + sal_uInt32 n = 0; - m_rWW8Export.InsUInt16( nTblOffset ); - + m_rWW8Export.InsUInt16( nTblOffset ); + std::vector<SwTwips> gridCols = GetGridCols( pTableTextNodeInfoInner ); for ( std::vector<SwTwips>::const_iterator it = gridCols.begin(), end = gridCols.end(); it != end; ++it ) { m_rWW8Export.InsUInt16( static_cast<USHORT>( *it ) + nTblOffset ); } - + /* TCs */ for ( n = 0; n < nBoxes; n++ ) { #ifdef DEBUG sal_uInt16 npOCount = m_rWW8Export.pO->Count(); #endif - + SwTableBox * pTabBox1 = rTabBoxes[n]; const SwFrmFmt & rBoxFmt = *(pTabBox1->GetFrmFmt()); if ( m_rWW8Export.bWrtWW8 ) { - sal_uInt16 nFlags = lcl_TCFlags(pTabBox1); + sal_uInt16 nFlags = lcl_TCFlags(pTabBox1); m_rWW8Export.InsUInt16( nFlags ); } - + static BYTE aNullBytes[] = { 0x0, 0x0 }; - + m_rWW8Export.pO->Insert( aNullBytes, 2, m_rWW8Export.pO->Count() ); // dummy m_rWW8Export.Out_SwFmtTableBox( *m_rWW8Export.pO, rBoxFmt.GetBox() ); // 8/16 Byte - + #ifdef DEBUG ::std::clog << "<tclength>" << m_rWW8Export.pO->Count() - npOCount << "</tclength>" << ::std::endl; @@ -2204,7 +2205,7 @@ std::vector<SwTwips> AttributeOutputBase::GetGridCols( ww8::WW8TableNodeInfoInne const SwTableLine * pTabLine = pTabBox->GetUpper(); const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes(); const SwTable *pTable = pTableTextNodeInfoInner->getTable( ); - + // number of cell written sal_uInt32 nBoxes = rTabBoxes.Count(); if ( nBoxes > 32 ) @@ -2292,9 +2293,9 @@ void AttributeOutputBase::GetTablePageSize( ww8::WW8TableNodeInfoInner::Pointer_ const SvxLRSpaceItem &rLR = pFmt->GetLRSpace(); nPageSize -= (rLR.GetLeft() + rLR.GetRight()); } - + } - + ASSERT(nWidthPercent, "Impossible"); if (nWidthPercent) { @@ -2319,7 +2320,7 @@ void WW8AttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointe BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT }; - + for ( int i = 0; i < 4; ++i ) { SwWW8Writer::InsUInt16( *m_rWW8Export.pO, 0xD634 ); @@ -2328,7 +2329,7 @@ void WW8AttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointe m_rWW8Export.pO->Insert( BYTE(1), m_rWW8Export.pO->Count() ); m_rWW8Export.pO->Insert( BYTE(1 << i), m_rWW8Export.pO->Count() ); m_rWW8Export.pO->Insert( BYTE(3), m_rWW8Export.pO->Count() ); - + SwWW8Writer::InsUInt16( *m_rWW8Export.pO, pFrmFmt->GetBox().GetDistance( aBorders[i] ) ); } @@ -2346,17 +2347,17 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t else m_rWW8Export.pO->Insert( (BYTE)191, m_rWW8Export.pO->Count() ); m_rWW8Export.pO->Insert( (BYTE)(nBoxes * 2), m_rWW8Export.pO->Count() ); // Len - + for ( sal_uInt8 n = 0; n < nBoxes; n++ ) { const SwTableBox * pBox1 = rTabBoxes[n]; const SwFrmFmt * pFrmFmt = pBox1->GetFrmFmt(); const SfxPoolItem * pI = NULL; Color aColor; - + if ( SFX_ITEM_ON == pFrmFmt->GetAttrSet().GetItemState( RES_BACKGROUND, false, &pI ) ) { - aColor = dynamic_cast<const SvxBrushItem *>(pI)->GetColor(); + aColor = dynamic_cast<const SvxBrushItem *>(pI)->GetColor(); } else aColor = COL_AUTO; @@ -2372,41 +2373,41 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t sal_uInt8 nBoxes0 = rTabBoxes.Count(); if (nBoxes0 > 21) nBoxes0 = 21; - + for (sal_uInt32 m = 0; m < 2; m++) { m_rWW8Export.InsUInt16( aSprmIds[m] ); m_rWW8Export.pO->Insert( static_cast<BYTE>(nBoxes0 * 10), m_rWW8Export.pO->Count() ); - - for ( sal_uInt8 n = 0; n < nBoxes0; n++ ) - { - const SwTableBox * pBox1 = rTabBoxes[n]; - const SwFrmFmt * pFrmFmt = pBox1->GetFrmFmt(); - const SfxPoolItem * pI = NULL; - Color aColor; - + + for ( sal_uInt8 n = 0; n < nBoxes0; n++ ) + { + const SwTableBox * pBox1 = rTabBoxes[n]; + const SwFrmFmt * pFrmFmt = pBox1->GetFrmFmt(); + const SfxPoolItem * pI = NULL; + Color aColor; + if ( SFX_ITEM_ON == 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 ); + { + 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 ); + } + } } } @@ -2531,16 +2532,16 @@ void MSWordExportBase::WriteText() SwNode * pCurrentNode = &pCurPam->GetPoint()->nNode.GetNode(); const SwNode * pNextNode = mpTableInfo->getNextNode(pCurrentNode); - + if (pNextNode != NULL) pCurPam->GetPoint()->nNode = SwNodeIndex(*pNextNode); else pCurPam->GetPoint()->nNode++; - + ULONG nPos = pCurPam->GetPoint()->nNode.GetIndex(); ::SetProgressState( nPos, pCurPam->GetDoc()->GetDocShell() ); } - + #ifdef DEBUG ::std::clog << "</WriteText>" << ::std::endl; #endif @@ -2709,18 +2710,19 @@ void WW8Export::WriteFkpPlcUsw() if ( pSttbfAssoc ) // <-- { - ::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(); - aIt != aItEnd; aIt++) - { - String aStr(aIt->getStr()); - aStrings.push_back(aStr); - } + ::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(); + aIt != aItEnd; aIt++) + { + String aStr(aIt->getStr()); + aStrings.push_back(aStr); + } - WriteAsStringTable(aStrings, pFib->fcSttbfAssoc, - pFib->lcbSttbfAssoc); + WriteAsStringTable(aStrings, pFib->fcSttbfAssoc, + pFib->lcbSttbfAssoc); } } Strm().Seek( 0 ); @@ -2728,18 +2730,17 @@ void WW8Export::WriteFkpPlcUsw() // 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 ) // <-- { - pFib->fReadOnlyRecommended = - pFibData->getReadOnlyRecommended() ? 1 : 0; - pFib->fWriteReservation = - pFibData->getWriteReservation() ? 1 : 0; + pFib->fReadOnlyRecommended = + pFibData->getReadOnlyRecommended() ? 1 : 0; + pFib->fWriteReservation = + pFibData->getWriteReservation() ? 1 : 0; } pFib->Write( Strm() ); // FIB - } void WW8Export::StoreDoc1() @@ -2877,7 +2878,7 @@ namespace rCtx.Encode(in, nBS, in, nBS); rOut.Write(in, nBS); } - } + } } void MSWordExportBase::ExportDocument( bool bWriteAll ) @@ -3082,12 +3083,12 @@ void WW8Export::ExportDocument_Impl() StoreDoc1(); if ( bEncrypt ) - { + { // Generate random number with a seed of time as salt. TimeValue aTime; osl_getSystemTime( &aTime ); rtlRandomPool aRandomPool = rtl_random_createPool (); - rtl_random_addBytes ( aRandomPool, &aTime, 8 ); + rtl_random_addBytes ( aRandomPool, &aTime, 8 ); sal_uInt8 aDocId[ 16 ] = {0}; rtl_random_getBytes( aRandomPool, aDocId, 16 ); @@ -3107,11 +3108,11 @@ void WW8Export::ExportDocument_Impl() pDataStrmTemp = &xDataStrm; if ( pDataStrmTemp && pDataStrmTemp != pStrmTemp) - EncryptRC4(aCtx, *pDataStrm, *pDataStrmTemp); + EncryptRC4(aCtx, *pDataStrm, *pDataStrmTemp); EncryptRC4(aCtx, *pTableStrm, *pTableStrmTemp); - // Write Unencrypted Header 52 bytes to the start of the table stream + // Write Unencrypted Header 52 bytes to the start of the table stream // EncryptionVersionInfo (4 bytes): A Version structure where Version.vMajor MUST be 0x0001, and Version.vMinor MUST be 0x0001. pTableStrmTemp->Seek( 0 ); sal_uInt32 nEncType = 0x10001; @@ -3123,19 +3124,19 @@ void WW8Export::ExportDocument_Impl() pTableStrmTemp->Write( aDocId, 16 ); pTableStrmTemp->Write( pSaltData, 16 ); - pTableStrmTemp->Write( pSaltDigest, 16 ); + pTableStrmTemp->Write( pSaltDigest, 16 ); EncryptRC4(aCtx, GetWriter().Strm(), *pStrmTemp); - // Write Unencrypted Fib 68 bytes to the start of the workdocument stream + // Write Unencrypted Fib 68 bytes to the start of the workdocument stream pFib->fEncrypted = 1; // fEncrypted indicates the document is encrypted. pFib->fObfuscated = 0; // Must be 0 for RC4. pFib->nHash = 0x34; // encrypt header bytes count of table stream. pFib->nKey = 0; // lkey2 must be 0 for RC4. - pStrmTemp->Seek( 0 ); - pFib->WriteHeader( *pStrmTemp ); - } + pStrmTemp->Seek( 0 ); + pFib->WriteHeader( *pStrmTemp ); + } if (pUsedNumTbl) // all used NumRules { @@ -3329,7 +3330,7 @@ ULONG SwWW8Writer::Write( SwPaM& rPaM, SfxMedium& rMed, MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam ) : aMainStg(sMainStream), pISet(0), pUsedNumTbl(0), mpTopNodeOfHdFtPage(0), - pBmpPal(0), pKeyMap(0), pOLEExp(0), pOCXExp(0), pOleMap(0), + pBmpPal(0), pKeyMap(0), pOLEExp(0), pOCXExp(0), pOleMap(0), mpTableInfo(new ww8::WW8TableInfo()), nUniqueList(0), mnHdFtIndex(0), pAktPageDesc(0), pPapPlc(0), pChpPlc(0), pChpIter(0), pStyles( NULL ), @@ -3527,11 +3528,23 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) const ::sw::mark::IFieldmark* pFieldmark = &rFieldmark; const ::sw::mark::ICheckboxFieldmark* pAsCheckbox = dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( pFieldmark ); + + ASSERT(rFieldmark.GetFieldname().equalsAscii( ODF_FORMTEXT ) || rFieldmark.GetFieldname().equalsAscii( ODF_FORMDROPDOWN ) || rFieldmark.GetFieldname().equalsAscii( ODF_FORMCHECKBOX ), "Unknown field type!!!"); + if ( ! ( rFieldmark.GetFieldname().equalsAscii( ODF_FORMTEXT ) || + rFieldmark.GetFieldname().equalsAscii( ODF_FORMDROPDOWN ) || + rFieldmark.GetFieldname().equalsAscii( ODF_FORMCHECKBOX ) ) ) + return; + int type = 0; // TextFieldmark if ( pAsCheckbox ) type = 1; + if ( rFieldmark.GetFieldname().equalsAscii( ODF_FORMDROPDOWN ) ) + type=2; - const ::rtl::OUString ffname = rFieldmark.GetFieldname(); + ::sw::mark::IFieldmark::parameter_map_t::const_iterator pNameParameter = rFieldmark.GetParameters()->find(::rtl::OUString::createFromAscii("name")); + ::rtl::OUString ffname; + if(pNameParameter != rFieldmark.GetParameters()->end()) + pNameParameter->second >>= ffname; ULONG nDataStt = pDataStrm->Tell(); pChpPlc->AppendFkpEntry(Strm().Tell()); @@ -3553,15 +3566,37 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) sal_uInt8 aFldHeader[] = { 0xFF, 0xFF, 0xFF, 0xFF, // Unicode Marker... - 0, 0, 0, 0//, 0, 0, 0, 0 + 0, 0, 0, 0,// 0, 0, 0, 0 }; aFldHeader[4] |= (type & 0x03); - int ffres = 0; // rFieldmark.GetFFRes(); + sal_Int32 ffres = 0; // rFieldmark.GetFFRes(); if ( pAsCheckbox && pAsCheckbox->IsChecked() ) ffres = 1; + else if ( type == 2 ) + { + ::sw::mark::IFieldmark::parameter_map_t::const_iterator pResParameter = rFieldmark.GetParameters()->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN)); + if(pResParameter != rFieldmark.GetParameters()->end()) + pResParameter->second >>= ffres; + else + ffres = 0; + } aFldHeader[4] |= ( (ffres<<2) & 0x7C ); + std::vector< ::rtl::OUString > aListItems; + if (type==2) + { + aFldHeader[5] |= 0x80; // ffhaslistbox + const ::sw::mark::IFieldmark::parameter_map_t* const pParameters = rFieldmark.GetParameters(); + ::sw::mark::IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)); + if(pListEntries != pParameters->end()) + { + uno::Sequence< ::rtl::OUString > vListEntries; + pListEntries->second >>= vListEntries; + copy(::comphelper::stl_begin(vListEntries), ::comphelper::stl_end(vListEntries), back_inserter(aListItems)); + } + } + const ::rtl::OUString ffdeftext; const ::rtl::OUString ffformat; const ::rtl::OUString ffhelptext; @@ -3569,6 +3604,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) const ::rtl::OUString ffentrymcr; const ::rtl::OUString ffexitmcr; + const sal_uInt8 aFldData[] = { 0x44,0, // the start of "next" data @@ -3578,7 +3614,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // | /16 0,0,0,0, // / /4 }; - sal_uInt32 slen=sizeof(sal_uInt32) + sal_uInt32 slen = sizeof(sal_uInt32) + sizeof(aFldData) + sizeof( aFldHeader ) + 2*ffname.getLength() + 4 @@ -3588,6 +3624,15 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) + 2*ffstattext.getLength() + 4 + 2*ffentrymcr.getLength() + 4 + 2*ffexitmcr.getLength() + 4; + if ( type==2 ) { + slen += 2; // for 0xFF, 0xFF + slen += 4; // for num of list items + const int items = aListItems.size(); + for( int i = 0; i < items; i++ ) { + rtl::OUString item = aListItems[i]; + slen += 2 * item.getLength() + 2; + } + } *pDataStrm << slen; @@ -3597,6 +3642,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) len = sizeof( aFldHeader ); OSL_ENSURE( len == 8, "SwWW8Writer::WriteFormData(..) - wrong aFldHeader length" ); + pDataStrm->Write( aFldHeader, len ); SwWW8Writer::WriteString_xstz( *pDataStrm, ffname, true ); // Form field name @@ -3611,11 +3657,20 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) SwWW8Writer::WriteString_xstz( *pDataStrm, String( ffstattext ), true ); SwWW8Writer::WriteString_xstz( *pDataStrm, String( ffentrymcr ), true ); SwWW8Writer::WriteString_xstz( *pDataStrm, String( ffexitmcr ), true ); -// if (type==2) { -// // 0xFF, 0xFF -// // sal_uInt32 number of strings -// // (sal_uInt16 len; sal_uInt16 unicode char[len])*num of strings -// } + if (type==2) { + *pDataStrm<<(sal_uInt16)0xFFFF; + const int items=aListItems.size(); + *pDataStrm<<(sal_uInt32)items; + for(int i=0;i<items;i++) { + rtl::OUString item=aListItems[i]; + SwWW8Writer::WriteString_xstz( *pDataStrm, item, false ); + } + } +} + +void WW8Export::WriteHyperlinkData( const sw::mark::IFieldmark& /*rFieldmark*/ ) +{ + //@TODO implement me !!! } void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner ) @@ -3628,35 +3683,35 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer #endif m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); // leeren - + if (pNodeInfoInner->isEndOfCell()) { #ifdef DEBUG ::std::clog << "<endOfCell/>" << ::std::endl; #endif m_rWW8Export.WriteCR(pNodeInfoInner); - + m_rWW8Export.pO->Insert( (BYTE*)&nStyle, 2, m_rWW8Export.pO->Count() ); // Style # TableInfoCell(pNodeInfoInner); m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->Count(), m_rWW8Export.pO->GetData() ); - + m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); // leeren } - + if (pNodeInfoInner->isEndOfLine()) { #ifdef DEBUG ::std::clog << "<endOfLine/>" << ::std::endl; #endif TableRowEnd(pNodeInfoInner->getDepth()); - + ShortToSVBT16(0, nStyle); m_rWW8Export.pO->Insert( (BYTE*)&nStyle, 2, m_rWW8Export.pO->Count() ); // Style # TableInfoRow(pNodeInfoInner); m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->Count(), m_rWW8Export.pO->GetData() ); - + m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); // leeren } #ifdef DEBUG @@ -3671,15 +3726,15 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) #endif ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = mpTableInfo->getTableNodeInfo( &rNode ); - + if (pNodeInfo) - { + { if (pNodeInfo.get() != NULL) - { -#ifdef DEBUG + { +#ifdef DEBUG ::std::clog << pNodeInfo->toString() << ::std::endl; #endif - + const ww8::WW8TableNodeInfo::Inners_t aInners = pNodeInfo->getInners(); ww8::WW8TableNodeInfo::Inners_t::const_iterator aIt(aInners.begin()); ww8::WW8TableNodeInfo::Inners_t::const_iterator aEnd(aInners.end()); @@ -3689,7 +3744,7 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) AttrOutput().TableNodeInfoInner(pInner); aIt++; } - } + } } #ifdef DEBUG ::std::clog << "</OutWW8_SwEndNode>" << ::std::endl; diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 745b258fcc..e513db155d 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -706,6 +706,7 @@ public: /// Write the data of the form field virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) = 0; + virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark ) = 0; virtual void DoComboBox(const rtl::OUString &rName, const rtl::OUString &rHelp, @@ -1073,6 +1074,7 @@ public: /// Write the data of the form field virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ); + virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark ); /// Fields. WW8_WrPlcFld* CurrentFieldPlc() const; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 8af405bd2f..58257baebb 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1508,7 +1508,6 @@ WW8ReaderSave::WW8ReaderSave(SwWW8ImplReader* pRdr ,WW8_CP nStartCp) : maOldApos.push_back(false); maOldApos.swap(pRdr->maApos); maOldFieldStack.swap(pRdr->maFieldStack); - maFieldCtxStack.swap(pRdr->maNewFieldCtxStack); } void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr ) @@ -1555,7 +1554,6 @@ void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr ) pRdr->pPlcxMan->RestoreAllPLCFx(maPLCFxSave); pRdr->maApos.swap(maOldApos); pRdr->maFieldStack.swap(maOldFieldStack); - pRdr->maNewFieldCtxStack.swap(maFieldCtxStack); } void SwWW8ImplReader::Read_HdFtFtnText( const SwNodeIndex* pSttIdx, @@ -2673,29 +2671,6 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) case 0x15: if( !bSpec ) // Juristenparagraph cInsert = '\xa7'; - else - { - // 0x15 is special --> so it's our field end mark...; - // hmmm what about field marks not handled by us??, maybe a problem with nested fields; - // probably an area of bugs... [well release quick and release often....] - if (!maNewFieldCtxStack.empty() && pPaM!=NULL && pPaM->GetPoint()!=NULL) - { - ::boost::scoped_ptr<WW8NewFieldCtx> pFieldCtx(maNewFieldCtxStack.back()); - maNewFieldCtxStack.pop_back(); - SwPosition aEndPos = *pPaM->GetPoint(); - SwPaM aFldPam(pFieldCtx->GetPtNode(), pFieldCtx->GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex()); - IDocumentMarkAccess* const pMarkAccess = rDoc.getIDocumentMarkAccess(); - ::sw::mark::IFieldmark* pFieldmark = - dynamic_cast< ::sw::mark::IFieldmark*>(pMarkAccess->makeMark( - aFldPam, - pFieldCtx->GetBookmarkName(), - IDocumentMarkAccess::TEXT_FIELDMARK)); - OSL_ENSURE(pFieldmark!=NULL, - "hmmm; why was the bookmark not created?"); - if (pFieldmark) - pFieldCtx->SetCurrentFieldParamsTo(pFieldmark); - } - } break; case 0x9: cInsert = '\x9'; // Tab @@ -3507,7 +3482,14 @@ void wwSectionManager::InsertSegments() bool bInsertSection = (aIter != aStart) ? (aIter->IsContinous() && bThisAndPreviousAreCompatible): false; bool bInsertPageDesc = !bInsertSection; - bool bProtected = !bUseEnhFields && SectionIsProtected(*aIter); // do we really need this ?? I guess I have a different logic in editshell which disales this... + bool bProtected = SectionIsProtected(*aIter); // do we really need this ?? I guess I have a different logic in editshell which disales this... + if (bUseEnhFields && mrReader.pWDop->fProtEnabled && aIter->IsNotProtected()) { + // here we have the special case that the whole document is protected, with the execption of this section. + // I want to address this when I do the section rework, so for the moment we disable the overall protection then... + mrReader.rDoc.set(IDocumentSettingAccess::PROTECT_FORM, false ); + } + + if (bInsertPageDesc) { /* diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index fd025fe4a3..56555bdb2f 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -57,6 +57,8 @@ #include "ww8glsy.hxx" #include "wrtww8.hxx" #include "../inc/msfilter.hxx" +#include <xmloff/odffields.hxx> +#include <IMark.hxx> class SwDoc; class SwPaM; @@ -359,43 +361,35 @@ namespace sw Position(const SwPosition &rPos); Position(const Position &rPos); operator SwPosition() const; + SwNodeIndex GetPtNode() { return maPtNode; }; + xub_StrLen GetPtCntnt() { return mnPtCntnt; }; }; } } class FieldEntry { -public: - sw::hack::Position maStartPos; - sal_uInt16 mnFieldId; - FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw(); - FieldEntry(const FieldEntry &rOther) throw(); - FieldEntry &operator=(const FieldEntry &rOther) throw(); - void Swap(FieldEntry &rOther) throw(); -}; - -class WW8NewFieldCtx -{ -private: - SwNodeIndex maPtNode; - xub_StrLen mnPtCntnt; - ::rtl::OUString msBookmarkName; - ::rtl::OUString msMarkType; - typedef ::std::pair< ::rtl::OUString, ::rtl::OUString> Param_t; - typedef ::std::vector< Param_t > Params_t; - Params_t maParams; - SwPaM * mpPaM; - -public: - WW8NewFieldCtx(SwPosition &aStartPos, ::rtl::OUString sBookmarkName, ::rtl::OUString sMarkType); - ~WW8NewFieldCtx(); - - SwNodeIndex GetPtNode() { return maPtNode; }; - xub_StrLen GetPtCntnt() { return mnPtCntnt; }; - ::rtl::OUString GetBookmarkName(); - ::rtl::OUString GetMarkType(); - void AddParam(::rtl::OUString name, ::rtl::OUString value); - void SetCurrentFieldParamsTo(::sw::mark::IFieldmark* pFieldmark); + private: + ::rtl::OUString msBookmarkName; + ::rtl::OUString msMarkType; + ::sw::mark::IFieldmark::parameter_map_t maParams; + + public: + sw::hack::Position maStartPos; + sal_uInt16 mnFieldId; + FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw(); + FieldEntry(const FieldEntry &rOther) throw(); + FieldEntry &operator=(const FieldEntry &rOther) throw(); + void Swap(FieldEntry &rOther) throw(); + + SwNodeIndex GetPtNode() { return maStartPos.GetPtNode(); }; + xub_StrLen GetPtCntnt() { return maStartPos.GetPtCntnt(); }; + + ::rtl::OUString GetBookmarkName(); + ::rtl::OUString GetBookmarkType(); + void SetBookmarkName(::rtl::OUString bookmarkName); + void SetBookmarkType(::rtl::OUString bookmarkType); + ::sw::mark::IFieldmark::parameter_map_t& getParameters(); }; @@ -431,7 +425,6 @@ private: bool mbWasParaEnd; bool mbHasBorder; bool mbFirstPara; - std::deque<WW8NewFieldCtx *> maFieldCtxStack; public: WW8ReaderSave(SwWW8ImplReader* pRdr, WW8_CP nStart=-1); void Restore(SwWW8ImplReader* pRdr); @@ -886,9 +879,6 @@ private: std::deque<FieldEntry> maFieldStack; typedef std::deque<FieldEntry>::const_iterator mycFieldIter; - typedef std::deque<WW8NewFieldCtx *> WW8NewFieldCtxStack_t; - WW8NewFieldCtxStack_t maNewFieldCtxStack; - /* A stack of open footnotes. Should only be one in it at any time. */ diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 61d2ea7348..fafaa10fe9 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -58,6 +58,7 @@ #include <com/sun/star/text/VertOrientation.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> #include <comphelper/extract.hxx> +#include <comphelper/stlunosequence.hxx> #include <com/sun/star/beans/XPropertyContainer.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -93,66 +94,15 @@ #include <IMark.hxx> #include <unotools/fltrcfg.hxx> +#include <xmloff/odffields.hxx> #include <stdio.h> +#include <algorithm> using namespace com::sun::star; using namespace sw::util; using namespace sw::types; - -WW8NewFieldCtx::WW8NewFieldCtx(SwPosition &aStartPos, ::rtl::OUString sBookmarkName, ::rtl::OUString sMarkType) - : maPtNode(aStartPos.nNode) - , mnPtCntnt(aStartPos.nContent.GetIndex()) - , msBookmarkName(sBookmarkName) - , msMarkType(sMarkType) - , mpPaM(NULL) -{ -} - - -WW8NewFieldCtx::~WW8NewFieldCtx() -{ - if (mpPaM) delete mpPaM; -} - -::rtl::OUString WW8NewFieldCtx::GetBookmarkName() -{ - return msBookmarkName; -} - -::rtl::OUString WW8NewFieldCtx::GetMarkType() -{ - return msMarkType; -} - -void WW8NewFieldCtx::AddParam(::rtl::OUString name, ::rtl::OUString value) -{ - maParams.push_back( Param_t(name, value) ); -} - -void WW8NewFieldCtx::SetCurrentFieldParamsTo(::sw::mark::IFieldmark* pFieldmark) -{ - for(Params_t::iterator i=maParams.begin();i!=maParams.end();i++) - { - ::rtl::OUString aName=i->first; - ::rtl::OUString aValue=i->second; - if(aName.compareToAscii("Description")==0) - { - pFieldmark->SetFieldHelptext(aValue); - } - else if(aName.compareToAscii("Name")==0) - { - pFieldmark->SetFieldname(aValue); - } - else if(aName.compareToAscii("Result")==0) - { - ::sw::mark::ICheckboxFieldmark* pAsCheckbox = - dynamic_cast< ::sw::mark::ICheckboxFieldmark* >(pFieldmark); - if(pAsCheckbox) - pAsCheckbox->SetChecked(aValue.toInt32()==0); - } - } -} +using namespace sw::mark; //----------------------------------------- // UNO-Controls @@ -230,10 +180,10 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, String& rStr ) if (aBookmarkName.Len()>0) { - WW8NewFieldCtx *pFieldCtx=new WW8NewFieldCtx(*pPaM->GetPoint(), aBookmarkName, ::rtl::OUString::createFromAscii("ecma.office-open-xml.field.FORMTEXT")); - maNewFieldCtxStack.push_back(pFieldCtx); - pFieldCtx->AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip); - pFieldCtx->AddParam(::rtl::OUString::createFromAscii("Name"), aFormula.sTitle); + maFieldStack.back().SetBookmarkName(aBookmarkName); + maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ODF_FORMTEXT)); + maFieldStack.back().getParameters()[::rtl::OUString::createFromAscii("Description")] = uno::makeAny(::rtl::OUString(aFormula.sToolTip)); + maFieldStack.back().getParameters()[::rtl::OUString::createFromAscii("Name")] = uno::makeAny(::rtl::OUString(aFormula.sTitle)); } return FLD_TEXT; } @@ -276,19 +226,20 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr ) aBookmarkName=pB->GetUniqueBookmarkName(aFormula.sTitle); } - if (aBookmarkName.Len()>0) { - ::sw::mark::ICheckboxFieldmark* pFieldmark = - dynamic_cast< ::sw::mark::ICheckboxFieldmark*>(rDoc.getIDocumentMarkAccess()->makeMark( - *pPaM, - aBookmarkName, - IDocumentMarkAccess::CHECKBOX_FIELDMARK)); - OSL_ENSURE(pFieldmark, - "hmmm; why was the bookmark not created?"); - if(pFieldmark) - { - pFieldmark->SetFieldname(aFormula.sTitle); - pFieldmark->SetFieldHelptext(aFormula.sToolTip); - pFieldmark->SetChecked(aFormula.nChecked!=0); + if (aBookmarkName.Len()>0) + { + IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( ); + IFieldmark* pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeNoTextFieldBookmark( + *pPaM, aBookmarkName, + rtl::OUString::createFromAscii( ODF_FORMCHECKBOX ) ) ); + ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); + if (pFieldmark!=NULL) { + IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters(); + ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(pFieldmark); + (*pParameters)[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_NAME)] = uno::makeAny(::rtl::OUString(aFormula.sTitle)); + (*pParameters)[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_HELPTEXT)] = uno::makeAny(::rtl::OUString(aFormula.sToolTip)); + if(pCheckboxFm) + pCheckboxFm->SetChecked(aFormula.nChecked); // set field data here... } } @@ -303,24 +254,71 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, String& rStr) if (0x01 == rStr.GetChar(writer_cast<xub_StrLen>(pF->nLCode-1))) ImportFormulaControl(aFormula,pF->nSCode+pF->nLCode-1, WW8_CT_DROPDOWN); - SwDropDownField aFld( - (SwDropDownFieldType*)rDoc.GetSysFldType(RES_DROPDOWN)); - - aFld.SetName(aFormula.sTitle); - aFld.SetHelp(aFormula.sHelp); - aFld.SetToolTip(aFormula.sToolTip); + const SvtFilterOptions* pOpt = SvtFilterOptions::Get(); + sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields()); - if (!aFormula.maListEntries.empty()) + if (!bUseEnhFields) { - aFld.SetItems(aFormula.maListEntries); - int nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size() - ? aFormula.fDropdownIndex : 0; - aFld.SetSelectedItem(aFormula.maListEntries[nIndex]); + SwDropDownField aFld((SwDropDownFieldType*)rDoc.GetSysFldType(RES_DROPDOWN)); + + aFld.SetName(aFormula.sTitle); + aFld.SetHelp(aFormula.sHelp); + aFld.SetToolTip(aFormula.sToolTip); + + if (!aFormula.maListEntries.empty()) + { + aFld.SetItems(aFormula.maListEntries); + int nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size() ? aFormula.fDropdownIndex : 0; + aFld.SetSelectedItem(aFormula.maListEntries[nIndex]); + } + + rDoc.InsertPoolItem(*pPaM, SwFmtFld(aFld), 0); + return FLD_OK; } + else + { + // TODO: review me + String aBookmarkName; + WW8PLCFx_Book* pB = pPlcxMan->GetBook(); + if (pB!=NULL) + { + WW8_CP currentCP=pF->nSCode; + WW8_CP currentLen=pF->nLen; - rDoc.InsertPoolItem(*pPaM, SwFmtFld(aFld), 0); + USHORT bkmFindIdx; + String aBookmarkFind=pB->GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx); - return FLD_OK; + if (aBookmarkFind.Len()>0) + { + pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark as consumed by field + if (aBookmarkFind.Len()>0) + aBookmarkName=aBookmarkFind; + } + } + + if (pB!=NULL && aBookmarkName.Len()==0) + aBookmarkName=pB->GetUniqueBookmarkName(aFormula.sTitle); + + if (aBookmarkName.Len()>0) + { + IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( ); + IFieldmark *pFieldmark = dynamic_cast<IFieldmark*>( + pMarksAccess->makeNoTextFieldBookmark( *pPaM, aBookmarkName, + ::rtl::OUString::createFromAscii( ODF_FORMDROPDOWN ) ) ); + ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); + if ( pFieldmark != NULL ) + { + uno::Sequence< ::rtl::OUString > vListEntries(aFormula.maListEntries.size()); + ::std::copy(aFormula.maListEntries.begin(), aFormula.maListEntries.end(), ::comphelper::stl_begin(vListEntries)); + (*pFieldmark->GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)] = uno::makeAny(vListEntries); + sal_Int32 nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size() ? aFormula.fDropdownIndex : 0; + (*pFieldmark->GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT)] = uno::makeAny(nIndex); + // set field data here... + } + } + + return FLD_OK; + } } void SwWW8ImplReader::DeleteFormImpl() @@ -2137,11 +2135,6 @@ bool SwWW8ImplReader::ImportFormulaControl(WW8FormulaControl &aFormula, if((aPic.lcb > 0x3A) && !pDataStream->GetError() ) { - pDataStream->Seek( nPicLocFc + aPic.cbHeader ); - int len=aPic.lcb-aPic.cbHeader; - char *pBuf=(char*)malloc(len); - pDataStream->Read( pBuf, len); - pDataStream->Seek( nPicLocFc + aPic.cbHeader ); aFormula.FormulaRead(nWhich,pDataStream); bRet = true; } diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index bcfc56b1d7..692e1df591 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -79,22 +79,26 @@ #include <fmtclds.hxx> #include <pagedesc.hxx> #include <SwStyleNameMapper.hxx> - +#include <IMark.hxx> #include "ww8scan.hxx" // WW8FieldDesc #include "ww8par.hxx" #include "ww8par2.hxx" #include "writerhelper.hxx" #include "fields.hxx" +#include <unotools/fltrcfg.hxx> #include <algorithm> // #i24377# +//#define WW_NATIVE_TOC 0 + #define MAX_FIELDLEN 64000 #define WW8_TOX_LEVEL_DELIM ':' using namespace ::com::sun::star; using namespace sw::util; +using namespace sw::mark; using namespace std; // #i24377# using namespace nsSwDocInfoSubType; @@ -319,9 +323,11 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*) //"_Toc*" and "_Hlt*" are unnecessary const String* pName = pB->GetName(); +#if !defined(WW_NATIVE_TOC) if( !pName || pName->EqualsIgnoreCaseAscii( "_Toc", 0, 4 ) || pName->EqualsIgnoreCaseAscii( "_Hlt", 0, 4 ) ) return 0; +#endif //JP 16.11.98: ToUpper darf auf keinen Fall gemacht werden, weil der //Bookmark- name ein Hyperlink-Ziel sein kann! @@ -663,6 +669,9 @@ sal_uInt16 SwWW8ImplReader::End_Field() if (!pF || !pF->EndPosIsFieldEnd()) return nRet; + const SvtFilterOptions* pOpt = SvtFilterOptions::Get(); + sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields()); + ASSERT(!maFieldStack.empty(), "Empty field stack\n"); if (!maFieldStack.empty()) { @@ -674,9 +683,42 @@ sal_uInt16 SwWW8ImplReader::End_Field() nRet = maFieldStack.back().mnFieldId; switch (nRet) { + case 70: + if (bUseEnhFields && pPaM!=NULL && pPaM->GetPoint()!=NULL) { + SwPosition aEndPos = *pPaM->GetPoint(); + SwPaM aFldPam( maFieldStack.back().GetPtNode(), maFieldStack.back().GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex()); + IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( ); + IFieldmark *pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeFieldBookmark( + aFldPam, maFieldStack.back().GetBookmarkName(), ::rtl::OUString::createFromAscii(ODF_FORMTEXT ) ) ); + ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); + if (pFieldmark!=NULL) { + const IFieldmark::parameter_map_t& pParametersToAdd = maFieldStack.back().getParameters(); + pFieldmark->GetParameters()->insert(pParametersToAdd.begin(), pParametersToAdd.end()); + } + } + break; +#if defined(WW_NATIVE_TOC) + case 8: // TOX_INDEX + case 13: // TOX_CONTENT + case 88: // HYPERLINK + case 37: // REF + if (pPaM!=NULL && pPaM->GetPoint()!=NULL) { + + SwPosition aEndPos = *pPaM->GetPoint(); + SwPaM aFldPam( maFieldStack.back().GetPtNode(), maFieldStack.back().GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex()); + SwFieldBookmark *pFieldmark=(SwFieldBookmark*)rDoc.makeFieldBookmark(aFldPam, maFieldStack.back().GetBookmarkName(), maFieldStack.back().GetBookmarkType()); + ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); + if (pFieldmark!=NULL) { + const IFieldmark::parameter_map_t& pParametersToAdd = maFieldStack.back().getParameters(); + pFieldmark->GetParameters()->insert(pParameters.begin(), pParameters.end()); + } + } + break; +#else case 88: pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT); break; +#endif case 36: case 68: //Move outside the section associated with this type of field @@ -694,6 +736,10 @@ bool AcceptableNestedField(sal_uInt16 nFieldCode) { switch (nFieldCode) { +#if defined(WW_NATIVE_TOC) + case 8: // allow recursive field in TOC... + case 13: // allow recursive field in TOC... +#endif case 36: case 68: case 79: @@ -732,6 +778,32 @@ FieldEntry &FieldEntry::operator=(const FieldEntry &rOther) throw() return *this; } +::rtl::OUString FieldEntry::GetBookmarkName() +{ + return msBookmarkName; +} + +::rtl::OUString FieldEntry::GetBookmarkType() +{ + return msMarkType; +} + +void FieldEntry::SetBookmarkName(::rtl::OUString bookmarkName) +{ + msBookmarkName=bookmarkName; +} + +void FieldEntry::SetBookmarkType(::rtl::OUString bookmarkType) +{ + msMarkType=bookmarkType; +} + + +::sw::mark::IFieldmark::parameter_map_t& FieldEntry::getParameters() { + return maParams; +} + + // Read_Field liest ein Feld ein oder, wenn es nicht gelesen werden kann, // wird 0 zurueckgegeben, so dass das Feld vom Aufrufer textuell gelesen wird. // Returnwert: Gesamtlaenge des Feldes ( zum UEberlesen ) @@ -2061,6 +2133,17 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, String& rStr ) String sName(GetMappedBookmark(sOrigName)); +#if defined(WW_NATIVE_TOC) + if (1) { + ::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_REF"); + maFieldStack.back().SetBookmarkName(aBookmarkName); + maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ODF_PAGEREF)); + maFieldStack.back().AddParam(rtl::OUString(), sName); + return FLD_TEXT; + } +#endif + + SwGetRefField aFld( (SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ), sName, REF_BOOKMARK, 0, REF_PAGE ); @@ -2614,8 +2697,8 @@ bool SwWW8ImplReader::AddExtraOutlinesAsExtraStyles(SwTOXBase& rBase) sal_uInt16 nStyleLevel = rSI.nOutlineLevel; sal_uInt16 nMaxLevel = rBase.GetLevel(); if ( - //nStyleLevel != pFmt->GetOutlineLevel() && //#outline level,zhaojianwei - nStyleLevel != (pFmt->GetAttrOutlineLevel()-1) && //<-end,zhaojianwei + //nStyleLevel != pFmt->GetOutlineLevel() && //#outline level,zhaojianwei + nStyleLevel != (pFmt->GetAttrOutlineLevel()-1) && //<-end,zhaojianwei nStyleLevel < nMaxLevel ) { @@ -2761,6 +2844,16 @@ USHORT lcl_GetMaxValidWordTOCLevel(const SwForm &rForm) eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr ) { +#if defined(WW_NATIVE_TOC) + if (1) { + ::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_TOC"); + maFieldStack.back().SetBookmarkName(aBookmarkName); + maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ODF_TOC)); +// maFieldStack.back().AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip); + return FLD_TEXT; + } +#endif + if (pF->nLRes < 3) return FLD_TEXT; // ignore (#i25440#) @@ -3279,6 +3372,16 @@ eF_ResT SwWW8ImplReader::Read_F_Shape(WW8FieldDesc* /*pF*/, String& /*rStr*/) eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr ) { +#if defined(WW_NATIVE_TOC) + if (1) { + ::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_HYPERLINK"); + maFieldStack.back().SetBookmarkName(aBookmarkName); + maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ODF_HYPERLINK)); +// maFieldStack.back().AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip); + return FLD_TEXT; + } +#endif + String sURL, sTarget, sMark; bool bDataImport = false; //HYPERLINk "filename" [switches] diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx index 4d7c8bf124..3896cbbe0d 100644 --- a/sw/source/ui/app/appenv.cxx +++ b/sw/source/ui/app/appenv.cxx @@ -191,7 +191,7 @@ static USHORT nTitleNo = 0; // Neues Dokument erzeugen (kein Show!) SfxObjectShellRef xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD ) ); xDocSh->DoInitNew( 0 ); - pFrame = SfxViewFrame::CreateViewFrame( *xDocSh, 0, TRUE ); + pFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 ); pNewView = (SwView*) pFrame->GetViewShell(); pNewView->AttrChangedNotify( &pNewView->GetWrtShell() );//Damit SelectShell gerufen wird. pSh = pNewView->GetWrtShellPtr(); @@ -501,7 +501,7 @@ static USHORT nTitleNo = 0; if (nMode == ENV_NEWDOC) { - pFrame->GetFrame()->Appear(); + pFrame->GetFrame().Appear(); if ( rItem.aAddrText.indexOf('<') >= 0 ) { diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index f88e6dd0be..708d6ceed3 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -240,7 +240,7 @@ SwView* lcl_LoadDoc(SwView* pView, const String& rURL) if( pViewShell->ISA(SwView) ) { pNewView = PTR_CAST(SwView,pViewShell); - pNewView->GetViewFrame()->GetFrame()->Appear(); + pNewView->GetViewFrame()->GetFrame().Appear(); } else { @@ -474,7 +474,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM { SwView* pTargetView = m_pMMConfig->GetTargetView(); uno::Reference< frame::XFrame > xFrame = - m_pView->GetViewFrame()->GetFrame()->GetFrameInterface(); + m_pView->GetViewFrame()->GetFrame().GetFrameInterface(); xFrame->getContainerWindow()->setVisible(sal_False); DBG_ASSERT(pTargetView, "No target view has been created"); if(pTargetView) @@ -520,7 +520,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM { m_pView2Close = pTargetView; pTargetView->GetViewFrame()->GetTopViewFrame()->GetWindow().Hide(); - pSourceView->GetViewFrame()->GetFrame()->AppearWithUpdate(); + pSourceView->GetViewFrame()->GetFrame().AppearWithUpdate(); // the current view has be be set when the target is destroyed m_pView = pSourceView; m_pMMConfig->SetTargetView(0); @@ -559,7 +559,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM if(pDocShell->HasName() && !pDocShell->IsModified()) m_pMMConfig->GetSourceView()->GetViewFrame()->DoClose(); else - m_pMMConfig->GetSourceView()->GetViewFrame()->GetFrame()->Appear(); + m_pMMConfig->GetSourceView()->GetViewFrame()->GetFrame().Appear(); } ExecutionFinished( true ); break; @@ -593,7 +593,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, CancelHdl, AbstractMailMergeWizard*, EMPTY m_pMMConfig->SetTargetView(0); } if(m_pMMConfig->GetSourceView()) - m_pMMConfig->GetSourceView()->GetViewFrame()->GetFrame()->AppearWithUpdate(); + m_pMMConfig->GetSourceView()->GetViewFrame()->GetFrame().AppearWithUpdate(); m_pMMConfig->Commit(); delete m_pMMConfig; @@ -959,21 +959,8 @@ void NewXForms( SfxRequest& rReq ) // initialize XForms static_cast<SwDocShell*>( &xDocSh )->GetDoc()->initXForms( true ); - // put document into frame - const SfxItemSet* pArgs = rReq.GetArgs(); - DBG_ASSERT( pArgs, "no arguments in SfxRequest"); - if( pArgs != NULL ) - { - const SfxPoolItem* pFrameItem = NULL; - pArgs->GetItemState( SID_DOCFRAME, FALSE, &pFrameItem ); - if( pFrameItem != NULL ) - { - SfxFrame* pFrame = - static_cast<const SfxFrameItem*>( pFrameItem )->GetFrame(); - DBG_ASSERT( pFrame != NULL, "no frame?" ); - pFrame->InsertDocument( xDocSh ); - } - } + // load document into frame + SfxViewFrame::DisplayNewDocument( *xDocSh, rReq ); // set return value rReq.SetReturnValue( SfxVoidItem( rReq.GetSlot() ) ); diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx index c160496ad4..e597547d89 100644 --- a/sw/source/ui/app/applab.cxx +++ b/sw/source/ui/app/applab.cxx @@ -220,25 +220,9 @@ static sal_uInt16 nBCTitleNo = 0; pDocSh->getIDocumentDeviceAccess()->setJobsetup(pPrt->GetJobSetup()); } - const SfxItemSet *pArgs = rReq.GetArgs(); - DBG_ASSERT( pArgs, "no arguments in SfxRequest"); - const SfxPoolItem* pFrameItem = 0; - if(pArgs) - pArgs->GetItemState(SID_DOCFRAME, FALSE, &pFrameItem); - - SfxViewFrame* pFrame = 0; - if( pFrameItem ) - { - SfxFrame* pFr = ((const SfxFrameItem*)pFrameItem)->GetFrame(); - xDocSh->PutItem(SfxBoolItem(SID_HIDDEN, TRUE)); - pFr->InsertDocument(xDocSh); - pFrame = pFr->GetCurrentViewFrame(); - } - else - { - pFrame = SfxViewFrame::CreateViewFrame( *xDocSh, 0, TRUE ); - } - SwView *pNewView = (SwView*) pFrame->GetViewShell(); + SfxViewFrame* pViewFrame = SfxViewFrame::DisplayNewDocument( *xDocSh, rReq ); + + SwView *pNewView = (SwView*) pViewFrame->GetViewShell(); pNewView->AttrChangedNotify( &pNewView->GetWrtShell() );//Damit SelectShell gerufen wird. // Dokumenttitel setzen @@ -255,7 +239,7 @@ static sal_uInt16 nBCTitleNo = 0; } xDocSh->SetTitle( aTmp ); - pFrame->GetFrame()->Appear(); + pViewFrame->GetFrame().Appear(); // Shell ermitteln SwWrtShell *pSh = pNewView->GetWrtShellPtr(); @@ -458,7 +442,7 @@ static sal_uInt16 nBCTitleNo = 0; if( rItem.bSynchron ) { - SfxDispatcher* pDisp = pFrame->GetDispatcher(); + SfxDispatcher* pDisp = pViewFrame->GetDispatcher(); ASSERT(pDisp, "Heute kein Dispatcher am Frame?"); pDisp->Execute(FN_SYNC_LABELS, SFX_CALLMODE_ASYNCHRON); } diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 560ac9a5af..b80b567ebf 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -763,6 +763,10 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) if ( pWrtShell ) { SwWait aWait( *this, TRUE ); + // --> OD 2009-12-31 #i106906# + const sal_Bool bFormerLockView = pWrtShell->IsViewLocked(); + pWrtShell->LockView( sal_True ); + // <-- pWrtShell->StartAllAction(); pWrtShell->Push(); SwWriter aWrt( rMedium, *pWrtShell, TRUE ); @@ -773,6 +777,9 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) { pWrtShell->Pop(FALSE); pWrtShell->EndAllAction(); + // --> OD 2009-12-31 #i106906# + pWrtShell->LockView( bFormerLockView ); + // <-- } } else diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index f30b77df14..cea9d745d7 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -676,7 +676,7 @@ void SwDocShell::Execute(SfxRequest& rReq) bOnly = FALSE; else if( IS_TYPE( SwPagePreView, pTmpFrm->GetViewShell())) { - pTmpFrm->GetFrame()->Appear(); + pTmpFrm->GetFrame().Appear(); bFound = TRUE; } if( bFound && !bOnly ) @@ -1027,7 +1027,7 @@ void SwDocShell::Execute(SfxRequest& rReq) else { // Neues Dokument erzeugen. - SfxViewFrame *pFrame = SfxViewFrame::CreateViewFrame( *xDocSh, 0 ); + SfxViewFrame *pFrame = SfxViewFrame::LoadDocument( *xDocSh, 0 ); SwView *pCurrView = (SwView*) pFrame->GetViewShell(); // Dokumenttitel setzen @@ -1169,18 +1169,6 @@ void SwDocShell::Execute(SfxRequest& rReq) } break; - case SID_MAIL_PREPAREEXPORT: - { - //pWrtShell is not set in page preview - if(pWrtShell) - pWrtShell->StartAllAction(); - pDoc->UpdateFlds( NULL, false ); - pDoc->EmbedAllLinks(); - pDoc->RemoveInvisibleContent(); - if(pWrtShell) - pWrtShell->EndAllAction(); - } - break; case SID_MAIL_EXPORT_FINISHED: { if(pWrtShell) @@ -1766,15 +1754,15 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) // Currently there can be only one view (layout) if the document is viewed in Web layout // So if there are more views we are in print layout and for toggling to Web layout all other views must be closed - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, 0, FALSE); + SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); do { if( pTmpFrm != pTempView->GetViewFrame() ) { pTmpFrm->DoClose(); - pTmpFrm = SfxViewFrame::GetFirst(this, 0, FALSE); + pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); } else - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, 0, FALSE); + pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, FALSE); } while ( pTmpFrm ); diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 77e54863dc..4b0e3575a6 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -39,6 +39,7 @@ #include <svtools/ctrltool.hxx> #include <unotools/lingucfg.hxx> #include <sfx2/docfile.hxx> +#include <sfx2/sfxmodelfactory.hxx> #include <sfx2/printer.hxx> #include <sfx2/bindings.hxx> #include <svl/asiancfg.hxx> @@ -371,7 +372,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) --------------------------------------------------------------------*/ -SwDocShell::SwDocShell( SfxObjectCreateMode eMode, sal_Bool _bScriptingSupport ) : +SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) : SfxObjectShell ( eMode ), pDoc(0), pFontList(0), @@ -382,8 +383,25 @@ SwDocShell::SwDocShell( SfxObjectCreateMode eMode, sal_Bool _bScriptingSupport ) bInUpdateFontList(false) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SwDocShell" ); - if ( !_bScriptingSupport ) - SetHasNoBasic(); + Init_Impl(); +} + +/*-------------------------------------------------------------------- + Beschreibung: Ctor / Dtor + --------------------------------------------------------------------*/ + + +SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) : + SfxObjectShell ( i_nSfxCreationFlags ), + pDoc(0), + pFontList(0), + pView( 0 ), + pWrtShell( 0 ), + pOLEChildList( 0 ), + nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG), + bInUpdateFontList(false) +{ + RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SwDocShell" ); Init_Impl(); } diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index 58d168426a..487d83b6f0 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -546,7 +546,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam } pDStyle->GetCollection()->SetDerivedFrom( pColl ); pDStyle->PresetParent( rParent ); - + //#outline level,add by zhaojianwei /*When a new paragraph style is created based on a "to outline style assigned" paragraph style, the outline level attribute and the list @@ -557,7 +557,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam SwNumRuleItem aItem(aEmptyStr); pDStyle->GetCollection()->SetFmtAttr( aItem ); pDStyle->GetCollection()->SetAttrOutlineLevel( 0 ); - } + } //<-end,zhaojianwei } @@ -1017,18 +1017,10 @@ USHORT SwDocShell::UpdateStyle(const String &rName, USHORT nFamily, SwWrtShell* pCurrWrtShell->StartAllAction(); pCurrWrtShell->GetFlyFrmAttr( aSet ); - // JP 10.06.98: nur automatische Orientierungen uebernehmen -/* #61359# jetzt auch wieder alle Orientierungen - * const SfxPoolItem* pItem; - if( SFX_ITEM_SET == aSet.GetItemState( RES_VERT_ORIENT, - FALSE, &pItem ) && - text::VertOrientation::NONE == ((SwFmtVertOrient*)pItem)->GetVertOrient()) - aSet.ClearItem( RES_VERT_ORIENT ); - - if( SFX_ITEM_SET == aSet.GetItemState( RES_HORI_ORIENT, - FALSE, &pItem ) && - text::HoriOrientation::NONE == ((SwFmtHoriOrient*)pItem)->GetHoriOrient()) - aSet.ClearItem( RES_HORI_ORIENT );*/ + // --> OD 2009-12-28 #i105535# + // no update of anchor attribute + aSet.ClearItem( RES_ANCHOR ); + // <-- pFrm->SetFmtAttr( aSet ); diff --git a/sw/source/ui/app/makefile.mk b/sw/source/ui/app/makefile.mk index 943f1004eb..88f9ff9d63 100644 --- a/sw/source/ui/app/makefile.mk +++ b/sw/source/ui/app/makefile.mk @@ -69,6 +69,7 @@ SLOFILES = \ EXCEPTIONSFILES= \ $(SLO)$/docsh.obj \ $(SLO)$/docst.obj \ + $(SLO)$/docshini.obj \ $(SLO)$/swmodule.obj \ $(SLO)$/swmodul1.obj \ $(SLO)$/apphdl.obj \ diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index bd2a42d022..cc3be1a93a 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -355,7 +355,7 @@ SwChapterNumRules* SwModule::GetChapterNumRules() void SwModule::ShowDBObj(SwView& rView, const SwDBData& rData, BOOL /*bOnlyIfAvailable*/) { - Reference<XFrame> xFrame = rView.GetViewFrame()->GetFrame()->GetFrameInterface(); + Reference<XFrame> xFrame = rView.GetViewFrame()->GetFrame().GetFrameInterface(); Reference<XDispatchProvider> xDP(xFrame, uno::UNO_QUERY); uno::Reference<frame::XFrame> xBeamerFrame = xFrame->findFrame( diff --git a/sw/source/ui/app/swwait.cxx b/sw/source/ui/app/swwait.cxx index 46ef17c400..2f484b8eb4 100644 --- a/sw/source/ui/app/swwait.cxx +++ b/sw/source/ui/app/swwait.cxx @@ -38,25 +38,25 @@ void SwDocShell::EnterWait( BOOL bLockDispatcher ) { - SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, 0, FALSE ); + SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, FALSE ); while ( pFrame ) { pFrame->GetWindow().EnterWait(); if ( bLockDispatcher ) pFrame->GetDispatcher()->Lock( TRUE ); - pFrame = SfxViewFrame::GetNext( *pFrame, this, 0, FALSE ); + pFrame = SfxViewFrame::GetNext( *pFrame, this, FALSE ); } } void SwDocShell::LeaveWait( BOOL bLockDispatcher ) { - SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, 0, FALSE ); + SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, FALSE ); while ( pFrame ) { pFrame->GetWindow().LeaveWait(); if ( bLockDispatcher ) pFrame->GetDispatcher()->Lock( FALSE ); - pFrame = SfxViewFrame::GetNext( *pFrame, this, 0, FALSE ); + pFrame = SfxViewFrame::GetNext( *pFrame, this, FALSE ); } } diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index 67cd341e3c..907db6eacf 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -241,8 +241,8 @@ SwCharURLPage::SwCharURLPage( Window* pParent, ::FillCharStyleListBox(aNotVisitedLB, pView->GetDocShell()); TargetList* pList = new TargetList; - const SfxFrame* pFrame = pView->GetViewFrame()->GetTopFrame(); - pFrame->GetTargetList(*pList); + const SfxFrame& rFrame = pView->GetViewFrame()->GetTopFrame(); + rFrame.GetTargetList(*pList); USHORT nCount = (USHORT)pList->Count(); if( nCount ) { diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src index 3d81942c92..a2573ed3c1 100644..100755 --- a/sw/source/ui/config/optdlg.src +++ b/sw/source/ui/config/optdlg.src @@ -952,11 +952,11 @@ StringArray STR_PRINTOPTUI < "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"; >; + < "P~ictures and other graphic 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"; >; + < "~Text placeholders"; >; < "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"; >; @@ -985,7 +985,7 @@ StringArray STR_PRINTOPTUI < "Select the Brochure option to print the document in brochure format."; >; < "Left-to-right script"; >; < "Right-to-left script"; >; - < "Ranges and copies"; >; + < "Range and copies"; >; < "~All pages"; >; < "Print the whole document."; >; < "Pa~ges"; >; diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 0d79743eb1..c543cf702c 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -580,7 +580,7 @@ void SwAddressListDialog::DetectTablesAndQueries( uno::Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); uno::Reference< XInteractionHandler > xHandler( - xMgr->createInstance( C2U( "com.sun.star.sdb.InteractionHandler" )), UNO_QUERY); + xMgr->createInstance( C2U( "com.sun.star.task.InteractionHandler" )), UNO_QUERY); pUserData->xConnection = SharedConnection( xComplConnection->connectWithCompletion( xHandler ) ); } if(pUserData->xConnection.is()) diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index bd5ebfe8fb..3cdba36e57 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -935,7 +935,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, // create a target docshell to put the merged document into xTargetDocShell = new SwDocShell( SFX_CREATE_MODE_STANDARD ); xTargetDocShell->DoInitNew( 0 ); - SfxViewFrame* pTargetFrame = SfxViewFrame::CreateViewFrame( *xTargetDocShell, 0, TRUE ); + SfxViewFrame* pTargetFrame = SfxViewFrame::LoadHiddenDocument( *xTargetDocShell, 0 ); pTargetView = static_cast<SwView*>( pTargetFrame->GetViewShell() ); @@ -1055,7 +1055,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, if (xWorkDocSh->DoLoad(pWorkMed)) { //create a view frame for the document - SfxViewFrame* pWorkFrame = SfxViewFrame::CreateViewFrame( *xWorkDocSh, 0, TRUE ); + SfxViewFrame* pWorkFrame = SfxViewFrame::LoadHiddenDocument( *xWorkDocSh, 0 ); //request the layout calculation SwWrtShell& rWorkShell = static_cast< SwView* >(pWorkFrame->GetViewShell())->GetWrtShell(); @@ -1255,6 +1255,9 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, nEndRow = pImpl->pMergeData ? pImpl->pMergeData->xResultSet->getRow() : 0; } while( !bCancel && (bSynchronizedDoc && (nStartRow != nEndRow)? ExistsNextRecord() : ToNextMergeRecord())); + + aPrtMonDlg.Show( FALSE ); + // save the single output document if(rMergeDescriptor.bCreateSingleFile || bAsSingleFile) { @@ -1613,7 +1616,7 @@ uno::Reference< sdbc::XConnection> SwNewDBMgr::GetConnection(const String& rData { rxSource.set(xComplConnection,UNO_QUERY); Reference< XInteractionHandler > xHandler( - xMgr->createInstance( C2U( "com.sun.star.sdb.InteractionHandler" )), UNO_QUERY); + xMgr->createInstance( C2U( "com.sun.star.task.InteractionHandler" )), UNO_QUERY); xConnection = xComplConnection->connectWithCompletion( xHandler ); } } @@ -2556,7 +2559,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, pWorkMed->SetFilter( pSfxFlt ); if( xWorkDocSh->DoLoad(pWorkMed) ) { - SfxViewFrame *pFrame = SfxViewFrame::CreateViewFrame( *xWorkDocSh, 0, TRUE ); + SfxViewFrame *pFrame = SfxViewFrame::LoadHiddenDocument( *xWorkDocSh, 0 ); SwView *pView = (SwView*) pFrame->GetViewShell(); pView->AttrChangedNotify( &pView->GetWrtShell() );//Damit SelectShell gerufen wird. //set the current DBMgr @@ -2765,7 +2768,7 @@ uno::Reference<XResultSet> SwNewDBMgr::createCursor(const ::rtl::OUString& _sDat if ( xRowSet.is() ) { - uno::Reference< XInteractionHandler > xHandler(xMgr->createInstance(C2U("com.sun.star.sdb.InteractionHandler")), UNO_QUERY); + uno::Reference< XInteractionHandler > xHandler(xMgr->createInstance(C2U("com.sun.star.task.InteractionHandler")), UNO_QUERY); xRowSet->executeWithCompletion(xHandler); } xResultSet = uno::Reference<XResultSet>(xRowSet, UNO_QUERY); @@ -2848,14 +2851,14 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, // create a target docshell to put the merged document into SfxObjectShellRef xTargetDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) ); xTargetDocShell->DoInitNew( 0 ); - SfxViewFrame* pTargetFrame = SfxViewFrame::CreateViewFrame( *xTargetDocShell, 0, TRUE ); + SfxViewFrame* pTargetFrame = SfxViewFrame::LoadHiddenDocument( *xTargetDocShell, 0 ); //the created window has to be located at the same position as the source window - Window& rTargetWindow = pTargetFrame->GetFrame()->GetWindow(); - Window& rSourceWindow = rSourceView.GetViewFrame()->GetFrame()->GetWindow(); + Window& rTargetWindow = pTargetFrame->GetFrame().GetWindow(); + Window& rSourceWindow = rSourceView.GetViewFrame()->GetFrame().GetWindow(); rTargetWindow.SetPosPixel(rSourceWindow.GetPosPixel()); -// pTargetFrame->GetFrame()->Appear(); +// pTargetFrame->GetFrame().Appear(); SwView* pTargetView = static_cast<SwView*>( pTargetFrame->GetViewShell() ); rMMConfig.SetTargetView(pTargetView); //initiate SelectShell() to create sub shells @@ -2909,7 +2912,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, xWorkDocSh->DoInitNew(); } //create a ViewFrame - SwView* pWorkView = static_cast< SwView* >( SfxViewFrame::CreateViewFrame( *xWorkDocSh, 0, sal_True )->GetViewShell() ); + SwView* pWorkView = static_cast< SwView* >( SfxViewFrame::LoadHiddenDocument( *xWorkDocSh, 0 )->GetViewShell() ); SwWrtShell& rWorkShell = pWorkView->GetWrtShell(); pWorkView->AttrChangedNotify( &rWorkShell );//Damit SelectShell gerufen wird. diff --git a/sw/source/ui/dbui/dbui.src b/sw/source/ui/dbui/dbui.src index f85d02090c..8d073412ab 100644 --- a/sw/source/ui/dbui/dbui.src +++ b/sw/source/ui/dbui/dbui.src @@ -83,7 +83,7 @@ ModelessDialog DLG_PRINTMONITOR Pos = MAP_APPFONT ( 6, 17 ) ; Size = MAP_APPFONT ( 100, 8 ) ; CENTER = TRUE ; - Text [ en-US ] = "is being printed on" ; + Text [ en-US ] = "is being prepared for printing on" ; }; FixedText FT_SENDING { diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 33f024ef99..fd601bdfb1 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -307,7 +307,7 @@ void SwMailMergeWizard::CreateTargetDocument() MergeDocuments( m_rConfigItem, *GetSwView() ); m_rConfigItem.SetMergeDone(); if( m_rConfigItem.GetTargetView() ) - m_rConfigItem.GetTargetView()->GetViewFrame()->GetFrame()->Appear(); + m_rConfigItem.GetTargetView()->GetViewFrame()->GetFrame().Appear(); } /*-- 23.08.2004 08:51:36--------------------------------------------------- diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index f2c5cfb3f7..9ede2af8a0 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -692,7 +692,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveStartHdl_Impl, PushButton*, pButton) { SfxViewFrame* pSourceViewFrm = pSourceView->GetViewFrame(); uno::Reference< frame::XFrame > xFrame = - pSourceViewFrm->GetFrame()->GetFrameInterface(); + pSourceViewFrm->GetFrame().GetFrameInterface(); xFrame->getContainerWindow()->setVisible(sal_True); pSourceViewFrm->GetDispatcher()->Execute(SID_SAVEDOC, SFX_CALLMODE_SYNCHRON); xFrame->getContainerWindow()->setVisible(sal_False); @@ -855,8 +855,8 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) //now extract a document from the target document SfxObjectShellRef xTempDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) ); xTempDocShell->DoInitNew( 0 ); - SfxViewFrame* pTempFrame = SfxViewFrame::CreateViewFrame( *xTempDocShell, 0, TRUE ); -// pTempFrame->GetFrame()->Appear(); + SfxViewFrame* pTempFrame = SfxViewFrame::LoadHiddenDocument( *xTempDocShell, 0 ); +// pTempFrame->GetFrame().Appear(); SwView* pTempView = static_cast<SwView*>( pTempFrame->GetViewShell() ); pTargetView->GetWrtShell().StartAction(); SwgReaderOption aOpt; @@ -1254,8 +1254,8 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) //now extract a document from the target document SfxObjectShellRef xTempDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) ); xTempDocShell->DoInitNew( 0 ); - SfxViewFrame* pTempFrame = SfxViewFrame::CreateViewFrame( *xTempDocShell, 0, TRUE ); -// pTempFrame->GetFrame()->Appear(); + SfxViewFrame* pTempFrame = SfxViewFrame::LoadHiddenDocument( *xTempDocShell, 0 ); +// pTempFrame->GetFrame().Appear(); SwView* pTempView = static_cast<SwView*>( pTempFrame->GetViewShell() ); pTargetView->GetWrtShell().StartAction(); SwgReaderOption aOpt; diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx index c79e7874dd..ef83dba1a3 100644 --- a/sw/source/ui/dialog/macassgn.cxx +++ b/sw/source/ui/dialog/macassgn.cxx @@ -149,7 +149,7 @@ BOOL SwMacroAssignDlg::INetFmtDlg( Window* pParent, SwWrtShell& rSh, SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SfxAbstractDialog* pMacroDlg = pFact->CreateSfxDialog( pParent, aSet, - rSh.GetView().GetViewFrame()->GetFrame()->GetFrameInterface(), + rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), SID_EVENTCONFIG ); if ( pMacroDlg && pMacroDlg->Execute() == RET_OK ) { diff --git a/sw/source/ui/dialog/makefile.mk b/sw/source/ui/dialog/makefile.mk index 54b7784946..758ea00fcb 100644 --- a/sw/source/ui/dialog/makefile.mk +++ b/sw/source/ui/dialog/makefile.mk @@ -86,11 +86,7 @@ $(INCCOM)$/swuilib.hxx: makefile.mk $(RM) $@ echo \#define DLL_NAME \"libswui$(DLLPOSTFIX)$(DLLPOST)\" >$@ .ELSE -.IF "$(USE_SHELL)"!="4nt" echo \#define DLL_NAME \"swui$(DLLPOSTFIX)$(DLLPOST)\" >$@ -.ELSE # "$(USE_SHELL)"!="4nt" - echo #define DLL_NAME "swui$(DLLPOSTFIX)$(DLLPOST)" >$@ -.ENDIF # "$(USE_SHELL)"!="4nt" .ENDIF $(SLO)$/swabstdlg.obj : $(INCCOM)$/swuilib.hxx diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index e96416401e..c2f668c6d5 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -2636,7 +2636,9 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData, if(pFmView) { const OXFormsDescriptor &rDesc = OXFormsTransferable::extractDescriptor(rData); if(0 != (pObj = pFmView->CreateXFormsControl(rDesc))) - rSh.SwFEShell::Insert( *pObj, 0, 0, pDragPt ); + { + rSh.SwFEShell::InsertDrawObj( *pObj, *pDragPt ); + } } } else if( nWh ) @@ -2697,7 +2699,7 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData, if (pFmView && bHaveColumnDescriptor) { if ( 0 != (pObj = pFmView->CreateFieldControl( OColumnTransferable::extractColumnDescriptor(rData) ) ) ) - rSh.SwFEShell::Insert( *pObj, 0, 0, pDragPt ); + rSh.SwFEShell::InsertDrawObj( *pObj, *pDragPt ); } } nRet = 1; @@ -3636,7 +3638,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) } else { - // creating a temp. bookmark without undo + // creating a temp. bookmark without undo BOOL bUndo = rSh.DoesUndo(); rSh.DoUndo( FALSE ); BOOL bIsModified = rSh.IsModified(); @@ -3646,7 +3648,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) ::rtl::OUString(), ::rtl::OUString(), IDocumentMarkAccess::DDE_BOOKMARK); - if(pMark) + if(pMark) { sName = pMark->GetName(); bDelBookmrk = TRUE; @@ -3754,8 +3756,8 @@ BOOL SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) } ::rtl::OUString sMarkName = pMark->GetName(); - // remove mark - pServerObject->SetNoServer(); // this removes the connection between SwServerObject and mark + // remove mark + pServerObject->SetNoServer(); // this removes the connection between SwServerObject and mark // N.B. ppMark was not loaded from file and cannot have xml:id pMarkAccess->deleteMark(ppMark); diff --git a/sw/source/ui/docvw/docvw.hrc b/sw/source/ui/docvw/docvw.hrc index 998c71401e..ff6e6c4fe0 100644 --- a/sw/source/ui/docvw/docvw.hrc +++ b/sw/source/ui/docvw/docvw.hrc @@ -34,7 +34,7 @@ #define MN_READONLY_OPENURL (RC_DOCVW_BEGIN + 2) #define MN_READONLY_OPENURLNEW (RC_DOCVW_BEGIN + 3) #define MN_READONLY_EDITDOC (RC_DOCVW_BEGIN + 4) -#define MN_READONLY_BROWSE_STOP (RC_DOCVW_BEGIN + 5) + // FREE, formerly known as MN_READONLY_BROWSE_STOP #define MN_READONLY_BROWSE_BACKWARD (RC_DOCVW_BEGIN + 6) #define MN_READONLY_BROWSE_FORWARD (RC_DOCVW_BEGIN + 7) #define MN_READONLY_SELECTION_MODE (RC_DOCVW_BEGIN + 8) diff --git a/sw/source/ui/docvw/docvw.src b/sw/source/ui/docvw/docvw.src index 741d8ea391..1ca8ebf6d8 100644 --- a/sw/source/ui/docvw/docvw.src +++ b/sw/source/ui/docvw/docvw.src @@ -78,12 +78,6 @@ Menu MN_READONLY_POPUP SEPARATOR MenuItem { - Identifier = MN_READONLY_BROWSE_STOP ; - HelpID = SID_BROWSE_STOP ; - Text [ en-US ] = "~Stop" ; - }; - MenuItem - { Identifier = MN_READONLY_BROWSE_BACKWARD ; HelpID = SID_BROWSE_BACKWARD ; Text [ en-US ] = "Backwards" ; diff --git a/sw/source/ui/docvw/edtdd.cxx b/sw/source/ui/docvw/edtdd.cxx index dd406c1cba..8174d81b65 100644 --- a/sw/source/ui/docvw/edtdd.cxx +++ b/sw/source/ui/docvw/edtdd.cxx @@ -515,7 +515,7 @@ IMPL_LINK( SwEditWin, DDHandler, Timer *, EMPTYARG ) ReleaseMouse(); bFrmDrag = FALSE; - if ( rView.GetViewFrame() && rView.GetViewFrame()->GetFrame() ) + if ( rView.GetViewFrame() ) { bExecuteDrag = TRUE; StartExecuteDrag(); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index b9f6f851df..f299146c02 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -137,6 +137,7 @@ #include <IMark.hxx> #include <doc.hxx> +#include <xmloff/odffields.hxx> #include "PostItMgr.hxx" #include "postit.hxx" @@ -146,14 +147,15 @@ //#define TEST_FOR_BUG91313 #endif +using namespace sw::mark; using namespace ::com::sun::star; /*-------------------------------------------------------------------- - Beschreibung: Globals + Beschreibung: Globals --------------------------------------------------------------------*/ static bool bInputLanguageSwitched = false; -extern BOOL bNoInterrupt; // in mainwn.cxx +extern BOOL bNoInterrupt; // in mainwn.cxx //Normalerweise wird im MouseButtonUp eine Selektion aufgehoben wenn die //Selektion nicht gerade aufgezogen wird. Leider wird im MouseButtonDown @@ -161,27 +163,27 @@ extern BOOL bNoInterrupt; // in mainwn.cxx //komplett abgeschlossen und kann deshalb im Up nicht mehr unterschieden //werden. Um dies Aufzuloese wird bHoldSelection im Down gesetzt und im //Up ausgewertet. -static BOOL bHoldSelection = FALSE; +static BOOL bHoldSelection = FALSE; -BOOL bFrmDrag = FALSE; -BOOL bValidCrsrPos = FALSE; -BOOL bModePushed = FALSE; -BOOL bDDTimerStarted = FALSE; -BOOL bFlushCharBuffer = FALSE; -BOOL SwEditWin::bReplaceQuote = FALSE; -BOOL bDDINetAttr = FALSE; -SdrHdlKind eSdrMoveHdl = HDL_USER; +BOOL bFrmDrag = FALSE; +BOOL bValidCrsrPos = FALSE; +BOOL bModePushed = FALSE; +BOOL bDDTimerStarted = FALSE; +BOOL bFlushCharBuffer = FALSE; +BOOL SwEditWin::bReplaceQuote = FALSE; +BOOL bDDINetAttr = FALSE; +SdrHdlKind eSdrMoveHdl = HDL_USER; -QuickHelpData* SwEditWin::pQuickHlpData = 0; +QuickHelpData* SwEditWin::pQuickHlpData = 0; -long SwEditWin::nDDStartPosY = 0; -long SwEditWin::nDDStartPosX = 0; -Color SwEditWin::aTextBackColor(COL_YELLOW); -Color SwEditWin::aTextColor(COL_RED); -BOOL SwEditWin::bTransparentBackColor = FALSE; // Hintergrund nicht transparent +long SwEditWin::nDDStartPosY = 0; +long SwEditWin::nDDStartPosX = 0; +Color SwEditWin::aTextBackColor(COL_YELLOW); +Color SwEditWin::aTextColor(COL_RED); +BOOL SwEditWin::bTransparentBackColor = FALSE; // Hintergrund nicht transparent -extern BOOL bExecuteDrag; +extern BOOL bExecuteDrag; SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType ); @@ -219,7 +221,7 @@ struct QuickHelpData void Start( SwWrtShell& rSh, USHORT nWrdLen ); void Stop( SwWrtShell& rSh ); - BOOL HasCntnt() const { return aArr.Count() && 0 != nLen; } + BOOL HasCntnt() const { return aArr.Count() && 0 != nLen; } void Inc( BOOL bEndLess ) { @@ -236,7 +238,7 @@ struct QuickHelpData /*-------------------------------------------------------------------- - Beschreibung: Minimale Bewegung Zittern vermeiden + Beschreibung: Minimale Bewegung Zittern vermeiden --------------------------------------------------------------------*/ #define HIT_PIX 2 /* Hit-Toleranz in Pixel */ @@ -272,7 +274,7 @@ inline BOOL IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt ) } /*-------------------------------------------------------------------- - Beschreibung: Pointer umschalten + Beschreibung: Pointer umschalten --------------------------------------------------------------------*/ @@ -289,7 +291,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, USHORT nModifier ) delete pUserMarker; pUserMarker = 0L; } -// rSh.SwCrsrShell::UnSetVisCrsr( rLPt ); +// rSh.SwCrsrShell::UnSetVisCrsr( rLPt ); eStyle = POINTER_NOTALLOWED; } else @@ -362,7 +364,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, USHORT nModifier ) // Removed ExecHyperlink option. //BOOL bExecHyperlinks = rSh.GetViewOptions()->IsExecHyperlinks() ^ - // (nModifier == KEY_MOD2 ? TRUE : FALSE); + // (nModifier == KEY_MOD2 ? TRUE : FALSE); BOOL bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); if ( !bExecHyperlinks ) { @@ -574,7 +576,7 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG ) if( aOldVis == rVisArea && !rSh.IsStartOfDoc() && !rSh.IsEndOfDoc() ) { //JP 11.10.2001 Bug 72294 - take the center point of VisArea to - // decide in which direction the user want. + // decide in which direction the user want. if( aModPt.Y() < ( rVisArea.Top() + rVisArea.Height() / 2 ) ) rSh.Up( TRUE, 1 ); else @@ -628,7 +630,7 @@ inline void SwEditWin::EnterArea() } /*------------------------------------------------------------------------ - Beschreibung: Modus fuer Rahmen einfuegen + Beschreibung: Modus fuer Rahmen einfuegen ------------------------------------------------------------------------*/ @@ -645,7 +647,7 @@ void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, BOOL bObjSelect ) { SetSdrDrawMode( eSdrObjectKind ); -/* if (GetDrawFuncPtr()) +/* if (GetDrawFuncPtr()) GetDrawFuncPtr()->Deactivate();*/ if (bObjSelect) @@ -658,7 +660,7 @@ void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, BOOL bObjSelect ) if (bObjSelect) rView.GetDrawFuncPtr()->Activate( SID_OBJECT_SELECT ); else - rView.GetDrawFuncPtr()->Activate( sal::static_int_cast< USHORT >(eSdrObjectKind) ); // don't know if this is useful at all; but it keeps functionality as it was... + rView.GetDrawFuncPtr()->Activate( sal::static_int_cast< USHORT >(eSdrObjectKind) ); // don't know if this is useful at all; but it keeps functionality as it was... bInsFrm = FALSE; nInsFrmColCount = 1; } @@ -672,7 +674,7 @@ void SwEditWin::StopInsFrm() rView.GetDrawFuncPtr()->Deactivate(); rView.SetDrawFuncPtr(NULL); } - rView.LeaveDrawCreate(); // Konstruktionsmode verlassen + rView.LeaveDrawCreate(); // Konstruktionsmode verlassen bInsFrm = FALSE; nInsFrmColCount = 1; } @@ -709,7 +711,7 @@ BOOL SwEditWin::IsInputSequenceCheckingRequired( const String &rText, const SwPa /*-------------------------------------------------------------------- - Beschreibung: Der Character Buffer wird in das Dokument eingefuegt + Beschreibung: Der Character Buffer wird in das Dokument eingefuegt --------------------------------------------------------------------*/ @@ -798,7 +800,7 @@ void SwEditWin::FlushInBuffer() ++nTmpPos; } } - aInBuffer = aNewText.copy( aOldText.getLength() ); // copy new text to be inserted to buffer + aInBuffer = aNewText.copy( aOldText.getLength() ); // copy new text to be inserted to buffer } } @@ -1240,7 +1242,7 @@ void SwEditWin::ChangeDrawing( BYTE nDir ) } /*-------------------------------------------------------------------- - Beschreibung: KeyEvents + Beschreibung: KeyEvents --------------------------------------------------------------------*/ @@ -1373,7 +1375,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) if( pMacro ) { String sRet; - SbxArrayRef xArgs = new SbxArray; + SbxArrayRef xArgs = new SbxArray; SbxVariableRef xVar = new SbxVariable; xVar->PutString( pFlyFmt->GetName() ); xArgs->Put( &xVar, 1 ); @@ -1491,12 +1493,12 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) switch( eKeyState ) { case KS_CheckKey: - eKeyState = KS_KeyToView; // default weiter zur View + eKeyState = KS_KeyToView; // default weiter zur View #ifdef DBG_UTIL //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // JP 19.01.99: zum Umschalten des Cursor Verhaltens in ReadOnly - // Bereichen + // Bereichen if( 0x7210 == rKeyCode.GetFullCode() ) rSh.SetReadOnlyAvailable( !rSh.IsReadOnlyAvailable() ); else @@ -1509,7 +1511,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) !rSh.HasReadonlySel() ) { // in der Tabelle am Anfang der Zelle ein '=' -> - // EditZeile aufrufen (F2-Funktionalitaet) + // EditZeile aufrufen (F2-Funktionalitaet) rSh.Push(); if( !rSh.MoveSection( fnSectionCurr, fnSectionStart) && !rSh.IsTableBoxTextFormat() ) @@ -1582,12 +1584,12 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) eFlyState = KS_Fly_Change; nDir = MOVE_DOWN_SMALL; goto KEYINPUT_CHECKTABLE; -// case KEY_UP | KEY_MOD2 | KEY_SHIFT: -// eKeyState = KS_ColTopBig; -// goto KEYINPUT_CHECKTABLE; -// case KEY_DOWN | KEY_MOD2 | KEY_SHIFT: -// eKeyState = KS_ColTopSmall; -// goto KEYINPUT_CHECKTABLE; +// case KEY_UP | KEY_MOD2 | KEY_SHIFT: +// eKeyState = KS_ColTopBig; +// goto KEYINPUT_CHECKTABLE; +// case KEY_DOWN | KEY_MOD2 | KEY_SHIFT: +// eKeyState = KS_ColTopSmall; +// goto KEYINPUT_CHECKTABLE; case KEY_UP | KEY_MOD2 | KEY_MOD1: eKeyState = KS_CellBottomSmall; @@ -1733,7 +1735,7 @@ KEYINPUT_CHECKTABLE_INSDEL: } break; - case KEY_RETURN: // Return + case KEY_RETURN: // Return if( !rSh.HasReadonlySel() ) { const int nSelectionType = rSh.GetSelectionType(); @@ -1769,7 +1771,7 @@ KEYINPUT_CHECKTABLE_INSDEL: } break; - case KEY_RETURN | KEY_MOD2: // ALT-Return + case KEY_RETURN | KEY_MOD2: // ALT-Return if( !rSh.HasReadonlySel() && !rSh.IsSttPara() && rSh.GetCurNumRule() ) eKeyState = KS_NoNum; else if( rSh.CanSpecialInsert() ) @@ -1979,8 +1981,8 @@ KEYINPUT_CHECKTABLE_INSDEL: if( rSh.IsSttOfPara() && !rSh.HasReadonlySel() ) { SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl(); - //if( pColl && 0 < pColl->GetOutlineLevel() && //#outline level,zhaojianwei - // MAXLEVEL - 1 >= pColl->GetOutlineLevel() ) + //if( pColl && 0 < pColl->GetOutlineLevel() && //#outline level,zhaojianwei + // MAXLEVEL - 1 >= pColl->GetOutlineLevel() ) if( pColl && pColl->IsAssignedToListLevelOfOutlineStyle() && 0 < pColl->GetAssignedOutlineStyleLevel()) @@ -2132,7 +2134,7 @@ KEYINPUT_CHECKTABLE_INSDEL: else { // OS 22.09.95: Da der Sfx Acceleratoren nur aufruft, wenn sie beim letzten -// Statusupdate enabled wurden, muss copy ggf. von uns +// Statusupdate enabled wurden, muss copy ggf. von uns // 'gewaltsam' gerufen werden. if( rKeyCode.GetFunction() == KEYFUNC_COPY ) GetView().GetViewFrame()->GetBindings().Execute(SID_COPY); @@ -2204,7 +2206,7 @@ KEYINPUT_CHECKTABLE_INSDEL: } break; case KS_InsTab: - if( rView.ISA( SwWebView )) //Kein Tabulator fuer Web! + if( rView.ISA( SwWebView )) //Kein Tabulator fuer Web! { // Bug 56196 - dann sollte der weiter gereicht werden. Window::KeyInput( aKeyEvent ); @@ -2298,7 +2300,7 @@ KEYINPUT_CHECKTABLE_INSDEL: else { InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute(); - // ??? Window::KeyInput( aKeyEvent ); + // ??? Window::KeyInput( aKeyEvent ); eKeyState = KS_Ende; } break; @@ -2311,6 +2313,12 @@ KEYINPUT_CHECKTABLE_INSDEL: ChgToEnEmDash | SetINetAttr | Autocorrect ) && !rSh.HasReadonlySel() ) + /* { + pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd | + ChgFractionSymbol | ChgOrdinalNumber | + ChgToEnEmDash | SetINetAttr | + Autocorrect ) && + !rSh.HasReadonlySel() ) */ { FlushInBuffer(); rSh.AutoCorrect( *pACorr, static_cast< sal_Unicode >('\0') ); @@ -2323,8 +2331,8 @@ KEYINPUT_CHECKTABLE_INSDEL: { USHORT nSlotId = 0; FlushInBuffer(); -//??? if( bFlushCharBuffer ) -//??? FlushInBuffer( &rSh ); +//??? if( bFlushCharBuffer ) +//??? FlushInBuffer( &rSh ); switch( eKeyState ) { case KS_SpecialInsert: @@ -2400,8 +2408,8 @@ KEYINPUT_CHECKTABLE_INSDEL: rSh.SplitNode( TRUE ); break; -// case KS_NumOrNoNum: -// break; +// case KS_NumOrNoNum: +// break; case KS_NextObject: case KS_PrevObject: if(rSh.GotoObj( KS_NextObject == eKeyState, GOTOOBJ_GOTO_ANY)) @@ -2467,40 +2475,40 @@ KEYINPUT_CHECKTABLE_INSDEL: } break; - case KS_ColLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; - case KS_ColRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; - case KS_ColLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_LEFT, pModOpt->GetTblHMove() ); break; - case KS_ColRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_RIGHT, pModOpt->GetTblHMove() ); break; -// case KS_ColTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break; - case KS_ColBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break; -// case KS_ColTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_TOP, pModOpt->GetTblVMove() ); break; - case KS_ColBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_BOTTOM, pModOpt->GetTblVMove() ); break; - case KS_CellLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; - case KS_CellRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; - case KS_CellLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_LEFT, pModOpt->GetTblHMove() ); break; - case KS_CellRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_RIGHT, pModOpt->GetTblHMove() ); break; - case KS_CellTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break; - case KS_CellBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break; - case KS_CellTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_TOP, pModOpt->GetTblVMove() ); break; - case KS_CellBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_BOTTOM, pModOpt->GetTblVMove() ); break; + case KS_ColLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; + case KS_ColRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; + case KS_ColLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_LEFT, pModOpt->GetTblHMove() ); break; + case KS_ColRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_RIGHT, pModOpt->GetTblHMove() ); break; +// case KS_ColTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break; + case KS_ColBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break; +// case KS_ColTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_TOP, pModOpt->GetTblVMove() ); break; + case KS_ColBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_BOTTOM, pModOpt->GetTblVMove() ); break; + case KS_CellLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; + case KS_CellRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; + case KS_CellLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_LEFT, pModOpt->GetTblHMove() ); break; + case KS_CellRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_RIGHT, pModOpt->GetTblHMove() ); break; + case KS_CellTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break; + case KS_CellBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break; + case KS_CellTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_TOP, pModOpt->GetTblVMove() ); break; + case KS_CellBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_BOTTOM, pModOpt->GetTblVMove() ); break; //--------------- - case KS_InsDel_ColLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_COL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHInsert() ); break; - case KS_InsDel_ColRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_COL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHInsert() ); break; - case KS_InsDel_ColLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_COL_LEFT, pModOpt->GetTblHInsert() ); break; - case KS_InsDel_ColRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_COL_RIGHT, pModOpt->GetTblHInsert() ); break; - case KS_InsDel_ColTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_ROW_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVInsert() ); break; - case KS_InsDel_ColBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_ROW_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVInsert() ); break; - case KS_InsDel_ColTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_ROW_TOP, pModOpt->GetTblVInsert() ); break; - case KS_InsDel_ColBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_ROW_BOTTOM, pModOpt->GetTblVInsert() ); break; - case KS_InsDel_CellLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHInsert() ); break; - case KS_InsDel_CellRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHInsert() ); break; - case KS_InsDel_CellLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_LEFT, pModOpt->GetTblHInsert() ); break; - case KS_InsDel_CellRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_RIGHT, pModOpt->GetTblHInsert() ); break; - case KS_InsDel_CellTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVInsert() ); break; - case KS_InsDel_CellBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVInsert() ); break; - case KS_InsDel_CellTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_TOP, pModOpt->GetTblVInsert() ); break; - case KS_InsDel_CellBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_BOTTOM, pModOpt->GetTblVInsert() ); break; + case KS_InsDel_ColLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_COL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHInsert() ); break; + case KS_InsDel_ColRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_COL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHInsert() ); break; + case KS_InsDel_ColLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_COL_LEFT, pModOpt->GetTblHInsert() ); break; + case KS_InsDel_ColRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_COL_RIGHT, pModOpt->GetTblHInsert() ); break; + case KS_InsDel_ColTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_ROW_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVInsert() ); break; + case KS_InsDel_ColBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_ROW_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVInsert() ); break; + case KS_InsDel_ColTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_ROW_TOP, pModOpt->GetTblVInsert() ); break; + case KS_InsDel_ColBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_ROW_BOTTOM, pModOpt->GetTblVInsert() ); break; + case KS_InsDel_CellLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHInsert() ); break; + case KS_InsDel_CellRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHInsert() ); break; + case KS_InsDel_CellLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_LEFT, pModOpt->GetTblHInsert() ); break; + case KS_InsDel_CellRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_RIGHT, pModOpt->GetTblHInsert() ); break; + case KS_InsDel_CellTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVInsert() ); break; + case KS_InsDel_CellBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVInsert() ); break; + case KS_InsDel_CellTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_TOP, pModOpt->GetTblVInsert() ); break; + case KS_InsDel_CellBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_FLAG_INSDEL|nsTblChgWidthHeightType::WH_CELL_BOTTOM, pModOpt->GetTblVInsert() ); break; //--------------- case KS_TblColCellInsDel: rSh.SetColRowWidthHeight( eTblChgMode, nTblChgSize ); @@ -2558,7 +2566,7 @@ KEYINPUT_CHECKTABLE_INSDEL: } /*-------------------------------------------------------------------- - Beschreibung: MouseEvents + Beschreibung: MouseEvents --------------------------------------------------------------------*/ @@ -2639,7 +2647,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) pQuickHlpData->bChkInsBlank = FALSE; if( rSh.FinishOLEObj() ) - return; //InPlace beenden und der Klick zaehlt nicht mehr + return; //InPlace beenden und der Klick zaehlt nicht mehr SET_CURR_SHELL( &rSh ); @@ -3240,7 +3248,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } } else - { if ( rSh.SelectObj( aDocPos ) ) + { if ( rSh.SelectObj( aDocPos ) ) { rSh.EnterSelFrmMode( &aDocPos ); SwEditWin::nDDStartPosY = aDocPos.Y(); @@ -3339,7 +3347,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) int nTmpSetCrsr = 0; - { // nur temp. Move-Kontext aufspannen, da sonst die + { // nur temp. Move-Kontext aufspannen, da sonst die // Abfrage auf die Inhaltsform nicht funktioniert!!! MV_KONTEXT( &rSh ); nTmpSetCrsr = (rSh.*rSh.fnSetCrsr)(&aDocPos,bOnlyText); @@ -3356,11 +3364,16 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) bNoInterrupt = bTmpNoInterrupt; } - if( !bOverURLGrf && !bOnlyText ) + if ( !bOverURLGrf && !bOnlyText ) { const int nSelType = rSh.GetSelectionType(); - if( nSelType == nsSelectionType::SEL_OLE || - nSelType == nsSelectionType::SEL_GRF ) + // --> OD 2009-12-30 #i89920# + // Check in general, if an object is selectable at given position. + // Thus, also text fly frames in background become selectable via Ctrl-Click. + if ( nSelType & nsSelectionType::SEL_OLE || + nSelType & nsSelectionType::SEL_GRF || + rSh.IsObjSelectable( aDocPos ) ) + // <-- { MV_KONTEXT( &rSh ); if( !rSh.IsFrmSelected() ) @@ -3372,8 +3385,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) // nicht mehr hier zuruecksetzen, damit -- falls durch MouseMove // bei gedrueckter Ctrl-Taste eine Mehrfachselektion erfolgen soll, // im Drag nicht die vorherige Selektion aufgehoben wird. -// if(bModePushed) -// rSh.PopMode(FALSE); +// if(bModePushed) +// rSh.PopMode(FALSE); break; } } @@ -3383,7 +3396,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } /*-------------------------------------------------------------------- - Beschreibung: MouseMove + Beschreibung: MouseMove --------------------------------------------------------------------*/ @@ -3471,7 +3484,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) Point aDD( SwEditWin::nDDStartPosX, SwEditWin::nDDStartPosY ); aDD = LogicToPixel( aDD ); Rectangle aRect( aDD.X()-3, aDD.Y()-3, aDD.X()+3, aDD.Y()+3 ); - if ( !aRect.IsInside( aPixPt ) ) // MA 23. May. 95: Tatterschutz. + if ( !aRect.IsInside( aPixPt ) ) // MA 23. May. 95: Tatterschutz. StopDDTimer( &rSh, aDocPt ); } @@ -3608,10 +3621,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) pAnchorMarker->ChgHdl( pHdl ); if( aNew.X() || aNew.Y() ) { - pAnchorMarker->SetPos( aNew ); - pAnchorMarker->SetLastPos( aDocPt ); - //OLMpSdrView->RefreshAllIAOManagers(); - } + pAnchorMarker->SetPos( aNew ); + pAnchorMarker->SetLastPos( aDocPt ); + //OLMpSdrView->RefreshAllIAOManagers(); + } } else { @@ -3661,7 +3674,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) // geht es los? if( HDL_USER == eSdrMoveHdl ) { - SdrHdl* pHdl = pSdrView->PickHandle( aSttPt ); + SdrHdl* pHdl = pSdrView->PickHandle( aSttPt ); eSdrMoveHdl = pHdl ? pHdl->GetKind() : HDL_MOVE; } @@ -3673,14 +3686,14 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) 0 != ( pMacro = pFlyFmt->GetMacro().GetMacroTable(). Get( nEvent )) && // oder nur z.B. alle 20 Twip bescheid sagen? -// ( 20 > Abs( aRszMvHdlPt.X() - aDocPt.X() ) || -// 20 > Abs( aRszMvHdlPt.Y() - aDocPt.Y() ) ) +// ( 20 > Abs( aRszMvHdlPt.X() - aDocPt.X() ) || +// 20 > Abs( aRszMvHdlPt.Y() - aDocPt.Y() ) ) aRszMvHdlPt != aDocPt ) { aRszMvHdlPt = aDocPt; USHORT nPos = 0; String sRet; - SbxArrayRef xArgs = new SbxArray; + SbxArrayRef xArgs = new SbxArray; SbxVariableRef xVar = new SbxVariable; xVar->PutString( pFlyFmt->GetName() ); xArgs->Put( &xVar, ++nPos ); @@ -3893,7 +3906,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } /*-------------------------------------------------------------------- - Beschreibung: Button Up + Beschreibung: Button Up --------------------------------------------------------------------*/ @@ -3910,7 +3923,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) DELETEZ( pRowColumnSelectionStart ); SdrHdlKind eOldSdrMoveHdl = eSdrMoveHdl; - eSdrMoveHdl = HDL_USER; // fuer die MoveEvents - wieder zuruecksetzen + eSdrMoveHdl = HDL_USER; // fuer die MoveEvents - wieder zuruecksetzen // sicherheitshalber zuruecksetzen Bug 27900 rView.SetTabColFromDoc( FALSE ); @@ -3933,9 +3946,9 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if ( !bMBPressed ) { // OS 25.02.97 Undo fuer die Giesskann ist bereits im CommandHdl -//JP 29.09.95: so sollte es sein!!! if(pApplyTempl->bUndo) -// if( pApplyTempl && MOUSE_RIGHT == rMEvt.GetModifier() + rMEvt.GetButtons() ) -// rSh.Do( SwWrtShell::UNDO ); +//JP 29.09.95: so sollte es sein!!! if(pApplyTempl->bUndo) +// if( pApplyTempl && MOUSE_RIGHT == rMEvt.GetModifier() + rMEvt.GetButtons() ) +// rSh.Do( SwWrtShell::UNDO ); return; } @@ -3967,7 +3980,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { if ( rView.GetDrawFuncPtr()->MouseButtonUp( rMEvt ) ) { - if (rView.GetDrawFuncPtr()) // Koennte im MouseButtonUp zerstoert worden sein + if (rView.GetDrawFuncPtr()) // Koennte im MouseButtonUp zerstoert worden sein { rView.GetDrawFuncPtr()->Deactivate(); @@ -4001,7 +4014,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) rView.AttrChangedNotify( &rSh ); } else if (rMEvt.GetButtons() == MOUSE_RIGHT && rSh.IsDrawCreate()) - rView.GetDrawFuncPtr()->BreakCreate(); // Zeichnen abbrechen + rView.GetDrawFuncPtr()->BreakCreate(); // Zeichnen abbrechen bNoInterrupt = FALSE; ReleaseMouse(); @@ -4076,7 +4089,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) const Point aSttPt( PixelToLogic( aStartPos ) ); aRszMvHdlPt = aDocPt; USHORT nPos = 0; - SbxArrayRef xArgs = new SbxArray; + SbxArrayRef xArgs = new SbxArray; SbxVariableRef xVar = new SbxVariable; xVar->PutString( pFlyFmt->GetName() ); xArgs->Put( &xVar, ++nPos ); @@ -4127,7 +4140,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if( bHoldSelection ) { //JP 27.04.99: Bug 65389 - das EndDrag sollte auf jedenfall - // gerufen werden. + // gerufen werden. bHoldSelection = FALSE; (rSh.*rSh.fnEndDrag)( &aDocPt, FALSE ); } @@ -4137,7 +4150,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { const BOOL bTmpNoInterrupt = bNoInterrupt; bNoInterrupt = FALSE; - { // nur temp. Move-Kontext aufspannen, da sonst die + { // nur temp. Move-Kontext aufspannen, da sonst die // Abfrage auf die Inhaltsform nicht funktioniert!!! MV_KONTEXT( &rSh ); const Point aDocPos( PixelToLogic( aStartPos ) ); @@ -4153,7 +4166,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) // Internetfield? --> Link-Callen (DocLaden!!) //JP 18.10.96: Bug 32437 - -// if( !rSh.HasSelection() ) +// if( !rSh.HasSelection() ) if( !bInSel ) { USHORT nFilter = URLLOAD_NOFILTER; @@ -4177,7 +4190,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) SwContentAtPos aCntntAtPos( SwContentAtPos::SW_CLICKFIELD | SwContentAtPos::SW_INETATTR | - SwContentAtPos::SW_SMARTTAG ); + SwContentAtPos::SW_SMARTTAG | SwContentAtPos::SW_FORMCTRL); if( rSh.GetContentAtPos( aDocPt, aCntntAtPos, TRUE ) ) { @@ -4198,6 +4211,29 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if ( bExecSmarttags && SwSmartTagMgr::Get().IsSmartTagsEnabled() ) rView.ExecSmartTagPopup( aDocPt ); } + else if ( SwContentAtPos::SW_FORMCTRL == aCntntAtPos.eCntntAtPos ) + { + ASSERT( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field ptr???"); + if ( aCntntAtPos.aFnd.pFldmark != NULL) + { + IFieldmark *fieldBM = const_cast< IFieldmark* > ( aCntntAtPos.aFnd.pFldmark ); + //SwDocShell* pDocSh = rView.GetDocShell(); + //SwDoc *pDoc=pDocSh->GetDoc(); + if (fieldBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) ) + { + ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(fieldBM); + pCheckboxFm->SetChecked(!pCheckboxFm->IsChecked()); + pCheckboxFm->Invalidate(); + rSh.InvalidateWindows( rView.GetVisArea() ); + } else if (fieldBM->GetFieldname().equalsAscii( ODF_FORMDROPDOWN) ) { + rView.ExecFieldPopup( aDocPt, fieldBM ); + fieldBM->Invalidate(); + rSh.InvalidateWindows( rView.GetVisArea() ); + } else { + // unknown type.. + } + } + } else // if ( SwContentAtPos::SW_INETATTR == aCntntAtPos.eCntntAtPos ) { if ( bExecHyperlinks ) @@ -4436,7 +4472,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) /*-------------------------------------------------------------------- - Beschreibung: Vorlage anwenden + Beschreibung: Vorlage anwenden --------------------------------------------------------------------*/ @@ -4491,7 +4527,7 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl) } /*-------------------------------------------------------------------- - Beschreibung: ctor + Beschreibung: ctor --------------------------------------------------------------------*/ @@ -4550,7 +4586,7 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView): aTemplateTimer.SetTimeoutHdl(LINK(this, SwEditWin, TemplateTimerHdl)); //JP 16.12.98: temporaere Loesung!!! Sollte bei jeder Cursorbewegung - // den Font von der akt. einfuege Position setzen! + // den Font von der akt. einfuege Position setzen! if( !rMyView.GetDocShell()->IsReadOnly() ) { Font aFont; @@ -4582,7 +4618,7 @@ SwEditWin::~SwEditWin() /****************************************************************************** - * Beschreibung: DrawTextEditMode einschalten + * Beschreibung: DrawTextEditMode einschalten ******************************************************************************/ @@ -4602,7 +4638,7 @@ void SwEditWin::EnterDrawTextMode( const Point& aDocPos ) } /****************************************************************************** - * Beschreibung: DrawMode einschalten + * Beschreibung: DrawMode einschalten ******************************************************************************/ @@ -4612,7 +4648,7 @@ BOOL SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos) SwWrtShell &rSh = rView.GetWrtShell(); SdrView *pSdrView = rSh.GetDrawView(); -// if ( GetDrawFuncPtr() && (aActHitType == SDRHIT_NONE || rSh.IsDrawCreate()) ) +// if ( GetDrawFuncPtr() && (aActHitType == SDRHIT_NONE || rSh.IsDrawCreate()) ) if ( rView.GetDrawFuncPtr() ) { if (rSh.IsDrawCreate()) @@ -4647,19 +4683,19 @@ BOOL SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos) } /****************************************************************************** - * Beschreibung: + * Beschreibung: ******************************************************************************/ BOOL SwEditWin::IsDrawSelMode() { -// return (IsFrmAction() == FALSE && GetSdrDrawMode() == OBJ_NONE); +// return (IsFrmAction() == FALSE && GetSdrDrawMode() == OBJ_NONE); return IsObjectSelect(); } /****************************************************************************** - * Beschreibung: + * Beschreibung: ******************************************************************************/ @@ -4676,7 +4712,7 @@ void SwEditWin::GetFocus() } /****************************************************************************** - * Beschreibung: + * Beschreibung: ******************************************************************************/ @@ -4691,7 +4727,7 @@ void SwEditWin::LoseFocus() } /****************************************************************************** - * Beschreibung: + * Beschreibung: ******************************************************************************/ @@ -4700,7 +4736,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) { SwWrtShell &rSh = rView.GetWrtShell(); - if ( !rView.GetViewFrame() || !rView.GetViewFrame()->GetFrame() ) + if ( !rView.GetViewFrame() ) { //Wenn der ViewFrame in Kuerze stirbt kein Popup mehr! Window::Command(rCEvt); @@ -4720,7 +4756,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) return; } - BOOL bCallBase = TRUE; + BOOL bCallBase = TRUE; switch ( rCEvt.GetCommand() ) { @@ -4818,32 +4854,32 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) switch ( pCData->GetCommand() ) { - case DICTATIONCOMMAND_NEWPARAGRAPH: nSlotId = FN_INSERT_BREAK; break; - case DICTATIONCOMMAND_NEWLINE: nSlotId = FN_INSERT_LINEBREAK; break; - case DICTATIONCOMMAND_LEFT: nSlotId = FN_PREV_WORD; break; - case DICTATIONCOMMAND_RIGHT: nSlotId = FN_NEXT_WORD; break; - case DICTATIONCOMMAND_UP: nSlotId = FN_LINE_UP; break; - case DICTATIONCOMMAND_DOWN: nSlotId = FN_LINE_DOWN; break; - case DICTATIONCOMMAND_UNDO: nSlotId = SID_UNDO; break; - case DICTATIONCOMMAND_REPEAT: nSlotId = SID_REPEAT; break; - case DICTATIONCOMMAND_DEL: nSlotId = FN_DELETE_BACK_WORD; break; - - case DICTATIONCOMMAND_BOLD_ON: nSlotId = SID_ATTR_CHAR_WEIGHT; + case DICTATIONCOMMAND_NEWPARAGRAPH: nSlotId = FN_INSERT_BREAK; break; + case DICTATIONCOMMAND_NEWLINE: nSlotId = FN_INSERT_LINEBREAK; break; + case DICTATIONCOMMAND_LEFT: nSlotId = FN_PREV_WORD; break; + case DICTATIONCOMMAND_RIGHT: nSlotId = FN_NEXT_WORD; break; + case DICTATIONCOMMAND_UP: nSlotId = FN_LINE_UP; break; + case DICTATIONCOMMAND_DOWN: nSlotId = FN_LINE_DOWN; break; + case DICTATIONCOMMAND_UNDO: nSlotId = SID_UNDO; break; + case DICTATIONCOMMAND_REPEAT: nSlotId = SID_REPEAT; break; + case DICTATIONCOMMAND_DEL: nSlotId = FN_DELETE_BACK_WORD; break; + + case DICTATIONCOMMAND_BOLD_ON: nSlotId = SID_ATTR_CHAR_WEIGHT; pItem = new SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ); break; - case DICTATIONCOMMAND_BOLD_OFF: nSlotId = SID_ATTR_CHAR_WEIGHT; + case DICTATIONCOMMAND_BOLD_OFF: nSlotId = SID_ATTR_CHAR_WEIGHT; pItem = new SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_WEIGHT ); break; - case DICTATIONCOMMAND_UNDERLINE_ON: nSlotId = SID_ATTR_CHAR_UNDERLINE; + case DICTATIONCOMMAND_UNDERLINE_ON: nSlotId = SID_ATTR_CHAR_UNDERLINE; pItem = new SvxUnderlineItem( UNDERLINE_SINGLE, RES_CHRATR_WEIGHT ); break; case DICTATIONCOMMAND_UNDERLINE_OFF:nSlotId = SID_ATTR_CHAR_UNDERLINE; pItem = new SvxUnderlineItem( UNDERLINE_NONE, RES_CHRATR_UNDERLINE ); break; - case DICTATIONCOMMAND_ITALIC_ON: nSlotId = SID_ATTR_CHAR_POSTURE; + case DICTATIONCOMMAND_ITALIC_ON: nSlotId = SID_ATTR_CHAR_POSTURE; pItem = new SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE ); break; - case DICTATIONCOMMAND_ITALIC_OFF: nSlotId = SID_ATTR_CHAR_POSTURE; + case DICTATIONCOMMAND_ITALIC_OFF: nSlotId = SID_ATTR_CHAR_POSTURE; pItem = new SvxPostureItem( ITALIC_NONE, RES_CHRATR_POSTURE ); break; case DICTATIONCOMMAND_NUMBERING_ON: @@ -5457,13 +5493,13 @@ void SwEditWin::SetChainMode( BOOL bOn ) uno::Reference< ::com::sun::star::accessibility::XAccessible > SwEditWin::CreateAccessible() { - vos::OGuard aGuard(Application::GetSolarMutex()); // this should have + vos::OGuard aGuard(Application::GetSolarMutex()); // this should have // happend already!!! SwWrtShell *pSh = rView.GetWrtShellPtr(); ASSERT( pSh, "no writer shell, no accessible object" ); uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc; - if( pSh ) + if( pSh ) xAcc = pSh->CreateAccessible(); return xAcc; @@ -5476,7 +5512,7 @@ void QuickHelpData::Move( QuickHelpData& rCpy ) // Pointer verschieben aArr.Insert( &rCpy.aArr ); rCpy.aArr.Remove( (USHORT)0, rCpy.aArr.Count() ); -// nTipId = rCpy.nTipId; +// nTipId = rCpy.nTipId; bClear = rCpy.bClear; nLen = rCpy.nLen; nCurArrPos = rCpy.nCurArrPos; @@ -5572,8 +5608,8 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) if( rWord.Len() + 1 < sStr.Len() && //!!! UNICODE: fehlendes interface -// pIntl->CompareEqual( rWord, sStr.Copy( 0, rWord.Len() ), -// INTN_COMPARE_IGNORECASE ) ) +// pIntl->CompareEqual( rWord, sStr.Copy( 0, rWord.Len() ), +// INTN_COMPARE_IGNORECASE ) ) COMPARE_EQUAL == rWord.CompareIgnoreCaseToAscii( sStr, rWord.Len() )) { @@ -5596,8 +5632,8 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) { const String& rS = rACLst[ nStt ]; //JP 16.06.99: Bug 66927 - only if the count of chars - // from the suggest greater as the - // actual word + // from the suggest greater as the + // actual word if( rS.Len() > rWord.Len() ) { String* pNew = new String( rS ); diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx index 44bf3263a9..363a653670 100644 --- a/sw/source/ui/docvw/postit.cxx +++ b/sw/source/ui/docvw/postit.cxx @@ -117,7 +117,6 @@ #include <sw_primitivetypes2d.hxx> #include <drawinglayer/primitive2d/primitivetools2d.hxx> -#include <drawinglayer/attribute/fillattribute.hxx> #include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx> #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx index afee05ee46..b412c7a88a 100644 --- a/sw/source/ui/docvw/romenu.cxx +++ b/sw/source/ui/docvw/romenu.cxx @@ -214,7 +214,7 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : else EnableItem( MN_READONLY_LOADGRAPHIC, FALSE ); - BOOL bReloadFrame = 0 != rSh.GetView().GetViewFrame()->GetFrame()->GetParentFrame(); + BOOL bReloadFrame = 0 != rSh.GetView().GetViewFrame()->GetFrame().GetParentFrame(); EnableItem( MN_READONLY_RELOAD_FRAME, bReloadFrame ); EnableItem( MN_READONLY_RELOAD, !bReloadFrame); @@ -222,7 +222,6 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : Check( MN_READONLY_EDITDOC, SID_EDITDOC, rDis ); Check( MN_READONLY_SELECTION_MODE, FN_READONLY_SELECTION_MODE, rDis ); Check( MN_READONLY_SOURCEVIEW, SID_SOURCEVIEW, rDis ); - Check( MN_READONLY_BROWSE_STOP, SID_BROWSE_STOP, rDis ); Check( MN_READONLY_BROWSE_BACKWARD, SID_BROWSE_BACKWARD,rDis ); Check( MN_READONLY_BROWSE_FORWARD, SID_BROWSE_FORWARD, rDis ); #ifdef WNT @@ -314,7 +313,6 @@ void SwReadOnlyPopup::Execute( Window* pWin, USHORT nId ) rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(SID_RELOAD); break; - case MN_READONLY_BROWSE_STOP: nExecId = SID_BROWSE_STOP; break; case MN_READONLY_BROWSE_BACKWARD: nExecId = SID_BROWSE_BACKWARD;break; case MN_READONLY_BROWSE_FORWARD: nExecId = SID_BROWSE_FORWARD; break; case MN_READONLY_SOURCEVIEW: nExecId = SID_SOURCEVIEW; break; diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index d311d29c6c..a80438afe8 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -65,7 +65,7 @@ #include <com/sun/star/sdbc/XDataSource.hpp> #include <toolkit/unohlp.hxx> #include <comphelper/processfactory.hxx> -#include <com/sun/star/form/XFormController.hpp> +#include <com/sun/star/form/runtime/XFormController.hpp> #include <cppuhelper/implbase1.hxx> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/container/XContainerQuery.hpp> @@ -96,7 +96,7 @@ using namespace ::com::sun::star::ui::dialogs; ---------------------------------------------------------------------------*/ struct SwMailMergeDlg_Impl { - uno::Reference<XFormController> xFController; + uno::Reference<runtime::XFormController> xFController; uno::Reference<XSelectionChangeListener> xChgLstnr; uno::Reference<XSelectionSupplier> xSelSupp; }; @@ -329,7 +329,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, pBeamerWin->Show(); } uno::Reference<XController> xController = xFrame->getController(); - pImpl->xFController = uno::Reference<XFormController>(xController, UNO_QUERY); + pImpl->xFController = uno::Reference<runtime::XFormController>(xController, UNO_QUERY); if(pImpl->xFController.is()) { uno::Reference< awt::XControl > xCtrl = pImpl->xFController->getCurrentControl( ); diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index a905de6b30..76f0fbcfc7 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -407,7 +407,7 @@ IMPL_LINK( SwFldEditDlg, AddressHdl, PushButton *, EMPTYARG ) DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aSet, - pSh->GetView().GetViewFrame()->GetFrame()->GetFrameInterface(), + pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RC_DLG_ADDR ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index e93686f707..644565b9bb 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -567,7 +567,7 @@ void SwTemplateDlg::PageCreated( USHORT nId, SfxTabPage &rPage ) SfxAllItemSet aNewSet(*aSet.GetPool()); aNewSet.Put( SwMacroAssignDlg::AddEvents(MACASSGN_ALLFRM) ); if ( pWrtShell ) - rPage.SetFrame( pWrtShell->GetView().GetViewFrame()->GetFrame()->GetFrameInterface() ); + rPage.SetFrame( pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface() ); rPage.PageCreated(aNewSet); break; } diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx index c69a2b5601..413845f1eb 100644 --- a/sw/source/ui/frmdlg/frmdlg.cxx +++ b/sw/source/ui/frmdlg/frmdlg.cxx @@ -193,7 +193,7 @@ void SwFrmDlg::PageCreated( USHORT nId, SfxTabPage &rPage ) aNewSet.Put( SwMacroAssignDlg::AddEvents( DLG_FRM_GRF == m_nDlgType ? MACASSGN_GRAPHIC : DLG_FRM_OLE == m_nDlgType ? MACASSGN_OLE : MACASSGN_FRMURL ) ); if ( m_pWrtShell ) - rPage.SetFrame( m_pWrtShell->GetView().GetViewFrame()->GetFrame()->GetFrameInterface() ); + rPage.SetFrame( m_pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface() ); rPage.PageCreated(aNewSet); break; } diff --git a/sw/source/ui/inc/tbxmgr.hxx b/sw/source/ui/inc/tbxmgr.hxx deleted file mode 100644 index 4a744f8e66..0000000000 --- a/sw/source/ui/inc/tbxmgr.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _TBXMGR_HXX -#define _TBXMGR_HXX - -#include <svx/tbxdraw.hxx> -/* -class SwPopupWindowTbxMgr : public SvxPopupWindowTbxMgr -{ - BOOL bWeb:1; //gilt der WebMode? - ResId aRIdWinTemp; - ResId aRIdTbxTemp; - WindowAlign eAlignment; - SfxBindings& mrBindings; - -public: - SwPopupWindowTbxMgr( USHORT nId, - WindowAlign eAlign, - ResId aRIdWin, - ResId aRIdTbx, - SfxBindings& rBindings ); - - virtual void StateChanged(USHORT nSID, SfxItemState eState, const SfxPoolItem* pState); - virtual SfxPopupWindow* Clone() const; -}; -*/ - -#endif // _TBX_DRAW_HXX diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index a155a15f65..4712c76e24 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -40,6 +40,7 @@ #include <swtypes.hxx> #include <shellid.hxx> #include <layout/layout.hxx> +#include <IMark.hxx> class SwBaseShell; class Button; @@ -92,6 +93,7 @@ struct SwConversionArgs; class Graphic; class GraphicFilter; class SwPostItMgr; +class SwFieldBookmark; namespace com{ namespace sun { namespace star { namespace view{ class XSelectionSupplier; } @@ -463,7 +465,7 @@ public: DECL_LINK( SpellError, LanguageType * ); BOOL ExecSpellPopup( const Point& rPt ); - + BOOL ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM ); // SMARTTAGS BOOL ExecSmartTagPopup( const Point& rPt ); diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index 9a95d3d3c6..14b26c0391 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -32,6 +32,7 @@ #include <fesh.hxx> #include <sortopt.hxx> #include <swurl.hxx> +#include <IMark.hxx> class Window; class OutputDevice; @@ -319,6 +320,9 @@ typedef BOOL (SwWrtShell:: *FNSimpleMove)(); void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0); BOOL UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0); + // new fields + BOOL UpdateField( sw::mark::IFieldmark &fieldBM); + // Numerierung und Bullets /** Turns on numbering or bullets. diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 7b96817fe8..02a342e02f 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -275,7 +275,7 @@ USHORT SwSpellPopup::fillLangPopupMenu( //6--all languages used in current document uno::Reference< com::sun::star::frame::XModel > xModel; - uno::Reference< com::sun::star::frame::XController > xController( pWrtSh->GetView().GetViewFrame()->GetFrame()->GetFrameInterface()->getController(), uno::UNO_QUERY ); + uno::Reference< com::sun::star::frame::XController > xController( pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface()->getController(), uno::UNO_QUERY ); if ( xController.is() ) xModel = xController->getModel(); @@ -576,7 +576,7 @@ bGrammarResults(false) nNumLanguageDocEntries = fillLangPopupMenu( pMenu, MN_LANGUAGE_ALL_TEXT_START, aSeq, pWrtSh, 2 ); EnableItem( MN_LANGUAGE_ALL_TEXT, true ); */ - uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame()->GetFrameInterface(); + uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(); Image rImg = ::GetImage( xFrame, ::rtl::OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False, Application::GetSettings().GetStyleSettings().GetHighContrastMode() ); @@ -710,7 +710,7 @@ aInfo16( SW_RES(IMG_INFO_16) ) nNumLanguageDocEntries = fillLangPopupMenu( pMenu, MN_LANGUAGE_ALL_TEXT_START, aSeq, pWrtSh, 2 ); EnableItem( MN_LANGUAGE_ALL_TEXT, true ); */ - uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame()->GetFrameInterface(); + uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(); Image rImg = ::GetImage( xFrame, ::rtl::OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False, Application::GetSettings().GetStyleSettings().GetHighContrastMode() ); diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index d11dc8e42a..faec81b639 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -638,7 +638,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) const SfxPoolItem* pItem; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SfxAbstractDialog* pMacroDlg = pFact->CreateSfxDialog( this, aSet, - pSh->GetView().GetViewFrame()->GetFrame()->GetFrameInterface(), SID_EVENTCONFIG ); + pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(), SID_EVENTCONFIG ); if ( pMacroDlg && pMacroDlg->Execute() == RET_OK && SFX_ITEM_SET == pMacroDlg->GetOutputItemSet()->GetItemState( RES_FRMMACRO, sal_False, &pItem ) ) { diff --git a/sw/source/ui/misc/glshell.cxx b/sw/source/ui/misc/glshell.cxx index a7f5224c84..d25c570ed0 100644 --- a/sw/source/ui/misc/glshell.cxx +++ b/sw/source/ui/misc/glshell.cxx @@ -306,7 +306,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS } // Dokumenttitel setzen - SfxViewFrame* pFrame = SfxViewFrame::CreateViewFrame( *xDocSh, nViewId, !bShow ); + SfxViewFrame* pFrame = bShow ? SfxViewFrame::LoadDocument( *xDocSh, nViewId ) : SfxViewFrame::LoadHiddenDocument( *xDocSh, nViewId ); String aDocTitle(SW_RES( STR_GLOSSARY )); aDocTitle += ' '; aDocTitle += sLongName; @@ -343,7 +343,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS xDocSh->GetDoc()->DoUndo( bDoesUndo ); xDocSh->GetDoc()->ResetModified(); if ( bShow ) - pFrame->GetFrame()->Appear(); + pFrame->GetFrame().Appear(); delete pGroup; } diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index f7cbb9a88b..586de971fd 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -173,7 +173,7 @@ IMPL_LINK( SwInsFootNoteDlg, NumberExtCharHdl, Button *, EMPTYARG ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aAllSet, - rSh.GetView().GetViewFrame()->GetFrame()->GetFrameInterface(), RID_SVXDLG_CHARMAP ); + rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP ); if (RET_OK == pDlg->Execute()) { SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP, FALSE ); diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index c121028ea3..fcac632511 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -393,7 +393,7 @@ IMPL_LINK( SwSortDlg, DelimCharHdl, PushButton*, EMPTYARG ) SfxAllItemSet aSet( rSh.GetAttrPool() ); aSet.Put( SfxInt32Item( SID_ATTR_CHAR, GetDelimChar() ) ); SfxAbstractDialog* pMap = pFact->CreateSfxDialog( &aDelimPB, aSet, - rSh.GetView().GetViewFrame()->GetFrame()->GetFrameInterface(), RID_SVXDLG_CHARMAP ); + rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP ); if( RET_OK == pMap->Execute() ) { SFX_ITEMSET_ARG( pMap->GetOutputItemSet(), pItem, SfxInt32Item, SID_ATTR_CHAR, FALSE ); diff --git a/sw/source/ui/ribbar/tblctrl.cxx b/sw/source/ui/ribbar/tblctrl.cxx index 96a03fe357..dbbbfcb44a 100644 --- a/sw/source/ui/ribbar/tblctrl.cxx +++ b/sw/source/ui/ribbar/tblctrl.cxx @@ -36,7 +36,6 @@ #include "cmdid.h" #include "swtypes.hxx" -#include "tbxmgr.hxx" #include "tblctrl.hxx" #include "tblctrl.hrc" diff --git a/sw/source/ui/ribbar/tbxmgr.cxx b/sw/source/ui/ribbar/tbxmgr.cxx deleted file mode 100644 index c4f05a7b6e..0000000000 --- a/sw/source/ui/ribbar/tbxmgr.cxx +++ /dev/null @@ -1,180 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" - - - -#include "cmdid.h" -#include "swtypes.hxx" // nur wegen aEmptyString?? -#include "errhdl.hxx" -#include "wdocsh.hxx" -#include "tbxmgr.hxx" - - -/************************************************************************* -|* -|* -|* -\************************************************************************/ -/* -SwPopupWindowTbxMgr::SwPopupWindowTbxMgr( USHORT nId, WindowAlign eAlign, - ResId aRIdWin, ResId aRIdTbx, - SfxBindings& rBindings ) : - SvxPopupWindowTbxMgr( nId, eAlign, aRIdWin, aRIdTbx ), - bWeb(FALSE), - aRIdWinTemp(aRIdWin), - aRIdTbxTemp(aRIdTbx), - eAlignment( eAlign ), - mrBindings( rBindings ) -{ - SfxObjectShell* pObjShell = SfxObjectShell::Current(); - if(PTR_CAST(SwWebDocShell, pObjShell)) - { - bWeb = TRUE; - ToolBox& rTbx = GetTbxMgr().GetToolBox(); - // jetzt muessen ein paar Items aus der Toolbox versteckt werden: - switch(nId) - { - case FN_INSERT_CTRL: - rTbx.ShowItem(FN_INSERT_FRAME_INTERACT_NOCOL); - rTbx.HideItem(FN_INSERT_FRAME_INTERACT); - rTbx.HideItem(FN_INSERT_FOOTNOTE); - rTbx.HideItem(FN_INSERT_ENDNOTE); - rTbx.HideItem(FN_PAGE_STYLE_SET_COLS); - rTbx.HideItem(FN_INSERT_IDX_ENTRY_DLG); - - break; - case FN_INSERT_FIELD_CTRL: - rTbx.HideItem(FN_INSERT_FLD_PGNUMBER); - rTbx.HideItem(FN_INSERT_FLD_PGCOUNT); - rTbx.HideItem(FN_INSERT_FLD_TOPIC); - rTbx.HideItem(FN_INSERT_FLD_TITLE); - break; - } - } - else if( FN_INSERT_CTRL == nId) - { - ToolBox& rTbx = GetTbxMgr().GetToolBox(); - rTbx.ShowItem(FN_INSERT_FRAME_INTERACT); - rTbx.HideItem(FN_INSERT_FRAME_INTERACT_NOCOL); - } - - Size aSize = GetTbxMgr().CalcWindowSizePixel(); - GetTbxMgr().SetPosSizePixel( Point(), aSize ); - SetOutputSizePixel( aSize ); -} -*/ -/************************************************************************* -|* -|* -|* -\************************************************************************/ -/* -void SwPopupWindowTbxMgr::StateChanged(USHORT nSID, SfxItemState eState, - const SfxPoolItem* pState) -{ - static USHORT __READONLY_DATA aInsertCtrl[] = - { - FN_INSERT_FRAME_INTERACT, - FN_INSERT_FOOTNOTE, - FN_INSERT_ENDNOTE, - FN_PAGE_STYLE_SET_COLS, - FN_INSERT_IDX_ENTRY_DLG, - 0 - }; - static USHORT __READONLY_DATA aInsertFld[] = - { - FN_INSERT_FLD_PGNUMBER, - FN_INSERT_FLD_PGCOUNT, - FN_INSERT_FLD_TOPIC, - FN_INSERT_FLD_TITLE, - 0 - }; - - SfxObjectShell* pObjShell = SfxObjectShell::Current(); - BOOL bNewWeb = 0 != PTR_CAST(SwWebDocShell, pObjShell); - - if(bWeb != bNewWeb) - { - bWeb = bNewWeb; - ToolBox& rTbx = GetTbxMgr().GetToolBox(); - // jetzt muessen ein paar Items aus der Toolbox versteckt werden: - const USHORT* pSid = 0; - - switch(nSID) - { - case FN_INSERT_CTRL: - pSid = &aInsertCtrl[0]; - if(bWeb) - rTbx.ShowItem(FN_INSERT_FRAME_INTERACT_NOCOL); - else - rTbx.HideItem(FN_INSERT_FRAME_INTERACT_NOCOL); - break; - case FN_INSERT_FIELD_CTRL: - pSid = & aInsertFld[0]; - break; - } - if(pSid) - { - if(bWeb) - while(*pSid) - { - rTbx.HideItem(*pSid); - pSid++; - } - else - while(*pSid) - { - rTbx.ShowItem(*pSid); - pSid++; - } - Size aSize = GetTbxMgr().CalcWindowSizePixel(); - GetTbxMgr().SetPosSizePixel( Point(), aSize ); - SetOutputSizePixel( aSize ); - } - } - - SfxPopupWindow::StateChanged(nSID, eState, pState); -} -*/ -/* -SfxPopupWindow* SwPopupWindowTbxMgr::Clone() const -{ - return new SwPopupWindowTbxMgr( - GetId(), - eAlignment, -// ((SwPopupWindowTbxMgr*)this)->GetTbxMgr().GetToolBox().GetAlign(), - aRIdWinTemp, - aRIdTbxTemp, - mrBindings -// (SfxBindings&)GetBindings() - ); -} -*/ - diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx index fbf42ecc08..bb69819b8d 100644 --- a/sw/source/ui/ribbar/workctrl.cxx +++ b/sw/source/ui/ribbar/workctrl.cxx @@ -50,7 +50,6 @@ #include <gloshdl.hxx> #include <glosdoc.hxx> #include <gloslst.hxx> -#include <tbxmgr.hxx> #include <workctrl.hxx> #ifndef _WORKCTRL_HRC #include <workctrl.hrc> diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 930546880e..6d2f209148 100755 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -1554,7 +1554,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) // Wenn Zeichen selektiert ist kann es angezeigt werden SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( rView.GetWindow(), aAllSet, - rView.GetViewFrame()->GetFrame()->GetFrameInterface(), RID_SVXDLG_CHARMAP ); + rView.GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP ); USHORT nResult = pDlg->Execute(); if( nResult == RET_OK ) diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 272a6bf7a5..19b149c20d 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -186,7 +186,7 @@ void lcl_UpdateIMapDlg( SwWrtShell& rSh ) void* pEditObj = GRAPHIC_NONE != nGrfType && GRAPHIC_DEFAULT != nGrfType ? rSh.GetIMapInventor() : 0; TargetList* pList = new TargetList; - rSh.GetView().GetViewFrame()->GetTopFrame()->GetTargetList(*pList); + rSh.GetView().GetViewFrame()->GetTopFrame().GetTargetList(*pList); SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); rSh.GetFlyFrmAttr( aSet ); @@ -2555,7 +2555,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) SvxBrushItem aBrush(RES_BACKGROUND); rSh.GetBoxBackground( aBrush ); pDlg = pFact->CreateSfxDialog( pMDI, aSet, - rView.GetViewFrame()->GetFrame()->GetFrameInterface(), + rView.GetViewFrame()->GetFrame().GetFrameInterface(), RC_SWDLG_BACKGROUND ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); aSet.Put( aBrush ); @@ -2574,7 +2574,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) rSh.GetFlyFrmAttr( aSet ); pDlg = pFact->CreateSfxDialog( pMDI, aSet, - rView.GetViewFrame()->GetFrame()->GetFrameInterface(), + rView.GetViewFrame()->GetFrame().GetFrameInterface(), RC_SWDLG_BACKGROUND ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() == RET_OK ) @@ -2589,7 +2589,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) rSh.GetCurAttr( aSet ); pDlg = pFact->CreateSfxDialog( pMDI, aSet, - rView.GetViewFrame()->GetFrame()->GetFrameInterface(), + rView.GetViewFrame()->GetFrame().GetFrameInterface(), RC_SWDLG_BACKGROUND ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() == RET_OK ) diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index 80bf51193b..e780143cb8 100644 --- a/sw/source/ui/shells/drwtxtsh.cxx +++ b/sw/source/ui/shells/drwtxtsh.cxx @@ -809,7 +809,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) // Wenn Zeichen selektiert ist kann es angezeigt werden SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( rView.GetWindow(), aAllSet, - rView.GetViewFrame()->GetFrame()->GetFrameInterface(), RID_SVXDLG_CHARMAP ); + rView.GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP ); 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 efa01b6652..b2dfee2fa4 100644 --- a/sw/source/ui/shells/frmsh.cxx +++ b/sw/source/ui/shells/frmsh.cxx @@ -450,7 +450,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) if(pArgs && pArgs->GetItemState(FN_FORMAT_FRAME_DLG, FALSE, &pItem) == SFX_ITEM_SET) nDefPage = ((SfxUInt16Item *)pItem)->GetValue(); - aSet.Put(SfxFrameItem( SID_DOCFRAME, GetView().GetViewFrame()->GetTopFrame())); + aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame())); FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView())); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< UINT16 >(eMetric) )); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 4f7332ebbb..1ba55d45dd 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -225,7 +225,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, aUsrPref.IsKeepRatio())); aSet.Put(SfxBoolItem( SID_ATTR_GRAF_KEEP_ZOOM, aUsrPref.IsGrfKeepZoom())); - aSet.Put(SfxFrameItem( SID_DOCFRAME, GetView().GetViewFrame()->GetTopFrame())); + aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame())); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialogdiet fail!"); diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx index eb5258f373..ec0cd2a6c2 100644 --- a/sw/source/ui/shells/grfshex.cxx +++ b/sw/source/ui/shells/grfshex.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -153,7 +153,7 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq ) pObj->setURL( aURL ); rSh.EnterStdMode(); - rSh.SwFEShell::Insert( *pObj, 0, 0, &aPos ); + rSh.SwFEShell::InsertDrawObj( *pObj, aPos ); bRet = true; if( pWindow ) diff --git a/sw/source/ui/shells/makefile.mk b/sw/source/ui/shells/makefile.mk index 4123040225..e9a03a5a41 100644 --- a/sw/source/ui/shells/makefile.mk +++ b/sw/source/ui/shells/makefile.mk @@ -73,6 +73,7 @@ SLOFILES = \ $(SLO)$/txtnum.obj EXCEPTIONSFILES = \ + $(SLO)$/basesh.obj \ $(SLO)$/annotsh.obj \ $(SLO)$/drwtxtsh.obj \ $(SLO)$/textsh.obj \ diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index 9c2658c5fc..3e17c83893 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -729,7 +729,7 @@ void SwTableShell::Execute(SfxRequest &rReq) DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(),aCoreSet, - pView->GetViewFrame()->GetFrame()->GetFrameInterface(), + pView->GetViewFrame()->GetFrame().GetFrameInterface(), RC_DLG_SWNUMFMTDLG ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 1394552f46..60c02e5f0b 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -1140,7 +1140,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(), aAllSet, - GetView().GetViewFrame()->GetFrame()->GetFrameInterface(), RID_SVXDLG_CHARMAP ); + GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP ); if( RET_OK == pDlg->Execute() ) { SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP, FALSE ); diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx index 0d74c930e5..10547000c5 100644 --- a/sw/source/ui/shells/txtattr.cxx +++ b/sw/source/ui/shells/txtattr.cxx @@ -561,7 +561,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(), aSet, - rSh.GetView().GetViewFrame()->GetFrame()->GetFrameInterface(), DLG_SWDROPCAPS ); + rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), DLG_SWDROPCAPS ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); if (pDlg->Execute() == RET_OK) { diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 0d7482f521..2d1ed91ef7 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -44,7 +44,6 @@ #include <sfx2/printer.hxx> #include <sfx2/progress.hxx> #include <sfx2/app.hxx> -#include <sfx2/topfrm.hxx> #include <sfx2/bindings.hxx> #include <sfx2/request.hxx> #include <sfx2/dispatch.hxx> @@ -128,8 +127,7 @@ SFX_IMPL_INTERFACE(SwPagePreView, SfxViewShell, SW_RES(RID_PVIEW_TOOLBOX)) TYPEINIT1(SwPagePreView,SfxViewShell) -#define SWVIEWFLAGS ( SFX_VIEW_MAXIMIZE_FIRST|SFX_VIEW_OPTIMIZE_EACH| \ - SFX_VIEW_CAN_PRINT|SFX_VIEW_HAS_PRINTOPTIONS ) +#define SWVIEWFLAGS ( SFX_VIEW_CAN_PRINT|SFX_VIEW_HAS_PRINTOPTIONS ) #define MIN_PREVIEW_ZOOM 25 #define MAX_PREVIEW_ZOOM 600 @@ -1566,7 +1564,8 @@ void SwPagePreView::GetState( SfxItemSet& rSet ) ASSERT(nWhich, leeres Set); SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); //#106746# zoom has to be disabled if Accessibility support is switched on - BOOL bZoomEnabled = !Application::GetSettings().GetMiscSettings().GetEnableATToolSupport(); + // MT 2010/01, see #110498# + BOOL bZoomEnabled = TRUE; // !Application::GetSettings().GetMiscSettings().GetEnableATToolSupport(); while(nWhich) { @@ -1816,7 +1815,7 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): pPageUpBtn(0), pPageDownBtn(0), pScrollFill(new ScrollBarBox( &pViewFrame->GetWindow(), - pViewFrame->GetFrame()->GetParentFrame() ? 0 : WB_SIZEABLE )), + pViewFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )), mnPageCount( 0 ), // OD 09.01.2003 #106334# mbResetFormDesignMode( false ), @@ -1901,15 +1900,13 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): delete pPageDownBtn; /* SfxObjectShell* pDocSh = GetDocShell(); - TypeId aType = TYPE( SfxTopViewFrame ); - - for( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocSh, aType ); - pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh, aType ) ) + for( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocSh ); + pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh ) ) if( pFrame != GetViewFrame() ) { // es gibt noch eine weitere Sicht auf unser Dokument, also // aktiviere dieses - pFrame->GetFrame()->Appear(); + pFrame->GetFrame().Appear(); break; } */} @@ -2086,8 +2083,11 @@ void SwPagePreView::OuterResizePixel( const Point &rOfst, const Size &rSize ) //Aufruf der DocSzChgd-Methode der Scrollbars ist noetig, da vom maximalen //Scrollrange immer die halbe Hoehe der VisArea abgezogen wird. - if ( pVScrollbar ) - ScrollDocSzChg(); + if ( pVScrollbar && + aTmpSize.Width() > 0 && aTmpSize.Height() > 0 ) + { + ScrollDocSzChg(); + } } /*-------------------------------------------------------------------- diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 65cf77b41f..aaa1e80808 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -111,9 +111,7 @@ using ::rtl::OUString; using ::com::sun::star::util::SearchOptions; -#define SWSRCVIEWFLAGS ( SFX_VIEW_MAXIMIZE_FIRST| \ - SFX_VIEW_OBJECTSIZE_EMBEDDED| \ - SFX_VIEW_CAN_PRINT|\ +#define SWSRCVIEWFLAGS ( SFX_VIEW_CAN_PRINT|\ SFX_VIEW_NO_NEWWINDOW ) #define SRC_SEARCHOPTIONS (0xFFFF & ~(SEARCH_OPTIONS_FORMAT|SEARCH_OPTIONS_FAMILIES|SEARCH_OPTIONS_SEARCH_ALL)) diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 521f8755b7..76b2ed5f50 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -127,14 +127,9 @@ using ::rtl::OUStringBuffer; extern sal_Bool bNoInterrupt; // in mainwn.cxx -#define SWVIEWFLAGS ( SFX_VIEW_MAXIMIZE_FIRST| \ - SFX_VIEW_OBJECTSIZE_EMBEDDED| \ - SFX_VIEW_CAN_PRINT| \ +#define SWVIEWFLAGS ( SFX_VIEW_CAN_PRINT| \ SFX_VIEW_HAS_PRINTOPTIONS) -//MA 06. Nov. 95: Each raus in Absprache mit MI wg. Bug 21523 -// SFX_VIEW_OPTIMIZE_EACH| - /*-------------------------------------------------------------------- Beschreibung: Statics --------------------------------------------------------------------*/ @@ -174,7 +169,7 @@ inline SfxDispatcher &SwView::GetDispatcher() void SwView::ImpSetVerb( int nSelType ) { sal_Bool bResetVerbs = bVerbsActive; - if ( !GetViewFrame()->GetFrame()->IsInPlace() && + if ( !GetViewFrame()->GetFrame().IsInPlace() && (nsSelectionType::SEL_OLE|nsSelectionType::SEL_GRF) & nSelType ) { if ( !pWrtShell->IsSelObjProtected(FLYPROTECT_CONTENT) ) @@ -756,7 +751,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) pFormShell(0), pHScrollbar(0), pVScrollbar(0), - pScrollFill(new ScrollBarBox( &_pFrame->GetWindow(), _pFrame->GetFrame()->GetParentFrame() ? 0 : WB_SIZEABLE )), + pScrollFill(new ScrollBarBox( &_pFrame->GetWindow(), _pFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )), pHRuler( new SvxRuler(&GetViewFrame()->GetWindow(), pEditWin, SVXRULER_SUPPORT_TABS | SVXRULER_SUPPORT_PARAGRAPH_MARGINS | @@ -928,10 +923,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) if( SFX_CREATE_MODE_EMBEDDED != pDocSh->GetCreateMode() ) aBrwsBorder = GetMargin(); - if( _pFrame->GetFrameType() & SFXFRAME_INTERNAL ) - pWrtShell->SetFrameView( aBrwsBorder ); - else - pWrtShell->SetBrowseBorder( aBrwsBorder ); + pWrtShell->SetBrowseBorder( aBrwsBorder ); // Im CTOR duerfen keine Shell wechsel erfolgen, die muessen ueber // den Timer "zwischen gespeichert" werden. Sonst raeumt der SFX @@ -943,7 +935,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) pVRuler->SetActive( sal_True ); SfxViewFrame* pViewFrame = GetViewFrame(); - if( pViewFrame->GetFrame()->GetParentFrame()) + if( pViewFrame->GetFrame().GetParentFrame()) { aUsrPref.SetViewHRuler(sal_False); aUsrPref.SetViewVRuler(sal_False); @@ -1002,13 +994,6 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) pWrtShell->SetReadOnlyAvailable( aUsrPref.IsCursorInProtectedArea() ); pWrtShell->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions()); - if( UseObjectSize() ) - { - //Damit der Sfx _rechtzeitig weiss_, wie gross die sheet::Border sind. - SvBorder aTmp; - CalcAndSetBorderPixel( aTmp, sal_True ); - } - if( pWrtShell->GetDoc()->IsUpdateExpFld() ) { SET_CURR_SHELL( pWrtShell ); @@ -1057,10 +1042,10 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) /*uno::Reference< awt::XWindow > aTmpRef; - _pFrame->GetFrame()->GetFrameInterface()->setComponent( aTmpRef, + _pFrame->GetFrame().GetFrameInterface()->setComponent( aTmpRef, pViewImpl->GetUNOObject_Impl());*/ - uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame()->GetFrameInterface(); + uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface(); uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame( OUString::createFromAscii("_beamer"), frame::FrameSearchFlag::CHILDREN); @@ -1622,7 +1607,7 @@ void SwView::ShowCursor( FASTBOOL bOn ) ErrCode SwView::DoVerb( long nVerb ) { - if ( !GetViewFrame()->GetFrame()->IsInPlace() ) + if ( !GetViewFrame()->GetFrame().IsInPlace() ) { SwWrtShell &rSh = GetWrtShell(); const int nSel = rSh.GetSelectionType(); diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 780086ac2c..2b0827ee47 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -72,7 +72,6 @@ #include <sfx2/fcontnr.hxx> #include <editeng/sizeitem.hxx> #include <sfx2/dispatch.hxx> -#include <sfx2/topfrm.hxx> #include <svl/whiter.hxx> #include <svl/ptitem.hxx> #include <sfx2/linkmgr.hxx> @@ -1028,7 +1027,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) if(bQuery) { SfxViewFrame* pTmpFrame = GetViewFrame(); - SfxHelp::OpenHelpAgent( pTmpFrame->GetFrame(), HID_MAIL_MERGE_SELECT ); + SfxHelp::OpenHelpAgent( &pTmpFrame->GetFrame(), HID_MAIL_MERGE_SELECT ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialogdiet fail!"); AbstractMailMergeCreateFromDlg* pDlg = pFact->CreateMailMergeCreateFromDlg( DLG_MERGE_CREATE, diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx index 8d67a14603..f35e5570f1 100644 --- a/sw/source/ui/uiview/viewdraw.cxx +++ b/sw/source/ui/uiview/viewdraw.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -171,7 +171,7 @@ void SwView::ExecDraw(SfxRequest& rReq) // TODO: unmark all other pWrtShell->EnterStdMode(); - pWrtShell->SwFEShell::Insert( *pObj, 0, 0, &aStartPos ); + pWrtShell->SwFEShell::InsertDrawObj( *pObj, aStartPos ); } } } @@ -218,7 +218,7 @@ void SwView::ExecDraw(SfxRequest& rReq) aSize = Size( 2835, 2835 ); pWrtShell->EnterStdMode(); - pWrtShell->SwFEShell::Insert( *pObj, 0, 0, &aPos ); + pWrtShell->SwFEShell::InsertDrawObj( *pObj, aPos ); rReq.Ignore (); } } @@ -243,8 +243,8 @@ void SwView::ExecDraw(SfxRequest& rReq) } //deselect if same shape is selected again (but different custom shapes do have same slot id) - if ( bDeselect || (nSlotId == nDrawSfxId && - (!pStringItem || (pStringItem->GetValue() == sDrawCustom)) + if ( bDeselect || (nSlotId == nDrawSfxId && + (!pStringItem || (pStringItem->GetValue() == sDrawCustom)) && (nSlotId != SID_DRAW_CS_ID) ) ) { if (GetDrawFuncPtr()) @@ -418,7 +418,7 @@ void SwView::ExitDraw() NoRotate(); if(pShell) - { + { //#126062 # the shell may be invalid at close/reload/SwitchToViewShell SfxDispatcher* pDispatch = GetViewFrame()->GetDispatcher(); USHORT nIdx = 0; @@ -428,7 +428,7 @@ void SwView::ExitDraw() pTest = pDispatch->GetShell(nIdx++); } while( pTest && pTest != this && pTest != pShell); - if(pTest == pShell && + if(pTest == pShell && // don't call LeaveSelFrmMode() etc. for the below, // because objects may still be selected: !pShell->ISA(SwDrawBaseShell) && diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx index 16bfbdfd11..5ccb5f8093 100644 --- a/sw/source/ui/uiview/viewling.cxx +++ b/sw/source/ui/uiview/viewling.cxx @@ -70,7 +70,7 @@ #include <edtwin.hxx> #include <crsskip.hxx> #include <ndtxt.hxx> - +#include <vcl/lstbox.hxx> #include <cmdid.h> #include <globals.hrc> #include <comcore.hrc> // STR_MULT_INTERACT_SPELL_WARN @@ -97,10 +97,13 @@ #include <svx/dialogs.hrc> #include <svtools/langtab.hxx> #include <unomid.h> +#include <IMark.hxx> +#include <xmloff/odffields.hxx> #include <memory> #include <editeng/editerr.hxx> +using namespace sw::mark; using ::rtl::OUString; using namespace ::com::sun::star; using namespace ::com::sun::star::beans; @@ -827,10 +830,9 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt) else { SfxViewFrame *pSfxViewFrame = GetViewFrame(); - SfxFrame *pSfxFrame = pSfxViewFrame? pSfxViewFrame->GetFrame() : 0; uno::Reference< frame::XFrame > xFrame; - if (pSfxFrame) - xFrame = pSfxFrame->GetFrameInterface(); + if ( pSfxViewFrame ) + xFrame = pSfxViewFrame->GetFrame().GetFrameInterface(); com::sun::star::util::URL aURL; uno::Reference< frame::XDispatchProvider > xDispatchProvider( xFrame, UNO_QUERY ); uno::Reference< lang::XMultiServiceFactory > xMgr( utl::getProcessServiceFactory(), uno::UNO_QUERY ); @@ -916,3 +918,142 @@ sal_Bool SwView::ExecSmartTagPopup( const Point& rPt ) return bRet; } + + +class SwFieldPopup : public PopupMenu +{ +public: + SwFieldPopup() { + InsertItem(1, ::rtl::OUString::createFromAscii("Hello")); + } +}; + +class SwFieldListBox : public ListBox +{ +public: + SwFieldListBox(Window* pParent) : ListBox(pParent /*, WB_DROPDOWN*/) { + } + + void *GetImplWin() { + return NULL; //FIXME!!! +// return mpImplWin; + } + +protected: + virtual void LoseFocus() { +// printf("ListBox: lose focus!!\n"); + ListBox::LoseFocus(); + } + + virtual void Select() { +// printf("SELECT!!! IsTravelSelect=%i\n", IsTravelSelect()); + ListBox::Select(); + } +}; + +class SwFieldDialog : public Dialog +{ +private: + SwFieldListBox aListBox; + Edit aText; + int selection; + + DECL_LINK( MyListBoxHandler, ListBox * ); + +public: + SwFieldDialog(Window* parent, IFieldmark *fieldBM) : Dialog(parent, WB_BORDER | WB_SYSTEMWINDOW | WB_NOSHADOW ), aListBox(this), aText(this, WB_RIGHT | WB_READONLY), selection(-1) { + + assert(fieldBM!=NULL); + if (fieldBM!=NULL) { + const IFieldmark::parameter_map_t* const pParameters = fieldBM->GetParameters(); + IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)); + if(pListEntries != pParameters->end()) + { + Sequence< ::rtl::OUString> vListEntries; + pListEntries->second >>= vListEntries; + for( ::rtl::OUString* pCurrent = vListEntries.getArray(); + pCurrent != vListEntries.getArray() + vListEntries.getLength(); + ++pCurrent) + { + aListBox.InsertEntry(*pCurrent); + } + } + } + Size lbSize=aListBox.GetOptimalSize(WINDOWSIZE_PREFERRED); + lbSize.Width()+=50; + lbSize.Height()+=20; + aListBox.SetSizePixel(lbSize); + aListBox.SetSelectHdl( LINK( this, SwFieldDialog, MyListBoxHandler ) ); + aListBox.Show(); + aText.SetText(rtl::OUString::createFromAscii("Cancel")); + Size tSize=aText.GetOptimalSize(WINDOWSIZE_PREFERRED); + aText.SetSizePixel(Size(lbSize.Width(), tSize.Height())); + aText.SetPosPixel(Point(0, lbSize.Height())); + aText.Show(); + SetSizePixel(Size(lbSize.Width(), lbSize.Height()+tSize.Height())); +// SetSizePixel(Size(200, 200)); + } + + int getSelection() { + return selection; + } +protected: + /* + virtual void LoseFocus() { + printf("lose focus!!\n"); + Dialog::LoseFocus(); + printf("close:\n"); + EndDialog(8); + } + */ + + virtual long PreNotify( NotifyEvent& rNEvt ) { + if (rNEvt.GetType() == EVENT_LOSEFOCUS && aListBox.GetImplWin()==rNEvt.GetWindow()) { + EndDialog(8); + return 1; + } + if (rNEvt.GetType() == EVENT_KEYINPUT) { +// printf("PreNotify::KEYINPUT\n"); + } + return Dialog::PreNotify(rNEvt); + } +}; + +IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox ) +{ +// printf("### DROP DOWN SELECT... IsTravelSelect=%i\n", pBox->IsTravelSelect()); + if (pBox->IsTravelSelect()) { + return 0; + } else { + this->selection=pBox->GetSelectEntryPos(); + EndDialog(9); //@TODO have meaningfull returns... + return 1; + } +} + + +BOOL SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM ) +{ + sal_Bool bRet = sal_False; + const sal_Bool bOldViewLock = pWrtShell->IsViewLocked(); + pWrtShell->LockView( sal_True ); + pWrtShell->Push(); + + bRet=sal_True; + const Point aPixPos = GetEditWin().LogicToPixel( rPt ); + + SwFieldDialog aFldDlg(pEditWin, fieldBM); + aFldDlg.SetPosPixel(pEditWin->OutputToScreenPixel(aPixPos)); + + /*short ret=*/aFldDlg.Execute(); + sal_Int32 selection=aFldDlg.getSelection(); + if (selection>=0) { + (*fieldBM->GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT)] = makeAny(selection); + } + + pWrtShell->Pop( sal_False ); + pWrtShell->LockView( bOldViewLock ); + + return bRet; +} + diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx index b6b53a7197..5bc918e377 100644 --- a/sw/source/ui/uiview/viewmdi.cxx +++ b/sw/source/ui/uiview/viewmdi.cxx @@ -178,7 +178,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, nFac = Max( long( MINZOOM ), nFac ); SwViewOption aOpt( *pOpt ); - if ( !GetViewFrame()->GetFrame()->IsInPlace() ) + if ( !GetViewFrame()->GetFrame().IsInPlace() ) { //MasterUsrPrefs updaten UND DANACH die ViewOptions der aktuellen //View updaten. @@ -261,7 +261,7 @@ void SwView::SetViewLayout( USHORT nColumns, bool bBookMode, BOOL bViewOnly ) ACT_KONTEXT(pWrtShell); - if ( !GetViewFrame()->GetFrame()->IsInPlace() && !bViewOnly ) + if ( !GetViewFrame()->GetFrame().IsInPlace() && !bViewOnly ) { const BOOL bWeb = 0 != PTR_CAST(SwWebView, this); SwMasterUsrPref *pUsrPref = (SwMasterUsrPref*)SW_MOD()->GetUsrPref(bWeb); @@ -347,7 +347,7 @@ void SwView::CreatePageButtons(BOOL bShow) pPageUpBtn->SetHelpId(HID_SCRL_PAGEUP); pPageDownBtn = new SwHlpImageButton(pMDI, SW_RES( BTN_PAGEDOWN ), FALSE ); pPageDownBtn->SetHelpId(HID_SCRL_PAGEDOWN); - Reference< XFrame > xFrame = GetViewFrame()->GetFrame()->GetFrameInterface(); + Reference< XFrame > xFrame = GetViewFrame()->GetFrame().GetFrameInterface(); pNaviBtn = new SwNaviImageButton(pMDI, xFrame ); pNaviBtn->SetHelpId(HID_SCRL_NAVI); Link aLk( LINK( this, SwView, BtnPage ) ); diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index e5258659ab..d47436aae3 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -221,7 +221,7 @@ aDocSz = rSz; SetVisArea( aNewVisArea, FALSE ); if ( UpdateScrollbars() && !bInOuterResizePixel && !bInInnerResizePixel && - !GetViewFrame()->GetFrame()->IsInPlace()) + !GetViewFrame()->GetFrame().IsInPlace()) OuterResizePixel( Point(), GetViewFrame()->GetWindow().GetOutputSizePixel() ); } @@ -355,7 +355,7 @@ void SwView::SetVisArea( const Point &rPt, BOOL bUpdateScrollbar ) void SwView::CheckVisArea() { pHScrollbar->SetAuto( pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && - !GetViewFrame()->GetFrame()->IsInPlace() ); + !GetViewFrame()->GetFrame().IsInPlace() ); if ( IsDocumentBorder() ) { if ( aVisArea.Left() != DOCUMENTBORDER || @@ -732,7 +732,7 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar ) { // JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE, // so we dont must do it agin. -// if(!GetViewFrame()->GetFrame()->IsInPlace()) +// if(!GetViewFrame()->GetFrame().IsInPlace()) // S F X_BINDINGS().Update(FN_STAT_PAGE); //QuickHelp: @@ -1053,7 +1053,7 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize ) Size aSz( rSize ); SvBorder aBorder; CalcAndSetBorderPixel( aBorder, TRUE ); - if ( GetViewFrame()->GetFrame()->IsInPlace() ) + if ( GetViewFrame()->GetFrame().IsInPlace() ) { Size aViewSize( aSz ); Point aViewPos( rOfst ); diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx index a64f4582a7..24e386259e 100644 --- a/sw/source/ui/uno/unodispatch.cxx +++ b/sw/source/ui/uno/unodispatch.cxx @@ -57,8 +57,7 @@ const sal_Char* cInternalDBChangeNotification = ".uno::Writer/DataSourceChanged" SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) : m_pView(&rVw) { - SfxFrame* pFrame = m_pView->GetViewFrame()->GetFrame(); - uno::Reference< frame::XFrame> xUnoFrame = pFrame->GetFrameInterface(); + uno::Reference< frame::XFrame> xUnoFrame = m_pView->GetViewFrame()->GetFrame().GetFrameInterface(); m_xIntercepted = uno::Reference< frame::XDispatchProviderInterception>(xUnoFrame, uno::UNO_QUERY); if(m_xIntercepted.is()) { diff --git a/sw/source/ui/uno/unodoc.cxx b/sw/source/ui/uno/unodoc.cxx index b2843ee5ae..fc0c440ff2 100644 --- a/sw/source/ui/uno/unodoc.cxx +++ b/sw/source/ui/uno/unodoc.cxx @@ -66,9 +66,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance( { ::vos::OGuard aGuard( Application::GetSolarMutex() ); SwDLL::Init(); - const SfxObjectCreateMode eCreateMode = ( _nCreationFlags & SFXMODEL_EMBEDDED_OBJECT ) ? SFX_CREATE_MODE_EMBEDDED : SFX_CREATE_MODE_STANDARD; - const bool bScriptSupport = ( _nCreationFlags & SFXMODEL_DISABLE_EMBEDDED_SCRIPTS ) == 0; - SfxObjectShell* pShell = new SwDocShell( eCreateMode, bScriptSupport ); + SfxObjectShell* pShell = new SwDocShell( _nCreationFlags ); return uno::Reference< uno::XInterface >( pShell->GetModel() ); } diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx index 3a8ee250b3..08c720d0b3 100644 --- a/sw/source/ui/uno/unomailmerge.cxx +++ b/sw/source/ui/uno/unomailmerge.cxx @@ -426,7 +426,7 @@ SwXMailMerge::SwXMailMerge() : SwDocShell *pDocShell = new SwDocShell( SFX_CREATE_MODE_STANDARD ); xDocSh = pDocShell; xDocSh->DoInitNew( 0 ); - SfxViewFrame *pFrame = SfxViewFrame::CreateViewFrame( *xDocSh, 0, TRUE ); + SfxViewFrame *pFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 ); SwView *pView = (SwView*) pFrame->GetViewShell(); pView->AttrChangedNotify( &pView->GetWrtShell() );//Damit SelectShell gerufen wird. @@ -624,7 +624,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( aCurSelection = aTranslated; } - SfxViewFrame* pFrame = SfxViewFrame::GetFirst( xCurDocSh, 0, FALSE); + SfxViewFrame* pFrame = SfxViewFrame::GetFirst( xCurDocSh, FALSE); SwView *pView = PTR_CAST( SwView, pFrame->GetViewShell() ); if (!pView) throw RuntimeException(); diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index e0834ff457..afc7581f78 100644..100755 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -35,6 +35,7 @@ #include <vcl/print.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/sfxbasecontroller.hxx> +#include <sfx2/docfile.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <toolkit/awt/vclxdevice.hxx> #include <cmdid.h> @@ -220,7 +221,6 @@ void lcl_DisposeView( SfxViewFrame* pToClose, SwDocShell* pDocShell ) { // check if the view frame still exists SfxViewFrame* pFound = SfxViewFrame::GetFirst( pDocShell, - 0, FALSE ); while(pFound) { @@ -231,7 +231,6 @@ void lcl_DisposeView( SfxViewFrame* pToClose, SwDocShell* pDocShell ) } pFound = SfxViewFrame::GetNext( *pFound, pDocShell, - 0, FALSE ); } } @@ -1223,7 +1222,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption ::vos::OGuard aGuard(Application::GetSolarMutex()); if(IsValid()) { - SfxViewFrame* pFrame = SfxViewFrame::CreateViewFrame( *pDocShell, 7, sal_True ); + SfxViewFrame* pFrame = SfxViewFrame::LoadHiddenDocument( *pDocShell, 7 ); SfxRequest aReq(FN_PRINT_PAGEPREVIEW, SFX_CALLMODE_SYNCHRON, pDocShell->GetDoc()->GetAttrPool()); aReq.AppendItem(SfxBoolItem(FN_PRINT_PAGEPREVIEW, sal_True)); @@ -2698,7 +2697,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( if (!pWrtShell) { //create a hidden view to be able to export as PDF also in print preview - m_pHiddenViewFrame = SfxViewFrame::CreateViewFrame( *pRenderDocShell, 2, TRUE ); + m_pHiddenViewFrame = SfxViewFrame::LoadHiddenDocument( *pRenderDocShell, 2 ); SwView* pSwView = (SwView*) m_pHiddenViewFrame->GetViewShell(); pWrtShell = pSwView->GetWrtShellPtr(); } @@ -2711,6 +2710,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( const TypeId aSwViewTypeId = TYPE(SwView); if (pView->IsA(aSwViewTypeId)) { + if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pWrtShell ) ) + m_pRenderData->ViewOptionAdjustStop(); if (m_pRenderData && !m_pRenderData->IsViewOptionAdjust()) m_pRenderData->ViewOptionAdjustStart( *pWrtShell, *pWrtShell->GetViewOptions() ); } @@ -2813,6 +2814,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( m_pPrintUIOptions->processProperties( rxOptions ); const bool bPrintProspect = m_pPrintUIOptions->getBoolValue( "PrintProspect", false ); const bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); + const bool bPrintPaperFromSetup = m_pPrintUIOptions->getBoolValue( "PrintPaperFromSetup", false ); SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); @@ -2840,7 +2842,21 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( uno::Sequence< beans::PropertyValue > aRenderer; if (m_pRenderData) { + const USHORT nPage = nRenderer + 1; + + // get paper tray to use ... + sal_Int32 nPrinterPaperTray = -1; + if (! bPrintPaperFromSetup) + { + // ... from individual page style (see the page tab in Format/Page dialog) + const std::map< sal_Int32, sal_Int32 > &rPaperTrays = m_pRenderData->GetPrinterPaperTrays(); + std::map< sal_Int32, sal_Int32 >::const_iterator aIt( rPaperTrays.find( nPage ) ); + if (aIt != rPaperTrays.end()) + nPrinterPaperTray = aIt->second; + } + awt::Size aPageSize; + awt::Size aPreferredPageSize; Size aTmpSize; if (bIsSwSrcView || bPrintProspect) { @@ -2858,36 +2874,49 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( Printer *pPrinter = dynamic_cast< Printer * >(lcl_GetOutputDevice( *m_pPrintUIOptions )); if (pPrinter) { + // HTML source view and prospect adapt to the printer's paper size + aTmpSize = pPrinter->GetPaperSize(); + aTmpSize = pPrinter->LogicToLogic( aTmpSize, + pPrinter->GetMapMode(), MapMode( MAP_100TH_MM )); + aPageSize = awt::Size( aTmpSize.Width(), aTmpSize.Height() ); 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() ); + // which may cause vcl to set that page size on the printer + // (if available and not overriden by the user) + aTmpSize = pDoc->GetPageSize( nPage, bIsSkipEmptyPages ); + aPreferredPageSize = awt::Size ( TWIP_TO_MM100( 2 * aTmpSize.Width() ), + TWIP_TO_MM100( aTmpSize.Height() )); } } } else { - aTmpSize = pDoc->GetPageSize( USHORT(nRenderer + 1), bIsSkipEmptyPages ); + aTmpSize = pDoc->GetPageSize( nPage, bIsSkipEmptyPages ); aPageSize = awt::Size ( TWIP_TO_MM100( aTmpSize.Width() ), TWIP_TO_MM100( aTmpSize.Height() )); } + sal_Int32 nLen = 2; 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; + if (aPreferredPageSize.Width && aPreferredPageSize.Height) + { + ++nLen; + aRenderer.realloc( nLen ); + aRenderer[ nLen - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PreferredPageSize" ) ); + aRenderer[ nLen - 1 ].Value <<= aPreferredPageSize; + } + if (nPrinterPaperTray >= 0) + { + ++nLen; + aRenderer.realloc( nLen ); + aRenderer[ nLen - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PrinterPaperTray" ) ); + aRenderer[ nLen - 1 ].Value <<= nPrinterPaperTray; + } } m_pPrintUIOptions->appendPrintUIOptions( aRenderer ); @@ -2908,7 +2937,7 @@ SfxViewShell * SwXTextDocument::GuessViewShell( SwView *pSwView = 0; SwPagePreView *pSwPagePreView = 0; SwSrcView *pSwSrcView = 0; - SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocShell, 0, sal_False ); + SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocShell, sal_False ); // look for the view shell with the same controller in use, // otherwise look for a suitable view, preferably a SwView, @@ -2927,7 +2956,7 @@ SfxViewShell * SwXTextDocument::GuessViewShell( } else if (pSwView || pSwSrcView) break; - pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, 0, sal_False ); + pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, sal_False ); } DBG_ASSERT( pSwView || pSwPagePreView || pSwSrcView, "failed to get view shell" ); @@ -3075,6 +3104,12 @@ void SAL_CALL SwXTextDocument::render( { lcl_DisposeView( m_pHiddenViewFrame, pDocShell ); m_pHiddenViewFrame = 0; + + // prevent crash described in #i108805 + SwDocShell *pRenderDocShell = pDoc->GetDocShell(); + SfxItemSet *pSet = pRenderDocShell->GetMedium()->GetItemSet(); + pSet->Put( SfxBoolItem( SID_HIDDEN, sal_False ) ); + } } } diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index d4e4f039ec..ef73263663 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -911,7 +911,7 @@ SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/ SfxObjectShellRef xDocSh( pDocSh = new SwDocShell( /*pPrtDoc, */SFX_CREATE_MODE_STANDARD ) ); xDocSh->DoInitNew( 0 ); pOldSh->FillPrtDoc(pDocSh->GetDoc(), pPrt); - SfxViewFrame* pDocFrame = SfxViewFrame::CreateViewFrame( *xDocSh, 0, TRUE ); + SfxViewFrame* pDocFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 ); SwView* pDocView = (SwView*) pDocFrame->GetViewShell(); pDocView->AttrChangedNotify( &pDocView->GetWrtShell() );//Damit SelectShell gerufen wird. SwWrtShell* pSh = pDocView->GetWrtShellPtr(); diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx index 576504f915..55276b7e33 100644 --- a/sw/source/ui/utlui/navipi.cxx +++ b/sw/source/ui/utlui/navipi.cxx @@ -500,7 +500,7 @@ void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, BOOL bSetFocus { // SfxBindings& rBind = GetCreateView()->GetViewFrame()->GetBindings(); // rBind.ENTERREGISTRATIONS(); - Reference< XFrame > xFrame = GetCreateView()->GetViewFrame()->GetFrame()->GetFrameInterface(); + Reference< XFrame > xFrame = GetCreateView()->GetViewFrame()->GetFrame().GetFrameInterface(); SwScrollNaviPopup* pPopup = new SwScrollNaviPopup(FN_SCROLL_NAVIGATION, xFrame ); diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx index c8d9bddc16..4bf6997cab 100644 --- a/sw/source/ui/utlui/numfmtlb.cxx +++ b/sw/source/ui/utlui/numfmtlb.cxx @@ -435,7 +435,7 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox ) DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aCoreSet, - GetView()->GetViewFrame()->GetFrame()->GetFrameInterface(), + GetView()->GetViewFrame()->GetFrame().GetFrameInterface(), RC_DLG_SWNUMFMTDLG ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index 12a5094dcb..c9e10d69c0 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -756,7 +756,7 @@ bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, USHORT nId } if(sCommand.Len()) { - uno::Reference< frame::XFrame > xFrame = rViewFrame.GetFrame()->GetFrameInterface(); + uno::Reference< frame::XFrame > xFrame = rViewFrame.GetFrame().GetFrameInterface(); uno::Reference < frame::XDispatchProvider > xProv( xFrame, uno::UNO_QUERY ); util::URL aURL; aURL.Complete = sCommand; diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 6ba4ff3c39..e86845f348 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -108,6 +108,8 @@ #include <paratr.hxx> #include <ndtxt.hxx> #include <editeng/acorrcfg.hxx> +//#include <svx/acorrcfg.hxx> +#include <IMark.hxx> // -> #111827# #include <SwRewriter.hxx> @@ -122,6 +124,7 @@ #include "PostItMgr.hxx" +using namespace sw::mark; using namespace com::sun::star; #define COMMON_INI_LIST \ @@ -641,7 +644,7 @@ BOOL SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrmFm void SwWrtShell::LaunchOLEObj( long nVerb ) { if ( GetCntType() == CNT_OLE && - !GetView().GetViewFrame()->GetFrame()->IsInPlace() ) + !GetView().GetViewFrame()->GetFrame().IsInPlace() ) { svt::EmbeddedObjectRef& xRef = GetOLEObject(); ASSERT( xRef.is(), "OLE not found" ); @@ -1375,10 +1378,13 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) if ( pTxtNode && ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) { - short nTxtNodeFirstLineOffset( 0 ); - pTxtNode->GetFirstLineOfsWithNum( nTxtNodeFirstLineOffset ); - const SwTwips nTxtNodeIndent = pTxtNode->GetLeftMarginForTabCalculation() + - nTxtNodeFirstLineOffset; + // --> OD 2010-01-05 #b6884103# +// short nTxtNodeFirstLineOffset( 0 ); +// pTxtNode->GetFirstLineOfsWithNum( nTxtNodeFirstLineOffset ); +// const SwTwips nTxtNodeIndent = pTxtNode->GetLeftMarginForTabCalculation() + +// nTxtNodeFirstLineOffset; + const SwTwips nTxtNodeIndent = pTxtNode->GetAdditionalIndentForStartingNewList(); + // <-- if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 ) { const SwTwips nIndentChange = nTxtNodeIndent + nWidthOfTabs; @@ -1750,6 +1756,12 @@ SwWrtShell::SwWrtShell( SwWrtShell& rSh, Window *_pWin, SwView &rShell ) SetSfxViewShell( (SfxViewShell *)&rShell ); SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) ); + + // place the cursor on the first field... + IFieldmark *pBM = NULL; + if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=NULL ) { + GotoFieldmark(pBM); + } } diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx index 062f15826b..ac874a9791 100644 --- a/sw/source/ui/wrtsh/wrtsh2.cxx +++ b/sw/source/ui/wrtsh/wrtsh2.cxx @@ -239,6 +239,13 @@ BOOL SwWrtShell::UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet) return bResult; } +BOOL SwWrtShell::UpdateField( sw::mark::IFieldmark &fieldBM ) +{ + return SwEditShell::UpdateField(fieldBM); +} + + + // ein Klick aus das angegebene Feld. Der Cursor steht auf diesem. // Fuehre die vor definierten Aktionen aus. diff --git a/sw/util/makefile.mk b/sw/util/makefile.mk index c69cec3125..557e871a74 100644 --- a/sw/util/makefile.mk +++ b/sw/util/makefile.mk @@ -134,7 +134,7 @@ DEFLIB1NAME=swall $(SWLIBFILES:b) SHL2TARGET= swd$(DLLPOSTFIX) SHL2IMPLIB= swdimp -SHL2VERSIONMAP= swd.map +SHL2VERSIONMAP=$(SOLARENV)/src/component.map SHL2DEF=$(MISC)$/$(SHL2TARGET).def DEF2NAME= $(SHL2TARGET) @@ -342,7 +342,7 @@ TARGET_VBA=vbaswobj SHL5TARGET=$(TARGET_VBA)$(DLLPOSTFIX).uno SHL5IMPLIB= i$(TARGET_VBA) -SHL5VERSIONMAP=$(TARGET_VBA).map +SHL5VERSIONMAP=$(SOLARENV)/src/component.map SHL5DEF=$(MISC)$/$(SHL5TARGET).def DEF5NAME=$(SHL5TARGET) SHL5STDLIBS= \ diff --git a/sw/util/msword.map b/sw/util/msword.map index db60fc5ce8..16b9d25b0b 100644..100755 --- a/sw/util/msword.map +++ b/sw/util/msword.map @@ -1,4 +1,4 @@ -MSWORD_1_0 { +UDK_3_0_0 { global: ImportRTF; ExportRTF; diff --git a/sw/util/sw.map b/sw/util/sw.map deleted file mode 100644 index 272fab31a0..0000000000 --- a/sw/util/sw.map +++ /dev/null @@ -1,8 +0,0 @@ -SW_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/sw/util/swd.map b/sw/util/swd.map deleted file mode 100644 index 272fab31a0..0000000000 --- a/sw/util/swd.map +++ /dev/null @@ -1,8 +0,0 @@ -SW_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/sw/util/swui.map b/sw/util/swui.map index f40bd255fe..ad5e33836c 100644 --- a/sw/util/swui.map +++ b/sw/util/swui.map @@ -1,4 +1,4 @@ -SWUI_1_0 { +UDK_3_0_0 { global: CreateDialogFactory; local: diff --git a/sw/util/vbaswobj.map b/sw/util/vbaswobj.map deleted file mode 100644 index 737cddbfe3..0000000000 --- a/sw/util/vbaswobj.map +++ /dev/null @@ -1,9 +0,0 @@ -OOO_1.1 { - global: - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; |