diff options
Diffstat (limited to 'svx/source')
243 files changed, 7971 insertions, 6995 deletions
diff --git a/svx/source/accessibility/AccessibleEditableTextPara.cxx b/svx/source/accessibility/AccessibleEditableTextPara.cxx index 27963bfdffc4..1c0ce04bb1d6 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 5cf8c5361d20..4e297f44c3b5 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 072d6347f3f4..6420a14c98ae 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 2ea02d03bf28..694043d69f4e 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 b611b62b47e6..333c555bb746 100644 --- a/svx/source/accessibility/AccessibleStaticTextBase.cxx +++ b/svx/source/accessibility/AccessibleStaticTextBase.cxx @@ -173,12 +173,16 @@ namespace accessibility AccessibleEditableTextPara& GetParagraph( sal_Int32 nPara ) const; sal_Int32 GetParagraphCount() 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 { 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 7882aeac6b7b..9423e6719a40 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 323ff7982876..418236a0107d 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 f953adc1dda0..8b1802bf1a25 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 5d957b831d54..330459b224f1 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,7 +2369,7 @@ BOOL OfaAutoCompleteTabPage::FillItemSet( SfxItemSet& ) bCheck = aCBCollect.IsChecked(); bModified |= pOpt->bAutoCmpltCollectWords != bCheck; pOpt->bAutoCmpltCollectWords = bCheck; - bCheck = aCBKeepList.IsChecked(); + bCheck = !aCBRemoveList.IsChecked(); // inverted value! bModified |= pOpt->bAutoCmpltKeepList != bCheck; pOpt->bAutoCmpltKeepList = bCheck; bCheck = aCBAppendSpace.IsChecked(); @@ -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 d3c34e3e48a2..6a698b4397d7 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 d9d16f8ed064..dba6ce826cc3 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 9ec079a5daae..a087bd7d59dc 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 b69d3449db4c..c229953ad3c8 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 fa962beafc3d..a66c7b3c10a8 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 5fe71d5eb8af..996d0f63f9e9 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 e6c1325b4b38..e52c21fc597a 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 91439e285f7d..920f99e03aec 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 000000000000..10b0a5d713a3 --- /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 c00be65908e2..e07c7cb2f1d5 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/source/cui/insrc.hxx b/svx/source/cui/insrc.hxx new file mode 100644 index 000000000000..e187313bdd03 --- /dev/null +++ b/svx/source/cui/insrc.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * 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.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_INSRC_HXX +#define _SVX_INSRC_HXX + +#include <svx/stddlg.hxx> + +#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 SvxInsRowColDlg : public SvxAbstractInsRowColDlg, public ModalDialog +{ + FixedText aCount; + NumericField aCountEdit; + FixedLine aInsFL; + + RadioButton aBeforeBtn; + RadioButton aAfterBtn; + FixedLine aPosFL; + + String aRow; + String aCol; + + OKButton aOKBtn; + CancelButton aCancelBtn; + HelpButton aHelpBtn; + + 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 000000000000..6023e94604ef --- /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 84fdb5c1af7f..0de8a8c5e1dd 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 7db32bb15f7a..7a1db4a85f19 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 ca8c361fa615..2f39bdc7a7b3 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 b8dc903879ed..3ad985caa706 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 c44087708b31..4b86896fa58f 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 7f3ad6968079..a711be6bf0fc 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 b31d56493aed..eeef9ec75fea 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 deb57fbddfb1..f842af6b7559 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 4a114b278cca..98aefdc79cc4 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 bf225508310e..734b59e1f6fe 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 a00a09e919e6..cc8f2db676ae 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 a0d07d999c60..ca2be79075e8 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 dca32260ab8d..197d1e2f2959 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 fb95a5bfbb15..f066cd6a4729 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 7f42ad751edc..25a537db072a 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 3451007a2b28..6d885d51e012 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 9cb3c414de37..0b41dda45eaa 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 b3544b8185da..8f43d8ac23a2 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 7b23629d625d..544500c34091 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 a81910b83038..9940a9bb21bc 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 beef4fe8ae48..59d0c721b560 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 5076b06f52c5..5018bd28a640 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 277a6a9f8372..40c94d2128c3 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 04865246a915..c54081365a11 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 8d0ec6ac4d59..918234222135 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 c90de8eb5ce0..acf278e2d01f 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 dd9662d366e5..872f19485ae6 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 2b0967e173a8..030dfb1ad615 100644 --- a/svx/source/editeng/editdoc2.cxx +++ b/svx/source/editeng/editdoc2.cxx @@ -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++ ) diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx index 2cff5e76dded..0f513b84bdfe 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,15 +697,35 @@ 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 ) { DBG_CHKTHIS( EditEngine, 0 ); diff --git a/svx/source/editeng/editobj.cxx b/svx/source/editeng/editobj.cxx index d0170e507060..fb5e921f60f0 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 51a044575dd2..2ed9c8b3e6d8 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 25cf685a5df7..df6725cff00f 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 e0628d086767..a659b0e513f0 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 2e27bd744637..16f0c1f5277d 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 5df4b0f5ed29..25b7cec4f449 100644 --- a/svx/source/editeng/impedit.hxx +++ b/svx/source/editeng/impedit.hxx @@ -813,6 +813,8 @@ public: 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; + 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 1299cfd1520a..f8cd7e67a4c9 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 3df2e40b8145..821c0ba07c32 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 4c03f949e939..bb590bd76c71 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 23e73421192d..2d3408ffeb86 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 ebd11f87c477..22ef5777f730 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 d92b1dd4bbca..99abbd9853f7 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 21381d9c8709..26c0d04a891e 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 80983514ede5..0bfc7c768973 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 d6cd4f2d2bae..45a67a09e52d 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 cab60f046cf3..da7fe3447b0a 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 a2387ef180f4..1e86308f9c44 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 2cf5f158ac1f..000000000000 --- 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 fd4ab39e2f91..b9f40b6ddda2 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 f7e59ce41888..10c0978288a6 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 95f1ae30f41c..18ca68b14bb0 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 6f4dff9d7fb3..1c4e64929dae 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 32a40c0949e4..000000000000 --- 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 9c9c76b9d403..104d2f423eb5 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 3d405edc00f1..b649be94d106 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 25992ad607dd..b5cdd332362d 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 703f730433c9..ae1f36e5f742 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 032c5b5472c7..e85e36b7b8ac 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 81e77be20b8e..deac560db58b 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 15174b85ef69..45e0019eb67d 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 5f48c24e1085..2bb298836d02 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 5684a4c0bd55..7a973e129280 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 f85f61fdd126..689d02396d23 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 7b66a9968f13..df60ba931739 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 e37b6a32e74e..4099f241b72a 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 90a7a4027b46..350fbedd709e 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 adfb73ad1dc8..34d88b325731 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 e538ee994d8f..201a5a351224 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 d3e8e8ce0327..438aee48d969 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 cd58a79df753..000000000000 --- 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 44495a1002e9..935e84c6448e 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 3f90948620da..21030d294a10 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 5e8eae756b89..2090b7e6b667 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 a68e28270591..3b4c3582f314 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 2f7e43073b8b..f60af20e05fd 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 496993f7fbe1..76c7d1c92df7 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 070367f26dd9..4758b17dd621 100644 --- a/svx/source/inc/unoedprx.hxx +++ b/svx/source/inc/unoedprx.hxx @@ -79,6 +79,9 @@ 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 ); @@ -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 dd8391e89c12..555e7f380ab3 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 8b299aa9ddb9..373b6ecc0f4a 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 c6cae5464735..ef4bf0b00149 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 50c18cd14b17..2d1e5b6ebf9f 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 c327cec80d1b..5bb1b77efc35 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 8057eded6131..65157df81baa 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 85c120f88d1b..adbe8b104860 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 428d18c20649..591bce8f4f6d 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 5a8c149fa2bf..5830a737e790 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 7308bbf221eb..7db08e229536 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 17674c4254ca..48823640af61 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 000000000000..afd772bbd7e4 --- /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 c4828b81f324..d68703983ebd 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 148d7391c905..86fc6d1c1a5d 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 b8bf859dbc17..3da9e8dbecac 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 b76f3a8c366e..0e319ad1be81 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 adbd85f88d94..44e161a3b503 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 6e9d312b8357..9eee8dbccce8 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 000000000000..0282b519499c --- /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/source/sdr/attribute/sdrformtextoutlineattribute.cxx b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx new file mode 100644 index 000000000000..db2fe20ae21b --- /dev/null +++ b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx @@ -0,0 +1,66 @@ +/************************************************************************* + * + * 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/sdrformtextoutlineattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// +// pointer compare define +#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q)) + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute( + const LineAttribute& rLineAttribute, + const StrokeAttribute& rStrokeAttribute, + sal_uInt8 nTransparence) + : maLineAttribute(rLineAttribute), + maStrokeAttribute(rStrokeAttribute), + mnTransparence(nTransparence) + { + } + + 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 + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index 394f68041d7a..33c958fa6268 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 851ee1f3da58..9ae265d29362 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 aae01c5d24ff..b083a1014299 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 e1b2867b0d66..3c239b12113c 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; - - 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); - } + // #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)); // 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 dc3fbcfaaa61..0f818ff40f7a 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 c48d110faaf2..8ba8ae8ab4c9 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 394ae3141182..5e9ab788e392 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 87288882995e..34fddf088c98 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 d5681c60463e..635ae9c7fcc8 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,136 +60,173 @@ 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()); - // the original ChartPrettyPainter does not do it for VDEV - if(!bPrettyPrintingForBitmaps && bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice()) + // 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(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 ea260f3285f7..92003865fde0 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 1243a71e2585..d202992c090d 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 4781cc247e7e..dcfeb0ae3dc2 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 cc782d38bc7d..000000000000 --- 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 9f0e183f420c..cd50c9149b27 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 7107817fad04..90bd99bc289e 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 a15d38f16bc9..9bda13816029 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 5de8d071a292..12cb5ac660ba 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 003da41ee31d..90ecb869f4f6 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 8c682adfc166..79d493b6d9d0 100644 --- a/svx/source/sdr/overlay/overlaymanager.cxx +++ b/svx/source/sdr/overlay/overlaymanager.cxx @@ -50,33 +50,49 @@ 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 @@ -84,87 +100,162 @@ namespace sdr } } - 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 { - 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; - } - - // set manager - rOverlayObject.mpOverlayManager = this; + OSL_ENSURE(0 == rOverlayObject.mpOverlayManager, "OverlayObject is added twice to an OverlayManager (!)"); - // 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 (!)"); + // execute remove actions + impApplyRemoveActions(rOverlayObject); - if(rOverlayObject.mpPrevious) - { - rOverlayObject.mpPrevious->mpNext = 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.mpNext) + if(bFound) { - rOverlayObject.mpNext->mpPrevious = rOverlayObject.mpPrevious; + maOverlayObjects.erase(aFindResult); } - - if(&rOverlayObject == mpOverlayObjectStart) - { - mpOverlayObjectStart = rOverlayObject.mpNext; - } - - if(&rOverlayObject == mpOverlayObjectEnd) - { - mpOverlayObjectEnd = rOverlayObject.mpPrevious; - } - - // 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 584faedcdda2..2b664e816d42 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 658b6719709e..5cddc3c63627 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> ////////////////////////////////////////////////////////////////////////////// @@ -53,206 +52,94 @@ namespace sdr { 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); - } - } - } + const basegfx::B2DRange aPreviousRange(maBaseRange); + maBaseRange.reset(); + setPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DSequence()); - // support method to draw striped geometries - void OverlayObject::ImpDrawRangeStriped(OutputDevice& rOutputDevice, const basegfx::B2DRange& rRange) - { - if(getOverlayManager()) + if(getOverlayManager() && !aPreviousRange.isEmpty()) { - const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(rRange)); - - if(aPolygon.count()) - { - ImpDrawPolygonStriped(rOutputDevice, aPolygon); - } + 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 25d2dbbdd31b..5df0fc85f8f9 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 ); + const basegfx::B2DRange& rRange(maRectangles[a]); + const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(rRange)); - // if(OUTDEV_WINDOW == rOutputDevice.GetOutDevType()) - // { - // ((Window&)rOutputDevice).Invert(aRectangle, INVERT_HIGHLIGHT); - // } - - 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 3c9107d94bfe..370b6d66c225 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 3d859a9b0659..a94dbdb9d1c4 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 1383a296709b..c43a9494901f 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 ea5be0e4f400..42a3575288be 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()); + 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()); - // Top lines - ImpDrawLineStriped(rOutputDevice, aRange.getMinX(), aVisibleLogic.Top(), aRange.getMinX(), aRange.getMinY()); - ImpDrawLineStriped(rOutputDevice, aRange.getMaxX(), aVisibleLogic.Top(), aRange.getMaxX(), aRange.getMinY()); + 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 7f1dbf2d5a4f..000000000000 --- 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 000000000000..2411ca3c31b4 --- /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 000000000000..664c487c7e43 --- /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 1d01ab24e388..74f23b8f845c 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; @@ -53,33 +56,30 @@ namespace sdr aPolygon.append(getThirdPosition()); aPolygon.setClosed(true); - ImpDrawPolygonStriped(rOutputDevice, aPolygon); - } + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aPolygon), + getBaseColor().getBColor())); - void OverlayTriangleStriped::createBaseRange(OutputDevice& /*rOutputDevice*/) - { - // reset range and expand it - maBaseRange.reset(); - maBaseRange.expand(getBasePosition()); - maBaseRange.expand(getSecondPosition()); - maBaseRange.expand(getThirdPosition()); + return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); } - 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 e9e976d434ed..7510b6a23b35 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 a330362dddbc..277ee70f82ca 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 80067901483b..3c8feb7ff2b2 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)); - - aLineSequence[0] = createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline); - aLineSequence[1] = createPolygonLinePrimitive(getTail(), getTransform(), aBlackHairline); + // 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)))); + } - 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 5ee00133588f..0edbe1a35046 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 51be7cd03033..c8847624bcdd 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 4a27eb73de8e..9666bd2c1ac1 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()) - { - // 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 - { - 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 + if(rText.isScroll()) + { + // suppress scroll when FontWork + if(!rText.getSdrFormTextAttribute()) { - rText.getScrollTextTiming(aAnimationList, aScale.getY(), aScaledRange.getHeight()); - } + // get scroll direction + const SdrTextAniDirection eDirection(rText.getSdrText().GetObject().GetTextAniDirection()); + const bool bHorizontal(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection); - 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; + 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); + } + } + } - // 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); + 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); - // 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); - } + // 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 814c20b681ac..ed3062184f1a 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 f1f88684dc6c..f5f2f4e876dc 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 7f9b47afb2d4..f515b9b6a5e9 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 2cedb1bfce29..ab5d23962719 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 000000000000..67fee9215b73 --- /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 3b6a653a7bc6..91ed0bd2adce 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 97aaf2735630..64ac716b40e9 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, 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); + // 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)))); + } - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence))); + // 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; } 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 113cd226d8ba..0cad266f69d1 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -41,6 +41,9 @@ #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> ////////////////////////////////////////////////////////////////////////////// @@ -48,6 +51,46 @@ 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 { namespace primitive2d @@ -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 3445e134fd0a..b3cc32d71536 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 5fb566e77dc2..f720e1b9d1b2 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 0ac4b70130e6..e777ad70d3f1 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 000000000000..3b613f42e6ef --- /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 fcf824c82921..5197b870919f 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 ebd596ac972d..341ce6dd90c0 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 bbc31b803096..e427e42d80ab 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 4dfc001ed6fc..69459b1bff35 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 75ce75240a6f..901bc0e7e5b6 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 7e2b04591d3f..bd6bf457bdbf 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 49e3fc87ae68..30c3ff62531a 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 2157c1052192..727e7f0bafcc 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 28435b26ff9f..0eab890b49f0 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 805b56eb207f..7273bb49889a 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 0f9e2e168721..dab855fa6f41 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 f192221bd880..d4d4717535b8 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 c1abb3add6b9..7ba4aec3e565 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -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 @@ -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(); } @@ -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(); } @@ -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(); } @@ -902,6 +980,10 @@ 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()) { @@ -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); @@ -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))); @@ -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 @@ -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()) @@ -2387,36 +2475,31 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas drawinglayer::processor2d::LineGeometryExtractor2D aExtractor(aViewInformation2D); aExtractor.process(xSequence); - aAreaPolyPolygon = aExtractor.getExtractedLineFills(); - aLinePolyPolygon = aExtractor.getExtractedHairlines(); - } + // #i102241# check for line results + const std::vector< basegfx::B2DPolygon >& rHairlineVector = 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); + 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)); @@ -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! */ diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 47fc34dba5ba..7d41191c99a9 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 9c8b8bf81937..6af31224ee45 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 4d4b9a985e15..abadbf094981 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 805577df9b72..3f5da01e101b 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 879a53851919..5782ca91b74b 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 6f97d4051b28..330b7f5c37f6 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 f71b45e928ee..8c30bfb88018 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -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 7d128cf79746..1e9c9b57c52d 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 ed841692a5f8..837b75bcf849 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 9abf3950d694..6b2f02299d4a 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 fe56b2da4e61..76c29de8d480 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 57fec8fbfaaa..f3bdeeb4811c 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 3b1a304bf9d4..f384cc9b4326 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 addc538efb25..aaed882cae3d 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())); + + if(pModel) { - pPathObj->ImpSetAnchorPos(aAnchor); - pPathObj->NbcSetLayer(SdrLayerID(GetLayer())); + pPathObj->SetModel(pModel); - if(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 abf9574f9172..74a3b0a49ada 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 a93905fe21ed..18840cde18e0 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 2986cb482aae..05b5b5e5aca6 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 c42497d73507..c89c458aa9c7 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 be0e871d61bf..0f126e2ec701 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 32c457cf3d02..144db41d515f 100644 --- a/svx/source/svdraw/svdstr.src +++ b/svx/source/svdraw/svdstr.src @@ -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 cbf80e23c91d..038eb96b35e6 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 918855b6d665..000000000000 --- 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 e78b85ff10d0..000000000000 --- 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 82fd38519171..000000000000 --- 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 b49d087d0251..08cee1eb17d3 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -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 0d47c0e81170..c7702b0d372a 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 9a6958b34c4d..b9a197ed89fb 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 8dbbd79a82fe..950036034d41 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 b4aaa497d2ef..6ba88589cb0f 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 bab67c91b1ef..889298b89f35 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 6f4bea3cbd40..d76d5e1b3079 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 166495ecc83d..95c8d684fe3b 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 89e18137eeb0..455d39eee467 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 4ac7b4754f8d..46268a68ca02 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 e48fe5bf74d9..901fe4735e51 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 72d0f18c582f..1d097dc6ede5 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 8789cd4da86b..ae0dc5eb685a 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 c42feb83c742..44caaee6c148 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 1d7b3f8a3295..c99c2b3c2262 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,9 +523,12 @@ 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() ) @@ -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 4caf7cd957a1..e13fad84179e 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 6b88e1d9a0ac..72e10e29c336 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 a6831f72bc88..e78d7fc4bdd3 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 5c1aca5a4542..b2620452d31a 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 c1c58977be64..45a24211f7b2 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 02bbd865d4fb..9bca3b979841 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 392b4c608ac6..efa49025bbc4 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 180724093424..601f2594a080 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 b5f3e5c6ec5f..5d1af9af2190 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()) ); - std::vector< SdrObject* > aShapes; + // #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 e8a4621ac63f..a2fbc38dd3d9 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 1210a3847a96..d742cf63ece8 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(); + 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 < 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 9b71d644f39d..4b8ecb093df4 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 fdac6b7a9c1a..7f7aedf860e9 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.") ); + const OUString aTextFieldPrexit( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.textfield.") ); - if( ServiceSpecifier.compareTo( aTextFieldPrexit, aTextFieldPrexit.getLength() ) == 0 ) + // #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 9b68e94239c5..d6d0913c4070 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 dc24ad21ddca..f7826c546d60 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 08e83fc889fb..81439effcfc1 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 e808dbe02799..802ded5aa7c1 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 7c31f8b14ffc..e7bbcea519b8 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"); diff --git a/svx/source/unoedit/unofored.cxx b/svx/source/unoedit/unofored.cxx index 685e5973b39f..c06c37ae2070 100644 --- a/svx/source/unoedit/unofored.cxx +++ b/svx/source/unoedit/unofored.cxx @@ -471,6 +471,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 ) { rEditEngine.QuickFormatDoc(); diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx index c46551d52d4f..9c6cb07440d7 100644 --- a/svx/source/unoedit/unoforou.cxx +++ b/svx/source/unoedit/unoforou.cxx @@ -430,6 +430,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 ) { rOutliner.QuickFormatDoc(); diff --git a/svx/source/unoedit/unotext.cxx b/svx/source/unoedit/unotext.cxx index 4a550fb8537d..a46533657f1c 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 aff102a09900..3826a4d6a330 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 a63b79bb6f67..a699208f4f01 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 ebeeffe742b8..126f49fe0b50 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 4cc56d5ca427..7ab6a44fd3fb 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 21dd7fcb1acd..6fae754662ee 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) { |