diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-09-09 11:45:13 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-09-09 11:45:13 +0200 |
commit | f1dd4efb7b36bd7d26ed92c7ecbbabefe67d8fb0 (patch) | |
tree | eca2eebab12da5554e210a57e5e83353cd2f6454 /svx | |
parent | dcb7e74c448f29b648d9462366b53904eb745836 (diff) | |
parent | 6738efb940d042acdeea59738b3610903ebe9a38 (diff) |
merge commit to DEV300_m57
Diffstat (limited to 'svx')
385 files changed, 9808 insertions, 9079 deletions
diff --git a/svx/inc/AccessibleSelectionBase.hxx b/svx/inc/AccessibleSelectionBase.hxx index 9fb01ce1e3..f2b06e1a57 100644 --- a/svx/inc/AccessibleSelectionBase.hxx +++ b/svx/inc/AccessibleSelectionBase.hxx @@ -34,85 +34,9 @@ #include <comphelper/accessibleselectionhelper.hxx> #include "svx/svxdllapi.h" -namespace accessibility +namespace accessibility { -/** @descr - This base class provides a base implementation of the - <type>XAccessibleSelection</type> interface. - The following methods have to be implemented if this - class is used: - - <method>implGetMutex</method>, - <method>implGetAccessibleContext</method>, - <method>implIsSelected</method>, - <method>implSelect</method>, -*/ - class SVX_DLLPUBLIC AccessibleSelectionBase : public ::comphelper::OCommonAccessibleSelection, - public ::com::sun::star::accessibility::XAccessibleSelection - { - protected: - - virtual ::osl::Mutex& implGetMutex() = 0; - - public: - - // XAccessibleSelection - default implementations - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - - public: - - AccessibleSelectionBase(); - virtual ~AccessibleSelectionBase(); - }; - -} - -#endif // _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX -/************************************************************************* - * - * 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: AccessibleSelectionBase.hxx,v $ - * $Revision: 1.6 $ - * - * 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 _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX -#define _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX - -#include <comphelper/accessibleselectionhelper.hxx> -#include "svx/svxdllapi.h" - -namespace accessibility -{ -/** @descr +/** @descr This base class provides a base implementation of the <type>XAccessibleSelection</type> interface. The following methods have to be implemented if this diff --git a/svx/inc/AccessibleStaticTextBase.hxx b/svx/inc/AccessibleStaticTextBase.hxx index bc204a3ff1..2a9fdab114 100644 --- a/svx/inc/AccessibleStaticTextBase.hxx +++ b/svx/inc/AccessibleStaticTextBase.hxx @@ -44,6 +44,7 @@ class SvxEditSource; +class SvxEditViewForwarder; namespace accessibility { @@ -266,6 +267,9 @@ namespace accessibility protected: Rectangle GetParagraphBoundingBox() const; + sal_Int32 GetParagraphCount() const; + sal_Int32 GetParagraphIndex() const; + sal_Int32 GetLineCount( sal_Int32 nParagraph ) const; private: diff --git a/svx/inc/ActionDescriptionProvider.hxx b/svx/inc/ActionDescriptionProvider.hxx index c638e7005d..68f48ca1b2 100644 --- a/svx/inc/ActionDescriptionProvider.hxx +++ b/svx/inc/ActionDescriptionProvider.hxx @@ -66,71 +66,3 @@ public: }; #endif -/************************************************************************* - * - * 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: ActionDescriptionProvider.hxx,v $ - * $Revision: 1.3 $ - * - * 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 _SVX_ACTIONDESCRIPTIONPROVIDER_HXX -#define _SVX_ACTIONDESCRIPTIONPROVIDER_HXX - -#include "svx/svxdllapi.h" - -// header for class OUString -#include <rtl/ustring.hxx> - -//----------------------------------------------------------------------------- -/** This class provides localized descriptions for some basic actions done with objects. -The strings are intended to be provided to the user e.g. as description for undo actions in the menu. -The name of the object acted on and the type of action needs to be given as input parameter. -*/ - -class SVX_DLLPUBLIC ActionDescriptionProvider -{ -public: - enum ActionType - { - INSERT - , DELETE - , CUT - , MOVE - , RESIZE - , ROTATE - , TRANSFORM - , FORMAT - , MOVE_TOTOP - , MOVE_TOBOTTOM - , POS_SIZE - }; - -public: - static ::rtl::OUString createDescription( ActionType eActionType - , const ::rtl::OUString& rObjectName ); -}; - -#endif diff --git a/svx/inc/EnhancedCustomShapeFunctionParser.hxx b/svx/inc/EnhancedCustomShapeFunctionParser.hxx index 997024ff6f..cdfa4dadad 100755 --- a/svx/inc/EnhancedCustomShapeFunctionParser.hxx +++ b/svx/inc/EnhancedCustomShapeFunctionParser.hxx @@ -32,14 +32,14 @@ #define _ENHANCEDCUSTOMSHAPEFUNCTIONPARSER_HXX #include <sal/config.h> -#ifndef BOOST_SHARED_PTR_HPP_INCLUDED #include <boost/shared_ptr.hpp> -#endif #include "EnhancedCustomShapeFunctionParser.hxx" #include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp> #include <vector> +#include <svx/svxdllapi.h> + struct EnhancedCustomShapeEquation { sal_Int32 nOperation; @@ -97,7 +97,7 @@ enum ExpressionFunct #define EXPRESSION_FLAG_SUMANGLE_MODE 1 -void FillEquationParameter( const com::sun::star::drawing::EnhancedCustomShapeParameter&, const sal_Int32, EnhancedCustomShapeEquation& ); +SVX_DLLPUBLIC void FillEquationParameter( const com::sun::star::drawing::EnhancedCustomShapeParameter&, const sal_Int32, EnhancedCustomShapeEquation& ); class ExpressionNode { @@ -200,7 +200,7 @@ public: @return the generated function object. */ - static ExpressionNodeSharedPtr parseFunction( const ::rtl::OUString& rFunction, const EnhancedCustomShape2d& rCustoShape ); + SVX_DLLPUBLIC static ExpressionNodeSharedPtr parseFunction( const ::rtl::OUString& rFunction, const EnhancedCustomShape2d& rCustoShape ); private: // disabled constructor/destructor, since this is diff --git a/svx/inc/accessibility.hrc b/svx/inc/accessibility.hrc index 018f12f327..8909545e61 100644 --- a/svx/inc/accessibility.hrc +++ b/svx/inc/accessibility.hrc @@ -80,102 +80,6 @@ // text paragraphs and bullets #define RID_SVXSTR_A11Y_TEXTHELPER_START (RID_SVXSTR_ACCESSIBILITY_START + 70) -#define RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 0) -#define RID_SVXSTR_A11Y_PARAGRAPH_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 1) -#define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 2) -#define RID_SVXSTR_A11Y_IMAGEBULLET_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 3) - -// SvxShowCharSetAcc -#define RID_SVXSTR_CHARACTER_SELECTION (RID_SVXSTR_ACCESSIBILITY_START + 80) -#define RID_SVXSTR_CHARACTER_CODE (RID_SVXSTR_ACCESSIBILITY_START + 81) -#define RID_SVXSTR_CHAR_SEL_DESC (RID_SVXSTR_ACCESSIBILITY_START + 82) - -#endif - -/************************************************************************* - * - * 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: accessibility.hrc,v $ - * $Revision: 1.10 $ - * - * 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 _SVX_ACCESSIBILITY_HRC -#define _SVX_ACCESSIBILITY_HRC - -#include <svx/dialogs.hrc> - -#define RID_SVXSTR_A11Y_3D_MATERIAL_COLOR (RID_SVXSTR_ACCESSIBILITY_START + 1) -#define RID_SVXSTR_A11Y_TEXT_COLOR (RID_SVXSTR_ACCESSIBILITY_START + 2) -#define RID_SVXSTR_A11Y_BACKGROUND_COLOR (RID_SVXSTR_ACCESSIBILITY_START + 3) -#define RID_SVXSTR_A11Y_FILLSTYLE_NONE (RID_SVXSTR_ACCESSIBILITY_START + 4) -#define RID_SVXSTR_A11Y_FILLSTYLE_SOLID (RID_SVXSTR_ACCESSIBILITY_START + 5) -#define RID_SVXSTR_A11Y_FILLSTYLE_HATCH (RID_SVXSTR_ACCESSIBILITY_START + 6) -#define RID_SVXSTR_A11Y_FILLSTYLE_GRADIENT (RID_SVXSTR_ACCESSIBILITY_START + 7) -#define RID_SVXSTR_A11Y_FILLSTYLE_BITMAP (RID_SVXSTR_ACCESSIBILITY_START + 8) -#define RID_SVXSTR_A11Y_WITH (RID_SVXSTR_ACCESSIBILITY_START + 9) -#define RID_SVXSTR_A11Y_STYLE (RID_SVXSTR_ACCESSIBILITY_START + 10) -#define RID_SVXSTR_A11Y_AND (RID_SVXSTR_ACCESSIBILITY_START + 11) - - -// SvxRectCtl & childs -#define RID_SVXSTR_RECTCTL_ACC_START (RID_SVXSTR_ACCESSIBILITY_START + 20) -#define RID_SVXSTR_RECTCTL_ACC_CORN_NAME (RID_SVXSTR_RECTCTL_ACC_START + 0) -#define RID_SVXSTR_RECTCTL_ACC_CORN_DESCR (RID_SVXSTR_RECTCTL_ACC_START + 1) -#define RID_SVXSTR_RECTCTL_ACC_ANGL_NAME (RID_SVXSTR_RECTCTL_ACC_START + 2) -#define RID_SVXSTR_RECTCTL_ACC_ANGL_DESCR (RID_SVXSTR_RECTCTL_ACC_START + 3) - -#define RID_SVXSTR_RECTCTL_ACC_CHLD_LT (RID_SVXSTR_RECTCTL_ACC_START + 4) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_MT (RID_SVXSTR_RECTCTL_ACC_START + 5) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_RT (RID_SVXSTR_RECTCTL_ACC_START + 6) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_LM (RID_SVXSTR_RECTCTL_ACC_START + 7) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_MM (RID_SVXSTR_RECTCTL_ACC_START + 8) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_RM (RID_SVXSTR_RECTCTL_ACC_START + 9) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_LB (RID_SVXSTR_RECTCTL_ACC_START + 10) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_MB (RID_SVXSTR_RECTCTL_ACC_START + 11) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_RB (RID_SVXSTR_RECTCTL_ACC_START + 12) - -#define RID_SVXSTR_RECTCTL_ACC_CHLD_A000 (RID_SVXSTR_RECTCTL_ACC_START + 13) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_A045 (RID_SVXSTR_RECTCTL_ACC_START + 14) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_A090 (RID_SVXSTR_RECTCTL_ACC_START + 15) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_A135 (RID_SVXSTR_RECTCTL_ACC_START + 16) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_A180 (RID_SVXSTR_RECTCTL_ACC_START + 17) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_A225 (RID_SVXSTR_RECTCTL_ACC_START + 18) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_A270 (RID_SVXSTR_RECTCTL_ACC_START + 19) -#define RID_SVXSTR_RECTCTL_ACC_CHLD_A315 (RID_SVXSTR_RECTCTL_ACC_START + 20) -#define RID_SVXSTR_RECTCTL_ACC_END (RID_SVXSTR_RECTCTL_ACC_START + 21) - -// SvxGraphCtrlAccessibleContext -#define RID_SVXSTR_GRAPHCTRL_ACC_START (RID_SVXSTR_RECTCTL_ACC_END) -#define RID_SVXSTR_GRAPHCTRL_ACC_NAME (RID_SVXSTR_GRAPHCTRL_ACC_START + 0) -#define RID_SVXSTR_GRAPHCTRL_ACC_DESCRIPTION (RID_SVXSTR_GRAPHCTRL_ACC_START + 1) - -// text paragraphs and bullets -#define RID_SVXSTR_A11Y_TEXTHELPER_START (RID_SVXSTR_ACCESSIBILITY_START + 70) -#define RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 0) -#define RID_SVXSTR_A11Y_PARAGRAPH_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 1) #define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 2) #define RID_SVXSTR_A11Y_IMAGEBULLET_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 3) diff --git a/svx/inc/acorrcfg.hxx b/svx/inc/acorrcfg.hxx index 18471483e2..2c34f0ed12 100644 --- a/svx/inc/acorrcfg.hxx +++ b/svx/inc/acorrcfg.hxx @@ -42,16 +42,16 @@ class SvxAutoCorrCfg; class SVX_DLLPUBLIC SvxBaseAutoCorrCfg : public utl::ConfigItem { SvxAutoCorrCfg& rParent; - com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames(); + com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames(); public: SvxBaseAutoCorrCfg(SvxAutoCorrCfg& rParent); ~SvxBaseAutoCorrCfg(); - void Load(sal_Bool bInit); - virtual void Commit(); - virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); - void SetModified() {ConfigItem::SetModified();} + void Load(sal_Bool bInit); + virtual void Commit(); + virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); + void SetModified() {ConfigItem::SetModified();} }; /* -----------------------------12.10.00 11:40-------------------------------- @@ -59,16 +59,16 @@ public: class SVX_DLLPUBLIC SvxSwAutoCorrCfg : public utl::ConfigItem { SvxAutoCorrCfg& rParent; - com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames(); + com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames(); public: SvxSwAutoCorrCfg(SvxAutoCorrCfg& rParent); ~SvxSwAutoCorrCfg(); - void Load(sal_Bool bInit); - virtual void Commit(); - virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); - void SetModified() {ConfigItem::SetModified();} + void Load(sal_Bool bInit); + virtual void Commit(); + virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); + void SetModified() {ConfigItem::SetModified();} }; /*-------------------------------------------------------------------- Beschreibung: Konfiguration fuer Auto Correction @@ -78,22 +78,22 @@ class SVX_DLLPUBLIC SvxAutoCorrCfg friend class SvxBaseAutoCorrCfg; friend class SvxSwAutoCorrCfg; - SvxAutoCorrect* pAutoCorrect; + SvxAutoCorrect* pAutoCorrect; - SvxBaseAutoCorrCfg aBaseConfig; - SvxSwAutoCorrCfg aSwConfig; + SvxBaseAutoCorrCfg aBaseConfig; + SvxSwAutoCorrCfg aSwConfig; // Flags f"ur Autotext: - sal_Bool bFileRel; - sal_Bool bNetRel; + sal_Bool bFileRel; + sal_Bool bNetRel; // Tiphilfe f"ur Autotext w"ahrend der Eingabe - sal_Bool bAutoTextTip; - sal_Bool bAutoTextPreview; - sal_Bool bAutoFmtByInput; + sal_Bool bAutoTextTip; + sal_Bool bAutoTextPreview; + sal_Bool bAutoFmtByInput; sal_Bool bSearchInAllCategories; public: - void SetModified() + void SetModified() { aBaseConfig.SetModified(); aSwConfig.SetModified(); @@ -104,171 +104,33 @@ public: aSwConfig.Commit(); } - SvxAutoCorrect* GetAutoCorrect() { return pAutoCorrect; } - const SvxAutoCorrect* GetAutoCorrect() const { return pAutoCorrect; } + SvxAutoCorrect* GetAutoCorrect() { return pAutoCorrect; } + const SvxAutoCorrect* GetAutoCorrect() const { return pAutoCorrect; } // der Pointer geht in den Besitz des ConfigItems! void SetAutoCorrect( SvxAutoCorrect* ); - sal_Bool IsAutoFmtByInput() const { return bAutoFmtByInput; } + sal_Bool IsAutoFmtByInput() const { return bAutoFmtByInput; } void SetAutoFmtByInput( sal_Bool bSet ) { bAutoFmtByInput = bSet;aSwConfig.SetModified();} - sal_Bool IsSaveRelFile() const { return bFileRel; } - void SetSaveRelFile( sal_Bool bSet ) { bFileRel = bSet; aSwConfig.SetModified(); } + sal_Bool IsSaveRelFile() const { return bFileRel; } + void SetSaveRelFile( sal_Bool bSet ) { bFileRel = bSet; aSwConfig.SetModified(); } - sal_Bool IsSaveRelNet() const { return bNetRel; } - void SetSaveRelNet( sal_Bool bSet ) { bNetRel = bSet; aSwConfig.SetModified();} + sal_Bool IsSaveRelNet() const { return bNetRel; } + void SetSaveRelNet( sal_Bool bSet ) { bNetRel = bSet; aSwConfig.SetModified();} sal_Bool IsAutoTextPreview() const {return bAutoTextPreview;} - void SetAutoTextPreview(sal_Bool bSet) {bAutoTextPreview = bSet; aSwConfig.SetModified();} + void SetAutoTextPreview(sal_Bool bSet) {bAutoTextPreview = bSet; aSwConfig.SetModified();} - sal_Bool IsAutoTextTip() const { return bAutoTextTip; } - void SetAutoTextTip(sal_Bool bSet ) { bAutoTextTip = bSet;aSwConfig.SetModified();} + sal_Bool IsAutoTextTip() const { return bAutoTextTip; } + void SetAutoTextTip(sal_Bool bSet ) { bAutoTextTip = bSet;aSwConfig.SetModified();} sal_Bool IsSearchInAllCategories() const { return bSearchInAllCategories;} void SetSearchInAllCategories(sal_Bool bSet ) { bSearchInAllCategories = bSet; aSwConfig.SetModified(); } SvxAutoCorrCfg(); virtual ~SvxAutoCorrCfg(); - static SvxAutoCorrCfg* Get(); + static SvxAutoCorrCfg* Get(); }; #endif - -/************************************************************************* - * - * 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: acorrcfg.hxx,v $ - * $Revision: 1.7 $ - * - * 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 _SVXACCFG_HXX -#define _SVXACCFG_HXX - -// include --------------------------------------------------------------- - -#include "svx/svxdllapi.h" -#include <unotools/configitem.hxx> -/* -----------------------------12.10.00 11:40-------------------------------- - - ---------------------------------------------------------------------------*/ -class SvxAutoCorrect; -class SvxAutoCorrCfg; -class SVX_DLLPUBLIC SvxBaseAutoCorrCfg : public utl::ConfigItem -{ - SvxAutoCorrCfg& rParent; - com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames(); - -public: - SvxBaseAutoCorrCfg(SvxAutoCorrCfg& rParent); - ~SvxBaseAutoCorrCfg(); - - void Load(sal_Bool bInit); - virtual void Commit(); - virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); - void SetModified() {ConfigItem::SetModified();} -}; -/* -----------------------------12.10.00 11:40-------------------------------- - - ---------------------------------------------------------------------------*/ -class SVX_DLLPUBLIC SvxSwAutoCorrCfg : public utl::ConfigItem -{ - SvxAutoCorrCfg& rParent; - com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames(); - -public: - SvxSwAutoCorrCfg(SvxAutoCorrCfg& rParent); - ~SvxSwAutoCorrCfg(); - - void Load(sal_Bool bInit); - virtual void Commit(); - virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); - void SetModified() {ConfigItem::SetModified();} -}; -/*-------------------------------------------------------------------- - Beschreibung: Konfiguration fuer Auto Correction - --------------------------------------------------------------------*/ -class SVX_DLLPUBLIC SvxAutoCorrCfg -{ - friend class SvxBaseAutoCorrCfg; - friend class SvxSwAutoCorrCfg; - - SvxAutoCorrect* pAutoCorrect; - - SvxBaseAutoCorrCfg aBaseConfig; - SvxSwAutoCorrCfg aSwConfig; - - // Flags f"ur Autotext: - sal_Bool bFileRel; - sal_Bool bNetRel; - // Tiphilfe f"ur Autotext w"ahrend der Eingabe - sal_Bool bAutoTextTip; - sal_Bool bAutoTextPreview; - sal_Bool bAutoFmtByInput; - sal_Bool bSearchInAllCategories; - -public: - void SetModified() - { - aBaseConfig.SetModified(); - aSwConfig.SetModified(); - } - void Commit() - { - aBaseConfig.Commit(); - aSwConfig.Commit(); - } - - SvxAutoCorrect* GetAutoCorrect() { return pAutoCorrect; } - const SvxAutoCorrect* GetAutoCorrect() const { return pAutoCorrect; } - // der Pointer geht in den Besitz des ConfigItems! - void SetAutoCorrect( SvxAutoCorrect* ); - - sal_Bool IsAutoFmtByInput() const { return bAutoFmtByInput; } - void SetAutoFmtByInput( sal_Bool bSet ) { bAutoFmtByInput = bSet;aSwConfig.SetModified();} - - sal_Bool IsSaveRelFile() const { return bFileRel; } - void SetSaveRelFile( sal_Bool bSet ) { bFileRel = bSet; aSwConfig.SetModified(); } - - sal_Bool IsSaveRelNet() const { return bNetRel; } - void SetSaveRelNet( sal_Bool bSet ) { bNetRel = bSet; aSwConfig.SetModified();} - - sal_Bool IsAutoTextPreview() const {return bAutoTextPreview;} - void SetAutoTextPreview(sal_Bool bSet) {bAutoTextPreview = bSet; aSwConfig.SetModified();} - - sal_Bool IsAutoTextTip() const { return bAutoTextTip; } - void SetAutoTextTip(sal_Bool bSet ) { bAutoTextTip = bSet;aSwConfig.SetModified();} - - sal_Bool IsSearchInAllCategories() const { return bSearchInAllCategories;} - void SetSearchInAllCategories(sal_Bool bSet ) { bSearchInAllCategories = bSet; aSwConfig.SetModified(); } - - SvxAutoCorrCfg(); - virtual ~SvxAutoCorrCfg(); - static SvxAutoCorrCfg* Get(); -}; - - -#endif - diff --git a/svx/inc/anchorid.hxx b/svx/inc/anchorid.hxx index b0cfa9b9d7..d518a7b2da 100644 --- a/svx/inc/anchorid.hxx +++ b/svx/inc/anchorid.hxx @@ -33,60 +33,13 @@ enum SvxAnchorIds { - SVX_OBJ_AT_CNTNT = 0x01, //Absatzgebundener Rahmen - SVX_OBJ_IN_CNTNT = 0x02, //Zeichengebundener Rahmen - SVX_OBJ_PAGE = 0x04, //Seitengebundener Rahmen - SVX_OBJ_AT_FLY = 0x08 //Rahmengebundener Rahmen -// SVX_OBJ_AUTO_CNTNT = 0x10 //Automatisch positionierter, absatzgebundener Rahmen + SVX_OBJ_AT_CNTNT = 0x01, //Absatzgebundener Rahmen + SVX_OBJ_IN_CNTNT = 0x02, //Zeichengebundener Rahmen + SVX_OBJ_PAGE = 0x04, //Seitengebundener Rahmen + SVX_OBJ_AT_FLY = 0x08 //Rahmengebundener Rahmen +// SVX_OBJ_AUTO_CNTNT = 0x10 //Automatisch positionierter, absatzgebundener Rahmen }; #endif - -/************************************************************************* - * - * 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: anchorid.hxx,v $ - * $Revision: 1.3 $ - * - * 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 _SVX_ANCHORID_HXX -#define _SVX_ANCHORID_HXX - - -enum SvxAnchorIds -{ - SVX_OBJ_AT_CNTNT = 0x01, //Absatzgebundener Rahmen - SVX_OBJ_IN_CNTNT = 0x02, //Zeichengebundener Rahmen - SVX_OBJ_PAGE = 0x04, //Seitengebundener Rahmen - SVX_OBJ_AT_FLY = 0x08 //Rahmengebundener Rahmen -// SVX_OBJ_AUTO_CNTNT = 0x10 //Automatisch positionierter, absatzgebundener Rahmen -}; - - - -#endif - diff --git a/svx/inc/asiancfg.hxx b/svx/inc/asiancfg.hxx index 841b8f72db..b9cc3abd31 100644 --- a/svx/inc/asiancfg.hxx +++ b/svx/inc/asiancfg.hxx @@ -48,99 +48,25 @@ public: SvxAsianConfig(sal_Bool bEnableNotify = sal_True); virtual ~SvxAsianConfig(); - void Load(); - virtual void Commit(); - virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); + void Load(); + virtual void Commit(); + virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); - sal_Bool IsKerningWesternTextOnly() const; - void SetKerningWesternTextOnly(sal_Bool bSet); + sal_Bool IsKerningWesternTextOnly() const; + void SetKerningWesternTextOnly(sal_Bool bSet); - sal_Int16 GetCharDistanceCompression() const; - void SetCharDistanceCompression(sal_Int16 nSet); + sal_Int16 GetCharDistanceCompression() const; + void SetCharDistanceCompression(sal_Int16 nSet); com::sun::star::uno::Sequence<com::sun::star::lang::Locale> GetStartEndCharLocales(); - sal_Bool GetStartEndChars( const com::sun::star::lang::Locale& rLocale, + sal_Bool GetStartEndChars( const com::sun::star::lang::Locale& rLocale, rtl::OUString& rStartChars, rtl::OUString& rEndChars ); - void SetStartEndChars( const com::sun::star::lang::Locale& rLocale, + void SetStartEndChars( const com::sun::star::lang::Locale& rLocale, const rtl::OUString* pStartChars, const rtl::OUString* pEndChars ); }; #endif - -/************************************************************************* - * - * 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: asiancfg.hxx,v $ - * $Revision: 1.4 $ - * - * 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 _SVX_ASIANCFG_HXX -#define _SVX_ASIANCFG_HXX - -#include <unotools/configitem.hxx> -#include <com/sun/star/uno/Sequence.h> -#include "svx/svxdllapi.h" - -namespace com{namespace sun{namespace star{ -namespace lang{ - struct Locale; -}}}} -//----------------------------------------------------------------------------- -struct SvxAsianConfig_Impl; -class SVX_DLLPUBLIC SvxAsianConfig : public utl::ConfigItem -{ - SvxAsianConfig_Impl* pImpl; - -public: - SvxAsianConfig(sal_Bool bEnableNotify = sal_True); - virtual ~SvxAsianConfig(); - - void Load(); - virtual void Commit(); - virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); - - sal_Bool IsKerningWesternTextOnly() const; - void SetKerningWesternTextOnly(sal_Bool bSet); - - sal_Int16 GetCharDistanceCompression() const; - void SetCharDistanceCompression(sal_Int16 nSet); - - com::sun::star::uno::Sequence<com::sun::star::lang::Locale> - GetStartEndCharLocales(); - - sal_Bool GetStartEndChars( const com::sun::star::lang::Locale& rLocale, - rtl::OUString& rStartChars, - rtl::OUString& rEndChars ); - void SetStartEndChars( const com::sun::star::lang::Locale& rLocale, - const rtl::OUString* pStartChars, - const rtl::OUString* pEndChars ); -}; - -#endif - diff --git a/svx/inc/bolnitem.hxx b/svx/inc/bolnitem.hxx index d91ecf49c3..9a05a6910e 100644 --- a/svx/inc/bolnitem.hxx +++ b/svx/inc/bolnitem.hxx @@ -59,116 +59,28 @@ public: ~SvxLineItem(); SvxLineItem &operator=( const SvxLineItem& rLine ); - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual int operator==( const SfxPoolItem& ) const; + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual int operator==( const SfxPoolItem& ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; - virtual int ScaleMetrics( long nMult, long nDiv ); - virtual int HasMetrics() const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; + virtual int ScaleMetrics( long nMult, long nDiv ); + virtual int HasMetrics() const; - const SvxBorderLine* GetLine () const { return pLine; } - void SetLine ( const SvxBorderLine *pNew ); + const SvxBorderLine* GetLine () const { return pLine; } + void SetLine ( const SvxBorderLine *pNew ); private: - SvxBorderLine* pLine; + SvxBorderLine* pLine; }; #endif - -/************************************************************************* - * - * 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: bolnitem.hxx,v $ - * $Revision: 1.7 $ - * - * 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 _SVX_BOLNITEM_HXX -#define _SVX_BOLNITEM_HXX - -// include --------------------------------------------------------------- - - - -#include <svtools/poolitem.hxx> -#include "svx/svxdllapi.h" - - - -// class SvxLineItem ----------------------------------------------------- - - -/* -[Beschreibung] -Dieses Item transportiert eine SvxBorderLine. -*/ - -class SvxBorderLine; - -class SVX_DLLPUBLIC SvxLineItem : public SfxPoolItem -{ -public: - TYPEINFO(); - - SvxLineItem( const USHORT nId ); - SvxLineItem( const SvxLineItem& rCpy ); - ~SvxLineItem(); - SvxLineItem &operator=( const SvxLineItem& rLine ); - - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual int operator==( const SfxPoolItem& ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, - SfxMapUnit eCoreMetric, - SfxMapUnit ePresMetric, - String &rText, const IntlWrapper * = 0 ) const; - - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; - virtual int ScaleMetrics( long nMult, long nDiv ); - virtual int HasMetrics() const; - - const SvxBorderLine* GetLine () const { return pLine; } - void SetLine ( const SvxBorderLine *pNew ); - -private: - SvxBorderLine* pLine; -}; - - - - -#endif - diff --git a/svx/inc/bulitem.hxx b/svx/inc/bulitem.hxx index 91faf19d88..4f2b665408 100644 --- a/svx/inc/bulitem.hxx +++ b/svx/inc/bulitem.hxx @@ -38,34 +38,34 @@ // define ---------------------------------------------------------------- // Styles -#define BS_ABC_BIG 0 -#define BS_ABC_SMALL 1 -#define BS_ROMAN_BIG 2 -#define BS_ROMAN_SMALL 3 -#define BS_123 4 -#define BS_NONE 5 -#define BS_BULLET 6 -#define BS_BMP 128 +#define BS_ABC_BIG 0 +#define BS_ABC_SMALL 1 +#define BS_ROMAN_BIG 2 +#define BS_ROMAN_SMALL 3 +#define BS_123 4 +#define BS_NONE 5 +#define BS_BULLET 6 +#define BS_BMP 128 // Justification -#define BJ_HLEFT 0x01 -#define BJ_HRIGHT 0x02 -#define BJ_HCENTER 0x04 -#define BJ_VTOP 0x08 -#define BJ_VBOTTOM 0x10 -#define BJ_VCENTER 0x20 +#define BJ_HLEFT 0x01 +#define BJ_HRIGHT 0x02 +#define BJ_HCENTER 0x04 +#define BJ_VTOP 0x08 +#define BJ_VBOTTOM 0x10 +#define BJ_VCENTER 0x20 // Valid-Bits // Erstmal nur die Werte, die vom Dialog geaendert werden... -#define VALID_FONTCOLOR 0x0001 -#define VALID_FONTNAME 0x0002 -#define VALID_SYMBOL 0x0004 -#define VALID_BITMAP 0x0008 -#define VALID_SCALE 0x0010 -#define VALID_START 0x0020 -#define VALID_STYLE 0x0040 -#define VALID_PREVTEXT 0x0080 -#define VALID_FOLLOWTEXT 0x0100 +#define VALID_FONTCOLOR 0x0001 +#define VALID_FONTNAME 0x0002 +#define VALID_SYMBOL 0x0004 +#define VALID_BITMAP 0x0008 +#define VALID_SCALE 0x0010 +#define VALID_START 0x0020 +#define VALID_STYLE 0x0040 +#define VALID_PREVTEXT 0x0080 +#define VALID_FOLLOWTEXT 0x0100 #include <svtools/poolitem.hxx> #include <vcl/font.hxx> #include <goodies/grfmgr.hxx> @@ -74,21 +74,21 @@ class SVX_DLLPUBLIC SvxBulletItem : public SfxPoolItem { - Font aFont; + Font aFont; GraphicObject* pGraphicObject; - String aPrevText; - String aFollowText; - USHORT nStart; - USHORT nStyle; - long nWidth; - USHORT nScale; - sal_Unicode cSymbol; - BYTE nJustify; - USHORT nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets + String aPrevText; + String aFollowText; + USHORT nStart; + USHORT nStyle; + long nWidth; + USHORT nScale; + sal_Unicode cSymbol; + BYTE nJustify; + USHORT nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets #ifdef _SVX_BULITEM_CXX - void SetDefaultFont_Impl(); - void SetDefaults_Impl(); + void SetDefaultFont_Impl(); + void SetDefaults_Impl(); #endif public: @@ -107,222 +107,57 @@ public: virtual SfxPoolItem* Create( SvStream&, USHORT nVersion ) const; virtual SvStream& Store( SvStream & , USHORT nItemVersion ) const; - String GetFullText() const; - sal_Unicode GetSymbol() const { return cSymbol; } - String GetPrevText() const { return aPrevText; } - String GetFollowText() const { return aFollowText; } + String GetFullText() const; + sal_Unicode GetSymbol() const { return cSymbol; } + String GetPrevText() const { return aPrevText; } + String GetFollowText() const { return aFollowText; } - USHORT GetStart() const { return nStart; } - long GetWidth() const { return nWidth; } - USHORT GetStyle() const { return nStyle; } - BYTE GetJustification() const { return nJustify; } - Font GetFont() const { return aFont; } - USHORT GetScale() const { return nScale; } - - Bitmap GetBitmap() const; - void SetBitmap( const Bitmap& rBmp ); + USHORT GetStart() const { return nStart; } + long GetWidth() const { return nWidth; } + USHORT GetStyle() const { return nStyle; } + BYTE GetJustification() const { return nJustify; } + Font GetFont() const { return aFont; } + USHORT GetScale() const { return nScale; } - const GraphicObject& GetGraphicObject() const; - void SetGraphicObject( const GraphicObject& rGraphicObject ); - - void SetSymbol( sal_Unicode c) { cSymbol = c; } - void SetPrevText( const String& rStr) { aPrevText = rStr;} - void SetFollowText(const String& rStr) { aFollowText=rStr;} - - void SetStart( USHORT nNew ) { nStart = nNew; } - void SetWidth( long nNew ) { nWidth = nNew; } - void SetStyle( USHORT nNew ) { nStyle = nNew; } - void SetJustification( BYTE nNew ) { nJustify = nNew; } - void SetFont( const Font& rNew) { aFont = rNew; } - void SetScale( USHORT nNew ) { nScale = nNew; } - - virtual USHORT GetVersion(USHORT nFileVersion) const; - virtual int operator==( const SfxPoolItem& ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, - SfxMapUnit eCoreMetric, - SfxMapUnit ePresMetric, - String &rText, const IntlWrapper * = 0 ) const; - - static void StoreFont( SvStream&, const Font& ); - static Font CreateFont( SvStream&, USHORT nVer ); - - USHORT& GetValidMask() { return nValidMask; } - USHORT GetValidMask() const { return nValidMask; } - USHORT IsValid( USHORT nFlag ) const { return nValidMask & nFlag; } - void SetValid( USHORT nFlag, BOOL bValid ) - { - if ( bValid ) - nValidMask |= nFlag; - else - nValidMask &= ~nFlag; - } - void CopyValidProperties( const SvxBulletItem& rCopyFrom ); -}; - - -#endif - -/************************************************************************* - * - * 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: bulitem.hxx,v $ - * $Revision: 1.6 $ - * - * 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 _SVX_BULITEM_HXX -#define _SVX_BULITEM_HXX - -// include --------------------------------------------------------------- - -#include "svx/svxdllapi.h" - - -// define ---------------------------------------------------------------- - -// Styles -#define BS_ABC_BIG 0 -#define BS_ABC_SMALL 1 -#define BS_ROMAN_BIG 2 -#define BS_ROMAN_SMALL 3 -#define BS_123 4 -#define BS_NONE 5 -#define BS_BULLET 6 -#define BS_BMP 128 - -// Justification -#define BJ_HLEFT 0x01 -#define BJ_HRIGHT 0x02 -#define BJ_HCENTER 0x04 -#define BJ_VTOP 0x08 -#define BJ_VBOTTOM 0x10 -#define BJ_VCENTER 0x20 - -// Valid-Bits -// Erstmal nur die Werte, die vom Dialog geaendert werden... -#define VALID_FONTCOLOR 0x0001 -#define VALID_FONTNAME 0x0002 -#define VALID_SYMBOL 0x0004 -#define VALID_BITMAP 0x0008 -#define VALID_SCALE 0x0010 -#define VALID_START 0x0020 -#define VALID_STYLE 0x0040 -#define VALID_PREVTEXT 0x0080 -#define VALID_FOLLOWTEXT 0x0100 -#include <svtools/poolitem.hxx> -#include <vcl/font.hxx> -#include <goodies/grfmgr.hxx> - -// class SvxBulletItem --------------------------------------------------- - -class SVX_DLLPUBLIC SvxBulletItem : public SfxPoolItem -{ - Font aFont; - GraphicObject* pGraphicObject; - String aPrevText; - String aFollowText; - USHORT nStart; - USHORT nStyle; - long nWidth; - USHORT nScale; - sal_Unicode cSymbol; - BYTE nJustify; - USHORT nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets - -#ifdef _SVX_BULITEM_CXX - void SetDefaultFont_Impl(); - void SetDefaults_Impl(); -#endif - -public: - TYPEINFO(); - - SvxBulletItem( USHORT nWhich = 0 ); - SvxBulletItem( BYTE nStyle, const Font& rFont, USHORT nStart = 0, USHORT nWhich = 0 ); - SvxBulletItem( const Font& rFont, sal_Unicode cSymbol, USHORT nWhich=0 ); - SvxBulletItem( const Bitmap&, USHORT nWhich = 0 ); - SvxBulletItem( const GraphicObject&, USHORT nWhich = 0 ); - SvxBulletItem( SvStream& rStrm, USHORT nWhich = 0 ); - SvxBulletItem( const SvxBulletItem& ); - ~SvxBulletItem(); - - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream&, USHORT nVersion ) const; - virtual SvStream& Store( SvStream & , USHORT nItemVersion ) const; - - String GetFullText() const; - sal_Unicode GetSymbol() const { return cSymbol; } - String GetPrevText() const { return aPrevText; } - String GetFollowText() const { return aFollowText; } - - USHORT GetStart() const { return nStart; } - long GetWidth() const { return nWidth; } - USHORT GetStyle() const { return nStyle; } - BYTE GetJustification() const { return nJustify; } - Font GetFont() const { return aFont; } - USHORT GetScale() const { return nScale; } - - Bitmap GetBitmap() const; - void SetBitmap( const Bitmap& rBmp ); + Bitmap GetBitmap() const; + void SetBitmap( const Bitmap& rBmp ); const GraphicObject& GetGraphicObject() const; - void SetGraphicObject( const GraphicObject& rGraphicObject ); + void SetGraphicObject( const GraphicObject& rGraphicObject ); - void SetSymbol( sal_Unicode c) { cSymbol = c; } - void SetPrevText( const String& rStr) { aPrevText = rStr;} - void SetFollowText(const String& rStr) { aFollowText=rStr;} + void SetSymbol( sal_Unicode c) { cSymbol = c; } + void SetPrevText( const String& rStr) { aPrevText = rStr;} + void SetFollowText(const String& rStr) { aFollowText=rStr;} - void SetStart( USHORT nNew ) { nStart = nNew; } - void SetWidth( long nNew ) { nWidth = nNew; } - void SetStyle( USHORT nNew ) { nStyle = nNew; } - void SetJustification( BYTE nNew ) { nJustify = nNew; } - void SetFont( const Font& rNew) { aFont = rNew; } - void SetScale( USHORT nNew ) { nScale = nNew; } + void SetStart( USHORT nNew ) { nStart = nNew; } + void SetWidth( long nNew ) { nWidth = nNew; } + void SetStyle( USHORT nNew ) { nStyle = nNew; } + void SetJustification( BYTE nNew ) { nJustify = nNew; } + void SetFont( const Font& rNew) { aFont = rNew; } + void SetScale( USHORT nNew ) { nScale = nNew; } - virtual USHORT GetVersion(USHORT nFileVersion) const; - virtual int operator==( const SfxPoolItem& ) const; + virtual USHORT GetVersion(USHORT nFileVersion) const; + virtual int operator==( const SfxPoolItem& ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; - static void StoreFont( SvStream&, const Font& ); - static Font CreateFont( SvStream&, USHORT nVer ); + static void StoreFont( SvStream&, const Font& ); + static Font CreateFont( SvStream&, USHORT nVer ); - USHORT& GetValidMask() { return nValidMask; } - USHORT GetValidMask() const { return nValidMask; } - USHORT IsValid( USHORT nFlag ) const { return nValidMask & nFlag; } - void SetValid( USHORT nFlag, BOOL bValid ) + USHORT& GetValidMask() { return nValidMask; } + USHORT GetValidMask() const { return nValidMask; } + USHORT IsValid( USHORT nFlag ) const { return nValidMask & nFlag; } + void SetValid( USHORT nFlag, BOOL bValid ) { if ( bValid ) nValidMask |= nFlag; else nValidMask &= ~nFlag; } - void CopyValidProperties( const SvxBulletItem& rCopyFrom ); + void CopyValidProperties( const SvxBulletItem& rCopyFrom ); }; #endif - diff --git a/svx/inc/charhiddenitem.hxx b/svx/inc/charhiddenitem.hxx index c092990440..1cff33a509 100644 --- a/svx/inc/charhiddenitem.hxx +++ b/svx/inc/charhiddenitem.hxx @@ -62,71 +62,3 @@ public: }; #endif - - -/************************************************************************* - * - * 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: charhiddenitem.hxx,v $ - * $Revision: 1.6 $ - * - * 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 _SVX_CHARHIDDENITEM_HXX -#define _SVX_CHARHIDDENITEM_HXX - -// include --------------------------------------------------------------- - -#include <svtools/poolitem.hxx> -#include <svtools/eitem.hxx> -#include "svx/svxdllapi.h" - -// class SvxCharHiddenItem ------------------------------------------------- -/* - [Description] - This item marks text as hidden -*/ - -class SVX_DLLPUBLIC SvxCharHiddenItem : public SfxBoolItem -{ -public: - TYPEINFO(); - - SvxCharHiddenItem( const BOOL bHidden /*= FALSE*/, const USHORT nId ); - - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, - SfxMapUnit eCoreMetric, - SfxMapUnit ePresMetric, - String &rText, const IntlWrapper * = 0 ) const; - - inline SvxCharHiddenItem& operator=(const SvxCharHiddenItem& rHidden) { - SetValue(rHidden.GetValue()); - return *this; - } -}; - -#endif - - diff --git a/svx/inc/edtspell.hxx b/svx/inc/edtspell.hxx index f7b642cb05..f2d0717e39 100644 --- a/svx/inc/edtspell.hxx +++ b/svx/inc/edtspell.hxx @@ -133,6 +133,9 @@ public: void MarkWrongsInvalid(); WrongList* Clone() const; + + // #i102062# + bool operator==(const WrongList& rCompare) const; }; inline void WrongList::InsertWrong( const WrongRange& rWrong, USHORT nPos ) diff --git a/svx/inc/fontitem.hxx b/svx/inc/fontitem.hxx index 7b15547daa..82efbf7dbe 100644 --- a/svx/inc/fontitem.hxx +++ b/svx/inc/fontitem.hxx @@ -111,7 +111,7 @@ public: return *this; } - static void EnableStoreUnicodeNames( BOOL bEnable ) { bEnableStoreUnicodeNames = bEnable; } + static void EnableStoreUnicodeNames( BOOL bEnable ); }; diff --git a/svx/inc/gallery1.hxx b/svx/inc/gallery1.hxx index 68f3a27a1e..6c508c2311 100644 --- a/svx/inc/gallery1.hxx +++ b/svx/inc/gallery1.hxx @@ -144,7 +144,7 @@ private: void ImplLoadImports(); void ImplWriteImportList(); - GalleryThemeEntry* ImplGetThemeEntry( const String& rThemeName ); + SVX_DLLPUBLIC GalleryThemeEntry* ImplGetThemeEntry( const String& rThemeName ); GalleryThemeEntry* ImplGetThemeEntry( ULONG nThemeId ); GalleryImportThemeEntry* ImplGetImportThemeEntry( const String& rImportName ); @@ -168,7 +168,7 @@ public: SVX_DLLPUBLIC BOOL CreateTheme( const String& rThemeName, UINT32 nNumFrom = 0 ); BOOL CreateImportTheme( const INetURLObject& rURL, const String& rFileName ); BOOL RenameTheme( const String& rOldName, const String& rNewName ); - BOOL RemoveTheme( const String& rThemeName ); + SVX_DLLPUBLIC BOOL RemoveTheme( const String& rThemeName ); SVX_DLLPUBLIC GalleryTheme* AcquireTheme( const String& rThemeName, SfxListener& rListener ); SVX_DLLPUBLIC void ReleaseTheme( GalleryTheme* pTheme, SfxListener& rListener ); diff --git a/svx/inc/galobj.hxx b/svx/inc/galobj.hxx index b65e1c0a80..f01a9f0da8 100644 --- a/svx/inc/galobj.hxx +++ b/svx/inc/galobj.hxx @@ -122,8 +122,8 @@ public: BOOL IsValid() const { return bIsValid; } BOOL IsThumbBitmap() const { return bIsThumbBmp; } - const String GetTitle() const; - void SetTitle( const String& rTitle ); + SVX_DLLPUBLIC const String GetTitle() const; + SVX_DLLPUBLIC void SetTitle( const String& rTitle ); friend SvStream& operator<<( SvStream& rOut, const SgaObject& rObj ); friend SvStream& operator>>( SvStream& rIn, SgaObject& rObj ); diff --git a/svx/inc/galtheme.hxx b/svx/inc/galtheme.hxx index 0deef6233c..2ff2d26d60 100644 --- a/svx/inc/galtheme.hxx +++ b/svx/inc/galtheme.hxx @@ -107,12 +107,12 @@ private: BOOL bAbortActualize; void ImplCreateSvDrawStorage(); - SgaObject* ImplReadSgaObject( GalleryObject* pEntry ); + SVX_DLLPUBLIC SgaObject* ImplReadSgaObject( GalleryObject* pEntry ); BOOL ImplWriteSgaObject( const SgaObject& rObj, ULONG nPos, GalleryObject* pExistentEntry ); void ImplRead(); void ImplWrite(); const GalleryObject* ImplGetGalleryObject( ULONG nPos ) const { return aObjectList.GetObject( nPos ); } - const GalleryObject* ImplGetGalleryObject( const INetURLObject& rURL ); + SVX_DLLPUBLIC const GalleryObject* ImplGetGalleryObject( const INetURLObject& rURL ); ULONG ImplGetGalleryObjectPos( const GalleryObject* pObj ) const { return aObjectList.GetPos( pObj ); } INetURLObject ImplGetURL( const GalleryObject* pObject ) const; INetURLObject ImplCreateUniqueURL( SgaObjKind eObjKind, ULONG nFormat = CVT_UNKNOWN ); @@ -129,11 +129,11 @@ public: ULONG GetObjectCount() const { return aObjectList.Count(); } - SgaObject* AcquireObject( ULONG nPos ); - void ReleaseObject( SgaObject* pObj ); + SVX_DLLPUBLIC SgaObject* AcquireObject( ULONG nPos ); + SVX_DLLPUBLIC void ReleaseObject( SgaObject* pObj ); - BOOL InsertObject( const SgaObject& rObj, ULONG nPos = LIST_APPEND ); - BOOL RemoveObject( ULONG nPos ); + SVX_DLLPUBLIC BOOL InsertObject( const SgaObject& rObj, ULONG nPos = LIST_APPEND ); + SVX_DLLPUBLIC BOOL RemoveObject( ULONG nPos ); BOOL ChangeObjectPos( ULONG nOldPos, ULONG nNewPos ); const String& GetName() const { return IsImported() ? aImportName : pThm->GetThemeName(); } @@ -194,11 +194,11 @@ public: BOOL GetThumb( ULONG nPos, Bitmap& rBmp, BOOL bProgress = FALSE ); - BOOL GetGraphic( ULONG nPos, Graphic& rGraphic, BOOL bProgress = FALSE ); - BOOL InsertGraphic( const Graphic& rGraphic, ULONG nInsertPos = LIST_APPEND ); + SVX_DLLPUBLIC BOOL GetGraphic( ULONG nPos, Graphic& rGraphic, BOOL bProgress = FALSE ); + SVX_DLLPUBLIC BOOL InsertGraphic( const Graphic& rGraphic, ULONG nInsertPos = LIST_APPEND ); - BOOL GetModel( ULONG nPos, SdrModel& rModel, BOOL bProgress = FALSE ); - BOOL InsertModel( const FmFormModel& rModel, ULONG nInsertPos = LIST_APPEND ); + SVX_DLLPUBLIC BOOL GetModel( ULONG nPos, SdrModel& rModel, BOOL bProgress = FALSE ); + SVX_DLLPUBLIC BOOL InsertModel( const FmFormModel& rModel, ULONG nInsertPos = LIST_APPEND ); BOOL GetModelStream( ULONG nPos, SotStorageStreamRef& rModelStreamRef, BOOL bProgress = FALSE ); BOOL InsertModelStream( const SotStorageStreamRef& rModelStream, ULONG nInsertPos = LIST_APPEND ); diff --git a/svx/inc/mscodec.hxx b/svx/inc/mscodec.hxx index 66dcf5d3a6..b80a778f1c 100644 --- a/svx/inc/mscodec.hxx +++ b/svx/inc/mscodec.hxx @@ -235,6 +235,36 @@ public: */ bool InitCipher( sal_uInt32 nCounter ); + /** Creates an MD5 digest of salt digest. */ + bool CreateSaltDigest( + const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] ); + + /** Encodes a block of memory. + + @see rtl_cipher_encode() + + @precond + The codec must be initialized with InitKey() before this function + can be used. The destination buffer must be able to take all + unencoded data from the source buffer (usually this means it must be + as long as or longer than the source buffer). + + @param pData + Unencrypted source data block. + @param nDatLen + Size of the passed source data block. + @param pBuffer + Destination buffer for the encrypted data. + @param nBufLen + Size of the destination buffer. + + @return + true = Encoding was successful (no error occured). + */ + bool Encode( + const void* pData, sal_Size nDatLen, + sal_uInt8* pBuffer, sal_Size nBufLen ); + /** Decodes a block of memory. @see rtl_cipher_decode() @@ -275,6 +305,27 @@ public: */ bool Skip( sal_Size nDatLen ); + /** Gets salt data and salt digest. + + @precond + The codec must be initialized with InitKey() before this function + can be used. + + @param pSalt + Salt, a random number. + @param pSaltData + Salt data block generated from the salt. + @param pSaltDigest + Salt digest generated from the salt. + */ + void GetEncryptKey ( + const sal_uInt8 pSalt[16], + sal_uInt8 pSaltData[16], + sal_uInt8 pSaltDigest[16]); + +private: + void GetDigestFromSalt( const sal_uInt8 pSaltData[16], sal_uInt8 pDigest[16] ); + private: SVX_DLLPRIVATE MSCodec_Std97( const MSCodec_Std97& ); SVX_DLLPRIVATE MSCodec_Std97& operator=( const MSCodec_Std97& ); diff --git a/svx/inc/optgenrl.hrc b/svx/inc/optgenrl.hrc index 815649479b..a0d06878a9 100644 --- a/svx/inc/optgenrl.hrc +++ b/svx/inc/optgenrl.hrc @@ -74,7 +74,7 @@ #define LINEH 12 #define FLINEH 8 #define LEFT 12 -#define MID 96 +#define MID 100 #define RIGHT 248 #define TOP 10 #define LINE(y) (14+y*15) diff --git a/svx/inc/svdglob.hxx b/svx/inc/svdglob.hxx index 8bdca80dcd..46029ac3a0 100644 --- a/svx/inc/svdglob.hxx +++ b/svx/inc/svdglob.hxx @@ -33,11 +33,11 @@ #include <tools/contnr.hxx> -#ifndef _RESID_HXX //autogen #include <tools/resid.hxx> -#endif #include <tools/string.hxx> +#include <svx/svxdllapi.h> + //************************************************************ // Vorausdeklarationen //************************************************************ @@ -64,7 +64,7 @@ public: // IDs von SDR_StringCacheBegin (256) bis // SDR_StringCacheEnd (weiss ich grad' nicht). // Hierzu siehe auch SvdStr.Hrc -String ImpGetResStr(sal_uInt16 nResID); +SVX_DLLPUBLIC String ImpGetResStr(sal_uInt16 nResID); //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/svx/inc/svdstr.hrc b/svx/inc/svdstr.hrc index 68a1eec5ee..8bf727b7f1 100644 --- a/svx/inc/svdstr.hrc +++ b/svx/inc/svdstr.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -324,7 +324,13 @@ #define STR_UndoNewLayer (STR_UndoBegin +13) #define STR_UndoDelLayer (STR_UndoBegin +14) #define STR_UndoMovLayer (STR_UndoBegin +15) -#define STR_UndoEnd (STR_UndoMovLayer) + +// --> OD 2009-07-09 #i73249# +#define STR_UndoObjName (STR_UndoBegin +16) +#define STR_UndoObjTitle (STR_UndoBegin +17) +#define STR_UndoObjDescription (STR_UndoBegin +18) +// <-- +#define STR_UndoEnd (STR_UndoObjDescription) #define STR_LayerBegin (STR_UndoEnd+1) diff --git a/svx/inc/svx/AccessibleContextBase.hxx b/svx/inc/svx/AccessibleContextBase.hxx index 6177164b93..552942f7bc 100644 --- a/svx/inc/svx/AccessibleContextBase.hxx +++ b/svx/inc/svx/AccessibleContextBase.hxx @@ -1,37 +1,5 @@ /************************************************************************* * -<<<<<<< AccessibleContextBase.hxx - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: AccessibleContextBase.hxx,v $ - * - * $Revision: 1.4 $ - * - * last change: $Author: rt $ $Date: 2008-07-07 14:27:26 $ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library 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 for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA -======= * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2008 by Sun Microsystems, Inc. @@ -57,7 +25,6 @@ * version 3 along with OpenOffice.org. If not, see * <http://www.openoffice.org/license.html> * for a copy of the LGPLv3 License. ->>>>>>> 1.3 * ************************************************************************/ diff --git a/svx/inc/svx/AccessibleControlShape.hxx b/svx/inc/svx/AccessibleControlShape.hxx index cf76e64ed4..93e6c89e82 100644 --- a/svx/inc/svx/AccessibleControlShape.hxx +++ b/svx/inc/svx/AccessibleControlShape.hxx @@ -31,13 +31,9 @@ #ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_CONTROL_SHAPE_HXX #define _SVX_ACCESSIBILITY_ACCESSIBLE_CONTROL_SHAPE_HXX -#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_MANAGER_HXX #include <svx/AccessibleShape.hxx> -#endif -#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_ #include <com/sun/star/accessibility/XAccessibleAction.hpp> -#endif #include <com/sun/star/accessibility/XAccessibleEventListener.hpp> #include <com/sun/star/util/XModeChangeBroadcaster.hpp> #include <com/sun/star/container/XContainerListener.hpp> diff --git a/svx/inc/svx/AccessibleShape.hxx b/svx/inc/svx/AccessibleShape.hxx index 33c173f1f4..b176c7c942 100755 --- a/svx/inc/svx/AccessibleShape.hxx +++ b/svx/inc/svx/AccessibleShape.hxx @@ -1,37 +1,5 @@ /************************************************************************* * -<<<<<<< AccessibleShape.hxx - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: AccessibleShape.hxx,v $ - * - * $Revision: 1.4 $ - * - * last change: $Author: rt $ $Date: 2008-07-07 14:28:01 $ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library 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 for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA -======= * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2008 by Sun Microsystems, Inc. @@ -57,7 +25,6 @@ * version 3 along with OpenOffice.org. If not, see * <http://www.openoffice.org/license.html> * for a copy of the LGPLv3 License. ->>>>>>> 1.3 * ************************************************************************/ diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc index aa8c6674d5..de1fd8e671 100644 --- a/svx/inc/svx/dialogs.hrc +++ b/svx/inc/svx/dialogs.hrc @@ -251,8 +251,10 @@ // ResId fuer FontSubstitution #define RID_SVX_FONT_SUBSTITUTION (RID_SVX_START + 18) +// insert row&col dialog +#define DLG_INS_ROW_COL (RID_SVX_START + 156) + //InetDlg -//#define RID_SVXDLG_INTERNET (RID_SVX_START + 156) #define RID_SVXPAGE_INET_MAIL (RID_SVX_START + 155) #define RID_SVXPAGE_INET_PROXY (RID_SVX_START + 157) #define RID_SVXPAGE_INET_CACHE (RID_SVX_START + 158) diff --git a/svx/inc/svx/editeng.hxx b/svx/inc/svx/editeng.hxx index 7f7cfea42b..d117950382 100644 --- a/svx/inc/svx/editeng.hxx +++ b/svx/inc/svx/editeng.hxx @@ -219,6 +219,8 @@ public: USHORT GetLineCount( USHORT nParagraph ) const; xub_StrLen GetLineLen( USHORT nParagraph, USHORT nLine ) const; + void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const; + USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const; sal_uInt32 GetLineHeight( USHORT nParagraph, USHORT nLine = 0 ); USHORT GetFirstLineOffset( USHORT nParagraph ); ParagraphInfos GetParagraphInfos( USHORT nPara ); diff --git a/svx/inc/svx/editobj.hxx b/svx/inc/svx/editobj.hxx index 42ca4c6093..90a13b7114 100644 --- a/svx/inc/svx/editobj.hxx +++ b/svx/inc/svx/editobj.hxx @@ -121,6 +121,9 @@ public: virtual void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName ); bool operator==( const EditTextObject& rCompare ) const; + + // #i102062# + bool isWrongListEqual(const EditTextObject& rCompare) const; }; #endif // _EDITOBJ_HXX diff --git a/svx/inc/svx/emphitem.hxx b/svx/inc/svx/emphitem.hxx index 21c256053c..f7aab6ba52 100644 --- a/svx/inc/svx/emphitem.hxx +++ b/svx/inc/svx/emphitem.hxx @@ -28,7 +28,7 @@ * ************************************************************************/ #ifndef _SVX_EMPHITEM_HXX -#define _SVX_EMPTITEM_HXX +#define _SVX_EMPHITEM_HXX // include --------------------------------------------------------------- diff --git a/svx/inc/svx/escherex.hxx b/svx/inc/svx/escherex.hxx index 4bb34498ed..d021a13466 100644 --- a/svx/inc/svx/escherex.hxx +++ b/svx/inc/svx/escherex.hxx @@ -304,6 +304,8 @@ #define ESCHER_ShpInst_ActionButtonMovie 200 #define ESCHER_ShpInst_HostControl 201 #define ESCHER_ShpInst_TextBox 202 + +#define ESCHER_ShpInst_COUNT 203 #define ESCHER_ShpInst_Max 0x0FFF #define ESCHER_ShpInst_Nil ESCHER_ShpInst_Max @@ -960,10 +962,35 @@ namespace com { namespace sun { namespace star { struct Gradient; } namespace drawing { + struct EnhancedCustomShapeAdjustmentValue; class XShape; } }}} +struct SVX_DLLPUBLIC EscherConnectorListEntry +{ + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnector; + ::com::sun::star::awt::Point maPointA; + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToA; + ::com::sun::star::awt::Point maPointB; + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToB; + + sal_uInt32 GetConnectorRule( sal_Bool bFirst ); + + EscherConnectorListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rC, + const ::com::sun::star::awt::Point& rPA, + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSA , + const ::com::sun::star::awt::Point& rPB, + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSB ) : + mXConnector ( rC ), + maPointA ( rPA ), + mXConnectToA( rSA ), + maPointB ( rPB ), + mXConnectToB( rSB ) {} + + sal_uInt32 GetClosestPoint( const Polygon& rPoly, const ::com::sun::star::awt::Point& rP ); +}; + struct SVX_DLLPUBLIC EscherExContainer { sal_uInt32 nContPos; @@ -1108,8 +1135,19 @@ public: #define ESCHER_CREATEPOLYGON_POLYLINE 2 #define ESCHER_CREATEPOLYGON_POLYPOLYGON 4 -struct EscherPropSortStruct; class GraphicAttr; +class SdrObjCustomShape; + +struct EscherPropSortStruct +{ + sal_uInt8* pBuf; + sal_uInt32 nPropSize; + sal_uInt32 nPropValue; + sal_uInt16 nPropId; +}; + +typedef std::vector< EscherPropSortStruct > EscherProperties; + class SVX_DLLPUBLIC EscherPropertyContainer { EscherGraphicProvider* pGraphicProvider; @@ -1154,6 +1192,10 @@ class SVX_DLLPUBLIC EscherPropertyContainer sal_uInt8* pProp, sal_uInt32 nPropSize ); sal_Bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const; + + sal_Bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const; + + EscherProperties GetOpts() const; void Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT ); @@ -1202,6 +1244,14 @@ class SVX_DLLPUBLIC EscherPropertyContainer static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Any& rSource ); static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags ); static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags, rtl::OUString& rShapeType ); + + // helper functions which are also used in ooxml export + static sal_Bool GetLineArrow( const sal_Bool bLineStart, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, + ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth ); + static sal_Bool IsDefaultObject( SdrObjCustomShape* pCustoShape ); + static void LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted ); + static sal_Bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue ); }; // --------------------------------------------------------------------------------------------- @@ -1338,7 +1388,7 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr BOOL mbOleEmf; // OLE is EMF instead of WMF - BOOL DoSeek( UINT32 nKey ); + virtual BOOL DoSeek( UINT32 nKey ); public: @@ -1349,7 +1399,7 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr /// Wenn pPicStreamMergeBSE angegeben ist, werden die BLIPs /// aus diesem Stream in die MsofbtBSE Records des EscherStream /// gemerged, wie es fuer Excel (und Word?) benoetigt wird. - void Flush( SvStream* pPicStreamMergeBSE = NULL ); + virtual void Flush( SvStream* pPicStreamMergeBSE = NULL ); virtual ~EscherEx(); @@ -1360,13 +1410,13 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr void InsertPersistOffset( UINT32 nKey, UINT32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet BOOL SeekToPersistOffset( UINT32 nKey ); - BOOL InsertAtPersistOffset( UINT32 nKey, UINT32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die + virtual BOOL InsertAtPersistOffset( UINT32 nKey, UINT32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die // aktuelle StreamPosition aendert SvStream& GetStream() const { return *mpOutStrm; } ULONG GetStreamPos() const { return mpOutStrm->Tell(); } - BOOL SeekBehindRecHeader( UINT16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen + virtual BOOL SeekBehindRecHeader( UINT16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen // features beim erzeugen folgender Container: // @@ -1378,23 +1428,26 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 ); virtual void CloseContainer(); - void BeginAtom(); - void EndAtom( UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 ); - void AddAtom( UINT32 nAtomSitze, UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 ); - void AddClientAnchor( const Rectangle& rRectangle ); + virtual void BeginAtom(); + virtual void EndAtom( UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 ); + virtual void AddAtom( UINT32 nAtomSitze, UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 ); + virtual void AddChildAnchor( const Rectangle& rRectangle ); + virtual void AddClientAnchor( const Rectangle& rRectangle ); - UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 ); + virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 ); UINT32 EnterGroup( const Rectangle* pBoundRect = NULL ); UINT32 GetGroupLevel() const { return mnGroupLevel; }; - BOOL SetGroupSnapRect( UINT32 nGroupLevel, const Rectangle& rRect ); - BOOL SetGroupLogicRect( UINT32 nGroupLevel, const Rectangle& rRect ); - void LeaveGroup(); + virtual BOOL SetGroupSnapRect( UINT32 nGroupLevel, const Rectangle& rRect ); + virtual BOOL SetGroupLogicRect( UINT32 nGroupLevel, const Rectangle& rRect ); + virtual void LeaveGroup(); // ein ESCHER_Sp wird geschrieben ( Ein ESCHER_DgContainer muss dazu geoeffnet sein !!) - void AddShape( UINT32 nShpInstance, UINT32 nFlagIds, UINT32 nShapeID = 0 ); + virtual void AddShape( UINT32 nShpInstance, UINT32 nFlagIds, UINT32 nShapeID = 0 ); // reserviert eine ShapeId UINT32 GetShapeID(); + virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect ); + UINT32 GetColor( const UINT32 nColor, BOOL bSwap = TRUE ); UINT32 GetColor( const Color& rColor, BOOL bSwap = TRUE ); diff --git a/svx/inc/svx/fntctrl.hxx b/svx/inc/svx/fntctrl.hxx index 955d871973..31422c88b1 100644 --- a/svx/inc/svx/fntctrl.hxx +++ b/svx/inc/svx/fntctrl.hxx @@ -71,6 +71,7 @@ public: SvxFont& GetCJKFont(); SvxFont& GetCTLFont(); void SetColor( const Color& rColor ); + void ResetColor(); void SetBackColor( const Color& rColor ); void UseResourceText( BOOL bUse = TRUE ); void Paint( const Rectangle& ); diff --git a/svx/inc/svx/framelink.hxx b/svx/inc/svx/framelink.hxx index e6263606b8..2bf5138d42 100644 --- a/svx/inc/svx/framelink.hxx +++ b/svx/inc/svx/framelink.hxx @@ -325,7 +325,7 @@ inline double GetVerDiagAngle( const Rectangle& rRect ) @param fAngle Inner (right) angle between diagonal and horizontal frame border. */ -long GetTLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle ); +SVX_DLLPUBLIC long GetTLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle ); /** Returns an X coordinate for a diagonal frame border in the specified height. @@ -434,7 +434,7 @@ long GetTRDiagOffset( long nVerOffs, long nDiagOffs, double fAngle ); True, if rLBorder and rRBorder can be drawn in one step without interruption at their connection point. */ -bool CheckFrameBorderConnectable( +SVX_DLLPUBLIC bool CheckFrameBorderConnectable( const Style& rLBorder, /// Style of the left frame border to connect. const Style& rRBorder, /// Style of the right frame border to connect. @@ -486,7 +486,7 @@ bool CheckFrameBorderConnectable( | \ / | rLFromB \ / rRFromB */ -void DrawHorFrameBorder( +SVX_DLLPUBLIC void DrawHorFrameBorder( OutputDevice& rDev, /// The output device used to draw the frame border. const Point& rLPos, /// Reference point for left end of the processed frame border. @@ -603,7 +603,7 @@ void SVX_DLLPUBLIC DrawHorFrameBorder( rBFromB | */ -void DrawVerFrameBorder( +SVX_DLLPUBLIC void DrawVerFrameBorder( OutputDevice& rDev, /// The output device used to draw the frame border. const Point& rTPos, /// Reference point for top end of the processed frame border. @@ -698,7 +698,7 @@ void SVX_DLLPUBLIC DrawVerFrameBorderSlanted( The function preserves all settings of the passed output device. */ -void DrawDiagFrameBorders( +SVX_DLLPUBLIC void DrawDiagFrameBorders( OutputDevice& rDev, /// The output device used to draw the frame border. const Rectangle& rRect, /// Rectangle for both diagonal frame borders. diff --git a/svx/inc/svx/msdffimp.hxx b/svx/inc/svx/msdffimp.hxx index 4feaead917..bc40b396ec 100644 --- a/svx/inc/svx/msdffimp.hxx +++ b/svx/inc/svx/msdffimp.hxx @@ -36,9 +36,7 @@ #include <tools/solar.h> // UINTXX #include <svtools/svarray.hxx> -#ifndef _SV_COLOR_HXX //autogen #include <tools/color.hxx> -#endif #include <tools/gen.hxx> #include <tools/table.hxx> #include <svx/msdffdef.hxx> @@ -48,7 +46,7 @@ #include <map> #include <com/sun/star/beans/XPropertySet.hpp> -#include "svx/svxdllapi.h" +#include <svx/svxdllapi.h> #include <sot/storage.hxx> diff --git a/svx/inc/svx/msocximex.hxx b/svx/inc/svx/msocximex.hxx index 251ab5b366..c9b7b817cd 100644 --- a/svx/inc/svx/msocximex.hxx +++ b/svx/inc/svx/msocximex.hxx @@ -230,7 +230,7 @@ class SVX_DLLPUBLIC OCX_Control { public: OCX_Control(UniString sN, OCX_Control* parent = NULL ) : nWidth( 0 ), nHeight( 0 ), mnLeft(0), mnTop(0), - mnStep(0), mnBackColor(0x8000000FL), mnForeColor(0), mnTabPos(0), sName(sN), pDocSh(0), + mnStep(0), mnBackColor(0x8000000FL), mnForeColor(0), mnTabPos(0), mbVisible(true), sName(sN), pDocSh(0), bSetInDialog(FALSE), mpParent( parent ) {} sal_Bool FullRead(SotStorageStream *pS) { @@ -287,6 +287,7 @@ public: sal_Int32 mnBackColor; sal_Int32 mnForeColor; sal_uInt16 mnTabPos; + bool mbVisible; UniString sName; UniString msToolTip; OCX_FontData aFontData; @@ -483,7 +484,7 @@ public: }; struct ContainerRecord { - ContainerRecord():nTop(0), nLeft(0), nSubStorageId(0), nSubStreamLen(0), nTabPos(0), nTypeIdent(0) {} + ContainerRecord():nTop(0), nLeft(0), nSubStorageId(0), nSubStreamLen(0), nTabPos(0), nTypeIdent(0), bVisible( true ) {} ::rtl::OUString cName; ::rtl::OUString controlTip; @@ -494,6 +495,7 @@ struct ContainerRecord sal_uInt32 nSubStreamLen; sal_uInt16 nTabPos; sal_uInt16 nTypeIdent; + bool bVisible; }; typedef std::vector<OCX_Control*>::iterator CtrlIterator; diff --git a/svx/inc/svx/obj3d.hxx b/svx/inc/svx/obj3d.hxx index 136e3d77ea..229d8bcf19 100644 --- a/svx/inc/svx/obj3d.hxx +++ b/svx/inc/svx/obj3d.hxx @@ -92,8 +92,8 @@ class E3dObjList : public SdrObjList public: TYPEINFO(); E3dObjList(SdrModel* pNewModel = 0, SdrPage* pNewPage = 0, E3dObjList* pNewUpList = 0); - E3dObjList(const E3dObjList& rSrcList); - virtual ~E3dObjList(); + SVX_DLLPUBLIC E3dObjList(const E3dObjList& rSrcList); + SVX_DLLPUBLIC virtual ~E3dObjList(); virtual void NbcInsertObject(SdrObject* pObj, ULONG nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL); virtual void InsertObject(SdrObject* pObj, ULONG nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL); @@ -308,9 +308,6 @@ public : virtual UINT16 GetObjIdentifier() const; virtual void RecalcSnapRect(); - // Hittest, wird an Geometrie weitergegeben - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; - // Parameter Geometrieerzeugung setzen/lesen BOOL GetCreateNormals() const { return bCreateNormals; } void SetCreateNormals(BOOL bNew); diff --git a/svx/inc/svx/outlobj.hxx b/svx/inc/svx/outlobj.hxx index f99a95aedb..470f173d41 100644 --- a/svx/inc/svx/outlobj.hxx +++ b/svx/inc/svx/outlobj.hxx @@ -67,6 +67,9 @@ public: bool operator==(const OutlinerParaObject& rCandidate) const; bool operator!=(const OutlinerParaObject& rCandidate) const { return !operator==(rCandidate); } + // #i102062# + bool isWrongListEqual(const OutlinerParaObject& rCompare) const; + // outliner mode access sal_uInt16 GetOutlinerMode() const; void SetOutlinerMode(sal_uInt16 nNew); diff --git a/svx/inc/svx/sdasaitm.hxx b/svx/inc/svx/sdasaitm.hxx index 42289cd5cb..163172c1da 100644 --- a/svx/inc/svx/sdasaitm.hxx +++ b/svx/inc/svx/sdasaitm.hxx @@ -54,9 +54,9 @@ class SdrCustomShapeAdjustmentItem : public SfxPoolItem public : TYPEINFO(); - SdrCustomShapeAdjustmentItem(); + SVX_DLLPUBLIC SdrCustomShapeAdjustmentItem(); SdrCustomShapeAdjustmentItem( SvStream& rIn, sal_uInt16 nVersion ); - ~SdrCustomShapeAdjustmentItem(); + SVX_DLLPUBLIC ~SdrCustomShapeAdjustmentItem(); virtual int operator==( const SfxPoolItem& ) const; virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation, @@ -76,8 +76,8 @@ class SdrCustomShapeAdjustmentItem : public SfxPoolItem #endif sal_uInt32 GetCount() const { return aAdjustmentValueList.Count(); }; - const SdrCustomShapeAdjustmentValue& GetValue( sal_uInt32 nIndex ) const; - void SetValue( sal_uInt32 nIndex, + SVX_DLLPUBLIC const SdrCustomShapeAdjustmentValue& GetValue( sal_uInt32 nIndex ) const; + SVX_DLLPUBLIC void SetValue( sal_uInt32 nIndex, const SdrCustomShapeAdjustmentValue& rVal ); }; diff --git a/svx/inc/svx/sdgcpitm.hxx b/svx/inc/svx/sdgcpitm.hxx index d38df10226..680b5d495b 100644 --- a/svx/inc/svx/sdgcpitm.hxx +++ b/svx/inc/svx/sdgcpitm.hxx @@ -38,7 +38,7 @@ // SdrGrafCropItem - //------------------ -class SdrGrafCropItem : public SvxGrfCrop +class SVX_DLLPUBLIC SdrGrafCropItem : public SvxGrfCrop { public: diff --git a/svx/inc/svx/sdr/animation/objectanimator.hxx b/svx/inc/svx/sdr/animation/objectanimator.hxx index a4b2867e5d..a618d846ef 100644 --- a/svx/inc/svx/sdr/animation/objectanimator.hxx +++ b/svx/inc/svx/sdr/animation/objectanimator.hxx @@ -48,7 +48,7 @@ namespace sdr public: // basic constructor and destructor primitiveAnimator(); - virtual ~primitiveAnimator(); + SVX_DLLPUBLIC virtual ~primitiveAnimator(); }; } // end of namespace animation } // end of namespace sdr diff --git a/svx/inc/svx/sdr/animation/scheduler.hxx b/svx/inc/svx/sdr/animation/scheduler.hxx index ea6c7d37cc..7c927ec590 100644 --- a/svx/inc/svx/sdr/animation/scheduler.hxx +++ b/svx/inc/svx/sdr/animation/scheduler.hxx @@ -33,6 +33,7 @@ #include <sal/types.h> #include <vcl/timer.hxx> +#include <svx/svxdllapi.h> ////////////////////////////////////////////////////////////////////////////// // event class @@ -52,7 +53,7 @@ namespace sdr public: // constructor/destructor Event(sal_uInt32 nTime); - virtual ~Event(); + SVX_DLLPUBLIC virtual ~Event(); // access to mpNext Event* GetNext() const; @@ -83,7 +84,7 @@ namespace sdr public: // constructor/destructor EventList(); - virtual ~EventList(); + SVX_DLLPUBLIC virtual ~EventList(); // insert/remove time dependent void Insert(Event* pNew); @@ -123,10 +124,10 @@ namespace sdr public: // constructor/destructor Scheduler(); - virtual ~Scheduler(); + SVX_DLLPUBLIC virtual ~Scheduler(); // From baseclass Timer, the timeout call - virtual void Timeout(); + SVX_DLLPUBLIC virtual void Timeout(); // get time sal_uInt32 GetTime(); diff --git a/svx/inc/svx/sdr/attribute/sdrallattribute.hxx b/svx/inc/svx/sdr/attribute/sdrallattribute.hxx index d264a0d2c5..092c0e224a 100644 --- a/svx/inc/svx/sdr/attribute/sdrallattribute.hxx +++ b/svx/inc/svx/sdr/attribute/sdrallattribute.hxx @@ -32,6 +32,8 @@ #ifndef _SDR_ATTRIBUTE_SDRALLATTRIBUTE_HXX #define _SDR_ATTRIBUTE_SDRALLATTRIBUTE_HXX +#include <sal/types.h> + ////////////////////////////////////////////////////////////////////////////// // predefines @@ -57,7 +59,9 @@ namespace drawinglayer SdrTextAttribute* mpTextAttribute; // text and text attributes (if used) public: - SdrShadowTextAttribute(SdrShadowAttribute* pShadow = 0L, SdrTextAttribute* pTextAttribute = 0L); + SdrShadowTextAttribute( + SdrShadowAttribute* pShadow = 0, + SdrTextAttribute* pTextAttribute = 0); ~SdrShadowTextAttribute(); // copy constructor and assigment operator @@ -68,7 +72,7 @@ namespace drawinglayer bool operator==(const SdrShadowTextAttribute& rCandidate) const; // bool access - bool isVisible() const { return (0L != mpTextAttribute); } + bool isVisible() const { return (0 != mpTextAttribute); } // data access const SdrShadowAttribute* getShadow() const { return mpShadow; } @@ -91,7 +95,10 @@ namespace drawinglayer SdrTextAttribute* mpTextAttribute; // text and text attributes (if used) public: - SdrFillTextAttribute(SdrFillAttribute* pFill = 0L, FillGradientAttribute* pFillFloatTransGradient = 0L, SdrTextAttribute* pTextAttribute = 0L); + SdrFillTextAttribute( + SdrFillAttribute* pFill = 0, + FillGradientAttribute* pFillFloatTransGradient = 0, + SdrTextAttribute* pTextAttribute = 0); ~SdrFillTextAttribute(); // copy constructor and assigment operator @@ -126,8 +133,10 @@ namespace drawinglayer public: SdrLineShadowTextAttribute( - SdrLineAttribute* pLine = 0L, SdrLineStartEndAttribute* pLineStartEnd = 0L, - SdrShadowAttribute* pShadow = 0L, SdrTextAttribute* pTextAttribute = 0L); + SdrLineAttribute* pLine = 0, + SdrLineStartEndAttribute* pLineStartEnd = 0, + SdrShadowAttribute* pShadow = 0, + SdrTextAttribute* pTextAttribute = 0); ~SdrLineShadowTextAttribute(); // copy constructor and assigment operator @@ -161,8 +170,12 @@ namespace drawinglayer public: SdrLineFillShadowTextAttribute( - SdrLineAttribute* pLine = 0L, SdrFillAttribute* pFill = 0L, SdrLineStartEndAttribute* pLineStartEnd = 0L, - SdrShadowAttribute* pShadow = 0L, FillGradientAttribute* pFillFloatTransGradient = 0L, SdrTextAttribute* pTextAttribute = 0L); + SdrLineAttribute* pLine = 0, + SdrFillAttribute* pFill = 0, + SdrLineStartEndAttribute* pLineStartEnd = 0, + SdrShadowAttribute* pShadow = 0, + FillGradientAttribute* pFillFloatTransGradient = 0, + SdrTextAttribute* pTextAttribute = 0); ~SdrLineFillShadowTextAttribute(); // copy constructor and assigment operator diff --git a/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx new file mode 100644 index 0000000000..aa417b4451 --- /dev/null +++ b/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * 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: sdrtextattribute.hxx,v $ + * + * $Revision: 1.2 $ + * + * 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 _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX + +#include <sal/types.h> +#include <svx/xenum.hxx> +#include <tools/color.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines +class SfxItemSet; +namespace drawinglayer { namespace attribute { class SdrFormTextOutlineAttribute; }} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrFormTextAttribute + { + private: + // FormText (FontWork) Attributes + sal_Int32 mnFormTextDistance; // distance from line in upright direction + sal_Int32 mnFormTextStart; // shift from polygon start + sal_Int32 mnFormTextShdwXVal; // shadow distance or 10th degrees + sal_Int32 mnFormTextShdwYVal; // shadow distance or scaling + sal_uInt16 mnFormTextShdwTransp; // shadow transparence + XFormTextStyle meFormTextStyle; // on/off and char orientation + XFormTextAdjust meFormTextAdjust; // adjustment (left/right/center) and scale + XFormTextShadow meFormTextShadow; // shadow mode + Color maFormTextShdwColor; // shadow color + + // outline attributes; used when getFormTextOutline() is true and (for + // shadow) when getFormTextShadow() != XFTSHADOW_NONE + SdrFormTextOutlineAttribute* mpOutline; + SdrFormTextOutlineAttribute* mpShadowOutline; + + // bitfield + unsigned mbFormTextMirror : 1; // change orientation + unsigned mbFormTextOutline : 1; // show contour of objects + + public: + SdrFormTextAttribute(const SfxItemSet& rSet); + ~SdrFormTextAttribute(); + + // copy constructor and assigment operator + SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate); + SdrFormTextAttribute& operator=(const SdrFormTextAttribute& rCandidate); + + // compare operator + bool operator==(const SdrFormTextAttribute& rCandidate) const; + + // data access + sal_Int32 getFormTextDistance() const { return mnFormTextDistance; } + sal_Int32 getFormTextStart() const { return mnFormTextStart; } + sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; } + sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; } + sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; } + XFormTextStyle getFormTextStyle() const { return meFormTextStyle; } + XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; } + XFormTextShadow getFormTextShadow() const { return meFormTextShadow; } + Color getFormTextShdwColor() const { return maFormTextShdwColor; } + + const SdrFormTextOutlineAttribute* getOutline() const { return mpOutline; } + const SdrFormTextOutlineAttribute* getShadowOutline() const { return mpShadowOutline; } + + bool getFormTextMirror() const { return mbFormTextMirror; } + bool getFormTextOutline() const { return mbFormTextOutline; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX + +// eof diff --git a/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx b/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx new file mode 100644 index 0000000000..c8c80ceb02 --- /dev/null +++ b/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx @@ -0,0 +1,74 @@ +/************************************************************************* + * + * 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: sdrtextattribute.hxx,v $ + * + * $Revision: 1.2 $ + * + * 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 _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX + +#include <sal/types.h> +#include <drawinglayer/attribute/lineattribute.hxx> +#include <drawinglayer/attribute/strokeattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrFormTextOutlineAttribute + { + private: + // one set of attributes for FormText (FontWork) outline visualisation + LineAttribute maLineAttribute; + StrokeAttribute maStrokeAttribute; + sal_uInt8 mnTransparence; + + public: + SdrFormTextOutlineAttribute( + const LineAttribute& rLineAttribute, + const StrokeAttribute& rStrokeAttribute, + sal_uInt8 nTransparence); + + // compare operator + bool operator==(const SdrFormTextOutlineAttribute& rCandidate) const; + + // data read access + const LineAttribute& getLineAttribute() const { return maLineAttribute; } + const StrokeAttribute getStrokeAttribute() const { return maStrokeAttribute; } + sal_uInt8 getTransparence() const { return mnTransparence; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX + +// eof diff --git a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx index 6193488113..48d3cb135d 100644 --- a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx +++ b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx @@ -32,18 +32,15 @@ #ifndef _SDR_ATTRIBUTE_SDRTEXTATTRIBUTE_HXX #define _SDR_ATTRIBUTE_SDRTEXTATTRIBUTE_HXX -#include <svx/xenum.hxx> #include <sal/types.h> -#include <svx/sdr/primitive2d/sdrtextprimitive2d.hxx> +#include <svx/xenum.hxx> +#include <svx/outlobj.hxx> ////////////////////////////////////////////////////////////////////////////// // predefines class SdrText; -class OutlinerParaObject; - -namespace drawinglayer { namespace animation { - class AnimationEntryList; -}} +namespace drawinglayer { namespace animation { class AnimationEntryList; }} +namespace drawinglayer { namespace attribute { class SdrFormTextAttribute; }} ////////////////////////////////////////////////////////////////////////////// @@ -53,15 +50,24 @@ namespace drawinglayer { class SdrTextAttribute { - const SdrText& mrSdrText; - const OutlinerParaObject maOutlinerParaObject; - XFormTextStyle meFormTextStyle; + private: + // all-text attributes. The SdrText itself and a copy + // of te OPO + const SdrText* mpSdrText; + OutlinerParaObject maOutlinerParaObject; + + // Set when it's a FormText; contains all FormText attributes + SdrFormTextAttribute* mpSdrFormTextAttribute; + // text distances sal_Int32 maTextLeftDistance; sal_Int32 maTextUpperDistance; sal_Int32 maTextRightDistance; sal_Int32 maTextLowerDistance; + // #i101556# use versioning from text attributes to detect changes + sal_uInt32 maPropertiesVersion; + // bitfield unsigned mbContour : 1; unsigned mbFitToSize : 1; @@ -85,23 +91,30 @@ namespace drawinglayer bool bBlink, bool bScroll, bool bInEditMode); + ~SdrTextAttribute(); + + // copy constructor and assigment operator + SdrTextAttribute(const SdrTextAttribute& rCandidate); + SdrTextAttribute& operator=(const SdrTextAttribute& rCandidate); + + // compare operator bool operator==(const SdrTextAttribute& rCandidate) const; // data access - const SdrText& getSdrText() const { return mrSdrText; } + const SdrText& getSdrText() const { return *mpSdrText; } const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; } bool isContour() const { return mbContour; } - bool isFontwork() const { return (XFT_NONE != meFormTextStyle); } bool isFitToSize() const { return mbFitToSize; } bool isHideContour() const { return mbHideContour; } bool isBlink() const { return mbBlink; } bool isScroll() const { return mbScroll; } bool isInEditMode() const { return mbInEditMode; } - XFormTextStyle getFormTextStyle() const { return meFormTextStyle; } + const SdrFormTextAttribute* getSdrFormTextAttribute() const { return mpSdrFormTextAttribute; } sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; } sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; } sal_Int32 getTextRightDistance() const { return maTextRightDistance; } sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; } + sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; } // animation timing generation void getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const; diff --git a/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx b/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx index f977de554d..322b55b69a 100644 --- a/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx +++ b/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx @@ -38,6 +38,8 @@ // predeclarations class SdrGrafObj; +namespace drawinglayer { namespace attribute { class SdrLineFillShadowTextAttribute; }} +class GraphicAttr; ////////////////////////////////////////////////////////////////////////////// @@ -47,6 +49,16 @@ namespace sdr { class ViewContactOfGraphic : public ViewContactOfTextObj { + private: + // helpers for constructing various primitive visualisations in various states + drawinglayer::primitive2d::Primitive2DSequence createVIP2DSForPresObj( + const basegfx::B2DHomMatrix& rObjectMatrix, + const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute, + const GraphicAttr& rLocalGrafInfo) const; + drawinglayer::primitive2d::Primitive2DSequence createVIP2DSForDraft( + const basegfx::B2DHomMatrix& rObjectMatrix, + const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const; + protected: // Create a Object-Specific ViewObjectContact, set ViewContact and // ObjectContact. Always needs to return something. @@ -63,6 +75,13 @@ namespace sdr ViewContactOfGraphic(SdrGrafObj& rGrafObj); virtual ~ViewContactOfGraphic(); + // #i102380# + void flushGraphicObjects(); + + // helpers for viusualisation state + bool visualisationUsesPresObj() const; + bool visualisationUsesDraft() const; + protected: // This method is responsible for creating the graphical visualisation data // ONLY based on model data diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx index 0283aeff83..630187b323 100644 --- a/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx @@ -64,15 +64,15 @@ namespace sdr ViewContactOfSdrOle2Obj(SdrOle2Obj& rOle2Obj); virtual ~ViewContactOfSdrOle2Obj(); - // helper for creating a OLE sequence for this object for a specified Graphic. This is locally - // used from createViewIndependentPrimitive2DSequence and also allows the VOC which knows about - // HighContrast mode to easily do the same with the HighContrast OLE metafile. It also allows - // to give a hint for scaling down the content what is needed for EmptyPresObjs - drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceWithGivenGraphic(const Graphic& rOLEGraphic, bool bScaleContent) const; + // helper for creating a OLE sequence for this object. It takes care od attributes, needed + // scaling (e.g. for EmptyPresObj's), the correct graphic and other stuff. It is used from + // createViewIndependentPrimitive2DSequence with false, and with evtl. HighContrast true + // from the VOC which knows that + drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceWithParameters(bool bHighContrast) const; protected: // This method is responsible for creating the graphical visualisation data - // ONLY based on model data + // ONLY based on model data, just wraps to call createPrimitive2DSequenceWithParameters(false) virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; }; } // end of namespace contact diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx index 5b7103e55c..b505756352 100644 --- a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx @@ -89,18 +89,6 @@ namespace sdr { namespace contact { */ void setControlDesignMode( bool _bDesignMode ) const; - /** determines whether the instance belongs to a given OutputDevice - @precond - The instance knows the device it belongs to, or can determine it. - If this is not the case, you will notice an assertion, and the method will - return false. - */ - bool belongsToDevice( const OutputDevice* _pDevice ) const; - - /** positions the control for subsequent paint operations - */ - void positionControlForPaint( const DisplayInfo& _rDisplayInfo ) const; - /** callback from impl class to react on changes of properties form the XControlModel */ void propertyChange(); @@ -165,6 +153,8 @@ namespace sdr { namespace contact { UnoControlPrintOrPreviewContact(); // never implemented UnoControlPrintOrPreviewContact( const UnoControlPrintOrPreviewContact& ); // never implemented UnoControlPrintOrPreviewContact& operator=( const UnoControlPrintOrPreviewContact& ); // never implemented + + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo ) const; }; //==================================================================== diff --git a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx index f0321d2936..f6603d2c4d 100644 --- a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx +++ b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx @@ -60,11 +60,8 @@ namespace sdr // Flag to remember which state to draw. Inited with sal_False (0) unsigned mbOverlayState : 1; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); // #i53216# check blink time value range (currently 25 < mnBlinkTime < 10000) void impCheckBlinkTimeValueRange(); @@ -100,11 +97,6 @@ namespace sdr // execute event from base class ::sdr::animation::Event. Default // implementation does nothing and does not create a new event. virtual void Trigger(sal_uInt32 nTime); - - // Zoom has changed. If the objects logical size - // depends on the MapMode of the used OutputDevice, use this call - // to invalidate the range in logical coordinates. - virtual void zoomHasChanged(); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlaybitmap.hxx b/svx/inc/svx/sdr/overlay/overlaybitmap.hxx deleted file mode 100644 index 25d6980976..0000000000 --- a/svx/inc/svx/sdr/overlay/overlaybitmap.hxx +++ /dev/null @@ -1,94 +0,0 @@ -/************************************************************************* - * - * 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: overlaybitmap.hxx,v $ - * $Revision: 1.3 $ - * - * 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 _SDR_OVERLAY_OVERLAYBITMAP_HXX -#define _SDR_OVERLAY_OVERLAYBITMAP_HXX - -#include <svx/sdr/overlay/overlayobject.hxx> -#include <vcl/bitmap.hxx> - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - class OverlayBitmap : public OverlayObjectWithBasePosition - { - protected: - // the Bitmap itself - Bitmap maBitmap; - - // position of the basePosition inside the Bitmap, in pixels - sal_uInt16 mnCenterX; - sal_uInt16 mnCenterY; - - // bitfield - // shall the BaseColor be used to create transparence? - unsigned mbUseTransparenceColor : 1; - - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); - - public: - OverlayBitmap( - const basegfx::B2DPoint& rBasePos, - const Bitmap& rBitmap, - sal_uInt16 nCenX = 0, sal_uInt16 nCenY = 0, - sal_Bool bUseTransCol = sal_False, - Color aTransColor = Color(COL_WHITE)); - virtual ~OverlayBitmap(); - - const Bitmap& getBitmap() const { return maBitmap; } - void setBitmap(const Bitmap& rNew); - - sal_Bool isTransparenceUsed() const { return mbUseTransparenceColor; } - void setTransparenceUsed(sal_Bool bNew); - - sal_uInt16 getCenterX() const { return mnCenterX; } - sal_uInt16 getCenterY() const { return mnCenterY; } - void setCenterXY(sal_uInt16 nNewX, sal_uInt16 nNewY); - - // Zoom has changed. If the objects logical size - // depends on the MapMode of the used OutputDevice, use this call - // to invalidate the range in logical coordinates. - virtual void zoomHasChanged(); - }; - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -#endif //_SDR_OVERLAY_OVERLAYBITMAP_HXX - -// eof diff --git a/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx b/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx index 8d006c5dc4..531890c6c0 100644 --- a/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx +++ b/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx @@ -50,11 +50,7 @@ namespace sdr sal_uInt16 mnCenterX; sal_uInt16 mnCenterY; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: OverlayBitmapEx( @@ -69,11 +65,6 @@ namespace sdr sal_uInt16 getCenterX() const { return mnCenterX; } sal_uInt16 getCenterY() const { return mnCenterY; } void setCenterXY(sal_uInt16 nNewX, sal_uInt16 nNewY); - - // Zoom has changed. If the objects logical size - // depends on the MapMode of the used OutputDevice, use this call - // to invalidate the range in logical coordinates. - virtual void zoomHasChanged(); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx b/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx index 75f8182558..5a9f2286f0 100644 --- a/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx +++ b/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx @@ -42,39 +42,15 @@ namespace sdr class OverlayCrosshairStriped : public OverlayObjectWithBasePosition { protected: - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: OverlayCrosshairStriped(const basegfx::B2DPoint& rBasePos); virtual ~OverlayCrosshairStriped(); - // Hittest with logical coordinates - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; - }; - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - class OverlayCrosshair : public OverlayCrosshairStriped - { - protected: - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - public: - OverlayCrosshair( - const basegfx::B2DPoint& rBasePos, - Color aLineColor = Color(COL_BLACK)); - virtual ~OverlayCrosshair(); + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx b/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx index a34eaf781e..497d7c1b89 100644 --- a/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx +++ b/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx @@ -47,38 +47,30 @@ namespace sdr { // geometric definitions basegfx::B2DPoint maSecondPosition; - const double mfDiscreteWidth; + const double mfDiscreteGrow; + const double mfDiscreteShrink; const double mfHatchRotation; const double mfRotation; - // helper to create visualisation geometry from above values - basegfx::B2DPolyPolygon getGeometry(OutputDevice& rOutputDevice); - - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: OverlayHatchRect( const basegfx::B2DPoint& rBasePosition, const basegfx::B2DPoint& rSecondPosition, const Color& rHatchColor, - double fDiscreteWidth, + double fDiscreteGrow, + double fDiscreteShrink, double fHatchRotation, double fRotation); const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } void setSecondPosition(const basegfx::B2DPoint&); - // Zoom has changed. If the objects logical size - // depends on the MapMode of the used OutputDevice, use this call - // to invalidate the range in logical coordinates. - virtual void zoomHasChanged(); - // data read access - double getDiscreteWidth() const { return mfDiscreteWidth; } + double getDiscreteGrow() const { return mfDiscreteGrow; } + double getDiscreteShrink() const { return mfDiscreteShrink; } double getHatchRotation() const { return mfHatchRotation; } double getRotation() const { return mfRotation; } }; diff --git a/svx/inc/svx/sdr/overlay/overlayhelpline.hxx b/svx/inc/svx/sdr/overlay/overlayhelpline.hxx index f171a39a67..b51a91621b 100644 --- a/svx/inc/svx/sdr/overlay/overlayhelpline.hxx +++ b/svx/inc/svx/sdr/overlay/overlayhelpline.hxx @@ -46,11 +46,8 @@ namespace sdr // remember HelpLineKind SdrHelpLineKind meKind; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: OverlayHelplineStriped( @@ -58,30 +55,11 @@ namespace sdr SdrHelpLineKind eNewKind = SDRHELPLINE_POINT); virtual ~OverlayHelplineStriped(); - // Hittest with logical coordinates - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; - }; - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - class OverlayHelpline : public OverlayHelplineStriped - { - protected: - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); + // dat read access + SdrHelpLineKind getKind() const { return meKind; } - public: - OverlayHelpline( - const basegfx::B2DPoint& rBasePos, - Color aLineColor = Color(COL_BLACK), - SdrHelpLineKind eNewKind = SDRHELPLINE_POINT); - virtual ~OverlayHelpline(); + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlayline.hxx b/svx/inc/svx/sdr/overlay/overlayline.hxx index b8aa0056bd..314589c47c 100644 --- a/svx/inc/svx/sdr/overlay/overlayline.hxx +++ b/svx/inc/svx/sdr/overlay/overlayline.hxx @@ -45,11 +45,8 @@ namespace sdr // second position in pixel basegfx::B2DPoint maSecondPosition; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: OverlayLineStriped( @@ -61,33 +58,8 @@ namespace sdr const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } void setSecondPosition(const basegfx::B2DPoint& rNew); - // Hittest with logical coordinates - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; - - // transform object coordinates. Needs to transform maSecondPosition. - virtual void transform(const basegfx::B2DHomMatrix& rMatrix); - }; - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - class OverlayLine : public OverlayLineStriped - { - protected: - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - public: - OverlayLine( - const basegfx::B2DPoint& rBasePos, - const basegfx::B2DPoint& rSecondPos, - Color aLineColor = Color(COL_BLACK)); - virtual ~OverlayLine(); + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlaylinestriped.hxx b/svx/inc/svx/sdr/overlay/overlaylinestriped.hxx deleted file mode 100644 index 55923aebd4..0000000000 --- a/svx/inc/svx/sdr/overlay/overlaylinestriped.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************* - * - * 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: overlaylinestriped.hxx,v $ - * $Revision: 1.3 $ - * - * 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 _SDR_OVERLAY_OVERLAYLINESTRIPED_HXX -#define _SDR_OVERLAY_OVERLAYLINESTRIPED_HXX - -#include <svx/sdr/overlay/overlayline.hxx> - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -#endif //_SDR_OVERLAY_OVERLAYLINESTRIPED_HXX - -// eof diff --git a/svx/inc/svx/sdr/overlay/overlaymanager.hxx b/svx/inc/svx/sdr/overlay/overlaymanager.hxx index 9b22f9b46f..1ca348a244 100644 --- a/svx/inc/svx/sdr/overlay/overlaymanager.hxx +++ b/svx/inc/svx/sdr/overlay/overlaymanager.hxx @@ -38,7 +38,6 @@ #include <tools/color.hxx> #include "svx/svxdllapi.h" #include <svtools/optionsdrawinglayer.hxx> -#include <boost/shared_ptr.hpp> #include <basegfx/matrix/b2dhommatrix.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> @@ -68,14 +67,9 @@ namespace sdr // the OutputDevice to work on, set on construction and not to be changed OutputDevice& rmOutputDevice; - // start, end and number of the double linked list of OverlayObjects - // managed by this manager - OverlayObject* mpOverlayObjectStart; - OverlayObject* mpOverlayObjectEnd; - - // MapMode for MapMode change watching - MapMode maMapMode; - + // the vector of registered OverlayObjects + OverlayObjectVector maOverlayObjects; + // Stripe support. All striped OverlayObjects use these stripe // values. Changes change all those objects. Color maStripeColorA; // defaults to Color(COL_BLACK) @@ -88,23 +82,33 @@ namespace sdr // hold buffered the logic length of discrete vector (1.0, 0.0) and the // view transformation belonging to it. Update happens in getDiscreteOne() basegfx::B2DHomMatrix maViewTransformation; + drawinglayer::geometry::ViewInformation2D maViewInformation2D; double mfDiscreteOne; // internal void ImpDrawMembers(const basegfx::B2DRange& rRange, OutputDevice& rDestinationDevice) const; - void ImpCheckMapModeChange() const; void ImpStripeDefinitionChanged(); + void impApplyRemoveActions(OverlayObject& rTarget); + void impApplyAddActions(OverlayObject& rTarget); // return mfDiscreteOne to derivations, but also check for buffered local // ViewTransformation and evtl. correct mfDiscreteOne double getDiscreteOne() const; public: - OverlayManager(OutputDevice& rOutputDevice); + // when handing over another OverlayManager at construction, the OverlayObjects + // will be taken over from it. The new one will have added all OverlayObjects + // while the handed over one will have none + OverlayManager( + OutputDevice& rOutputDevice, + OverlayManager* pOldOverlayManager = 0); virtual ~OverlayManager(); + // access to current ViewInformation2D; this call checks and evtl. updates ViewInformation2D + const drawinglayer::geometry::ViewInformation2D getCurrentViewInformation2D() const; + // complete redraw - virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L) const; + virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0) const; // flush. Do buffered updates. virtual void flush(); @@ -139,17 +143,6 @@ namespace sdr // access to maDrawinglayerOpt const SvtOptionsDrawinglayer& getDrawinglayerOpt() const { return maDrawinglayerOpt; } - - /** Return a list of all OverlayObjects that currently belong to - the called OverlayManager. Subsequent calls to add() or - remove() will not alter the content of the returned list. - Modifying the list will not change the list of - OverlayObjects that belong to the called OverlayManager. - @return - The returned pointer is never empty but the pointed-to - vector may be. - */ - ::boost::shared_ptr<OverlayObjectVector> GetOverlayObjects (void) const; }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx b/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx index 5f3d7d3df5..709f3be982 100644 --- a/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx +++ b/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx @@ -65,7 +65,7 @@ namespace sdr // bitfield // Flag to decide if PreRendering shall be used for overlay refreshes. - // Default is sal_False. + // Default is false. unsigned mbRefreshWithPreRendering : 1; // link for timer @@ -78,7 +78,13 @@ namespace sdr void ImpSaveBackground(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L); public: - OverlayManagerBuffered(OutputDevice& rOutputDevice, sal_Bool bRefreshWithPreRendering = sal_False); + // when handing over another OverlayManager at construction, the OverlayObjects + // will be taken over from it. The new one will have added all OverlayObjects + // while the handed over one will have none + OverlayManagerBuffered( + OutputDevice& rOutputDevice, + OverlayManager* pOldOverlayManager = 0, + bool bRefreshWithPreRendering = false); virtual ~OverlayManagerBuffered(); // complete redraw @@ -97,8 +103,8 @@ namespace sdr virtual void invalidateRange(const basegfx::B2DRange& rRange); // access to RefreshWithPreRendering Flag - sal_Bool DoRefreshWithPreRendering() const { return mbRefreshWithPreRendering; } - void SetRefreshWithPreRendering(sal_Bool bNew); + bool DoRefreshWithPreRendering() const { return mbRefreshWithPreRendering; } + void SetRefreshWithPreRendering(bool bNew); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlayobject.hxx b/svx/inc/svx/sdr/overlay/overlayobject.hxx index 3d8c4fbc29..a48afed140 100644 --- a/svx/inc/svx/sdr/overlay/overlayobject.hxx +++ b/svx/inc/svx/sdr/overlay/overlayobject.hxx @@ -36,6 +36,7 @@ #include <tools/color.hxx> #include <svx/sdr/animation/scheduler.hxx> #include "svx/svxdllapi.h" +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> #include <vector> @@ -65,60 +66,64 @@ namespace sdr { namespace overlay { - class SVX_DLLPUBLIC OverlayObject : public ::sdr::animation::Event + class SVX_DLLPUBLIC OverlayObject : private ::boost::noncopyable, public ::sdr::animation::Event { - // Manager is allowed access to private Members, especially - // pNext and pPrevious are used form the manager to handle the - // OverlayObject. - friend class OverlayManager; + private: + // Manager is allowed access to private Member mpOverlayManager + friend class OverlayManager; // pointer to OverlayManager, if object is added. Changed by // OverlayManager, do not chnge Yourself. - OverlayManager* mpOverlayManager; + OverlayManager* mpOverlayManager; - // Chaining of IAO's, used by OverlayManager. These will be - // used form the OverlayManager, so do not change them Yourself. - OverlayObject* mpNext; - OverlayObject* mpPrevious; + // Primitive2DSequence of the OverlayObject + drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence; protected: + // access methods to maPrimitive2DSequence. The usage of this methods may allow + // later thread-safe stuff to be added if needed. Only to be used by getPrimitive2DSequence() + // implementations for buffering the last decomposition. + const drawinglayer::primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; } + void setPrimitive2DSequence(const drawinglayer::primitive2d::Primitive2DSequence& rNew) { maPrimitive2DSequence = rNew; } + + // the creation method for Primitive2DSequence. Called when getPrimitive2DSequence() + // sees that maPrimitive2DSequence is empty. Needs to be supported by all + // OverlayObject implementations. Default implementation will assert + // a missing implementation + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + // region in logical coordinates - basegfx::B2DRange maBaseRange; + basegfx::B2DRange maBaseRange; // base color of this OverlayObject - Color maBaseColor; + Color maBaseColor; // bitfield // Flag for visibility - unsigned mbIsVisible : 1; - - // Flag for validity - unsigned mbIsChanged : 1; + unsigned mbIsVisible : 1; // Flag to control hittability - unsigned mbIsHittable : 1; + unsigned mbIsHittable : 1; // Flag to hold info if this objects supports animation. Default is - // sal_False. If sal_True, the Trigger() method should be overloaded + // false. If true, the Trigger() method should be overloaded // to implement the animation effect and to re-initiate the event. - unsigned mbAllowsAnimation : 1; + unsigned mbAllowsAnimation : 1; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice) = 0; - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice) = 0; + // Flag tocontrol if this OverlayObject allows AntiAliased visualisation. + // Default is true, but e.g. for selection visualisation in SC and SW, + // it is switched to false + unsigned mbAllowsAntiAliase : 1; // set changed flag. Call after change, since the old range is invalidated // and then the new one is calculated and invalidated, too. This will only // work after the change. - void objectChange(); + virtual void objectChange(); - // support method to draw striped geometries - void ImpDrawRangeStriped(OutputDevice& rOutputDevice, const basegfx::B2DRange& rRange); - void ImpDrawLineStriped(OutputDevice& rOutputDevice, double x1, double y1, double x2, double y2); - void ImpDrawLineStriped(OutputDevice& rOutputDevice, const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd); - void ImpDrawPolygonStriped(OutputDevice& rOutputDevice, const basegfx::B2DPolygon& rPolygon); + // write access to AntiAliase flag. This is protected since + // only implementations are allowed to change this, preferrably in their + // constructor + void allowAntiAliase(bool bNew); public: OverlayObject(Color aBaseColor); @@ -127,19 +132,21 @@ namespace sdr // get OverlayManager OverlayManager* getOverlayManager() const { return mpOverlayManager; } - // Hittest with logical coordinates. Default tests against maBaseRange. - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; + // the access method for Primitive2DSequence. Will use createPrimitive2DSequence and + // setPrimitive2DSequence if needed. Overloading may be used to allow disposal of last + // created primitives to react on changed circumstances and to re-create primitives + virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const; // access to visibility state - sal_Bool isVisible() const { return mbIsVisible; } - void setVisible(sal_Bool bNew); - - // read access to changed flag - sal_Bool isChanged() const { return mbIsChanged; } + bool isVisible() const { return mbIsVisible; } + void setVisible(bool bNew); // access to hittable flag - sal_Bool isHittable() const { return mbIsHittable; } - void setHittable(sal_Bool bNew); + bool isHittable() const { return mbIsHittable; } + void setHittable(bool bNew); + + // read access to AntiAliase flag + bool allowsAntiAliase() const { return mbAllowsAntiAliase; } // read access to baseRange. This may trigger createBaseRange() if // object is changed. @@ -154,16 +161,7 @@ namespace sdr virtual void Trigger(sal_uInt32 nTime); // acces to AllowsAnimation flag - sal_Bool allowsAnimation() const { return mbAllowsAnimation; } - - // transform object coordinates. - virtual void transform(const basegfx::B2DHomMatrix& rMatrix) = 0; - - // Zoom has changed. If the objects logical size - // depends on the MapMode of the used OutputDevice, use this call - // to invalidate the range in logical coordinates. Default is no - // change. - virtual void zoomHasChanged(); + bool allowsAnimation() const { return mbAllowsAnimation; } // stripe definition has changed. The OverlayManager does have // support data to draw graphics in two colors striped. This @@ -197,10 +195,6 @@ namespace sdr // access to basePosition const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } void setBasePosition(const basegfx::B2DPoint& rNew); - - // transform object coordinates. Transforms maBasePosition - // and invalidates on change - virtual void transform(const basegfx::B2DHomMatrix& rMatrix); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx b/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx index 3a9cf12173..2c9c26888b 100644 --- a/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx +++ b/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx @@ -42,7 +42,7 @@ namespace sdr { namespace overlay { - enum CellOverlayType { CELL_OVERLAY_INVERT, CELL_OVERLAY_HATCH, CELL_OVERLAY_TRANSPARENT, CELL_OVERLAY_LIGHT_TRANSPARENT }; + enum CellOverlayType { CELL_OVERLAY_INVERT, CELL_OVERLAY_TRANSPARENT }; // OverlayObjectCell - used for cell cursor, selection and AutoFill handle @@ -55,14 +55,12 @@ namespace sdr CellOverlayType mePaintType; RangeVector maRectangles; - virtual void drawGeometry(OutputDevice& rOutputDevice); - virtual void createBaseRange(OutputDevice& rOutputDevice); + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: OverlayObjectCell( CellOverlayType eType, const Color& rColor, const RangeVector& rRects); virtual ~OverlayObjectCell(); - - virtual void transform(const basegfx::B2DHomMatrix& rMatrix); }; } // end of namespace overlay diff --git a/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx b/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx index 30e7e62130..2b87ed1917 100644 --- a/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx +++ b/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx @@ -70,16 +70,13 @@ namespace sdr OverlayObject& getOverlayObject(sal_uInt32 nIndex) const { return *(maVector[nIndex]); } // Hittest with logical coordinates - sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; + bool isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance = 0.0) const; // Hittest with pixel coordinates and pixel tolerance - sal_Bool isHitPixel(const Point& rPos, sal_uInt32 nTol = DEFAULT_VALUE_FOR_HITTEST_PIXEL) const; + bool isHitPixel(const Point& rDiscretePosition, sal_uInt32 fDiscreteTolerance = DEFAULT_VALUE_FOR_HITTEST_PIXEL) const; // calculate BaseRange of all included OverlayObjects and return basegfx::B2DRange getBaseRange() const; - - // transform all members coordinates - void transform(const basegfx::B2DHomMatrix& rMatrix); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx b/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx index d6d48c02ce..523a9ba652 100644 --- a/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx +++ b/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx @@ -46,11 +46,8 @@ namespace sdr // geometry basegfx::B2DPolyPolygon maPolyPolygon; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: OverlayPolyPolygonStriped(const basegfx::B2DPolyPolygon& rPolyPolygon); @@ -60,33 +57,8 @@ namespace sdr basegfx::B2DPolyPolygon getPolyPolygon() const { return maPolyPolygon; } void setPolyPolygon(const basegfx::B2DPolyPolygon& rNew); - // Hittest with logical coordinates - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; - - // transform object coordinates. Needs to transform maSecondPosition - // and maThirdPosition. - virtual void transform(const basegfx::B2DHomMatrix& rMatrix); - }; - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - class OverlayPolyPolygon : public OverlayPolyPolygonStriped - { - protected: - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - public: - OverlayPolyPolygon( - const basegfx::B2DPolyPolygon& rPolyPolygon, - Color aPolygonColor = Color(COL_BLACK)); - virtual ~OverlayPolyPolygon(); + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx b/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx index 8208e1a298..68ece1cb77 100644 --- a/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx +++ b/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx @@ -41,20 +41,14 @@ namespace sdr { namespace overlay { - class OverlayPrimitive2DSequenceObject : public OverlayObjectWithBasePosition + class SVX_DLLPUBLIC OverlayPrimitive2DSequenceObject : public OverlayObjectWithBasePosition { protected: // the sequence of primitives to show const drawinglayer::primitive2d::Primitive2DSequence maSequence; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); - - // Hittest with logical coordinates. Default tests against maBaseRange. - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); private: // internal helper to create a drawinglayer::geometry::ViewInformation2D diff --git a/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx b/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx index 574fb8f3cb..9b875ffdba 100644 --- a/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx +++ b/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx @@ -52,18 +52,15 @@ namespace sdr // Flag to switch on/off the bounds itself unsigned mbShowBounds : 1; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: OverlayRollingRectangleStriped( const basegfx::B2DPoint& rBasePos, const basegfx::B2DPoint& rSecondPos, - sal_Bool bExtendedLines = sal_False, - sal_Bool bShowBounds = sal_True); + bool bExtendedLines = false, + bool bShowBounds = true); virtual ~OverlayRollingRectangleStriped(); // change second position @@ -71,42 +68,15 @@ namespace sdr void setSecondPosition(const basegfx::B2DPoint& rNew); // change extended lines - sal_Bool getExtendedLines() const { return mbExtendedLines; } - void setExtendedLines(sal_Bool bNew); + bool getExtendedLines() const { return mbExtendedLines; } + void setExtendedLines(bool bNew); // change show bounds - sal_Bool getShowBounds() const { return mbShowBounds; } - void setShowBounds(sal_Bool bNew); - - // Hittest with logical coordinates - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; - - // transform object coordinates. Needs to transform maSecondPosition. - virtual void transform(const basegfx::B2DHomMatrix& rMatrix); - }; - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - class OverlayRollingRectangle : public OverlayRollingRectangleStriped - { - protected: - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); + bool getShowBounds() const { return mbShowBounds; } + void setShowBounds(bool bNew); - public: - OverlayRollingRectangle( - const basegfx::B2DPoint& rBasePos, - const basegfx::B2DPoint& rSecondPos, - Color aLineColor = Color(COL_BLACK), - sal_Bool bExtendedLines = sal_False, - sal_Bool bShowBounds = sal_True); - virtual ~OverlayRollingRectangle(); + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/overlay/overlayselection.hxx b/svx/inc/svx/sdr/overlay/overlayselection.hxx new file mode 100644 index 0000000000..f6d3539877 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayselection.hxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * 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: overlayline.hxx,v $ + * $Revision: 1.3 $ + * + * 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 _SDR_OVERLAY_OVERLAYSELECTION_HXX +#define _SDR_OVERLAY_OVERLAYSELECTION_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/region.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + // overlay type definition + enum OverlayType + { + OVERLAY_INVERT, + OVERLAY_SOLID, + OVERLAY_TRANSPARENT + }; + + class SVX_DLLPUBLIC OverlaySelection : public OverlayObject + { + protected: + // type of overlay + OverlayType meOverlayType; + + // geometry of overlay + std::vector< basegfx::B2DRange > maRanges; + + // Values of last primitive creation. These are checked in getOverlayObjectPrimitive2DSequence + // to evtl. get rid of last Primitive2DSequence. This ensures that these values are up-to-date + // and are usable when creating primitives + OverlayType maLastOverlayType; + sal_uInt16 mnLastTransparence; + + // bitfield + unsigned mbBorder : 1; + + // geometry creation for OverlayObject, can use local *Last* values + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlaySelection( + OverlayType eType, + const Color& rColor, + const std::vector< basegfx::B2DRange >& rRanges, + bool bBorder); + virtual ~OverlaySelection(); + + // data read access + const OverlayType getOverlayType() const { return meOverlayType; } + const std::vector< basegfx::B2DRange >& getRanges() const { return maRanges; } + bool getBorder() const { return mbBorder; } + + // overloaded to check conditions for last createOverlayObjectPrimitive2DSequence + virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const; + + // data write access + void setRanges(const std::vector< basegfx::B2DRange >& rNew); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYSELECTION_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlaytools.hxx b/svx/inc/svx/sdr/overlay/overlaytools.hxx new file mode 100644 index 0000000000..761b588f1d --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlaytools.hxx @@ -0,0 +1,281 @@ +/************************************************************************* + * + * 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: overlayobject.hxx,v $ + * $Revision: 1.4 $ + * + * 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 _SDR_OVERLAY_OVERLAYTOOLS_HXX +#define _SDR_OVERLAY_OVERLAYTOOLS_HXX + +#include <drawinglayer/primitive2d/primitivetools2d.hxx> +#include <vcl/bitmapex.hxx> + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class which holds a BotmapEx which is to be visualized +// at the given logic position with the Bitmap's pixel size, unscaled and +// unrotated (like a marker). The discrete pixel on the bitmap assocciated +// with the target position is given in discrete X,Y coordinates +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayBitmapExPrimitive : public DiscreteMetricDependentPrimitive2D + { + private: + // The BitmapEx to use, PixelSize is used + BitmapEx maBitmapEx; + + // The logic position + basegfx::B2DPoint maBasePosition; + + // The pixel inside the BitmapEx which is assocciated with + // the target position (offset in the bitmap) + sal_uInt16 mnCenterX; + sal_uInt16 mnCenterY; + + protected: + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayBitmapExPrimitive( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rBasePosition, + sal_uInt16 nCenterX, + sal_uInt16 nCenterY); + + // data access + const BitmapEx& getBitmapEx() const { return maBitmapEx; } + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + sal_uInt16 getCenterX() const { return mnCenterX; } + sal_uInt16 getCenterY() const { return mnCenterY; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for a crosshair +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayCrosshairPrimitive : public ViewportDependentPrimitive2D + { + private: + // The logic position + basegfx::B2DPoint maBasePosition; + + // The stripe colors and legth + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + protected: + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayCrosshairPrimitive( + const basegfx::B2DPoint& rBasePosition, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength); + + // data access + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } + const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } + double getDiscreteDashLength() const { return mfDiscreteDashLength; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for a hatch rectangle as used e.g. for text object +// selection hilighting +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayHatchRectanglePrimitive : public DiscreteMetricDependentPrimitive2D + { + private: + // the logic rectangle definition + basegfx::B2DRange maObjectRange; + + // the hatch definition + double mfDiscreteHatchDistance; + double mfHatchRotation; + basegfx::BColor maHatchColor; + + // the dscrete grow and shrink of the box + double mfDiscreteGrow; + double mfDiscreteShrink; + + // the rotation of the primitive itself + double mfRotation; + + protected: + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayHatchRectanglePrimitive( + const basegfx::B2DRange& rObjectRange, + double fDiscreteHatchDistance, + double fHatchRotation, + const basegfx::BColor& rHatchColor, + double fDiscreteGrow, + double fDiscreteShrink, + double fRotation); + + // data access + const basegfx::B2DRange& getObjectRange() const { return maObjectRange; } + double getDiscreteHatchDistance() const { return mfDiscreteHatchDistance; } + double getHatchRotation() const { return mfHatchRotation; } + const basegfx::BColor& getHatchColor() const { return maHatchColor; } + double getDiscreteGrow() const { return mfDiscreteGrow; } + double getDiscreteShrink() const { return mfDiscreteShrink; } + double getRotation() const { return mfRotation; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for a striped helpline + +namespace drawinglayer +{ + namespace primitive2d + { + enum HelplineStyle + { + HELPLINESTYLE_POINT, + HELPLINESTYLE_VERTICAL, + HELPLINESTYLE_HORIZONTAL + }; + + class OverlayHelplineStripedPrimitive : public ViewportDependentPrimitive2D + { + private: + // The logic position + basegfx::B2DPoint maBasePosition; + + // the style + HelplineStyle meStyle; + + // The stripe colors and legth + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + protected: + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayHelplineStripedPrimitive( + const basegfx::B2DPoint& rBasePosition, + HelplineStyle eStyle, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength); + + // data access + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + HelplineStyle getStyle() const { return meStyle; } + const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } + const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } + double getDiscreteDashLength() const { return mfDiscreteDashLength; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for rolling rectangle helplines. This primitive is +// only for the extended lines to the ends of the view + +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayRollingRectanglePrimitive : public ViewportDependentPrimitive2D + { + private: + // The logic range + basegfx::B2DRange maRollingRectangle; + + // The stripe colors and legth + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + protected: + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayRollingRectanglePrimitive( + const basegfx::B2DRange& aRollingRectangle, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength); + + // data access + const basegfx::B2DRange& getRollingRectangle() const { return maRollingRectangle; } + const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } + const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } + double getDiscreteDashLength() const { return mfDiscreteDashLength; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYTOOLS_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlaytriangle.hxx b/svx/inc/svx/sdr/overlay/overlaytriangle.hxx index 268460e71b..b9a175fa90 100644 --- a/svx/inc/svx/sdr/overlay/overlaytriangle.hxx +++ b/svx/inc/svx/sdr/overlay/overlaytriangle.hxx @@ -39,25 +39,23 @@ namespace sdr { namespace overlay { - class OverlayTriangleStriped : public OverlayObjectWithBasePosition + class OverlayTriangle : public OverlayObjectWithBasePosition { protected: // second and third position in pixel basegfx::B2DPoint maSecondPosition; basegfx::B2DPoint maThirdPosition; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: - OverlayTriangleStriped( + OverlayTriangle( const basegfx::B2DPoint& rBasePos, const basegfx::B2DPoint& rSecondPos, - const basegfx::B2DPoint& rThirdPos); - virtual ~OverlayTriangleStriped(); + const basegfx::B2DPoint& rThirdPos, + Color aTriangleColor); + virtual ~OverlayTriangle(); // change second position const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } @@ -66,36 +64,6 @@ namespace sdr // change third position const basegfx::B2DPoint& getThirdPosition() const { return maThirdPosition; } void setThirdPosition(const basegfx::B2DPoint& rNew); - - // Hittest with logical coordinates - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; - - // transform object coordinates. Needs to transform maSecondPosition - // and maThirdPosition. - virtual void transform(const basegfx::B2DHomMatrix& rMatrix); - }; - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - class OverlayTriangle : public OverlayTriangleStriped - { - protected: - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - public: - OverlayTriangle( - const basegfx::B2DPoint& rBasePos, - const basegfx::B2DPoint& rSecondPos, - const basegfx::B2DPoint& rThirdPos, - Color aTriangleColor = Color(COL_BLACK)); - virtual ~OverlayTriangle(); }; } // end of namespace overlay } // end of namespace sdr diff --git a/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx b/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx index 6ddfa92fed..ad4867b4da 100644 --- a/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx @@ -36,6 +36,8 @@ #include <cppuhelper/compbase1.hxx> #include <comphelper/broadcasthelper.hxx> +#include <svx/svxdllapi.h> + ////////////////////////////////////////////////////////////////////////////// // UNO API helper methods @@ -43,7 +45,7 @@ namespace drawinglayer { namespace primitive2d { - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); + SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); } // end of namespace primitive2d } // end of namespace drawinglayer @@ -73,8 +75,8 @@ namespace drawinglayer virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXDrawPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException); // UNO API helpers - static rtl::OUString getImplementationName_Static(); - static com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static(); + SVX_DLLPUBLIC static rtl::OUString getImplementationName_Static(); + SVX_DLLPUBLIC static com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static(); }; } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx index 057e7ba6a0..097eecb952 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx @@ -71,7 +71,16 @@ namespace drawinglayer attribute::SdrLineStartEndAttribute* createNewSdrLineStartEndAttribute(const SfxItemSet& rSet, double fWidth); attribute::SdrShadowAttribute* createNewSdrShadowAttribute(const SfxItemSet& rSet); attribute::SdrFillAttribute* createNewSdrFillAttribute(const SfxItemSet& rSet); - attribute::SdrTextAttribute* createNewSdrTextAttribute(const SfxItemSet& rSet, const SdrText& rText); + + // #i101508# Support handing over given text-to-border distances + attribute::SdrTextAttribute* createNewSdrTextAttribute( + const SfxItemSet& rSet, + const SdrText& rText, + const sal_Int32* pLeft = 0, + const sal_Int32* pUpper = 0, + const sal_Int32* pRight = 0, + const sal_Int32* pLower = 0); + attribute::FillGradientAttribute* createNewTransparenceGradientAttribute(const SfxItemSet& rSet); attribute::SdrFillBitmapAttribute* createNewSdrFillBitmapAttribute(const SfxItemSet& rSet); attribute::SdrShadowTextAttribute* createNewSdrShadowTextAttribute( @@ -83,7 +92,15 @@ namespace drawinglayer attribute::SdrLineFillShadowAttribute* createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill); attribute::SdrSceneAttribute* createNewSdrSceneAttribute(const SfxItemSet& rSet); attribute::SdrLightingAttribute* createNewSdrLightingAttribute(const SfxItemSet& rSet); - attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(const SfxItemSet& rSet, const SdrText* pSdrText); + + // #i101508# Support handing over given text-to-border distances + attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute( + const SfxItemSet& rSet, + const SdrText* pSdrText, + const sal_Int32* pLeft = 0, + const sal_Int32* pUpper = 0, + const sal_Int32* pRight = 0, + const sal_Int32* pLower = 0); // helpers void calculateRelativeCornerRadius(sal_Int32 nRadius, const ::basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY); diff --git a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx index b48009dc75..c47ba9b1cd 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx @@ -76,7 +76,7 @@ namespace drawinglayer const ::basegfx::B2DPolygon& getTail() const { return maTail; } double getCornerRadiusX() const { return mfCornerRadiusX; } double getCornerRadiusY() const { return mfCornerRadiusY; } - bool hasCornerRadius() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); } + bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); } // provide unique ID DeclPrimitrive2DIDBlock() diff --git a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx index 118c368ab6..d37adb214c 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx @@ -77,8 +77,8 @@ namespace drawinglayer bool bCellText, bool bWordWrap); - Primitive2DReference createShadowPrimitive( - const Primitive2DSequence& rSource, + Primitive2DSequence createEmbeddedShadowPrimitive( + const Primitive2DSequence& rContent, const attribute::SdrShadowAttribute& rShadow); } // end of namespace primitive2d diff --git a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx index 8b02fb511b..3e31be61ca 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx @@ -63,8 +63,8 @@ namespace drawinglayer { private: attribute::SdrLineShadowTextAttribute maSdrLSTAttribute; - ::basegfx::B2DPoint maStart; - ::basegfx::B2DPoint maEnd; + basegfx::B2DPoint maStart; + basegfx::B2DPoint maEnd; MeasureTextPosition meHorizontal; MeasureTextPosition meVertical; double mfDistance; @@ -80,9 +80,9 @@ namespace drawinglayer // internal decomposition helper Primitive2DReference impCreatePart( - const ::basegfx::B2DHomMatrix& rObjectMatrix, - const ::basegfx::B2DPoint& rStart, - const ::basegfx::B2DPoint& rEnd, + const basegfx::B2DHomMatrix& rObjectMatrix, + const basegfx::B2DPoint& rStart, + const basegfx::B2DPoint& rEnd, bool bLeftActive, bool bRightActive) const; @@ -93,7 +93,8 @@ namespace drawinglayer public: SdrMeasurePrimitive2D( const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute, - const ::basegfx::B2DPoint& rStart, const ::basegfx::B2DPoint& rEnd, + const basegfx::B2DPoint& rStart, + const basegfx::B2DPoint& rEnd, MeasureTextPosition eHorizontal, MeasureTextPosition eVertical, double fDistance, @@ -107,8 +108,8 @@ namespace drawinglayer // data access const attribute::SdrLineShadowTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; } - const ::basegfx::B2DPoint& getStart() const { return maStart; } - const ::basegfx::B2DPoint& getEnd() const { return maEnd; } + const basegfx::B2DPoint& getStart() const { return maStart; } + const basegfx::B2DPoint& getEnd() const { return maEnd; } MeasureTextPosition getHorizontal() const { return meHorizontal; } MeasureTextPosition getVertical() const { return meVertical; } double getDistance() const { return mfDistance; } diff --git a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx new file mode 100644 index 0000000000..f54028d134 --- /dev/null +++ b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx @@ -0,0 +1,89 @@ +/************************************************************************* + * + * 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: sdrcaptionprimitive2d.hxx,v $ + * + * $Revision: 1.2 $ + * + * 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 INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/svdobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefinitions + +class SdrOle2Obj; + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrOleContentPrimitive2D : public BasePrimitive2D + { + private: + SdrObjectWeakRef mpSdrOle2Obj; + basegfx::B2DHomMatrix maObjectTransform; + + // bitfield + unsigned mbHighContrast : 1; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrOleContentPrimitive2D( + const SdrOle2Obj& rSdrOle2Obj, + const basegfx::B2DHomMatrix& rObjectTransform, + bool bHighContrast); + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // The default implementation will use getDecomposition results to create the range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // data access + const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; } + bool getHighContrast() const { return mbHighContrast; } + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX + +// eof diff --git a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx index defaa73eff..199f3c4fdc 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx @@ -49,9 +49,9 @@ namespace drawinglayer class SdrPathPrimitive2D : public BasePrimitive2D { private: - ::basegfx::B2DHomMatrix maTransform; + basegfx::B2DHomMatrix maTransform; attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute; - ::basegfx::B2DPolyPolygon maUnitPolyPolygon; + basegfx::B2DPolyPolygon maUnitPolyPolygon; protected: // local decomposition. @@ -59,14 +59,14 @@ namespace drawinglayer public: SdrPathPrimitive2D( - const ::basegfx::B2DHomMatrix& rTransform, + const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, - const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon); + const basegfx::B2DPolyPolygon& rUnitPolyPolygon); // data access - const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } - const ::basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; } + const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; diff --git a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx index e75fe94446..c604b4e1e9 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx @@ -49,28 +49,35 @@ namespace drawinglayer class SdrRectanglePrimitive2D : public BasePrimitive2D { private: - ::basegfx::B2DHomMatrix maTransform; + basegfx::B2DHomMatrix maTransform; attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute; double mfCornerRadiusX; // [0.0..1.0] relative to 1/2 width double mfCornerRadiusY; // [0.0..1.0] relative to 1/2 height + // bitfield + // flag which decides if this is a text frame. If Yes, the HitArea + // should be the filled geometry + bool mbTextFrame : 1; + protected: // local decomposition. virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrRectanglePrimitive2D( - const ::basegfx::B2DHomMatrix& rTransform, + const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, - double fCornerRadiusX = 0.0, - double fCornerRadiusY = 0.0); + double fCornerRadiusX, + double fCornerRadiusY, + bool bTextFrame); // data access - const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } double getCornerRadiusX() const { return mfCornerRadiusX; } double getCornerRadiusY() const { return mfCornerRadiusY; } - bool hasCornerRadius() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); } + bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); } + bool getTextFrame() const { return mbTextFrame; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; diff --git a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx index e7903997de..2e58067a57 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -36,8 +36,10 @@ #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <com/sun/star/drawing/XDrawPage.hpp> -#include <boost/shared_ptr.hpp> #include <svx/outlobj.hxx> +#include <tools/color.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx> +#include <tools/weakbase.hxx> ////////////////////////////////////////////////////////////////////////////// // predefines @@ -54,11 +56,11 @@ namespace drawinglayer private: // The text model data; this sould later just be the OutlinerParaObject or // something equal - const SdrText& mrSdrText; // text model data + ::tools::WeakReference< SdrText > mrSdrText; // #i97628# - // The text content; now as OutlinerParaObject* and in exclusive, local, cloned - // form as needed in a primitive + // The text content; now as local OutlinerParaObject copy (internally RefCounted and + // COW) and in exclusive, local form as needed in a primitive const OutlinerParaObject maOutlinerParaObject; // remeber last VisualizingPage for which a decomposition was made. If the new target @@ -67,6 +69,18 @@ namespace drawinglayer // field renderings in SubGeometry and MasterPage mnode com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxLastVisualizingPage; + // remember last PageNumber for which a decomposition was made. This is only used + // when mbContainsPageField is true, else it is 0 + sal_Int16 mnLastPageNumber; + + // remember last PageCount for which a decomposition was made. This is only used + // when mbContainsPageCountField is true, else it is 0 + sal_Int16 mnLastPageCount; + + // #i101443# remember last TextBackgroundColor to decide if a new decomposition is + // needed because of background color change + Color maLastTextBackgroundColor; + // bitfield // remember if last decomposition was with or without spell checker. In this special // case the get2DDecomposition implementation has to take care of this aspect. This is @@ -75,6 +89,8 @@ namespace drawinglayer // is there a PageNumber, Header, Footer or DateTimeField used? Evaluated at construction unsigned mbContainsPageField : 1; + unsigned mbContainsPageCountField : 1; + unsigned mbContainsOtherFields : 1; protected: // support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments @@ -85,11 +101,11 @@ namespace drawinglayer public: SdrTextPrimitive2D( - const SdrText& rSdrText, + const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObjectPtr); // get data - const SdrText& getSdrText() const { return mrSdrText; } + const SdrText* getSdrText() const { return mrSdrText.get(); } const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; } // compare operator @@ -100,7 +116,7 @@ namespace drawinglayer virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; // transformed clone operator - virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const = 0; + virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const = 0; }; } // end of namespace primitive2d } // end of namespace drawinglayer @@ -114,8 +130,11 @@ namespace drawinglayer class SdrContourTextPrimitive2D : public SdrTextPrimitive2D { private: - ::basegfx::B2DPolyPolygon maUnitPolyPolygon; // unit contour polygon (scaled to [0.0 .. 1.0]) - ::basegfx::B2DHomMatrix maObjectTransform; // complete contour polygon transform (scale, rotate, shear, translate) + // unit contour polygon (scaled to [0.0 .. 1.0]) + basegfx::B2DPolyPolygon maUnitPolyPolygon; + + // complete contour polygon transform (scale, rotate, shear, translate) + basegfx::B2DHomMatrix maObjectTransform; protected: // local decomposition. @@ -123,20 +142,20 @@ namespace drawinglayer public: SdrContourTextPrimitive2D( - const SdrText& rSdrText, + const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObjectPtr, - const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon, - const ::basegfx::B2DHomMatrix& rObjectTransform); + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DHomMatrix& rObjectTransform); // get data - const ::basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; } - const ::basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; } + const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; } + const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; // transformed clone operator - virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const; + virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const; // provide unique ID DeclPrimitrive2DIDBlock() @@ -153,7 +172,11 @@ namespace drawinglayer class SdrPathTextPrimitive2D : public SdrTextPrimitive2D { private: - ::basegfx::B2DPolyPolygon maPathPolyPolygon; // the path to use. Each paragraph will use one Polygon. + // the path to use. Each paragraph will use one Polygon. + basegfx::B2DPolyPolygon maPathPolyPolygon; + + // the Fontwork parameters + attribute::SdrFormTextAttribute maSdrFormTextAttribute; protected: // local decomposition. @@ -161,18 +184,20 @@ namespace drawinglayer public: SdrPathTextPrimitive2D( - const SdrText& rSdrText, + const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObjectPtr, - const ::basegfx::B2DPolyPolygon& rPathPolyPolygon); + const basegfx::B2DPolyPolygon& rPathPolyPolygon, + const attribute::SdrFormTextAttribute& rSdrFormTextAttribute); // get data - const ::basegfx::B2DPolyPolygon& getPathPolyPolygon() const { return maPathPolyPolygon; } + const basegfx::B2DPolyPolygon& getPathPolyPolygon() const { return maPathPolyPolygon; } + const attribute::SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; // transformed clone operator - virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const; + virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const; // provide unique ID DeclPrimitrive2DIDBlock() @@ -189,7 +214,8 @@ namespace drawinglayer class SdrBlockTextPrimitive2D : public SdrTextPrimitive2D { private: - ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range + // text range transformation from unit range ([0.0 .. 1.0]) to text range + basegfx::B2DHomMatrix maTextRangeTransform; // bitfield unsigned mbUnlimitedPage : 1; // force layout with no text break @@ -202,9 +228,9 @@ namespace drawinglayer public: SdrBlockTextPrimitive2D( - const SdrText& rSdrText, + const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObjectPtr, - const ::basegfx::B2DHomMatrix& rTextRangeTransform, + const basegfx::B2DHomMatrix& rTextRangeTransform, bool bUnlimitedPage, bool bCellText, bool bWordWrap); @@ -219,7 +245,7 @@ namespace drawinglayer virtual bool operator==(const BasePrimitive2D& rPrimitive) const; // transformed clone operator - virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const; + virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const; // provide unique ID DeclPrimitrive2DIDBlock() @@ -236,7 +262,8 @@ namespace drawinglayer class SdrStretchTextPrimitive2D : public SdrTextPrimitive2D { private: - ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range + // text range transformation from unit range ([0.0 .. 1.0]) to text range + basegfx::B2DHomMatrix maTextRangeTransform; protected: // local decomposition. @@ -244,18 +271,18 @@ namespace drawinglayer public: SdrStretchTextPrimitive2D( - const SdrText& rSdrText, + const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObjectPtr, - const ::basegfx::B2DHomMatrix& rTextRangeTransform); + const basegfx::B2DHomMatrix& rTextRangeTransform); // get data - const ::basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; } + const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; // transformed clone operator - virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const; + virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const; // provide unique ID DeclPrimitrive2DIDBlock() diff --git a/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx b/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx index b0f0e62b76..70dc15c62e 100644 --- a/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx @@ -52,6 +52,13 @@ #define PRIMITIVE2D_ID_SDRSTRETCHTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 13) #define PRIMITIVE2D_ID_SDRCELLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 14) #define PRIMITIVE2D_ID_SDRBORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 15) +#define PRIMITIVE2D_ID_OVERLAYBITMAPEXPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 16) +#define PRIMITIVE2D_ID_OVERLAYCROSSHAIRPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 17) +#define PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 18) +#define PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 19) +#define PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 20) +#define PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 21) +#define PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 22) ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/inc/svx/sdr/properties/properties.hxx b/svx/inc/svx/sdr/properties/properties.hxx index 855b8a2504..2b8928e376 100644 --- a/svx/inc/svx/sdr/properties/properties.hxx +++ b/svx/inc/svx/sdr/properties/properties.hxx @@ -184,6 +184,11 @@ namespace sdr // ClearItemAndBroadcast() and SetItemSetAndBroadcast(), see above. // But also from inside SdrObjects. void BroadcastItemChange(const ItemChangeBroadcaster& rChange); + + // #i101556# add versioning mechanism; used from e.g. text attribute set to + // allow detection of e.g. style sheet or single text attribute changes. The + // default implementation returns 0 (zero) + virtual sal_uInt32 getVersion() const; }; } // end of namespace properties } // end of namespace sdr diff --git a/svx/inc/svx/sdr/properties/textproperties.hxx b/svx/inc/svx/sdr/properties/textproperties.hxx index 5dcc8f5d3f..08f2603a76 100644 --- a/svx/inc/svx/sdr/properties/textproperties.hxx +++ b/svx/inc/svx/sdr/properties/textproperties.hxx @@ -42,6 +42,10 @@ namespace sdr { class SVX_DLLPUBLIC TextProperties : public AttributeProperties { + private: + // #i101556# versioning support + sal_uInt32 maVersion; + protected: // create a new itemset virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); @@ -82,6 +86,9 @@ namespace sdr // Set single item at the local ItemSet. *Does not use* AllowItemChange(), // ItemChange(), PostItemChange() and ItemSetChanged() calls. void SetObjectItemNoBroadcast(const SfxPoolItem& rItem); + + // #i101556# versioning support + virtual sal_uInt32 getVersion() const; }; } // end of namespace properties } // end of namespace sdr diff --git a/svx/inc/svx/sdrhittesthelper.hxx b/svx/inc/svx/sdrhittesthelper.hxx new file mode 100644 index 0000000000..dae0c26487 --- /dev/null +++ b/svx/inc/svx/sdrhittesthelper.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * 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: svdetc.hxx,v $ + * $Revision: 1.4.152.1 $ + * + * 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 _SDRHITTESTHELPER_HXX +#define _SDRHITTESTHELPER_HXX + +#include "svx/svxdllapi.h" +#include <tools/string.hxx> +#include <tools/gen.hxx> + +///////////////////////////////////////////////////////////////////// +// #i101872# new Object HitTest as View-tooling + +class SdrObject; +class SdrPageView; +class SetOfByte; +class SdrObjList; +namespace sdr { namespace contact { class ViewObjectContact; }} +namespace basegfx { class B2DPoint; } + +///////////////////////////////////////////////////////////////////// +// Wrappers for classic Sdr* Mode/View classes + +SVX_DLLPUBLIC SdrObject* SdrObjectPrimitiveHit( + const SdrObject& rObject, + const Point& rPnt, + sal_uInt16 nTol, + const SdrPageView& rSdrPageView, + const SetOfByte* pVisiLayer, + bool bTextOnly); + +SVX_DLLPUBLIC SdrObject* SdrObjListPrimitiveHit( + const SdrObjList& rList, + const Point& rPnt, + sal_uInt16 nTol, + const SdrPageView& rSdrPageView, + const SetOfByte* pVisiLayer, + bool bTextOnly); + +///////////////////////////////////////////////////////////////////// +// the pure HitTest based on a VOC + +SVX_DLLPUBLIC bool ViewObjectContactPrimitiveHit( + const sdr::contact::ViewObjectContact& rVOC, + const basegfx::B2DPoint& rHitPosition, + double fLogicHitTolerance, + bool bTextOnly); + +///////////////////////////////////////////////////////////////////// + +#endif //_SDRHITTESTHELPER_HXX + +///////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/inc/svx/sdtfchim.hxx b/svx/inc/svx/sdtfchim.hxx index 95d709a30e..2a630fac6b 100644 --- a/svx/inc/svx/sdtfchim.hxx +++ b/svx/inc/svx/sdtfchim.hxx @@ -32,28 +32,28 @@ #include <svx/svddef.hxx> -class SdrTextFixedCellHeightItem : public SfxBoolItem +class SVX_DLLPUBLIC SdrTextFixedCellHeightItem : public SfxBoolItem { public: TYPEINFO(); SdrTextFixedCellHeightItem( BOOL bUseFixedCellHeight = FALSE ); - SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion ); + SVX_DLLPRIVATE SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion ); - virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, String &rText, const IntlWrapper * = 0) const; - virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItem ) const; - virtual SvStream& Store( SvStream&, sal_uInt16 nVersion ) const; - virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const; - virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItem ) const; + SVX_DLLPRIVATE virtual SvStream& Store( SvStream&, sal_uInt16 nVersion ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const; + SVX_DLLPRIVATE virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); #ifdef SDR_ISPOOLABLE - virtual int IsPoolable() const; + SVX_DLLPRIVATE virtual int IsPoolable() const; #endif }; diff --git a/svx/inc/svx/svdedxv.hxx b/svx/inc/svx/svdedxv.hxx index 999a8b0963..c6599092e2 100644 --- a/svx/inc/svx/svdedxv.hxx +++ b/svx/inc/svx/svdedxv.hxx @@ -130,9 +130,6 @@ protected: void ImpPaintOutlinerView(OutlinerView& rOutlView, const Rectangle& rRect) const; void ImpInvalidateOutlinerView(OutlinerView& rOutlView) const; - // Hintergrundfarbe fuer die Outlinerviews bestimmen - Color ImpGetTextEditBackgroundColor() const; - // Feststellen, ob der gesamte Text markiert ist. Liefert auch TRUE wenn // kein Text vorhanden ist. BOOL ImpIsTextEditAllSelected() const; diff --git a/svx/inc/svx/svdetc.hxx b/svx/inc/svx/svdetc.hxx index 76d45f693a..5fe0d1245b 100644 --- a/svx/inc/svx/svdetc.hxx +++ b/svx/inc/svx/svdetc.hxx @@ -81,7 +81,7 @@ friend class SdrAttrObj; Fraction aMapFraction; private: - SVX_DLLPRIVATE static SdrEngineDefaults& GetDefaults(); + static SdrEngineDefaults& GetDefaults(); public: SdrEngineDefaults(); @@ -272,7 +272,7 @@ protected: public: SdrLinkList(): aList(1024,4,4) {} ~SdrLinkList() { Clear(); } - void Clear(); + SVX_DLLPUBLIC void Clear(); unsigned GetLinkCount() const { return (unsigned)aList.Count(); } Link& GetLink(unsigned nNum) { return *((Link*)(aList.GetObject(nNum))); } const Link& GetLink(unsigned nNum) const { return *((Link*)(aList.GetObject(nNum))); } @@ -299,7 +299,7 @@ class OLEObjCache : public Container public: OLEObjCache(); - ~OLEObjCache(); + SVX_DLLPUBLIC ~OLEObjCache(); void SetSize(ULONG nNewSize); void InsertObj(SdrOle2Obj* pObj); @@ -344,8 +344,12 @@ SVX_DLLPUBLIC String GetResourceString(sal_uInt16 nResID); } +///////////////////////////////////////////////////////////////////// +// #i101872# isolated GetTextEditBackgroundColor for tooling +class SdrObjEditView; + +SVX_DLLPUBLIC Color GetTextEditBackgroundColor(const SdrObjEditView& rView); ///////////////////////////////////////////////////////////////////// #endif //_SVDETC_HXX - diff --git a/svx/inc/svx/svdhdl.hxx b/svx/inc/svx/svdhdl.hxx index f5a1cc4f90..77f7afae22 100644 --- a/svx/inc/svx/svdhdl.hxx +++ b/svx/inc/svx/svdhdl.hxx @@ -245,7 +245,7 @@ public: sal_uInt32 GetSourceHdlNum() const { return nSourceHdlNum; } virtual Pointer GetPointer() const; - virtual bool IsHdlHit(const Point& rPnt) const; + bool IsHdlHit(const Point& rPnt) const; // #97016# II virtual BOOL IsFocusHdl() const; @@ -363,7 +363,6 @@ public: virtual ~SdrHdlLine(); virtual Pointer GetPointer() const; - virtual bool IsHdlHit(const Point& rPnt) const; }; // Ein SdrHdlBezWgt hat Kenntnis von seinem "BasisHandle". Seine Draw-Methode diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx index c8d132536e..56c0e8550e 100644 --- a/svx/inc/svx/svdmodel.hxx +++ b/svx/inc/svx/svdmodel.hxx @@ -689,7 +689,7 @@ public: void SetModelStorage( SotStorage* pStor ) { pModelStorage = pStor; } ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoModel(); - void setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel ) { mxUnoModel = xModel; } + void setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel ); // these functions are used by the api to disable repaints during a // set of api calls. diff --git a/svx/inc/svx/svdmrkv.hxx b/svx/inc/svx/svdmrkv.hxx index 962fce5030..4639a291a2 100644 --- a/svx/inc/svx/svdmrkv.hxx +++ b/svx/inc/svx/svdmrkv.hxx @@ -180,9 +180,8 @@ protected: void ForceUndirtyMrkPnt() const { if (bMrkPntDirty) UndirtyMrkPnt(); } //HMHvoid ImpShowMarkHdl(bool bNoRefHdl); - SdrObject* ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const; - SdrObject* ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObjList* pOL, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const; - BOOL ImpIsObjHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions) const { return ImpCheckObjHit(rPnt,nTol,pObj,pPV,nOptions,NULL)!=NULL; } + virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const; + virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObjList* pOL, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const; BOOL ImpIsFrameHandles() const; void ImpTakeDescriptionStr(USHORT nStrCacheID, String& rStr, USHORT nVal=0, USHORT nOpt=0) const; @@ -309,9 +308,9 @@ public: // SDRSEARCH_DEEP SDRSEARCH_ALSOONMASTER SDRSEARCH_TESTMARKABLE SDRSEARCH_TESTTEXTEDIT // SDRSEARCH_WITHTEXT SDRSEARCH_TESTTEXTAREA SDRSEARCH_BACKWARD SDRSEARCH_MARKED // SDRSEARCH_WHOLEPAGE - BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions, SdrObject** ppRootObj, ULONG* pnMarkNum=NULL, USHORT* pnPassNum=NULL) const; - BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const; - BOOL PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); } + virtual BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions, SdrObject** ppRootObj, ULONG* pnMarkNum=NULL, USHORT* pnPassNum=NULL) const; + virtual BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const; + // BOOL PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); } BOOL MarkObj(const Point& rPnt, short nTol=-2, BOOL bToggle=FALSE, BOOL bDeep=FALSE); // Pick: Unterstuetzte Optionen fuer nOptions sind SDRSEARCH_PASS2BOUND und SDRSEARCH_PASS3NEAREST diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx index 45cc1fefc8..1238cea024 100644 --- a/svx/inc/svx/svdoashp.hxx +++ b/svx/inc/svx/svdoashp.hxx @@ -105,7 +105,7 @@ private: // #i37011# render geometry shadow SdrObject* mpLastShadowGeometry; - static SVX_DLLPRIVATE com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > GetCustomShapeEngine( const SdrObjCustomShape* pCustomShape ); + static com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > GetCustomShapeEngine( const SdrObjCustomShape* pCustomShape ); // SVX_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > > // SdrObjCustomShape::GetInteraction( const SdrObjCustomShape* pCustomShape ) const; @@ -134,7 +134,7 @@ public: const SdrObject* GetSdrObjectShadowFromCustomShape() const; sal_Bool GetTextBounds( Rectangle& rTextBound ) const; sal_Bool IsTextPath() const; - static SVX_DLLPRIVATE basegfx::B2DPolyPolygon GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed ); + static basegfx::B2DPolyPolygon GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed ); protected: @@ -224,8 +224,6 @@ public: virtual void TakeTextAnchorRect( Rectangle& rAnchorRect ) const; virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText=FALSE, Rectangle* pAnchorRect=NULL, BOOL bLineWidth=TRUE ) const; - - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void operator=(const SdrObject& rObj); virtual void TakeObjNameSingul(String& rName) const; diff --git a/svx/inc/svx/svdoattr.hxx b/svx/inc/svx/svdoattr.hxx index 984d11b8a0..ca84262c7b 100644 --- a/svx/inc/svx/svdoattr.hxx +++ b/svx/inc/svx/svdoattr.hxx @@ -66,9 +66,6 @@ protected: // Strichstaerke ermitteln. Keine Linie -> 0. sal_Int32 ImpGetLineWdt() const; - // Schattenabstand ermitteln. FALSE=Kein Schatten. - FASTBOOL ImpGetShadowDist(sal_Int32& nXDist, sal_Int32& nYDist) const; - // Zuhoeren, ob sich ein StyleSheet aendert virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx index 6d64205a03..93bf3a1479 100644 --- a/svx/inc/svx/svdobj.hxx +++ b/svx/inc/svx/svdobj.hxx @@ -683,20 +683,10 @@ public: // Tooling for painting a single object to a OutputDevice. This will be needed as long // as not all painting is changed to use DrawContact objects. sal_Bool SingleObjectPainter(OutputDevice& rOut) const; - BOOL LineGeometryUsageIsNecessary() const; - // HitTest, 2. Stufe. nTol ist die zulaessige Toleranz in logischen Einheiten. - // rVisiLayer ist hauptsaechlich fuer Gruppenobjekte gedacht, die ja Objekte - // mit unterschiedlichen Layerzuordnungen beinhalten koennen. - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; - //SdrObject* CheckHit(const Point& rPnt, USHORT nTol) const { return CheckHit(rPnt,nTol,NULL); } - sal_Bool IsHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const { return CheckHit(rPnt,nTol,pVisiLayer)!=NULL; } - sal_Bool IsHit(const Point& rPnt, USHORT nTol) const { return CheckHit(rPnt,nTol,NULL)!=NULL; } - // Clone() soll eine komplette Kopie des Objektes erzeugen. virtual SdrObject* Clone() const; - // #116235# virtual SdrObject* Clone(SdrPage* pPage, SdrModel* pModel) const; virtual void operator=(const SdrObject& rObj); // TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert". @@ -878,10 +868,6 @@ public: // TextEdit virtual FASTBOOL HasTextEdit() const; - virtual SdrObject* CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; - //SdrObject* CheckTextEditHit(const Point& rPnt, USHORT nTol) const { return CheckTextEditHit(rPnt,nTol,NULL); } - sal_Bool IsTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const { return CheckTextEditHit(rPnt,nTol,pVisiLayer)!=NULL; } - sal_Bool IsTextEditHit(const Point& rPnt, USHORT nTol) const { return CheckTextEditHit(rPnt,nTol,NULL)!=NULL; } // Return==TRUE: TextEditMode gestartet virtual sal_Bool BegTextEdit(SdrOutliner& rOutl); diff --git a/svx/inc/svx/svdocapt.hxx b/svx/inc/svx/svdocapt.hxx index f151d46762..e2cecd0579 100644 --- a/svx/inc/svx/svdocapt.hxx +++ b/svx/inc/svx/svdocapt.hxx @@ -99,7 +99,6 @@ public: virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; virtual UINT16 GetObjIdentifier() const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void operator=(const SdrObject& rObj); // for calc: special shadow only for text box diff --git a/svx/inc/svx/svdocirc.hxx b/svx/inc/svx/svdocirc.hxx index 99faedcc3a..7fff0c36db 100644 --- a/svx/inc/svx/svdocirc.hxx +++ b/svx/inc/svx/svdocirc.hxx @@ -111,7 +111,6 @@ public: virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; virtual UINT16 GetObjIdentifier() const; virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void TakeObjNameSingul(String& rName) const; virtual void TakeObjNamePlural(String& rName) const; diff --git a/svx/inc/svx/svdoedge.hxx b/svx/inc/svx/svdoedge.hxx index aff5d7ecd0..0f5366d5b1 100644 --- a/svx/inc/svx/svdoedge.hxx +++ b/svx/inc/svx/svdoedge.hxx @@ -73,7 +73,7 @@ protected: public: SdrObjConnection() { ResetVars(); } - ~SdrObjConnection(); + SVX_DLLPUBLIC ~SdrObjConnection(); void ResetVars(); FASTBOOL TakeGluePoint(SdrGluePoint& rGP, FASTBOOL bSetAbsolutePos) const; @@ -252,7 +252,6 @@ public: virtual void RecalcSnapRect(); virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void operator=(const SdrObject& rObj); virtual void TakeObjNameSingul(String& rName) const; virtual void TakeObjNamePlural(String& rName) const; diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx index 8c7b47c0cb..8a81917dfe 100644 --- a/svx/inc/svx/svdograf.hxx +++ b/svx/inc/svx/svdograf.hxx @@ -180,7 +180,6 @@ public: virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; virtual UINT16 GetObjIdentifier() const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void TakeObjNameSingul(String& rName) const; virtual void TakeObjNamePlural(String& rName) const; @@ -227,6 +226,9 @@ public: sal_Bool IsObjectTransparent() const; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > getInputStream(); + + // #i103116# FullDrag support + virtual SdrObject* getFullDragClone() const; }; #endif //_SVDOGRAF_HXX diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx index 06cc6a1674..5e796b75c9 100644 --- a/svx/inc/svx/svdogrp.hxx +++ b/svx/inc/svx/svdogrp.hxx @@ -84,7 +84,6 @@ public: virtual const Rectangle& GetCurrentBoundRect() const; virtual const Rectangle& GetSnapRect() const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void operator=(const SdrObject& rObj); virtual void TakeObjNameSingul(String& rName) const; diff --git a/svx/inc/svx/svdomeas.hxx b/svx/inc/svx/svdomeas.hxx index d3a8643085..e410904fe5 100644 --- a/svx/inc/svx/svdomeas.hxx +++ b/svx/inc/svx/svdomeas.hxx @@ -105,7 +105,6 @@ public: virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; virtual UINT16 GetObjIdentifier() const; virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void operator=(const SdrObject& rObj); virtual void TakeObjNameSingul(String& rName) const; @@ -153,7 +152,6 @@ public: Rectangle* pAnchorRect=NULL, BOOL bLineWidth=TRUE ) const; virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const; virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const; - virtual SdrObject* CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual USHORT GetOutlinerViewAnchorMode() const; virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject); virtual OutlinerParaObject* GetOutlinerParaObject() const; diff --git a/svx/inc/svx/svdoole2.hxx b/svx/inc/svx/svdoole2.hxx index 180b9fd4b0..41157116b3 100644 --- a/svx/inc/svx/svdoole2.hxx +++ b/svx/inc/svx/svdoole2.hxx @@ -145,7 +145,6 @@ public: virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; virtual UINT16 GetObjIdentifier() const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void TakeObjNameSingul(String& rName) const; virtual void TakeObjNamePlural(String& rName) const; @@ -185,14 +184,8 @@ public: sal_Bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize ); sal_Bool AddOwnLightClient(); - // helper for ViewObjectContactOfSdrOle2Obj. As long as the OLE stuff is not - // reworked, the things the old Do_PaintObject did at this object need to be - // emulated. Isolated those things here. Return value tells if the object - // is active - bool executeOldDoPaintPreparations(SdrPageView* pPageVew) const; - // handy to get the empty replacement bitmap without accessing all the old stuff - Bitmap GetEmtyOLEReplacementBitmap() const; + static Bitmap GetEmtyOLEReplacementBitmap(); void SetWindow(const com::sun::star::uno::Reference < com::sun::star::awt::XWindow >& _xWindow); }; diff --git a/svx/inc/svx/svdopath.hxx b/svx/inc/svx/svdopath.hxx index 42668cb1e8..b59ee4b84b 100644 --- a/svx/inc/svx/svdopath.hxx +++ b/svx/inc/svx/svdopath.hxx @@ -99,7 +99,6 @@ public: virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; virtual UINT16 GetObjIdentifier() const; virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void operator=(const SdrObject& rObj); virtual void TakeObjNameSingul(String& rName) const; diff --git a/svx/inc/svx/svdorect.hxx b/svx/inc/svx/svdorect.hxx index 50a4f5e170..9942941d04 100644 --- a/svx/inc/svx/svdorect.hxx +++ b/svx/inc/svx/svdorect.hxx @@ -75,7 +75,6 @@ protected: protected: XPolygon ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const; - SdrObject* ImpCheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer, FASTBOOL bForceFilled, FASTBOOL bForceTol=FALSE) const; void SetXPolyDirty(); // RecalcXPoly sollte ueberladen werden. Dabei muss dann eine XPolygon @@ -103,7 +102,6 @@ public: virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; virtual UINT16 GetObjIdentifier() const; virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void TakeObjNameSingul(String& rName) const; virtual void TakeObjNamePlural(String& rName) const; diff --git a/svx/inc/svx/svdotable.hxx b/svx/inc/svx/svdotable.hxx index 792c8eb1bf..f14695ca48 100644 --- a/svx/inc/svx/svdotable.hxx +++ b/svx/inc/svx/svdotable.hxx @@ -226,7 +226,6 @@ public: virtual FASTBOOL AdjustTextFrameWidthAndHeight(Rectangle& rR, FASTBOOL bHgt=TRUE, FASTBOOL bWdt=TRUE) const; virtual FASTBOOL AdjustTextFrameWidthAndHeight(FASTBOOL bHgt=TRUE, FASTBOOL bWdt=TRUE); - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void TakeObjNameSingul(String& rName) const; virtual void TakeObjNamePlural(String& rName) const; virtual void operator=(const SdrObject& rObj); diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx index d8ceefa242..a32a7e5ffb 100644 --- a/svx/inc/svx/svdotext.hxx +++ b/svx/inc/svx/svdotext.hxx @@ -259,7 +259,7 @@ protected: // Flag for allowing text animation. Default is sal_true. BOOL mbTextAnimationAllowed : 1; - SVX_DLLPRIVATE SdrOutliner& ImpGetDrawOutliner() const; + SdrOutliner& ImpGetDrawOutliner() const; private: SVX_DLLPRIVATE void ImpCheckMasterCachable(); @@ -272,14 +272,14 @@ private: Rectangle& rAnchorRect, Rectangle& rPaintRect, Fraction& aFitXKorreg ) const; - SVX_DLLPRIVATE SdrObject* ImpConvertObj(FASTBOOL bToPoly) const; + SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const; SVX_DLLPRIVATE void ImpLinkAnmeldung(); SVX_DLLPRIVATE void ImpLinkAbmeldung(); SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const; // void ImpCheckItemSetChanges(const SfxItemSet& rAttr); protected: - FASTBOOL ImpCanConvTextToCurve() const { return GetOutlinerParaObject()!=NULL && pModel!=NULL && !IsOutlText() && !IsFontwork(); } + bool ImpCanConvTextToCurve() const; SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, sal_Bool bClosed, sal_Bool bBezier, sal_Bool bNoSetAttr = sal_False) const; SdrObject* ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) const; void ImpSetTextStyleSheetListeners(); @@ -430,7 +430,6 @@ public: // Wird zur Bestimmung des Textankerbereichs benoetigt virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void TakeObjNameSingul(String& rName) const; virtual void TakeObjNamePlural(String& rName) const; virtual void operator=(const SdrObject& rObj); @@ -472,7 +471,6 @@ public: virtual sal_Bool BegTextEdit(SdrOutliner& rOutl); virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const; virtual void EndTextEdit(SdrOutliner& rOutl); - virtual SdrObject* CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual USHORT GetOutlinerViewAnchorMode() const; void StartTextAnimation(OutputDevice* pOutDev, const Point& rOffset, long nExtraData=0L); diff --git a/svx/inc/svx/svdouno.hxx b/svx/inc/svx/svdouno.hxx index 0723e74528..e6a7d53869 100644 --- a/svx/inc/svx/svdouno.hxx +++ b/svx/inc/svx/svdouno.hxx @@ -90,7 +90,6 @@ public: virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; virtual UINT16 GetObjIdentifier() const; - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual void operator = (const SdrObject& rObj); virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact); diff --git a/svx/inc/svx/svdovirt.hxx b/svx/inc/svx/svdovirt.hxx index a6b99d5428..b055c37dc7 100644 --- a/svx/inc/svx/svdovirt.hxx +++ b/svx/inc/svx/svdovirt.hxx @@ -83,7 +83,6 @@ public: virtual const Rectangle& GetLastBoundRect() const; virtual void RecalcBoundRect(); virtual void SetChanged(); - virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; virtual SdrObject* Clone() const; virtual void operator=(const SdrObject& rObj); diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx index 2b4c25d913..09ff53ee5d 100644 --- a/svx/inc/svx/svdpage.hxx +++ b/svx/inc/svx/svdpage.hxx @@ -132,9 +132,7 @@ friend class SdrEditView; FASTBOOL bRectsDirty; protected: virtual void RecalcRects(); -//#if 0 // _SOLAR__PRIVATE - FASTBOOL ImpGetFillColor(SdrObject* pObj, Color& rCol) const; -//#endif // __PRIVATE + private: /// simple ActionChildInserted forwarder to have it on a central place void impChildInserted(SdrObject& rChild) const; @@ -188,12 +186,6 @@ public: const Rectangle& GetAllObjSnapRect() const; const Rectangle& GetAllObjBoundRect() const; - // HitTest auf alle Objekte der Liste - SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer, FASTBOOL bBackward=FALSE) const; - SdrObject* CheckHit(const Point& rPnt, USHORT nTol, FASTBOOL bBackward=FALSE) const { return CheckHit(rPnt,nTol,NULL,bBackward); } - FASTBOOL IsHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const { return CheckHit(rPnt,nTol,pVisiLayer)!=NULL; } - FASTBOOL IsHit(const Point& rPnt, USHORT nTol) const { return CheckHit(rPnt,nTol)!=NULL; } // #i24906# - // Alle Textobjekte neu formatieren, z.B. bei Druckerwechsel void NbcReformatAllTextObjects(); void ReformatAllTextObjects(); @@ -204,14 +196,6 @@ public: // Die Vorlagenattribute der Zeichenobjekte in harte Attribute verwandeln. void BurnInStyleSheetAttributes(); - // Bestimmung der FuellFarbe an einer bestimmten Position. - // FALSE=Kein Objekt mit FuellFarbe an dieser Position gefunden. - // rVisLayers gibt die zu durchsuchenden Layer an. - // bLayerSorted: TRUE=Es wird in der Reihenfolge der Layer gesucht (ni) - // rCol: Hier wird die gefundene Farbe zurueckgegeben - FASTBOOL GetFillColor(const Point& rPnt, const SetOfByte& rVisLayers, - /* FASTBOOL bLayerSorted, */ Color& rCol) const; - ULONG GetObjCount() const; SdrObject* GetObj(ULONG nNum) const; @@ -444,10 +428,6 @@ friend class ChXChartDocument; // this is a weak reference to a possible living api wrapper for this page ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage; - // #108867# used by GetFillColor - FASTBOOL ImplGetFillColor(const Point& rPnt, const SetOfByte& rVisLayers, - /* FASTBOOL bLayerSorted, */ Color& rCol, FASTBOOL bSkipBackgroundShape) const; - protected: SdrLayerAdmin* pLayerAdmin; SdrObject* pBackgroundObj; @@ -530,15 +510,6 @@ public: const SdrLayerAdmin& GetLayerAdmin() const { return *pLayerAdmin; } SdrLayerAdmin& GetLayerAdmin() { return *pLayerAdmin; } - // Bestimmung der FuellFarbe an einer bestimmten Position. - // FALSE=Kein Objekt mit FuellFarbe an dieser Position gefunden. - // rVisLayers gibt die zu durchsuchenden Layer an. - // bLayerSorted: TRUE=Es wird in der Reihenfolge der Layer gesucht (ni) - // rCol: Hier wird die gefundene Farbe zurueckgegeben - // Auch MasterPages werden durchsucht. - FASTBOOL GetFillColor(const Point& rPnt, const SetOfByte& rVisLayers, - /*FASTBOOL bLayerSorted,*/ Color& rCol) const; - // GetBitmap und GetMetafile sind noch nicht implementiert. // Bitmap in Bildschirmaufloesung und -farbtiefe aus den Objekten der // Page erzeugen. diff --git a/svx/inc/svx/svdpntv.hxx b/svx/inc/svx/svdpntv.hxx index f345897dd7..33fd3d0812 100644 --- a/svx/inc/svx/svdpntv.hxx +++ b/svx/inc/svx/svdpntv.hxx @@ -109,7 +109,7 @@ namespace sdr //////////////////////////////////////////////////////////////////////////////////////////////////// -class SvxViewHint : public SfxHint +class SVX_DLLPUBLIC SvxViewHint : public SfxHint { public: enum HintType { SVX_HINT_VIEWCHANGED }; @@ -319,6 +319,10 @@ public: void SetHitTolerancePixel(USHORT nVal) { nHitTolPix=nVal; TheresNewMapMode(); } USHORT GetHitTolerancePixel() const { return (USHORT)nHitTolPix; } + // data read access on logic HitTolerance and MinMoveTolerance + USHORT getHitTolLog() const { return nHitTolLog; } + USHORT getMinMovLog() const { return nMinMovLog; } + // Flag zur Visualisierung von Gruppen abfragen/testen BOOL DoVisualizeEnteredGroup() const { return bVisualizeEnteredGroup; } void SetVisualizeEnteredGroup(BOOL bNew) { bVisualizeEnteredGroup = bNew; } @@ -559,35 +563,6 @@ public: // #103911# Set document color for svx at SdrPageViews void SetApplicationDocumentColor(Color aDocumentColor); - /** Determine typical background color for given area on given page - - This method calculates a single representative color for the - given rectangular area. This is accomplished by sampling from - various points within that area, and calculating a weighted - mean value of those samples. High contrast settings are - respected by this method, i.e. in high contrast mode, - svtools::DOCCOLOR is used as the background color. - - @attention For some cases, such as highly structured - background or huge color ranges spanned by the background, - this method cannot yield meaningful results, as the background - simply cannot be represented by a single color. Beware. - - @param rArea - Rectangular area to determine representative background color from - - @param rVisibleLayers - Set of layers visible when calculating the background color - - @param rCurrPage - Current page for which to determine background color on - - @return a representative background color. - */ - Color CalcBackgroundColor( const Rectangle& rArea, - const SetOfByte& rVisibleLayers, - const SdrPage& rCurrPage ) const; - // #i38135# // Sets the timer for Object animations and restarts. void SetAnimationTimer(sal_uInt32 nTime); diff --git a/svx/inc/svx/svdtext.hxx b/svx/inc/svx/svdtext.hxx index 15751f7c8d..d44f426958 100644 --- a/svx/inc/svx/svdtext.hxx +++ b/svx/inc/svx/svdtext.hxx @@ -33,6 +33,7 @@ #include <sal/types.h> #include "svx/svxdllapi.h" +#include <tools/weakbase.hxx> // -------------------------------------------------------------------- @@ -49,7 +50,7 @@ namespace sdr { namespace properties { /** This class stores information about one text inside a shape. */ -class SVX_DLLPUBLIC SdrText +class SVX_DLLPUBLIC SdrText : public tools::WeakBase< SdrText > { public: SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject = 0 ); diff --git a/svx/inc/svx/svdundo.hxx b/svx/inc/svx/svdundo.hxx index e098fd3345..de73a88333 100644 --- a/svx/inc/svx/svdundo.hxx +++ b/svx/inc/svx/svdundo.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -484,6 +484,35 @@ public: virtual bool CanSdrRepeat(SdrView& rView) const; }; +// --> OD 2009-07-09 #i73249# +class SdrUndoObjStrAttr : public SdrUndoObj +{ +public: + enum ObjStrAttrType + { + OBJ_NAME, + OBJ_TITLE, + OBJ_DESCRIPTION + }; + +protected: + const ObjStrAttrType meObjStrAttr; + const String msOldStr; + const String msNewStr; + +public: + SdrUndoObjStrAttr( SdrObject& rNewObj, + const ObjStrAttrType eObjStrAttr, + const String& sOldStr, + const String& sNewStr); + + virtual void Undo(); + virtual void Redo(); + + virtual String GetComment() const; +}; +// <-- + //////////////////////////////////////////////////////////////////////////////////////////////////// // // @@ @@@@ @@ @@ @@@@@ @@@@@ @@ -754,7 +783,7 @@ protected: SdrUndoPageMasterPage(SdrPage& rChangedPage); public: - virtual ~SdrUndoPageMasterPage(); + SVX_DLLPUBLIC virtual ~SdrUndoPageMasterPage(); }; //************************************************************ @@ -827,6 +856,13 @@ public: virtual SdrUndoAction* CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer ); virtual SdrUndoAction* CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText ); + // --> OD 2009-07-09 #i73249# + virtual SdrUndoAction* CreateUndoObjectStrAttr( SdrObject& rObject, + SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, + String sOldStr, + String sNewStr ); + // <-- + // layer virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); diff --git a/svx/inc/svx/svx3ditems.hxx b/svx/inc/svx/svx3ditems.hxx index 558c1904cf..a9ea7d22b1 100644 --- a/svx/inc/svx/svx3ditems.hxx +++ b/svx/inc/svx/svx3ditems.hxx @@ -48,12 +48,12 @@ public: class Svx3DBackscaleItem : public SfxUInt16Item { public: - Svx3DBackscaleItem(sal_uInt16 nVal = 100); + SVX_DLLPUBLIC Svx3DBackscaleItem(sal_uInt16 nVal = 100); }; class Svx3DDepthItem : public SfxUInt32Item { public: - Svx3DDepthItem(sal_uInt32 nVal = 1000); + SVX_DLLPUBLIC Svx3DDepthItem(sal_uInt32 nVal = 1000); }; class SVX_DLLPUBLIC Svx3DHorizontalSegmentsItem : public SfxUInt32Item { @@ -63,12 +63,12 @@ public: class Svx3DVerticalSegmentsItem : public SfxUInt32Item { public: - Svx3DVerticalSegmentsItem(sal_uInt32 nVal = 24); + SVX_DLLPUBLIC Svx3DVerticalSegmentsItem(sal_uInt32 nVal = 24); }; class Svx3DEndAngleItem : public SfxUInt32Item { public: - Svx3DEndAngleItem(sal_uInt32 nVal = 3600); + SVX_DLLPUBLIC Svx3DEndAngleItem(sal_uInt32 nVal = 3600); }; class SVX_DLLPUBLIC Svx3DDoubleSidedItem : public SfxBoolItem { @@ -85,29 +85,29 @@ public: virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const; }; -class Svx3DNormalsKindItem : public SfxUInt16Item { +class SVX_DLLPUBLIC Svx3DNormalsKindItem : public SfxUInt16Item { public: Svx3DNormalsKindItem(sal_uInt16 nVal = 0); // use drawing::NormalsKind - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; + SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; }; class Svx3DNormalsInvertItem : public SfxBoolItem { public: - Svx3DNormalsInvertItem(BOOL bVal = 0); + SVX_DLLPUBLIC Svx3DNormalsInvertItem(BOOL bVal = 0); }; -class Svx3DTextureProjectionXItem : public SfxUInt16Item { +class SVX_DLLPUBLIC Svx3DTextureProjectionXItem : public SfxUInt16Item { public: Svx3DTextureProjectionXItem(sal_uInt16 nVal = 0); // use drawing::TextureProjectionMode - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; + SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; }; class SVX_DLLPUBLIC Svx3DTextureProjectionYItem : public SfxUInt16Item { @@ -122,7 +122,7 @@ public: class Svx3DShadow3DItem : public SfxBoolItem { public: - Svx3DShadow3DItem(BOOL bVal = 0); + SVX_DLLPUBLIC Svx3DShadow3DItem(BOOL bVal = 0); }; class Svx3DMaterialColorItem : public SvxColorItem { @@ -132,68 +132,68 @@ public: class Svx3DMaterialEmissionItem : public SvxColorItem { public: - Svx3DMaterialEmissionItem(const Color& rCol = Color(0x00000000)); + SVX_DLLPUBLIC Svx3DMaterialEmissionItem(const Color& rCol = Color(0x00000000)); }; class Svx3DMaterialSpecularItem : public SvxColorItem { public: - Svx3DMaterialSpecularItem(const Color& rCol = Color(0x00ffffff)); + SVX_DLLPUBLIC Svx3DMaterialSpecularItem(const Color& rCol = Color(0x00ffffff)); }; class Svx3DMaterialSpecularIntensityItem : public SfxUInt16Item { public: - Svx3DMaterialSpecularIntensityItem(sal_uInt16 nVal = 15); + SVX_DLLPUBLIC Svx3DMaterialSpecularIntensityItem(sal_uInt16 nVal = 15); }; -class Svx3DTextureKindItem : public SfxUInt16Item { +class SVX_DLLPUBLIC Svx3DTextureKindItem : public SfxUInt16Item { public: Svx3DTextureKindItem(sal_uInt16 nVal = 3); // use drawing::TextureKind - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; + SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; }; -class Svx3DTextureModeItem : public SfxUInt16Item { +class SVX_DLLPUBLIC Svx3DTextureModeItem : public SfxUInt16Item { public: Svx3DTextureModeItem(sal_uInt16 nVal = 2); // use drawing:TextureMode - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; + SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; }; class Svx3DTextureFilterItem : public SfxBoolItem { public: - Svx3DTextureFilterItem(BOOL bVal = 0); + SVX_DLLPUBLIC Svx3DTextureFilterItem(BOOL bVal = 0); }; // Svx3D _3DSCENE_ Items -class Svx3DPerspectiveItem : public SfxUInt16Item { +class SVX_DLLPUBLIC Svx3DPerspectiveItem : public SfxUInt16Item { public: Svx3DPerspectiveItem(sal_uInt16 nVal = (sal_uInt16)PR_PERSPECTIVE); // use drawing::ProjectionMode - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; + SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; }; class Svx3DDistanceItem : public SfxUInt32Item { public: - Svx3DDistanceItem(sal_uInt32 nVal = 100); + SVX_DLLPUBLIC Svx3DDistanceItem(sal_uInt32 nVal = 100); }; class Svx3DFocalLengthItem : public SfxUInt32Item { public: - Svx3DFocalLengthItem(sal_uInt32 nVal = 100); + SVX_DLLPUBLIC Svx3DFocalLengthItem(sal_uInt32 nVal = 100); }; class Svx3DTwoSidedLightingItem : public SfxBoolItem { public: - Svx3DTwoSidedLightingItem(BOOL bVal = 0); + SVX_DLLPUBLIC Svx3DTwoSidedLightingItem(BOOL bVal = 0); }; class SVX_DLLPUBLIC Svx3DLightcolor1Item : public SvxColorItem { @@ -323,17 +323,17 @@ public: class Svx3DShadowSlantItem : public SfxUInt16Item { public: - Svx3DShadowSlantItem(sal_uInt16 nVal = 0); + SVX_DLLPUBLIC Svx3DShadowSlantItem(sal_uInt16 nVal = 0); }; -class Svx3DShadeModeItem : public SfxUInt16Item { +class SVX_DLLPUBLIC Svx3DShadeModeItem : public SfxUInt16Item { public: Svx3DShadeModeItem(sal_uInt16 nVal = 2); // use drawing::ShadeMode - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; + SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const; }; ////////////////////////////////////////////////////////////////////////////// @@ -362,19 +362,19 @@ public: }; // #107245# Item to replace bExtrudeCloseFront and bLatheCloseFront -class Svx3DCloseFrontItem : public SfxBoolItem { +class SVX_DLLPUBLIC Svx3DCloseFrontItem : public SfxBoolItem { public: Svx3DCloseFrontItem(BOOL bVal = 1); - virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const; - virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const; + SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const; }; // #107245# Item to replace bExtrudeCloseBack and bLatheCloseBack -class Svx3DCloseBackItem : public SfxBoolItem { +class SVX_DLLPUBLIC Svx3DCloseBackItem : public SfxBoolItem { public: Svx3DCloseBackItem(BOOL bVal = 1); - virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const; - virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const; + SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const; }; #endif // _SVX3DITEMS_HXX diff --git a/svx/inc/svx/svxdlg.hxx b/svx/inc/svx/svxdlg.hxx index 0db2d86534..613d5752f5 100644 --- a/svx/inc/svx/svxdlg.hxx +++ b/svx/inc/svx/svxdlg.hxx @@ -347,6 +347,13 @@ public: virtual sal_Int32 getColumns() const = 0; }; +class SvxAbstractInsRowColDlg : public VclAbstractDialog +{ +public: + virtual bool isInsertBefore() const = 0; + virtual sal_uInt16 getInsertCount() const = 0; +}; + //------------------------------------------------------------- class SVX_DLLPUBLIC SvxAbstractDialogFactory : public SfxAbstractDialogFactory @@ -543,6 +550,8 @@ public: virtual SvxAbstractSplittTableDialog* CreateSvxSplittTableDialog( Window* pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )=0; virtual SvxAbstractNewTableDialog* CreateSvxNewTableDialog( Window* pParent ) = 0; + + virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId ) = 0; }; #endif diff --git a/svx/inc/svx/svxfont.hxx b/svx/inc/svx/svxfont.hxx index 656bcef471..a710c64097 100644 --- a/svx/inc/svx/svxfont.hxx +++ b/svx/inc/svx/svxfont.hxx @@ -70,7 +70,8 @@ public: inline void SetCaseMap( const SvxCaseMap eNew ) { eCaseMap = eNew; } inline LanguageType GetLanguage() const { return eLang; } - inline void SetLanguage( const LanguageType eNewLan ) { eLang = eNewLan; } + inline void SetLanguage( const LanguageType eNewLan ) + { eLang = eNewLan; Font::SetLanguage(eNewLan); } // Is-Methoden: inline BOOL IsCaseMap() const { return SVX_CASEMAP_NOT_MAPPED != eCaseMap; } diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc index 4bfad86fba..36ca4a48e4 100644 --- a/svx/inc/svx/svxids.hrc +++ b/svx/inc/svx/svxids.hrc @@ -831,7 +831,11 @@ #define SID_OFASLOTS_START ( SID_SVX_START + 425 ) //#define SID_SD_AUTOPILOT ( SID_SVX_START + 425 ) -> sfxsids.hrc #define SID_AUTOPILOT SID_SD_AUTOPILOT -// 4 defines of Writer's old wizards have been removed here + +#define SID_TABLE_INSERT_COL_DLG ( SID_SVX_START + 426 ) +#define SID_TABLE_INSERT_ROW_DLG ( SID_SVX_START + 427 ) +#define SID_TABLE_PARAM_INSERT_AFTER ( SID_SVX_START + 428 ) + #define SID_TABLEDESIGN ( SID_SVX_START + 429 ) #define SID_MN_AUTOPILOT ( SID_SVX_START + 430 ) #define SID_GENERAL_OPTIONS ( SID_SVX_START + 432 ) diff --git a/svx/inc/svx/sxfiitm.hxx b/svx/inc/svx/sxfiitm.hxx index 6b985bf586..ab8e35de0e 100644 --- a/svx/inc/svx/sxfiitm.hxx +++ b/svx/inc/svx/sxfiitm.hxx @@ -40,7 +40,7 @@ class SdrFractionItem: public SfxPoolItem { Fraction nValue; public: - TYPEINFO(); + TYPEINFO_VISIBILITY( SVX_DLLPUBLIC ); SdrFractionItem(USHORT nId=0): SfxPoolItem(nId) {} SdrFractionItem(USHORT nId, const Fraction& rVal): SfxPoolItem(nId), nValue(rVal) {} SdrFractionItem(USHORT nId, SvStream& rIn); diff --git a/svx/inc/svx/unoedsrc.hxx b/svx/inc/svx/unoedsrc.hxx index a152063fb0..b6601ff93a 100644 --- a/svx/inc/svx/unoedsrc.hxx +++ b/svx/inc/svx/unoedsrc.hxx @@ -31,6 +31,8 @@ #ifndef _SVX_UNOEDSRC_HXX #define _SVX_UNOEDSRC_HXX +#include <com/sun/star/accessibility/TextSegment.hpp> + #include <tools/solar.h> #include <i18npool/lang.h> #include <tools/link.hxx> @@ -357,6 +359,36 @@ public: */ virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const = 0; + + /** Query bounds of line in paragraph + + @param rStart [output param; 0 .. text_len] + The index in the paragraph text that belongs to the chara at the start of the line + + @param rEnd [output param; 0 .. text_len] + The index in the paragraph text that follows the last chara in the line + + @param nParagraph[0 .. n-1] + Index of paragraph to query line length in + + @param nLine[0 .. m-1] + Index of line in paragraph to query line length of + + */ + virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const = 0; + + /** Query the line number for a index in the paragraphs text + + @param nPara[0 .. n-1] + Index of paragraph to query line length in + + @param nIndex[0 .. m-1] + Index of of the chara in the paragraph text + + @returns [0 .. k-1] + The line number of the chara in the paragraph + */ + virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const = 0; /** Delete given text range and reformat text diff --git a/svx/inc/svx/unofored.hxx b/svx/inc/svx/unofored.hxx index d8cdb8ee5e..6aa4a18fb0 100644 --- a/svx/inc/svx/unofored.hxx +++ b/svx/inc/svx/unofored.hxx @@ -81,6 +81,8 @@ public: virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const; virtual USHORT GetLineCount( USHORT nPara ) const; virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const; + virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const; + virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const; virtual sal_Bool Delete( const ESelection& ); virtual sal_Bool InsertText( const String&, const ESelection& ); virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE ); diff --git a/svx/inc/svx/unoforou.hxx b/svx/inc/svx/unoforou.hxx index bd3b9d6d24..bb56d57721 100644 --- a/svx/inc/svx/unoforou.hxx +++ b/svx/inc/svx/unoforou.hxx @@ -102,6 +102,8 @@ public: virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const; virtual USHORT GetLineCount( USHORT nPara ) const; virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const; + virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const; + virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const; virtual sal_Bool Delete( const ESelection& ); virtual sal_Bool InsertText( const String&, const ESelection& ); virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE ); diff --git a/svx/inc/svx/unoprov.hxx b/svx/inc/svx/unoprov.hxx index dac1f96f66..fcef2c605b 100644 --- a/svx/inc/svx/unoprov.hxx +++ b/svx/inc/svx/unoprov.hxx @@ -166,7 +166,7 @@ namespace comphelper { class PropertySetInfo; } class SvxPropertySetInfoPool { public: - static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw(); + SVX_DLLPUBLIC static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw(); private: static comphelper::PropertySetInfo* mpInfos[SVXUNO_SERVICEID_LASTID+1]; diff --git a/svx/inc/svx/unoshtxt.hxx b/svx/inc/svx/unoshtxt.hxx index 6a128bda89..1c0c2d0de6 100644 --- a/svx/inc/svx/unoshtxt.hxx +++ b/svx/inc/svx/unoshtxt.hxx @@ -35,9 +35,14 @@ #include <svx/unoedsrc.hxx> #include "svx/svxdllapi.h" -namespace com { namespace sun { namespace star { namespace uno { - class XInterface; -} } } } +namespace com { namespace sun { namespace star { + namespace uno { + class XInterface; + } + namespace accessibility { + struct TextSegment; + } +} } } class SvxTextForwarder; class SdrObject; @@ -80,7 +85,7 @@ public: // static sal_Bool hasLevels( const SdrObject* pObject ); - // the viewforwarder interface + // the SvxViewForwarder interface virtual BOOL IsValid() const; virtual Rectangle GetVisArea() const; virtual Point LogicToPixel( const Point&, const MapMode& ) const; diff --git a/svx/inc/svx/unotext.hxx b/svx/inc/svx/unotext.hxx index 478180bb75..fb06d47343 100644 --- a/svx/inc/svx/unotext.hxx +++ b/svx/inc/svx/unotext.hxx @@ -231,6 +231,8 @@ public: virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const; virtual USHORT GetLineCount( USHORT nPara ) const; virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const; + virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const; + virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const; virtual sal_Bool Delete( const ESelection& ); virtual sal_Bool InsertText( const String&, const ESelection& ); virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE ); @@ -673,9 +675,9 @@ public: }; -const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet(); -const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap(); -const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet(); -const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap(); +SVX_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet(); +SVX_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap(); +SVX_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet(); +SVX_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap(); #endif diff --git a/svx/inc/svx/xcolit.hxx b/svx/inc/svx/xcolit.hxx index 2c36e77975..f1bc9f0643 100644 --- a/svx/inc/svx/xcolit.hxx +++ b/svx/inc/svx/xcolit.hxx @@ -48,7 +48,7 @@ class SVX_DLLPUBLIC XColorItem : public NameOrIndex public: TYPEINFO(); XColorItem() {} - XColorItem(USHORT nWhich, long nIndex, const Color& rTheColor); + XColorItem(USHORT nWhich, INT32 nIndex, const Color& rTheColor); virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); diff --git a/svx/inc/svx/xflbckit.hxx b/svx/inc/svx/xflbckit.hxx index dbebc22532..ff4e898c29 100644 --- a/svx/inc/svx/xflbckit.hxx +++ b/svx/inc/svx/xflbckit.hxx @@ -46,13 +46,13 @@ public: TYPEINFO(); XFillBackgroundItem( BOOL bFill = FALSE ); - XFillBackgroundItem( SvStream& rIn ); + SVX_DLLPRIVATE XFillBackgroundItem( SvStream& rIn ); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const; - virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; diff --git a/svx/inc/svx/xflbmpit.hxx b/svx/inc/svx/xflbmpit.hxx index 43367a2238..e4b5174e90 100644 --- a/svx/inc/svx/xflbmpit.hxx +++ b/svx/inc/svx/xflbmpit.hxx @@ -45,18 +45,18 @@ class SVX_DLLPUBLIC XFillBmpPosItem : public SfxEnumItem public: TYPEINFO(); XFillBmpPosItem( RECT_POINT eRP = RP_MM ); - XFillBmpPosItem( SvStream& rIn ); + SVX_DLLPRIVATE XFillBmpPosItem( SvStream& rIn ); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; - virtual USHORT GetValueCount() const; - RECT_POINT GetValue() const { return (RECT_POINT) SfxEnumItem::GetValue(); } + SVX_DLLPRIVATE virtual USHORT GetValueCount() const; + SVX_DLLPRIVATE RECT_POINT GetValue() const { return (RECT_POINT) SfxEnumItem::GetValue(); } }; diff --git a/svx/inc/svx/xflbmsli.hxx b/svx/inc/svx/xflbmsli.hxx index c1cf2ad936..eb22a47016 100644 --- a/svx/inc/svx/xflbmsli.hxx +++ b/svx/inc/svx/xflbmsli.hxx @@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpSizeLogItem : public SfxBoolItem public: TYPEINFO(); XFillBmpSizeLogItem( BOOL bLog = TRUE ); - XFillBmpSizeLogItem( SvStream& rIn ); + SVX_DLLPRIVATE XFillBmpSizeLogItem( SvStream& rIn ); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; diff --git a/svx/inc/svx/xflbmsxy.hxx b/svx/inc/svx/xflbmsxy.hxx index 45eb9d32ba..39eabd4d41 100644 --- a/svx/inc/svx/xflbmsxy.hxx +++ b/svx/inc/svx/xflbmsxy.hxx @@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpSizeXItem : public SfxMetricItem public: TYPEINFO(); XFillBmpSizeXItem( long nSizeX = 0 ); - XFillBmpSizeXItem( SvStream& rIn ); + SVX_DLLPRIVATE XFillBmpSizeXItem( SvStream& rIn ); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; @@ -58,7 +58,7 @@ public: // Dieses Item nimmt sowohl metrische als auch // Prozentwerte ( sind negativ ) auf; das muessen // wir hier beruecksichtigen - virtual FASTBOOL HasMetrics() const; + SVX_DLLPRIVATE virtual FASTBOOL HasMetrics() const; }; /************************************************************************* @@ -72,12 +72,12 @@ class SVX_DLLPUBLIC XFillBmpSizeYItem : public SfxMetricItem public: TYPEINFO(); XFillBmpSizeYItem( long nSizeY = 0 ); - XFillBmpSizeYItem( SvStream& rIn ); + SVX_DLLPRIVATE XFillBmpSizeYItem( SvStream& rIn ); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; @@ -85,7 +85,7 @@ public: // Dieses Item nimmt sowohl metrische als auch // Prozentwerte ( sind negativ ) auf; das muessen // wir hier beruecksichtigen - virtual FASTBOOL HasMetrics() const; + SVX_DLLPRIVATE virtual FASTBOOL HasMetrics() const; }; #endif diff --git a/svx/inc/svx/xflboxy.hxx b/svx/inc/svx/xflboxy.hxx index 59dd441545..1d1d8d5eb5 100644 --- a/svx/inc/svx/xflboxy.hxx +++ b/svx/inc/svx/xflboxy.hxx @@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpPosOffsetXItem : public SfxUInt16Item public: TYPEINFO(); XFillBmpPosOffsetXItem( USHORT nOffPosX = 0 ); - XFillBmpPosOffsetXItem( SvStream& rIn ); + SVX_DLLPRIVATE XFillBmpPosOffsetXItem( SvStream& rIn ); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; @@ -68,12 +68,12 @@ class SVX_DLLPUBLIC XFillBmpPosOffsetYItem : public SfxUInt16Item public: TYPEINFO(); XFillBmpPosOffsetYItem( USHORT nOffPosY = 0 ); - XFillBmpPosOffsetYItem( SvStream& rIn ); + SVX_DLLPRIVATE XFillBmpPosOffsetYItem( SvStream& rIn ); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; diff --git a/svx/inc/svx/xflbtoxy.hxx b/svx/inc/svx/xflbtoxy.hxx index dd7068e7e6..83b283ea77 100644 --- a/svx/inc/svx/xflbtoxy.hxx +++ b/svx/inc/svx/xflbtoxy.hxx @@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpTileOffsetXItem : public SfxUInt16Item public: TYPEINFO(); XFillBmpTileOffsetXItem( USHORT nOffX = 0 ); - XFillBmpTileOffsetXItem( SvStream& rIn ); + SVX_DLLPRIVATE XFillBmpTileOffsetXItem( SvStream& rIn ); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; @@ -68,12 +68,12 @@ class SVX_DLLPUBLIC XFillBmpTileOffsetYItem : public SfxUInt16Item public: TYPEINFO(); XFillBmpTileOffsetYItem( USHORT nOffX = 0 ); - XFillBmpTileOffsetYItem( SvStream& rIn ); + SVX_DLLPRIVATE XFillBmpTileOffsetYItem( SvStream& rIn ); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; diff --git a/svx/inc/svx/xflclit.hxx b/svx/inc/svx/xflclit.hxx index a91389987f..c579b66c2b 100644 --- a/svx/inc/svx/xflclit.hxx +++ b/svx/inc/svx/xflclit.hxx @@ -46,7 +46,7 @@ class SVX_DLLPUBLIC XFillColorItem : public XColorItem public: TYPEINFO(); XFillColorItem() {} - XFillColorItem(long nIndex, const Color& rTheColor); + XFillColorItem(INT32 nIndex, const Color& rTheColor); XFillColorItem(const String& rName, const Color& rTheColor); XFillColorItem(SvStream& rIn); diff --git a/svx/inc/svx/xflftrit.hxx b/svx/inc/svx/xflftrit.hxx index abac4dc3f7..9737cf3b10 100644 --- a/svx/inc/svx/xflftrit.hxx +++ b/svx/inc/svx/xflftrit.hxx @@ -50,7 +50,7 @@ public: TYPEINFO(); XFillFloatTransparenceItem(); - XFillFloatTransparenceItem( long nIndex, const XGradient& rGradient, BOOL bEnable = TRUE ); + XFillFloatTransparenceItem( INT32 nIndex, const XGradient& rGradient, BOOL bEnable = TRUE ); XFillFloatTransparenceItem(const String& rName, const XGradient& rGradient, BOOL bEnable = TRUE ); XFillFloatTransparenceItem(SfxItemPool* pPool, const XGradient& rTheGradient, BOOL bEnable = TRUE ); XFillFloatTransparenceItem(SfxItemPool* pPool ); diff --git a/svx/inc/svx/xflgrit.hxx b/svx/inc/svx/xflgrit.hxx index be4da4cce5..cf1bdcac6c 100644 --- a/svx/inc/svx/xflgrit.hxx +++ b/svx/inc/svx/xflgrit.hxx @@ -47,7 +47,7 @@ class SVX_DLLPUBLIC XFillGradientItem : public NameOrIndex public: TYPEINFO(); XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {} - XFillGradientItem(long nIndex, const XGradient& rTheGradient); + XFillGradientItem(INT32 nIndex, const XGradient& rTheGradient); XFillGradientItem(const UniString& rName, const XGradient& rTheGradient); XFillGradientItem(SfxItemPool* pPool, const XGradient& rTheGradient); XFillGradientItem(SfxItemPool* pPool ); diff --git a/svx/inc/svx/xflhtit.hxx b/svx/inc/svx/xflhtit.hxx index a67fa8ef46..4f6ffefe0e 100644 --- a/svx/inc/svx/xflhtit.hxx +++ b/svx/inc/svx/xflhtit.hxx @@ -47,7 +47,7 @@ class SVX_DLLPUBLIC XFillHatchItem : public NameOrIndex public: TYPEINFO(); XFillHatchItem() : NameOrIndex(XATTR_FILLHATCH, -1) {} - XFillHatchItem(long nIndex, const XHatch& rTheHatch); + XFillHatchItem(INT32 nIndex, const XHatch& rTheHatch); XFillHatchItem(const String& rName, const XHatch& rTheHatch); XFillHatchItem(SfxItemPool* pPool, const XHatch& rTheHatch); XFillHatchItem(SfxItemPool* pPool ); diff --git a/svx/inc/svx/xftshcit.hxx b/svx/inc/svx/xftshcit.hxx index 353a02235c..f05319fbbe 100644 --- a/svx/inc/svx/xftshcit.hxx +++ b/svx/inc/svx/xftshcit.hxx @@ -45,7 +45,7 @@ class SVX_DLLPUBLIC XFormTextShadowColorItem : public XColorItem public: TYPEINFO(); XFormTextShadowColorItem() {} - XFormTextShadowColorItem(long nIndex, const Color& rTheColor); + XFormTextShadowColorItem(INT32 nIndex, const Color& rTheColor); XFormTextShadowColorItem(const String& rName, const Color& rTheColor); XFormTextShadowColorItem(SvStream& rIn); diff --git a/svx/inc/svx/xit.hxx b/svx/inc/svx/xit.hxx index c1754690d2..35b78558aa 100644 --- a/svx/inc/svx/xit.hxx +++ b/svx/inc/svx/xit.hxx @@ -54,7 +54,7 @@ typedef BOOL (*SvxCompareValueFunc)( const NameOrIndex* p1, const NameOrIndex* p //------------------- class SVX_DLLPUBLIC NameOrIndex : public SfxStringItem { - long nPalIndex; + INT32 nPalIndex; protected: void Detach() { nPalIndex = -1; } @@ -62,7 +62,7 @@ protected: public: TYPEINFO(); NameOrIndex() { nPalIndex = -1; } - NameOrIndex(USHORT nWhich, long nIndex); + NameOrIndex(USHORT nWhich, INT32 nIndex); NameOrIndex(USHORT nWhich, const String& rName= String()); NameOrIndex(USHORT nWhich, SvStream& rIn); @@ -76,8 +76,8 @@ public: String GetName() const { return GetValue(); } void SetName(const String& rName) { SetValue(rName); } - long GetIndex() const { return nPalIndex; } - void SetIndex(long nIndex) { nPalIndex = nIndex; } + INT32 GetIndex() const { return nPalIndex; } + void SetIndex(INT32 nIndex) { nPalIndex = nIndex; } BOOL IsIndex() const { return (nPalIndex >= 0); } /** this static checks if the given NameOrIndex item has a unique name for its value. diff --git a/svx/inc/svx/xlnclit.hxx b/svx/inc/svx/xlnclit.hxx index b935781e81..be073fffd2 100644 --- a/svx/inc/svx/xlnclit.hxx +++ b/svx/inc/svx/xlnclit.hxx @@ -42,7 +42,7 @@ class SVX_DLLPUBLIC XLineColorItem : public XColorItem public: TYPEINFO(); XLineColorItem() {} - XLineColorItem(long nIndex, const Color& rTheColor); + XLineColorItem(INT32 nIndex, const Color& rTheColor); XLineColorItem(const String& rName, const Color& rTheColor); XLineColorItem(SvStream& rIn); diff --git a/svx/inc/svx/xlndsit.hxx b/svx/inc/svx/xlndsit.hxx index cabb050085..a39e078b53 100644 --- a/svx/inc/svx/xlndsit.hxx +++ b/svx/inc/svx/xlndsit.hxx @@ -50,7 +50,7 @@ class SVX_DLLPUBLIC XLineDashItem : public NameOrIndex public: TYPEINFO(); XLineDashItem() : NameOrIndex(XATTR_LINEDASH, -1) {} - XLineDashItem(long nIndex, const XDash& rTheDash); + XLineDashItem(INT32 nIndex, const XDash& rTheDash); XLineDashItem(const String& rName, const XDash& rTheDash); XLineDashItem(SfxItemPool* pPool, const XDash& rTheDash); XLineDashItem(SfxItemPool* pPool ); diff --git a/svx/inc/svx/xlnedit.hxx b/svx/inc/svx/xlnedit.hxx index 5d9b265071..a0ec1abfb7 100644 --- a/svx/inc/svx/xlnedit.hxx +++ b/svx/inc/svx/xlnedit.hxx @@ -46,7 +46,7 @@ class SVX_DLLPUBLIC XLineEndItem : public NameOrIndex public: TYPEINFO(); - XLineEndItem(long nIndex = -1); + XLineEndItem(INT32 nIndex = -1); XLineEndItem(const String& rName, const basegfx::B2DPolyPolygon& rPolyPolygon); XLineEndItem(SfxItemPool* pPool, const basegfx::B2DPolyPolygon& rPolyPolygon); XLineEndItem(SfxItemPool* pPool ); diff --git a/svx/inc/svx/xlnstit.hxx b/svx/inc/svx/xlnstit.hxx index 30686871d8..24475fc0ef 100644 --- a/svx/inc/svx/xlnstit.hxx +++ b/svx/inc/svx/xlnstit.hxx @@ -46,7 +46,7 @@ class SVX_DLLPUBLIC XLineStartItem : public NameOrIndex public: TYPEINFO(); - XLineStartItem(long nIndex = -1); + XLineStartItem(INT32 nIndex = -1); XLineStartItem(const String& rName, const basegfx::B2DPolyPolygon& rPolyPolygon); XLineStartItem(SfxItemPool* pPool, const basegfx::B2DPolyPolygon& rPolyPolygon); XLineStartItem(SfxItemPool* pPool ); diff --git a/svx/inc/svx/xsflclit.hxx b/svx/inc/svx/xsflclit.hxx index b54391391a..be552105b5 100644 --- a/svx/inc/svx/xsflclit.hxx +++ b/svx/inc/svx/xsflclit.hxx @@ -36,24 +36,24 @@ //------------------------------ // class XSecondaryFillColorItem //------------------------------ -class XSecondaryFillColorItem : public XColorItem +class SVX_DLLPUBLIC XSecondaryFillColorItem : public XColorItem { public: TYPEINFO(); - XSecondaryFillColorItem() {} - XSecondaryFillColorItem(long nIndex, const Color& rTheColor); + SVX_DLLPRIVATE XSecondaryFillColorItem() {} + SVX_DLLPRIVATE XSecondaryFillColorItem(INT32 nIndex, const Color& rTheColor); XSecondaryFillColorItem(const String& rName, const Color& rTheColor); - XSecondaryFillColorItem(SvStream& rIn); + SVX_DLLPRIVATE XSecondaryFillColorItem(SvStream& rIn); - virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; - virtual SfxPoolItem* Create(SvStream& rIn, USHORT nVer) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; + SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, USHORT nVer) const; - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; - virtual USHORT GetVersion( USHORT nFileFormatVersion ) const; + SVX_DLLPRIVATE virtual USHORT GetVersion( USHORT nFileFormatVersion ) const; }; diff --git a/svx/inc/unoapi.hxx b/svx/inc/unoapi.hxx index f8c1352a1a..6d0720e0e0 100644 --- a/svx/inc/unoapi.hxx +++ b/svx/inc/unoapi.hxx @@ -97,12 +97,12 @@ SVX_DLLPUBLIC sal_Bool SvxFieldUnitToMeasureUnit( const short nVcl, short& eApi /** if the given name is a predefined name for the current language it is replaced by the corresponding api name. */ -void SvxUnogetApiNameForItem( const sal_Int16 nWhich, const String& rInternalName, rtl::OUString& rApiName ) throw(); +SVX_DLLPUBLIC void SvxUnogetApiNameForItem( const sal_Int16 nWhich, const String& rInternalName, rtl::OUString& rApiName ) throw(); /** if the given name is a predefined api name it is replaced by the predefined name for the current language. */ -void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString& rApiName, String& rInternalName ) throw(); +SVX_DLLPUBLIC void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString& rApiName, String& rInternalName ) throw(); /** returns the which id for the given property name. This only works for properties of shapes (map SVXMAP_SHAPE is used for searching) @@ -115,10 +115,10 @@ void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString& //SVX_DLLPUBLIC sal_Int16 SvxUnoGetWhichIdForNamedProperty( const ::rtl::OUString & rPropName ); /** converts the given any with a metric to 100th/mm if needed */ -void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, com::sun::star::uno::Any & rMetric ) throw(); +SVX_DLLPUBLIC void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, com::sun::star::uno::Any & rMetric ) throw(); /** converts the given any with a metric from 100th/mm to the given metric if needed */ -void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, com::sun::star::uno::Any & rMetric ) throw(); +SVX_DLLPUBLIC void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, com::sun::star::uno::Any & rMetric ) throw(); #endif // _SVX_UNOAPI_HXX_ diff --git a/svx/inc/unoedhlp.hxx b/svx/inc/unoedhlp.hxx index 7482f93dc6..8e63b8a8b5 100644 --- a/svx/inc/unoedhlp.hxx +++ b/svx/inc/unoedhlp.hxx @@ -49,7 +49,7 @@ class EditEngine; case denotes the destination position, the two parameters the start and the end of the moved paragraph range. */ -class SvxEditSourceHint : public TextHint +class SVX_DLLPUBLIC SvxEditSourceHint : public TextHint { private: ULONG mnStart; diff --git a/svx/inc/unolingu.hxx b/svx/inc/unolingu.hxx index 2427e44148..267cd80f44 100644 --- a/svx/inc/unolingu.hxx +++ b/svx/inc/unolingu.hxx @@ -67,7 +67,7 @@ class SvxLinguConfigUpdate public: - static void UpdateAll( sal_Bool bForceCheck = sal_False ); + SVX_DLLPUBLIC static void UpdateAll( sal_Bool bForceCheck = sal_False ); static BOOL IsNeedUpdateAll( sal_Bool bForceCheck = sal_False ); }; diff --git a/svx/inc/xexch.hxx b/svx/inc/xexch.hxx index f4ca2d4008..2e0c291677 100644 --- a/svx/inc/xexch.hxx +++ b/svx/inc/xexch.hxx @@ -60,7 +60,7 @@ public: // Zuweisungsoperator XFillExchangeData& operator=( const XFillExchangeData& rXFillExchangeData ); - friend SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rXFillExchangeData ); + SVX_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rXFillExchangeData ); SVX_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, XFillExchangeData& rXFillExchangeData ); static ULONG RegisterClipboardFormatName(); diff --git a/svx/inc/xmlgrhlp.hxx b/svx/inc/xmlgrhlp.hxx index 96a381b22e..71d52a42c3 100644 --- a/svx/inc/xmlgrhlp.hxx +++ b/svx/inc/xmlgrhlp.hxx @@ -95,7 +95,7 @@ private: SVX_DLLPRIVATE sal_Bool ImplWriteGraphic( const ::rtl::OUString& rPictureStorageName, const ::rtl::OUString& rPictureStreamName, const ::rtl::OUString& rGraphicId ); - SVX_DLLPRIVATE void ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos ); + SVX_DLLPRIVATE void ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos, rtl::OUString& rRequestedFileName ); protected: SvXMLGraphicHelper(); @@ -142,9 +142,9 @@ namespace svx uses eCreateMode == GRAPHICHELPER_MODE_READ, bDirect == TRUE in SvXMLGraphicHelper */ -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicImportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); -::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicImportHelper_getSupportedServiceNames() throw(); -::rtl::OUString SAL_CALL SvXMLGraphicImportHelper_getImplementationName() throw(); +SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicImportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); +SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicImportHelper_getSupportedServiceNames() throw(); +SVX_DLLPUBLIC ::rtl::OUString SAL_CALL SvXMLGraphicImportHelper_getImplementationName() throw(); /** Create this with createInstanceWithArguments. service name "com.sun.star.comp.Svx.GraphicExportHelper", one argument which is the @@ -158,9 +158,9 @@ namespace svx uses eCreateMode == GRAPHICHELPER_MODE_WRITE, bDirect == TRUE in SvXMLGraphicHelper */ -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicExportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); -::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicExportHelper_getSupportedServiceNames() throw(); -::rtl::OUString SAL_CALL SvXMLGraphicExportHelper_getImplementationName() throw(); +SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicExportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); +SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicExportHelper_getSupportedServiceNames() throw(); +SVX_DLLPUBLIC ::rtl::OUString SAL_CALL SvXMLGraphicExportHelper_getImplementationName() throw(); } #endif diff --git a/svx/inc/xoutbmp.hxx b/svx/inc/xoutbmp.hxx index 33c90ffc97..7c09fd0b99 100644 --- a/svx/inc/xoutbmp.hxx +++ b/svx/inc/xoutbmp.hxx @@ -95,6 +95,6 @@ public: // - DitherBitmap - // ---------------- -BOOL DitherBitmap( Bitmap& rBitmap ); +SVX_DLLPUBLIC BOOL DitherBitmap( Bitmap& rBitmap ); #endif // _XOUTBMP_HXX diff --git a/svx/prj/d.lst b/svx/prj/d.lst index 74236afdad..227dac4db6 100644 --- a/svx/prj/d.lst +++ b/svx/prj/d.lst @@ -10,7 +10,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\global\accelerator\es ..\%__SRC%\inc\svxslots.ilb %_DEST%\inc%_EXT%\svxslots.ilb ..\%__SRC%\inc\*.ilb* %_DEST%\inc%_EXT%\*.ilb* ..\%__SRC%\lib\lib*.* %_DEST%\lib%_EXT%\lib*.* -..\%__SRC%\lib\isvx.lib %_DEST%\lib%_EXT%\isvx.lib +..\%__SRC%\lib\isvx*.lib %_DEST%\lib%_EXT%\isvx*.lib ..\%__SRC%\bin\gengal* %_DEST%\bin%_EXT%\gengal* ..\%__SRC%\bin\gengalrc %_DEST%\bin%_EXT%\gengal.ini ..\%__SRC%\bin\cui*.dll %_DEST%\bin%_EXT%\cui*.dll @@ -218,6 +218,7 @@ mkdir: %_DEST%\inc%_EXT%\svx ..\inc\svx\svdedtv.hxx %_DEST%\inc%_EXT%\svx\svdedtv.hxx ..\inc\svx\svdedxv.hxx %_DEST%\inc%_EXT%\svx\svdedxv.hxx ..\inc\svx\svdetc.hxx %_DEST%\inc%_EXT%\svx\svdetc.hxx +..\inc\svx\sdrhittesthelper.hxx %_DEST%\inc%_EXT%\svx\sdrhittesthelper.hxx ..\inc\svx\svdglev.hxx %_DEST%\inc%_EXT%\svx\svdglev.hxx ..\inc\svx\svdglue.hxx %_DEST%\inc%_EXT%\svx\svdglue.hxx ..\inc\svx\svdhdl.hxx %_DEST%\inc%_EXT%\svx\svdhdl.hxx @@ -254,7 +255,6 @@ mkdir: %_DEST%\inc%_EXT%\svx ..\inc\svx\svdpoev.hxx %_DEST%\inc%_EXT%\svx\svdpoev.hxx ..\inc\svx\svdpool.hxx %_DEST%\inc%_EXT%\svx\svdpool.hxx ..\inc\svx\svdsnpv.hxx %_DEST%\inc%_EXT%\svx\svdsnpv.hxx -..\inc\svdtouch.hxx %_DEST%\inc%_EXT%\svx\svdtouch.hxx ..\inc\svx\svdtrans.hxx %_DEST%\inc%_EXT%\svx\svdtrans.hxx ..\inc\svx\svdundo.hxx %_DEST%\inc%_EXT%\svx\svdundo.hxx ..\inc\svx\svdoutl.hxx %_DEST%\inc%_EXT%\svx\svdoutl.hxx @@ -593,11 +593,9 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\contact mkdir: %_DEST%\inc%_EXT%\svx\sdr\overlay ..\inc\svx\sdr\overlay\overlayanimatedbitmapex.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayanimatedbitmapex.hxx -..\inc\svx\sdr\overlay\overlaybitmap.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaybitmap.hxx ..\inc\svx\sdr\overlay\overlaybitmapex.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaybitmapex.hxx ..\inc\svx\sdr\overlay\overlayline.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayline.hxx ..\inc\svx\sdr\overlay\overlayhelpline.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayhelpline.hxx -..\inc\svx\sdr\overlay\overlaylinestriped.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaylinestriped.hxx ..\inc\svx\sdr\overlay\overlaymanager.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaymanager.hxx ..\inc\svx\sdr\overlay\overlaymanagerbuffered.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaymanagerbuffered.hxx ..\inc\svx\sdr\overlay\overlayobject.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayobject.hxx @@ -605,7 +603,9 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\overlay ..\inc\svx\sdr\overlay\overlaytriangle.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaytriangle.hxx ..\inc\svx\sdr\overlay\overlaypolypolygon.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaypolypolygon.hxx ..\inc\svx\sdr\overlay\overlayobjectcell.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayobjectcell.hxx -..\inc\svx\sdr\overlay\overlaysdrobject.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaysdrobject.hxx +..\inc\svx\sdr\overlay\overlayprimitive2dsequenceobject.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayprimitive2dsequenceobject.hxx +..\inc\svx\sdr\overlay\overlayselection.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayselection.hxx +..\inc\svx\sdr\overlay\overlaytools.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaytools.hxx mkdir: %_DEST%\inc%_EXT%\svx\sdr\animation ..\inc\svx\sdr\animation\ainfographic.hxx %_DEST%\inc%_EXT%\svx\sdr\animation\ainfographic.hxx diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index a69aae4cf9..3c819229ee 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -14911,3 +14911,54 @@ SfxVoidItem RecheckDocument SID_RECHECK_DOCUMENT GroupId = GID_DOCUMENT; ] +//-------------------------------------------------------------------------- + +SfxVoidItem InsertColumnDialog SID_TABLE_INSERT_COL_DLG +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_TABLE; +] + +//-------------------------------------------------------------------------- + +SfxVoidItem InsertRowDialog SID_TABLE_INSERT_ROW_DLG +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_TABLE; +] diff --git a/svx/source/accessibility/AccessibleEditableTextPara.cxx b/svx/source/accessibility/AccessibleEditableTextPara.cxx index 7f43f3d81a..55775b8fbb 100644 --- a/svx/source/accessibility/AccessibleEditableTextPara.cxx +++ b/svx/source/accessibility/AccessibleEditableTextPara.cxx @@ -806,7 +806,7 @@ namespace accessibility // must provide XAccesibleText by hand, since it comes publicly inherited by XAccessibleEditableText if ( rType == ::getCppuType((uno::Reference< XAccessibleText > *)0) ) { - uno::Reference< XAccessibleText > aAccText = this; + uno::Reference< XAccessibleText > aAccText = static_cast< XAccessibleEditableText * >(this); aRet <<= aAccText; } else if ( rType == ::getCppuType((uno::Reference< XAccessibleEditableText > *)0) ) @@ -912,65 +912,18 @@ namespace accessibility { DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - // append first 40 characters from text, or first line, if shorter - // (writer takes first sentence here, but that's not supported - // from EditEngine) - // throws if defunc - ::rtl::OUString aLine; - - if( getCharacterCount() ) - aLine = getTextAtIndex(0, AccessibleTextType::LINE).SegmentText; - - // Get the string from the resource for the specified id. - String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION ) ); - String sParaIndex = ::rtl::OUString::valueOf( GetParagraphIndex() ); - sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )), - sParaIndex ); - - if( aLine.getLength() > MaxDescriptionLen ) - { - ::rtl::OUString aCurrWord; - sal_Int32 i; - - // search backward from MaxDescriptionLen for previous word start - for( aCurrWord=getTextAtIndex(MaxDescriptionLen, AccessibleTextType::WORD).SegmentText, - i=MaxDescriptionLen, - aLine=::rtl::OUString(); - i>=0; - --i ) - { - if( getTextAtIndex(i, AccessibleTextType::WORD).SegmentText != aCurrWord ) - { - if( i == 0 ) - // prevent completely empty string - aLine = getTextAtIndex(0, AccessibleTextType::WORD).SegmentText; - else - aLine = getTextRange(0, i); - } - } - } +// ::vos::OGuard aGuard( Application::GetSolarMutex() ); - return ::rtl::OUString( sStr ) + aLine; + return ::rtl::OUString(); } ::rtl::OUString SAL_CALL AccessibleEditableTextPara::getAccessibleName() throw (uno::RuntimeException) { DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - // throws if defunc - sal_Int32 nPara( GetParagraphIndex() ); - - // Get the string from the resource for the specified id. - String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_PARAGRAPH_NAME) ); - String sParaIndex = ::rtl::OUString::valueOf( nPara ); - sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )), - sParaIndex ); +// ::vos::OGuard aGuard( Application::GetSolarMutex() ); - return ::rtl::OUString( sStr ); + return ::rtl::OUString(); } uno::Reference< XAccessibleRelationSet > SAL_CALL AccessibleEditableTextPara::getAccessibleRelationSet() throw (uno::RuntimeException) @@ -2113,6 +2066,99 @@ namespace accessibility return aOutSequence; } + // XAccessibleMultiLineText + sal_Int32 SAL_CALL AccessibleEditableTextPara::getLineNumberAtIndex( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); + + sal_Int32 nRes = -1; + sal_Int32 nPara = GetParagraphIndex(); + + SvxTextForwarder &rCacheTF = GetTextForwarder(); + const bool bValidPara = 0 <= nPara && nPara < rCacheTF.GetParagraphCount(); + DBG_ASSERT( bValidPara, "getLineNumberAtIndex: current paragraph index out of range" ); + if (bValidPara) + { + // we explicitly allow for the index to point at the character right behind the text + if (0 <= nIndex && nIndex <= rCacheTF.GetTextLen( static_cast< USHORT >(nPara) )) + nRes = rCacheTF.GetLineNumberAtIndex( static_cast< USHORT >(nPara), static_cast< USHORT >(nIndex) ); + else + throw lang::IndexOutOfBoundsException(); + } + return nRes; + } + + // XAccessibleMultiLineText + ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleEditableTextPara::getTextAtLineNumber( sal_Int32 nLineNo ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); + + ::com::sun::star::accessibility::TextSegment aResult; + sal_Int32 nPara = GetParagraphIndex(); + SvxTextForwarder &rCacheTF = GetTextForwarder(); + const bool bValidPara = 0 <= nPara && nPara < rCacheTF.GetParagraphCount(); + DBG_ASSERT( bValidPara, "getTextAtLineNumber: current paragraph index out of range" ); + if (bValidPara) + { + if (0 <= nLineNo && nLineNo < rCacheTF.GetLineCount( static_cast< USHORT >(nPara) )) + { + USHORT nStart = 0, nEnd = 0; + rCacheTF.GetLineBoundaries( nStart, nEnd, static_cast< USHORT >(nPara), static_cast< USHORT >(nLineNo) ); + if (nStart != 0xFFFF && nEnd != 0xFFFF) + { + try + { + aResult.SegmentText = getTextRange( nStart, nEnd ); + aResult.SegmentStart = nStart; + aResult.SegmentEnd = nEnd; + } + catch (lang::IndexOutOfBoundsException) + { + // this is not the exception that should be raised in this function ... + DBG_ASSERT( 0, "unexpected exception" ); + } + } + } + else + throw lang::IndexOutOfBoundsException(); + } + return aResult; + } + + // XAccessibleMultiLineText + ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleEditableTextPara::getTextAtLineWithCaret( ) throw (uno::RuntimeException) + { + DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); + + ::com::sun::star::accessibility::TextSegment aResult; + try + { + aResult = getTextAtLineNumber( getNumberOfLineWithCaret() ); + } + catch (lang::IndexOutOfBoundsException &) + { + // this one needs to be catched since this interface does not allow for it. + } + return aResult; + } + + // XAccessibleMultiLineText + sal_Int32 SAL_CALL AccessibleEditableTextPara::getNumberOfLineWithCaret( ) throw (uno::RuntimeException) + { + DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); + + sal_Int32 nRes = -1; + try + { + nRes = getLineNumberAtIndex( getCaretPosition() ); + } + catch (lang::IndexOutOfBoundsException &) + { + // this one needs to be catched since this interface does not allow for it. + } + return nRes; + } + // XServiceInfo ::rtl::OUString SAL_CALL AccessibleEditableTextPara::getImplementationName (void) throw (uno::RuntimeException) diff --git a/svx/source/accessibility/AccessibleEditableTextPara.hxx b/svx/source/accessibility/AccessibleEditableTextPara.hxx index c13bdf820b..f78cbd4ad4 100644 --- a/svx/source/accessibility/AccessibleEditableTextPara.hxx +++ b/svx/source/accessibility/AccessibleEditableTextPara.hxx @@ -34,12 +34,10 @@ #include <tools/gen.hxx> #include <tools/string.hxx> #include <cppuhelper/weakref.hxx> -#include <cppuhelper/compbase7.hxx> +#include <cppuhelper/compbase8.hxx> #include <cppuhelper/typeprovider.hxx> - -#ifndef _CPPUHELPER_INTERFACECONTAINER_H_ #include <cppuhelper/interfacecontainer.hxx> -#endif + #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> @@ -47,6 +45,8 @@ #include <com/sun/star/accessibility/XAccessibleComponent.hpp> #include <com/sun/star/accessibility/XAccessibleEditableText.hpp> #include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp> +#include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp> + #include <comphelper/accessibletexthelper.hxx> #include <comphelper/broadcasthelper.hxx> #include "AccessibleParaManager.hxx" @@ -55,12 +55,13 @@ namespace accessibility { - typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::accessibility::XAccessible, + typedef ::cppu::WeakComponentImplHelper8< ::com::sun::star::accessibility::XAccessible, ::com::sun::star::accessibility::XAccessibleContext, ::com::sun::star::accessibility::XAccessibleComponent, ::com::sun::star::accessibility::XAccessibleEditableText, ::com::sun::star::accessibility::XAccessibleEventBroadcaster, ::com::sun::star::accessibility::XAccessibleTextAttributes, + ::com::sun::star::accessibility::XAccessibleMultiLineText, ::com::sun::star::lang::XServiceInfo > AccessibleTextParaInterfaceBase; /** This class implements the actual text paragraphs for the EditEngine/Outliner UAA @@ -128,7 +129,7 @@ namespace accessibility virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); - // XAccessibleText (this comes implicitely inherited by XAccessibleEditableText) + // XAccessibleText (this comes implicitely inherited by XAccessibleEditableText AND by XAccessibleMultiLineText) virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); @@ -163,6 +164,12 @@ namespace accessibility virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( ::sal_Int32 Index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + // XAccessibleMultiLineText + virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineNumber( ::sal_Int32 nLineNo ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getNumberOfLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException); + // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName (void) throw (::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL supportsService (const ::rtl::OUString& sServiceName) throw (::com::sun::star::uno::RuntimeException); diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx index e19d5040b9..49306c3c4b 100644 --- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx +++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx @@ -161,6 +161,8 @@ namespace accessibility sal_Bool GetAttributeRun( USHORT&, USHORT&, USHORT, USHORT ) const { return sal_False; } USHORT GetLineCount( USHORT nPara ) const { return nPara == 0 ? 1 : 0; } USHORT GetLineLen( USHORT, USHORT ) const { return 0; } + void GetLineBoundaries( /*out*/USHORT & rStart, /*out*/USHORT & rEnd, USHORT /*nParagraph*/, USHORT /*nLine*/ ) const { rStart = rEnd = 0; } + USHORT GetLineNumberAtIndex( USHORT /*nPara*/, USHORT /*nIndex*/ ) const { return 0; } // the following two methods would, strictly speaking, require // a switch to a real EditSource, too. Fortunately, the diff --git a/svx/source/accessibility/AccessibleImageBullet.cxx b/svx/source/accessibility/AccessibleImageBullet.cxx index ab37707dee..9212b9dd40 100644 --- a/svx/source/accessibility/AccessibleImageBullet.cxx +++ b/svx/source/accessibility/AccessibleImageBullet.cxx @@ -172,16 +172,8 @@ namespace accessibility ::vos::OGuard aGuard( Application::GetSolarMutex() ); - // throws if defunc - sal_Int32 nPara( GetParagraphIndex() ); - // Get the string from the resource for the specified id. - String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION) ); - String sParaIndex = ::rtl::OUString::valueOf( nPara ); - sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )), - sParaIndex ); - - return ::rtl::OUString( sStr ); + return ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION) ); } ::rtl::OUString SAL_CALL AccessibleImageBullet::getAccessibleName() throw (uno::RuntimeException) @@ -190,16 +182,8 @@ namespace accessibility ::vos::OGuard aGuard( Application::GetSolarMutex() ); - // throws if defunc - sal_Int32 nPara( GetParagraphIndex() ); - // Get the string from the resource for the specified id. - String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_NAME) ); - String sParaIndex = ::rtl::OUString::valueOf( nPara ); - sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )), - sParaIndex ); - - return ::rtl::OUString( sStr ); + return ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_NAME) ); } uno::Reference< XAccessibleRelationSet > SAL_CALL AccessibleImageBullet::getAccessibleRelationSet() throw (uno::RuntimeException) diff --git a/svx/source/accessibility/AccessibleStaticTextBase.cxx b/svx/source/accessibility/AccessibleStaticTextBase.cxx index 68ddf62319..c5681a4f0e 100644 --- a/svx/source/accessibility/AccessibleStaticTextBase.cxx +++ b/svx/source/accessibility/AccessibleStaticTextBase.cxx @@ -173,13 +173,17 @@ namespace accessibility AccessibleEditableTextPara& GetParagraph( sal_Int32 nPara ) const; sal_Int32 GetParagraphCount() const; - EPosition Index2Internal( sal_Int32 nFlatIndex ) const + sal_Int32 GetParagraphIndex() const; + sal_Int32 GetLineCount( sal_Int32 nParagraph ) const; + + EPosition Index2Internal( sal_Int32 nFlatIndex ) const { DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL ); return ImpCalcInternal( nFlatIndex, false ); } - EPosition Range2Internal( sal_Int32 nFlatIndex ) const + + EPosition Range2Internal( sal_Int32 nFlatIndex ) const { DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL ); @@ -327,6 +331,26 @@ namespace accessibility return mpTextParagraph->GetTextForwarder().GetParagraphCount(); } + sal_Int32 AccessibleStaticTextBase_Impl::GetParagraphIndex() const + { + DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL ); + + sal_Int32 nIndex = -1; + if( mpTextParagraph ) + nIndex = mpTextParagraph->GetParagraphIndex(); + return nIndex; + } + + sal_Int32 AccessibleStaticTextBase_Impl::GetLineCount( sal_Int32 nParagraph ) const + { + DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL ); + + sal_Int32 nIndex = 0; + if( mpTextParagraph ) + nIndex = mpTextParagraph->GetTextForwarder().GetLineCount( static_cast< USHORT >(nParagraph) ); + return nIndex; + } + sal_Int32 AccessibleStaticTextBase_Impl::Internal2Index( EPosition nEEIndex ) const { sal_Int32 aRes(0); @@ -1001,10 +1025,25 @@ namespace accessibility return ::comphelper::concatSequences( aRunAttrSeq, aDiffVec.getAsConstList() ); } - Rectangle AccessibleStaticTextBase::GetParagraphBoundingBox() const - { - return mpImpl->GetParagraphBoundingBox(); - } + Rectangle AccessibleStaticTextBase::GetParagraphBoundingBox() const + { + return mpImpl->GetParagraphBoundingBox(); + } + + sal_Int32 AccessibleStaticTextBase::GetParagraphIndex() const + { + return mpImpl->GetParagraphIndex(); + } + + sal_Int32 AccessibleStaticTextBase::GetParagraphCount() const + { + return mpImpl->GetParagraphCount(); + } + + sal_Int32 AccessibleStaticTextBase::GetLineCount( sal_Int32 nParagraph ) const + { + return mpImpl->GetLineCount( nParagraph ); + } } // end of namespace accessibility diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx index 4373c58146..26c855ba69 100644 --- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx +++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx @@ -64,6 +64,8 @@ #include <svx/svdpage.hxx> #include <svx/unomod.hxx> #include <svx/dialmgr.hxx> +#include <svx/svdetc.hxx> +#include <svx/sdrhittesthelper.hxx> //===== namespaces =========================================================== @@ -225,7 +227,14 @@ Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleAt { Point aPnt( rPoint.X, rPoint.Y ); mpControl->PixelToLogic( aPnt ); - SdrObject * pObj = mpPage->CheckHit(aPnt, 1, NULL, false); + + SdrObject* pObj = 0; + + if(mpView && mpView->GetSdrPageView()) + { + pObj = SdrObjListPrimitiveHit(*mpPage, aPnt, 1, *mpView->GetSdrPageView(), 0, false); + } + if( pObj ) xAccessible = getAccessible( pObj ); } diff --git a/svx/source/accessibility/accessibility.src b/svx/source/accessibility/accessibility.src index e38e9bd85c..82fe774f5b 100644 --- a/svx/source/accessibility/accessibility.src +++ b/svx/source/accessibility/accessibility.src @@ -196,19 +196,9 @@ String RID_SVXSTR_GRAPHCTRL_ACC_DESCRIPTION Text [ en-US ] = "This is where you can edit the contour." ; }; -String RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION -{ - Text [ en-US ] = "Paragraph: $(ARG) " ; -}; - -String RID_SVXSTR_A11Y_PARAGRAPH_NAME -{ - Text [ en-US ] = "Paragraph $(ARG)" ; -}; - String RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION { - Text [ en-US ] = "Image bullet in paragraph: $(ARG)" ; + Text [ en-US ] = "Image bullet in paragraph" ; }; String RID_SVXSTR_A11Y_IMAGEBULLET_NAME diff --git a/svx/source/accessibility/makefile.mk b/svx/source/accessibility/makefile.mk index f953adc1dd..8b1802bf1a 100755 --- a/svx/source/accessibility/makefile.mk +++ b/svx/source/accessibility/makefile.mk @@ -33,6 +33,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=accessibility +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- @@ -42,7 +43,12 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- -SLOFILES = \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ + $(SLO)$/AccessibleStringWrap.obj + +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ $(SLO)$/charmapacc.obj \ $(SLO)$/svxrectctaccessiblecontext.obj \ $(SLO)$/GraphCtlAccessibleContext.obj \ @@ -63,13 +69,14 @@ SLOFILES = \ $(SLO)$/AccessibleStaticTextBase.obj \ $(SLO)$/AccessibleParaManager.obj \ $(SLO)$/AccessibleEditableTextPara.obj \ - $(SLO)$/AccessibleStringWrap.obj \ $(SLO)$/AccessibleImageBullet.obj \ $(SLO)$/ShapeTypeHandler.obj \ $(SLO)$/SvxShapeTypes.obj \ $(SLO)$/AccessibleControlShape.obj \ $(SLO)$/DGColorNameLookUp.obj \ $(SLO)$/AccessibleFrameSelector.obj + +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) SRS2NAME = accessibility SRC2FILES = accessibility.src diff --git a/svx/source/cui/autocdlg.cxx b/svx/source/cui/autocdlg.cxx index 5fef343dfa..4da7f0d8d8 100644 --- a/svx/source/cui/autocdlg.cxx +++ b/svx/source/cui/autocdlg.cxx @@ -2308,7 +2308,7 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage( Window* pParent, aCBAppendSpace (this, SVX_RES(CB_APPEND_SPACE)), aCBAsTip (this, SVX_RES(CB_AS_TIP)), aCBCollect (this, SVX_RES(CB_COLLECT)), - aCBKeepList (this, SVX_RES(CB_KEEP_LIST)), + aCBRemoveList (this, SVX_RES(CB_REMOVE_LIST)), aFTExpandKey (this, SVX_RES(FT_EXPAND_KEY)), aDCBExpandKey (this, SVX_RES(DCB_EXPAND_KEY)), aFTMinWordlen (this, SVX_RES(FT_MIN_WORDLEN)), @@ -2369,8 +2369,8 @@ BOOL OfaAutoCompleteTabPage::FillItemSet( SfxItemSet& ) bCheck = aCBCollect.IsChecked(); bModified |= pOpt->bAutoCmpltCollectWords != bCheck; pOpt->bAutoCmpltCollectWords = bCheck; - bCheck = aCBKeepList.IsChecked(); - bModified |= pOpt->bAutoCmpltKeepList != bCheck; + bCheck = !aCBRemoveList.IsChecked(); // inverted value! + bModified |= pOpt->bAutoCmpltKeepList != bCheck; pOpt->bAutoCmpltKeepList = bCheck; bCheck = aCBAppendSpace.IsChecked(); bModified |= pOpt->bAutoCmpltAppendBlanc != bCheck; @@ -2416,7 +2416,7 @@ void OfaAutoCompleteTabPage::Reset( const SfxItemSet& ) aCBActiv.Check( 0 != pOpt->bAutoCompleteWords ); aCBCollect.Check( 0 != pOpt->bAutoCmpltCollectWords ); - aCBKeepList.Check( 0 != pOpt->bAutoCmpltKeepList); + aCBRemoveList.Check( !pOpt->bAutoCmpltKeepList ); //inverted value! aCBAppendSpace.Check( 0 != pOpt->bAutoCmpltAppendBlanc ); aCBAsTip.Check( 0 != pOpt->bAutoCmpltShowAsTip ); @@ -2487,7 +2487,7 @@ IMPL_LINK( OfaAutoCompleteTabPage, CheckHdl, CheckBox*, pBox ) aDCBExpandKey.Enable( bEnable ); } else if(&aCBCollect == pBox) - aCBKeepList.Enable( bEnable ); + aCBRemoveList.Enable( bEnable ); return 0; } diff --git a/svx/source/cui/autocdlg.hrc b/svx/source/cui/autocdlg.hrc index 08de5d0134..65770dbae1 100644 --- a/svx/source/cui/autocdlg.hrc +++ b/svx/source/cui/autocdlg.hrc @@ -129,7 +129,7 @@ #define CB_ACTIV 121 #define CB_COLLECT 122 #define CB_APPEND_SPACE 123 -#define CB_KEEP_LIST 124 +#define CB_REMOVE_LIST 124 #define CB_AS_TIP 125 #define FT_MIN_WORDLEN 126 #define FT_MAX_ENTRIES 127 diff --git a/svx/source/cui/autocdlg.hxx b/svx/source/cui/autocdlg.hxx index fb5533b2f0..f6e48d671d 100644 --- a/svx/source/cui/autocdlg.hxx +++ b/svx/source/cui/autocdlg.hxx @@ -406,7 +406,7 @@ class OfaAutoCompleteTabPage : public SfxTabPage CheckBox aCBAsTip; //Show as tip CheckBox aCBCollect;//Collect words - CheckBox aCBKeepList;//...save the list for later use... + CheckBox aCBRemoveList;//...save the list for later use... //--removed--CheckBox aCBEndless;// FixedText aFTExpandKey; diff --git a/svx/source/cui/autocdlg.src b/svx/source/cui/autocdlg.src index 437708e72d..0d9bc123d4 100644 --- a/svx/source/cui/autocdlg.src +++ b/svx/source/cui/autocdlg.src @@ -656,12 +656,12 @@ TabPage RID_OFAPAGE_AUTOCOMPLETE_OPTIONS Size = MAP_APPFONT( 116, 10 ); Text [ en-US ] = "C~ollect words"; }; - CheckBox CB_KEEP_LIST + CheckBox CB_REMOVE_LIST { Pos = MAP_APPFONT( 10, 59 ); Size = MAP_APPFONT( 110, 40 ); WordBreak = TRUE; - Text [ en-US ] = "~When closing a document, save the list for later use in other documents."; + Text [ en-US ] = "~When closing a document, remove the words collected from it from the list"; }; FixedText FT_EXPAND_KEY { diff --git a/svx/source/cui/commonlingui.src b/svx/source/cui/commonlingui.src index 59fbb6b81f..f3d3c05c1a 100644 --- a/svx/source/cui/commonlingui.src +++ b/svx/source/cui/commonlingui.src @@ -47,7 +47,7 @@ Window RID_SVX_WND_COMMON_LINGU { HelpId=HID_SPELLDLG_SETWORD; Pos = MAP_APPFONT( 51, 9 ); - Size = MAP_APPFONT( 149, 10 ); + Size = MAP_APPFONT( 164, 10 ); Border =FALSE; TabStop = TRUE; }; @@ -62,7 +62,7 @@ Window RID_SVX_WND_COMMON_LINGU Edit ED_NEWWORD { Pos = MAP_APPFONT( 51, 24 ); - Size = MAP_APPFONT( 122, 12 ); + Size = MAP_APPFONT( 137, 12 ); Border = TRUE; }; @@ -75,21 +75,21 @@ Window RID_SVX_WND_COMMON_LINGU PushButton BTN_IGNORE { - Pos = MAP_APPFONT( 209, 6 ); + Pos = MAP_APPFONT( 224, 6 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "~Ignore" ; }; PushButton BTN_IGNOREALL { - Pos = MAP_APPFONT( 209, 22 ); + Pos = MAP_APPFONT( 224, 22 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "Always I~gnore" ; }; PushButton BTN_CHANGE { - Pos = MAP_APPFONT( 209, 40 ); + Pos = MAP_APPFONT( 224, 40 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "~Replace" ; DefButton = TRUE ; @@ -97,14 +97,14 @@ Window RID_SVX_WND_COMMON_LINGU PushButton BTN_CHANGEALL { - Pos = MAP_APPFONT( 209, 56 ); + Pos = MAP_APPFONT( 224, 56 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "Always R~eplace" ; }; PushButton BTN_OPTIONS { - Pos = MAP_APPFONT( 209, 129 ); + Pos = MAP_APPFONT( 224, 129 ); Size = MAP_APPFONT( 55, 14 ); Hide = TRUE ; Text [ en-US ] = "Options..." ; @@ -119,19 +119,19 @@ Window RID_SVX_WND_COMMON_LINGU GroupBox GB_AUDIT { Pos = MAP_APPFONT( 1, 1 ); - Size = MAP_APPFONT( 268, 148 ); + Size = MAP_APPFONT( 283, 148 ); Hide=TRUE; }; HelpButton BTN_SPL_HELP { - Pos = MAP_APPFONT( 145, 153 ); + Pos = MAP_APPFONT( 160, 153 ); Size = MAP_APPFONT( 55, 14 ); }; CancelButton BTN_SPL_CANCEL { - Pos = MAP_APPFONT ( 209 , 153 ) ; + Pos = MAP_APPFONT ( 224 , 153 ) ; Size = MAP_APPFONT ( 55 , 14 ) ; TabStop = TRUE ; Text [ en-US ] = "~Close" ; diff --git a/svx/source/cui/cuicharmap.cxx b/svx/source/cui/cuicharmap.cxx index fa962beafc..a66c7b3c10 100644 --- a/svx/source/cui/cuicharmap.cxx +++ b/svx/source/cui/cuicharmap.cxx @@ -6,9 +6,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: cuicharmap.cxx,v $ - * $Revision: 1.10 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -405,6 +402,11 @@ IMPL_LINK( SvxCharMapData, FontSelectHdl, ListBox *, EMPTYARG ) USHORT nPos = aFontLB.GetSelectEntryPos(), nFont = (USHORT)(ULONG)aFontLB.GetEntryData( nPos ); aFont = mpDialog->GetDevFont( nFont ); + aFont.SetWeight( WEIGHT_DONTKNOW ); + aFont.SetItalic( ITALIC_NONE ); + aFont.SetWidthType( WIDTH_DONTKNOW ); + aFont.SetPitch( PITCH_DONTKNOW ); + aFont.SetFamily( FAMILY_DONTKNOW ); // notify children using this font aShowSet.SetFont( aFont ); diff --git a/svx/source/cui/dlgfact.cxx b/svx/source/cui/dlgfact.cxx index a894f52f6a..28f879e77b 100644 --- a/svx/source/cui/dlgfact.cxx +++ b/svx/source/cui/dlgfact.cxx @@ -112,6 +112,7 @@ #include "newtabledlg.hxx" #include "macroass.hxx" #include "acccfg.hxx" +#include "insrc.hxx" using namespace ::com::sun::star; using namespace ::com::sun::star::frame; @@ -2385,3 +2386,8 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateOptionsDialog( { return new VclAbstractDialog_Impl( new OfaTreeOptionsDialog( pParent, rExtensionId ) ); } + +SvxAbstractInsRowColDlg* AbstractDialogFactory_Impl::CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId ) +{ + return new SvxInsRowColDlg( pParent, bCol, nHelpId ); +} diff --git a/svx/source/cui/dlgfact.hxx b/svx/source/cui/dlgfact.hxx index ce47d30163..a6bd99c97d 100644 --- a/svx/source/cui/dlgfact.hxx +++ b/svx/source/cui/dlgfact.hxx @@ -810,6 +810,8 @@ public: virtual VclAbstractDialog* CreateOptionsDialog( Window* pParent, const rtl::OUString& rExtensionId, const rtl::OUString& rApplicationContext ); + + virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId ); }; #endif diff --git a/svx/source/cui/hangulhanjadlg.src b/svx/source/cui/hangulhanjadlg.src index 603a28e798..0d0041b67e 100644 --- a/svx/source/cui/hangulhanjadlg.src +++ b/svx/source/cui/hangulhanjadlg.src @@ -37,7 +37,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA { HelpId = HID_DIALOG_HANGULHANJA; - Size = MAP_APPFONT( 287, 175 ); + Size = MAP_APPFONT( 302, 175 ); OutputSize = TRUE; Closeable = TRUE ; Moveable = TRUE ; @@ -47,7 +47,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA PushButton PB_FIND { - Pos = MAP_APPFONT( 192, 23 ); + Pos = MAP_APPFONT( 207, 23 ); Size = MAP_APPFONT( 30, 14 ); Text [ en-US ] = "~Find"; @@ -56,7 +56,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA Control CTL_SUGGESTIONS { Pos = MAP_APPFONT( 51, 46 ); - Size = MAP_APPFONT( 171, 30 ); + Size = MAP_APPFONT( 186, 30 ); TabStop = TRUE ; }; @@ -71,7 +71,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA RadioButton RB_SIMPLE_CONVERSION { Pos = MAP_APPFONT( 51, 81 ); - Size = MAP_APPFONT( 55, 8 ); + Size = MAP_APPFONT( 60, 8 ); Group = TRUE; @@ -80,16 +80,16 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA RadioButton RB_HANJA_HANGUL_BRACKETED { - Pos = MAP_APPFONT( 109, 81 ); - Size = MAP_APPFONT( 55, 8 ); + Pos = MAP_APPFONT( 114, 81 ); + Size = MAP_APPFONT( 60, 8 ); Text [ en-US ] = "Hanja (Han~gul)"; }; RadioButton RB_HANGUL_HANJA_BRACKETED { - Pos = MAP_APPFONT( 167, 81 ); - Size = MAP_APPFONT( 55, 8 ); + Pos = MAP_APPFONT( 177, 81 ); + Size = MAP_APPFONT( 60, 8 ); Text [ en-US ] = "Hang~ul (Hanja)"; }; @@ -97,7 +97,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA RadioButton RB_HANGUL_HANJA_ABOVE { Pos = MAP_APPFONT( 51, 95 ); - Size = MAP_APPFONT( 55, 16 ); + Size = MAP_APPFONT( 60, 16 ); // this is the _primary_ text Text [ en-US ] = "Hangu~l"; @@ -105,8 +105,8 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA RadioButton RB_HANGUL_HANJA_BELOW { - Pos = MAP_APPFONT( 109, 95 ); - Size = MAP_APPFONT( 55, 16 ); + Pos = MAP_APPFONT( 114, 95 ); + Size = MAP_APPFONT( 60, 16 ); // this is the _primary_ text Text [ en-US ] = "Hang~ul"; @@ -114,8 +114,8 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA RadioButton RB_HANJA_HANGUL_ABOVE { - Pos = MAP_APPFONT( 51, 114 ); - Size = MAP_APPFONT( 55, 16 ); + Pos = MAP_APPFONT( 56, 114 ); + Size = MAP_APPFONT( 60, 16 ); // this is the _primary_ text Text [ en-US ] = "Han~ja"; @@ -123,8 +123,8 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA RadioButton RB_HANJA_HANGUL_BELOW { - Pos = MAP_APPFONT( 109, 114 ); - Size = MAP_APPFONT( 55, 16 ); + Pos = MAP_APPFONT( 114, 114 ); + Size = MAP_APPFONT( 60, 16 ); // this is the _primary_ text Text [ en-US ] = "Ha~nja"; @@ -141,14 +141,14 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA CheckBox CB_HANGUL_ONLY { Pos = MAP_APPFONT( 51, 134 ); - Size = MAP_APPFONT( 55, 8 ); + Size = MAP_APPFONT( 60, 8 ); Text [ en-US ] = "Hangul ~only"; }; CheckBox CB_HANJA_ONLY { - Pos = MAP_APPFONT( 109, 134 ); + Pos = MAP_APPFONT( 114, 134 ); Size = MAP_APPFONT( 55, 8 ); Text [ en-US ] = "Hanja onl~y"; @@ -157,12 +157,12 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA // this element is only for determining where our radio button group ends (in both directions) FixedText FT_RESIZE_ANCHOR { - Pos = MAP_APPFONT( 226, 133 ); + Pos = MAP_APPFONT( 241, 133 ); }; CheckBox CB_REPLACE_BY_CHARACTER { - Pos = MAP_APPFONT( 226, 81 ); + Pos = MAP_APPFONT( 241, 81 ); Size = MAP_APPFONT( 55, 24 ); WordBreak = TRUE; diff --git a/svx/source/cui/insrc.cxx b/svx/source/cui/insrc.cxx new file mode 100644 index 0000000000..e0a7bdc5f0 --- /dev/null +++ b/svx/source/cui/insrc.cxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * 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: insrc.cxx,v $ + * $Revision: 1.10 $ + * + * 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_svx.hxx" +#ifdef SVX_DLLIMPLEMENTATION +#undef SVX_DLLIMPLEMENTATION +#endif + +#include <svx/dialmgr.hxx> +#include <svx/svxdlg.hxx> +#include <svx/dialogs.hrc> +#include "insrc.hxx" +#include "insrc.hrc" + +bool SvxInsRowColDlg::isInsertBefore() const +{ + return !aAfterBtn.IsChecked(); +} + +sal_uInt16 SvxInsRowColDlg::getInsertCount() const +{ + return static_cast< sal_uInt16 >( aCountEdit.GetValue() ); +} + +SvxInsRowColDlg::SvxInsRowColDlg(Window* pParent, bool bCol, ULONG nHelpId ) + : ModalDialog( pParent, SVX_RES(DLG_INS_ROW_COL) ), + aCount( this, SVX_RES( FT_COUNT ) ), + aCountEdit( this, SVX_RES( ED_COUNT ) ), + aInsFL( this, SVX_RES( FL_INS ) ), + aBeforeBtn( this, SVX_RES( CB_POS_BEFORE ) ), + aAfterBtn( this, SVX_RES( CB_POS_AFTER ) ), + aPosFL( this, SVX_RES( FL_POS ) ), + aRow(SVX_RES(STR_ROW)), + aCol(SVX_RES(STR_COL)), + aOKBtn( this, SVX_RES( BT_OK ) ), + aCancelBtn( this, SVX_RES( BT_CANCEL ) ), + aHelpBtn( this, SVX_RES( BT_HELP ) ), + bColumn( bCol ) +{ + FreeResource(); + String aTmp( GetText() ); + if( bColumn ) + { + aTmp += aCol; + } + else + { + aTmp += aRow; + } + SetText( aTmp ); + SetHelpId( nHelpId ); +} + +short SvxInsRowColDlg::Execute(void) +{ + return ModalDialog::Execute(); +} + + + diff --git a/svx/source/sdr/overlay/overlaylinestriped.cxx b/svx/source/cui/insrc.hrc index 00400ea84a..133bcf70c3 100644 --- a/svx/source/sdr/overlay/overlaylinestriped.cxx +++ b/svx/source/cui/insrc.hrc @@ -6,7 +6,7 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: overlaylinestriped.cxx,v $ + * $RCSfile: insrc.hrc,v $ * $Revision: 1.4 $ * * This file is part of OpenOffice.org. @@ -27,21 +27,17 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +#define FT_COUNT 1 +#define ED_COUNT 2 +#define FL_INS 3 -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" -#include <svx/sdr/overlay/overlaylinestriped.hxx> -#include <tools/gen.hxx> -#include <vcl/outdev.hxx> +#define CB_POS_BEFORE 10 +#define CB_POS_AFTER 11 +#define FL_POS 12 -////////////////////////////////////////////////////////////////////////////// +#define STR_ROW 20 +#define STR_COL 21 -namespace sdr -{ - namespace overlay - { - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// -// eof +#define BT_OK 100 +#define BT_CANCEL 101 +#define BT_HELP 102 diff --git a/svx/inc/svdtouch.hxx b/svx/source/cui/insrc.hxx index a3ac3dd259..ea6dd8569d 100644 --- a/svx/inc/svdtouch.hxx +++ b/svx/source/cui/insrc.hxx @@ -6,8 +6,8 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: svdtouch.hxx,v $ - * $Revision: 1.6 $ + * $RCSfile: insrc.hxx,v $ + * $Revision: 1.4 $ * * This file is part of OpenOffice.org. * @@ -27,27 +27,46 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +#ifndef _SVX_INSRC_HXX +#define _SVX_INSRC_HXX -#ifndef _SVDTOUCH_HXX -#define _SVDTOUCH_HXX +#include <svx/stddlg.hxx> -#include <tools/solar.h> +#include <vcl/fixed.hxx> +#include <vcl/field.hxx> +#include <vcl/button.hxx> +#include <vcl/group.hxx> +#include <vcl/button.hxx> -//////////////////////////////////////////////////////////////////////////////////////////////////// +#include <tools/string.hxx> -class Point; -class Polygon; -class PolyPolygon; -class Rectangle; +class SvxInsRowColDlg : public SvxAbstractInsRowColDlg, public ModalDialog +{ + FixedText aCount; + NumericField aCountEdit; + FixedLine aInsFL; -bool IsPointInsidePoly(const Polygon& rPoly, const Point& rHit); -bool IsPointInsidePoly(const PolyPolygon& rPoly, const Point& rHit); + RadioButton aBeforeBtn; + RadioButton aAfterBtn; + FixedLine aPosFL; -bool IsRectTouchesLine(const Point& rPt1, const Point& rPt2, const Rectangle& rHit); -bool IsRectTouchesLine(const Polygon& rLine, const Rectangle& rHit); -bool IsRectTouchesLine(const PolyPolygon& rLine, const Rectangle& rHit); + String aRow; + String aCol; -//////////////////////////////////////////////////////////////////////////////////////////////////// + OKButton aOKBtn; + CancelButton aCancelBtn; + HelpButton aHelpBtn; -#endif //_SVDTOUCH_HXX + bool bColumn; + +public: + SvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId ); + + virtual short Execute(void); + + virtual bool isInsertBefore() const; + virtual sal_uInt16 getInsertCount() const; +}; + +#endif diff --git a/svx/source/cui/insrc.src b/svx/source/cui/insrc.src new file mode 100644 index 0000000000..58b6ec63a6 --- /dev/null +++ b/svx/source/cui/insrc.src @@ -0,0 +1,118 @@ +/************************************************************************* + * + * 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: insrc.src,v $ + * $Revision: 1.32 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#include <svx/dialogs.hrc> +#include "insrc.hrc" + +ModalDialog DLG_INS_ROW_COL +{ + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 136 , 84 ) ; + Text [ en-US ] = "Insert" ; + Moveable = TRUE ; + OKButton BT_OK + { + Pos = MAP_APPFONT ( 80 , 6 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + DefButton = TRUE ; + }; + CancelButton BT_CANCEL + { + Pos = MAP_APPFONT ( 80 , 23 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + HelpButton BT_HELP + { + Pos = MAP_APPFONT ( 80 , 43 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + RadioButton CB_POS_BEFORE + { + Pos = MAP_APPFONT ( 12 , 49 ) ; + Size = MAP_APPFONT ( 56 , 10 ) ; + Text [ en-US ] = "~Before" ; + TabStop = TRUE ; + }; + RadioButton CB_POS_AFTER + { + Pos = MAP_APPFONT ( 12 , 62 ) ; + Size = MAP_APPFONT ( 56 , 10 ) ; + Text [ en-US ] = "A~fter" ; + TabStop = TRUE ; + Check = TRUE ; + }; + NumericField ED_COUNT + { + Border = TRUE ; + Pos = MAP_APPFONT ( 44 , 14 ) ; + Size = MAP_APPFONT ( 24 , 12 ) ; + TabStop = TRUE ; + Left = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 1 ; + Maximum = 99 ; + Value = 1 ; + First = 1 ; + Last = 5 ; + }; + FixedLine FL_INS + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 68 , 8 ) ; + Text [ en-US ] = "Insert" ; + }; + FixedLine FL_POS + { + Pos = MAP_APPFONT ( 6 , 38 ) ; + Size = MAP_APPFONT ( 68 , 8 ) ; + Text [ en-US ] = "Position"; + }; + FixedText FT_COUNT + { + Pos = MAP_APPFONT ( 12 , 16 ) ; + Size = MAP_APPFONT ( 30 , 8 ) ; + Text [ en-US ] = "~Number" ; + Left = TRUE ; + }; + String STR_ROW + { + Text [ en-US ] = " Rows" ; + }; + String STR_COL + { + Text [ en-US ] = " Columns" ; + }; +}; diff --git a/svx/source/cui/macropg.src b/svx/source/cui/macropg.src index c8d3bcd760..7361c5c3b1 100644 --- a/svx/source/cui/macropg.src +++ b/svx/source/cui/macropg.src @@ -234,11 +234,11 @@ String RID_SVXSTR_EVENT_PAGECOUNTCHANGE }; String RID_SVXSTR_EVENT_SUBCOMPONENT_OPENED { - Text = "Loaded a sub component" ; + Text [ en-US ] = "Loaded a sub component" ; }; String RID_SVXSTR_EVENT_SUBCOMPONENT_CLOSED { - Text = "Closed a sub component" ; + Text [ en-US ] = "Closed a sub component" ; }; String RID_SVXSTR_EVENT_APPROVEPARAMETER { diff --git a/svx/source/cui/makefile.mk b/svx/source/cui/makefile.mk index 7db32bb15f..7a1db4a85f 100755 --- a/svx/source/cui/makefile.mk +++ b/svx/source/cui/makefile.mk @@ -100,7 +100,8 @@ SRC1FILES = \ textattr.src \ treeopt.src \ webconninfo.src \ - zoom.src + zoom.src \ + insrc.src SRS2NAME=cuidrawdlgs SRC2FILES = \ @@ -221,7 +222,8 @@ SLOFILES+=\ $(SLO)$/macroass.obj \ $(SLO)$/cfg.obj \ $(SLO)$/cfgutil.obj \ - $(SLO)$/optchart.obj + $(SLO)$/optchart.obj \ + $(SLO)$/insrc.obj .IF "$(GUI)"=="WNT" SLOFILES+=$(SLO)$/winpluginlib.obj diff --git a/svx/source/cui/optgdlg.cxx b/svx/source/cui/optgdlg.cxx index b4a642eeb5..f9155421b7 100644 --- a/svx/source/cui/optgdlg.cxx +++ b/svx/source/cui/optgdlg.cxx @@ -136,7 +136,6 @@ int OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ ) return LEAVE_PAGE; } -# ifdef ENABLE_GTK namespace { ::rtl::OUString impl_SystemFileOpenServiceName() @@ -146,13 +145,33 @@ namespace if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "gnome" ) ) { + #ifdef ENABLE_GTK return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.GtkFilePicker" ); + #else + return rtl::OUString(); + #endif + } + else if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde4" ) ) + { + #ifdef ENABLE_KDE4 + return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.KDE4FilePicker" ); + #else + return rtl::OUString(); + #endif } else if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde" ) ) { + #ifdef ENABLE_KDE return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.KDEFilePicker" ); + #else + return rtl::OUString(); + #endif } + #if defined WNT || (defined MACOSX && defined QUARTZ) return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" ); + #else + return rtl::OUString(); + #endif } sal_Bool lcl_HasSystemFilePicker() @@ -180,8 +199,6 @@ namespace } } -#endif - // ----------------------------------------------------------------------- OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) : @@ -210,20 +227,11 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) : { FreeResource(); - //system fileopen only available in Windows and with gtk vclplug based - //picker and on MacOSX (aqua version) -#if !defined( WNT ) && !defined( ENABLE_GTK ) && !(defined(MACOSX) && defined(QUARTZ)) - aFileDlgFL.Hide(); - aFileDlgCB.Hide(); -#else -# ifdef ENABLE_GTK if (!lcl_HasSystemFilePicker()) { aFileDlgFL.Hide(); aFileDlgCB.Hide(); } -# endif -#endif #if ! defined(QUARTZ) aPrintDlgFL.Hide(); @@ -691,6 +699,12 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) : aMousePosLB ( this, SVX_RES( LB_MOUSEPOS ) ), aMouseMiddleFT ( this, SVX_RES( FT_MOUSEMIDDLE ) ), aMouseMiddleLB ( this, SVX_RES( LB_MOUSEMIDDLE ) ), + + // #i97672# + maSelectionFL(this, SVX_RES(FL_SELECTION)), + maSelectionCB(this, SVX_RES(CB_SELECTION)), + maSelectionMF(this, SVX_RES(MF_SELECTION)), + nSizeLB_InitialSelection(0), nStyleLB_InitialSelection(0), pAppearanceCfg(new SvtTabAppearanceCfg), @@ -753,6 +767,9 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) : #endif + // #i97672# + maSelectionCB.SetToggleHdl( LINK( this, OfaViewTabPage, OnSelectionToggled ) ); + FreeResource(); if( ! Application::ValidateSystemFont() ) @@ -807,6 +824,15 @@ IMPL_LINK( OfaViewTabPage, OnAntialiasingToggled, void*, NOTINTERESTEDIN ) } #endif +// #i97672# +IMPL_LINK( OfaViewTabPage, OnSelectionToggled, void*, NOTINTERESTEDIN ) +{ + (void)NOTINTERESTEDIN; + const bool bSelectionEnabled(maSelectionCB.IsChecked()); + maSelectionMF.Enable(bSelectionEnabled); + return 0; +} + /*-----------------06.12.96 11.50------------------- --------------------------------------------------*/ @@ -828,6 +854,7 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& ) BOOL bModified = FALSE; BOOL bMenuOptModified = FALSE; + bool bRepaintWindows(false); SvtMiscOptions aMiscOptions; UINT16 nSizeLB_NewSelection = aIconSizeLB.GetSelectEntryPos(); @@ -953,16 +980,30 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& ) { mpDrawinglayerOpt->SetAntiAliasing(aUseAntiAliase.IsChecked()); bModified = TRUE; + bRepaintWindows = true; + } + } - // react on AA change; invalidate all windows to force - // a repaint when changing from AA to non-AA or vice-versa - Window* pAppWindow = Application::GetFirstTopLevelWindow(); + // #i97672# + if(maSelectionCB.IsEnabled()) + { + const bool bNewSelection(maSelectionCB.IsChecked()); + const sal_uInt16 nNewTransparence((sal_uInt16)maSelectionMF.GetValue()); - while(pAppWindow) - { - pAppWindow->Invalidate(); - pAppWindow = Application::GetNextTopLevelWindow(pAppWindow); - } + if(bNewSelection != (bool)mpDrawinglayerOpt->IsTransparentSelection()) + { + mpDrawinglayerOpt->SetTransparentSelection(maSelectionCB.IsChecked()); + bModified = TRUE; + bRepaintWindows = true; + } + + // #i104150# even read the value when maSelectionMF is disabled; it may have been + // modified by enabling-modify-disabling by the user + if(nNewTransparence != mpDrawinglayerOpt->GetTransparentSelectionPercent()) + { + mpDrawinglayerOpt->SetTransparentSelectionPercent(nNewTransparence); + bModified = TRUE; + bRepaintWindows = true; } } @@ -993,6 +1034,17 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& ) pAppearanceCfg->SetApplicationDefaults ( GetpApp() ); } + if(bRepaintWindows) + { + Window* pAppWindow = Application::GetFirstTopLevelWindow(); + + while(pAppWindow) + { + pAppWindow->Invalidate(); + pAppWindow = Application::GetNextTopLevelWindow(pAppWindow); + } + } + return bModified; } @@ -1082,6 +1134,27 @@ void OfaViewTabPage::Reset( const SfxItemSet& ) aUseAntiAliase.SaveValue(); } + { + // #i97672# Selection + // check if transparent selection is possible on this system + const bool bTransparentSelectionPossible( + !GetSettings().GetStyleSettings().GetHighContrastMode() + && supportsOperation(OutDevSupport_TransparentRect)); + + // enter values + if(bTransparentSelectionPossible) + { + maSelectionCB.Check(mpDrawinglayerOpt->IsTransparentSelection()); + } + else + { + maSelectionCB.Enable(false); + } + + maSelectionMF.SetValue(mpDrawinglayerOpt->GetTransparentSelectionPercent()); + maSelectionMF.Enable(mpDrawinglayerOpt->IsTransparentSelection() && bTransparentSelectionPossible); + } + #if defined( UNX ) aFontAntiAliasing.SaveValue(); aAAPointLimit.SaveValue(); diff --git a/svx/source/cui/optgdlg.hrc b/svx/source/cui/optgdlg.hrc index 79c0c24df0..4001d2056a 100644 --- a/svx/source/cui/optgdlg.hrc +++ b/svx/source/cui/optgdlg.hrc @@ -91,6 +91,10 @@ #define ROW_FT_MOUSEMIDDLE (ROW_LB_MOUSEPOS + RSC_CD_DROPDOWN_HEIGHT + ROWSPACE) #define ROW_LB_MOUSEMIDDLE (ROW_FT_MOUSEMIDDLE + RSC_CD_FIXEDTEXT_HEIGHT + ROWSPACE) +// #i97672# +#define ROW_FL_SELECTION (ROW_LB_MOUSEMIDDLE + RSC_CD_DROPDOWN_HEIGHT + RSC_SP_FLGR_SPACE_X) +#define ROW_CB_SELECTION (ROW_FL_SELECTION + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE) + // tabpage general ------------------------------------------------------- #define FL_HELP 10 @@ -150,6 +154,11 @@ #define CB_USE_HARDACCELL 68 #define CB_USE_ANTIALIASE 69 +// #i97672# +#define FL_SELECTION 70 +#define CB_SELECTION 71 +#define MF_SELECTION 72 + // tabpage languages ----------------------------------------------------- #define FL_UI_LANG 1 diff --git a/svx/source/cui/optgdlg.hxx b/svx/source/cui/optgdlg.hxx index 5023f33644..52fe207310 100644 --- a/svx/source/cui/optgdlg.hxx +++ b/svx/source/cui/optgdlg.hxx @@ -129,6 +129,11 @@ private: FixedText aMouseMiddleFT; ListBox aMouseMiddleLB; + // #i97672# + FixedLine maSelectionFL; + CheckBox maSelectionCB; + MetricField maSelectionMF; + UINT16 nSizeLB_InitialSelection; UINT16 nStyleLB_InitialSelection; BOOL bSfxSymbolsAuto; @@ -140,6 +145,9 @@ private: #if defined( UNX ) DECL_LINK( OnAntialiasingToggled, void* ); #endif + // #i97672# + DECL_LINK( OnSelectionToggled, void* ); + public: OfaViewTabPage( Window* pParent, const SfxItemSet& rSet ); ~OfaViewTabPage(); diff --git a/svx/source/cui/optgdlg.src b/svx/source/cui/optgdlg.src index 7f3ad69680..a711be6bf0 100644 --- a/svx/source/cui/optgdlg.src +++ b/svx/source/cui/optgdlg.src @@ -404,6 +404,38 @@ TabPage OFA_TP_VIEW }; }; + // #i97672# + FixedLine FL_SELECTION + { + Pos = MAP_APPFONT ( 133 , ROW_FL_SELECTION ) ; + Size = MAP_APPFONT ( 120 , 8 ) ; + Text [ en-US ] = "Selection"; + }; + + CheckBox CB_SELECTION + { + Pos = MAP_APPFONT ( 139, ROW_CB_SELECTION + (((12 - RSC_CD_CHECKBOX_HEIGHT) / 2) + 1)) ; + Size = MAP_APPFONT ( 118 - 34 , RSC_CD_CHECKBOX_HEIGHT ) ; + Text [ en-US ] = "Transparency" ; + }; + + MetricField MF_SELECTION + { + Pos = MAP_APPFONT ( 139 + (95 - 12), ROW_CB_SELECTION ) ; + Size = MAP_APPFONT ( 31 , 12 ) ; + Border = TRUE ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 10 ; + Maximum = 90 ; + DecimalDigits = 0 ; + First = 10 ; + Last = 90 ; + SpinSize = 5 ; + Unit = FUNIT_CUSTOM ; + CustomUnitText [ en-US ] = "%" ; + }; }; // ******************************************************************* diff --git a/svx/source/cui/optpath.cxx b/svx/source/cui/optpath.cxx index 54695490fa..ec589678b2 100644 --- a/svx/source/cui/optpath.cxx +++ b/svx/source/cui/optpath.cxx @@ -41,6 +41,7 @@ #include <tools/shl.hxx> #include <vcl/msgbox.hxx> #include <sfx2/filedlghelper.hxx> +#include <sfx2/app.hxx> #include <svtools/pickerhelper.hxx> #include <svtools/aeitem.hxx> #include <svtools/svtabbx.hxx> @@ -52,6 +53,7 @@ #include <unotools/localfilehelper.hxx> #include <svtools/pathoptions.hxx> #include <svtools/moduleoptions.hxx> +#include <svtools/viewoptions.hxx> #define _SVX_OPTPATH_CXX @@ -62,6 +64,7 @@ #include <svx/dialogs.hrc> #include "helpid.hrc" #include <comphelper/processfactory.hxx> +#include <comphelper/configurationhelper.hxx> #include <com/sun/star/uno/Exception.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -91,6 +94,7 @@ using namespace svx; #define POSTFIX_WRITABLE String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_writable" ) ) #define POSTFIX_READONLY String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_readonly" ) ) #define VAR_ONE String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "%1" ) ) +#define IODLG_CONFIGNAME String(DEFINE_CONST_UNICODE("FilePicker_Save")) // struct OptPath_Impl --------------------------------------------------- @@ -536,6 +540,26 @@ void SvxPathTabPage::ChangeCurrentEntry( const String& _rFolder ) pPathImpl = (PathUserData_Impl*)pPathBox->GetEntry(nPos)->GetUserData(); pPathImpl->eState = SFX_ITEM_SET; pPathImpl->sWritablePath = sNewPathStr; + if ( SvtPathOptions::PATH_WORK == pPathImpl->nRealId ) + { + // Remove view options entry so the new work path + // will be used for the next open dialog. + SvtViewOptions aDlgOpt( E_DIALOG, IODLG_CONFIGNAME ); + aDlgOpt.Delete(); + // Reset also last used dir in the sfx application instance + SfxApplication *pSfxApp = SFX_APP(); + pSfxApp->ResetLastDir(); + + // Set configuration flag to notify file picker that it's necessary + // to take over the path provided. + Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); + ::comphelper::ConfigurationHelper::writeDirectKey(xFactory, + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/")), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Path/Info")), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkPathChanged")), + ::com::sun::star::uno::makeAny(true), + ::comphelper::ConfigurationHelper::E_STANDARD); + } } } diff --git a/svx/source/cui/page.cxx b/svx/source/cui/page.cxx index 8e44ebc1fc..2ebbf8bcde 100644 --- a/svx/source/cui/page.cxx +++ b/svx/source/cui/page.cxx @@ -596,18 +596,24 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet ) aBspWin.SetSize( Size( ConvertLong_Impl( aPaperSize.Width(), eUnit ), ConvertLong_Impl( aPaperSize.Height(), eUnit ) ) ); - // Werte in die Edits eintragen - SetMetricValue( aPaperHeightEdit, aPaperSize.Height(), eUnit ); - SetMetricValue( aPaperWidthEdit, aPaperSize.Width(), eUnit ); - aPaperSizeBox.Clear(); + aPaperSize = OutputDevice::LogicToLogic(aPaperSize, (MapUnit)eUnit, MAP_100TH_MM); + if ( bLandscape ) + Swap( aPaperSize ); + + // Actual Paper Format + Paper ePaper = SvxPaperInfo::GetSvxPaper( aPaperSize, MAP_100TH_MM, TRUE ); - // Papierformate - Size aTmpSize = aPaperSize; + if ( PAPER_USER != ePaper ) + aPaperSize = SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM ); if ( bLandscape ) - Swap( aTmpSize ); - // aktuelles Format - Paper ePaper = SvxPaperInfo::GetSvxPaper( aTmpSize, (MapUnit)eUnit, TRUE ); + Swap( aPaperSize ); + + // Werte in die Edits eintragen + SetMetricValue( aPaperHeightEdit, aPaperSize.Height(), SFX_MAPUNIT_100TH_MM ); + SetMetricValue( aPaperWidthEdit, aPaperSize.Width(), SFX_MAPUNIT_100TH_MM ); + aPaperSizeBox.Clear(); + USHORT nActPos = LISTBOX_ENTRY_NOTFOUND; USHORT nAryId = RID_SVXSTRARY_PAPERSIZE_STD; @@ -1044,19 +1050,19 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox ) if ( ePaper != PAPER_USER ) { - Size aSize( SvxPaperInfo::GetPaperSize( ePaper ) ); + Size aSize( SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM ) ); if ( aLandscapeBtn.IsChecked() ) Swap( aSize ); - if ( aSize.Height() < aPaperHeightEdit.GetMin( FUNIT_TWIP ) ) + if ( aSize.Height() < aPaperHeightEdit.GetMin( FUNIT_100TH_MM ) ) aPaperHeightEdit.SetMin( - aPaperHeightEdit.Normalize( aSize.Height() ), FUNIT_TWIP ); - if ( aSize.Width() < aPaperWidthEdit.GetMin( FUNIT_TWIP ) ) + aPaperHeightEdit.Normalize( aSize.Height() ), FUNIT_100TH_MM ); + if ( aSize.Width() < aPaperWidthEdit.GetMin( FUNIT_100TH_MM ) ) aPaperWidthEdit.SetMin( - aPaperWidthEdit.Normalize( aSize.Width() ), FUNIT_TWIP ); - SetMetricValue( aPaperHeightEdit, aSize.Height(), SFX_MAPUNIT_TWIP ); - SetMetricValue( aPaperWidthEdit, aSize.Width(), SFX_MAPUNIT_TWIP ); + aPaperWidthEdit.Normalize( aSize.Width() ), FUNIT_100TH_MM ); + SetMetricValue( aPaperHeightEdit, aSize.Height(), SFX_MAPUNIT_100TH_MM ); + SetMetricValue( aPaperWidthEdit, aSize.Width(), SFX_MAPUNIT_100TH_MM ); // R"ander ggf. neu berechnen CalcMargin_Impl(); @@ -1145,12 +1151,12 @@ IMPL_LINK( SvxPageDescPage, SwapOrientation_Impl, RadioButton *, pBtn ) { bLandscape = aLandscapeBtn.IsChecked(); - const long lWidth = GetCoreValue( aPaperWidthEdit, SFX_MAPUNIT_TWIP ); - const long lHeight = GetCoreValue( aPaperHeightEdit, SFX_MAPUNIT_TWIP ); + const long lWidth = GetCoreValue( aPaperWidthEdit, SFX_MAPUNIT_100TH_MM ); + const long lHeight = GetCoreValue( aPaperHeightEdit, SFX_MAPUNIT_100TH_MM ); // swap with and height - SetMetricValue( aPaperWidthEdit, lHeight, SFX_MAPUNIT_TWIP ); - SetMetricValue( aPaperHeightEdit, lWidth, SFX_MAPUNIT_TWIP ); + SetMetricValue( aPaperWidthEdit, lHeight, SFX_MAPUNIT_100TH_MM ); + SetMetricValue( aPaperHeightEdit, lWidth, SFX_MAPUNIT_100TH_MM ); // recalculate margins if necessary CalcMargin_Impl(); diff --git a/svx/source/cui/page.h b/svx/source/cui/page.h index dcbed63cc0..1df26b13b2 100644 --- a/svx/source/cui/page.h +++ b/svx/source/cui/page.h @@ -60,7 +60,7 @@ #define PAPERSIZE_MONARCH 25 #define PAPERSIZE_COM675 26 #define PAPERSIZE_COM9 27 -#define PAPERSIZE_COM10 29 +#define PAPERSIZE_COM10 28 #define PAPERSIZE_COM11 29 #define PAPERSIZE_COM12 30 #define PAPERSIZE_KAI16 31 @@ -68,7 +68,7 @@ #define PAPERSIZE_KAI32BIG 33 #define PAPERSIZE_B4_JIS 34 #define PAPERSIZE_B5_JIS 35 -#define PAPERSIZE_B6_JIS 38 +#define PAPERSIZE_B6_JIS 36 #endif diff --git a/svx/source/cui/showcols.cxx b/svx/source/cui/showcols.cxx index d226ecade4..af6f4a54ea 100644 --- a/svx/source/cui/showcols.cxx +++ b/svx/source/cui/showcols.cxx @@ -36,19 +36,17 @@ #endif #include "showcols.hxx" -#ifndef _SVX_FMRESIDS_HRC #include "fmresids.hrc" -#endif #include <tools/shl.hxx> #include <svx/dialmgr.hxx> #include <vcl/msgbox.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <comphelper/extract.hxx> #include <comphelper/types.hxx> -#include "fmstatic.hxx" //CHINA001 -IMPLEMENT_CONSTASCII_USTRING(CUIFM_PROP_HIDDEN, "Hidden"); -IMPLEMENT_CONSTASCII_USTRING(CUIFM_PROP_LABEL,"Label"); +#define CUIFM_PROP_HIDDEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Hidden" ) ) +#define CUIFM_PROP_LABEL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" ) ) + //========================================================================== // FmShowColsDialog //========================================================================== diff --git a/svx/source/cui/svuidlg.src b/svx/source/cui/svuidlg.src index 11a0fd9ac8..eeff7e33d0 100644 --- a/svx/source/cui/svuidlg.src +++ b/svx/source/cui/svuidlg.src @@ -156,37 +156,37 @@ ModalDialog MD_UPDATE_BASELINKS }; CancelButton 1 { - Pos = MAP_APPFONT ( 275 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; + Pos = MAP_APPFONT ( 270 , 6 ) ; + Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Close" ; }; HelpButton 1 { - Pos = MAP_APPFONT ( 275 , 26 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; + Pos = MAP_APPFONT ( 270 , 26 ) ; + Size = MAP_APPFONT ( 60 , 14 ) ; }; PushButton PB_UPDATE_NOW { - Pos = MAP_APPFONT ( 275 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; + Pos = MAP_APPFONT ( 270 , 43 ) ; + Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Update" ; }; PushButton PB_OPEN_SOURCE { - Pos = MAP_APPFONT ( 275 , 60 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; + Pos = MAP_APPFONT ( 270 , 60 ) ; + Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Open" ; }; PushButton PB_CHANGE_SOURCE { - Pos = MAP_APPFONT ( 275 , 77 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; + Pos = MAP_APPFONT ( 270 , 77 ) ; + Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Modify..." ; }; PushButton PB_BREAK_LINK { - Pos = MAP_APPFONT ( 275 , 94 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; + Pos = MAP_APPFONT ( 270 , 94 ) ; + Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Break Link" ; }; FixedText FT_FILES2 diff --git a/svx/source/cui/treeopt.cxx b/svx/source/cui/treeopt.cxx index fc2694c71d..d1be63e327 100644 --- a/svx/source/cui/treeopt.cxx +++ b/svx/source/cui/treeopt.cxx @@ -64,6 +64,8 @@ #include <com/sun/star/awt/XContainerWindowEventHandler.hpp> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/awt/XTopWindow.hpp> +#include <com/sun/star/awt/XControl.hpp> +#include <com/sun/star/awt/XTabController.hpp> #include <vcl/help.hxx> #ifndef _LINGUISTIC_MISC_HHX_ #include <linguistic/misc.hxx> @@ -2745,10 +2747,23 @@ void ExtensionsTabPage::CreateDialogWithHandler() if ( !bWithHandler || m_xEventHdl.is() ) { + SetStyle( GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL ); Reference< awt::XWindowPeer > xParent( VCLUnoHelper::GetInterface( this ), UNO_QUERY ); m_xPage = Reference < awt::XWindow >( m_xWinProvider->createContainerWindow( m_sPageURL, rtl::OUString(), xParent, m_xEventHdl ), UNO_QUERY ); + + Reference< awt::XControl > xPageControl( m_xPage, UNO_QUERY ); + if ( xPageControl.is() ) + { + Reference< awt::XWindowPeer > xWinPeer( xPageControl->getPeer() ); + if ( xWinPeer.is() ) + { + Window* pWindow = VCLUnoHelper::GetWindow( xWinPeer ); + if ( pWindow ) + pWindow->SetStyle( pWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL ); + } + } } } catch ( ::com::sun::star::lang::IllegalArgumentException& ) diff --git a/svx/source/cui/zoom.src b/svx/source/cui/zoom.src index dca32260ab..197d1e2f29 100644 --- a/svx/source/cui/zoom.src +++ b/svx/source/cui/zoom.src @@ -37,48 +37,48 @@ ModalDialog RID_SVXDLG_ZOOM HelpId = SID_ATTR_ZOOM ; OutputSize = TRUE ; SvLook = TRUE ; - Size = MAP_APPFONT ( 218 , 112 ) ; + Size = MAP_APPFONT ( 242 , 112 ) ; Moveable = TRUE ; Text [ en-US ] = "Zoom & View Layout"; FixedLine FL_ZOOM { Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; + Size = MAP_APPFONT ( 112 , 8 ) ; Text [ en-US ] = "Zoom factor"; }; RadioButton BTN_OPTIMAL { Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 91 , 10 ) ; + Size = MAP_APPFONT ( 105 , 10 ) ; Text [ en-US ] = "~Optimal" ; }; RadioButton BTN_WHOLE_PAGE { Pos = MAP_APPFONT ( 12 , 27 ) ; - Size = MAP_APPFONT ( 91 , 10 ) ; + Size = MAP_APPFONT ( 105 , 10 ) ; Text [ en-US ] = "~Fit width and height" ; }; RadioButton BTN_PAGE_WIDTH { Pos = MAP_APPFONT ( 12 , 40 ) ; - Size = MAP_APPFONT ( 91 , 10 ) ; + Size = MAP_APPFONT ( 105, 10 ) ; Text [ en-US ] = "Fit ~width" ; }; RadioButton BTN_100 { Pos = MAP_APPFONT ( 12 , 53 ) ; - Size = MAP_APPFONT ( 91 , 10 ) ; + Size = MAP_APPFONT ( 105, 10 ) ; Text = "~100 %" ; }; RadioButton BTN_USER { Pos = MAP_APPFONT ( 12 , 67 ) ; - Size = MAP_APPFONT ( 59 , 10 ) ; + Size = MAP_APPFONT ( 72 , 10 ) ; Text [ en-US ] = "~Variable" ; }; MetricField ED_USER { - Pos = MAP_APPFONT ( 74 , 66 ) ; + Pos = MAP_APPFONT ( 86 , 66 ) ; Size = MAP_APPFONT ( 32 , 12 ) ; Border = TRUE ; Group = TRUE ; @@ -91,31 +91,31 @@ ModalDialog RID_SVXDLG_ZOOM }; FixedLine FL_VIEWLAYOUT { - Pos = MAP_APPFONT ( 112 , 3 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; + Pos = MAP_APPFONT ( 124 , 3 ) ; + Size = MAP_APPFONT ( 112 , 8 ) ; Text [ en-US ] = "View layout"; }; RadioButton BTN_AUTOMATIC { - Pos = MAP_APPFONT ( 118 , 14 ) ; - Size = MAP_APPFONT ( 91 , 10 ) ; + Pos = MAP_APPFONT ( 130 , 14 ) ; + Size = MAP_APPFONT ( 106 , 10 ) ; Text [ en-US ] = "~Automatic" ; }; RadioButton BTN_SINGLE { - Pos = MAP_APPFONT ( 118 , 27 ) ; - Size = MAP_APPFONT ( 91 , 10 ) ; + Pos = MAP_APPFONT ( 130, 27 ) ; + Size = MAP_APPFONT ( 106, 10 ) ; Text [ en-US ] = "~Single page" ; }; RadioButton BTN_COLUMNS { - Pos = MAP_APPFONT ( 118 , 41 ) ; - Size = MAP_APPFONT ( 64 , 10 ) ; + Pos = MAP_APPFONT ( 130, 41 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; Text [ en-US ] = "~Columns" ; }; MetricField ED_COLUMNS { - Pos = MAP_APPFONT ( 185 , 40 ) ; + Pos = MAP_APPFONT ( 209 , 40 ) ; Size = MAP_APPFONT ( 24 , 12 ) ; Border = TRUE ; Group = TRUE ; @@ -128,29 +128,29 @@ ModalDialog RID_SVXDLG_ZOOM }; CheckBox CHK_BOOK { - Pos = MAP_APPFONT ( 124 , 55 ) ; + Pos = MAP_APPFONT ( 136 , 55 ) ; Size = MAP_APPFONT ( 85 , 10 ) ; Text [ en-US ] = "~Book mode" ; }; FixedLine FL_BOTTOM { Pos = MAP_APPFONT ( 6 , 81 ) ; - Size = MAP_APPFONT ( 206 , 8 ) ; + Size = MAP_APPFONT ( 230 , 8 ) ; }; OKButton BTN_ZOOM_OK { - Pos = MAP_APPFONT ( 53 , 92 ) ; + Pos = MAP_APPFONT ( 77 , 92 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; DefButton = TRUE ; }; CancelButton BTN_ZOOM_CANCEL { - Pos = MAP_APPFONT ( 106 , 92 ) ; + Pos = MAP_APPFONT ( 130 , 92 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; }; HelpButton BTN_ZOOM_HELP { - Pos = MAP_APPFONT ( 162 , 92 ) ; + Pos = MAP_APPFONT ( 186 , 92 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; }; }; diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 61b4f60365..1f411f35bb 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -751,30 +751,9 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) : } break; case mso_sptCurvedLeftArrow : - { - if ( ( seqAdjustmentValues.getLength() > 2 ) && ( seqAdjustmentValues[ 2 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE ) ) - { - double fValue; - seqAdjustmentValues[ 2 ].Value >>= fValue; - fValue = 21600 - fValue; - seqAdjustmentValues[ 2 ].Value <<= fValue; - } - nFlags |= DFF_CUSTOMSHAPE_FLIP_H; - } - break; + case mso_sptCurvedRightArrow : case mso_sptCurvedUpArrow : - { - if ( ( seqAdjustmentValues.getLength() > 2 ) && ( seqAdjustmentValues[ 2 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE ) ) - { - double fValue; - seqAdjustmentValues[ 2 ].Value >>= fValue; - fValue = 21600 - fValue; - seqAdjustmentValues[ 2 ].Value <<= fValue; - } - nFlags |= DFF_CUSTOMSHAPE_FLIP_V | DFF_CUSTOMSHAPE_EXCH; - } - break; - case mso_sptCurvedDownArrow : nFlags |= DFF_CUSTOMSHAPE_EXCH; break; + case mso_sptCurvedDownArrow : nColorData = 0x2d000000; break; case mso_sptRibbon2 : nColorData = 0x30dd0000; break; case mso_sptRibbon : nColorData = 0x30dd0000; break; diff --git a/svx/source/customshapes/EnhancedCustomShape2d.hxx b/svx/source/customshapes/EnhancedCustomShape2d.hxx index b1b4ba47d9..134118e3bf 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.hxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.hxx @@ -32,28 +32,19 @@ #define _ENHANCEDCUSTOMSHAPE2D_HXX #include <svx/msdffdef.hxx> -#include <svx/msdffimp.hxx> #include <svx/sdasitm.hxx> #include <com/sun/star/uno/Sequence.h> -#ifndef _com_sun_star_beans_PropertyValues_hpp__ #include <com/sun/star/beans/PropertyValues.hpp> -#endif #include <com/sun/star/awt/Point.hpp> #include <svtools/itemset.hxx> -#ifndef __com_sun_star_drawing_EnhancedCustomShapeParameterPair_hpp__ #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> -#endif #include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp> -#ifndef __COM_SUN_STAR_DRAWING_ENHANCEDCUSTOMSHAPETEXTFRAME_HPP__ #include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp> -#endif #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp> #include <EnhancedCustomShapeFunctionParser.hxx> -#ifndef BOOST_SHARED_PTR_HPP_INCLUDED #include <boost/shared_ptr.hpp> -#endif #include <vector> #define DFF_CUSTOMSHAPE_FLIP_V 1 @@ -84,6 +75,7 @@ class SvxMSDffAdjustmentHandle; // between X_RANGE and Y_RANGE class SdrPathObj; + class EnhancedCustomShape2d : public SfxItemSet { SdrObject* pCustomShapeObj; @@ -164,17 +156,17 @@ class EnhancedCustomShape2d : public SfxItemSet sal_Bool IsFlipHorz() { return bFlipH; }; sal_Int32 GetRotateAngle() { return nRotateAngle; }; - SdrObject* CreateLineGeometry(); - SdrObject* CreateObject( sal_Bool bLineGeometryNeededOnly ); - void ApplyGluePoints( SdrObject* pObj ); - Rectangle GetTextRect() const; + SVX_DLLPUBLIC SdrObject* CreateLineGeometry(); + SVX_DLLPUBLIC SdrObject* CreateObject( sal_Bool bLineGeometryNeededOnly ); + SVX_DLLPUBLIC void ApplyGluePoints( SdrObject* pObj ); + SVX_DLLPUBLIC Rectangle GetTextRect() const; - sal_uInt32 GetHdlCount() const; - sal_Bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const; - sal_Bool SetHandleControllerPosition( const sal_uInt32 nIndex, const com::sun::star::awt::Point& rPosition ); + SVX_DLLPUBLIC sal_uInt32 GetHdlCount() const; + SVX_DLLPUBLIC sal_Bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const; + SVX_DLLPUBLIC sal_Bool SetHandleControllerPosition( const sal_uInt32 nIndex, const com::sun::star::awt::Point& rPosition ); - EnhancedCustomShape2d( SdrObject* pSdrObjCustomShape ); - ~EnhancedCustomShape2d(); + SVX_DLLPUBLIC EnhancedCustomShape2d( SdrObject* pSdrObjCustomShape ); + SVX_DLLPUBLIC ~EnhancedCustomShape2d(); enum EnumFunc { @@ -198,15 +190,15 @@ class EnhancedCustomShape2d : public SfxItemSet double GetEquationValueAsDouble( const sal_Int32 nIndex ) const; sal_Int32 GetAdjustValueAsInteger( const sal_Int32 nIndex, const sal_Int32 nDefault = 0 ) const; - static rtl::OUString GetEquation( const sal_uInt16 nFlags, sal_Int16 nPara1, sal_Int16 nPara2, sal_Int16 nPara3 ); + SVX_DLLPUBLIC static rtl::OUString GetEquation( const sal_uInt16 nFlags, sal_Int16 nPara1, sal_Int16 nPara2, sal_Int16 nPara3 ); static void AppendEnhancedCustomShapeEquationParameter( rtl::OUString& rParameter, const sal_Int16 nPara, const sal_Bool bIsSpecialValue ); static void SetEnhancedCustomShapeEquationParameter( com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter, const sal_Int16 nPara, const sal_Bool bIsSpecialValue ); - static void SetEnhancedCustomShapeParameter( com::sun::star::drawing::EnhancedCustomShapeParameter& + SVX_DLLPUBLIC static void SetEnhancedCustomShapeParameter( com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter, const sal_Int32 nValue ); - static void SetEnhancedCustomShapeHandleParameter( com::sun::star::drawing::EnhancedCustomShapeParameter& + SVX_DLLPUBLIC static void SetEnhancedCustomShapeHandleParameter( com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter, const sal_Int32 nPara, const sal_Bool bIsSpecialValue, sal_Bool bHorz ); static sal_Bool ConvertSequenceToEnhancedCustomShape2dHandle( const com::sun::star::beans::PropertyValues& rHandleProperties, EnhancedCustomShape2d::Handle& rDestinationHandle ); diff --git a/svx/source/customshapes/EnhancedCustomShape3d.hxx b/svx/source/customshapes/EnhancedCustomShape3d.hxx index f7f4acd85a..45d98d9e4c 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.hxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.hxx @@ -31,14 +31,15 @@ #ifndef _ENHANCEDCUSTOMSHAPE3D_HXX #define _ENHANCEDCUSTOMSHAPE3D_HXX -#include <svx/msdffimp.hxx> #include <vector> -//#include <poly3d.hxx> -//#include <goodies/point3d.hxx> #include <com/sun/star/drawing/ProjectionMode.hpp> #include <basegfx/point/b3dpoint.hxx> #include <basegfx/polygon/b3dpolygon.hxx> +#include <tools/gen.hxx> + +class SdrObject; + class EnhancedCustomShape3d { class Transformation2D diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index c39ae74bdd..548c09b295 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -54,10 +54,6 @@ static const SvxMSDffTextRect TextRect[] = { { { 0, 0 }, { 0, 0 } } }; -static const sal_Int32 BoundRect[] = -{ - 0, 0, 21600, 21600 -}; static const mso_CustomShape mso = { (SvxMSDffVertPair*)mso_sptVert, sizeof( mso_sptVert ) / sizeof( SvxMSDffVertPair ), @@ -668,10 +664,6 @@ static const SvxMSDffVertPair mso_sptCanGluePoints[] = { { 44, 6 MSO_I }, { 44, 0 }, { 0, 10800 }, { 44, 21600 }, { 88, 10800 } }; -static const sal_Int32 mso_sptCanBoundRect[] = -{ - 0, 0, 88, 21600 -}; static const SvxMSDffHandle mso_sptCanHandle[] = { { MSDFF_HANDLE_FLAGS_RANGE, @@ -1197,60 +1189,422 @@ static const mso_CustomShape msoBentUpArrow = (SvxMSDffHandle*)mso_sptBentUpArrowHandle, sizeof( mso_sptBentUpArrowHandle ) / sizeof( SvxMSDffHandle ) }; -static const SvxMSDffVertPair mso_sptCurvedArrowVert[] = // adjustment1 : y 10800 - 21600, adjustment2 : y 16424 - 21600 -{ // adjustment3 : x 0 - 21600 - { 21600, 0 }, - { 9675, 0 }, { 0, 10 MSO_I }, { 0, 9 MSO_I }, // ccp - { 0, 11 MSO_I }, - { 0, 14 MSO_I }, { 15 MSO_I, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, // ccp - { 2 MSO_I, 21600 }, { 21600, 7 MSO_I }, { 2 MSO_I, 0 MSO_I }, { 2 MSO_I, 16 MSO_I },// pppp - { 2 MSO_I, 16 MSO_I }, { 80, 8 MSO_I }, { 80, 8 MSO_I }, // ccp - { 80, 8 MSO_I }, { 21600, 5 MSO_I }, { 21600, 0 } // ccp -}; -static const sal_uInt16 mso_sptCurvedArrowSegm[] = -{ - 0x4000, 0x2001, 0x0001, 0x2001, 0x0004, 0x2002, 0x6001, 0x8000 -}; -static const SvxMSDffCalculationData mso_sptCurvedArrowCalc[] = -{ - { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0 - { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, // 1 - { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, // 2 - { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, // 3 - { 0xa000, { DFF_Prop_adjust2Value, 0, DFF_Prop_adjustValue } }, // 4 - { 0xa000, { 0x0404, 0, 0x0403 } }, // 5 - { 0x2001, { 0x0405, 1, 2 } }, // 6 - { 0xa000, { DFF_Prop_adjust2Value, 0, 0x0406 } }, // 7 - { 0x2001, { DFF_Prop_adjust2Value, 1, 2 } }, // 8 - { 0xa000, { 0x0408, 0, 0x0406 } }, // 9 - { 0x2001, { 0x0409, 10000, 22326 } }, // 10 - { 0x6000, { 0x0409, 0x0405, 0 } }, // 11 - { 0xa000, { DFF_Prop_adjust2Value, 0, 0x040b } }, // 12 - { 0x2001, { 0x040c, 10000, 23148 } }, // 13 - { 0x6000, { 0x040d, 0x040b, 0 } }, // 14 - { 0x2001, { DFF_Prop_adjust3Value, 10000, 25467 } }, // 15 - { 0x6000, { DFF_Prop_adjustValue, 0x0403, 0 } } // 16 -}; -static const sal_Int32 mso_sptCurvedArrowDefault[] = -{ - 3, 13000, 19400, 14400 -}; -static const SvxMSDffTextRectangles mso_sptCurvedArrowTextRect[] = // todo + +static const SvxMSDffVertPair mso_sptCurvedDownVert[] = { - { { 0, 0 }, { 21600, 21600 } } + { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 0, 21600 }, { 4 MSO_I, 0 }, + { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 4 MSO_I, 0 }, { 17 MSO_I, 24 MSO_I }, + { 15 MSO_I, 0 }, { 1 MSO_I, 21 MSO_I }, { 17 MSO_I, 24 MSO_I }, { 15 MSO_I, 21600 }, + { 15 MSO_I, 0 }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 0 }, { 13 MSO_I, 2 MSO_I }, + { 14 MSO_I, 2 MSO_I }, { 8 MSO_I, 21600 }, { 12 MSO_I, 2 MSO_I }, + { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 11 MSO_I, 2 MSO_I }, { 17 MSO_I, 24 MSO_I }, + { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 17 MSO_I, 24 MSO_I }, { 4 MSO_I, 0 } +}; +static const sal_uInt16 mso_sptCurvedDownSegm[] = +{ + 0xa508, + 0xa304, + 0x6000, + 0x8000, + 0xa604, + 0x0003, + 0xa308, + 0x6000, + 0x8000 +}; +static const SvxMSDffCalculationData mso_sptCurvedDownCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } }, + { 0x2001, { 0x403, 1, 2 } }, + { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } }, + { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } }, + { 0x2001, { 0x406, 1, 2 } }, + { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjust3Value } }, + { 0xa00f, { 0x409, 21600, 0x404 } }, + { 0x6000, { 0x404, 0x40a, 0 } }, + { 0x6000, { 0x40b, DFF_Prop_adjust2Value, 21600 } }, + { 0x6000, { 0x407, 0x40a, 0 } }, + { 0xa000, { 0x40c, 21600, DFF_Prop_adjustValue } }, + { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x40f, 1, 2 } }, + { 0x6002, { 0x404, 0x407, 0 } }, + { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } }, + { 0x2001, { 0x412, 1, 2 } }, + { 0xa000, { 0x411, 0, 0x413 } }, + { 0x0001, { 21600, 2, 1 } }, + { 0xa000, { 0x411, 0, 0x404 } }, + { 0x600f, { 0x416, 0x404, 21600 } }, + { 0x8000, { 21600, 0, 0x417 } }, + { 0x2000, { 0x408, 128, 0 } }, + { 0x2001, { 0x405, 1, 2 } }, + { 0x2000, { 0x405, 0, 128 } }, + { 0xe000, { DFF_Prop_adjustValue, 0x411, 0x40c } }, + { 0x600f, { 0x414, 0x404, 21600 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x41e, 1, 2 } }, + { 0x0001, { 21600, 21600, 1 } }, + { 0x6001, { 0x409, 0x409, 1 } }, + { 0xa000, { 0x420, 0, 0x421 } }, + { 0x200d, { 0x422, 0, 0 } }, + { 0x2000, { 0x423, 21600, 0 } }, + { 0x8001, { 21600, 21600, 0x424 } }, + { 0x2000, { 0x425, 64, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x600f, { 0x41f, 0x427, 21600 } }, + { 0x8000, { 21600, 0, 0x428 } }, + { 0x2000, { 0x429, 64, 0 } }, + { 0x2001, { 0x404, 1, 2 } }, + { 0xa000, { DFF_Prop_adjust2Value, 0, 0x42b } }, + { 0x0001, { 21600, 2195, 16384 } }, + { 0x0001, { 21600, 14189, 16384 } } }; -static const mso_CustomShape msoCurvedArrow = +static const sal_Int32 mso_sptCurvedDownDefault[] = { - (SvxMSDffVertPair*)mso_sptCurvedArrowVert, sizeof( mso_sptCurvedArrowVert ) / sizeof( SvxMSDffVertPair ), - (sal_uInt16*)mso_sptCurvedArrowSegm, sizeof( mso_sptCurvedArrowSegm ) >> 1, - (SvxMSDffCalculationData*)mso_sptCurvedArrowCalc, sizeof( mso_sptCurvedArrowCalc ) / sizeof( SvxMSDffCalculationData ), - (sal_Int32*)mso_sptCurvedArrowDefault, - (SvxMSDffTextRectangles*)mso_sptCurvedArrowTextRect, sizeof( mso_sptCurvedArrowTextRect ) / sizeof( SvxMSDffTextRectangles ), + 3, 12960, 19440, 14400 +}; +static const SvxMSDffTextRectangles mso_sptCurvedDownTextRect[] = +{ + { { 43 MSO_I, 45 MSO_I }, { 44 MSO_I, 46 MSO_I } } +}; +static const SvxMSDffVertPair mso_sptCurvedDownGluePoints[] = +{ + { 17 MSO_I, 0 }, { 16 MSO_I, 21600 }, { 12 MSO_I, 2 MSO_I }, { 8 MSO_I, 21600 }, { 14 MSO_I, 2 MSO_I } +}; +static const SvxMSDffHandle mso_sptCurvedDownHandles[] = +{ + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL, + 0x100, 21600, 10800, 10800, 3 + 0x26, 3 + 0x1b, 0, 10800 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL, + 0x101, 21600, 10800, 10800, 3 + 0x19, 21600, 0, 10800 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL, + 21600, 0x102, 10800, 10800, 3375, 21600, 3 + 0x2a, 21600 } +}; +static const mso_CustomShape msoCurvedDownArrow = +{ + (SvxMSDffVertPair*)mso_sptCurvedDownVert, sizeof( mso_sptCurvedDownVert ) / sizeof( SvxMSDffVertPair ), + (sal_uInt16*)mso_sptCurvedDownSegm, sizeof( mso_sptCurvedDownSegm ) >> 1, + (SvxMSDffCalculationData*)mso_sptCurvedDownCalc, sizeof( mso_sptCurvedDownCalc ) / sizeof( SvxMSDffCalculationData ), + (sal_Int32*)mso_sptCurvedDownDefault, + (SvxMSDffTextRectangles*)mso_sptCurvedDownTextRect, sizeof( mso_sptCurvedDownTextRect ) / sizeof( SvxMSDffTextRectangles ), 21600, 21600, 0x80000000, 0x80000000, - NULL, 0, - NULL, 0 // handles + (SvxMSDffVertPair*)mso_sptCurvedDownGluePoints, sizeof( mso_sptCurvedDownGluePoints ) / sizeof( SvxMSDffVertPair ), + (SvxMSDffHandle*)mso_sptCurvedDownHandles, sizeof( mso_sptCurvedDownHandles ) / sizeof( SvxMSDffHandle ) +}; + +static const SvxMSDffVertPair mso_sptCurvedUpVert[] = +{ + { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 0, 0 }, { 4 MSO_I, 21 MSO_I }, + { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, { 12 MSO_I, 2 MSO_I }, + { 13 MSO_I, 2 MSO_I }, { 8 MSO_I, 0 }, { 11 MSO_I, 2 MSO_I }, + { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 10 MSO_I, 2 MSO_I }, { 16 MSO_I, 24 MSO_I }, + { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }, { 14 MSO_I, 0 }, + { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I } +}; +static const sal_uInt16 mso_sptCurvedUpSegm[] = +{ + 0xa408, + 0x0003, + 0xa508, + 0x6000, + 0x8000, + 0xa604, + 0xaa00, + 0x8000 +}; +static const SvxMSDffCalculationData mso_sptCurvedUpCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } }, + { 0x2001, { 0x403, 1, 2 } }, + { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } }, + { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } }, + { 0x2001, { 0x406, 1, 2 } }, + { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } }, + { 0xa00f, { DFF_Prop_adjust3Value, 21600, 0x404 } }, + { 0x6000, { 0x404, 0x409, 0 } }, + { 0x6000, { 0x40a, DFF_Prop_adjust2Value, 21600 } }, + { 0x6000, { 0x407, 0x409, 0 } }, + { 0xa000, { 0x40b, 21600, DFF_Prop_adjustValue } }, + { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x40e, 1, 2 } }, + { 0x6002, { 0x404, 0x407, 0 } }, + { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } }, + { 0x2001, { 0x411, 1, 2 } }, + { 0xa000, { 0x410, 0, 0x412 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0000, { 0, 0, 21600 } }, + { 0xa000, { 0x410, 0, 0x404 } }, + { 0x600f, { 0x417, 0x404, 21600 } }, + { 0x2000, { 0x408, 128, 0 } }, + { 0x2001, { 0x405, 1, 2 } }, + { 0x2000, { 0x405, 0, 128 } }, + { 0xe000, { DFF_Prop_adjustValue, 0x410, 0x40b } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x41d, 1, 2 } }, + { 0x0001, { 21600, 21600, 1 } }, + { 0x6001, { DFF_Prop_adjust3Value, DFF_Prop_adjust3Value, 1 } }, + { 0xa000, { 0x41f, 0, 0x420 } }, + { 0x200d, { 0x421, 0, 0 } }, + { 0x2000, { 0x422, 21600, 0 } }, + { 0x8001, { 21600, 21600, 0x423 } }, + { 0x2000, { 0x424, 64, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x600f, { 0x41e, 0x426, 21600 } }, + { 0x2000, { 0x427, 0, 64 } }, + { 0x2001, { 0x404, 1, 2 } }, + { 0xa000, { DFF_Prop_adjust2Value, 0, 0x429 } }, + { 0x0001, { 21600, 2195, 16384 } }, + { 0x0001, { 21600, 14189, 16384 } } +}; +static const sal_Int32 mso_sptCurvedUpDefault[] = +{ + 3, 12960, 19440, 7200 +}; +static const SvxMSDffTextRectangles mso_sptCurvedUpTextRect[] = +{ + { { 41 MSO_I, 43 MSO_I }, { 42 MSO_I, 44 MSO_I } } +}; +static const SvxMSDffVertPair mso_sptCurvedUpGluePoints[] = +{ + { 8 MSO_I, 0 }, { 11 MSO_I, 2 MSO_I }, { 15 MSO_I, 0 }, { 16 MSO_I, 21 MSO_I }, { 13 MSO_I, 2 MSO_I } +}; +static const SvxMSDffHandle mso_sptCurvedUpHandles[] = +{ + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL, + 0x100, 0, 10800, 10800, 3 + 37, 3 + 27, 0, 10800 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL, + 0x101, 0, 10800, 10800, 3 + 25, 3 + 20, 0, 10800 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL, + 21600, 0x102, 10800, 10800, 3375, 21600, 0, 3 + 40 } +}; +static const mso_CustomShape msoCurvedUpArrow = +{ + (SvxMSDffVertPair*)mso_sptCurvedUpVert, sizeof( mso_sptCurvedUpVert ) / sizeof( SvxMSDffVertPair ), + (sal_uInt16*)mso_sptCurvedUpSegm, sizeof( mso_sptCurvedUpSegm ) >> 1, + (SvxMSDffCalculationData*)mso_sptCurvedUpCalc, sizeof( mso_sptCurvedUpCalc ) / sizeof( SvxMSDffCalculationData ), + (sal_Int32*)mso_sptCurvedUpDefault, + (SvxMSDffTextRectangles*)mso_sptCurvedUpTextRect, sizeof( mso_sptCurvedUpTextRect ) / sizeof( SvxMSDffTextRectangles ), + 21600, 21600, + 0x80000000, 0x80000000, + (SvxMSDffVertPair*)mso_sptCurvedUpGluePoints, sizeof( mso_sptCurvedUpGluePoints ) / sizeof( SvxMSDffVertPair ), + (SvxMSDffHandle*)mso_sptCurvedUpHandles, sizeof( mso_sptCurvedUpHandles ) / sizeof( SvxMSDffHandle ) +}; + +static const SvxMSDffVertPair mso_sptCurvedRightVert[] = +{ + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 22 MSO_I, 0 }, { 0, 4 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 0, 7 MSO_I }, { 2 MSO_I, 13 MSO_I }, + { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I }, + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 2 MSO_I, 11 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 22 MSO_I, 15 MSO_I }, + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 0, 4 MSO_I }, { 26 MSO_I, 17 MSO_I } +}; +static const sal_uInt16 mso_sptCurvedRightSegm[] = +{ + 0xa408, + 0x0003, + 0xa508, + 0x6000, + 0x8000, + 0xa404, + 0xaa00, + 0x8000 +}; +static const SvxMSDffCalculationData mso_sptCurvedRightCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } }, + { 0x2001, { 0x403, 1, 2 } }, + { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } }, + { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } }, + { 0x2001, { 0x406, 1, 2 } }, + { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjust3Value } }, + { 0xa00f, { 0x409, 21600, 0x404 } }, + { 0x6000, { 0x404, 0x40a, 0 } }, + { 0x6000, { 0x40b, DFF_Prop_adjust2Value, 21600 } }, + { 0x6000, { 0x407, 0x40a, 0 } }, + { 0xa000, { 0x40c, 21600, DFF_Prop_adjustValue } }, + { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x40f, 1, 2 } }, + { 0x6002, { 0x404, 0x407, 0 } }, + { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } }, + { 0x2001, { 0x412, 1, 2 } }, + { 0xa000, { 0x411, 0, 0x413 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0001, { 21600, 2, 1 } }, + { 0xa000, { 0x411, 0, 0x404 } }, + { 0x600f, { 0x418, 0x404, 21600 } }, + { 0x8000, { 21600, 0, 0x419 } }, + { 0x2000, { 0x408, 128, 0 } }, + { 0x2001, { 0x405, 1, 2 } }, + { 0x2000, { 0x405, 0, 128 } }, + { 0xe000, { DFF_Prop_adjustValue, 0x411, 0x40c } }, + { 0x600f, { 0x414, 0x404, 21600 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x420, 1, 2 } }, + { 0x0001, { 21600, 21600, 1 } }, + { 0x6001, { 0x409, 0x409, 1 } }, + { 0xa000, { 0x422, 0, 0x423 } }, + { 0x200d, { 0x424, 0, 0 } }, + { 0x2000, { 0x425, 21600, 0 } }, + { 0x8001, { 21600, 21600, 0x426 } }, + { 0x2000, { 0x427, 64, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x600f, { 0x421, 0x429, 21600 } }, + { 0x8000, { 21600, 0, 0x42a } }, + { 0x2000, { 0x42b, 64, 0 } }, + { 0x2001, { 0x404, 1, 2 } }, + { 0xa000, { DFF_Prop_adjust2Value, 0, 0x42d } }, + { 0x0001, { 21600, 2195, 16384 } }, + { 0x0001, { 21600, 14189, 16384 } } +}; +static const sal_Int32 mso_sptCurvedRightDefault[] = +{ + 3, 12960, 19440, 14400 +}; +static const SvxMSDffTextRectangles mso_sptCurvedRightTextRect[] = +{ + { { 47 MSO_I, 45 MSO_I }, { 48 MSO_I, 46 MSO_I } } +}; +static const SvxMSDffVertPair mso_sptCurvedRightGluePoints[] = +{ + { 0, 17 MSO_I }, { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I }, { 22 MSO_I, 16 MSO_I } +}; +static const SvxMSDffHandle mso_sptCurvedRightHandles[] = +{ + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL, + 21600, 0x100, 10800, 10800, 0, 10800, 3 + 40, 3 + 29 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL, + 21600, 0x101, 10800, 10800, 0, 10800, 3 + 27, 3 + 21 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL, + 0x102, 21600, 10800, 10800, 3 + 44, 3 + 22, 3375, 21600 } +}; +static const mso_CustomShape msoCurvedRightArrow = +{ + (SvxMSDffVertPair*)mso_sptCurvedRightVert, sizeof( mso_sptCurvedRightVert ) / sizeof( SvxMSDffVertPair ), + (sal_uInt16*)mso_sptCurvedRightSegm, sizeof( mso_sptCurvedRightSegm ) >> 1, + (SvxMSDffCalculationData*)mso_sptCurvedRightCalc, sizeof( mso_sptCurvedRightCalc ) / sizeof( SvxMSDffCalculationData ), + (sal_Int32*)mso_sptCurvedRightDefault, + (SvxMSDffTextRectangles*)mso_sptCurvedRightTextRect, sizeof( mso_sptCurvedRightTextRect ) / sizeof( SvxMSDffTextRectangles ), + 21600, 21600, + 0x80000000, 0x80000000, + (SvxMSDffVertPair*)mso_sptCurvedRightGluePoints, sizeof( mso_sptCurvedRightGluePoints ) / sizeof( SvxMSDffVertPair ), + (SvxMSDffHandle*)mso_sptCurvedRightHandles, sizeof( mso_sptCurvedRightHandles ) / sizeof( SvxMSDffHandle ) +}; + +static const SvxMSDffVertPair mso_sptCurvedLeftVert[] = +{ + { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 0, 0 }, { 21 MSO_I, 4 MSO_I }, { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 2 MSO_I, 12 MSO_I }, + { 2 MSO_I, 13 MSO_I }, { 0, 8 MSO_I }, { 2 MSO_I, 11 MSO_I }, + { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 2 MSO_I, 10 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 0, 14 MSO_I }, + { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 24 MSO_I, 16 MSO_I } +}; +static const sal_uInt16 mso_sptCurvedLeftSegm[] = +{ + 0xa608, + 0x0003, + 0xa308, + 0x6000, + 0x8000, + 0xa404, + 0xaa00, + 0x8000 +}; +static const SvxMSDffCalculationData mso_sptCurvedLeftCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } }, + { 0x2001, { 0x403, 1, 2 } }, + { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } }, + { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } }, + { 0x2001, { 0x406, 1, 2 } }, + { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } }, + { 0xa00f, { DFF_Prop_adjust3Value, 21600, 0x404 } }, + { 0x6000, { 0x404, 0x409, 0 } }, + { 0x6000, { 0x40a, DFF_Prop_adjust2Value, 21600 } }, + { 0x6000, { 0x407, 0x409, 0 } }, + { 0xa000, { 0x40b, 21600, DFF_Prop_adjustValue } }, + { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x40e, 1, 2 } }, + { 0x6002, { 0x404, 0x407, 0 } }, + { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } }, + { 0x2001, { 0x411, 1, 2 } }, + { 0xa000, { 0x410, 0, 0x412 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0000, { 0, 0, 21600 } }, + { 0xa000, { 0x410, 0, 0x404 } }, + { 0x600f, { 0x417, 0x404, 21600 } }, + { 0x2000, { 0x408, 128, 0 } }, + { 0x2001, { 0x405, 1, 2 } }, + { 0x2000, { 0x405, 0, 128 } }, + { 0xe000, { DFF_Prop_adjustValue, 0x410, 0x40b } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x41d, 1, 2 } }, + { 0x0001, { 21600, 21600, 1 } }, + { 0x6001, { DFF_Prop_adjust3Value, DFF_Prop_adjust3Value, 1 } }, + { 0xa000, { 0x41f, 0, 0x420 } }, + { 0x200d, { 0x421, 0, 0 } }, + { 0x2000, { 0x422, 21600, 0 } }, + { 0x8001, { 21600, 21600, 0x423 } }, + { 0x2000, { 0x424, 64, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x600f, { 0x41e, 0x426, 21600 } }, + { 0x2000, { 0x427, 0, 64 } }, + { 0x2001, { 0x404, 1, 2 } }, + { 0xa000, { DFF_Prop_adjust2Value, 0, 0x429 } }, + { 0x0001, { 21600, 2195, 16384 } }, + { 0x0001, { 21600, 14189, 16384 } } +}; +static const sal_Int32 mso_sptCurvedLeftDefault[] = +{ + 3, 12960, 19440, 7200 +}; +static const SvxMSDffTextRectangles mso_sptCurvedLeftTextRect[] = +{ + { { 43 MSO_I, 41 MSO_I }, { 44 MSO_I, 42 MSO_I } } }; +static const SvxMSDffVertPair mso_sptCurvedLeftGluePoints[] = +{ + { 0, 15 MSO_I }, { 2 MSO_I, 11 MSO_I }, { 0, 8 MSO_I }, { 2 MSO_I, 13 MSO_I }, { 21 MSO_I, 16 MSO_I } +}; +static const SvxMSDffHandle mso_sptCurvedLeftHandles[] = +{ + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL, + 0, 0x100, 10800, 10800, 0, 10800, 3 + 37, 3 + 27 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL, + 0, 0x101, 10800, 10800, 0, 10800, 3 + 25, 3 + 20 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL, + 0x102, 21600, 10800, 10800, 0, 3 + 40, 3375, 21600 } +}; +static const mso_CustomShape msoCurvedLeftArrow = +{ + (SvxMSDffVertPair*)mso_sptCurvedLeftVert, sizeof( mso_sptCurvedLeftVert ) / sizeof( SvxMSDffVertPair ), + (sal_uInt16*)mso_sptCurvedLeftSegm, sizeof( mso_sptCurvedLeftSegm ) >> 1, + (SvxMSDffCalculationData*)mso_sptCurvedLeftCalc, sizeof( mso_sptCurvedLeftCalc ) / sizeof( SvxMSDffCalculationData ), + (sal_Int32*)mso_sptCurvedLeftDefault, + (SvxMSDffTextRectangles*)mso_sptCurvedLeftTextRect, sizeof( mso_sptCurvedLeftTextRect ) / sizeof( SvxMSDffTextRectangles ), + 21600, 21600, + 0x80000000, 0x80000000, + (SvxMSDffVertPair*)mso_sptCurvedLeftGluePoints, sizeof( mso_sptCurvedLeftGluePoints ) / sizeof( SvxMSDffVertPair ), + (SvxMSDffHandle*)mso_sptCurvedLeftHandles, sizeof( mso_sptCurvedLeftHandles ) / sizeof( SvxMSDffHandle ) +}; + + + + static const SvxMSDffVertPair mso_sptStripedRightArrowVert[] = // adjustment1 : x 3375 - 21600 { // adjustment2 : y 0 - 10800 @@ -3046,10 +3400,6 @@ static const SvxMSDffVertPair mso_sptHeartGluePoints[] = { { 10800, 2180 }, { 3090, 10800 }, { 10800, 21600 }, { 18490, 10800 } }; -static const sal_Int32 mso_sptHeartBoundRect[] = -{ - -9, 0, 21606, 21602 -}; static const mso_CustomShape msoHeart = { (SvxMSDffVertPair*)mso_sptHeartVert, sizeof( mso_sptHeartVert ) / sizeof( SvxMSDffVertPair ), @@ -7772,10 +8122,10 @@ const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType ) case mso_sptUturnArrow : pCustomShape = &msoUturnArrow; break; case mso_sptLeftUpArrow : pCustomShape = &msoLeftUpArrow; break; case mso_sptBentUpArrow : pCustomShape = &msoBentUpArrow; break; - case mso_sptCurvedRightArrow : pCustomShape = &msoCurvedArrow; break; - case mso_sptCurvedLeftArrow : pCustomShape = &msoCurvedArrow; break; - case mso_sptCurvedUpArrow : pCustomShape = &msoCurvedArrow; break; - case mso_sptCurvedDownArrow : pCustomShape = &msoCurvedArrow; break; + case mso_sptCurvedRightArrow : pCustomShape = &msoCurvedRightArrow; break; + case mso_sptCurvedLeftArrow : pCustomShape = &msoCurvedLeftArrow; break; + case mso_sptCurvedUpArrow : pCustomShape = &msoCurvedUpArrow; break; + case mso_sptCurvedDownArrow : pCustomShape = &msoCurvedDownArrow; break; case mso_sptStripedRightArrow : pCustomShape = &msoStripedRightArrow; break; case mso_sptNotchedRightArrow : pCustomShape = &msoNotchedRightArrow; break; case mso_sptHomePlate : pCustomShape = &msoHomePlate; break; diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx index 30e5bb4e7c..d216c5bb48 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx @@ -93,12 +93,12 @@ struct mso_CustomShape #define MSO_I | (sal_Int32)0x80000000 sal_Bool SortFilledObjectsToBackByDefault( MSO_SPT eSpType ); -sal_Bool IsCustomShapeFilledByDefault( MSO_SPT eSpType ); -sal_Int16 GetCustomShapeConnectionTypeDefault( MSO_SPT eSpType ); +SVX_DLLPUBLIC sal_Bool IsCustomShapeFilledByDefault( MSO_SPT eSpType ); +SVX_DLLPUBLIC sal_Int16 GetCustomShapeConnectionTypeDefault( MSO_SPT eSpType ); // #i28269# -sal_Bool IsCustomShapeStrokedByDefault( MSO_SPT eSpType ); +SVX_DLLPUBLIC sal_Bool IsCustomShapeStrokedByDefault( MSO_SPT eSpType ); -const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType ); +SVX_DLLPUBLIC const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType ); #endif diff --git a/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx b/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx index a42a05b233..a24f11ebf0 100644 --- a/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx +++ b/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx @@ -33,12 +33,10 @@ #include <svx/msdffdef.hxx> #include <rtl/ustring.hxx> -class EnhancedCustomShapeTypeNames +namespace EnhancedCustomShapeTypeNames { - public : - - static MSO_SPT Get( const rtl::OUString& ); - static rtl::OUString Get( const MSO_SPT ); -}; + SVX_DLLPUBLIC MSO_SPT Get( const rtl::OUString& ); + SVX_DLLPUBLIC rtl::OUString Get( const MSO_SPT ); +} #endif diff --git a/svx/source/customshapes/makefile.mk b/svx/source/customshapes/makefile.mk index a81910b830..9940a9bb21 100644 --- a/svx/source/customshapes/makefile.mk +++ b/svx/source/customshapes/makefile.mk @@ -32,6 +32,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=customshapes +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE # --- Settings ---------------------------------- @@ -50,16 +51,23 @@ NOOPTFILES= $(SLO)$/EnhancedCustomShapeFunctionParser.obj # --- Files ------------------------------------- -SLOFILES= $(SLO)$/EnhancedCustomShapeEngine.obj \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/EnhancedCustomShapeTypeNames.obj \ $(SLO)$/EnhancedCustomShapeGeometry.obj \ $(SLO)$/EnhancedCustomShape2d.obj \ + $(SLO)$/EnhancedCustomShapeFunctionParser.obj + +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/EnhancedCustomShapeEngine.obj \ $(SLO)$/EnhancedCustomShape3d.obj \ $(SLO)$/EnhancedCustomShapeFontWork.obj \ $(SLO)$/EnhancedCustomShapeHandle.obj \ - $(SLO)$/EnhancedCustomShapeFunctionParser.obj \ $(SLO)$/tbxcustomshapes.obj +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + # --- Targets ---------------------------------- .INCLUDE : target.mk diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index c330524be6..2d3b9d33b4 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -173,24 +173,22 @@ void SvxRectCtl::InitRectBitmap( void ) pBitmap = new Bitmap( SVX_RES( RID_SVXCTRL_RECTBTNS ) ); // set bitmap-colors - long aTempAry1[(7*sizeof(Color))/sizeof(long)]; - long aTempAry2[(7*sizeof(Color))/sizeof(long)]; - Color* pColorAry1 = (Color*)aTempAry1; - Color* pColorAry2 = (Color*)aTempAry2; - pColorAry1[0] = Color( 0xC0, 0xC0, 0xC0 ); // light-gray - pColorAry1[1] = Color( 0xFF, 0xFF, 0x00 ); // yellow - pColorAry1[2] = Color( 0xFF, 0xFF, 0xFF ); // white - pColorAry1[3] = Color( 0x80, 0x80, 0x80 ); // dark-gray - pColorAry1[4] = Color( 0x00, 0x00, 0x00 ); // black - pColorAry1[5] = Color( 0x00, 0xFF, 0x00 ); // green - pColorAry1[6] = Color( 0x00, 0x00, 0xFF ); // blue - pColorAry2[0] = rStyles.GetDialogColor(); // background - pColorAry2[1] = rStyles.GetWindowColor(); - pColorAry2[2] = rStyles.GetLightColor(); - pColorAry2[3] = rStyles.GetShadowColor(); - pColorAry2[4] = rStyles.GetDarkShadowColor(); - pColorAry2[5] = Color( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor ); - pColorAry2[6] = rStyles.GetDialogColor(); + Color aColorAry1[7]; + Color aColorAry2[7]; + aColorAry1[0] = Color( 0xC0, 0xC0, 0xC0 ); // light-gray + aColorAry1[1] = Color( 0xFF, 0xFF, 0x00 ); // yellow + aColorAry1[2] = Color( 0xFF, 0xFF, 0xFF ); // white + aColorAry1[3] = Color( 0x80, 0x80, 0x80 ); // dark-gray + aColorAry1[4] = Color( 0x00, 0x00, 0x00 ); // black + aColorAry1[5] = Color( 0x00, 0xFF, 0x00 ); // green + aColorAry1[6] = Color( 0x00, 0x00, 0xFF ); // blue + aColorAry2[0] = rStyles.GetDialogColor(); // background + aColorAry2[1] = rStyles.GetWindowColor(); + aColorAry2[2] = rStyles.GetLightColor(); + aColorAry2[3] = rStyles.GetShadowColor(); + aColorAry2[4] = rStyles.GetDarkShadowColor(); + aColorAry2[5] = Color( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor ); + aColorAry2[6] = rStyles.GetDialogColor(); #ifdef DBG_UTIL static BOOL bModify = FALSE; @@ -205,11 +203,11 @@ void SvxRectCtl::InitRectBitmap( void ) UINT8& rr = r; UINT8& rg = g; UINT8& rb = b; - pColorAry2[ rn ] = Color( rr, rg, rb ); + aColorAry2[ rn ] = Color( rr, rg, rb ); } #endif - pBitmap->Replace( pColorAry1, pColorAry2, 7, NULL ); + pBitmap->Replace( aColorAry1, aColorAry2, 7, NULL ); } // ----------------------------------------------------------------------- diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index ff0c706b71..d76dd9a4a2 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -36,6 +36,7 @@ #include <sfx2/printer.hxx> // SfxPrinter #include <vcl/metric.hxx> #include <vcl/svapp.hxx> +#include <unicode/uchar.h> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/i18n/XBreakIterator.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -244,7 +245,25 @@ void FontPrevWin_Impl::_CheckScript() do { nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript ); - aScriptChg.Insert( nChg, nCnt ); + if (nChg < aText.Len() && nChg > 0 && + (com::sun::star::i18n::ScriptType::WEAK == + xBreak->getScriptType(aText, nChg - 1))) + { + int8_t nType = u_charType(aText.GetChar(nChg) ); + if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK || + nType == U_COMBINING_SPACING_MARK ) + { + aScriptChg.Insert( nChg - 1, nCnt ); + } + else + { + aScriptChg.Insert( nChg, nCnt ); + } + } + else + { + aScriptChg.Insert( nChg, nCnt ); + } aScriptType.Insert( nScript, nCnt ); aTextWidth.Insert( ULONG(0), nCnt++ ); @@ -604,6 +623,14 @@ void SvxFontPrevWindow::SetColor(const Color &rColor) pImpl->pColor = new Color( rColor ); Invalidate(); } +// ----------------------------------------------------------------------- + +void SvxFontPrevWindow::ResetColor() +{ + delete pImpl->pColor; + pImpl->pColor = 0; + Invalidate(); +} // ----------------------------------------------------------------------- diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 364087b6e4..1c981b92de 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -716,7 +716,7 @@ void IMapWindow::RequestHelp( const HelpEvent& rHEvt ) if ( Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled() ) { - if ( pView->PickObj( aPos, pSdrObj, pPageView ) ) + if ( pView->PickObj( aPos, pView->getHitTolLog(), pSdrObj, pPageView ) ) { const IMapObject* pIMapObj = GetIMapObj( pSdrObj ); String aStr; diff --git a/svx/source/dialog/makefile.mk b/svx/source/dialog/makefile.mk index 04865246a9..c54081365a 100644 --- a/svx/source/dialog/makefile.mk +++ b/svx/source/dialog/makefile.mk @@ -31,6 +31,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=dialogs +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- @@ -76,9 +77,28 @@ SRC1FILES = \ SRS2NAME=drawdlgs SRC2FILES = \ - sdstring.src \ + sdstring.src -SLOFILES= \ +LIB1TARGET=$(SLB)$/$(TARGET)-core.lib + +LIB1OBJFILES= \ + $(SLO)$/dialmgr.obj\ + $(SLO)$/dlgutil.obj \ + $(SLO)$/framelink.obj\ + $(SLO)$/hangulhanja.obj \ + $(SLO)$/hyphen.obj \ + $(SLO)$/impgrf.obj \ + $(SLO)$/langbox.obj \ + $(SLO)$/opengrf.obj \ + $(SLO)$/simptabl.obj \ + $(SLO)$/splwrap.obj \ + $(SLO)$/svxdlg.obj \ + $(SLO)$/stddlg.obj \ + $(SLO)$/thesdlg.obj + +LIB2TARGET=$(SLB)$/$(TARGET).lib + +LIB2OBJFILES= \ $(SLO)$/charmap.obj \ $(SLO)$/checklbx.obj \ $(SLO)$/connctrl.obj \ @@ -86,31 +106,23 @@ SLOFILES= \ $(SLO)$/ctredlin.obj \ $(SLO)$/databaseregistrationui.obj \ $(SLO)$/dialcontrol.obj \ - $(SLO)$/dialmgr.obj\ $(SLO)$/dlgctl3d.obj \ $(SLO)$/dlgctrl.obj \ - $(SLO)$/dlgutil.obj \ $(SLO)$/docrecovery.obj \ $(SLO)$/fntctrl.obj \ $(SLO)$/fontlb.obj \ $(SLO)$/fontwork.obj \ - $(SLO)$/framelink.obj\ $(SLO)$/framelinkarray.obj \ $(SLO)$/frmdirlbox.obj \ $(SLO)$/frmsel.obj \ $(SLO)$/graphctl.obj \ $(SLO)$/grfflt.obj \ - $(SLO)$/hangulhanja.obj \ $(SLO)$/hdft.obj \ $(SLO)$/hyperdlg.obj \ - $(SLO)$/hyphen.obj \ $(SLO)$/hyprlink.obj \ $(SLO)$/imapdlg.obj \ $(SLO)$/imapwnd.obj \ - $(SLO)$/impgrf.obj \ - $(SLO)$/langbox.obj \ $(SLO)$/measctrl.obj \ - $(SLO)$/opengrf.obj \ $(SLO)$/orienthelper.obj \ $(SLO)$/pagectrl.obj \ $(SLO)$/paraprev.obj \ @@ -122,21 +134,16 @@ SLOFILES= \ $(SLO)$/rlrcitem.obj \ $(SLO)$/rubydialog.obj \ $(SLO)$/rulritem.obj \ - $(SLO)$/simptabl.obj \ $(SLO)$/SpellDialogChildWindow.obj \ - $(SLO)$/splwrap.obj \ $(SLO)$/srchctrl.obj \ $(SLO)$/srchdlg.obj \ - $(SLO)$/stddlg.obj \ $(SLO)$/strarray.obj \ $(SLO)$/svxbmpnumvalueset.obj\ $(SLO)$/svxbox.obj \ - $(SLO)$/svxdlg.obj \ $(SLO)$/svxgrahicitem.obj \ $(SLO)$/svxruler.obj \ $(SLO)$/swframeexample.obj \ $(SLO)$/swframeposstrings.obj \ - $(SLO)$/thesdlg.obj \ $(SLO)$/txencbox.obj \ $(SLO)$/txenctab.obj \ $(SLO)$/wrapfield.obj \ @@ -144,15 +151,17 @@ SLOFILES= \ $(SLO)$/_contdlg.obj .IF "$(GUI)"=="UNX" -SLOFILES += $(SLO)$/sendreportunx.obj +LIB2OBJFILES += $(SLO)$/sendreportunx.obj .ELSE .IF "$(GUI)"=="WNT" -SLOFILES += $(SLO)$/sendreportw32.obj +LIB2OBJFILES += $(SLO)$/sendreportw32.obj .ELSE -SLOFILES += $(SLO)$/sendreportgen.obj +LIB2OBJFILES += $(SLO)$/sendreportgen.obj .ENDIF .ENDIF +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + # --- Targets ------------------------------------------------------- .INCLUDE : target.mk diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index fa49e6e960..670264aae4 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -394,7 +394,7 @@ void SvxJSearchOptionsDialog::SetTransliterationFlags( INT32 nSettings ) aCalcStr ( THIS_SVX_RES( STR_WORDCALC ) ), \ pImpl ( NULL ), \ pSearchList ( NULL ), \ - pReplaceList ( NULL ), \ + pReplaceList ( new SearchAttrItemList ), \ pSearchItem ( NULL ), \ pSearchController ( NULL ), \ pOptionsController ( NULL ), \ diff --git a/svx/source/editeng/editdoc.cxx b/svx/source/editeng/editdoc.cxx index 45493a700f..7160a4197a 100644 --- a/svx/source/editeng/editdoc.cxx +++ b/svx/source/editeng/editdoc.cxx @@ -258,7 +258,7 @@ USHORT aV5Map[] = { 4035, 4036, 4037, 4038 }; -SV_IMPL_PTRARR( ContentList, ContentNode* ); +SV_IMPL_PTRARR( DummyContentList, ContentNode* ); SV_IMPL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo ); SV_IMPL_VARARR( WritingDirectionInfos, WritingDirectionInfo ); // SV_IMPL_VARARR( ExtraCharInfos, ExtraCharInfo ); diff --git a/svx/source/editeng/editdoc.hxx b/svx/source/editeng/editdoc.hxx index 301883042a..90efe213b6 100644 --- a/svx/source/editeng/editdoc.hxx +++ b/svx/source/editeng/editdoc.hxx @@ -285,7 +285,15 @@ public: }; typedef ContentNode* ContentNodePtr; -SV_DECL_PTRARR( ContentList, ContentNodePtr, 0, 4 ) +SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0, 4 ) + +class ContentList : public DummyContentList +{ + USHORT nLastCache; +public: + ContentList() : DummyContentList( 0, 4 ), nLastCache(0) {} + USHORT GetPos( const ContentNodePtr &rPtr ) const; +}; // ------------------------------------------------------------------------- // class EditPaM @@ -612,6 +620,7 @@ SV_DECL_PTRARR( DummyParaPortionList, ParaPortionPtr, 0, 4 ) // ------------------------------------------------------------------------- class ParaPortionList : public DummyParaPortionList { + USHORT nLastCache; public: ParaPortionList(); ~ParaPortionList(); @@ -623,6 +632,8 @@ public: inline ParaPortion* SaveGetObject( USHORT nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; } + USHORT GetPos( const ParaPortionPtr &rPtr ) const; + // temporaer: void DbgCheck( EditDoc& rDoc ); }; diff --git a/svx/source/editeng/editdoc2.cxx b/svx/source/editeng/editdoc2.cxx index c24910a6ca..e0d5fc27e9 100644 --- a/svx/source/editeng/editdoc2.cxx +++ b/svx/source/editeng/editdoc2.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -151,14 +151,14 @@ USHORT TextPortionList::GetStartPos( USHORT nPortion ) // ------------------------------------------------------------------------- ExtraPortionInfo::ExtraPortionInfo() -{ - nOrgWidth = 0; - nWidthFullCompression = 0; +{ + nOrgWidth = 0; + nWidthFullCompression = 0; nMaxCompression100thPercent = 0; - nAsianCompressionTypes = 0; - nPortionOffsetX = 0; - bFirstCharIsRightPunktuation = FALSE; - bCompressed = FALSE; + nAsianCompressionTypes = 0; + nPortionOffsetX = 0; + bFirstCharIsRightPunktuation = FALSE; + bCompressed = FALSE; pOrgDXArray = NULL; } @@ -167,7 +167,7 @@ ExtraPortionInfo::~ExtraPortionInfo() delete[] pOrgDXArray; } -void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, USHORT nLen ) +void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, USHORT nLen ) { delete[] pOrgDXArray; pOrgDXArray = new sal_Int32[nLen]; @@ -324,10 +324,42 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin DBG_ASSERT( aLineList[ aLineList.Count()-1 ]->GetEnd() == pNode->Len(), "CorrectLines: Ende stimmt nicht!" ); } -// ------------------------------------------------------------------------- +// Shared reverse lookup acceleration pieces ... + +static USHORT FastGetPos( const VoidPtr *pPtrArray, USHORT nPtrArrayLen, + VoidPtr pPtr, USHORT &rLastPos ) +{ + // Through certain filter code-paths we do a lot of appends, which in + // turn call GetPos - creating some N^2 nightmares. If we have a + // non-trivially large list, do a few checks from the end first. + if( rLastPos > 16 ) + { + USHORT nEnd; + if (rLastPos > nPtrArrayLen - 2) + nEnd = nPtrArrayLen; + else + nEnd = rLastPos + 2; + + for( USHORT nIdx = rLastPos - 2; nIdx < nEnd; nIdx++ ) + { + if( pPtrArray[ nIdx ] == pPtr ) + { + rLastPos = nIdx; + return nIdx; + } + } + } + // The world's lamest linear search from svarray ... + for( USHORT nIdx = 0; nIdx < nPtrArrayLen; nIdx++ ) + if (pPtrArray[ nIdx ] == pPtr ) + return rLastPos = nIdx; + return USHRT_MAX; +} + +// ------------------------------------------------------------------------- // class ParaPortionList // ------------------------------------------------------------------------- -ParaPortionList::ParaPortionList() +ParaPortionList::ParaPortionList() : nLastCache( 0 ) { } @@ -336,6 +368,20 @@ ParaPortionList::~ParaPortionList() Reset(); } +USHORT ParaPortionList::GetPos( const ParaPortionPtr &rPtr ) const +{ + return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ), + Count(), static_cast<VoidPtr>( rPtr ), + ((ParaPortionList *)this)->nLastCache ); +} + +USHORT ContentList::GetPos( const ContentNodePtr &rPtr ) const +{ + return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ), + Count(), static_cast<VoidPtr>( rPtr ), + ((ContentList *)this)->nLastCache ); +} + void ParaPortionList::Reset() { for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) @@ -369,10 +415,10 @@ USHORT ParaPortionList::FindParagraph( long nYOffset ) return 0xFFFF; // solte mal ueber EE_PARA_NOT_FOUND erreicht werden! } -void ParaPortionList::DbgCheck( EditDoc& +void ParaPortionList::DbgCheck( EditDoc& #ifdef DBG_UTIL rDoc -#endif +#endif ) { #ifdef DBG_UTIL diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx index 05bfdea5bf..80027fff73 100644 --- a/svx/source/editeng/editeng.cxx +++ b/svx/source/editeng/editeng.cxx @@ -86,11 +86,9 @@ #include <vcl/help.hxx> #include <svx/xpoly.hxx> #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> -#ifndef _COM_SUN_STAR_I18N_XINPUTSEQUENCECHECKER_HPP_ #include <com/sun/star/i18n/InputSequenceCheckMode.hpp> -#endif -#include <srchdlg.hxx> +#include <sfx2/srchdefs.hxx> #if OSL_DEBUG_LEVEL > 1 #include <svx/frmdiritem.hxx> @@ -99,18 +97,11 @@ // Spaeter -> TOOLS\STRING.H (fuer Grep: WS_TARGET) -//using namespace ::rtl; -//using namespace ::utl; using namespace ::com::sun::star; -//using namespace ::com::sun::star::util; using namespace ::com::sun::star::uno; -//using namespace ::com::sun::star::lang; -//using namespace ::com::sun::star::beans; -//using namespace ::com::sun::star::frame; using namespace ::com::sun::star::linguistic2; - DBG_NAME( EditEngine ) DBG_NAMEEX( EditView ) @@ -706,14 +697,34 @@ sal_uInt16 EditEngine::GetParagraphCount() const sal_uInt16 EditEngine::GetLineCount( sal_uInt16 nParagraph ) const { DBG_CHKTHIS( EditEngine, 0 ); + if ( !pImpEditEngine->IsFormatted() ) + pImpEditEngine->FormatDoc(); return pImpEditEngine->GetLineCount( nParagraph ); } sal_uInt16 EditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const { DBG_CHKTHIS( EditEngine, 0 ); + if ( !pImpEditEngine->IsFormatted() ) + pImpEditEngine->FormatDoc(); return pImpEditEngine->GetLineLen( nParagraph, nLine ); } + +void EditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const +{ + DBG_CHKTHIS( EditEngine, 0 ); + if ( !pImpEditEngine->IsFormatted() ) + pImpEditEngine->FormatDoc(); + return pImpEditEngine->GetLineBoundaries( rStart, rEnd, nParagraph, nLine ); +} + +USHORT EditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +{ + DBG_CHKTHIS( EditEngine, 0 ); + if ( !pImpEditEngine->IsFormatted() ) + pImpEditEngine->FormatDoc(); + return pImpEditEngine->GetLineNumberAtIndex( nPara, nIndex ); +} sal_uInt32 EditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine ) { diff --git a/svx/source/editeng/editobj.cxx b/svx/source/editeng/editobj.cxx index a9d3bca341..d8f0a332b9 100644 --- a/svx/source/editeng/editobj.cxx +++ b/svx/source/editeng/editobj.cxx @@ -253,6 +253,18 @@ void ContentInfo::DestroyLoadStoreTempInfos() } */ +// #i102062# +bool ContentInfo::isWrongListEqual(const ContentInfo& rCompare) const +{ + if(GetWrongList() == rCompare.GetWrongList()) + return true; + + if(!GetWrongList() || !rCompare.GetWrongList()) + return false; + + return (*GetWrongList() == *rCompare.GetWrongList()); +} + bool ContentInfo::operator==( const ContentInfo& rCompare ) const { if( (aText == rCompare.aText) && @@ -566,6 +578,12 @@ bool EditTextObject::operator==( const EditTextObject& rCompare ) const return static_cast< const BinTextObject* >( this )->operator==( static_cast< const BinTextObject& >( rCompare ) ); } +// #i102062# +bool EditTextObject::isWrongListEqual(const EditTextObject& rCompare) const +{ + return static_cast< const BinTextObject* >(this)->isWrongListEqual(static_cast< const BinTextObject& >(rCompare)); +} + // from SfxItemPoolUser void BinTextObject::ObjectInDestruction(const SfxItemPool& rSfxItemPool) { @@ -599,6 +617,23 @@ void BinTextObject::ObjectInDestruction(const SfxItemPool& rSfxItemPool) } } +EditEngineItemPool* getEditEngineItemPool(SfxItemPool* pPool) +{ + EditEngineItemPool* pRetval = dynamic_cast< EditEngineItemPool* >(pPool); + + while(!pRetval && pPool && pPool->GetSecondaryPool()) + { + pPool = pPool->GetSecondaryPool(); + + if(pPool) + { + pRetval = dynamic_cast< EditEngineItemPool* >(pPool); + } + } + + return pRetval; +} + BinTextObject::BinTextObject( SfxItemPool* pP ) : EditTextObject( EE_FORMAT_BIN ), SfxItemPoolUser() @@ -608,9 +643,17 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) : nUserType = 0; nObjSettings = 0; pPortionInfo = 0; - if ( pP ) + + // #i101239# ensure target is a EditEngineItemPool, else + // fallback to pool ownership. This is needed to ensure that at + // pool destruction time of an alien pool, the pool is still alive. + // When registering would happen at an alien pool which just uses an + // EditEngineItemPool as some sub-pool, that pool could already + // be decoupled and deleted whcih would lead to crashes. + pPool = getEditEngineItemPool(pP); + + if ( pPool ) { - pPool = pP; bOwnerOfPool = FALSE; } else @@ -621,6 +664,7 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) : if(!bOwnerOfPool && pPool) { + // it is sure now that the pool is an EditEngineItemPool pPool->AddSfxItemPoolUser(*this); } @@ -641,9 +685,12 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : nScriptType = r.nScriptType; pPortionInfo = NULL; // PortionInfo nicht kopieren bStoreUnicodeStrings = FALSE; + if ( !r.bOwnerOfPool ) { - // Dann den Pool mitverwenden + // reuse alien pool; this must be a EditEngineItemPool + // since there is no other way to construct a BinTextObject + // than it's regular constructor where that is ensured pPool = r.pPool; bOwnerOfPool = FALSE; } @@ -656,6 +703,7 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : if(!bOwnerOfPool && pPool) { + // it is sure now that the pool is an EditEngineItemPool pPool->AddSfxItemPoolUser(*this); } @@ -1589,6 +1637,28 @@ bool BinTextObject::operator==( const BinTextObject& rCompare ) const return true; } +// #i102062# +bool BinTextObject::isWrongListEqual(const BinTextObject& rCompare) const +{ + if(GetContents().Count() != rCompare.GetContents().Count()) + { + return false; + } + + for(USHORT a(0); a < GetContents().Count(); a++) + { + const ContentInfo& rCandA(*GetContents().GetObject(a)); + const ContentInfo& rCandB(*rCompare.GetContents().GetObject(a)); + + if(!rCandA.isWrongListEqual(rCandB)) + { + return false; + } + } + + return true; +} + #define CHARSETMARKER 0x9999 void __EXPORT BinTextObject::CreateData300( SvStream& rIStream ) diff --git a/svx/source/editeng/editobj2.hxx b/svx/source/editeng/editobj2.hxx index c61a198f47..b37ceabbd7 100644 --- a/svx/source/editeng/editobj2.hxx +++ b/svx/source/editeng/editobj2.hxx @@ -181,13 +181,10 @@ public: WrongList* GetWrongList() const { return pWrongs; } void SetWrongList( WrongList* p ) { pWrongs = p; } - -/* cl removed because not needed anymore since binfilter - LoadStoreTempInfos* GetLoadStoreTempInfos() const { return pTempLoadStoreInfos; } - void CreateLoadStoreTempInfos(); - void DestroyLoadStoreTempInfos(); -*/ bool operator==( const ContentInfo& rCompare ) const; + + // #i102062# + bool isWrongListEqual(const ContentInfo& rCompare) const; }; typedef ContentInfo* ContentInfoPtr; @@ -198,6 +195,7 @@ SV_DECL_PTRARR( ContentInfoList, ContentInfoPtr, 1, 4 ) class BinTextObject : public EditTextObject, public SfxItemPoolUser { using EditTextObject::operator==; + using EditTextObject::isWrongListEqual; private: ContentInfoList aContents; @@ -303,6 +301,9 @@ public: bool operator==( const BinTextObject& rCompare ) const; + // #i102062# + bool isWrongListEqual(const BinTextObject& rCompare) const; + // from SfxItemPoolUser virtual void ObjectInDestruction(const SfxItemPool& rSfxItemPool); }; diff --git a/svx/source/editeng/edtspell.cxx b/svx/source/editeng/edtspell.cxx index cad0602529..2fb92641ef 100644 --- a/svx/source/editeng/edtspell.cxx +++ b/svx/source/editeng/edtspell.cxx @@ -476,6 +476,31 @@ WrongList* WrongList::Clone() const return pNew; } +// #i102062# +bool WrongList::operator==(const WrongList& rCompare) const +{ + // cleck direct members + if(GetInvalidStart() != rCompare.GetInvalidStart() + || GetInvalidEnd() != rCompare.GetInvalidEnd() + || Count() != rCompare.Count()) + { + return false; + } + + for(USHORT a(0); a < Count(); a++) + { + const WrongRange& rCandA(GetObject(a)); + const WrongRange& rCandB(rCompare.GetObject(a)); + + if(rCandA.nStart != rCandB.nStart + || rCandA.nEnd != rCandB.nEnd) + { + return false; + } + } + + return true; +} #ifdef DBG_UTIL sal_Bool WrongList::DbgIsBuggy() const diff --git a/svx/source/editeng/eertfpar.cxx b/svx/source/editeng/eertfpar.cxx index b4e504b829..65c1b6c516 100644 --- a/svx/source/editeng/eertfpar.cxx +++ b/svx/source/editeng/eertfpar.cxx @@ -43,6 +43,19 @@ #include <svtools/rtftoken.h> +// alle Werte auf default; wird nach einlesen der Bitmap aufgerufen ! +void SvxRTFPictureType::ResetValues() +{ // setze alle Werte RTF-Defaults + eStyle = RTF_BITMAP; + nMode = HEX_MODE; + nType = nGoalWidth = nGoalHeight = 0; + nWidth = nHeight = nWidthBytes = 0; + uPicLen = 0; + nBitsPerPixel = nPlanes = 1; + nScalX = nScalY = 100; // Skalierung in Prozent + nCropT = nCropB = nCropL = nCropR = 0; +} + ImportInfo::ImportInfo( ImportState eSt, SvParser* pPrsrs, const ESelection& rSel ) : aSelection( rSel ) { diff --git a/svx/source/editeng/impedit.cxx b/svx/source/editeng/impedit.cxx index 72dd53d026..51dff075be 100644 --- a/svx/source/editeng/impedit.cxx +++ b/svx/source/editeng/impedit.cxx @@ -670,6 +670,8 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US USHORT nTextPortionStart = 0; USHORT nPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); + if (nPara == USHRT_MAX) // #i94322 + return; ParaPortion* pParaPortion = pEditEngine->pImpEditEngine->GetParaPortions().GetObject( nPara ); nShowCursorFlags |= nExtraCursorFlags; diff --git a/svx/source/editeng/impedit.hxx b/svx/source/editeng/impedit.hxx index 9a1f3002f8..adf6afb7c2 100644 --- a/svx/source/editeng/impedit.hxx +++ b/svx/source/editeng/impedit.hxx @@ -812,7 +812,9 @@ public: sal_uInt32 CalcTextWidth( BOOL bIgnoreExtraSpace ); sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, BOOL bIgnoreExtraSpace ); sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const; - sal_uInt16 GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const; + sal_uInt16 GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const; + void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const; + USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const; sal_uInt16 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine ); sal_uInt32 GetParaHeight( sal_uInt16 nParagraph ); diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx index ed4c843d82..6be5fc0ef0 100644 --- a/svx/source/editeng/impedit2.cxx +++ b/svx/source/editeng/impedit2.cxx @@ -1777,7 +1777,7 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara ) ::rtl::OUString aOUText( aText ); USHORT nTextLen = (USHORT)aOUText.getLength(); - long nPos = 0; + sal_Int32 nPos = 0; short nScriptType = _xBI->getScriptType( aOUText, nPos ); rTypes.Insert( ScriptTypePosInfo( nScriptType, (USHORT)nPos, nTextLen ), rTypes.Count() ); nPos = _xBI->endOfScript( aOUText, nPos, nScriptType ); @@ -1795,6 +1795,17 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara ) } else { + if ( _xBI->getScriptType( aOUText, nPos - 1 ) == i18n::ScriptType::WEAK ) + { + switch ( u_charType(aOUText.iterateCodePoints(&nPos, 0) ) ) { + case U_NON_SPACING_MARK: + case U_ENCLOSING_MARK: + case U_COMBINING_SPACING_MARK: + --nPos; + rTypes[rTypes.Count()-1].nEndPos--; + break; + } + } rTypes.Insert( ScriptTypePosInfo( nScriptType, (USHORT)nPos, nTextLen ), rTypes.Count() ); } @@ -3289,9 +3300,9 @@ USHORT ImpEditEngine::GetLineCount( USHORT nParagraph ) const xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const { - DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" ); + DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineLen: Out of range" ); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); - DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineHeight" ); + DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineLen" ); if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) ) { EditLine* pLine = pPPortion->GetLines().GetObject( nLine ); @@ -3302,6 +3313,48 @@ xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const return 0xFFFF; } +void ImpEditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const +{ + DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" ); + ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); + DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineBoundaries" ); + rStart = rEnd = 0xFFFF; // default values in case of error + if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) ) + { + EditLine* pLine = pPPortion->GetLines().GetObject( nLine ); + DBG_ASSERT( pLine, "Zeile nicht gefunden: GetLineBoundaries" ); + rStart = pLine->GetStart(); + rEnd = pLine->GetEnd(); + } +} + +USHORT ImpEditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +{ + USHORT nLineNo = 0xFFFF; + ContentNode* pNode = GetEditDoc().SaveGetObject( nPara ); + DBG_ASSERT( pNode, "GetLineNumberAtIndex: invalid paragraph index" ); + if (pNode) + { + // we explicitly allow for the index to point at the character right behind the text + const bool bValidIndex = /*0 <= nIndex &&*/ nIndex <= pNode->Len(); + DBG_ASSERT( bValidIndex, "GetLineNumberAtIndex: invalid index" ); + const USHORT nLineCount = GetLineCount( nPara ); + if (nIndex == pNode->Len()) + nLineNo = nLineCount > 0 ? nLineCount - 1 : 0; + else if (bValidIndex) // nIndex < pNode->Len() + { + USHORT nStart = USHRT_MAX, nEnd = USHRT_MAX; + for (USHORT i = 0; i < nLineCount && nLineNo == 0xFFFF; ++i) + { + GetLineBoundaries( nStart, nEnd, nPara, i ); + if (nStart <= nIndex && nIndex < nEnd) + nLineNo = i; + } + } + } + return nLineNo; +} + USHORT ImpEditEngine::GetLineHeight( USHORT nParagraph, USHORT nLine ) { DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" ); diff --git a/svx/source/engine3d/helperhittest3d.cxx b/svx/source/engine3d/helperhittest3d.cxx index 634fd8cc7f..401111be85 100644 --- a/svx/source/engine3d/helperhittest3d.cxx +++ b/svx/source/engine3d/helperhittest3d.cxx @@ -92,7 +92,12 @@ namespace drawinglayer basegfx::B3DPoint maBack; // the found cut points - ::std::vector< basegfx::B3DPoint > mo_rResult; + ::std::vector< basegfx::B3DPoint > maResult; + + // #i102956# the transformation change from TransformPrimitive3D processings + // needs to be remembered to be able to transform found cuts to the + // basic coordinate system the processor starts with + basegfx::B3DHomMatrix maCombinedTransform; // as tooling, the process() implementation takes over API handling and calls this // virtual render method when the primitive implementation is BasePrimitive3D-based. @@ -105,11 +110,12 @@ namespace drawinglayer : BaseProcessor3D(rViewInformation), maFront(rFront), maBack(rBack), - mo_rResult() + maResult(), + maCombinedTransform() {} // data access - const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return mo_rResult; } + const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; } }; void CutFindProcessor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate) @@ -119,9 +125,8 @@ namespace drawinglayer { case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D : { - // transform group. Remember current transformations + // transform group. const primitive3d::TransformPrimitive3D& rPrimitive = static_cast< const primitive3d::TransformPrimitive3D& >(rCandidate); - const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D()); // remember old and transform front, back to object coordinates const basegfx::B3DPoint aLastFront(maFront); @@ -131,7 +136,8 @@ namespace drawinglayer maFront *= aInverseTrans; maBack *= aInverseTrans; - // create new transformation; add new object transform from right side + // remember current and create new transformation; add new object transform from right side + const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D()); const geometry::ViewInformation3D aNewViewInformation3D( aLastViewInformation3D.getObjectTransformation() * rPrimitive.getTransformation(), aLastViewInformation3D.getOrientation(), @@ -141,10 +147,15 @@ namespace drawinglayer aLastViewInformation3D.getExtendedInformationSequence()); updateViewInformation(aNewViewInformation3D); + // #i102956# remember needed back-transform for found cuts (combine from right side) + const basegfx::B3DHomMatrix aLastCombinedTransform(maCombinedTransform); + maCombinedTransform = maCombinedTransform * rPrimitive.getTransformation(); + // let break down process(rPrimitive.getChildren()); // restore transformations and front, back + maCombinedTransform = aLastCombinedTransform; updateViewInformation(aLastViewInformation3D); maFront = aLastFront; maBack = aLastBack; @@ -207,7 +218,10 @@ namespace drawinglayer if(basegfx::tools::isInside(rPolyPolygon, aCutPoint, false)) { - mo_rResult.push_back(aCutPoint); + // #i102956# add result. Do not forget to do this in the coordinate + // system the processor get started with, so use the collected + // combined transformation from processed TransformPrimitive3D's + maResult.push_back(maCombinedTransform * aCutPoint); } } } @@ -376,9 +390,9 @@ SVX_DLLPUBLIC void getAllHit3DObjectsSortedFrontToBack( ::std::vector< basegfx::B3DPoint > aHitsWithObject; getAllHit3DObjectWithRelativePoint(aFront, aBack, *pCandidate, aViewInfo3D, aHitsWithObject); - if(aHitsWithObject.size()) + for(sal_uInt32 a(0); a < aHitsWithObject.size(); a++) { - const basegfx::B3DPoint aPointInViewCoordinates(aViewInfo3D.getObjectToView() * aHitsWithObject[0]); + const basegfx::B3DPoint aPointInViewCoordinates(aViewInfo3D.getObjectToView() * aHitsWithObject[a]); aDepthAndObjectResults.push_back(ImplPairDephAndObject(pCandidate, aPointInViewCoordinates.getZ())); } } diff --git a/svx/source/engine3d/makefile.mk b/svx/source/engine3d/makefile.mk index 4c03f949e9..bb590bd76c 100644 --- a/svx/source/engine3d/makefile.mk +++ b/svx/source/engine3d/makefile.mk @@ -33,6 +33,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=engine3d +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- @@ -42,7 +43,8 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- -SLOFILES= \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/e3dsceneupdater.obj \ $(SLO)$/helperminimaldepth3d.obj \ $(SLO)$/helperhittest3d.obj \ @@ -57,16 +59,21 @@ SLOFILES= \ $(SLO)$/svx3ditems.obj \ $(SLO)$/deflt3d.obj \ $(SLO)$/e3dundo.obj \ - $(SLO)$/volume3d.obj \ - $(SLO)$/viewpt3d.obj \ $(SLO)$/viewpt3d2.obj \ $(SLO)$/camera3d.obj \ $(SLO)$/objfac3d.obj \ $(SLO)$/dragmt3d.obj \ $(SLO)$/view3d.obj \ - $(SLO)$/view3d1.obj \ + $(SLO)$/view3d1.obj + +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/volume3d.obj \ + $(SLO)$/viewpt3d.obj \ $(SLO)$/float3d.obj +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + #disable optimizer for MSCompiler and ICC .IF "$(COM)"=="ICC" || "$(COM)"=="MSC" NOOPTFILES=\ diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx index bc26b8f4b4..85c35f03cb 100644 --- a/svx/source/engine3d/obj3d.cxx +++ b/svx/source/engine3d/obj3d.cxx @@ -1206,22 +1206,6 @@ void E3dCompoundObject::operator=(const SdrObject& rObj) /************************************************************************* |* -|* Hittest fuer 3D-Objekte, wird an Geometrie weitergegeben -|* -\************************************************************************/ - -SdrObject* E3dCompoundObject::CheckHit(const Point& rPnt, USHORT /*nTol*/, const SetOfByte* /*pVisiLayer*/) const -{ - if(checkHitSingle3DObject(basegfx::B2DPoint(rPnt.X(), rPnt.Y()), *this)) - { - return const_cast< E3dCompoundObject* >(this); - } - - return 0; -} - -/************************************************************************* -|* |* Parameter Geometrieerzeugung setzen |* \************************************************************************/ diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index d29984c42d..5079f527bc 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -538,6 +538,19 @@ void E3dScene::operator=(const SdrObject& rObj) // #110988# ImpCleanup3DDepthMapper(); + + // #i101941# + // After a Scene as model object is cloned, the used + // ViewContactOfE3dScene is created and partially used + // to calculate Bound/SnapRects, but - since quite some + // values are buffered at the VC - not really well + // initialized. It would be possible to always watch for + // preconditions of buffered data, but this would be expensive + // and would create a lot of short living data structures. + // It is currently better to flush that data, e.g. by using + // ActionChanged at the VC which will for this class + // flush that cached data and initalize it's valid reconstruction + GetViewContact().ActionChanged(); } /************************************************************************* diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx index bfc819f113..04a2b30b40 100644 --- a/svx/source/fmcomp/dbaexchange.cxx +++ b/svx/source/fmcomp/dbaexchange.cxx @@ -61,7 +61,6 @@ namespace svx using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; using namespace ::com::sun::star::datatransfer; - using namespace ::svxform; using namespace ::comphelper; //==================================================================== diff --git a/svx/source/fmcomp/dbaobjectex.cxx b/svx/source/fmcomp/dbaobjectex.cxx index d9e67ac2b2..d30ba00e27 100644 --- a/svx/source/fmcomp/dbaobjectex.cxx +++ b/svx/source/fmcomp/dbaobjectex.cxx @@ -60,7 +60,6 @@ namespace svx using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; using namespace ::com::sun::star::datatransfer; - using namespace ::svxform; using namespace ::comphelper; //==================================================================== diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 0b86ce9921..649a9f4fa1 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1919,9 +1919,9 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V sal_Bool bVoid = !Value.hasValue(); - if ( 0 == PropertyName.compareToAscii( FM_PROP_TEXTLINECOLOR ) ) + if ( 0 == PropertyName.compareTo( FM_PROP_TEXTLINECOLOR ) ) { - ::Color aTextLineColor(::comphelper::getINT32(Value)); + ::Color aTextLineColor( bVoid ? COL_TRANSPARENT : ::comphelper::getINT32( Value ) ); if (bVoid) { pGrid->SetTextLineColor(); @@ -1953,21 +1953,21 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V if (isDesignMode()) pGrid->Invalidate(); } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_FONTEMPHASISMARK ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_FONTEMPHASISMARK ) ) { Font aGridFont = pGrid->GetControlFont(); sal_Int16 nValue = ::comphelper::getINT16(Value); aGridFont.SetEmphasisMark( nValue ); pGrid->SetControlFont( aGridFont ); } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_FONTRELIEF ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_FONTRELIEF ) ) { Font aGridFont = pGrid->GetControlFont(); sal_Int16 nValue = ::comphelper::getINT16(Value); aGridFont.SetRelief( (FontRelief)nValue ); pGrid->SetControlFont( aGridFont ); } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_HELPURL ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_HELPURL ) ) { String sHelpURL(::comphelper::getString(Value)); String sPattern; @@ -1978,11 +1978,11 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V pGrid->SetHelpId(sID.ToInt32()); } } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_DISPLAYSYNCHRON ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_DISPLAYSYNCHRON ) ) { pGrid->setDisplaySynchron(::comphelper::getBOOL(Value)); } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_CURSORCOLOR ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_CURSORCOLOR ) ) { if (bVoid) pGrid->SetCursorColor(COL_TRANSPARENT); @@ -1991,13 +1991,13 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V if (isDesignMode()) pGrid->Invalidate(); } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_ALWAYSSHOWCURSOR ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_ALWAYSSHOWCURSOR ) ) { pGrid->EnablePermanentCursor(::comphelper::getBOOL(Value)); if (isDesignMode()) pGrid->Invalidate(); } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_FONT ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_FONT ) ) { if ( bVoid ) pGrid->SetControlFont( Font() ); @@ -2031,7 +2031,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V } } } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_BACKGROUNDCOLOR ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_BACKGROUNDCOLOR ) ) { if ( bVoid ) { @@ -2044,7 +2044,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V pGrid->SetControlBackground( aColor ); } } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_TEXTCOLOR ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_TEXTCOLOR ) ) { if ( bVoid ) { @@ -2057,7 +2057,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V pGrid->SetControlForeground( aColor ); } } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_ROWHEIGHT ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_ROWHEIGHT ) ) { sal_Int32 nLogHeight(0); if (Value >>= nLogHeight) @@ -2070,17 +2070,17 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V else if (bVoid) pGrid->SetDataRowHeight(0); } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_HASNAVIGATION ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_HASNAVIGATION ) ) { if (Value.getValueType() == ::getBooleanCppuType()) pGrid->EnableNavigationBar(*(sal_Bool*)Value.getValue()); } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_RECORDMARKER ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_RECORDMARKER ) ) { if (Value.getValueType() == ::getBooleanCppuType()) pGrid->EnableHandle(*(sal_Bool*)Value.getValue()); } - else if ( 0 == PropertyName.compareToAscii( FM_PROP_ENABLED ) ) + else if ( 0 == PropertyName.compareTo( FM_PROP_ENABLED ) ) { if (Value.getValueType() == ::getBooleanCppuType()) { @@ -2134,37 +2134,37 @@ Any FmXGridPeer::getProperty( const ::rtl::OUString& _rPropertyName ) throw( Run FmGridControl* pGrid = (FmGridControl*) GetWindow(); Window* pDataWindow = &pGrid->GetDataWindow(); - if ( 0 == _rPropertyName.compareToAscii( FM_PROP_NAME ) ) + if ( 0 == _rPropertyName.compareTo( FM_PROP_NAME ) ) { Font aFont = pDataWindow->GetControlFont(); aProp <<= ImplCreateFontDescriptor( aFont ); } - else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_TEXTCOLOR ) ) + else if ( 0 == _rPropertyName.compareTo( FM_PROP_TEXTCOLOR ) ) { aProp <<= (sal_Int32)pDataWindow->GetControlForeground().GetColor(); } - else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_BACKGROUNDCOLOR ) ) + else if ( 0 == _rPropertyName.compareTo( FM_PROP_BACKGROUNDCOLOR ) ) { aProp <<= (sal_Int32)pDataWindow->GetControlBackground().GetColor(); } - else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_ROWHEIGHT ) ) + else if ( 0 == _rPropertyName.compareTo( FM_PROP_ROWHEIGHT ) ) { sal_Int32 nPixelHeight = pGrid->GetDataRowHeight(); // take the zoom factor into account nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight); aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0,nPixelHeight),MAP_10TH_MM).Y(); } - else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_HASNAVIGATION ) ) + else if ( 0 == _rPropertyName.compareTo( FM_PROP_HASNAVIGATION ) ) { sal_Bool bHasNavBar = pGrid->HasNavigationBar(); aProp <<= (sal_Bool)bHasNavBar; } - else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_RECORDMARKER ) ) + else if ( 0 == _rPropertyName.compareTo( FM_PROP_RECORDMARKER ) ) { sal_Bool bHasHandle = pGrid->HasHandle(); aProp <<= (sal_Bool)bHasHandle; } - else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_ENABLED ) ) + else if ( 0 == _rPropertyName.compareTo( FM_PROP_ENABLED ) ) { aProp <<= (sal_Bool)pDataWindow->IsEnabled(); } @@ -2948,7 +2948,7 @@ IMPL_LINK(FmXGridPeer, OnExecuteGridSlot, void*, pSlot) if (m_pDispatchers[i].is()) { // commit any changes done so far, if it's not the undoRecord URL - if ( 0 == pUrls->Complete.compareToAscii( FMURL_RECORD_UNDO ) || commit() ) + if ( 0 == pUrls->Complete.compareTo( FMURL_RECORD_UNDO ) || commit() ) m_pDispatchers[i]->dispatch(*pUrls, Sequence< PropertyValue>()); return 1; // handled diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index a1e98b9a00..0442a5e1e8 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -55,6 +55,7 @@ #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/awt/LineEndFormat.hpp> +#include <com/sun/star/awt/MouseWheelBehavior.hpp> #ifndef _COM_SUN_STAR_SCRTIP_XEVENTATTACHERMANAGER_HPP_ #include <com/sun/star/script/XEventAttacherManager.hpp> #endif @@ -90,9 +91,9 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::form; -using ::com::sun::star::util::XNumberFormatter; using ::com::sun::star::util::XNumberFormatter; +namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior; String INVALIDTEXT = String::CreateFromAscii("###"); String OBJECTTEXT = String::CreateFromAscii("<OBJECT>"); @@ -650,10 +651,10 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R Reference< XPropertySet > xSourceProps( _rEvent.Source, UNO_QUERY ); - if ( _rEvent.PropertyName.equalsAscii( FM_PROP_VALUE ) - || _rEvent.PropertyName.equalsAscii( FM_PROP_STATE ) - || _rEvent.PropertyName.equalsAscii( FM_PROP_TEXT ) - || _rEvent.PropertyName.equalsAscii( FM_PROP_EFFECTIVE_VALUE ) + if ( _rEvent.PropertyName.equals( FM_PROP_VALUE ) + || _rEvent.PropertyName.equals( FM_PROP_STATE ) + || _rEvent.PropertyName.equals( FM_PROP_TEXT ) + || _rEvent.PropertyName.equals( FM_PROP_EFFECTIVE_VALUE ) ) { // it was one of the known "value" properties if ( !isValuePropertyLocked() ) @@ -661,11 +662,11 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R implValuePropertyChanged( ); } } - else if ( _rEvent.PropertyName.equalsAscii( FM_PROP_READONLY ) ) + else if ( _rEvent.PropertyName.equals( FM_PROP_READONLY ) ) { implAdjustReadOnly( xSourceProps ); } - else if ( _rEvent.PropertyName.equalsAscii( FM_PROP_ENABLED ) ) + else if ( _rEvent.PropertyName.equals( FM_PROP_ENABLED ) ) { implAdjustEnabled( xSourceProps ); } @@ -836,22 +837,40 @@ void DbCellControl::Init( Window& rParent, const Reference< XRowSet >& _rxCursor try { // some other common properties - Reference< XPropertySet > xModel( m_rColumn.getModel() ); - Reference< XPropertySetInfo > xModelPSI; - if ( xModel.is() ) - xModelPSI = xModel->getPropertySetInfo(); + Reference< XPropertySet > xModel( m_rColumn.getModel(), UNO_SET_THROW ); + Reference< XPropertySetInfo > xModelPSI( xModel->getPropertySetInfo(), UNO_SET_THROW ); - // the "readonly" state - if ( xModelPSI.is() && xModelPSI->hasPropertyByName( FM_PROP_READONLY ) ) + if ( xModelPSI->hasPropertyByName( FM_PROP_READONLY ) ) { implAdjustReadOnly( xModel ); } - // the "enabled" flag - if ( xModelPSI.is() && xModelPSI->hasPropertyByName( FM_PROP_ENABLED ) ) + if ( xModelPSI->hasPropertyByName( FM_PROP_ENABLED ) ) { implAdjustEnabled( xModel ); } + + if ( xModelPSI->hasPropertyByName( FM_PROP_MOUSE_WHEEL_BEHAVIOR ) ) + { + sal_Int16 nWheelBehavior = MouseWheelBehavior::SCROLL_FOCUS_ONLY; + OSL_VERIFY( xModel->getPropertyValue( FM_PROP_MOUSE_WHEEL_BEHAVIOR ) >>= nWheelBehavior ); + USHORT nVclSetting = MOUSE_WHEEL_FOCUS_ONLY; + switch ( nWheelBehavior ) + { + case MouseWheelBehavior::SCROLL_DISABLED: nVclSetting = MOUSE_WHEEL_DISABLE; break; + case MouseWheelBehavior::SCROLL_FOCUS_ONLY: nVclSetting = MOUSE_WHEEL_FOCUS_ONLY; break; + case MouseWheelBehavior::SCROLL_ALWAYS: nVclSetting = MOUSE_WHEEL_ALWAYS; break; + default: + OSL_ENSURE( false, "DbCellControl::Init: invalid MouseWheelBehavior!" ); + break; + } + + AllSettings aSettings = m_pWindow->GetSettings(); + MouseSettings aMouseSettings = aSettings.GetMouseSettings(); + aMouseSettings.SetWheelBehavior( nVclSetting ); + aSettings.SetMouseSettings( aMouseSettings ); + m_pWindow->SetSettings( aSettings, TRUE ); + } } catch( const Exception& ) { @@ -2410,7 +2429,7 @@ DbComboBox::DbComboBox(DbGridColumn& _rColumn) //------------------------------------------------------------------------------ void DbComboBox::_propertyChanged( const PropertyChangeEvent& _rEvent ) throw( RuntimeException ) { - if ( _rEvent.PropertyName.equalsAscii( FM_PROP_STRINGITEMLIST ) ) + if ( _rEvent.PropertyName.equals( FM_PROP_STRINGITEMLIST ) ) { SetList(_rEvent.NewValue); } @@ -2539,7 +2558,7 @@ DbListBox::DbListBox(DbGridColumn& _rColumn) //------------------------------------------------------------------------------ void DbListBox::_propertyChanged( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent ) throw( RuntimeException ) { - if ( _rEvent.PropertyName.equalsAscii( FM_PROP_STRINGITEMLIST ) ) + if ( _rEvent.PropertyName.equals( FM_PROP_STRINGITEMLIST ) ) { SetList(_rEvent.NewValue); } diff --git a/svx/source/fmcomp/gridcols.cxx b/svx/source/fmcomp/gridcols.cxx index 2fc232f55b..561be8ab69 100644 --- a/svx/source/fmcomp/gridcols.cxx +++ b/svx/source/fmcomp/gridcols.cxx @@ -36,23 +36,6 @@ #include "fmservs.hxx" #include "fmtools.hxx" -namespace svxform -{ - - IMPLEMENT_CONSTASCII_USTRING(FM_COL_TEXTFIELD, "TextField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COL_COMBOBOX, "ComboBox"); - IMPLEMENT_CONSTASCII_USTRING(FM_COL_CHECKBOX, "CheckBox"); - IMPLEMENT_CONSTASCII_USTRING(FM_COL_TIMEFIELD, "TimeField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COL_DATEFIELD, "DateField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COL_NUMERICFIELD, "NumericField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COL_CURRENCYFIELD, "CurrencyField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COL_PATTERNFIELD, "PatternField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COL_LISTBOX, "ListBox"); - IMPLEMENT_CONSTASCII_USTRING(FM_COL_FORMATTEDFIELD, "FormattedField"); - -} // namespace svxform -using namespace ::svxform; - //------------------------------------------------------------------------------ const ::comphelper::StringSequence& getColumnTypes() { @@ -81,7 +64,7 @@ sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName) const ::rtl::OUString aCompatibleModelPrefix = ::rtl::OUString::createFromAscii("stardiv.one.form.component."); sal_Int32 nTypeId = -1; - if (aModelName == ::svxform::FM_COMPONENT_EDIT) + if (aModelName == FM_COMPONENT_EDIT) nTypeId = TYPE_TEXTFIELD; else { diff --git a/svx/source/fmcomp/makefile.mk b/svx/source/fmcomp/makefile.mk index a2387ef180..1e86308f9c 100644 --- a/svx/source/fmcomp/makefile.mk +++ b/svx/source/fmcomp/makefile.mk @@ -33,6 +33,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=fmcomp +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE @@ -48,25 +49,20 @@ SRC1FILES= \ gridctrl.src \ showcols.src -#SLOFILES= \ -# $(SLO)$/dbaexchange.obj \ -# $(SLO)$/gridcols.obj \ -# $(SLO)$/gridctrl.obj \ -# $(SLO)$/gridcell.obj \ -# $(SLO)$/fmgridcl.obj \ -# $(SLO)$/fmgridif.obj \ -# $(SLO)$/trace.obj - -SLOFILES= \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/dbaexchange.obj \ - $(SLO)$/dbaobjectex.obj \ $(SLO)$/gridcols.obj \ $(SLO)$/gridctrl.obj \ $(SLO)$/gridcell.obj \ $(SLO)$/fmgridcl.obj \ $(SLO)$/fmgridif.obj \ - $(SLO)$/trace.obj \ + $(SLO)$/trace.obj \ $(SLO)$/xmlexchg.obj +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/dbaobjectex.obj + .INCLUDE : target.mk diff --git a/svx/source/form/fmprop.cxx b/svx/source/form/fmprop.cxx deleted file mode 100644 index 63342725ff..0000000000 --- a/svx/source/form/fmprop.cxx +++ /dev/null @@ -1,194 +0,0 @@ -/************************************************************************* - * - * 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: fmprop.cxx,v $ - * $Revision: 1.22 $ - * - * 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_svx.hxx" - -#ifndef _SVX_FMPROP_HRC -#include "fmprop.hrc" -#endif -#include "fmstatic.hxx" - -#include <set> - -namespace svxform -{ - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_NAME,"Name"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CLASSID,"ClassId"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWCOUNT,"RowCount"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWCOUNTFINAL,"IsRowCountFinal"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FETCHSIZE,"FetchSize"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUE,"Value"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXT,"Text"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LABEL,"Label"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANINSERT,"CanInsert"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANUPDATE,"CanUpdate"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANDELETE,"CanDelete"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_NAVIGATION,"NavigationBarMode"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HASNAVIGATION,"HasNavigationBar"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CYCLE,"Cycle"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCE,"DataField"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ENABLED,"Enabled"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_READONLY,"ReadOnly"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISREADONLY,"IsReadOnly"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTER,"Filter"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_AUTOINCREMENT,"IsAutoIncrement"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATAENTRY,"DataEntry"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_WIDTH,"Width"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SEARCHABLE,"IsSearchable"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_MULTILINE,"MultiLine"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TARGET_URL,"TargetURL"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULTCONTROL,"DefaultControl"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_MAXTEXTLEN,"MaxTextLen"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EDITMASK,"EditMask"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SPIN,"Spin"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATE,"Date"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIME,"Time"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STATE,"State"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TRISTATE,"TriState"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STRINGITEMLIST,"StringItemList"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_TEXT,"DefaultText"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULTCHECKED,"DefaultState"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FORMATKEY,"FormatKey"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FORMATSSUPPLIER,"FormatsSupplier"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LISTSOURCETYPE,"ListSourceType"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LISTSOURCE,"ListSource"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECT_SEQ,"SelectedItems"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUE_SEQ,"ValueItemList"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_SELECT_SEQ,"DefaultSelection"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ALIGN,"Align"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_DATE,"DefaultDate"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_TIME,"DefaultTime"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_VALUE,"DefaultValue"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DECIMAL_ACCURACY,"DecimalAccuracy"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORSOURCE,"DataSelection"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORSOURCETYPE,"DataSelectionType"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FIELDTYPE,"Type"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_REFVALUE,"RefValue"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUEMIN,"ValueMin"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUEMAX,"ValueMax"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STRICTFORMAT,"StrictFormat"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LITERALMASK,"LiteralMask"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUESTEP,"ValueStep"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SHOWTHOUSANDSEP,"ShowThousandsSeparator"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURRENCYSYMBOL,"CurrencySymbol"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEFORMAT,"DateFormat"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEMIN,"DateMin"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEMAX,"DateMax"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATE_SHOW_CENTURY,"DateShowCentury"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEFORMAT, "TimeFormat"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEMIN, "TimeMin"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEMAX,"TimeMax"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LINECOUNT,"LineCount"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BOUNDCOLUMN, "BoundColumn"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONT,"FontDescriptor"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BACKGROUNDCOLOR,"BackgroundColor"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXTCOLOR,"TextColor"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BORDER,"Border"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DROPDOWN,"Dropdown"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWHEIGHT,"RowHeight"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HELPTEXT, "HelpText"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HELPURL, "HelpURL"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RECORDMARKER, "HasRecordMarker"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BOUNDFIELD, "BoundField"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_VALUE, "EffectiveValue"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_DEFAULT, "EffectiveDefault"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MIN, "EffectiveMin"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MAX, "EffectiveMax"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HIDDEN, "Hidden"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTERPROPOSAL, "UseFilterValueProposal"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FIELDSOURCE, "FieldSource"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TABLENAME, "TableName"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTERSUPPLIER, "FilterSupplier"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURRENTFILTER, "CurrentFilter"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECTED_FIELDS, "SelectedFields"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECTED_TABLES, "SelectedTables"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_THREADSAFE, "ThreadSafe"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISFILTERAPPLIED, "IsFilterApplied"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLLABEL, "LabelControl"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORCOLOR, "CursorColor"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ALWAYSSHOWCURSOR, "AlwaysShowCursor"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DISPLAYSYNCHRON, "DisplayIsSynchron"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISMODIFIED, "IsModified"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISNEW, "IsNew"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_PRIVILEGES, "Privileges"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_COMMAND,"Command"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_COMMANDTYPE,"CommandType"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RESULTSET_CONCURRENCY, "ResultSetConcurrency"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_INSERTONLY, "IgnoreResult"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RESULTSET_TYPE, "ResultSetType"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ESCAPE_PROCESSING, "EscapeProcessing"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_APPLYFILTER, "ApplyFilter"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISNULLABLE, "IsNullable"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ACTIVECOMMAND, "ActiveCommand"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISCURRENCY, "IsCurrency"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_URL, "URL"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ACTIVE_CONNECTION, "ActiveConnection"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SORT, "Order"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATASOURCE, "DataSourceName"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_REALNAME,"RealName"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCEPROPERTY,"DataFieldProperty"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXTLINECOLOR, "TextLineColor"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONTEMPHASISMARK, "FontEmphasisMark"); - IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONTRELIEF, "FontRelief"); - - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MIN, "ScrollValueMin" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MAX, "ScrollValueMax" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DEFAULT_SCROLLVALUE, "DefaultScrollValue" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_LINEINCREMENT, "LineIncrement" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BLOCKINCREMENT, "BlockIncrement" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_ORIENTATION, "Orientation" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_REPEAT, "Repeat" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_REPEATDELAY, "RepeatDelay" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SYMBOLCOLOR, "SymbolColor" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_VISIBILESIZE, "VisibleSize" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MIN, "SpinValueMin" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MAX, "SpinValueMax" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DEFAULT_SPINVALUE, "DefaultSpinValue" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPININCREMENT, "SpinIncrement" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_LINEENDFORMAT, "LineEndFormat" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_TOGGLE, "Toggle" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_FOCUSONCLICK, "FocusOnClick" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_HIDEINACTIVESELECTION, "HideInactiveSelection" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_VISUALEFFECT, "VisualEffect" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BORDERCOLOR, "BorderColor" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DYNAMIC_CONTROL_BORDER, "DynamicControlBorder" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_FOCUS, "ControlBorderColorOnFocus" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_MOUSE, "ControlBorderColorOnHover" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_INVALID,"ControlBorderColorOnInvalid" ); - - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BUTTON_TYPE, "ButtonType" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_FORM_OPERATIONS, "FormOperations" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_INPUT_REQUIRED, "InputRequired" ); - - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_WRITING_MODE, "WritingMode" ); - -} // namespace svxform - diff --git a/svx/source/form/fmservs.cxx b/svx/source/form/fmservs.cxx index cd62117010..d41886c844 100644 --- a/svx/source/form/fmservs.cxx +++ b/svx/source/form/fmservs.cxx @@ -31,76 +31,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" #include <com/sun/star/container/XSet.hpp> -#include "fmstatic.hxx" #include <cppuhelper/factory.hxx> #include <comphelper/processfactory.hxx> - -namespace svxform -{ - - // ----------------------- - // service names for compatibility - // ----------------------- - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_EDIT,"stardiv.one.form.component.Edit"); // compatibility - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_TEXTFIELD,"stardiv.one.form.component.TextField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_LISTBOX,"stardiv.one.form.component.ListBox"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_COMBOBOX,"stardiv.one.form.component.ComboBox"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_RADIOBUTTON,"stardiv.one.form.component.RadioButton"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_GROUPBOX,"stardiv.one.form.component.GroupBox"); // compatibility - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_FIXEDTEXT,"stardiv.one.form.component.FixedText"); // compatibility - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_COMMANDBUTTON,"stardiv.one.form.component.CommandButton"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_CHECKBOX,"stardiv.one.form.component.CheckBox"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_GRID,"stardiv.one.form.component.Grid"); // compatibility - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_GRIDCONTROL,"stardiv.one.form.component.GridControl"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_IMAGEBUTTON,"stardiv.one.form.component.ImageButton"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_FILECONTROL,"stardiv.one.form.component.FileControl"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_TIMEFIELD,"stardiv.one.form.component.TimeField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_DATEFIELD,"stardiv.one.form.component.DateField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_NUMERICFIELD,"stardiv.one.form.component.NumericField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_CURRENCYFIELD,"stardiv.one.form.component.CurrencyField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_PATTERNFIELD,"stardiv.one.form.component.PatternField"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_HIDDEN,"stardiv.one.form.component.Hidden"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_HIDDENCONTROL,"stardiv.one.form.component.HiddenControl"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_IMAGECONTROL,"stardiv.one.form.component.ImageControl"); - IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_FORMATTEDFIELD,"stardiv.one.form.component.FormattedField"); - - IMPLEMENT_CONSTASCII_USTRING(FM_CONTROL_GRID,"stardiv.one.form.control.Grid"); // compatibility - IMPLEMENT_CONSTASCII_USTRING(FM_CONTROL_GRIDCONTROL,"stardiv.one.form.control.GridControl"); - - // ----------------------- - // new (sun) service names - // ----------------------- - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORM,"com.sun.star.form.component.Form"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_TEXTFIELD,"com.sun.star.form.component.TextField"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_LISTBOX,"com.sun.star.form.component.ListBox"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMBOBOX,"com.sun.star.form.component.ComboBox"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_RADIOBUTTON,"com.sun.star.form.component.RadioButton"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_GROUPBOX,"com.sun.star.form.component.GroupBox"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FIXEDTEXT,"com.sun.star.form.component.FixedText"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMMANDBUTTON,"com.sun.star.form.component.CommandButton"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_CHECKBOX,"com.sun.star.form.component.CheckBox"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_GRIDCONTROL,"com.sun.star.form.component.GridControl"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGEBUTTON,"com.sun.star.form.component.ImageButton"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FILECONTROL,"com.sun.star.form.component.FileControl"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_TIMEFIELD,"com.sun.star.form.component.TimeField"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_DATEFIELD,"com.sun.star.form.component.DateField"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_NUMERICFIELD,"com.sun.star.form.component.NumericField"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_CURRENCYFIELD,"com.sun.star.form.component.CurrencyField"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_PATTERNFIELD,"com.sun.star.form.component.PatternField"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_HIDDENCONTROL,"com.sun.star.form.component.HiddenControl"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGECONTROL,"com.sun.star.form.component.DatabaseImageControl"); - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORMATTEDFIELD,"com.sun.star.form.component.FormattedField"); - IMPLEMENT_CONSTASCII_USTRING( FM_SUN_COMPONENT_SCROLLBAR, "com.sun.star.form.component.ScrollBar" ); - IMPLEMENT_CONSTASCII_USTRING( FM_SUN_COMPONENT_SPINBUTTON, "com.sun.star.form.component.SpinButton" ); - IMPLEMENT_CONSTASCII_USTRING( FM_SUN_COMPONENT_NAVIGATIONBAR,"com.sun.star.form.component.NavigationToolBar" ); - - IMPLEMENT_CONSTASCII_USTRING(FM_SUN_CONTROL_GRIDCONTROL,"com.sun.star.form.control.GridControl"); - - IMPLEMENT_CONSTASCII_USTRING(FM_NUMBER_FORMATTER,"com.sun.star.util.NumberFormatter"); - IMPLEMENT_CONSTASCII_USTRING(FM_FORM_CONTROLLER,"com.sun.star.form.FormController"); - IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_CONNECTION,"com.sun.star.sdb.Connection"); - IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_INTERACTION_HANDLER,"com.sun.star.sdb.InteractionHandler"); -} // namespace svxform +#include "fmservs.hxx" // ------------------------------------------------------------------------ #define DECL_SERVICE(ImplName) \ diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index 8211bc1afd..7555b3d30d 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -94,7 +94,6 @@ namespace svx using namespace ::com::sun::star::util; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; - using namespace ::svxform; //==================================================================== typedef USHORT WhichId; diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx index 652c868c69..9be98fd4b1 100644 --- a/svx/source/form/fmtools.cxx +++ b/svx/source/form/fmtools.cxx @@ -100,7 +100,6 @@ #include <connectivity/dbtools.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> -#include "fmstatic.hxx" #include <comphelper/extract.hxx> #include <comphelper/uno3.hxx> #include <connectivity/dbexception.hxx> @@ -109,14 +108,6 @@ #include <algorithm> #include <rtl/logfile.hxx> -namespace svxform -{ - - IMPLEMENT_CONSTASCII_USTRING(DATA_MODE,"DataMode"); - IMPLEMENT_CONSTASCII_USTRING(FILTER_MODE,"FilterMode"); - -} // namespace svxform - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; using namespace ::com::sun::star::lang; diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index 827fbb1280..bc8b334d55 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -459,7 +459,7 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt) return; // if it's a "default value" property of a control model, set the according "value" property - static const sal_Char* pDefaultValueProperties[] = { + static ::rtl::OUString pDefaultValueProperties[] = { FM_PROP_DEFAULT_TEXT, FM_PROP_DEFAULTCHECKED, FM_PROP_DEFAULT_DATE, FM_PROP_DEFAULT_TIME, FM_PROP_DEFAULT_VALUE, FM_PROP_DEFAULT_SELECT_SEQ, FM_PROP_EFFECTIVE_DEFAULT }; @@ -472,7 +472,7 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt) "FmXUndoEnvironment::propertyChange: inconsistence!"); for (sal_Int32 i=0; i<nDefaultValueProps; ++i) { - if (0 == evt.PropertyName.compareToAscii(pDefaultValueProperties[i])) + if (0 == evt.PropertyName.compareTo(pDefaultValueProperties[i])) { try { diff --git a/svx/source/form/fmurl.cxx b/svx/source/form/fmurl.cxx deleted file mode 100644 index dc81ed7a2d..0000000000 --- a/svx/source/form/fmurl.cxx +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * 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: fmurl.cxx,v $ - * $Revision: 1.7 $ - * - * 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_svx.hxx" -#include "fmurl.hxx" - - -namespace svxform -{ - - IMPLEMENT_CONSTASCII_USTRING(FMURL_FORMSLOTS_PREFIX, ".uno:FormController/"); - - IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_POSITION, ".uno:FormController/positionForm" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_RECORDCOUNT, ".uno:FormController/RecordCount" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVEFIRST, ".uno:FormController/moveToFirst" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVEPREV, ".uno:FormController/moveToPrev" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVENEXT, ".uno:FormController/moveToNext" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVELAST, ".uno:FormController/moveToLast" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVETONEW, ".uno:FormController/moveToNew" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_UNDO, ".uno:FormController/undoRecord" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_SAVE, ".uno:FormController/saveRecord" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_DELETE, ".uno:FormController/deleteRecord" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_REFRESH, ".uno:FormController/refreshForm" ); - IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_REFRESH_CURRENT_CONTROL, - ".uno:FormController/refreshCurrentControl" ); - - IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_SORT_UP, ".uno:FormController/sortUp" ); - IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_SORT_DOWN, ".uno:FormController/sortDown" ); - IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_SORT, ".uno:FormController/sort" ); - IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_AUTO_FILTER, ".uno:FormController/autoFilter" ); - IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_FILTER, ".uno:FormController/filter" ); - IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_APPLY_FILTER, ".uno:FormController/applyFilter" ); - IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_REMOVE_FILTER,".uno:FormController/removeFilterOrder" ); - - IMPLEMENT_CONSTASCII_USTRING(FMURL_CONFIRM_DELETION,".uno:FormSlots/ConfirmDeletion"); - - IMPLEMENT_CONSTASCII_USTRING(FMURL_COMPONENT_FORMGRIDVIEW,".component:DB/FormGridView"); - IMPLEMENT_CONSTASCII_USTRING(FMURL_GRIDVIEW_CLEARVIEW,".uno:FormSlots/ClearView"); - IMPLEMENT_CONSTASCII_USTRING(FMURL_GRIDVIEW_ADDCOLUMN,".uno:FormSlots/AddGridColumn"); - IMPLEMENT_CONSTASCII_USTRING(FMURL_GRIDVIEW_ATTACHTOFORM,".uno:FormSlots/AttachToForm"); - - IMPLEMENT_CONSTASCII_USTRING(FMARG_ATTACHTO_MASTERFORM,"MasterForm"); - IMPLEMENT_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNTYPE,"ColumnType"); - IMPLEMENT_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNPOS,"ColumnPosition"); - -} // namespace svxform diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx index e3f2a48efc..69a2fb308e 100644 --- a/svx/source/form/formcontrolling.cxx +++ b/svx/source/form/formcontrolling.cxx @@ -57,7 +57,6 @@ namespace svx { //........................................................................ - using namespace ::svxform; /** === begin UNO using === **/ using ::com::sun::star::uno::Reference; using ::com::sun::star::lang::XMultiServiceFactory; diff --git a/svx/source/form/makefile.mk b/svx/source/form/makefile.mk index 3d405edc00..b649be94d1 100644 --- a/svx/source/form/makefile.mk +++ b/svx/source/form/makefile.mk @@ -33,6 +33,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=form +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE @@ -53,7 +54,8 @@ SRC1FILES= \ formshell.src \ datanavi.src -SLOFILES = \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/formtoolbars.obj \ $(SLO)$/fmdocumentclassification.obj \ $(SLO)$/fmcontrolbordermanager.obj \ @@ -61,7 +63,6 @@ SLOFILES = \ $(SLO)$/fmtextcontroldialogs.obj \ $(SLO)$/fmtextcontrolfeature.obj \ $(SLO)$/fmtextcontrolshell.obj \ - $(SLO)$/dbcharsethelper.obj \ $(SLO)$/ParseContext.obj \ $(SLO)$/typeconversionclient.obj \ $(SLO)$/confirmdelete.obj \ @@ -69,9 +70,7 @@ SLOFILES = \ $(SLO)$/sqlparserclient.obj \ $(SLO)$/dataaccessdescriptor.obj \ $(SLO)$/fmpage.obj \ - $(SLO)$/fmPropBrw.obj \ $(SLO)$/fmundo.obj \ - $(SLO)$/fmprop.obj \ $(SLO)$/fmmodel.obj \ $(SLO)$/navigatortree.obj \ $(SLO)$/navigatortreemodel.obj \ @@ -81,21 +80,14 @@ SLOFILES = \ $(SLO)$/fmvwimp.obj \ $(SLO)$/fmdpage.obj \ $(SLO)$/fmitems.obj \ - $(SLO)$/tbxform.obj \ $(SLO)$/fmobj.obj \ $(SLO)$/fmdmod.obj \ - $(SLO)$/fmobjfac.obj \ - $(SLO)$/fmsrccfg.obj \ $(SLO)$/fmservs.obj \ $(SLO)$/typemap.obj \ $(SLO)$/fmexch.obj \ - $(SLO)$/tabwin.obj \ - $(SLO)$/fmurl.obj \ - $(SLO)$/filtnav.obj \ $(SLO)$/fmtools.obj \ $(SLO)$/fmshimp.obj \ $(SLO)$/fmshell.obj \ - $(SLO)$/fmsrcimp.obj \ $(SLO)$/fmview.obj \ $(SLO)$/sdbdatacolumn.obj \ $(SLO)$/formcontrolling.obj \ @@ -105,13 +97,22 @@ SLOFILES = \ $(SLO)$/datalistener.obj \ $(SLO)$/fmscriptingenv.obj \ $(SLO)$/stringlistresource.obj \ - $(SLO)$/databaselocationinput.obj \ $(SLO)$/delayedevent.obj \ $(SLO)$/formcontrolfactory.obj -.IF "$(OS)$(CPU)"=="SOLARISI" -NOOPTFILES=$(SLO)$/fmprop.obj -.ENDIF +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/dbcharsethelper.obj \ + $(SLO)$/fmPropBrw.obj \ + $(SLO)$/tbxform.obj \ + $(SLO)$/fmobjfac.obj \ + $(SLO)$/fmsrccfg.obj \ + $(SLO)$/tabwin.obj \ + $(SLO)$/filtnav.obj \ + $(SLO)$/fmsrcimp.obj \ + $(SLO)$/databaselocationinput.obj + +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) # --- Targets ---------------------------------- diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index dc6540fe97..a4b9cc0d39 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -134,7 +134,8 @@ BOOL SgaObject::CreateThumb( const Graphic& rGraphic ) else aSize.Height() = (sal_Int32)( S_THUMB / fFactor ); - aThumbBmp = rGraphic.GetBitmap( &aSize ); + const GraphicConversionParameters aParameters(aSize); + aThumbBmp = rGraphic.GetBitmap(aParameters); if( !aThumbBmp.IsEmpty() ) { diff --git a/svx/source/gengal/makefile.mk b/svx/source/gengal/makefile.mk index 703f730433..ae1f36e5f7 100644 --- a/svx/source/gengal/makefile.mk +++ b/svx/source/gengal/makefile.mk @@ -66,7 +66,7 @@ APP1STDLIBS=$(TOOLSLIB) \ $(SALLIB) \ $(VCLLIB) \ $(UCBHELPERLIB) \ - $(SVXLIB) + $(SVXCORELIB) #.IF "$(COM)"=="GCC" #ADDOPTFILES=$(OBJ)$/gengal.obj diff --git a/svx/source/inc/AccessibleStringWrap.hxx b/svx/source/inc/AccessibleStringWrap.hxx index dba73dbb70..0d4e5c42e9 100644 --- a/svx/source/inc/AccessibleStringWrap.hxx +++ b/svx/source/inc/AccessibleStringWrap.hxx @@ -34,6 +34,8 @@ #include <sal/types.h> #include <tools/string.hxx> +#include <svx/svxdllapi.h> + class OutputDevice; class SvxFont; class Rectangle; @@ -49,10 +51,10 @@ class AccessibleStringWrap { public: - AccessibleStringWrap( OutputDevice& rDev, SvxFont& rFont, const String& rText ); + SVX_DLLPUBLIC AccessibleStringWrap( OutputDevice& rDev, SvxFont& rFont, const String& rText ); - sal_Bool GetCharacterBounds( sal_Int32 nIndex, Rectangle& rRect ); - sal_Int32 GetIndexAtPoint( const Point& rPoint ); + SVX_DLLPUBLIC sal_Bool GetCharacterBounds( sal_Int32 nIndex, Rectangle& rRect ); + SVX_DLLPUBLIC sal_Int32 GetIndexAtPoint( const Point& rPoint ); private: diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx index a61182189f..269db25f47 100644 --- a/svx/source/inc/datanavi.hxx +++ b/svx/source/inc/datanavi.hxx @@ -307,10 +307,10 @@ namespace svxform }; //======================================================================== - class DataNavigatorManager : public SfxChildWindow + class SVX_DLLPUBLIC DataNavigatorManager : public SfxChildWindow { public: - DataNavigatorManager( Window* pParent, sal_uInt16 nId, + SVX_DLLPRIVATE DataNavigatorManager( Window* pParent, sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo ); SFX_DECL_CHILDWINDOW( DataNavigatorManager ); }; diff --git a/svx/source/inc/dbtoolsclient.hxx b/svx/source/inc/dbtoolsclient.hxx index 1e979315ec..262b791e80 100644 --- a/svx/source/inc/dbtoolsclient.hxx +++ b/svx/source/inc/dbtoolsclient.hxx @@ -36,6 +36,7 @@ #include <osl/module.h> #include <tools/solar.h> #include <unotools/sharedunocomponent.hxx> +#include <svx/svxdllapi.h> //........................................................................ namespace svxform @@ -50,7 +51,7 @@ namespace svxform /** base class for classes which want to use dbtools features with load-on-call of the dbtools lib. */ - class ODbtoolsClient + class SVX_DLLPUBLIC ODbtoolsClient { private: static ::osl::Mutex s_aMutex; @@ -82,7 +83,7 @@ namespace svxform //==================================================================== //= OStaticDataAccessTools //==================================================================== - class OStaticDataAccessTools : public ODbtoolsClient + class SVX_DLLPUBLIC OStaticDataAccessTools : public ODbtoolsClient { protected: mutable ::rtl::Reference< ::connectivity::simple::IDataAccessTools > m_xDataAccessTools; @@ -93,7 +94,7 @@ namespace svxform public: OStaticDataAccessTools(); - const ::rtl::Reference< ::connectivity::simple::IDataAccessTools >& getDataAccessTools() const { return m_xDataAccessTools; } + SVX_DLLPRIVATE const ::rtl::Reference< ::connectivity::simple::IDataAccessTools >& getDataAccessTools() const { return m_xDataAccessTools; } // ------------------------------------------------ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> getNumberFormats( @@ -102,13 +103,13 @@ namespace svxform ) const; // ------------------------------------------------ - sal_Int32 getDefaultNumberFormat( + SVX_DLLPRIVATE sal_Int32 getDefaultNumberFormat( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xColumn, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _xTypes, const ::com::sun::star::lang::Locale& _rLocale ); // ------------------------------------------------ - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection_withFeedback( + SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection_withFeedback( const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rUser, const ::rtl::OUString& _rPwd, @@ -130,26 +131,26 @@ namespace svxform const SAL_THROW ( (::com::sun::star::uno::RuntimeException) ); // ------------------------------------------------ - void TransferFormComponentProperties( + SVX_DLLPRIVATE void TransferFormComponentProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxOld, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxNew, const ::com::sun::star::lang::Locale& _rLocale ) const; // ------------------------------------------------ - ::rtl::OUString quoteName( + SVX_DLLPRIVATE ::rtl::OUString quoteName( const ::rtl::OUString& _rQuote, const ::rtl::OUString& _rName ) const; // ------------------------------------------------ - ::rtl::OUString composeTableNameForSelect( + SVX_DLLPRIVATE ::rtl::OUString composeTableNameForSelect( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable ) const; // ------------------------------------------------ - ::com::sun::star::sdb::SQLContext prependContextInfo( + SVX_DLLPRIVATE ::com::sun::star::sdb::SQLContext prependContextInfo( ::com::sun::star::sdbc::SQLException& _rException, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, const ::rtl::OUString& _rContextDescription, @@ -157,7 +158,7 @@ namespace svxform ) const; // ------------------------------------------------ - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource( + SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource( const ::rtl::OUString& _rsRegisteredName, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory ) const; @@ -166,22 +167,22 @@ namespace svxform /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::INSERT @param _rxCursorSet the property set */ - sal_Bool canInsert(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const; + SVX_DLLPRIVATE sal_Bool canInsert(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const; // ------------------------------------------------ /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::UPDATE @param _rxCursorSet the property set */ - sal_Bool canUpdate(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const; + SVX_DLLPRIVATE sal_Bool canUpdate(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const; // ------------------------------------------------ /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::DELETE @param _rxCursorSet the property set */ - sal_Bool canDelete(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const; + SVX_DLLPRIVATE sal_Bool canDelete(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const; // ------------------------------------------------ - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > + SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getFieldsByCommandDescriptor( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const sal_Int32 _nCommandType, @@ -200,13 +201,13 @@ namespace svxform ) SAL_THROW( ( ) ); // ------------------------------------------------ - bool isEmbeddedInDatabase( + SVX_DLLPRIVATE bool isEmbeddedInDatabase( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent, ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxActualConnection ); // ------------------------------------------------ - bool isEmbeddedInDatabase( + SVX_DLLPRIVATE bool isEmbeddedInDatabase( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent ); }; diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx index 13998e3beb..c84d8d5ae5 100644 --- a/svx/source/inc/filtnav.hxx +++ b/svx/source/inc/filtnav.hxx @@ -43,13 +43,8 @@ #include <vcl/image.hxx> #include <svtools/svtreebx.hxx> -#ifndef _DIALOG_HXX //autogen #include <vcl/dialog.hxx> -#endif - -#ifndef _GROUP_HXX //autogen #include <vcl/group.hxx> -#endif #include <vcl/dockwin.hxx> #include "fmtools.hxx" #include "fmexch.hxx" diff --git a/svx/source/inc/fmctrler.hxx b/svx/source/inc/fmctrler.hxx index 6407ca78fd..7c127a2adf 100644 --- a/svx/source/inc/fmctrler.hxx +++ b/svx/source/inc/fmctrler.hxx @@ -273,7 +273,7 @@ public: // XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); - static FmXFormController* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent ); + SVX_DLLPUBLIC static FmXFormController* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent ); // XDispatch virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& _rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs ) throw (::com::sun::star::uno::RuntimeException); @@ -462,7 +462,7 @@ public: --m_nCurrentFilterPosition; } - void setCurrentFilterPosition(sal_Int32 nPos); + SVX_DLLPUBLIC void setCurrentFilterPosition(sal_Int32 nPos); sal_Int32 getCurrentFilterPosition() const {return m_nCurrentFilterPosition;} protected: diff --git a/svx/source/inc/fmexch.hxx b/svx/source/inc/fmexch.hxx index 1f6db8abea..410addcf31 100644 --- a/svx/source/inc/fmexch.hxx +++ b/svx/source/inc/fmexch.hxx @@ -36,6 +36,8 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <tools/link.hxx> +#include <svx/svxdllapi.h> + class FmFormShell; class FmFormPage; class SvLBoxEntry; @@ -63,7 +65,7 @@ namespace svxform //==================================================================== //= OLocalExchange //==================================================================== - class OLocalExchange : public TransferableHelper + class SVX_DLLPUBLIC OLocalExchange : public TransferableHelper { private: Link m_aClipboardListener; @@ -110,7 +112,7 @@ namespace svxform //= OLocalExchangeHelper //==================================================================== /// a helper for navigator windows (SvTreeListBox'es) which allow DnD within themself - class OLocalExchangeHelper + class SVX_DLLPUBLIC OLocalExchangeHelper { protected: Window* m_pDragSource; @@ -130,13 +132,13 @@ namespace svxform inline sal_Bool isDataExchangeActive( ) const { return isDragSource() || isClipboardOwner(); } inline void clear() { if ( isDataExchangeActive() ) m_pTransferable->clear(); } - void setClipboardListener( const Link& _rListener ) { if ( m_pTransferable ) m_pTransferable->setClipboardListener( _rListener ); } + SVX_DLLPRIVATE void setClipboardListener( const Link& _rListener ) { if ( m_pTransferable ) m_pTransferable->setClipboardListener( _rListener ); } protected: - virtual OLocalExchange* createExchange() const = 0; + SVX_DLLPRIVATE virtual OLocalExchange* createExchange() const = 0; protected: - void implReset(); + SVX_DLLPRIVATE void implReset(); }; //==================================================================== diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx index ba49c7b897..bb008a0727 100644 --- a/svx/source/inc/fmexpl.hxx +++ b/svx/source/inc/fmexpl.hxx @@ -595,10 +595,10 @@ namespace svxform }; //======================================================================== - class NavigatorFrameManager : public SfxChildWindow + class SVX_DLLPUBLIC NavigatorFrameManager : public SfxChildWindow { public: - NavigatorFrameManager( Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, + SVX_DLLPRIVATE NavigatorFrameManager( Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo ); SFX_DECL_CHILDWINDOW( NavigatorFrameManager ); }; diff --git a/svx/source/inc/fmobj.hxx b/svx/source/inc/fmobj.hxx index 65ad3778fc..3dd15fc1cd 100644 --- a/svx/source/inc/fmobj.hxx +++ b/svx/source/inc/fmobj.hxx @@ -62,8 +62,8 @@ class FmFormObj: public SdrUnoObj // only to be used for comparison with the current ref device! public: - FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType); - FmFormObj(sal_Int32 _nType); + SVX_DLLPUBLIC FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType); + SVX_DLLPUBLIC FmFormObj(sal_Int32 _nType); TYPEINFO(); diff --git a/svx/source/inc/fmpgeimp.hxx b/svx/source/inc/fmpgeimp.hxx index 070ddf33b5..651232c68c 100644 --- a/svx/source/inc/fmpgeimp.hxx +++ b/svx/source/inc/fmpgeimp.hxx @@ -154,8 +154,7 @@ public: /** returns an object mapping from control models to drawing shapes. */ - ::com::sun::star::uno::Reference< ::com::sun::star::container::XMap > - getControlToShapeMap(); + SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XMap > getControlToShapeMap(); private: /** validates whether <member>xCurrentForm</member> is still valid and to be used diff --git a/svx/source/inc/fmprop.hrc b/svx/source/inc/fmprop.hrc index 833439f52a..a981cc65c4 100644 --- a/svx/source/inc/fmprop.hrc +++ b/svx/source/inc/fmprop.hrc @@ -30,9 +30,6 @@ #ifndef _SVX_FMPROP_HRC #define _SVX_FMPROP_HRC -#ifndef _FM_STATIC_HXX_ -#include "fmstatic.hxx" -#endif // PropertyId's, welche eine Zuordnung zu einen PropertyName haben, das koennten // auch in Zukunft WhichIds sein -> Itemset #define FM_ATTR_START 0 @@ -40,150 +37,145 @@ #define FM_ATTR_FILTER ( FM_ATTR_START + 1 ) #define FM_ATTR_FORM_OPERATIONS ( FM_ATTR_START + 2 ) - -namespace svxform -{ - DECLARE_CONSTASCII_USTRING(FM_PROP_NAME); - DECLARE_CONSTASCII_USTRING(FM_PROP_CLASSID); - DECLARE_CONSTASCII_USTRING(FM_PROP_ALIGN); - DECLARE_CONSTASCII_USTRING(FM_PROP_ROWCOUNT); - DECLARE_CONSTASCII_USTRING(FM_PROP_ROWCOUNTFINAL); - DECLARE_CONSTASCII_USTRING(FM_PROP_FETCHSIZE); - DECLARE_CONSTASCII_USTRING(FM_PROP_VALUE); - DECLARE_CONSTASCII_USTRING(FM_PROP_VALUEMIN); - DECLARE_CONSTASCII_USTRING(FM_PROP_VALUEMAX); - DECLARE_CONSTASCII_USTRING(FM_PROP_VALUESTEP); - DECLARE_CONSTASCII_USTRING(FM_PROP_TEXT); - DECLARE_CONSTASCII_USTRING(FM_PROP_LABEL); - DECLARE_CONSTASCII_USTRING(FM_PROP_NAVIGATION); - DECLARE_CONSTASCII_USTRING(FM_PROP_CYCLE); - DECLARE_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCE); - DECLARE_CONSTASCII_USTRING(FM_PROP_ENABLED); - DECLARE_CONSTASCII_USTRING(FM_PROP_SPIN); - DECLARE_CONSTASCII_USTRING(FM_PROP_READONLY); - DECLARE_CONSTASCII_USTRING(FM_PROP_FILTER); - DECLARE_CONSTASCII_USTRING(FM_PROP_AUTOINCREMENT); - DECLARE_CONSTASCII_USTRING(FM_PROP_WIDTH); - DECLARE_CONSTASCII_USTRING(FM_PROP_SEARCHABLE); - DECLARE_CONSTASCII_USTRING(FM_PROP_MULTILINE); - DECLARE_CONSTASCII_USTRING(FM_PROP_TARGET_URL); - DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULTCONTROL); - DECLARE_CONSTASCII_USTRING(FM_PROP_MAXTEXTLEN); - DECLARE_CONSTASCII_USTRING(FM_PROP_DATE); - DECLARE_CONSTASCII_USTRING(FM_PROP_TIME); - DECLARE_CONSTASCII_USTRING(FM_PROP_STATE); - DECLARE_CONSTASCII_USTRING(FM_PROP_TRISTATE); - DECLARE_CONSTASCII_USTRING(FM_PROP_STRINGITEMLIST); - DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_TEXT); - DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULTCHECKED); - DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_DATE); - DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_TIME); - DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_VALUE); - DECLARE_CONSTASCII_USTRING(FM_PROP_FORMATKEY); - DECLARE_CONSTASCII_USTRING(FM_PROP_FORMATSSUPPLIER); - DECLARE_CONSTASCII_USTRING(FM_PROP_LISTSOURCETYPE); - DECLARE_CONSTASCII_USTRING(FM_PROP_LISTSOURCE); - DECLARE_CONSTASCII_USTRING(FM_PROP_SELECT_SEQ); - DECLARE_CONSTASCII_USTRING(FM_PROP_VALUE_SEQ); - DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_SELECT_SEQ); - DECLARE_CONSTASCII_USTRING(FM_PROP_DECIMAL_ACCURACY); - DECLARE_CONSTASCII_USTRING(FM_PROP_EDITMASK); - DECLARE_CONSTASCII_USTRING(FM_PROP_ISREADONLY); - DECLARE_CONSTASCII_USTRING(FM_PROP_FIELDTYPE); - DECLARE_CONSTASCII_USTRING(FM_PROP_REFVALUE); - DECLARE_CONSTASCII_USTRING(FM_PROP_STRICTFORMAT); - DECLARE_CONSTASCII_USTRING(FM_PROP_DATASOURCE); - DECLARE_CONSTASCII_USTRING(FM_PROP_LITERALMASK); - DECLARE_CONSTASCII_USTRING(FM_PROP_SHOWTHOUSANDSEP); - DECLARE_CONSTASCII_USTRING(FM_PROP_CURRENCYSYMBOL); - DECLARE_CONSTASCII_USTRING(FM_PROP_DATEFORMAT); - DECLARE_CONSTASCII_USTRING(FM_PROP_DATEMIN); - DECLARE_CONSTASCII_USTRING(FM_PROP_DATEMAX); - DECLARE_CONSTASCII_USTRING(FM_PROP_DATE_SHOW_CENTURY); - DECLARE_CONSTASCII_USTRING(FM_PROP_TIMEFORMAT); - DECLARE_CONSTASCII_USTRING(FM_PROP_TIMEMIN); - DECLARE_CONSTASCII_USTRING(FM_PROP_TIMEMAX); - DECLARE_CONSTASCII_USTRING(FM_PROP_LINECOUNT); - DECLARE_CONSTASCII_USTRING(FM_PROP_BOUNDCOLUMN); - DECLARE_CONSTASCII_USTRING(FM_PROP_HASNAVIGATION); - DECLARE_CONSTASCII_USTRING(FM_PROP_FONT); - DECLARE_CONSTASCII_USTRING(FM_PROP_BACKGROUNDCOLOR); - DECLARE_CONSTASCII_USTRING(FM_PROP_TEXTCOLOR); - DECLARE_CONSTASCII_USTRING(FM_PROP_BORDER); - DECLARE_CONSTASCII_USTRING(FM_PROP_DROPDOWN); - DECLARE_CONSTASCII_USTRING(FM_PROP_ROWHEIGHT); - DECLARE_CONSTASCII_USTRING(FM_PROP_HELPTEXT); - DECLARE_CONSTASCII_USTRING(FM_PROP_HELPURL); - DECLARE_CONSTASCII_USTRING(FM_PROP_RECORDMARKER); - DECLARE_CONSTASCII_USTRING(FM_PROP_BOUNDFIELD); - DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_VALUE); - DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_DEFAULT); - DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MIN); - DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MAX); - DECLARE_CONSTASCII_USTRING(FM_PROP_HIDDEN); - DECLARE_CONSTASCII_USTRING(FM_PROP_FILTERPROPOSAL); - DECLARE_CONSTASCII_USTRING(FM_PROP_FIELDSOURCE); - DECLARE_CONSTASCII_USTRING(FM_PROP_TABLENAME); - DECLARE_CONSTASCII_USTRING(FM_PROP_FILTERSUPPLIER); - DECLARE_CONSTASCII_USTRING(FM_PROP_CURRENTFILTER); - DECLARE_CONSTASCII_USTRING(FM_PROP_SELECTED_FIELDS); - DECLARE_CONSTASCII_USTRING(FM_PROP_SELECTED_TABLES); - DECLARE_CONSTASCII_USTRING(FM_PROP_THREADSAFE); - DECLARE_CONSTASCII_USTRING(FM_PROP_CONTROLLABEL); - DECLARE_CONSTASCII_USTRING(FM_PROP_CURSORCOLOR); - DECLARE_CONSTASCII_USTRING(FM_PROP_ALWAYSSHOWCURSOR); - DECLARE_CONSTASCII_USTRING(FM_PROP_DISPLAYSYNCHRON); - DECLARE_CONSTASCII_USTRING(FM_PROP_ISMODIFIED); - DECLARE_CONSTASCII_USTRING(FM_PROP_ISNEW); - DECLARE_CONSTASCII_USTRING(FM_PROP_PRIVILEGES); - DECLARE_CONSTASCII_USTRING(FM_PROP_COMMAND); - DECLARE_CONSTASCII_USTRING(FM_PROP_COMMANDTYPE); - DECLARE_CONSTASCII_USTRING(FM_PROP_RESULTSET_CONCURRENCY); - DECLARE_CONSTASCII_USTRING(FM_PROP_INSERTONLY); - DECLARE_CONSTASCII_USTRING(FM_PROP_RESULTSET_TYPE); - DECLARE_CONSTASCII_USTRING(FM_PROP_ESCAPE_PROCESSING); - DECLARE_CONSTASCII_USTRING(FM_PROP_APPLYFILTER); - DECLARE_CONSTASCII_USTRING(FM_PROP_ISNULLABLE); - DECLARE_CONSTASCII_USTRING(FM_PROP_ACTIVECOMMAND); - DECLARE_CONSTASCII_USTRING(FM_PROP_ISCURRENCY); - DECLARE_CONSTASCII_USTRING(FM_PROP_URL); - DECLARE_CONSTASCII_USTRING(FM_PROP_ACTIVE_CONNECTION); - DECLARE_CONSTASCII_USTRING(FM_PROP_SORT); - DECLARE_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCEPROPERTY); - DECLARE_CONSTASCII_USTRING(FM_PROP_REALNAME); - DECLARE_CONSTASCII_USTRING(FM_PROP_TEXTLINECOLOR); - DECLARE_CONSTASCII_USTRING(FM_PROP_FONTEMPHASISMARK); - DECLARE_CONSTASCII_USTRING(FM_PROP_FONTRELIEF); - DECLARE_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MIN ); - DECLARE_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MAX ); - DECLARE_CONSTASCII_USTRING( FM_PROP_DEFAULT_SCROLLVALUE ); - DECLARE_CONSTASCII_USTRING( FM_PROP_LINEINCREMENT ); - DECLARE_CONSTASCII_USTRING( FM_PROP_BLOCKINCREMENT ); - DECLARE_CONSTASCII_USTRING( FM_PROP_ORIENTATION ); - DECLARE_CONSTASCII_USTRING( FM_PROP_REPEAT ); - DECLARE_CONSTASCII_USTRING( FM_PROP_REPEATDELAY ); - DECLARE_CONSTASCII_USTRING( FM_PROP_SYMBOLCOLOR ); - DECLARE_CONSTASCII_USTRING( FM_PROP_VISIBILESIZE ); - DECLARE_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MIN ); - DECLARE_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MAX ); - DECLARE_CONSTASCII_USTRING( FM_PROP_DEFAULT_SPINVALUE ); - DECLARE_CONSTASCII_USTRING( FM_PROP_SPININCREMENT ); - DECLARE_CONSTASCII_USTRING( FM_PROP_LINEENDFORMAT ); - DECLARE_CONSTASCII_USTRING( FM_PROP_TOGGLE ); - DECLARE_CONSTASCII_USTRING( FM_PROP_FOCUSONCLICK ); - DECLARE_CONSTASCII_USTRING( FM_PROP_HIDEINACTIVESELECTION ); - DECLARE_CONSTASCII_USTRING( FM_PROP_VISUALEFFECT ); - DECLARE_CONSTASCII_USTRING( FM_PROP_BORDERCOLOR ); - DECLARE_CONSTASCII_USTRING( FM_PROP_DYNAMIC_CONTROL_BORDER ); - DECLARE_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_FOCUS ); - DECLARE_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_MOUSE ); - DECLARE_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_INVALID ); - DECLARE_CONSTASCII_USTRING( FM_PROP_BUTTON_TYPE ); - DECLARE_CONSTASCII_USTRING( FM_PROP_FORM_OPERATIONS ); - DECLARE_CONSTASCII_USTRING( FM_PROP_INPUT_REQUIRED ); - DECLARE_CONSTASCII_USTRING( FM_PROP_WRITING_MODE ); - -} // namespace svxform +#define FM_PROP_NAME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) +#define FM_PROP_CLASSID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ClassId" ) ) +#define FM_PROP_ALIGN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Align" ) ) +#define FM_PROP_ROWCOUNT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowCount" ) ) +#define FM_PROP_ROWCOUNTFINAL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsRowCountFinal" ) ) +#define FM_PROP_FETCHSIZE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FetchSize" ) ) +#define FM_PROP_VALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ) ) +#define FM_PROP_VALUEMIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueMin" ) ) +#define FM_PROP_VALUEMAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueMax" ) ) +#define FM_PROP_VALUESTEP rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueStep" ) ) +#define FM_PROP_TEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) ) +#define FM_PROP_LABEL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" ) ) +#define FM_PROP_NAVIGATION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NavigationBarMode" ) ) +#define FM_PROP_CYCLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cycle" ) ) +#define FM_PROP_CONTROLSOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataField" ) ) +#define FM_PROP_ENABLED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) ) +#define FM_PROP_SPIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Spin" ) ) +#define FM_PROP_READONLY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ReadOnly" ) ) +#define FM_PROP_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Filter" ) ) +#define FM_PROP_AUTOINCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutoIncrement" ) ) +#define FM_PROP_WIDTH rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) +#define FM_PROP_SEARCHABLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSearchable" ) ) +#define FM_PROP_MULTILINE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ) +#define FM_PROP_TARGET_URL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" ) ) +#define FM_PROP_DEFAULTCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultControl" ) ) +#define FM_PROP_MAXTEXTLEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) ) +#define FM_PROP_DATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Date" ) ) +#define FM_PROP_TIME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Time" ) ) +#define FM_PROP_STATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "State" ) ) +#define FM_PROP_TRISTATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TriState" ) ) +#define FM_PROP_STRINGITEMLIST rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StringItemList" ) ) +#define FM_PROP_DEFAULT_TEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultText" ) ) +#define FM_PROP_DEFAULTCHECKED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultState" ) ) +#define FM_PROP_DEFAULT_DATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultDate" ) ) +#define FM_PROP_DEFAULT_TIME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultTime" ) ) +#define FM_PROP_DEFAULT_VALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultValue" ) ) +#define FM_PROP_FORMATKEY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormatKey" ) ) +#define FM_PROP_FORMATSSUPPLIER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormatsSupplier" ) ) +#define FM_PROP_LISTSOURCETYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListSourceType" ) ) +#define FM_PROP_LISTSOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListSource" ) ) +#define FM_PROP_SELECT_SEQ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) ) +#define FM_PROP_VALUE_SEQ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueItemList" ) ) +#define FM_PROP_DEFAULT_SELECT_SEQ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultSelection" ) ) +#define FM_PROP_DECIMAL_ACCURACY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DecimalAccuracy" ) ) +#define FM_PROP_EDITMASK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EditMask" ) ) +#define FM_PROP_ISREADONLY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ) +#define FM_PROP_FIELDTYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) +#define FM_PROP_REFVALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RefValue" ) ) +#define FM_PROP_STRICTFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictFormat" ) ) +#define FM_PROP_DATASOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataSourceName" ) ) +#define FM_PROP_LITERALMASK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LiteralMask" ) ) +#define FM_PROP_SHOWTHOUSANDSEP rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShowThousandsSeparator" ) ) +#define FM_PROP_CURRENCYSYMBOL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CurrencySymbol" ) ) +#define FM_PROP_DATEFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateFormat" ) ) +#define FM_PROP_DATEMIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateMin" ) ) +#define FM_PROP_DATEMAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateMax" ) ) +#define FM_PROP_DATE_SHOW_CENTURY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateShowCentury" ) ) +#define FM_PROP_TIMEFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeFormat" ) ) +#define FM_PROP_TIMEMIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeMin" ) ) +#define FM_PROP_TIMEMAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeMax" ) ) +#define FM_PROP_LINECOUNT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineCount" ) ) +#define FM_PROP_BOUNDCOLUMN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BoundColumn" ) ) +#define FM_PROP_HASNAVIGATION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasNavigationBar" ) ) +#define FM_PROP_FONT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontDescriptor" ) ) +#define FM_PROP_BACKGROUNDCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BackgroundColor" ) ) +#define FM_PROP_TEXTCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextColor" ) ) +#define FM_PROP_BORDER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Border" ) ) +#define FM_PROP_DROPDOWN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Dropdown" ) ) +#define FM_PROP_ROWHEIGHT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeight" ) ) +#define FM_PROP_HELPTEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) ) +#define FM_PROP_HELPURL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) ) +#define FM_PROP_RECORDMARKER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasRecordMarker" ) ) +#define FM_PROP_BOUNDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BoundField" ) ) +#define FM_PROP_EFFECTIVE_VALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveValue" ) ) +#define FM_PROP_EFFECTIVE_DEFAULT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveDefault" ) ) +#define FM_PROP_EFFECTIVE_MIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveMin" ) ) +#define FM_PROP_EFFECTIVE_MAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveMax" ) ) +#define FM_PROP_HIDDEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Hidden" ) ) +#define FM_PROP_FILTERPROPOSAL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseFilterValueProposal" ) ) +#define FM_PROP_FIELDSOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FieldSource" ) ) +#define FM_PROP_TABLENAME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TableName" ) ) +#define FM_PROP_FILTERSUPPLIER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterSupplier" ) ) +#define FM_PROP_CURRENTFILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CurrentFilter" ) ) +#define FM_PROP_SELECTED_FIELDS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedFields" ) ) +#define FM_PROP_SELECTED_TABLES rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedTables" ) ) +#define FM_PROP_THREADSAFE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ThreadSafe" ) ) +#define FM_PROP_CONTROLLABEL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LabelControl" ) ) +#define FM_PROP_CURSORCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CursorColor" ) ) +#define FM_PROP_ALWAYSSHOWCURSOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AlwaysShowCursor" ) ) +#define FM_PROP_DISPLAYSYNCHRON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayIsSynchron" ) ) +#define FM_PROP_ISMODIFIED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsModified" ) ) +#define FM_PROP_ISNEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsNew" ) ) +#define FM_PROP_PRIVILEGES rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Privileges" ) ) +#define FM_PROP_COMMAND rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Command" ) ) +#define FM_PROP_COMMANDTYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CommandType" ) ) +#define FM_PROP_RESULTSET_CONCURRENCY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResultSetConcurrency" ) ) +#define FM_PROP_INSERTONLY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IgnoreResult" ) ) +#define FM_PROP_RESULTSET_TYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResultSetType" ) ) +#define FM_PROP_ESCAPE_PROCESSING rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EscapeProcessing" ) ) +#define FM_PROP_APPLYFILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ApplyFilter" ) ) +#define FM_PROP_ISNULLABLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsNullable" ) ) +#define FM_PROP_ACTIVECOMMAND rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveCommand" ) ) +#define FM_PROP_ISCURRENCY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsCurrency" ) ) +#define FM_PROP_URL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) +#define FM_PROP_ACTIVE_CONNECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) ) +#define FM_PROP_SORT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Order" ) ) +#define FM_PROP_CONTROLSOURCEPROPERTY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataFieldProperty" ) ) +#define FM_PROP_REALNAME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RealName" ) ) +#define FM_PROP_TEXTLINECOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextLineColor" ) ) +#define FM_PROP_FONTEMPHASISMARK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontEmphasisMark" ) ) +#define FM_PROP_FONTRELIEF rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontRelief" ) ) +#define FM_PROP_SCROLLVALUE_MIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScrollValueMin" ) ) +#define FM_PROP_SCROLLVALUE_MAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScrollValueMax" ) ) +#define FM_PROP_DEFAULT_SCROLLVALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultScrollValue" ) ) +#define FM_PROP_LINEINCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineIncrement" ) ) +#define FM_PROP_BLOCKINCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BlockIncrement" ) ) +#define FM_PROP_ORIENTATION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Orientation" ) ) +#define FM_PROP_REPEAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Repeat" ) ) +#define FM_PROP_REPEATDELAY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RepeatDelay" ) ) +#define FM_PROP_SYMBOLCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SymbolColor" ) ) +#define FM_PROP_VISIBILESIZE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleSize" ) ) +#define FM_PROP_SPINVALUE_MIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SpinValueMin" ) ) +#define FM_PROP_SPINVALUE_MAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SpinValueMax" ) ) +#define FM_PROP_DEFAULT_SPINVALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultSpinValue" ) ) +#define FM_PROP_SPININCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SpinIncrement" ) ) +#define FM_PROP_LINEENDFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineEndFormat" ) ) +#define FM_PROP_TOGGLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Toggle" ) ) +#define FM_PROP_FOCUSONCLICK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FocusOnClick" ) ) +#define FM_PROP_HIDEINACTIVESELECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HideInactiveSelection" ) ) +#define FM_PROP_VISUALEFFECT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VisualEffect" ) ) +#define FM_PROP_BORDERCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BorderColor" ) ) +#define FM_PROP_DYNAMIC_CONTROL_BORDER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DynamicControlBorder" ) ) +#define FM_PROP_CONTROL_BORDER_COLOR_FOCUS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlBorderColorOnFocus" ) ) +#define FM_PROP_CONTROL_BORDER_COLOR_MOUSE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlBorderColorOnHover" ) ) +#define FM_PROP_CONTROL_BORDER_COLOR_INVALID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlBorderColorOnInvalid" ) ) +#define FM_PROP_BUTTON_TYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" ) ) +#define FM_PROP_FORM_OPERATIONS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormOperations" ) ) +#define FM_PROP_INPUT_REQUIRED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputRequired" ) ) +#define FM_PROP_WRITING_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WritingMode" ) ) +#define FM_PROP_MOUSE_WHEEL_BEHAVIOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MouseWheelBehavior" ) ) #endif // _SVX_FMPROP_HRC - diff --git a/svx/source/inc/fmservs.hxx b/svx/source/inc/fmservs.hxx index 2e3d30cf0e..165630eab8 100644 --- a/svx/source/inc/fmservs.hxx +++ b/svx/source/inc/fmservs.hxx @@ -30,76 +30,64 @@ #ifndef _SVX_FMSERVS_HXX #define _SVX_FMSERVS_HXX -#include "fmstatic.hxx" +#include <svx/svxdllapi.h> + +#define FM_NUMBER_FORMATTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.NumberFormatter" ) ) +#define FM_COMPONENT_EDIT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.Edit" ) ) +#define FM_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.TextField" ) ) +#define FM_COMPONENT_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ListBox" ) ) +#define FM_COMPONENT_COMBOBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ComboBox" ) ) +#define FM_COMPONENT_RADIOBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.RadioButton" ) ) +#define FM_COMPONENT_GROUPBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.GroupBox" ) ) +#define FM_COMPONENT_FIXEDTEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.FixedText" ) ) +#define FM_COMPONENT_COMMANDBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.CommandButton" ) ) +#define FM_COMPONENT_CHECKBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.CheckBox" ) ) +#define FM_COMPONENT_GRID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.Grid" ) ) +#define FM_COMPONENT_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.GridControl" ) ) +#define FM_COMPONENT_IMAGEBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ImageButton" ) ) +#define FM_COMPONENT_FILECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.FileControl" ) ) +#define FM_COMPONENT_TIMEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.TimeField" ) ) +#define FM_COMPONENT_DATEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.DateField" ) ) +#define FM_COMPONENT_NUMERICFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.NumericField" ) ) +#define FM_COMPONENT_CURRENCYFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.CurrencyField" ) ) +#define FM_COMPONENT_PATTERNFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.PatternField" ) ) +#define FM_COMPONENT_FORMATTEDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.FormattedField" ) ) +#define FM_COMPONENT_HIDDEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.Hidden" ) ) +#define FM_COMPONENT_HIDDENCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.HiddenControl" ) ) +#define FM_COMPONENT_IMAGECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ImageControl" ) ) +#define FM_CONTROL_GRID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.Grid" ) ) +#define FM_CONTROL_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.GridControl" ) ) +#define FM_FORM_CONTROLLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.FormController" ) ) +#define SRV_SDB_CONNECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.Connection" ) ) +#define SRV_SDB_INTERACTION_HANDLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.InteractionHandler" ) ) +#define FM_SUN_COMPONENT_FORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.Form" ) ) +#define FM_SUN_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ) ) +#define FM_SUN_COMPONENT_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ListBox" ) ) +#define FM_SUN_COMPONENT_COMBOBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ComboBox" ) ) +#define FM_SUN_COMPONENT_RADIOBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.RadioButton" ) ) +#define FM_SUN_COMPONENT_GROUPBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.GroupBox" ) ) +#define FM_SUN_COMPONENT_FIXEDTEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FixedText" ) ) +#define FM_SUN_COMPONENT_COMMANDBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CommandButton" ) ) +#define FM_SUN_COMPONENT_CHECKBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CheckBox" ) ) +#define FM_SUN_COMPONENT_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.GridControl" ) ) +#define FM_SUN_COMPONENT_IMAGEBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ImageButton" ) ) +#define FM_SUN_COMPONENT_FILECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FileControl" ) ) +#define FM_SUN_COMPONENT_TIMEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TimeField" ) ) +#define FM_SUN_COMPONENT_DATEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.DateField" ) ) +#define FM_SUN_COMPONENT_NUMERICFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.NumericField" ) ) +#define FM_SUN_COMPONENT_CURRENCYFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CurrencyField" ) ) +#define FM_SUN_COMPONENT_PATTERNFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.PatternField" ) ) +#define FM_SUN_COMPONENT_HIDDENCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.HiddenControl" ) ) +#define FM_SUN_COMPONENT_IMAGECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.DatabaseImageControl" ) ) +#define FM_SUN_COMPONENT_FORMATTEDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FormattedField" ) ) +#define FM_SUN_COMPONENT_SCROLLBAR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ScrollBar" ) ) +#define FM_SUN_COMPONENT_SPINBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.SpinButton" ) ) +#define FM_SUN_COMPONENT_NAVIGATIONBAR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.NavigationToolBar" ) ) +#define FM_SUN_CONTROL_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.control.GridControl" ) ) namespace svxform { - - DECLARE_CONSTASCII_USTRING(FM_NUMBER_FORMATTER); - - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_EDIT); // alter service name (5.0) - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_TEXTFIELD); - - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_LISTBOX); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_COMBOBOX); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_RADIOBUTTON); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_GROUPBOX); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_FIXEDTEXT); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_COMMANDBUTTON); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_CHECKBOX); - - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_GRID); // alter service name (5.0) - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_GRIDCONTROL); - - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_IMAGEBUTTON); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_FILECONTROL); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_TIMEFIELD); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_DATEFIELD); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_NUMERICFIELD); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_CURRENCYFIELD); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_PATTERNFIELD); - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_FORMATTEDFIELD); - - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_HIDDEN); // alter service name (5.0) - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_HIDDENCONTROL); - - DECLARE_CONSTASCII_USTRING(FM_COMPONENT_IMAGECONTROL); - - DECLARE_CONSTASCII_USTRING(FM_CONTROL_GRID); - DECLARE_CONSTASCII_USTRING(FM_CONTROL_GRIDCONTROL); - - DECLARE_CONSTASCII_USTRING(FM_FORM_CONTROLLER); - DECLARE_CONSTASCII_USTRING(SRV_SDB_CONNECTION); - DECLARE_CONSTASCII_USTRING(SRV_SDB_INTERACTION_HANDLER); - - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORM); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_TEXTFIELD); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_LISTBOX); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMBOBOX); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_RADIOBUTTON); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_GROUPBOX); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FIXEDTEXT); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMMANDBUTTON); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_CHECKBOX); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_GRIDCONTROL); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGEBUTTON); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FILECONTROL); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_TIMEFIELD); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_DATEFIELD); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_NUMERICFIELD); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_CURRENCYFIELD); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_PATTERNFIELD); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_HIDDENCONTROL); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGECONTROL); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORMATTEDFIELD); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_SCROLLBAR); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_SPINBUTTON); - DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_NAVIGATIONBAR); - - DECLARE_CONSTASCII_USTRING(FM_SUN_CONTROL_GRIDCONTROL); - - void ImplSmartRegisterUnoServices(); - + SVX_DLLPUBLIC void ImplSmartRegisterUnoServices(); } // namespace svxform #endif // _SVX_FMSERVS_HXX diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx index 481acade50..350bf26a5f 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -422,7 +422,7 @@ public: /** retrieves the current selection */ - void getCurrentSelection( InterfaceBag& /* [out] */ _rSelection ) const; + SVX_DLLPUBLIC void getCurrentSelection( InterfaceBag& /* [out] */ _rSelection ) const; /** sets a new current selection as indicated by a mark list @return @@ -631,7 +631,7 @@ public: // ======================================================================== SV_DECL_PTRARR_DEL(StatusForwarderArray, SfxStatusForwarder*, 16, 0) -class SAL_DLLPRIVATE ControlConversionMenuController : public SfxMenuControl +class SVX_DLLPUBLIC ControlConversionMenuController : public SfxMenuControl { protected: StatusForwarderArray m_aStatusForwarders; @@ -639,11 +639,11 @@ protected: PopupMenu* m_pConversionMenu; public: - ControlConversionMenuController(sal_uInt16 nId, Menu& rMenu, SfxBindings& rBindings); - virtual ~ControlConversionMenuController(); + SVX_DLLPRIVATE ControlConversionMenuController(sal_uInt16 nId, Menu& rMenu, SfxBindings& rBindings); + SVX_DLLPRIVATE virtual ~ControlConversionMenuController(); SFX_DECL_MENU_CONTROL(); - virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState); + SVX_DLLPRIVATE virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState); }; //================================================================== diff --git a/svx/source/inc/fmstatic.hxx b/svx/source/inc/fmstatic.hxx deleted file mode 100644 index f34bf276af..0000000000 --- a/svx/source/inc/fmstatic.hxx +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * 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: fmstatic.hxx,v $ - * $Revision: 1.6 $ - * - * 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 _FM_STATIC_HXX_ -#define _FM_STATIC_HXX_ -#include <tools/string.hxx> - -struct ConstAsciiString -{ - const sal_Char* ascii; - sal_Int32 length; - - inline operator const ::rtl::OUString () const; - inline operator const sal_Char* () const { return ascii; } - - inline ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength); - inline ~ConstAsciiString(); - -private: - mutable ::rtl::OUString* ustring; -}; - -//------------------------------------------------------------ -inline ConstAsciiString::ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength) - :ascii(_pAsciiZeroTerminated) - ,length(_nLength) - ,ustring(NULL) -{ -} - -//------------------------------------------------------------ -inline ConstAsciiString::~ConstAsciiString() -{ - delete ustring; - ustring = NULL; -} - -//------------------------------------------------------------ -inline ConstAsciiString::operator const ::rtl::OUString () const -{ - if (!ustring) - ustring = new ::rtl::OUString(ascii, length, RTL_TEXTENCODING_ASCII_US); - return *ustring; -} - -#define DECLARE_CONSTASCII_USTRING(name) \ - extern ConstAsciiString name - -#define IMPLEMENT_CONSTASCII_USTRING(name, asciivalue) \ - ConstAsciiString name(asciivalue, sizeof(asciivalue) - 1) - - -#endif // _FM_STATIC_HXX_ - diff --git a/svx/source/inc/fmtools.hxx b/svx/source/inc/fmtools.hxx index 3da2c92116..3c71698f06 100644 --- a/svx/source/inc/fmtools.hxx +++ b/svx/source/inc/fmtools.hxx @@ -96,7 +96,8 @@ #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase3.hxx> #include <cppuhelper/component.hxx> -#include "fmstatic.hxx" + +#include <svx/svxdllapi.h> #include <set> @@ -109,19 +110,12 @@ class Window; // display info about a simple ::com::sun::star::sdbc::SQLException void displayException(const ::com::sun::star::sdbc::SQLException&, Window* _pParent = NULL); void displayException(const ::com::sun::star::sdbc::SQLWarning&, Window* _pParent = NULL); -void displayException(const ::com::sun::star::sdb::SQLContext&, Window* _pParent = NULL); +SVX_DLLPUBLIC void displayException(const ::com::sun::star::sdb::SQLContext&, Window* _pParent = NULL); void displayException(const ::com::sun::star::sdb::SQLErrorEvent&, Window* _pParent = NULL); void displayException(const ::com::sun::star::uno::Any&, Window* _pParent = NULL); -// StringConversion -namespace svxform -{ - // modes for the XModeSelector - DECLARE_CONSTASCII_USTRING(DATA_MODE); - DECLARE_CONSTASCII_USTRING(FILTER_MODE); - -} // namespace svxform - +#define DATA_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMode" ) ) +#define FILTER_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterMode" ) ) // Kopieren von Persistenten Objecten ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> cloneUsingProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XPersistObject>& _xObj); @@ -139,7 +133,7 @@ String getFormComponentAccessPath(const ::com::sun::star::uno::Reference< ::com: ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel> getXModel(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xIface); -::rtl::OUString getLabelName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xControlModel); +SVX_DLLPUBLIC ::rtl::OUString getLabelName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xControlModel); // =================================================================================================== // = class CursorWrapper - eine Hilfsklasse, die parallel mit je einem ::com::sun::star::uno::Reference<XDatabaseUpdateCursor>, @@ -159,7 +153,7 @@ public: // Construction/Destruction CursorWrapper() { } CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxCursor, sal_Bool bUseCloned = sal_False); - CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxCursor, sal_Bool bUseCloned = sal_False); + SVX_DLLPUBLIC CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxCursor, sal_Bool bUseCloned = sal_False); // bei bUseCloned == sal_True wird der Cursor ueber das XCloneable-Interface (dass er besitzen muss) gedoubled und // erst dann benutzt diff --git a/svx/source/inc/fmurl.hxx b/svx/source/inc/fmurl.hxx index 6333e8be9f..9513fa1841 100644 --- a/svx/source/inc/fmurl.hxx +++ b/svx/source/inc/fmurl.hxx @@ -31,46 +31,33 @@ #ifndef _SVX_FMURL_HXX #define _SVX_FMURL_HXX -#include "fmstatic.hxx" - -namespace svxform -{ - - DECLARE_CONSTASCII_USTRING(FMURL_FORMSLOTS_PREFIX); - - DECLARE_CONSTASCII_USTRING(FMURL_FORM_POSITION); - DECLARE_CONSTASCII_USTRING(FMURL_FORM_RECORDCOUNT); - DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVEFIRST); - DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVEPREV); - DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVENEXT); - DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVELAST); - DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVETONEW); - DECLARE_CONSTASCII_USTRING(FMURL_RECORD_UNDO); - DECLARE_CONSTASCII_USTRING(FMURL_RECORD_SAVE); - DECLARE_CONSTASCII_USTRING(FMURL_RECORD_DELETE); - DECLARE_CONSTASCII_USTRING(FMURL_FORM_REFRESH); - DECLARE_CONSTASCII_USTRING(FMURL_FORM_REFRESH_CURRENT_CONTROL); - - DECLARE_CONSTASCII_USTRING(FMURL_FORM_SORT_UP); - DECLARE_CONSTASCII_USTRING(FMURL_FORM_SORT_DOWN); - DECLARE_CONSTASCII_USTRING(FMURL_FORM_SORT); - DECLARE_CONSTASCII_USTRING(FMURL_FORM_AUTO_FILTER); - DECLARE_CONSTASCII_USTRING(FMURL_FORM_FILTER); - DECLARE_CONSTASCII_USTRING(FMURL_FORM_APPLY_FILTER); - DECLARE_CONSTASCII_USTRING(FMURL_FORM_REMOVE_FILTER); - - DECLARE_CONSTASCII_USTRING(FMURL_CONFIRM_DELETION); - - DECLARE_CONSTASCII_USTRING(FMURL_COMPONENT_FORMGRIDVIEW); - DECLARE_CONSTASCII_USTRING(FMURL_GRIDVIEW_CLEARVIEW); - DECLARE_CONSTASCII_USTRING(FMURL_GRIDVIEW_ADDCOLUMN); - DECLARE_CONSTASCII_USTRING(FMURL_GRIDVIEW_ATTACHTOFORM); - - DECLARE_CONSTASCII_USTRING(FMARG_ATTACHTO_MASTERFORM); - DECLARE_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNTYPE); - DECLARE_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNPOS); - -} // namespace svxform +#define FMURL_FORMSLOTS_PREFIX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/" ) ) +#define FMURL_FORM_POSITION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/positionForm" ) ) +#define FMURL_FORM_RECORDCOUNT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/RecordCount" ) ) +#define FMURL_RECORD_MOVEFIRST rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToFirst" ) ) +#define FMURL_RECORD_MOVEPREV rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToPrev" ) ) +#define FMURL_RECORD_MOVENEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToNext" ) ) +#define FMURL_RECORD_MOVELAST rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToLast" ) ) +#define FMURL_RECORD_MOVETONEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToNew" ) ) +#define FMURL_RECORD_UNDO rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/undoRecord" ) ) +#define FMURL_RECORD_SAVE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/saveRecord" ) ) +#define FMURL_RECORD_DELETE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/deleteRecord" ) ) +#define FMURL_FORM_REFRESH rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/refreshForm" ) ) +#define FMURL_FORM_REFRESH_CURRENT_CONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/refreshCurrentControl" ) ) +#define FMURL_FORM_SORT_UP rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/sortUp" ) ) +#define FMURL_FORM_SORT_DOWN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/sortDown" ) ) +#define FMURL_FORM_SORT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/sort" ) ) +#define FMURL_FORM_AUTO_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/autoFilter" ) ) +#define FMURL_FORM_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/filter" ) ) +#define FMURL_FORM_APPLY_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/applyFilter" ) ) +#define FMURL_FORM_REMOVE_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/removeFilterOrder" ) ) +#define FMURL_CONFIRM_DELETION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/ConfirmDeletion" ) ) +#define FMURL_COMPONENT_FORMGRIDVIEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".component:DB/FormGridView" ) ) +#define FMURL_GRIDVIEW_CLEARVIEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/ClearView" ) ) +#define FMURL_GRIDVIEW_ADDCOLUMN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/AddGridColumn" ) ) +#define FMURL_GRIDVIEW_ATTACHTOFORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/AttachToForm" ) ) +#define FMARG_ATTACHTO_MASTERFORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MasterForm" ) ) +#define FMARG_ADDCOL_COLUMNTYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnType" ) ) +#define FMARG_ADDCOL_COLUMNPOS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnPosition" ) ) #endif // _SVX_FMURL_HXX - diff --git a/svx/source/inc/formtoolbars.hxx b/svx/source/inc/formtoolbars.hxx index a833ff1273..2083e2baa8 100644 --- a/svx/source/inc/formtoolbars.hxx +++ b/svx/source/inc/formtoolbars.hxx @@ -31,14 +31,13 @@ #ifndef SVX_SOURCE_INC_FORMTOOLBARS_HXX #define SVX_SOURCE_INC_FORMTOOLBARS_HXX -/** === begin UNO includes === **/ -/** === end UNO includes === **/ - #include "fmdocumentclassification.hxx" #include <com/sun/star/frame/XLayoutManager.hpp> #include <tools/solar.h> +#include <svx/svxdllapi.h> + //........................................................................ namespace svxform { @@ -58,7 +57,7 @@ namespace svxform @param _rxFrame the frame to analyze */ - FormToolboxes( + SVX_DLLPUBLIC FormToolboxes( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ); @@ -66,16 +65,16 @@ namespace svxform /** retrieves the URI for the toolbox associated with the given slot, depending on the type of our document */ - ::rtl::OUString + SVX_DLLPUBLIC ::rtl::OUString getToolboxResourceName( USHORT _nSlotId ) const; /** toggles the toolbox associated with the given slot */ - void toggleToolbox( USHORT _nSlotId ) const; + SVX_DLLPUBLIC void toggleToolbox( USHORT _nSlotId ) const; /** determines whether the toolbox associated with the given slot is currently visible */ - bool isToolboxVisible( USHORT _nSlotId ) const; + SVX_DLLPUBLIC bool isToolboxVisible( USHORT _nSlotId ) const; /** ensures that a given toolbox is visible */ diff --git a/svx/source/inc/gridcols.hxx b/svx/source/inc/gridcols.hxx index a8fb271abe..9b7930837e 100644 --- a/svx/source/inc/gridcols.hxx +++ b/svx/source/inc/gridcols.hxx @@ -30,25 +30,20 @@ #ifndef _SVX_GRIDCOLS_HXX #define _SVX_GRIDCOLS_HXX -#include "fmstatic.hxx" +#include <sal/types.h> -namespace svxform -{ - - // list of possible controls - DECLARE_CONSTASCII_USTRING(FM_COL_TEXTFIELD); - DECLARE_CONSTASCII_USTRING(FM_COL_CHECKBOX); - DECLARE_CONSTASCII_USTRING(FM_COL_COMBOBOX); - DECLARE_CONSTASCII_USTRING(FM_COL_LISTBOX); - DECLARE_CONSTASCII_USTRING(FM_COL_NUMERICFIELD); - DECLARE_CONSTASCII_USTRING(FM_COL_DATEFIELD); - DECLARE_CONSTASCII_USTRING(FM_COL_TIMEFIELD); - DECLARE_CONSTASCII_USTRING(FM_COL_CURRENCYFIELD); - DECLARE_CONSTASCII_USTRING(FM_COL_PATTERNFIELD); - DECLARE_CONSTASCII_USTRING(FM_COL_FORMATTEDFIELD); - -} // namespace svxform +namespace rtl { class OUString; } +#define FM_COL_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextField" ) ) +#define FM_COL_COMBOBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ComboBox" ) ) +#define FM_COL_CHECKBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CheckBox" ) ) +#define FM_COL_TIMEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeField" ) ) +#define FM_COL_DATEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateField" ) ) +#define FM_COL_NUMERICFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NumericField" ) ) +#define FM_COL_CURRENCYFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CurrencyField" ) ) +#define FM_COL_PATTERNFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PatternField" ) ) +#define FM_COL_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListBox" ) ) +#define FM_COL_FORMATTEDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormattedField" ) ) // column type ids #define TYPE_CHECKBOX 0 diff --git a/svx/source/inc/sqlparserclient.hxx b/svx/source/inc/sqlparserclient.hxx index 398c638c73..61e0e951bd 100644 --- a/svx/source/inc/sqlparserclient.hxx +++ b/svx/source/inc/sqlparserclient.hxx @@ -43,7 +43,7 @@ namespace svxform //==================================================================== //= OSQLParserClient //==================================================================== - class OSQLParserClient : public ODbtoolsClient + class SVX_DLLPUBLIC OSQLParserClient : public ODbtoolsClient ,public ::svxform::OParseContextClient { private: diff --git a/svx/source/inc/stringlistresource.hxx b/svx/source/inc/stringlistresource.hxx index 3db48e105d..8fb8ff9db2 100644 --- a/svx/source/inc/stringlistresource.hxx +++ b/svx/source/inc/stringlistresource.hxx @@ -31,11 +31,10 @@ #ifndef SVX_STRINGLISTRESOURCE_HXX #define SVX_STRINGLISTRESOURCE_HXX -/** === begin UNO includes === **/ -/** === end UNO includes === **/ - #include <tools/rc.hxx> +#include <svx/svxdllapi.h> + #include <memory> //........................................................................ @@ -52,8 +51,8 @@ namespace svx class StringListResource : public Resource { public: - StringListResource( const ResId& _rResId ); - ~StringListResource(); + SVX_DLLPUBLIC StringListResource( const ResId& _rResId ); + SVX_DLLPUBLIC ~StringListResource(); inline void get( ::std::vector< String >& _rStrings ) { diff --git a/svx/source/inc/unoedprx.hxx b/svx/source/inc/unoedprx.hxx index cf510f63dd..8edb9c773d 100644 --- a/svx/source/inc/unoedprx.hxx +++ b/svx/source/inc/unoedprx.hxx @@ -79,7 +79,10 @@ public: virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const; virtual USHORT GetLineCount( USHORT nPara ) const; virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const; - virtual sal_Bool Delete( const ESelection& ); + virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const; + virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const; + + virtual sal_Bool Delete( const ESelection& ); virtual sal_Bool InsertText( const String&, const ESelection& ); virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE ); virtual sal_Int16 GetDepth( USHORT nPara ) const; @@ -118,12 +121,13 @@ public: SvxAccessibleTextEditViewAdapter(); virtual ~SvxAccessibleTextEditViewAdapter(); + // SvxViewForwarder interface virtual BOOL IsValid() const; - virtual Rectangle GetVisArea() const; virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const; virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const; + // SvxEditViewForwarder interface virtual sal_Bool GetSelection( ESelection& rSelection ) const; virtual sal_Bool SetSelection( const ESelection& rSelection ); virtual sal_Bool Copy(); diff --git a/svx/source/inc/unogalthemeprovider.hxx b/svx/source/inc/unogalthemeprovider.hxx index e4cfa57359..c4e3cf0287 100644 --- a/svx/source/inc/unogalthemeprovider.hxx +++ b/svx/source/inc/unogalthemeprovider.hxx @@ -36,6 +36,8 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/gallery/XGalleryThemeProvider.hpp> +#include <svx/svxdllapi.h> + class Gallery; namespace unogallery { @@ -60,8 +62,8 @@ public: GalleryThemeProvider(); ~GalleryThemeProvider(); - static ::rtl::OUString getImplementationName_Static() throw(); - static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw(); + SVX_DLLPUBLIC static ::rtl::OUString getImplementationName_Static() throw(); + SVX_DLLPUBLIC static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw(); protected: diff --git a/svx/source/inc/unopolyhelper.hxx b/svx/source/inc/unopolyhelper.hxx index 431b40cea2..e912d02ad4 100644 --- a/svx/source/inc/unopolyhelper.hxx +++ b/svx/source/inc/unopolyhelper.hxx @@ -33,6 +33,8 @@ #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <svx/svxdllapi.h> + namespace com { namespace sun { namespace star { namespace drawing { struct PolyPolygonBezierCoords; } } } } @@ -48,7 +50,7 @@ basegfx::B2DPolyPolygon SvxConvertPolyPolygonBezierToB2DPolyPolygon( const com:: /** convert a B2DPolyPolygon to a drawing::PolyPolygonBezierCoords */ -void SvxConvertB2DPolyPolygonToPolyPolygonBezier( const basegfx::B2DPolyPolygon& rPolyPoly, com::sun::star::drawing::PolyPolygonBezierCoords& rRetval ); +SVX_DLLPUBLIC void SvxConvertB2DPolyPolygonToPolyPolygonBezier( const basegfx::B2DPolyPolygon& rPolyPoly, com::sun::star::drawing::PolyPolygonBezierCoords& rRetval ); #endif diff --git a/svx/source/items/makefile.mk b/svx/source/items/makefile.mk index c6cae54647..ef4bf0b001 100644 --- a/svx/source/items/makefile.mk +++ b/svx/source/items/makefile.mk @@ -38,6 +38,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch PRJNAME=svx TARGET=items +LIBTARGET=NO # --- Settings ----------------------------------------------------- @@ -51,41 +52,45 @@ SRC1FILES = \ svxerr.src \ svxitems.src -SLOFILES= \ - $(SLO)$/ofaitem.obj \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/writingmodeitem.obj \ $(SLO)$/frmitems.obj \ $(SLO)$/paraitem.obj \ $(SLO)$/textitem.obj \ - $(SLO)$/postattr.obj \ $(SLO)$/flditem.obj \ - $(SLO)$/hlnkitem.obj \ $(SLO)$/svxfont.obj \ - $(SLO)$/pageitem.obj \ - $(SLO)$/viewlayoutitem.obj \ - $(SLO)$/paperinf.obj \ + $(SLO)$/paperinf.obj \ $(SLO)$/drawitem.obj \ - $(SLO)$/algitem.obj \ $(SLO)$/itemtype.obj \ - $(SLO)$/rotmodit.obj \ - $(SLO)$/numinf.obj \ - $(SLO)$/svxerr.obj \ - $(SLO)$/numfmtsh.obj \ - $(SLO)$/zoomitem.obj \ $(SLO)$/chrtitem.obj \ $(SLO)$/bulitem.obj \ $(SLO)$/e3ditem.obj \ $(SLO)$/numitem.obj \ $(SLO)$/grfitem.obj \ $(SLO)$/clipfmtitem.obj \ - $(SLO)$/svxempty.obj \ $(SLO)$/xmlcnitm.obj \ $(SLO)$/customshapeitem.obj \ - $(SLO)$/charhiddenitem.obj \ + $(SLO)$/charhiddenitem.obj + +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/ofaitem.obj \ + $(SLO)$/postattr.obj \ + $(SLO)$/hlnkitem.obj \ + $(SLO)$/pageitem.obj \ + $(SLO)$/viewlayoutitem.obj \ + $(SLO)$/algitem.obj \ + $(SLO)$/rotmodit.obj \ + $(SLO)$/numinf.obj \ + $(SLO)$/svxerr.obj \ + $(SLO)$/numfmtsh.obj \ + $(SLO)$/zoomitem.obj \ + $(SLO)$/svxempty.obj \ $(SLO)$/SmartTagItem.obj \ $(SLO)$/zoomslideritem.obj \ - +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) EXCEPTIONSFILES= \ $(SLO)$/paraitem.obj \ diff --git a/svx/source/items/textitem.cxx b/svx/source/items/textitem.cxx index 32e8b9f617..8460558e67 100644 --- a/svx/source/items/textitem.cxx +++ b/svx/source/items/textitem.cxx @@ -485,6 +485,13 @@ SfxItemPresentation SvxFontItem::GetPresentation return SFX_ITEM_PRESENTATION_NONE; } +//------------------------------------------------------------------------ + +void SvxFontItem::EnableStoreUnicodeNames( BOOL bEnable ) +{ + bEnableStoreUnicodeNames = bEnable; +} + // class SvxPostureItem -------------------------------------------------- SvxPostureItem::SvxPostureItem( const FontItalic ePosture, const USHORT nId ) : diff --git a/svx/source/msfilter/escherex.cxx b/svx/source/msfilter/escherex.cxx index 4eeeda8171..d21aa84a2d 100644 --- a/svx/source/msfilter/escherex.cxx +++ b/svx/source/msfilter/escherex.cxx @@ -156,14 +156,6 @@ EscherExClientAnchor_Base::~EscherExClientAnchor_Base() // --------------------------------------------------------------------------------------------- -struct EscherPropSortStruct -{ - sal_uInt8* pBuf; - sal_uInt32 nPropSize; - sal_uInt32 nPropValue; - sal_uInt16 nPropId; -}; - void EscherPropertyContainer::ImplInit() { nSortCount = 0; @@ -275,21 +267,40 @@ void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, sal_Bool bBlib, sal_uI } } -sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, sal_uInt32& nPropValue ) const +sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, sal_uInt32& rPropValue ) const +{ + EscherPropSortStruct aPropStruct; + + if ( GetOpt( nPropId, aPropStruct ) ) + { + rPropValue = aPropStruct.nPropValue; + return sal_True; + } + return sal_False; +} + +sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, EscherPropSortStruct& rPropValue ) const { - sal_Bool bRetValue = sal_False; for( sal_uInt32 i = 0; i < nSortCount; i++ ) { if ( ( pSortStruct[ i ].nPropId &~0xc000 ) == ( nPropId &~0xc000 ) ) { - nPropValue = pSortStruct[ i ].nPropValue; - bRetValue = sal_True; - break; + rPropValue = pSortStruct[ i ]; + return sal_True; } } - return bRetValue; + return sal_False; } +EscherProperties EscherPropertyContainer::GetOpts() const +{ + EscherProperties aVector; + + for ( sal_uInt32 i = 0; i < nSortCount; ++i ) + aVector.push_back( pSortStruct[ i ] ); + + return aVector; +} extern "C" int __LOADONCALLAPI EscherPropSortFunc( const void* p1, const void* p2 ) { @@ -715,7 +726,7 @@ void EscherPropertyContainer::CreateTextProperties( AddOpt( ESCHER_Prop_lTxid, nTextId ); } -static sal_Bool GetLineArrow( const sal_Bool bLineStart, +sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth ) { @@ -2084,6 +2095,68 @@ void ConvertEnhancedCustomShapeEquation( SdrObjCustomShape* pCustoShape, } } +sal_Bool EscherPropertyContainer::IsDefaultObject( SdrObjCustomShape* pCustoShape ) +{ + sal_Bool bIsDefaultObject = sal_False; + if ( pCustoShape ) + { + if ( pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_EQUATIONS ) + && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_VIEWBOX ) + && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_PATH ) + && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_GLUEPOINTS ) + && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_SEGMENTS ) + && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHX ) + && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHY ) +// && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_HANDLES ) + && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_TEXTFRAMES ) ) + bIsDefaultObject = sal_True; + } + + return bIsDefaultObject; +} + +void EscherPropertyContainer::LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted ) +{ + const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eShapeType ); + if ( pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles ) + { + sal_Int32 k, nkCount = pDefCustomShape->nHandles; + const SvxMSDffHandle* pData = pDefCustomShape->pHandles; + for ( k = 0; k < nkCount; k++, pData++ ) + { + if ( pData->nFlags & MSDFF_HANDLE_FLAGS_POLAR ) + { + if ( ( pData->nPositionY >= 0x256 ) || ( pData->nPositionY <= 0x107 ) ) + nAdjustmentsWhichNeedsToBeConverted |= ( 1 << k ); + } + } + } +} + +sal_Bool EscherPropertyContainer::GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue ) +{ + if ( rkProp.State != beans::PropertyState_DIRECT_VALUE ) + return FALSE; + + sal_Bool bUseFixedFloat = ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << nIndex ) ) != 0; + if ( rkProp.Value.getValueTypeClass() == uno::TypeClass_DOUBLE ) + { + double fValue; + rkProp.Value >>= fValue; + if ( bUseFixedFloat ) + fValue *= 65536.0; + nValue = (sal_Int32)fValue; + } + else + { + rkProp.Value >>= nValue; + if ( bUseFixedFloat ) + nValue <<= 16; + } + + return TRUE; +} + void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeType, const uno::Reference< drawing::XShape > & rXShape ) { uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY ); @@ -2108,22 +2181,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0; uno::Sequence< beans::PropertyValues > aHandlesPropSeq; sal_Bool bPredefinedHandlesUsed = sal_True; - - - sal_Bool bIsDefaultObject = sal_False; - if ( pCustoShape ) - { - if ( pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_EQUATIONS ) - && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_VIEWBOX ) - && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_PATH ) - && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_GLUEPOINTS ) - && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_SEGMENTS ) - && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHX ) - && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHY ) -// && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_HANDLES ) - && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_TEXTFRAMES ) ) - bIsDefaultObject = sal_True; - } + sal_Bool bIsDefaultObject = IsDefaultObject( pCustoShape ); // convert property "Equations" into std::vector< EnhancedCustomShapeEquationEquation > std::vector< EnhancedCustomShapeEquation > aEquations; @@ -3185,46 +3243,12 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT if ( pAdjustmentValuesProp->Value >>= aAdjustmentSeq ) { if ( bPredefinedHandlesUsed ) - { - const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eShapeType ); - if ( pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles ) - { - sal_Int32 k, nkCount = pDefCustomShape->nHandles; - const SvxMSDffHandle* pData = pDefCustomShape->pHandles; - for ( k = 0; k < nkCount; k++, pData++ ) - { - if ( pData->nFlags & MSDFF_HANDLE_FLAGS_POLAR ) - { - if ( ( pData->nPositionY >= 0x256 ) || ( pData->nPositionY <= 0x107 ) ) - nAdjustmentsWhichNeedsToBeConverted |= ( 1 << k ); - } - } - } - } + LookForPolarHandles( eShapeType, nAdjustmentsWhichNeedsToBeConverted ); + sal_Int32 k, nValue = 0, nAdjustmentValues = aAdjustmentSeq.getLength(); for ( k = 0; k < nAdjustmentValues; k++ ) - { - const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp = aAdjustmentSeq[ k ]; - if ( rkProp.State == beans::PropertyState_DIRECT_VALUE ) - { - sal_Bool bUseFixedFloat = ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << k ) ) != 0; - if ( rkProp.Value.getValueTypeClass() == uno::TypeClass_DOUBLE ) - { - double fValue; - rkProp.Value >>= fValue; - if ( bUseFixedFloat ) - fValue *= 65536.0; - nValue = (sal_Int32)fValue; - } - else - { - rkProp.Value >>= nValue; - if ( bUseFixedFloat ) - nValue <<= 16; - } + if( GetAdjustmentValue( aAdjustmentSeq[ k ], k, nAdjustmentsWhichNeedsToBeConverted, nValue ) ) AddOpt( (sal_uInt16)( DFF_Prop_adjustValue + k ), (sal_uInt32)nValue ); - } - } } } } @@ -3923,30 +3947,6 @@ struct EscherConnectorRule sal_uInt32 ncptiB; // Connection site Index of shape B }; -struct EscherConnectorListEntry -{ - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnector; - ::com::sun::star::awt::Point maPointA; - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToA; - ::com::sun::star::awt::Point maPointB; - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToB; - - sal_uInt32 GetConnectorRule( sal_Bool bFirst ); - - EscherConnectorListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rC, - const ::com::sun::star::awt::Point& rPA, - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSA , - const ::com::sun::star::awt::Point& rPB, - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSB ) : - mXConnector ( rC ), - maPointA ( rPA ), - mXConnectToA( rSA ), - maPointB ( rPB ), - mXConnectToB( rSB ) {} - - sal_uInt32 GetClosestPoint( const Polygon& rPoly, const ::com::sun::star::awt::Point& rP ); -}; - struct EscherShapeListEntry { ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > aXShape; @@ -4650,6 +4650,17 @@ void EscherEx::AddAtom( UINT32 nAtomSize, UINT16 nRecType, int nRecVersion, int // --------------------------------------------------------------------------------------------- +void EscherEx::AddChildAnchor( const Rectangle& rRect ) +{ + AddAtom( 16, ESCHER_ChildAnchor ); + GetStream() << (INT32)rRect.Left() + << (INT32)rRect.Top() + << (INT32)rRect.Right() + << (INT32)rRect.Bottom(); +} + +// --------------------------------------------------------------------------------------------- + void EscherEx::AddClientAnchor( const Rectangle& rRect ) { AddAtom( 8, ESCHER_ClientAnchor ); @@ -4699,15 +4710,10 @@ UINT32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRe if( rShapeName.Len() > 0 ) aPropOpt.AddOpt( ESCHER_Prop_wzName, rShapeName ); - aPropOpt.Commit( *mpOutStrm ); + Commit( aPropOpt, aRect ); if ( mnGroupLevel > 1 ) - { - AddAtom( 16, ESCHER_ChildAnchor ); - *mpOutStrm << (INT32)aRect.Left() - << (INT32)aRect.Top() - << (INT32)aRect.Right() - << (INT32)aRect.Bottom(); - } + AddChildAnchor( aRect ); + EscherExHostAppData* pAppData = mpImplEscherExSdr->ImplGetHostData(); if( pAppData ) { @@ -4805,6 +4811,13 @@ UINT32 EscherEx::GetShapeID() // --------------------------------------------------------------------------------------------- +void EscherEx::Commit( EscherPropertyContainer& rProps, const Rectangle& ) +{ + rProps.Commit( GetStream() ); +} + +// --------------------------------------------------------------------------------------------- + UINT32 EscherEx::GetColor( const UINT32 nSOColor, BOOL bSwap ) { if ( bSwap ) diff --git a/svx/source/msfilter/eschesdo.cxx b/svx/source/msfilter/eschesdo.cxx index 319cb2d43d..86a1bd131b 100644 --- a/svx/source/msfilter/eschesdo.cxx +++ b/svx/source/msfilter/eschesdo.cxx @@ -736,16 +736,10 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, if( rObj.GetAngle() ) ImplFlipBoundingBox( rObj, aPropOpt ); - aPropOpt.Commit( mpEscherEx->GetStream() ); + mpEscherEx->Commit( aPropOpt, rObj.GetRect() ); if( mpEscherEx->GetGroupLevel() > 1 ) - { - mpEscherEx->AddAtom( 16, ESCHER_ChildAnchor ); - const Rectangle& rRect = rObj.GetRect(); - mpEscherEx->GetStream() << (INT32)rRect.Left() - << (INT32)rRect.Top() - << (INT32)rRect.Right() - << (INT32)rRect.Bottom(); - } + mpEscherEx->AddChildAnchor( rObj.GetRect() ); + if ( mpHostAppData ) { //! with AdditionalText the App has to control whether these are written or not mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.GetRect() ); @@ -839,15 +833,10 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj, rObj.GetRect() ); } rObj.SetAngle( nAngle ); - aPropOpt.Commit( mpEscherEx->GetStream() ); + mpEscherEx->Commit( aPropOpt, rObj.GetRect() ); // write the childanchor - mpEscherEx->AddAtom( 16, ESCHER_ChildAnchor ); - const Rectangle& rRect = rObj.GetRect(); - mpEscherEx->GetStream() << (INT32)rRect.Left() - << (INT32)rRect.Top() - << (INT32)rRect.Right() - << (INT32)rRect.Bottom(); + mpEscherEx->AddChildAnchor( rObj.GetRect() ); #if defined EES_WRITE_EPP // ClientAnchor diff --git a/svx/source/msfilter/makefile.mk b/svx/source/msfilter/makefile.mk index 85c120f88d..adbe8b1048 100644 --- a/svx/source/msfilter/makefile.mk +++ b/svx/source/msfilter/makefile.mk @@ -33,6 +33,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=msfilter +LIBTARGET=NO AUTOSEG=true # --- Settings ----------------------------------------------------- @@ -42,7 +43,8 @@ AUTOSEG=true # --- Files -------------------------------------------------------- -SLOFILES=\ +LIB1TARGET= $(SLB)$/$(TARGET)-msfilter.lib +LIB1OBJFILES= \ $(SLO)$/countryid.obj \ $(SLO)$/escherex.obj \ $(SLO)$/eschesdo.obj \ @@ -54,6 +56,12 @@ SLOFILES=\ $(SLO)$/mscodec.obj \ $(SLO)$/msfiltertracer.obj +LIB2TARGET= $(SLB)$/$(TARGET)-core.lib +LIB2OBJFILES= \ + $(SLO)$/svxmsbas2.obj + +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + EXCEPTIONSFILES= \ $(SLO)$/eschesdo.obj \ $(SLO)$/escherex.obj \ diff --git a/svx/source/msfilter/mscodec.cxx b/svx/source/msfilter/mscodec.cxx index e549fd48ee..54da76c546 100644 --- a/svx/source/msfilter/mscodec.cxx +++ b/svx/source/msfilter/mscodec.cxx @@ -37,6 +37,13 @@ #include <string.h> #include <tools/solar.h> +#define DEBUG_MSO_ENCRYPTION_STD97 0 + +#if DEBUG_MSO_ENCRYPTION_STD97 +#include <stdio.h> +#endif + + namespace svx { // ============================================================================ @@ -241,15 +248,50 @@ MSCodec_Std97::~MSCodec_Std97 () rtl_cipher_destroy (m_hCipher); } +#if DEBUG_MSO_ENCRYPTION_STD97 +static void lcl_PrintKeyData(const sal_uInt8* pKeyData, const char* msg) +{ + printf("pKeyData: (%s)\n", msg); + for (int j = 0; j < 4; ++j) + { + for (int i = 0; i < 16; ++i) + printf("%2.2x ", pKeyData[j*16+i]); + printf("\n"); + } +} +#else +static void lcl_PrintKeyData(const sal_uInt8* /*pKeyData*/, const char* /*msg*/) +{ +} +#endif + +#if DEBUG_MSO_ENCRYPTION_STD97 +static void lcl_PrintDigest(const sal_uInt8* pDigest, const char* msg) +{ + printf("digest: (%s)\n", msg); + for (int i = 0; i < 16; ++i) + printf("%2.2x ", pDigest[i]); + printf("\n"); +} +#else +static void lcl_PrintDigest(const sal_uInt8* /*pDigest*/, const char* /*msg*/) +{ +} +#endif + void MSCodec_Std97::InitKey ( const sal_uInt16 pPassData[16], const sal_uInt8 pUnique[16]) { +#if DEBUG_MSO_ENCRYPTION_STD97 + fprintf(stdout, "MSCodec_Std97::InitKey: --begin\n");fflush(stdout); +#endif sal_uInt8 pKeyData[64]; int i, n; // Fill PassData into KeyData. (void)memset (pKeyData, 0, sizeof(pKeyData)); + lcl_PrintKeyData(pKeyData, "initial"); for (i = 0, n = 16; (i < n) && pPassData[i]; i++) { pKeyData[2*i ] = sal::static_int_cast< sal_uInt8 >( @@ -260,12 +302,16 @@ void MSCodec_Std97::InitKey ( pKeyData[2*i] = 0x80; pKeyData[ 56] = sal::static_int_cast< sal_uInt8 >(i << 4); + lcl_PrintKeyData(pKeyData, "password data"); + // Fill raw digest of KeyData into KeyData. (void)rtl_digest_updateMD5 ( m_hDigest, pKeyData, sizeof(pKeyData)); (void)rtl_digest_rawMD5 ( m_hDigest, pKeyData, RTL_DIGEST_LENGTH_MD5); + lcl_PrintKeyData(pKeyData, "raw digest of key data"); + // Update digest with KeyData and Unique. for (i = 0; i < 16; i++) { @@ -279,6 +325,8 @@ void MSCodec_Std97::InitKey ( pKeyData[56] = 0x80; pKeyData[57] = 0x0a; + lcl_PrintKeyData(pKeyData, "update digest with padding"); + rtl_digest_updateMD5 ( m_hDigest, &(pKeyData[16]), sizeof(pKeyData) - 16); @@ -286,6 +334,8 @@ void MSCodec_Std97::InitKey ( rtl_digest_rawMD5 ( m_hDigest, m_pDigestValue, sizeof(m_pDigestValue)); + lcl_PrintDigest(m_pDigestValue, "digest value"); + // Erase KeyData array and leave. (void)memset (pKeyData, 0, sizeof(pKeyData)); } @@ -294,27 +344,21 @@ bool MSCodec_Std97::VerifyKey ( const sal_uInt8 pSaltData[16], const sal_uInt8 pSaltDigest[16]) { + // both the salt data and salt digest (hash) come from the document being imported. + +#if DEBUG_MSO_ENCRYPTION_STD97 + fprintf(stdout, "MSCodec_Std97::VerifyKey: \n"); + lcl_PrintDigest(pSaltData, "salt data"); + lcl_PrintDigest(pSaltDigest, "salt hash"); +#endif bool result = false; if (InitCipher(0)) { sal_uInt8 pDigest[RTL_DIGEST_LENGTH_MD5]; - sal_uInt8 pBuffer[64]; - - // Decode SaltData into Buffer. - rtl_cipher_decode ( - m_hCipher, pSaltData, 16, pBuffer, sizeof(pBuffer)); - - pBuffer[16] = 0x80; - (void)memset (pBuffer + 17, 0, sizeof(pBuffer) - 17); - pBuffer[56] = 0x80; - - // Fill raw digest of Buffer into Digest. - rtl_digest_updateMD5 ( - m_hDigest, pBuffer, sizeof(pBuffer)); - rtl_digest_rawMD5 ( - m_hDigest, pDigest, sizeof(pDigest)); + GetDigestFromSalt(pSaltData, pDigest); + sal_uInt8 pBuffer[16]; // Decode original SaltDigest into Buffer. rtl_cipher_decode ( m_hCipher, pSaltDigest, 16, pBuffer, sizeof(pBuffer)); @@ -333,7 +377,7 @@ bool MSCodec_Std97::VerifyKey ( bool MSCodec_Std97::InitCipher (sal_uInt32 nCounter) { rtlCipherError result; - sal_uInt8 pKeyData[64]; + sal_uInt8 pKeyData[64]; // 512-bit message block // Initialize KeyData array. (void)memset (pKeyData, 0, sizeof(pKeyData)); @@ -358,7 +402,7 @@ bool MSCodec_Std97::InitCipher (sal_uInt32 nCounter) // Initialize Cipher with KeyData (for decoding). result = rtl_cipher_init ( - m_hCipher, rtl_Cipher_DirectionDecode, + m_hCipher, rtl_Cipher_DirectionBoth, pKeyData, RTL_DIGEST_LENGTH_MD5, 0, 0); // Erase KeyData array and leave. @@ -367,6 +411,39 @@ bool MSCodec_Std97::InitCipher (sal_uInt32 nCounter) return (result == rtl_Cipher_E_None); } +bool MSCodec_Std97::CreateSaltDigest( const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] ) +{ +#if DEBUG_MSO_ENCRYPTION_STD97 + lcl_PrintDigest(pSaltData, "salt data"); +#endif + bool result = false; + + if (InitCipher(0)) + { + sal_uInt8 pDigest[RTL_DIGEST_LENGTH_MD5]; + GetDigestFromSalt(nSaltData, pDigest); + + rtl_cipher_decode ( + m_hCipher, pDigest, 16, pDigest, sizeof(pDigest)); + + (void)memcpy(nSaltDigest, pDigest, 16); + } + + return (result); +} + +bool MSCodec_Std97::Encode ( + const void *pData, sal_Size nDatLen, + sal_uInt8 *pBuffer, sal_Size nBufLen) +{ + rtlCipherError result; + + result = rtl_cipher_encode ( + m_hCipher, pData, nDatLen, pBuffer, nBufLen); + + return (result == rtl_Cipher_E_None); +} + bool MSCodec_Std97::Decode ( const void *pData, sal_Size nDatLen, sal_uInt8 *pBuffer, sal_Size nBufLen) @@ -395,6 +472,65 @@ bool MSCodec_Std97::Skip( sal_Size nDatLen ) return bResult; } +void MSCodec_Std97::GetDigestFromSalt( const sal_uInt8 pSaltData[16], sal_uInt8 pDigest[16] ) +{ + sal_uInt8 pBuffer[64]; + sal_uInt8 pDigestLocal[16]; + + // Decode SaltData into Buffer. + rtl_cipher_decode ( + m_hCipher, pSaltData, 16, pBuffer, sizeof(pBuffer)); + + // set the 129th bit to make the buffer 128-bit in length. + pBuffer[16] = 0x80; + + // erase the rest of the buffer with zeros. + (void)memset (pBuffer + 17, 0, sizeof(pBuffer) - 17); + + // set the 441st bit. + pBuffer[56] = 0x80; + + // Fill raw digest of Buffer into Digest. + rtl_digest_updateMD5 ( + m_hDigest, pBuffer, sizeof(pBuffer)); + rtl_digest_rawMD5 ( + m_hDigest, pDigestLocal, sizeof(pDigestLocal)); + + memcpy(pDigest, pDigestLocal, 16); +} + +void MSCodec_Std97::GetEncryptKey ( + const sal_uInt8 pSalt[16], + sal_uInt8 pSaltData[16], + sal_uInt8 pSaltDigest[16]) +{ + if (InitCipher(0)) + { + sal_uInt8 pDigest[RTL_DIGEST_LENGTH_MD5]; + sal_uInt8 pBuffer[64]; + + rtl_cipher_encode ( + m_hCipher, pSalt, 16, pSaltData, sizeof(pBuffer)); + + (void)memcpy( pBuffer, pSalt, 16 ); + + pBuffer[16] = 0x80; + (void)memset (pBuffer + 17, 0, sizeof(pBuffer) - 17); + pBuffer[56] = 0x80; + + rtl_digest_updateMD5 ( + m_hDigest, pBuffer, sizeof(pBuffer)); + rtl_digest_rawMD5 ( + m_hDigest, pDigest, sizeof(pDigest)); + + rtl_cipher_encode ( + m_hCipher, pDigest, 16, pSaltDigest, 16); + + (void)memset (pBuffer, 0, sizeof(pBuffer)); + (void)memset (pDigest, 0, sizeof(pDigest)); + } +} + // ============================================================================ } // namespace svx diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx index 554a185ced..31e7716651 100644 --- a/svx/source/msfilter/msdffimp.cxx +++ b/svx/source/msfilter/msdffimp.cxx @@ -4754,13 +4754,13 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r if ( ( nGroupRotateAngle > 4500 && nGroupRotateAngle <= 13500 ) || ( nGroupRotateAngle > 22500 && nGroupRotateAngle <= 31500 ) ) { - sal_Int32 nHalfWidth = ( aGlobalChildRect.GetWidth() + 1 ) >> 1; - sal_Int32 nHalfHeight = ( aGlobalChildRect.GetHeight() + 1 ) >> 1; - Point aTopLeft( aGlobalChildRect.Left() + nHalfWidth - nHalfHeight, - aGlobalChildRect.Top() + nHalfHeight - nHalfWidth ); - Size aNewSize( aGlobalChildRect.GetHeight(), aGlobalChildRect.GetWidth() ); + sal_Int32 nHalfWidth = ( aClientRect.GetWidth() + 1 ) >> 1; + sal_Int32 nHalfHeight = ( aClientRect.GetHeight() + 1 ) >> 1; + Point aTopLeft( aClientRect.Left() + nHalfWidth - nHalfHeight, + aClientRect.Top() + nHalfHeight - nHalfWidth ); + Size aNewSize( aClientRect.GetHeight(), aClientRect.GetWidth() ); Rectangle aNewRect( aTopLeft, aNewSize ); - aGlobalChildRect = aNewRect; + aClientRect = aNewRect; } // now importing the inner objects of the group diff --git a/svx/source/msfilter/msocximex.cxx b/svx/source/msfilter/msocximex.cxx index c8f4ba519f..493e097857 100644 --- a/svx/source/msfilter/msocximex.cxx +++ b/svx/source/msfilter/msocximex.cxx @@ -623,7 +623,11 @@ class ContainerRecReader pS->SeekRel( 4 ); // option flags if( nContentFlags & 0x00000010 ) - pS->SeekRel( 4 ); + { + sal_uInt32 nBitFlags = 0; + *pS >> nBitFlags; + rec.bVisible = ( ( nBitFlags & 0x02 ) == 0x02 ); + } // substream size if( nContentFlags & 0x00000020 ) *pS >> rec.nSubStreamLen; @@ -1212,6 +1216,13 @@ sal_Bool OCX_Control::Import(uno::Reference<container::XNameContainer> &rDialog xPropSet->setPropertyValue(WW8_ASCII2STR("Step"), aTmp); } + try + { + xPropSet->setPropertyValue(WW8_ASCII2STR("EnableVisible"), uno::makeAny( mbVisible ) ); + } + catch( uno::Exception& ) + { + } return sal_True; } @@ -3612,6 +3623,7 @@ void OCX_ContainerControl::ProcessControl(OCX_Control* pControl,SvStorageStream* // reflect the ms tabbing from orig MS UserForm, see below pControl->mnTabPos = rec.nTabPos; pControl->SetInDialog(true); + pControl->mbVisible = rec.bVisible; if ( mnStep ) { // If the container has a step then it should be diff --git a/svx/source/msfilter/svxmsbas.cxx b/svx/source/msfilter/svxmsbas.cxx index 4dd3446f61..a2448c8727 100644 --- a/svx/source/msfilter/svxmsbas.cxx +++ b/svx/source/msfilter/svxmsbas.cxx @@ -403,53 +403,4 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName, return bRet; } -ULONG SvxImportMSVBasic::SaveOrDelMSVBAStorage( BOOL bSaveInto, - const String& rStorageName ) -{ - ULONG nRet = ERRCODE_NONE; - uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() ); - String aDstStgName( GetMSBasicStorageName() ); - SotStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, - STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL ) ); - if( xVBAStg.Is() && !xVBAStg->GetError() ) - { - xVBAStg = 0; - if( bSaveInto ) - { - BasicManager *pBasicMan = rDocSh.GetBasicManager(); - if( pBasicMan && pBasicMan->IsBasicModified() ) - nRet = ERRCODE_SVX_MODIFIED_VBASIC_STORAGE; - - SotStorageRef xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, STREAM_STD_READ ); - SotStorageRef xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | STREAM_TRUNC ); - xSrc->CopyTo( xDst ); - xDst->Commit(); - ErrCode nError = xDst->GetError(); - if ( nError == ERRCODE_NONE ) - nError = xSrc->GetError(); - if ( nError != ERRCODE_NONE ) - xRoot->SetError( nError ); - } - } - - return nRet; -} - -// check if the MS-VBA-Storage exists in the RootStorage of the DocShell. -// If it exists, then return the WarningId for losing the information. -ULONG SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocSh) -{ - uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() ); - SvStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, GetMSBasicStorageName(), - STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL )); - return ( xVBAStg.Is() && !xVBAStg->GetError() ) - ? ERRCODE_SVX_VBASIC_STORAGE_EXIST - : ERRCODE_NONE; -} - -String SvxImportMSVBasic::GetMSBasicStorageName() -{ - return String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Macros" ) ); -} - /* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/svx/source/msfilter/svxmsbas2.cxx b/svx/source/msfilter/svxmsbas2.cxx new file mode 100644 index 0000000000..afd772bbd7 --- /dev/null +++ b/svx/source/msfilter/svxmsbas2.cxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * 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: svxmsbas.cxx,v $ + * $Revision: 1.24 $ + * + * 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_svx.hxx" + +#include <basic/basmgr.hxx> +#include <sfx2/objsh.hxx> +#include <svxerr.hxx> +#include <svxmsbas.hxx> + +using namespace com::sun::star; + +ULONG SvxImportMSVBasic::SaveOrDelMSVBAStorage( BOOL bSaveInto, + const String& rStorageName ) +{ + ULONG nRet = ERRCODE_NONE; + uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() ); + String aDstStgName( GetMSBasicStorageName() ); + SotStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, + STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL ) ); + if( xVBAStg.Is() && !xVBAStg->GetError() ) + { + xVBAStg = 0; + if( bSaveInto ) + { + BasicManager *pBasicMan = rDocSh.GetBasicManager(); + if( pBasicMan && pBasicMan->IsBasicModified() ) + nRet = ERRCODE_SVX_MODIFIED_VBASIC_STORAGE; + + SotStorageRef xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, STREAM_STD_READ ); + SotStorageRef xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | STREAM_TRUNC ); + xSrc->CopyTo( xDst ); + xDst->Commit(); + ErrCode nError = xDst->GetError(); + if ( nError == ERRCODE_NONE ) + nError = xSrc->GetError(); + if ( nError != ERRCODE_NONE ) + xRoot->SetError( nError ); + } + } + + return nRet; +} + +// check if the MS-VBA-Storage exists in the RootStorage of the DocShell. +// If it exists, then return the WarningId for losing the information. +ULONG SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocSh) +{ + uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() ); + SvStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, GetMSBasicStorageName(), + STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL )); + return ( xVBAStg.Is() && !xVBAStg->GetError() ) + ? ERRCODE_SVX_VBASIC_STORAGE_EXIST + : ERRCODE_NONE; +} + +String SvxImportMSVBasic::GetMSBasicStorageName() +{ + return String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Macros" ) ); +} diff --git a/svx/source/options/makefile.mk b/svx/source/options/makefile.mk index c4828b81f3..d68703983e 100644 --- a/svx/source/options/makefile.mk +++ b/svx/source/options/makefile.mk @@ -36,6 +36,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util\svxpch PRJNAME=svx TARGET=options +LIBTARGET=NO # --- Settings ----------------------------------------------------- @@ -62,39 +63,23 @@ SRC1FILES=\ optchart.src \ optimprove.src -#EXCEPTIONSFILES=\ -# $(SLO)$/optasian.obj \ -# $(SLO)$/optlingu.obj \ -# $(SLO)$/optaccessibility.obj \ -# $(SLO)$/optsave.obj \ -# $(SLO)$/optpath.obj - -#SLOFILES=\ -# $(EXCEPTIONSFILES) \ -# $(SLO)$/asiancfg.obj \ -# $(SLO)$/htmlcfg.obj \ -# $(SLO)$/optcolor.obj \ -# $(SLO)$/optjsearch.obj \ -# $(SLO)$/optitems.obj \ -# $(SLO)$/optgenrl.obj \ -# $(SLO)$/adritem.obj \ -# $(SLO)$/optgrid.obj \ -# $(SLO)$/optinet2.obj \ -# $(SLO)$/optextbr.obj \ -# $(SLO)$/srchcfg.obj \ -# $(SLO)$/optctl.obj - EXCEPTIONSFILES=\ $(SLO)$/optlingu.obj -SLOFILES=\ - $(EXCEPTIONSFILES) \ - $(SLO)$/asiancfg.obj \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ + $(SLO)$/asiancfg.obj + +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/optlingu.obj \ $(SLO)$/htmlcfg.obj \ $(SLO)$/optitems.obj \ $(SLO)$/optgrid.obj \ $(SLO)$/srchcfg.obj +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + # --- Targets ------------------------------------------------------- .INCLUDE : target.mk diff --git a/svx/source/options/optimprove.src b/svx/source/options/optimprove.src index 148d7391c9..86fc6d1c1a 100644 --- a/svx/source/options/optimprove.src +++ b/svx/source/options/optimprove.src @@ -87,7 +87,7 @@ TabPage RID_SVXPAGE_IMPROVEMENT { Pos = MAP_APPFONT ( 12 , 132 ) ; Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Number of reports send:" ; + Text [ en-US ] = "Number of reports sent:" ; }; FixedText FT_NR_REPORTS_VALUE { diff --git a/svx/source/outliner/outliner.cxx b/svx/source/outliner/outliner.cxx index 66aa95474d..f290864808 100644 --- a/svx/source/outliner/outliner.cxx +++ b/svx/source/outliner/outliner.cxx @@ -1519,14 +1519,14 @@ void Outliner::ImplCheckParagraphs( USHORT nStart, USHORT nEnd ) // --> OD 2009-03-10 #i100014# // assure that the following for-loop does not loop forever - for ( ULONG n = nStart; n < nEnd; n++ ) + for ( USHORT n = nStart; n < nEnd; n++ ) // <-- { Paragraph* pPara = pParaList->GetParagraph( n ); if (pPara) { pPara->Invalidate(); - ImplCalcBulletText( static_cast< USHORT >(n), FALSE, FALSE ); + ImplCalcBulletText( n, FALSE, FALSE ); } } } diff --git a/svx/source/outliner/outlobj.cxx b/svx/source/outliner/outlobj.cxx index bdcbcf88e6..72601d9d7e 100644 --- a/svx/source/outliner/outlobj.cxx +++ b/svx/source/outliner/outlobj.cxx @@ -77,6 +77,12 @@ public: && maParagraphDataVector == rCandidate.maParagraphDataVector && mbIsEditDoc == rCandidate.mbIsEditDoc); } + + // #i102062# + bool isWrongListEqual(const ImplOutlinerParaObject& rCompare) const + { + return mpEditTextObject->isWrongListEqual(*rCompare.mpEditTextObject); + } }; ////////////////////////////////////////////////////////////////////////////// @@ -147,6 +153,17 @@ bool OutlinerParaObject::operator==(const OutlinerParaObject& rCandidate) const return (*rCandidate.mpImplOutlinerParaObject == *mpImplOutlinerParaObject); } +// #i102062# +bool OutlinerParaObject::isWrongListEqual(const OutlinerParaObject& rCompare) const +{ + if(rCompare.mpImplOutlinerParaObject == mpImplOutlinerParaObject) + { + return true; + } + + return mpImplOutlinerParaObject->isWrongListEqual(*rCompare.mpImplOutlinerParaObject); +} + sal_uInt16 OutlinerParaObject::GetOutlinerMode() const { return mpImplOutlinerParaObject->mpEditTextObject->GetUserType(); diff --git a/svx/source/sdr/attribute/makefile.mk b/svx/source/sdr/attribute/makefile.mk index adbd85f88d..44e161a3b5 100644 --- a/svx/source/sdr/attribute/makefile.mk +++ b/svx/source/sdr/attribute/makefile.mk @@ -33,6 +33,7 @@ PRJ=..$/..$/.. PRJNAME=svx TARGET=attribute +ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- @@ -43,6 +44,8 @@ TARGET=attribute SLOFILES=\ $(SLO)$/sdrallattribute.obj \ - $(SLO)$/sdrtextattribute.obj + $(SLO)$/sdrtextattribute.obj \ + $(SLO)$/sdrformtextattribute.obj \ + $(SLO)$/sdrformtextoutlineattribute.obj .INCLUDE : target.mk diff --git a/svx/source/sdr/attribute/sdrallattribute.cxx b/svx/source/sdr/attribute/sdrallattribute.cxx index 6dea264890..1150f5a684 100644 --- a/svx/source/sdr/attribute/sdrallattribute.cxx +++ b/svx/source/sdr/attribute/sdrallattribute.cxx @@ -30,6 +30,7 @@ ************************************************************************/ #include "precompiled_svx.hxx" + #include <svx/sdr/attribute/sdrallattribute.hxx> #include <drawinglayer/attribute/sdrattribute.hxx> #include <drawinglayer/attribute/fillattribute.hxx> @@ -45,20 +46,20 @@ namespace drawinglayer { namespace attribute { - SdrShadowTextAttribute::SdrShadowTextAttribute(SdrShadowAttribute* pShadow, SdrTextAttribute* pTextAttribute) + SdrShadowTextAttribute::SdrShadowTextAttribute( + SdrShadowAttribute* pShadow, + SdrTextAttribute* pTextAttribute) : mpShadow(pShadow), mpTextAttribute(pTextAttribute) { } - SdrShadowTextAttribute::SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate) - : mpShadow(0L), - mpTextAttribute(0L) + SdrShadowTextAttribute::SdrShadowTextAttribute( + const SdrShadowTextAttribute& rCandidate) + : mpShadow(0), + mpTextAttribute(0) { - if(!(*this == rCandidate)) - { - *this = rCandidate; - } + *this = rCandidate; } SdrShadowTextAttribute::~SdrShadowTextAttribute() @@ -72,14 +73,14 @@ namespace drawinglayer // handle mpShadow { // delete local mpShadow if necessary - if(mpShadow && ((!rCandidate.mpShadow) || (!(*mpShadow == *rCandidate.mpShadow)))) + if(mpShadow) { delete mpShadow; - mpShadow = 0L; + mpShadow = 0; } // copy mpShadow if necessary - if(!mpShadow && rCandidate.mpShadow) + if(rCandidate.mpShadow) { mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow); } @@ -88,14 +89,14 @@ namespace drawinglayer // handle mpTextAttribute { // delete local mpTextAttribute if necessary - if(mpTextAttribute && ((!rCandidate.mpTextAttribute) || (!(*mpTextAttribute == *rCandidate.mpTextAttribute)))) + if(mpTextAttribute) { delete mpTextAttribute; - mpTextAttribute = 0L; + mpTextAttribute = 0; } // copy mpTextAttribute if necessary - if(!mpTextAttribute && rCandidate.mpTextAttribute) + if(rCandidate.mpTextAttribute) { mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute); } @@ -125,22 +126,23 @@ namespace drawinglayer { namespace attribute { - SdrFillTextAttribute::SdrFillTextAttribute(SdrFillAttribute* pFill, FillGradientAttribute* pFillFloatTransGradient, SdrTextAttribute* pTextAttribute) + SdrFillTextAttribute::SdrFillTextAttribute( + SdrFillAttribute* pFill, + FillGradientAttribute* pFillFloatTransGradient, + SdrTextAttribute* pTextAttribute) : mpFill(pFill), mpFillFloatTransGradient(pFillFloatTransGradient), mpTextAttribute(pTextAttribute) { } - SdrFillTextAttribute::SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate) + SdrFillTextAttribute::SdrFillTextAttribute( + const SdrFillTextAttribute& rCandidate) : mpFill(0), mpFillFloatTransGradient(0), mpTextAttribute(0) { - if(!(*this == rCandidate)) - { - *this = rCandidate; - } + *this = rCandidate; } SdrFillTextAttribute::~SdrFillTextAttribute() @@ -155,14 +157,14 @@ namespace drawinglayer // handle mpFill { // delete local mpFill if necessary - if(mpFill && ((!rCandidate.mpFill) || (!(*mpFill == *rCandidate.mpFill)))) + if(mpFill) { delete mpFill; - mpFill = 0L; + mpFill = 0; } // copy mpFill if necessary - if(!mpFill && rCandidate.mpFill) + if(rCandidate.mpFill) { mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill); } @@ -171,14 +173,14 @@ namespace drawinglayer // handle mpFillFloatTransGradient { // delete local mpFillFloatTransGradient if necessary - if(mpFillFloatTransGradient && ((!rCandidate.mpFillFloatTransGradient) || (!(*mpFillFloatTransGradient == *rCandidate.mpFillFloatTransGradient)))) + if(mpFillFloatTransGradient) { delete mpFillFloatTransGradient; - mpFillFloatTransGradient = 0L; + mpFillFloatTransGradient = 0; } // copy mpFillFloatTransGradient if necessary - if(!mpFillFloatTransGradient && rCandidate.mpFillFloatTransGradient) + if(rCandidate.mpFillFloatTransGradient) { mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient); } @@ -187,14 +189,14 @@ namespace drawinglayer // handle mpTextAttribute { // delete local mpTextAttribute if necessary - if(mpTextAttribute && ((!rCandidate.mpTextAttribute) || (!(*mpTextAttribute == *rCandidate.mpTextAttribute)))) + if(mpTextAttribute) { delete mpTextAttribute; - mpTextAttribute = 0L; + mpTextAttribute = 0; } // copy mpTextAttribute if necessary - if(!mpTextAttribute && rCandidate.mpTextAttribute) + if(rCandidate.mpTextAttribute) { mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute); } @@ -229,23 +231,23 @@ namespace drawinglayer namespace attribute { SdrLineShadowTextAttribute::SdrLineShadowTextAttribute( - SdrLineAttribute* pLine, SdrLineStartEndAttribute* pLineStartEnd, - SdrShadowAttribute* pShadow, SdrTextAttribute* pTextAttribute) + SdrLineAttribute* pLine, + SdrLineStartEndAttribute* pLineStartEnd, + SdrShadowAttribute* pShadow, + SdrTextAttribute* pTextAttribute) : SdrShadowTextAttribute(pShadow, pTextAttribute), mpLine(pLine), mpLineStartEnd(pLineStartEnd) { } - SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate) - : SdrShadowTextAttribute(0L, 0L), - mpLine(0L), - mpLineStartEnd(0L) + SdrLineShadowTextAttribute::SdrLineShadowTextAttribute( + const SdrLineShadowTextAttribute& rCandidate) + : SdrShadowTextAttribute(0, 0), + mpLine(0), + mpLineStartEnd(0) { - if(!(*this == rCandidate)) - { - *this = rCandidate; - } + *this = rCandidate; } SdrLineShadowTextAttribute::~SdrLineShadowTextAttribute() @@ -262,14 +264,14 @@ namespace drawinglayer // handle mpLine { // delete local mpLine if necessary - if(mpLine && ((!rCandidate.mpLine) || (!(*mpLine == *rCandidate.mpLine)))) + if(mpLine) { delete mpLine; - mpLine = 0L; + mpLine = 0; } // copy mpLine if necessary - if(!mpLine && rCandidate.mpLine) + if(rCandidate.mpLine) { mpLine = new SdrLineAttribute(*rCandidate.mpLine); } @@ -278,14 +280,14 @@ namespace drawinglayer // handle mpLineStartEnd { // delete local mpLineStartEnd if necessary - if(mpLineStartEnd && ((!rCandidate.mpLineStartEnd) || (!(*mpLineStartEnd == *rCandidate.mpLineStartEnd)))) + if(mpLineStartEnd) { delete mpLineStartEnd; - mpLineStartEnd = 0L; + mpLineStartEnd = 0; } // copy mpLineStartEnd if necessary - if(!mpLineStartEnd && rCandidate.mpLineStartEnd) + if(rCandidate.mpLineStartEnd) { mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd); } @@ -320,23 +322,25 @@ namespace drawinglayer namespace attribute { SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute( - SdrLineAttribute* pLine, attribute::SdrFillAttribute* pFill, SdrLineStartEndAttribute* pLineStartEnd, - SdrShadowAttribute* pShadow, FillGradientAttribute* pFillFloatTransGradient, SdrTextAttribute* pTextAttribute) + SdrLineAttribute* pLine, + attribute::SdrFillAttribute* pFill, + SdrLineStartEndAttribute* pLineStartEnd, + SdrShadowAttribute* pShadow, + FillGradientAttribute* pFillFloatTransGradient, + SdrTextAttribute* pTextAttribute) : SdrLineShadowTextAttribute(pLine, pLineStartEnd, pShadow, pTextAttribute), mpFill(pFill), mpFillFloatTransGradient(pFillFloatTransGradient) { } - SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate) - : SdrLineShadowTextAttribute(0L, 0L, 0L, 0L), - mpFill(0L), - mpFillFloatTransGradient(0L) + SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute( + const SdrLineFillShadowTextAttribute& rCandidate) + : SdrLineShadowTextAttribute(0, 0, 0, 0), + mpFill(0), + mpFillFloatTransGradient(0) { - if(!(*this == rCandidate)) - { - *this = rCandidate; - } + *this = rCandidate; } SdrLineFillShadowTextAttribute::~SdrLineFillShadowTextAttribute() @@ -353,14 +357,14 @@ namespace drawinglayer // handle mpFill { // delete local mpFill if necessary - if(mpFill && ((!rCandidate.mpFill) || (!(*mpFill == *rCandidate.mpFill)))) + if(mpFill) { delete mpFill; - mpFill = 0L; + mpFill = 0; } // copy mpFill if necessary - if(!mpFill && rCandidate.mpFill) + if(rCandidate.mpFill) { mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill); } @@ -369,14 +373,14 @@ namespace drawinglayer // handle mpFillFloatTransGradient { // delete local mpFillFloatTransGradient if necessary - if(mpFillFloatTransGradient && ((!rCandidate.mpFillFloatTransGradient) || (!(*mpFillFloatTransGradient == *rCandidate.mpFillFloatTransGradient)))) + if(mpFillFloatTransGradient) { delete mpFillFloatTransGradient; - mpFillFloatTransGradient = 0L; + mpFillFloatTransGradient = 0; } // copy mpFillFloatTransGradient if necessary - if(!mpFillFloatTransGradient && rCandidate.mpFillFloatTransGradient) + if(rCandidate.mpFillFloatTransGradient) { mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient); } diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx new file mode 100644 index 0000000000..8bd8c3b6b6 --- /dev/null +++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx @@ -0,0 +1,304 @@ +/************************************************************************* + * + * 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: sdrtextattribute.cxx,v $ + * + * $Revision: 1.2 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_svx.hxx" + +#include <svx/sdr/attribute/sdrformtextattribute.hxx> +#include <svtools/itemset.hxx> + +#include <svx/xftdiit.hxx> +#include <svx/xftstit.hxx> +#include <svx/xftshxy.hxx> +#include <svx/xftshtit.hxx> +#include <svx/xtextit0.hxx> +#include <svx/xftadit.hxx> +#include <svx/xftshit.hxx> +#include <svx/xftshcit.hxx> +#include <svx/xftmrit.hxx> +#include <svx/xftouit.hxx> + +#include <svx/sdshtitm.hxx> +#include <svx/xlntrit.hxx> +#include <drawinglayer/attribute/lineattribute.hxx> +#include <drawinglayer/attribute/strokeattribute.hxx> +#include <svx/sdshcitm.hxx> +#include <svx/xlnclit.hxx> +#include <svx/xlnwtit.hxx> +#include <xlinjoit.hxx> +#include <svx/xlineit0.hxx> +#include <svx/xdash.hxx> +#include <svx/xlndsit.hxx> +#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// +// pointer compare define +#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q)) + +////////////////////////////////////////////////////////////////////////////// +// helper to get line, stroke and transparence attributes from SfxItemSet + +namespace +{ + basegfx::B2DLineJoin impGetB2DLineJoin(XLineJoint eLineJoint) + { + switch(eLineJoint) + { + case XLINEJOINT_MIDDLE : + { + return basegfx::B2DLINEJOIN_MIDDLE; + } + case XLINEJOINT_BEVEL : + { + return basegfx::B2DLINEJOIN_BEVEL; + } + case XLINEJOINT_MITER : + { + return basegfx::B2DLINEJOIN_MITER; + } + case XLINEJOINT_ROUND : + { + return basegfx::B2DLINEJOIN_ROUND; + } + default : + { + return basegfx::B2DLINEJOIN_NONE; // XLINEJOINT_NONE + } + } + } + + sal_uInt8 impGetStrokeTransparence(bool bShadow, const SfxItemSet& rSet) + { + sal_uInt8 nRetval; + + if(bShadow) + { + nRetval = (sal_uInt8)((((SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue() * 255) / 100); + } + else + { + nRetval = (sal_uInt8)((((XLineTransparenceItem&)(rSet.Get(XATTR_LINETRANSPARENCE))).GetValue() * 255) / 100); + } + + return nRetval; + } + + drawinglayer::attribute::LineAttribute impGetLineAttribute(bool bShadow, const SfxItemSet& rSet) + { + basegfx::BColor aColorAttribute; + + if(bShadow) + { + const Color aShadowColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue()); + aColorAttribute = aShadowColor.getBColor(); + } + else + { + const Color aLineColor(((XLineColorItem&)(rSet.Get(XATTR_LINECOLOR))).GetColorValue()); + aColorAttribute = aLineColor.getBColor(); + } + + const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue(); + const XLineJoint eLineJoint = ((const XLineJointItem&)(rSet.Get(XATTR_LINEJOINT))).GetValue(); + + return drawinglayer::attribute::LineAttribute(aColorAttribute, (double)nLineWidth, impGetB2DLineJoin(eLineJoint)); + } + + drawinglayer::attribute::StrokeAttribute impGetStrokeAttribute(const SfxItemSet& rSet) + { + const XLineStyle eLineStyle = ((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue(); + double fFullDotDashLen(0.0); + ::std::vector< double > aDotDashArray; + + if(XLINE_DASH == eLineStyle) + { + const XDash& rDash = ((const XLineDashItem&)(rSet.Get(XATTR_LINEDASH))).GetDashValue(); + + if(rDash.GetDots() || rDash.GetDashes()) + { + const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue(); + fFullDotDashLen = rDash.CreateDotDashArray(aDotDashArray, (double)nLineWidth); + } + } + + return drawinglayer::attribute::StrokeAttribute(aDotDashArray, fFullDotDashLen); + } +} // end of anonymous namespace + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet) + : mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()), + mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()), + mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()), + mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()), + mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()), + meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()), + meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()), + meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()), + maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()), + mpOutline(0), + mpShadowOutline(0), + mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()), + mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue()) + { + if(getFormTextOutline()) + { + const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet)); + + // also need to prepare attributes for outlines + { + const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet)); + const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet)); + + mpOutline = new SdrFormTextOutlineAttribute( + aLineAttribute, aStrokeAttribute, nTransparence); + } + + if(XFTSHADOW_NONE != getFormTextShadow()) + { + // also need to prepare attributes for shadow outlines + const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet)); + const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet)); + + mpShadowOutline = new SdrFormTextOutlineAttribute( + aLineAttribute, aStrokeAttribute, nTransparence); + } + } + } + + SdrFormTextAttribute::~SdrFormTextAttribute() + { + if(mpOutline) + { + delete mpOutline; + mpOutline = 0; + } + + if(mpShadowOutline) + { + delete mpShadowOutline; + mpShadowOutline = 0; + } + } + + SdrFormTextAttribute::SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate) + : mnFormTextDistance(rCandidate.getFormTextDistance()), + mnFormTextStart(rCandidate.getFormTextStart()), + mnFormTextShdwXVal(rCandidate.getFormTextShdwXVal()), + mnFormTextShdwYVal(rCandidate.getFormTextShdwYVal()), + mnFormTextShdwTransp(rCandidate.getFormTextShdwTransp()), + meFormTextStyle(rCandidate.getFormTextStyle()), + meFormTextAdjust(rCandidate.getFormTextAdjust()), + meFormTextShadow(rCandidate.getFormTextShadow()), + maFormTextShdwColor(rCandidate.getFormTextShdwColor()), + mpOutline(0), + mpShadowOutline(0), + mbFormTextMirror(rCandidate.getFormTextMirror()), + mbFormTextOutline(rCandidate.getFormTextOutline()) + { + if(rCandidate.getOutline()) + { + mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline()); + } + + if(rCandidate.getShadowOutline()) + { + mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline()); + } + } + + SdrFormTextAttribute& SdrFormTextAttribute::operator=(const SdrFormTextAttribute& rCandidate) + { + mnFormTextDistance = rCandidate.getFormTextDistance(); + mnFormTextStart = rCandidate.getFormTextStart(); + mnFormTextShdwXVal = rCandidate.getFormTextShdwXVal(); + mnFormTextShdwYVal = rCandidate.getFormTextShdwYVal(); + mnFormTextShdwTransp = rCandidate.getFormTextShdwTransp(); + meFormTextStyle = rCandidate.getFormTextStyle(); + meFormTextAdjust = rCandidate.getFormTextAdjust(); + meFormTextShadow = rCandidate.getFormTextShadow(); + maFormTextShdwColor = rCandidate.getFormTextShdwColor(); + + if(mpOutline) + { + delete mpOutline; + } + + mpOutline = 0; + + if(rCandidate.getOutline()) + { + mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline()); + } + + if(mpShadowOutline) + { + delete mpShadowOutline; + } + + mpShadowOutline = 0; + + if(rCandidate.getShadowOutline()) + { + mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline()); + } + + mbFormTextMirror = rCandidate.getFormTextMirror(); + mbFormTextOutline = rCandidate.getFormTextOutline(); + + return *this; + } + + bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const + { + return (getFormTextDistance() == rCandidate.getFormTextDistance() + && getFormTextStart() == rCandidate.getFormTextStart() + && getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal() + && getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal() + && getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp() + && getFormTextStyle() == rCandidate.getFormTextStyle() + && getFormTextAdjust() == rCandidate.getFormTextAdjust() + && getFormTextShadow() == rCandidate.getFormTextShadow() + && getFormTextShdwColor() == rCandidate.getFormTextShdwColor() + && pointerOrContentEqual(getOutline(), rCandidate.getOutline()) + && pointerOrContentEqual(getShadowOutline(), rCandidate.getShadowOutline()) + && getFormTextMirror() == rCandidate.getFormTextMirror() + && getFormTextOutline() == rCandidate.getFormTextOutline()); + } + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/inc/svx/sdr/overlay/overlaysdrobject.hxx b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx index 1625ba89be..0a96ad2f6f 100644 --- a/svx/inc/svx/sdr/overlay/overlaysdrobject.hxx +++ b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx @@ -6,8 +6,9 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: overlaysdrobject.hxx,v $ - * $Revision: 1.4 $ + * $RCSfile: sdrtextattribute.cxx,v $ + * + * $Revision: 1.2 $ * * This file is part of OpenOffice.org. * @@ -28,47 +29,38 @@ * ************************************************************************/ -#ifndef _SDR_OVERLAY_OVERLAYSDROBJECT_HXX -#define _SDR_OVERLAY_OVERLAYSDROBJECT_HXX +#include "precompiled_svx.hxx" -#include <svx/sdr/overlay/overlayobject.hxx> +#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx> ////////////////////////////////////////////////////////////////////////////// -// predeclarations -class SdrObject; +// pointer compare define +#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q)) ////////////////////////////////////////////////////////////////////////////// -namespace sdr +namespace drawinglayer { - namespace overlay + namespace attribute { - class SVX_DLLPUBLIC OverlaySdrObject : public OverlayObjectWithBasePosition + SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute( + const LineAttribute& rLineAttribute, + const StrokeAttribute& rStrokeAttribute, + sal_uInt8 nTransparence) + : maLineAttribute(rLineAttribute), + maStrokeAttribute(rStrokeAttribute), + mnTransparence(nTransparence) { - protected: - // the SdrObject to show - const SdrObject& mrSdrObject; - - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); - - // Hittest with logical coordinates. Default tests against maBaseRange. - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; + } - public: - OverlaySdrObject( - const basegfx::B2DPoint& rBasePos, - const SdrObject& rObject); - virtual ~OverlaySdrObject(); - }; - } // end of namespace overlay -} // end of namespace sdr + bool SdrFormTextOutlineAttribute::operator==(const SdrFormTextOutlineAttribute& rCandidate) const + { + return (getLineAttribute() == rCandidate.getLineAttribute() + && getStrokeAttribute() == rCandidate.getStrokeAttribute() + && getTransparence() == rCandidate.getTransparence()); + } + } // end of namespace attribute +} // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// - -#endif //_SDR_OVERLAY_OVERLAYSDROBJECT_HXX - // eof diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index 591fcb026a..09f5299654 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -30,11 +30,18 @@ ************************************************************************/ #include "precompiled_svx.hxx" + #include <svx/sdr/attribute/sdrtextattribute.hxx> +#include <svx/sdr/attribute/sdrformtextattribute.hxx> #include <svx/svdotext.hxx> #include <svx/outlobj.hxx> #include <svx/editobj.hxx> #include <svx/flditem.hxx> +#include <svx/sdr/properties/properties.hxx> + +////////////////////////////////////////////////////////////////////////////// +// pointer compare define +#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q)) ////////////////////////////////////////////////////////////////////////////// @@ -56,13 +63,14 @@ namespace drawinglayer bool bBlink, bool bScroll, bool bInEditMode) - : mrSdrText(rSdrText), + : mpSdrText(&rSdrText), maOutlinerParaObject(rOutlinerParaObject), - meFormTextStyle(eFormTextStyle), + mpSdrFormTextAttribute(0), maTextLeftDistance(aTextLeftDistance), maTextUpperDistance(aTextUpperDistance), maTextRightDistance(aTextRightDistance), maTextLowerDistance(aTextLowerDistance), + maPropertiesVersion(0), mbContour(bContour), mbFitToSize(bFitToSize), mbHideContour(bHideContour), @@ -70,16 +78,94 @@ namespace drawinglayer mbScroll(bScroll), mbInEditMode(bInEditMode) { + if(XFT_NONE != eFormTextStyle) + { + // text on path. Create FormText attribute + const SfxItemSet& rSet = getSdrText().GetItemSet(); + mpSdrFormTextAttribute = new SdrFormTextAttribute(rSet); + } + + // #i101556# init with version number to detect changes of single text + // attribute and/or style sheets in primitive data without having to + // copy that data locally (which would be better from principle) + maPropertiesVersion = rSdrText.GetObject().GetProperties().getVersion(); + } + + SdrTextAttribute::~SdrTextAttribute() + { + if(mpSdrFormTextAttribute) + { + delete mpSdrFormTextAttribute; + mpSdrFormTextAttribute = 0; + } + } + + SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate) + : mpSdrText(&rCandidate.getSdrText()), + maOutlinerParaObject(rCandidate.getOutlinerParaObject()), + mpSdrFormTextAttribute(0), + maTextLeftDistance(rCandidate.getTextLeftDistance()), + maTextUpperDistance(rCandidate.getTextUpperDistance()), + maTextRightDistance(rCandidate.getTextRightDistance()), + maTextLowerDistance(rCandidate.getTextLowerDistance()), + mbContour(rCandidate.isContour()), + mbFitToSize(rCandidate.isFitToSize()), + mbHideContour(rCandidate.isHideContour()), + mbBlink(rCandidate.isBlink()), + mbScroll(rCandidate.isScroll()), + mbInEditMode(rCandidate.isInEditMode()) + { + if(rCandidate.getSdrFormTextAttribute()) + { + mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute()); + } + } + + SdrTextAttribute& SdrTextAttribute::operator=(const SdrTextAttribute& rCandidate) + { + mpSdrText = &rCandidate.getSdrText(); + maOutlinerParaObject = rCandidate.getOutlinerParaObject(); + + if(mpSdrFormTextAttribute) + { + delete mpSdrFormTextAttribute; + } + + mpSdrFormTextAttribute = 0; + + if(rCandidate.getSdrFormTextAttribute()) + { + mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute()); + } + + maTextLeftDistance = rCandidate.getTextLeftDistance(); + maTextUpperDistance = rCandidate.getTextUpperDistance(); + maTextRightDistance = rCandidate.getTextRightDistance(); + maTextLowerDistance = rCandidate.getTextLowerDistance(); + mbContour = rCandidate.isContour(); + mbFitToSize = rCandidate.isFitToSize(); + mbHideContour = rCandidate.isHideContour(); + mbBlink = rCandidate.isBlink(); + mbScroll = rCandidate.isScroll(); + mbInEditMode = rCandidate.isInEditMode(); + + return *this; } bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const { return (getOutlinerParaObject() == rCandidate.getOutlinerParaObject() - && getFormTextStyle() == rCandidate.getFormTextStyle() + // #i102062# for primitive visualisation, the WrongList (SpellChecking) + // is important, too, so use isWrongListEqual since there is no WrongList + // comparison in the regular OutlinerParaObject compare (since it's + // not-persistent data) + && getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject()) + && pointerOrContentEqual(getSdrFormTextAttribute(), rCandidate.getSdrFormTextAttribute()) && getTextLeftDistance() == rCandidate.getTextLeftDistance() && getTextUpperDistance() == rCandidate.getTextUpperDistance() && getTextRightDistance() == rCandidate.getTextRightDistance() && getTextLowerDistance() == rCandidate.getTextLowerDistance() + && getPropertiesVersion() == rCandidate.getPropertiesVersion() && isContour() == rCandidate.isContour() && isFitToSize() == rCandidate.isFitToSize() && isHideContour() == rCandidate.isHideContour() @@ -92,7 +178,7 @@ namespace drawinglayer { if(isBlink()) { - mrSdrText.GetObject().impGetBlinkTextTiming(rAnimList); + mpSdrText->GetObject().impGetBlinkTextTiming(rAnimList); } } @@ -100,7 +186,7 @@ namespace drawinglayer { if(isScroll()) { - mrSdrText.GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength); + mpSdrText->GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength); } } } // end of namespace attribute diff --git a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx index 61d5cc78cb..e61c73c2d8 100644 --- a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx @@ -75,8 +75,8 @@ namespace sdr basegfx::B3DPolyPolygon aPolyPolygon3D(GetE3dPolygonObj().GetPolyPolygon3D()); const basegfx::B3DPolyPolygon aPolyNormals3D(GetE3dPolygonObj().GetPolyNormals3D()); const basegfx::B2DPolyPolygon aPolyTexture2D(GetE3dPolygonObj().GetPolyTexture2D()); - const bool bNormals(aPolyNormals3D.count()); - const bool bTexture(aPolyTexture2D.count()); + const bool bNormals(aPolyNormals3D.count() && aPolyNormals3D.count() == aPolyPolygon3D.count());
+ const bool bTexture(aPolyTexture2D.count() && aPolyTexture2D.count() == aPolyPolygon3D.count());
if(bNormals || bTexture) { @@ -100,12 +100,19 @@ namespace sdr { if(bNormals) { - aCandidate3D.setNormal(b, aNormals3D.getB3DPoint(b)); + sal_uInt32 nNormalCount = aNormals3D.count(); + if( b < nNormalCount ) + aCandidate3D.setNormal(b, aNormals3D.getB3DPoint(b)); + else if( nNormalCount > 0 ) + aCandidate3D.setNormal(b, aNormals3D.getB3DPoint(0)); } - if(bTexture) { - aCandidate3D.setTextureCoordinate(b, aTexture2D.getB2DPoint(b)); + sal_uInt32 nTextureCount = aTexture2D.count(); + if( b < nTextureCount ) + aCandidate3D.setTextureCoordinate(b, aTexture2D.getB2DPoint(b)); + else if( nTextureCount > 0 ) + aCandidate3D.setTextureCoordinate(b, aTexture2D.getB2DPoint(0)); } } diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 3f6ac13caf..29ee7efce1 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -53,6 +53,18 @@ #include <svdglob.hxx> #include <vcl/svapp.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> +#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> +#include <drawinglayer/primitive2d/textprimitive2d.hxx> +#include <drawinglayer/primitive2d/textlayoutdevice.hxx> +#include <drawinglayer/primitive2d/maskprimitive2d.hxx> + +#include <svx/sdr/primitive2d/sdrtextprimitive2d.hxx> +#include <svx/eeitem.hxx> +#include <svx/colritem.hxx> +//#include <svx/xtable.hxx> + ////////////////////////////////////////////////////////////////////////////// namespace sdr @@ -78,6 +90,238 @@ namespace sdr { } + void ViewContactOfGraphic::flushGraphicObjects() + { + // #i102380# The graphic is swapped out. To let that have an effect ist is necessary to + // delete copies of the GraphicObject which are not swapped out and have no SwapHandler set + // (this is what happnes when the GraphicObject gets copied to a SdrGrafPrimitive2D). This + // is best achieved for the VC by clearing the local decomposition cache. It would be possible + // to also do this for the VOC cache, but that VOCs exist exactly expresss that the object + // gets visualised, so this would be wrong. + flushViewIndependentPrimitive2DSequence(); + } + + drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createVIP2DSForPresObj( + const basegfx::B2DHomMatrix& rObjectMatrix, + const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute, + const GraphicAttr& rLocalGrafInfo) const + { + drawinglayer::primitive2d::Primitive2DSequence xRetval; + GraphicObject aEmptyGraphicObject; + GraphicAttr aEmptyGraphicAttr; + + // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts + const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D( + rObjectMatrix, + rAttribute, + aEmptyGraphicObject, + aEmptyGraphicAttr)); + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1); + + // SdrGrafPrimitive2D with content (which is the preview graphic) scaled to smaller size and + // without attributes + basegfx::B2DHomMatrix aSmallerMatrix; + + // #i94431# for some reason, i forgot to take the PrefMapMode of the graphic + // into account. Since EmptyPresObj's are only used in Draw/Impress, it is + // safe to assume 100th mm as target. + Size aPrefSize(GetGrafObject().GetGrafPrefSize()); + + if(MAP_PIXEL == GetGrafObject().GetGrafPrefMapMode().GetMapUnit()) + { + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM); + } + else + { + aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MAP_100TH_MM); + } + + // decompose object matrix to get single values + basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + rObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX); + + const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 2.0); + const double fOffsetY((aScale.getY() - aPrefSize.getHeight()) / 2.0); + + if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0)) + { + // create the EmptyPresObj fallback visualisation. The fallback graphic + // is already provided in rGraphicObject in this case, use it + aSmallerMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight()); + aSmallerMatrix.translate(fOffsetX, fOffsetY); + aSmallerMatrix.shearX(fShearX); + aSmallerMatrix.rotate(fRotate); + aSmallerMatrix.translate(aTranslate.getX(), aTranslate.getY()); + + const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false); + const drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0); + const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D( + aSmallerMatrix, + aEmptyAttributes, + rGraphicObject, + rLocalGrafInfo)); + + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReferenceB); + } + + return xRetval; + } + + drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createVIP2DSForDraft( + const basegfx::B2DHomMatrix& rObjectMatrix, + const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const + { + drawinglayer::primitive2d::Primitive2DSequence xRetval; + GraphicObject aEmptyGraphicObject; + GraphicAttr aEmptyGraphicAttr; + + // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts + const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D( + rObjectMatrix, + rAttribute, + aEmptyGraphicObject, + aEmptyGraphicAttr)); + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1); + + if(!rAttribute.getLine()) + { + // create a surrounding frame when no linestyle given + const Color aColor(Application::GetSettings().GetStyleSettings().GetShadowColor()); + const basegfx::BColor aBColor(aColor.getBColor()); + const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0); + + basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange)); + aOutline.transform(rObjectMatrix); + + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, + drawinglayer::primitive2d::Primitive2DReference( + new drawinglayer::primitive2d::PolygonHairlinePrimitive2D( + aOutline, + aBColor))); + } + + // decompose object matrix to get single values + basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + rObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX); + + // define a distance value, used for distance from bitmap to borders and from bitmap + // to text, too (2 mm) + const double fDistance(200.0); + + // consume borders from values + aScale.setX(std::max(0.0, aScale.getX() - (2.0 * fDistance))); + aScale.setY(std::max(0.0, aScale.getY() - (2.0 * fDistance))); + aTranslate.setX(aTranslate.getX() + fDistance); + aTranslate.setY(aTranslate.getY() + fDistance); + + // draw a draft bitmap + const Bitmap aDraftBitmap(ResId(BMAP_GrafikEi, *ImpGetResMgr())); + + if(!aDraftBitmap.IsEmpty()) + { + Size aPrefSize(aDraftBitmap.GetPrefSize()); + + if(MAP_PIXEL == aDraftBitmap.GetPrefMapMode().GetMapUnit()) + { + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MAP_100TH_MM); + } + else + { + aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MAP_100TH_MM); + } + + const double fBitmapScaling(2.0); + const double fWidth(aPrefSize.getWidth() * fBitmapScaling); + const double fHeight(aPrefSize.getHeight() * fBitmapScaling); + + if(basegfx::fTools::more(fWidth, 1.0) + && basegfx::fTools::more(fHeight, 1.0) + && basegfx::fTools::lessOrEqual(fWidth, aScale.getX()) + && basegfx::fTools::lessOrEqual(fHeight, aScale.getY())) + { + basegfx::B2DHomMatrix aBitmapMatrix; + + aBitmapMatrix.scale(fWidth, fHeight); + aBitmapMatrix.shearX(fShearX); + aBitmapMatrix.rotate(fRotate); + aBitmapMatrix.translate(aTranslate.getX(), aTranslate.getY()); + + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, + drawinglayer::primitive2d::Primitive2DReference( + new drawinglayer::primitive2d::BitmapPrimitive2D( + BitmapEx(aDraftBitmap), + aBitmapMatrix))); + + // consume bitmap size in X + aScale.setX(std::max(0.0, aScale.getX() - (fWidth + fDistance))); + aTranslate.setX(aTranslate.getX() + fWidth + fDistance); + } + } + + // Build the text for the draft object + XubString aDraftText = GetGrafObject().GetFileName(); + + if(!aDraftText.Len()) + { + aDraftText = GetGrafObject().GetName(); + aDraftText.AppendAscii(" ..."); + } + + if(aDraftText.Len() && GetGrafObject().GetModel()) + { + // #i103255# Goal is to produce TextPrimitives which hold the given text as + // BlockText in the available space. It would be very tricky to do + // an own word wrap/line layout here. + // Using SdrBlockTextPrimitive2D OTOH is critical since it internally + // uses the SdrObject it references. To solve this, create a temp + // SdrObject with Attributes and Text, generate a SdrBlockTextPrimitive2D + // directly and immediately decompose it. After that, it is no longer + // needed and can be deleted. + + // create temp RectObj as TextObj and set needed attributes + SdrRectObj aRectObj(OBJ_TEXT); + aRectObj.SetModel(GetGrafObject().GetModel()); + aRectObj.NbcSetText(aDraftText); + aRectObj.SetMergedItem(SvxColorItem(Color(COL_LIGHTRED), EE_CHAR_COLOR)); + + // get SdrText and OPO + SdrText* pSdrText = aRectObj.getText(0); + OutlinerParaObject* pOPO = aRectObj.GetOutlinerParaObject(); + + if(pSdrText && pOPO) + { + // directly use the remaining space as TextRangeTransform + basegfx::B2DHomMatrix aTextRangeTransform; + + aTextRangeTransform.scale(aScale.getX(), aScale.getY()); + aTextRangeTransform.shearX(fShearX); + aTextRangeTransform.rotate(fRotate); + aTextRangeTransform.translate(aTranslate.getX(), aTranslate.getY()); + + // directly create temp SdrBlockTextPrimitive2D + drawinglayer::primitive2d::SdrBlockTextPrimitive2D aBlockTextPrimitive( + pSdrText, + *pOPO, + aTextRangeTransform, + false, + false, + false); + + // decompose immediately with neutral ViewInformation. This will + // layout the text to more simple TextPrimitives from drawinglayer + const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0); + + drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence( + xRetval, + aBlockTextPrimitive.get2DDecomposition(aViewInformation2D)); + } + } + + return xRetval; + } + drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createViewIndependentPrimitive2DSequence() const { drawinglayer::primitive2d::Primitive2DSequence xRetval; @@ -86,7 +330,8 @@ namespace sdr if(pSdrText) { const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet(); - drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText); + drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = + drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText); bool bVisible(pAttribute && pAttribute->isVisible()); // create and fill GraphicAttr @@ -131,7 +376,7 @@ namespace sdr // which will use the primitive data we just create in the near future const Rectangle& rRectangle = GetGrafObject().GetGeoRect(); const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); - ::basegfx::B2DHomMatrix aObjectMatrix; + basegfx::B2DHomMatrix aObjectMatrix; // look for mirroring const GeoStat& rGeoStat(GetGrafObject().GetGeoStat()); @@ -170,60 +415,25 @@ namespace sdr // get the current, unchenged graphic obect from SdrGrafObj const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false); - if(GetGrafObject().IsEmptyPresObj()) + if(visualisationUsesPresObj()) { // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one // with the content which is the placeholder graphic - GraphicObject aEmptyGraphicObject; - GraphicAttr aEmptyGraphicAttr; - drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0); - - // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts - const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D( - aObjectMatrix, *pAttribute, aEmptyGraphicObject, aEmptyGraphicAttr)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1); - - // SdrGrafPrimitive2D with content (which is the preview graphic) scaled to smaller size and - // without attributes - basegfx::B2DHomMatrix aSmallerMatrix; - - // #i94431# for some reason, i forgot to take the PrefMapMode of the graphic - // into account. Since EmptyPresObj's are only used in Draw/Impress, it is - // safe to assume 100th mm as target. - Size aPrefSize(GetGrafObject().GetGrafPrefSize()); - - if(MAP_PIXEL == GetGrafObject().GetGrafPrefMapMode().GetMapUnit()) - { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM); - } - else - { - aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MAP_100TH_MM); - } - - const double fOffsetX((aObjectRange.getWidth() - aPrefSize.getWidth()) / 2.0); - const double fOffsetY((aObjectRange.getHeight() - aPrefSize.getHeight()) / 2.0); - - if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0)) - { - aSmallerMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight()); - aSmallerMatrix.translate(fOffsetX, fOffsetY); - aSmallerMatrix.shearX(fShearX); - aSmallerMatrix.rotate(fRotate); - aSmallerMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY()); - - const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D( - aSmallerMatrix, - aEmptyAttributes, - rGraphicObject, - aLocalGrafInfo)); - - drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReferenceB); - } + xRetval = createVIP2DSForPresObj(aObjectMatrix, *pAttribute, aLocalGrafInfo); + } + else if(visualisationUsesDraft()) + { + // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism + // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious + // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent + // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster + // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages + xRetval = createVIP2DSForDraft(aObjectMatrix, *pAttribute); } else { - // create primitive + // create primitive. Info: Calling the copy-constructor of GraphicObject in this + // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D( aObjectMatrix, *pAttribute, @@ -241,6 +451,31 @@ namespace sdr return xRetval; } + bool ViewContactOfGraphic::visualisationUsesPresObj() const + { + return GetGrafObject().IsEmptyPresObj(); + } + + bool ViewContactOfGraphic::visualisationUsesDraft() const + { + // no draft when already PresObj + if(visualisationUsesPresObj()) + return false; + + // draft when swapped out + const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false); + static bool bAllowReplacements(true); + + if(rGraphicObject.IsSwappedOut() && bAllowReplacements) + return true; + + // draft when no graphic + if(GRAPHIC_NONE == rGraphicObject.GetType() || GRAPHIC_DEFAULT == rGraphicObject.GetType()) + return true; + + return false; + } + } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx index 9ef9832871..454b68cbfb 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -45,6 +45,7 @@ #include <svtools/colorcfg.hxx> #include <svx/sdr/primitive2d/sdrattributecreator.hxx> #include <vcl/svapp.hxx> +#include <svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -71,7 +72,8 @@ namespace sdr { } - drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithGivenGraphic(const Graphic& rOLEGraphic, bool bScaleContent) const + drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters( + bool bHighContrast) const { drawinglayer::primitive2d::Primitive2DSequence xRetval; SdrText* pSdrText = GetOle2Obj().getText(0); @@ -103,80 +105,24 @@ namespace sdr pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0, 0, 0, 0, 0, 0); } - // Prepare OLE filling. This is normally the metafile describing OLE content, but may also - // be the empty OLE bitmap for empty/not loaded OLEs - const GraphicObject aGraphicObject(rOLEGraphic); - const GraphicAttr aGraphicAttr; - drawinglayer::primitive2d::Primitive2DSequence xOLEContent; + // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing + // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect + // calculations without OLE Graphic access (which may trigger e.g. chart recalculation). + // It will also take care of HighContrast and ScaleContent + const drawinglayer::primitive2d::Primitive2DReference xOleContent( + new drawinglayer::primitive2d::SdrOleContentPrimitive2D( + GetOle2Obj(), + aObjectMatrix, + bHighContrast)); - if(bScaleContent) - { - // Create outline and placeholder graphic with some scaling - // #i94431# for some reason, i forgot to take the PrefMapMode of the graphic - // into account. Since EmptyPresObj's are only used in Draw/Impress, it is - // safe to assume 100th mm as target. - Size aPrefSize(rOLEGraphic.GetPrefSize()); - - if(MAP_PIXEL == rOLEGraphic.GetPrefMapMode().GetMapUnit()) - { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM); - } - else - { - aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, rOLEGraphic.GetPrefMapMode(), MAP_100TH_MM); - } - - const double fOffsetX((aObjectRange.getWidth() - aPrefSize.getWidth()) / 2.0); - const double fOffsetY((aObjectRange.getHeight() - aPrefSize.getHeight()) / 2.0); - - if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0)) - { - // if content fits into frame, create it - basegfx::B2DHomMatrix aInnerObjectMatrix; - - aInnerObjectMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight()); - aInnerObjectMatrix.translate(fOffsetX, fOffsetY); - aInnerObjectMatrix.shearX(fShearX); - aInnerObjectMatrix.rotate(fRotate); - aInnerObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY()); - - drawinglayer::primitive2d::Primitive2DReference xScaledContent( - new drawinglayer::primitive2d::GraphicPrimitive2D(aInnerObjectMatrix, aGraphicObject, aGraphicAttr)); - xOLEContent = drawinglayer::primitive2d::Primitive2DSequence(&xScaledContent, 1); - } - } - else - { - // create graphic primitive for content - drawinglayer::primitive2d::Primitive2DReference xDirectContent( - new drawinglayer::primitive2d::GraphicPrimitive2D(aObjectMatrix, aGraphicObject, aGraphicAttr)); - xOLEContent = drawinglayer::primitive2d::Primitive2DSequence(&xDirectContent, 1); - } - // create primitive. Use Ole2 primitive here. Prepare attribute settings, will be used soon anyways. + const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1); const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrOle2Primitive2D( xOLEContent, aObjectMatrix, *pAttribute)); xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); delete pAttribute; - - // a standard gray outline is created for scaled content - if(bScaleContent) - { - const svtools::ColorConfig aColorConfig; - const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES)); - - if(aColor.bIsVisible) - { - basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0, 0, 1, 1))); - const Color aVclColor(aColor.nColor); - aOutline.transform(aObjectMatrix); - const drawinglayer::primitive2d::Primitive2DReference xOutline( - new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aVclColor.getBColor())); - drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xOutline); - } - } } return xRetval; @@ -184,21 +130,8 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createViewIndependentPrimitive2DSequence() const { - const Graphic* pOLEGraphic = GetOle2Obj().GetGraphic(); - - if(pOLEGraphic) - { - // there is a graphic set, use it - return createPrimitive2DSequenceWithGivenGraphic(*pOLEGraphic, GetOle2Obj().IsEmptyPresObj()); - } - else - { - // no graphic, use default empty OLE bitmap - const Bitmap aEmptyOLEBitmap(GetOle2Obj().GetEmtyOLEReplacementBitmap()); - const Graphic aEmtyOLEGraphic(aEmptyOLEBitmap); - - return createPrimitive2DSequenceWithGivenGraphic(aEmtyOLEGraphic, true); - } + // do as if no HC and call standard creator + return createPrimitive2DSequenceWithParameters(false); } } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index da467f8c63..1cb99de835 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -62,59 +62,86 @@ namespace sdr if(pSdrText) { - drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText); + drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = + drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( + rItemSet, + *pSdrText); if(pAttribute) { if(pAttribute->isVisible()) { - // prepare object transformation and unit polygon (direct model data) - ::basegfx::B2DHomMatrix aObjectMatrix; - ::basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly()); - const bool bIsLine( - !aUnitPolyPolygon.areControlPointsUsed() - && 1L == aUnitPolyPolygon.count() - && 2L == aUnitPolyPolygon.getB2DPolygon(0L).count()); - - if(bIsLine) - { - // special handling for single line mode (2 points) - const ::basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0L)); - const ::basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0L)); - const ::basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1L)); - const ::basegfx::B2DVector aLine(aEnd - aStart); - - // create new polygon - ::basegfx::B2DPolygon aNewPolygon; - aNewPolygon.append(::basegfx::B2DPoint(0.0, 0.0)); - aNewPolygon.append(::basegfx::B2DPoint(aLine.getLength(), 0.0)); - aUnitPolyPolygon.setB2DPolygon(0L, aNewPolygon); - - // fill objectMatrix with rotation and offset (no shear for lines, scale in polygon) - aObjectMatrix.rotate(atan2(aLine.getY(), aLine.getX())); - aObjectMatrix.translate(aStart.getX(), aStart.getY()); - } - else + basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly()); + const sal_uInt32 nPolyCount(aUnitPolyPolygon.count()); + + if(nPolyCount) { - // create scaled, but unsheared, unrotated and untranslated polygon - // by creating the object matrix and back-transforming the polygon - const ::basegfx::B2DRange aObjectRange(::basegfx::tools::getRange(aUnitPolyPolygon)); - const GeoStat& rGeoStat(GetPathObj().GetGeoStat()); - - aObjectMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000)); - aObjectMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); - aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY()); - - // ceate scaled unit polygon from object's absolute path - ::basegfx::B2DHomMatrix aInverse(aObjectMatrix); - aInverse.invert(); - aUnitPolyPolygon.transform(aInverse); + // prepare object transformation and unit polygon (direct model data) + basegfx::B2DHomMatrix aObjectMatrix; + const bool bIsLine( + !aUnitPolyPolygon.areControlPointsUsed() + && 1 == nPolyCount + && 2 == aUnitPolyPolygon.getB2DPolygon(0).count()); + + if(bIsLine) + { + // special handling for single line mode (2 points) + const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0)); + const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0)); + const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1)); + const basegfx::B2DVector aLine(aEnd - aStart); + + // #i102548# create new unit polygon for line (horizontal) + basegfx::B2DPolygon aNewPolygon; + aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0)); + aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0)); + aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon); + + // #i102548# fill objectMatrix with rotation and offset (no shear for lines) + aObjectMatrix.scale(aLine.getLength(), 1.0); + aObjectMatrix.rotate(atan2(aLine.getY(), aLine.getX())); + aObjectMatrix.translate(aStart.getX(), aStart.getY()); + } + else + { + // #i102548# create unscaled, unsheared, unrotated and untranslated polygon + // (unit polygon) by creating the object matrix and back-transforming the polygon + const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon)); + const GeoStat& rGeoStat(GetPathObj().GetGeoStat()); + const double fWidth(aObjectRange.getWidth()); + const double fHeight(aObjectRange.getHeight()); + + aObjectMatrix.scale( + basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth, + basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight); + + if(rGeoStat.nShearWink) + { + aObjectMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000)); + } + + if(rGeoStat.nDrehWink) + { + aObjectMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); + } + + aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY()); + + // ceate unit polygon from object's absolute path + basegfx::B2DHomMatrix aInverse(aObjectMatrix); + aInverse.invert(); + aUnitPolyPolygon.transform(aInverse); + } + + // create primitive + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrPathPrimitive2D( + aObjectMatrix, + *pAttribute, + aUnitPolyPolygon)); + + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } - - // create primitive - const drawinglayer::primitive2d::Primitive2DReference xReference( - new drawinglayer::primitive2d::SdrPathPrimitive2D(aObjectMatrix, *pAttribute, aUnitPolyPolygon)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } delete pAttribute; diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx index 0c6d3177b9..9c7810ea46 100644 --- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx @@ -105,8 +105,14 @@ namespace sdr drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY); // create primitive - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrRectanglePrimitive2D( - aObjectMatrix, *pAttribute, fCornerRadiusX, fCornerRadiusY)); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrRectanglePrimitive2D( + aObjectMatrix, + *pAttribute, + fCornerRadiusX, + fCornerRadiusY, + GetRectObj().IsTextFrame())); + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx index 7a6e115490..276da4a240 100644 --- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx @@ -38,6 +38,7 @@ #include <svx/svdograf.hxx> #include <svx/sdr/contact/objectcontact.hxx> #include <svx/svdmodel.hxx> +#include <svx/svdpage.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -219,6 +220,11 @@ namespace sdr SdrGrafObj& rGrafObj = getSdrGrafObj(); rGrafObj.ForceSwapIn(); + // #i103720# forget event to avoid possible deletion by the following ActionChanged call + // which may use createPrimitive2DSequence/impPrepareGraphicWithAsynchroniousLoading again. + // Deletion is actally done by the scheduler who leaded to coming here + mpAsynchLoadEvent = 0; + // Invalidate all paint areas and check existing animation (which may have changed). GetViewContact().ActionChanged(); } @@ -229,11 +235,15 @@ namespace sdr void ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent(sdr::event::AsynchGraphicLoadingEvent* pEvent) { (void) pEvent; // suppress warning - DBG_ASSERT(mpAsynchLoadEvent, "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: I did not trigger a event, why am i called (?)"); - DBG_ASSERT(mpAsynchLoadEvent == pEvent, "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: Forced to forget another event then i have scheduled (?)"); - // forget event - mpAsynchLoadEvent = 0; + if(mpAsynchLoadEvent) + { + OSL_ENSURE(!pEvent || mpAsynchLoadEvent == pEvent, + "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: Forced to forget another event then i have scheduled (?)"); + + // forget event + mpAsynchLoadEvent = 0; + } } SdrGrafObj& ViewObjectContactOfGraphic::getSdrGrafObj() @@ -245,10 +255,19 @@ namespace sdr { // prepare primitive generation with evtl. loading the graphic when it's swapped out SdrGrafObj& rGrafObj = const_cast< ViewObjectContactOfGraphic* >(this)->getSdrGrafObj(); - const bool bDoAsynchronGraphicLoading(rGrafObj.GetModel() && rGrafObj.GetModel()->IsSwapGraphics()); + bool bDoAsynchronGraphicLoading(rGrafObj.GetModel() && rGrafObj.GetModel()->IsSwapGraphics()); static bool bSuppressAsynchLoading(false); bool bSwapInDone(false); + if(bDoAsynchronGraphicLoading + && rGrafObj.IsSwappedOut() + && rGrafObj.GetPage() + && rGrafObj.GetPage()->IsMasterPage()) + { + // #i102380# force Swap-In for GraphicObjects on MasterPage to have a nicer visualisation + bDoAsynchronGraphicLoading = false; + } + if(bDoAsynchronGraphicLoading && !bSuppressAsynchLoading) { bSwapInDone = const_cast< ViewObjectContactOfGraphic* >(this)->impPrepareGraphicWithAsynchroniousLoading(); @@ -261,6 +280,23 @@ namespace sdr // get return value by calling parent drawinglayer::primitive2d::Primitive2DSequence xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo); + if(xRetval.hasElements()) + { + // #i103255# suppress when graphic needs draft visualisation and output + // is for PDF export/Printer + const ViewContactOfGraphic& rVCOfGraphic = static_cast< const ViewContactOfGraphic& >(GetViewContact()); + + if(rVCOfGraphic.visualisationUsesDraft()) + { + const ObjectContact& rObjectContact = GetObjectContact(); + + if(rObjectContact.isOutputToPDFFile() || rObjectContact.isOutputToPrinter()) + { + xRetval = drawinglayer::primitive2d::Primitive2DSequence(); + } + } + } + // if swap in was forced only for printing, swap out again const bool bSwapInExclusiveForPrinting(bSwapInDone && GetObjectContact().isOutputToPrinter()); diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx index f69f4d5550..87ba0b8c3a 100644 --- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx @@ -291,7 +291,8 @@ namespace sdr } // add a gray outline frame, except not when printing - if(!GetObjectContact().isOutputToPrinter()) + // #i102637# add frame also when printing and page exists (handout pages) + if(!GetObjectContact().isOutputToPrinter() || pPage) { const Color aFrameColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES).nColor); basegfx::B2DPolygon aOwnOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx index b11bc993f3..9c9aaa959c 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx @@ -37,10 +37,13 @@ #include <svx/sdr/contact/viewcontactofsdrole2obj.hxx> #include <svx/svdoole2.hxx> #include <svx/sdr/contact/objectcontact.hxx> +#include <svx/svdview.hxx> #include <drawinglayer/primitive2d/chartprimitive2d.hxx> #include <drawinglayer/attribute/fillattribute.hxx> #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <com/sun/star/embed/EmbedMisc.hpp>
+#include <com/sun/star/embed/EmbedStates.hpp>
////////////////////////////////////////////////////////////////////////////// @@ -57,138 +60,175 @@ namespace sdr return static_cast< ViewContactOfSdrOle2Obj& >(GetViewContact()).GetOle2Obj(); } - drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfSdrOle2Obj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const + drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfSdrOle2Obj::createPrimitive2DSequence( + const DisplayInfo& /*rDisplayInfo*/) const { // this method is overloaded to do some things the old SdrOle2Obj::DoPaintObject did. // In the future, some of these may be solved different, but ATM try to stay compatible // with the old behaviour drawinglayer::primitive2d::Primitive2DSequence xRetval; const SdrOle2Obj& rSdrOle2 = getSdrOle2Object(); - const bool bIsActive(rSdrOle2.executeOldDoPaintPreparations(GetObjectContact().TryToGetSdrPageView())); - const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect()); - const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom()); - - // create object transform - basegfx::B2DHomMatrix aObjectTransform; - aObjectTransform.set(0, 0, aObjectRange.getWidth()); - aObjectTransform.set(1, 1, aObjectRange.getHeight()); - aObjectTransform.set(0, 2, aObjectRange.getMinX()); - aObjectTransform.set(1, 2, aObjectRange.getMinY()); - - if(GetObjectContact().isDrawModeHighContrast()) - { - // directly call at the corresponding VC and force OLE Graphic to HighContrast - const ViewContactOfSdrOle2Obj& rVC = static_cast< const ViewContactOfSdrOle2Obj& >(GetViewContact()); - Graphic* pOLEHighContrastGraphic = rSdrOle2.getEmbeddedObjectRef().GetHCGraphic(); + sal_Int32 nState(-1); - if(pOLEHighContrastGraphic) - { - // there is a graphic set, use it - xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(*pOLEHighContrastGraphic, rSdrOle2.IsEmptyPresObj()); - } - else - { - // no HighContrast graphic, use default empty OLE bitmap - const Bitmap aEmptyOLEBitmap(rSdrOle2.GetEmtyOLEReplacementBitmap()); - const Graphic aEmtyOLEGraphic(aEmptyOLEBitmap); - - xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(aEmtyOLEGraphic, true); - } - } - else { - // call parent which will use the regular createViewIndependentPrimitive2DSequence - // at the corresponding VC - xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo); + const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef(); + if ( xObjRef.is() ) + nState = xObjRef->getCurrentState(); } - if(rSdrOle2.getEmbeddedObjectRef().IsChart()) + const bool bIsOutplaceActive(nState == embed::EmbedStates::ACTIVE); + const bool bIsInplaceActive((nState == embed::EmbedStates::INPLACE_ACTIVE) || (nState == embed::EmbedStates::UI_ACTIVE)); + const bool bIsChart(rSdrOle2.IsChart()); + bool bDone(false); + + if(!bDone && bIsInplaceActive) { - // for chart, to not lose the current better quality visualisation which - // uses a direct paint, use a primtive wrapper for that exceptional case. The renderers - // will then ATM paint it to an OutputDevice directly. - // In later versions this should be replaced by getting the Primitive2DSequnce from - // the chart and using it. - // to be able to render something in non-VCL using renderers, the wrapper is a - // GroupPrimitive2D which automatically decomposes to the already created Metafile - // content. - // For being completely compatible, ATM Window and VDEV PrettyPrinting is suppressed. - // It works in the VCL renderers, though. So for activating again with VCL primitive - // renderers, change conditions here. - - // determine if embedding and PrettyPrinting shall be done at all - uno::Reference< frame::XModel > xChartModel; - bool bDoChartPrettyPrinting(true); - static bool bPrettyPrintingForBitmaps(false); - - // the original ChartPrettyPainter does not do it for Window - if(!bPrettyPrintingForBitmaps && bDoChartPrettyPrinting && GetObjectContact().isOutputToWindow()) + if( !GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile() ) { - bDoChartPrettyPrinting = false; + //no need to create a primitive sequence here as the OLE object does render itself + //in case of charts the superfluous creation of a metafile is strongly performance relevant! + bDone = true; } + } + + if( !bDone ) + { + const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect()); + const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom()); + + // create object transform + basegfx::B2DHomMatrix aObjectTransform; + aObjectTransform.set(0, 0, aObjectRange.getWidth()); + aObjectTransform.set(1, 1, aObjectRange.getHeight()); + aObjectTransform.set(0, 2, aObjectRange.getMinX()); + aObjectTransform.set(1, 2, aObjectRange.getMinY()); - // the original ChartPrettyPainter does not do it for VDEV - if(!bPrettyPrintingForBitmaps && bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice()) + if(bIsChart) { - if(GetObjectContact().isOutputToPDFFile()) + //charts must be painted resolution dependent!! #i82893#, #i75867# + + // for chart, to not lose the current better quality visualisation which + // uses a direct paint, use a primtive wrapper for that exceptional case. The renderers + // will then ATM paint it to an OutputDevice directly. + // In later versions this should be replaced by getting the Primitive2DSequnce from + // the chart and using it. + // to be able to render something in non-VCL using renderers, the wrapper is a + // GroupPrimitive2D which automatically decomposes to the already created Metafile + // content. + // For being completely compatible, ATM Window and VDEV PrettyPrinting is suppressed. + // It works in the VCL renderers, though. So for activating again with VCL primitive + // renderers, change conditions here. + + // determine if embedding and PrettyPrinting shall be done at all + uno::Reference< frame::XModel > xChartModel; + bool bDoChartPrettyPrinting(true); + + // the original ChartPrettyPainter does not do it for Window + if(bDoChartPrettyPrinting && GetObjectContact().isOutputToWindow()) { - // #i97982# - // For PDF files, allow PrettyPrinting + bDoChartPrettyPrinting = false; } - else + + // the original ChartPrettyPainter does not do it for VDEV + if(bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice()) { - bDoChartPrettyPrinting = false; + if(GetObjectContact().isOutputToPDFFile()) + { + // #i97982# + // For PDF files, allow PrettyPrinting + } + else + { + bDoChartPrettyPrinting = false; + } } - } - // the chart model is needed. Check if it's available - if(bDoChartPrettyPrinting) - { - // get chart model - xChartModel = rSdrOle2.getXModel(); + // the chart model is needed. Check if it's available + if(bDoChartPrettyPrinting) + { + // get chart model + xChartModel = rSdrOle2.getXModel(); - if(!xChartModel.is()) + if(!xChartModel.is()) + { + bDoChartPrettyPrinting = false; + } + } + + if(bDoChartPrettyPrinting) { - bDoChartPrettyPrinting = false; + // embed MetaFile data in a specialized Wrapper Primitive which holds also the ChartModel needed + // for PrettyPrinting + const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ChartPrimitive2D( + xChartModel, aObjectTransform, xRetval)); + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + bDone = true; } } - if(bDoChartPrettyPrinting) + if( !bDone ) { - // embed MetaFile data in a specialized Wrapper Primitive which holds also the ChartModel needed - // for PrettyPrinting - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ChartPrimitive2D( - xChartModel, aObjectTransform, xRetval)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + //old stuff that should be reworked + { + //if no replacement image is available load the OLE object + if(!rSdrOle2.GetGraphic()) //try to fetch the metafile - this can lead to the actual creation of the metafile what can be extremely expensive (e.g. for big charts)!!! #i101925# + { + // try to create embedded object + rSdrOle2.GetObjRef(); //this loads the OLE object if it is not loaded already + } + const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef(); + if(xObjRef.is()) + { + const sal_Int64 nMiscStatus(xObjRef->getStatus(rSdrOle2.GetAspect())); + + // this hack (to change model data during PAINT argh(!)) should be reworked + if(!rSdrOle2.IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE)) + { + const_cast< SdrOle2Obj* >(&rSdrOle2)->SetResizeProtect(true); + } + + SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView(); + if(pPageView && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE)) + { + // connect plugin object + pPageView->GetView().DoConnect(const_cast< SdrOle2Obj* >(&rSdrOle2)); + } + } + }//end old stuff to rework + + // create OLE primitive stuff directly at VC with HC as parameter + const ViewContactOfSdrOle2Obj& rVC = static_cast< const ViewContactOfSdrOle2Obj& >(GetViewContact()); + xRetval = rVC.createPrimitive2DSequenceWithParameters(GetObjectContact().isDrawModeHighContrast()); } - } - if(bIsActive) - { - // do not shade when printing or PDF exporting - if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile()) + if(bIsOutplaceActive) { - // shade the representation if the object is activated outplace - basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); - aObjectOutline.transform(aObjectTransform); - - // Use a FillHatchPrimitive2D with necessary attributes - const drawinglayer::attribute::FillHatchAttribute aFillHatch( - drawinglayer::attribute::HATCHSTYLE_SINGLE, // single hatch - 125.0, // 1.25 mm - 45.0 * F_PI180, // 45 degree diagonal - Color(COL_BLACK).getBColor(), // black color - false); // no filling - - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D( - basegfx::B2DPolyPolygon(aObjectOutline), - Color(COL_BLACK).getBColor(), - aFillHatch)); - - drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReference); + // do not shade when printing or PDF exporting + if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile()) + { + // shade the representation if the object is activated outplace + basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + aObjectOutline.transform(aObjectTransform); + + // Use a FillHatchPrimitive2D with necessary attributes + const drawinglayer::attribute::FillHatchAttribute aFillHatch( + drawinglayer::attribute::HATCHSTYLE_SINGLE, // single hatch + 125.0, // 1.25 mm + 45.0 * F_PI180, // 45 degree diagonal + Color(COL_BLACK).getBColor(), // black color + false); // no filling + + const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D( + basegfx::B2DPolyPolygon(aObjectOutline), + Color(COL_BLACK).getBColor(), + aFillHatch)); + + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReference); + } } - } + } + return xRetval; } diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 43114516c7..2ba50855ae 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -35,6 +35,7 @@ #include <svx/sdr/contact/displayinfo.hxx> #include <svx/sdr/properties/properties.hxx> #include <svx/sdr/contact/objectcontactofpageview.hxx> +#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx> /** === begin UNO includes === **/ #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -80,6 +81,7 @@ namespace sdr { namespace contact { using ::com::sun::star::uno::XInterface; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::awt::XControl; @@ -175,7 +177,11 @@ namespace sdr { namespace contact { inline void addWindowListener( const Reference< XWindowListener >& _l ) const { m_xControlWindow->addWindowListener( _l ); } inline void removeWindowListener( const Reference< XWindowListener >& _l ) const { m_xControlWindow->removeWindowListener( _l ); } void setPosSize( const Rectangle& _rPosSize ) const; - void setZoom( const MapMode& _rMapMode ) const; + Rectangle + getPosSize() const; + void setZoom( const ::basegfx::B2DVector& _rScale ) const; + ::basegfx::B2DVector + getZoom() const; inline void setGraphics( const Reference< XGraphics >& _g ) const { m_xControlView->setGraphics( _g ); } inline Reference< XGraphics > @@ -221,10 +227,36 @@ namespace sdr { namespace contact { } //-------------------------------------------------------------------- - void ControlHolder::setZoom( const MapMode& _rMapMode ) const + ::Rectangle ControlHolder::getPosSize() const { // no check whether we're valid, this is the responsibility of the caller - m_xControlView->setZoom( (float)double( _rMapMode.GetScaleX() ), (float)double( _rMapMode.GetScaleY() ) ); + return VCLUnoHelper::ConvertToVCLRect( m_xControlWindow->getPosSize() ); + } + + //-------------------------------------------------------------------- + void ControlHolder::setZoom( const ::basegfx::B2DVector& _rScale ) const + { + // no check whether we're valid, this is the responsibility of the caller + m_xControlView->setZoom( (float)_rScale.getX(), (float)_rScale.getY() ); + } + + //-------------------------------------------------------------------- + ::basegfx::B2DVector ControlHolder::getZoom() const + { + // no check whether we're valid, this is the responsibility of the caller + + // Argh. Why does XView have a setZoom only, but not a getZoom? + Window* pWindow = VCLUnoHelper::GetWindow( m_xControlWindow ); + OSL_ENSURE( pWindow, "ControlHolder::setZoom: no implementation access!" ); + + ::basegfx::B2DVector aZoom( 1, 1 ); + if ( pWindow ) + { + const Fraction& rZoom( pWindow->GetZoom() ); + aZoom.setX( (double)rZoom ); + aZoom.setY( (double)rZoom ); + } + return aZoom; } //==================================================================== @@ -233,37 +265,13 @@ namespace sdr { namespace contact { class UnoControlContactHelper { public: - /** positions a control relative to a device - - @precond <arg>_pDevice</arg> is not <NULL/> + /** positions a control, and sets its zoom mode, using a given transformation and output device */ - static void positionControl_throw( + static void adjustControlGeometry_throw( const ControlHolder& _rControl, const Rectangle& _rLogicBoundingRect, - const OutputDevice* _pDevice - ); - - /** sets the zoom at a UNO control, according to a Device's MapMode - - @precond <arg>_pDevice</arg> is not <NULL/> - */ - static void setControlZoom( - const ControlHolder& _rControl, - const OutputDevice* _pDevice - ); - - /** draws a given control onto it's current XGraphics, at given coordinates - - Note that the control is not drawn onto the given device, instead you must - use ->XView::setGraphics yourself, before calling this method. The given ->OutputDevice - is only used to calculate pixel coordinates from logic coordinates - - @precond <arg>_pDevice</arg> is not <NULL/> - */ - static void drawControl( - const ControlHolder& _rControl, - const Point& _rLogicTopLeft, - const OutputDevice* _pDevice + const ::basegfx::B2DHomMatrix& _rViewTransformation, + const ::basegfx::B2DHomMatrix& _rZoomLevelNormalization ); /** disposes the given control @@ -279,50 +287,28 @@ namespace sdr { namespace contact { }; //-------------------------------------------------------------------- - void UnoControlContactHelper::positionControl_throw( const ControlHolder& _rControl, const Rectangle& _rLogicBoundingRect, - const OutputDevice* _pDevice ) + void UnoControlContactHelper::adjustControlGeometry_throw( const ControlHolder& _rControl, const Rectangle& _rLogicBoundingRect, + const basegfx::B2DHomMatrix& _rViewTransformation, const ::basegfx::B2DHomMatrix& _rZoomLevelNormalization ) { - OSL_PRECOND( _pDevice, "UnoControlContactHelper::positionControl_throw: no device -> no survival!" ); - - if ( _rControl.is() ) - { - const Rectangle aPaintRectPixel( - _pDevice->LogicToPixel( _rLogicBoundingRect.TopLeft() ), - _pDevice->LogicToPixel( _rLogicBoundingRect.GetSize() ) - ); - - _rControl.setPosSize( aPaintRectPixel ); - } - } - - //-------------------------------------------------------------------- - void UnoControlContactHelper::setControlZoom( const ControlHolder& _rControl, const OutputDevice* _pDevice ) - { - OSL_PRECOND( _pDevice, "UnoControlContactHelper::setControlZoom: no device -> no survival!" ); - OSL_PRECOND( _rControl.is(), "UnoControlContactHelper::setControlZoom: illegal control!" ); - - if ( _rControl.is() ) - _rControl.setZoom( _pDevice->GetMapMode() ); - } - - //-------------------------------------------------------------------- - void UnoControlContactHelper::drawControl( const ControlHolder& _rControl, const Point& _rLogicTopLeft, - const OutputDevice* _pDevice ) - { - OSL_PRECOND( _rControl.is(), "UnoControlContactHelper::drawControl: invalid control!" ); + OSL_PRECOND( _rControl.is(), "UnoControlContactHelper::adjustControlGeometry_throw: illegal control!" ); if ( !_rControl.is() ) return; - try - { - _rControl.draw( - _pDevice->LogicToPixel( _rLogicTopLeft ) - ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } + // transform the logic bound rect, using the view transformation, to pixel coordinates + ::basegfx::B2DPoint aTopLeft( _rLogicBoundingRect.Left(), _rLogicBoundingRect.Top() ); + aTopLeft *= _rViewTransformation; + ::basegfx::B2DPoint aBottomRight( _rLogicBoundingRect.Right(), _rLogicBoundingRect.Bottom() ); + aBottomRight *= _rViewTransformation; + + const Rectangle aPaintRectPixel( (long)aTopLeft.getX(), (long)aTopLeft.getY(), (long)aBottomRight.getX(), (long)aBottomRight.getY() ); + _rControl.setPosSize( aPaintRectPixel ); + + // determine the scale from the current view transformation, and the normalization matrix + ::basegfx::B2DHomMatrix aObtainResolutionDependentScale( _rViewTransformation * _rZoomLevelNormalization ); + ::basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + aObtainResolutionDependentScale.decompose( aScale, aTranslate, fRotate, fShearX ); + _rControl.setZoom( aScale ); } //-------------------------------------------------------------------- @@ -402,40 +388,7 @@ namespace sdr { namespace contact { } //==================================================================== - //= DummyPageViewAccess - //==================================================================== - /** is a ->IPageViewAccess implementation which defaults all attribute access, and thus can be - operated without an actual ->SdrPageView - */ - class DummyPageViewAccess : public IPageViewAccess - { - public: - virtual bool isDesignMode() const; - virtual Reference< XControlContainer > - getControlContainer( const OutputDevice& _rDevice ) const; - virtual bool isLayerVisible( SdrLayerID _nLayerID ) const; - }; - - //-------------------------------------------------------------------- - bool DummyPageViewAccess::isDesignMode() const - { - return true; - } - - //-------------------------------------------------------------------- - Reference< XControlContainer > DummyPageViewAccess::getControlContainer( const OutputDevice& /*_rDevice*/ ) const - { - return Reference< XControlContainer >(); - } - - //-------------------------------------------------------------------- - bool DummyPageViewAccess::isLayerVisible( SdrLayerID /*_nLayerID*/ ) const - { - return true; - } - - //==================================================================== - //= DummyPageViewAccess + //= InvisibleControlViewAccess //==================================================================== /** is a ->IPageViewAccess implementation which can be used to create an invisble control for an arbitrary device @@ -510,7 +463,7 @@ namespace sdr { namespace contact { Reference< XContainer > m_xContainer; /// the output device for which the control was created - OutputDevice const* m_pOutputDeviceForWindow; + const OutputDevice* m_pOutputDeviceForWindow; /// flag indicating whether the control is currently visible bool m_bControlIsVisible; @@ -527,6 +480,8 @@ namespace sdr { namespace contact { /// is the control currently in design mode? mutable ViewControlMode m_eControlDesignMode; + ::basegfx::B2DHomMatrix m_aZoomLevelNormalization; + public: ViewObjectContactOfUnoControl_Impl( ViewObjectContactOfUnoControl* _pAntiImpl ); @@ -549,17 +504,13 @@ namespace sdr { namespace contact { */ bool getUnoObject( SdrUnoObj*& _out_rpObject ) const; - /** ensures that we have an XControl which can be painted onto the given display - */ - bool ensureControl( const DisplayInfo& _rDisplayInfo ); - /** ensures that we have an ->XControl Must only be called if a control is needed when no DisplayInfo is present, yet. - For creating a control, an ->OutputDevice is needed, and an ->SdrPageView. Both can only be - obtained from a ->DisplayInfo struct, or alternatively a ->ObjectContactOfPageView. So, if - our (anti-impl's) object contact is not a ->ObjectContactOfPageView, this method fill fail. + For creating a control, an ->OutputDevice is needed, and an ->SdrPageView. Both will be obtained + from a ->ObjectContactOfPageView. So, if our (anti-impl's) object contact is not a ->ObjectContactOfPageView, + this method fill fail. Failure of this method will be reported via an assertion in a non-product version. */ @@ -572,22 +523,16 @@ namespace sdr { namespace contact { inline const ControlHolder& getExistentControl() const { return m_aControl; } - /** positions our XControl according to the geometry settings in the SdrUnoObj, - and sets proper zoom settings according to our device + inline bool + hasControl() const { return m_aControl.is(); } + + /** positions our XControl according to the geometry settings in the SdrUnoObj, modified by the given + transformation, and sets proper zoom settings according to our device @precond ->m_pOutputDeviceForWindow and ->m_aControl are not <NULL/> - @tolerant - If the preconditions are not met, nothing is done at all */ - void positionAndZoomControl() const; - - /** positions the control for a paint onto a given device - - If we do not (yet) have a control, or the control does not belong to the - device for which a paint is requested, no positioning happens. - */ - void positionControlForPaint( const DisplayInfo& _rDisplayInfo ) const; + void positionAndZoomControl( const basegfx::B2DHomMatrix& _rViewTransformation ) const; /** determines whether or not our control is printable @@ -626,6 +571,13 @@ namespace sdr { namespace contact { struct GuardAccess { friend class VOCGuard; private: GuardAccess() { } }; ::osl::Mutex& getMutex( GuardAccess ) const { return m_aMutex; } + const ViewContactOfUnoControl& + getViewContact() const + { + ENSURE_OR_THROW( !impl_isDisposed_nofail(), "already disposed" ); + return static_cast< const ViewContactOfUnoControl& >( m_pAntiImpl->GetViewContact() ); + } + protected: ~ViewObjectContactOfUnoControl_Impl(); @@ -797,10 +749,11 @@ namespace sdr { namespace contact { This method cares for this, by retrieving the very original OutputDevice. */ - const OutputDevice& imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact ) const; + static const OutputDevice& imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact ); + const OutputDevice& imp_getPageViewDevice_nothrow() const; private: - ViewObjectContactOfUnoControl_Impl(); // never implemented + ViewObjectContactOfUnoControl_Impl(); // never implemented ViewObjectContactOfUnoControl_Impl( const ViewObjectContactOfUnoControl_Impl& ); // never implemented ViewObjectContactOfUnoControl_Impl& operator=( const ViewObjectContactOfUnoControl_Impl& ); // never implemented }; @@ -812,18 +765,65 @@ namespace sdr { namespace contact { */ class VOCGuard { - const ViewObjectContactOfUnoControl_Impl& m_rImpl; - ::osl::MutexGuard m_aMutexGuard; + private: + ::osl::MutexGuard m_aMutexGuard; public: VOCGuard( const ViewObjectContactOfUnoControl_Impl& _rImpl ) - :m_rImpl( _rImpl ) - ,m_aMutexGuard( _rImpl.getMutex( ViewObjectContactOfUnoControl_Impl::GuardAccess() ) ) + :m_aMutexGuard( _rImpl.getMutex( ViewObjectContactOfUnoControl_Impl::GuardAccess() ) ) { } }; //==================================================================== + //= LazyControlCreationPrimitive2D + //==================================================================== + class LazyControlCreationPrimitive2D : public ::drawinglayer::primitive2d::BasePrimitive2D + { + private: + typedef ::drawinglayer::primitive2d::BasePrimitive2D BasePrimitive2D; + + protected: + virtual ::drawinglayer::primitive2d::Primitive2DSequence + get2DDecomposition( + const ::drawinglayer::geometry::ViewInformation2D& rViewInformation + ) const; + + virtual ::drawinglayer::primitive2d::Primitive2DSequence + createLocalDecomposition( + const ::drawinglayer::geometry::ViewInformation2D& rViewInformation + ) const; + + virtual ::basegfx::B2DRange + getB2DRange( + const ::drawinglayer::geometry::ViewInformation2D& rViewInformation + ) const; + + public: + LazyControlCreationPrimitive2D( const ::rtl::Reference< ViewObjectContactOfUnoControl_Impl >& _pVOCImpl ) + :m_pVOCImpl( _pVOCImpl ) + { + ENSURE_OR_THROW( m_pVOCImpl.is(), "Illegal argument." ); + getTransformation( m_pVOCImpl->getViewContact(), m_aTransformation ); + } + + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // declare unique ID for this primitive class + DeclPrimitrive2DIDBlock() + + static void getTransformation( const ViewContactOfUnoControl& _rVOC, ::basegfx::B2DHomMatrix& _out_Transformation ); + + private: + ::rtl::Reference< ViewObjectContactOfUnoControl_Impl > m_pVOCImpl; + /** The geometry is part of the identity of an primitive, so we cannot calculate it on demand + (since the data the calculation is based on might have changed then), but need to calc + it at construction time, and remember it. + */ + ::basegfx::B2DHomMatrix m_aTransformation; + }; + + //==================================================================== //= ViewObjectContactOfUnoControl_Impl //==================================================================== DBG_NAME( ViewObjectContactOfUnoControl_Impl ) @@ -834,10 +834,20 @@ namespace sdr { namespace contact { ,m_bControlIsVisible( false ) ,m_bIsDesignModeListening( false ) ,m_eControlDesignMode( eUnknown ) + ,m_aZoomLevelNormalization() { DBG_CTOR( ViewObjectContactOfUnoControl_Impl, NULL ); DBG_ASSERT( m_pAntiImpl, "ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl: invalid AntiImpl!" ); - } + + const OutputDevice& rPageViewDevice( imp_getPageViewDevice_nothrow() ); + m_aZoomLevelNormalization = rPageViewDevice.GetInverseViewTransformation(); + + ::basegfx::B2DHomMatrix aScaleNormalization; + MapMode aCurrentDeviceMapMode( rPageViewDevice.GetMapMode() ); + aScaleNormalization.set( 0, 0, (double)aCurrentDeviceMapMode.GetScaleX() ); + aScaleNormalization.set( 1, 1, (double)aCurrentDeviceMapMode.GetScaleY() ); + m_aZoomLevelNormalization *= aScaleNormalization; + } //-------------------------------------------------------------------- ViewObjectContactOfUnoControl_Impl::~ViewObjectContactOfUnoControl_Impl() @@ -898,27 +908,21 @@ namespace sdr { namespace contact { } //-------------------------------------------------------------------- - void ViewObjectContactOfUnoControl_Impl::positionControlForPaint( const DisplayInfo& /* #i74769# _rDisplayInfo*/ ) const - { - if ( !m_aControl.is() ) - return; - - positionAndZoomControl(); - } - - //-------------------------------------------------------------------- - void ViewObjectContactOfUnoControl_Impl::positionAndZoomControl() const + void ViewObjectContactOfUnoControl_Impl::positionAndZoomControl( const basegfx::B2DHomMatrix& _rViewTransformation ) const { - OSL_PRECOND( m_pOutputDeviceForWindow && m_aControl.is(), "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no output device or no control!" ); - if ( !m_pOutputDeviceForWindow || !m_aControl.is() ) + OSL_PRECOND( ( m_pOutputDeviceForWindow != NULL ) && m_aControl.is(), "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no output device or no control!" ); + if ( ( m_pOutputDeviceForWindow == NULL ) || !m_aControl.is() ) return; try { SdrUnoObj* pUnoObject( NULL ); if ( getUnoObject( pUnoObject ) ) - UnoControlContactHelper::positionControl_throw( m_aControl, pUnoObject->GetLogicRect(), m_pOutputDeviceForWindow ); - UnoControlContactHelper::setControlZoom( m_aControl, m_pOutputDeviceForWindow ); + { + UnoControlContactHelper::adjustControlGeometry_throw( m_aControl, pUnoObject->GetLogicRect(), _rViewTransformation, m_aZoomLevelNormalization ); + } + else + OSL_ENSURE( false, "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no SdrUnoObj!" ); } catch( const Exception& ) { @@ -927,37 +931,6 @@ namespace sdr { namespace contact { } //-------------------------------------------------------------------- - bool ViewObjectContactOfUnoControl_Impl::ensureControl( const DisplayInfo& /*_rDisplayInfo*/ ) - { - OSL_PRECOND( !impl_isDisposed_nofail(), "ViewObjectContactOfUnoControl_Impl::ensureControl: already disposed()" ); - if ( impl_isDisposed_nofail() ) - return false; - - const OutputDevice* pDeviceForControl( NULL ); - - // if we're working for a page view, use the respective OutputDevice at the proper - // PaintWindow. The DisplayInfo might only contain a temporary (virtual) device, which - // is dangerous to remember - // 2006-10-24 / #i70604# / frank.schoenheit@sun.com - ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &m_pAntiImpl->GetObjectContact() ); - if ( pPageViewContact ) - pDeviceForControl = &imp_getPageViewDevice_nothrow( *pPageViewContact ); - - if ( !pDeviceForControl && pPageViewContact) - pDeviceForControl = pPageViewContact->TryToGetOutputDevice(); - - DBG_ASSERT( pDeviceForControl, "ViewObjectContactOfUnoControl_Impl::ensureControl: no output device!" ); - if ( !pDeviceForControl ) - return false; - - SdrPageView* pPageView = m_pAntiImpl->GetObjectContact().TryToGetSdrPageView(); - - ::std::auto_ptr< IPageViewAccess > pPVAccess; - pPVAccess.reset( pPageView ? (IPageViewAccess*)new SdrPageViewAccess( *pPageView ) : (IPageViewAccess*)new DummyPageViewAccess() ); - return impl_ensureControl_nothrow( *pPVAccess, *pDeviceForControl ); - } - - //-------------------------------------------------------------------- bool ViewObjectContactOfUnoControl_Impl::ensureControl() { OSL_PRECOND( !impl_isDisposed_nofail(), "ViewObjectContactOfUnoControl_Impl::ensureControl: already disposed()" ); @@ -977,13 +950,21 @@ namespace sdr { namespace contact { } //-------------------------------------------------------------------- - const OutputDevice& ViewObjectContactOfUnoControl_Impl::imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact ) const + const OutputDevice& ViewObjectContactOfUnoControl_Impl::imp_getPageViewDevice_nothrow() const + { + ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &m_pAntiImpl->GetObjectContact() ); + ENSURE_OR_THROW( pPageViewContact, "need a ObjectContactOfPageView." ); + return imp_getPageViewDevice_nothrow( *pPageViewContact ); + } + + //-------------------------------------------------------------------- + const OutputDevice& ViewObjectContactOfUnoControl_Impl::imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact ) { // if the PageWindow has a patched PaintWindow, use the original PaintWindow // this ensures that our control is _not_ re-created just because somebody // (temporarily) changed the window to paint onto. // #i72429# / 2007-02-20 / frank.schoenheit@sun.com - const SdrPageWindow& rPageWindow( _rObjectContact.GetPageWindow() ); + SdrPageWindow& rPageWindow( _rObjectContact.GetPageWindow() ); if ( rPageWindow.GetOriginalPaintWindow() ) return rPageWindow.GetOriginalPaintWindow()->GetOutputDevice(); @@ -1001,7 +982,7 @@ namespace sdr { namespace contact { // Somebody requested a control for a new device, which means either of // - our PageView's paint window changed since we were last here // - we don't belong to a page view, and are simply painted onto different devices - // The first sounds strange (doens't it?), the second means we could perhaps + // The first sounds strange (doens't it?), the second means we could perhaps // optimize this in the future - there is no need to re-create the control every time, // is it? // #i74523# / 2007-02-15 / frank.schoenheit@sun.com @@ -1063,44 +1044,37 @@ namespace sdr { namespace contact { bool bSuccess = false; try { - do - { - const ::rtl::OUString sControlServiceName( _rUnoObject.GetUnoControlTypeName() ); + const ::rtl::OUString sControlServiceName( _rUnoObject.GetUnoControlTypeName() ); - Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - if ( xFactory.is() ) - { - _out_rControl = Reference< XControl >( xFactory->createInstance( sControlServiceName ), UNO_QUERY ); - } - DBG_ASSERT( _out_rControl.is(), "ViewObjectContactOfUnoControl_Impl::createControlForDevice: no control could be created!" ); - if ( !_out_rControl.is() ) - break; + Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_SET_THROW ); + _out_rControl = Reference< XControl >( xFactory->createInstance( sControlServiceName ), UNO_QUERY_THROW ); - // knit the model and the control - _out_rControl.setModel( xControlModel ); + // knit the model and the control + _out_rControl.setModel( xControlModel ); - UnoControlContactHelper::positionControl_throw( _out_rControl, _rUnoObject.GetLogicRect(), &_rDevice ); - - // proper zoom - UnoControlContactHelper::setControlZoom( _out_rControl, &_rDevice ); + // proper geometry + UnoControlContactHelper::adjustControlGeometry_throw( + _out_rControl, + _rUnoObject.GetLogicRect(), + _rDevice.GetViewTransformation(), + _rDevice.GetInverseViewTransformation() + ); - // #107049# set design mode before peer is created, - // this is also needed for accessibility - _out_rControl.setDesignMode( _rPageView.isDesignMode() ); + // #107049# set design mode before peer is created, + // this is also needed for accessibility + _out_rControl.setDesignMode( _rPageView.isDesignMode() ); - // adjust the initial visibility according to the visibility of the layer - // 2003-06-03 - #110592# - fs@openoffice.org - impl_adjustControlVisibilityToLayerVisibility_throw( _out_rControl, _rUnoObject, _rPageView, false, true ); + // adjust the initial visibility according to the visibility of the layer + // 2003-06-03 - #110592# - fs@openoffice.org + impl_adjustControlVisibilityToLayerVisibility_throw( _out_rControl, _rUnoObject, _rPageView, false, true ); - // add the control to the respective control container - // #108327# do this last - Reference< XControlContainer > xControlContainer( _rPageView.getControlContainer( _rDevice ) ); - if ( xControlContainer.is() ) - xControlContainer->addControl( sControlServiceName, _out_rControl.getControl() ); + // add the control to the respective control container + // #108327# do this last + Reference< XControlContainer > xControlContainer( _rPageView.getControlContainer( _rDevice ) ); + if ( xControlContainer.is() ) + xControlContainer->addControl( sControlServiceName, _out_rControl.getControl() ); - bSuccess = true; - } - while ( false ); + bSuccess = true; } catch( const Exception& ) { @@ -1257,18 +1231,16 @@ namespace sdr { namespace contact { //-------------------------------------------------------------------- bool ViewObjectContactOfUnoControl_Impl::isPrintableControl() const { - if ( !m_aControl.is() ) + SdrUnoObj* pUnoObject( NULL ); + if ( !getUnoObject( pUnoObject ) ) return false; bool bIsPrintable = false; try { - Reference< XPropertySet > xModelProperties( m_aControl.getModel(), UNO_QUERY ); - Reference< XPropertySetInfo > xPropertyInfo( xModelProperties.is() ? xModelProperties->getPropertySetInfo() : Reference< XPropertySetInfo >() ); - const ::rtl::OUString sPrintablePropertyName( RTL_CONSTASCII_USTRINGPARAM( "Printable" ) ); - - if ( xPropertyInfo.is() && xPropertyInfo->hasPropertyByName( sPrintablePropertyName ) ) - OSL_VERIFY( xModelProperties->getPropertyValue( sPrintablePropertyName ) >>= bIsPrintable ); + Reference< XPropertySet > xModelProperties( pUnoObject->GetUnoControlModel(), UNO_QUERY_THROW ); + static const ::rtl::OUString s_sPrintablePropertyName( RTL_CONSTASCII_USTRINGPARAM( "Printable" ) ); + OSL_VERIFY( xModelProperties->getPropertyValue( s_sPrintablePropertyName ) >>= bIsPrintable ); } catch( const Exception& ) { @@ -1411,15 +1383,20 @@ namespace sdr { namespace contact { if ( !xNewControl.is() ) return; + ENSURE_OR_THROW( m_pOutputDeviceForWindow, "calling this without /me having an output device should be impossible." ); + DBG_ASSERT( xNewControl->getModel() == m_aControl.getModel(), "ViewObjectContactOfUnoControl_Impl::elementReplaced: another model at the new control?" ); // another model should - in the drawing layer - also imply another SdrUnoObj, which // should also result in new ViewContact, and thus in new ViewObjectContacts impl_switchControlListening_nothrow( false ); + ControlHolder aNewControl( xNewControl ); + aNewControl.setZoom( m_aControl.getZoom() ); + aNewControl.setPosSize( m_aControl.getPosSize() ); + aNewControl.setDesignMode( impl_isControlDesignMode_nothrow() ); + m_aControl = xNewControl; - positionAndZoomControl(); - m_aControl.setDesignMode( impl_isControlDesignMode_nothrow() ); m_bControlIsVisible = m_aControl.isVisible(); impl_switchControlListening_nothrow( true ); @@ -1449,30 +1426,96 @@ namespace sdr { namespace contact { } } + //==================================================================== + //= LazyControlCreationPrimitive2D + //==================================================================== //-------------------------------------------------------------------- - bool ViewObjectContactOfUnoControl_Impl::belongsToDevice( const OutputDevice* _pDevice ) const + bool LazyControlCreationPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - DBG_ASSERT( _pDevice, "ViewObjectContactOfUnoControl_Impl::belongsToDevice: invalid device!" ); + if ( !BasePrimitive2D::operator==( rPrimitive ) ) + return false; - OSL_PRECOND( !impl_isDisposed_nofail(), "ViewObjectContactOfUnoControl_Impl::belongsToDevice: already disposed!" ); - if ( impl_isDisposed_nofail() ) + const LazyControlCreationPrimitive2D* pRHS = dynamic_cast< const LazyControlCreationPrimitive2D* >( &rPrimitive ); + if ( !pRHS ) return false; - if ( m_pOutputDeviceForWindow ) - { - if ( _pDevice == m_pOutputDeviceForWindow ) - return true; + if ( m_pVOCImpl != pRHS->m_pVOCImpl ) return false; - } - ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &m_pAntiImpl->GetObjectContact() ); - if ( pPageViewContact ) - return ( _pDevice == &imp_getPageViewDevice_nothrow( *pPageViewContact ) ); + if ( m_aTransformation != pRHS->m_aTransformation ) + return false; - DBG_ERROR( "ViewObjectContactOfUnoControl_Impl::belongsToDevice: could not determine the device I belong to!" ); - return false; + return true; + } + + //-------------------------------------------------------------------- + void LazyControlCreationPrimitive2D::getTransformation( const ViewContactOfUnoControl& _rVOC, ::basegfx::B2DHomMatrix& _out_Transformation ) + { + // Do use model data directly to create the correct geometry. Do NOT + // use getBoundRect()/getSnapRect() here; tese will use the sequence of + // primitives themselves in the long run. + const Rectangle aSdrGeoData( _rVOC.GetSdrUnoObj().GetGeoRect() ); + const basegfx::B2DRange aRange( + aSdrGeoData.Left(), + aSdrGeoData.Top(), + aSdrGeoData.Right(), + aSdrGeoData.Bottom() + ); + + _out_Transformation.identity(); + _out_Transformation.set( 0, 0, aRange.getWidth() ); + _out_Transformation.set( 1, 1, aRange.getHeight() ); + _out_Transformation.set( 0, 2, aRange.getMinX() ); + _out_Transformation.set( 1, 2, aRange.getMinY() ); } + //-------------------------------------------------------------------- + ::basegfx::B2DRange LazyControlCreationPrimitive2D::getB2DRange( const ::drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/ ) const + { + ::basegfx::B2DRange aRange( 0.0, 0.0, 1.0, 1.0 ); + aRange.transform( m_aTransformation ); + return aRange; + } + + //-------------------------------------------------------------------- + ::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::get2DDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const + { + if ( m_pVOCImpl->hasControl() ) + m_pVOCImpl->positionAndZoomControl( _rViewInformation.getObjectToViewTransformation() ); + return BasePrimitive2D::get2DDecomposition( _rViewInformation ); + } + + //-------------------------------------------------------------------- + ::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::createLocalDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const + { + // force control here to make it a VCL ChildWindow. Will be fetched + // and used below by getExistentControl() + m_pVOCImpl->ensureControl(); + m_pVOCImpl->positionAndZoomControl( _rViewInformation.getObjectToViewTransformation() ); + + // get needed data + const ViewContactOfUnoControl& rViewContactOfUnoControl( m_pVOCImpl->getViewContact() ); + Reference< XControlModel > xControlModel( rViewContactOfUnoControl.GetSdrUnoObj().GetUnoControlModel() ); + const ControlHolder& rControl( m_pVOCImpl->getExistentControl() ); + + // check if we already have an XControl. + if ( !xControlModel.is() || !rControl.is() ) + // use the default mechanism. This will create a ControlPrimitive2D without + // handing over a XControl. If not even a XControlModel exists, it will + // create the SdrObject fallback visualisation + return rViewContactOfUnoControl.getViewIndependentPrimitive2DSequence(); + + // create a primitive and hand over the existing xControl. This will + // allow the primitive to not need to create another one on demand. + const drawinglayer::primitive2d::Primitive2DReference xRetval( new ::drawinglayer::primitive2d::ControlPrimitive2D( + m_aTransformation, xControlModel, rControl.getControl() ) ); + + return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1); + } + + //-------------------------------------------------------------------- + ImplPrimitrive2DIDBlock( LazyControlCreationPrimitive2D, PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D ) + //==================================================================== //= ViewObjectContactOfUnoControl //==================================================================== @@ -1522,20 +1565,6 @@ namespace sdr { namespace contact { } //-------------------------------------------------------------------- - void ViewObjectContactOfUnoControl::positionControlForPaint( const DisplayInfo& _rDisplayInfo ) const - { - VOCGuard aGuard( *m_pImpl ); - - // ensure we have a control. If we don't, then the Drawing Layer might be tempted to - // never draw the complete form layer. - // #i75095# / 2007-03-05 / frank.schoenheit@sun.com - m_pImpl->ensureControl( _rDisplayInfo ); - - // position the control - m_pImpl->positionControlForPaint( _rDisplayInfo ); - } - - //-------------------------------------------------------------------- void ViewObjectContactOfUnoControl::ensureControlVisibility( bool _bVisible ) const { VOCGuard aGuard( *m_pImpl ); @@ -1582,70 +1611,32 @@ namespace sdr { namespace contact { } //-------------------------------------------------------------------- - bool ViewObjectContactOfUnoControl::belongsToDevice( const OutputDevice* _pDevice ) const + drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfUnoControl::createPrimitive2DSequence(const DisplayInfo& /*rDisplayInfo*/) const { - VOCGuard aGuard( *m_pImpl ); - return m_pImpl->belongsToDevice( _pDevice ); + if ( m_pImpl->isDisposed() ) + // our control already died. + // TODO: Is it worth re-creating the control? Finally, this is a pathological situation, it means some instance + // disposed the control though it doesn't own it. So, /me thinks we should not bother here. + return drawinglayer::primitive2d::Primitive2DSequence();
+
+ ::drawinglayer::primitive2d::Primitive2DReference xPrimitive( new LazyControlCreationPrimitive2D( m_pImpl ) ); + return ::drawinglayer::primitive2d::Primitive2DSequence( &xPrimitive, 1 ); } //-------------------------------------------------------------------- - drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfUnoControl::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const - { - // force control here to make it a VCL ChildWindow. Will be fetched - // and used below by getExistentControl() - m_pImpl->ensureControl(); - m_pImpl->positionControlForPaint(rDisplayInfo); - - // get needed data - const ViewContactOfUnoControl& rViewContactOfUnoControl(static_cast< const ViewContactOfUnoControl& >(GetViewContact())); - Reference< XControlModel > xControlModel(rViewContactOfUnoControl.GetSdrUnoObj().GetUnoControlModel()); - const ControlHolder& rControl(m_pImpl->getExistentControl()); - - // check if we already have a XControl. - if(xControlModel.is() && rControl.is()) - { - // create a primitive and hand over the existing xControl. This will - // allow the primitive to not need to create another one on demand. - // Do use model data directly to create the correct geometry. Do NOT - // use getBoundRect()/getSnapRect() here; tese will use the sequence of - // primitives themselves in the long run. - const Rectangle aUnoControlModelData(rViewContactOfUnoControl.GetSdrUnoObj().GetGeoRect()); - const basegfx::B2DRange aRange(aUnoControlModelData.Left(), aUnoControlModelData.Top(), aUnoControlModelData.Right(), aUnoControlModelData.Bottom()); - - // create object transform - basegfx::B2DHomMatrix aTransform; - aTransform.set(0, 0, aRange.getWidth()); - aTransform.set(1, 1, aRange.getHeight()); - aTransform.set(0, 2, aRange.getMinX()); - aTransform.set(1, 2, aRange.getMinY()); - - // create control primitive with existing XControl - const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::ControlPrimitive2D( - aTransform, xControlModel, rControl.getControl())); - - return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1); - } - else - { - // use the default mechanism. This will create a ControlPrimitive2D without - // handing over a XControl. If not even a XControlModel exists, it will - // create the SdrObject fallback visualisation - return rViewContactOfUnoControl.getViewIndependentPrimitive2DSequence(); - } - } - void ViewObjectContactOfUnoControl::propertyChange() { // graphical invalidate at all views ActionChanged(); // #i93318# flush Primitive2DSequence to force recreation with updated XControlModel - // since e.g. background color has changed and existing decompositions are evtl. no + // since e.g. background color has changed and existing decompositions are possibly no // longer valid. Unfortunately this is not detected from ControlPrimitive2D::operator== // since it only has a uno reference to the XControlModel flushPrimitive2DSequence(); } + //-------------------------------------------------------------------- void ViewObjectContactOfUnoControl::ActionChanged() { // call parent @@ -1721,6 +1712,14 @@ namespace sdr { namespace contact { DBG_DTOR( UnoControlPrintOrPreviewContact, NULL ); } + //-------------------------------------------------------------------- + drawinglayer::primitive2d::Primitive2DSequence UnoControlPrintOrPreviewContact::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo ) const + { + if ( !m_pImpl->isPrintableControl() ) + return drawinglayer::primitive2d::Primitive2DSequence(); + return ViewObjectContactOfUnoControl::createPrimitive2DSequence( rDisplayInfo ); + } + //==================================================================== //= UnoControlPDFExportContact //==================================================================== diff --git a/svx/source/sdr/overlay/makefile.mk b/svx/source/sdr/overlay/makefile.mk index 1243a71e25..d202992c09 100644 --- a/svx/source/sdr/overlay/makefile.mk +++ b/svx/source/sdr/overlay/makefile.mk @@ -43,22 +43,21 @@ ENABLE_EXCEPTIONS=TRUE SLOFILES=\ $(SLO)$/overlayanimatedbitmapex.obj \ - $(SLO)$/overlaybitmap.obj \ $(SLO)$/overlaybitmapex.obj \ + $(SLO)$/overlaycrosshair.obj \ + $(SLO)$/overlayhatchrect.obj \ + $(SLO)$/overlayhelpline.obj \ $(SLO)$/overlayline.obj \ - $(SLO)$/overlaylinestriped.obj \ $(SLO)$/overlaymanager.obj \ $(SLO)$/overlaymanagerbuffered.obj \ $(SLO)$/overlayobject.obj \ + $(SLO)$/overlayobjectcell.obj \ $(SLO)$/overlayobjectlist.obj \ - $(SLO)$/overlaytriangle.obj \ - $(SLO)$/overlaycrosshair.obj \ - $(SLO)$/overlayhelpline.obj \ - $(SLO)$/overlayhatchrect.obj \ - $(SLO)$/overlayrollingrectangle.obj \ $(SLO)$/overlaypolypolygon.obj \ - $(SLO)$/overlaysdrobject.obj \ $(SLO)$/overlayprimitive2dsequenceobject.obj \ - $(SLO)$/overlayobjectcell.obj + $(SLO)$/overlayrollingrectangle.obj \ + $(SLO)$/overlayselection.obj \ + $(SLO)$/overlaytools.obj \ + $(SLO)$/overlaytriangle.obj .INCLUDE : target.mk diff --git a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx index 9fbecbc0fe..7ea78b6d4c 100644 --- a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx +++ b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx @@ -34,9 +34,8 @@ #include <vcl/salbtype.hxx> #include <vcl/outdev.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> - -// #i77674# #include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdr/overlay/overlaytools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -57,43 +56,30 @@ namespace sdr } } - void OverlayAnimatedBitmapEx::drawGeometry(OutputDevice& rOutputDevice) - { - // #i77674# calculate discrete top-left - basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition()); - aDiscreteTopLeft -= (mbOverlayState) - ? basegfx::B2DPoint((double)mnCenterX1, (double)mnCenterY1) - : basegfx::B2DPoint((double)mnCenterX2, (double)mnCenterY2); - - // remember MapMode and switch to pixels - const bool bMapModeWasEnabled(rOutputDevice.IsMapModeEnabled()); - rOutputDevice.EnableMapMode(false); - - // draw the bitmap - const Point aPixelTopLeft((sal_Int32)floor(aDiscreteTopLeft.getX()), (sal_Int32)floor(aDiscreteTopLeft.getY())); - rOutputDevice.DrawBitmapEx(aPixelTopLeft, (mbOverlayState) ? maBitmapEx1 : maBitmapEx2); - - // restore MapMode - rOutputDevice.EnableMapMode(bMapModeWasEnabled); - } - - void OverlayAnimatedBitmapEx::createBaseRange(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayAnimatedBitmapEx::createOverlayObjectPrimitive2DSequence() { - // #i77674# calculate discrete top-left - basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition()); - aDiscreteTopLeft -= (mbOverlayState) - ? basegfx::B2DPoint((double)mnCenterX1, (double)mnCenterY1) - : basegfx::B2DPoint((double)mnCenterX2, (double)mnCenterY2); - - // calculate discrete range - const Size aBitmapPixelSize((mbOverlayState) ? maBitmapEx1.GetSizePixel() : maBitmapEx2.GetSizePixel()); - const basegfx::B2DRange aDiscreteRange( - aDiscreteTopLeft.getX(), aDiscreteTopLeft.getY(), - aDiscreteTopLeft.getX() + (double)aBitmapPixelSize.getWidth(), aDiscreteTopLeft.getY() + (double)aBitmapPixelSize.getHeight()); - - // set and go back to logic range - maBaseRange = aDiscreteRange; - maBaseRange.transform(rOutputDevice.GetInverseViewTransformation()); + if(mbOverlayState) + { + const drawinglayer::primitive2d::Primitive2DReference aPrimitive( + new drawinglayer::primitive2d::OverlayBitmapExPrimitive( + getBitmapEx1(), + getBasePosition(), + getCenterX1(), + getCenterY1())); + + return drawinglayer::primitive2d::Primitive2DSequence(&aPrimitive, 1); + } + else + { + const drawinglayer::primitive2d::Primitive2DReference aPrimitive( + new drawinglayer::primitive2d::OverlayBitmapExPrimitive( + getBitmapEx2(), + getBasePosition(), + getCenterX2(), + getCenterY2())); + + return drawinglayer::primitive2d::Primitive2DSequence(&aPrimitive, 1); + } } OverlayAnimatedBitmapEx::OverlayAnimatedBitmapEx( @@ -111,10 +97,10 @@ namespace sdr mnCenterX1(nCenX1), mnCenterY1(nCenY1), mnCenterX2(nCenX2), mnCenterY2(nCenY2), mnBlinkTime(nBlinkTime), - mbOverlayState(sal_False) + mbOverlayState(false) { // set AllowsAnimation flag to mark this object as animation capable - mbAllowsAnimation = sal_True; + mbAllowsAnimation = true; // #i53216# check blink time value range impCheckBlinkTimeValueRange(); @@ -213,11 +199,11 @@ namespace sdr // switch state if(mbOverlayState) { - mbOverlayState = sal_False; + mbOverlayState = false; } else { - mbOverlayState = sal_True; + mbOverlayState = true; } // re-insert me as event @@ -227,12 +213,6 @@ namespace sdr objectChange(); } } - - void OverlayAnimatedBitmapEx::zoomHasChanged() - { - // reset validity of range in logical coor to force recalculation - mbIsChanged = sal_True; - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlaybitmap.cxx b/svx/source/sdr/overlay/overlaybitmap.cxx deleted file mode 100644 index be40a026ac..0000000000 --- a/svx/source/sdr/overlay/overlaybitmap.cxx +++ /dev/null @@ -1,162 +0,0 @@ -/************************************************************************* - * - * 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: overlaybitmap.cxx,v $ - * $Revision: 1.5 $ - * - * 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_svx.hxx" -#include <svx/sdr/overlay/overlaybitmap.hxx> -#include <vcl/salbtype.hxx> -#include <vcl/outdev.hxx> -#include <vcl/bitmapex.hxx> - -// #i77674# -#include <basegfx/matrix/b2dhommatrix.hxx> - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - void OverlayBitmap::drawGeometry(OutputDevice& rOutputDevice) - { - // #i77674# calculate discrete top-left - basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition()); - aDiscreteTopLeft -= basegfx::B2DPoint((double)mnCenterX, (double)mnCenterY); - - // remember MapMode and switch to pixels - const bool bMapModeWasEnabled(rOutputDevice.IsMapModeEnabled()); - rOutputDevice.EnableMapMode(false); - - // draw the bitmap - const Point aPixelTopLeft((sal_Int32)floor(aDiscreteTopLeft.getX()), (sal_Int32)floor(aDiscreteTopLeft.getY())); - - if(mbUseTransparenceColor) - { - BitmapEx aBitmapEx(maBitmap, getBaseColor()); - rOutputDevice.DrawBitmapEx(aPixelTopLeft, aBitmapEx); - } - else - { - rOutputDevice.DrawBitmap(aPixelTopLeft, maBitmap); - } - - // restore MapMode - rOutputDevice.EnableMapMode(bMapModeWasEnabled); - } - - void OverlayBitmap::createBaseRange(OutputDevice& rOutputDevice) - { - // #i77674# calculate discrete top-left - basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition()); - aDiscreteTopLeft -= basegfx::B2DPoint((double)mnCenterX, (double)mnCenterY); - - // calculate discrete range - const Size aBitmapPixelSize(maBitmap.GetSizePixel()); - const basegfx::B2DRange aDiscreteRange( - aDiscreteTopLeft.getX(), aDiscreteTopLeft.getY(), - aDiscreteTopLeft.getX() + (double)aBitmapPixelSize.getWidth(), aDiscreteTopLeft.getY() + (double)aBitmapPixelSize.getHeight()); - - // set and go back to logic range - maBaseRange = aDiscreteRange; - maBaseRange.transform(rOutputDevice.GetInverseViewTransformation()); - } - - OverlayBitmap::OverlayBitmap( - const basegfx::B2DPoint& rBasePos, - const Bitmap& rBitmap, - sal_uInt16 nCenX, sal_uInt16 nCenY, - sal_Bool bUseTransCol, - Color aTransColor) - : OverlayObjectWithBasePosition(rBasePos, aTransColor), - maBitmap(rBitmap), - mnCenterX(nCenX), - mnCenterY(nCenY), - mbUseTransparenceColor(bUseTransCol) - { - } - - OverlayBitmap::~OverlayBitmap() - { - } - - void OverlayBitmap::setBitmap(const Bitmap& rNew) - { - if(rNew != maBitmap) - { - // remember new Bitmap - maBitmap = rNew; - - // register change (after change) - objectChange(); - } - } - - void OverlayBitmap::setTransparenceUsed(sal_Bool bNew) - { - if(bNew != mbUseTransparenceColor) - { - // remember new value - mbUseTransparenceColor = bNew; - - // register change (after change) - objectChange(); - } - } - - void OverlayBitmap::setCenterXY(sal_uInt16 nNewX, sal_uInt16 nNewY) - { - if(nNewX != mnCenterX || nNewY != mnCenterY) - { - // remember new values - if(nNewX != mnCenterX) - { - mnCenterX = nNewX; - } - - if(nNewY != mnCenterY) - { - mnCenterY = nNewY; - } - - // register change (after change) - objectChange(); - } - } - - void OverlayBitmap::zoomHasChanged() - { - // reset validity of range in logical coor to force recalculation - mbIsChanged = sal_True; - } - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/svx/source/sdr/overlay/overlaybitmapex.cxx b/svx/source/sdr/overlay/overlaybitmapex.cxx index c1f5e2269a..bf3a020398 100644 --- a/svx/source/sdr/overlay/overlaybitmapex.cxx +++ b/svx/source/sdr/overlay/overlaybitmapex.cxx @@ -33,9 +33,8 @@ #include <svx/sdr/overlay/overlaybitmapex.hxx> #include <vcl/salbtype.hxx> #include <vcl/outdev.hxx> - -// #i77674# #include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdr/overlay/overlaytools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -43,39 +42,16 @@ namespace sdr { namespace overlay { - void OverlayBitmapEx::drawGeometry(OutputDevice& rOutputDevice) - { - // #i77674# calculate discrete top-left - basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition()); - aDiscreteTopLeft -= basegfx::B2DPoint((double)mnCenterX, (double)mnCenterY); - - // remember MapMode and switch to pixels - const bool bMapModeWasEnabled(rOutputDevice.IsMapModeEnabled()); - rOutputDevice.EnableMapMode(false); - - // draw the bitmap - const Point aPixelTopLeft((sal_Int32)floor(aDiscreteTopLeft.getX()), (sal_Int32)floor(aDiscreteTopLeft.getY())); - rOutputDevice.DrawBitmapEx(aPixelTopLeft, maBitmapEx); - - // restore MapMode - rOutputDevice.EnableMapMode(bMapModeWasEnabled); - } - - void OverlayBitmapEx::createBaseRange(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayBitmapEx::createOverlayObjectPrimitive2DSequence() { - // #i77674# calculate discrete top-left - basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition()); - aDiscreteTopLeft -= basegfx::B2DPoint((double)mnCenterX, (double)mnCenterY); - - // calculate discrete range - const Size aBitmapPixelSize(maBitmapEx.GetSizePixel()); - const basegfx::B2DRange aDiscreteRange( - aDiscreteTopLeft.getX(), aDiscreteTopLeft.getY(), - aDiscreteTopLeft.getX() + (double)aBitmapPixelSize.getWidth(), aDiscreteTopLeft.getY() + (double)aBitmapPixelSize.getHeight()); - - // set and go back to logic range - maBaseRange = aDiscreteRange; - maBaseRange.transform(rOutputDevice.GetInverseViewTransformation()); + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::OverlayBitmapExPrimitive( + getBitmapEx(), + getBasePosition(), + getCenterX(), + getCenterY())); + + return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); } OverlayBitmapEx::OverlayBitmapEx( @@ -124,12 +100,6 @@ namespace sdr objectChange(); } } - - void OverlayBitmapEx::zoomHasChanged() - { - // reset validity of range in logical coor to force recalculation - mbIsChanged = sal_True; - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlaycrosshair.cxx b/svx/source/sdr/overlay/overlaycrosshair.cxx index f755c70af1..9204c0e87b 100644 --- a/svx/source/sdr/overlay/overlaycrosshair.cxx +++ b/svx/source/sdr/overlay/overlaycrosshair.cxx @@ -34,6 +34,8 @@ #include <tools/gen.hxx> #include <vcl/salbtype.hxx> #include <vcl/outdev.hxx> +#include <svx/sdr/overlay/overlaytools.hxx> +#include <svx/sdr/overlay/overlaymanager.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -41,31 +43,33 @@ namespace sdr { namespace overlay { - void OverlayCrosshairStriped::drawGeometry(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayCrosshairStriped::createOverlayObjectPrimitive2DSequence() { - const Point aEmptyPoint; - const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel()); - const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel)); + drawinglayer::primitive2d::Primitive2DSequence aRetval; - const basegfx::B2DPoint aStartA(aVisibleLogic.Left(), getBasePosition().getY()); - const basegfx::B2DPoint aEndA(aVisibleLogic.Right(), getBasePosition().getY()); - ImpDrawLineStriped(rOutputDevice, aStartA, aEndA); + if(getOverlayManager()) + { + const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor()); + const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor()); + const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel()); + + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::OverlayCrosshairPrimitive( + getBasePosition(), + aRGBColorA, + aRGBColorB, + fStripeLengthPixel)); + + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); + } - const basegfx::B2DPoint aStartB(getBasePosition().getX(), aVisibleLogic.Top()); - const basegfx::B2DPoint aEndB(getBasePosition().getX(), aVisibleLogic.Bottom()); - ImpDrawLineStriped(rOutputDevice, aStartB, aEndB); + return aRetval; } - void OverlayCrosshairStriped::createBaseRange(OutputDevice& rOutputDevice) + void OverlayCrosshairStriped::stripeDefinitionHasChanged() { - // reset range and expand it - const Point aEmptyPoint; - const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel()); - const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel)); - - maBaseRange.reset(); - maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Left(), aVisibleLogic.Top())); - maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Right(), aVisibleLogic.Bottom())); + // react on OverlayManager's stripe definition change + objectChange(); } OverlayCrosshairStriped::OverlayCrosshairStriped(const basegfx::B2DPoint& rBasePos) @@ -76,64 +80,6 @@ namespace sdr OverlayCrosshairStriped::~OverlayCrosshairStriped() { } - - sal_Bool OverlayCrosshairStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const - { - if(isHittable()) - { - // test vertical - if(rPos.getY() >= (getBasePosition().getY() - fTol) - && rPos.getY() <= (getBasePosition().getY() + fTol)) - { - return sal_True; - } - - // test horizontal - if(rPos.getX() >= (getBasePosition().getX() - fTol) - && rPos.getX() <= (getBasePosition().getX() + fTol)) - { - return sal_True; - } - } - - return sal_False; - } - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - void OverlayCrosshair::drawGeometry(OutputDevice& rOutputDevice) - { - const Point aBasePos(FRound(getBasePosition().getX()), FRound(getBasePosition().getY())); - const Point aEmptyPoint; - const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel()); - const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel)); - - rOutputDevice.SetLineColor(getBaseColor()); - rOutputDevice.SetFillColor(); - - rOutputDevice.DrawLine(Point(aVisibleLogic.Left(), aBasePos.Y()), Point(aVisibleLogic.Right(), aBasePos.Y())); - rOutputDevice.DrawLine(Point(aBasePos.X(), aVisibleLogic.Top()), Point(aBasePos.X(), aVisibleLogic.Bottom())); - } - - OverlayCrosshair::OverlayCrosshair( - const basegfx::B2DPoint& rBasePos, - Color aLineColor) - : OverlayCrosshairStriped(rBasePos) - { - // set base color here, OverlayCrosshairStriped constructor has set - // it to it's own default. - maBaseColor = aLineColor; - } - - OverlayCrosshair::~OverlayCrosshair() - { - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlayhatchrect.cxx b/svx/source/sdr/overlay/overlayhatchrect.cxx index a1c6f35cd4..284aa204af 100644 --- a/svx/source/sdr/overlay/overlayhatchrect.cxx +++ b/svx/source/sdr/overlay/overlayhatchrect.cxx @@ -38,6 +38,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/numeric/ftools.hxx> +#include <svx/sdr/overlay/overlaytools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -45,81 +46,34 @@ namespace sdr { namespace overlay { - basegfx::B2DPolyPolygon OverlayHatchRect::getGeometry(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayHatchRect::createOverlayObjectPrimitive2DSequence() { - const basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition()); - const basegfx::B2DPoint aDiscreteBottomRight(rOutputDevice.GetViewTransformation() * getSecondPosition()); - - basegfx::B2DRange aInnerRange( - floor(aDiscreteTopLeft.getX()), floor(aDiscreteTopLeft.getY()), - floor(aDiscreteBottomRight.getX()), floor(aDiscreteBottomRight.getY())); - basegfx::B2DRange aOuterRange(aInnerRange); - basegfx::B2DPolyPolygon aRetval; - - aOuterRange.grow(getDiscreteWidth() * 0.5); - aInnerRange.grow(getDiscreteWidth() * -0.5); - - aRetval.append(basegfx::tools::createPolygonFromRect(aOuterRange)); - aRetval.append(basegfx::tools::createPolygonFromRect(aInnerRange)); - - if(!basegfx::fTools::equalZero(mfRotation)) - { - basegfx::B2DHomMatrix aTransform; - - aTransform.translate(-aOuterRange.getMinX(), -aOuterRange.getMinY()); - aTransform.rotate(getRotation()); - aTransform.translate(aOuterRange.getMinX(), aOuterRange.getMinY()); - - aRetval.transform(aTransform); - } - - return aRetval; - } - - void OverlayHatchRect::drawGeometry(OutputDevice& rOutputDevice) - { - const basegfx::B2DPolyPolygon aB2DGeometry(getGeometry(rOutputDevice)); - const bool bMapModeWasEnabled(rOutputDevice.IsMapModeEnabled()); - - // use VCL polygon and methodology for paint - double fFullRotation(getHatchRotation() - getRotation()); - - while(fFullRotation < 0.0) - { - fFullRotation += F_2PI; - } - - while(fFullRotation >= F_2PI) - { - fFullRotation -= F_2PI; - } - - const Hatch aHatch(HATCH_SINGLE, getBaseColor(), 3, (sal_uInt16)basegfx::fround(fFullRotation * ( 10.0 / F_PI180))); - rOutputDevice.EnableMapMode(false); - rOutputDevice.DrawHatch(PolyPolygon(aB2DGeometry), aHatch); - rOutputDevice.EnableMapMode(bMapModeWasEnabled); - } - - void OverlayHatchRect::createBaseRange(OutputDevice& rOutputDevice) - { - // reset range and expand with fresh geometry - maBaseRange = getGeometry(rOutputDevice).getB2DRange(); - - // getGeometry data is in discrete coordinates (pixels), so transform back to - // world coordinates (logic) - maBaseRange.transform(rOutputDevice.GetInverseViewTransformation()); + const basegfx::B2DRange aHatchRange(getBasePosition(), getSecondPosition()); + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::OverlayHatchRectanglePrimitive( + aHatchRange, + 3.0, + getHatchRotation(), + getBaseColor().getBColor(), + getDiscreteGrow(), + getDiscreteShrink(), + getRotation())); + + return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); } OverlayHatchRect::OverlayHatchRect( const basegfx::B2DPoint& rBasePosition, const basegfx::B2DPoint& rSecondPosition, const Color& rHatchColor, - double fDiscreteWidth, + double fDiscreteGrow, + double fDiscreteShrink, double fHatchRotation, double fRotation) : OverlayObjectWithBasePosition(rBasePosition, rHatchColor), maSecondPosition(rSecondPosition), - mfDiscreteWidth(fDiscreteWidth), + mfDiscreteGrow(fDiscreteGrow), + mfDiscreteShrink(fDiscreteShrink), mfHatchRotation(fHatchRotation), mfRotation(fRotation) { @@ -136,12 +90,6 @@ namespace sdr objectChange(); } } - - void OverlayHatchRect::zoomHasChanged() - { - // reset validity of range in logical coor to force recalculation - mbIsChanged = sal_True; - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlayhelpline.cxx b/svx/source/sdr/overlay/overlayhelpline.cxx index fa12c6df89..eaff70a6f0 100644 --- a/svx/source/sdr/overlay/overlayhelpline.cxx +++ b/svx/source/sdr/overlay/overlayhelpline.cxx @@ -35,6 +35,8 @@ #include <vcl/salbtype.hxx> #include <vcl/outdev.hxx> #include <basegfx/vector/b2dvector.hxx> +#include <svx/sdr/overlay/overlaytools.hxx> +#include <svx/sdr/overlay/overlaymanager.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -42,79 +44,38 @@ namespace sdr { namespace overlay { - void OverlayHelplineStriped::drawGeometry(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayHelplineStriped::createOverlayObjectPrimitive2DSequence() { - // prepare OutputDevice - const Point aEmptyPoint; - const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel()); - const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel)); + drawinglayer::primitive2d::Primitive2DSequence aRetval; - switch(meKind) + if(getOverlayManager()) { - case SDRHELPLINE_VERTICAL : - { - const basegfx::B2DPoint aStart(getBasePosition().getX(), aVisibleLogic.Top()); - const basegfx::B2DPoint aEnd(getBasePosition().getX(), aVisibleLogic.Bottom()); - ImpDrawLineStriped(rOutputDevice, aStart, aEnd); - break; - } - - case SDRHELPLINE_HORIZONTAL : - { - const basegfx::B2DPoint aStart(aVisibleLogic.Left(), getBasePosition().getY()); - const basegfx::B2DPoint aEnd(aVisibleLogic.Right(), getBasePosition().getY()); - ImpDrawLineStriped(rOutputDevice, aStart, aEnd); - break; - } - - case SDRHELPLINE_POINT : - { - const Size aPixelSize(SDRHELPLINE_POINT_PIXELSIZE, SDRHELPLINE_POINT_PIXELSIZE); - const Size aLogicSize(rOutputDevice.PixelToLogic(aPixelSize)); - - const basegfx::B2DPoint aStartA(getBasePosition().getX(), getBasePosition().getY() - aLogicSize.Height()); - const basegfx::B2DPoint aEndA(getBasePosition().getX(), getBasePosition().getY() + aLogicSize.Height()); - ImpDrawLineStriped(rOutputDevice, aStartA, aEndA); - - const basegfx::B2DPoint aStartB(getBasePosition().getX() - aLogicSize.Width(), getBasePosition().getY()); - const basegfx::B2DPoint aEndB(getBasePosition().getX() + aLogicSize.Width(), getBasePosition().getY()); - ImpDrawLineStriped(rOutputDevice, aStartB, aEndB); - - break; - } + const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor()); + const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor()); + const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel()); + const drawinglayer::primitive2d::HelplineStyle aStyle( + SDRHELPLINE_POINT == getKind() ? drawinglayer::primitive2d::HELPLINESTYLE_POINT : + SDRHELPLINE_VERTICAL == getKind() ? drawinglayer::primitive2d::HELPLINESTYLE_VERTICAL : + drawinglayer::primitive2d::HELPLINESTYLE_HORIZONTAL); + + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::OverlayHelplineStripedPrimitive( + getBasePosition(), + aStyle, + aRGBColorA, + aRGBColorB, + fStripeLengthPixel)); + + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); } + + return aRetval; } - void OverlayHelplineStriped::createBaseRange(OutputDevice& rOutputDevice) + void OverlayHelplineStriped::stripeDefinitionHasChanged() { - // reset range and expand it - maBaseRange.reset(); - - if(SDRHELPLINE_POINT == meKind) - { - const Size aPixelSize(SDRHELPLINE_POINT_PIXELSIZE, SDRHELPLINE_POINT_PIXELSIZE); - const Size aLogicSize(rOutputDevice.PixelToLogic(aPixelSize)); - - maBaseRange.expand(basegfx::B2DPoint(getBasePosition().getX() - aLogicSize.Width(), getBasePosition().getY() - aLogicSize.Height())); - maBaseRange.expand(basegfx::B2DPoint(getBasePosition().getX() + aLogicSize.Width(), getBasePosition().getY() + aLogicSize.Height())); - } - else - { - const Point aEmptyPoint; - const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel()); - const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel)); - - if(SDRHELPLINE_HORIZONTAL == meKind) - { - maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Left(), getBasePosition().getY())); - maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Right(), getBasePosition().getY())); - } - else if(SDRHELPLINE_VERTICAL == meKind) - { - maBaseRange.expand(basegfx::B2DPoint(getBasePosition().getX(), aVisibleLogic.Top())); - maBaseRange.expand(basegfx::B2DPoint(getBasePosition().getX(), aVisibleLogic.Bottom())); - } - } + // react on OverlayManager's stripe definition change + objectChange(); } OverlayHelplineStriped::OverlayHelplineStriped( @@ -128,102 +89,6 @@ namespace sdr OverlayHelplineStriped::~OverlayHelplineStriped() { } - - sal_Bool OverlayHelplineStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const - { - if(isHittable()) - { - if(SDRHELPLINE_POINT == meKind) - { - // use distance to BasePosition - const basegfx::B2DVector aVector(rPos - getBasePosition()); - - return (aVector.getLength() < fTol); - } - else - { - if(SDRHELPLINE_HORIZONTAL == meKind) - { - // test vertical - if(rPos.getY() >= (getBasePosition().getY() - fTol) - && rPos.getY() <= (getBasePosition().getY() + fTol)) - { - return sal_True; - } - } - else if(SDRHELPLINE_VERTICAL == meKind) - { - // test horizontal - if(rPos.getX() >= (getBasePosition().getX() - fTol) - && rPos.getX() <= (getBasePosition().getX() + fTol)) - { - return sal_True; - } - } - } - } - - return sal_False; - } - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - void OverlayHelpline::drawGeometry(OutputDevice& rOutputDevice) - { - Point aBasePos(FRound(getBasePosition().getX()), FRound(getBasePosition().getY())); - - rOutputDevice.SetLineColor(getBaseColor()); - rOutputDevice.SetFillColor(); - - if(SDRHELPLINE_POINT == meKind) - { - Size aPixelSize(SDRHELPLINE_POINT_PIXELSIZE, SDRHELPLINE_POINT_PIXELSIZE); - Size aLogicSize(rOutputDevice.PixelToLogic(aPixelSize)); - - rOutputDevice.DrawLine( - Point(aBasePos.X() - aLogicSize.Width(), aBasePos.Y()), - Point(aBasePos.X() + aLogicSize.Width(), aBasePos.Y())); - rOutputDevice.DrawLine( - Point(aBasePos.X(), aBasePos.Y() - aLogicSize.Height()), - Point(aBasePos.X(), aBasePos.Y() + aLogicSize.Height())); - } - else - { - Point aEmptyPoint; - Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel()); - Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel)); - - if(SDRHELPLINE_HORIZONTAL == meKind) - { - rOutputDevice.DrawLine(Point(aVisibleLogic.Left(), aBasePos.Y()), Point(aVisibleLogic.Right(), aBasePos.Y())); - } - else if(SDRHELPLINE_VERTICAL == meKind) - { - rOutputDevice.DrawLine(Point(aBasePos.X(), aVisibleLogic.Top()), Point(aBasePos.X(), aVisibleLogic.Bottom())); - } - } - } - - OverlayHelpline::OverlayHelpline( - const basegfx::B2DPoint& rBasePos, - Color aLineColor, - SdrHelpLineKind eNewKind) - : OverlayHelplineStriped(rBasePos, eNewKind) - { - // set base color here, OverlayCrosshairStriped constructor has set - // it to it's own default. - maBaseColor = aLineColor; - } - - OverlayHelpline::~OverlayHelpline() - { - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlayline.cxx b/svx/source/sdr/overlay/overlayline.cxx index 325c2f459e..5a2a5f2248 100644 --- a/svx/source/sdr/overlay/overlayline.cxx +++ b/svx/source/sdr/overlay/overlayline.cxx @@ -37,6 +37,9 @@ #include <basegfx/vector/b2dvector.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <svx/sdr/overlay/overlaymanager.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -44,17 +47,37 @@ namespace sdr { namespace overlay { - void OverlayLineStriped::drawGeometry(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayLineStriped::createOverlayObjectPrimitive2DSequence() { - ImpDrawLineStriped(rOutputDevice, getBasePosition(), getSecondPosition()); + drawinglayer::primitive2d::Primitive2DSequence aRetval; + + if(getOverlayManager()) + { + const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor()); + const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor()); + const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel()); + basegfx::B2DPolygon aLine; + + aLine.append(getBasePosition()); + aLine.append(getSecondPosition()); + + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::PolygonMarkerPrimitive2D( + aLine, + aRGBColorA, + aRGBColorB, + fStripeLengthPixel)); + + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); + } + + return aRetval; } - void OverlayLineStriped::createBaseRange(OutputDevice& /*rOutputDevice*/) + void OverlayLineStriped::stripeDefinitionHasChanged() { - // reset range and expand it - maBaseRange.reset(); - maBaseRange.expand(getBasePosition()); - maBaseRange.expand(getSecondPosition()); + // react on OverlayManager's stripe definition change + objectChange(); } OverlayLineStriped::OverlayLineStriped( @@ -80,63 +103,6 @@ namespace sdr objectChange(); } } - - sal_Bool OverlayLineStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const - { - if(isHittable() && !getBasePosition().equal(getSecondPosition())) - { - return basegfx::tools::isInEpsilonRange(getBasePosition(), getSecondPosition(), rPos, fTol); - } - - return sal_False; - } - - void OverlayLineStriped::transform(const basegfx::B2DHomMatrix& rMatrix) - { - if(!rMatrix.isIdentity()) - { - // transform base position - OverlayObjectWithBasePosition::transform(rMatrix); - - // transform maSecondPosition - const basegfx::B2DPoint aNewSecondPosition = rMatrix * getSecondPosition(); - setSecondPosition(aNewSecondPosition); - } - } - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - void OverlayLine::drawGeometry(OutputDevice& rOutputDevice) - { - const Point aStart(FRound(getBasePosition().getX()), FRound(getBasePosition().getY())); - const Point aEnd(FRound(getSecondPosition().getX()), FRound(getSecondPosition().getY())); - - rOutputDevice.SetLineColor(getBaseColor()); - rOutputDevice.SetFillColor(); - - rOutputDevice.DrawLine(aStart, aEnd); - } - - OverlayLine::OverlayLine( - const basegfx::B2DPoint& rBasePos, - const basegfx::B2DPoint& rSecondPos, - Color aLineColor) - : OverlayLineStriped(rBasePos, rSecondPos) - { - // set base color here, OverlayCrosshairStriped constructor has set - // it to it's own default. - maBaseColor = aLineColor; - } - - OverlayLine::~OverlayLine() - { - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx index 834f8f170c..f77b533a0e 100644 --- a/svx/source/sdr/overlay/overlaymanager.cxx +++ b/svx/source/sdr/overlay/overlaymanager.cxx @@ -50,121 +50,212 @@ namespace sdr { void OverlayManager::ImpDrawMembers(const basegfx::B2DRange& rRange, OutputDevice& rDestinationDevice) const { - ::sdr::overlay::OverlayObject* pCurrent = mpOverlayObjectStart; + const sal_uInt32 nSize(maOverlayObjects.size()); - if(pCurrent) + if(nSize) { const sal_uInt16 nOriginalAA(rDestinationDevice.GetAntialiasing()); + const bool bIsAntiAliasing(getDrawinglayerOpt().IsAntiAliasing()); - // react on AntiAliasing settings - if(maDrawinglayerOpt.IsAntiAliasing()) - { - rDestinationDevice.SetAntialiasing(nOriginalAA | ANTIALIASING_ENABLE_B2DDRAW); - } - else - { - rDestinationDevice.SetAntialiasing(nOriginalAA & ~ANTIALIASING_ENABLE_B2DDRAW); - } + // create processor + drawinglayer::processor2d::BaseProcessor2D* pProcessor = ::sdr::contact::createBaseProcessor2DFromOutputDevice( + rDestinationDevice, + getCurrentViewInformation2D()); - while(pCurrent) + if(pProcessor) { - if(pCurrent->isVisible()) + for(OverlayObjectVector::const_iterator aIter(maOverlayObjects.begin()); aIter != maOverlayObjects.end(); aIter++) { - if(rRange.overlaps(pCurrent->getBaseRange())) + OSL_ENSURE(*aIter, "Corrupted OverlayObject List (!)"); + const OverlayObject& rCandidate = **aIter; + + if(rCandidate.isVisible()) { - pCurrent->drawGeometry(rDestinationDevice); + const drawinglayer::primitive2d::Primitive2DSequence& rSequence = rCandidate.getOverlayObjectPrimitive2DSequence(); + + if(rSequence.hasElements()) + { + if(rRange.overlaps(rCandidate.getBaseRange())) + { + if(bIsAntiAliasing && rCandidate.allowsAntiAliase()) + { + rDestinationDevice.SetAntialiasing(nOriginalAA | ANTIALIASING_ENABLE_B2DDRAW); + } + else + { + rDestinationDevice.SetAntialiasing(nOriginalAA & ~ANTIALIASING_ENABLE_B2DDRAW); + } + + pProcessor->process(rSequence); + } + } } } - pCurrent = pCurrent->mpNext; + delete pProcessor; } - + // restore AA settings rDestinationDevice.SetAntialiasing(nOriginalAA); } } - void OverlayManager::ImpCheckMapModeChange() const + void OverlayManager::ImpStripeDefinitionChanged() { - sal_Bool bZoomHasChanged(sal_False); - MapMode aOutputDeviceMapMode(getOutputDevice().GetMapMode()); - ::sdr::overlay::OverlayObject* pCurrent = mpOverlayObjectStart; + const sal_uInt32 nSize(maOverlayObjects.size()); - if(maMapMode != aOutputDeviceMapMode) + if(nSize) { - bZoomHasChanged = ( - maMapMode.GetScaleX() != aOutputDeviceMapMode.GetScaleX() - || maMapMode.GetScaleY() != aOutputDeviceMapMode.GetScaleY()); - - // remember MapMode - ((OverlayManager*)this)->maMapMode = aOutputDeviceMapMode; - } - - if(bZoomHasChanged && pCurrent) - { - while(pCurrent) + for(OverlayObjectVector::iterator aIter(maOverlayObjects.begin()); aIter != maOverlayObjects.end(); aIter++) { - pCurrent->zoomHasChanged(); - pCurrent = pCurrent->mpNext; + OSL_ENSURE(*aIter, "Corrupted OverlayObject List (!)"); + OverlayObject& rCandidate = **aIter; + rCandidate.stripeDefinitionHasChanged(); } } } - void OverlayManager::ImpStripeDefinitionChanged() - { - ::sdr::overlay::OverlayObject* pCurrent = mpOverlayObjectStart; - - while(pCurrent) - { - pCurrent->stripeDefinitionHasChanged(); - pCurrent = pCurrent->mpNext; - } - } - - double OverlayManager::getDiscreteOne() const + double OverlayManager::getDiscreteOne() const { - if(getOutputDevice().GetViewTransformation() != maViewTransformation) + if(basegfx::fTools::equalZero(mfDiscreteOne)) { - OverlayManager* pThis = const_cast< OverlayManager* >(this); - pThis->maViewTransformation = getOutputDevice().GetViewTransformation(); const basegfx::B2DVector aDiscreteInLogic(getOutputDevice().GetInverseViewTransformation() * basegfx::B2DVector(1.0, 0.0)); - pThis->mfDiscreteOne = aDiscreteInLogic.getLength(); + const_cast< OverlayManager* >(this)->mfDiscreteOne = aDiscreteInLogic.getLength(); } return mfDiscreteOne; } - OverlayManager::OverlayManager(OutputDevice& rOutputDevice) + OverlayManager::OverlayManager( + OutputDevice& rOutputDevice, + OverlayManager* pOldOverlayManager) : Scheduler(), rmOutputDevice(rOutputDevice), - mpOverlayObjectStart(0L), - mpOverlayObjectEnd(0L), + maOverlayObjects(), maStripeColorA(Color(COL_BLACK)), maStripeColorB(Color(COL_WHITE)), - mnStripeLengthPixel(5L), + mnStripeLengthPixel(5), maDrawinglayerOpt(), maViewTransformation(), + maViewInformation2D(0), mfDiscreteOne(0.0) { + if(pOldOverlayManager) + { + // take over OverlayObjects from given OverlayManager. Copy + // the vector of pointers + maOverlayObjects = pOldOverlayManager->maOverlayObjects; + const sal_uInt32 nSize(maOverlayObjects.size()); + + if(nSize) + { + for(OverlayObjectVector::iterator aIter(maOverlayObjects.begin()); aIter != maOverlayObjects.end(); aIter++) + { + OSL_ENSURE(*aIter, "Corrupted OverlayObject List (!)"); + OverlayObject& rCandidate = **aIter; + + // remove from old and add to new OverlayManager + pOldOverlayManager->impApplyRemoveActions(rCandidate); + impApplyAddActions(rCandidate); + } + + pOldOverlayManager->maOverlayObjects.clear(); + } + } + } + + const drawinglayer::geometry::ViewInformation2D OverlayManager::getCurrentViewInformation2D() const + { + if(getOutputDevice().GetViewTransformation() != maViewTransformation) + { + basegfx::B2DRange aViewRange(maViewInformation2D.getViewport()); + + if(OUTDEV_WINDOW == getOutputDevice().GetOutDevType()) + { + const Size aOutputSizePixel(getOutputDevice().GetOutputSizePixel()); + aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight()); + aViewRange.transform(getOutputDevice().GetInverseViewTransformation()); + } + + OverlayManager* pThis = const_cast< OverlayManager* >(this); + + pThis->maViewTransformation = getOutputDevice().GetViewTransformation(); + pThis->maViewInformation2D = drawinglayer::geometry::ViewInformation2D( + maViewInformation2D.getObjectTransformation(), + maViewTransformation, + aViewRange, + maViewInformation2D.getVisualizedPage(), + maViewInformation2D.getViewTime(), + maViewInformation2D.getExtendedInformationSequence()); + pThis->mfDiscreteOne = 0.0; + } + + return maViewInformation2D; + } + + void OverlayManager::impApplyRemoveActions(OverlayObject& rTarget) + { + // handle evtl. animation + if(rTarget.allowsAnimation()) + { + // remove from event chain + RemoveEvent(&rTarget); + } + + // make invisible + invalidateRange(rTarget.getBaseRange()); + + // clear manager + rTarget.mpOverlayManager = 0; + } + + void OverlayManager::impApplyAddActions(OverlayObject& rTarget) + { + // set manager + rTarget.mpOverlayManager = this; + + // make visible + invalidateRange(rTarget.getBaseRange()); + + // handle evtl. animation + if(rTarget.allowsAnimation()) + { + // Trigger at current time to get alive. This will do the + // object-specific next time calculation and hand over adding + // again to the scheduler to the animated object, too. This works for + // a paused or non-paused animator. + rTarget.Trigger(GetTime()); + } } OverlayManager::~OverlayManager() { - // the OverlayManager is not the owner of the OverlayObjects - // and thus will not delete them, but remove them. - while(mpOverlayObjectStart) + // The OverlayManager is not the owner of the OverlayObjects + // and thus will not delete them, but remove them. Profit here + // from knowing that all will be removed + const sal_uInt32 nSize(maOverlayObjects.size()); + + if(nSize) { - remove(*mpOverlayObjectStart); + for(OverlayObjectVector::iterator aIter(maOverlayObjects.begin()); aIter != maOverlayObjects.end(); aIter++) + { + OSL_ENSURE(*aIter, "Corrupted OverlayObject List (!)"); + OverlayObject& rCandidate = **aIter; + impApplyRemoveActions(rCandidate); + } + + // erase vector + maOverlayObjects.clear(); } } void OverlayManager::completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice) const { - if(!rRegion.IsEmpty() && mpOverlayObjectStart) + if(!rRegion.IsEmpty() && maOverlayObjects.size()) { // check for changed MapModes. That may influence the // logical size of pixel based OverlayObjects (like BitmapHandles) - ImpCheckMapModeChange(); + //ImpCheckMapModeChange(); // paint members const Rectangle aRegionBoundRect(rRegion.GetBoundRect()); @@ -195,87 +286,38 @@ namespace sdr void OverlayManager::add(OverlayObject& rOverlayObject) { - // add to the end of chain to preserve display order in paint - DBG_ASSERT(0L == rOverlayObject.mpOverlayManager, - "OverlayManager::add: OverlayObject is added to an OverlayManager (!)"); - - if(mpOverlayObjectEnd) - { - // new element, add to end - rOverlayObject.mpNext = mpOverlayObjectEnd->mpNext; - rOverlayObject.mpPrevious = mpOverlayObjectEnd; - mpOverlayObjectEnd->mpNext = &rOverlayObject; - mpOverlayObjectEnd = &rOverlayObject; - } - else - { - // first element - rOverlayObject.mpNext = rOverlayObject.mpPrevious = 0L; - mpOverlayObjectEnd = mpOverlayObjectStart = &rOverlayObject; - } + OSL_ENSURE(0 == rOverlayObject.mpOverlayManager, "OverlayObject is added twice to an OverlayManager (!)"); - // set manager - rOverlayObject.mpOverlayManager = this; - - // make visible - invalidateRange(rOverlayObject.getBaseRange()); + // add to the end of chain to preserve display order in paint + maOverlayObjects.push_back(&rOverlayObject); - // handle evtl. animation - if(rOverlayObject.allowsAnimation()) - { - // Trigger at current time to get alive. This will do the - // object-specific next time calculation and hand over adding - // again to the scheduler to the animated object, too. This works for - // a paused or non-paused animator. - rOverlayObject.Trigger(GetTime()); - } + // execute add actions + impApplyAddActions(rOverlayObject); } void OverlayManager::remove(OverlayObject& rOverlayObject) { - // handle evtl. animation - if(rOverlayObject.allowsAnimation()) - { - // remove from event chain - RemoveEvent(&rOverlayObject); - } + OSL_ENSURE(rOverlayObject.mpOverlayManager == this, "OverlayObject is removed from wrong OverlayManager (!)"); - // Remove from chain - DBG_ASSERT(rOverlayObject.mpOverlayManager == this, - "OverlayManager::remove: OverlayObject is removed from wrong OverlayManager (!)"); - - if(rOverlayObject.mpPrevious) - { - rOverlayObject.mpPrevious->mpNext = rOverlayObject.mpNext; - } + // execute remove actions + impApplyRemoveActions(rOverlayObject); - if(rOverlayObject.mpNext) - { - rOverlayObject.mpNext->mpPrevious = rOverlayObject.mpPrevious; - } - - if(&rOverlayObject == mpOverlayObjectStart) - { - mpOverlayObjectStart = rOverlayObject.mpNext; - } + // remove from vector + const OverlayObjectVector::iterator aFindResult = ::std::find(maOverlayObjects.begin(), maOverlayObjects.end(), &rOverlayObject); + const bool bFound(aFindResult != maOverlayObjects.end()); + OSL_ENSURE(bFound, "OverlayObject NOT found at OverlayManager (!)"); - if(&rOverlayObject == mpOverlayObjectEnd) + if(bFound) { - mpOverlayObjectEnd = rOverlayObject.mpPrevious; + maOverlayObjects.erase(aFindResult); } - - // make invisible - invalidateRange(rOverlayObject.getBaseRange()); - - // clear manager - rOverlayObject.mpOverlayManager = 0L; } void OverlayManager::invalidateRange(const basegfx::B2DRange& rRange) { if(OUTDEV_WINDOW == getOutputDevice().GetOutDevType()) { - if(maDrawinglayerOpt.IsAntiAliasing()) + if(getDrawinglayerOpt().IsAntiAliasing()) { // assume AA needs one pixel more and invalidate one pixel more const double fDiscreteOne(getDiscreteOne()); @@ -331,18 +373,6 @@ namespace sdr ImpStripeDefinitionChanged(); } } - - ::boost::shared_ptr<OverlayObjectVector> OverlayManager::GetOverlayObjects (void) const - { - ::boost::shared_ptr<OverlayObjectVector> pObjectList (new OverlayObjectVector()); - sdr::overlay::OverlayObject* pObject = mpOverlayObjectStart; - while (pObject != NULL) - { - pObjectList->push_back(pObject); - pObject = pObject->mpNext; - } - return pObjectList; - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index 38ac0ce98a..9b0fdb1589 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -36,12 +36,8 @@ #include <basegfx/range/b2drange.hxx> #include <vcl/salbtype.hxx> #include <vcl/window.hxx> - -// #i72754# #include <vcl/bitmap.hxx> #include <tools/stream.hxx> - -// #i75163# #include <basegfx/matrix/b2dhommatrix.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -63,7 +59,7 @@ namespace sdr // compare the MapModes for zoom/scroll changes if(maBufferDevice.GetMapMode() != getOutputDevice().GetMapMode()) { - const sal_Bool bZoomed( + const bool bZoomed( maBufferDevice.GetMapMode().GetScaleX() != getOutputDevice().GetMapMode().GetScaleX() || maBufferDevice.GetMapMode().GetScaleY() != getOutputDevice().GetMapMode().GetScaleY()); @@ -71,7 +67,7 @@ namespace sdr { const Point& rOriginOld = maBufferDevice.GetMapMode().GetOrigin(); const Point& rOriginNew = getOutputDevice().GetMapMode().GetOrigin(); - const sal_Bool bScrolled(rOriginOld != rOriginNew); + const bool bScrolled(rOriginOld != rOriginNew); if(bScrolled) { @@ -81,8 +77,8 @@ namespace sdr const Size aOutputSizePixel(maBufferDevice.GetOutputSizePixel()); // remember and switch off MapMode - const sal_Bool bMapModeWasEnabled(maBufferDevice.IsMapModeEnabled()); - maBufferDevice.EnableMapMode(sal_False); + const bool bMapModeWasEnabled(maBufferDevice.IsMapModeEnabled()); + maBufferDevice.EnableMapMode(false); // scroll internally buffered stuff const Point aDestinationOffsetPixel(aOriginNewPixel - aOriginOldPixel); @@ -132,10 +128,10 @@ namespace sdr Rectangle aRegionRectanglePixel; // MapModes off - const sal_Bool bMapModeWasEnabledDest(getOutputDevice().IsMapModeEnabled()); - const sal_Bool bMapModeWasEnabledSource(maBufferDevice.IsMapModeEnabled()); - getOutputDevice().EnableMapMode(sal_False); - ((OverlayManagerBuffered*)this)->maBufferDevice.EnableMapMode(sal_False); + const bool bMapModeWasEnabledDest(getOutputDevice().IsMapModeEnabled()); + const bool bMapModeWasEnabledSource(maBufferDevice.IsMapModeEnabled()); + getOutputDevice().EnableMapMode(false); + ((OverlayManagerBuffered*)this)->maBufferDevice.EnableMapMode(false); while(aRegionPixel.GetEnumRects(aRegionHandle, aRegionRectanglePixel)) { @@ -200,10 +196,10 @@ namespace sdr Rectangle aRegionRectanglePixel; // MapModes off - const sal_Bool bMapModeWasEnabledDest(rSource.IsMapModeEnabled()); - const sal_Bool bMapModeWasEnabledSource(maBufferDevice.IsMapModeEnabled()); - rSource.EnableMapMode(sal_False); - maBufferDevice.EnableMapMode(sal_False); + const bool bMapModeWasEnabledDest(rSource.IsMapModeEnabled()); + const bool bMapModeWasEnabledSource(maBufferDevice.IsMapModeEnabled()); + rSource.EnableMapMode(false); + maBufferDevice.EnableMapMode(false); while(aRegion.GetEnumRects(aRegionHandle, aRegionRectanglePixel)) { @@ -221,7 +217,7 @@ namespace sdr static bool bDoPaintForVisualControl(false); if(bDoPaintForVisualControl) { - const sal_Bool bMapModeWasEnabledTest(getOutputDevice().IsMapModeEnabled()); + const bool bMapModeWasEnabledTest(getOutputDevice().IsMapModeEnabled()); getOutputDevice().EnableMapMode(false); getOutputDevice().SetLineColor(COL_LIGHTRED); getOutputDevice().SetFillColor(); @@ -282,7 +278,7 @@ namespace sdr } maOutputBufferDevice.SetMapMode(getOutputDevice().GetMapMode()); - maOutputBufferDevice.EnableMapMode(sal_False); + maOutputBufferDevice.EnableMapMode(false); maOutputBufferDevice.SetDrawMode(maBufferDevice.GetDrawMode()); maOutputBufferDevice.SetSettings(maBufferDevice.GetSettings()); maOutputBufferDevice.SetAntialiasing(maBufferDevice.GetAntialiasing()); @@ -320,8 +316,8 @@ namespace sdr const Size aSize(aRegionRectanglePixel.GetSize()); { - const sal_Bool bMapModeWasEnabledDest(maBufferDevice.IsMapModeEnabled()); - maBufferDevice.EnableMapMode(sal_False); + const bool bMapModeWasEnabledDest(maBufferDevice.IsMapModeEnabled()); + maBufferDevice.EnableMapMode(false); maOutputBufferDevice.DrawOutDev( aTopLeft, aSize, // destination @@ -334,14 +330,14 @@ namespace sdr // paint overlay content for remembered region, use // method from base class directly - maOutputBufferDevice.EnableMapMode(sal_True); + maOutputBufferDevice.EnableMapMode(true); OverlayManager::ImpDrawMembers(aBufferRememberedRangeLogic, maOutputBufferDevice); - maOutputBufferDevice.EnableMapMode(sal_False); + maOutputBufferDevice.EnableMapMode(false); // copy to output { - const sal_Bool bMapModeWasEnabledDest(getOutputDevice().IsMapModeEnabled()); - getOutputDevice().EnableMapMode(sal_False); + const bool bMapModeWasEnabledDest(getOutputDevice().IsMapModeEnabled()); + getOutputDevice().EnableMapMode(false); getOutputDevice().DrawOutDev( aTopLeft, aSize, // destination @@ -417,8 +413,11 @@ namespace sdr return 0; } - OverlayManagerBuffered::OverlayManagerBuffered(OutputDevice& rOutputDevice, sal_Bool bRefreshWithPreRendering) - : OverlayManager(rOutputDevice), + OverlayManagerBuffered::OverlayManagerBuffered( + OutputDevice& rOutputDevice, + OverlayManager* pOldOverlayManager, + bool bRefreshWithPreRendering) + : OverlayManager(rOutputDevice, pOldOverlayManager), mbRefreshWithPreRendering(bRefreshWithPreRendering) { // Init timer @@ -515,9 +514,9 @@ namespace sdr } } - void OverlayManagerBuffered::SetRefreshWithPreRendering(sal_Bool bNew) + void OverlayManagerBuffered::SetRefreshWithPreRendering(bool bNew) { - if(mbRefreshWithPreRendering != bNew) + if((bool)mbRefreshWithPreRendering != bNew) { mbRefreshWithPreRendering = bNew; } diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx index 63dc6c1f2a..83947826ff 100644 --- a/svx/source/sdr/overlay/overlayobject.cxx +++ b/svx/source/sdr/overlay/overlayobject.cxx @@ -43,7 +43,6 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <svx/sdr/contact/objectcontacttools.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> -#include <drawinglayer/processor2d/baseprocessor2d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -52,207 +51,95 @@ namespace sdr namespace overlay { void OverlayObject::objectChange() - { - if(mpOverlayManager) - { - basegfx::B2DRange aPreviousRange(maBaseRange); - - if(!aPreviousRange.isEmpty()) - { - mpOverlayManager->invalidateRange(aPreviousRange); - } - - mbIsChanged = sal_True; - const basegfx::B2DRange& rCurrentRange = getBaseRange(); - - if(rCurrentRange != aPreviousRange && !rCurrentRange.isEmpty()) - { - mpOverlayManager->invalidateRange(rCurrentRange); - } - } - } - - // support method to draw striped geometries - void OverlayObject::ImpDrawRangeStriped(OutputDevice& rOutputDevice, const basegfx::B2DRange& rRange) { - if(getOverlayManager()) - { - const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(rRange)); + const basegfx::B2DRange aPreviousRange(maBaseRange); + maBaseRange.reset(); + setPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DSequence()); - if(aPolygon.count()) - { - ImpDrawPolygonStriped(rOutputDevice, aPolygon); - } + if(getOverlayManager() && !aPreviousRange.isEmpty()) + { + getOverlayManager()->invalidateRange(aPreviousRange); } - } - void OverlayObject::ImpDrawLineStriped(OutputDevice& rOutputDevice, double x1, double y1, double x2, double y2) - { - if(getOverlayManager()) - { - const basegfx::B2DPoint aStart(x1, y1); - const basegfx::B2DPoint aEnd(x2, y2); + const basegfx::B2DRange& rCurrentRange = getBaseRange(); - if(!aStart.equal(aEnd)) - { - basegfx::B2DPolygon aPolygon; - aPolygon.append(aStart); - aPolygon.append(aEnd); - - ImpDrawPolygonStriped(rOutputDevice, aPolygon); - } + if(getOverlayManager() && rCurrentRange != aPreviousRange && !rCurrentRange.isEmpty()) + { + getOverlayManager()->invalidateRange(rCurrentRange); } } - void OverlayObject::ImpDrawLineStriped(OutputDevice& rOutputDevice, const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd) + // OverlayObject implementations. + drawinglayer::primitive2d::Primitive2DSequence OverlayObject::createOverlayObjectPrimitive2DSequence() { - if(getOverlayManager() && !rStart.equal(rEnd)) - { - basegfx::B2DPolygon aPolygon; - aPolygon.append(rStart); - aPolygon.append(rEnd); - - ImpDrawPolygonStriped(rOutputDevice, aPolygon); - } + // Default implementation has to assert a missing implementation. It cannot + // be useful to have overlay object derivations which have no visualisation + // at all + OSL_ENSURE(false, "OverlayObject derivation without visualisation definition (missing createOverlayObjectPrimitive2DSequence implementation) (!)"); + return drawinglayer::primitive2d::Primitive2DSequence(); } - void OverlayObject::ImpDrawPolygonStriped(OutputDevice& rOutputDevice, const basegfx::B2DPolygon& rPolygon) + void OverlayObject::allowAntiAliase(bool bNew) { - if(getOverlayManager() && rPolygon.count()) + if(bNew != (bool)mbAllowsAntiAliase) { - if(getOverlayManager() && getOverlayManager()->getDrawinglayerOpt().IsAntiAliasing()) - { - // prepare ViewInformation2D - const drawinglayer::geometry::ViewInformation2D aViewInformation2D( - basegfx::B2DHomMatrix(), - rOutputDevice.GetViewTransformation(), - basegfx::B2DRange(), - 0, - 0.0, - 0); - - // create processor - drawinglayer::processor2d::BaseProcessor2D* pProcessor = ::sdr::contact::createBaseProcessor2DFromOutputDevice( - rOutputDevice, - aViewInformation2D); - - if(pProcessor) - { - // prepare primitives - const drawinglayer::primitive2d::Primitive2DReference aPolygonMarkerPrimitive2D( - new drawinglayer::primitive2d::PolygonMarkerPrimitive2D( - rPolygon, - getOverlayManager()->getStripeColorA().getBColor(), - getOverlayManager()->getStripeColorB().getBColor(), - getOverlayManager()->getStripeLengthPixel())); - const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aPolygonMarkerPrimitive2D, 1); - - pProcessor->process(aSequence); - - delete pProcessor; - } - } - else - { - const sal_uInt32 nLenPixel(getOverlayManager()->getStripeLengthPixel()); - const Size aDashSizePixel(nLenPixel, nLenPixel); - const Size aDashSizeLogic(rOutputDevice.PixelToLogic(aDashSizePixel)); - const double fDashLength(aDashSizeLogic.Width()); - const double fFullDotDashLength(fDashLength + fDashLength); - - // fill DashDot vector - ::std::vector<double> aDotDashArray; - aDotDashArray.push_back(fDashLength); - aDotDashArray.push_back(fDashLength); - - // get dash polygons - basegfx::B2DPolyPolygon aStripesA; - basegfx::B2DPolyPolygon aStripesB; - basegfx::tools::applyLineDashing(rPolygon, aDotDashArray, &aStripesA, &aStripesB, fFullDotDashLength); - - // draw stripes A - if(aStripesA.count()) - { - rOutputDevice.SetFillColor(); - rOutputDevice.SetLineColor(getOverlayManager()->getStripeColorA()); - - for(sal_uInt32 a(0L); a < aStripesA.count();a ++) - { - rOutputDevice.DrawPolyLine(aStripesA.getB2DPolygon(a)); - } - } - - // draw stripes B - if(aStripesB.count()) - { - rOutputDevice.SetFillColor(); - rOutputDevice.SetLineColor(getOverlayManager()->getStripeColorB()); + // remember new value + mbAllowsAntiAliase = bNew; - for(sal_uInt32 a(0L); a < aStripesB.count();a ++) - { - rOutputDevice.DrawPolyLine(aStripesB.getB2DPolygon(a)); - } - } - } + // register change (after change) + objectChange(); } } OverlayObject::OverlayObject(Color aBaseColor) - : Event(0L), - mpOverlayManager(0L), - mpNext(0L), - mpPrevious(0L), + : Event(0), + mpOverlayManager(0), maBaseColor(aBaseColor), - mbIsVisible(sal_True), - mbIsChanged(sal_True), - mbIsHittable(sal_True), - mbAllowsAnimation(sal_False) + mbIsVisible(true), + mbIsHittable(true), + mbAllowsAnimation(false), + mbAllowsAntiAliase(true) { } OverlayObject::~OverlayObject() { - DBG_ASSERT(0L == mpOverlayManager, - "OverlayObject is destructed which is still registered at OverlayManager (!)"); + OSL_ENSURE(0 == getOverlayManager(), "OverlayObject is destructed which is still registered at OverlayManager (!)"); } - sal_Bool OverlayObject::isHit(const basegfx::B2DPoint& rPos, double fTol) const + drawinglayer::primitive2d::Primitive2DSequence OverlayObject::getOverlayObjectPrimitive2DSequence() const { - if(isHittable()) + if(!getPrimitive2DSequence().hasElements()) { - if(0.0 != fTol) - { - basegfx::B2DRange aRange(getBaseRange()); - aRange.grow(fTol); - return aRange.isInside(rPos); - } - else - { - return getBaseRange().isInside(rPos); - } + // no existing sequence; create one + const_cast< OverlayObject* >(this)->setPrimitive2DSequence( + const_cast< OverlayObject* >(this)->createOverlayObjectPrimitive2DSequence()); } - return sal_False; + return getPrimitive2DSequence(); } const basegfx::B2DRange& OverlayObject::getBaseRange() const { - if(mbIsChanged) + if(getOverlayManager() && maBaseRange.isEmpty()) { - if(mpOverlayManager) + const drawinglayer::primitive2d::Primitive2DSequence& rSequence = getOverlayObjectPrimitive2DSequence(); + + if(rSequence.hasElements()) { - ((::sdr::overlay::OverlayObject*)this)->createBaseRange(mpOverlayManager->getOutputDevice()); - } + const drawinglayer::geometry::ViewInformation2D aViewInformation2D(getOverlayManager()->getCurrentViewInformation2D()); - ((::sdr::overlay::OverlayObject*)this)->mbIsChanged = sal_False; + const_cast< sdr::overlay::OverlayObject* >(this)->maBaseRange = + drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(rSequence, aViewInformation2D); + } } return maBaseRange; } - void OverlayObject::setVisible(sal_Bool bNew) + void OverlayObject::setVisible(bool bNew) { - if(bNew != mbIsVisible) + if(bNew != (bool)mbIsVisible) { // remember new value mbIsVisible = bNew; @@ -262,9 +149,9 @@ namespace sdr } } - void OverlayObject::setHittable(sal_Bool bNew) + void OverlayObject::setHittable(bool bNew) { - if(bNew != mbIsHittable) + if(bNew != (bool)mbIsHittable) { // remember new value mbIsHittable = bNew; @@ -291,11 +178,6 @@ namespace sdr // default does not register again } - void OverlayObject::zoomHasChanged() - { - // default does not need to do anything - } - void OverlayObject::stripeDefinitionHasChanged() { // default does not need to do anything @@ -330,15 +212,6 @@ namespace sdr objectChange(); } } - - void OverlayObjectWithBasePosition::transform(const basegfx::B2DHomMatrix& rMatrix) - { - if(!rMatrix.isIdentity()) - { - basegfx::B2DPoint aNewBasePosition = rMatrix * getBasePosition(); - setBasePosition(aNewBasePosition); - } - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlayobjectcell.cxx b/svx/source/sdr/overlay/overlayobjectcell.cxx index 87954ea7e5..cda1bbd636 100644 --- a/svx/source/sdr/overlay/overlayobjectcell.cxx +++ b/svx/source/sdr/overlay/overlayobjectcell.cxx @@ -35,6 +35,11 @@ #include <vcl/outdev.hxx> #include <vcl/hatch.hxx> #include <svx/sdr/overlay/overlayobjectcell.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> +#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx> +#include <drawinglayer/primitive2d/invertprimitive2d.hxx> using namespace ::basegfx; @@ -48,83 +53,60 @@ namespace sdr mePaintType( eType ), maRectangles( rRects ) { + // no AA for selection overlays + allowAntiAliase(false); } OverlayObjectCell::~OverlayObjectCell() { } - void OverlayObjectCell::drawGeometry(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayObjectCell::createOverlayObjectPrimitive2DSequence() { - // set colors - rOutputDevice.SetLineColor(); - rOutputDevice.SetFillColor(getBaseColor()); + drawinglayer::primitive2d::Primitive2DSequence aRetval; + const sal_uInt32 nCount(maRectangles.size()); - if ( mePaintType == CELL_OVERLAY_INVERT ) + if(nCount) { - rOutputDevice.Push(); - rOutputDevice.SetRasterOp( ROP_XOR ); - rOutputDevice.SetFillColor( COL_WHITE ); - } - - for(sal_uInt32 a(0L);a < maRectangles.size(); a++) - { - const basegfx::B2DRange& rRange(maRectangles[a]); - const Rectangle aRectangle(fround(rRange.getMinX()), fround(rRange.getMinY()), fround(rRange.getMaxX()), fround(rRange.getMaxY())); + const basegfx::BColor aRGBColor(getBaseColor().getBColor()); + aRetval.realloc(nCount); - switch(mePaintType) + // create primitives for all ranges + for(sal_uInt32 a(0); a < nCount; a++) { - case CELL_OVERLAY_INVERT : - { - rOutputDevice.DrawRect( aRectangle ); - - // if(OUTDEV_WINDOW == rOutputDevice.GetOutDevType()) - // { - // ((Window&)rOutputDevice).Invert(aRectangle, INVERT_HIGHLIGHT); - // } + const basegfx::B2DRange& rRange(maRectangles[a]); + const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(rRange)); - break; - } - case CELL_OVERLAY_HATCH : - { - rOutputDevice.DrawHatch(PolyPolygon(Polygon(aRectangle)), Hatch(HATCH_SINGLE, getBaseColor(), 2, 450)); - break; - } - case CELL_OVERLAY_TRANSPARENT : - { - rOutputDevice.DrawTransparent(PolyPolygon(Polygon(aRectangle)), 50); - break; - } - case CELL_OVERLAY_LIGHT_TRANSPARENT : - { - rOutputDevice.DrawTransparent(PolyPolygon(Polygon(aRectangle)), 80); - break; - } + aRetval[a] = drawinglayer::primitive2d::Primitive2DReference( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aPolygon), + aRGBColor)); } - } - if ( mePaintType == CELL_OVERLAY_INVERT ) - rOutputDevice.Pop(); - } - void OverlayObjectCell::createBaseRange(OutputDevice& /*rOutputDevice*/) - { - maBaseRange.reset(); + if(mePaintType == CELL_OVERLAY_TRANSPARENT) + { + // embed in 50% transparent paint + const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha( + new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + aRetval, + 0.5)); - for(sal_uInt32 a(0L); a < maRectangles.size(); a++) - { - maBaseRange.expand(maRectangles[a]); - } - } + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1); + } + else // CELL_OVERLAY_INVERT + { + // embed in invert primitive + const drawinglayer::primitive2d::Primitive2DReference aInvert( + new drawinglayer::primitive2d::InvertPrimitive2D( + aRetval)); - void OverlayObjectCell::transform(const basegfx::B2DHomMatrix& rMatrix) - { - for(sal_uInt32 a(0L); a < maRectangles.size(); a++) - { - maRectangles[a].transform(rMatrix); + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aInvert, 1); + } } - } + return aRetval; + } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx index 2b18f048b4..1ca102e36e 100644 --- a/svx/source/sdr/overlay/overlayobjectlist.cxx +++ b/svx/source/sdr/overlay/overlayobjectlist.cxx @@ -40,6 +40,8 @@ // get access to basic algos like ::std::find #include <algorithm> +#include <drawinglayer/processor2d/hittestprocessor2d.hxx> + ////////////////////////////////////////////////////////////////////////////// namespace sdr @@ -73,63 +75,92 @@ namespace sdr void OverlayObjectList::remove(OverlayObject& rOverlayObject) { const OverlayObjectVector::iterator aFindResult = ::std::find(maVector.begin(), maVector.end(), &rOverlayObject); - DBG_ASSERT((aFindResult != maVector.end()), - "OverlayObjectList::remove: Could not find given object in list (!)"); - maVector.erase(aFindResult); + const bool bFound(aFindResult != maVector.end()); + OSL_ENSURE(bFound, "Could not find given object in list (!)"); + + if(bFound) + { + maVector.erase(aFindResult); + } } - sal_Bool OverlayObjectList::isHit(const basegfx::B2DPoint& rPos, double fTol) const + bool OverlayObjectList::isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance) const { if(maVector.size()) { OverlayObjectVector::const_iterator aStart(maVector.begin()); + sdr::overlay::OverlayObject* pFirst = *aStart; + OSL_ENSURE(pFirst, "Corrupt OverlayObjectList (!)"); + OverlayManager* pManager = pFirst->getOverlayManager(); - if(0.0 == fTol) + if(pManager) { - ::sdr::overlay::OverlayObject* pCandidate = *aStart; - OverlayManager* pManager = pCandidate->getOverlayManager(); - - if(pManager) + if(0.0 == fLogicTolerance) { - Size aSizeLogic(pManager->getOutputDevice().PixelToLogic( + const Size aSizeLogic(pManager->getOutputDevice().PixelToLogic( Size(DEFAULT_VALUE_FOR_HITTEST_PIXEL, DEFAULT_VALUE_FOR_HITTEST_PIXEL))); - fTol = aSizeLogic.Width(); + fLogicTolerance = aSizeLogic.Width(); } - } - for(; aStart != maVector.end(); aStart++) - { - ::sdr::overlay::OverlayObject* pCandidate = *aStart; + const drawinglayer::geometry::ViewInformation2D aViewInformation2D(pManager->getCurrentViewInformation2D()); + drawinglayer::processor2d::HitTestProcessor2D aHitTestProcessor2D( + aViewInformation2D, + rLogicPosition, + fLogicTolerance, + false); - if(pCandidate->isHit(rPos, fTol)) + for(; aStart != maVector.end(); aStart++) { - return sal_True; + sdr::overlay::OverlayObject* pCandidate = *aStart; + OSL_ENSURE(pCandidate, "Corrupt OverlayObjectList (!)"); + + if(pCandidate->isHittable()) + { + const drawinglayer::primitive2d::Primitive2DSequence& rSequence = pCandidate->getOverlayObjectPrimitive2DSequence(); + + if(rSequence.hasElements()) + { + aHitTestProcessor2D.process(rSequence); + + if(aHitTestProcessor2D.getHit()) + { + return true; + } + } + } } } } - return sal_False; + return false; } - sal_Bool OverlayObjectList::isHitPixel(const Point& rPos, sal_uInt32 nTol) const + bool OverlayObjectList::isHitPixel(const Point& rDiscretePosition, sal_uInt32 nDiscreteTolerance) const { if(maVector.size()) { OverlayObjectVector::const_iterator aStart(maVector.begin()); - ::sdr::overlay::OverlayObject* pCandidate = *aStart; + sdr::overlay::OverlayObject* pCandidate = *aStart; OverlayManager* pManager = pCandidate->getOverlayManager(); if(pManager) { - Point aPosLogic(pManager->getOutputDevice().PixelToLogic(rPos)); - Size aSizeLogic(pManager->getOutputDevice().PixelToLogic(Size(nTol, nTol))); - basegfx::B2DPoint aPosition(aPosLogic.X(), aPosLogic.Y()); + const Point aPosLogic(pManager->getOutputDevice().PixelToLogic(rDiscretePosition)); + const basegfx::B2DPoint aPosition(aPosLogic.X(), aPosLogic.Y()); - return isHit(aPosition, (double)aSizeLogic.Width()); + if(nDiscreteTolerance) + { + const Size aSizeLogic(pManager->getOutputDevice().PixelToLogic(Size(nDiscreteTolerance, nDiscreteTolerance))); + return isHitLogic(aPosition, (double)aSizeLogic.Width()); + } + else + { + return isHitLogic(aPosition); + } } } - return sal_False; + return false; } basegfx::B2DRange OverlayObjectList::getBaseRange() const @@ -149,20 +180,6 @@ namespace sdr return aRetval; } - - void OverlayObjectList::transform(const basegfx::B2DHomMatrix& rMatrix) - { - if(!rMatrix.isIdentity() && maVector.size()) - { - OverlayObjectVector::iterator aStart(maVector.begin()); - - for(; aStart != maVector.end(); aStart++) - { - ::sdr::overlay::OverlayObject* pCandidate = *aStart; - pCandidate->transform(rMatrix); - } - } - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlaypolypolygon.cxx b/svx/source/sdr/overlay/overlaypolypolygon.cxx index 16890fa8a5..6827cd64cf 100644 --- a/svx/source/sdr/overlay/overlaypolypolygon.cxx +++ b/svx/source/sdr/overlay/overlaypolypolygon.cxx @@ -35,6 +35,8 @@ #include <vcl/outdev.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <svx/sdr/overlay/overlaymanager.hxx> +#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -42,21 +44,33 @@ namespace sdr { namespace overlay { - void OverlayPolyPolygonStriped::drawGeometry(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStriped::createOverlayObjectPrimitive2DSequence() { - if(maPolyPolygon.count()) + drawinglayer::primitive2d::Primitive2DSequence aRetval; + + if(getOverlayManager()) { - for(sal_uInt32 a(0L); a < maPolyPolygon.count(); a++) - { - ImpDrawPolygonStriped(rOutputDevice, maPolyPolygon.getB2DPolygon(a)); - } + const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor()); + const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor()); + const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel()); + + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D( + getPolyPolygon(), + aRGBColorA, + aRGBColorB, + fStripeLengthPixel)); + + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); } + + return aRetval; } - void OverlayPolyPolygonStriped::createBaseRange(OutputDevice& /*rOutputDevice*/) + void OverlayPolyPolygonStriped::stripeDefinitionHasChanged() { - // use tooling to get range from PolyPolygon - maBaseRange = basegfx::tools::getRange(maPolyPolygon); + // react on OverlayManager's stripe definition change + objectChange(); } OverlayPolyPolygonStriped::OverlayPolyPolygonStriped( @@ -81,67 +95,6 @@ namespace sdr objectChange(); } } - - sal_Bool OverlayPolyPolygonStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const - { - if(isHittable()) - { - return basegfx::tools::isInEpsilonRange(maPolyPolygon, rPos, fTol); - } - - return sal_False; - } - - void OverlayPolyPolygonStriped::transform(const basegfx::B2DHomMatrix& rMatrix) - { - if(!rMatrix.isIdentity()) - { - // transform maPolyPolygon - maPolyPolygon.transform(rMatrix); - - // register change (after change) - objectChange(); - } - } - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - void OverlayPolyPolygon::drawGeometry(OutputDevice& rOutputDevice) - { - if(maPolyPolygon.count()) - { - rOutputDevice.SetLineColor(getBaseColor()); - rOutputDevice.SetFillColor(); - - // iterate self, else the single polygons will be closed when - // using DrawPolyPolygon - for(sal_uInt32 a(0L); a < maPolyPolygon.count(); a++) - { - const Polygon aPaintPoly(maPolyPolygon.getB2DPolygon(a)); - rOutputDevice.DrawPolyLine(aPaintPoly); - } - } - } - - OverlayPolyPolygon::OverlayPolyPolygon( - const basegfx::B2DPolyPolygon& rPolyPolygon, - Color aPolygonColor) - : OverlayPolyPolygonStriped(rPolyPolygon) - { - // set base color here, OverlayCrosshairStriped constructor has set - // it to it's own default. - maBaseColor = aPolygonColor; - } - - OverlayPolyPolygon::~OverlayPolyPolygon() - { - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx b/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx index 6ceca0ff7a..d89a457a87 100644 --- a/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx +++ b/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx @@ -43,55 +43,9 @@ namespace sdr { namespace overlay { - void OverlayPrimitive2DSequenceObject::drawGeometry(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayPrimitive2DSequenceObject::createOverlayObjectPrimitive2DSequence() { - if(getOverlayManager()) - { - // prepare ViewInformation2D - const drawinglayer::geometry::ViewInformation2D aViewInformation2D( - basegfx::B2DHomMatrix(), - rOutputDevice.GetViewTransformation(), - basegfx::B2DRange(), - 0, - 0.0, - 0); - - // create processor - drawinglayer::processor2d::BaseProcessor2D* pProcessor = ::sdr::contact::createBaseProcessor2DFromOutputDevice( - rOutputDevice, - aViewInformation2D); - - if(pProcessor) - { - pProcessor->process(getSequence()); - - delete pProcessor; - } - } - } - - void OverlayPrimitive2DSequenceObject::createBaseRange(OutputDevice& rOutputDevice) - { - const drawinglayer::geometry::ViewInformation2D aViewInformation2D( - basegfx::B2DHomMatrix(), - rOutputDevice.GetViewTransformation(), - basegfx::B2DRange(), - 0, - 0.0, - 0); - - maBaseRange = drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence( - getSequence(), aViewInformation2D); - } - - sal_Bool OverlayPrimitive2DSequenceObject::isHit(const basegfx::B2DPoint& /*rPos*/, double /*fTol*/) const - { - if(isHittable()) - { - return false; - } - - return false; + return getSequence(); } OverlayPrimitive2DSequenceObject::OverlayPrimitive2DSequenceObject(const drawinglayer::primitive2d::Primitive2DSequence& rSequence) diff --git a/svx/source/sdr/overlay/overlayrollingrectangle.cxx b/svx/source/sdr/overlay/overlayrollingrectangle.cxx index 8b862484d6..e2e079a37f 100644 --- a/svx/source/sdr/overlay/overlayrollingrectangle.cxx +++ b/svx/source/sdr/overlay/overlayrollingrectangle.cxx @@ -35,6 +35,11 @@ #include <vcl/salbtype.hxx> #include <vcl/outdev.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdr/overlay/overlaytools.hxx> +#include <svx/sdr/overlay/overlaymanager.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -42,65 +47,59 @@ namespace sdr { namespace overlay { - void OverlayRollingRectangleStriped::drawGeometry(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayRollingRectangleStriped::createOverlayObjectPrimitive2DSequence() { - const basegfx::B2DRange aRange(getBasePosition(), getSecondPosition()); + drawinglayer::primitive2d::Primitive2DSequence aRetval; - if(getShowBounds()) + if(getOverlayManager() && (getShowBounds() || getExtendedLines())) { - ImpDrawRangeStriped(rOutputDevice, aRange); - } - - if(getExtendedLines()) - { - const Point aEmptyPoint; - const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel()); - const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel)); - - // Left lines - ImpDrawLineStriped(rOutputDevice, aVisibleLogic.Left(), aRange.getMinY(), aRange.getMinX(), aRange.getMinY()); - ImpDrawLineStriped(rOutputDevice, aVisibleLogic.Left(), aRange.getMaxY(), aRange.getMinX(), aRange.getMaxY()); - - // Right lines - ImpDrawLineStriped(rOutputDevice, aRange.getMaxX(), aRange.getMinY(), aVisibleLogic.Right(), aRange.getMinY()); - ImpDrawLineStriped(rOutputDevice, aRange.getMaxX(), aRange.getMaxY(), aVisibleLogic.Right(), aRange.getMaxY()); - - // Top lines - ImpDrawLineStriped(rOutputDevice, aRange.getMinX(), aVisibleLogic.Top(), aRange.getMinX(), aRange.getMinY()); - ImpDrawLineStriped(rOutputDevice, aRange.getMaxX(), aVisibleLogic.Top(), aRange.getMaxX(), aRange.getMinY()); + const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor()); + const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor()); + const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel()); + const basegfx::B2DRange aRollingRectangle(getBasePosition(), getSecondPosition()); + + if(getShowBounds()) + { + // view-independent part, create directly + const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(aRollingRectangle)); + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::PolygonMarkerPrimitive2D( + aPolygon, + aRGBColorA, + aRGBColorB, + fStripeLengthPixel)); + + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aReference); + } - // Bottom lines - ImpDrawLineStriped(rOutputDevice, aRange.getMinX(), aRange.getMaxY(), aRange.getMinX(), aVisibleLogic.Bottom()); - ImpDrawLineStriped(rOutputDevice, aRange.getMaxX(), aRange.getMaxY(), aRange.getMaxX(), aVisibleLogic.Bottom()); + if(getExtendedLines()) + { + // view-dependent part, use helper primitive + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::OverlayRollingRectanglePrimitive( + aRollingRectangle, + aRGBColorA, + aRGBColorB, + fStripeLengthPixel)); + + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aReference); + } } + + return aRetval; } - void OverlayRollingRectangleStriped::createBaseRange(OutputDevice& rOutputDevice) + void OverlayRollingRectangleStriped::stripeDefinitionHasChanged() { - // reset range and expand it - maBaseRange.reset(); - - if(getExtendedLines()) - { - const Point aEmptyPoint; - const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel()); - const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel)); - maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Left(), aVisibleLogic.Top())); - maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Right(), aVisibleLogic.Bottom())); - } - - if(getShowBounds()) - { - maBaseRange.expand(getBasePosition()); - maBaseRange.expand(getSecondPosition()); - } + // react on OverlayManager's stripe definition change + objectChange(); } OverlayRollingRectangleStriped::OverlayRollingRectangleStriped( const basegfx::B2DPoint& rBasePos, const basegfx::B2DPoint& rSecondPos, - sal_Bool bExtendedLines, - sal_Bool bShowBounds) + bool bExtendedLines, + bool bShowBounds) : OverlayObjectWithBasePosition(rBasePos, Color(COL_BLACK)), maSecondPosition(rSecondPos), mbExtendedLines(bExtendedLines), @@ -124,9 +123,9 @@ namespace sdr } } - void OverlayRollingRectangleStriped::setExtendedLines(sal_Bool bNew) + void OverlayRollingRectangleStriped::setExtendedLines(bool bNew) { - if(bNew != mbExtendedLines) + if(bNew != (bool)mbExtendedLines) { // remember new value mbExtendedLines = bNew; @@ -136,9 +135,9 @@ namespace sdr } } - void OverlayRollingRectangleStriped::setShowBounds(sal_Bool bNew) + void OverlayRollingRectangleStriped::setShowBounds(bool bNew) { - if(bNew != mbShowBounds) + if(bNew != (bool)mbShowBounds) { // remember new value mbShowBounds = bNew; @@ -147,138 +146,6 @@ namespace sdr objectChange(); } } - - sal_Bool OverlayRollingRectangleStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const - { - if(isHittable()) - { - if(getExtendedLines()) - { - const basegfx::B2DRange aRange(getBaseRange()); - const basegfx::B2DPoint aMinimum(aRange.getMinimum()); - const basegfx::B2DPoint aMaximum(aRange.getMaximum()); - - // test upper line horizontal - if(rPos.getY() > (aMinimum.getY() - fTol) && rPos.getY() < (aMinimum.getY() + fTol)) - { - return sal_True; - } - - // test lower line horizontal - if(rPos.getY() > (aMaximum.getY() - fTol) && rPos.getY() < (aMaximum.getY() + fTol)) - { - return sal_True; - } - - // test left line vertical - if(rPos.getX() > (aMinimum.getX() - fTol) && rPos.getX() < (aMinimum.getX() + fTol)) - { - return sal_True; - } - - // test rightline vertical - if(rPos.getX() > (aMaximum.getX() - fTol) && rPos.getX() < (aMaximum.getX() + fTol)) - { - return sal_True; - } - } - - if(getShowBounds()) - { - // test for inside grown range, outside shrinked one to test for border - // hit without interiour - basegfx::B2DRange aOuterRange(getBaseRange()); - aOuterRange.grow(fTol); - - if(aOuterRange.isInside(rPos)) - { - basegfx::B2DRange aInnerRange(getBaseRange()); - aInnerRange.grow(-fTol); - - return !aInnerRange.isInside(rPos); - } - } - } - - return sal_False; - } - - void OverlayRollingRectangleStriped::transform(const basegfx::B2DHomMatrix& rMatrix) - { - if(!rMatrix.isIdentity()) - { - // transform base position - OverlayObjectWithBasePosition::transform(rMatrix); - - // transform maSecondPosition - const basegfx::B2DPoint aNewSecondPosition = rMatrix * getSecondPosition(); - setSecondPosition(aNewSecondPosition); - } - } - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - void OverlayRollingRectangle::drawGeometry(OutputDevice& rOutputDevice) - { - const Point aStart(FRound(getBasePosition().getX()), FRound(getBasePosition().getY())); - const Point aEnd(FRound(getSecondPosition().getX()), FRound(getSecondPosition().getY())); - Rectangle aRectangle(aStart, aEnd); - aRectangle.Justify(); - - if(getShowBounds()) - { - rOutputDevice.SetLineColor(getBaseColor()); - rOutputDevice.SetFillColor(); - - rOutputDevice.DrawRect(aRectangle); - } - - if(getExtendedLines()) - { - const Point aEmptyPoint; - const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel()); - const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel)); - - // Left lines - rOutputDevice.DrawLine(Point(aVisibleLogic.Left(), aRectangle.Top()), aRectangle.TopLeft()); - rOutputDevice.DrawLine(Point(aVisibleLogic.Left(), aRectangle.Bottom()), aRectangle.BottomLeft()); - - // Right lines - rOutputDevice.DrawLine(aRectangle.TopRight(), Point(aVisibleLogic.Right(), aRectangle.Top())); - rOutputDevice.DrawLine(aRectangle.BottomRight(), Point(aVisibleLogic.Right(), aRectangle.Bottom())); - - // Top lines - rOutputDevice.DrawLine(Point(aRectangle.Left(), aVisibleLogic.Top()), aRectangle.TopLeft()); - rOutputDevice.DrawLine(Point(aRectangle.Right(), aVisibleLogic.Top()), aRectangle.TopRight()); - - // Bottom lines - rOutputDevice.DrawLine(aRectangle.BottomLeft(), Point(aRectangle.Left(), aVisibleLogic.Bottom())); - rOutputDevice.DrawLine(aRectangle.BottomRight(), Point(aRectangle.Right(), aVisibleLogic.Bottom())); - } - } - - OverlayRollingRectangle::OverlayRollingRectangle( - const basegfx::B2DPoint& rBasePos, - const basegfx::B2DPoint& rSecondPos, - Color aLineColor, - sal_Bool bExtendedLines, - sal_Bool bShowBounds) - : OverlayRollingRectangleStriped(rBasePos, rSecondPos, bExtendedLines, bShowBounds) - { - // set base color here, OverlayCrosshairStriped constructor has set - // it to it's own default. - maBaseColor = aLineColor; - } - - OverlayRollingRectangle::~OverlayRollingRectangle() - { - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/overlay/overlaysdrobject.cxx b/svx/source/sdr/overlay/overlaysdrobject.cxx deleted file mode 100644 index 70aedad836..0000000000 --- a/svx/source/sdr/overlay/overlaysdrobject.cxx +++ /dev/null @@ -1,87 +0,0 @@ -/************************************************************************* - * - * 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: overlaysdrobject.cxx,v $ - * $Revision: 1.7 $ - * - * 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_svx.hxx" -#include <svx/sdr/overlay/overlaysdrobject.hxx> -#include <svx/svdobj.hxx> - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - void OverlaySdrObject::drawGeometry(OutputDevice& rOutputDevice) - { - mrSdrObject.SingleObjectPainter(rOutputDevice); - } - - void OverlaySdrObject::createBaseRange(OutputDevice& /*rOutputDevice*/) - { - // reset range and expand it - maBaseRange.reset(); - - // get BoundRect - Rectangle aBoundRect(mrSdrObject.GetCurrentBoundRect()); - const basegfx::B2DPoint aTopLeft(aBoundRect.Left(), aBoundRect.Top()); - const basegfx::B2DPoint aBottomRight(aBoundRect.Right(), aBoundRect.Bottom()); - - maBaseRange.expand(aTopLeft); - maBaseRange.expand(aBottomRight); - } - - OverlaySdrObject::OverlaySdrObject( - const basegfx::B2DPoint& rBasePos, - const SdrObject& rObject) - : OverlayObjectWithBasePosition(rBasePos, Color(COL_BLACK)), - mrSdrObject(rObject) - { - } - - OverlaySdrObject::~OverlaySdrObject() - { - } - - sal_Bool OverlaySdrObject::isHit(const basegfx::B2DPoint& rPos, double fTol) const - { - if(isHittable()) - { - Point aPnt( (long)rPos.getX(), (long)rPos.getY() ); - return mrSdrObject.CheckHit(aPnt, (USHORT)fTol, 0) != 0 ? sal_True : sal_False; - } - - return sal_False; - } - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx new file mode 100644 index 0000000000..b60f1e66ce --- /dev/null +++ b/svx/source/sdr/overlay/overlayselection.cxx @@ -0,0 +1,233 @@ +/************************************************************************* + * + * 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: overlayline.cxx,v $ + * $Revision: 1.5 $ + * + * 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_svx.hxx" +#include <svx/sdr/overlay/overlayselection.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> +#include <svtools/optionsdrawinglayer.hxx> +#include <vcl/svapp.hxx> +#include <vcl/outdev.hxx> +#include <drawinglayer/primitive2d/invertprimitive2d.hxx> +#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx> +#include <basegfx/polygon/b2dpolypolygoncutter.hxx> +#include <svx/sdr/overlay/overlaymanager.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + // combine rages geometrically to a single, ORed polygon + basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const std::vector< basegfx::B2DRange >& rRanges) + { + const sal_uInt32 nCount(rRanges.size()); + basegfx::B2DPolyPolygon aRetval; + + for(sal_uInt32 a(0); a < nCount; a++) + { + const basegfx::B2DPolygon aDiscretePolygon(basegfx::tools::createPolygonFromRect(rRanges[a])); + + if(0 == a) + { + aRetval.append(aDiscretePolygon); + } + else + { + aRetval = basegfx::tools::solvePolygonOperationOr(aRetval, basegfx::B2DPolyPolygon(aDiscretePolygon)); + } + } + + return aRetval; + } + + // check if wanted type OVERLAY_TRANSPARENT or OVERLAY_SOLID + // is possible. If not, fallback to invert mode (classic mode) + OverlayType impCheckPossibleOverlayType(OverlayType aOverlayType) + { + if(OVERLAY_INVERT != aOverlayType) + { + const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer; + + if(!aSvtOptionsDrawinglayer.IsTransparentSelection()) + { + // not possible when switched off by user + return OVERLAY_INVERT; + } + else + { + const OutputDevice *pOut = Application::GetDefaultDevice(); + + if(pOut->GetSettings().GetStyleSettings().GetHighContrastMode()) + { + // not possible when in high contrast mode + return OVERLAY_INVERT; + } + + if(!pOut->supportsOperation(OutDevSupport_TransparentRect)) + { + // not possible when no fast transparence paint is supported on the system + return OVERLAY_INVERT; + } + } + } + + return aOverlayType; + } + + drawinglayer::primitive2d::Primitive2DSequence OverlaySelection::createOverlayObjectPrimitive2DSequence() + { + drawinglayer::primitive2d::Primitive2DSequence aRetval; + const sal_uInt32 nCount(getRanges().size()); + + if(nCount) + { + // create range primitives + const basegfx::BColor aRGBColor(getBaseColor().getBColor()); + aRetval.realloc(nCount); + + for(sal_uInt32 a(0);a < nCount; a++) + { + const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(maRanges[a])); + aRetval[a] = drawinglayer::primitive2d::Primitive2DReference( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aPolygon), + aRGBColor)); + } + + if(OVERLAY_INVERT == maLastOverlayType) + { + // embed all in invert primitive + const drawinglayer::primitive2d::Primitive2DReference aInvert( + new drawinglayer::primitive2d::InvertPrimitive2D( + aRetval)); + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aInvert, 1); + } + else if(OVERLAY_TRANSPARENT == maLastOverlayType) + { + // embed all rectangles in transparent paint + const double fTransparence(mnLastTransparence / 100.0); + const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha( + new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + aRetval, + fTransparence)); + + if(getBorder()) + { + const basegfx::B2DPolyPolygon aPolyPolygon(impCombineRangesToPolyPolygon(getRanges())); + const drawinglayer::primitive2d::Primitive2DReference aSelectionOutline( + new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D( + aPolyPolygon, + aRGBColor)); + + // add both to result + aRetval.realloc(2); + aRetval[0] = aUnifiedAlpha; + aRetval[1] = aSelectionOutline; + } + else + { + // just add transparent part + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1); + } + } + } + + return aRetval; + } + + OverlaySelection::OverlaySelection( + OverlayType eType, + const Color& rColor, + const std::vector< basegfx::B2DRange >& rRanges, + bool bBorder) + : OverlayObject(rColor), + meOverlayType(eType), + maRanges(rRanges), + maLastOverlayType(eType), + mnLastTransparence(0), + mbBorder(bBorder) + { + // no AA for selection overlays + allowAntiAliase(false); + } + + OverlaySelection::~OverlaySelection() + { + if(getOverlayManager()) + { + getOverlayManager()->remove(*this); + } + } + + drawinglayer::primitive2d::Primitive2DSequence OverlaySelection::getOverlayObjectPrimitive2DSequence() const + { + // get current values + const OverlayType aNewOverlayType(impCheckPossibleOverlayType(meOverlayType)); + const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer; + const sal_uInt16 nNewTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent()); + + if(getPrimitive2DSequence().hasElements()) + { + if(aNewOverlayType != maLastOverlayType + || nNewTransparence != mnLastTransparence) + { + // conditions of last local decomposition have changed, delete + const_cast< OverlaySelection* >(this)->setPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DSequence()); + } + } + + if(!getPrimitive2DSequence().hasElements()) + { + // remember new values + const_cast< OverlaySelection* >(this)->maLastOverlayType = aNewOverlayType; + const_cast< OverlaySelection* >(this)->mnLastTransparence = nNewTransparence; + } + + // call base implementation + return OverlayObject::getOverlayObjectPrimitive2DSequence(); + } + + void OverlaySelection::setRanges(const std::vector< basegfx::B2DRange >& rNew) + { + if(rNew != maRanges) + { + maRanges = rNew; + objectChange(); + } + } + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/sdr/overlay/overlaytools.cxx b/svx/source/sdr/overlay/overlaytools.cxx new file mode 100644 index 0000000000..ea20bd4f20 --- /dev/null +++ b/svx/source/sdr/overlay/overlaytools.cxx @@ -0,0 +1,498 @@ +/************************************************************************* + * + * 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: overlayobject.cxx,v $ + * $Revision: 1.6 $ + * + * 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_svx.hxx" + +#include <svx/sdr/overlay/overlaytools.hxx> +#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> +#include <drawinglayer/geometry/viewinformation2d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + OverlayBitmapExPrimitive::OverlayBitmapExPrimitive( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rBasePosition, + sal_uInt16 nCenterX, + sal_uInt16 nCenterY) + : DiscreteMetricDependentPrimitive2D(), + maBitmapEx(rBitmapEx), + maBasePosition(rBasePosition), + mnCenterX(nCenterX), + mnCenterY(nCenterY) + {} + + Primitive2DSequence OverlayBitmapExPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + Primitive2DSequence aRetval; + const Size aBitmapSize(getBitmapEx().GetSizePixel()); + + if(aBitmapSize.Width() && aBitmapSize.Height() && basegfx::fTools::more(getDiscreteUnit(), 0.0)) + { + // calculate back from internal bitmap's extreme coordinates (the edges) + // to logical coordinates. Only use a unified scaling value (getDiscreteUnit(), + // the prepared one which expresses how many logic units form a discrete unit) + // for this step. This primitive is to be displayed always unscaled (in it's pixel size) + // and unrotated, more like a marker + const double fLeft(((0.0 - getCenterX()) * getDiscreteUnit()) + getBasePosition().getX()); + const double fTop(((0.0 - getCenterY()) * getDiscreteUnit()) + getBasePosition().getY()); + const double fRight((((aBitmapSize.getWidth() - 1.0) - getCenterX()) * getDiscreteUnit()) + getBasePosition().getX()); + const double fBottom((((aBitmapSize.getHeight() - 1.0) - getCenterY()) * getDiscreteUnit()) + getBasePosition().getY()); + + // create a BitmapPrimitive2D using those positions + basegfx::B2DHomMatrix aTransform; + + aTransform.set(0, 0, fRight - fLeft); + aTransform.set(1, 1, fBottom - fTop); + aTransform.set(0, 2, fLeft); + aTransform.set(1, 2, fTop); + + const Primitive2DReference aPrimitive(new BitmapPrimitive2D(getBitmapEx(), aTransform)); + aRetval = Primitive2DSequence(&aPrimitive, 1); + } + + return aRetval; + } + + bool OverlayBitmapExPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const + { + if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive)) + { + const OverlayBitmapExPrimitive& rCompare = static_cast< const OverlayBitmapExPrimitive& >(rPrimitive); + + return (getBitmapEx() == rCompare.getBitmapEx() + && getBasePosition() == rCompare.getBasePosition() + && getCenterX() == rCompare.getCenterX() + && getCenterY() == rCompare.getCenterY()); + } + + return false; + } + + ImplPrimitrive2DIDBlock(OverlayBitmapExPrimitive, PRIMITIVE2D_ID_OVERLAYBITMAPEXPRIMITIVE) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + OverlayCrosshairPrimitive::OverlayCrosshairPrimitive( + const basegfx::B2DPoint& rBasePosition, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength) + : ViewportDependentPrimitive2D(), + maBasePosition(rBasePosition), + maRGBColorA(rRGBColorA), + maRGBColorB(rRGBColorB), + mfDiscreteDashLength(fDiscreteDashLength) + {} + + Primitive2DSequence OverlayCrosshairPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + // use the prepared Viewport information accessible using getViewport() + Primitive2DSequence aRetval; + + if(!getViewport().isEmpty()) + { + aRetval.realloc(2); + basegfx::B2DPolygon aPolygon; + + aPolygon.append(basegfx::B2DPoint(getViewport().getMinX(), getBasePosition().getY())); + aPolygon.append(basegfx::B2DPoint(getViewport().getMaxX(), getBasePosition().getY())); + + aRetval[0] = Primitive2DReference( + new PolygonMarkerPrimitive2D( + aPolygon, + getRGBColorA(), + getRGBColorB(), + getDiscreteDashLength())); + + aPolygon.clear(); + aPolygon.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMinY())); + aPolygon.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMaxY())); + + aRetval[1] = Primitive2DReference( + new PolygonMarkerPrimitive2D( + aPolygon, + getRGBColorA(), + getRGBColorB(), + getDiscreteDashLength())); + } + + return aRetval; + } + + bool OverlayCrosshairPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const + { + if(ViewportDependentPrimitive2D::operator==(rPrimitive)) + { + const OverlayCrosshairPrimitive& rCompare = static_cast< const OverlayCrosshairPrimitive& >(rPrimitive); + + return (getBasePosition() == rCompare.getBasePosition() + && getRGBColorA() == rCompare.getRGBColorA() + && getRGBColorB() == rCompare.getRGBColorB() + && getDiscreteDashLength() == rCompare.getDiscreteDashLength()); + } + + return false; + } + + ImplPrimitrive2DIDBlock(OverlayCrosshairPrimitive, PRIMITIVE2D_ID_OVERLAYCROSSHAIRPRIMITIVE) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + OverlayHatchRectanglePrimitive::OverlayHatchRectanglePrimitive( + const basegfx::B2DRange& rObjectRange, + double fDiscreteHatchDistance, + double fHatchRotation, + const basegfx::BColor& rHatchColor, + double fDiscreteGrow, + double fDiscreteShrink, + double fRotation) + : DiscreteMetricDependentPrimitive2D(), + maObjectRange(rObjectRange), + mfDiscreteHatchDistance(fDiscreteHatchDistance), + mfHatchRotation(fHatchRotation), + maHatchColor(rHatchColor), + mfDiscreteGrow(fDiscreteGrow), + mfDiscreteShrink(fDiscreteShrink), + mfRotation(fRotation) + {} + + Primitive2DSequence OverlayHatchRectanglePrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + Primitive2DSequence aRetval; + + if(basegfx::fTools::more(getDiscreteUnit(), 0.0)) + { + basegfx::B2DRange aInnerRange(getObjectRange()); + basegfx::B2DRange aOuterRange(getObjectRange()); + basegfx::B2DPolyPolygon aHatchPolyPolygon; + + aOuterRange.grow(getDiscreteUnit() * getDiscreteGrow()); + aInnerRange.grow(getDiscreteUnit() * -getDiscreteShrink()); + + aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aOuterRange)); + + if(!aInnerRange.isEmpty()) + { + aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aInnerRange)); + } + + if(!basegfx::fTools::equalZero(getRotation())) + { + basegfx::B2DHomMatrix aTransform; + + aTransform.translate(-getObjectRange().getMinX(), -getObjectRange().getMinY()); + aTransform.rotate(getRotation()); + aTransform.translate(getObjectRange().getMinX(), getObjectRange().getMinY()); + + aHatchPolyPolygon.transform(aTransform); + } + + const basegfx::BColor aEmptyColor(0.0, 0.0, 0.0); + const drawinglayer::attribute::FillHatchAttribute aFillHatchAttribute( + drawinglayer::attribute::HATCHSTYLE_SINGLE, + getDiscreteHatchDistance() * getDiscreteUnit(), + getHatchRotation() - getRotation(), + getHatchColor(), + false); + const Primitive2DReference aPrimitive( + new PolyPolygonHatchPrimitive2D( + aHatchPolyPolygon, + aEmptyColor, + aFillHatchAttribute)); + + aRetval = Primitive2DSequence(&aPrimitive, 1); + } + + return aRetval; + } + + bool OverlayHatchRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const + { + if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive)) + { + const OverlayHatchRectanglePrimitive& rCompare = static_cast< const OverlayHatchRectanglePrimitive& >(rPrimitive); + + return (getObjectRange() == rCompare.getObjectRange() + && getDiscreteHatchDistance() == rCompare.getDiscreteHatchDistance() + && getHatchRotation() == rCompare.getHatchRotation() + && getHatchColor() == rCompare.getHatchColor() + && getDiscreteGrow() == rCompare.getDiscreteGrow() + && getDiscreteShrink() == rCompare.getDiscreteShrink() + && getRotation() == rCompare.getRotation()); + } + + return false; + } + + ImplPrimitrive2DIDBlock(OverlayHatchRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + OverlayHelplineStripedPrimitive::OverlayHelplineStripedPrimitive( + const basegfx::B2DPoint& rBasePosition, + HelplineStyle eStyle, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength) + : ViewportDependentPrimitive2D(), + maBasePosition(rBasePosition), + meStyle(eStyle), + maRGBColorA(rRGBColorA), + maRGBColorB(rRGBColorB), + mfDiscreteDashLength(fDiscreteDashLength) + {} + + Primitive2DSequence OverlayHelplineStripedPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + { + // use the prepared Viewport information accessible using getViewport() + Primitive2DSequence aRetval; + + if(!getViewport().isEmpty()) + { + switch(getStyle()) + { + case HELPLINESTYLE_VERTICAL : + { + aRetval.realloc(1); + basegfx::B2DPolygon aLine; + + aLine.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMinY())); + aLine.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMaxY())); + + aRetval[0] = Primitive2DReference( + new PolygonMarkerPrimitive2D( + aLine, + getRGBColorA(), + getRGBColorB(), + getDiscreteDashLength())); + break; + } + + case HELPLINESTYLE_HORIZONTAL : + { + aRetval.realloc(1); + basegfx::B2DPolygon aLine; + + aLine.append(basegfx::B2DPoint(getViewport().getMinX(), getBasePosition().getY())); + aLine.append(basegfx::B2DPoint(getViewport().getMaxX(), getBasePosition().getY())); + + aRetval[0] = Primitive2DReference( + new PolygonMarkerPrimitive2D( + aLine, + getRGBColorA(), + getRGBColorB(), + getDiscreteDashLength())); + break; + } + + default: // case HELPLINESTYLE_POINT : + { + const double fDiscreteUnit((rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength()); + aRetval.realloc(2); + basegfx::B2DPolygon aLineA, aLineB; + + aLineA.append(basegfx::B2DPoint(getBasePosition().getX(), getBasePosition().getY() - fDiscreteUnit)); + aLineA.append(basegfx::B2DPoint(getBasePosition().getX(), getBasePosition().getY() + fDiscreteUnit)); + + aRetval[0] = Primitive2DReference( + new PolygonMarkerPrimitive2D( + aLineA, + getRGBColorA(), + getRGBColorB(), + getDiscreteDashLength())); + + aLineB.append(basegfx::B2DPoint(getBasePosition().getX() - fDiscreteUnit, getBasePosition().getY())); + aLineB.append(basegfx::B2DPoint(getBasePosition().getX() + fDiscreteUnit, getBasePosition().getY())); + + aRetval[1] = Primitive2DReference( + new PolygonMarkerPrimitive2D( + aLineB, + getRGBColorA(), + getRGBColorB(), + getDiscreteDashLength())); + + break; + } + } + } + + return aRetval; + } + + bool OverlayHelplineStripedPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const + { + if(ViewportDependentPrimitive2D::operator==(rPrimitive)) + { + const OverlayHelplineStripedPrimitive& rCompare = static_cast< const OverlayHelplineStripedPrimitive& >(rPrimitive); + + return (getBasePosition() == rCompare.getBasePosition() + && getStyle() == rCompare.getStyle() + && getRGBColorA() == rCompare.getRGBColorA() + && getRGBColorB() == rCompare.getRGBColorB() + && getDiscreteDashLength() == rCompare.getDiscreteDashLength()); + } + + return false; + } + + ImplPrimitrive2DIDBlock(OverlayHelplineStripedPrimitive, PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + OverlayRollingRectanglePrimitive::OverlayRollingRectanglePrimitive( + const basegfx::B2DRange& aRollingRectangle, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength) + : ViewportDependentPrimitive2D(), + maRollingRectangle(aRollingRectangle), + maRGBColorA(rRGBColorA), + maRGBColorB(rRGBColorB), + mfDiscreteDashLength(fDiscreteDashLength) + {} + + Primitive2DSequence OverlayRollingRectanglePrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + // use the prepared Viewport information accessible using getViewport() + Primitive2DSequence aRetval; + + if(!getViewport().isEmpty()) + { + basegfx::B2DPolygon aLine; + aRetval.realloc(8); + + // Left lines + aLine.append(basegfx::B2DPoint(getViewport().getMinX(), getRollingRectangle().getMinY())); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMinY())); + aRetval[0] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength())); + + aLine.clear(); + aLine.append(basegfx::B2DPoint(getViewport().getMinX(), getRollingRectangle().getMaxY())); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMaxY())); + aRetval[1] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength())); + + // Right lines + aLine.clear(); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMinY())); + aLine.append(basegfx::B2DPoint(getViewport().getMaxX(), getRollingRectangle().getMinY())); + aRetval[2] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength())); + + aLine.clear(); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMaxY())); + aLine.append(basegfx::B2DPoint(getViewport().getMaxX(), getRollingRectangle().getMaxY())); + aRetval[3] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength())); + + // Top lines + aLine.clear(); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getViewport().getMinY())); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMinY())); + aRetval[4] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength())); + + aLine.clear(); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getViewport().getMinY())); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMinY())); + aRetval[5] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength())); + + // Bottom lines + aLine.clear(); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMaxY())); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getViewport().getMaxY())); + aRetval[6] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength())); + + aLine.clear(); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMaxY())); + aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getViewport().getMaxY())); + aRetval[7] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength())); + } + + return aRetval; + } + + bool OverlayRollingRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const + { + if(ViewportDependentPrimitive2D::operator==(rPrimitive)) + { + const OverlayRollingRectanglePrimitive& rCompare = static_cast< const OverlayRollingRectanglePrimitive& >(rPrimitive); + + return (getRollingRectangle() == rCompare.getRollingRectangle() + && getRGBColorA() == rCompare.getRGBColorA() + && getRGBColorB() == rCompare.getRGBColorB() + && getDiscreteDashLength() == rCompare.getDiscreteDashLength()); + } + + return false; + } + + ImplPrimitrive2DIDBlock(OverlayRollingRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/sdr/overlay/overlaytriangle.cxx b/svx/source/sdr/overlay/overlaytriangle.cxx index 715a27bfe0..f22c737166 100644 --- a/svx/source/sdr/overlay/overlaytriangle.cxx +++ b/svx/source/sdr/overlay/overlaytriangle.cxx @@ -37,6 +37,9 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> +#include <svx/sdr/overlay/overlaymanager.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> +#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -44,7 +47,7 @@ namespace sdr { namespace overlay { - void OverlayTriangleStriped::drawGeometry(OutputDevice& rOutputDevice) + drawinglayer::primitive2d::Primitive2DSequence OverlayTriangle::createOverlayObjectPrimitive2DSequence() { basegfx::B2DPolygon aPolygon; @@ -52,34 +55,31 @@ namespace sdr aPolygon.append(getSecondPosition()); aPolygon.append(getThirdPosition()); aPolygon.setClosed(true); + + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aPolygon), + getBaseColor().getBColor())); - ImpDrawPolygonStriped(rOutputDevice, aPolygon); + return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); } - void OverlayTriangleStriped::createBaseRange(OutputDevice& /*rOutputDevice*/) - { - // reset range and expand it - maBaseRange.reset(); - maBaseRange.expand(getBasePosition()); - maBaseRange.expand(getSecondPosition()); - maBaseRange.expand(getThirdPosition()); - } - - OverlayTriangleStriped::OverlayTriangleStriped( + OverlayTriangle::OverlayTriangle( const basegfx::B2DPoint& rBasePos, const basegfx::B2DPoint& rSecondPos, - const basegfx::B2DPoint& rThirdPos) - : OverlayObjectWithBasePosition(rBasePos, Color(COL_BLACK)), + const basegfx::B2DPoint& rThirdPos, + Color aTriangleColor) + : OverlayObjectWithBasePosition(rBasePos, aTriangleColor), maSecondPosition(rSecondPos), maThirdPosition(rThirdPos) { } - OverlayTriangleStriped::~OverlayTriangleStriped() + OverlayTriangle::~OverlayTriangle() { } - void OverlayTriangleStriped::setSecondPosition(const basegfx::B2DPoint& rNew) + void OverlayTriangle::setSecondPosition(const basegfx::B2DPoint& rNew) { if(rNew != maSecondPosition) { @@ -91,7 +91,7 @@ namespace sdr } } - void OverlayTriangleStriped::setThirdPosition(const basegfx::B2DPoint& rNew) + void OverlayTriangle::setThirdPosition(const basegfx::B2DPoint& rNew) { if(rNew != maThirdPosition) { @@ -102,96 +102,6 @@ namespace sdr objectChange(); } } - - sal_Bool OverlayTriangleStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const - { - if(isHittable()) - { - // test with all lines and epsilon-range - if(basegfx::tools::isInEpsilonRange(getBasePosition(), getThirdPosition(), rPos, fTol)) - { - return sal_True; - } - else if(basegfx::tools::isInEpsilonRange(getSecondPosition(), getBasePosition(), rPos, fTol)) - { - return sal_True; - } - else if(basegfx::tools::isInEpsilonRange(getThirdPosition(), getSecondPosition(), rPos, fTol)) - { - return sal_True; - } - - // test if inside triangle - basegfx::B2DPolygon aTestPoly; - aTestPoly.append(getBasePosition()); - aTestPoly.append(getSecondPosition()); - aTestPoly.append(getThirdPosition()); - aTestPoly.setClosed(true); - - return basegfx::tools::isInside(aTestPoly, rPos); - } - - return sal_False; - } - - void OverlayTriangleStriped::transform(const basegfx::B2DHomMatrix& rMatrix) - { - if(!rMatrix.isIdentity()) - { - // transform base position - OverlayObjectWithBasePosition::transform(rMatrix); - - // transform maSecondPosition - const basegfx::B2DPoint aNewSecondPosition = rMatrix * getSecondPosition(); - setSecondPosition(aNewSecondPosition); - - // transform maThirdPosition - const basegfx::B2DPoint aNewThirdPosition = rMatrix * getThirdPosition(); - setThirdPosition(aNewThirdPosition); - } - } - } // end of namespace overlay -} // end of namespace sdr - -////////////////////////////////////////////////////////////////////////////// - -namespace sdr -{ - namespace overlay - { - void OverlayTriangle::drawGeometry(OutputDevice& rOutputDevice) - { - Polygon aPolygon(4); - Point aPosition(FRound(getBasePosition().getX()), FRound(getBasePosition().getY())); - aPolygon[0] = aPolygon[3] = aPosition; - aPosition.X() = FRound(getSecondPosition().getX()); - aPosition.Y() = FRound(getSecondPosition().getY()); - aPolygon[1] = aPosition; - aPosition.X() = FRound(getThirdPosition().getX()); - aPosition.Y() = FRound(getThirdPosition().getY()); - aPolygon[2] = aPosition; - - rOutputDevice.SetLineColor(); - rOutputDevice.SetFillColor(getBaseColor()); - - rOutputDevice.DrawPolygon(aPolygon); - } - - OverlayTriangle::OverlayTriangle( - const basegfx::B2DPoint& rBasePos, - const basegfx::B2DPoint& rSecondPos, - const basegfx::B2DPoint& rThirdPos, - Color aTriangleColor) - : OverlayTriangleStriped(rBasePos, rSecondPos, rThirdPos) - { - // set base color here, OverlayCrosshairStriped constructor has set - // it to it's own default. - maBaseColor = aTriangleColor; - } - - OverlayTriangle::~OverlayTriangle() - { - } } // end of namespace overlay } // end of namespace sdr diff --git a/svx/source/sdr/primitive2d/makefile.mk b/svx/source/sdr/primitive2d/makefile.mk index e9e976d434..7510b6a23b 100644 --- a/svx/source/sdr/primitive2d/makefile.mk +++ b/svx/source/sdr/primitive2d/makefile.mk @@ -51,6 +51,7 @@ SLOFILES=\ $(SLO)$/sdrcaptionprimitive2d.obj \ $(SLO)$/sdrgrafprimitive2d.obj \ $(SLO)$/sdrole2primitive2d.obj \ + $(SLO)$/sdrolecontentprimitive2d.obj \ $(SLO)$/sdrpathprimitive2d.obj \ $(SLO)$/sdrprimitivetools.obj \ $(SLO)$/sdrmeasureprimitive2d.obj \ diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index c617fde61b..6669912886 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -473,7 +473,14 @@ namespace drawinglayer return pRetval; } - attribute::SdrTextAttribute* createNewSdrTextAttribute(const SfxItemSet& rSet, const SdrText& rText) + // #i101508# Support handing over given text-to-border distances + attribute::SdrTextAttribute* createNewSdrTextAttribute( + const SfxItemSet& rSet, + const SdrText& rText, + const sal_Int32* pLeft, + const sal_Int32* pUpper, + const sal_Int32* pRight, + const sal_Int32* pLower) { attribute::SdrTextAttribute* pRetval(0); const SdrTextObj& rTextObj = rText.GetObject(); @@ -519,10 +526,10 @@ namespace drawinglayer rText, aOutlinerParaObject, ((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue(), - rTextObj.GetTextLeftDistance(), - rTextObj.GetTextUpperDistance(), - rTextObj.GetTextRightDistance(), - rTextObj.GetTextLowerDistance(), + pLeft ? *pLeft : rTextObj.GetTextLeftDistance(), + pUpper ? *pUpper : rTextObj.GetTextUpperDistance(), + pRight ? *pRight : rTextObj.GetTextRightDistance(), + pLower ? *pLower : rTextObj.GetTextLowerDistance(), ((const SdrTextContourFrameItem&)rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(), (SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit), ((const XFormTextHideFormItem&)rSet.Get(XATTR_FORMTXTHIDEFORM)).GetValue(), @@ -591,10 +598,18 @@ namespace drawinglayer if(aBitmap.GetPrefMapMode() != aDestinationMapUnit) { - // #i96237# need to use LogicToLogic, source is not always pixels - aBitmap.SetPrefSize(Application::GetDefaultDevice()->LogicToLogic( - aBitmap.GetPrefSize(), aBitmap.GetPrefMapMode(), aDestinationMapUnit)); - aBitmap.SetPrefMapMode(aDestinationMapUnit); + // #i100360# for MAP_PIXEL, LogicToLogic will not work properly, + // so fallback to Application::GetDefaultDevice() + if(MAP_PIXEL == aBitmap.GetPrefMapMode().GetMapUnit()) + { + aBitmap.SetPrefSize(Application::GetDefaultDevice()->PixelToLogic( + aBitmap.GetPrefSize(), aDestinationMapUnit)); + } + else + { + aBitmap.SetPrefSize(OutputDevice::LogicToLogic( + aBitmap.GetPrefSize(), aBitmap.GetPrefMapMode(), aDestinationMapUnit)); + } } // get size @@ -665,7 +680,7 @@ namespace drawinglayer // when object has text and text is fontwork and hide contour is set for fontwork, force // line and fill style to empty - if(pText && pText->isFontwork() && pText->isHideContour()) + if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour()) { bFontworkHideContour = true; } @@ -730,7 +745,7 @@ namespace drawinglayer // when object has text and text is fontwork and hide contour is set for fontwork, force // line and fill style to empty - if(pText && pText->isFontwork() && pText->isHideContour()) + if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour()) { bFontworkHideContour = true; } @@ -1023,7 +1038,14 @@ namespace drawinglayer } } - attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(const SfxItemSet& rSet, const SdrText* pSdrText) + // #i101508# Support handing over given text-to-border distances + attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute( + const SfxItemSet& rSet, + const SdrText* pSdrText, + const sal_Int32* pLeft, + const sal_Int32* pUpper, + const sal_Int32* pRight, + const sal_Int32* pLower) { attribute::SdrFillTextAttribute* pRetval(0L); attribute::SdrFillAttribute* pFill(0L); @@ -1034,12 +1056,12 @@ namespace drawinglayer // look for text first if(pSdrText) { - pText = createNewSdrTextAttribute(rSet, *pSdrText); + pText = createNewSdrTextAttribute(rSet, *pSdrText, pLeft, pUpper, pRight, pLower); } // when object has text and text is fontwork and hide contour is set for fontwork, force // fill style to empty - if(pText && pText->isFontwork() && pText->isHideContour()) + if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour()) { bFontworkHideContour = true; } diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx index 855fafe223..bde6bb4cd6 100644 --- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx @@ -50,62 +50,95 @@ namespace drawinglayer Primitive2DSequence SdrCaptionPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; + Primitive2DSequence aHitTestContent; // create unit outline polygon - ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromRect(::basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), getCornerRadiusX(), getCornerRadiusY())); + const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect( + basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), + getCornerRadiusX(), + getCornerRadiusY())); // add fill if(getSdrLFSTAttribute().getFill()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + *getSdrLFSTAttribute().getFill(), + getSdrLFSTAttribute().getFillFloatTransGradient())); + } + else + { + // if no fill, create one for HitTest and BoundRect fallback + appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent, + createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)), + getSdrLFSTAttribute().getFillFloatTransGradient())); } // add line if(getSdrLFSTAttribute().getLine()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine())); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(getTail(), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolygonLinePrimitive( + aUnitOutline, + getTransform(), + *getSdrLFSTAttribute().getLine())); + + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolygonLinePrimitive( + getTail(), + getTransform(), + *getSdrLFSTAttribute().getLine(), + getSdrLFSTAttribute().getLineStartEnd())); } else { - // if initially no line is defined, create one for HitTest and BoundRect - Primitive2DSequence aLineSequence(2); - const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0)); + // if initially no line is defined, create one for HitTest and BoundRect. It + // is sufficient to use the tail; the body is already ensured with fill creation + appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent, + createPolygonLinePrimitive( + getTail(), + getTransform(), + attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0)))); + } - aLineSequence[0] = createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline); - aLineSequence[1] = createPolygonLinePrimitive(getTail(), getTransform(), aBlackHairline); - - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(aLineSequence))); + // add HitTest and BoundRect helper geometry (if exists) + if(aHitTestContent.hasElements()) + { + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + Primitive2DReference(new HitTestPrimitive2D(aHitTestContent))); } // add text if(getSdrLFSTAttribute().getText()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + *getSdrLFSTAttribute().getText(), + getSdrLFSTAttribute().getLine(), + false, + false)); } // add shadow if(getSdrLFSTAttribute().getShadow()) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow())); - - if(xShadow.is()) - { - Primitive2DSequence aContentWithShadow(2L); - aContentWithShadow[0L] = xShadow; - aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval)); - aRetval = aContentWithShadow; - } + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); } return aRetval; } SdrCaptionPrimitive2D::SdrCaptionPrimitive2D( - const ::basegfx::B2DHomMatrix& rTransform, + const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, - const ::basegfx::B2DPolygon& rTail, + const basegfx::B2DPolygon& rTail, double fCornerRadiusX, double fCornerRadiusY) : BasePrimitive2D(), @@ -118,7 +151,7 @@ namespace drawinglayer // transform maTail to unit polygon if(getTail().count()) { - ::basegfx::B2DHomMatrix aInverse(getTransform()); + basegfx::B2DHomMatrix aInverse(getTransform()); aInverse.invert(); maTail.transform(aInverse); } diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx index 13da3dcca7..58745f87ad 100644 --- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx @@ -78,15 +78,7 @@ namespace drawinglayer // add shadow if(getSdrLSTAttribute().getShadow()) { - const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow())); - - if(xShadow.is()) - { - Primitive2DSequence aContentWithShadow(2L); - aContentWithShadow[0L] = xShadow; - aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval)); - aRetval = aContentWithShadow; - } + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx index 7a03bd2f2d..926967314a 100644 --- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx @@ -60,18 +60,9 @@ namespace drawinglayer } // add shadow - if(getSdrSTAttribute().getShadow()) + if(aRetval.hasElements() && getSdrSTAttribute().getShadow()) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow())); - - if(xShadow.is()) - { - Primitive2DSequence aContentWithShadow(2L); - aContentWithShadow[0L] = xShadow; - aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval)); - aRetval = aContentWithShadow; - } + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 39157f5b7f..11ace8b8f5 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -67,13 +67,13 @@ namespace drawinglayer namespace primitive2d { Primitive2DReference createPolyPolygonFillPrimitive( - const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon, - const ::basegfx::B2DHomMatrix& rObjectTransform, + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DHomMatrix& rObjectTransform, const attribute::SdrFillAttribute& rFill, const attribute::FillGradientAttribute* pFillGradient) { // prepare fully scaled polygon - ::basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon); + basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon); aScaledPolyPolygon.transform(rObjectTransform); BasePrimitive2D* pNewFillPrimitive = 0L; @@ -87,7 +87,7 @@ namespace drawinglayer } else if(rFill.isBitmap()) { - const ::basegfx::B2DRange aRange(::basegfx::tools::getRange(aScaledPolyPolygon)); + const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon)); pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getBitmap()->getFillBitmapAttribute(aRange)); } else @@ -110,7 +110,7 @@ namespace drawinglayer // create FillGradientPrimitive2D for transparence and add to new sequence // fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways - const ::basegfx::B2DRange aRange(::basegfx::tools::getRange(aScaledPolyPolygon)); + const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon)); const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, *pFillGradient)); const Primitive2DSequence aAlpha(&xRefB, 1L); @@ -125,13 +125,13 @@ namespace drawinglayer } Primitive2DReference createPolygonLinePrimitive( - const ::basegfx::B2DPolygon& rUnitPolygon, - const ::basegfx::B2DHomMatrix& rObjectTransform, + const basegfx::B2DPolygon& rUnitPolygon, + const basegfx::B2DHomMatrix& rObjectTransform, const attribute::SdrLineAttribute& rLine, const attribute::SdrLineStartEndAttribute* pStroke) { // prepare fully scaled polygon - ::basegfx::B2DPolygon aScaledPolygon(rUnitPolygon); + basegfx::B2DPolygon aScaledPolygon(rUnitPolygon); aScaledPolygon.transform(rObjectTransform); // create line and stroke attribute @@ -168,15 +168,15 @@ namespace drawinglayer } Primitive2DReference createTextPrimitive( - const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon, - const ::basegfx::B2DHomMatrix& rObjectTransform, + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DHomMatrix& rObjectTransform, const attribute::SdrTextAttribute& rText, const attribute::SdrLineAttribute* pStroke, bool bCellText, bool bWordWrap) { - ::basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform); - SdrTextPrimitive2D* pNew = 0L; + basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform); + SdrTextPrimitive2D* pNew = 0; if(rText.isContour()) { @@ -185,20 +185,20 @@ namespace drawinglayer { // take line width into account and shrink contour polygon accordingly // decompose to get scale - ::basegfx::B2DVector aScale, aTranslate; + basegfx::B2DVector aScale, aTranslate; double fRotate, fShearX; rObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX); // scale outline to object's size to allow growing with value relative to that size // and also to keep aspect ratio - ::basegfx::B2DHomMatrix aScaleTransform; + basegfx::B2DHomMatrix aScaleTransform; aScaleTransform.set(0, 0, fabs(aScale.getX())); aScaleTransform.set(1, 1, fabs(aScale.getY())); - ::basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon); + basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon); aScaledUnitPolyPolygon.transform(aScaleTransform); // grow the polygon. To shrink, use negative value (half width) - aScaledUnitPolyPolygon = ::basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5)); + aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5)); // scale back to unit polygon aScaleTransform.set(0, 0, 0.0 != aScale.getX() ? 1.0 / aScale.getX() : 1.0); @@ -206,48 +206,60 @@ namespace drawinglayer aScaledUnitPolyPolygon.transform(aScaleTransform); // create with unit polygon - pNew = new SdrContourTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), aScaledUnitPolyPolygon, rObjectTransform); + pNew = new SdrContourTextPrimitive2D( + &rText.getSdrText(), + rText.getOutlinerParaObject(), + aScaledUnitPolyPolygon, + rObjectTransform); } else { // create with unit polygon - pNew = new SdrContourTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), rUnitPolyPolygon, rObjectTransform); + pNew = new SdrContourTextPrimitive2D( + &rText.getSdrText(), + rText.getOutlinerParaObject(), + rUnitPolyPolygon, + rObjectTransform); } } - else if(rText.isFontwork() && !rText.isScroll()) + else if(rText.getSdrFormTextAttribute()) { - // text on path, use scaled polygon. Not allowed when text scrolling is used. - ::basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon); + // text on path, use scaled polygon + basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon); aScaledPolyPolygon.transform(rObjectTransform); - pNew = new SdrPathTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), aScaledPolyPolygon); + pNew = new SdrPathTextPrimitive2D( + &rText.getSdrText(), + rText.getOutlinerParaObject(), + aScaledPolyPolygon, + *rText.getSdrFormTextAttribute()); } else { // rObjectTransform is the whole SdrObject transformation from unit rectangle // to it's size and position. Decompose to allow working with single values. - ::basegfx::B2DVector aScale, aTranslate; + basegfx::B2DVector aScale, aTranslate; double fRotate, fShearX; rObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX); // extract mirroring - const bool bMirrorX(::basegfx::fTools::less(aScale.getX(), 0.0)); - const bool bMirrorY(::basegfx::fTools::less(aScale.getY(), 0.0)); + const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0)); + const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0)); aScale = basegfx::absolute(aScale); // Get the real size, since polygon ountline and scale // from the object transformation may vary (e.g. ellipse segments) - ::basegfx::B2DHomMatrix aJustScaleTransform; + basegfx::B2DHomMatrix aJustScaleTransform; aJustScaleTransform.set(0, 0, aScale.getX()); aJustScaleTransform.set(1, 1, aScale.getY()); - ::basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon); + basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon); aScaledUnitPolyPolygon.transform(aJustScaleTransform); - const ::basegfx::B2DRange aSnapRange(::basegfx::tools::getRange(aScaledUnitPolyPolygon)); + const basegfx::B2DRange aSnapRange(basegfx::tools::getRange(aScaledUnitPolyPolygon)); // create a range describing the wanted text position and size (aTextAnchorRange). This // means to use the text distance values here - const ::basegfx::B2DPoint aTopLeft(aSnapRange.getMinX() + rText.getTextLeftDistance(), aSnapRange.getMinY() + rText.getTextUpperDistance()); - const ::basegfx::B2DPoint aBottomRight(aSnapRange.getMaxX() - rText.getTextRightDistance(), aSnapRange.getMaxY() - rText.getTextLowerDistance()); - ::basegfx::B2DRange aTextAnchorRange; + const basegfx::B2DPoint aTopLeft(aSnapRange.getMinX() + rText.getTextLeftDistance(), aSnapRange.getMinY() + rText.getTextUpperDistance()); + const basegfx::B2DPoint aBottomRight(aSnapRange.getMaxX() - rText.getTextRightDistance(), aSnapRange.getMaxY() - rText.getTextLowerDistance()); + basegfx::B2DRange aTextAnchorRange; aTextAnchorRange.expand(aTopLeft); aTextAnchorRange.expand(aBottomRight); @@ -267,12 +279,21 @@ namespace drawinglayer if(rText.isFitToSize()) { // streched text in range - pNew = new SdrStretchTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform); + pNew = new SdrStretchTextPrimitive2D( + &rText.getSdrText(), + rText.getOutlinerParaObject(), + aAnchorTransform); } else // text in range { // build new primitive - pNew = new SdrBlockTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform, rText.isScroll(), bCellText, bWordWrap); + pNew = new SdrBlockTextPrimitive2D( + &rText.getSdrText(), + rText.getOutlinerParaObject(), + aAnchorTransform, + rText.isScroll(), + bCellText, + bWordWrap); } } @@ -299,154 +320,164 @@ namespace drawinglayer return Primitive2DReference(pNew); } } - else if(rText.isScroll()) + + if(rText.isScroll()) { - // get scroll direction - const SdrTextAniDirection eDirection(rText.getSdrText().GetObject().GetTextAniDirection()); - const bool bHorizontal(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection); - - // decompose to get separated values for the scroll box - ::basegfx::B2DVector aScale, aTranslate; - double fRotate, fShearX; - aAnchorTransform.decompose(aScale, aTranslate, fRotate, fShearX); - - // build transform from scaled only to full AnchorTransform and inverse - ::basegfx::B2DHomMatrix aSRT; - aSRT.shearX(fShearX); - aSRT.rotate(fRotate); - aSRT.translate(aTranslate.getX(), aTranslate.getY()); - ::basegfx::B2DHomMatrix aISRT(aSRT); - aISRT.invert(); - - // bring the primitive back to scaled only and get scaled range, create new clone for this - SdrTextPrimitive2D* pNew2 = pNew->createTransformedClone(aISRT); - OSL_ENSURE(pNew2, "createTextPrimitive: Could not create transformed clone of text primitive (!)"); - delete pNew; - pNew = pNew2; - - // create neutral geometry::ViewInformation2D for local range and decompose calls. This is okay - // since the decompose is view-independent - const uno::Sequence< beans::PropertyValue > xViewParameters; - geometry::ViewInformation2D aViewInformation2D(xViewParameters); - - // get range - const ::basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D)); - - // create left outside and right outside transformations. Also take care - // of the clip rectangle - ::basegfx::B2DHomMatrix aLeft, aRight; - ::basegfx::B2DPoint aClipTopLeft(0.0, 0.0); - ::basegfx::B2DPoint aClipBottomRight(aScale.getX(), aScale.getY()); - - if(bHorizontal) - { - aClipTopLeft.setY(aScaledRange.getMinY()); - aClipBottomRight.setY(aScaledRange.getMaxY()); - aLeft.translate(-aScaledRange.getMaxX(), 0.0); - aRight.translate(aScale.getX() - aScaledRange.getMinX(), 0.0); - } - else + // suppress scroll when FontWork + if(!rText.getSdrFormTextAttribute()) { - aClipTopLeft.setX(aScaledRange.getMinX()); - aClipBottomRight.setX(aScaledRange.getMaxX()); - aLeft.translate(0.0, -aScaledRange.getMaxY()); - aRight.translate(0.0, aScale.getY() - aScaledRange.getMinY()); - } + // get scroll direction + const SdrTextAniDirection eDirection(rText.getSdrText().GetObject().GetTextAniDirection()); + const bool bHorizontal(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection); - aLeft *= aSRT; - aRight *= aSRT; - - // prepare animation list - drawinglayer::animation::AnimationEntryList aAnimationList; - - if(bHorizontal) - { - rText.getScrollTextTiming(aAnimationList, aScale.getX(), aScaledRange.getWidth()); - } - else - { - rText.getScrollTextTiming(aAnimationList, aScale.getY(), aScaledRange.getHeight()); - } - - if(0.0 != aAnimationList.getDuration()) - { - // create a new Primitive2DSequence containing the animated text in it's scaled only state. - // use the decomposition to force to simple text primitives, those will no longer - // need the outliner for formatting (alternatively it is also possible to just add - // pNew to aNewPrimitiveSequence) - Primitive2DSequence aAnimSequence(pNew->get2DDecomposition(aViewInformation2D)); + // decompose to get separated values for the scroll box + basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + aAnchorTransform.decompose(aScale, aTranslate, fRotate, fShearX); + + // build transform from scaled only to full AnchorTransform and inverse + basegfx::B2DHomMatrix aSRT; + aSRT.shearX(fShearX); + aSRT.rotate(fRotate); + aSRT.translate(aTranslate.getX(), aTranslate.getY()); + basegfx::B2DHomMatrix aISRT(aSRT); + aISRT.invert(); + + // bring the primitive back to scaled only and get scaled range, create new clone for this + SdrTextPrimitive2D* pNew2 = pNew->createTransformedClone(aISRT); + OSL_ENSURE(pNew2, "createTextPrimitive: Could not create transformed clone of text primitive (!)"); delete pNew; - - // create a new animatedInterpolatePrimitive and add it - std::vector< basegfx::B2DHomMatrix > aMatrixStack; - aMatrixStack.push_back(aLeft); - aMatrixStack.push_back(aRight); - const Primitive2DReference xRefA(new AnimatedInterpolatePrimitive2D(aMatrixStack, aAnimationList, aAnimSequence, true)); - const Primitive2DSequence aContent(&xRefA, 1L); - - // scrolling needs an encapsulating clipping primitive - const ::basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight); - ::basegfx::B2DPolygon aClipPolygon(::basegfx::tools::createPolygonFromRect(aClipRange)); - aClipPolygon.transform(aSRT); - return Primitive2DReference(new MaskPrimitive2D(::basegfx::B2DPolyPolygon(aClipPolygon), aContent)); - } - else - { - // add to decomposition - return Primitive2DReference(pNew); + pNew = pNew2; + + // create neutral geometry::ViewInformation2D for local range and decompose calls. This is okay + // since the decompose is view-independent + const uno::Sequence< beans::PropertyValue > xViewParameters; + geometry::ViewInformation2D aViewInformation2D(xViewParameters); + + // get range + const basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D)); + + // create left outside and right outside transformations. Also take care + // of the clip rectangle + basegfx::B2DHomMatrix aLeft, aRight; + basegfx::B2DPoint aClipTopLeft(0.0, 0.0); + basegfx::B2DPoint aClipBottomRight(aScale.getX(), aScale.getY()); + + if(bHorizontal) + { + aClipTopLeft.setY(aScaledRange.getMinY()); + aClipBottomRight.setY(aScaledRange.getMaxY()); + aLeft.translate(-aScaledRange.getMaxX(), 0.0); + aRight.translate(aScale.getX() - aScaledRange.getMinX(), 0.0); + } + else + { + aClipTopLeft.setX(aScaledRange.getMinX()); + aClipBottomRight.setX(aScaledRange.getMaxX()); + aLeft.translate(0.0, -aScaledRange.getMaxY()); + aRight.translate(0.0, aScale.getY() - aScaledRange.getMinY()); + } + + aLeft *= aSRT; + aRight *= aSRT; + + // prepare animation list + drawinglayer::animation::AnimationEntryList aAnimationList; + + if(bHorizontal) + { + rText.getScrollTextTiming(aAnimationList, aScale.getX(), aScaledRange.getWidth()); + } + else + { + rText.getScrollTextTiming(aAnimationList, aScale.getY(), aScaledRange.getHeight()); + } + + if(0.0 != aAnimationList.getDuration()) + { + // create a new Primitive2DSequence containing the animated text in it's scaled only state. + // use the decomposition to force to simple text primitives, those will no longer + // need the outliner for formatting (alternatively it is also possible to just add + // pNew to aNewPrimitiveSequence) + Primitive2DSequence aAnimSequence(pNew->get2DDecomposition(aViewInformation2D)); + delete pNew; + + // create a new animatedInterpolatePrimitive and add it + std::vector< basegfx::B2DHomMatrix > aMatrixStack; + aMatrixStack.push_back(aLeft); + aMatrixStack.push_back(aRight); + const Primitive2DReference xRefA(new AnimatedInterpolatePrimitive2D(aMatrixStack, aAnimationList, aAnimSequence, true)); + const Primitive2DSequence aContent(&xRefA, 1L); + + // scrolling needs an encapsulating clipping primitive + const basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight); + basegfx::B2DPolygon aClipPolygon(basegfx::tools::createPolygonFromRect(aClipRange)); + aClipPolygon.transform(aSRT); + return Primitive2DReference(new MaskPrimitive2D(basegfx::B2DPolyPolygon(aClipPolygon), aContent)); + } + else + { + // add to decomposition + return Primitive2DReference(pNew); + } } } + + if(rText.isInEditMode()) + { + // #i97628# + // encapsulate with TextHierarchyEditPrimitive2D to allow renderers + // to suppress actively edited content if needed + const Primitive2DReference xRefA(pNew); + const Primitive2DSequence aContent(&xRefA, 1L); + + // create and add TextHierarchyEditPrimitive2D primitive + return Primitive2DReference(new TextHierarchyEditPrimitive2D(aContent)); + } else { - if(rText.isInEditMode()) - { - // #i97628# - // encapsulate with TextHierarchyEditPrimitive2D to allow renderers - // to suppress actively edited content if needed - const Primitive2DReference xRefA(pNew); - const Primitive2DSequence aContent(&xRefA, 1L); - - // create and add TextHierarchyEditPrimitive2D primitive - return Primitive2DReference(new TextHierarchyEditPrimitive2D(aContent)); - } - else - { - // add to decomposition - return Primitive2DReference(pNew); - } + // add to decomposition + return Primitive2DReference(pNew); } } - Primitive2DReference createShadowPrimitive( - const Primitive2DSequence& rSource, + Primitive2DSequence createEmbeddedShadowPrimitive( + const Primitive2DSequence& rContent, const attribute::SdrShadowAttribute& rShadow) { - // create Shadow primitives. Need to be added in front, should use already created primitives - if(rSource.hasElements()) + if(rContent.hasElements()) { + Primitive2DSequence aRetval(2); + basegfx::B2DHomMatrix aShadowOffset; + // prepare shadow offset - ::basegfx::B2DHomMatrix aShadowOffset; aShadowOffset.set(0, 2, rShadow.getOffset().getX()); aShadowOffset.set(1, 2, rShadow.getOffset().getY()); // create shadow primitive and add content - const Primitive2DReference xRefShadow(new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), rSource)); + aRetval[0] = Primitive2DReference( + new ShadowPrimitive2D( + aShadowOffset, + rShadow.getColor(), + rContent)); if(0.0 != rShadow.getTransparence()) { // create SimpleTransparencePrimitive2D - const Primitive2DSequence aContent(&xRefShadow, 1L); - return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rShadow.getTransparence())); - } - else - { - // return directly - return xRefShadow; + const Primitive2DSequence aTempContent(&aRetval[0], 1); + + aRetval[0] = Primitive2DReference( + new UnifiedAlphaPrimitive2D( + aTempContent, + rShadow.getTransparence())); } + + aRetval[1] = Primitive2DReference(new GroupPrimitive2D(rContent)); + return aRetval; } else { - return Primitive2DReference(); + return rContent; } } } // end of namespace primitive2d diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx index d43b2ce3c1..c30b036bf5 100644 --- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx @@ -100,16 +100,7 @@ namespace drawinglayer // add shadow if(getSdrLFSTAttribute().getShadow()) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow())); - - if(xShadow.is()) - { - Primitive2DSequence aContentWithShadow(2L); - aContentWithShadow[0L] = xShadow; - aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval)); - aRetval = aContentWithShadow; - } + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); } return aRetval; @@ -206,16 +197,7 @@ namespace drawinglayer // add shadow if(getSdrLFSTAttribute().getShadow()) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow())); - - if(xShadow.is()) - { - Primitive2DSequence aContentWithShadow(2L); - aContentWithShadow[0L] = xShadow; - aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval)); - aRetval = aContentWithShadow; - } + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx index 9250feaf41..e4183f3e69 100644 --- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx @@ -110,16 +110,7 @@ namespace drawinglayer // add shadow if(getSdrLFSTAttribute().getShadow()) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow())); - - if(xShadow.is()) - { - Primitive2DSequence aContentWithShadow(2L); - aContentWithShadow[0L] = xShadow; - aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval)); - aRetval = aContentWithShadow; - } + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index 2eba93c5c0..8f9d863a41 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -52,71 +52,71 @@ namespace drawinglayer namespace primitive2d { Primitive2DReference SdrMeasurePrimitive2D::impCreatePart( - const ::basegfx::B2DHomMatrix& rObjectMatrix, - const ::basegfx::B2DPoint& rStart, - const ::basegfx::B2DPoint& rEnd, + const basegfx::B2DHomMatrix& rObjectMatrix, + const basegfx::B2DPoint& rStart, + const basegfx::B2DPoint& rEnd, bool bLeftActive, bool bRightActive) const { - ::basegfx::B2DPolygon aPolygon; + basegfx::B2DPolygon aPolygon; aPolygon.append(rStart); aPolygon.append(rEnd); - if(!maSdrLSTAttribute.getLineStartEnd() || (!bLeftActive && !bRightActive)) + if(!getSdrLSTAttribute().getLineStartEnd() || (!bLeftActive && !bRightActive)) { - return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), 0L); + return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), 0L); } if(bLeftActive && bRightActive) { - return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), maSdrLSTAttribute.getLineStartEnd()); + return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), getSdrLSTAttribute().getLineStartEnd()); } - const attribute::SdrLineStartEndAttribute* pLineStartEnd = maSdrLSTAttribute.getLineStartEnd(); - const ::basegfx::B2DPolyPolygon aEmpty; + const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd(); + const basegfx::B2DPolyPolygon aEmpty; const attribute::SdrLineStartEndAttribute aLineStartEnd( bLeftActive ? pLineStartEnd->getStartPolyPolygon() : aEmpty, bRightActive ? pLineStartEnd->getEndPolyPolygon() : aEmpty, bLeftActive ? pLineStartEnd->getStartWidth() : 0.0, bRightActive ? pLineStartEnd->getEndWidth() : 0.0, bLeftActive ? pLineStartEnd->isStartActive() : false, bRightActive ? pLineStartEnd->isEndActive() : false, bLeftActive ? pLineStartEnd->isStartCentered() : false, bRightActive? pLineStartEnd->isEndCentered() : false); - return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), &aLineStartEnd); + return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), &aLineStartEnd); } Primitive2DSequence SdrMeasurePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; SdrBlockTextPrimitive2D* pBlockText = 0L; - ::basegfx::B2DRange aTextRange; - double fTextX((maStart.getX() + maEnd.getX()) * 0.5); - double fTextY((maStart.getX() + maEnd.getX()) * 0.5); - const ::basegfx::B2DVector aLine(maEnd - maStart); + basegfx::B2DRange aTextRange; + double fTextX((getStart().getX() + getEnd().getX()) * 0.5); + double fTextY((getStart().getX() + getEnd().getX()) * 0.5); + const basegfx::B2DVector aLine(getEnd() - getStart()); const double fDistance(aLine.getLength()); const double fAngle(atan2(aLine.getY(), aLine.getX())); bool bAutoUpsideDown(false); - const attribute::SdrTextAttribute* pTextAttribute = maSdrLSTAttribute.getText(); + const attribute::SdrTextAttribute* pTextAttribute = getSdrLSTAttribute().getText(); - ::basegfx::B2DHomMatrix aObjectMatrix; + basegfx::B2DHomMatrix aObjectMatrix; aObjectMatrix.rotate(fAngle); - aObjectMatrix.translate(maStart.getX(), maStart.getY()); + aObjectMatrix.translate(getStart().getX(), getStart().getY()); if(pTextAttribute) { - ::basegfx::B2DHomMatrix aTextMatrix; + basegfx::B2DHomMatrix aTextMatrix; double fTestAngle(fAngle); - if(mbTextRotation) + if(getTextRotation()) { aTextMatrix.rotate(-90.0 * F_PI180); fTestAngle -= (90.0 * F_PI180); - if(mbTextAutoAngle && fTestAngle < -F_PI) + if(getTextAutoAngle() && fTestAngle < -F_PI) { fTestAngle += F_2PI; } } - if(mbTextAutoAngle) + if(getTextAutoAngle()) { if(fTestAngle > (F_PI / 4.0) || fTestAngle < (-F_PI * (3.0 / 4.0))) { @@ -125,13 +125,18 @@ namespace drawinglayer } // create primitive and get text range - pBlockText = new SdrBlockTextPrimitive2D(pTextAttribute->getSdrText(), pTextAttribute->getOutlinerParaObject(), - aTextMatrix, pTextAttribute->isScroll(), false, false); + pBlockText = new SdrBlockTextPrimitive2D( + &pTextAttribute->getSdrText(), + pTextAttribute->getOutlinerParaObject(), + aTextMatrix, + pTextAttribute->isScroll(), + false, + false); aTextRange = pBlockText->getB2DRange(aViewInformation); } // prepare line attribute and result - const attribute::SdrLineAttribute* pLineAttribute(maSdrLSTAttribute.getLine()); + const attribute::SdrLineAttribute* pLineAttribute(getSdrLSTAttribute().getLine()); if(!pLineAttribute) { @@ -142,7 +147,7 @@ namespace drawinglayer { bool bArrowsOutside(false); bool bMainLineSplitted(false); - const attribute::SdrLineStartEndAttribute* pLineStartEnd = maSdrLSTAttribute.getLineStartEnd(); + const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd(); double fStartArrowW(0.0); double fStartArrowH(0.0); double fEndArrowW(0.0); @@ -152,7 +157,7 @@ namespace drawinglayer { if(pLineStartEnd->isStartActive()) { - const ::basegfx::B2DRange aArrowRange(::basegfx::tools::getRange(pLineStartEnd->getStartPolyPolygon())); + const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getStartPolyPolygon())); fStartArrowW = pLineStartEnd->getStartWidth(); fStartArrowH = aArrowRange.getHeight() * fStartArrowW / aArrowRange.getWidth(); @@ -164,7 +169,7 @@ namespace drawinglayer if(pLineStartEnd->isEndActive()) { - const ::basegfx::B2DRange aArrowRange(::basegfx::tools::getRange(pLineStartEnd->getEndPolyPolygon())); + const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getEndPolyPolygon())); fEndArrowW = pLineStartEnd->getEndWidth(); fEndArrowH = aArrowRange.getHeight() * fEndArrowW / aArrowRange.getWidth(); @@ -184,8 +189,8 @@ namespace drawinglayer bArrowsOutside = true; } - MeasureTextPosition eHorizontal(meHorizontal); - MeasureTextPosition eVertical(meVertical); + MeasureTextPosition eHorizontal(getHorizontal()); + MeasureTextPosition eVertical(getVertical()); if(MEASURETEXTPOSITION_AUTOMATIC == eVertical) { @@ -232,7 +237,7 @@ namespace drawinglayer } // switch text above/below? - if(mbBelow || (bAutoUpsideDown && !mbTextRotation)) + if(getBelow() || (bAutoUpsideDown && !getTextRotation())) { if(MEASURETEXTPOSITION_NEGATIVE == eVertical) { @@ -244,9 +249,9 @@ namespace drawinglayer } } - const double fMainLineOffset(mbBelow ? mfDistance : -mfDistance); - const ::basegfx::B2DPoint aMainLeft(0.0, fMainLineOffset); - const ::basegfx::B2DPoint aMainRight(fDistance, fMainLineOffset); + const double fMainLineOffset(getBelow() ? getDistance() : -getDistance()); + const basegfx::B2DPoint aMainLeft(0.0, fMainLineOffset); + const basegfx::B2DPoint aMainRight(fDistance, fMainLineOffset); // main line if(bArrowsOutside) @@ -266,8 +271,8 @@ namespace drawinglayer } } - const ::basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY()); - const ::basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY()); + const basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY()); + const basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY()); appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainLeftLeft, aMainLeft, false, true)); appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainRight, aMainRightRight, true, false)); @@ -282,8 +287,8 @@ namespace drawinglayer if(bMainLineSplitted) { const double fHalfLength((fDistance - (aTextRange.getWidth() + (fStartArrowH + fEndArrowH) * 0.25)) * 0.5); - const ::basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY()); - const ::basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY()); + const basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY()); + const basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY()); appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainLeft, aMainInnerLeft, true, false)); appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainInnerRight, aMainRight, false, true)); @@ -295,19 +300,19 @@ namespace drawinglayer } // left/right help line value preparation - const double fTopEdge(mbBelow ? mfUpper + mfDistance : -mfUpper - mfDistance); - const double fBottomLeft(mbBelow ? mfLower - mfLeftDelta : mfLeftDelta - mfLower); - const double fBottomRight(mbBelow ? mfLower - mfRightDelta : mfRightDelta - mfLower); + const double fTopEdge(getBelow() ? getUpper() + getDistance() : -getUpper() - getDistance()); + const double fBottomLeft(getBelow() ? getLower() - getLeftDelta() : getLeftDelta() - getLower()); + const double fBottomRight(getBelow() ? getLower() - getRightDelta() : getRightDelta() - getLower()); // left help line - const ::basegfx::B2DPoint aLeftUp(0.0, fTopEdge); - const ::basegfx::B2DPoint aLeftDown(0.0, fBottomLeft); + const basegfx::B2DPoint aLeftUp(0.0, fTopEdge); + const basegfx::B2DPoint aLeftDown(0.0, fBottomLeft); appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aLeftDown, aLeftUp, false, false)); // right help line - const ::basegfx::B2DPoint aRightUp(fDistance, fTopEdge); - const ::basegfx::B2DPoint aRightDown(fDistance, fBottomRight); + const basegfx::B2DPoint aRightUp(fDistance, fTopEdge); + const basegfx::B2DPoint aRightDown(fDistance, fBottomRight); appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aRightDown, aRightUp, false, false)); @@ -390,7 +395,7 @@ namespace drawinglayer } } - if(!maSdrLSTAttribute.getLine()) + if(!getSdrLSTAttribute().getLine()) { // embed line geometry to invisible line group const Primitive2DReference xHiddenLines(new HitTestPrimitive2D(aRetval)); @@ -403,7 +408,7 @@ namespace drawinglayer if(pBlockText) { // create transformation to text primitive end position - ::basegfx::B2DHomMatrix aChange; + basegfx::B2DHomMatrix aChange; // handle auto text rotation if(bAutoUpsideDown) @@ -427,18 +432,9 @@ namespace drawinglayer } // add shadow - if(maSdrLSTAttribute.getShadow()) + if(getSdrLSTAttribute().getShadow()) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *maSdrLSTAttribute.getShadow())); - - if(xShadow.is()) - { - Primitive2DSequence aContentWithShadow(2L); - aContentWithShadow[0L] = xShadow; - aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval)); - aRetval = aContentWithShadow; - } + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow()); } return aRetval; @@ -446,8 +442,8 @@ namespace drawinglayer SdrMeasurePrimitive2D::SdrMeasurePrimitive2D( const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute, - const ::basegfx::B2DPoint& rStart, - const ::basegfx::B2DPoint& rEnd, + const basegfx::B2DPoint& rStart, + const basegfx::B2DPoint& rEnd, MeasureTextPosition eHorizontal, MeasureTextPosition eVertical, double fDistance, @@ -481,19 +477,19 @@ namespace drawinglayer { const SdrMeasurePrimitive2D& rCompare = (SdrMeasurePrimitive2D&)rPrimitive; - return (maStart == rCompare.maStart - && maEnd == rCompare.maEnd - && meHorizontal == rCompare.meHorizontal - && meVertical == rCompare.meVertical - && mfDistance == rCompare.mfDistance - && mfUpper == rCompare.mfUpper - && mfLower == rCompare.mfLower - && mfLeftDelta == rCompare.mfLeftDelta - && mfRightDelta == rCompare.mfRightDelta - && mbBelow == rCompare.mbBelow - && mbTextRotation == rCompare.mbTextRotation - && mbTextAutoAngle == rCompare.mbTextAutoAngle - && maSdrLSTAttribute == rCompare.maSdrLSTAttribute); + return (getStart() == rCompare.getStart() + && getEnd() == rCompare.getEnd() + && getHorizontal() == rCompare.getHorizontal() + && getVertical() == rCompare.getVertical() + && getDistance() == rCompare.getDistance() + && getUpper() == rCompare.getUpper() + && getLower() == rCompare.getLower() + && getLeftDelta() == rCompare.getLeftDelta() + && getRightDelta() == rCompare.getRightDelta() + && getBelow() == rCompare.getBelow() + && getTextRotation() == rCompare.getTextRotation() + && getTextAutoAngle() == rCompare.getTextAutoAngle() + && getSdrLSTAttribute() == rCompare.getSdrLSTAttribute()); } return false; diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx index cd2b7b7789..a7d647d2c5 100644 --- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx @@ -116,16 +116,7 @@ namespace drawinglayer // add shadow if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getShadow()) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow())); - - if(xShadow.is()) - { - Primitive2DSequence aContentWithShadow(2L); - aContentWithShadow[0L] = xShadow; - aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval)); - aRetval = aContentWithShadow; - } + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx new file mode 100644 index 0000000000..9c5616ebff --- /dev/null +++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx @@ -0,0 +1,200 @@ +/************************************************************************* + * + * 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: sdrcaptionprimitive2d.cxx,v $ + * + * $Revision: 1.2.18.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_svx.hxx" +#include <svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx> +#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx> +#include <svx/svdoole2.hxx> +#include <vcl/svapp.hxx> +#include <drawinglayer/primitive2d/graphicprimitive2d.hxx> +#include <svtools/colorcfg.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence SdrOleContentPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + { + Primitive2DSequence aRetval; + const SdrOle2Obj* pSource = (mpSdrOle2Obj.is() ? static_cast< SdrOle2Obj* >(mpSdrOle2Obj.get()) : 0); + bool bScaleContent(false); + Graphic aGraphic; + + if(pSource) + { + Graphic* pOLEGraphic = (getHighContrast()) + ? pSource->getEmbeddedObjectRef().GetHCGraphic() + : pSource->GetGraphic(); + + if(pOLEGraphic) + { + aGraphic = *pOLEGraphic; + bScaleContent = pSource->IsEmptyPresObj(); + } + } + + if(GRAPHIC_NONE == aGraphic.GetType()) + { + // no source, use fallback ressource emty OLE graphic + const Bitmap aEmptyOLEBitmap(SdrOle2Obj::GetEmtyOLEReplacementBitmap()); + aGraphic = Graphic(aEmptyOLEBitmap); + bScaleContent = true; + } + + if(GRAPHIC_NONE != aGraphic.GetType()) + { + const GraphicObject aGraphicObject(aGraphic); + const GraphicAttr aGraphicAttr; + drawinglayer::primitive2d::Primitive2DSequence xOLEContent; + + if(bScaleContent) + { + // get transformation atoms + basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + getObjectTransform().decompose(aScale, aTranslate, fRotate, fShearX); + + // get PrefSize from the graphic in 100th mm + Size aPrefSize(aGraphic.GetPrefSize()); + + if(MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit()) + { + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM); + } + else + { + aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MAP_100TH_MM); + } + + const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 2.0); + const double fOffsetY((aScale.getY() - aPrefSize.getHeight()) / 2.0); + + if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0)) + { + // if content fits into frame, create it + basegfx::B2DHomMatrix aInnerObjectMatrix; + + aInnerObjectMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight()); + aInnerObjectMatrix.translate(fOffsetX, fOffsetY); + aInnerObjectMatrix.shearX(fShearX); + aInnerObjectMatrix.rotate(fRotate); + aInnerObjectMatrix.translate(aTranslate.getX(), aTranslate.getY()); + + const drawinglayer::primitive2d::Primitive2DReference aGraphicPrimitive( + new drawinglayer::primitive2d::GraphicPrimitive2D( + aInnerObjectMatrix, + aGraphicObject, + aGraphicAttr)); + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aGraphicPrimitive); + } + } + else + { + // create graphic primitive for content + const drawinglayer::primitive2d::Primitive2DReference aGraphicPrimitive( + new drawinglayer::primitive2d::GraphicPrimitive2D( + getObjectTransform(), + aGraphicObject, + aGraphicAttr)); + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aGraphicPrimitive); + } + + // a standard gray outline is created for scaled content + if(bScaleContent) + { + const svtools::ColorConfig aColorConfig; + const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES)); + + if(aColor.bIsVisible) + { + basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + const Color aVclColor(aColor.nColor); + aOutline.transform(getObjectTransform()); + const drawinglayer::primitive2d::Primitive2DReference xOutline( + new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aVclColor.getBColor())); + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xOutline); + } + } + } + + // get graphic and check scale content state + return aRetval; + } + + SdrOleContentPrimitive2D::SdrOleContentPrimitive2D( + const SdrOle2Obj& rSdrOle2Obj, + const basegfx::B2DHomMatrix& rObjectTransform, + bool bHighContrast) + : BasePrimitive2D(), + mpSdrOle2Obj(const_cast< SdrOle2Obj* >(&rSdrOle2Obj)), + maObjectTransform(rObjectTransform), + mbHighContrast(bHighContrast) + { + } + + bool SdrOleContentPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(BasePrimitive2D::operator==(rPrimitive)) + { + const SdrOleContentPrimitive2D& rCompare = (SdrOleContentPrimitive2D&)rPrimitive; + const bool bBothNot(!mpSdrOle2Obj.is() && !rCompare.mpSdrOle2Obj.is()); + const bool bBothAndEqual(mpSdrOle2Obj.is() && rCompare.mpSdrOle2Obj.is() + && mpSdrOle2Obj.get() == rCompare.mpSdrOle2Obj.get()); + + return ((bBothNot || bBothAndEqual) + && getObjectTransform() == rCompare.getObjectTransform() + && getHighContrast() == rCompare.getHighContrast()); + } + + return false; + } + + basegfx::B2DRange SdrOleContentPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + basegfx::B2DRange aRange(0.0, 0.0, 1.0, 1.0); + aRange.transform(getObjectTransform()); + + return aRange; + } + + // provide unique ID + ImplPrimitrive2DIDBlock(SdrOleContentPrimitive2D, PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx index f892648dc0..f09e9c14b8 100644 --- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx @@ -52,22 +52,22 @@ namespace drawinglayer Primitive2DSequence aRetval; // add fill - if(maSdrLFSTAttribute.getFill() && maUnitPolyPolygon.isClosed()) + if(getSdrLFSTAttribute().getFill() && getUnitPolyPolygon().isClosed()) { // take care for orientations - ::basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(::basegfx::tools::correctOrientations(maUnitPolyPolygon)); + basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(basegfx::tools::correctOrientations(getUnitPolyPolygon())); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(aOrientedUnitPolyPolygon, maTransform, *maSdrLFSTAttribute.getFill(), maSdrLFSTAttribute.getFillFloatTransGradient())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(aOrientedUnitPolyPolygon, getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); } // add line - if(maSdrLFSTAttribute.getLine()) + if(getSdrLFSTAttribute().getLine()) { - Primitive2DSequence aTemp(maUnitPolyPolygon.count()); + Primitive2DSequence aTemp(getUnitPolyPolygon().count()); - for(sal_uInt32 a(0L); a < maUnitPolyPolygon.count(); a++) + for(sal_uInt32 a(0L); a < getUnitPolyPolygon().count(); a++) { - aTemp[a] = createPolygonLinePrimitive(maUnitPolyPolygon.getB2DPolygon(a), maTransform, *maSdrLFSTAttribute.getLine(), maSdrLFSTAttribute.getLineStartEnd()); + aTemp[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd()); } appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp); @@ -76,44 +76,35 @@ namespace drawinglayer { // if initially no line is defined, create one for HitTest and BoundRect const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0)); - Primitive2DSequence xHiddenLineSequence(maUnitPolyPolygon.count()); + Primitive2DSequence xHiddenLineSequence(getUnitPolyPolygon().count()); - for(sal_uInt32 a(0); a < maUnitPolyPolygon.count(); a++) + for(sal_uInt32 a(0); a < getUnitPolyPolygon().count(); a++) { - xHiddenLineSequence[a] = createPolygonLinePrimitive(maUnitPolyPolygon.getB2DPolygon(a), maTransform, aBlackHairline); + xHiddenLineSequence[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), aBlackHairline); } appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence))); } // add text - if(maSdrLFSTAttribute.getText()) + if(getSdrLFSTAttribute().getText()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(maUnitPolyPolygon, maTransform, *maSdrLFSTAttribute.getText(), maSdrLFSTAttribute.getLine(), false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(getUnitPolyPolygon(), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false)); } // add shadow - if(maSdrLFSTAttribute.getShadow()) + if(getSdrLFSTAttribute().getShadow()) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *maSdrLFSTAttribute.getShadow())); - - if(xShadow.is()) - { - Primitive2DSequence aContentWithShadow(2L); - aContentWithShadow[0L] = xShadow; - aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval)); - aRetval = aContentWithShadow; - } + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); } return aRetval; } SdrPathPrimitive2D::SdrPathPrimitive2D( - const ::basegfx::B2DHomMatrix& rTransform, + const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, - const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon) + const basegfx::B2DPolyPolygon& rUnitPolyPolygon) : BasePrimitive2D(), maTransform(rTransform), maSdrLFSTAttribute(rSdrLFSTAttribute), @@ -127,9 +118,9 @@ namespace drawinglayer { const SdrPathPrimitive2D& rCompare = (SdrPathPrimitive2D&)rPrimitive; - return (maUnitPolyPolygon == rCompare.maUnitPolyPolygon - && maTransform == rCompare.maTransform - && maSdrLFSTAttribute == rCompare.maSdrLFSTAttribute); + return (getUnitPolyPolygon() == rCompare.getUnitPolyPolygon() + && getTransform() == rCompare.getTransform() + && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute()); } return false; diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx index e197679296..e4b9d3f4ec 100644 --- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx @@ -50,65 +50,90 @@ namespace drawinglayer Primitive2DSequence SdrRectanglePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; + Primitive2DSequence aHitTestContent; // create unit outline polygon - ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromRect(::basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), getCornerRadiusX(), getCornerRadiusY())); + const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect( + basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), + getCornerRadiusX(), + getCornerRadiusY())); // add fill if(getSdrLFSTAttribute().getFill()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + *getSdrLFSTAttribute().getFill(), + getSdrLFSTAttribute().getFillFloatTransGradient())); + } + else if(getTextFrame()) + { + // if no fill and it's a text frame, create a fill for HitTest and + // BoundRect fallback + appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent, + createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)), + getSdrLFSTAttribute().getFillFloatTransGradient())); } // add line if(getSdrLFSTAttribute().getLine()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolygonLinePrimitive( + aUnitOutline, + getTransform(), + *getSdrLFSTAttribute().getLine())); } - else + else if(!getTextFrame()) + { + // if initially no line is defined and it's not a text frame, create + // a line for HitTest and BoundRect + appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent, + createPolygonLinePrimitive( + aUnitOutline, + getTransform(), + attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0)))); + } + + // add HitTest and BoundRect helper geometry (if exists) + if(aHitTestContent.hasElements()) { - // if initially no line is defined, create one for HitTest and BoundRect - const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0)); - const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline)); - const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1); - - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence))); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + Primitive2DReference(new HitTestPrimitive2D(aHitTestContent))); } // add text if(getSdrLFSTAttribute().getText()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false)); } // add shadow if(getSdrLFSTAttribute().getShadow()) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow())); - - if(xShadow.is()) - { - Primitive2DSequence aContentWithShadow(2L); - aContentWithShadow[0L] = xShadow; - aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval)); - aRetval = aContentWithShadow; - } + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); } return aRetval; } SdrRectanglePrimitive2D::SdrRectanglePrimitive2D( - const ::basegfx::B2DHomMatrix& rTransform, + const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, double fCornerRadiusX, - double fCornerRadiusY) + double fCornerRadiusY, + bool bTextFrame) : BasePrimitive2D(), maTransform(rTransform), maSdrLFSTAttribute(rSdrLFSTAttribute), mfCornerRadiusX(fCornerRadiusX), - mfCornerRadiusY(fCornerRadiusY) + mfCornerRadiusY(fCornerRadiusY), + mbTextFrame(bTextFrame) { } @@ -121,7 +146,8 @@ namespace drawinglayer return (getCornerRadiusX() == rCompare.getCornerRadiusX() && getCornerRadiusY() == rCompare.getCornerRadiusY() && getTransform() == rCompare.getTransform() - && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute()); + && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute() + && getTextFrame() == rCompare.getTextFrame()); } return false; diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index 919ac76e39..0b5abd1482 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -41,12 +41,55 @@ #include <drawinglayer/geometry/viewinformation2d.hxx> #include <unoapi.hxx> #include <svx/svdpage.hxx> +#include <svx/svdmodel.hxx> +#include <svx/svdoutl.hxx> +#include <com/sun/star/beans/XPropertySet.hpp> ////////////////////////////////////////////////////////////////////////////// using namespace com::sun::star; ////////////////////////////////////////////////////////////////////////////// + +namespace +{ + sal_Int16 getPageNumber(const uno::Reference< drawing::XDrawPage >& rxDrawPage) + { + sal_Int16 nRetval(0); + uno::Reference< beans::XPropertySet > xSet(rxDrawPage, uno::UNO_QUERY); + + if (xSet.is()) + { + try + { + const uno::Any aNumber(xSet->getPropertyValue(::rtl::OUString::createFromAscii("Number"))); + aNumber >>= nRetval; + } + catch(const uno::Exception&) + { + OSL_ASSERT(false); + } + } + + return nRetval; + } + + sal_Int16 getPageCount(const uno::Reference< drawing::XDrawPage >& rxDrawPage) + { + sal_Int16 nRetval(0); + SdrPage* pPage = GetSdrPageFromXDrawPage(rxDrawPage); + + if(pPage && pPage->GetModel()) + { + const sal_uInt16 nPageCount(pPage->GetModel()->GetPageCount()); + nRetval = ((sal_Int16)nPageCount - 1) / 2; + } + + return nRetval; + } +} // end of anonymous namespace + +////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { @@ -64,20 +107,28 @@ namespace drawinglayer } SdrTextPrimitive2D::SdrTextPrimitive2D( - const SdrText& rSdrText, + const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObject) : BasePrimitive2D(), - mrSdrText(rSdrText), + mrSdrText(const_cast< SdrText* >(pSdrText)), maOutlinerParaObject(rOutlinerParaObject), mxLastVisualizingPage(), + mnLastPageNumber(0), + mnLastPageCount(0), + maLastTextBackgroundColor(), mbLastSpellCheck(false), - mbContainsPageField(false) + mbContainsPageField(false), + mbContainsPageCountField(false), + mbContainsOtherFields(false) { const EditTextObject& rETO = maOutlinerParaObject.GetTextObject(); - mbContainsPageField = rETO.HasField(SvxPageField::StaticType()) - || rETO.HasField(SvxHeaderField::StaticType()) - || rETO.HasField(SvxFooterField::StaticType()) - || rETO.HasField(SvxDateTimeField::StaticType()); +
+ mbContainsPageField = rETO.HasField(SvxPageField::StaticType());
+ mbContainsPageCountField = rETO.HasField(SvxPagesField::StaticType());
+ mbContainsOtherFields = rETO.HasField(SvxHeaderField::StaticType())
+ || rETO.HasField(SvxFooterField::StaticType())
+ || rETO.HasField(SvxDateTimeField::StaticType())
+ || rETO.HasField(SvxAuthorField::StaticType());
} bool SdrTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const @@ -94,21 +145,66 @@ namespace drawinglayer Primitive2DSequence SdrTextPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { - const bool bCurrentSpellCheck(getSdrText().GetObject().impCheckSpellCheckForDecomposeTextPrimitive()); + const bool bCurrentSpellCheck(getSdrText() + ? getSdrText()->GetObject().impCheckSpellCheckForDecomposeTextPrimitive() + : false); uno::Reference< drawing::XDrawPage > xCurrentlyVisualizingPage; + bool bCurrentlyVisualizingPageIsSet(false); + Color aNewTextBackgroundColor; + bool bNewTextBackgroundColorIsSet(false); + sal_Int16 nCurrentlyValidPageNumber(0); + sal_Int16 nCurrentlyValidPageCount(0); if(getLocalDecomposition().hasElements()) { bool bDoDelete(getLastSpellCheck() != bCurrentSpellCheck); - if(!bDoDelete && mbContainsPageField) + // check visualized page + if(!bDoDelete && (mbContainsPageField || mbContainsPageCountField || mbContainsOtherFields)) { + // get visualized page and remember xCurrentlyVisualizingPage = rViewInformation.getVisualizedPage(); + bCurrentlyVisualizingPageIsSet = true; if(xCurrentlyVisualizingPage != mxLastVisualizingPage) { bDoDelete = true; } + + // #i98870# check visualized PageNumber + if(!bDoDelete && mbContainsPageField) + { + nCurrentlyValidPageNumber = getPageNumber(xCurrentlyVisualizingPage); + + if(nCurrentlyValidPageNumber != mnLastPageNumber) + { + bDoDelete = true; + } + } + + // #i98870# check visualized PageCount, too + if(!bDoDelete && mbContainsPageCountField) + { + nCurrentlyValidPageCount = getPageCount(xCurrentlyVisualizingPage); + + if(nCurrentlyValidPageCount != mnLastPageCount) + { + bDoDelete = true; + } + } + } + + // #i101443# check change of TextBackgroundolor + if(!bDoDelete && getSdrText() && getSdrText()->GetModel()) + { + SdrOutliner& rDrawOutliner = getSdrText()->GetModel()->GetDrawOutliner(0); + aNewTextBackgroundColor = rDrawOutliner.GetBackgroundColor(); + bNewTextBackgroundColorIsSet = true; + + if(aNewTextBackgroundColor != maLastTextBackgroundColor) + { + bDoDelete = true; + } } if(bDoDelete) @@ -119,8 +215,32 @@ namespace drawinglayer if(!getLocalDecomposition().hasElements()) { + if(!bCurrentlyVisualizingPageIsSet && mbContainsPageField) + { + xCurrentlyVisualizingPage = rViewInformation.getVisualizedPage(); + } + + if(!nCurrentlyValidPageNumber && mbContainsPageField) + { + nCurrentlyValidPageNumber = getPageNumber(xCurrentlyVisualizingPage); + } + + if(!nCurrentlyValidPageCount && mbContainsPageCountField) + { + nCurrentlyValidPageCount = getPageCount(xCurrentlyVisualizingPage); + } + + if(!bNewTextBackgroundColorIsSet && getSdrText() && getSdrText()->GetModel()) + { + SdrOutliner& rDrawOutliner = getSdrText()->GetModel()->GetDrawOutliner(0); + aNewTextBackgroundColor = rDrawOutliner.GetBackgroundColor(); + } + const_cast< SdrTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck); const_cast< SdrTextPrimitive2D* >(this)->mxLastVisualizingPage = xCurrentlyVisualizingPage; + const_cast< SdrTextPrimitive2D* >(this)->mnLastPageNumber = nCurrentlyValidPageNumber; + const_cast< SdrTextPrimitive2D* >(this)->mnLastPageCount = nCurrentlyValidPageCount; + const_cast< SdrTextPrimitive2D* >(this)->maLastTextBackgroundColor = aNewTextBackgroundColor; } // call parent @@ -138,7 +258,9 @@ namespace drawinglayer Primitive2DSequence SdrContourTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText().GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation)); + const bool bCurrentSpellCheck(getSdrText() + ? getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation) + : false); if(getLastSpellCheck() != bCurrentSpellCheck) { @@ -150,11 +272,11 @@ namespace drawinglayer } SdrContourTextPrimitive2D::SdrContourTextPrimitive2D( - const SdrText& rSdrText, + const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObject, - const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon, - const ::basegfx::B2DHomMatrix& rObjectTransform) - : SdrTextPrimitive2D(rSdrText, rOutlinerParaObject), + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DHomMatrix& rObjectTransform) + : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject), maUnitPolyPolygon(rUnitPolyPolygon), maObjectTransform(rObjectTransform) { @@ -166,16 +288,20 @@ namespace drawinglayer { const SdrContourTextPrimitive2D& rCompare = (SdrContourTextPrimitive2D&)rPrimitive; - return (maUnitPolyPolygon == rCompare.maUnitPolyPolygon - && maObjectTransform == rCompare.maObjectTransform); + return (getUnitPolyPolygon() == rCompare.getUnitPolyPolygon() + && getObjectTransform() == rCompare.getObjectTransform()); } return false; } - SdrTextPrimitive2D* SdrContourTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const + SdrTextPrimitive2D* SdrContourTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const { - return new SdrContourTextPrimitive2D(getSdrText(), getOutlinerParaObject(), maUnitPolyPolygon, rTransform * maObjectTransform); + return new SdrContourTextPrimitive2D( + getSdrText(), + getOutlinerParaObject(), + getUnitPolyPolygon(), + rTransform * getObjectTransform()); } // provide unique ID @@ -193,7 +319,9 @@ namespace drawinglayer Primitive2DSequence SdrPathTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText().GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation)); + const bool bCurrentSpellCheck(getSdrText() + ? getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation) + : false); if(getLastSpellCheck() != bCurrentSpellCheck) { @@ -205,11 +333,13 @@ namespace drawinglayer } SdrPathTextPrimitive2D::SdrPathTextPrimitive2D( - const SdrText& rSdrText, + const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObject, - const ::basegfx::B2DPolyPolygon& rPathPolyPolygon) - : SdrTextPrimitive2D(rSdrText, rOutlinerParaObject), - maPathPolyPolygon(rPathPolyPolygon) + const basegfx::B2DPolyPolygon& rPathPolyPolygon, + const attribute::SdrFormTextAttribute& rSdrFormTextAttribute) + : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject), + maPathPolyPolygon(rPathPolyPolygon), + maSdrFormTextAttribute(rSdrFormTextAttribute) { } @@ -219,17 +349,23 @@ namespace drawinglayer { const SdrPathTextPrimitive2D& rCompare = (SdrPathTextPrimitive2D&)rPrimitive; - return (maPathPolyPolygon == rCompare.maPathPolyPolygon); + return (getPathPolyPolygon() == rCompare.getPathPolyPolygon() + && getSdrFormTextAttribute() == rCompare.getSdrFormTextAttribute()); } return false; } - SdrTextPrimitive2D* SdrPathTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const + SdrTextPrimitive2D* SdrPathTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const { - ::basegfx::B2DPolyPolygon aNewPolyPolygon(maPathPolyPolygon); + basegfx::B2DPolyPolygon aNewPolyPolygon(getPathPolyPolygon()); aNewPolyPolygon.transform(rTransform); - return new SdrPathTextPrimitive2D(getSdrText(), getOutlinerParaObject(), aNewPolyPolygon); + + return new SdrPathTextPrimitive2D( + getSdrText(), + getOutlinerParaObject(), + aNewPolyPolygon, + getSdrFormTextAttribute()); } // provide unique ID @@ -247,7 +383,9 @@ namespace drawinglayer Primitive2DSequence SdrBlockTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText().GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation)); + const bool bCurrentSpellCheck(getSdrText() + ? getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation) + : false); if(getLastSpellCheck() != bCurrentSpellCheck) { @@ -259,13 +397,13 @@ namespace drawinglayer } SdrBlockTextPrimitive2D::SdrBlockTextPrimitive2D( - const SdrText& rSdrText, + const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObject, - const ::basegfx::B2DHomMatrix& rTextRangeTransform, + const basegfx::B2DHomMatrix& rTextRangeTransform, bool bUnlimitedPage, bool bCellText, bool bWordWrap) - : SdrTextPrimitive2D(rSdrText, rOutlinerParaObject), + : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject), maTextRangeTransform(rTextRangeTransform), mbUnlimitedPage(bUnlimitedPage), mbCellText(bCellText), @@ -288,9 +426,15 @@ namespace drawinglayer return false; } - SdrTextPrimitive2D* SdrBlockTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const + SdrTextPrimitive2D* SdrBlockTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const { - return new SdrBlockTextPrimitive2D(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform(), getUnlimitedPage(), getCellText(), getWordWrap()); + return new SdrBlockTextPrimitive2D( + getSdrText(), + getOutlinerParaObject(), + rTransform * getTextRangeTransform(), + getUnlimitedPage(), + getCellText(), + getWordWrap()); } // provide unique ID @@ -308,7 +452,9 @@ namespace drawinglayer Primitive2DSequence SdrStretchTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText().GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation)); + const bool bCurrentSpellCheck(getSdrText() + ? getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation) + : false); if(getLastSpellCheck() != bCurrentSpellCheck) { @@ -320,10 +466,10 @@ namespace drawinglayer } SdrStretchTextPrimitive2D::SdrStretchTextPrimitive2D( - const SdrText& rSdrText, + const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObject, - const ::basegfx::B2DHomMatrix& rTextRangeTransform) - : SdrTextPrimitive2D(rSdrText, rOutlinerParaObject), + const basegfx::B2DHomMatrix& rTextRangeTransform) + : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject), maTextRangeTransform(rTextRangeTransform) { } @@ -334,15 +480,18 @@ namespace drawinglayer { const SdrStretchTextPrimitive2D& rCompare = (SdrStretchTextPrimitive2D&)rPrimitive; - return (maTextRangeTransform == rCompare.maTextRangeTransform); + return (getTextRangeTransform() == rCompare.getTextRangeTransform()); } return false; } - SdrTextPrimitive2D* SdrStretchTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const + SdrTextPrimitive2D* SdrStretchTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const { - return new SdrStretchTextPrimitive2D(getSdrText(), getOutlinerParaObject(), rTransform * maTextRangeTransform); + return new SdrStretchTextPrimitive2D( + getSdrText(), + getOutlinerParaObject(), + rTransform * getTextRangeTransform()); } // provide unique ID diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx index 0d6cb3b83b..fe317a495a 100644 --- a/svx/source/sdr/properties/properties.cxx +++ b/svx/source/sdr/properties/properties.cxx @@ -180,6 +180,11 @@ namespace sdr GetSdrObject().SendUserCall(SDRUSERCALL_CHGATTR, rChange.GetRectangle(a)); } } + + sal_uInt32 BaseProperties::getVersion() const + { + return 0; + } } // end of namespace properties } // end of namespace sdr diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index 139d2fb988..229ba89db5 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -72,12 +72,14 @@ namespace sdr } TextProperties::TextProperties(SdrObject& rObj) - : AttributeProperties(rObj) + : AttributeProperties(rObj), + maVersion(0) { } TextProperties::TextProperties(const TextProperties& rProps, SdrObject& rObj) - : AttributeProperties(rProps, rObj) + : AttributeProperties(rProps, rObj), + maVersion(rProps.getVersion()) { } @@ -93,10 +95,11 @@ namespace sdr void TextProperties::ItemSetChanged(const SfxItemSet& rSet) { SdrTextObj& rObj = (SdrTextObj&)GetSdrObject(); - - sal_Int32 nText = rObj.getTextCount(); + // #i101556# ItemSet has changed -> new version + maVersion++; + while( --nText >= 0 ) { SdrText* pText = rObj.getText( nText ); @@ -237,6 +240,9 @@ namespace sdr // call parent AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr); + // #i101556# StyleSheet has changed -> new version + maVersion++; + if( rObj.GetModel() /*&& !rObj.IsTextEditActive()*/ && !rObj.IsLinkedText() ) { SdrOutliner& rOutliner = rObj.ImpGetDrawOutliner(); @@ -577,6 +583,9 @@ namespace sdr rObj.ActionChanged(); //rObj.BroadcastObjectChange(); } + + // #i101556# content of StyleSheet has changed -> new version + maVersion++; } if(SFX_HINT_DYING == nId) @@ -616,6 +625,12 @@ namespace sdr } } } + + // #i101556# Handout version information + sal_uInt32 TextProperties::getVersion() const + { + return maVersion; + } } // end of namespace properties } // end of namespace sdr diff --git a/svx/source/svdraw/makefile.mk b/svx/source/svdraw/makefile.mk index 0ac4b70130..e777ad70d3 100644 --- a/svx/source/svdraw/makefile.mk +++ b/svx/source/svdraw/makefile.mk @@ -33,6 +33,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=svdraw +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- @@ -42,11 +43,11 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- -SLOFILES=\ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/svdxcgv.obj \ $(SLO)$/svdmodel.obj \ $(SLO)$/svdpage.obj \ - $(SLO)$/svdoimp.obj \ $(SLO)$/svdobj.obj \ $(SLO)$/svdedtv1.obj \ $(SLO)$/svdcrtv.obj \ @@ -59,7 +60,6 @@ SLOFILES=\ $(SLO)$/svdotextdecomposition.obj \ $(SLO)$/svdotextpathdecomposition.obj \ $(SLO)$/svdouno.obj \ - $(SLO)$/svdfppt.obj \ $(SLO)$/svdpagv.obj \ $(SLO)$/svddrgmt.obj \ $(SLO)$/svdpntv.obj \ @@ -91,11 +91,11 @@ SLOFILES=\ $(SLO)$/svdedtv2.obj \ $(SLO)$/svdedxv.obj \ $(SLO)$/svdetc.obj \ + $(SLO)$/sdrhittesthelper.obj \ $(SLO)$/svdfmtf.obj \ $(SLO)$/svdglev.obj \ $(SLO)$/svdglue.obj \ $(SLO)$/svdhlpln.obj \ - $(SLO)$/svdibrow.obj \ $(SLO)$/svditer.obj \ $(SLO)$/svdlayer.obj \ $(SLO)$/svdmark.obj \ @@ -105,20 +105,29 @@ SLOFILES=\ $(SLO)$/sdrpagewindow.obj \ $(SLO)$/sdrpaintwindow.obj \ $(SLO)$/svdpoev.obj \ - $(SLO)$/svdscrol.obj \ - $(SLO)$/svdtouch.obj \ $(SLO)$/svdtrans.obj \ - $(SLO)$/svdtxhdl.obj \ $(SLO)$/svdundo.obj \ $(SLO)$/svdviter.obj \ $(SLO)$/clonelist.obj \ - $(SLO)$/ActionDescriptionProvider.obj \ $(SLO)$/svdedtv.obj \ $(SLO)$/selectioncontroller.obj \ $(SLO)$/polypolygoneditor.obj \ - $(SLO)$/svdomedia.obj \ + $(SLO)$/svdibrow.obj \ + $(SLO)$/svdomedia.obj + +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/svdoimp.obj \ + $(SLO)$/svdscrol.obj \ + $(SLO)$/ActionDescriptionProvider.obj \ $(SLO)$/impgrfll.obj +LIB3TARGET= $(SLB)$/$(TARGET)-msfilter.lib +LIB3OBJFILES= \ + $(SLO)$/svdfppt.obj \ + +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) $(LIB3OBJFILES) + SRS1NAME=svdstr SRC1FILES= svdstr.src diff --git a/svx/source/svdraw/sdrhittesthelper.cxx b/svx/source/svdraw/sdrhittesthelper.cxx new file mode 100644 index 0000000000..008ae7734e --- /dev/null +++ b/svx/source/svdraw/sdrhittesthelper.cxx @@ -0,0 +1,176 @@ +/************************************************************************* + * + * 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: svdetc.cxx,v $ + * $Revision: 1.35.18.2 $ + * + * 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_svx.hxx" + +#include <svx/sdrhittesthelper.hxx> +#include <svx/obj3d.hxx> +#include <svx/helperhittest3d.hxx> +#include <svx/sdrpagewindow.hxx> +#include <svx/sdr/contact/viewobjectcontact.hxx> +#include <svx/sdr/contact/displayinfo.hxx> +#include <svx/sdr/contact/objectcontact.hxx> +#include <drawinglayer/processor2d/hittestprocessor2d.hxx> +#include <svx/svdpagv.hxx> +#include <svx/sdr/contact/viewcontact.hxx> + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// #i101872# new Object HitTest as View-tooling + +SdrObject* SdrObjectPrimitiveHit( + const SdrObject& rObject, + const Point& rPnt, + sal_uInt16 nTol, + const SdrPageView& rSdrPageView, + const SetOfByte* pVisiLayer, + bool bTextOnly) +{ + SdrObject* pResult = 0; + + if(rObject.GetSubList() && rObject.GetSubList()->GetObjCount()) + { + // group or scene with content. Single 3D objects also have a + // true == rObject.GetSubList(), but no content + pResult = SdrObjListPrimitiveHit(*rObject.GetSubList(), rPnt, nTol, rSdrPageView, pVisiLayer, bTextOnly); + } + else + { + if(!pVisiLayer || pVisiLayer->IsSet(rObject.GetLayer())) + { + // single object, 3d object, empty scene or empty group. Check if + // it's a single 3D object + const E3dCompoundObject* pE3dCompoundObject = dynamic_cast< const E3dCompoundObject* >(&rObject); + + if(pE3dCompoundObject) + { + const basegfx::B2DPoint aHitPosition(rPnt.X(), rPnt.Y()); + + if(checkHitSingle3DObject(aHitPosition, *pE3dCompoundObject)) + { + pResult = const_cast< E3dCompoundObject* >(pE3dCompoundObject); + } + } + else + { + // not a single 3D object; Check in first PageWindow using prmitives (only SC + // with split views uses multiple PageWindows nowadays) + if(rSdrPageView.PageWindowCount()) + { + const double fLogicTolerance(nTol); + const basegfx::B2DPoint aHitPosition(rPnt.X(), rPnt.Y()); + const sdr::contact::ViewObjectContact& rVOC = rObject.GetViewContact().GetViewObjectContact( + rSdrPageView.GetPageWindow(0)->GetObjectContact()); + + if(ViewObjectContactPrimitiveHit(rVOC, aHitPosition, fLogicTolerance, bTextOnly)) + { + pResult = const_cast< SdrObject* >(&rObject); + } + } + } + } + } + + return pResult; +} + +///////////////////////////////////////////////////////////////////// + +SdrObject* SdrObjListPrimitiveHit( + const SdrObjList& rList, + const Point& rPnt, + sal_uInt16 nTol, + const SdrPageView& rSdrPageView, + const SetOfByte* pVisiLayer, + bool bTextOnly) +{ + sal_uInt32 nObjNum(rList.GetObjCount()); + SdrObject* pRetval = 0; + + while(!pRetval && nObjNum > 0) + { + nObjNum--; + SdrObject* pObj = rList.GetObj(nObjNum); + + pRetval = SdrObjectPrimitiveHit(*pObj, rPnt, nTol, rSdrPageView, pVisiLayer, bTextOnly); + } + + return pRetval; +} + +///////////////////////////////////////////////////////////////////// + +bool ViewObjectContactPrimitiveHit( + const sdr::contact::ViewObjectContact& rVOC, + const basegfx::B2DPoint& rHitPosition, + double fLogicHitTolerance, + bool bTextOnly) +{ + basegfx::B2DRange aObjectRange(rVOC.getObjectRange()); + + if(!aObjectRange.isEmpty()) + { + // first do a rough B2DRange based HitTest; do not forget to + // include the HitTolerance if given + if(basegfx::fTools::more(fLogicHitTolerance, 0.0)) + { + aObjectRange.grow(fLogicHitTolerance); + } + + if(aObjectRange.isInside(rHitPosition)) + { + // get primitive sequence + sdr::contact::DisplayInfo aDisplayInfo; + const drawinglayer::primitive2d::Primitive2DSequence& rSequence(rVOC.getPrimitive2DSequence(aDisplayInfo)); + + if(rSequence.hasElements()) + { + // create a HitTest processor + const drawinglayer::geometry::ViewInformation2D& rViewInformation2D = rVOC.GetObjectContact().getViewInformation2D(); + drawinglayer::processor2d::HitTestProcessor2D aHitTestProcessor2D( + rViewInformation2D, + rHitPosition, + fLogicHitTolerance, + bTextOnly); + + // feed it with the primitives + aHitTestProcessor2D.process(rSequence); + + // deliver result + return aHitTestProcessor2D.getHit(); + } + } + } + + return false; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx index 05cca4c5ce..276a7d4f8d 100644 --- a/svx/source/svdraw/sdrpaintwindow.cxx +++ b/svx/source/svdraw/sdrpaintwindow.cxx @@ -116,8 +116,9 @@ void SdrPaintWindow::impCreateOverlayManager(const bool bUseBuffer) // When the buffer usage has changed then we have to create a new // overlay manager. Save the current one so that later we can move its // overlay objects to the new one. - ::sdr::overlay::OverlayManager* pOldOverlayManager = NULL; - if (mbUseBuffer != bUseBuffer) + sdr::overlay::OverlayManager* pOldOverlayManager = NULL; + + if(mbUseBuffer != bUseBuffer) { mbUseBuffer = bUseBuffer; pOldOverlayManager = mpOverlayManager; @@ -134,15 +135,19 @@ void SdrPaintWindow::impCreateOverlayManager(const bool bUseBuffer) if(GetPaintView().IsBufferedOverlayAllowed() && mbUseBuffer) { // buffered OverlayManager, buffers it's background and refreshes from there - // for pure overlay changes (no system redraw). The 2nd parameter specifies + // for pure overlay changes (no system redraw). The 3rd parameter specifies // if that refresh itself will use a 2nd vdev to avoid flickering. - mpOverlayManager = new ::sdr::overlay::OverlayManagerBuffered(GetOutputDevice(), sal_True); + // Also hand over the evtl. existing old OverlayManager; this means to take over + // the registered OverlayObjects from it + mpOverlayManager = new ::sdr::overlay::OverlayManagerBuffered(GetOutputDevice(), pOldOverlayManager, true); } else { // unbuffered OverlayManager, just invalidates places where changes // take place - mpOverlayManager = new ::sdr::overlay::OverlayManager(GetOutputDevice()); + // Also hand over the evtl. existing old OverlayManager; this means to take over + // the registered OverlayObjects from it + mpOverlayManager = new ::sdr::overlay::OverlayManager(GetOutputDevice(), pOldOverlayManager); } OSL_ENSURE(mpOverlayManager, "SdrPaintWindow::SdrPaintWindow: Could not allocate an overlayManager (!)"); @@ -169,33 +174,10 @@ void SdrPaintWindow::impCreateOverlayManager(const bool bUseBuffer) } } - // Because we can not notify the creators of the overlay objects that - // belong to the old overlay manager we have to move these objects from - // the old to the new overlay manager and hope for the best (ie that the - // owner of the overlay objects did not store a pointer to the overlay - // manager but asks the view for the current one.) - if (pOldOverlayManager != NULL) + // OverlayObjects are transfered for the evtl. newly created OverlayManager by handing over + // at construction time + if(pOldOverlayManager) { - if (mpOverlayManager != NULL) - { - // Get a list of all overlay objects added to the old overlay - // manager. This list is not modified when overlay objects are - // moved from one overlay manager to the other so its save to - // iterate over it. - ::boost::shared_ptr<sdr::overlay::OverlayObjectVector> pOverlayObjects ( - pOldOverlayManager->GetOverlayObjects()); - // Iterate over the list of overlay objects and move, not copy, - // them from the old to the new overlay manager. - sdr::overlay::OverlayObjectVector::iterator iOverlay; - for (iOverlay=pOverlayObjects->begin(); iOverlay!=pOverlayObjects->end(); ++iOverlay) - { - if (*iOverlay != NULL) - { - pOldOverlayManager->remove(**iOverlay); - mpOverlayManager->add(**iOverlay); - } - } - } // The old overlay manager is not used anymore and can be (has to be) deleted. delete pOldOverlayManager; } diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index d0d2cd01d2..54cb04d980 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -41,28 +41,19 @@ #include <svx/svdetc.hxx> #include <svx/scene3d.hxx> #include <svx/view3d.hxx> - -// #116425# #include <svx/sdr/contact/objectcontactofobjlistpainter.hxx> - -// #116425# #include <svx/sdr/contact/displayinfo.hxx> #include <svx/svdouno.hxx> - #define XOR_CREATE_PEN PEN_SOLID #include <svx/svdopath.hxx> - -//////////////////////////////////////////////////////////////////////////////////////////////////// #include <svx/sdr/overlay/overlaypolypolygon.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> -#include <svx/sdr/overlay/overlaysdrobject.hxx> #include <sdrpaintwindow.hxx> - -// #i72535# #include "fmobj.hxx" - -// #i68562# #include <svx/svdocirc.hxx> +#include <svx/sdr/contact/viewcontact.hxx> +#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx> +#include <svx/sdr/overlay/overlaymanager.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -172,7 +163,10 @@ void ImpSdrCreateViewExtraData::CreateAndShowOverlay(const SdrCreateView& rView, { if(pObject) { - ::sdr::overlay::OverlaySdrObject* pNew = new ::sdr::overlay::OverlaySdrObject(basegfx::B2DPoint(), *pObject); + const sdr::contact::ViewContact& rVC = pObject->GetViewContact(); + const drawinglayer::primitive2d::Primitive2DSequence aSequence = rVC.getViewIndependentPrimitive2DSequence(); + sdr::overlay::OverlayObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence); + pOverlayManager->add(*pNew); maObjects.append(*pNew); } @@ -799,6 +793,15 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/) // overlay objects instead. sal_Bool bUseSolidDragging(IsSolidDragging()); + // #i101648# check if dragged object is a naked SdrObject (no + // derivation of). This is e.g. used in SW Frame construction + // as placeholder. Do not use SolidDragging for naked SDrObjects, + // they cannot have a valid optical representation + if(bUseSolidDragging && OBJ_NONE == pAktCreate->GetObjIdentifier()) + { + bUseSolidDragging = false; + } + // check for objects with no fill and no line if(bUseSolidDragging) { @@ -821,13 +824,15 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/) } } - // #i68562# Force to non-solid dragging when not creating a full circle and up to step three - if(bUseSolidDragging - && pAktCreate->ISA(SdrCircObj) - && OBJ_CIRC != (SdrObjKind)(static_cast< SdrCircObj* >(pAktCreate)->GetObjIdentifier()) - && aDragStat.GetPointAnz() < 4L) + // #i101781# force to non-solid dragging when not creating a full circle + if(bUseSolidDragging) { - bUseSolidDragging = false; + SdrCircObj* pCircObj = dynamic_cast< SdrCircObj* >(pAktCreate); + + if(pCircObj && OBJ_CIRC != pCircObj->GetObjIdentifier()) + { + bUseSolidDragging = false; + } } if(bUseSolidDragging) @@ -869,6 +874,18 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/) { mpCreateViewExtraData->CreateAndShowOverlay(*this, 0, pAktCreate->TakeCreatePoly(aDragStat)); } + + // #i101679# Force changed overlay to be shown + for(sal_uInt32 a(0); a < PaintWindowCount(); a++) + { + SdrPaintWindow* pCandidate = GetPaintWindow(a); + sdr::overlay::OverlayManager* pOverlayManager = pCandidate->GetOverlayManager(); + + if(pOverlayManager) + { + pOverlayManager->flush(); + } + } } aDragStat.SetShown(TRUE); diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index f4a0f5225c..5c582541e2 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -2551,7 +2551,7 @@ bool SdrDragGradient::BeginSdrDrag() { basegfx::B2DPoint aPosition(DragStat().GetStart().X(), DragStat().GetStart().Y()); - if(pColHdl->getOverlayObjectList().isHit(aPosition)) + if(pColHdl->getOverlayObjectList().isHitLogic(aPosition)) { bHit = true; pIAOHandle->SetMoveSingleHandle(true); @@ -2566,7 +2566,7 @@ bool SdrDragGradient::BeginSdrDrag() { basegfx::B2DPoint aPosition(DragStat().GetStart().X(), DragStat().GetStart().Y()); - if(pColHdl->getOverlayObjectList().isHit(aPosition)) + if(pColHdl->getOverlayObjectList().isHitLogic(aPosition)) { bHit = true; pIAOHandle->SetMoveSingleHandle(true); @@ -2578,7 +2578,7 @@ bool SdrDragGradient::BeginSdrDrag() { basegfx::B2DPoint aPosition(DragStat().GetStart().X(), DragStat().GetStart().Y()); - if(pIAOHandle->getOverlayObjectList().isHit(aPosition)) + if(pIAOHandle->getOverlayObjectList().isHitLogic(aPosition)) { bHit = true; } diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 49c2038c52..36d78ffc97 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -51,6 +51,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <svx/polypolygoneditor.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdr/overlay/overlaymanager.hxx> using namespace sdr; @@ -844,6 +845,9 @@ void SdrDragView::ShowDragObj() if(pOverlayManager) { mpCurrentSdrDragMethod->CreateOverlayGeometry(*pOverlayManager); + + // #i101679# Force changed overlay to be shown + pOverlayManager->flush(); } } diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 6c25af2441..adca082371 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -246,7 +246,7 @@ void SdrObjEditView::ModelHasChanged() eNewAnchor=(EVAnchorMode)pTextObj->GetOutlinerViewAnchorMode(); bAnchorChg=eOldAnchor!=eNewAnchor; Color aOldColor(pTextEditOutlinerView->GetBackgroundColor()); - aNewColor=ImpGetTextEditBackgroundColor(); + aNewColor = GetTextEditBackgroundColor(*this); bColorChg=aOldColor!=aNewColor; } // #104082# refresh always when it's a contour frame. That @@ -425,52 +425,10 @@ void SdrObjEditView::ImpInvalidateOutlinerView(OutlinerView& rOutlView) const } } -Color SdrObjEditView::ImpGetTextEditBackgroundColor() const -{ - // #108759# Extracted significant parts to SdrPaintView::CalcBackgroundColor() - svtools::ColorConfig aColorConfig; - Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor); - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - - if(!rStyleSettings.GetHighContrastMode()) - { - bool bFound=false; - SdrTextObj* pText = dynamic_cast< SdrTextObj * >( mxTextEditObj.get()); - if (pText!=NULL && pText->IsClosedObj()) - { - ::sdr::table::SdrTableObj* pTable = dynamic_cast< ::sdr::table::SdrTableObj * >( pText ); - if( pTable ) - bFound = GetDraftFillColor(pTable->GetActiveCellItemSet(), aBackground ); - - if( !bFound ) - bFound=GetDraftFillColor(pText->GetMergedItemSet(), aBackground); - } - if (!bFound && pTextEditPV!=NULL && pText) - { - // #108784# - Point aPvOfs(pText->GetTextEditOffset()); - - const SdrPage* pPg=pTextEditPV->GetPage(); - - // #112690# - // Test existance of the page before using CalcBackgroundColor - if(pPg) - { - Rectangle aSnapRect( pText->GetSnapRect() ); - aSnapRect.Move(aPvOfs.X(), aPvOfs.Y()); - - return CalcBackgroundColor( aSnapRect, pTextEditPV->GetVisibleLayers(), *pPg ); - } - } - } - - return aBackground; -} - OutlinerView* SdrObjEditView::ImpMakeOutlinerView(Window* pWin, BOOL /*bNoPaint*/, OutlinerView* pGivenView) const { // Hintergrund - Color aBackground(ImpGetTextEditBackgroundColor()); + Color aBackground(GetTextEditBackgroundColor(*this)); SdrTextObj* pText = dynamic_cast< SdrTextObj * >( mxTextEditObj.get() ); BOOL bTextFrame=pText!=NULL && pText->IsTextFrame(); BOOL bContourFrame=pText!=NULL && pText->IsContourTextFrame(); diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index 7c7aef9e59..0487aafb3c 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -31,10 +31,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" #include "forbiddencharacterstable.hxx" - #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/embed/EmbedStates.hpp> - #include <svx/svdetc.hxx> #include "svditext.hxx" #include <svx/svdmodel.hxx> @@ -68,15 +66,14 @@ #include <i18npool/lang.h> #include <unotools/charclass.hxx> #include <svtools/syslocale.hxx> - -// #97870# #include <svx/xflbckit.hxx> #include <svx/extrusionbar.hxx> #include <svx/fontworkbar.hxx> #include <vcl/svapp.hxx> //add CHINA001 - -//#i80528# #include <svx/sdr/contact/viewcontact.hxx> +#include <svx/svdpage.hxx> +#include <svx/svdotable.hxx> +#include <svx/sdrhittesthelper.hxx> using namespace ::com::sun::star; @@ -847,6 +844,258 @@ void SvdProgressInfo::ReportError() } //////////////////////////////////////////////////////////////////////////////////////////////////// +// #i101872# isolate GetTextEditBackgroundColor to tooling; it woll anyways only be used as long +// as text edit is not running on overlay + +namespace +{ + bool impGetSdrObjListFillColor( + const SdrObjList& rList, + const Point& rPnt, + const SdrPageView& rTextEditPV, + const SetOfByte& rVisLayers, + Color& rCol) + { + if(!rList.GetModel()) + return false; + + bool bRet(false); + bool bMaster(rList.GetPage() ? rList.GetPage()->IsMasterPage() : false); + + for(ULONG no(rList.GetObjCount()); !bRet && no > 0; ) + { + no--; + SdrObject* pObj = rList.GetObj(no); + SdrObjList* pOL = pObj->GetSubList(); + + if(pOL) + { + // group object + bRet = impGetSdrObjListFillColor(*pOL, rPnt, rTextEditPV, rVisLayers, rCol); + } + else + { + SdrTextObj* pText = dynamic_cast< SdrTextObj * >(pObj); + + // #108867# Exclude zero master page object (i.e. background shape) from color query + if(pText + && pObj->IsClosedObj() + && (!bMaster || (!pObj->IsNotVisibleAsMaster() && 0 != no)) + && pObj->GetCurrentBoundRect().IsInside(rPnt) + && !pText->IsHideContour() + && SdrObjectPrimitiveHit(*pObj, rPnt, 0, rTextEditPV, &rVisLayers, false)) + { + bRet = GetDraftFillColor(pObj->GetMergedItemSet(), rCol); + } + } + } + + return bRet; + } + + bool impGetSdrPageFillColor( + const SdrPage& rPage, + const Point& rPnt, + const SdrPageView& rTextEditPV, + const SetOfByte& rVisLayers, + Color& rCol, + bool bSkipBackgroundShape) + { + if(!rPage.GetModel()) + return false; + + bool bRet(impGetSdrObjListFillColor(rPage, rPnt, rTextEditPV, rVisLayers, rCol)); + + if(!bRet && !rPage.IsMasterPage()) + { + if(rPage.TRG_HasMasterPage()) + { + SetOfByte aSet(rVisLayers); + aSet &= rPage.TRG_GetMasterPageVisibleLayers(); + SdrPage& rMasterPage = rPage.TRG_GetMasterPage(); + + // #108867# Don't fall back to background shape on + // master pages. This is later handled by + // GetBackgroundColor, and is necessary to cater for + // the silly ordering: 1. shapes, 2. master page + // shapes, 3. page background, 4. master page + // background. + bRet = impGetSdrPageFillColor(rMasterPage, rPnt, rTextEditPV, aSet, rCol, true); + } + } + + // #108867# Only now determine background color from background shapes + if(!bRet && !bSkipBackgroundShape) + { + rCol = rPage.GetPageBackgroundColor(); + return true; + } + + return bRet; + } + + Color impCalcBackgroundColor( + const Rectangle& rArea, + const SdrPageView& rTextEditPV, + const SdrPage& rPage) + { + svtools::ColorConfig aColorConfig; + Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor); + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + + if(!rStyleSettings.GetHighContrastMode()) + { + // search in page + const USHORT SPOTCOUNT(5); + Point aSpotPos[SPOTCOUNT]; + Color aSpotColor[SPOTCOUNT]; + ULONG nHeight( rArea.GetSize().Height() ); + ULONG nWidth( rArea.GetSize().Width() ); + ULONG nWidth14 = nWidth / 4; + ULONG nHeight14 = nHeight / 4; + ULONG nWidth34 = ( 3 * nWidth ) / 4; + ULONG nHeight34 = ( 3 * nHeight ) / 4; + + USHORT i; + for ( i = 0; i < SPOTCOUNT; i++ ) + { + // five spots are used + switch ( i ) + { + case 0 : + { + // Center-Spot + aSpotPos[i] = rArea.Center(); + } + break; + + case 1 : + { + // TopLeft-Spot + aSpotPos[i] = rArea.TopLeft(); + aSpotPos[i].X() += nWidth14; + aSpotPos[i].Y() += nHeight14; + } + break; + + case 2 : + { + // TopRight-Spot + aSpotPos[i] = rArea.TopLeft(); + aSpotPos[i].X() += nWidth34; + aSpotPos[i].Y() += nHeight14; + } + break; + + case 3 : + { + // BottomLeft-Spot + aSpotPos[i] = rArea.TopLeft(); + aSpotPos[i].X() += nWidth14; + aSpotPos[i].Y() += nHeight34; + } + break; + + case 4 : + { + // BottomRight-Spot + aSpotPos[i] = rArea.TopLeft(); + aSpotPos[i].X() += nWidth34; + aSpotPos[i].Y() += nHeight34; + } + break; + + } + + aSpotColor[i] = Color( COL_WHITE ); + impGetSdrPageFillColor(rPage, aSpotPos[i], rTextEditPV, rTextEditPV.GetVisibleLayers(), aSpotColor[i], false); + } + + USHORT aMatch[SPOTCOUNT]; + + for ( i = 0; i < SPOTCOUNT; i++ ) + { + // were same spot colors found? + aMatch[i] = 0; + + for ( USHORT j = 0; j < SPOTCOUNT; j++ ) + { + if( j != i ) + { + if( aSpotColor[i] == aSpotColor[j] ) + { + aMatch[i]++; + } + } + } + } + + // highest weight to center spot + aBackground = aSpotColor[0]; + + for ( USHORT nMatchCount = SPOTCOUNT - 1; nMatchCount > 1; nMatchCount-- ) + { + // which spot color was found most? + for ( i = 0; i < SPOTCOUNT; i++ ) + { + if( aMatch[i] == nMatchCount ) + { + aBackground = aSpotColor[i]; + nMatchCount = 1; // break outer for-loop + break; + } + } + } + } + + return aBackground; + } +} // end of anonymous namespace + +Color GetTextEditBackgroundColor(const SdrObjEditView& rView) +{ + svtools::ColorConfig aColorConfig; + Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor); + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + + if(!rStyleSettings.GetHighContrastMode()) + { + bool bFound(false); + SdrTextObj* pText = dynamic_cast< SdrTextObj * >(rView.GetTextEditObject()); + + if(pText && pText->IsClosedObj()) + { + ::sdr::table::SdrTableObj* pTable = dynamic_cast< ::sdr::table::SdrTableObj * >( pText ); + + if( pTable ) + bFound = GetDraftFillColor(pTable->GetActiveCellItemSet(), aBackground ); + + if( !bFound ) + bFound=GetDraftFillColor(pText->GetMergedItemSet(), aBackground); + } + if(!bFound && pText) + { + SdrPageView* pTextEditPV = rView.GetTextEditPageView(); + + if(pTextEditPV) + { + Point aPvOfs(pText->GetTextEditOffset()); + const SdrPage* pPg = pTextEditPV->GetPage(); + + if(pPg) + { + Rectangle aSnapRect( pText->GetSnapRect() ); + aSnapRect.Move(aPvOfs.X(), aPvOfs.Y()); + + return impCalcBackgroundColor(aSnapRect, *pTextEditPV, *pPg); + } + } + } + } + return aBackground; +} +//////////////////////////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index df52800ab4..52bfccdc0c 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -476,6 +476,12 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaChordAction& rAct) bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrcPoly) { + // #i102706# Do not merge closed polygons + if(rSrcPoly.isClosed()) + { + return false; + } + // #i73407# reformulation to use new B2DPolygon classes if(bLastObjWasLine && (aOldLineColor == aVD.GetLineColor()) && rSrcPoly.count()) { @@ -489,6 +495,12 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc bool bOk(false); basegfx::B2DPolygon aDstPoly(pLastPoly->GetPathPoly().getB2DPolygon(0L)); + // #i102706# Do not merge closed polygons + if(aDstPoly.isClosed()) + { + return false; + } + if(aDstPoly.count()) { const sal_uInt32 nMaxDstPnt(aDstPoly.count() - 1L); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 2a36ff870c..9606b6e594 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -34,7 +34,6 @@ #include <algorithm> #include <svx/svdhdl.hxx> -#include "svdtouch.hxx" #include <svx/svdpagv.hxx> #include <svx/svdetc.hxx> #include <svx/svdmrkv.hxx> @@ -62,8 +61,7 @@ #include <svx/sdr/overlay/overlaymanager.hxx> #include <svx/sdr/overlay/overlayanimatedbitmapex.hxx> #include <svx/sdr/overlay/overlaybitmapex.hxx> -#include <svx/sdr/overlay/overlaybitmap.hxx> -#include <svx/sdr/overlay/overlaylinestriped.hxx> +#include <svx/sdr/overlay/overlayline.hxx> #include <svx/sdr/overlay/overlaytriangle.hxx> #include <svx/sdr/overlay/overlayhatchrect.hxx> #include <svx/sdrpagewindow.hxx> @@ -83,36 +81,63 @@ class SdrHdlBitmapSet { // the bitmap holding all infos - BitmapEx maMarkersBitmap; + BitmapEx maMarkersBitmap; + + // the cropped Bitmaps for reusage + ::std::vector< BitmapEx > maRealMarkers; + + // elpers + BitmapEx& impGetOrCreateTargetBitmap(sal_uInt16 nIndex, const Rectangle& rRectangle); public: SdrHdlBitmapSet(UINT16 nResId); ~SdrHdlBitmapSet(); - BitmapEx GetBitmapEx(BitmapMarkerKind eKindOfMarker, UINT16 nInd=0); + const BitmapEx& GetBitmapEx(BitmapMarkerKind eKindOfMarker, UINT16 nInd=0); }; //////////////////////////////////////////////////////////////////////////////////////////////////// +#define KIND_COUNT (14) +#define INDEX_COUNT (6) +#define INDIVIDUAL_COUNT (4) SdrHdlBitmapSet::SdrHdlBitmapSet(UINT16 nResId) +: maMarkersBitmap(), + // 14 kinds (BitmapMarkerKind) use index [0..5], 4 extra + maRealMarkers((KIND_COUNT * INDEX_COUNT) + INDIVIDUAL_COUNT) { // #101928# change color used for transparent parts to 0x00ff00ff (ImageList standard) - Color aColTransparent(0x00ff00ff); - Bitmap aBitmap(ResId(nResId, *ImpGetResMgr())); - maMarkersBitmap = BitmapEx(aBitmap, aColTransparent); + const Color aColTransparent(0x00ff00ff); + const Bitmap aBitmap(ResId(nResId, *ImpGetResMgr())); + const Bitmap aMask(aBitmap.CreateMask(aColTransparent)); + + // create a real BitmapEx with an AlphaMask + maMarkersBitmap = BitmapEx(aBitmap, aMask); + // maMarkersBitmap = BitmapEx(aBitmap, aColTransparent); } SdrHdlBitmapSet::~SdrHdlBitmapSet() { } -// #i15222# +BitmapEx& SdrHdlBitmapSet::impGetOrCreateTargetBitmap(sal_uInt16 nIndex, const Rectangle& rRectangle) +{ + BitmapEx& rTargetBitmap = maRealMarkers[nIndex]; + + if(rTargetBitmap.IsEmpty()) + { + rTargetBitmap = maMarkersBitmap; + rTargetBitmap.Crop(rRectangle); + } + + return rTargetBitmap; +} + // change getting of bitmap to use the big ressource bitmap -BitmapEx SdrHdlBitmapSet::GetBitmapEx(BitmapMarkerKind eKindOfMarker, UINT16 nInd) +const BitmapEx& SdrHdlBitmapSet::GetBitmapEx(BitmapMarkerKind eKindOfMarker, UINT16 nInd) { // fill in size and source position in maMarkersBitmap const sal_uInt16 nYPos(nInd * 11); - Rectangle aSourceRect; switch(eKindOfMarker) { @@ -123,140 +148,135 @@ BitmapEx SdrHdlBitmapSet::GetBitmapEx(BitmapMarkerKind eKindOfMarker, UINT16 nIn } case Rect_7x7: { - aSourceRect = Rectangle(Point(0, nYPos), Size(7, 7)); - break; + return impGetOrCreateTargetBitmap((0 * INDEX_COUNT) + nInd, Rectangle(Point(0, nYPos), Size(7, 7))); } case Rect_9x9: { - aSourceRect = Rectangle(Point(7, nYPos), Size(9, 9)); - break; + return impGetOrCreateTargetBitmap((1 * INDEX_COUNT) + nInd, Rectangle(Point(7, nYPos), Size(9, 9))); } case Rect_11x11: { - aSourceRect = Rectangle(Point(16, nYPos), Size(11, 11)); - break; + return impGetOrCreateTargetBitmap((2 * INDEX_COUNT) + nInd, Rectangle(Point(16, nYPos), Size(11, 11))); } case Rect_13x13: { + const sal_uInt16 nIndex((3 * INDEX_COUNT) + nInd); + switch(nInd) { - case 0: aSourceRect = Rectangle(Point(72, 66), Size(13, 13)); break; - case 1: aSourceRect = Rectangle(Point(85, 66), Size(13, 13)); break; - case 2: aSourceRect = Rectangle(Point(72, 78), Size(13, 13)); break; - case 3: aSourceRect = Rectangle(Point(85, 78), Size(13, 13)); break; - case 4: aSourceRect = Rectangle(Point(98, 78), Size(13, 13)); break; - case 5: aSourceRect = Rectangle(Point(98, 66), Size(13, 13)); break; + case 0: + { + return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(72, 66), Size(13, 13))); + } + case 1: + { + return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(85, 66), Size(13, 13))); + } + case 2: + { + return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(72, 78), Size(13, 13))); + } + case 3: + { + return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(85, 78), Size(13, 13))); + } + case 4: + { + return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(98, 78), Size(13, 13))); + } + default: // case 5: + { + return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(98, 66), Size(13, 13))); + } } - - break; } case Circ_7x7: { - aSourceRect = Rectangle(Point(27, nYPos), Size(7, 7)); - break; + return impGetOrCreateTargetBitmap((4 * INDEX_COUNT) + nInd, Rectangle(Point(27, nYPos), Size(7, 7))); } case Circ_9x9: case Customshape1: { - aSourceRect = Rectangle(Point(34, nYPos), Size(9, 9)); - break; + return impGetOrCreateTargetBitmap((5 * INDEX_COUNT) + nInd, Rectangle(Point(34, nYPos), Size(9, 9))); } case Circ_11x11: { - aSourceRect = Rectangle(Point(43, nYPos), Size(11, 11)); - break; + return impGetOrCreateTargetBitmap((6 * INDEX_COUNT) + nInd, Rectangle(Point(43, nYPos), Size(11, 11))); } case Elli_7x9: { - aSourceRect = Rectangle(Point(54, nYPos), Size(7, 9)); - break; + return impGetOrCreateTargetBitmap((7 * INDEX_COUNT) + nInd, Rectangle(Point(54, nYPos), Size(7, 9))); } case Elli_9x11: { - aSourceRect = Rectangle(Point(61, nYPos), Size(9, 11)); - break; + return impGetOrCreateTargetBitmap((8 * INDEX_COUNT) + nInd, Rectangle(Point(61, nYPos), Size(9, 11))); } case Elli_9x7: { - aSourceRect = Rectangle(Point(70, nYPos), Size(9, 7)); - break; + return impGetOrCreateTargetBitmap((9 * INDEX_COUNT) + nInd, Rectangle(Point(70, nYPos), Size(9, 7))); } case Elli_11x9: { - aSourceRect = Rectangle(Point(79, nYPos), Size(11, 9)); - break; + return impGetOrCreateTargetBitmap((10 * INDEX_COUNT) + nInd, Rectangle(Point(79, nYPos), Size(11, 9))); } case RectPlus_7x7: { - aSourceRect = Rectangle(Point(90, nYPos), Size(7, 7)); - break; + return impGetOrCreateTargetBitmap((11 * INDEX_COUNT) + nInd, Rectangle(Point(90, nYPos), Size(7, 7))); } case RectPlus_9x9: { - aSourceRect = Rectangle(Point(97, nYPos), Size(9, 9)); - break; + return impGetOrCreateTargetBitmap((12 * INDEX_COUNT) + nInd, Rectangle(Point(97, nYPos), Size(9, 9))); } case RectPlus_11x11: { - aSourceRect = Rectangle(Point(106, nYPos), Size(11, 11)); - break; + return impGetOrCreateTargetBitmap((13 * INDEX_COUNT) + nInd, Rectangle(Point(106, nYPos), Size(11, 11))); } case Crosshair: { - aSourceRect = Rectangle(Point(0, 68), Size(15, 15)); - break; + return impGetOrCreateTargetBitmap((KIND_COUNT * INDEX_COUNT) + 0, Rectangle(Point(0, 68), Size(15, 15))); } case Glue: { - aSourceRect = Rectangle(Point(15, 74), Size(9, 9)); - break; + return impGetOrCreateTargetBitmap((KIND_COUNT * INDEX_COUNT) + 1, Rectangle(Point(15, 74), Size(9, 9))); } - case Anchor: - // #101688# AnchorTR for SW + case Anchor: // #101688# AnchorTR for SW case AnchorTR: { - aSourceRect = Rectangle(Point(24, 68), Size(24, 23)); - break; + return impGetOrCreateTargetBitmap((KIND_COUNT * INDEX_COUNT) + 2, Rectangle(Point(24, 68), Size(24, 23))); } // #98388# add AnchorPressed to be able to aninate anchor control case AnchorPressed: case AnchorPressedTR: { - aSourceRect = Rectangle(Point(48, 68), Size(24, 23)); - break; + return impGetOrCreateTargetBitmap((KIND_COUNT * INDEX_COUNT) + 3, Rectangle(Point(48, 68), Size(24, 23))); } } - // construct return bitmap - BitmapEx aRetval(maMarkersBitmap); - aRetval.Crop(aSourceRect); - - return aRetval; + // cannot happen since all pathes return something; return Rect_7x7 as default (see switch) + return maRealMarkers[0]; } //////////////////////////////////////////////////////////////////////////////////////////////////// SdrHdlBitmapSet* SdrHdl::pSimpleSet = NULL; SdrHdlBitmapSet* SdrHdl::pModernSet = NULL; - -// #101928# SdrHdlBitmapSet* SdrHdl::pHighContrastSet = NULL; //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -810,7 +830,7 @@ bool SdrHdl::IsHdlHit(const Point& rPnt) const { // OVERLAYMANAGER basegfx::B2DPoint aPosition(rPnt.X(), rPnt.Y()); - return maOverlayGroup.isHit(aPosition); + return maOverlayGroup.isHitLogic(aPosition); } Pointer SdrHdl::GetPointer() const @@ -984,8 +1004,9 @@ void SdrHdlColor::CreateB2dIAObject() Bitmap aBmpCol(CreateColorDropper(aMarkerColor)); basegfx::B2DPoint aPosition(aPos.X(), aPos.Y()); ::sdr::overlay::OverlayObject* pNewOverlayObject = new - ::sdr::overlay::OverlayBitmap( - aPosition, aBmpCol, + ::sdr::overlay::OverlayBitmapEx( + aPosition, + BitmapEx(aBmpCol), (UINT16)(aBmpCol.GetSizePixel().Width() - 1) >> 1, (UINT16)(aBmpCol.GetSizePixel().Height() - 1) >> 1 ); @@ -1183,11 +1204,13 @@ void SdrHdlGradient::CreateB2dIAObject() pNewOverlayObject = new ::sdr::overlay::OverlayTriangle( - aPositionLeft, aPosition2, aPositionRight + aPositionLeft, + aPosition2, + aPositionRight, + IsGradient() ? Color(COL_BLACK) : Color(COL_BLUE) ); DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!"); - pNewOverlayObject->setBaseColor(IsGradient() ? Color(COL_BLACK) : Color(COL_BLUE)); rPageWindow.GetOverlayManager()->add(*pNewOverlayObject); maOverlayGroup.append(*pNewOverlayObject); } @@ -1331,13 +1354,6 @@ void SdrHdlLine::CreateB2dIAObject() } } -bool SdrHdlLine::IsHdlHit(const Point& rPnt) const -{ - // OVERLAYMANAGER - basegfx::B2DPoint aPosition(rPnt.X(), rPnt.Y()); - return maOverlayGroup.isHit(aPosition); -} - Pointer SdrHdlLine::GetPointer() const { return Pointer(POINTER_REFHAND); @@ -1689,7 +1705,8 @@ void ImpTextframeHdl::CreateB2dIAObject() aTopLeft, aBottomRight, aHatchCol, - 6.0, + 3.0, + 3.0, 45 * F_PI180, nDrehWink * -F_PI18000); pNewOverlayObject->setHittable(false); diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index e568e7ea93..991582d84b 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -1882,6 +1882,11 @@ uno::Reference< uno::XInterface > SdrModel::getUnoModel() return mxUnoModel; } +void SdrModel::setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel ) +{ + mxUnoModel = xModel; +} + uno::Reference< uno::XInterface > SdrModel::createUnoModel() { DBG_ERROR( "SdrModel::createUnoModel() - base implementation should not be called!" ); diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 37a7140941..d5afb80d15 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -48,26 +48,19 @@ #include <svx/svdoole2.hxx> #include <svx/xgrad.hxx> #include <svx/xflgrit.hxx> - #include "gradtrns.hxx" #include <svx/xflftrit.hxx> - #include <svx/dialmgr.hxx> #include "svdstr.hrc" #include <svx/svdundo.hxx> - -// #105722# #include <svx/svdopath.hxx> - -// #i13033# #include <svx/scene3d.hxx> - -// OD 30.06.2003 #108784# #include <svx/svdovirt.hxx> #include <svx/sdr/overlay/overlayrollingrectangle.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> #include <sdrpaintwindow.hxx> #include <svx/sdrpagewindow.hxx> +#include <svx/sdrhittesthelper.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// // predefines @@ -109,7 +102,7 @@ ImplMarkingOverlay::ImplMarkingOverlay(const SdrPaintView& rView, const basegfx: if(pTargetOverlay) { ::sdr::overlay::OverlayRollingRectangleStriped* pNew = new ::sdr::overlay::OverlayRollingRectangleStriped( - rStartPos, rStartPos, sal_False); + rStartPos, rStartPos, false); pTargetOverlay->add(*pNew); maObjects.append(*pNew); } @@ -1290,7 +1283,7 @@ BOOL SdrMarkView::IsMarkedObjHit(const Point& rPnt, short nTol) const Point aPt(rPnt); for (ULONG nm=0; nm<GetMarkedObjectCount() && !bRet; nm++) { SdrMark* pM=GetSdrMarkByIndex(nm); - bRet=ImpIsObjHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0); + bRet = 0 != CheckSingleSdrObjectHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0,0); } return bRet; } @@ -1391,7 +1384,8 @@ BOOL SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, BOOL bPrev) for (nm=nMarkAnz; nm>0 && pTopMarkHit==NULL;) { nm--; SdrMark* pM=GetSdrMarkByIndex(nm); - if (ImpIsObjHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0)) { + if(CheckSingleSdrObjectHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0,0)) + { pTopMarkHit=pM; nTopMarkHit=nm; } @@ -1407,7 +1401,8 @@ BOOL SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, BOOL bPrev) for (nm=0; nm<nMarkAnz && pBtmMarkHit==NULL; nm++) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrPageView* pPV2=pM->GetPageView(); - if (pPV2==pPV && ImpIsObjHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pPV2,0)) { + if (pPV2==pPV && CheckSingleSdrObjectHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pPV2,0,0)) + { pBtmMarkHit=pM; nBtmMarkHit=nm; } @@ -1464,7 +1459,8 @@ BOOL SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, BOOL bPrev) pObj = pObjList->GetObj(no); } - if (ImpIsObjHit(aPt,USHORT(nTol),pObj,pPV,SDRSEARCH_TESTMARKABLE)) { + if (CheckSingleSdrObjectHit(aPt,USHORT(nTol),pObj,pPV,SDRSEARCH_TESTMARKABLE,0)) + { if (TryToFindMarkedObject(pObj)==CONTAINER_ENTRY_NOTFOUND) { pFndObj=pObj; } else { @@ -1590,7 +1586,7 @@ void SdrMarkView::SetMarkHdlSizePixel(USHORT nSiz) } #define SDRSEARCH_IMPISMASTER 0x80000000 /* MasterPage wird gerade durchsucht */ -SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const +SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const { if((nOptions & SDRSEARCH_IMPISMASTER) && pObj->IsNotVisibleAsMaster()) { @@ -1636,15 +1632,13 @@ SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObject aPnt.Move( -aOffset.X(), -aOffset.Y() ); } - pRet=ImpCheckObjHit(aPnt,nTol,pOL,pPV,nOptions,pMVisLay,pTmpObj); + pRet=CheckSingleSdrObjectHit(aPnt,nTol,pOL,pPV,nOptions,pMVisLay,pTmpObj); } else { - SdrLayerID nLay=pObj->GetLayer(); - - if(pPV->GetVisibleLayers().IsSet(nLay) && (pMVisLay==NULL || pMVisLay->IsSet(nLay))) + if(!pMVisLay || pMVisLay->IsSet(pObj->GetLayer())) { - pRet=pObj->CheckHit(rPnt,nTol2,&pPV->GetVisibleLayers()); + pRet = SdrObjectPrimitiveHit(*pObj, rPnt, nTol2, *pPV, &pPV->GetVisibleLayers(), false); } } } @@ -1658,7 +1652,7 @@ SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObject return pRet; } -SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObjList* pOL, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const +SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObjList* pOL, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const { BOOL bBack=(nOptions & SDRSEARCH_BACKWARD)!=0; SdrObject* pRet=NULL; @@ -1685,7 +1679,7 @@ SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObjLis pObj = pOL->GetObj(nObjNum); } - pRet=ImpCheckObjHit(rPnt,nTol,pObj,pPV,nOptions,pMVisLay); + pRet=CheckSingleSdrObjectHit(rPnt,nTol,pObj,pPV,nOptions,pMVisLay); if (pRet!=NULL) rpRootObj=pObj; if (bBack) nObjNum++; } @@ -1733,7 +1727,7 @@ BOOL SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP SdrMark* pM=GetSdrMarkByIndex(nMrkNum); pObj=pM->GetMarkedSdrObj(); pPV=pM->GetPageView(); - pHitObj=ImpCheckObjHit(aPt,nTol,pObj,pPV,nOptions,NULL); + pHitObj=CheckSingleSdrObjectHit(aPt,nTol,pObj,pPV,nOptions,NULL); if (bBack) nMrkNum++; } } @@ -1778,7 +1772,7 @@ BOOL SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP if (pnPassNum!=NULL) *pnPassNum|=SDRSEARCHPASS_MASTERPAGE; nTmpOptions=nTmpOptions | SDRSEARCH_IMPISMASTER; } - pHitObj=ImpCheckObjHit(aPt,nTol,pObjList,pPV,nTmpOptions,pMVisLay,pObj); + pHitObj=CheckSingleSdrObjectHit(aPt,nTol,pObjList,pPV,nTmpOptions,pMVisLay,pObj); if (bBack) nPgNum++; } } @@ -1801,8 +1795,12 @@ BOOL SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP if (!pObj->HasMacro() || !pObj->IsMacroHit(aHitRec)) pObj=NULL; } if (pObj!=NULL && (nOptions & SDRSEARCH_WITHTEXT) !=0 && pObj->GetOutlinerParaObject()==NULL) pObj=NULL; - if (pObj!=NULL && (nOptions & SDRSEARCH_TESTTEXTAREA) !=0) { - if (!pObj->IsTextEditHit(aPt,0/*nTol*/,NULL)) pObj=NULL; + if (pObj!=NULL && (nOptions & SDRSEARCH_TESTTEXTAREA) !=0) + { + if(!SdrObjectPrimitiveHit(*pObj, aPt, 0, *pPV, 0, true)) + { + pObj = 0; + } } if (pObj!=NULL) { rpObj=pObj; @@ -1831,7 +1829,7 @@ BOOL SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageVie SdrMark* pM=GetSdrMarkByIndex(nMarkNum); SdrPageView* pPV=pM->GetPageView(); SdrObject* pObj=pM->GetMarkedSdrObj(); - bFnd=ImpIsObjHit(aPt,nTol,pObj,pPV,SDRSEARCH_TESTMARKABLE); + bFnd = 0 != CheckSingleSdrObjectHit(aPt,nTol,pObj,pPV,SDRSEARCH_TESTMARKABLE,0); if (bFnd) { rpObj=pObj; rpPV=pPV; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index d4e1f7f7da..f8220ad472 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -3093,10 +3093,6 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRe rTextRect=Rectangle(aTextPos,aTextSiz); } -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// - void SdrObjCustomShape::NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject) { SdrTextObj::NbcSetOutlinerParaObject( pTextObject ); @@ -3105,81 +3101,6 @@ void SdrObjCustomShape::NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject InvalidateRenderGeometry(); } -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -SdrObject* SdrObjCustomShape::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - SdrObject* pHitObj = NULL; - const SdrObject* pSdrObject = GetSdrObjectFromCustomShape(); - if ( pSdrObject ) - { - SdrObjList* pOL = pSdrObject->GetSubList(); - if ( pOL ) - { - ULONG nObjNum = pOL->GetObjCount(); - while ( ( pHitObj == NULL ) && nObjNum ) - { - nObjNum--; - SdrObject* pObj = pOL->GetObj( nObjNum ); - if ( pObj->CheckHit( rPnt, nTol, pVisiLayer ) ) - pHitObj = (SdrObject*)this; - } - } - else if ( pSdrObject->CheckHit( rPnt, nTol, pVisiLayer ) ) - pHitObj = (SdrObject*)this; - } - - if ( !pHitObj && HasText() ) - { - // paint text over object - double fTextRotation = GetExtraTextRotation(); - if ( fTextRotation != 0.0 ) - { - GeoStat aOldGeoStat( aGeo ); - Rectangle aOldRect( aRect ); - Rectangle aTextBound( aRect ); - GetTextBounds( aTextBound ); - - // determining the correct refpoint - Point aRef( aTextBound.Center() ); - Rectangle aUnrotatedSnapRect( aOutRect ); - RotatePoint( aRef, aUnrotatedSnapRect.Center(), -aGeo.nSin, -aGeo.nCos ); - - long dx = aRect.Right()-aRect.Left(); - long dy = aRect.Bottom()-aRect.Top(); - Point aP( aRect.TopLeft() ); - double sn = sin( F_PI180 * fTextRotation ); - double cs = cos( F_PI180 * fTextRotation ); - RotatePoint( aP, aRef, sn, cs ); - ((SdrObjCustomShape*)this)->aRect.Left()=aP.X(); - ((SdrObjCustomShape*)this)->aRect.Top()=aP.Y(); - ((SdrObjCustomShape*)this)->aRect.Right()=aRect.Left()+dx; - ((SdrObjCustomShape*)this)->aRect.Bottom()=aRect.Top()+dy; - if ( aGeo.nDrehWink == 0 ) - { - ((SdrObjCustomShape*)this)->aGeo.nDrehWink=NormAngle360( (sal_Int32)( fTextRotation * 100.0 ) ); - ((SdrObjCustomShape*)this)->aGeo.nSin = sn; - ((SdrObjCustomShape*)this)->aGeo.nCos = cs; - } - else - { - ((SdrObjCustomShape*)this)->aGeo.nDrehWink=NormAngle360( aGeo.nDrehWink + (sal_Int32)( fTextRotation * 100.0 ) ); - ((SdrObjCustomShape*)this)->aGeo.RecalcSinCos(); - } - pHitObj = SdrTextObj::CheckHit( rPnt, nTol, pVisiLayer ); - ((SdrObjCustomShape*)this)->aGeo = aOldGeoStat; - ((SdrObjCustomShape*)this)->aRect = aOldRect; - - } - else - pHitObj = SdrTextObj::CheckHit( rPnt, nTol, pVisiLayer ); - } - - return pHitObj; -} - void SdrObjCustomShape::operator=(const SdrObject& rObj) { SdrTextObj::operator=( rObj ); diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx index 6afdb11856..828cd948ff 100644 --- a/svx/source/svdraw/svdoattr.cxx +++ b/svx/source/svdraw/svdoattr.cxx @@ -34,7 +34,6 @@ #include <svx/svdoattr.hxx> #include <svx/xpool.hxx> #include "svditext.hxx" -#include "svdtouch.hxx" #include <svx/svdmodel.hxx> #include <svx/svdpage.hxx> #include <svx/svdattr.hxx> @@ -171,26 +170,6 @@ sal_Int32 SdrAttrObj::ImpGetLineWdt() const return nRetval; } -////////////////////////////////////////////////////////////////////////////// - -FASTBOOL SdrAttrObj::ImpGetShadowDist(sal_Int32& nXDist, sal_Int32& nYDist) const -{ - const SfxItemSet& rSet = GetMergedItemSet(); - - nXDist = 0L; - nYDist = 0L; - - BOOL bShadOn = ((SdrShadowItem&)(rSet.Get(SDRATTR_SHADOW))).GetValue(); - if(bShadOn) - { - nXDist = ((SdrShadowXDistItem&)(rSet.Get(SDRATTR_SHADOWXDIST))).GetValue(); - nYDist = ((SdrShadowYDistItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue(); - return TRUE; - } - - return FALSE; -} - BOOL SdrAttrObj::HasFill() const { return bClosedObj && ((XFillStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_FILLSTYLE))).GetValue()!=XFILL_NONE; diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 0935adba4f..ae5686b2c6 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -127,6 +127,11 @@ #include <svx/polysc3d.hxx> #include "svx/svdotable.hxx" #include "svx/shapepropertynotifier.hxx" +#include <svx/sdrhittesthelper.hxx> + +// --> OD 2009-07-10 #i73249# +#include <svx/svdundo.hxx> +// <-- using namespace ::com::sun::star; @@ -175,8 +180,15 @@ FASTBOOL SdrObjUserData::HasMacro(const SdrObject* /*pObj*/) const SdrObject* SdrObjUserData::CheckMacroHit(const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const { - if (pObj==NULL) return NULL; - return pObj->CheckHit(rRec.aPos,rRec.nTol,rRec.pVisiLayer); + if(pObj) + { + if(rRec.pPageView) + { + return SdrObjectPrimitiveHit(*pObj, rRec.aPos, rRec.nTol, *rRec.pPageView, rRec.pVisiLayer, false); + } + } + + return 0; } Pointer SdrObjUserData::GetMacroPointer(const SdrObjMacroHitRec& /*rRec*/, const SdrObject* /*pObj*/) const @@ -186,7 +198,7 @@ Pointer SdrObjUserData::GetMacroPointer(const SdrObjMacroHitRec& /*rRec*/, const void SdrObjUserData::PaintMacro(OutputDevice& rOut, const Rectangle& /*rDirtyRect*/, const SdrObjMacroHitRec& /*rRec*/, const SdrObject* pObj) const { - if(!pObj) + if(!pObj) return; const RasterOp eRop(rOut.GetRasterOp()); @@ -197,7 +209,7 @@ void SdrObjUserData::PaintMacro(OutputDevice& rOut, const Rectangle& /*rDirtyRec rOut.SetFillColor(); rOut.SetRasterOp(ROP_INVERT); - for(sal_uInt32 a(0); a < nCount; a++) + for(sal_uInt32 a(0); a < nCount; a++) { rOut.DrawPolyLine(aPolyPolygon.getB2DPolygon(a)); } @@ -751,7 +763,29 @@ void SdrObject::SetName(const String& rStr) if(pPlusData && pPlusData->aObjName != rStr) { + // --> OD 2009-07-09 #i73249# + // Undo/Redo for setting object's name + bool bUndo( false ); + if ( GetModel() && GetModel()->IsUndoEnabled() ) + { + bUndo = true; + SdrUndoAction* pUndoAction = + GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr( + *this, + SdrUndoObjStrAttr::OBJ_NAME, + GetName(), + rStr ); + GetModel()->BegUndo( pUndoAction->GetComment() ); + GetModel()->AddUndo( pUndoAction ); + } + // <-- pPlusData->aObjName = rStr; + // --> OD 2009-07-09 #i73249# + if ( bUndo ) + { + GetModel()->EndUndo(); + } + // <-- SetChanged(); BroadcastObjectChange(); } @@ -759,7 +793,7 @@ void SdrObject::SetName(const String& rStr) String SdrObject::GetName() const { - if(pPlusData) + if(pPlusData) { return pPlusData->aObjName; } @@ -776,7 +810,29 @@ void SdrObject::SetTitle(const String& rStr) if(pPlusData && pPlusData->aObjTitle != rStr) { + // --> OD 2009-07-13 #i73249# + // Undo/Redo for setting object's title + bool bUndo( false ); + if ( GetModel() && GetModel()->IsUndoEnabled() ) + { + bUndo = true; + SdrUndoAction* pUndoAction = + GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr( + *this, + SdrUndoObjStrAttr::OBJ_TITLE, + GetTitle(), + rStr ); + GetModel()->BegUndo( pUndoAction->GetComment() ); + GetModel()->AddUndo( pUndoAction ); + } + // <-- pPlusData->aObjTitle = rStr; + // --> OD 2009-07-13 #i73249# + if ( bUndo ) + { + GetModel()->EndUndo(); + } + // <-- SetChanged(); BroadcastObjectChange(); } @@ -784,7 +840,7 @@ void SdrObject::SetTitle(const String& rStr) String SdrObject::GetTitle() const { - if(pPlusData) + if(pPlusData) { return pPlusData->aObjTitle; } @@ -801,7 +857,29 @@ void SdrObject::SetDescription(const String& rStr) if(pPlusData && pPlusData->aObjDescription != rStr) { + // --> OD 2009-07-13 #i73249# + // Undo/Redo for setting object's description + bool bUndo( false ); + if ( GetModel() && GetModel()->IsUndoEnabled() ) + { + bUndo = true; + SdrUndoAction* pUndoAction = + GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr( + *this, + SdrUndoObjStrAttr::OBJ_DESCRIPTION, + GetDescription(), + rStr ); + GetModel()->BegUndo( pUndoAction->GetComment() ); + GetModel()->AddUndo( pUndoAction ); + } + // <-- pPlusData->aObjDescription = rStr; + // --> OD 2009-07-13 #i73249# + if ( bUndo ) + { + GetModel()->EndUndo(); + } + // <-- SetChanged(); BroadcastObjectChange(); } @@ -809,7 +887,7 @@ void SdrObject::SetDescription(const String& rStr) String SdrObject::GetDescription() const { - if(pPlusData) + if(pPlusData) { return pPlusData->aObjDescription; } @@ -882,11 +960,11 @@ void SdrObject::SetNavigationPosition (const sal_uInt32 nNewPosition) // GetCurrentBoundRect(). const Rectangle& SdrObject::GetCurrentBoundRect() const { - if(aOutRect.IsEmpty()) + if(aOutRect.IsEmpty()) { const_cast< SdrObject* >(this)->RecalcBoundRect(); } - + return aOutRect; } @@ -902,8 +980,12 @@ const Rectangle& SdrObject::GetLastBoundRect() const void SdrObject::RecalcBoundRect() { + // #i101680# suppress BoundRect calculations on import(s) + if(pModel && pModel->isLocked() ) + return; + // central new method which will calculate the BoundRect using primitive geometry - if(aOutRect.IsEmpty()) + if(aOutRect.IsEmpty()) { const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(GetViewContact().getViewIndependentPrimitive2DSequence()); @@ -916,7 +998,7 @@ void SdrObject::RecalcBoundRect() if(!aRange.isEmpty()) { aOutRect = Rectangle( - (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()), + (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()), (sal_Int32)ceil(aRange.getMaxX()), (sal_Int32)ceil(aRange.getMaxY())); return; } @@ -982,19 +1064,6 @@ BOOL SdrObject::LineGeometryUsageIsNecessary() const return (eXLS != XLINE_NONE); } -SdrObject* SdrObject::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - return 0L; - } - - Rectangle aO(GetCurrentBoundRect()); - aO.Left()-=nTol; aO.Top()-=nTol; aO.Right()+=nTol; aO.Bottom()+=nTol; - FASTBOOL bRet=aO.IsInside(rPnt); - return bRet ? (SdrObject*)this : NULL; -} - SdrObject* SdrObject::Clone() const { SdrObject* pObj=SdrObjFactory::MakeNewObject(GetObjInventor(),GetObjIdentifier(),NULL); @@ -1129,7 +1198,7 @@ basegfx::B2DPolyPolygon SdrObject::TakeContour() const { basegfx::B2DPolyPolygon aRetval; - // create cloned object without text, but with XLINE_SOLID, + // create cloned object without text, but with XLINE_SOLID, // COL_BLACK as line color and XFILL_NONE SdrObject* pClone = Clone(); @@ -1166,6 +1235,11 @@ basegfx::B2DPolyPolygon SdrObject::TakeContour() const SfxItemSet aNewSet(*GetObjectItemPool()); + // #i101980# ignore LineWidth; that's what the old implementation + // did. With linewidth, the result may be huge due to fat/thick + // line decompositions + aNewSet.Put(XLineWidthItem(0)); + // solid black lines and no fill aNewSet.Put(XLineStyleItem(XLINE_SOLID)); aNewSet.Put(XLineColorItem(String(), Color(COL_BLACK))); @@ -1344,8 +1418,8 @@ bool SdrObject::beginSpecialDrag(SdrDragStat& rDrag) const SdrHdlKind eHdl = (pHdl == NULL) ? HDL_MOVE : pHdl->GetKind(); if(eHdl==HDL_UPLFT || eHdl==HDL_UPPER || eHdl==HDL_UPRGT || - eHdl==HDL_LEFT || eHdl==HDL_RIGHT || eHdl==HDL_LWLFT || - eHdl==HDL_LOWER || eHdl==HDL_LWRGT) + eHdl==HDL_LEFT || eHdl==HDL_RIGHT || eHdl==HDL_LWLFT || + eHdl==HDL_LOWER || eHdl==HDL_LWRGT) { return true; } @@ -1357,11 +1431,11 @@ bool SdrObject::applySpecialDrag(SdrDragStat& rDrag) { Rectangle aNewRect(ImpDragCalcRect(rDrag)); - if(aNewRect != GetSnapRect()) + if(aNewRect != GetSnapRect()) { NbcSetSnapRect(aNewRect); } - + return true; } @@ -1393,8 +1467,15 @@ FASTBOOL SdrObject::MovCreate(SdrDragStat& rStat) rStat.TakeCreateRect(aOutRect); rStat.SetActionRect(aOutRect); aOutRect.Justify(); - SetBoundRectDirty(); - bSnapRectDirty=TRUE; + + // #i101648# for naked (non-derived) SdrObjects, do not invalidate aOutRect + // by calling SetBoundRectDirty(); aOutRect IS the geometry for such objects. + // No derivation implementation calls the parent implementation, so this will + // cause no further prolems + // + // SetBoundRectDirty(); + // bSnapRectDirty=TRUE; + return TRUE; } @@ -1402,7 +1483,11 @@ FASTBOOL SdrObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) { rStat.TakeCreateRect(aOutRect); aOutRect.Justify(); - SetRectsDirty(); + + // #i101648# see description at MovCreate + // + // SetRectsDirty(); + return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2); } @@ -1730,11 +1815,6 @@ FASTBOOL SdrObject::HasTextEdit() const return FALSE; } -SdrObject* SdrObject::CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - return CheckHit(rPnt,nTol,pVisiLayer); -} - sal_Bool SdrObject::BegTextEdit(SdrOutliner& /*rOutl*/) { return FALSE; @@ -1806,11 +1886,19 @@ FASTBOOL SdrObject::HasMacro() const SdrObject* SdrObject::CheckMacroHit(const SdrObjMacroHitRec& rRec) const { - SdrObjUserData* pData=ImpGetMacroUserData(); - if (pData!=NULL) { - return pData->CheckMacroHit(rRec,this); + SdrObjUserData* pData = ImpGetMacroUserData(); + + if(pData) + { + return pData->CheckMacroHit(rRec, this); } - return CheckHit(rRec.aPos,rRec.nTol,rRec.pVisiLayer); + + if(rRec.pPageView) + { + return SdrObjectPrimitiveHit(*this, rRec.aPos, rRec.nTol, *rRec.pPageView, rRec.pVisiLayer, false); + } + + return 0; } Pointer SdrObject::GetMacroPointer(const SdrObjMacroHitRec& rRec) const @@ -1825,12 +1913,12 @@ Pointer SdrObject::GetMacroPointer(const SdrObjMacroHitRec& rRec) const void SdrObject::PaintMacro(OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const { SdrObjUserData* pData=ImpGetMacroUserData(); - - if(pData) + + if(pData) { pData->PaintMacro(rOut,rDirtyRect,rRec,this); - } - else + } + else { const RasterOp eRop(rOut.GetRasterOp()); const basegfx::B2DPolyPolygon aPolyPolygon(TakeXorPoly()); @@ -1840,7 +1928,7 @@ void SdrObject::PaintMacro(OutputDevice& rOut, const Rectangle& rDirtyRect, cons rOut.SetFillColor(); rOut.SetRasterOp(ROP_INVERT); - for(sal_uInt32 a(0); a < nCount; a++) + for(sal_uInt32 a(0); a < nCount; a++) { rOut.DrawPolyLine(aPolyPolygon.getB2DPolygon(a)); } @@ -2251,8 +2339,8 @@ SdrGluePoint SdrObject::GetVertexGluePoint(USHORT nPosNum) const // #i41936# Use SnapRect for default GluePoints const Rectangle aR(GetSnapRect()); Point aPt; - - switch(nPosNum) + + switch(nPosNum) { case 0 : aPt = aR.TopCenter(); break; case 1 : aPt = aR.RightCenter(); break; @@ -2374,8 +2462,8 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas if(pRet->LineGeometryUsageIsNecessary()) { - basegfx::B2DPolyPolygon aAreaPolyPolygon; - basegfx::B2DPolyPolygon aLinePolyPolygon; + basegfx::B2DPolyPolygon aMergedLineFillPolyPolygon; + basegfx::B2DPolyPolygon aMergedHairlinePolyPolygon; const drawinglayer::primitive2d::Primitive2DSequence xSequence(pRet->GetViewContact().getViewIndependentPrimitive2DSequence()); if(xSequence.hasElements()) @@ -2386,37 +2474,32 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas // create extractor, process and get result drawinglayer::processor2d::LineGeometryExtractor2D aExtractor(aViewInformation2D); aExtractor.process(xSequence); - - aAreaPolyPolygon = aExtractor.getExtractedLineFills(); - aLinePolyPolygon = aExtractor.getExtractedHairlines(); - } - // Since this may in some cases lead to a count of 0 after - // the merge i moved the merge to the front. - if(aAreaPolyPolygon.count()) - { - // bezier geometry got created, even for straight edges since the given - // object is a result of DoConvertToPolyObj. For conversion to contour - // this is not really needed and can be reduced again AFAP - aAreaPolyPolygon = basegfx::tools::simplifyCurveSegments(aAreaPolyPolygon); + // #i102241# check for line results + const std::vector< basegfx::B2DPolygon >& rHairlineVector = aExtractor.getExtractedHairlines(); + + if(rHairlineVector.size()) + { + // for SdrObject creation, just copy all to a single Hairline-PolyPolygon + for(sal_uInt32 a(0); a < rHairlineVector.size(); a++) + { + aMergedHairlinePolyPolygon.append(rHairlineVector[a]); + } + } - // merge all to a decent result (try to use AND, but remember original) - const basegfx::B2DPolyPolygon aTemp(aAreaPolyPolygon); - aAreaPolyPolygon = basegfx::tools::solveCrossovers(aAreaPolyPolygon); - aAreaPolyPolygon = basegfx::tools::stripNeutralPolygons(aAreaPolyPolygon); - aAreaPolyPolygon = basegfx::tools::stripDispensablePolygons(aAreaPolyPolygon, false); + // #i102241# check for fill rsults + const std::vector< basegfx::B2DPolyPolygon >& rLineFillVector(aExtractor.getExtractedLineFills()); - if(!aAreaPolyPolygon.count()) + if(rLineFillVector.size()) { - // OOps, AND is empty, this means there were no overlapping parts. Use - // remembered parts as result - aAreaPolyPolygon = aTemp; + // merge to a single PolyPolygon (OR) + aMergedLineFillPolyPolygon = basegfx::tools::mergeToSinglePolyPolygon(rLineFillVector); } } - // || aLinePolyPolygon.Count() removed; the conversion is ONLY + // || aMergedHairlinePolyPolygon.Count() removed; the conversion is ONLY // useful when new closed filled polygons are created - if(aAreaPolyPolygon.count() || (bForceLineDash && aLinePolyPolygon.count())) + if(aMergedLineFillPolyPolygon.count() || (bForceLineDash && aMergedHairlinePolyPolygon.count())) { SfxItemSet aSet(pRet->GetMergedItemSet()); XFillStyle eOldFillStyle = ((const XFillStyleItem&)(aSet.Get(XATTR_FILLSTYLE))).GetValue(); @@ -2424,10 +2507,10 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas SdrPathObj* aLineHairlinePart = NULL; bool bBuildGroup(false); - if(aAreaPolyPolygon.count()) + if(aMergedLineFillPolyPolygon.count()) { // create SdrObject for filled line geometry - aLinePolygonPart = new SdrPathObj(OBJ_PATHFILL, aAreaPolyPolygon); + aLinePolygonPart = new SdrPathObj(OBJ_PATHFILL, aMergedLineFillPolyPolygon); aLinePolygonPart->SetModel(pRet->GetModel()); // correct item properties @@ -2442,13 +2525,13 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas aLinePolygonPart->SetMergedItemSet(aSet); } - if(aLinePolyPolygon.count()) + if(aMergedHairlinePolyPolygon.count()) { // create SdrObject for hairline geometry // OBJ_PATHLINE is necessary here, not OBJ_PATHFILL. This is intended // to get a non-filled object. If the poly is closed, the PathObj takes care for // the correct closed state. - aLineHairlinePart = new SdrPathObj(OBJ_PATHLINE, aLinePolyPolygon); + aLineHairlinePart = new SdrPathObj(OBJ_PATHLINE, aMergedHairlinePolyPolygon); aLineHairlinePart->SetModel(pRet->GetModel()); aSet.Put(XLineWidthItem(0L)); @@ -2569,8 +2652,8 @@ SdrObject* SdrObject::ConvertToContourObj(SdrObject* pRet, BOOL bForceLineDash) { SdrPathObj* pPathObj = (SdrPathObj*)pRet; - // bezier geometry got created, even for straight edges since the given - // object is a result of DoConvertToPolyObj. For conversion to contour + // bezier geometry got created, even for straight edges since the given + // object is a result of DoConvertToPolyObj. For conversion to contour // this is not really needed and can be reduced again AFAP pPathObj->SetPathPoly(basegfx::tools::simplifyCurveSegments(pPathObj->GetPathPoly())); } @@ -2850,8 +2933,8 @@ void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUn { maWeakUnoShape = _rxUnoShape; mpSvxShape = SvxShape::getImplementation( _rxUnoShape ); - OSL_ENSURE( mpSvxShape || !_rxUnoShape.is(), - "SdrObject::setUnoShape: not sure it's a good idea to have an XShape which is not implemented by SvxShape ..." ); +// OSL_ENSURE( mpSvxShape || !_rxUnoShape.is(), +// "SdrObject::setUnoShape: not sure it's a good idea to have an XShape which is not implemented by SvxShape ..." ); } /** only for internal use! */ @@ -2974,7 +3057,7 @@ sal_Bool SdrObject::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B // build matrix rMatrix.identity(); - + if(1.0 != aScale.getX() || 1.0 != aScale.getY()) { rMatrix.scale(aScale.getX(), aScale.getY()); diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index a39926d84f..29488fc407 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -40,7 +40,6 @@ #include <svx/svdpool.hxx> #include <svx/svdetc.hxx> #include <svx/svdtrans.hxx> -#include "svdtouch.hxx" #include <svx/svdhdl.hxx> #include <svx/svddrag.hxx> #include <svx/svdmodel.hxx> @@ -61,6 +60,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <svx/sdrhittesthelper.hxx> // #i32599# inline double ImplTwipsToMM(double fVal) { return (fVal * (127.0 / 72.0)); } @@ -253,31 +253,6 @@ UINT16 SdrCaptionObj::GetObjIdentifier() const return UINT16(OBJ_CAPTION); } -SdrObject* SdrCaptionObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - return NULL; - } - - sal_Bool bHit(SdrRectObj::CheckHit(rPnt,nTol,pVisiLayer) != NULL); - if (!bHit) { - INT32 nMyTol=nTol; - INT32 nWdt = ((XLineWidthItem&)(GetObjectItem(XATTR_LINEWIDTH))).GetValue(); - nWdt++; - nWdt /= 2; - - if (nWdt>nMyTol) nMyTol=nWdt; // Bei dicker Linie keine Toleranz noetig - Rectangle aR(rPnt,rPnt); - aR.Left() -=nMyTol; - aR.Right() +=nMyTol; - aR.Top() -=nMyTol; - aR.Bottom()+=nMyTol; - bHit = IsRectTouchesLine(aTailPoly,aR); - } - return bHit ? (SdrObject*)this : NULL; -} - void SdrCaptionObj::operator=(const SdrObject& rObj) { SdrRectObj::operator=(rObj); @@ -377,8 +352,10 @@ bool SdrCaptionObj::beginSpecialDrag(SdrDragStat& rDrag) const Point aHit(rDrag.GetStart()); - if(SdrRectObj::CheckHit(aHit, 0, NULL)) + if(rDrag.GetPageView() && SdrObjectPrimitiveHit(*this, aHit, 0, *rDrag.GetPageView(), 0, false)) + { return true; + } } else { diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 251cbe6daf..b37e327ed1 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -40,7 +40,6 @@ #include <svx/svdocirc.hxx> #include <math.h> #include <svx/xpool.hxx> -#include "svdtouch.hxx" #include <svx/svdattr.hxx> #include <svx/svdpool.hxx> #include <svx/svdattrx.hxx> @@ -312,127 +311,6 @@ void SdrCircObj::RecalcXPoly() mpXPoly = new XPolygon(aPolyCirc); } -SdrObject* SdrCircObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - return NULL; - } - - Point aPt(rPnt); - Point aZero; - aPt.X()-=aRect.Left(); - aPt.Y()-=aRect.Top(); - - INT32 nMyTol=nTol; - FASTBOOL bFilled=meCircleKind!=OBJ_CARC && (bTextFrame || HasFill()); - - INT32 nWdt=ImpGetLineWdt()/2; // Halbe Strichstaerke - long nBoundWdt=aRect.GetWidth()-1; - long nBoundHgt=aRect.GetHeight()-1; - if (meCircleKind==OBJ_SECT) { - long nTmpWink=NormAngle360(nEndWink-nStartWink); - if (nTmpWink<9000) { - nBoundWdt=0; - nBoundHgt=0; - } else if (nTmpWink<27000) { - nBoundWdt/=2; - nBoundHgt/=2; - } - } - if (bFilled && nBoundWdt>short(nTol) && nBoundHgt>short(nTol) && Abs(aGeo.nShearWink)<=4500) nMyTol=0; // Keine Toleranz noetig hier - if (nWdt>nMyTol) nMyTol=nWdt; // Bei dicker Umrandung keine Toleranz noetig - - // Den uebergebenen Punkt auf den gedrehten, geshearten Kreis transformieren - // Unrotate: - if (aGeo.nDrehWink!=0) RotatePoint(aPt,aZero,-aGeo.nSin,aGeo.nCos); // -sin fuer Umkehrung - // Unshear: - if (aGeo.nShearWink!=0) ShearPoint(aPt,aZero,-aGeo.nTan); // -tan fuer Umkehrung - - long nXRad=aRect.GetWidth()/2; if (nXRad<1) nXRad=1; - long nYRad=aRect.GetHeight()/2; if (nYRad<1) nYRad=1; - - // Die wirklichen Radien fuer spaeter merken - long nXRadReal=nXRad; - long nYRadReal=nYRad; - aPt.X()-=nXRad; - aPt.Y()-=nYRad; - Point aPtNoStretch(aPt); - - if (nXRad>nYRad) { - aPt.Y()=BigMulDiv(aPt.Y(),nXRad,nYRad); - // Da die Strichstaerke bei Ellipsen ueberall gleich ist: - if (Abs(aPt.X())<Abs(aPt.Y())) { - nMyTol=BigMulDiv(nMyTol,nXRad,nYRad); - } - nYRad=nXRad; - } - if (nYRad>nXRad) { - aPt.X()=BigMulDiv(aPt.X(),nYRad,nXRad); - // Da die Strichstaerke bei Ellipsen ueberall gleich ist: - if (Abs(aPt.Y())<Abs(aPt.X())) { - nMyTol=BigMulDiv(nMyTol,nYRad,nXRad); - } - nXRad=nYRad; - } - - // Die BigInts haben bei *= leider ein Vorzeichenproblem (a*=a;) - // (SV250A), deshalb hier soviele Instanzen. (JOE) - long nAussen=nXRad+nMyTol; - BigInt nBigTmpA(nAussen); - BigInt nAusRadQ(nBigTmpA*nBigTmpA); - long nInnen=nXRad-nMyTol; if (nInnen<=0) nInnen=0; - BigInt nBigTmpI(nInnen); - // wird sonst nicht benoetigt, ggf. BugMul sparen: - BigInt nInnRadQ((!bFilled && nInnen!=0) ? nBigTmpI*nBigTmpI : nBigTmpI); - - // Radius von aPt berechnen - BigInt nBigTmpX(aPt.X()); - BigInt nBigTmpY(aPt.Y()); - BigInt nPntRadQ(nBigTmpX*nBigTmpX+nBigTmpY*nBigTmpY); - - sal_Bool bRet(sal_False); - if (nPntRadQ<=nAusRadQ) { // sonst ausserhalb - if (nInnen==0) bRet = sal_True; - else if (meCircleKind==OBJ_CIRC) { // Vollkreis - if (bFilled) bRet = sal_True; - else if (nPntRadQ>=nInnRadQ) bRet = sal_True; - } else { // Teilkreise - long nWink=NormAngle360(GetAngle(aPt)); - long a=nStartWink; - long e=nEndWink; - if (e<a) e+=36000; - if (nWink<a) nWink+=36000; - if (nWink>=a && nWink<=e) { - if (bFilled) bRet = sal_True; - else if (nPntRadQ>=nInnRadQ) bRet = sal_True; - } - if (!bRet) { - Rectangle aR(aPtNoStretch.X()-nMyTol,aPtNoStretch.Y()-nMyTol, - aPtNoStretch.X()+nMyTol,aPtNoStretch.Y()+nMyTol); - Point aP1(GetWinkPnt(aRect,nStartWink)); - aP1.X()-=aRect.Left()+nXRadReal; - aP1.Y()-=aRect.Top()+nYRadReal; - Point aP2(GetWinkPnt(aRect,nEndWink)); - aP2.X()-=aRect.Left()+nXRadReal; - aP2.Y()-=aRect.Top()+nYRadReal; - if (meCircleKind==OBJ_SECT) { // Kreissektor: nur noch die beiden Strecken testen - bRet=IsRectTouchesLine(aZero,aP1,aR) || IsRectTouchesLine(aZero,aP2,aR); - } - if (meCircleKind==OBJ_CCUT) { // Kreisabschnitt noch die Sehne und die MaeuseEcke (Dreieck) testen - if (IsRectTouchesLine(aP1,aP2,aR)) bRet = sal_True; // die Sehne - else if (bFilled) { // und nun die Maeusescke - const Polygon aPoly(GetXPoly().getB2DPolygon().getDefaultAdaptiveSubdivision()); - bRet=IsPointInsidePoly(aPoly,rPnt); - } - } - } - } - } - if (!bRet && HasText()) bRet=SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer)!=NULL; - return bRet ? (SdrObject*)this : NULL; -} - void SdrCircObj::TakeObjNameSingul(XubString& rName) const { USHORT nID=STR_ObjNameSingulCIRC; diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index ef999fa9f6..002a0773b4 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -44,7 +44,6 @@ #include <svx/svddrgv.hxx> #include "svddrgm1.hxx" #include <svx/svdhdl.hxx> -#include "svdtouch.hxx" #include <svx/svdtrans.hxx> #include <svx/svdetc.hxx> #include "svdglob.hxx" // StringCache @@ -58,6 +57,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdrhittesthelper.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -417,30 +417,6 @@ void SdrEdgeObj::TakeUnrotatedSnapRect(Rectangle& rRect) const rRect=GetSnapRect(); } -SdrObject* SdrEdgeObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - return NULL; - } - - INT32 nMyTol=nTol; - INT32 nWdt=ImpGetLineWdt()/2; // Halbe Strichstaerke - if (nWdt>nMyTol) nMyTol=nWdt; // Bei dicker Linie keine Toleranz noetig - Rectangle aR(rPnt,rPnt); - aR.Left() -=nMyTol; - aR.Right() +=nMyTol; - aR.Top() -=nMyTol; - aR.Bottom()+=nMyTol; - - sal_Bool bHit(sal_False); - - const Polygon aPoly(pEdgeTrack->getB2DPolygon().getDefaultAdaptiveSubdivision()); - bHit = IsRectTouchesLine(aPoly,aR); - if (!bHit && HasText()) bHit = SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer)!=NULL; - return bHit ? (SdrObject*)this : NULL; -} - FASTBOOL SdrEdgeObj::IsNode() const { return TRUE; @@ -2134,7 +2110,8 @@ FASTBOOL SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, USHORT nGesAnz=nConAnz+9; FASTBOOL bUserFnd=FALSE; ULONG nBestDist=0xFFFFFFFF; - for (USHORT i=0; i<nGesAnz; i++) { + for (USHORT i=0; i<nGesAnz; i++) + { FASTBOOL bUser=i<nConAnz; FASTBOOL bVertex=i>=nConAnz+0 && i<nConAnz+4; FASTBOOL bCorner=i>=nConAnz+4 && i<nConAnz+8; @@ -2191,7 +2168,9 @@ FASTBOOL SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, } // Falls kein Konnektor getroffen wird nochmal // HitTest versucht fuer BestConnector (=bCenter) - if (!bFnd && !bEdge && pObj->IsHit(rPt,nBoundHitTol,&rVisLayer)) + if(!bFnd && + !bEdge && + SdrObjectPrimitiveHit(*pObj, rPt, nBoundHitTol, rPV, &rVisLayer, false)) { // #109007# // Suppress default connect at object inside bound diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index a7e9d7e67f..67d02ac706 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -581,13 +581,6 @@ sal_Bool SdrGrafObj::ImpUpdateGraphicLink() const // ----------------------------------------------------------------------------- -SdrObject* SdrGrafObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - return ImpCheckHit( rPnt, nTol, pVisiLayer, TRUE ); -} - -// ----------------------------------------------------------------------------- - void SdrGrafObj::TakeObjNameSingul(XubString& rName) const { switch( pGraphic->GetType() ) @@ -666,6 +659,23 @@ void SdrGrafObj::TakeObjNamePlural( XubString& rName ) const // ----------------------------------------------------------------------------- +SdrObject* SdrGrafObj::getFullDragClone() const +{ + // call parent + SdrGrafObj* pRetval = static_cast< SdrGrafObj* >(SdrRectObj::getFullDragClone()); + + // #i103116# the full drag clone leads to problems + // with linked graphics, so reset the link in this + // temporary interaction object and load graphic + if(pRetval && IsLinkedGraphic()) + { + pRetval->ForceSwapIn(); + pRetval->ReleaseGraphicLink(); + } + + return pRetval; +} + void SdrGrafObj::operator=( const SdrObject& rObj ) { SdrRectObj::operator=( rObj ); @@ -1097,6 +1107,14 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO ) pRet = GRFMGR_AUTOSWAPSTREAM_TEMP; pGraphic->SetUserData(); } + + // #i102380# + sdr::contact::ViewContactOfGraphic* pVC = dynamic_cast< sdr::contact::ViewContactOfGraphic* >(&GetViewContact()); + + if(pVC) + { + pVC->flushGraphicObjects(); + } } } } diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index b8822b5ad8..d1966d1bfc 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -295,32 +295,6 @@ const Rectangle& SdrObjGroup::GetSnapRect() const // <-- } -SdrObject* SdrObjGroup::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - if (pSub->GetObjCount()!=0) { - return pSub->CheckHit(rPnt,nTol,pVisiLayer); - } else { // ansonsten ist es eine leere Gruppe - if(!pVisiLayer || pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - Rectangle aAussen(aOutRect); - aAussen.Top() -=nTol; - aAussen.Left() -=nTol; - aAussen.Bottom()+=nTol; - aAussen.Right() +=nTol; - nTol++; - Rectangle aInnen(aOutRect); - aInnen.Top() +=nTol; - aInnen.Left() +=nTol; - aInnen.Bottom()-=nTol; - aInnen.Right() -=nTol; - if (aAussen.IsInside(rPnt) && !aInnen.IsInside(rPnt)) { - return (SdrObject*)this; - } - } - } - return NULL; -} - void SdrObjGroup::operator=(const SdrObject& rObj) { if(rObj.IsGroupObject()) diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 51ada515a3..975d5dea92 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -36,7 +36,6 @@ #include "svditext.hxx" // #include <svx/xpoly.hxx> #include <svx/svdtrans.hxx> -#include "svdtouch.hxx" #include <svx/svdhdl.hxx> #include <svx/svdoutl.hxx> #include <svx/svddrag.hxx> @@ -766,37 +765,6 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const } } -SdrObject* SdrMeasureObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - return NULL; - } - - sal_Bool bHit(sal_False); - INT32 nMyTol=nTol; - INT32 nWdt=ImpGetLineWdt()/2; // Halbe Strichstaerke - if (nWdt>nMyTol) nMyTol=nWdt; // Bei dicker Linie keine Toleranz noetig - Rectangle aR(rPnt,rPnt); - aR.Left() -=nMyTol; - aR.Right() +=nMyTol; - aR.Top() -=nMyTol; - aR.Bottom()+=nMyTol; - - if (bTextDirty) UndirtyText(); - ImpMeasureRec aRec; - ImpMeasurePoly aMPol; - ImpTakeAttr(aRec); - ImpCalcGeometrics(aRec,aMPol); - bHit=IsRectTouchesLine(aMPol.aMainline1.aP1,aMPol.aMainline1.aP2,aR) || - IsRectTouchesLine(aMPol.aMainline2.aP1,aMPol.aMainline2.aP2,aR) || - IsRectTouchesLine(aMPol.aHelpline1.aP1,aMPol.aHelpline1.aP2,aR) || - IsRectTouchesLine(aMPol.aHelpline2.aP1,aMPol.aHelpline2.aP2,aR); - // und nun noch ggf. den Textbereich checken - bHit=bHit || SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer)!=NULL; - return bHit ? (SdrObject*)this : NULL; -} - void SdrMeasureObj::operator=(const SdrObject& rObj) { SdrTextObj::operator=(rObj); @@ -1381,12 +1349,6 @@ void SdrMeasureObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle SdrTextObj::TakeTextEditArea(pPaperMin,pPaperMax,pViewInit,pViewMin); } -SdrObject* SdrMeasureObj::CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - if (bTextDirty) UndirtyText(); - return SdrTextObj::CheckTextEditHit(rPnt,nTol,pVisiLayer); -} - USHORT SdrMeasureObj::GetOutlinerViewAnchorMode() const { if (bTextDirty) UndirtyText(); diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index dfd1ac243c..37281e107b 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -279,7 +279,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj Size aScaledSize( static_cast< long >( m_aScaleWidth * Fraction( aVisArea.GetWidth() ) ), static_cast< long >( m_aScaleHeight * Fraction( aVisArea.GetHeight() ) ) ); Rectangle aLogicRect( mpObj->GetLogicRect() ); - + // react to the change if the difference is bigger than one pixel Size aPixelDiff = Application::GetDefaultDevice()->LogicToPixel( @@ -398,7 +398,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::activatingUI() uno::Reference < frame::XFramesSupplier > xParentFrame( xOwnFrame->getCreator(), uno::UNO_QUERY ); if ( xParentFrame.is() ) xParentFrame->setActiveFrame( xOwnFrame ); - + OLEObjCache& rObjCache = GetSdrGlobalData().GetOLEObjCache(); const ULONG nCount = rObjCache.Count(); for(sal_Int32 i = nCount-1 ; i >= 0;--i) @@ -471,7 +471,7 @@ uno::Reference< ::com::sun::star::frame::XLayoutManager > SAL_CALL SdrLightEmbed { throw uno::RuntimeException(); } - + return xMan; } @@ -1094,7 +1094,7 @@ void SdrOle2Obj::Connect_Impl() if ( pPers ) { comphelper::EmbeddedObjectContainer& rContainer = pPers->getEmbeddedObjectContainer(); - if ( !rContainer.HasEmbeddedObject( mpImpl->aPersistName ) + if ( !rContainer.HasEmbeddedObject( mpImpl->aPersistName ) || ( xObjRef.is() && !rContainer.HasEmbeddedObject( xObjRef.GetObject() ) ) ) { // object not known to container document @@ -1578,13 +1578,6 @@ UINT16 SdrOle2Obj::GetObjIdentifier() const // ----------------------------------------------------------------------------- -SdrObject* SdrOle2Obj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - return ImpCheckHit(rPnt,nTol,pVisiLayer,TRUE,TRUE); -} - -// ----------------------------------------------------------------------------- - void SdrOle2Obj::TakeObjNameSingul(XubString& rName) const { rName = ImpGetResStr(bFrame ? STR_ObjNameSingulFrame : STR_ObjNameSingulOLE2); @@ -2215,82 +2208,7 @@ sal_Bool SdrOle2Obj::AddOwnLightClient() ////////////////////////////////////////////////////////////////////////////// -bool SdrOle2Obj::executeOldDoPaintPreparations(SdrPageView* pPageVew) const -{ - bool bIsActive(false); - // copy of the old SdrOle2Obj::Do_PaintObject stuff which evtl. needs - // to be emulated. - - // //charts must be painted resolution dependent!! #i82893#, #i75867# - // if( ChartPrettyPainter::IsChart(xObjRef) && ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( rOut.GetOutDev() ) ) - // if( !rOut.GetOffset().nA && !rOut.GetOffset().nB )//offset!=0 is the scenario 'copy -> past special gdi metafile' which does not work with direct painting so far - // if( ChartPrettyPainter::DoPrettyPaintChart( this->getXModel(), rOut.GetOutDev(), aRect ) ) - // return bOk; - // - // if( !GetGraphic() ) - // ( (SdrOle2Obj*) this)->GetObjRef_Impl(); // try to create embedded object - - // this one can be used directly, just reformatting a bit - if(!GetGraphic()) - { - // try to create embedded object - const_cast< SdrOle2Obj* >(this)->GetObjRef_Impl(); - } - - // if ( xObjRef.is() ) - // { - // sal_Int64 nMiscStatus = xObjRef->getStatus( GetAspect() ); - // if( !bSizProt && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE) ) - // ( (SdrOle2Obj*) this)->bSizProt = TRUE; - - // old stuff which relies on xObjRef and nMiscStatus - if(xObjRef.is()) - { - const sal_Int64 nMiscStatus(xObjRef->getStatus(GetAspect())); - - // this hack (to change model data during PAINT argh(!)) can also be reproduced - // directly - if(!IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE)) - { - const_cast< SdrOle2Obj* >(this)->SetResizeProtect(true); - } - - // OutputDevice* pOut = rOut.GetOutDev(); - // - // //TODO/LATER: currently it's not possible to compare the windows, the XOutDev contains a virtual device - // sal_Int32 nState = xObjRef->getCurrentState(); - // //if ( ( nState != embed::EmbedStates::INPLACE_ACTIVE && nState != embed::EmbedStates::UI_ACTIVE ) || - // // pModel && SfxInPlaceClient::GetActiveWindow( pModel->GetPersist(), xObjRef ) != pOut ) - // { - // if ( nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE ) - // { - // // PlugIn-Objekt connecten - // if (rInfoRec.pPV!=NULL) - // { - // SdrOle2Obj* pOle2Obj = (SdrOle2Obj*) this; - // SdrView* pSdrView = (SdrView*) &rInfoRec.pPV->GetView(); - // pSdrView->DoConnect(pOle2Obj); - // } - // } - - // nState is used in old paint to see if OLE is activated and to do - // a different paint - const sal_Int32 nState(xObjRef->getCurrentState()); - - bIsActive = (nState == embed::EmbedStates::ACTIVE); - - // for this one i need the view. - if(pPageVew && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE)) - { - // connect plugin object - pPageVew->GetView().DoConnect(const_cast< SdrOle2Obj* >(this)); - } - } - - return bIsActive; -} - -Bitmap SdrOle2Obj::GetEmtyOLEReplacementBitmap() const +Bitmap SdrOle2Obj::GetEmtyOLEReplacementBitmap() { return Bitmap(ResId(BMP_SVXOLEOBJ, *ImpGetResMgr())); } diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index a14e771dba..41c948f130 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -37,7 +37,6 @@ #include <svx/xpool.hxx> #include <svx/xpoly.hxx> #include <svx/svdattr.hxx> -#include "svdtouch.hxx" #include <svx/svdtrans.hxx> #include <svx/svdetc.hxx> #include <svx/svddrag.hxx> @@ -79,6 +78,10 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); } #include <basegfx/curve/b2dcubicbezier.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +// #i89784# +#include <svx/sdr/attribute/sdrtextattribute.hxx> +#include <svx/sdr/primitive2d/sdrattributecreator.hxx> + using namespace sdr; inline USHORT GetPrevPnt(USHORT nPnt, USHORT nPntMax, FASTBOOL bClosed) @@ -1746,7 +1749,10 @@ void SdrPathObj::ImpForceKind() // was called, once here below and once on a 2nd place below. // #i10659# for SdrTextObj, keep aRect up to date - aRect = ImpGetBoundRect(GetPathPoly()); + if(GetPathPoly().count()) + { + aRect = ImpGetBoundRect(GetPathPoly()); + } } // #i75974# adapt polygon state to object type. This may include a reinterpretation @@ -1825,51 +1831,6 @@ UINT16 SdrPathObj::GetObjIdentifier() const return USHORT(meKind); } -SdrObject* SdrPathObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - return NULL; - } - - sal_Bool bHit(sal_False); - const basegfx::B2DPoint aHitPoint(rPnt.X(), rPnt.Y()); - - if(GetPathPoly().isClosed() && (bTextFrame || HasFill())) - { - // hit in filled polygon? Subdivbide needed for better precision - if(GetPathPoly().areControlPointsUsed()) - { - bHit = basegfx::tools::isInside(GetPathPoly().getDefaultAdaptiveSubdivision(), aHitPoint); - } - else - { - bHit = basegfx::tools::isInside(GetPathPoly(), aHitPoint); - } - } - - if(!bHit) - { - // hit polygon line? - const double fHalfLineWidth(ImpGetLineWdt() / 2.0); - double fDistance(nTol); - - if(fHalfLineWidth > fDistance) - { - fDistance = fHalfLineWidth; - } - - bHit = basegfx::tools::isInEpsilonRange(GetPathPoly(), aHitPoint, fDistance); - } - - if(!bHit && !IsTextFrame() && HasText()) - { - bHit = (0L != SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer)); - } - - return bHit ? (SdrObject*)this : 0L; -} - void SdrPathObj::operator=(const SdrObject& rObj) { SdrTextObj::operator=(rObj); @@ -2424,7 +2385,10 @@ void SdrPathObj::TakeUnrotatedSnapRect(Rectangle& rRect) const void SdrPathObj::RecalcSnapRect() { - maSnapRect = ImpGetBoundRect(GetPathPoly()); + if(GetPathPoly().count()) + { + maSnapRect = ImpGetBoundRect(GetPathPoly()); + } } void SdrPathObj::NbcSetSnapRect(const Rectangle& rRect) @@ -2514,8 +2478,11 @@ void SdrPathObj::NbcSetPoint(const Point& rPnt, sal_uInt32 nHdlNum) } else { - // #i10659# for SdrTextObj, keep aRect up to date - aRect = ImpGetBoundRect(GetPathPoly()); // fuer SdrTextObj + if(GetPathPoly().count()) + { + // #i10659# for SdrTextObj, keep aRect up to date + aRect = ImpGetBoundRect(GetPathPoly()); // fuer SdrTextObj# + } } SetRectsDirty(); @@ -2717,7 +2684,19 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index) SdrObject* SdrPathObj::DoConvertToPolyObj(BOOL bBezier) const { - SdrObject* pRet = ImpConvertMakeObj(GetPathPoly(), IsClosed(), bBezier); + // #i89784# check for FontWork with activated HideContour + bool bHideContour(false); + + { + drawinglayer::attribute::SdrTextAttribute* pText = drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0)); + bHideContour = pText && pText->getSdrFormTextAttribute() && pText->isHideContour(); + delete pText; + } + + SdrObject* pRet = bHideContour ? + 0 : + ImpConvertMakeObj(GetPathPoly(), IsClosed(), bBezier); + SdrPathObj* pPath = PTR_CAST(SdrPathObj, pRet); if(pPath) diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index c0aad5a1bf..858df2eda3 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -38,7 +38,6 @@ #include <svx/xpoly.hxx> #include <svx/svdattr.hxx> #include <svx/svdpool.hxx> -#include "svdtouch.hxx" #include <svx/svdtrans.hxx> #include <svx/svdetc.hxx> #include <svx/svddrag.hxx> @@ -239,81 +238,6 @@ void SdrRectObj::TakeUnrotatedSnapRect(Rectangle& rRect) const } } -SdrObject* SdrRectObj::ImpCheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer, FASTBOOL bForceFilled, FASTBOOL bForceTol) const -{ - if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - return NULL; - } - - INT32 nMyTol=nTol; - FASTBOOL bFilled=bForceFilled || HasFill(); - FASTBOOL bPickThrough=pModel!=NULL && pModel->IsPickThroughTransparentTextFrames(); - if (bTextFrame && !bPickThrough) bFilled=TRUE; - FASTBOOL bLine=HasLine(); - - INT32 nWdt=bLine ? ImpGetLineWdt() :0; // Halbe Strichstaerke - - // #i25616# - if(nWdt && !LineIsOutsideGeometry()) - { - nWdt /= 2; - } - - long nBoundWdt=aRect.GetWidth()-1; - long nBoundHgt=aRect.GetHeight()-1; - if (bFilled && nBoundWdt>short(nTol) && nBoundHgt>short(nTol) && Abs(aGeo.nShearWink)<=4500) { - if (!bForceTol && !bTextFrame ) nMyTol=0; // Keine Toleranz noetig hier - } - if (nWdt>nMyTol && (!bTextFrame || pEdtOutl==NULL)) nMyTol=nWdt; // Bei dicker Umrandung keine Toleranz noetig, ausser wenn bei TextEdit - Rectangle aR(aRect); - if (nMyTol!=0 && bFilled) { - aR.Left ()-=nMyTol; - aR.Top ()-=nMyTol; - aR.Right ()+=nMyTol; - aR.Bottom()+=nMyTol; - } - - if (bFilled || bLine || bTextFrame) { // Bei TextFrame so tun, alsob Linie da - unsigned nCnt=0; - INT32 nXShad=0,nYShad=0; - long nEckRad=/*bTextFrame ? 0 :*/ GetEckenradius(); - do { // 1 Durchlauf, bei Schatten 2 Durchlaeufe. - if (nCnt!=0) aR.Move(nXShad,nYShad); - if (aGeo.nDrehWink!=0 || aGeo.nShearWink!=0 || nEckRad!=0 || !bFilled) { - Polygon aPol(aR); - if (nEckRad!=0) { - INT32 nRad=nEckRad; - if (bFilled) nRad+=nMyTol; // um korrekt zu sein ... - XPolygon aXPoly(ImpCalcXPoly(aR,nRad)); - aPol = Polygon(aXPoly.getB2DPolygon().getDefaultAdaptiveSubdivision()); - } else { - if (aGeo.nShearWink!=0) ShearPoly(aPol,aRect.TopLeft(),aGeo.nTan); - if (aGeo.nDrehWink!=0) RotatePoly(aPol,aRect.TopLeft(),aGeo.nSin,aGeo.nCos); - } - if (bFilled) { - if (IsPointInsidePoly(aPol,rPnt)) return (SdrObject*)this; - } else { - Rectangle aTouchRect(rPnt.X()-nMyTol,rPnt.Y()-nMyTol,rPnt.X()+nMyTol,rPnt.Y()+nMyTol); - if (IsRectTouchesLine(aPol,aTouchRect)) return (SdrObject*)this; - } - } else { - if (aR.IsInside(rPnt)) return (SdrObject*)this; - } - } while (nCnt++==0 && ImpGetShadowDist(nXShad,nYShad)); - } - FASTBOOL bCheckText=TRUE; - if (bCheckText && HasText() && (!bTextFrame || bPickThrough)) { - return SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer); - } - return NULL; -} - -SdrObject* SdrRectObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - return ImpCheckHit(rPnt,nTol,pVisiLayer,FALSE/*,bTextFrame*/); -} - void SdrRectObj::TakeObjNameSingul(XubString& rName) const { if (IsTextFrame()) diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 043b38957c..a0116cd1d9 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -36,7 +36,6 @@ #include <svx/svdpagv.hxx> // fuer Abfrage im Paint, ob das #include <svx/svdview.hxx> // Objekt gerade editiert wird #include <svx/svdpage.hxx> // und fuer AnimationHandler (Laufschrift) -#include "svdtouch.hxx" #include <svx/svdetc.hxx> #include <svx/svdoutl.hxx> #include "svdscrol.hxx" // fuer Laufschrift @@ -1129,101 +1128,6 @@ void SdrTextObj::StopTextAnimation(OutputDevice* /*pOutDev*/, long /*nExtraData* SetTextAnimationAllowed(sal_False); } -SdrObject* SdrTextObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - if(!bTextFrame && !GetOutlinerParaObject() ) - { - return NULL; - } - - if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - return NULL; - } - - INT32 nMyTol=nTol; - FASTBOOL bFontwork=IsFontwork(); - SdrFitToSizeType eFit=GetFitToSize(); - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES); - Rectangle aR(aRect); - Rectangle aAnchor2(aR); - Rectangle aTextRect(aR); - SdrOutliner* pOutliner = NULL; - pOutliner = &pModel->GetHitTestOutliner(); - - if (bFontwork) { - if (pFormTextBoundRect!=NULL) aR=*pFormTextBoundRect; - else aR=GetCurrentBoundRect(); - } - else - { - TakeTextRect( *pOutliner, aTextRect, FALSE, &aAnchor2, FALSE ); // EditText nicht mehr ignorieren! TRUE); // EditText ignorieren! - - if (bFitToSize) - aR=aAnchor2; - else - aR=aTextRect; - } - if (aR.GetWidth()-1>short(nTol) && aR.GetHeight()-1>short(nTol)) nMyTol=0; // Keine Toleranz noetig hier - if (nMyTol!=0) { - aR.Left ()-=nMyTol; - aR.Top ()-=nMyTol; - aR.Right ()+=nMyTol; - aR.Bottom()+=nMyTol; - } - FASTBOOL bRet=FALSE; - - if(bFontwork) - { - bRet = aR.IsInside(rPnt); - - // #105130# Include aRect here in measurements to be able to hit a - // fontwork object on its border - if(!bRet) - { - const Rectangle aSnapRect = GetSnapRect(); - - if( (rPnt.X() >= aSnapRect.Left() - nTol && rPnt.X() <= aSnapRect.Left() + nTol) - || (rPnt.X() >= aSnapRect.Right() - nTol && rPnt.X() <= aSnapRect.Right() + nTol) - || (rPnt.Y() >= aSnapRect.Top() - nTol && rPnt.Y() <= aSnapRect.Top() + nTol) - || (rPnt.Y() >= aSnapRect.Bottom() - nTol && rPnt.Y() <= aSnapRect.Bottom() + nTol)) - { - bRet = TRUE; - } - } - } - else - { - if (aGeo.nDrehWink!=0) { - Polygon aPol(aR); - RotatePoly(aPol,aR.TopLeft(),aGeo.nSin,aGeo.nCos); - bRet=IsPointInsidePoly(aPol,rPnt); - } else { - bRet=aR.IsInside(rPnt); - } - if (bRet) { // und nun noch checken, ob wirklich Buchstaben getroffen sind - // Featurewunsch zur 4.0 - // Zunaechst meine Dok-Koordinaten in EE-Dok-Koordinaten umwandeln. - Point aPt(rPnt); aPt-=aR.TopLeft(); - if (bFitToSize) { // #38214#: FitToSize berueksichtigen - Fraction aX(aTextRect.GetWidth()-1,aAnchor2.GetWidth()-1); - Fraction aY(aTextRect.GetHeight()-1,aAnchor2.GetHeight()-1); - ResizePoint(aPt,Point(),aX,aY); - } - if (aGeo.nDrehWink!=0) RotatePoint(aPt,Point(),-aGeo.nSin,aGeo.nCos); // -sin fuer Unrotate - // Und nun im EE-Dok auf Buchstabensuche gehen - long nHitTol = 2000; - OutputDevice* pRef = pOutliner->GetRefDevice(); - if( pRef ) - nHitTol = pRef->LogicToLogic( nHitTol, MAP_100TH_MM, pRef->GetMapMode().GetMapUnit() ); - - bRet = pOutliner->IsTextPos( aPt, (sal_uInt16)nHitTol ); - } - } - - return bRet ? (SdrObject*)this : NULL; -} - void SdrTextObj::TakeObjNameSingul(XubString& rName) const { XubString aStr; diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 4ca4e02c90..cd760c7a44 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -657,7 +657,11 @@ namespace bool SdrTextObj::impCheckSpellCheckForDecomposeTextPrimitive() const { - return false; + // #i102062# asked TL who killed this feature (CWS tl56). Obviously, there + // is no more support for EE_CNTRL_NOREDLINES anymore; redlining is always + // on nowadays. Unfortunately, not false, but true should be returned then. + // Trying if this is all... + return true; } bool SdrTextObj::impDecomposeContourTextPrimitive( @@ -731,7 +735,9 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive( // prepare outliner const bool bIsCell(rSdrBlockTextPrimitive.getCellText()); - const SfxItemSet& rTextItemSet = rSdrBlockTextPrimitive.getSdrText().GetItemSet(); + const SfxItemSet& rTextItemSet = rSdrBlockTextPrimitive.getSdrText() + ? rSdrBlockTextPrimitive.getSdrText()->GetItemSet() + : GetObjectItemSet(); SdrOutliner& rOutliner = ImpGetDrawOutliner(); SdrTextVertAdjust eVAdj = GetTextVerticalAdjust(rTextItemSet); SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust(rTextItemSet); @@ -767,17 +773,40 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive( } else { + // check if block text is used (only one of them can be true) + const bool bHorizontalIsBlock(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg); + const bool bVerticalIsBlock(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg); + if((rSdrBlockTextPrimitive.getWordWrap() || IsTextFrame()) && !rSdrBlockTextPrimitive.getUnlimitedPage()) { - rOutliner.SetMaxAutoPaperSize(aAnchorTextSize); + // #i103454# maximal paper size hor/ver needs to be limited to text + // frame size. If it's block text, still allow the 'other' direction + // to grow to get a correct real text size when using GetPaperSize(). + // When just using aAnchorTextSize as maximum, GetPaperSize() + // would just return aAnchorTextSize again: this means, the wanted + // 'measurement' of the real size of block text would not work + Size aMaxAutoPaperSize(aAnchorTextSize); + + if(bHorizontalIsBlock) + { + // allow to grow vertical for horizontal blocks + aMaxAutoPaperSize.setHeight(1000000); + } + else if(bVerticalIsBlock) + { + // allow to grow horizontal for vertical blocks + aMaxAutoPaperSize.setWidth(1000000); + } + + rOutliner.SetMaxAutoPaperSize(aMaxAutoPaperSize); } - if(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg) + // set minimal paper size hor/ver if needed + if(bHorizontalIsBlock) { rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0)); } - - if(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg) + else if(bVerticalIsBlock) { rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight)); } @@ -903,7 +932,9 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive( // prepare outliner SdrOutliner& rOutliner = ImpGetDrawOutliner(); const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord()); - const SfxItemSet& rTextItemSet = rSdrStretchTextPrimitive.getSdrText().GetItemSet(); + const SfxItemSet& rTextItemSet = rSdrStretchTextPrimitive.getSdrText() + ? rSdrStretchTextPrimitive.getSdrText()->GetItemSet() + : GetObjectItemSet(); const Size aNullSize; rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE); @@ -927,6 +958,16 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive( basegfx::B2DHomMatrix aNewTransformA; basegfx::B2DHomMatrix aNewTransformB; + // #i101957# Check for vertical text. If used, aNewTransformA + // needs to translate the text initially around object width to orient + // it relative to the topper right instead of the topper left + const bool bVertical(rSdrStretchTextPrimitive.getOutlinerParaObject().IsVertical()); + + if(bVertical) + { + aNewTransformA.translate(aScale.getX(), 0.0); + } + // calculate global char stretching scale parameters. Use non-mirrored sizes // to layout without mirroring const double fScaleX(fabs(aScale.getX()) / aOutlinerScale.getX()); @@ -1196,4 +1237,5 @@ void SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL } } +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index 5379f525b0..af6413bb8d 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -70,6 +70,7 @@ #include <editstat.hxx> #include <unoapi.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> +#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -223,65 +224,13 @@ namespace } // end of anonymous namespace ////////////////////////////////////////////////////////////////////////////// -// TextBreakup data helper - -namespace -{ - class impFormTextValues - { - sal_Int32 mnFormTextDistance; // distance from line in upright direction - sal_Int32 mnFormTextStart; // shift from polygon start - sal_Int32 mnFormTextShdwXVal; // shadow distance or 10th degrees - sal_Int32 mnFormTextShdwYVal; // shadow distance or scaling - sal_uInt16 mnFormTextShdwTransp; // shadow transparence - XFormTextStyle meFormTextStyle; // on/off and char orientation - XFormTextAdjust meFormTextAdjust; // adjustment (left/right/center) and scale - XFormTextShadow meFormTextShadow; // shadow mode - Color maFormTextShdwColor; // shadow color - - // bitfield - unsigned mbFormTextMirror : 1; // change orientation - unsigned mbFormTextOutline : 1; // show contour of objects - - public: - impFormTextValues(const SfxItemSet& rSet) - : mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()), - mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()), - mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()), - mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()), - mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()), - meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()), - meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()), - meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()), - maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()), - mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()), - mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue()) - { - } - - // data access - sal_Int32 getFormTextDistance() const { return mnFormTextDistance; } - sal_Int32 getFormTextStart() const { return mnFormTextStart; } - sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; } - sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; } - sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; } - XFormTextStyle getFormTextStyle() const { return meFormTextStyle; } - XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; } - XFormTextShadow getFormTextShadow() const { return meFormTextShadow; } - Color getFormTextShdwColor() const { return maFormTextShdwColor; } - bool getFormTextMirror() const { return mbFormTextMirror; } - bool getFormTextOutline() const { return mbFormTextOutline; } - }; -} // end of anonymous namespace - -////////////////////////////////////////////////////////////////////////////// // TextBreakup one poly and one paragraph helper namespace { class impPolygonParagraphHandler { - const impFormTextValues& mrVal; // FormText parameters + const drawinglayer::attribute::SdrFormTextAttribute& mrSdrFormTextAttribute; // FormText parameters std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrDecomposition; // destination primitive list std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrShadowDecomposition; // destination primitive list for shadow Reference < com::sun::star::i18n::XBreakIterator > mxBreak; // break iterator @@ -321,10 +270,10 @@ namespace public: impPolygonParagraphHandler( - const impFormTextValues& rVal, + const drawinglayer::attribute::SdrFormTextAttribute& rSdrFormTextAttribute, std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rDecomposition, std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rShadowDecomposition) - : mrVal(rVal), + : mrSdrFormTextAttribute(rSdrFormTextAttribute), mrDecomposition(rDecomposition), mrShadowDecomposition(rShadowDecomposition) { @@ -348,16 +297,18 @@ namespace double fPolyStart(0.0); double fScaleFactor(1.0); - if(mrVal.getFormTextMirror()) + if(mrSdrFormTextAttribute.getFormTextMirror()) { aPolygonCandidate.flip(); } - if(mrVal.getFormTextStart() && (XFT_LEFT == mrVal.getFormTextAdjust() || XFT_RIGHT == mrVal.getFormTextAdjust())) + if(mrSdrFormTextAttribute.getFormTextStart() + && (XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust() + || XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust())) { - if(XFT_LEFT == mrVal.getFormTextAdjust()) + if(XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust()) { - fPolyStart += mrVal.getFormTextStart(); + fPolyStart += mrSdrFormTextAttribute.getFormTextStart(); if(fPolyStart > fPolyEnd) { @@ -366,7 +317,7 @@ namespace } else { - fPolyEnd -= mrVal.getFormTextStart(); + fPolyEnd -= mrSdrFormTextAttribute.getFormTextStart(); if(fPolyEnd < fPolyStart) { @@ -375,7 +326,7 @@ namespace } } - if(XFT_LEFT != mrVal.getFormTextAdjust()) + if(XFT_LEFT != mrSdrFormTextAttribute.getFormTextAdjust()) { // calculate total text length of this paragraph, some layout needs to be done const double fParagraphTextLength(getParagraphTextLength(rTextPortions)); @@ -384,7 +335,7 @@ namespace // but still take care of XFT_AUTOSIZE in that case const bool bTextTooLong(fParagraphTextLength > (fPolyEnd - fPolyStart)); - if(XFT_RIGHT == mrVal.getFormTextAdjust()) + if(XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust()) { if(!bTextTooLong) { @@ -392,7 +343,7 @@ namespace fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength); } } - else if(XFT_CENTER == mrVal.getFormTextAdjust()) + else if(XFT_CENTER == mrSdrFormTextAttribute.getFormTextAdjust()) { if(!bTextTooLong) { @@ -400,7 +351,7 @@ namespace fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength) / 2.0; } } - else if(XFT_AUTOSIZE == mrVal.getFormTextAdjust()) + else if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) { // if scale, prepare scale factor between curve length and text length if(0.0 != fParagraphTextLength) @@ -434,7 +385,7 @@ namespace // prepare portion length. Takes RTL sections into account. double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen)); - if(XFT_AUTOSIZE == mrVal.getFormTextAdjust()) + if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) { // when scaling, expand portion length fPortionLength *= fScaleFactor; @@ -449,25 +400,27 @@ namespace aNewTransformA.scale(aSize.getX(), aSize.getY()); // prepare scaling of text primitive - if(XFT_AUTOSIZE == mrVal.getFormTextAdjust()) + if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) { // when scaling, expand text primitive scaling aNewTransformA.scale(fScaleFactor, fScaleFactor); } // eventually create shadow primitives from aDecomposition and add to rDecomposition - const bool bShadow(XFTSHADOW_NONE != mrVal.getFormTextShadow()); + const bool bShadow(XFTSHADOW_NONE != mrSdrFormTextAttribute.getFormTextShadow()); if(bShadow) { - if(XFTSHADOW_NORMAL == mrVal.getFormTextShadow()) + if(XFTSHADOW_NORMAL == mrSdrFormTextAttribute.getFormTextShadow()) { - aNewShadowTransform.translate(mrVal.getFormTextShdwXVal(), -mrVal.getFormTextShdwYVal()); + aNewShadowTransform.translate( + mrSdrFormTextAttribute.getFormTextShdwXVal(), + -mrSdrFormTextAttribute.getFormTextShdwYVal()); } else // XFTSHADOW_SLANT { - double fScaleValue(mrVal.getFormTextShdwYVal() / 100.0); - double fShearValue(-mrVal.getFormTextShdwXVal() * F_PI1800); + double fScaleValue(mrSdrFormTextAttribute.getFormTextShdwYVal() / 100.0); + double fShearValue(-mrSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800); aNewShadowTransform.scale(1.0, fScaleValue); aNewShadowTransform.shearX(sin(fShearValue)); @@ -475,7 +428,7 @@ namespace } } - switch(mrVal.getFormTextStyle()) + switch(mrSdrFormTextAttribute.getFormTextStyle()) { case XFT_ROTATE : { @@ -533,7 +486,7 @@ namespace } // distance from path? - if(mrVal.getFormTextDistance()) + if(mrSdrFormTextAttribute.getFormTextDistance()) { if(aEndPos.equal(aStartPos)) { @@ -541,7 +494,9 @@ namespace } // use back vector (aStartPos - aEndPos) here to get mirrored perpendicular as in old stuff - const basegfx::B2DVector aPerpendicular(basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) * mrVal.getFormTextDistance()); + const basegfx::B2DVector aPerpendicular( + basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) * + mrSdrFormTextAttribute.getFormTextDistance()); aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY()); } @@ -550,7 +505,7 @@ namespace { if(pCandidate->getText().Len() && nNextGlyphLen) { - const Color aShadowColor(mrVal.getFormTextShdwColor()); + const Color aShadowColor(mrSdrFormTextAttribute.getFormTextShdwColor()); const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen)); const ::std::vector< double > aNewDXArray( @@ -611,101 +566,6 @@ namespace namespace { - basegfx::B2DLineJoin impGetB2DLineJoin(XLineJoint eLineJoint) - { - switch(eLineJoint) - { - case XLINEJOINT_MIDDLE : - { - return basegfx::B2DLINEJOIN_MIDDLE; - } - case XLINEJOINT_BEVEL : - { - return basegfx::B2DLINEJOIN_BEVEL; - } - case XLINEJOINT_MITER : - { - return basegfx::B2DLINEJOIN_MITER; - } - case XLINEJOINT_ROUND : - { - return basegfx::B2DLINEJOIN_ROUND; - } - default : - { - return basegfx::B2DLINEJOIN_NONE; // XLINEJOINT_NONE - } - } - } -} // end of anonymous namespace - -////////////////////////////////////////////////////////////////////////////// - -namespace -{ - sal_uInt8 impGetStrokeTransparence(bool bShadow, const SfxItemSet& rSet) - { - sal_uInt8 nRetval; - - if(bShadow) - { - nRetval = (sal_uInt8)((((SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue() * 255) / 100); - } - else - { - nRetval = (sal_uInt8)((((XLineTransparenceItem&)(rSet.Get(XATTR_LINETRANSPARENCE))).GetValue() * 255) / 100); - } - - return nRetval; - } - - drawinglayer::attribute::LineAttribute impGetLineAttribute(bool bShadow, const SfxItemSet& rSet) - { - basegfx::BColor aColorAttribute; - - if(bShadow) - { - const Color aShadowColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue()); - aColorAttribute = aShadowColor.getBColor(); - } - else - { - const Color aLineColor(((XLineColorItem&)(rSet.Get(XATTR_LINECOLOR))).GetColorValue()); - aColorAttribute = aLineColor.getBColor(); - } - - const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue(); - const XLineJoint eLineJoint = ((const XLineJointItem&)(rSet.Get(XATTR_LINEJOINT))).GetValue(); - - return drawinglayer::attribute::LineAttribute(aColorAttribute, (double)nLineWidth, impGetB2DLineJoin(eLineJoint)); - } - - drawinglayer::attribute::StrokeAttribute impGetStrokeAttribute(const SfxItemSet& rSet) - { - const XLineStyle eLineStyle = ((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue(); - double fFullDotDashLen(0.0); - ::std::vector< double > aDotDashArray; - - if(XLINE_DASH == eLineStyle) - { - const XDash& rDash = ((const XLineDashItem&)(rSet.Get(XATTR_LINEDASH))).GetDashValue(); - - if(rDash.GetDots() || rDash.GetDashes()) - { - const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue(); - fFullDotDashLen = rDash.CreateDotDashArray(aDotDashArray, (double)nLineWidth); - } - } - - return drawinglayer::attribute::StrokeAttribute(aDotDashArray, fFullDotDashLen); - } -} // end of anonymous namespace - -////////////////////////////////////////////////////////////////////////////// -// primitive decomposition helpers - -namespace -{ void impAddPolygonStrokePrimitives( const basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector, const basegfx::B2DHomMatrix& rTransform, @@ -732,8 +592,7 @@ namespace drawinglayer::primitive2d::Primitive2DSequence impAddPathTextOutlines( const std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rSource, - bool bShadow, - const SfxItemSet& rSet) + const drawinglayer::attribute::SdrFormTextOutlineAttribute& rOutlineAttribute) { std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aNewPrimitives; @@ -751,19 +610,19 @@ namespace if(aB2DPolyPolyVector.size()) { - // prepare Line and Stroke Attribute - const drawinglayer::attribute::LineAttribute aLineAttribute(impGetLineAttribute(bShadow, rSet)); - const drawinglayer::attribute::StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet)); - const sal_uInt8 nTransparence(impGetStrokeTransparence(bShadow, rSet)); - // create stroke primitives std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aStrokePrimitives; - impAddPolygonStrokePrimitives(aB2DPolyPolyVector, aPolygonTransform, aLineAttribute, aStrokeAttribute, aStrokePrimitives); + impAddPolygonStrokePrimitives( + aB2DPolyPolyVector, + aPolygonTransform, + rOutlineAttribute.getLineAttribute(), + rOutlineAttribute.getStrokeAttribute(), + aStrokePrimitives); const sal_uInt32 nStrokeCount(aStrokePrimitives.size()); if(nStrokeCount) { - if(nTransparence) + if(rOutlineAttribute.getTransparence()) { // create UnifiedAlphaPrimitive2D drawinglayer::primitive2d::Primitive2DSequence aStrokePrimitiveSequence(nStrokeCount); @@ -773,7 +632,10 @@ namespace aStrokePrimitiveSequence[b] = drawinglayer::primitive2d::Primitive2DReference(aStrokePrimitives[b]); } - drawinglayer::primitive2d::UnifiedAlphaPrimitive2D* pNew2 = new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aStrokePrimitiveSequence, (double)nTransparence / 100.0); + drawinglayer::primitive2d::UnifiedAlphaPrimitive2D* pNew2 = + new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + aStrokePrimitiveSequence, + (double)rOutlineAttribute.getTransparence() / 100.0); aNewPrimitives.push_back(pNew2); } else @@ -822,7 +684,7 @@ bool SdrTextObj::impDecomposePathTextPrimitive( rOutliner.SetUpdateMode(true); rOutliner.Clear(); rOutliner.SetPaperSize(Size(LONG_MAX,LONG_MAX)); - rOutliner.SetText(*rSdrPathTextPrimitive.getSdrText().GetOutlinerParaObject()); + rOutliner.SetText(rSdrPathTextPrimitive.getOutlinerParaObject()); // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage())); @@ -833,11 +695,8 @@ bool SdrTextObj::impDecomposePathTextPrimitive( if(rPathTextPortions.size()) { - // get FormText values - const SfxItemSet& rSet = rSdrPathTextPrimitive.getSdrText().GetItemSet(); - const impFormTextValues aVal(rSet); - - // get polygon values + // get FormText and polygon values + const drawinglayer::attribute::SdrFormTextAttribute& rFormTextAttribute = rSdrPathTextPrimitive.getSdrFormTextAttribute(); const basegfx::B2DPolyPolygon& rPathPolyPolygon(rSdrPathTextPrimitive.getPathPolyPolygon()); // get loop count @@ -848,12 +707,13 @@ bool SdrTextObj::impDecomposePathTextPrimitive( nLoopCount = rOutliner.GetParagraphCount(); } - if(nLoopCount && XFT_NONE != aVal.getFormTextStyle()) + if(nLoopCount) { // prepare common decomposition stuff std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aRegularDecomposition; std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aShadowDecomposition; - impPolygonParagraphHandler aPolygonParagraphHandler(aVal, aRegularDecomposition, aShadowDecomposition); + impPolygonParagraphHandler aPolygonParagraphHandler( + rFormTextAttribute, aRegularDecomposition, aShadowDecomposition); sal_uInt32 a; for(a = 0L; a < nLoopCount; a++) @@ -892,10 +752,10 @@ bool SdrTextObj::impDecomposePathTextPrimitive( } // evtl. add shadow outlines - if(aVal.getFormTextOutline()) + if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getShadowOutline()) { - const SfxItemSet& rLocalSet = rSdrPathTextPrimitive.getSdrText().GetObject().GetMergedItemSet(); - const drawinglayer::primitive2d::Primitive2DSequence aOutlines(impAddPathTextOutlines(aShadowDecomposition, true, rLocalSet)); + const drawinglayer::primitive2d::Primitive2DSequence aOutlines( + impAddPathTextOutlines(aShadowDecomposition, *rFormTextAttribute.getShadowOutline())); drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalA, aOutlines); } } @@ -911,10 +771,10 @@ bool SdrTextObj::impDecomposePathTextPrimitive( } // evtl. add outlines - if(aVal.getFormTextOutline()) + if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getOutline()) { - const SfxItemSet& rLocalSet = rSdrPathTextPrimitive.getSdrText().GetObject().GetMergedItemSet(); - const drawinglayer::primitive2d::Primitive2DSequence aOutlines(impAddPathTextOutlines(aRegularDecomposition, false, rLocalSet)); + const drawinglayer::primitive2d::Primitive2DSequence aOutlines( + impAddPathTextOutlines(aRegularDecomposition, *rFormTextAttribute.getOutline())); drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalB, aOutlines); } } diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index a3f5fb76d1..07258ef669 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -291,11 +291,6 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl) mbInEditMode = FALSE; } -SdrObject* SdrTextObj::CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - return SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer); -} - USHORT SdrTextObj::GetOutlinerViewAnchorMode() const { SdrTextHorzAdjust eH=GetTextHorizontalAdjust(); diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx index 121e8dc1bb..9d4917efbc 100644 --- a/svx/source/svdraw/svdotxtr.cxx +++ b/svx/source/svdraw/svdotxtr.cxx @@ -43,9 +43,13 @@ #include <svx/sdr/properties/itemsettools.hxx> #include <svx/sdr/properties/properties.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> -#include "svdtxhdl.hxx" #include <svtools/itemset.hxx> #include <svditer.hxx> +#include <drawinglayer/processor2d/textaspolygonextractor2d.hxx> +#include <svx/sdr/contact/viewcontact.hxx> +#include <svx/xflclit.hxx> +#include <svx/xlnclit.hxx> +#include <svx/xlnwtit.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// // @@ -335,37 +339,139 @@ void SdrTextObj::NbcMirror(const Point& rRef1, const Point& rRef2) SetGlueReallyAbsolute(FALSE); } -SdrObject* SdrTextObj::ImpConvertObj(FASTBOOL bToPoly) const +////////////////////////////////////////////////////////////////////////////// + +SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const { - if (!ImpCanConvTextToCurve()) return NULL; - SdrObjGroup* pGroup=new SdrObjGroup(); + SdrObject* pRetval = 0; - boost::shared_ptr< SdrOutliner > xOutl( const_cast< SdrTextObj* >(this)->CreateDrawOutliner() ); - xOutl->SetUpdateMode(TRUE); - ImpTextPortionHandler aConverter(*(xOutl.get()),*this); + if(!ImpCanConvTextToCurve()) + { + // suppress HelpTexts from PresObj's + return 0; + } - aConverter.ConvertToPathObj(*pGroup,bToPoly); + // get primitives + const drawinglayer::primitive2d::Primitive2DSequence xSequence(GetViewContact().getViewIndependentPrimitive2DSequence()); - // Nachsehen, ob ueberhaupt was drin ist: - SdrObjList* pOL=pGroup->GetSubList(); + if(xSequence.hasElements()) + { + // create an extractor with neutral ViewInformation + const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0); + drawinglayer::processor2d::TextAsPolygonExtractor2D aExtractor(aViewInformation2D); - if (pOL->GetObjCount()==0) { - delete pGroup; - return NULL; - } - // Ein einzelnes Objekt muss nicht gruppiert werden: - if (pOL->GetObjCount()==1) { - SdrObject* pObj=pOL->RemoveObject(0); - delete pGroup; - return pObj; + // extract text as polygons + aExtractor.process(xSequence); + + // get results + const drawinglayer::processor2d::TextAsPolygonDataNodeVector& rResult = aExtractor.getTarget(); + const sal_uInt32 nResultCount(rResult.size()); + + if(nResultCount) + { + // prepare own target + SdrObjGroup* pGroup = new SdrObjGroup(); + SdrObjList* pObjectList = pGroup->GetSubList(); + + // process results + for(sal_uInt32 a(0); a < nResultCount; a++) + { + const drawinglayer::processor2d::TextAsPolygonDataNode& rCandidate = rResult[a]; + basegfx::B2DPolyPolygon aPolyPolygon(rCandidate.getB2DPolyPolygon()); + + if(aPolyPolygon.count()) + { + // take care of wanted polygon type + if(bToPoly) + { + if(aPolyPolygon.areControlPointsUsed()) + { + aPolyPolygon = basegfx::tools::adaptiveSubdivideByAngle(aPolyPolygon); + } + } + else + { + if(!aPolyPolygon.areControlPointsUsed()) + { + aPolyPolygon = basegfx::tools::expandToCurve(aPolyPolygon); + } + } + + // create ItemSet with object attributes + SfxItemSet aAttributeSet(GetObjectItemSet()); + SdrPathObj* pPathObj = 0; + + // always clear objectshadow; this is included in the extraction + aAttributeSet.Put(SdrShadowItem(false)); + + if(rCandidate.getIsFilled()) + { + // set needed items + aAttributeSet.Put(XFillColorItem(String(), Color(rCandidate.getBColor()))); + aAttributeSet.Put(XLineStyleItem(XLINE_NONE)); + aAttributeSet.Put(XFillStyleItem(XFILL_SOLID)); + + // create filled SdrPathObj + pPathObj = new SdrPathObj(OBJ_PATHFILL, aPolyPolygon); + } + else + { + // set needed items + aAttributeSet.Put(XLineColorItem(String(), Color(rCandidate.getBColor()))); + aAttributeSet.Put(XLineStyleItem(XLINE_SOLID)); + aAttributeSet.Put(XLineWidthItem(0)); + aAttributeSet.Put(XFillStyleItem(XFILL_NONE)); + + // create line SdrPathObj + pPathObj = new SdrPathObj(OBJ_PATHLINE, aPolyPolygon); + } + + // copy basic information from original + pPathObj->ImpSetAnchorPos(GetAnchorPos()); + pPathObj->NbcSetLayer(GetLayer()); + + if(GetModel()) + { + pPathObj->SetModel(GetModel()); + pPathObj->NbcSetStyleSheet(GetStyleSheet(), true); + } + + // apply prepared ItemSet and add to target + pPathObj->SetMergedItemSet(aAttributeSet); + pObjectList->InsertObject(pPathObj); + } + } + + // postprocess; if no result and/or only one object, simplify + if(!pObjectList->GetObjCount()) + { + delete pGroup; + } + else if(1 == pObjectList->GetObjCount()) + { + pRetval = pObjectList->RemoveObject(0); + delete pGroup; + } + else + { + pRetval = pGroup; + } + } } - // Ansonsten die Gruppe zurueckgeben - return pGroup; + + return pRetval; } +////////////////////////////////////////////////////////////////////////////// + SdrObject* SdrTextObj::DoConvertToPolyObj(BOOL bBezier) const { - return ImpConvertObj(!bBezier); + return ImpConvertContainedTextToSdrPathObjs(!bBezier); +} + +bool SdrTextObj::ImpCanConvTextToCurve() const +{ + return !IsOutlText(); } SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, sal_Bool bClosed, sal_Bool bBezier, sal_Bool bNoSetAttr) const @@ -388,25 +494,23 @@ SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPol pPathObj->SetPathPoly(basegfx::tools::expandToCurve(pPathObj->GetPathPoly())); } + if(pPathObj) { - if(pPathObj) - { - pPathObj->ImpSetAnchorPos(aAnchor); - pPathObj->NbcSetLayer(SdrLayerID(GetLayer())); + pPathObj->ImpSetAnchorPos(aAnchor); + pPathObj->NbcSetLayer(SdrLayerID(GetLayer())); - if(pModel) + if(pModel) + { + pPathObj->SetModel(pModel); + + if(!bNoSetAttr) { - pPathObj->SetModel(pModel); + sdr::properties::ItemChangeBroadcaster aC(*pPathObj); - if(!bNoSetAttr) - { - sdr::properties::ItemChangeBroadcaster aC(*pPathObj); - - pPathObj->ClearMergedItem(); - pPathObj->SetMergedItemSet(GetObjectItemSet()); - pPathObj->GetProperties().BroadcastItemChange(aC); - pPathObj->NbcSetStyleSheet(GetStyleSheet(), sal_True); - } + pPathObj->ClearMergedItem(); + pPathObj->SetMergedItemSet(GetObjectItemSet()); + pPathObj->GetProperties().BroadcastItemChange(aC); + pPathObj->NbcSetStyleSheet(GetStyleSheet(), sal_True); } } } @@ -421,7 +525,7 @@ SdrObject* SdrTextObj::ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) cons return pObj; } - SdrObject* pText = ImpConvertObj(!bBezier); + SdrObject* pText = ImpConvertContainedTextToSdrPathObjs(!bBezier); if(!pText) { @@ -433,40 +537,6 @@ SdrObject* SdrTextObj::ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) cons return pText; } - // #i97874# - // if shadow is set, apply it to created text, too - const bool bShadowOn(((SdrShadowItem&)GetObjectItem(SDRATTR_SHADOW)).GetValue()); - SfxItemSet aShadowSet(*(GetObjectItemSet().GetPool()), SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST); - - if(bShadowOn) - { - // filter shadow items - aShadowSet.Put(GetObjectItemSet()); - } - - { // #i97874# - // copy needed attributes from local object to all newly created objects - SdrObjListIter aIter(*pText); - - while(aIter.IsMore()) - { - SdrObject* pCandidate = aIter.Next(); - - // make sure Layer and model are correct - pCandidate->NbcSetLayer(SdrLayerID(GetLayer())); - pCandidate->SetModel(pModel); - - // set shadow if needed - if(bShadowOn) - { - pCandidate->SetMergedItemSet(aShadowSet); - } - - // set used StyleSheet - pCandidate->NbcSetStyleSheet(GetStyleSheet(), true); - } - } - if(pText->IsGroupObject()) { // is already group object, add partial shape in front @@ -487,4 +557,5 @@ SdrObject* SdrTextObj::ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) cons } } +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index 3c6710f050..313de1087f 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -297,11 +297,6 @@ namespace }; } -SdrObject* SdrUnoObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - return ImpCheckHit(rPnt, nTol, pVisiLayer, TRUE, TRUE); -} - void SdrUnoObj::TakeObjNameSingul(XubString& rName) const { rName = ImpGetResStr(STR_ObjNameSingulUno); diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 23e443c8d8..63ff2ef669 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -161,13 +161,6 @@ void SdrVirtObj::SetChanged() SdrObject::SetChanged(); } -SdrObject* SdrVirtObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const -{ - Point aPnt(rPnt-aAnchor); - FASTBOOL bRet=rRefObj.CheckHit(aPnt,nTol,pVisiLayer)!=NULL; - return bRet ? (SdrObject*)this : NULL; -} - SdrObject* SdrVirtObj::Clone() const { SdrObject* pObj=new SdrVirtObj(((SdrVirtObj*)this)->rRefObj); // Nur eine weitere Referenz diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 610c0e6afe..8f4d8cd94c 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -678,33 +678,6 @@ const Rectangle& SdrObjList::GetAllObjBoundRect() const return aOutRect; } -SdrObject* SdrObjList::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer, FASTBOOL bBackward) const -{ - SdrObject* pHit=NULL; - Rectangle R(rPnt.X()-nTol,rPnt.Y()-nTol,rPnt.X()+nTol,rPnt.Y()+nTol); - if (R.IsOver(GetAllObjBoundRect())) { - ULONG nObjAnz=GetObjCount(); - ULONG nObjNum=bBackward ? 0 : nObjAnz; - while (pHit==NULL && (bBackward ? nObjNum<nObjAnz : nObjNum>0)) { - if (!bBackward) nObjNum--; - SdrObject* pObj=GetObj(nObjNum); - if (R.IsOver(pObj->GetCurrentBoundRect())) { - SdrObjList* pSubList=pObj->GetSubList(); - if (pSubList!=NULL || pVisiLayer==NULL) { // Gruppenobjekte beruecksichtigen sichtbare Layer selbst - pHit=pObj->CheckHit(rPnt,nTol,pVisiLayer/*,bBackward*/); - } else { // Ansonsten nur wenn Layer sichtbar - SdrLayerID nLayer=pObj->GetLayer(); - if (pVisiLayer->IsSet(nLayer)) { - pHit=pObj->CheckHit(rPnt,nTol,pVisiLayer/*,bBackward*/); - } - } - } - if (bBackward) nObjNum++; - } - } - return pHit; -} - void SdrObjList::NbcReformatAllTextObjects() { ULONG nAnz=GetObjCount(); @@ -773,42 +746,6 @@ void SdrObjList::BurnInStyleSheetAttributes() } } -FASTBOOL SdrObjList::ImpGetFillColor(SdrObject* pObj, Color& rCol) const -{ - return GetDraftFillColor(pObj->GetMergedItemSet(), rCol); -} - -FASTBOOL SdrObjList::GetFillColor(const Point& rPnt, const SetOfByte& rVisLayers, - /*FASTBOOL bLayerSorted,*/ Color& rCol) const -{ - if (pModel==NULL) return FALSE; - FASTBOOL bRet=FALSE; - FASTBOOL bMaster=pPage!=NULL ? pPage->IsMasterPage() : FALSE; - for (ULONG no=GetObjCount(); !bRet && no>0; ) { - no--; - SdrObject* pObj=GetObj(no); - SdrObjList* pOL=pObj->GetSubList(); - if (pOL!=NULL) { // Aha, Gruppenobjekt - bRet=pOL->GetFillColor(rPnt,rVisLayers,/*bLayerSorted,*/rCol); - } else { - SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pObj); - // #108867# Exclude zero master page object (i.e. background - // shape) from color query - if (pTextObj!=NULL && - pObj->IsClosedObj() && rVisLayers.IsSet(pObj->GetLayer()) && - (!bMaster || (!pObj->IsNotVisibleAsMaster() && no!=0)) && - pObj->GetCurrentBoundRect().IsInside(rPnt) && - !pTextObj->IsHideContour() && pObj->IsHit(rPnt,0,NULL)) - { // Nachfolgend extra Funktion um Stack zu sparen, - // da diese Methode hier rekursiv ist. - bRet=ImpGetFillColor(pObj,rCol); - } - } - } - return bRet; -} - - ULONG SdrObjList::GetObjCount() const { return maList.size(); @@ -1706,56 +1643,6 @@ void SdrPage::TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage) } } -// MasterPage interface -//////////////////////////////////////////////////////////////////////////////////////////////////// - -FASTBOOL SdrPage::ImplGetFillColor(const Point& rPnt, const SetOfByte& rVisLayers, - /* FASTBOOL bLayerSorted,*/ Color& rCol, FASTBOOL bSkipBackgroundShape) const -{ - if (pModel==NULL) return FALSE; - FASTBOOL bRet=SdrObjList::GetFillColor(rPnt,rVisLayers,/*bLayerSorted,*/rCol); - if (!bRet && !mbMaster) - { - // nun zu den Masterpages - if(TRG_HasMasterPage()) - { - SetOfByte aSet(rVisLayers); - aSet &= TRG_GetMasterPageVisibleLayers(); - SdrPage& rMasterPage = TRG_GetMasterPage(); - - // #108867# Don't fall back to background shape on - // master pages. This is later handled by - // GetBackgroundColor, and is necessary to cater for - // the silly ordering: 1. shapes, 2. master page - // shapes, 3. page background, 4. master page - // background. - bRet = rMasterPage.ImplGetFillColor(rPnt, aSet, rCol, TRUE); - } - } - - // #108867# Only now determine background color from background shapes - if( !bRet && !bSkipBackgroundShape ) - { - rCol = GetPageBackgroundColor(); - return TRUE; - } - - return bRet; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -FASTBOOL SdrPage::GetFillColor(const Point& rPnt, const SetOfByte& rVisLayers, - /*FASTBOOL bLayerSorted,*/ Color& rCol) const -{ - // #108867# Wrapper for ImplGetFillColor. Used to properly set the - // bSkipBackgroundShape parameter. Never skip background shape on - // first level of recursion - return ImplGetFillColor(rPnt,rVisLayers,/*bLayerSorted,*/rCol,FALSE); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - const SdrPageGridFrameList* SdrPage::GetGridFrameList(const SdrPageView* /*pPV*/, const Rectangle* /*pRect*/) const { return NULL; diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index f9c71c9a74..cf0034903e 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -113,7 +113,7 @@ ImplEncirclementOverlay::ImplEncirclementOverlay(const SdrPaintView& rView, cons if(pTargetOverlay) { ::sdr::overlay::OverlayRollingRectangleStriped* aNew = new ::sdr::overlay::OverlayRollingRectangleStriped( - rStartPos, rStartPos, sal_False); + rStartPos, rStartPos, false); pTargetOverlay->add(*aNew); maObjects.append(*aNew); } @@ -1466,130 +1466,6 @@ void SdrPaintView::SetApplicationDocumentColor(Color aDocumentColor) } } -// declaration extracted from svdedxv.cxx -#define SPOTCOUNT 5 - -Color SdrPaintView::CalcBackgroundColor( const Rectangle& rArea, - const SetOfByte& rVisibleLayers, - const SdrPage& rCurrPage ) const -{ - // code extracted from SdrObjEditView::ImpGetTextEditBackgroundColor - svtools::ColorConfig aColorConfig; - Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor); - - // #98988# test if we are in High contrast mode; if yes, take - // application background color - // #10049# wrong, always use svtools::DOCCOLOR as default and use document settings if - // not hc mode - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - - if(!rStyleSettings.GetHighContrastMode()) - { - // Ok, dann eben die Page durchsuchen! - Point aSpotPos[SPOTCOUNT]; - Color aSpotColor[SPOTCOUNT]; - ULONG nHeight( rArea.GetSize().Height() ); - ULONG nWidth( rArea.GetSize().Width() ); - ULONG nWidth14 = nWidth / 4; - ULONG nHeight14 = nHeight / 4; - ULONG nWidth34 = ( 3 * nWidth ) / 4; - ULONG nHeight34 = ( 3 * nHeight ) / 4; - - USHORT i; - for ( i = 0; i < SPOTCOUNT; i++ ) - { - // Es wird anhand von fuenf Spots die Farbe untersucht - switch ( i ) - { - case 0 : - { - // Center-Spot - aSpotPos[i] = rArea.Center(); - } - break; - - case 1 : - { - // TopLeft-Spot - aSpotPos[i] = rArea.TopLeft(); - aSpotPos[i].X() += nWidth14; - aSpotPos[i].Y() += nHeight14; - } - break; - - case 2 : - { - // TopRight-Spot - aSpotPos[i] = rArea.TopLeft(); - aSpotPos[i].X() += nWidth34; - aSpotPos[i].Y() += nHeight14; - } - break; - - case 3 : - { - // BottomLeft-Spot - aSpotPos[i] = rArea.TopLeft(); - aSpotPos[i].X() += nWidth14; - aSpotPos[i].Y() += nHeight34; - } - break; - - case 4 : - { - // BottomRight-Spot - aSpotPos[i] = rArea.TopLeft(); - aSpotPos[i].X() += nWidth34; - aSpotPos[i].Y() += nHeight34; - } - break; - - } - - aSpotColor[i] = Color( COL_WHITE ); - rCurrPage.GetFillColor(aSpotPos[i], rVisibleLayers, /*bLayerSortedRedraw,*/ aSpotColor[i]); - } - - USHORT aMatch[SPOTCOUNT]; - - for ( i = 0; i < SPOTCOUNT; i++ ) - { - // Wurden gleiche Spot-Farben gefuden? - aMatch[i] = 0; - - for ( USHORT j = 0; j < SPOTCOUNT; j++ ) - { - if( j != i ) - { - if( aSpotColor[i] == aSpotColor[j] ) - { - aMatch[i]++; - } - } - } - } - - // Das hoechste Gewicht hat der Spot in der Mitte - aBackground = aSpotColor[0]; - - for ( USHORT nMatchCount = SPOTCOUNT - 1; nMatchCount > 1; nMatchCount-- ) - { - // Welche Spot-Farbe wurde am haeufigsten gefunden? - for ( i = 0; i < SPOTCOUNT; i++ ) - { - if( aMatch[i] == nMatchCount ) - { - aBackground = aSpotColor[i]; - nMatchCount = 1; // Abbruch auch der aeusseren for-Schleife - break; - } - } - } - } - - return aBackground; -} - // #114898# bool SdrPaintView::IsBufferedOutputAllowed() const { diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx index 17fbd889ca..4f051f8ecb 100644 --- a/svx/source/svdraw/svdsnpv.cxx +++ b/svx/source/svdraw/svdsnpv.cxx @@ -93,11 +93,16 @@ void ImplPageOriginOverlay::SetPosition(const basegfx::B2DPoint& rNewPosition) if(rNewPosition != maPosition) { // apply to OverlayObjects - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate( - rNewPosition.getX() - maPosition.getX(), - rNewPosition.getY() - maPosition.getY()); - maObjects.transform(aMatrix); + for(sal_uInt32 a(0); a < maObjects.count(); a++) + { + sdr::overlay::OverlayCrosshairStriped* pCandidate = + static_cast< sdr::overlay::OverlayCrosshairStriped* >(&maObjects.getOverlayObject(a)); + + if(pCandidate) + { + pCandidate->setBasePosition(rNewPosition); + } + } // remember new position maPosition = rNewPosition; @@ -167,11 +172,17 @@ void ImplHelpLineOverlay::SetPosition(const basegfx::B2DPoint& rNewPosition) if(rNewPosition != maPosition) { // apply to OverlayObjects - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate( - rNewPosition.getX() - maPosition.getX(), - rNewPosition.getY() - maPosition.getY()); - maObjects.transform(aMatrix); + // apply to OverlayObjects + for(sal_uInt32 a(0); a < maObjects.count(); a++) + { + sdr::overlay::OverlayHelplineStriped* pCandidate = + static_cast< sdr::overlay::OverlayHelplineStriped* >(&maObjects.getOverlayObject(a)); + + if(pCandidate) + { + pCandidate->setBasePosition(rNewPosition); + } + } // remember new position maPosition = rNewPosition; diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src index f577928354..595ff95bcd 100644 --- a/svx/source/svdraw/svdstr.src +++ b/svx/source/svdraw/svdstr.src @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -1127,6 +1127,20 @@ String STR_UndoMovLayer { Text [ en-US ] = "Change order of layers" ; }; +// --> OD 2009-07-09 #i73249# +String STR_UndoObjName +{ + Text [ en-US ] = "Change object name of %1 to" ; +}; +String STR_UndoObjTitle +{ + Text [ en-US ] = "Change object title of %1" ; +}; +String STR_UndoObjDescription +{ + Text [ en-US ] = "Change object description of %1" ; +}; +// <-- String STR_StandardLayerName { Text [ en-US ] = "Standard" ; diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx index 2d513942af..93c0024ecc 100644 --- a/svx/source/svdraw/svdtext.cxx +++ b/svx/source/svdraw/svdtext.cxx @@ -53,6 +53,7 @@ SdrText::SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject / SdrText::~SdrText() { + clearWeak(); delete mpOutlinerParaObject; } @@ -60,10 +61,19 @@ void SdrText::CheckPortionInfo( SdrOutliner& rOutliner ) { if(!mbPortionInfoChecked) { + // #i102062# no action when the Outliner is the HitTestOutliner, + // this will remove WrongList info at the OPO + if(mpModel && &rOutliner == &mpModel->GetHitTestOutliner()) + return; + // Optimierung: ggf. BigTextObject erzeugen mbPortionInfoChecked=true; if(mpOutlinerParaObject!=NULL && rOutliner.ShouldCreateBigTextObject()) - mpOutlinerParaObject= rOutliner.CreateParaObject(); + { + // #i102062# MemoryLeak closed + delete mpOutlinerParaObject; + mpOutlinerParaObject = rOutliner.CreateParaObject(); + } } } diff --git a/svx/source/svdraw/svdtouch.cxx b/svx/source/svdraw/svdtouch.cxx deleted file mode 100644 index 6c3fa1ecc4..0000000000 --- a/svx/source/svdraw/svdtouch.cxx +++ /dev/null @@ -1,299 +0,0 @@ -/************************************************************************* - * - * 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: svdtouch.cxx,v $ - * $Revision: 1.11 $ - * - * 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_svx.hxx" - -#include "svdtouch.hxx" -#include <svx/xpoly.hxx> -#include <tools/bigint.hxx> -#include <tools/poly.hxx> -#include <basegfx/polygon/b2dpolygon.hxx> -#include <basegfx/polygon/b2dpolygontools.hxx> - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -class ImpPolyHitCalc { -public: - long x1,x2,y1,y2; // Koordinaten des Rect, muessen sortiert sein! - FASTBOOL bEdge; // ein Punkt lag genau auf einer Kante - FASTBOOL bIntersect; // mind. 2 Punkte auf verschiedenen Seiten einer Kante - FASTBOOL bPntInRect; // mind. 1 Punkt war vollstaendig im Rect - USHORT nOCnt; // wenn Counter ungerade, dann getroffen - USHORT nUCnt; // wenn Counter ungerade, dann getroffen - USHORT nLCnt; // wenn Counter ungerade, dann getroffen - USHORT nRCnt; // wenn Counter ungerade, dann getroffen - FASTBOOL bLine; // TRUE=PolyLine, kein Polygon -public: - ImpPolyHitCalc(const Rectangle& aR, FASTBOOL bIsLine=FALSE) - { - bLine=bIsLine; - bEdge=FALSE; - bIntersect=FALSE; - bPntInRect=FALSE; - x1=aR.Left(); - x2=aR.Right(); - y1=aR.Top(); - y2=aR.Bottom(); - nOCnt=0; - nUCnt=0; - nLCnt=0; - nRCnt=0; - } - FASTBOOL IsDecided() { return bEdge || bIntersect || bPntInRect; } - void CheckPntInRect(const Point& rP) - { - if (!bPntInRect) { - bPntInRect=rP.X()>=x1 && rP.X()<=x2 && rP.Y()>=y1 && rP.Y()<=y2; - } - } - bool IsHit() { return (!bLine && (nOCnt & 1)==1) || IsDecided(); } -}; - -#define CAREFUL_MULDIV(Res,Val,Mul,Div) { \ - if (Abs(Val)>0xB504 || Abs(Mul)>0xB504) { \ - BigInt aBigTemp(Val); \ - aBigTemp*=Mul; \ - aBigTemp/=Div; \ - Res=long(aBigTemp); \ - } else { \ - Res=Val*Mul/Div; \ - } \ -} - -void ImpCheckIt(ImpPolyHitCalc& rH, long lx1, long ly1, long lx2, long ly2, - long rx1, long ry1, long rx2, long ry2, USHORT& nOCnt, USHORT& nUCnt) -{ - if ((ly1>ly2) || ((ly1==ly2) && (lx1>lx2))) { - long nTmp; // die 2 Punkte nach Y sortieren - nTmp=lx1; - lx1=lx2; - lx2=nTmp; - nTmp=ly1; - ly1=ly2; - ly2=nTmp; - } - FASTBOOL b1=FALSE,b2=FALSE,b3=FALSE,b4=FALSE; // je 1 Flag fuer jeden der 4 Punkte LO,RO,LU,RU - FASTBOOL bx1,bx2; - FASTBOOL by1=ly1<=ry1 && ly2>ry1; - FASTBOOL by2=ly1<=ry2 && ly2>ry2; - long dx(0),dy(0),a(0); - if (by1 || by2) { - dx=lx2-lx1; - dy=ly2-ly1; - } - if (by1) { // Nur wer die Scanline schneidet - bx1=lx1<rx1; // x1,y1 - bx2=lx2<rx1; - FASTBOOL bA=FALSE; // Optimierung: ggf eine Division sparen - if (bx1 && bx2) b1=TRUE; - else if (bx1 || bx2) { - long yTemp=ry1-ly1; - CAREFUL_MULDIV(a,dx,yTemp,dy); // a=dx*yTemp/dy; - a+=lx1; - bA=TRUE; - rH.bEdge=(a==rx1); - if (a<rx1) b1=TRUE; - } // x2,y1 - bx1=lx1<rx2; - bx2=lx2<rx2; - if (bx1 && bx2) b2=TRUE; - else if (bx1 || bx2) { - if (!bA) { - long yTemp=ry1-ly1; - CAREFUL_MULDIV(a,dx,yTemp,dy); - a+=lx1; - } - rH.bEdge=(a==rx2); - if (a<rx2) b2=TRUE; - } - } - if (by2) { // Nur wer die Scanline schneidet - bx1=lx1<rx1; // x1,y2 - bx2=lx2<rx1; - FASTBOOL bA=FALSE; // Optimierung: ggf eine Division sparen - if (bx1 && bx2) b3=TRUE; - else if (bx1 || bx2) { - long yTemp=ry2-ly1; - CAREFUL_MULDIV(a,dx,yTemp,dy); - a+=lx1; - bA=TRUE; - rH.bEdge=(a==rx1); - if (a<rx1) b3=TRUE; - } - bx1=lx1<rx2; // x2,y2 - bx2=lx2<rx2; - if (bx1 && bx2) b4=TRUE; - else if (bx1 || bx2) { - if (!bA) { - long yTemp=ry2-ly1; - CAREFUL_MULDIV(a,dx,yTemp,dy); - a+=lx1; - } - rH.bEdge=(a==rx2); - if (a<rx2) b4=TRUE; - } - } - if (by1 || by2) { // nun die Ergebnisse auswerten - if (by1 && by2) { // Linie durch beide Scanlines - if (b1 && b2 && b3 && b4) { nOCnt++; nUCnt++; } // Rect komplett rechts neben der Linie - else if (b1 || b2 || b3 || b4) rH.bIntersect=TRUE; // Nur zum Teil->Schnittpunkt - } else { // ansonsten Ober- und Unterkante des Rects getrennt betrachten - if (by1) { // Linie durch Oberkante - if (b1 && b2) nOCnt++; // Oberkante komplett rechts neben der Linie - else if (b1 || b2) rH.bIntersect=TRUE; // Nur zum Teil->Schnittpunkt - } - if (by2) { // Linie durch Unterkante - if (b3 && b4) nUCnt++; // Unterkante komplett rechts neben der Linie - else if (b3 || b4) rH.bIntersect=TRUE; // Nur zum Teil->Schnittpunkt - } - } - } -} - -void CheckPolyHit(const Polygon& rPoly, ImpPolyHitCalc& rH) -{ - USHORT nAnz=rPoly.GetSize(); - if (nAnz==0) return; - if (nAnz==1) { rH.CheckPntInRect(rPoly[0]); return; } - Point aPt0=rPoly[USHORT(nAnz-1)]; - rH.CheckPntInRect(aPt0); - USHORT i=0; - if (rH.bLine) { - aPt0=rPoly[0]; - i++; - } - for (; i<nAnz && !rH.IsDecided(); i++) { - Point aP1(aPt0); - Point aP2(rPoly[i]); - rH.CheckPntInRect(aP2); - if (!rH.IsDecided()) { - ImpCheckIt(rH,aP1.X(),aP1.Y(),aP2.X(),aP2.Y(),rH.x1,rH.y1,rH.x2,rH.y2,rH.nOCnt,rH.nUCnt); - ImpCheckIt(rH,aP1.Y(),aP1.X(),aP2.Y(),aP2.X(),rH.y1,rH.x1,rH.y2,rH.x2,rH.nLCnt,rH.nRCnt); - } - aPt0=rPoly[i]; - } - if (!rH.bLine) { // Sicherheitshalber nochmal checken - if ((rH.nOCnt&1)!=(rH.nUCnt&1)) rH.bIntersect=TRUE; // da wird wohl eine durchgegangen sein - if ((rH.nLCnt&1)!=(rH.nRCnt&1)) rH.bIntersect=TRUE; // da wird wohl eine durchgegangen sein - if ((rH.nOCnt&1)!=(rH.nLCnt&1)) rH.bIntersect=TRUE; // da wird wohl eine durchgegangen sein - } -} - -bool IsRectTouchesLine(const Point& rPt1, const Point& rPt2, const Rectangle& rHit) -{ - Polygon aPol(2); - aPol[0]=rPt1; - aPol[1]=rPt2; - ImpPolyHitCalc aHit(rHit,TRUE); - CheckPolyHit(aPol,aHit); - return aHit.IsHit(); -} - -bool IsRectTouchesLine(const Polygon& rLine, const Rectangle& rHit) -{ - ImpPolyHitCalc aHit(rHit,TRUE); - CheckPolyHit(rLine,aHit); - return aHit.IsHit(); -} - -bool IsRectTouchesLine(const PolyPolygon& rLine, const Rectangle& rHit) -{ - ImpPolyHitCalc aHit(rHit,TRUE); - USHORT nAnz=rLine.Count(); - for (USHORT nNum=0; nNum<nAnz && !aHit.IsHit(); nNum++) { - CheckPolyHit(rLine[nNum],aHit); - } - return aHit.IsHit(); -} - -BYTE CheckPointTouchesPoly(const Polygon& rPoly, const Point& rHit) // 0=Ausserhalb, 1=Innerhalb, 2=Beruehrung -{ - USHORT nAnz=rPoly.GetSize(); - if (nAnz<2) return FALSE; - FASTBOOL bEdge=FALSE; - USHORT nCnt=0; - Point aPt0=rPoly[USHORT(nAnz-1)]; - for (USHORT i=0; i<nAnz && !bEdge; i++) { - Point aP1(rPoly[i]); - Point aP2(aPt0); - if ((aP1.Y()>aP2.Y()) || ((aP1.Y()==aP2.Y()) && (aP1.X()>aP2.X()))) { Point aTmp(aP1); aP1=aP2; aP2=aTmp; } - bEdge=((aP1.X()==aP2.X()) && (rHit.X()==aP1.X()) && (rHit.Y()>=aP1.Y()) && (rHit.Y()<=aP2.Y())) || - ((aP1.Y()==aP2.Y()) && (rHit.Y()==aP1.Y()) && (rHit.X()>=aP1.X()) && (rHit.X()<=aP2.X())) || - (rHit.X()==aP1.X()) && (rHit.Y()==aP1.Y()); - if (!bEdge && aP1.Y()<=rHit.Y() && aP2.Y()>rHit.Y()) { // Nur wer die Scanline schneidet - FASTBOOL bx1=aP1.X()<rHit.X(); - FASTBOOL bx2=aP2.X()<rHit.X(); - if (bx1 && bx2) nCnt++; - else if (bx1 || bx2) { - long dx=aP2.X()-aP1.X(); - long dy=aP2.Y()-aP1.Y(); - long yTemp=rHit.Y()-aP1.Y(); - long xTemp; - if (Abs(dx)>0xB504 || Abs(yTemp)>0xB504) { // gegen Integerueberlaeufe - BigInt aBigTemp(dx); - aBigTemp*=yTemp; - aBigTemp/=dy; - xTemp=long(aBigTemp); - } else { - xTemp=dx*yTemp /dy; - } - xTemp+=aP1.X(); - bEdge=(xTemp==rHit.X()); - if (xTemp<rHit.X()) nCnt++; - } - } - aPt0=rPoly[i]; - } - if (bEdge) return 2; - return (nCnt & 1)==1; -} - -bool IsPointInsidePoly(const Polygon& rPoly, const Point& rHit) -{ - return CheckPointTouchesPoly(rPoly,rHit)!=0; -} - -bool IsPointInsidePoly(const PolyPolygon& rPoly, const Point& rHit) -{ - FASTBOOL bInside=FALSE; - FASTBOOL bEdge=FALSE; - USHORT nAnz=rPoly.Count(); - for (USHORT i=0; i<nAnz && !bEdge; i++) { - BYTE n=CheckPointTouchesPoly(rPoly.GetObject(i),rHit); - bEdge=n==2; - if (n==1) bInside=!bInside; - } - return bInside || bEdge; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/svx/source/svdraw/svdtxhdl.cxx b/svx/source/svdraw/svdtxhdl.cxx deleted file mode 100644 index d64dcad177..0000000000 --- a/svx/source/svdraw/svdtxhdl.cxx +++ /dev/null @@ -1,400 +0,0 @@ -/************************************************************************* - * - * 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: svdtxhdl.cxx,v $ - * $Revision: 1.29 $ - * - * 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_svx.hxx" - -#include "svdtxhdl.hxx" -#include <limits.h> -#include "svditext.hxx" -#include <svx/svdmodel.hxx> -#include <svx/svdpage.hxx> -#include <svx/svdogrp.hxx> -#include <svx/svdotext.hxx> -#include <svx/svdoutl.hxx> -#include <svx/outliner.hxx> -#include <svx/outlobj.hxx> -#include <svx/svxfont.hxx> -#include <svx/xlnclit.hxx> -#include <svx/xlnwtit.hxx> -#include <svx/xflclit.hxx> -#include <vcl/metric.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> - -#include <com/sun/star/i18n/ScriptType.hdl> -#include <com/sun/star/i18n/XBreakIterator.hpp> -#include <comphelper/processfactory.hxx> - -#include <com/sun/star/i18n/CharacterIteratorMode.hdl> -#include "unolingu.hxx" -#include <basegfx/polygon/b2dpolygon.hxx> -#include <basegfx/polygon/b2dpolygontools.hxx> -#include <basegfx/matrix/b2dhommatrix.hxx> -#include <svtools/itemset.hxx> - -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::i18n; - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -ImpTextPortionHandler::ImpTextPortionHandler(SdrOutliner& rOutln, const SdrTextObj& rTxtObj): - rOutliner(rOutln), - rTextObj(rTxtObj) -{ - SdrModel* pModel = rTextObj.GetModel(); - MapMode aMap=aVDev.GetMapMode(); - - aMap.SetMapUnit(pModel->GetScaleUnit()); - aMap.SetScaleX(pModel->GetScaleFraction()); - aMap.SetScaleY(pModel->GetScaleFraction()); - aVDev.SetMapMode(aMap); -} - -void ImpTextPortionHandler::ConvertToPathObj(SdrObjGroup& rGroup, FASTBOOL bPoly) -{ - bToPoly=bPoly; - pGroup=&rGroup; - - Rectangle aAnchorRect; - Rectangle aTextRect; - SdrFitToSizeType eFit=rTextObj.GetFitToSize(); - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES); - // Bei TakeTextRect wird u.a. auch der Text in - // den Outliner gesteckt - rTextObj.TakeTextRect(rOutliner,aTextRect,FALSE,&aAnchorRect); - maTextRect=aTextRect; - if (bFitToSize) maTextRect=aAnchorRect; - rOutliner.SetDrawPortionHdl(LINK(this,ImpTextPortionHandler,ConvertHdl)); - rOutliner.StripPortions(); - rOutliner.SetDrawPortionHdl(Link()); - rOutliner.Clear(); - - if(bFitToSize) - { - Fraction nX(aAnchorRect.Right()-aAnchorRect.Left(),aTextRect.Right()-aTextRect.Left()); - Fraction nY(aAnchorRect.Bottom()-aAnchorRect.Top(),aTextRect.Bottom()-aTextRect.Top()); - - // #95395# scale from top-right when vertical text - if(rOutliner.IsVertical()) - pGroup->NbcResize(aAnchorRect.TopRight(),nX,nY); - else - pGroup->NbcResize(aAnchorRect.TopLeft(),nX,nY); - } - if (rTextObj.aGeo.nDrehWink!=0) { // #35825# Rotieren erst nach Resize (wg. FitToSize) - pGroup->NbcRotate(maTextRect.TopLeft(),rTextObj.aGeo.nDrehWink,rTextObj.aGeo.nSin,rTextObj.aGeo.nCos); - } -} - -// #101498# Helper class to remember text portions in sorted manner -class ImpRecordPortion -{ -public: - Point maPosition; - String maText; - xub_StrLen mnTextStart; - xub_StrLen mnTextLength; - sal_uInt16 mnPara; - xub_StrLen mnIndex; - - // #102819# Here SvxFont needs to be used instead of Font - SvxFont maFont; - - sal_Int32* mpDXArray; - sal_uInt8 mnBiDiLevel; - - ImpRecordPortion(DrawPortionInfo* pInfo); - ~ImpRecordPortion(); - - sal_uInt8 GetBiDiLevel() const { return mnBiDiLevel; } -}; - -ImpRecordPortion::ImpRecordPortion(DrawPortionInfo* pInfo) -: maPosition(pInfo->mrStartPos), - maText(pInfo->mrText), - mnTextStart((xub_StrLen)pInfo->mnTextStart), - mnTextLength((xub_StrLen)pInfo->mnTextLen), - mnPara(pInfo->mnPara), - mnIndex(pInfo->mnIndex), - maFont(pInfo->mrFont), - mpDXArray(NULL), - mnBiDiLevel(pInfo->GetBiDiLevel()) -{ - if(pInfo->mpDXArray) - { - mpDXArray = new sal_Int32[pInfo->mnTextLen]; - - for(sal_uInt32 a(0L); a < pInfo->mnTextLen; a++) - { - mpDXArray[a] = pInfo->mpDXArray[a]; - } - } -} - -ImpRecordPortion::~ImpRecordPortion() -{ - if(mpDXArray) - { - delete[] mpDXArray; - } -} - -IMPL_LINK(ImpTextPortionHandler,ConvertHdl,DrawPortionInfo*,pInfo) -{ - // maTextRect enthaelt den Ausgabebereich des Textobjekts - BOOL bIsVertical(rOutliner.IsVertical()); - Point aPos2(maTextRect.TopLeft() + pInfo->mrStartPos); - Color aColor(pInfo->mrFont.GetColor()); - - if(bIsVertical) - aPos2 = maTextRect.TopRight() + pInfo->mrStartPos; - - Point aStartPos(aPos2); - SfxItemSet aAttrSet((SfxItemPool&)(*rTextObj.GetObjectItemPool())); - long nHochTief(pInfo->mrFont.GetEscapement()); - FontMetric aFontMetric(aVDev.GetFontMetric()); - sal_Int32 nLineLen(0L); - - Font aFont( pInfo->mrFont ); - - if( nHochTief) - { - // shrink the font for sub-/superscripting - long nPercent(pInfo->mrFont.GetPropr()); - - if(nPercent != 100) - { - Size aSize(aFont.GetSize()); - aSize.Height() = (aSize.Height() * nPercent +50) / 100; - aSize.Width() = (aSize.Width() * nPercent +50) / 100; - aFont.SetSize(aSize); - } - - sal_Bool bNeg(nHochTief < 0); - - if(bNeg) - nHochTief = -nHochTief; - - nHochTief = (nHochTief * pInfo->mrFont.GetSize().Height() +50) /100; - - if(bNeg) - nHochTief = -nHochTief; - } - - aFont.SetOrientation( 0 ); - aVDev.SetFont( aFont ); - - if(bIsVertical) - // #83068# - aPos2.X() += aFontMetric.GetAscent() + nHochTief; - else - aPos2.Y() -= aFontMetric.GetAscent() + nHochTief; - - if (pInfo->mrFont.IsOutline()) - { - aAttrSet.Put(XLineColorItem(String(),aColor)); - aAttrSet.Put(XLineStyleItem(XLINE_SOLID)); - aAttrSet.Put(XLineWidthItem(0)); - aAttrSet.Put(XFillStyleItem(XFILL_NONE)); - } - else - { - aAttrSet.Put(XFillColorItem(String(),aColor)); - aAttrSet.Put(XLineStyleItem(XLINE_NONE)); - aAttrSet.Put(XFillStyleItem(XFILL_SOLID)); - } - - // #100318# convert in a single step - // #101499# Use GetTextOutlines and a PolyPolyVector now - PolyPolyVector aPolyPolyVector; - if(aVDev.GetTextOutlines(aPolyPolyVector, pInfo->mrText, pInfo->mnTextStart, pInfo->mnTextStart, pInfo->mnTextLen) - && aPolyPolyVector.size()) - { - for(sal_uInt32 a(0); a < aPolyPolyVector.size(); a++) - { - PolyPolygon aPolyPoly(aPolyPolyVector[a]); - - if(aPolyPoly.Count() > 0 && aPolyPoly[0].GetSize() > 0) - { - basegfx::B2DPolyPolygon aPolyPolygon(aPolyPoly.getB2DPolyPolygon()); - basegfx::B2DHomMatrix aMatrix; - - // rotate 270 degree if vertical since result is unrotated - if(pInfo->mrFont.GetOrientation()) - { - double fAngle(F_PI * (pInfo->mrFont.GetOrientation() % 3600) / 1800.0); - aMatrix.rotate(fAngle); - } - - // result is baseline oriented, thus move one line height, too - if(bIsVertical) - { - aMatrix.translate(-aFontMetric.GetAscent(), 0.0); - } - else - { - aMatrix.translate(0.0, aFontMetric.GetAscent()); - } - - // move to output coordinates - aMatrix.translate(aPos2.X(), aPos2.Y()); - - // transform - aPolyPolygon.transform(aMatrix); - - // create object - SdrObject* pObj = rTextObj.ImpConvertMakeObj(aPolyPolygon, sal_True, !bToPoly, sal_True); - pObj->SetMergedItemSet(aAttrSet); - pGroup->GetSubList()->InsertObject(pObj); - } - } - - nLineLen = pInfo->mpDXArray[pInfo->mnTextLen - 1]; - } - - FontUnderline eUndl=pInfo->mrFont.GetUnderline(); - FontStrikeout eStrk=pInfo->mrFont.GetStrikeout(); - if (eUndl!=UNDERLINE_NONE) { - FASTBOOL bDouble=eUndl==UNDERLINE_DOUBLE; - long nDescent=aFontMetric.GetDescent(); - long nAscend=aFontMetric.GetAscent(); - long nDick=nDescent / (bDouble ? 5 : 3); - long nDist=(nDescent-nDick*2)/3; // Linienabstand bei doppelt - basegfx::B2DPolyPolygon aPolyPolygon; - - if (eUndl!=UNDERLINE_DOTTED) { - Point aPoint(0,0); - XPolygon aXP(Rectangle(aPoint,bIsVertical ? Point(nDick,nLineLen) : Point(nLineLen,nDick))); - if(bIsVertical) - aXP.Move(nAscend-nDist,0); - aPolyPolygon.append(aXP.getB2DPolygon()); - if (bDouble) { - if(bIsVertical) - aXP.Move(-(nDick+nDist),0); - else - aXP.Move(0,nDick+nDist); - aPolyPolygon.append(aXP.getB2DPolygon()); - } - } else { - Point aPoint(0,0); - XPolygon aXP(Rectangle(aPoint,Point(nDick,nDick))); - long n=0; - while (n<=nLineLen) { - if (n+nDick>nLineLen) { // ler letzte Dot ggf. etwas schmaler - aXP=XPolygon(Rectangle( - bIsVertical ? Point(0,n) : Point(n,0), - bIsVertical ? Point(nDick,nLineLen) : Point(nLineLen,nDick))); - } - aPolyPolygon.append(aXP.getB2DPolygon()); - if(bIsVertical) - aXP.Move(0,2*nDick); - else - aXP.Move(2*nDick,0); - n+=2*nDick; - } - } - - long y=nDescent-nDick; // y-Position der Striche zur Baseline bestimmen - if (bDouble) y-=nDick+nDist; - y=(y+1)/2; - - basegfx::B2DHomMatrix aMatrix; - - if(bIsVertical) - { - aMatrix.translate(aStartPos.X() - (y - nHochTief), aStartPos.Y()); - } - else - { - aMatrix.translate(aStartPos.X(), aStartPos.Y() + y - nHochTief); - } - - aPolyPolygon.transform(aMatrix); - - // maTextRect enthaelt den Ausgabebereich des Textobjekts - SdrObject* pObj=rTextObj.ImpConvertMakeObj(aPolyPolygon, sal_True, !bToPoly, sal_True); - pObj->SetMergedItemSet(aAttrSet); - pGroup->GetSubList()->InsertObject(pObj); - } - if (eStrk!=STRIKEOUT_NONE) { - FASTBOOL bDouble=eStrk==STRIKEOUT_DOUBLE; - long nDescent=aFontMetric.GetDescent(); - //long nAscend=aFontMetric.GetAscent(); - long nDick=nDescent / (bDouble ? 5 : 3); - long nDist=(nDescent-nDick*2)/3; // Linienabstand bei doppelt - basegfx::B2DPolyPolygon aPolyPolygon; - - const Point aPoint(0,0); - const Rectangle aRect(aPoint,bIsVertical ? Point(nDick,nLineLen) : Point(nLineLen,nDick)); - const basegfx::B2DRange aRectRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom()); - basegfx::B2DPolygon aPolyFromRect(basegfx::tools::createPolygonFromRect(aRectRange)); - aPolyPolygon.append(aPolyFromRect); - - if (bDouble) - { - basegfx::B2DHomMatrix aMatrix; - - if(bIsVertical) - aMatrix.translate(-(nDick+nDist), 0.0); - else - aMatrix.translate(0.0, nDick+nDist); - - aPolyFromRect.transform(aMatrix); - aPolyPolygon.append(aPolyFromRect); - } - - // y-Position der Striche zur Baseline bestimmen - long y=-(long)(aFontMetric.GetAscent()-aFontMetric.GetIntLeading()+1)/3; - if (!bDouble) y-=(nDick+1)/2; - else y-=nDick+(nDist+1)/2; - - basegfx::B2DHomMatrix aMatrix; - - if(bIsVertical) - { - aMatrix.translate(aStartPos.X() - (y - nHochTief), aStartPos.Y()); - } - else - { - aMatrix.translate(aStartPos.X(), aStartPos.Y() + y - nHochTief); - } - - aPolyPolygon.transform(aMatrix); - - // maTextRect enthaelt den Ausgabebereich des Textobjekts - SdrObject* pObj=rTextObj.ImpConvertMakeObj(aPolyPolygon, sal_True, !bToPoly, sal_True); - pObj->SetMergedItemSet(aAttrSet); - pGroup->GetSubList()->InsertObject(pObj); - } - - return 0; -} - -// eof diff --git a/svx/source/svdraw/svdtxhdl.hxx b/svx/source/svdraw/svdtxhdl.hxx deleted file mode 100644 index 0a15886e83..0000000000 --- a/svx/source/svdraw/svdtxhdl.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************* - * - * 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: svdtxhdl.hxx,v $ - * $Revision: 1.9 $ - * - * 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 _SVDTXHDL_HXX -#define _SVDTXHDL_HXX - -#include <vcl/virdev.hxx> -#include <tools/poly.hxx> -#include <tools/link.hxx> - -//************************************************************ -// Vorausdeklarationen -//************************************************************ - -class SdrOutliner; -class DrawPortionInfo; -class SdrTextObj; -class SdrObjGroup; -class SdrModel; - -//************************************************************ -// ImpTextPortionHandler -//************************************************************ - -class ImpTextPortionHandler -{ - VirtualDevice aVDev; - SdrOutliner& rOutliner; - const SdrTextObj& rTextObj; - - // Variablen fuer ConvertToPathObj - SdrObjGroup* pGroup; - FASTBOOL bToPoly; - Rectangle maTextRect; - -public: - ImpTextPortionHandler(SdrOutliner& rOutln, const SdrTextObj& rTxtObj); - void ConvertToPathObj(SdrObjGroup& rGroup, FASTBOOL bToPoly); - - DECL_LINK(ConvertHdl,DrawPortionInfo*); -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -#endif //_SVDTXHDL_HXX - diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index ab9c73ef8e..896e4d4aee 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -682,8 +682,8 @@ void SdrUndoGeoObj::Undo() // #97172# // only repaint, no objectchange pObj->ActionChanged(); - } - else + } + else { if (pRedoGeo!=NULL) delete pRedoGeo; pRedoGeo=pObj->GetGeoData(); @@ -789,7 +789,7 @@ void SdrUndoRemoveObj::Undo() void SdrUndoRemoveObj::Redo() { DBG_ASSERT(pObj->IsInserted(),"RedoRemoveObj: pObj ist nicht Inserted"); - if (pObj->IsInserted()) + if (pObj->IsInserted()) { ImplUnmarkObject( pObj ); E3DModifySceneSnapRectUpdater aUpdater(pObj); @@ -808,7 +808,7 @@ void SdrUndoInsertObj::Undo() ImpShowPageOfThisObject(); DBG_ASSERT(pObj->IsInserted(),"UndoInsertObj: pObj ist nicht Inserted"); - if (pObj->IsInserted()) + if (pObj->IsInserted()) { ImplUnmarkObject( pObj ); @@ -987,7 +987,7 @@ void SdrUndoReplaceObj::Redo() DBG_ASSERT(pObj->IsInserted(),"SdrUndoReplaceObj::Redo(): Altes Objekt ist nicht inserted!"); SetOldOwner(TRUE); SetNewOwner(FALSE); - + ImplUnmarkObject( pObj ); pObjList->ReplaceObject(pNewObj,nOrdNum); @@ -1146,7 +1146,7 @@ void SdrUndoObjSetText::Redo() { // Text fuer Undo kopieren, denn SetOutlinerParaObject() ist Eigentumsuebereignung OutlinerParaObject* pText1 = pNewText; - + if(pText1) pText1 = new OutlinerParaObject(*pText1); @@ -1193,7 +1193,7 @@ void SdrUndoObjSetText::SdrRepeat(SdrView& rView) { SdrObject* pObj2=rML.GetMark(nm)->GetMarkedSdrObj(); SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pObj2); - if (pTextObj!=NULL) + if (pTextObj!=NULL) { if( bUndo ) rView.AddUndo(new SdrUndoObjSetText(*pTextObj,0)); @@ -1219,6 +1219,95 @@ bool SdrUndoObjSetText::CanSdrRepeat(SdrView& rView) const return bOk; } +// --> OD 2009-07-09 #i73249# +SdrUndoObjStrAttr::SdrUndoObjStrAttr( SdrObject& rNewObj, + const ObjStrAttrType eObjStrAttr, + const String& sOldStr, + const String& sNewStr) + : SdrUndoObj( rNewObj ), + meObjStrAttr( eObjStrAttr ), + msOldStr( sOldStr ), + msNewStr( sNewStr ) +{ +} + +void SdrUndoObjStrAttr::Undo() +{ + ImpShowPageOfThisObject(); + + switch ( meObjStrAttr ) + { + case OBJ_NAME: + { + pObj->SetName( msOldStr ); + } + break; + case OBJ_TITLE: + { + pObj->SetTitle( msOldStr ); + } + break; + case OBJ_DESCRIPTION: + { + pObj->SetDescription( msOldStr ); + } + break; + } +} + +void SdrUndoObjStrAttr::Redo() +{ + switch ( meObjStrAttr ) + { + case OBJ_NAME: + { + pObj->SetName( msNewStr ); + } + break; + case OBJ_TITLE: + { + pObj->SetTitle( msNewStr ); + } + break; + case OBJ_DESCRIPTION: + { + pObj->SetDescription( msNewStr ); + } + break; + } + + ImpShowPageOfThisObject(); +} + +String SdrUndoObjStrAttr::GetComment() const +{ + String aStr; + switch ( meObjStrAttr ) + { + case OBJ_NAME: + { + ImpTakeDescriptionStr( STR_UndoObjName, aStr ); + aStr += sal_Unicode(' '); + aStr += sal_Unicode('\''); + aStr += msNewStr; + aStr += sal_Unicode('\''); + } + break; + case OBJ_TITLE: + { + ImpTakeDescriptionStr( STR_UndoObjTitle, aStr ); + } + break; + case OBJ_DESCRIPTION: + { + ImpTakeDescriptionStr( STR_UndoObjDescription, aStr ); + } + break; + } + + return aStr; +} + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // @@ -1726,6 +1815,15 @@ SdrUndoAction* SdrUndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_ return new SdrUndoObjSetText( rNewObj, nText ); } +SdrUndoAction* SdrUndoFactory::CreateUndoObjectStrAttr( SdrObject& rObject, + SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, + String sOldStr, + String sNewStr ) +{ + return new SdrUndoObjStrAttr( rObject, eObjStrAttrType, sOldStr, sNewStr ); +} + + // layer SdrUndoAction* SdrUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) { diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index bdc10c04ee..92b64f3501 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -55,13 +55,12 @@ #include "svx/svddrgmt.hxx" #include "svx/svdoutl.hxx" #include "svx/svdotable.hxx" - -// #90477# #include <tools/tenccvt.hxx> #include <svx/sdr/overlay/overlaypolypolygon.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> #include <sdrpaintwindow.hxx> #include <svx/sdrpagewindow.hxx> +#include <svx/sdrhittesthelper.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -489,7 +488,9 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pHitObj); if (pTextObj!=NULL && pTextObj->HasText()) { - BOOL bTEHit=pTextObj->IsTextEditHit(aLocalLogicPosition,0/*nHitTolLog*/,&pPV->GetVisibleLayers()); + bool bTEHit(pPV && + SdrObjectPrimitiveHit(*pTextObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true)); + if (bTEHit) { Rectangle aTextRect; @@ -566,11 +567,15 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co if(!bBoundRectHit) { - BOOL bTEHit=pHitObj->IsTextEditHit(aLocalLogicPosition,0,&pPV->GetVisibleLayers()); + bool bTEHit(pPV && + SdrObjectPrimitiveHit(*pHitObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true)); // TextEdit an Objekten im gesperrten Layer if (pPV->GetLockedLayers().IsSet(pHitObj->GetLayer())) + { bTEHit=FALSE; + } + if (bTEHit) { rVEvt.pRootObj=pObj; diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index af00499280..4d717d4dfa 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -554,7 +554,17 @@ Bitmap SdrExchangeView::GetMarkedObjBitmap( BOOL bNoVDevIfOneBmpMarked ) const if( !aBmp ) { const Graphic aGraphic( GetMarkedObjMetaFile( bNoVDevIfOneBmpMarked ) ); - aBmp = aGraphic.GetBitmap(); + + // #i102089# support user's settings of AA and LineSnap when the MetaFile gets + // rasterconverted to a bitmap + const SvtOptionsDrawinglayer aDrawinglayerOpt; + const GraphicConversionParameters aParameters( + Size(), + false, + aDrawinglayerOpt.IsAntiAliasing(), + aDrawinglayerOpt.IsSnapHorVerLinesToDiscrete()); + + aBmp = aGraphic.GetBitmap(aParameters); } } @@ -687,17 +697,16 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject* aOut.EnableOutput( FALSE ); aOut.SetMapMode( aMap ); aMtf.Record( &aOut ); - - // aXOut.SetOffset( Point( -aBoundRect.Left(), -aBoundRect.Top() ) ); - // #i92760# offset set in wrong direction, corrected - MapMode aOffsetMapMode(aOut.GetMapMode()); - aOffsetMapMode.SetOrigin(Point(-aBoundRect.Left(), -aBoundRect.Top())); - aOut.SetMapMode(aOffsetMapMode); - pObj->SingleObjectPainter( aOut ); // #110094#-17 - aMtf.Stop(); aMtf.WindStart(); + + // #i99268# replace the original offset from using XOutDev's SetOffset + // NOT (as tried with #i92760#) with another MapMode which gets recorded + // by the Metafile itself (what always leads to problems), but by hardly + // moving the result + aMtf.Move(-aBoundRect.Left(), -aBoundRect.Top()); + aMtf.SetPrefMapMode( aMap ); aMtf.SetPrefSize( aBoundRect.GetSize() ); diff --git a/svx/source/svrtf/makefile.mk b/svx/source/svrtf/makefile.mk index 8dbbd79a82..950036034d 100644 --- a/svx/source/svrtf/makefile.mk +++ b/svx/source/svrtf/makefile.mk @@ -36,6 +36,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch PRJNAME=svx TARGET=svxrtf +LIBTARGET=NO AUTOSEG=true # --- Settings ----------------------------------------------------- @@ -48,11 +49,17 @@ AUTOSEG=true EXCEPTIONSFILES= \ $(SLO)$/svxrtf.obj -SLOFILES = \ - $(SLO)$/rtfgrf.obj \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/rtfitem.obj \ $(SLO)$/svxrtf.obj +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/rtfgrf.obj + +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + # ========================================================================== .INCLUDE : target.mk diff --git a/svx/source/svrtf/rtfgrf.cxx b/svx/source/svrtf/rtfgrf.cxx index eb9ca01c67..4262daac92 100644 --- a/svx/source/svrtf/rtfgrf.cxx +++ b/svx/source/svrtf/rtfgrf.cxx @@ -559,17 +559,4 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) return bValidBmp; } - // alle Werte auf default; wird nach einlesen der Bitmap aufgerufen ! -void SvxRTFPictureType::ResetValues() -{ // setze alle Werte RTF-Defaults - eStyle = RTF_BITMAP; - nMode = HEX_MODE; - nType = nGoalWidth = nGoalHeight = 0; - nWidth = nHeight = nWidthBytes = 0; - uPicLen = 0; - nBitsPerPixel = nPlanes = 1; - nScalX = nScalY = 100; // Skalierung in Prozent - nCropT = nCropB = nCropL = nCropR = 0; -} - /* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/svx/source/svrtf/rtfitem.cxx b/svx/source/svrtf/rtfitem.cxx index 45a0d0f461..471b00d497 100644 --- a/svx/source/svrtf/rtfitem.cxx +++ b/svx/source/svrtf/rtfitem.cxx @@ -1257,12 +1257,16 @@ ATTR_SETEMPHASIS: ReadTabAttr( nToken, *pSet ); /* - cmc: #i76140, he who reads the { must read the } + cmc: #i76140, he who consumed the { must consume the } We rewound to a state of { being the current - token so it is our responsibility to read the } - token. + token so it is our responsibility to consume the } + token if we consumed the {. We will not have consumed + the { if it belonged to our caller, i.e. if the { we + are handling is the "firsttoken" passed to us then + the *caller* must consume it, not us. Otherwise *we* + should consume it. */ - if (nToken == BRACELEFT) + if (nToken == BRACELEFT && !bFirstToken) { nToken = GetNextToken(); DBG_ASSERT( nToken == BRACERIGHT, diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx index a77e80a417..6066023eac 100644 --- a/svx/source/table/accessiblecell.cxx +++ b/svx/source/table/accessiblecell.cxx @@ -573,4 +573,15 @@ sal_Int32 SAL_CALL AccessibleCell::getAccessibleIndexInParent (void) throw (Runt return mnIndexInParent; } +::rtl::OUString SAL_CALL AccessibleCell::getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException) +{ + ThrowIfDisposed (); + ::vos::OGuard aSolarGuard (::Application::GetSolarMutex()); + + if( mxCell.is() ) + return mxCell->getName(); + + return AccessibleCellBase::getAccessibleName(); +} + } // end of namespace accessibility diff --git a/svx/source/table/accessiblecell.hxx b/svx/source/table/accessiblecell.hxx index f09a66a5bd..6114b540bb 100644 --- a/svx/source/table/accessiblecell.hxx +++ b/svx/source/table/accessiblecell.hxx @@ -85,6 +85,7 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int32 nIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL getAccessibleStateSet(void) throw(::com::sun::star::uno::RuntimeException); virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(void) throw(::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException); // XAccessibleComponent virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint) throw (::com::sun::star::uno::RuntimeException); diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx index ba7dd602c8..0c6beba822 100644 --- a/svx/source/table/accessibletableshape.cxx +++ b/svx/source/table/accessibletableshape.cxx @@ -160,6 +160,8 @@ Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild( sal_Int32 maChildMap[xCell] = xAccessibleCell; + xAccessibleCell->Init(); + Reference< XAccessible > xChild( xAccessibleCell.get() ); return xChild; } @@ -501,10 +503,11 @@ Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleCellAt( sal ::vos::OGuard aSolarGuard (::Application::GetSolarMutex()); checkCellPosition( nColumn, nRow ); - (void)nRow; - (void)nColumn; - Reference< XAccessible > xRet; - return xRet; + sal_Int32 nChildIndex = 0; + if( mxImpl->mxTable.is() ) + nChildIndex = mxImpl->mxTable->getColumnCount() * nRow + nColumn; + + return getAccessibleChild( nChildIndex ); } //-------------------------------------------------------------------- diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 9b3bca602e..b63ce98791 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -1757,5 +1757,71 @@ void SAL_CALL Cell::disposing( const EventObject& /*Source*/ ) throw (RuntimeExc dispose(); } +static OUString getCellName( sal_Int32 nCol, sal_Int32 nRow ) +{ + rtl::OUStringBuffer aBuf; + + if (nCol < 26*26) + { + if (nCol < 26) + aBuf.append( static_cast<sal_Unicode>( 'A' + + static_cast<sal_uInt16>(nCol))); + else + { + aBuf.append( static_cast<sal_Unicode>( 'A' + + (static_cast<sal_uInt16>(nCol) / 26) - 1)); + aBuf.append( static_cast<sal_Unicode>( 'A' + + (static_cast<sal_uInt16>(nCol) % 26))); + } + } + else + { + String aStr; + while (nCol >= 26) + { + sal_Int32 nC = nCol % 26; + aStr += static_cast<sal_Unicode>( 'A' + + static_cast<sal_uInt16>(nC)); + nCol = nCol - nC; + nCol = nCol / 26 - 1; + } + aStr += static_cast<sal_Unicode>( 'A' + + static_cast<sal_uInt16>(nCol)); + aStr.Reverse(); + aBuf.append( aStr); + } + aBuf.append( OUString::valueOf(nRow+1) ); + return aBuf.makeStringAndClear(); +} + +OUString Cell::getName() +{ + // todo: optimize! + OUString sName; + if( mxTable.is() ) try + { + Reference< XCell > xThis( static_cast< XCell* >( this ) ); + + sal_Int32 nRowCount = mxTable->getRowCount(); + sal_Int32 nColCount = mxTable->getColumnCount(); + for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ ) + { + for( sal_Int32 nCol = 0; nCol < nColCount; nCol++ ) + { + Reference< XCell > xCell( mxTable->getCellByPosition( nCol, nRow ) ); + if( xCell == xThis ) + { + return getCellName( nCol, nRow ); + } + } + } + } + catch( Exception& ) + { + } + + return sName; +} + } } diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx index 7079471e84..dd79dd1f5f 100644 --- a/svx/source/table/cell.hxx +++ b/svx/source/table/cell.hxx @@ -58,7 +58,7 @@ namespace sdr { namespace table { // ----------------------------------------------------------------------------- -class Cell : public SdrText, +class SVX_DLLPUBLIC Cell : public SdrText, public SvxUnoTextBase, public ::com::sun::star::table::XMergeableCell, public ::com::sun::star::awt::XLayoutConstrains, @@ -68,156 +68,158 @@ class Cell : public SdrText, friend class CellUndo; public: - static rtl::Reference< Cell > create( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ); + SVX_DLLPRIVATE static rtl::Reference< Cell > create( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ); // private - void dispose(); + SVX_DLLPRIVATE void dispose(); // SdrTextShape proxy bool IsTextEditActive(); - bool hasText() const; + SVX_DLLPRIVATE bool hasText() const; - void cloneFrom( const CellRef& rCell ); + SVX_DLLPRIVATE void cloneFrom( const CellRef& rCell ); - void setCellRect( ::Rectangle& rCellRect ) { maCellRect = rCellRect; } - const ::Rectangle& getCellRect() const { return maCellRect; } - ::Rectangle& getCellRect() { return maCellRect; } + SVX_DLLPRIVATE void setCellRect( ::Rectangle& rCellRect ) { maCellRect = rCellRect; } + SVX_DLLPRIVATE const ::Rectangle& getCellRect() const { return maCellRect; } + SVX_DLLPRIVATE ::Rectangle& getCellRect() { return maCellRect; } OutlinerParaObject* GetEditOutlinerParaObject() const; - void SetStyleSheet( SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr ); - virtual SfxStyleSheet* GetStyleSheet() const; + SVX_DLLPRIVATE void SetStyleSheet( SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr ); + SVX_DLLPRIVATE virtual SfxStyleSheet* GetStyleSheet() const; SfxStyleSheetPool* GetStyleSheetPool() const; - virtual const Rectangle& GetCurrentBoundRect() const; - virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const; + SVX_DLLPRIVATE virtual const Rectangle& GetCurrentBoundRect() const; + SVX_DLLPRIVATE virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const; - virtual const SfxItemSet& GetItemSet() const; - void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems); + SVX_DLLPRIVATE virtual const SfxItemSet& GetItemSet() const; + SVX_DLLPRIVATE void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems); void SetMergedItem(const SfxPoolItem& rItem); - sal_Int32 getMinimumWidth(); - sal_Int32 getMinimumHeight(); + SVX_DLLPRIVATE sal_Int32 getMinimumWidth(); + SVX_DLLPRIVATE sal_Int32 getMinimumHeight(); - long GetTextLeftDistance() const; - long GetTextRightDistance() const; - long GetTextUpperDistance() const; - long GetTextLowerDistance() const; + SVX_DLLPRIVATE long GetTextLeftDistance() const; + SVX_DLLPRIVATE long GetTextRightDistance() const; + SVX_DLLPRIVATE long GetTextUpperDistance() const; + SVX_DLLPRIVATE long GetTextLowerDistance() const; - SdrTextVertAdjust GetTextVerticalAdjust() const; + SVX_DLLPRIVATE SdrTextVertAdjust GetTextVerticalAdjust() const; SdrTextHorzAdjust GetTextHorizontalAdjust() const; - virtual void SetModel(SdrModel* pNewModel); + SVX_DLLPRIVATE virtual void SetModel(SdrModel* pNewModel); - void merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan ); - void mergeContent( const CellRef& xSourceCell ); - void replaceContentAndFormating( const CellRef& xSourceCell ); + SVX_DLLPRIVATE void merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan ); + SVX_DLLPRIVATE void mergeContent( const CellRef& xSourceCell ); + SVX_DLLPRIVATE void replaceContentAndFormating( const CellRef& xSourceCell ); - void setMerged(); + SVX_DLLPRIVATE void setMerged(); // XInterface - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& Type ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire() throw (); - virtual void SAL_CALL release() throw (); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& Type ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL acquire() throw (); + SVX_DLLPRIVATE virtual void SAL_CALL release() throw (); // XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); // XLayoutConstrains - virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw (::com::sun::star::uno::RuntimeException); // XMergeableCell - virtual ::sal_Int32 SAL_CALL getRowSpan() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getColumnSpan() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isMerged() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getRowSpan() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getColumnSpan() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::sal_Bool SAL_CALL isMerged() throw (::com::sun::star::uno::RuntimeException); // XCell - virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw (::com::sun::star::uno::RuntimeException); - virtual double SAL_CALL getValue() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setValue( double nValue ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::table::CellContentType SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getError() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual double SAL_CALL getValue() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setValue( double nValue ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::table::CellContentType SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual sal_Int32 SAL_CALL getError() throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::beans::XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XMultiPropertySet - virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::beans::XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XMultiPropertyStates - virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XFastPropertySet - virtual void SAL_CALL setFastPropertyValue( ::sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( ::sal_Int32 nHandle ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setFastPropertyValue( ::sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( ::sal_Int32 nHandle ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XText - virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); // XSimpleText - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::rtl::OUString& aString, ::sal_Bool bAbsorb ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, ::sal_Int16 nControlCharacter, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::rtl::OUString& aString, ::sal_Bool bAbsorb ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, ::sal_Int16 nControlCharacter, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); // XTextRange - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getString( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getString( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw (::com::sun::star::uno::RuntimeException); // XEventListener - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); - virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject ); + SVX_DLLPRIVATE virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject ); - void AddUndo(); + SVX_DLLPRIVATE void AddUndo(); using SvxUnoTextRangeBase::setPropertyValue; using SvxUnoTextRangeBase::getPropertyValue; - sdr::properties::TextProperties* CloneProperties( SdrObject& rNewObj, Cell& rNewCell ); + SVX_DLLPRIVATE sdr::properties::TextProperties* CloneProperties( SdrObject& rNewObj, Cell& rNewCell ); - static sdr::properties::TextProperties* CloneProperties( sdr::properties::TextProperties* pProperties, SdrObject& rNewObj, Cell& rNewCell ); + SVX_DLLPRIVATE static sdr::properties::TextProperties* CloneProperties( sdr::properties::TextProperties* pProperties, SdrObject& rNewObj, Cell& rNewCell ); - void notifyModified(); + SVX_DLLPRIVATE void notifyModified(); + + ::rtl::OUString getName(); protected: - virtual const SfxItemSet& GetObjectItemSet(); - virtual void SetObjectItem(const SfxPoolItem& rItem); + SVX_DLLPRIVATE virtual const SfxItemSet& GetObjectItemSet(); + SVX_DLLPRIVATE virtual void SetObjectItem(const SfxPoolItem& rItem); - ::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap ); + SVX_DLLPRIVATE ::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap ); private: - Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw(); - virtual ~Cell() throw(); + SVX_DLLPRIVATE Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw(); + SVX_DLLPRIVATE virtual ~Cell() throw(); const SvxItemPropertySet* mpPropSet; diff --git a/svx/source/table/celleditsource.hxx b/svx/source/table/celleditsource.hxx index b2ea75c3b4..ebd991905b 100644 --- a/svx/source/table/celleditsource.hxx +++ b/svx/source/table/celleditsource.hxx @@ -73,7 +73,7 @@ public: void lock(); void unlock(); - // the viewforwarder interface + // the SvxViewForwarder interface virtual BOOL IsValid() const; virtual Rectangle GetVisArea() const; virtual Point LogicToPixel( const Point&, const MapMode& ) const; diff --git a/svx/source/table/makefile.mk b/svx/source/table/makefile.mk index 8789cd4da8..ae0dc5eb68 100644 --- a/svx/source/table/makefile.mk +++ b/svx/source/table/makefile.mk @@ -36,6 +36,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch PRJNAME=svx TARGET=table +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE; # --- Settings ----------------------------------------------------- @@ -45,9 +46,9 @@ ENABLE_EXCEPTIONS=TRUE; # --- Files -------------------------------------------------------- -SLOFILES= \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/propertyset.obj\ - $(SLO)$/celleditsource.obj\ $(SLO)$/cell.obj\ $(SLO)$/cellrange.obj\ $(SLO)$/cellcursor.obj\ @@ -61,13 +62,19 @@ SLOFILES= \ $(SLO)$/tablelayouter.obj\ $(SLO)$/tablehandles.obj\ $(SLO)$/tablecontroller.obj\ - $(SLO)$/tabledesign.obj\ - $(SLO)$/tableundo.obj\ - $(SLO)$/accessibletableshape.obj\ + $(SLO)$/tableundo.obj + +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/celleditsource.obj \ + $(SLO)$/tabledesign.obj \ + $(SLO)$/accessibletableshape.obj \ $(SLO)$/accessiblecell.obj \ $(SLO)$/tablertfexporter.obj \ $(SLO)$/tablertfimporter.obj +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + SRS1NAME=table SRC1FILES= table.src diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 1a83e03611..d639b3e884 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1930,21 +1930,6 @@ void lcl_VertLine( OutputDevice& rDev, const Point& rTop, const Point& rBottom, // -------------------------------------------------------------------- -SdrObject* SdrTableObj::CheckHit(const Point& rPnt, USHORT /*nTol*/, const SetOfByte* pVisiLayer) const -{ - if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - return NULL; - } - - if( (rPnt.X() >= aOutRect.Left()) && (rPnt.X() <= aOutRect.Right()) && (rPnt.Y() >= aOutRect.Top()) && rPnt.Y() <= aOutRect.Bottom() ) - return const_cast<SdrObject*>(static_cast<const SdrObject*>(this)); - - return NULL; -} - -// -------------------------------------------------------------------- - void SdrTableObj::TakeObjNameSingul(XubString& rName) const { rName = ImpGetResStr(STR_ObjNameSingulTable); diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 2a9aa3ecdf..180485f3fc 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -493,7 +493,7 @@ void SvxTableController::GetState( SfxItemSet& rSet ) // -------------------------------------------------------------------- -void SvxTableController::onInsert( sal_uInt16 nSId ) +void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs ) { ::sdr::table::SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() ); if( !pTableObj ) @@ -501,6 +501,21 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) if( mxTable.is() ) try { + // + bool bInsertAfter = true; + sal_uInt16 nCount = 0; + if( pArgs ) + { + const SfxPoolItem* pItem = 0; + pArgs->GetItemState(nSId, FALSE, &pItem); + if (pItem) + { + nCount = ((const SfxInt16Item* )pItem)->GetValue(); + if(SFX_ITEM_SET == pArgs->GetItemState(SID_TABLE_PARAM_INSERT_AFTER, TRUE, &pItem)) + bInsertAfter = ((const SfxBoolItem* )pItem)->GetValue(); + } + } + CellPos aStart, aEnd; if( hasSelectedCells() ) { @@ -508,15 +523,18 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) } else { - aStart.mnCol = mxTable->getColumnCount() - 1; - aStart.mnRow = mxTable->getRowCount() - 1; - aEnd = aStart; + if( bInsertAfter ) + { + aStart.mnCol = mxTable->getColumnCount() - 1; + aStart.mnRow = mxTable->getRowCount() - 1; + aEnd = aStart; + } } if( pTableObj->IsTextEditActive() ) mpView->SdrEndTextEdit(sal_True); - RemoveSelection(); + RemoveSelection(); const OUString sSize( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ); @@ -535,8 +553,9 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) } Reference< XTableColumns > xCols( mxTable->getColumns() ); - const sal_Int32 nNewColumns = aEnd.mnCol - aStart.mnCol + 1; - xCols->insertByIndex( aEnd.mnCol + 1, nNewColumns ); + const sal_Int32 nNewColumns = (nCount == 0) ? (aEnd.mnCol - aStart.mnCol + 1) : nCount; + const sal_Int32 nNewStartColumn = aEnd.mnCol + (bInsertAfter ? 1 : 0); + xCols->insertByIndex( nNewStartColumn, nNewColumns ); for( sal_Int32 nOffset = 0; nOffset < nNewColumns; nOffset++ ) { @@ -552,7 +571,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) if( mpModel ) mpModel->SetChanged(); - aStart.mnCol = aEnd.mnCol+1; + aStart.mnCol = nNewStartColumn; aStart.mnRow = 0; aEnd.mnCol = aStart.mnCol + nNewColumns - 1; aEnd.mnRow = mxTable->getRowCount() - 1; @@ -570,8 +589,9 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) } Reference< XTableRows > xRows( mxTable->getRows() ); - const sal_Int32 nNewRows = aEnd.mnRow - aStart.mnRow + 1; - xRows->insertByIndex( aEnd.mnRow + 1, nNewRows ); + const sal_Int32 nNewRows = (nCount == 0) ? (aEnd.mnRow - aStart.mnRow + 1) : nCount; + const sal_Int32 nNewRowStart = aEnd.mnRow + (bInsertAfter ? 1 : 0); + xRows->insertByIndex( nNewRowStart, nNewRows ); for( sal_Int32 nOffset = 0; nOffset < nNewRows; nOffset++ ) { @@ -591,7 +611,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) mpModel->SetChanged(); aStart.mnCol = 0; - aStart.mnRow = aEnd.mnRow+1; + aStart.mnRow = nNewRowStart; aEnd.mnCol = mxTable->getColumnCount() - 1; aEnd.mnRow = aStart.mnRow + nNewRows - 1; break; @@ -759,7 +779,7 @@ void SvxTableController::Execute( SfxRequest& rReq ) { case SID_TABLE_INSERT_ROW: case SID_TABLE_INSERT_COL: - onInsert( nSId ); + onInsert( nSId, rReq.GetArgs() ); break; case SID_TABLE_DELETE_ROW: case SID_TABLE_DELETE_COL: @@ -1490,7 +1510,7 @@ bool SvxTableController::executeAction( sal_uInt16 nAction, bool bSelect, Window CellPos aNextCell( pTableObj->getNextCell( aSelectionEnd, true ) ); if( aSelectionEnd == aNextCell ) { - onInsert( SID_TABLE_INSERT_ROW ); + onInsert( SID_TABLE_INSERT_ROW, 0 ); aNextCell = pTableObj->getNextCell( aSelectionEnd, true ); } gotoCell( aNextCell, false, pWindow, nAction ); @@ -1952,7 +1972,6 @@ void SvxTableController::updateSelectionOverlay() if( pOverlayManager ) { // sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_INVERT; - // sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_HATCH; sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_TRANSPARENT; sdr::overlay::OverlayObjectCell* pOverlay = new sdr::overlay::OverlayObjectCell( eType, aHighlight, aRanges ); diff --git a/svx/source/table/tablecontroller.hxx b/svx/source/table/tablecontroller.hxx index 2ea934eaed..b4eecf0902 100644 --- a/svx/source/table/tablecontroller.hxx +++ b/svx/source/table/tablecontroller.hxx @@ -43,6 +43,7 @@ class SdrObjEditView; class SdrObject; +class SfxItemSet; namespace sdr { namespace table { @@ -50,97 +51,97 @@ const sal_Int16 SELTYPE_NONE = 0; const sal_Int16 SELTYPE_MOUSE = 1; const sal_Int16 SELTYPE_KEYS = 2; -class SvxTableController: public sdr::SelectionController +class SVX_DLLPUBLIC SvxTableController: public sdr::SelectionController { public: - SvxTableController( SdrObjEditView* pView, const SdrObject* pObj ); - virtual ~SvxTableController(); + SVX_DLLPRIVATE SvxTableController( SdrObjEditView* pView, const SdrObject* pObj ); + SVX_DLLPRIVATE virtual ~SvxTableController(); - virtual bool onKeyInput(const KeyEvent& rKEvt, Window* pWin); - virtual bool onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin); - virtual bool onMouseButtonUp(const MouseEvent& rMEvt, Window* pWin); - virtual bool onMouseMove(const MouseEvent& rMEvt, Window* pWin); + SVX_DLLPRIVATE virtual bool onKeyInput(const KeyEvent& rKEvt, Window* pWin); + SVX_DLLPRIVATE virtual bool onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin); + SVX_DLLPRIVATE virtual bool onMouseButtonUp(const MouseEvent& rMEvt, Window* pWin); + SVX_DLLPRIVATE virtual bool onMouseMove(const MouseEvent& rMEvt, Window* pWin); - virtual bool DeleteMarked(); + SVX_DLLPRIVATE virtual bool DeleteMarked(); - virtual void onSelectionHasChanged(); + SVX_DLLPRIVATE virtual void onSelectionHasChanged(); - virtual void GetState( SfxItemSet& rSet ); - virtual void Execute( SfxRequest& rReq ); + SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet ); + SVX_DLLPRIVATE virtual void Execute( SfxRequest& rReq ); - virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const; - virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ); + SVX_DLLPRIVATE virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const; + SVX_DLLPRIVATE virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ); // slots - void onInsert( sal_uInt16 nSId ); - void onDelete( sal_uInt16 nSId ); - void onSelect( sal_uInt16 nSId ); - void onFormatTable( SfxRequest& rReq ); - void MergeMarkedCells(); - void SplitMarkedCells(); - void DistributeColumns(); - void DistributeRows(); - void SetVertical( sal_uInt16 nSId ); + SVX_DLLPRIVATE void onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs = 0 ); + SVX_DLLPRIVATE void onDelete( sal_uInt16 nSId ); + SVX_DLLPRIVATE void onSelect( sal_uInt16 nSId ); + SVX_DLLPRIVATE void onFormatTable( SfxRequest& rReq ); + SVX_DLLPRIVATE void MergeMarkedCells(); + SVX_DLLPRIVATE void SplitMarkedCells(); + SVX_DLLPRIVATE void DistributeColumns(); + SVX_DLLPRIVATE void DistributeRows(); + SVX_DLLPRIVATE void SetVertical( sal_uInt16 nSId ); - static rtl::Reference< sdr::SelectionController > create( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController ); + SVX_DLLPRIVATE static rtl::Reference< sdr::SelectionController > create( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController ); - void MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnlyHardAttr) const; - void SetAttrToSelectedCells(const SfxItemSet& rAttr, bool bReplaceAll); + SVX_DLLPRIVATE void MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnlyHardAttr) const; + SVX_DLLPRIVATE void SetAttrToSelectedCells(const SfxItemSet& rAttr, bool bReplaceAll); - virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const; - virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll); + SVX_DLLPRIVATE virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const; + SVX_DLLPRIVATE virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll); - virtual bool GetMarkedObjModel( SdrPage* pNewPage ); - virtual bool PasteObjModel( const SdrModel& rModel ); + SVX_DLLPRIVATE virtual bool GetMarkedObjModel( SdrPage* pNewPage ); + SVX_DLLPRIVATE virtual bool PasteObjModel( const SdrModel& rModel ); - bool hasSelectedCells() const { return mbCellSelectionMode || mpView->IsTextEdit(); } + SVX_DLLPRIVATE bool hasSelectedCells() const { return mbCellSelectionMode || mpView->IsTextEdit(); } void getSelectedCells( CellPos& rFirstPos, CellPos& rLastPos ); void setSelectedCells( const CellPos& rFirstPos, const CellPos& rLastPos ); void clearSelection(); void selectAll(); - void onTableModified(); + SVX_DLLPRIVATE void onTableModified(); private: SvxTableController(SvxTableController &); // not defined void operator =(SvxTableController &); // not defined // internals - void ApplyBorderAttr( const SfxItemSet& rAttr ); - void UpdateTableShape(); + SVX_DLLPRIVATE void ApplyBorderAttr( const SfxItemSet& rAttr ); + SVX_DLLPRIVATE void UpdateTableShape(); - void SetTableStyle( const SfxItemSet* pArgs ); - void SetTableStyleSettings( const SfxItemSet* pArgs ); + SVX_DLLPRIVATE void SetTableStyle( const SfxItemSet* pArgs ); + SVX_DLLPRIVATE void SetTableStyleSettings( const SfxItemSet* pArgs ); - bool PasteObject( SdrTableObj* pPasteTableObj ); + SVX_DLLPRIVATE bool PasteObject( SdrTableObj* pPasteTableObj ); - bool checkTableObject(); - bool updateTableObject(); - const CellPos& getSelectionStart(); - void setSelectionStart( const CellPos& rPos ); - const CellPos& getSelectionEnd(); - ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellCursor > getSelectionCursor(); - void checkCell( CellPos& rPos ); + SVX_DLLPRIVATE bool checkTableObject(); + SVX_DLLPRIVATE bool updateTableObject(); + SVX_DLLPRIVATE const CellPos& getSelectionStart(); + SVX_DLLPRIVATE void setSelectionStart( const CellPos& rPos ); + SVX_DLLPRIVATE const CellPos& getSelectionEnd(); + SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellCursor > getSelectionCursor(); + SVX_DLLPRIVATE void checkCell( CellPos& rPos ); - void MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow ); + SVX_DLLPRIVATE void MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow ); - void EditCell( const CellPos& rPos, ::Window* pWindow, const ::com::sun::star::awt::MouseEvent* pMouseEvent = 0, sal_uInt16 nAction = 0 ); - bool StopTextEdit(); + SVX_DLLPRIVATE void EditCell( const CellPos& rPos, ::Window* pWindow, const ::com::sun::star::awt::MouseEvent* pMouseEvent = 0, sal_uInt16 nAction = 0 ); + SVX_DLLPRIVATE bool StopTextEdit(); - void DeleteTable(); + SVX_DLLPRIVATE void DeleteTable(); - sal_uInt16 getKeyboardAction( const KeyEvent& rKEvt, Window* pWindow ); - bool executeAction( sal_uInt16 nAction, bool bSelect, Window* pWindow ); - void gotoCell( const CellPos& rCell, bool bSelect, Window* pWindow, sal_uInt16 nAction = 0 ); + SVX_DLLPRIVATE sal_uInt16 getKeyboardAction( const KeyEvent& rKEvt, Window* pWindow ); + SVX_DLLPRIVATE bool executeAction( sal_uInt16 nAction, bool bSelect, Window* pWindow ); + SVX_DLLPRIVATE void gotoCell( const CellPos& rCell, bool bSelect, Window* pWindow, sal_uInt16 nAction = 0 ); - void StartSelection( const CellPos& rPos ); - void UpdateSelection( const CellPos& rPos ); - void RemoveSelection(); - void updateSelectionOverlay(); - void destroySelectionOverlay(); + SVX_DLLPRIVATE void StartSelection( const CellPos& rPos ); + SVX_DLLPRIVATE void UpdateSelection( const CellPos& rPos ); + SVX_DLLPRIVATE void RemoveSelection(); + SVX_DLLPRIVATE void updateSelectionOverlay(); + SVX_DLLPRIVATE void destroySelectionOverlay(); - void findMergeOrigin( CellPos& rPos ); + SVX_DLLPRIVATE void findMergeOrigin( CellPos& rPos ); DECL_LINK( UpdateHdl, void * ); diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx index 202908f65b..511616921c 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -38,60 +38,36 @@ #include <vcl/salbtype.hxx> #include <vcl/canvastools.hxx> #include <vcl/hatch.hxx> - #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/range/b2drectangle.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> - #include <svx/sdr/overlay/overlayobject.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> #include <svx/sdrpagewindow.hxx> #include <sdrpaintwindow.hxx> #include <svx/svdmrkv.hxx> #include <svx/svdpagv.hxx> - +#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> +#include <svx/sdr/overlay/overlayhatchrect.hxx> +#include <drawinglayer/primitive2d/hittestprimitive2d.hxx> namespace sdr { namespace table { -class OverlayTableEdge : public sdr::overlay::OverlayObject -{ -protected: - basegfx::B2DPolyPolygon maPolyPolygon; - - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); - - virtual void transform(const basegfx::B2DHomMatrix& rMatrix); - -public: - OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon ); - virtual ~OverlayTableEdge(); -}; - // -------------------------------------------------------------------- -class OverlayTableBorder : public sdr::overlay::OverlayObject +class OverlayTableEdge : public sdr::overlay::OverlayObject { protected: basegfx::B2DPolyPolygon maPolyPolygon; + bool mbVisible; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); - - virtual void transform(const basegfx::B2DHomMatrix& rMatrix); - - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: - OverlayTableBorder( const basegfx::B2DPolyPolygon& rPolyPolygon ); - virtual ~OverlayTableBorder(); + OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bVisible ); + virtual ~OverlayTableEdge(); }; // -------------------------------------------------------------------- @@ -134,40 +110,23 @@ sal_Int32 TableEdgeHdl::GetValidDragOffset( const SdrDragStat& rDrag ) const basegfx::B2DPolyPolygon TableEdgeHdl::getSpecialDragPoly(const SdrDragStat& rDrag) const { - return GetPolyPolygon(false, &rDrag); -} + basegfx::B2DPolyPolygon aVisible; + basegfx::B2DPolyPolygon aInvisible; -bool TableEdgeHdl::IsHdlHit(const Point& rPnt) const -{ - if( GetPointNum() != 0 ) - { - double fTol = 0.0; - if( pHdlList ) - { - SdrMarkView* pView = pHdlList->GetView(); - if( pView ) - { - OutputDevice* pOutDev = pView->GetFirstOutputDevice(); - if( pOutDev ) - { - fTol = static_cast<double>(pOutDev->PixelToLogic(Size(3, 3)).Width()); - } - } - } + // create and return visible and non-visible parts for drag + getPolyPolygon(aVisible, aInvisible, &rDrag); + aVisible.append(aInvisible); - basegfx::B2DPoint aPosition(rPnt.X(), rPnt.Y()); - if( basegfx::tools::isInEpsilonRange( maVisiblePolygon, aPosition, fTol ) ) - return sal_True; - } - return false; + return aVisible; } - -basegfx::B2DPolyPolygon TableEdgeHdl::GetPolyPolygon( bool bOnlyVisible, const SdrDragStat* pDrag /*= 0*/ ) const +void TableEdgeHdl::getPolyPolygon(basegfx::B2DPolyPolygon& rVisible, basegfx::B2DPolyPolygon& rInvisible, const SdrDragStat* pDrag) const { - basegfx::B2DPolyPolygon aRetValue; - + // changed method to create visible and invisible partial polygons in one run in + // separate PolyPolygons; both kinds are used basegfx::B2DPoint aOffset(aPos.X(), aPos.Y()); + rVisible.clear(); + rInvisible.clear(); if( pDrag ) { @@ -176,37 +135,35 @@ basegfx::B2DPolyPolygon TableEdgeHdl::GetPolyPolygon( bool bOnlyVisible, const S } basegfx::B2DPoint aStart(aOffset), aEnd(aOffset); - int nPos = mbHorizontal ? 0 : 1; - - // base line hit, check for edges TableEdgeVector::const_iterator aIter( maEdges.begin() ); + while( aIter != maEdges.end() ) { TableEdge aEdge(*aIter++); - if( aEdge.meState == Visible || ( aEdge.meState == Invisible && !bOnlyVisible ) ) - { - aStart[nPos] = aOffset[nPos] + aEdge.mnStart; - aEnd[nPos] = aOffset[nPos] + aEdge.mnEnd; + aStart[nPos] = aOffset[nPos] + aEdge.mnStart; + aEnd[nPos] = aOffset[nPos] + aEdge.mnEnd; - basegfx::B2DPolygon aPolygon; - aPolygon.append( aStart ); - aPolygon.append( aEnd ); + basegfx::B2DPolygon aPolygon; + aPolygon.append( aStart ); + aPolygon.append( aEnd ); - aRetValue.append( aPolygon ); + if(aEdge.meState == Visible) + { + rVisible.append(aPolygon); + } + else + { + rInvisible.append(aPolygon); } } - - return aRetValue; } void TableEdgeHdl::CreateB2dIAObject() { GetRidOfIAObject(); - maVisiblePolygon = GetPolyPolygon(false); - if(pHdlList && pHdlList->GetView() && !pHdlList->GetView()->areMarkHandlesHidden()) { SdrMarkView* pView = pHdlList->GetView(); @@ -214,20 +171,40 @@ void TableEdgeHdl::CreateB2dIAObject() if(pPageView) { - for(sal_uInt32 nWindow = 0; nWindow < pPageView->PageWindowCount(); nWindow++) - { - // const SdrPageViewWinRec& rPageViewWinRec = rPageViewWinList[b]; - const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(nWindow); + basegfx::B2DPolyPolygon aVisible; + basegfx::B2DPolyPolygon aInvisible; - if(rPageWindow.GetPaintWindow().OutputToWindow()) + // get visible and invisible parts + getPolyPolygon(aVisible, aInvisible, 0); + + if(aVisible.count() || aInvisible.count()) + { + for(sal_uInt32 nWindow = 0; nWindow < pPageView->PageWindowCount(); nWindow++) { - if(rPageWindow.GetOverlayManager()) - { - ::sdr::overlay::OverlayObject* pOverlayObject = - new OverlayTableEdge( GetPolyPolygon(true) ); + const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(nWindow); - rPageWindow.GetOverlayManager()->add(*pOverlayObject); - maOverlayGroup.append(*pOverlayObject); + if(rPageWindow.GetPaintWindow().OutputToWindow()) + { + if(rPageWindow.GetOverlayManager()) + { + if(aVisible.count()) + { + // create overlay object for visible parts + sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aVisible, true); + rPageWindow.GetOverlayManager()->add(*pOverlayObject); + maOverlayGroup.append(*pOverlayObject); + } + + if(aInvisible.count()) + { + // also create overlay object vor invisible parts to allow + // a standard HitTest using the primitives from that overlay object + // (see OverlayTableEdge implementation) + sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aInvisible, false); + rPageWindow.GetOverlayManager()->add(*pOverlayObject); + maOverlayGroup.append(*pOverlayObject); + } + } } } } @@ -237,9 +214,10 @@ void TableEdgeHdl::CreateB2dIAObject() ////////////////////////////////////////////////////////////////////////////// -OverlayTableEdge::OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon ) +OverlayTableEdge::OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bVisible ) : OverlayObject(Color(COL_GRAY)) , maPolyPolygon( rPolyPolygon ) +, mbVisible(bVisible) { } @@ -247,47 +225,35 @@ OverlayTableEdge::~OverlayTableEdge() { } -void OverlayTableEdge::drawGeometry(OutputDevice& rOutputDevice) +drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayObjectPrimitive2DSequence() { - rOutputDevice.SetLineColor(getBaseColor()); - rOutputDevice.SetFillColor(); + drawinglayer::primitive2d::Primitive2DSequence aRetval; - for(sal_uInt32 a(0L); a < maPolyPolygon.count();a ++) + if(maPolyPolygon.count()) { -/* - const basegfx::B2DPolygon aPolygon = maPolyPolygon.getB2DPolygon(a); - const basegfx::B2DPoint aStart(aPolygon.getB2DPoint(0L)); - const basegfx::B2DPoint aEnd(aPolygon.getB2DPoint(aPolygon.count() - 1L)); - const Point aStartPoint(FRound(aStart.getX()), FRound(aStart.getY())); - const Point aEndPoint(FRound(aEnd.getX()), FRound(aEnd.getY())); - rOutputDevice.DrawLine(aStartPoint, aEndPoint); -*/ - PolyPolygon aPolyPolygon( maPolyPolygon ); - rOutputDevice.DrawTransparent( aPolyPolygon, 50 ); - } -} - -void OverlayTableEdge::transform(const basegfx::B2DHomMatrix& rMatrix) -{ - maPolyPolygon.transform( rMatrix ); -} - -void OverlayTableEdge::createBaseRange(OutputDevice& /*rOutputDevice*/) -{ - // reset range and expand it - maBaseRange.reset(); - - if(isHittable()) - { - for(sal_uInt32 a(0L); a < maPolyPolygon.count();a ++) + // Discussed with CL. Currently i will leave the transparence out since this + // a little bit expensive. We may check the look with drag polygons later + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D( + maPolyPolygon, + getBaseColor().getBColor())); + + if(mbVisible) + { + // visible, just return as sequence + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); + } + else { - const basegfx::B2DPolygon aPolygon = maPolyPolygon.getB2DPolygon(a); - const basegfx::B2DPoint aStart(aPolygon.getB2DPoint(0L)); - const basegfx::B2DPoint aEnd(aPolygon.getB2DPoint(aPolygon.count() - 1L)); - maBaseRange.expand(aStart); - maBaseRange.expand(aEnd); + // embed in HitTest primitive to support HitTest of this overlay object + const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aReference, 1); + const drawinglayer::primitive2d::Primitive2DReference aNewReference( + new drawinglayer::primitive2d::HitTestPrimitive2D(aSequence)); + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aNewReference, 1); } } + + return aRetval; } // ==================================================================== @@ -325,16 +291,15 @@ void TableBorderHdl::CreateB2dIAObject() { if(rPageWindow.GetOverlayManager()) { - OutputDevice& rOutDev = rPageWindow.GetPaintWindow().GetOutputDevice(); - - Size aBorderSize( rOutDev.PixelToLogic( Size( 6, 6 ) ) ); - basegfx::B2DRectangle aRect( vcl::unotools::b2DRectangleFromRectangle( maRectangle ) ); - basegfx::B2DPolyPolygon aPolyPolygon; - aPolyPolygon.append(basegfx::tools::createPolygonFromRect( aRect ) ); - aRect.grow( aBorderSize.nA ); - aPolyPolygon.append(basegfx::tools::createPolygonFromRect( aRect ) ); - - ::sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableBorder( aPolyPolygon ); + const basegfx::B2DRange aRange(vcl::unotools::b2DRectangleFromRectangle(maRectangle)); + sdr::overlay::OverlayObject* pOverlayObject = new sdr::overlay::OverlayHatchRect( + aRange.getMinimum(), + aRange.getMaximum(), + Color(0x80, 0x80, 0x80), + 6.0, + 0.0, + 45 * F_PI180, + 0.0); rPageWindow.GetOverlayManager()->add(*pOverlayObject); maOverlayGroup.append(*pOverlayObject); @@ -345,55 +310,7 @@ void TableBorderHdl::CreateB2dIAObject() } } -OverlayTableBorder::OverlayTableBorder( const basegfx::B2DPolyPolygon& rPolyPolygon ) -: OverlayObject(Color(COL_GRAY)) -, maPolyPolygon( rPolyPolygon ) -{ -} - -OverlayTableBorder::~OverlayTableBorder() -{ -} - -// Hittest with logical coordinates -sal_Bool OverlayTableBorder::isHit(const basegfx::B2DPoint& rPos, double /*fTol = 0.0*/) const -{ - if(isHittable()) - { - if( basegfx::tools::isInside( maPolyPolygon.getB2DPolygon(1), rPos, true ) ) - if( !basegfx::tools::isInside( maPolyPolygon.getB2DPolygon(0), rPos, false ) ) - return sal_True; - } - return sal_False; -} - -// Draw geometry -void OverlayTableBorder::drawGeometry(OutputDevice& rOutputDevice) -{ - svtools::ColorConfig aColorConfig; - Color aHatchCol( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor ); - const Hatch aHatch( HATCH_SINGLE, aHatchCol, 3, 450 ); - PolyPolygon aPolyPolygon( maPolyPolygon ); - rOutputDevice.DrawHatch( aPolyPolygon, aHatch ); -} - -// Create the BaseRange. This method needs to calculate maBaseRange. -void OverlayTableBorder::createBaseRange(OutputDevice& /*rOutputDevice*/) -{ - if(isHittable()) - { - maBaseRange = basegfx::tools::getRange(maPolyPolygon); - } - else - { - maBaseRange.reset(); - } -} - -void OverlayTableBorder::transform(const basegfx::B2DHomMatrix& rMatrix) -{ - maPolyPolygon.transform( rMatrix ); -} +////////////////////////////////////////////////////////////////////////////// } // end of namespace table } // end of namespace sdr diff --git a/svx/source/table/tablehandles.hxx b/svx/source/table/tablehandles.hxx index 9ce6e60f63..e1a9095118 100644 --- a/svx/source/table/tablehandles.hxx +++ b/svx/source/table/tablehandles.hxx @@ -57,8 +57,6 @@ class TableEdgeHdl : public SdrHdl public: TableEdgeHdl( const Point& rPnt, bool bHorizontal, sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nEdges ); - virtual bool IsHdlHit(const Point& rPnt) const; - sal_Int32 GetValidDragOffset( const SdrDragStat& rDrag ) const; virtual Pointer GetPointer() const; @@ -68,7 +66,7 @@ public: bool IsHorizontalEdge() const { return mbHorizontal; } basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const; - basegfx::B2DPolyPolygon GetPolyPolygon( bool bOnlyVisible, const SdrDragStat* pDrag = 0 ) const; + void getPolyPolygon(basegfx::B2DPolyPolygon& rVisible, basegfx::B2DPolyPolygon& rInvisible, const SdrDragStat* pDrag) const; protected: // create marker for this kind @@ -77,7 +75,6 @@ protected: private: bool mbHorizontal; sal_Int32 mnMin, mnMax; - basegfx::B2DPolyPolygon maVisiblePolygon; TableEdgeVector maEdges; }; diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index 00402e9f75..9818f0ad39 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -118,6 +118,7 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const width += maColumns[aPos.mnCol++].mnSize; nColSpan--; + nColSpan--; } } } @@ -128,6 +129,7 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const return basegfx::B2ITuple( width, height ); } + // ----------------------------------------------------------------------------- bool TableLayouter::getCellArea( const CellPos& rPos, basegfx::B2IRectangle& rArea ) const diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index 0af6d2f2be..ffc23078b1 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -599,7 +599,30 @@ namespace sdr const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet(); const sal_uInt32 nTextIndex(nColCount * aCellPos.mnRow + aCellPos.mnCol); const SdrText* pSdrText = rTableObj.getText(nTextIndex); - drawinglayer::attribute::SdrFillTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(rCellItemSet, pSdrText); + drawinglayer::attribute::SdrFillTextAttribute* pAttribute = 0; + + if(pSdrText) + { + // #i101508# take cell's local text frame distances into account + const sal_Int32 nLeft(xCurrentCell->GetTextLeftDistance()); + const sal_Int32 nRight(xCurrentCell->GetTextRightDistance()); + const sal_Int32 nUpper(xCurrentCell->GetTextUpperDistance()); + const sal_Int32 nLower(xCurrentCell->GetTextLowerDistance()); + + pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( + rCellItemSet, + pSdrText, + &nLeft, + &nUpper, + &nRight, + &nLower); + } + else + { + pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( + rCellItemSet, + pSdrText); + } if(pAttribute) { @@ -664,17 +687,7 @@ namespace sdr if(pNewShadowAttribute) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const drawinglayer::primitive2d::Primitive2DReference xShadow(drawinglayer::primitive2d::createShadowPrimitive(xRetval, *pNewShadowAttribute)); - - if(xShadow.is()) - { - drawinglayer::primitive2d::Primitive2DSequence xContentWithShadow(2); - xContentWithShadow[0] = xShadow; - xContentWithShadow[1] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::GroupPrimitive2D(xRetval)); - xRetval = xContentWithShadow; - } - + xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, *pNewShadowAttribute); delete pNewShadowAttribute; } } diff --git a/svx/source/tbxctrls/makefile.mk b/svx/source/tbxctrls/makefile.mk index 02bbd865d4..9bca3b9798 100644 --- a/svx/source/tbxctrls/makefile.mk +++ b/svx/source/tbxctrls/makefile.mk @@ -33,6 +33,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=tbxctrls +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- @@ -42,10 +43,17 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- -SLOFILES= \ - $(SLO)$/formatpaintbrushctrl.obj\ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/fontworkgallery.obj\ $(SLO)$/extrusioncontrols.obj \ + $(SLO)$/tbcontrl.obj \ + $(SLO)$/toolbarmenu.obj \ + $(SLO)$/tbxcolorupdate.obj + +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/formatpaintbrushctrl.obj\ $(SLO)$/colrctrl.obj \ $(SLO)$/fillctrl.obj \ $(SLO)$/grafctrl.obj \ @@ -53,16 +61,15 @@ SLOFILES= \ $(SLO)$/layctrl.obj \ $(SLO)$/lboxctrl.obj \ $(SLO)$/linectrl.obj \ - $(SLO)$/tbcontrl.obj \ $(SLO)$/tbxalign.obj \ $(SLO)$/tbxdrctl.obj \ $(SLO)$/verttexttbxctrl.obj \ - $(SLO)$/toolbarmenu.obj \ $(SLO)$/subtoolboxcontrol.obj \ $(SLO)$/tbxcolor.obj \ - $(SLO)$/tbxcolorupdate.obj \ $(SLO)$/tbunocontroller.obj +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + SRS1NAME=$(TARGET) SRC1FILES = \ fontworkgallery.src \ diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 1d0b4c155c..94494aa3aa 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -292,6 +292,7 @@ class SvxLineWindow_Impl : public SfxPopupWindow { private: ValueSet aLineSet; + bool m_bIsWriter; #if _SOLAR__PRIVATE void MakeLineBitmap( USHORT nNo, Bitmap& rBmp, const Size& rSize, String& rStr, @@ -1335,6 +1336,14 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( USHORT nId, const Reference< XFrame >& r aLineSet( this, WinBits( WB_3DLOOK | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD | WB_NONEFIELD | WB_NO_DIRECTSELECT ) ) { + try + { + Reference< lang::XServiceInfo > xServices( rFrame->getController()->getModel(), UNO_QUERY_THROW ); + m_bIsWriter = xServices->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument"))); + } + catch(const uno::Exception& ) + { + } Size aBmpSize( 55, 12 ); CreateBitmaps(); @@ -1598,7 +1607,7 @@ IMPL_LINK( SvxLineWindow_Impl, SelectHdl, void *, EMPTYARG ) Any a; Sequence< PropertyValue > aArgs( 1 ); aArgs[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "LineStyle" )); - aLineItem.QueryValue( a ); + aLineItem.QueryValue( a, m_bIsWriter ? CONVERT_TWIPS : 0 ); aArgs[0].Value = a; /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() call. @@ -2631,7 +2640,6 @@ SfxPopupWindowType SvxFrameLineStyleToolBoxControl::GetPopupWindowType() const SfxPopupWindow* SvxFrameLineStyleToolBoxControl::CreatePopupWindow() { SvxLineWindow_Impl* pLineWin = new SvxLineWindow_Impl( GetSlotId(), m_xFrame, &GetToolBox() ); - pLineWin->StartPopupMode( &GetToolBox(), TRUE ); pLineWin->StartSelection(); SetPopupWindow( pLineWin ); diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src index 9bd251bcb4..dcc74b99e7 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src @@ -40,7 +40,7 @@ #define FULL_WIDTH (220) #define FULL_HEIGHT (120) -#define EDITBUTTON_WIDTH (70) +#define EDITBUTTON_WIDTH (75) #define COL_1 (RSC_SP_DLG_INNERBORDER_LEFT) #define COL_2 (COL_1+RSC_SP_FLGR_SPACE_X) diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 2dcd3c1a89..691d23ab43 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -104,6 +104,9 @@ using namespace ::com::sun::star::task; #include <svx/sdr/contact/viewobjectcontact.hxx> #include <svx/sdr/contact/viewcontact.hxx> +// #i102251# +#include <editstat.hxx> + ////////////////////////////////////////////////////////////////////////////// namespace svx @@ -198,13 +201,13 @@ namespace svx SdrModel* mpDoc; }; - Reference< XInterface > SAL_CALL GraphicExporter_createInstance(const Reference< XMultiServiceFactory > & ) + SVX_DLLPUBLIC Reference< XInterface > SAL_CALL GraphicExporter_createInstance(const Reference< XMultiServiceFactory > & ) throw( Exception ) { return (XWeak*)new GraphicExporter(); } - Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() + SVX_DLLPUBLIC Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() throw() { Sequence< OUString > aSupportedServiceNames( 1 ); @@ -212,7 +215,7 @@ namespace svx return aSupportedServiceNames; } - OUString SAL_CALL GraphicExporter_getImplementationName() + SVX_DLLPUBLIC OUString SAL_CALL GraphicExporter_getImplementationName() throw() { return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.GraphicExporter" ) ); @@ -225,16 +228,27 @@ namespace svx Graphic aGraphic( rMtf ); BitmapEx aBmpEx; + // #i102089# support user's settings of AA and LineSnap when the MetaFile gets + // rasterconverted to a bitmap + const SvtOptionsDrawinglayer aDrawinglayerOpt; + const GraphicConversionParameters aParameters( + pSize ? *pSize : Size(0, 0), + true, // allow unlimited size + aDrawinglayerOpt.IsAntiAliasing(), + aDrawinglayerOpt.IsSnapHorVerLinesToDiscrete()); + if( bTransparent ) { - Graphic aMaskGraphic( rMtf.GetMonochromeMtf( COL_BLACK ) ); - Bitmap aMaskBmp( aMaskGraphic.GetUnlimitedBitmap( pSize ) ); + Graphic aMaskGraphic(rMtf.GetMonochromeMtf(COL_BLACK)); + Bitmap aMaskBmp(aMaskGraphic.GetBitmap(aParameters)); - aMaskBmp.Convert( BMP_CONVERSION_1BIT_THRESHOLD ); - aBmpEx = BitmapEx( aGraphic.GetUnlimitedBitmap( pSize ), aMaskBmp ); + aMaskBmp.Convert(BMP_CONVERSION_1BIT_THRESHOLD); + aBmpEx = BitmapEx(aGraphic.GetBitmap(aParameters), aMaskBmp); } else - aBmpEx = BitmapEx( aGraphic.GetUnlimitedBitmap( pSize ) ); + { + aBmpEx = BitmapEx(aGraphic.GetBitmap(aParameters)); + } aBmpEx.SetPrefMapMode( rMtf.GetPrefMapMode() ); aBmpEx.SetPrefSize( rMtf.GetPrefSize() ); @@ -625,8 +639,12 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, rOutl.SetCalcFieldValueHdl( LINK(this, GraphicExporter, CalcFieldValueHdl) ); rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pView->GetSdrPageView()) ); + // #i102251# + const sal_uInt32 nOldCntrl(rOutl.GetControlWord()); + sal_uInt32 nCntrl = nOldCntrl & ~EE_CNTRL_ONLINESPELLING; + rOutl.SetControlWord(nCntrl); + std::vector< SdrObject* > aShapes; - bool bRet = true; // export complete page? @@ -977,6 +995,9 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, rOutl.SetCalcFieldValueHdl( maOldCalcFieldValueHdl ); + // #i102251# + rOutl.SetControlWord(nOldCntrl); + return bRet; } diff --git a/svx/source/unodraw/UnoGraphicExporter.hxx b/svx/source/unodraw/UnoGraphicExporter.hxx index 1c83eff327..5a755af937 100644 --- a/svx/source/unodraw/UnoGraphicExporter.hxx +++ b/svx/source/unodraw/UnoGraphicExporter.hxx @@ -35,9 +35,9 @@ namespace svx { - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GraphicExporter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); - ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() throw(); - ::rtl::OUString SAL_CALL GraphicExporter_getImplementationName() throw(); + SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GraphicExporter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); + SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() throw(); + SVX_DLLPUBLIC ::rtl::OUString SAL_CALL GraphicExporter_getImplementationName() throw(); } #endif diff --git a/svx/source/unodraw/gluepts.cxx b/svx/source/unodraw/gluepts.cxx index d511dbea25..ca41fa9fe5 100644 --- a/svx/source/unodraw/gluepts.cxx +++ b/svx/source/unodraw/gluepts.cxx @@ -49,19 +49,15 @@ using namespace ::cppu; const USHORT NON_USER_DEFINED_GLUE_POINTS = 4; -class SvxUnoGluePointAccess : public WeakImplHelper2< container::XIndexContainer, container::XIdentifierContainer >, - public SfxListener +class SvxUnoGluePointAccess : public WeakImplHelper2< container::XIndexContainer, container::XIdentifierContainer > { private: - SdrObject* mpObject; + SdrObjectWeakRef mpObject; public: SvxUnoGluePointAccess( SdrObject* pObject ) throw(); virtual ~SvxUnoGluePointAccess() throw(); - // SfxListener - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw (); - // XIdentifierContainer virtual sal_Int32 SAL_CALL insert( const uno::Any& aElement ) throw (lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL removeByIdentifier( sal_Int32 Identifier ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException); @@ -223,52 +219,16 @@ static void convert( const drawing::GluePoint2& rUnoGlue, SdrGluePoint& rSdrGlue SvxUnoGluePointAccess::SvxUnoGluePointAccess( SdrObject* pObject ) throw() : mpObject( pObject ) { - StartListening( *mpObject->GetModel() ); - } SvxUnoGluePointAccess::~SvxUnoGluePointAccess() throw() { - if( mpObject && mpObject->GetModel()) - EndListening( *mpObject->GetModel() ); -} - -void SvxUnoGluePointAccess::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw() -{ - const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint ); - - if( pSdrHint && mpObject) - { - if( pSdrHint->GetKind() == HINT_OBJREMOVED ) - { - if( mpObject == pSdrHint->GetObject() ) - mpObject = NULL; - } - else if( pSdrHint->GetKind() == HINT_MODELCLEARED ) - { - mpObject = NULL; - } - // #110094#-9 - //else if( pSdrHint->GetKind() == HINT_OBJLISTCLEAR ) - //{ - // SdrObjList* pObjList = mpObject ? mpObject->GetObjList() : NULL; - // while( pObjList ) - // { - // if( pSdrHint->GetObjList() == pObjList ) - // { - // mpObject = NULL; - // break; - // } - // pObjList = pObjList->GetUpList(); - // } - //} - } } // XIdentifierContainer sal_Int32 SAL_CALL SvxUnoGluePointAccess::insert( const uno::Any& aElement ) throw (lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { - if( mpObject ) + if( mpObject.is() ) { SdrGluePointList* pList = mpObject->ForceGluePointList(); if( pList ) @@ -298,7 +258,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::insert( const uno::Any& aElement ) thr void SAL_CALL SvxUnoGluePointAccess::removeByIdentifier( sal_Int32 Identifier ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { - if( mpObject && ( Identifier >= NON_USER_DEFINED_GLUE_POINTS )) + if( mpObject.is() && ( Identifier >= NON_USER_DEFINED_GLUE_POINTS )) { const USHORT nId = (USHORT)(Identifier - NON_USER_DEFINED_GLUE_POINTS) + 1; @@ -327,7 +287,7 @@ void SAL_CALL SvxUnoGluePointAccess::removeByIdentifier( sal_Int32 Identifier ) // XIdentifierReplace void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, const uno::Any& aElement ) throw (lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { - if( mpObject && mpObject->IsNode() ) + if( mpObject.is() && mpObject->IsNode() ) { struct drawing::GluePoint2 aGluePoint; if( (Identifier < NON_USER_DEFINED_GLUE_POINTS) || !(aElement >>= aGluePoint)) @@ -361,7 +321,7 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, c // XIdentifierAccess uno::Any SAL_CALL SvxUnoGluePointAccess::getByIdentifier( sal_Int32 Identifier ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { - if( mpObject && mpObject->IsNode() ) + if( mpObject.is() && mpObject->IsNode() ) { struct drawing::GluePoint2 aGluePoint; @@ -401,21 +361,29 @@ uno::Any SAL_CALL SvxUnoGluePointAccess::getByIdentifier( sal_Int32 Identifier ) uno::Sequence< sal_Int32 > SAL_CALL SvxUnoGluePointAccess::getIdentifiers() throw (uno::RuntimeException) { - const SdrGluePointList* pList = mpObject->GetGluePointList(); - const USHORT nCount = pList ? pList->GetCount() : 0; + if( mpObject.is() ) + { + const SdrGluePointList* pList = mpObject->GetGluePointList(); + const USHORT nCount = pList ? pList->GetCount() : 0; - USHORT i; + USHORT i; - uno::Sequence< sal_Int32 > aIdSequence( nCount + NON_USER_DEFINED_GLUE_POINTS ); - sal_Int32 *pIdentifier = aIdSequence.getArray(); - - for( i = 0; i < NON_USER_DEFINED_GLUE_POINTS; i++ ) - *pIdentifier++ = (sal_Int32)i; + uno::Sequence< sal_Int32 > aIdSequence( nCount + NON_USER_DEFINED_GLUE_POINTS ); + sal_Int32 *pIdentifier = aIdSequence.getArray(); + + for( i = 0; i < NON_USER_DEFINED_GLUE_POINTS; i++ ) + *pIdentifier++ = (sal_Int32)i; - for( i = 0; i < nCount; i++ ) - *pIdentifier++ = (sal_Int32) ( (*pList)[i].GetId() + NON_USER_DEFINED_GLUE_POINTS ) - 1; + for( i = 0; i < nCount; i++ ) + *pIdentifier++ = (sal_Int32) ( (*pList)[i].GetId() + NON_USER_DEFINED_GLUE_POINTS ) - 1; - return aIdSequence; + return aIdSequence; + } + else + { + uno::Sequence< sal_Int32 > aEmpty; + return aEmpty; + } } /* deprecated */ @@ -425,7 +393,7 @@ void SAL_CALL SvxUnoGluePointAccess::insertByIndex( sal_Int32, const uno::Any& E throw(lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) { - if( mpObject ) + if( mpObject.is() ) { SdrGluePointList* pList = mpObject->ForceGluePointList(); if( pList ) @@ -455,7 +423,7 @@ void SAL_CALL SvxUnoGluePointAccess::insertByIndex( sal_Int32, const uno::Any& E void SAL_CALL SvxUnoGluePointAccess::removeByIndex( sal_Int32 Index ) throw(lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) { - if( mpObject ) + if( mpObject.is() ) { SdrGluePointList* pList = mpObject->ForceGluePointList(); if( pList ) @@ -487,7 +455,7 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIndex( sal_Int32 Index, const uno: throw lang::IllegalArgumentException(); Index -= 4; - if( mpObject && Index >= 0 ) + if( mpObject.is() && Index >= 0 ) { SdrGluePointList* pList = const_cast< SdrGluePointList* >( mpObject->GetGluePointList() ); if( pList && Index < pList->GetCount() ) @@ -509,7 +477,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::getCount() throw(uno::RuntimeException) { sal_Int32 nCount = 0; - if( mpObject ) + if( mpObject.is() ) { // each node has a default of 4 glue points // and any number of user defined glue points @@ -529,7 +497,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::getCount() uno::Any SAL_CALL SvxUnoGluePointAccess::getByIndex( sal_Int32 Index ) throw(lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) { - if( Index >= 0 && mpObject && mpObject->IsNode() ) + if( Index >= 0 && mpObject.is() && mpObject->IsNode() ) { struct drawing::GluePoint2 aGluePoint; @@ -571,7 +539,7 @@ uno::Type SAL_CALL SvxUnoGluePointAccess::getElementType() sal_Bool SAL_CALL SvxUnoGluePointAccess::hasElements() throw( uno::RuntimeException) { - return mpObject && mpObject->IsNode(); + return mpObject.is() && mpObject->IsNode(); } /** diff --git a/svx/source/unodraw/makefile.mk b/svx/source/unodraw/makefile.mk index 9b71d644f3..4b8ecb093d 100644 --- a/svx/source/unodraw/makefile.mk +++ b/svx/source/unodraw/makefile.mk @@ -33,6 +33,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=unodraw +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- @@ -42,21 +43,18 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- -SLOFILES = \ - $(SLO)$/UnoNamespaceMap.obj \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/UnoGraphicExporter.obj \ - $(SLO)$/unopool.obj \ $(SLO)$/XPropertyTable.obj \ $(SLO)$/UnoNameItemTable.obj \ $(SLO)$/unoshape.obj \ $(SLO)$/unoipset.obj \ - $(SLO)$/unoctabl.obj \ $(SLO)$/unoshap2.obj \ $(SLO)$/unoshap3.obj \ $(SLO)$/unoshap4.obj \ $(SLO)$/unopage.obj \ $(SLO)$/unoshtxt.obj \ - $(SLO)$/unoshcol.obj \ $(SLO)$/unoprov.obj \ $(SLO)$/unomod.obj \ $(SLO)$/unonrule.obj \ @@ -69,10 +67,19 @@ SLOFILES = \ $(SLO)$/unomtabl.obj \ $(SLO)$/unodtabl.obj \ $(SLO)$/gluepts.obj \ - $(SLO)$/recoveryui.obj \ $(SLO)$/tableshape.obj \ $(SLO)$/shapepropertynotifier.obj +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/UnoNamespaceMap.obj \ + $(SLO)$/unopool.obj \ + $(SLO)$/unoctabl.obj \ + $(SLO)$/unoshcol.obj \ + $(SLO)$/recoveryui.obj + +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + SRS1NAME=unodraw SRC1FILES = \ unodraw.src diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 3d455fbec2..9b3a4ec7df 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -215,9 +215,14 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createTextField( { uno::Reference< uno::XInterface > xRet; - const OUString aTextFieldPrexit( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.") ); - - if( ServiceSpecifier.compareTo( aTextFieldPrexit, aTextFieldPrexit.getLength() ) == 0 ) + const OUString aTextFieldPrexit( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.textfield.") ); + + // #i93308# up to OOo 3.2 we used this wrong namespace name with the capital T & F. This is + // fixed since OOo 3.2 but for compatibility we will still provide support for the wrong notation. + const OUString aTextFieldPrexit2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.") ); + + if( (ServiceSpecifier.compareTo( aTextFieldPrexit, aTextFieldPrexit.getLength() ) == 0) || + (ServiceSpecifier.compareTo( aTextFieldPrexit2, aTextFieldPrexit2.getLength() ) == 0) ) { OUString aFieldType( ServiceSpecifier.copy( aTextFieldPrexit.getLength() ) ); diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 1f5a375d9c..1d3b94ebe9 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -65,6 +65,7 @@ #include "shapeimpl.hxx" #include "svx/unoshprp.hxx" #include <svx/svdoashp.hxx> +#include "unopolyhelper.hxx" // #i29181# #include "svdviter.hxx" @@ -1833,7 +1834,7 @@ bool SvxGraphicObject::getPropertyValueImpl( const ::rtl::OUString& rName, const } else { - const GraphicObject& rGrafObj = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphicObject(); + const GraphicObject& rGrafObj = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphicObject(true); OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX)); aURL += OUString::createFromAscii( rGrafObj.GetUniqueID().GetBuffer() ); rValue <<= aURL; diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx index 79a28a9804..cb59ca37e4 100644 --- a/svx/source/unodraw/unoshap3.cxx +++ b/svx/source/unodraw/unoshap3.cxx @@ -760,7 +760,10 @@ Svx3DLatheObject::~Svx3DLatheObject() throw() { } -static bool PolyPolygonShape3D_to_B3dPolyPolygon( const Any& rValue, basegfx::B3DPolyPolygon& rResultPolygon ) +bool PolyPolygonShape3D_to_B3dPolyPolygon( + const Any& rValue, + basegfx::B3DPolyPolygon& rResultPolygon, + bool bCorrectPolygon) { drawing::PolyPolygonShape3D aSourcePolyPolygon; if( !(rValue >>= aSourcePolyPolygon) ) @@ -791,7 +794,14 @@ static bool PolyPolygonShape3D_to_B3dPolyPolygon( const Any& rValue, basegfx::B3 pInnerSequenceX++; pInnerSequenceY++; pInnerSequenceZ++; - basegfx::tools::checkClosed(aNewPolygon); + + // #i101520# correction is needed for imported polygons of old format, + // see callers + if(bCorrectPolygon) + { + basegfx::tools::checkClosed(aNewPolygon); + } + rResultPolygon.append(aNewPolygon); } return true; @@ -855,7 +865,9 @@ bool Svx3DLatheObject::setPropertyValueImpl( const ::rtl::OUString& rName, const { // Polygondefinition in das Objekt packen basegfx::B3DPolyPolygon aNewB3DPolyPolygon; - if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) ) + + // #i101520# Probably imported + if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, true ) ) { // #105127# SetPolyPoly3D sets the Svx3DVerticalSegmentsItem to the number // of points of the polygon. Thus, value gets lost. To avoid this, rescue @@ -973,7 +985,9 @@ bool Svx3DExtrudeObject::setPropertyValueImpl( const ::rtl::OUString& rName, con { // Polygondefinition in das Objekt packen basegfx::B3DPolyPolygon aNewB3DPolyPolygon; - if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) ) + + // #i101520# Probably imported + if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, true ) ) { // Polygon setzen const basegfx::B3DHomMatrix aIdentity; @@ -1082,7 +1096,9 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const ::rtl::OUString& rName, con { // Polygondefinition in das Objekt packen basegfx::B3DPolyPolygon aNewB3DPolyPolygon; - if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) ) + + // #i101520# Direct API data (e.g. from chart) + if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) ) { // Polygon setzen static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyPolygon3D(aNewB3DPolyPolygon); @@ -1094,7 +1110,9 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const ::rtl::OUString& rName, con { // Normalendefinition in das Objekt packen basegfx::B3DPolyPolygon aNewB3DPolyPolygon; - if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) ) + + // #i101520# Direct API data (e.g. from chart) + if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) ) { // Polygon setzen static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyNormals3D(aNewB3DPolyPolygon); @@ -1106,7 +1124,9 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const ::rtl::OUString& rName, con { // Texturdefinition in das Objekt packen basegfx::B3DPolyPolygon aNewB3DPolyPolygon; - if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) ) + + // #i101520# Direct API data (e.g. from chart) + if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) ) { // Polygon setzen const basegfx::B3DHomMatrix aIdentity; diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 465e911dda..75c4d7ab68 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -620,25 +620,29 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() mpTextForwarder->flushCache(); OutlinerParaObject* pOutlinerParaObject = NULL; - bool bTextEditActive = false; SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject ); if( pTextObj && pTextObj->getActiveText() == mpText ) pOutlinerParaObject = pTextObj->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active + bool bOwnParaObj(false); if( pOutlinerParaObject ) - bTextEditActive = true; // text edit active + bOwnParaObj = true; // text edit active else pOutlinerParaObject = mpText->GetOutlinerParaObject(); - if( pOutlinerParaObject && ( bTextEditActive || !mpObject->IsEmptyPresObj() || mpObject->GetPage()->IsMasterPage() ) ) + if( pOutlinerParaObject && ( bOwnParaObj || !mpObject->IsEmptyPresObj() || mpObject->GetPage()->IsMasterPage() ) ) { mpOutliner->SetText( *pOutlinerParaObject ); // #91254# put text to object and set EmptyPresObj to FALSE - if( mpText && bTextEditActive && pOutlinerParaObject && mpObject->IsEmptyPresObj() && pTextObj->IsRealyEdited() ) + if( mpText && bOwnParaObj && pOutlinerParaObject && mpObject->IsEmptyPresObj() && pTextObj->IsRealyEdited() ) { mpObject->SetEmptyPresObj( FALSE ); static_cast< SdrTextObj* >( mpObject)->NbcSetOutlinerParaObjectForText( pOutlinerParaObject, mpText ); + + // #i103982# Here, due to mpObject->NbcSetOutlinerParaObjectForText, we LOSE ownership of the + // OPO, so do NOT delete it when leaving this method (!) + bOwnParaObj = false; } } else @@ -676,7 +680,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() mbDataValid = TRUE; - if( bTextEditActive ) + if( bOwnParaObj ) delete pOutlinerParaObject; } diff --git a/svx/source/unoedit/makefile.mk b/svx/source/unoedit/makefile.mk index e808dbe027..802ded5aa7 100644 --- a/svx/source/unoedit/makefile.mk +++ b/svx/source/unoedit/makefile.mk @@ -33,6 +33,7 @@ PRJ=..$/.. PRJNAME=svx TARGET=unoedit +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- @@ -42,13 +43,10 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- -SLOFILES = \ - $(SLO)$/UnoForbiddenCharsTable.obj \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/unoedsrc.obj \ $(SLO)$/unoedhlp.obj \ - $(SLO)$/unopracc.obj \ - $(SLO)$/unoedprx.obj \ - $(SLO)$/unoviwed.obj \ $(SLO)$/unoviwou.obj \ $(SLO)$/unofored.obj \ $(SLO)$/unoforou.obj \ @@ -56,6 +54,15 @@ SLOFILES = \ $(SLO)$/unotext2.obj \ $(SLO)$/unofield.obj +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/UnoForbiddenCharsTable.obj \ + $(SLO)$/unopracc.obj \ + $(SLO)$/unoedprx.obj \ + $(SLO)$/unoviwed.obj + +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + # --- Tagets ------------------------------------------------------- .INCLUDE : target.mk diff --git a/svx/source/unoedit/unoedprx.cxx b/svx/source/unoedit/unoedprx.cxx index 06d8ce00e5..2b500aeac6 100644 --- a/svx/source/unoedit/unoedprx.cxx +++ b/svx/source/unoedit/unoedprx.cxx @@ -1044,6 +1044,16 @@ USHORT SvxAccessibleTextAdapter::GetLineLen( USHORT nPara, USHORT nLine ) const return static_cast< USHORT >(aEndIndex.GetIndex()); } +void SvxAccessibleTextAdapter::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const +{ + mrTextForwarder->GetLineBoundaries( rStart, rEnd, nParagraph, nLine ); +} + +USHORT SvxAccessibleTextAdapter::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +{ + return mrTextForwarder->GetLineNumberAtIndex( nPara, nIndex ); +} + sal_Bool SvxAccessibleTextAdapter::Delete( const ESelection& rSel ) { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -1215,7 +1225,7 @@ Point SvxAccessibleTextEditViewAdapter::PixelToLogic( const Point& rPoint, const return mrViewForwarder->PixelToLogic(rPoint, rMapMode); } - + sal_Bool SvxAccessibleTextEditViewAdapter::GetSelection( ESelection& rSel ) const { DBG_ASSERT(mrViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder"); diff --git a/svx/source/unoedit/unofored.cxx b/svx/source/unoedit/unofored.cxx index e6761cc6bb..20807d46ff 100644 --- a/svx/source/unoedit/unofored.cxx +++ b/svx/source/unoedit/unofored.cxx @@ -470,6 +470,17 @@ USHORT SvxEditEngineForwarder::GetLineLen( USHORT nPara, USHORT nLine ) const { return rEditEngine.GetLineLen(nPara, nLine); } + +void SvxEditEngineForwarder::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const +{ + rEditEngine.GetLineBoundaries(rStart, rEnd, nPara, nLine); +} + +USHORT SvxEditEngineForwarder::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +{ + return rEditEngine.GetLineNumberAtIndex(nPara, nIndex); +} + sal_Bool SvxEditEngineForwarder::QuickFormatDoc( BOOL ) { diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx index 8e9aea00b2..94bcd342a8 100644 --- a/svx/source/unoedit/unoforou.cxx +++ b/svx/source/unoedit/unoforou.cxx @@ -429,6 +429,16 @@ USHORT SvxOutlinerForwarder::GetLineLen( USHORT nPara, USHORT nLine ) const { return rOutliner.GetLineLen(nPara, nLine); } + +void SvxOutlinerForwarder::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const +{ + return rOutliner.GetEditEngine().GetLineBoundaries( rStart, rEnd, nPara, nLine ); +} + +USHORT SvxOutlinerForwarder::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +{ + return rOutliner.GetEditEngine().GetLineNumberAtIndex( nPara, nIndex ); +} sal_Bool SvxOutlinerForwarder::QuickFormatDoc( BOOL ) { diff --git a/svx/source/unoedit/unotext.cxx b/svx/source/unoedit/unotext.cxx index a568a548f7..0706db84a9 100644 --- a/svx/source/unoedit/unotext.cxx +++ b/svx/source/unoedit/unotext.cxx @@ -2647,6 +2647,16 @@ USHORT SvxDummyTextSource::GetLineLen( USHORT, USHORT ) const return 0; } +void SvxDummyTextSource::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT /*nParagraph*/, USHORT /*nLine*/ ) const +{ + rStart = rEnd = 0; +} + +USHORT SvxDummyTextSource::GetLineNumberAtIndex( USHORT /*nPara*/, USHORT /*nIndex*/ ) const +{ + return 0; +} + sal_Bool SvxDummyTextSource::QuickFormatDoc( BOOL ) { return sal_False; diff --git a/svx/source/unoedit/unoviwou.cxx b/svx/source/unoedit/unoviwou.cxx index b339f25706..9825d6db53 100644 --- a/svx/source/unoedit/unoviwou.cxx +++ b/svx/source/unoedit/unoviwou.cxx @@ -35,6 +35,7 @@ #include <svx/unoviwou.hxx> #include <svx/outliner.hxx> +#include <svx/editeng.hxx> #include <svx/svdotext.hxx> diff --git a/svx/source/unogallery/makefile.mk b/svx/source/unogallery/makefile.mk index a63b79bb6f..a699208f4f 100755 --- a/svx/source/unogallery/makefile.mk +++ b/svx/source/unogallery/makefile.mk @@ -38,14 +38,10 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/makefile.pmk # --- Files -------------------------------------------------------- -CXXFILES= \ - unogalthemeprovider.cxx \ - unogaltheme.cxx \ - unogalitem.cxx - SLOFILES= \ $(SLO)$/unogalthemeprovider.obj \ $(SLO)$/unogaltheme.obj \ diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx index f014431c86..f96d569b75 100644 --- a/svx/source/unogallery/unogalthemeprovider.cxx +++ b/svx/source/unogallery/unogalthemeprovider.cxx @@ -92,7 +92,7 @@ GalleryThemeProvider::~GalleryThemeProvider() // ------------------------------------------------------------------------------ -::rtl::OUString GalleryThemeProvider::getImplementationName_Static() +SVX_DLLPUBLIC ::rtl::OUString GalleryThemeProvider::getImplementationName_Static() throw() { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.gallery.GalleryThemeProvider" ) ); @@ -100,7 +100,7 @@ GalleryThemeProvider::~GalleryThemeProvider() // ------------------------------------------------------------------------------ -uno::Sequence< ::rtl::OUString > GalleryThemeProvider::getSupportedServiceNames_Static() +SVX_DLLPUBLIC uno::Sequence< ::rtl::OUString > GalleryThemeProvider::getSupportedServiceNames_Static() throw() { uno::Sequence< ::rtl::OUString > aSeq( 1 ); diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 356b98777d..1ba98b3e79 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -670,17 +670,16 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const ::rtl::OUString& rPictureSt // ----------------------------------------------------------------------------- -void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos ) +void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos, rtl::OUString& rRequestedFileName ) { + rtl::OUString aURLString( rURLStr ); ::rtl::OUString aPictureStorageName, aPictureStreamName; - - if( ( maURLSet.find( rURLStr ) != maURLSet.end() ) ) + if( ( maURLSet.find( aURLString ) != maURLSet.end() ) ) { URLPairVector::iterator aIter( maGrfURLs.begin() ), aEnd( maGrfURLs.end() ); - while( aIter != aEnd ) { - if( rURLStr == (*aIter).first ) + if( aURLString == (*aIter).first ) { maGrfURLs[ nInsertPos ].second = (*aIter).second; aIter = aEnd; @@ -689,7 +688,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s aIter++; } } - else if( ImplGetStreamNames( rURLStr, aPictureStorageName, aPictureStreamName ) ) + else if( ImplGetStreamNames( aURLString, aPictureStorageName, aPictureStreamName ) ) { URLPair& rURLPair = maGrfURLs[ nInsertPos ]; @@ -718,22 +717,23 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s String aStreamName( aGraphicObjectId ); Graphic aGraphic( (Graphic&) aGrfObject.GetGraphic() ); const GfxLink aGfxLink( aGraphic.GetLink() ); + String aExtension; if( aGfxLink.GetDataSize() ) { switch( aGfxLink.GetType() ) { - case( GFX_LINK_TYPE_EPS_BUFFER ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) ); break; - case( GFX_LINK_TYPE_NATIVE_GIF ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) ); break; - case( GFX_LINK_TYPE_NATIVE_JPG ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".jpg" ) ); break; - case( GFX_LINK_TYPE_NATIVE_PNG ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ); break; - case( GFX_LINK_TYPE_NATIVE_TIF ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".tif" ) ); break; - case( GFX_LINK_TYPE_NATIVE_WMF ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".wmf" ) ); break; - case( GFX_LINK_TYPE_NATIVE_MET ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".met" ) ); break; - case( GFX_LINK_TYPE_NATIVE_PCT ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".pct" ) ); break; + case( GFX_LINK_TYPE_EPS_BUFFER ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) ); break; + case( GFX_LINK_TYPE_NATIVE_GIF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) ); break; + case( GFX_LINK_TYPE_NATIVE_JPG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".jpg" ) ); break; + case( GFX_LINK_TYPE_NATIVE_PNG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ); break; + case( GFX_LINK_TYPE_NATIVE_TIF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".tif" ) ); break; + case( GFX_LINK_TYPE_NATIVE_WMF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".wmf" ) ); break; + case( GFX_LINK_TYPE_NATIVE_MET ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".met" ) ); break; + case( GFX_LINK_TYPE_NATIVE_PCT ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".pct" ) ); break; default: - aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".grf" ) ); + aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".grf" ) ); break; } } @@ -742,30 +742,52 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s if( aGrfObject.GetType() == GRAPHIC_BITMAP ) { if( aGrfObject.IsAnimated() ) - aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) ); + aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) ); else - aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ); + aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ); } else if( aGrfObject.GetType() == GRAPHIC_GDIMETAFILE ) { // SJ: first check if this metafile is just a eps file, then we will store the eps instead of svm GDIMetaFile& rMtf( (GDIMetaFile&)aGraphic.GetGDIMetaFile() ); if ( ImplCheckForEPS( rMtf ) ) - aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) ); + aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) ); else - aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".svm" ) ); + aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".svm" ) ); } } + rtl::OUString aURLEntry; + const String sPictures( RTL_CONSTASCII_USTRINGPARAM( "Pictures/" ) ); + + if ( rRequestedFileName.getLength() ) + { + aURLEntry = sPictures; + aURLEntry += rRequestedFileName; + aURLEntry += aExtension; + + URLPairVector::iterator aIter( maGrfURLs.begin() ), aEnd( maGrfURLs.end() ); + while( aIter != aEnd ) + { + if( aURLEntry == (*aIter).second ) + break; + aIter++; + } + if ( aIter == aEnd ) + aStreamName = rRequestedFileName; + } + + aStreamName += aExtension; + if( mbDirect && aStreamName.Len() ) ImplWriteGraphic( aPictureStorageName, aStreamName, aGraphicObjectId ); - rURLPair.second = String( RTL_CONSTASCII_USTRINGPARAM( "Pictures/" ) ); + rURLPair.second = sPictures; rURLPair.second += aStreamName; } } - maURLSet.insert( rURLStr ); + maURLSet.insert( aURLString ); } } @@ -820,14 +842,45 @@ void SvXMLGraphicHelper::Destroy( SvXMLGraphicHelper* pSvXMLGraphicHelper ) // ----------------------------------------------------------------------------- // XGraphicObjectResolver -::rtl::OUString SAL_CALL SvXMLGraphicHelper::resolveGraphicObjectURL( const ::rtl::OUString& aURL ) +::rtl::OUString SAL_CALL SvXMLGraphicHelper::resolveGraphicObjectURL( const ::rtl::OUString& rURL ) throw(uno::RuntimeException) { ::osl::MutexGuard aGuard( maMutex ); const sal_Int32 nIndex = maGrfURLs.size(); + rtl::OUString aURL( rURL ); + rtl::OUString aUserData; + rtl::OUString aRequestedFileName; + + sal_Int32 nUser = rURL.indexOf( '?', 0 ); + if ( nUser >= 0 ) + { + aURL = rtl::OUString( rURL.copy( 0, nUser ) ); + nUser++; + aUserData = rURL.copy( nUser, rURL.getLength() - nUser ); + } + if ( aUserData.getLength() ) + { + sal_Int32 nIndex2 = 0; + do + { + rtl::OUString aToken = aUserData.getToken( 0, ';', nIndex2 ); + sal_Int32 n = aToken.indexOf( '=' ); + if ( ( n > 0 ) && ( ( n + 1 ) < aToken.getLength() ) ) + { + rtl::OUString aParam( aToken.copy( 0, n ) ); + rtl::OUString aValue( aToken.copy( n + 1, aToken.getLength() - ( n + 1 ) ) ); + + const rtl::OUString sRequestedName( RTL_CONSTASCII_USTRINGPARAM("requestedName") ); + if ( aParam.match( sRequestedName ) ) + aRequestedFileName = aValue; + } + } + while ( nIndex2 >= 0 ); + } + maGrfURLs.push_back( ::std::make_pair( aURL, ::rtl::OUString() ) ); - ImplInsertGraphicURL( aURL, nIndex ); + ImplInsertGraphicURL( aURL, nIndex, aRequestedFileName ); return maGrfURLs[ nIndex ].second; } diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index dca95ac457..1e527885b7 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -66,6 +66,8 @@ #include <basegfx/point/b2dpoint.hxx> #include <basegfx/vector/b2dvector.hxx> +#include <stdio.h> + using namespace ::rtl; using namespace ::com::sun::star; @@ -108,7 +110,7 @@ long ScaleMetricValue( long nVal, long nMul, long nDiv ) /************************************************************************* |* -|* NameOrIndex::NameOrIndex(USHORT nWhich, long nIndex) +|* NameOrIndex::NameOrIndex(USHORT nWhich, INT32 nIndex) |* |* Beschreibung |* Ersterstellung 14.11.94 @@ -116,7 +118,7 @@ long ScaleMetricValue( long nVal, long nMul, long nDiv ) |* *************************************************************************/ -NameOrIndex::NameOrIndex(USHORT _nWhich, long nIndex) : +NameOrIndex::NameOrIndex(USHORT _nWhich, INT32 nIndex) : SfxStringItem(_nWhich, aNameOrIndexEmptyString), nPalIndex(nIndex) { @@ -134,7 +136,7 @@ NameOrIndex::NameOrIndex(USHORT _nWhich, long nIndex) : NameOrIndex::NameOrIndex(USHORT _nWhich, const XubString& rName) : SfxStringItem(_nWhich, rName), - nPalIndex((long)-1) + nPalIndex(-1) { } @@ -230,7 +232,7 @@ SfxPoolItem* NameOrIndex::Create(SvStream& rIn, USHORT /*nVer*/) const SvStream& NameOrIndex::Store( SvStream& rOut, USHORT nItemVersion ) const { SfxStringItem::Store( rOut, nItemVersion ); - rOut << (INT32)nPalIndex; + rOut << nPalIndex; return rOut; } @@ -369,11 +371,11 @@ TYPEINIT1_AUTOFACTORY(XColorItem, NameOrIndex); /************************************************************************* |* -|* XColorItem::XColorItem(USHORT nWhich, long nIndex, const Color& rTheColor) +|* XColorItem::XColorItem(USHORT nWhich, INT32 nIndex, const Color& rTheColor) |* \************************************************************************/ -XColorItem::XColorItem(USHORT _nWhich, long nIndex, const Color& rTheColor) : +XColorItem::XColorItem(USHORT _nWhich, INT32 nIndex, const Color& rTheColor) : NameOrIndex(_nWhich, nIndex), aColor(rTheColor) { @@ -884,7 +886,7 @@ TYPEINIT1_AUTOFACTORY(XLineDashItem, NameOrIndex); /************************************************************************* |* -|* XLineDashItem::XLineDashItem(long nIndex, const XDash& rTheDash) +|* XLineDashItem::XLineDashItem(INT32 nIndex, const XDash& rTheDash) |* |* Beschreibung |* Ersterstellung 15.11.94 @@ -892,7 +894,7 @@ TYPEINIT1_AUTOFACTORY(XLineDashItem, NameOrIndex); |* *************************************************************************/ -XLineDashItem::XLineDashItem(long nIndex, const XDash& rTheDash) : +XLineDashItem::XLineDashItem(INT32 nIndex, const XDash& rTheDash) : NameOrIndex(XATTR_LINEDASH, nIndex), aDash(rTheDash) { @@ -1501,7 +1503,7 @@ TYPEINIT1_AUTOFACTORY(XLineColorItem, XColorItem); /************************************************************************* |* -|* XLineColorItem::XLineColorItem(long nIndex, const Color& rTheColor) +|* XLineColorItem::XLineColorItem(INT32 nIndex, const Color& rTheColor) |* |* Beschreibung |* Ersterstellung 15.11.94 @@ -1509,7 +1511,7 @@ TYPEINIT1_AUTOFACTORY(XLineColorItem, XColorItem); |* *************************************************************************/ -XLineColorItem::XLineColorItem(long nIndex, const Color& rTheColor) : +XLineColorItem::XLineColorItem(INT32 nIndex, const Color& rTheColor) : XColorItem(XATTR_LINECOLOR, nIndex, rTheColor) { } @@ -1720,7 +1722,7 @@ TYPEINIT1_AUTOFACTORY(XLineStartItem, NameOrIndex); /************************************************************************* |* -|* XLineStartItem::XLineStartItem(long nIndex) +|* XLineStartItem::XLineStartItem(INT32 nIndex) |* |* Beschreibung |* Ersterstellung 15.11.94 @@ -1728,7 +1730,7 @@ TYPEINIT1_AUTOFACTORY(XLineStartItem, NameOrIndex); |* *************************************************************************/ -XLineStartItem::XLineStartItem(long nIndex) +XLineStartItem::XLineStartItem(INT32 nIndex) : NameOrIndex(XATTR_LINESTART, nIndex) { } @@ -2192,7 +2194,7 @@ TYPEINIT1_AUTOFACTORY(XLineEndItem, NameOrIndex); /************************************************************************* |* -|* XLineEndItem::XLineEndItem(long nIndex) +|* XLineEndItem::XLineEndItem(INT32 nIndex) |* |* Beschreibung |* Ersterstellung 15.11.94 @@ -2200,7 +2202,7 @@ TYPEINIT1_AUTOFACTORY(XLineEndItem, NameOrIndex); |* *************************************************************************/ -XLineEndItem::XLineEndItem(long nIndex) +XLineEndItem::XLineEndItem(INT32 nIndex) : NameOrIndex(XATTR_LINEEND, nIndex) { } @@ -2664,7 +2666,7 @@ TYPEINIT1_AUTOFACTORY(XLineStartWidthItem, SfxMetricItem); /************************************************************************* |* -|* XLineStartWidthItem::XLineStartWidthItem(long nWidth) +|* XLineStartWidthItem::XLineStartWidthItem(INT32 nWidth) |* |* Beschreibung |* Ersterstellung 15.11.94 @@ -3249,7 +3251,7 @@ TYPEINIT1_AUTOFACTORY(XFillColorItem, XColorItem); /************************************************************************* |* -|* XFillColorItem::XFillColorItem(long nIndex, const Color& rTheColor) +|* XFillColorItem::XFillColorItem(INT32 nIndex, const Color& rTheColor) |* |* Beschreibung |* Ersterstellung 15.11.94 @@ -3257,7 +3259,7 @@ TYPEINIT1_AUTOFACTORY(XFillColorItem, XColorItem); |* *************************************************************************/ -XFillColorItem::XFillColorItem(long nIndex, const Color& rTheColor) : +XFillColorItem::XFillColorItem(INT32 nIndex, const Color& rTheColor) : XColorItem(XATTR_FILLCOLOR, nIndex, rTheColor) { } @@ -3372,7 +3374,7 @@ sal_Bool XFillColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, BYTE // ----------------------------- TYPEINIT1_AUTOFACTORY(XSecondaryFillColorItem, XColorItem); -XSecondaryFillColorItem::XSecondaryFillColorItem(long nIndex, const Color& rTheColor) : +XSecondaryFillColorItem::XSecondaryFillColorItem(INT32 nIndex, const Color& rTheColor) : XColorItem(XATTR_SECONDARYFILLCOLOR, nIndex, rTheColor) { } @@ -3510,7 +3512,7 @@ TYPEINIT1_AUTOFACTORY(XFillGradientItem, NameOrIndex); /************************************************************************* |* -|* XFillGradientItem::XFillGradientItem(long nIndex, +|* XFillGradientItem::XFillGradientItem(INT32 nIndex, |* const XGradient& rTheGradient) |* |* Beschreibung @@ -3519,7 +3521,7 @@ TYPEINIT1_AUTOFACTORY(XFillGradientItem, NameOrIndex); |* *************************************************************************/ -XFillGradientItem::XFillGradientItem(long nIndex, +XFillGradientItem::XFillGradientItem(INT32 nIndex, const XGradient& rTheGradient) : NameOrIndex(XATTR_FILLGRADIENT, nIndex), aGradient(rTheGradient) @@ -4042,7 +4044,7 @@ XFillFloatTransparenceItem::XFillFloatTransparenceItem() : //------------------------------------------------------------------------ -XFillFloatTransparenceItem::XFillFloatTransparenceItem( long nIndex, const XGradient& rGradient, BOOL bEnable ) : +XFillFloatTransparenceItem::XFillFloatTransparenceItem( INT32 nIndex, const XGradient& rGradient, BOOL bEnable ) : XFillGradientItem ( nIndex, rGradient ), bEnabled ( bEnable ) { @@ -4246,7 +4248,7 @@ TYPEINIT1_AUTOFACTORY(XFillHatchItem, NameOrIndex); /************************************************************************* |* -|* XFillHatchItem::XFillHatchItem(long nIndex, +|* XFillHatchItem::XFillHatchItem(INT32 nIndex, |* const XHatch& rTheHatch) |* |* Beschreibung @@ -4255,7 +4257,7 @@ TYPEINIT1_AUTOFACTORY(XFillHatchItem, NameOrIndex); |* *************************************************************************/ -XFillHatchItem::XFillHatchItem(long nIndex, +XFillHatchItem::XFillHatchItem(INT32 nIndex, const XHatch& rTheHatch) : NameOrIndex(XATTR_FILLHATCH, nIndex), aHatch(rTheHatch) @@ -5258,7 +5260,7 @@ TYPEINIT1_AUTOFACTORY(XFormTextShadowColorItem, XColorItem); |* *************************************************************************/ -XFormTextShadowColorItem::XFormTextShadowColorItem(long nIndex, +XFormTextShadowColorItem::XFormTextShadowColorItem(INT32 nIndex, const Color& rTheColor) : XColorItem(XATTR_FORMTXTSHDWCOLOR, nIndex, rTheColor) { diff --git a/svx/util/makefile.mk b/svx/util/makefile.mk index f212284fa4..898629299e 100644 --- a/svx/util/makefile.mk +++ b/svx/util/makefile.mk @@ -52,11 +52,6 @@ RSCLOCINC+=-I$(PRJ)$/source$/svdraw LIB1TARGET= $(SLB)$/$(TARGET).lib LIB1FILES=\ - $(SLB)$/animation.lib \ - $(SLB)$/overlay.lib \ - $(SLB)$/attribute.lib \ - $(SLB)$/primitive2d.lib \ - $(SLB)$/primitive3d.lib \ $(SLB)$/svdraw.lib \ $(SLB)$/form.lib @@ -67,10 +62,6 @@ LIB1FILES+=$(SLB)$/ibrwimp.lib LIB2TARGET= $(SLB)$/$(TARGET)_2.lib LIB2FILES=\ $(SLB)$/items.lib \ - $(SLB)$/svxlink.lib \ - $(SLB)$/svxrtf.lib \ - $(SLB)$/editeng.lib \ - $(SLB)$/outliner.lib \ $(SLB)$/dialogs.lib \ $(SLB)$/mnuctrls.lib \ $(SLB)$/options.lib \ @@ -83,40 +74,112 @@ LIB3TARGET= $(SLB)$/$(TARGET)_3.lib LIB3FILES=\ $(SLB)$/unodraw.lib \ $(SLB)$/unogallery.lib\ - $(SLB)$/gal.lib \ $(SLB)$/accessibility.lib \ - $(SLB)$/customshapes.lib\ - $(SLB)$/toolbars.lib \ - $(SLB)$/properties.lib \ - $(SLB)$/contact.lib \ - $(SLB)$/event.lib + $(SLB)$/customshapes.lib LIB4TARGET= $(SLB)$/$(TARGET)_4.lib LIB4FILES=\ $(SLB)$/fmcomp.lib \ $(SLB)$/engine3d.lib \ - $(SLB)$/msfilter.lib \ - $(SLB)$/xout.lib \ - $(SLB)$/xml.lib \ $(SLB)$/table.lib +# Objects needed for the svxcore library. +LIB5TARGET= $(SLB)$/$(TARGET)_5.lib +LIB5FILES=\ + $(SLB)$/accessibility-core.lib \ + $(SLB)$/animation.lib \ + $(SLB)$/attribute.lib \ + $(SLB)$/contact.lib \ + $(SLB)$/customshapes-core.lib \ + $(SLB)$/dialogs-core.lib \ + $(SLB)$/editeng.lib \ + $(SLB)$/engine3d-core.lib \ + $(SLB)$/event.lib \ + $(SLB)$/fmcomp-core.lib \ + $(SLB)$/form-core.lib \ + $(SLB)$/gal.lib \ + $(SLB)$/items-core.lib \ + $(SLB)$/msfilter-core.lib \ + $(SLB)$/options-core.lib + +LIB6TARGET= $(SLB)$/$(TARGET)_6.lib +LIB6FILES=\ + $(SLB)$/outliner.lib \ + $(SLB)$/overlay.lib \ + $(SLB)$/primitive2d.lib \ + $(SLB)$/primitive3d.lib \ + $(SLB)$/properties.lib \ + $(SLB)$/svdraw-core.lib \ + $(SLB)$/svxlink.lib \ + $(SLB)$/svxrtf-core.lib \ + $(SLB)$/table-core.lib \ + $(SLB)$/tbxctrls-core.lib \ + $(SLB)$/toolbars.lib \ + $(SLB)$/unodraw-core.lib \ + $(SLB)$/unoedit-core.lib \ + $(SLB)$/xml.lib \ + $(SLB)$/xout.lib + +# Objects needed for the svxmsfilter library. +LIB7TARGET= $(SLB)$/$(TARGET)_7.lib +LIB7FILES=\ + $(SLB)$/msfilter-msfilter.lib \ + $(SLB)$/svdraw-msfilter.lib \ + $(SLB)$/svxrtf.lib + HELPIDFILES= ..$/inc$/helpid.hrc -# svx -SHL1TARGET= svx$(DLLPOSTFIX) -SHL1IMPLIB= i$(TARGET) +# svxcore +SHL1TARGET= svxcore$(DLLPOSTFIX) +SHL1IMPLIB= isvxcore SHL1USE_EXPORTS=name +SHL1LIBS= $(LIB5TARGET) $(LIB6TARGET) -SHL1LIBS= $(LIB1TARGET) $(LIB2TARGET) $(LIB3TARGET) $(LIB4TARGET) SHL1STDLIBS= \ - $(AVMEDIALIB) \ + $(AVMEDIALIB) \ + $(SFX2LIB) \ + $(XMLOFFLIB) \ + $(GOODIESLIB) \ + $(BASEGFXLIB) \ + $(DRAWINGLAYERLIB) \ + $(LNGLIB) \ + $(BASICLIB) \ + $(SVTOOLLIB) \ + $(TKLIB) \ + $(VCLLIB) \ + $(SVLLIB) \ + $(SOTLIB) \ + $(UNOTOOLSLIB) \ + $(TOOLSLIB) \ + $(I18NISOLANGLIB) \ + $(I18NPAPERLIB) \ + $(COMPHELPERLIB) \ + $(UCBHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(VOSLIB) \ + $(SALLIB) \ + $(ICUUCLIB) + +SHL1DEF= $(MISC)$/$(SHL1TARGET).def +DEF1NAME= $(SHL1TARGET) +DEFLIB1NAME=$(TARGET)_5 + +# svx +SHL2TARGET= svx$(DLLPOSTFIX) +SHL2IMPLIB= i$(TARGET) +SHL2USE_EXPORTS=name +SHL2DEPN=$(SHL1TARGETN) + +SHL2LIBS= $(LIB1TARGET) $(LIB2TARGET) $(LIB3TARGET) $(LIB4TARGET) +SHL2STDLIBS= \ + $(SVXCORELIB) \ $(SFX2LIB) \ $(XMLOFFLIB) \ $(GOODIESLIB) \ $(BASEGFXLIB) \ $(DRAWINGLAYERLIB) \ $(BASICLIB) \ - $(LNGLIB) \ $(SVTOOLLIB) \ $(TKLIB) \ $(VCLLIB) \ @@ -125,7 +188,6 @@ SHL1STDLIBS= \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(I18NISOLANGLIB) \ - $(I18NPAPERLIB) \ $(XMLSCRIPTLIB) \ $(COMPHELPERLIB) \ $(UCBHELPERLIB) \ @@ -136,25 +198,26 @@ SHL1STDLIBS= \ $(ICUUCLIB) .IF "$(GUI)"=="WNT" -SHL1STDLIBS+=$(SHELLLIB) +SHL2STDLIBS+=$(SHELLLIB) .ENDIF # WNT -SHL1DEF= $(MISC)$/$(SHL1TARGET).def -DEF1NAME= $(SHL1TARGET) -DEFLIB1NAME=$(TARGET) $(TARGET)_2 $(TARGET)_3 $(TARGET)_4 +SHL2DEF= $(MISC)$/$(SHL2TARGET).def +DEF2NAME= $(SHL2TARGET) +DEFLIB2NAME=$(TARGET) $(TARGET)_2 $(TARGET)_3 $(TARGET)_4 # cui -SHL2TARGET= cui$(DLLPOSTFIX) -SHL2VERSIONMAP= cui.map -SHL2IMPLIB=icui -SHL2DEPN=$(SHL1TARGETN) +SHL3TARGET= cui$(DLLPOSTFIX) +SHL3VERSIONMAP= cui.map +SHL3IMPLIB=icui +SHL3DEPN=$(SHL2TARGETN) -SHL2DEF= $(MISC)$/$(SHL2TARGET).def -DEF2NAME= $(SHL2TARGET) +SHL3DEF= $(MISC)$/$(SHL3TARGET).def +DEF3NAME= $(SHL3TARGET) -SHL2LIBS= $(SLB)$/cui.lib +SHL3LIBS= $(SLB)$/cui.lib -SHL2STDLIBS= \ +SHL3STDLIBS= \ + $(SVXCORELIB) \ $(SVXLIB) \ $(AVMEDIALIB) \ $(SFX2LIB) \ @@ -175,18 +238,50 @@ SHL2STDLIBS= \ $(CPPULIB) \ $(VOSLIB) \ $(SALLIB) \ - $(JVMFWKLIB) + $(JVMFWKLIB) \ + $(ICUUCLIB) .IF "$(debug)$(dbgutil)"!="" SHL2STDLIBS += $(CPPUHELPERLIB) .ENDIF # "$(debug)$(dbgutil)"!="" .IF "$(GUI)"=="WNT" -SHL2STDLIBS+= \ +SHL3STDLIBS+= \ $(SHLWAPILIB) \ $(ADVAPI32LIB) .ENDIF # WNT +# svxmsfilter library +SHL4TARGET= svxmsfilter$(DLLPOSTFIX) +SHL4IMPLIB= isvxmsfilter +SHL4USE_EXPORTS=name +SHL4DEPN=$(SHL1TARGETN) +SHL4LIBS= $(LIB7TARGET) + +SHL4STDLIBS= \ + $(SVXCORELIB) \ + $(SFX2LIB) \ + $(XMLOFFLIB) \ + $(GOODIESLIB) \ + $(BASEGFXLIB) \ + $(BASICLIB) \ + $(SVTOOLLIB) \ + $(TKLIB) \ + $(VCLLIB) \ + $(SVLLIB) \ + $(SOTLIB) \ + $(UNOTOOLSLIB) \ + $(TOOLSLIB) \ + $(XMLSCRIPTLIB) \ + $(COMPHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALLIB) + +SHL4DEF= $(MISC)$/$(SHL4TARGET).def +DEF4NAME= $(SHL4TARGET) +DEFLIB4NAME=$(TARGET)_6 + # ------------------------------------------------------------------------------ # Resource files diff --git a/svx/util/makefile.pmk b/svx/util/makefile.pmk index 27f185e936..b2aae33291 100644 --- a/svx/util/makefile.pmk +++ b/svx/util/makefile.pmk @@ -36,4 +36,12 @@ CDEFS += -DSVX_DLLIMPLEMENTATION CFLAGS+=-DENABLE_GTK .ENDIF +.IF "$(ENABLE_KDE)" != "" +CFLAGS+=-DENABLE_KDE +.ENDIF + +.IF "$(ENABLE_KDE4)" != "" +CFLAGS+=-DENABLE_KDE4 +.ENDIF + VISIBILITY_HIDDEN=TRUE |