diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-01-29 15:36:08 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-01-29 15:36:08 +0000 |
commit | ab2c479d30f89cd8724945a4e4f3894095fb9d31 (patch) | |
tree | 6f052827c7ab277f0c5985d64cb9f697e238b5e5 /svx/source | |
parent | c34ac530c00fe2fdafa021aae4fcfd9cc9955c21 (diff) | |
parent | e92917d1bc75f095222ec757f0006b8ef6883a9b (diff) |
ab71: merge with DEV300_m63
Diffstat (limited to 'svx/source')
239 files changed, 6511 insertions, 3934 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..15da06a17054 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 @@ -338,6 +340,13 @@ namespace accessibility if( mbEditSourceEmpty ) Switch2ProxyEditSource(); } + else if (pSdrHint && pSdrHint->GetObject()!=NULL) + { + // When the SdrObject just got a para outliner object then + // switch the edit source. + if (pSdrHint->GetObject()->GetOutlinerParaObject() != NULL) + Switch2ProxyEditSource(); + } // forward messages Broadcast( rHint ); 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/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/cuioptgenrl.hxx b/svx/source/cui/cuioptgenrl.hxx index a19b20c16028..22ef5481651f 100644 --- a/svx/source/cui/cuioptgenrl.hxx +++ b/svx/source/cui/cuioptgenrl.hxx @@ -80,6 +80,7 @@ private: SvxUserEdit aCompanyEdit; FixedText aNameLbl; FixedText aNameLblRuss; + FixedText aNameLblEastern; SvxUserEdit aFirstName; SvxUserEdit aFatherName; SvxUserEdit aName; 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/cui/insrc.hrc b/svx/source/cui/insrc.hrc new file mode 100644 index 000000000000..e07c7cb2f1d5 --- /dev/null +++ b/svx/source/cui/insrc.hrc @@ -0,0 +1,43 @@ +/************************************************************************* + * + * 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.hrc,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. + * + ************************************************************************/ +#define FT_COUNT 1 +#define ED_COUNT 2 +#define FL_INS 3 + +#define CB_POS_BEFORE 10 +#define CB_POS_AFTER 11 +#define FL_POS 12 + +#define STR_ROW 20 +#define STR_COL 21 + +#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.cxx b/svx/source/cui/macropg.cxx index 6eeba1b0e703..0ee76246abe3 100644 --- a/svx/source/cui/macropg.cxx +++ b/svx/source/cui/macropg.cxx @@ -271,22 +271,42 @@ void _SvxMacroTabPage::InitResources() // the event name to UI string mappings for App Events aDisplayNames.push_back( EventDisplayName( "OnStartApp", RID_SVXSTR_EVENT_STARTAPP ) ); aDisplayNames.push_back( EventDisplayName( "OnCloseApp", RID_SVXSTR_EVENT_CLOSEAPP ) ); - aDisplayNames.push_back( EventDisplayName( "OnNew", RID_SVXSTR_EVENT_CREATEDOC ) ); + aDisplayNames.push_back( EventDisplayName( "OnCreate", RID_SVXSTR_EVENT_CREATEDOC ) ); + aDisplayNames.push_back( EventDisplayName( "OnNew", RID_SVXSTR_EVENT_NEWDOC ) ); + aDisplayNames.push_back( EventDisplayName( "OnLoadFinished", RID_SVXSTR_EVENT_LOADDOCFINISHED ) ); aDisplayNames.push_back( EventDisplayName( "OnLoad", RID_SVXSTR_EVENT_OPENDOC ) ); - aDisplayNames.push_back( EventDisplayName( "OnSaveAs", RID_SVXSTR_EVENT_SAVEASDOC ) ); - aDisplayNames.push_back( EventDisplayName( "OnSaveAsDone", RID_SVXSTR_EVENT_SAVEASDOCDONE ) ); - aDisplayNames.push_back( EventDisplayName( "OnSave", RID_SVXSTR_EVENT_SAVEDOC ) ); - aDisplayNames.push_back( EventDisplayName( "OnSaveDone", RID_SVXSTR_EVENT_SAVEDOCDONE ) ); aDisplayNames.push_back( EventDisplayName( "OnPrepareUnload", RID_SVXSTR_EVENT_PREPARECLOSEDOC ) ); aDisplayNames.push_back( EventDisplayName( "OnUnload", RID_SVXSTR_EVENT_CLOSEDOC ) ) ; + aDisplayNames.push_back( EventDisplayName( "OnViewCreated", RID_SVXSTR_EVENT_VIEWCREATED ) ); + aDisplayNames.push_back( EventDisplayName( "OnPrepareViewClosing", RID_SVXSTR_EVENT_PREPARECLOSEVIEW ) ); + aDisplayNames.push_back( EventDisplayName( "OnViewClosed", RID_SVXSTR_EVENT_CLOSEVIEW ) ) ; aDisplayNames.push_back( EventDisplayName( "OnFocus", RID_SVXSTR_EVENT_ACTIVATEDOC ) ); aDisplayNames.push_back( EventDisplayName( "OnUnfocus", RID_SVXSTR_EVENT_DEACTIVATEDOC ) ); + aDisplayNames.push_back( EventDisplayName( "OnSave", RID_SVXSTR_EVENT_SAVEDOC ) ); + aDisplayNames.push_back( EventDisplayName( "OnSaveDone", RID_SVXSTR_EVENT_SAVEDOCDONE ) ); + aDisplayNames.push_back( EventDisplayName( "OnSaveFailed", RID_SVXSTR_EVENT_SAVEDOCFAILED ) ); + aDisplayNames.push_back( EventDisplayName( "OnSaveAs", RID_SVXSTR_EVENT_SAVEASDOC ) ); + aDisplayNames.push_back( EventDisplayName( "OnSaveAsDone", RID_SVXSTR_EVENT_SAVEASDOCDONE ) ); + aDisplayNames.push_back( EventDisplayName( "OnSaveAsFailed", RID_SVXSTR_EVENT_SAVEASDOCFAILED ) ); + aDisplayNames.push_back( EventDisplayName( "OnCopyTo", RID_SVXSTR_EVENT_COPYTODOC ) ); + aDisplayNames.push_back( EventDisplayName( "OnCopyToDone", RID_SVXSTR_EVENT_COPYTODOCDONE ) ); + aDisplayNames.push_back( EventDisplayName( "OnCopyToFailed", RID_SVXSTR_EVENT_COPYTODOCFAILED ) ); aDisplayNames.push_back( EventDisplayName( "OnPrint", RID_SVXSTR_EVENT_PRINTDOC ) ); aDisplayNames.push_back( EventDisplayName( "OnModifyChanged", RID_SVXSTR_EVENT_MODIFYCHANGED ) ); + aDisplayNames.push_back( EventDisplayName( "OnTitleChanged", RID_SVXSTR_EVENT_TITLECHANGED ) ); +// aDisplayNames.push_back( EventDisplayName( "OnModeChanged", RID_SVXSTR_EVENT_MODECHANGED ) ); +// aDisplayNames.push_back( EventDisplayName( "OnVisAreaChanged", RID_SVXSTR_EVENT_VISAREACHANGED ) ); +// aDisplayNames.push_back( EventDisplayName( "OnStorageChanged", RID_SVXSTR_EVENT_STORAGECHANGED ) ); + + // application specific events aDisplayNames.push_back( EventDisplayName( "OnMailMerge", RID_SVXSTR_EVENT_MAILMERGE ) ); + aDisplayNames.push_back( EventDisplayName( "OnMailMergeFinished", RID_SVXSTR_EVENT_MAILMERGE_END ) ); + aDisplayNames.push_back( EventDisplayName( "OnFieldMerge", RID_SVXSTR_EVENT_FIELDMERGE ) ); + aDisplayNames.push_back( EventDisplayName( "OnFieldMergeFinished", RID_SVXSTR_EVENT_FIELDMERGE_FINISHED ) ); aDisplayNames.push_back( EventDisplayName( "OnPageCountChange", RID_SVXSTR_EVENT_PAGECOUNTCHANGE ) ); aDisplayNames.push_back( EventDisplayName( "OnSubComponentOpened", RID_SVXSTR_EVENT_SUBCOMPONENT_OPENED ) ); aDisplayNames.push_back( EventDisplayName( "OnSubComponentClosed", RID_SVXSTR_EVENT_SUBCOMPONENT_CLOSED ) ); +// aDisplayNames.push_back( EventDisplayName( "OnLayoutFinished", RID_SVXSTR_EVENT_LAYOUT_FINISHED ) ); // the event name to UI string mappings for forms & dialogs // @@ -571,9 +591,14 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents) rListBox.Select( _pE ); rListBox.MakeVisible( _pE ); } + pE = rListBox.GetEntry(0); if( pE ) + { rListBox.Select( pE ); + rListBox.MakeVisible( pE ); + } + rListBox.SetUpdateMode( TRUE ); EnableButtons( String() ); } diff --git a/svx/source/cui/macropg.src b/svx/source/cui/macropg.src index 0de8a8c5e1dd..92e1e718ba61 100644 --- a/svx/source/cui/macropg.src +++ b/svx/source/cui/macropg.src @@ -165,19 +165,19 @@ String RID_SVXSTR_EVENT_CLOSEAPP Text [ en-US ] = "Close Application" ; }; -String RID_SVXSTR_EVENT_CREATEDOC +String RID_SVXSTR_EVENT_NEWDOC { - Text [ en-US ] = "Create Document" ; + Text [ en-US ] = "New Document" ; }; String RID_SVXSTR_EVENT_CLOSEDOC { - Text [ en-US ] = "Document is closing" ; + Text [ en-US ] = "Document closed" ; }; String RID_SVXSTR_EVENT_PREPARECLOSEDOC { - Text [ en-US ] = "Close Document" ; + Text [ en-US ] = "Document is going to be closed" ; }; String RID_SVXSTR_EVENT_OPENDOC @@ -226,7 +226,19 @@ String RID_SVXSTR_EVENT_MODIFYCHANGED }; String RID_SVXSTR_EVENT_MAILMERGE { - Text [ en-US ] = "Print form letters" ; + Text [ en-US ] = "Printing of form letters started" ; +}; +String RID_SVXSTR_EVENT_MAILMERGE_END +{ + Text [ en-US ] = "Printing of form letters finished" ; +}; +String RID_SVXSTR_EVENT_FIELDMERGE +{ + Text [ en-US ] = "Merging of form fields started" ; +}; +String RID_SVXSTR_EVENT_FIELDMERGE_FINISHED +{ + Text [ en-US ] = "Merging of form fields finished" ; }; String RID_SVXSTR_EVENT_PAGECOUNTCHANGE { @@ -372,3 +384,78 @@ String RID_SVXSTR_EVENT_CHANGED { Text [ en-US ] = "Changed" ; }; + +String RID_SVXSTR_EVENT_CREATEDOC +{ + Text [ en-US ] = "Document created" ; +}; + +String RID_SVXSTR_EVENT_LOADDOCFINISHED +{ + Text [ en-US ] = "Document loading finished" ; +}; + +String RID_SVXSTR_EVENT_SAVEDOCFAILED +{ + Text [ en-US ] = "Saving of document failed" ; +}; + +String RID_SVXSTR_EVENT_SAVEASDOCFAILED +{ + Text [ en-US ] = "'Save as' has failed" ; +}; + +String RID_SVXSTR_EVENT_COPYTODOC +{ + Text [ en-US ] = "Storing or exporting copy of document" ; +}; + +String RID_SVXSTR_EVENT_COPYTODOCDONE +{ + Text [ en-US ] = "Document copy has been created" ; +}; + +String RID_SVXSTR_EVENT_COPYTODOCFAILED +{ + Text [ en-US ] = "Creating of document copy failed" ; +}; + +String RID_SVXSTR_EVENT_VIEWCREATED +{ + Text [ en-US ] = "View created" ; +}; + +String RID_SVXSTR_EVENT_PREPARECLOSEVIEW +{ + Text [ en-US ] = "View is going to be closed" ; +}; + +String RID_SVXSTR_EVENT_CLOSEVIEW +{ + Text [ en-US ] = "View closed" ; +}; + +String RID_SVXSTR_EVENT_TITLECHANGED +{ + Text [ en-US ] = "Document title changed" ; +}; + +String RID_SVXSTR_EVENT_MODECHANGED +{ + Text [ en-US ] = "Document mode changed" ; +}; + +String RID_SVXSTR_EVENT_VISAREACHANGED +{ + Text [ en-US ] = "Visible area changed" ; +}; + +String RID_SVXSTR_EVENT_STORAGECHANGED +{ + Text [ en-US ] = "Document has got a new storage" ; +}; + +String RID_SVXSTR_EVENT_LAYOUT_FINISHED +{ + Text [ en-US ] = "Document layout finished" ; +}; 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/numfmt.cxx b/svx/source/cui/numfmt.cxx index a3b426c6110e..d6978ea008b8 100644 --- a/svx/source/cui/numfmt.cxx +++ b/svx/source/cui/numfmt.cxx @@ -292,7 +292,6 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage( Window* pParent, pNumFmtShell ( NULL ), nInitFormat ( ULONG_MAX ), - aStrEurope ( THIS_SVX_RES( STR_EUROPE) ), sAutomaticEntry ( THIS_SVX_RES( STR_AUTO_ENTRY)), pLastActivWindow( NULL ) { @@ -1887,7 +1886,7 @@ void SvxNumberFormatTabPage::FillCurrencyBox() USHORT nPos=0; USHORT nSelPos=0; - pNumFmtShell->GetCurrencySymbols(aList,aStrEurope,&nSelPos); + pNumFmtShell->GetCurrencySymbols( aList, &nSelPos); for(USHORT i=1;i<aList.Count();i++) { diff --git a/svx/source/cui/numfmt.hrc b/svx/source/cui/numfmt.hrc index 7f63e02b57d5..102c5a212ac6 100644 --- a/svx/source/cui/numfmt.hrc +++ b/svx/source/cui/numfmt.hrc @@ -64,10 +64,9 @@ #define IB_INFO 31 #define IL_ICON 32 #define LB_CURRENCY 33 -#define STR_EUROPE 34 -#define CB_SOURCEFORMAT 35 -#define IL_ICON_HC 36 -#define STR_AUTO_ENTRY 37 +#define CB_SOURCEFORMAT 34 +#define IL_ICON_HC 35 +#define STR_AUTO_ENTRY 36 #define TBX_ADDREMOVE 1 #define IID_ADD 1 diff --git a/svx/source/cui/numfmt.hxx b/svx/source/cui/numfmt.hxx index ff9d0813f6e5..e14f397cf0ba 100644 --- a/svx/source/cui/numfmt.hxx +++ b/svx/source/cui/numfmt.hxx @@ -170,7 +170,6 @@ private: long nCurFormatHeight; long nStdFormatY; long nStdFormatHeight; - LocalizedString aStrEurope; LocalizedString sAutomaticEntry; Window* pLastActivWindow; diff --git a/svx/source/cui/numfmt.src b/svx/source/cui/numfmt.src index ab71ae446998..96269bb9ec09 100644 --- a/svx/source/cui/numfmt.src +++ b/svx/source/cui/numfmt.src @@ -256,10 +256,6 @@ TabPage RID_SVXPAGE_NUMBERFORMAT IdCount = { 3 ; }; }; - String STR_EUROPE - { - Text [ en-US ] = "Europe"; - }; String STR_AUTO_ENTRY { Text [ en-US ] = "Automatic"; diff --git a/svx/source/cui/optaccessibility.cxx b/svx/source/cui/optaccessibility.cxx index 749e98a7d5c2..eb7cac6d8c5d 100644 --- a/svx/source/cui/optaccessibility.cxx +++ b/svx/source/cui/optaccessibility.cxx @@ -145,14 +145,14 @@ BOOL SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet& ) if(m_pImpl->m_aConfig.IsModified()) m_pImpl->m_aConfig.Commit(); -#ifndef UNX AllSettings aAllSettings = Application::GetSettings(); MiscSettings aMiscSettings = aAllSettings.GetMiscSettings(); +#ifndef UNX aMiscSettings.SetEnableATToolSupport( m_aAccessibilityTool.IsChecked() ); +#endif aAllSettings.SetMiscSettings(aMiscSettings); Application::SetSettings(aAllSettings); Application::MergeSystemSettings( aAllSettings ); -#endif return FALSE; } diff --git a/svx/source/cui/optgdlg.cxx b/svx/source/cui/optgdlg.cxx index ca8c361fa615..9a53de6bea72 100644 --- a/svx/source/cui/optgdlg.cxx +++ b/svx/source/cui/optgdlg.cxx @@ -103,6 +103,7 @@ #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/container/XContentEnumerationAccess.hpp> #include <com/sun/star/container/XSet.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> #include <vcl/svapp.hxx> @@ -136,7 +137,6 @@ int OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ ) return LEAVE_PAGE; } -# ifdef ENABLE_GTK namespace { ::rtl::OUString impl_SystemFileOpenServiceName() @@ -146,13 +146,35 @@ 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 return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" ); + #elif (defined MACOSX && defined QUARTZ) + return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.AquaFilePicker" ); + #else + return rtl::OUString(); + #endif } sal_Bool lcl_HasSystemFilePicker() @@ -180,8 +202,6 @@ namespace } } -#endif - // ----------------------------------------------------------------------- OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) : @@ -210,20 +230,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 +702,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 +770,9 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) : #endif + // #i97672# + maSelectionCB.SetToggleHdl( LINK( this, OfaViewTabPage, OnSelectionToggled ) ); + FreeResource(); if( ! Application::ValidateSystemFont() ) @@ -807,6 +827,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 +857,7 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& ) BOOL bModified = FALSE; BOOL bMenuOptModified = FALSE; + bool bRepaintWindows(false); SvtMiscOptions aMiscOptions; UINT16 nSizeLB_NewSelection = aIconSizeLB.GetSelectEntryPos(); @@ -953,16 +983,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 +1037,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 +1137,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(); @@ -1202,8 +1278,13 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe // initialize user interface language selection SvtLanguageTable* pLanguageTable = new SvtLanguageTable; - String aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) ); - aUserInterfaceLB.InsertEntry(aStr); + const String aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) ); + + String aUILang(aStr); + aUILang += String::CreateFromAscii(" - "); + aUILang += pLanguageTable->GetString( Application::GetSettings().GetUILanguage() ); + + aUserInterfaceLB.InsertEntry(aUILang); aUserInterfaceLB.SetEntryData(0, 0); aUserInterfaceLB.SelectEntryPos(0); try @@ -1265,16 +1346,24 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe } aWesternLanguageLB.SetLanguageList( LANG_LIST_WESTERN | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE ); - aAsianLanguageLB .SetLanguageList( LANG_LIST_CJK | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE ); + aWesternLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::LATIN ); + aAsianLanguageLB.SetLanguageList( LANG_LIST_CJK | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE ); + aAsianLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::ASIAN ); aComplexLanguageLB.SetLanguageList( LANG_LIST_CTL | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE ); - aLocaleSettingLB .SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE, FALSE, FALSE); - aLocaleSettingLB.InsertLanguage( LANGUAGE_SYSTEM ); + aComplexLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::COMPLEX ); + + aLocaleSettingLB.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE, FALSE, FALSE); + aLocaleSettingLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::WEAK ); - // insert SYSTEM entry, no specific currency - aCurrencyLB.InsertEntry( aStr ); + const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable(); + const NfCurrencyEntry& rCurr = SvNumberFormatter::GetCurrencyEntry( LANGUAGE_SYSTEM ); + // insert SYSTEM entry + String aDefaultCurr(aStr); + aDefaultCurr += String::CreateFromAscii(" - "); + aDefaultCurr += rCurr.GetBankSymbol(); + aCurrencyLB.InsertEntry( aDefaultCurr ); // all currencies String aTwoSpace( RTL_CONSTASCII_USTRINGPARAM( " " ) ); - const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable(); USHORT nCurrCount = rCurrTab.Count(); // first entry is SYSTEM, skip it for ( USHORT j=1; j < nCurrCount; ++j ) @@ -1497,7 +1586,7 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) if(!bCurrentDocCBChecked) { Any aValue; - Locale aLocale = SvxCreateLocale( eSelectLang ); + Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false ); aValue <<= aLocale; OUString aPropName( C2U("DefaultLocale") ); pLangConfig->aLinguConfig.SetProperty( aPropName, aValue ); @@ -1506,7 +1595,8 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) } if(pCurrentDocShell) { - rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_LANGUAGE)); + rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::LATIN), + SID_ATTR_LANGUAGE)); bRet = TRUE; } } @@ -1517,7 +1607,7 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) if(!bCurrentDocCBChecked) { Any aValue; - Locale aLocale = SvxCreateLocale( eSelectLang ); + Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false ); aValue <<= aLocale; OUString aPropName( C2U("DefaultLocale_CJK") ); pLangConfig->aLinguConfig.SetProperty( aPropName, aValue ); @@ -1526,7 +1616,8 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) } if(pCurrentDocShell) { - rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CJK_LANGUAGE)); + rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::ASIAN), + SID_ATTR_CHAR_CJK_LANGUAGE)); bRet = TRUE; } } @@ -1537,7 +1628,7 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) if(!bCurrentDocCBChecked) { Any aValue; - Locale aLocale = SvxCreateLocale( eSelectLang ); + Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false ); aValue <<= aLocale; OUString aPropName( C2U("DefaultLocale_CTL") ); pLangConfig->aLinguConfig.SetProperty( aPropName, aValue ); @@ -1546,7 +1637,8 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) } if(pCurrentDocShell) { - rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CTL_LANGUAGE)); + rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::COMPLEX), + SID_ATTR_CHAR_CTL_LANGUAGE)); bRet = TRUE; } } @@ -1646,13 +1738,18 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet ) aWestLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale")); Locale aLocale; aWestLang >>= aLocale; - eCurLang = SvxLocaleToLanguage( aLocale ); + + eCurLang = MsLangId::convertLocaleToLanguage( aLocale ); + aCJKLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CJK")); + aLocale = Locale(); aCJKLang >>= aLocale; - eCurLangCJK = SvxLocaleToLanguage( aLocale ); + eCurLangCJK = MsLangId::convertLocaleToLanguage( aLocale ); + aCTLLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CTL")); + aLocale = Locale(); aCTLLang >>= aLocale; - eCurLangCTL = SvxLocaleToLanguage( aLocale ); + eCurLangCTL = MsLangId::convertLocaleToLanguage( aLocale ); } catch(Exception&) { @@ -1664,13 +1761,25 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet ) aCurrentDocCB.Check(bLanguageCurrentDoc_Impl); const SfxPoolItem* pLang; if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_LANGUAGE, FALSE, &pLang)) - eCurLang = ((const SvxLanguageItem*)pLang)->GetValue(); + { + LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue(); + if (MsLangId::resolveSystemLanguageByScriptType(eCurLang, ::com::sun::star::i18n::ScriptType::LATIN) != eTempCurLang) + eCurLang = eTempCurLang; + } if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, FALSE, &pLang)) - eCurLangCJK = ((const SvxLanguageItem*)pLang)->GetValue(); + { + LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue(); + if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCJK, ::com::sun::star::i18n::ScriptType::ASIAN) != eTempCurLang) + eCurLangCJK = eTempCurLang; + } if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, FALSE, &pLang)) - eCurLangCTL = ((const SvxLanguageItem*)pLang)->GetValue(); + { + LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue(); + if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCTL, ::com::sun::star::i18n::ScriptType::COMPLEX) != eTempCurLang) + eCurLangCTL = eTempCurLang; + } } if(LANGUAGE_NONE == eCurLang || LANGUAGE_DONTKNOW == eCurLang) aWesternLanguageLB.SelectLanguage(LANGUAGE_NONE); 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..f663a7ed44ef 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 ] = "%" ; + }; }; // ******************************************************************* @@ -428,13 +460,13 @@ TabPage OFA_TP_LANGUAGES FixedText FT_USERINTERFACE { Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; + Size = MAP_APPFONT ( 108 , 8 ) ; Text [ en-US ] = "~User interface"; }; ListBox LB_USERINTERFACE { - Pos = MAP_APPFONT ( 135 , 14 ) ; - Size = MAP_APPFONT ( 113 , 60 ) ; + Pos = MAP_APPFONT ( 123 , 14 ) ; + Size = MAP_APPFONT ( 125 , 60 ) ; DropDown = TRUE ; Border = TRUE ; TabStop = TRUE ; @@ -449,13 +481,13 @@ TabPage OFA_TP_LANGUAGES FixedText FT_LOCALESETTING { Pos = MAP_APPFONT ( 12 , 31 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; + Size = MAP_APPFONT ( 108 , 8 ) ; Text [ en-US ] = "Locale setting"; }; ListBox LB_LOCALESETTING { - Pos = MAP_APPFONT ( 135 , 30 ) ; - Size = MAP_APPFONT ( 113 , 60 ) ; + Pos = MAP_APPFONT ( 123 , 30 ) ; + Size = MAP_APPFONT ( 125 , 60 ) ; DropDown = TRUE ; Border = TRUE ; TabStop = TRUE ; @@ -464,13 +496,13 @@ TabPage OFA_TP_LANGUAGES FixedText FT_DECIMALSEPARATOR { Pos = MAP_APPFONT ( 12 , 46 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; + Size = MAP_APPFONT ( 108 , 8 ) ; Text [ en-US ] = "Decimal separator key"; }; CheckBox CB_DECIMALSEPARATOR { - Pos = MAP_APPFONT ( 135 , 46) ; - Size = MAP_APPFONT ( 119 , RSC_CD_CHECKBOX_HEIGHT ) ; + Pos = MAP_APPFONT ( 123 , 46) ; + Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ; Text [ en-US ] = "~Same as locale setting ( %1 )"; }; FixedImage FI_CURRENCY @@ -482,13 +514,13 @@ TabPage OFA_TP_LANGUAGES FixedText FT_CURRENCY { Pos = MAP_APPFONT ( 12 , 61 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; + Size = MAP_APPFONT ( 108 , 8 ) ; Text [ en-US ] = "~Default currency"; }; ListBox LB_CURRENCY { - Pos = MAP_APPFONT ( 135 , 59 ) ; - Size = MAP_APPFONT ( 113 , 60 ) ; + Pos = MAP_APPFONT ( 123 , 59 ) ; + Size = MAP_APPFONT ( 125 , 60 ) ; DropDown = TRUE ; Border = TRUE ; TabStop = TRUE ; @@ -509,14 +541,14 @@ TabPage OFA_TP_LANGUAGES FixedText FT_WEST_LANG { Pos = MAP_APPFONT ( 12 , 90 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; + Size = MAP_APPFONT ( 108 , 8 ) ; Text [ en-US ] = "Western"; }; ListBox LB_WEST_LANG { - Pos = MAP_APPFONT ( 135 , 88 ) ; - Size = MAP_APPFONT ( 113 , 60 ) ; + Pos = MAP_APPFONT ( 123 , 88 ) ; + Size = MAP_APPFONT ( 125 , 60 ) ; DropDown = TRUE ; Border = TRUE ; TabStop = TRUE ; @@ -531,13 +563,13 @@ TabPage OFA_TP_LANGUAGES FixedText FT_ASIAN_LANG { Pos = MAP_APPFONT ( 12 , 106 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; + Size = MAP_APPFONT ( 108 , 8 ) ; Text [ en-US ] = "Asian"; }; ListBox LB_ASIAN_LANG { - Pos = MAP_APPFONT ( 135 , 104 ) ; - Size = MAP_APPFONT ( 113 , 60 ) ; + Pos = MAP_APPFONT ( 123 , 104 ) ; + Size = MAP_APPFONT ( 125 , 60 ) ; DropDown = TRUE ; Border = TRUE ; TabStop = TRUE ; @@ -552,13 +584,13 @@ TabPage OFA_TP_LANGUAGES FixedText FT_COMPLEX_LANG { Pos = MAP_APPFONT ( 12 , 122 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; + Size = MAP_APPFONT ( 108 , 8 ) ; Text [ en-US ] = "C~TL"; }; ListBox LB_COMPLEX_LANG { - Pos = MAP_APPFONT ( 135 , 120 ) ; - Size = MAP_APPFONT ( 113 , 60 ) ; + Pos = MAP_APPFONT ( 123 , 120 ) ; + Size = MAP_APPFONT ( 125 , 60 ) ; DropDown = TRUE ; Border = TRUE ; TabStop = TRUE ; @@ -566,8 +598,8 @@ TabPage OFA_TP_LANGUAGES }; CheckBox CB_CURRENT_DOC { - Pos = MAP_APPFONT ( 135 , 135 ) ; - Size = MAP_APPFONT ( 113 , RSC_CD_CHECKBOX_HEIGHT ) ; + Pos = MAP_APPFONT ( 123 , 135 ) ; + Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ; Text [ en-US ] = "For the current document only"; }; FixedLine FL_ENHANCED diff --git a/svx/source/cui/optgenrl.cxx b/svx/source/cui/optgenrl.cxx index 1766dd58de72..7159cfdd7e61 100644 --- a/svx/source/cui/optgenrl.cxx +++ b/svx/source/cui/optgenrl.cxx @@ -103,6 +103,7 @@ SvxGeneralTabPage::SvxGeneralTabPage( Window* pParent, const SfxItemSet& rCoreSe aCompanyEdit ( this, SVX_RES( ED_COMPANY ), INDEX_NOTSET, &aCompanyLbl ), aNameLbl ( this, SVX_RES( FT_NAME ), true ), aNameLblRuss ( this, SVX_RES( FT_NAME_RUSS ), true ), + aNameLblEastern ( this, SVX_RES( FT_NAME_EASTERN ), true ), aFirstName ( this, SVX_RES( ED_FIRSTNAME ), 0, &aNameLbl ), aFatherName ( this, SVX_RES( ED_FATHERNAME ) ), aName ( this, SVX_RES( ED_NAME ), 1, &aNameLbl ), @@ -189,6 +190,23 @@ SvxGeneralTabPage::SvxGeneralTabPage( Window* pParent, const SfxItemSet& rCoreSe aFirstName.SetZOrder( &aName, WINDOW_ZORDER_BEHIND ); aFatherName.SetZOrder( &aFirstName, WINDOW_ZORDER_BEHIND ); } + else if ( LANGUAGE_JAPANESE == eLang || + LANGUAGE_KOREAN == eLang || + LANGUAGE_CHINESE_TRADITIONAL == eLang || + LANGUAGE_CHINESE_SIMPLIFIED == eLang) + { + aUsCityEdit.Hide(); + aUsStateEdit.Hide(); + aUsZipEdit.Hide(); + aNameLbl.Hide(); + aNameLblEastern.Show(); + + // swap "first name" field and "last name" field + Point aPosTmp = aFirstName.GetPosPixel(); + aFirstName.SetPosPixel( aName.GetPosPixel() ); + aName.SetPosPixel( aPosTmp ); + aFirstName.SetZOrder( &aName, WINDOW_ZORDER_BEHIND ); + } else { aUsCityEdit.Hide(); diff --git a/svx/source/cui/optsave.cxx b/svx/source/cui/optsave.cxx index 67ac02536b47..29708444fe93 100644 --- a/svx/source/cui/optsave.cxx +++ b/svx/source/cui/optsave.cxx @@ -245,38 +245,57 @@ SfxSaveTabPage::SfxSaveTabPage( Window* pParent, const SfxItemSet& rCoreSet ) : SvtModuleOptions aModuleOpt; if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SMATH ) ) + { aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_MATH )); + aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_MATH )); + } else { pImpl->aDefaultArr[APP_MATH] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_MATH); pImpl->aDefaultReadonlyArr[APP_MATH] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_MATH); } + if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) ) + { aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_DRAW )); + aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_DRAW )); + } else { pImpl->aDefaultArr[APP_DRAW] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_DRAW); pImpl->aDefaultReadonlyArr[APP_DRAW] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_DRAW); } + if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) ) + { aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_IMPRESS )); + aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_IMPRESS )); + } else { pImpl->aDefaultArr[APP_IMPRESS] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_IMPRESS); pImpl->aDefaultReadonlyArr[APP_IMPRESS] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_IMPRESS); } + if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) ) + { aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_CALC )); + aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_CALC )); + } else { pImpl->aDefaultArr[APP_CALC] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_CALC); pImpl->aDefaultReadonlyArr[APP_CALC] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_CALC); } + if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) ) { aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_WRITER )); aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_WRITER_WEB )); aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_WRITER_GLOBAL )); + aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_WRITER )); + aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_WRITER_WEB )); + aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_WRITER_GLOBAL )); } else { @@ -718,18 +737,23 @@ OUString lcl_ExtracUIName(const Sequence<PropertyValue> rProperties) ---------------------------------------------------------------------------*/ IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) { - if(&aDocTypeLB == pBox) + USHORT nCurPos = aDocTypeLB.GetSelectEntryPos(); + + long nData = -1; + if(nCurPos < APP_COUNT) + nData = (long) aDocTypeLB.GetEntryData(nCurPos); + + if ( nData >= 0 && nData < APP_COUNT ) { - USHORT nAppPos = pBox->GetSelectEntryPos(); - if ( nAppPos < APP_COUNT ) + if(&aDocTypeLB == pBox) { aSaveAsLB.Clear(); - const OUString* pFilters = pImpl->aFilterArr[nAppPos].getConstArray(); - if(!pImpl->aUIFilterArr[nAppPos].getLength()) + const OUString* pFilters = pImpl->aFilterArr[nData].getConstArray(); + if(!pImpl->aUIFilterArr[nData].getLength()) { - pImpl->aUIFilterArr[nAppPos].realloc(pImpl->aFilterArr[nAppPos].getLength()); - OUString* pUIFilters = pImpl->aUIFilterArr[nAppPos].getArray(); - for(int nFilter = 0; nFilter < pImpl->aFilterArr[nAppPos].getLength(); nFilter++) + pImpl->aUIFilterArr[nData].realloc(pImpl->aFilterArr[nData].getLength()); + OUString* pUIFilters = pImpl->aUIFilterArr[nData].getArray(); + for(int nFilter = 0; nFilter < pImpl->aFilterArr[nData].getLength(); nFilter++) { Any aProps = pImpl->xFact->getByName(pFilters[nFilter]); Sequence<PropertyValue> aProperties; @@ -737,37 +761,36 @@ IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) pUIFilters[nFilter] = lcl_ExtracUIName(aProperties); } } - const OUString* pUIFilters = pImpl->aUIFilterArr[nAppPos].getConstArray(); + const OUString* pUIFilters = pImpl->aUIFilterArr[nData].getConstArray(); OUString sSelect; - for(int i = 0; i < pImpl->aUIFilterArr[nAppPos].getLength(); i++) + for(int i = 0; i < pImpl->aUIFilterArr[nData].getLength(); i++) { USHORT nEntryPos = aSaveAsLB.InsertEntry(pUIFilters[i]); - if ( pImpl->aODFArr[nAppPos][i] ) + if ( pImpl->aODFArr[nData][i] ) aSaveAsLB.SetEntryData( nEntryPos, (void*)pImpl ); - if(pFilters[i] == pImpl->aDefaultArr[nAppPos]) + if(pFilters[i] == pImpl->aDefaultArr[nData]) sSelect = pUIFilters[i]; } if(sSelect.getLength()) aSaveAsLB.SelectEntry(sSelect); - aSaveAsFI.Show(pImpl->aDefaultReadonlyArr[nAppPos]); - aSaveAsFT.Enable(!pImpl->aDefaultReadonlyArr[nAppPos]); - aSaveAsLB.Enable(!pImpl->aDefaultReadonlyArr[nAppPos]); + aSaveAsFI.Show(pImpl->aDefaultReadonlyArr[nData]); + aSaveAsFT.Enable(!pImpl->aDefaultReadonlyArr[nData]); + aSaveAsLB.Enable(!pImpl->aDefaultReadonlyArr[nData]); } - } - else - { - OUString sSelect = pBox->GetSelectEntry(); - USHORT nPos = aDocTypeLB.GetSelectEntryPos(); - const OUString* pFilters = pImpl->aFilterArr[nPos].getConstArray(); - OUString* pUIFilters = pImpl->aUIFilterArr[nPos].getArray(); - for(int i = 0; i < pImpl->aUIFilterArr[nPos].getLength(); i++) - if(pUIFilters[i] == sSelect) - { - sSelect = pFilters[i]; - break; - } + else + { + OUString sSelect = pBox->GetSelectEntry(); + const OUString* pFilters = pImpl->aFilterArr[nData].getConstArray(); + OUString* pUIFilters = pImpl->aUIFilterArr[nData].getArray(); + for(int i = 0; i < pImpl->aUIFilterArr[nData].getLength(); i++) + if(pUIFilters[i] == sSelect) + { + sSelect = pFilters[i]; + break; + } - pImpl->aDefaultArr[nPos] = sSelect; + pImpl->aDefaultArr[nData] = sSelect; + } } ODFVersionHdl_Impl( &aSaveAsLB ); @@ -777,7 +800,7 @@ IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) IMPL_LINK( SfxSaveTabPage, ODFVersionHdl_Impl, ListBox *, EMPTYARG ) { long nVersion = long( aODFVersionLB.GetEntryData( aODFVersionLB.GetSelectEntryPos() ) ); - bool bShown = SvtSaveOptions::ODFDefaultVersion( nVersion ) == SvtSaveOptions::ODFVER_012; + bool bShown = SvtSaveOptions::ODFDefaultVersion( nVersion ) != SvtSaveOptions::ODFVER_LATEST; if ( bShown ) { bool bHasODFFormat = false; @@ -795,8 +818,8 @@ IMPL_LINK( SfxSaveTabPage, ODFVersionHdl_Impl, ListBox *, EMPTYARG ) || ( aSaveAsLB.GetEntryData( aSaveAsLB.GetSelectEntryPos() ) != NULL ); } - aODFWarningFI.Show( !bShown ); - aODFWarningFT.Show( !bShown ); + aODFWarningFI.Show( bShown ); + aODFWarningFT.Show( bShown ); return 0; } diff --git a/svx/source/cui/selector.cxx b/svx/source/cui/selector.cxx index 39e22e5ab9f2..83e4aa2b1612 100644 --- a/svx/source/cui/selector.cxx +++ b/svx/source/cui/selector.cxx @@ -1053,6 +1053,7 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog( aCategories.SetSelectHdl( LINK( this, SvxScriptSelectorDialog, SelectHdl ) ); aCommands.SetSelectHdl( LINK( this, SvxScriptSelectorDialog, SelectHdl ) ); + aCommands.SetDoubleClickHdl( LINK( this, SvxScriptSelectorDialog, FunctionDoubleClickHdl ) ); aOKButton.SetClickHdl( LINK( this, SvxScriptSelectorDialog, ClickHdl ) ); aCancelButton.SetClickHdl( LINK( this, SvxScriptSelectorDialog, ClickHdl ) ); @@ -1140,6 +1141,14 @@ IMPL_LINK( SvxScriptSelectorDialog, SelectHdl, Control*, pCtrl ) return 0; } +IMPL_LINK( SvxScriptSelectorDialog, FunctionDoubleClickHdl, Control*, pCtrl ) +{ + (void)pCtrl; + if ( aOKButton.IsEnabled() ) + return ClickHdl( &aOKButton ); + return 0; +} + // Check if command is selected and enable the OK button accordingly // Grab the help text for this id if available and update the description field void diff --git a/svx/source/cui/selector.hxx b/svx/source/cui/selector.hxx index fe6152131c9d..10346f251563 100644 --- a/svx/source/cui/selector.hxx +++ b/svx/source/cui/selector.hxx @@ -216,6 +216,7 @@ class SvxScriptSelectorDialog : public ModelessDialog DECL_LINK( ClickHdl, Button * ); DECL_LINK( SelectHdl, Control* ); + DECL_LINK( FunctionDoubleClickHdl, Control* ); void UpdateUI(); void ResizeControls(); 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 7491b2bb1cc5..744f9d5c1dbe 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/webconninfo.cxx b/svx/source/cui/webconninfo.cxx index 8fdf6a26d2bd..997c246abf1e 100644 --- a/svx/source/cui/webconninfo.cxx +++ b/svx/source/cui/webconninfo.cxx @@ -44,9 +44,10 @@ #include <com/sun/star/task/UrlRecord.hpp> #include <com/sun/star/task/XPasswordContainer.hpp> #include <com/sun/star/task/XMasterPasswordHandling.hpp> +#include "com/sun/star/task/XUrlContainer.hpp" #include <comphelper/processfactory.hxx> -#include <svtools/docpasswdrequest.hxx> +#include <comphelper/docpasswordrequest.hxx> #include "webconninfo.hxx" #include "webconninfo.hrc" @@ -116,7 +117,7 @@ WebConnectionInfoDialog::WebConnectionInfoDialog( Window* pParent ) : ,m_aButtonsFL ( this, SVX_RES( FL_BUTTONS ) ) ,m_aCloseBtn ( this, SVX_RES( PB_CLOSE ) ) ,m_aHelpBtn ( this, SVX_RES( PB_HELP ) ) - + ,m_nPos ( -1 ) { static long aStaticTabs[]= { 3, 0, 150, 250 }; m_aPasswordsLB.SetTabs( aStaticTabs ); @@ -211,6 +212,7 @@ void WebConnectionInfoDialog::FillPasswordList() uno::Sequence< task::UrlRecord > aURLEntries = xPasswdContainer->getAllPersistent( xInteractionHandler ); sal_Int32 nCount = 0; for ( sal_Int32 nURLInd = 0; nURLInd < aURLEntries.getLength(); nURLInd++ ) + { for ( sal_Int32 nUserInd = 0; nUserInd < aURLEntries[nURLInd].UserList.getLength(); nUserInd++ ) { ::rtl::OUString aUIEntry( aURLEntries[nURLInd].Url ); @@ -219,6 +221,25 @@ void WebConnectionInfoDialog::FillPasswordList() SvLBoxEntry* pEntry = m_aPasswordsLB.InsertEntry( aUIEntry ); pEntry->SetUserData( (void*)(nCount++) ); } + } + + // remember pos of first url container entry. + m_nPos = nCount; + + uno::Reference< task::XUrlContainer > xUrlContainer( + xPasswdContainer, uno::UNO_QUERY_THROW ); + + uno::Sequence< rtl::OUString > aUrls + = xUrlContainer->getUrls( sal_True /* OnlyPersistent */ ); + + for ( sal_Int32 nURLIdx = 0; nURLIdx < aUrls.getLength(); nURLIdx++ ) + { + ::rtl::OUString aUIEntry( aUrls[ nURLIdx ] ); + aUIEntry += ::rtl::OUString::valueOf( (sal_Unicode)'\t' ); + aUIEntry += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*" ) ); + SvLBoxEntry* pEntry = m_aPasswordsLB.InsertEntry( aUIEntry ); + pEntry->SetUserData( (void*)(nCount++) ); + } } } catch( uno::Exception& ) @@ -230,22 +251,29 @@ IMPL_LINK( WebConnectionInfoDialog, RemovePasswordHdl, PushButton*, EMPTYARG ) { try { - uno::Reference< task::XPasswordContainer > xPasswdContainer( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ), - uno::UNO_QUERY_THROW ); - - uno::Reference< task::XInteractionHandler > xInteractionHandler( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.InteractionHandler" ) ) ), - uno::UNO_QUERY_THROW ); - SvLBoxEntry* pEntry = m_aPasswordsLB.GetCurEntry(); if ( pEntry ) { ::rtl::OUString aURL = m_aPasswordsLB.GetEntryText( pEntry, 0 ); ::rtl::OUString aUserName = m_aPasswordsLB.GetEntryText( pEntry, 1 ); - xPasswdContainer->removePersistent( aURL, aUserName ); + + uno::Reference< task::XPasswordContainer > xPasswdContainer( + comphelper::getProcessServiceFactory()->createInstance( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.task.PasswordContainer" ) ) ), + uno::UNO_QUERY_THROW ); + + sal_Int32 nPos = (sal_Int32)(sal_IntPtr)pEntry->GetUserData(); + if ( nPos < m_nPos ) + { + xPasswdContainer->removePersistent( aURL, aUserName ); + } + else + { + uno::Reference< task::XUrlContainer > xUrlContainer( + xPasswdContainer, uno::UNO_QUERY_THROW ); + xUrlContainer->removeUrl( aURL ); + } m_aPasswordsLB.RemoveEntry( pEntry ); } } @@ -262,11 +290,20 @@ IMPL_LINK( WebConnectionInfoDialog, RemoveAllPasswordsHdl, PushButton*, EMPTYARG { uno::Reference< task::XPasswordContainer > xPasswdContainer( comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.task.PasswordContainer" ) ) ), uno::UNO_QUERY_THROW ); // should the master password be requested before? xPasswdContainer->removeAllPersistent(); + + uno::Reference< task::XUrlContainer > xUrlContainer( + xPasswdContainer, uno::UNO_QUERY_THROW ); + uno::Sequence< rtl::OUString > aUrls + = xUrlContainer->getUrls( sal_True /* OnlyPersistent */ ); + for ( sal_Int32 nURLIdx = 0; nURLIdx < aUrls.getLength(); nURLIdx++ ) + xUrlContainer->removeUrl( aUrls[ nURLIdx ] ); + m_aPasswordsLB.Clear(); } catch( uno::Exception& ) @@ -280,35 +317,38 @@ IMPL_LINK( WebConnectionInfoDialog, ChangePasswordHdl, PushButton*, EMPTYARG ) { try { - uno::Reference< task::XPasswordContainer > xPasswdContainer( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ), - uno::UNO_QUERY_THROW ); - - uno::Reference< task::XInteractionHandler > xInteractionHandler( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.InteractionHandler" ) ) ), - uno::UNO_QUERY_THROW ); - - SvLBoxEntry* pEntry = m_aPasswordsLB.GetCurEntry(); if ( pEntry ) { ::rtl::OUString aURL = m_aPasswordsLB.GetEntryText( pEntry, 0 ); ::rtl::OUString aUserName = m_aPasswordsLB.GetEntryText( pEntry, 1 ); - RequestDocumentPassword* pPasswordRequest = new RequestDocumentPassword( - task::PasswordRequestMode_PASSWORD_CREATE, - aURL ); - + ::comphelper::DocPasswordRequest* pPasswordRequest + = new ::comphelper::DocPasswordRequest( + ::comphelper::DocPasswordRequestType_STANDARD, + task::PasswordRequestMode_PASSWORD_CREATE, aURL ); uno::Reference< task::XInteractionRequest > rRequest( pPasswordRequest ); + + uno::Reference< task::XInteractionHandler > xInteractionHandler( + comphelper::getProcessServiceFactory()->createInstance( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.task.InteractionHandler" ) ) ), + uno::UNO_QUERY_THROW ); xInteractionHandler->handle( rRequest ); + if ( pPasswordRequest->isPassword() ) { String aNewPass = pPasswordRequest->getPassword(); uno::Sequence< ::rtl::OUString > aPasswd( 1 ); aPasswd[0] = aNewPass; - xPasswdContainer->addPersistent( aURL, aUserName, aPasswd, xInteractionHandler ); + + uno::Reference< task::XPasswordContainer > xPasswdContainer( + comphelper::getProcessServiceFactory()->createInstance( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.task.PasswordContainer" ) ) ), + uno::UNO_QUERY_THROW ); + xPasswdContainer->addPersistent( + aURL, aUserName, aPasswd, xInteractionHandler ); } } } @@ -330,7 +370,11 @@ IMPL_LINK( WebConnectionInfoDialog, EntrySelectedHdl, void*, EMPTYARG ) else { m_aRemoveBtn.Enable( TRUE ); - m_aChangeBtn.Enable( TRUE ); + + // url container entries (-> use system credentials) have + // no password + sal_Int32 nPos = (sal_Int32)(sal_IntPtr)pEntry->GetUserData(); + m_aChangeBtn.Enable( nPos < m_nPos ); } return 0; diff --git a/svx/source/cui/webconninfo.hxx b/svx/source/cui/webconninfo.hxx index 775d5072393c..f24b9f0dd4c8 100644 --- a/svx/source/cui/webconninfo.hxx +++ b/svx/source/cui/webconninfo.hxx @@ -65,6 +65,7 @@ namespace svx FixedLine m_aButtonsFL; CancelButton m_aCloseBtn; HelpButton m_aHelpBtn; + sal_Int32 m_nPos; DECL_LINK( HeaderBarClickedHdl, SvxSimpleTable* ); DECL_LINK( RemovePasswordHdl, PushButton* ); 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..804db0c58a16 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -55,6 +55,12 @@ #include <svx/xlnedwit.hxx> #include <svx/xlnstcit.hxx> #include <svx/xlnedcit.hxx> +#include <svx/xflgrit.hxx> +#include <svx/xflhtit.hxx> +#include <svx/xbtmpit.hxx> +#include <svx/xgrad.hxx> +#include <svx/xbitmap.hxx> +#include <svx/xhatch.hxx> #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp> #ifndef __COM_SUN_STAR_DRAWING_ENHANCEDCUSTOMSHAPESEGMENTCOMMAND_HPP__ @@ -64,6 +70,7 @@ #include <boost/shared_ptr.hpp> #endif #include <basegfx/numeric/ftools.hxx> +#include <basegfx/color/bcolortools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> // #i76201# @@ -724,23 +731,23 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) : /*const sal_Int32* pDefData =*/ ApplyShapeAttributes( rGeometryItem ); switch( eSpType ) { - case mso_sptCan : nColorData = 0x20200000; break; - case mso_sptCube : nColorData = 0x302d0000; break; - case mso_sptActionButtonBlank : nColorData = 0x502ad400; break; - case mso_sptActionButtonHome : nColorData = 0x702ad4ad; break; - case mso_sptActionButtonHelp : nColorData = 0x602ad4a0; break; - case mso_sptActionButtonInformation : nColorData = 0x702ad4a5; break; - case mso_sptActionButtonBackPrevious : nColorData = 0x602ad4a0; break; - case mso_sptActionButtonForwardNext : nColorData = 0x602ad4a0; break; - case mso_sptActionButtonBeginning : nColorData = 0x602ad4a0; break; - case mso_sptActionButtonEnd : nColorData = 0x602ad4a0; break; - case mso_sptActionButtonReturn : nColorData = 0x602ad4a0; break; - case mso_sptActionButtonDocument : nColorData = 0x702ad4da; break; - case mso_sptActionButtonSound : nColorData = 0x602ad4a0; break; - case mso_sptActionButtonMovie : nColorData = 0x602ad4a0; break; - case mso_sptBevel : nColorData = 0x502ad400; break; - case mso_sptFoldedCorner : nColorData = 0x20d00000; break; - case mso_sptSmileyFace : nColorData = 0x20d00000; break; + case mso_sptCan : nColorData = 0x20400000; break;
+ case mso_sptCube : nColorData = 0x302e0000; break;
+ case mso_sptActionButtonBlank : nColorData = 0x502ce400; break;
+ case mso_sptActionButtonHome : nColorData = 0x702ce4ce; break;
+ case mso_sptActionButtonHelp : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonInformation : nColorData = 0x702ce4c5; break;
+ case mso_sptActionButtonBackPrevious : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonForwardNext : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonBeginning : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonEnd : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonReturn : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonDocument : nColorData = 0x702ce4ec; break;
+ case mso_sptActionButtonSound : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonMovie : nColorData = 0x602ce4c0; break;
+ case mso_sptBevel : nColorData = 0x502ce400; break;
+ case mso_sptFoldedCorner : nColorData = 0x20e00000; break;
+ case mso_sptSmileyFace : nColorData = 0x20e00000; break;
case mso_sptNil : { if( sShapeType.getLength() > 4 && @@ -751,38 +758,17 @@ 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_sptRibbon2 : nColorData = 0x30dd0000; break; - case mso_sptRibbon : nColorData = 0x30dd0000; break; + case mso_sptCurvedDownArrow : nColorData = 0x2d000000; break; + case mso_sptRibbon2 : nColorData = 0x30ee0000; break; + case mso_sptRibbon : nColorData = 0x30ee0000; break; - case mso_sptEllipseRibbon2 : nColorData = 0x30dd0000; break; - case mso_sptEllipseRibbon : nColorData = 0x30dd0000; break; + case mso_sptEllipseRibbon2 : nColorData = 0x30ee0000; break; + case mso_sptEllipseRibbon : nColorData = 0x30ee0000; break; - case mso_sptVerticalScroll : nColorData = 0x30dd0000; break; - case mso_sptHorizontalScroll : nColorData = 0x30dd0000; break; + case mso_sptVerticalScroll : nColorData = 0x30ee0000; break; + case mso_sptHorizontalScroll : nColorData = 0x30ee0000; break; default: break; } @@ -1043,41 +1029,48 @@ sal_Bool EnhancedCustomShape2d::GetParameter( double& rRetValue, const EnhancedC // nLumDat 27-24 = nLumDatEntry 0 // nLumDat 23-20 = nLumDatEntry 1 ... // each 4bit entry is to be interpreted as a 10 percent signed luminance changing -Color EnhancedCustomShape2d::GetColorData( const Color& rFillColor, sal_uInt32 nIndex ) +sal_Int32 EnhancedCustomShape2d::GetLuminanceChange( sal_uInt32 nIndex ) const { - Color aRetColor; + const sal_uInt32 nCount = nColorData >> 28; + if ( !nCount ) + return 0; - sal_uInt32 i, nColor, nTmp, nCount = nColorData >> 28; + if ( nIndex >= nCount ) + nIndex = nCount - 1; + + const sal_Int32 nLumDat = nColorData << ( ( 1 + nIndex ) << 2 ); + return ( nLumDat >> 28 ) * 10; +} - if ( nCount ) +Color EnhancedCustomShape2d::GetColorData( const Color& rFillColor, sal_uInt32 nIndex ) const +{ + const sal_Int32 nLuminance = GetLuminanceChange(nIndex); + if( !nLuminance ) + return rFillColor; + + basegfx::BColor aHSVColor= + basegfx::tools::rgb2hsv( + basegfx::BColor(rFillColor.GetRed()/255.0, + rFillColor.GetGreen()/255.0, + rFillColor.GetBlue()/255.0)); + if( nLuminance > 0 ) + { + aHSVColor.setGreen( + aHSVColor.getGreen() * (1.0-nLuminance/100.0)); + aHSVColor.setBlue( + nLuminance/100.0 + + (1.0-nLuminance/100.0)*aHSVColor.getBlue()); + } + else if( nLuminance < 0 ) { - if ( nIndex >= nCount ) - nIndex = nCount - 1; - - sal_uInt32 nFillColor = (sal_uInt32)rFillColor.GetRed() | - ((sal_uInt32)rFillColor.GetGreen() << 8 ) | - ((sal_uInt32)rFillColor.GetBlue() << 16 ); - - sal_Int32 nLumDat = nColorData << ( ( 1 + nIndex ) << 2 ); - sal_Int32 nLuminance = ( nLumDat >> 28 ) * 12; - - nTmp = nFillColor; - nColor = 0; - for ( i = 0; i < 3; i++ ) - { - sal_Int32 nC = (sal_uInt8)nTmp; - nTmp >>= 8; - nC += ( ( nLuminance * nC ) >> 8 ); - if ( nC < 0 ) - nC = 0; - else if ( nC &~ 0xff ) - nC = 0xff; - nColor >>= 8; - nColor |= nC << 16; - } - aRetColor = Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) ); + aHSVColor.setBlue( + (1.0+nLuminance/100.0)*aHSVColor.getBlue()); } - return aRetColor; + + aHSVColor = basegfx::tools::hsv2rgb(aHSVColor); + return Color( (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getRed(),0.0,1.0) * 255.0 + 0.5 ), + (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getGreen(),0.0,1.0) * 255.0 + 0.5 ), + (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getBlue(),0.0,1.0) * 255.0 + 0.5 ) ); } Rectangle EnhancedCustomShape2d::GetTextRect() const @@ -1708,6 +1701,19 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm if(aNewB2DPolyPolygon.count()) { + if( !bLineGeometryNeededOnly )
+ {
+ // hack aNewB2DPolyPolygon to fill logic rect - this is
+ // needed to produce gradient fills that look like mso
+ aNewB2DPolygon.clear();
+ aNewB2DPolygon.append(basegfx::B2DPoint(0,0));
+ aNewB2DPolyPolygon.append(aNewB2DPolygon);
+
+ aNewB2DPolygon.clear();
+ aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(),
+ aLogicRect.GetHeight()));
+ aNewB2DPolyPolygon.append(aNewB2DPolygon);
+ }
// #i37011# bool bForceCreateTwoObjects(false); @@ -1877,6 +1883,78 @@ void CorrectCalloutArrows( MSO_SPT eSpType, sal_uInt32 nLineObjectCount, std::ve } } +void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rCustomShapeSet, + sal_uInt32& nColorIndex, sal_uInt32 nColorCount) +{ + if ( !rObj.IsLine() ) + { + const XFillStyle eFillStyle = ((const XFillStyleItem&)rObj.GetMergedItem(XATTR_FILLSTYLE)).GetValue(); + switch( eFillStyle ) + { + default: + case XFILL_SOLID: + { + Color aFillColor; + if ( nColorCount ) + { + aFillColor = GetColorData( + ((XFillColorItem&)rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue(), + std::min(nColorIndex, nColorCount-1) ); + rObj.SetMergedItem( XFillColorItem( String(), aFillColor ) ); + } + break; + } + case XFILL_GRADIENT: + { + XGradient aXGradient(((const XFillGradientItem&)rObj.GetMergedItem(XATTR_FILLGRADIENT)).GetGradientValue()); + if ( nColorCount ) + { + aXGradient.SetStartColor( + GetColorData( + aXGradient.GetStartColor(), + std::min(nColorIndex, nColorCount-1) )); + aXGradient.SetEndColor( + GetColorData( + aXGradient.GetEndColor(), + std::min(nColorIndex, nColorCount-1) )); + } + + rObj.SetMergedItem( XFillGradientItem( String(), aXGradient ) ); + break; + } + case XFILL_HATCH: + { + XHatch aXHatch(((const XFillHatchItem&)rObj.GetMergedItem(XATTR_FILLHATCH)).GetHatchValue()); + if ( nColorCount ) + { + aXHatch.SetColor( + GetColorData( + aXHatch.GetColor(), + std::min(nColorIndex, nColorCount-1) )); + } + + rObj.SetMergedItem( XFillHatchItem( String(), aXHatch ) ); + break; + } + case XFILL_BITMAP: + { + Bitmap aBitmap(((const XFillBitmapItem&)rObj.GetMergedItem(XATTR_FILLBITMAP)).GetBitmapValue().GetBitmap()); + if ( nColorCount ) + { + aBitmap.Adjust( + static_cast< short > ( GetLuminanceChange( + std::min(nColorIndex, nColorCount-1)))); + } + + rObj.SetMergedItem( XFillBitmapItem( String(), aBitmap ) ); + break; + } + } + + if ( nColorIndex < nColorCount ) + nColorIndex++; + } +} SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnly ) { @@ -1901,18 +1979,10 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl if ( vObjectList.size() ) { const SfxItemSet& rCustomShapeSet = pCustomShapeObj->GetMergedItemSet(); - // For primitive rendering, shadow handling is done completely based on the geometry, so i removed it here - // const sal_Bool bShadow(((SdrShadowItem&)rCustomShapeSet.Get( SDRATTR_SHADOW )).GetValue()); - Color aBasicColor( COL_WHITE ); Color aFillColor; sal_uInt32 nColorCount = nColorData >> 28; sal_uInt32 nColorIndex = 0; - if ( nColorCount ) - { - aBasicColor = ((XFillColorItem&)rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue(); - } - // #i37011# remove invisible objects if(vObjectList.size()) { @@ -1937,26 +2007,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl if(1L == vObjectList.size()) { // a single object, correct some values - SdrPathObj* pObj(vObjectList[0L]); - -// For primitive rendering, shadow handling is done completely based on the geometry, so i removed it here -// if(bShadow) -// { -// pObj->SetMergedItem(SdrShadowItem(sal_True)); -// } - - if(!pObj->IsLine()) - { - if ( nColorIndex < nColorCount ) - { - aFillColor = GetColorData( aBasicColor, nColorIndex++ ); - } - - if ( nColorCount ) - { - pObj->SetMergedItem( XFillColorItem( String(), aFillColor ) ); - } - } + AdaptObjColor(*vObjectList[0L],rCustomShapeSet,nColorIndex,nColorCount); } else { @@ -1975,16 +2026,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl else { nAreaObjectCount++; - - if ( nColorIndex < nColorCount ) - { - aFillColor = GetColorData( aBasicColor, nColorIndex++ ); - } - - if ( nColorCount ) - { - pObj->SetMergedItem( XFillColorItem( String(), aFillColor ) ); - } + AdaptObjColor(*pObj,rCustomShapeSet,nColorIndex,nColorCount); } } diff --git a/svx/source/customshapes/EnhancedCustomShape2d.hxx b/svx/source/customshapes/EnhancedCustomShape2d.hxx index 7f42ad751edc..6be05a9e588d 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; @@ -128,7 +120,10 @@ class EnhancedCustomShape2d : public SfxItemSet sal_Int32 nRotateAngle; sal_Bool SetAdjustValueAsDouble( const double& rValue, const sal_Int32 nIndex ); - Color GetColorData( const Color& rFillColor, sal_uInt32 nIndex ); + sal_Int32 GetLuminanceChange( sal_uInt32 nIndex ) const; + Color GetColorData( const Color& rFillColor, sal_uInt32 nIndex ) const; + void AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rCustomShapeSet, + sal_uInt32& nColorIndex, sal_uInt32 nColorCount); sal_Bool GetParameter( double& rParameterReturnValue, const com::sun::star::drawing::EnhancedCustomShapeParameter&, const sal_Bool bReplaceGeoWidth, const sal_Bool bReplaceGeoHeight ) const; Point GetPoint( const com::sun::star::drawing::EnhancedCustomShapeParameterPair&, @@ -164,17 +159,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 +193,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/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 426c94adcab8..abe6178cc800 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -683,7 +683,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW break; const Polygon& rOutlinePoly( aOutlines2d[ nOutline2dIdx++ ] ); const sal_uInt16 nPointCount = rOutlinePoly.GetSize(); - if ( nPointCount ) + if ( nPointCount > 1 ) { std::vector< double > vDistances; vDistances.reserve( nPointCount ); @@ -745,7 +745,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW const Polygon& rOutlinePoly2( aOutlines2d[ nOutline2dIdx++ ] ); const sal_uInt16 nPointCount = rOutlinePoly.GetSize(); const sal_uInt16 nPointCount2 = rOutlinePoly2.GetSize(); - if ( nPointCount && nPointCount2 ) + if ( ( nPointCount > 1 ) && ( nPointCount2 > 1 ) ) { std::vector< double > vDistances; vDistances.reserve( nPointCount ); diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx index 8f447de5b51c..022b7505cb44 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -44,7 +44,7 @@ #include <typeinfo> #define BOOST_SPIRIT_DEBUG #endif -#include <boost/spirit/core.hpp> +#include <boost/spirit/include/classic_core.hpp> #if (OSL_DEBUG_LEVEL > 0) #include <iostream> 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..edd6f7d33ed0 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 ---------------------------------- @@ -48,18 +49,27 @@ ENABLE_EXCEPTIONS=TRUE NOOPTFILES= $(SLO)$/EnhancedCustomShapeFunctionParser.obj .ENDIF +ENVCFLAGS += -DBOOST_SPIRIT_USE_OLD_NAMESPACE + # --- 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/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 40c94d2128c3..d835dd1a129e 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -819,11 +819,12 @@ void IMapWindow::DoMacroAssign() if ( pSdrObj ) { - SfxItemSet aSet( *pIMapPool, SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG ); + SfxItemSet aSet( *pIMapPool, SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 ); SfxEventNamesItem aNamesItem(SID_EVENTCONFIG); aNamesItem.AddEvent( String::CreateFromAscii( "MouseOver" ), String(), SFX_EVENT_MOUSEOVER_OBJECT ); aNamesItem.AddEvent( String::CreateFromAscii( "MouseOut" ), String(), SFX_EVENT_MOUSEOUT_OBJECT ); + aSet.Put( aNamesItem ); SvxMacroItem aMacroItem(SID_ATTR_MACROITEM); IMapObject* pIMapObj = GetIMapObj( pSdrObj ); diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 16e04efeefbe..c196178a4d16 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -37,8 +37,9 @@ #include <com/sun/star/linguistic2/XLinguServiceManager.hdl> #endif #include <com/sun/star/linguistic2/XAvailableLocales.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> #include <linguistic/misc.hxx> -#include<rtl/ustring.hxx> +#include <rtl/ustring.hxx> #include <unotools/localedatawrapper.hxx> #include <svtools/langtab.hxx> @@ -315,6 +316,13 @@ void SvxLanguageBox::SetLanguageList( INT16 nLangList, USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos ) { + return ImplInsertLanguage( nLangType, nPos, ::com::sun::star::i18n::ScriptType::WEAK ); +} + +//------------------------------------------------------------------------ + +USHORT SvxLanguageBox::ImplInsertLanguage( const LanguageType nLangType, USHORT nPos, sal_Int16 nType ) +{ LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( nLangType); // For obsolete and to be replaced languages check whether an entry of the // replacement already exists and if so don't add an entry with identical @@ -329,6 +337,15 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos String aStrEntry = m_pLangTable->GetString( nLang ); if (LANGUAGE_NONE == nLang && m_bHasLangNone && m_bLangNoneIsLangAll) aStrEntry = m_aAllString; + + LanguageType nRealLang = nLang; + if (nRealLang == LANGUAGE_SYSTEM) + { + nRealLang = MsLangId::resolveSystemLanguageByScriptType(nRealLang, nType); + aStrEntry.AppendAscii(" - "); + aStrEntry.Append(m_pLangTable->GetString( nRealLang )); + } + aStrEntry = ApplyLreOrRleEmbedding( aStrEntry ); USHORT nAt = 0; @@ -343,7 +360,7 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos m_pSpellUsedLang = new Sequence< INT16 >( xSpell->getLanguages() ); } bFound = m_pSpellUsedLang ? - lcl_SeqHasLang( *m_pSpellUsedLang, nLang ) : FALSE; + lcl_SeqHasLang( *m_pSpellUsedLang, nRealLang ) : FALSE; nAt = ImplInsertImgEntry( aStrEntry, nPos, bFound ); } @@ -356,6 +373,13 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos //------------------------------------------------------------------------ +USHORT SvxLanguageBox::InsertDefaultLanguage( sal_Int16 nType, USHORT nPos ) +{ + return ImplInsertLanguage( LANGUAGE_SYSTEM, nPos, nType ); +} + +//------------------------------------------------------------------------ + USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, BOOL bCheckEntry, USHORT nPos ) { 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/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx index 1215c685514e..0c96191c3db8 100644 --- a/svx/source/dialog/txencbox.cxx +++ b/svx/source/dialog/txencbox.cxx @@ -34,7 +34,7 @@ #include "txencbox.hxx" #include "txenctab.hxx" #include <svx/dialogs.hrc> -#include "dbcharsethelper.hxx" +#include "svx/dbcharsethelper.hxx" #include <vcl/svapp.hxx> #include <rtl/tencinfo.h> #include <rtl/locale.h> diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx index 9a0b1d593f40..059dae19c8f8 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/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/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/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 20de4e139b9d..c210919bd09d 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -889,9 +889,6 @@ void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMe break; case SID_FM_SHOWCOLS_MORE: { - //CHINA001 FmShowColsDialog dlg(NULL); - //CHINA001 dlg.SetColumns(xCols); - //CHINA001 dlg.Execute(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { @@ -960,24 +957,14 @@ void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMe } else { - // Standardlabel setzen - ::rtl::OUString sLabelBase = String( SVX_RES( RID_STR_COLUMN ) ); - // disambiguate the name - Reference< XNameAccess > xColNames( xCols, UNO_QUERY ); - ::rtl::OUString sLabel; - for ( sal_Int32 i=1; i<65535; ++i ) - { - sLabel = sLabelBase; - sLabel += ::rtl::OUString::valueOf( (sal_Int32)i ); - if ( !xColNames->hasByName( sLabel ) ) - break; - } - // no fallback in case the name is not unique (which is rather improbable) .... + FormControlFactory factory( ::comphelper::getProcessServiceFactory() ); + + ::rtl::OUString sLabel = factory.getDefaultUniqueName_ByComponentType( + Reference< XNameAccess >( xCols, UNO_QUERY_THROW ), xNewCol ); xNewCol->setPropertyValue( FM_PROP_LABEL, makeAny( sLabel ) ); xNewCol->setPropertyValue( FM_PROP_NAME, makeAny( sLabel ) ); - FormControlFactory determine( ::comphelper::getProcessServiceFactory() ); - determine.initializeControlModel( DocumentClassification::classifyHostDocument( xCols ), xNewCol ); + factory.initializeControlModel( DocumentClassification::classifyHostDocument( xCols ), xNewCol ); xCols->insertByIndex( nPos, makeAny( xNewCol ) ); } diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 8f5a895e0c33..0bfc7c768973 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1919,7 +1919,7 @@ 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( bVoid ? COL_TRANSPARENT : ::comphelper::getINT32( Value ) ); if (bVoid) @@ -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 ad645992d53d..ff7cfd422eb8 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -30,55 +30,52 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#include "gridcell.hxx" -#include "fmtools.hxx" -#include <stdio.h> -#ifndef _SVX_FMPROP_HRC + + #include "fmprop.hrc" -#endif +#include "fmresids.hrc" +#include "fmtools.hxx" +#include "gridcell.hxx" #include "gridcols.hxx" #include "sdbdatacolumn.hxx" + +#include <com/sun/star/awt/LineEndFormat.hpp> +#include <com/sun/star/awt/MouseWheelBehavior.hpp> #include <com/sun/star/awt/VisualEffect.hpp> -#include <com/sun/star/sdbc/XStatement.hpp> +#include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/form/FormComponentType.hpp> +#include <com/sun/star/form/XBoundComponent.hpp> #include <com/sun/star/script/XEventAttacherManager.hpp> -#ifndef _COM_SUN_STAR_SDDB_XCOLUMNSSUPPLIER_HPP_ -#include <com/sun/star/sdbcx/XColumnsSupplier.hpp> -#endif #include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp> -#include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> -#include <com/sun/star/form/XBoundComponent.hpp> -#include <com/sun/star/container/XChild.hpp> -#include <com/sun/star/form/FormComponentType.hpp> -#include <com/sun/star/util/XNumberFormatter.hpp> +#include <com/sun/star/sdbc/DataType.hpp> +#include <com/sun/star/sdbc/XStatement.hpp> +#include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/util/NumberFormat.hpp> #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 -#include <svtools/fmtfield.hxx> -#include <svtools/numuno.hxx> -#include <svtools/calendar.hxx> -#include <vcl/longcurr.hxx> -#include <svx/dialmgr.hxx> -#ifndef _SVX_FMRESIDS_HRC -#include "fmresids.hrc" -#endif -#include <tools/shl.hxx> -#include <tools/diagnose_ex.h> +#include <com/sun/star/util/XNumberFormatter.hpp> + +#include <comphelper/extract.hxx> #include <comphelper/numbers.hxx> #include <comphelper/property.hxx> -#include <comphelper/extract.hxx> +#include <connectivity/formattedcolumnvalue.hxx> #include <cppuhelper/typeprovider.hxx> #include <i18npool/lang.h> -#include <connectivity/formattedcolumnvalue.hxx> -#include <math.h> #include <rtl/math.hxx> +#include <svtools/calendar.hxx> +#include <svtools/fmtfield.hxx> +#include <svtools/numuno.hxx> #include <svtools/svmedit.hxx> +#include <svx/dialmgr.hxx> +#include <toolkit/helper/vclunohelper.hxx> +#include <tools/diagnose_ex.h> +#include <tools/shl.hxx> +#include <vcl/longcurr.hxx> + +#include <math.h> +#include <stdio.h> using namespace ::connectivity; using namespace ::connectivity::simple; @@ -228,13 +225,15 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, const Reference< ::com::s { switch (nTypeId) { - case TYPE_CHECKBOX: m_pCell = new FmXCheckBoxCell(this, pCellControl); break; - case TYPE_LISTBOX: m_pCell = new FmXListBoxCell(this, pCellControl); break; + case TYPE_CHECKBOX: m_pCell = new FmXCheckBoxCell( this, *pCellControl ); break; + case TYPE_LISTBOX: m_pCell = new FmXListBoxCell( this, *pCellControl ); break; + case TYPE_COMBOBOX: m_pCell = new FmXComboBoxCell( this, *pCellControl ); break; default: - m_pCell = new FmXEditCell(this, pCellControl); + m_pCell = new FmXEditCell( this, *pCellControl ); } } m_pCell->acquire(); + m_pCell->init(); impl_toggleScriptManager_nothrow( true ); @@ -651,10 +650,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() ) @@ -662,11 +661,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 ); } @@ -2429,7 +2428,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); } @@ -2558,7 +2557,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); } @@ -3199,13 +3198,33 @@ TYPEINIT0(FmXGridCell); DBG_NAME(FmXGridCell); //----------------------------------------------------------------------------- -FmXGridCell::FmXGridCell(DbGridColumn* pColumn, DbCellControl* pControl) +FmXGridCell::FmXGridCell( DbGridColumn* pColumn, DbCellControl* _pControl ) :OComponentHelper(m_aMutex) ,m_pColumn(pColumn) - ,m_pCellControl(pControl) + ,m_pCellControl( _pControl ) + ,m_aWindowListeners( m_aMutex ) + ,m_aFocusListeners( m_aMutex ) + ,m_aKeyListeners( m_aMutex ) + ,m_aMouseListeners( m_aMutex ) + ,m_aMouseMotionListeners( m_aMutex ) { DBG_CTOR(FmXGridCell,NULL); +} + +//----------------------------------------------------------------------------- +void FmXGridCell::init() +{ + Window* pEventWindow( getEventWindow() ); + if ( pEventWindow ) + pEventWindow->AddEventListener( LINK( this, FmXGridCell, OnWindowEvent ) ); +} +//----------------------------------------------------------------------------- +Window* FmXGridCell::getEventWindow() const +{ + if ( m_pCellControl ) + return &m_pCellControl->GetWindow(); + return NULL; } //----------------------------------------------------------------------------- @@ -3236,25 +3255,34 @@ void FmXGridCell::SetTextLineColor(const Color& _rColor) // XTypeProvider //------------------------------------------------------------------ -Sequence< sal_Int8 > SAL_CALL FmXGridCell::getImplementationId() throw(RuntimeException) -{ - static ::cppu::OImplementationId* pId = 0; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); +Sequence< Type > SAL_CALL FmXGridCell::getTypes( ) throw (RuntimeException) +{ + Sequence< uno::Type > aTypes = ::comphelper::concatSequences( + ::cppu::OComponentHelper::getTypes(), + FmXGridCell_Base::getTypes() + ); + if ( m_pCellControl ) + aTypes = ::comphelper::concatSequences( + aTypes, + FmXGridCell_WindowBase::getTypes() + ); + return aTypes; } +//------------------------------------------------------------------ +IMPLEMENT_GET_IMPLEMENTATION_ID( FmXGridCell ) + // OComponentHelper //----------------------------------------------------------------------------- void FmXGridCell::disposing() { + lang::EventObject aEvent( *this ); + m_aWindowListeners.disposeAndClear( aEvent ); + m_aFocusListeners.disposeAndClear( aEvent ); + m_aKeyListeners.disposeAndClear( aEvent ); + m_aMouseListeners.disposeAndClear( aEvent ); + m_aMouseMotionListeners.disposeAndClear( aEvent ); + OComponentHelper::disposing(); m_pColumn = NULL; DELETEZ(m_pCellControl); @@ -3263,12 +3291,13 @@ void FmXGridCell::disposing() //------------------------------------------------------------------ Any SAL_CALL FmXGridCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException) { - Any aReturn = OComponentHelper::queryAggregation(_rType); - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType, - static_cast< ::com::sun::star::awt::XControl* >(this), - static_cast< ::com::sun::star::form::XBoundControl* >(this) - ); + Any aReturn = OComponentHelper::queryAggregation( _rType ); + + if ( !aReturn.hasValue() ) + aReturn = FmXGridCell_Base::queryInterface( _rType ); + + if ( !aReturn.hasValue() && ( m_pCellControl != NULL ) ) + aReturn = FmXGridCell_WindowBase::queryInterface( _rType ); return aReturn; } @@ -3305,6 +3334,231 @@ void FmXGridCell::setLock(sal_Bool _bLock) throw( RuntimeException ) } } +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::setPosSize( ::sal_Int32 _XX, ::sal_Int32 _Y, ::sal_Int32 _Width, ::sal_Int32 _Height, ::sal_Int16 _Flags ) throw (RuntimeException) +{ + OSL_ENSURE( false, "FmXGridCell::setPosSize: not implemented" ); + (void)_XX; + (void)_Y; + (void)_Width; + (void)_Height; + (void)_Flags; + // not allowed to tamper with this for a grid cell +} + +//------------------------------------------------------------------ +awt::Rectangle SAL_CALL FmXGridCell::getPosSize( ) throw (RuntimeException) +{ + OSL_ENSURE( false, "FmXGridCell::getPosSize: not implemented" ); + return awt::Rectangle(); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::setVisible( ::sal_Bool _Visible ) throw (RuntimeException) +{ + OSL_ENSURE( false, "FmXGridCell::setVisible: not implemented" ); + (void)_Visible; + // not allowed to tamper with this for a grid cell +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::setEnable( ::sal_Bool _Enable ) throw (RuntimeException) +{ + OSL_ENSURE( false, "FmXGridCell::setEnable: not implemented" ); + (void)_Enable; + // not allowed to tamper with this for a grid cell +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::setFocus( ) throw (RuntimeException) +{ + OSL_ENSURE( false, "FmXGridCell::setFocus: not implemented" ); + // not allowed to tamper with this for a grid cell +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::addWindowListener( const Reference< awt::XWindowListener >& _rxListener ) throw (RuntimeException) +{ + m_aWindowListeners.addInterface( _rxListener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::removeWindowListener( const Reference< awt::XWindowListener >& _rxListener ) throw (RuntimeException) +{ + m_aWindowListeners.removeInterface( _rxListener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::addFocusListener( const Reference< awt::XFocusListener >& _rxListener ) throw (RuntimeException) +{ + m_aFocusListeners.addInterface( _rxListener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::removeFocusListener( const Reference< awt::XFocusListener >& _rxListener ) throw (RuntimeException) +{ + m_aFocusListeners.removeInterface( _rxListener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::addKeyListener( const Reference< awt::XKeyListener >& _rxListener ) throw (RuntimeException) +{ + m_aKeyListeners.addInterface( _rxListener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::removeKeyListener( const Reference< awt::XKeyListener >& _rxListener ) throw (RuntimeException) +{ + m_aKeyListeners.removeInterface( _rxListener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::addMouseListener( const Reference< awt::XMouseListener >& _rxListener ) throw (RuntimeException) +{ + m_aMouseListeners.addInterface( _rxListener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::removeMouseListener( const Reference< awt::XMouseListener >& _rxListener ) throw (RuntimeException) +{ + m_aMouseListeners.removeInterface( _rxListener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::addMouseMotionListener( const Reference< awt::XMouseMotionListener >& _rxListener ) throw (RuntimeException) +{ + m_aMouseMotionListeners.addInterface( _rxListener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::removeMouseMotionListener( const Reference< awt::XMouseMotionListener >& _rxListener ) throw (RuntimeException) +{ + m_aMouseMotionListeners.removeInterface( _rxListener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::addPaintListener( const Reference< awt::XPaintListener >& _rxListener ) throw (RuntimeException) +{ + OSL_ENSURE( false, "FmXGridCell::addPaintListener: not implemented" ); + (void)_rxListener; +} + +//------------------------------------------------------------------ +void SAL_CALL FmXGridCell::removePaintListener( const Reference< awt::XPaintListener >& _rxListener ) throw (RuntimeException) +{ + OSL_ENSURE( false, "FmXGridCell::removePaintListener: not implemented" ); + (void)_rxListener; +} + +//------------------------------------------------------------------ +IMPL_LINK( FmXGridCell, OnWindowEvent, VclWindowEvent*, _pEvent ) +{ + ENSURE_OR_THROW( _pEvent, "illegal event pointer" ); + ENSURE_OR_THROW( _pEvent->GetWindow(), "illegal window" ); + onWindowEvent( _pEvent->GetId(), *_pEvent->GetWindow(), _pEvent->GetData() ); + return 1L; +} + +//------------------------------------------------------------------------------ +void FmXGridCell::onFocusGained( const awt::FocusEvent& _rEvent ) +{ + m_aFocusListeners.notifyEach( &awt::XFocusListener::focusGained, _rEvent ); +} + +//------------------------------------------------------------------------------ +void FmXGridCell::onFocusLost( const awt::FocusEvent& _rEvent ) +{ + m_aFocusListeners.notifyEach( &awt::XFocusListener::focusLost, _rEvent ); +} + +//------------------------------------------------------------------------------ +void FmXGridCell::onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData ) +{ + switch ( _nEventId ) + { + case VCLEVENT_CONTROL_GETFOCUS: + case VCLEVENT_WINDOW_GETFOCUS: + case VCLEVENT_CONTROL_LOSEFOCUS: + case VCLEVENT_WINDOW_LOSEFOCUS: + { + if ( ( _rWindow.IsCompoundControl() + && ( _nEventId == VCLEVENT_CONTROL_GETFOCUS + || _nEventId == VCLEVENT_CONTROL_LOSEFOCUS + ) + ) + || ( !_rWindow.IsCompoundControl() + && ( _nEventId == VCLEVENT_WINDOW_GETFOCUS + || _nEventId == VCLEVENT_WINDOW_LOSEFOCUS + ) + ) + ) + { + if ( !m_aFocusListeners.getLength() ) + break; + + bool bFocusGained = ( _nEventId == VCLEVENT_CONTROL_GETFOCUS ) || ( _nEventId == VCLEVENT_WINDOW_GETFOCUS ); + + awt::FocusEvent aEvent; + aEvent.Source = *this; + aEvent.FocusFlags = _rWindow.GetGetFocusFlags(); + aEvent.Temporary = sal_False; + + if ( bFocusGained ) + onFocusGained( aEvent ); + else + onFocusLost( aEvent ); + } + } + break; + case VCLEVENT_WINDOW_MOUSEBUTTONDOWN: + case VCLEVENT_WINDOW_MOUSEBUTTONUP: + { + if ( !m_aMouseListeners.getLength() ) + break; + + const bool bButtonDown = ( _nEventId == VCLEVENT_WINDOW_MOUSEBUTTONDOWN ); + + awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *static_cast< const ::MouseEvent* >( _pEventData ), *this ) ); + m_aMouseListeners.notifyEach( bButtonDown ? &awt::XMouseListener::mousePressed : &awt::XMouseListener::mouseReleased, aEvent ); + } + break; + case VCLEVENT_WINDOW_MOUSEMOVE: + { + const MouseEvent& rMouseEvent = *static_cast< const ::MouseEvent* >( _pEventData ); + if ( rMouseEvent.IsEnterWindow() || rMouseEvent.IsLeaveWindow() ) + { + if ( m_aMouseListeners.getLength() != 0 ) + { + awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( rMouseEvent, *this ) ); + m_aMouseListeners.notifyEach( rMouseEvent.IsEnterWindow() ? &awt::XMouseListener::mouseEntered: &awt::XMouseListener::mouseExited, aEvent ); + } + } + else if ( !rMouseEvent.IsEnterWindow() && !rMouseEvent.IsLeaveWindow() ) + { + if ( m_aMouseMotionListeners.getLength() != 0 ) + { + awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( rMouseEvent, *this ) ); + aEvent.ClickCount = 0; + const bool bSimpleMove = ( ( rMouseEvent.GetMode() & MOUSE_SIMPLEMOVE ) != 0 ); + m_aMouseMotionListeners.notifyEach( bSimpleMove ? &awt::XMouseMotionListener::mouseMoved: &awt::XMouseMotionListener::mouseDragged, aEvent ); + } + } + } + break; + case VCLEVENT_WINDOW_KEYINPUT: + case VCLEVENT_WINDOW_KEYUP: + { + if ( !m_aKeyListeners.getLength() ) + break; + + const bool bKeyPressed = ( _nEventId == VCLEVENT_WINDOW_KEYINPUT ); + awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent( *static_cast< const ::KeyEvent* >( _pEventData ), *this ) ); + m_aKeyListeners.notifyEach( bKeyPressed ? &awt::XKeyListener::keyPressed: &awt::XKeyListener::keyReleased, aEvent ); + } + break; + } +} + /*************************************************************************/ TYPEINIT1(FmXDataCell, FmXGridCell); //------------------------------------------------------------------------------ @@ -3326,6 +3580,12 @@ void FmXDataCell::UpdateFromColumn() /*************************************************************************/ TYPEINIT1(FmXTextCell, FmXDataCell); +FmXTextCell::FmXTextCell( DbGridColumn* pColumn, DbCellControl& _rControl ) + :FmXDataCell( pColumn, _rControl ) + ,m_bFastPaint( sal_True ) +{ +} + //------------------------------------------------------------------------------ void FmXTextCell::PaintFieldToCell(OutputDevice& rDev, const Rectangle& rRect, @@ -3372,15 +3632,16 @@ void FmXTextCell::PaintFieldToCell(OutputDevice& rDev, DBG_NAME(FmXEditCell); //------------------------------------------------------------------------------ -FmXEditCell::FmXEditCell(DbGridColumn* pColumn, DbCellControl* pControl) - :FmXTextCell(pColumn, pControl) +FmXEditCell::FmXEditCell( DbGridColumn* pColumn, DbCellControl& _rControl ) + :FmXTextCell( pColumn, _rControl ) ,m_aTextListeners(m_aMutex) + ,m_aChangeListeners( m_aMutex ) ,m_pEditImplementation( NULL ) ,m_bOwnEditImplementation( false ) { DBG_CTOR(FmXEditCell,NULL); - DbTextField* pTextField = PTR_CAST( DbTextField, pControl ); + DbTextField* pTextField = PTR_CAST( DbTextField, &_rControl ); if ( pTextField ) { @@ -3390,11 +3651,9 @@ FmXEditCell::FmXEditCell(DbGridColumn* pColumn, DbCellControl* pControl) } else { - m_pEditImplementation = new EditImplementation( *static_cast< Edit* >( pControl->GetControl() ) ); + m_pEditImplementation = new EditImplementation( static_cast< Edit& >( _rControl.GetWindow() ) ); m_bOwnEditImplementation = true; } - - m_pEditImplementation->SetModifyHdl( LINK( this, FmXEditCell, OnTextChanged ) ); } //------------------------------------------------------------------ @@ -3416,6 +3675,7 @@ void FmXEditCell::disposing() { ::com::sun::star::lang::EventObject aEvt(*this); m_aTextListeners.disposeAndClear(aEvt); + m_aChangeListeners.disposeAndClear(aEvt); m_pEditImplementation->SetModifyHdl( Link() ); if ( m_bOwnEditImplementation ) @@ -3428,27 +3688,26 @@ void FmXEditCell::disposing() //------------------------------------------------------------------ Any SAL_CALL FmXEditCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException) { - Any aReturn = FmXDataCell::queryAggregation(_rType); - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType, - static_cast< ::com::sun::star::awt::XTextComponent* >(this) - ); + Any aReturn = FmXTextCell::queryAggregation( _rType ); + + if ( !aReturn.hasValue() ) + aReturn = FmXEditCell_Base::queryInterface( _rType ); + return aReturn; } //------------------------------------------------------------------------- Sequence< ::com::sun::star::uno::Type > SAL_CALL FmXEditCell::getTypes( ) throw(RuntimeException) { - Sequence< ::com::sun::star::uno::Type > aTypes = OComponentHelper::getTypes(); - - sal_Int32 nLen = aTypes.getLength(); - aTypes.realloc(nLen + 2); - aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XControl >* >(NULL)); - aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XTextComponent >* >(NULL)); - - return aTypes; + return ::comphelper::concatSequences( + FmXTextCell::getTypes(), + FmXEditCell_Base::getTypes() + ); } +//------------------------------------------------------------------------------ +IMPLEMENT_GET_IMPLEMENTATION_ID( FmXEditCell ) + // ::com::sun::star::awt::XTextComponent //------------------------------------------------------------------------------ void SAL_CALL FmXEditCell::addTextListener(const Reference< ::com::sun::star::awt::XTextListener >& l) throw( RuntimeException ) @@ -3473,7 +3732,7 @@ void SAL_CALL FmXEditCell::setText( const ::rtl::OUString& aText ) throw( Runtim // In JAVA wird auch ein textChanged ausgeloest, in VCL nicht. // ::com::sun::star::awt::Toolkit soll JAVA-komform sein... - OnTextChanged( NULL ); + onTextChanged(); } } @@ -3583,30 +3842,70 @@ void SAL_CALL FmXEditCell::setMaxTextLen( sal_Int16 nLen ) throw( RuntimeExcepti } //------------------------------------------------------------------------------ -IMPL_LINK( FmXEditCell, OnTextChanged, void*, EMPTYARG ) +void SAL_CALL FmXEditCell::addChangeListener( const Reference< form::XChangeListener >& _Listener ) throw (RuntimeException) { - if ( m_pEditImplementation ) + m_aChangeListeners.addInterface( _Listener ); +} + +//------------------------------------------------------------------------------ +void SAL_CALL FmXEditCell::removeChangeListener( const Reference< form::XChangeListener >& _Listener ) throw (RuntimeException) +{ + m_aChangeListeners.removeInterface( _Listener ); +} + +//------------------------------------------------------------------------------ +void FmXEditCell::onTextChanged() +{ + ::com::sun::star::awt::TextEvent aEvent; + aEvent.Source = *this; + m_aTextListeners.notifyEach( &awt::XTextListener::textChanged, aEvent ); +} + +//------------------------------------------------------------------------------ +void FmXEditCell::onFocusGained( const awt::FocusEvent& _rEvent ) +{ + FmXTextCell::onFocusGained( _rEvent ); + m_sValueOnEnter = getText(); +} + +//------------------------------------------------------------------------------ +void FmXEditCell::onFocusLost( const awt::FocusEvent& _rEvent ) +{ + FmXTextCell::onFocusLost( _rEvent ); + + if ( getText() != m_sValueOnEnter ) { - ::cppu::OInterfaceIteratorHelper aIt( m_aTextListeners ); - ::com::sun::star::awt::TextEvent aEvt; - aEvt.Source = *this; - while( aIt.hasMoreElements() ) - ((::com::sun::star::awt::XTextListener *)aIt.next())->textChanged( aEvt ); + lang::EventObject aEvent( *this ); + m_aChangeListeners.notifyEach( &XChangeListener::changed, aEvent ); } - return 1; +} + +//------------------------------------------------------------------------------ +void FmXEditCell::onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData ) +{ + switch ( _nEventId ) + { + case VCLEVENT_EDIT_MODIFY: + { + if ( m_pEditImplementation && m_aTextListeners.getLength() ) + onTextChanged(); + return; + } + } + + FmXTextCell::onWindowEvent( _nEventId, _rWindow, _pEventData ); } /*************************************************************************/ DBG_NAME(FmXCheckBoxCell); //------------------------------------------------------------------------------ -FmXCheckBoxCell::FmXCheckBoxCell(DbGridColumn* pColumn, DbCellControl* pControl) - :FmXDataCell(pColumn, pControl) +FmXCheckBoxCell::FmXCheckBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl ) + :FmXDataCell( pColumn, _rControl ) ,m_aItemListeners(m_aMutex) - ,m_pBox(&((CheckBoxControl*)pControl->GetControl())->GetBox()) + ,m_aActionListeners( m_aMutex ) + ,m_pBox( & static_cast< CheckBoxControl& >( _rControl.GetWindow() ).GetBox() ) { DBG_CTOR(FmXCheckBoxCell,NULL); - - ((CheckBoxControl*)pControl->GetControl())->SetClickHdl( LINK( this, FmXCheckBoxCell, OnClick ) ); } //------------------------------------------------------------------ @@ -3627,8 +3926,9 @@ void FmXCheckBoxCell::disposing() { ::com::sun::star::lang::EventObject aEvt(*this); m_aItemListeners.disposeAndClear(aEvt); + m_aActionListeners.disposeAndClear(aEvt); - ((CheckBoxControl*)m_pCellControl->GetControl())->SetClickHdl(Link()); + static_cast< CheckBoxControl& >( m_pCellControl->GetWindow() ).SetClickHdl(Link()); m_pBox = NULL; FmXDataCell::disposing(); @@ -3637,27 +3937,26 @@ void FmXCheckBoxCell::disposing() //------------------------------------------------------------------ Any SAL_CALL FmXCheckBoxCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException) { - Any aReturn = FmXDataCell::queryAggregation(_rType); - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType, - static_cast< ::com::sun::star::awt::XCheckBox* >(this) - ); + Any aReturn = FmXDataCell::queryAggregation( _rType ); + + if ( !aReturn.hasValue() ) + aReturn = FmXCheckBoxCell_Base::queryInterface( _rType ); + return aReturn; } //------------------------------------------------------------------------- Sequence< ::com::sun::star::uno::Type > SAL_CALL FmXCheckBoxCell::getTypes( ) throw(RuntimeException) { - Sequence< ::com::sun::star::uno::Type > aTypes = OComponentHelper::getTypes(); - - sal_Int32 nLen = aTypes.getLength(); - aTypes.realloc(nLen + 2); - aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XControl >* >(NULL)); - aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XCheckBox >* >(NULL)); - - return aTypes; + return ::comphelper::concatSequences( + FmXDataCell::getTypes(), + FmXCheckBoxCell_Base::getTypes() + ); } +//------------------------------------------------------------------------------ +IMPLEMENT_GET_IMPLEMENTATION_ID( FmXCheckBoxCell ) + //------------------------------------------------------------------ void SAL_CALL FmXCheckBoxCell::addItemListener( const Reference< ::com::sun::star::awt::XItemListener >& l ) throw( RuntimeException ) { @@ -3671,17 +3970,6 @@ void SAL_CALL FmXCheckBoxCell::removeItemListener( const Reference< ::com::sun:: } //------------------------------------------------------------------ -void SAL_CALL FmXCheckBoxCell::setLabel( const ::rtl::OUString& rLabel ) throw( RuntimeException ) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - if (m_pBox) - { - UpdateFromColumn(); - m_pBox->SetText( rLabel ); - } -} - -//------------------------------------------------------------------ void SAL_CALL FmXCheckBoxCell::setState( short n ) throw( RuntimeException ) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -3716,42 +4004,89 @@ void SAL_CALL FmXCheckBoxCell::enableTriState( sal_Bool b ) throw( RuntimeExcept } //------------------------------------------------------------------ -IMPL_LINK( FmXCheckBoxCell, OnClick, void*, EMPTYARG ) +void SAL_CALL FmXCheckBoxCell::addActionListener( const Reference< awt::XActionListener >& _Listener ) throw (RuntimeException) { - if (m_pBox) + m_aActionListeners.addInterface( _Listener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXCheckBoxCell::removeActionListener( const Reference< awt::XActionListener >& _Listener ) throw (RuntimeException) +{ + m_aActionListeners.removeInterface( _Listener ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXCheckBoxCell::setLabel( const ::rtl::OUString& _Label ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + if ( m_pColumn ) + { + DbGridControl& rGrid( m_pColumn->GetParent() ); + rGrid.SetColumnTitle( rGrid.GetColumnId( m_pColumn->GetFieldPos() ), _Label ); + } +} + +//------------------------------------------------------------------ +void SAL_CALL FmXCheckBoxCell::setActionCommand( const ::rtl::OUString& _Command ) throw (RuntimeException) +{ + m_aActionCommand = _Command; +} + +//------------------------------------------------------------------ +Window* FmXCheckBoxCell::getEventWindow() const +{ + return m_pBox; +} + +//------------------------------------------------------------------ +void FmXCheckBoxCell::onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData ) +{ + switch ( _nEventId ) + { + case VCLEVENT_CHECKBOX_TOGGLE: { // check boxes are to be committed immediately (this holds for ordinary check box controls in // documents, and this must hold for check boxes in grid columns, too // 91210 - 22.08.2001 - frank.schoenheit@sun.com m_pCellControl->Commit(); - // notify our listeners - ::cppu::OInterfaceIteratorHelper aIt( m_aItemListeners ); - - ::com::sun::star::awt::ItemEvent aEvent; - aEvent.Source = *this; - aEvent.Highlighted = sal_False; - aEvent.Selected = m_pBox->GetState(); + Reference< XWindow > xKeepAlive( this ); + if ( m_aItemListeners.getLength() && m_pBox ) + { + awt::ItemEvent aEvent; + aEvent.Source = *this; + aEvent.Highlighted = sal_False; + aEvent.Selected = m_pBox->GetState(); + m_aItemListeners.notifyEach( &awt::XItemListener::itemStateChanged, aEvent ); + } + if ( m_aActionListeners.getLength() ) + { + awt::ActionEvent aEvent; + aEvent.Source = *this; + aEvent.ActionCommand = m_aActionCommand; + m_aActionListeners.notifyEach( &awt::XActionListener::actionPerformed, aEvent ); + } + } + break; - while ( aIt.hasMoreElements() ) - static_cast< awt::XItemListener* >( aIt.next() )->itemStateChanged( aEvent ); + default: + FmXDataCell::onWindowEvent( _nEventId, _rWindow, _pEventData ); + break; } - return 1; } /*************************************************************************/ DBG_NAME(FmXListBoxCell); //------------------------------------------------------------------------------ -FmXListBoxCell::FmXListBoxCell(DbGridColumn* pColumn, DbCellControl* pControl) - :FmXTextCell(pColumn, pControl) +FmXListBoxCell::FmXListBoxCell(DbGridColumn* pColumn, DbCellControl& _rControl) + :FmXTextCell( pColumn, _rControl ) ,m_aItemListeners(m_aMutex) ,m_aActionListeners(m_aMutex) - ,m_pBox((ListBox*)pControl->GetControl()) + ,m_pBox( &static_cast< ListBox& >( _rControl.GetWindow() ) ) { DBG_CTOR(FmXListBoxCell,NULL); - m_pBox->AddEventListener( LINK( this, FmXListBoxCell, OnSelect ) ); m_pBox->SetDoubleClickHdl( LINK( this, FmXListBoxCell, OnDoubleClick ) ); } @@ -3786,26 +4121,25 @@ void FmXListBoxCell::disposing() Any SAL_CALL FmXListBoxCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException) { Any aReturn = FmXTextCell::queryAggregation(_rType); - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType, - static_cast< ::com::sun::star::awt::XListBox* >(this) - ); + + if ( !aReturn.hasValue() ) + aReturn = FmXListBoxCell_Base::queryInterface( _rType ); + return aReturn; } //------------------------------------------------------------------------- Sequence< ::com::sun::star::uno::Type > SAL_CALL FmXListBoxCell::getTypes( ) throw(RuntimeException) { - Sequence< ::com::sun::star::uno::Type > aTypes = OComponentHelper::getTypes(); - - sal_Int32 nLen = aTypes.getLength(); - aTypes.realloc(nLen + 2); - aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XControl >* >(NULL)); - aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XListBox >* >(NULL)); - - return aTypes; + return ::comphelper::concatSequences( + FmXTextCell::getTypes(), + FmXListBoxCell_Base::getTypes() + ); } +//------------------------------------------------------------------------------ +IMPLEMENT_GET_IMPLEMENTATION_ID( FmXListBoxCell ) + //------------------------------------------------------------------ void SAL_CALL FmXListBoxCell::addItemListener(const Reference< ::com::sun::star::awt::XItemListener >& l) throw( RuntimeException ) { @@ -4042,10 +4376,10 @@ void SAL_CALL FmXListBoxCell::makeVisible(sal_Int16 nEntry) throw( RuntimeExcept } //------------------------------------------------------------------ -IMPL_LINK(FmXListBoxCell, OnSelect, VclWindowEvent*, _pEvent ) +void FmXListBoxCell::onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData ) { - if ( ( _pEvent->GetWindow() == m_pBox ) - && ( _pEvent->GetId() == VCLEVENT_LISTBOX_SELECT ) + if ( ( &_rWindow == m_pBox ) + && ( _nEventId == VCLEVENT_LISTBOX_SELECT ) ) { OnDoubleClick( NULL ); @@ -4059,8 +4393,10 @@ IMPL_LINK(FmXListBoxCell, OnSelect, VclWindowEvent*, _pEvent ) ? m_pBox->GetSelectEntryPos() : 0xFFFF; m_aItemListeners.notifyEach( &awt::XItemListener::itemStateChanged, aEvent ); + return; } - return 1; + + FmXTextCell::onWindowEvent( _nEventId, _rWindow, _pEventData ); } @@ -4083,6 +4419,203 @@ IMPL_LINK( FmXListBoxCell, OnDoubleClick, void*, EMPTYARG ) /*************************************************************************/ + +DBG_NAME( FmXComboBoxCell ); + +//------------------------------------------------------------------------------ +FmXComboBoxCell::FmXComboBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl ) + :FmXTextCell( pColumn, _rControl ) + ,m_aItemListeners( m_aMutex ) + ,m_aActionListeners( m_aMutex ) + ,m_pComboBox( &static_cast< ComboBox& >( _rControl.GetWindow() ) ) +{ + DBG_CTOR( FmXComboBoxCell, NULL ); +} + +//------------------------------------------------------------------------------ +FmXComboBoxCell::~FmXComboBoxCell() +{ + if ( !OComponentHelper::rBHelper.bDisposed ) + { + acquire(); + dispose(); + } + + DBG_DTOR( FmXComboBoxCell, NULL ); +} + +//----------------------------------------------------------------------------- +void FmXComboBoxCell::disposing() +{ + ::com::sun::star::lang::EventObject aEvt(*this); + m_aItemListeners.disposeAndClear(aEvt); + m_aActionListeners.disposeAndClear(aEvt); + + FmXTextCell::disposing(); +} + +//------------------------------------------------------------------ +Any SAL_CALL FmXComboBoxCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException) +{ + Any aReturn = FmXTextCell::queryAggregation(_rType); + + if ( !aReturn.hasValue() ) + aReturn = FmXComboBoxCell_Base::queryInterface( _rType ); + + return aReturn; +} + +//------------------------------------------------------------------------- +Sequence< Type > SAL_CALL FmXComboBoxCell::getTypes( ) throw(RuntimeException) +{ + return ::comphelper::concatSequences( + FmXTextCell::getTypes(), + FmXComboBoxCell_Base::getTypes() + ); +} + +//------------------------------------------------------------------------------ +IMPLEMENT_GET_IMPLEMENTATION_ID( FmXComboBoxCell ) + +//------------------------------------------------------------------ +void SAL_CALL FmXComboBoxCell::addItemListener(const Reference< awt::XItemListener >& l) throw( RuntimeException ) +{ + m_aItemListeners.addInterface( l ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXComboBoxCell::removeItemListener(const Reference< awt::XItemListener >& l) throw( RuntimeException ) +{ + m_aItemListeners.removeInterface( l ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXComboBoxCell::addActionListener(const Reference< awt::XActionListener >& l) throw( RuntimeException ) +{ + m_aActionListeners.addInterface( l ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXComboBoxCell::removeActionListener(const Reference< awt::XActionListener >& l) throw( RuntimeException ) +{ + m_aActionListeners.removeInterface( l ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXComboBoxCell::addItem( const ::rtl::OUString& _Item, sal_Int16 _Pos ) throw( RuntimeException ) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + if ( m_pComboBox ) + m_pComboBox->InsertEntry( _Item, _Pos ); +} + +//------------------------------------------------------------------ +void SAL_CALL FmXComboBoxCell::addItems( const Sequence< ::rtl::OUString >& _Items, sal_Int16 _Pos ) throw( RuntimeException ) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + if ( m_pComboBox ) + { + sal_uInt16 nP = _Pos; + for ( sal_uInt16 n = 0; n < _Items.getLength(); n++ ) + { + m_pComboBox->InsertEntry( _Items.getConstArray()[n], nP ); + if ( _Pos != -1 ) + nP++; + } + } +} + +//------------------------------------------------------------------ +void SAL_CALL FmXComboBoxCell::removeItems( sal_Int16 _Pos, sal_Int16 _Count ) throw( RuntimeException ) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + if ( m_pComboBox ) + { + for ( sal_uInt16 n = _Count; n; ) + m_pComboBox->RemoveEntry( _Pos + (--n) ); + } +} + +//------------------------------------------------------------------ +sal_Int16 SAL_CALL FmXComboBoxCell::getItemCount() throw( RuntimeException ) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + return m_pComboBox ? m_pComboBox->GetEntryCount() : 0; +} + +//------------------------------------------------------------------ +::rtl::OUString SAL_CALL FmXComboBoxCell::getItem( sal_Int16 _Pos ) throw( RuntimeException ) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + String sItem; + if ( m_pComboBox ) + sItem = m_pComboBox->GetEntry( _Pos ); + return sItem; +} +//------------------------------------------------------------------ +Sequence< ::rtl::OUString > SAL_CALL FmXComboBoxCell::getItems() throw( RuntimeException ) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + + Sequence< ::rtl::OUString > aItems; + if ( m_pComboBox ) + { + sal_uInt16 nEntries = m_pComboBox->GetEntryCount(); + aItems.realloc( nEntries ); + ::rtl::OUString* pItem = aItems.getArray(); + for ( sal_uInt16 n=0; n<nEntries; ++n, ++pItem ) + *pItem = m_pComboBox->GetEntry( n ); + } + return aItems; +} + +//------------------------------------------------------------------ +sal_Int16 SAL_CALL FmXComboBoxCell::getDropDownLineCount() throw( RuntimeException ) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + + sal_Int16 nLines = 0; + if ( m_pComboBox ) + nLines = m_pComboBox->GetDropDownLineCount(); + + return nLines; +} + +//------------------------------------------------------------------ +void SAL_CALL FmXComboBoxCell::setDropDownLineCount(sal_Int16 nLines) throw( RuntimeException ) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + if ( m_pComboBox ) + m_pComboBox->SetDropDownLineCount( nLines ); +} + +//------------------------------------------------------------------------------ +void FmXComboBoxCell::onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData ) +{ + + switch ( _nEventId ) + { + case VCLEVENT_COMBOBOX_SELECT: + { + awt::ItemEvent aEvent; + aEvent.Source = *this; + aEvent.Highlighted = sal_False; + + // Bei Mehrfachselektion 0xFFFF, sonst die ID + aEvent.Selected = ( m_pComboBox->GetSelectEntryCount() == 1 ) + ? m_pComboBox->GetSelectEntryPos() + : 0xFFFF; + m_aItemListeners.notifyEach( &awt::XItemListener::itemStateChanged, aEvent ); + } + break; + + default: + FmXTextCell::onWindowEvent( _nEventId, _rWindow, _pEventData ); + break; + } +} + +/*************************************************************************/ TYPEINIT1(FmXFilterCell, FmXGridCell); //------------------------------------------------------------------------------ @@ -4093,8 +4626,8 @@ Reference< XInterface > FmXFilterCell_CreateInstance(const Reference< ::com::su DBG_NAME(FmXFilterCell); //------------------------------------------------------------------------------ -FmXFilterCell::FmXFilterCell(DbGridColumn* pColumn, DbCellControl* pControl) - :FmXGridCell(pColumn, pControl) +FmXFilterCell::FmXFilterCell(DbGridColumn* pColumn, DbCellControl* pControl ) + :FmXGridCell( pColumn, pControl ) ,m_aTextListeners(m_aMutex) { DBG_CTOR(FmXFilterCell,NULL); @@ -4180,26 +4713,25 @@ void FmXFilterCell::disposing() Any SAL_CALL FmXFilterCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException) { Any aReturn = FmXGridCell::queryAggregation(_rType); - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType, - static_cast< ::com::sun::star::awt::XTextComponent* >(this) - ); + + if ( !aReturn.hasValue() ) + aReturn = FmXFilterCell_Base::queryInterface( _rType ); + return aReturn; } //------------------------------------------------------------------------- Sequence< ::com::sun::star::uno::Type > SAL_CALL FmXFilterCell::getTypes( ) throw(RuntimeException) { - Sequence< ::com::sun::star::uno::Type > aTypes = OComponentHelper::getTypes(); - - sal_Int32 nLen = aTypes.getLength(); - aTypes.realloc(nLen + 2); - aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XControl >* >(NULL)); - aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XTextComponent >* >(NULL)); - - return aTypes; + return ::comphelper::concatSequences( + FmXGridCell::getTypes(), + FmXFilterCell_Base::getTypes() + ); } +//------------------------------------------------------------------------------ +IMPLEMENT_GET_IMPLEMENTATION_ID( FmXFilterCell ) + // ::com::sun::star::awt::XTextComponent //------------------------------------------------------------------------------ void SAL_CALL FmXFilterCell::addTextListener(const Reference< ::com::sun::star::awt::XTextListener >& l) throw( RuntimeException ) 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/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 3ef1d68916ec..afff309168ac 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -36,7 +36,7 @@ #endif #include <svx/gridctrl.hxx> #include "gridcell.hxx" -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" #include "fmtools.hxx" #include <svtools/stringtransfer.hxx> @@ -698,25 +698,6 @@ void DbGridControl::NavigationBar::SetState(sal_uInt16 nWhich) else pWnd->SetText(aText); - { - vos::OGuard aPaintSafety(Application::GetSolarMutex()); - // we want to update only the window, not our parent, so lock the latter - // (In fact, if we are in DbGridControl::RecalcRows, perhaps as a result of an setDataSource or - // a VisibleRowsChanged, the grid will be frozen and a SeekRow triggered implicitly by the update - // of pWnd will fail.) - // (the SetUpdateMode call goes to the data window : it's sufficient to prevent SeekRow's, but it - // avoids the Invalidate which would be triggered by BrowseBox::SetUpdateMode (which lead to massive - // flicker when scrolling)) - // FS - 06.10.99 - - // don't use SetUpdateMode in those situations as all necessary paints get lost DG - // so update only if necessary (DG) - if (pParent->IsPaintEnabled()) - { - pWnd->Update(); - pWnd->Flush(); - } - } pParent->SetRealRowCount(aText); } break; } @@ -782,12 +763,18 @@ void DbGridControl::NavigationBar::StateChanged( StateChangedType nType ) Fraction aZoom = GetZoom(); // not all of these controls need to know the new zoom, but to be sure ... - Font aFont( IsControlFont() ? GetControlFont() : GetPointFont()); + Font aFont( GetSettings().GetStyleSettings().GetFieldFont() ); + if ( IsControlFont() ) + aFont.Merge( GetControlFont() ); + for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i) { pWindows[i]->SetZoom(aZoom); pWindows[i]->SetZoomedPointFont(aFont); } + + SetZoomedPointFont( aFont ); + // rearrange the controls m_nDefaultWidth = ArrangeControls(); } @@ -1094,18 +1081,13 @@ void DbGridControl::ImplInitWindow( const InitWindowFacet _eInitWhat ) { if ( m_bNavigationBar ) { - m_aBar.SetZoom( GetZoom() ); - Font aFont = m_aBar.GetSettings().GetStyleSettings().GetFieldFont(); if ( IsControlFont() ) - { m_aBar.SetControlFont( GetControlFont() ); - aFont.Merge( GetControlFont() ); - } else m_aBar.SetControlFont(); - m_aBar.SetZoomedPointFont( aFont ); + m_aBar.SetZoom( GetZoom() ); } } 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/datanavi.cxx b/svx/source/form/datanavi.cxx index 01e65ff891a3..791bebc772c8 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -452,9 +452,11 @@ namespace svxform bool bIsDocModified = false; m_pNaviWin->DisableNotify( true ); - if ( TBI_ITEM_ADD == _nToolBoxID - || TBI_ITEM_ADD_ELEMENT == _nToolBoxID - || TBI_ITEM_ADD_ATTRIBUTE == _nToolBoxID ) + switch ( _nToolBoxID ) + { + case TBI_ITEM_ADD: + case TBI_ITEM_ADD_ELEMENT: + case TBI_ITEM_ADD_ATTRIBUTE: { bHandled = true; Reference< css::xforms::XModel > xModel( m_xUIHelper, UNO_QUERY ); @@ -643,7 +645,9 @@ namespace svxform } } } - else if ( TBI_ITEM_EDIT == _nToolBoxID ) + break; + + case TBI_ITEM_EDIT: { bHandled = true; SvLBoxEntry* pEntry = m_aItemList.FirstSelected(); @@ -737,7 +741,9 @@ namespace svxform } } } - else if ( TBI_ITEM_REMOVE == _nToolBoxID ) + break; + + case TBI_ITEM_REMOVE: { bHandled = true; if ( DGTInstance == m_eGroup && m_sInstanceURL.Len() > 0 ) @@ -748,6 +754,18 @@ namespace svxform } bIsDocModified = RemoveEntry(); } + break; + + case MID_INSERT_CONTROL: + { + OSL_ENSURE( false, "XFormsPage::DoToolboxAction: MID_INSERT_CONTROL not implemented, yet!" ); + } + break; + + default: + OSL_ENSURE( false, "XFormsPage::DoToolboxAction: unknown ID!" ); + break; + } m_pNaviWin->DisableNotify( false ); EnableMenuItems( NULL ); diff --git a/svx/source/form/datanavi.src b/svx/source/form/datanavi.src index 29ea1797073b..4d48ead413b8 100644 --- a/svx/source/form/datanavi.src +++ b/svx/source/form/datanavi.src @@ -512,7 +512,8 @@ Menu RID_MENU_DATANAVIGATOR { ItemList = { - MenuItem + // MID_INSERT_CONTROL not implemented, yet (#i99890#) + /*MenuItem { Identifier = MID_INSERT_CONTROL ; HelpId = HID_XFORMS_MID_INSERT_CONTROL ; @@ -521,7 +522,7 @@ Menu RID_MENU_DATANAVIGATOR MenuItem { Separator = TRUE; - }; + };*/ MenuItem { Identifier = TBI_ITEM_ADD ; diff --git a/svx/source/form/dbcharsethelper.cxx b/svx/source/form/dbcharsethelper.cxx index 0d3e3ebaf764..4e2f86eab25c 100644 --- a/svx/source/form/dbcharsethelper.cxx +++ b/svx/source/form/dbcharsethelper.cxx @@ -30,7 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#include "dbcharsethelper.hxx" +#include "svx/dbcharsethelper.hxx" //........................................................................ namespace svxform diff --git a/svx/source/form/dbtoolsclient.cxx b/svx/source/form/dbtoolsclient.cxx index 0c1e1b40564b..88f55ff2cd50 100644 --- a/svx/source/form/dbtoolsclient.cxx +++ b/svx/source/form/dbtoolsclient.cxx @@ -34,7 +34,7 @@ #include <com/sun/star/sdbc/XDataSource.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/sdb/SQLContext.hpp> -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" #include <osl/diagnose.h> #include <connectivity/formattedcolumnvalue.hxx> diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx index d968342d6ef5..ccce6b50ee20 100644 --- a/svx/source/form/fmPropBrw.cxx +++ b/svx/source/form/fmPropBrw.cxx @@ -190,7 +190,7 @@ using namespace ::svxform; case FormComponentType::IMAGECONTROL: nClassNameResourceId = RID_STR_PROPTITLE_IMAGECONTROL; break; case FormComponentType::HIDDENCONTROL: - nClassNameResourceId = RID_STR_HIDDEN_CLASSNAME; break; + nClassNameResourceId = RID_STR_PROPTITLE_HIDDEN; break; case FormComponentType::SCROLLBAR: nClassNameResourceId = RID_STR_PROPTITLE_SCROLLBAR; break; case FormComponentType::SPINBUTTON: @@ -199,7 +199,7 @@ using namespace ::svxform; nClassNameResourceId = RID_STR_PROPTITLE_NAVBAR; break; case FormComponentType::CONTROL: default: - nClassNameResourceId = RID_STR_CONTROL_CLASSNAME; break; + nClassNameResourceId = RID_STR_CONTROL; break; } if ( !nClassNameResourceId ) @@ -218,6 +218,7 @@ FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBinding :SfxFloatingWindow(_pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_3DLOOK|WB_ROLLABLE) ) ,SfxControllerItem(SID_FM_PROPERTY_CONTROL, *_pBindings) ,m_bInitialStateChange(sal_True) + ,m_bInStateChange( false ) ,m_xORB(_xORB) { DBG_CTOR(FmPropBrw,NULL); @@ -668,11 +669,12 @@ void FmPropBrw::impl_ensurePropertyBrowser_nothrow( FmFormShell* _pFormShell ) //----------------------------------------------------------------------- void FmPropBrw::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) { + if (!pState || SID_FM_PROPERTY_CONTROL != nSID) + return; + + m_bInStateChange = true; try { - if (!pState || SID_FM_PROPERTY_CONTROL != nSID) - return; - if (eState >= SFX_ITEM_AVAILABLE) { FmFormShell* pShell = PTR_CAST(FmFormShell,((SfxObjectItem*)pState)->GetShell()); @@ -719,5 +721,5 @@ void FmPropBrw::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPool { DBG_ERROR("FmPropBrw::StateChanged: Exception occured!"); } - + m_bInStateChange = false; } diff --git a/svx/source/form/fmctrler.cxx b/svx/source/form/fmctrler.cxx index 935bdbc74fe8..48db5acbb01e 100644 --- a/svx/source/form/fmctrler.cxx +++ b/svx/source/form/fmctrler.cxx @@ -129,6 +129,7 @@ struct ColumnInfo Reference< XColumn > xColumn; sal_Int32 nNullable; sal_Bool bAutoIncrement; + sal_Bool bReadOnly; ::rtl::OUString sName; // information about the control(s) bound to this column @@ -148,6 +149,7 @@ struct ColumnInfo :xColumn() ,nNullable( ColumnValue::NULLABLE_UNKNOWN ) ,bAutoIncrement( sal_False ) + ,bReadOnly( sal_False ) ,sName() ,xFirstControlWithInputRequired() ,xFirstGridWithInputRequiredColumn() @@ -202,6 +204,7 @@ ColumnInfoCache::ColumnInfoCache( const Reference< XColumnsSupplier >& _rxColSup OSL_VERIFY( xColumnProps->getPropertyValue( FM_PROP_ISNULLABLE ) >>= aColInfo.nNullable ); OSL_VERIFY( xColumnProps->getPropertyValue( FM_PROP_AUTOINCREMENT ) >>= aColInfo.bAutoIncrement ); OSL_VERIFY( xColumnProps->getPropertyValue( FM_PROP_NAME ) >>= aColInfo.sName ); + OSL_VERIFY( xColumnProps->getPropertyValue( FM_PROP_ISREADONLY ) >>= aColInfo.bReadOnly ); m_aColumns.push_back( aColInfo ); } @@ -227,6 +230,7 @@ namespace OSL_VERIFY( _rxControlModel->getPropertyValue( FM_PROP_INPUT_REQUIRED ) >>= bInputRequired ); return ( bInputRequired != sal_False ); } + void lcl_resetColumnControlInfo( ColumnInfo& _rColInfo ) { _rColInfo.xFirstControlWithInputRequired.clear(); @@ -2956,7 +2960,6 @@ void FmXFormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos) aRow[(*iter).xText] = sCriteria; } } - break; } } } @@ -3502,6 +3505,9 @@ sal_Bool SAL_CALL FmXFormController::approveRowChange(const RowChangeEvent& _rEv if ( rColInfo.bAutoIncrement ) continue; + if ( rColInfo.bReadOnly ) + continue; + if ( !rColInfo.xFirstControlWithInputRequired.is() && !rColInfo.xFirstGridWithInputRequiredColumn.is() ) continue; diff --git a/svx/source/form/fmdocumentclassification.cxx b/svx/source/form/fmdocumentclassification.cxx index 70c37f223ffd..1d9c3ed0bf1d 100644 --- a/svx/source/form/fmdocumentclassification.cxx +++ b/svx/source/form/fmdocumentclassification.cxx @@ -34,7 +34,7 @@ #ifndef SVX_SOURCE_FORM_FMDOCUMENTCLASSIFICATION_HXX #include "fmdocumentclassification.hxx" #endif -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" /** === begin UNO includes === **/ #include <com/sun/star/container/XChild.hpp> diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index a2add33b849b..ed4cd890ec9e 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -38,9 +38,10 @@ #include "fmprop.hrc" #include "fmservs.hxx" #include "fmobj.hxx" +#include "formcontrolfactory.hxx" #include "svditer.hxx" #include "fmresids.hrc" -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" #include "treevisitor.hxx" #include <com/sun/star/sdb/CommandType.hpp> @@ -551,18 +552,12 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo xFormProps->setPropertyValue(FM_PROP_COMMANDTYPE, makeAny(nCommandType)); Reference< ::com::sun::star::container::XNameAccess > xNamedSet( getForms(), UNO_QUERY ); - ::rtl::OUString aName; - if ((CommandType::TABLE == nCommandType) || (CommandType::QUERY == nCommandType)) - { - // Namen der ::com::sun::star::form ueber den Titel der CursorSource setzen - aName = getUniqueName(rCursorSource, xNamedSet); - } - else - // ansonsten StandardformName verwenden - aName = getUniqueName(::rtl::OUString(String(SVX_RES(RID_STR_STDFORMNAME))), xNamedSet); + const bool bTableOrQuery = ( CommandType::TABLE == nCommandType ) || ( CommandType::QUERY == nCommandType ); + ::rtl::OUString sName = FormControlFactory::getUniqueName( xNamedSet, + bTableOrQuery ? rCursorSource : ::rtl::OUString( String( SVX_RES( RID_STR_STDFORMNAME ) ) ) ); - xFormProps->setPropertyValue(FM_PROP_NAME, makeAny(aName)); + xFormProps->setPropertyValue( FM_PROP_NAME, makeAny( sName ) ); if( bUndo ) { @@ -574,7 +569,7 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo xContainer->getCount())); } - getForms()->insertByName(aName, makeAny(xForm)); + getForms()->insertByName( sName, makeAny( xForm ) ); if( bUndo ) pModel->EndUndo(); @@ -672,7 +667,6 @@ Reference< XForm > FmFormPageImpl::findFormForDataSource( //------------------------------------------------------------------------------ ::rtl::OUString FmFormPageImpl::setUniqueName(const Reference< XFormComponent > & xFormComponent, const Reference< XForm > & xControls) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::setUniqueName" ); #if OSL_DEBUG_LEVEL > 0 try { @@ -696,9 +690,10 @@ Reference< XForm > FmFormPageImpl::findFormForDataSource( // setzen eines default Namens ueber die ClassId sal_Int16 nClassId( FormComponentType::CONTROL ); xSet->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId; - Reference< XServiceInfo > xSI( xSet, UNO_QUERY ); - ::rtl::OUString sDefaultName = getDefaultName( nClassId, xControls, xSI ); + ::rtl::OUString sDefaultName = FormControlFactory::getDefaultUniqueName_ByComponentType( + Reference< XNameAccess >( xControls, UNO_QUERY ), xSet ); + // bei Radiobuttons, die einen Namen haben, diesen nicht ueberschreiben! if (!sName.getLength() || nClassId != ::com::sun::star::form::FormComponentType::RADIOBUTTON) { @@ -711,78 +706,6 @@ Reference< XForm > FmFormPageImpl::findFormForDataSource( return sName; } - -UniString FmFormPageImpl::getDefaultName( sal_Int16 _nClassId, const Reference< XServiceInfo >& _rxObject ) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::getDefaultName" ); - sal_uInt16 nResId; - - switch (_nClassId) - { - case FormComponentType::COMMANDBUTTON: nResId = RID_STR_BUTTON_CLASSNAME; break; - case FormComponentType::RADIOBUTTON: nResId = RID_STR_RADIOBUTTON_CLASSNAME; break; - case FormComponentType::CHECKBOX: nResId = RID_STR_CHECKBOX_CLASSNAME; break; - case FormComponentType::LISTBOX: nResId = RID_STR_LISTBOX_CLASSNAME; break; - case FormComponentType::COMBOBOX: nResId = RID_STR_COMBOBOX_CLASSNAME; break; - case FormComponentType::GROUPBOX: nResId = RID_STR_GROUPBOX_CLASSNAME; break; - case FormComponentType::IMAGEBUTTON: nResId = RID_STR_IMAGE_CLASSNAME; break; - case FormComponentType::FIXEDTEXT: nResId = RID_STR_FIXEDTEXT_CLASSNAME; break; - case FormComponentType::GRIDCONTROL: nResId = RID_STR_GRID_CLASSNAME; break; - case FormComponentType::FILECONTROL: nResId = RID_STR_FILECONTROL_CLASSNAME; break; - case FormComponentType::DATEFIELD: nResId = RID_STR_DATEFIELD_CLASSNAME; break; - case FormComponentType::TIMEFIELD: nResId = RID_STR_TIMEFIELD_CLASSNAME; break; - case FormComponentType::NUMERICFIELD: nResId = RID_STR_NUMERICFIELD_CLASSNAME; break; - case FormComponentType::CURRENCYFIELD: nResId = RID_STR_CURRENCYFIELD_CLASSNAME; break; - case FormComponentType::PATTERNFIELD: nResId = RID_STR_PATTERNFIELD_CLASSNAME; break; - case FormComponentType::IMAGECONTROL: nResId = RID_STR_IMAGECONTROL_CLASSNAME; break; - case FormComponentType::HIDDENCONTROL: nResId = RID_STR_HIDDEN_CLASSNAME; break; - case FormComponentType::SCROLLBAR: nResId = RID_STR_CLASSNAME_SCROLLBAR; break; - case FormComponentType::SPINBUTTON: nResId = RID_STR_CLASSNAME_SPINBUTTON; break; - case FormComponentType::NAVIGATIONBAR: nResId = RID_STR_NAVBAR_CLASSNAME; break; - - case FormComponentType::TEXTFIELD: - nResId = RID_STR_EDIT_CLASSNAME; - if ( _rxObject.is() && _rxObject->supportsService( FM_SUN_COMPONENT_FORMATTEDFIELD ) ) - nResId = RID_STR_FORMATTED_CLASSNAME; - break; - - default: - nResId = RID_STR_CONTROL_CLASSNAME; break; - } - - return SVX_RES(nResId); -} - -//------------------------------------------------------------------------------ -::rtl::OUString FmFormPageImpl::getDefaultName( - sal_Int16 _nClassId, const Reference< XForm >& _rxControls, const Reference< XServiceInfo >& _rxObject ) const -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::getDefaultName" ); - ::rtl::OUString aClassName=getDefaultName( _nClassId, _rxObject ); - - Reference< ::com::sun::star::container::XNameAccess > xNamedSet( _rxControls, UNO_QUERY ); - return getUniqueName(aClassName, xNamedSet); -} - -//------------------------------------------------------------------ -::rtl::OUString FmFormPageImpl::getUniqueName(const ::rtl::OUString& rName, const Reference< ::com::sun::star::container::XNameAccess > & xNamedSet) const -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::getUniqueName" ); - Reference< ::com::sun::star::container::XIndexAccess > xIndexSet(xNamedSet, UNO_QUERY); - ::rtl::OUString sName( rName ); - - if ( !xIndexSet.is() ) - return sName; - - sal_Int32 n = 0; - ::rtl::OUString sClassName = rName; - - while ( xNamedSet->hasByName( sName ) ) - sName = sClassName + ::rtl::OUString::valueOf(++n); - - return sName; -} - //------------------------------------------------------------------ void FmFormPageImpl::formObjectInserted( const FmFormObj& _object ) { diff --git a/svx/source/form/fmprop.cxx b/svx/source/form/fmprop.cxx deleted file mode 100644 index e328e79b9514..000000000000 --- a/svx/source/form/fmprop.cxx +++ /dev/null @@ -1,195 +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" ); - IMPLEMENT_CONSTASCII_USTRING( FM_PROP_MOUSE_WHEEL_BEHAVIOR, "MouseWheelBehavior" ); - -} // 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/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 87149994839b..8c5ca61f6691 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -785,7 +785,7 @@ void SAL_CALL FmXFormShell::formDeactivated(const EventObject& rEvent) throw( Ru void FmXFormShell::disposing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::disposing" ); - OSL_TRACE( "--- FmXFormShell::disposing : %p, ........, ........\n", this ); + OSL_TRACE( "--- FmXFormShell::disposing : %p, ........, ........", this ); impl_checkDisposed(); FmXFormShell_BASE::disposing(); @@ -3936,7 +3936,7 @@ void FmXFormShell::SetWizardUsing(sal_Bool _bUseThem) void FmXFormShell::viewDeactivated( FmFormView& _rCurrentView, sal_Bool _bDeactivateController /* = sal_True */ ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::viewDeactivated" ); - OSL_TRACE( "--- FmXFormShell::viewDeactivated: %p, %p, ........\n", this, &_rCurrentView ); + OSL_TRACE( "--- FmXFormShell::viewDeactivated: %p, %p, ........", this, &_rCurrentView ); if ( _rCurrentView.GetImpl() && !_rCurrentView.IsDesignMode() ) { @@ -3971,7 +3971,7 @@ void FmXFormShell::viewDeactivated( FmFormView& _rCurrentView, sal_Bool _bDeacti // remove callbacks at the page if ( pPage ) { - OSL_TRACE( "--- FmXFormShell::resetHandler : %p, ........, %p\n", this, pPage ); + OSL_TRACE( "--- FmXFormShell::resetHandler : %p, ........, %p", this, pPage ); pPage->GetImpl().SetFormsCreationHdl( Link() ); } UpdateForms( sal_True ); @@ -4010,7 +4010,7 @@ IMPL_LINK( FmXFormShell, OnFormsCreated, FmFormPage*, /*_pPage*/ ) void FmXFormShell::viewActivated( FmFormView& _rCurrentView, sal_Bool _bSyncAction /* = sal_False */ ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::viewActivated" ); - OSL_TRACE( "--- FmXFormShell::viewActivated : %p, %p, ........\n", this, &_rCurrentView ); + OSL_TRACE( "--- FmXFormShell::viewActivated : %p, %p, ........", this, &_rCurrentView ); FmFormPage* pPage = _rCurrentView.GetCurPage(); @@ -4040,7 +4040,7 @@ void FmXFormShell::viewActivated( FmFormView& _rCurrentView, sal_Bool _bSyncActi // set callbacks at the page if ( pPage ) { - OSL_TRACE( "--- FmXFormShell::setHandler : %p, ........, %p\n", this, pPage ); + OSL_TRACE( "--- FmXFormShell::setHandler : %p, ........, %p", this, pPage ); pPage->GetImpl().SetFormsCreationHdl( LINK( this, FmXFormShell, OnFormsCreated ) ); } diff --git a/svx/source/form/fmstring.src b/svx/source/form/fmstring.src index 2572c2ed2239..8b42ccadc6a6 100644 --- a/svx/source/form/fmstring.src +++ b/svx/source/form/fmstring.src @@ -84,107 +84,16 @@ Resource RID_RSC_TABWIN_PREFIX }; String RID_STR_FORMSHELL { - Text [ en-US ] = "Form"; + Text = "Form Shell"; }; String RID_STR_STDFORMNAME { - Text = "Standard"; -}; -String RID_STR_FORMATTED_CLASSNAME -{ - Text = "FormattedField"; -}; -String RID_STR_CONTROL_CLASSNAME -{ - Text = "Control"; -}; -String RID_STR_CHECKBOX_CLASSNAME -{ - Text = "CheckBox"; -}; -String RID_STR_RADIOBUTTON_CLASSNAME -{ - Text = "OptionButton"; -}; -String RID_STR_BUTTON_CLASSNAME -{ - Text = "PushButton"; -}; -String RID_STR_FIXEDTEXT_CLASSNAME -{ - Text = "LabelField"; -}; -String RID_STR_IMAGE_CLASSNAME -{ - Text = "ImageButton"; -}; -String RID_STR_GRID_CLASSNAME -{ - Text = "TableControl"; -}; -String RID_STR_GROUPBOX_CLASSNAME -{ - Text = "GroupBox"; -}; -String RID_STR_LISTBOX_CLASSNAME -{ - Text = "ListBox"; -}; -String RID_STR_COMBOBOX_CLASSNAME -{ - Text = "ComboBox"; -}; -String RID_STR_EDIT_CLASSNAME -{ - Text = "TextBox"; + Text [ en-US ]= "Form"; }; -String RID_STR_FILECONTROL_CLASSNAME +String RID_STR_PROPTITLE_HIDDEN { - Text = "FileSelection"; + Text [ en-US ] = "Hidden Control"; }; -String RID_STR_DATEFIELD_CLASSNAME -{ - Text = "DateField"; -}; -String RID_STR_TIMEFIELD_CLASSNAME -{ - Text = "TimeField"; -}; -String RID_STR_NUMERICFIELD_CLASSNAME -{ - Text = "NumericalField"; -}; -String RID_STR_CURRENCYFIELD_CLASSNAME -{ - Text = "CurrencyField"; -}; -String RID_STR_PATTERNFIELD_CLASSNAME -{ - Text = "PatternField"; -}; -String RID_STR_IMAGECONTROL_CLASSNAME -{ - Text = "ImageControl"; -}; -String RID_STR_HIDDEN_CLASSNAME -{ - Text = "HiddenControl"; -}; -String RID_STR_NAVBAR_CLASSNAME -{ - Text [ en-US ] = "NavigationBar"; -}; - -String RID_STR_CLASSNAME_SCROLLBAR -{ - Text [ en-US ] = "Scrollbar"; -}; - -String RID_STR_CLASSNAME_SPINBUTTON -{ - Text [ en-US ] = "SpinButton"; -}; - String RID_STR_CONTROL { Text [ en-US ] = "Control"; @@ -282,7 +191,7 @@ String RID_STR_TIME }; String RID_STR_PROPTITLE_PUSHBUTTON { - Text [ en-US ] = "Button"; + Text [ en-US ] = "Push Button"; }; String RID_STR_PROPTITLE_RADIOBUTTON { @@ -294,7 +203,7 @@ String RID_STR_PROPTITLE_CHECKBOX }; String RID_STR_PROPTITLE_FIXEDTEXT { - Text [ en-US ] = "Label field"; + Text [ en-US ] = "Label Field"; }; String RID_STR_PROPTITLE_GROUPBOX { diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index f7e59ce41888..fc7f1aa78558 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; @@ -102,6 +101,7 @@ namespace svx //==================================================================== static SfxSlotId pTextControlSlots[] = { + SID_CLIPBOARD_FORMAT_ITEMS, SID_CUT, SID_COPY, SID_PASTE, @@ -141,7 +141,6 @@ namespace svx // SID_TEXTDIRECTION_TOP_TO_BOTTOM, SID_ATTR_CHAR_SCALEWIDTH, /* 911 */ SID_ATTR_CHAR_RELIEF, - SID_CLIPBOARD_FORMAT_ITEMS, /* 922 */ SID_ATTR_PARA_LEFT_TO_RIGHT, /* 950 */ SID_ATTR_PARA_RIGHT_TO_LEFT, 0 diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx index a608f968b0da..b5a2aa97d23b 100644 --- a/svx/source/form/fmtools.cxx +++ b/svx/source/form/fmtools.cxx @@ -37,7 +37,7 @@ #include <com/sun/star/sdbcx/Privilege.hpp> #include <com/sun/star/lang/Locale.hpp> #include "fmtools.hxx" -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" #include "fmservs.hxx" #include <svx/fmglob.hxx> #include <vcl/stdtext.hxx> @@ -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> @@ -110,14 +109,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 df7bc44d939c..7b29fbfe9589 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -55,7 +55,7 @@ #include <rtl/logfile.hxx> #include <svx/dialmgr.hxx> #include "fmpgeimp.hxx" -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" #include <svtools/macitem.hxx> #include <tools/shl.hxx> #include <tools/diagnose_ex.h> @@ -550,7 +550,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 }; @@ -563,7 +563,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/fmview.cxx b/svx/source/form/fmview.cxx index 94ce048f4ed2..222407a36021 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -342,7 +342,7 @@ void FmFormView::GrabFirstControlFocus( sal_Bool _bForceSync ) //------------------------------------------------------------------------ SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage) { - OSL_TRACE( "--- FmFormView::ShowSdrPage : ........, %p, %p\n", this, pPage ); + OSL_TRACE( "--- FmFormView::ShowSdrPage : ........, %p, %p", this, pPage ); SdrPageView* pPV = E3dView::ShowSdrPage(pPage); @@ -380,7 +380,7 @@ SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage) //------------------------------------------------------------------------ void FmFormView::HideSdrPage() { - OSL_TRACE( "--- FmFormView::HideSdrPage : ........, %p, %p\n", this, GetCurPage() ); + OSL_TRACE( "--- FmFormView::HideSdrPage : ........, %p, %p", this, GetCurPage() ); // --- 1. deactivate controls if ( !IsDesignMode() ) diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx index 570fb4df15c3..de1a7d76b526 100644 --- a/svx/source/form/formcontrolfactory.cxx +++ b/svx/source/form/formcontrolfactory.cxx @@ -30,11 +30,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" #include "formcontrolfactory.hxx" #include "fmcontrollayout.hxx" #include "fmprop.hrc" #include "fmresids.hrc" +#include "fmservs.hxx" #include "svx/dialmgr.hxx" #include "svx/svdouno.hxx" @@ -739,6 +740,75 @@ namespace svxform } } + //------------------------------------------------------------------------------ + ::rtl::OUString FormControlFactory::getDefaultName( sal_Int16 _nClassId, const Reference< XServiceInfo >& _rxObject ) + { + sal_uInt16 nResId(0); + + switch ( _nClassId ) + { + case FormComponentType::COMMANDBUTTON: nResId = RID_STR_PROPTITLE_PUSHBUTTON; break; + case FormComponentType::RADIOBUTTON: nResId = RID_STR_PROPTITLE_RADIOBUTTON; break; + case FormComponentType::CHECKBOX: nResId = RID_STR_PROPTITLE_CHECKBOX; break; + case FormComponentType::LISTBOX: nResId = RID_STR_PROPTITLE_LISTBOX; break; + case FormComponentType::COMBOBOX: nResId = RID_STR_PROPTITLE_COMBOBOX; break; + case FormComponentType::GROUPBOX: nResId = RID_STR_PROPTITLE_GROUPBOX; break; + case FormComponentType::IMAGEBUTTON: nResId = RID_STR_PROPTITLE_IMAGEBUTTON; break; + case FormComponentType::FIXEDTEXT: nResId = RID_STR_PROPTITLE_FIXEDTEXT; break; + case FormComponentType::GRIDCONTROL: nResId = RID_STR_PROPTITLE_DBGRID; break; + case FormComponentType::FILECONTROL: nResId = RID_STR_PROPTITLE_FILECONTROL; break; + case FormComponentType::DATEFIELD: nResId = RID_STR_PROPTITLE_DATEFIELD; break; + case FormComponentType::TIMEFIELD: nResId = RID_STR_PROPTITLE_TIMEFIELD; break; + case FormComponentType::NUMERICFIELD: nResId = RID_STR_PROPTITLE_NUMERICFIELD; break; + case FormComponentType::CURRENCYFIELD: nResId = RID_STR_PROPTITLE_CURRENCYFIELD; break; + case FormComponentType::PATTERNFIELD: nResId = RID_STR_PROPTITLE_PATTERNFIELD; break; + case FormComponentType::IMAGECONTROL: nResId = RID_STR_PROPTITLE_IMAGECONTROL; break; + case FormComponentType::HIDDENCONTROL: nResId = RID_STR_PROPTITLE_HIDDEN; break; + case FormComponentType::SCROLLBAR: nResId = RID_STR_PROPTITLE_SCROLLBAR; break; + case FormComponentType::SPINBUTTON: nResId = RID_STR_PROPTITLE_SPINBUTTON; break; + case FormComponentType::NAVIGATIONBAR: nResId = RID_STR_PROPTITLE_NAVBAR; break; + + case FormComponentType::TEXTFIELD: + nResId = RID_STR_PROPTITLE_EDIT; + if ( _rxObject.is() && _rxObject->supportsService( FM_SUN_COMPONENT_FORMATTEDFIELD ) ) + nResId = RID_STR_PROPTITLE_FORMATTED; + break; + + default: + nResId = RID_STR_CONTROL; break; + } + + return String( SVX_RES( nResId ) ); + } + + //------------------------------------------------------------------------------ + ::rtl::OUString FormControlFactory::getDefaultUniqueName_ByComponentType( const Reference< XNameAccess >& _rxContainer, + const Reference< XPropertySet >& _rxObject ) + { + sal_Int16 nClassId = FormComponentType::CONTROL; + OSL_VERIFY( _rxObject->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId ); + ::rtl::OUString sBaseName = getDefaultName( nClassId, Reference< XServiceInfo >( _rxObject, UNO_QUERY ) ); + + return getUniqueName( _rxContainer, sBaseName ); + } + + //------------------------------------------------------------------------------ + ::rtl::OUString FormControlFactory::getUniqueName( const Reference< XNameAccess >& _rxContainer, const ::rtl::OUString& _rBaseName ) + { + sal_Int32 n = 0; + ::rtl::OUString sName; + do + { + ::rtl::OUStringBuffer aBuf( _rBaseName ); + aBuf.appendAscii( " " ); + aBuf.append( ++n ); + sName = aBuf.makeStringAndClear(); + } + while ( _rxContainer->hasByName( sName ) ); + + return sName; + } + //........................................................................ } // 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 66d7308f2e90..761752b4eab9 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 @@ -57,7 +58,8 @@ SRC1FILES= \ formshell.src \ datanavi.src -SLOFILES = \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/formtoolbars.obj \ $(SLO)$/fmdocumentclassification.obj \ $(SLO)$/fmcontrolbordermanager.obj \ @@ -65,7 +67,6 @@ SLOFILES = \ $(SLO)$/fmtextcontroldialogs.obj \ $(SLO)$/fmtextcontrolfeature.obj \ $(SLO)$/fmtextcontrolshell.obj \ - $(SLO)$/dbcharsethelper.obj \ $(SLO)$/ParseContext.obj \ $(SLO)$/typeconversionclient.obj \ $(SLO)$/confirmdelete.obj \ @@ -73,9 +74,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 \ @@ -85,21 +84,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 \ @@ -109,13 +101,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/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index b57863ffd5ae..f90f0d8c2ce4 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -1573,7 +1573,7 @@ namespace svxform aBaseName = SVX_RES( RID_STR_STDFORMNAME ); else if( pEntryData->ISA(FmControlData) ) - aBaseName = SVX_RES( RID_STR_CONTROL_CLASSNAME ); + aBaseName = SVX_RES( RID_STR_CONTROL ); ////////////////////////////////////////////////////////////////////// // Neuen Namen erstellen diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index e28ff0204366..4ad118418981 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -52,7 +52,7 @@ #endif #include <svx/fmshell.hxx> #include "fmshimp.hxx" -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" #include <svx/fmpage.hxx> #ifndef _SVX_FMPGEIMP_HXX 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/dbcharsethelper.hxx b/svx/source/inc/dbcharsethelper.hxx deleted file mode 100644 index 6b5c1769faba..000000000000 --- a/svx/source/inc/dbcharsethelper.hxx +++ /dev/null @@ -1,69 +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: dbcharsethelper.hxx,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef SVX_DBCHARSETHELPER_HXX -#define SVX_DBCHARSETHELPER_HXX - -#include "dbtoolsclient.hxx" - -//........................................................................ -namespace svxform -{ -//........................................................................ - - //==================================================================== - //= ODataAccessCharsetHelper - //==================================================================== - class ODataAccessCharsetHelper : public ODbtoolsClient - { - protected: - mutable ::rtl::Reference< ::connectivity::simple::IDataAccessCharSet > m_xCharsetHelper; - - protected: - virtual bool ensureLoaded() const; - - public: - ODataAccessCharsetHelper( ); - - inline sal_Int32 getSupportedTextEncodings( ::std::vector< rtl_TextEncoding >& _rEncs ) const - { - if ( ensureLoaded() ) - return m_xCharsetHelper->getSupportedTextEncodings( _rEncs ); - return 0; - } - }; - -//........................................................................ -} // namespace svxform -//........................................................................ - -#endif // SVX_DBCHARSETCLIENT_HXX - - diff --git a/svx/source/inc/dbtoolsclient.hxx b/svx/source/inc/dbtoolsclient.hxx deleted file mode 100644 index 15174b85ef69..000000000000 --- a/svx/source/inc/dbtoolsclient.hxx +++ /dev/null @@ -1,237 +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: dbtoolsclient.hxx,v $ - * $Revision: 1.18 $ - * - * 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_DBTOOLSCLIENT_HXX -#define SVX_DBTOOLSCLIENT_HXX - -#include <connectivity/virtualdbtools.hxx> -#include <osl/mutex.hxx> -#include <osl/module.h> -#include <tools/solar.h> -#include <unotools/sharedunocomponent.hxx> - -//........................................................................ -namespace svxform -{ -//........................................................................ - - typedef ::utl::SharedUNOComponent< ::com::sun::star::sdbc::XConnection > SharedConnection; - - //==================================================================== - //= ODbtoolsClient - //==================================================================== - /** base class for classes which want to use dbtools features with load-on-call - of the dbtools lib. - */ - class ODbtoolsClient - { - private: - static ::osl::Mutex s_aMutex; - static sal_Int32 s_nClients; - static oslModule s_hDbtoolsModule; - static ::connectivity::simple::createDataAccessToolsFactoryFunction - s_pFactoryCreationFunc; - //add by BerryJia for fixing Bug97420 Time:2002-9-12-11:00(PRC time) - mutable BOOL m_bCreateAlready; - - private: - mutable ::rtl::Reference< ::connectivity::simple::IDataAccessToolsFactory > m_xDataAccessFactory; - - protected: - ODbtoolsClient(); - virtual ~ODbtoolsClient(); - - virtual bool ensureLoaded() const; - - protected: - const ::rtl::Reference< ::connectivity::simple::IDataAccessToolsFactory >& - getFactory() const { return m_xDataAccessFactory; } - - private: - static void registerClient(); - static void revokeClient(); - }; - - //==================================================================== - //= OStaticDataAccessTools - //==================================================================== - class OStaticDataAccessTools : public ODbtoolsClient - { - protected: - mutable ::rtl::Reference< ::connectivity::simple::IDataAccessTools > m_xDataAccessTools; - - protected: - virtual bool ensureLoaded() const; - - public: - OStaticDataAccessTools(); - - const ::rtl::Reference< ::connectivity::simple::IDataAccessTools >& getDataAccessTools() const { return m_xDataAccessTools; } - - // ------------------------------------------------ - ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> getNumberFormats( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConn, - sal_Bool _bAllowDefault - ) const; - - // ------------------------------------------------ - 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( - const ::rtl::OUString& _rDataSourceName, - const ::rtl::OUString& _rUser, - const ::rtl::OUString& _rPwd, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory - ) const SAL_THROW ( (::com::sun::star::sdbc::SQLException) ); - - // ------------------------------------------------ - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> connectRowset( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, - sal_Bool _bSetAsActiveConnection - ) const SAL_THROW ( ( ::com::sun::star::sdbc::SQLException - , ::com::sun::star::lang::WrappedTargetException - , ::com::sun::star::uno::RuntimeException) ); - - // ------------------------------------------------ - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getRowSetConnection( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet) - const SAL_THROW ( (::com::sun::star::uno::RuntimeException) ); - - // ------------------------------------------------ - 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( - const ::rtl::OUString& _rQuote, - const ::rtl::OUString& _rName - ) const; - - // ------------------------------------------------ - ::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( - ::com::sun::star::sdbc::SQLException& _rException, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, - const ::rtl::OUString& _rContextDescription, - const ::rtl::OUString& _rContextDetails - ) const; - - // ------------------------------------------------ - ::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; - - // ------------------------------------------------ - /** 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; - - // ------------------------------------------------ - /** 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; - - // ------------------------------------------------ - /** 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; - - // ------------------------------------------------ - ::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, - const ::rtl::OUString& _rCommand, - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxKeepFieldsAlive, - ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL - ) SAL_THROW( ( ) ); - - // ------------------------------------------------ - ::com::sun::star::uno::Sequence< ::rtl::OUString > - getFieldNamesByCommandDescriptor( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const sal_Int32 _nCommandType, - const ::rtl::OUString& _rCommand, - ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL - ) SAL_THROW( ( ) ); - - // ------------------------------------------------ - 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( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent - ); - }; - - //==================================================================== - //= DBToolsObjectFactory - //==================================================================== - class DBToolsObjectFactory : public ODbtoolsClient - { - public: - DBToolsObjectFactory(); - ~DBToolsObjectFactory(); - - // ------------------------------------------------ - ::std::auto_ptr< ::dbtools::FormattedColumnValue > createFormattedColumnValue( - const ::comphelper::ComponentContext& _rContext, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn - ); - }; - -//........................................................................ -} // namespace svxform -//........................................................................ - -#endif // SVX_DBTOOLSCLIENT_HXX - - 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/fmPropBrw.hxx b/svx/source/inc/fmPropBrw.hxx index 6d7e6bde0259..285cb90320d2 100644 --- a/svx/source/inc/fmPropBrw.hxx +++ b/svx/source/inc/fmPropBrw.hxx @@ -57,6 +57,7 @@ class FmFormShell; class FmPropBrw : public SfxFloatingWindow, public SfxControllerItem { sal_Bool m_bInitialStateChange; + bool m_bInStateChange; ::rtl::OUString m_sLastActivePage; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xInspectorContext; 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..880ecb21d7e5 100644 --- a/svx/source/inc/fmpgeimp.hxx +++ b/svx/source/inc/fmpgeimp.hxx @@ -133,29 +133,15 @@ protected: sal_Int32 nCommandType ); - ::rtl::OUString getDefaultName( - sal_Int16 _nClassId, - const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm>& _rxControls, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject - ) const; - public: - - static UniString getDefaultName( - sal_Int16 nClassId, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject - ); - ::rtl::OUString setUniqueName(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent>& xFormComponent, const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm>& xControls); - ::rtl::OUString getUniqueName(const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& xNamedSet) const; void formObjectInserted( const FmFormObj& _object ); void formObjectRemoved( const FmFormObj& _object ); /** 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 3deec41981d4..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,151 +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 ); - DECLARE_CONSTASCII_USTRING( FM_PROP_MOUSE_WHEEL_BEHAVIOR ); - -} // 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/fmresids.hrc b/svx/source/inc/fmresids.hrc index e9f39396cca6..95a478fc5aee 100644 --- a/svx/source/inc/fmresids.hrc +++ b/svx/source/inc/fmresids.hrc @@ -214,29 +214,29 @@ #define RID_STR_SVT_SQL_SYNTAX_COLUMN (RID_FORMS_START + 98) #define RID_STR_PROPTITLE_SCROLLBAR (RID_FORMS_START + 99) #define RID_STR_PROPTITLE_SPINBUTTON (RID_FORMS_START + 100) -#define RID_STR_EDIT_CLASSNAME (RID_FORMS_START + 101) -#define RID_STR_BUTTON_CLASSNAME (RID_FORMS_START + 102) -#define RID_STR_FIXEDTEXT_CLASSNAME (RID_FORMS_START + 103) -#define RID_STR_CHECKBOX_CLASSNAME (RID_FORMS_START + 104) -#define RID_STR_RADIOBUTTON_CLASSNAME (RID_FORMS_START + 105) -#define RID_STR_LISTBOX_CLASSNAME (RID_FORMS_START + 106) -#define RID_STR_COMBOBOX_CLASSNAME (RID_FORMS_START + 107) -#define RID_STR_FORMATTED_CLASSNAME (RID_FORMS_START + 108) -#define RID_STR_GROUPBOX_CLASSNAME (RID_FORMS_START + 109) -#define RID_STR_CONTROL_CLASSNAME (RID_FORMS_START + 110) -#define RID_STR_IMAGE_CLASSNAME (RID_FORMS_START + 111) -#define RID_STR_GRID_CLASSNAME (RID_FORMS_START + 112) -#define RID_STR_FILECONTROL_CLASSNAME (RID_FORMS_START + 113) -#define RID_STR_DATEFIELD_CLASSNAME (RID_FORMS_START + 114) -#define RID_STR_TIMEFIELD_CLASSNAME (RID_FORMS_START + 115) -#define RID_STR_NUMERICFIELD_CLASSNAME (RID_FORMS_START + 116) -#define RID_STR_CURRENCYFIELD_CLASSNAME (RID_FORMS_START + 117) -#define RID_STR_PATTERNFIELD_CLASSNAME (RID_FORMS_START + 118) -#define RID_STR_IMAGECONTROL_CLASSNAME (RID_FORMS_START + 119) -#define RID_STR_HIDDEN_CLASSNAME (RID_FORMS_START + 120) -#define RID_STR_CLASSNAME_SCROLLBAR (RID_FORMS_START + 121) -#define RID_STR_CLASSNAME_SPINBUTTON (RID_FORMS_START + 122) -#define RID_STR_NAVBAR_CLASSNAME (RID_FORMS_START + 123) +#define RID_STR_PROPTITLE_HIDDEN (RID_FORMS_START + 101) + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE + // FREE #define RID_STR_DATANAVIGATOR (RID_FORMS_START + 124) #define RID_STR_DATANAV_SUBM_PARENT (RID_FORMS_START + 125) #define RID_STR_DATANAV_SUBM_ID (RID_FORMS_START + 126) 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..85644ea5daba 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -79,7 +79,7 @@ #include <cppuhelper/compbase4.hxx> #include <cppuhelper/compbase6.hxx> #include <unotools/configitem.hxx> -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" #include "formcontrolling.hxx" #include "fmdocumentclassification.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/formcontrolfactory.hxx b/svx/source/inc/formcontrolfactory.hxx index 2868308d6f7c..432ad25bdea0 100644 --- a/svx/source/inc/formcontrolfactory.hxx +++ b/svx/source/inc/formcontrolfactory.hxx @@ -37,6 +37,8 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/util/XNumberFormats.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XNameAccess.hpp> /** === end UNO includes === **/ #include <memory> @@ -94,6 +96,21 @@ namespace svxform const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >& _rxNumberFormats ); + static ::rtl::OUString getDefaultName( + const sal_Int16 nClassId, + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject + ); + + static ::rtl::OUString getDefaultUniqueName_ByComponentType( + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject + ); + + static ::rtl::OUString getUniqueName( + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer, + const ::rtl::OUString& _rBaseName + ); + private: ::std::auto_ptr< FormControlFactory_Data > m_pData; }; 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/gridcell.hxx b/svx/source/inc/gridcell.hxx index 6a552da6edb7..cb747e3a894c 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -42,20 +42,24 @@ #include <com/sun/star/form/XBoundControl.hpp> #include <com/sun/star/awt/XTextComponent.hpp> #include <com/sun/star/awt/XListBox.hpp> +#include <com/sun/star/awt/XComboBox.hpp> #include <com/sun/star/awt/TextAlign.hpp> #include <com/sun/star/awt/XControlModel.hpp> #include <com/sun/star/awt/XControl.hpp> #include <com/sun/star/awt/XCheckBox.hpp> +#include <com/sun/star/awt/XButton.hpp> #include <com/sun/star/beans/XFastPropertySet.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/form/XChangeBroadcaster.hpp> /** === end UNO includes === **/ -#include <tools/rtti.hxx> - #include <comphelper/propmultiplex.hxx> #include <comphelper/componentcontext.hxx> - #include <cppuhelper/component.hxx> +#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/implbase2.hxx> +#include <tools/diagnose_ex.h> +#include <tools/rtti.hxx> class DbCellControl; class Edit; @@ -282,7 +286,11 @@ public: virtual ~DbCellControl(); - Window* GetControl() const { return m_pWindow; } + Window& GetWindow() const + { + ENSURE_OR_THROW( m_pWindow, "no window" ); + return *m_pWindow; + } // control alignment inline sal_Bool isAlignedController() const { return m_bAlignedController; } @@ -732,20 +740,34 @@ protected: //================================================================== // Base class providing the access to a grid cell //================================================================== -class FmXGridCell : public ::cppu::OComponentHelper, - public ::com::sun::star::awt::XControl, - public ::com::sun::star::form::XBoundControl +typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XControl + , ::com::sun::star::form::XBoundControl + > FmXGridCell_Base; +typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XWindow + > FmXGridCell_WindowBase; +class FmXGridCell :public ::cppu::OComponentHelper + ,public FmXGridCell_Base + ,public FmXGridCell_WindowBase { protected: - ::osl::Mutex m_aMutex; - DbGridColumn* m_pColumn; - DbCellControl* m_pCellControl; + ::osl::Mutex m_aMutex; + DbGridColumn* m_pColumn; + DbCellControl* m_pCellControl; + +private: + ::cppu::OInterfaceContainerHelper m_aWindowListeners; + ::cppu::OInterfaceContainerHelper m_aFocusListeners; + ::cppu::OInterfaceContainerHelper m_aKeyListeners; + ::cppu::OInterfaceContainerHelper m_aMouseListeners; + ::cppu::OInterfaceContainerHelper m_aMouseMotionListeners; +protected: virtual ~FmXGridCell(); + public: TYPEINFO(); - FmXGridCell(DbGridColumn* pColumn, DbCellControl* pControl); - + FmXGridCell( DbGridColumn* pColumn, DbCellControl* pControl ); + void init(); DECLARE_UNO3_AGG_DEFAULTS(FmXGridCell, OComponentHelper); virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException); @@ -754,6 +776,7 @@ public: void SetTextLineColor(const Color& _rColor); // 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); // OComponentHelper @@ -781,6 +804,25 @@ public: virtual sal_Bool SAL_CALL getLock() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setLock(sal_Bool _bLock) throw(::com::sun::star::uno::RuntimeException); + // XWindow + virtual void SAL_CALL setPosSize( ::sal_Int32 X, ::sal_Int32 Y, ::sal_Int32 Width, ::sal_Int32 Height, ::sal_Int16 Flags ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getPosSize( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setVisible( ::sal_Bool Visible ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setEnable( ::sal_Bool Enable ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFocus( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + sal_Bool Commit() {return m_pCellControl->Commit();} void ImplInitWindow( Window& rParent, const InitWindowFacet _eInitWhat ) { m_pCellControl->ImplInitWindow( rParent, _eInitWhat ); } @@ -788,6 +830,17 @@ public: sal_Bool isAlignedController() const { return m_pCellControl->isAlignedController(); } void AlignControl(sal_Int16 nAlignment) { m_pCellControl->AlignControl(nAlignment);} + +protected: + virtual Window* getEventWindow() const; + virtual void onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData ); + + // default implementations call our focus listeners, don't forget to call them if you override this + virtual void onFocusGained( const ::com::sun::star::awt::FocusEvent& _rEvent ); + virtual void onFocusLost( const ::com::sun::star::awt::FocusEvent& _rEvent ); + +private: + DECL_LINK( OnWindowEvent, VclWindowEvent* ); }; //================================================================== @@ -795,7 +848,10 @@ class FmXDataCell : public FmXGridCell { public: TYPEINFO(); - FmXDataCell(DbGridColumn* pColumn, DbCellControl* pControl):FmXGridCell(pColumn, pControl){} + FmXDataCell( DbGridColumn* pColumn, DbCellControl& _rControl ) + :FmXGridCell( pColumn, &_rControl ) + { + } virtual void PaintFieldToCell(OutputDevice& rDev, const Rectangle& rRect, @@ -831,11 +887,7 @@ protected: public: TYPEINFO(); - FmXTextCell( DbGridColumn* pColumn, DbCellControl* pControl ) - :FmXDataCell( pColumn, pControl ) - ,m_bFastPaint( sal_True ) - { - } + FmXTextCell( DbGridColumn* pColumn, DbCellControl& _rControl ); virtual void PaintFieldToCell(OutputDevice& rDev, const Rectangle& rRect, @@ -849,23 +901,31 @@ public: }; //================================================================== +typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XTextComponent + , ::com::sun::star::form::XChangeBroadcaster + > FmXEditCell_Base; class FmXEditCell : public FmXTextCell, - public ::com::sun::star::awt::XTextComponent + public FmXEditCell_Base { +private: + ::rtl::OUString m_sValueOnEnter; + protected: ::cppu::OInterfaceContainerHelper m_aTextListeners; + ::cppu::OInterfaceContainerHelper m_aChangeListeners; ::svt::IEditImplementation* m_pEditImplementation; bool m_bOwnEditImplementation; virtual ~FmXEditCell(); public: - FmXEditCell(DbGridColumn* pColumn, DbCellControl* pControl); + FmXEditCell( DbGridColumn* pColumn, DbCellControl& _rControl ); DECLARE_UNO3_AGG_DEFAULTS(FmXEditCell, FmXTextCell); virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException); // 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); // OComponentHelper virtual void SAL_CALL disposing(); @@ -884,26 +944,43 @@ public: virtual void SAL_CALL setMaxTextLen(sal_Int16 nLen) throw(::com::sun::star::uno::RuntimeException); virtual sal_Int16 SAL_CALL getMaxTextLen() throw(::com::sun::star::uno::RuntimeException); + // XChangeBroadcaster + virtual void SAL_CALL addChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + protected: - DECL_LINK( OnTextChanged, void* ); + virtual void onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData ); + + virtual void onFocusGained( const ::com::sun::star::awt::FocusEvent& _rEvent ); + virtual void onFocusLost( const ::com::sun::star::awt::FocusEvent& _rEvent ); + +private: + void onTextChanged(); }; //================================================================== +typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XCheckBox + , ::com::sun::star::awt::XButton + > FmXCheckBoxCell_Base; class FmXCheckBoxCell : public FmXDataCell, - public ::com::sun::star::awt::XCheckBox + public FmXCheckBoxCell_Base { ::cppu::OInterfaceContainerHelper m_aItemListeners; + ::cppu::OInterfaceContainerHelper m_aActionListeners; + ::rtl::OUString m_aActionCommand; CheckBox* m_pBox; + protected: virtual ~FmXCheckBoxCell(); -public: - FmXCheckBoxCell(DbGridColumn* pColumn, DbCellControl* pControl); +public: + FmXCheckBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl ); // UNO DECLARE_UNO3_AGG_DEFAULTS(FmXCheckBoxCell, FmXDataCell); virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException); 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); // OComponentHelper virtual void SAL_CALL disposing(); @@ -916,26 +993,37 @@ public: virtual void SAL_CALL setLabel(const ::rtl::OUString& Label) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL enableTriState(sal_Bool b) throw(::com::sun::star::uno::RuntimeException); + // XButton + virtual void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw (::com::sun::star::uno::RuntimeException); + //virtual void SAL_CALL setLabel( const ::rtl::OUString& Label ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setActionCommand( const ::rtl::OUString& Command ) throw (::com::sun::star::uno::RuntimeException); + protected: - DECL_LINK( OnClick, void* ); + virtual Window* getEventWindow() const; + virtual void onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData ); }; //================================================================== -class FmXListBoxCell : public FmXTextCell, - public ::com::sun::star::awt::XListBox +typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XListBox + > FmXListBoxCell_Base; +class FmXListBoxCell :public FmXTextCell + ,public FmXListBoxCell_Base { ::cppu::OInterfaceContainerHelper m_aItemListeners, m_aActionListeners; ListBox* m_pBox; + protected: virtual ~FmXListBoxCell(); -public: - FmXListBoxCell(DbGridColumn* pColumn, DbCellControl* pControl); +public: + FmXListBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl ); DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell, FmXTextCell); virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException); 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); // OComponentHelper virtual void SAL_CALL disposing(); @@ -965,14 +1053,60 @@ public: virtual void SAL_CALL SAL_CALL makeVisible(sal_Int16 nEntry) throw(::com::sun::star::uno::RuntimeException); protected: - DECL_LINK( OnSelect, VclWindowEvent* ); + virtual void onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData ); + DECL_LINK( OnDoubleClick, void* ); }; //================================================================== +typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XComboBox + > FmXComboBoxCell_Base; +class FmXComboBoxCell :public FmXTextCell + ,public FmXComboBoxCell_Base +{ +private: + ::cppu::OInterfaceContainerHelper m_aItemListeners, + m_aActionListeners; + ComboBox* m_pComboBox; + +protected: + virtual ~FmXComboBoxCell(); + +public: + FmXComboBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl ); + + DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell, FmXTextCell); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException); + 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); + + // OComponentHelper + virtual void SAL_CALL disposing(); + + // XComboBox + virtual void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addItem( const ::rtl::OUString& _Item, ::sal_Int16 _Pos ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _Items, ::sal_Int16 _Pos ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeItems( ::sal_Int16 nPos, ::sal_Int16 nCount ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getItemCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getItem( ::sal_Int16 _Pos ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getItems( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getDropDownLineCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDropDownLineCount( ::sal_Int16 _Lines ) throw (::com::sun::star::uno::RuntimeException); + +protected: + virtual void onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData ); +}; + +//================================================================== +typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XTextComponent + , ::com::sun::star::lang::XUnoTunnel + > FmXFilterCell_Base; class FmXFilterCell :public FmXGridCell - ,public ::com::sun::star::awt::XTextComponent - ,public ::com::sun::star::lang::XUnoTunnel + ,public FmXFilterCell_Base { ::cppu::OInterfaceContainerHelper m_aTextListeners; protected: @@ -985,6 +1119,7 @@ public: DECLARE_UNO3_AGG_DEFAULTS(FmXFilterCell, FmXGridCell); virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException); 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); // XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); 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..65f96cf80523 100644 --- a/svx/source/inc/sqlparserclient.hxx +++ b/svx/source/inc/sqlparserclient.hxx @@ -31,7 +31,7 @@ #ifndef SVX_SQLPARSERCLIENT_HXX #define SVX_SQLPARSERCLIENT_HXX -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" #include "ParseContext.hxx" #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -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/tabwin.hxx b/svx/source/inc/tabwin.hxx index e83e0c0f80bd..be46c05a58d5 100644 --- a/svx/source/inc/tabwin.hxx +++ b/svx/source/inc/tabwin.hxx @@ -42,7 +42,7 @@ //#endif #include <comphelper/propmultiplex.hxx> #include <svtools/transfer.hxx> -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" //================================================================== class FmFieldWin; diff --git a/svx/source/inc/typeconversionclient.hxx b/svx/source/inc/typeconversionclient.hxx index 947cc4eddd07..2cfaaabe5173 100644 --- a/svx/source/inc/typeconversionclient.hxx +++ b/svx/source/inc/typeconversionclient.hxx @@ -31,7 +31,7 @@ #ifndef SVX_TYPECONVERSION_CLIENT_HXX #define SVX_TYPECONVERSION_CLIENT_HXX -#include "dbtoolsclient.hxx" +#include "svx/dbtoolsclient.hxx" //........................................................................ namespace svxform 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/intro/intro_tmpl.hrc b/svx/source/intro/intro_tmpl.hrc index 0f1b36e0c9f6..ad3a628213be 100644 --- a/svx/source/intro/intro_tmpl.hrc +++ b/svx/source/intro/intro_tmpl.hrc @@ -269,9 +269,9 @@ ItemList = \ < "Darin Fisher" ; > ; \ < "Nicole M. Follet-Dunn" ; > ; \ < "Kenneth Foskey" ; > ; \ - < "Peter Frandsen" ; > ; \ < "Duncan Foster" ; > ; \ < "Tim Foster" ; > ; \ + < "Peter Frandsen" ; > ; \ < "Gary Frederick" ; > ; \ < "Nils Fuhrmann" ; > ; \ < "Jan Funken" ; > ; \ diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx index c291c9b1be69..447d11f6d6ea 100644 --- a/svx/source/items/algitem.cxx +++ b/svx/source/items/algitem.cxx @@ -45,6 +45,7 @@ #include <com/sun/star/table/TableOrientation.hpp> #include <com/sun/star/table/CellHoriJustify.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> +#include "com/sun/star/style/VerticalAlignment.hpp" #include <com/sun/star/util/SortField.hpp> #include <com/sun/star/util/SortFieldType.hpp> #include <com/sun/star/table/CellOrientation.hpp> @@ -275,42 +276,89 @@ SfxItemPresentation SvxVerJustifyItem::GetPresentation //------------------------------------------------------------------------ -sal_Bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const +sal_Bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { - table::CellVertJustify eUno = table::CellVertJustify_STANDARD; - switch ( (SvxCellVerJustify)GetValue() ) + nMemberId &= ~CONVERT_TWIPS; + switch ( nMemberId ) { - case SVX_VER_JUSTIFY_STANDARD: eUno = table::CellVertJustify_STANDARD; break; - case SVX_VER_JUSTIFY_TOP: eUno = table::CellVertJustify_TOP; break; - case SVX_VER_JUSTIFY_CENTER: eUno = table::CellVertJustify_CENTER; break; - case SVX_VER_JUSTIFY_BOTTOM: eUno = table::CellVertJustify_BOTTOM; break; - default: ; //prevent warning + case MID_HORJUST_ADJUST: + { + style::VerticalAlignment eUno = style::VerticalAlignment_TOP; + switch ( (SvxCellVerJustify)GetValue() ) + { + case SVX_VER_JUSTIFY_TOP: eUno = style::VerticalAlignment_TOP; break; + case SVX_VER_JUSTIFY_CENTER: eUno = style::VerticalAlignment_MIDDLE; break; + case SVX_VER_JUSTIFY_BOTTOM: eUno = style::VerticalAlignment_BOTTOM; break; + default: ; //prevent warning + } + rVal <<= eUno; + break; + } + default: + { + table::CellVertJustify eUno = table::CellVertJustify_STANDARD; + switch ( (SvxCellVerJustify)GetValue() ) + { + case SVX_VER_JUSTIFY_STANDARD: eUno = table::CellVertJustify_STANDARD; break; + case SVX_VER_JUSTIFY_TOP: eUno = table::CellVertJustify_TOP; break; + case SVX_VER_JUSTIFY_CENTER: eUno = table::CellVertJustify_CENTER; break; + case SVX_VER_JUSTIFY_BOTTOM: eUno = table::CellVertJustify_BOTTOM; break; + default: ; //prevent warning + } + rVal <<= eUno; + break; + } } - rVal <<= eUno; return sal_True; } -sal_Bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ ) +sal_Bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { - table::CellVertJustify eUno; - if(!(rVal >>= eUno)) + nMemberId &= ~CONVERT_TWIPS; + switch ( nMemberId ) { - sal_Int32 nValue = 0; - if(!(rVal >>= nValue)) - return sal_False; - eUno = (table::CellVertJustify)nValue; - } + case MID_HORJUST_ADJUST: + { + // property contains ParagraphAdjust values as sal_Int16 + style::VerticalAlignment nVal = style::VerticalAlignment_TOP; + if(!(rVal >>= nVal)) + return sal_False; - SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD; - switch (eUno) - { - case table::CellVertJustify_STANDARD: eSvx = SVX_VER_JUSTIFY_STANDARD; break; - case table::CellVertJustify_TOP: eSvx = SVX_VER_JUSTIFY_TOP; break; - case table::CellVertJustify_CENTER: eSvx = SVX_VER_JUSTIFY_CENTER; break; - case table::CellVertJustify_BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break; - default: ; //prevent warning + SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD; + switch (nVal) + { + case style::VerticalAlignment_TOP: eSvx = SVX_VER_JUSTIFY_TOP; break; + case style::VerticalAlignment_MIDDLE: eSvx = SVX_VER_JUSTIFY_CENTER; break; + case style::VerticalAlignment_BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break; + default:; + } + SetValue( (USHORT)eSvx ); + break; + } + default: + { + table::CellVertJustify eUno; + if(!(rVal >>= eUno)) + { + sal_Int32 nValue = 0; + if(!(rVal >>= nValue)) + return sal_False; + eUno = (table::CellVertJustify)nValue; + } + + SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD; + switch (eUno) + { + case table::CellVertJustify_STANDARD: eSvx = SVX_VER_JUSTIFY_STANDARD; break; + case table::CellVertJustify_TOP: eSvx = SVX_VER_JUSTIFY_TOP; break; + case table::CellVertJustify_CENTER: eSvx = SVX_VER_JUSTIFY_CENTER; break; + case table::CellVertJustify_BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break; + default: ; //prevent warning + } + SetValue( (USHORT)eSvx ); + break; + } } - SetValue( (USHORT)eSvx ); return sal_True; } 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/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index d4dd02f74a3b..ca6333753769 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -45,6 +45,7 @@ #include <svtools/langtab.hxx> #include <vcl/svapp.hxx> +#include <comphelper/processfactory.hxx> #include <svx/numfmtsh.hxx> // class SvxNumberFormatShell -------------------------------------------- @@ -1523,22 +1524,22 @@ String SvxNumberFormatShell::GetStandardName() const return pFormatter->GetStandardName( eCurLanguage); } -void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubString& rStrEurope, sal_uInt16* pPos) +void SvxNumberFormatShell::GetCurrencySymbols( SvStringsDtor& rList, sal_uInt16* pPos ) { const NfCurrencyEntry* pTmpCurrencyEntry=SvNumberFormatter::MatchSystemCurrency(); sal_Bool bFlag=(pTmpCurrencyEntry==NULL); - GetCurrencySymbols(rList,rStrEurope, bFlag); + GetCurrencySymbols( rList, bFlag); if(pPos!=NULL) { const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable(); - sal_uInt16 nCount=rCurrencyTable.Count(); + sal_uInt16 nTableCount=rCurrencyTable.Count(); *pPos=0; - nCount=aCurCurrencyList.Count(); + sal_uInt16 nCount=aCurCurrencyList.Count(); if(bFlag) { @@ -1549,8 +1550,9 @@ void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubStri { for(sal_uInt16 i=1;i<nCount;i++) { - if(aCurCurrencyList[i]!=(sal_uInt16)-1 && - pTmpCurrencyEntry==rCurrencyTable[aCurCurrencyList[i]]) + const sal_uInt16 j = aCurCurrencyList[i]; + if (j != (sal_uInt16)-1 && j < nTableCount && + pTmpCurrencyEntry == rCurrencyTable[j]) { *pPos=i; nCurCurrencyEntryPos=i; @@ -1562,7 +1564,7 @@ void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubStri } -void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubString& /*rStrEurope*/, sal_Bool bFlag) +void SvxNumberFormatShell::GetCurrencySymbols( SvStringsDtor& rList, sal_Bool bFlag ) { aCurCurrencyList.Remove(0,aCurCurrencyList.Count()); @@ -1574,9 +1576,9 @@ void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubStri sal_uInt16 nStart=1; sal_uInt16 i,j; - XubString aString(rCurrencyTable[0]->GetSymbol()); + XubString aString( ApplyLreOrRleEmbedding( rCurrencyTable[0]->GetSymbol())); aString += sal_Unicode(' '); - aString += pLanguageTable->GetString(rCurrencyTable[0]->GetLanguage()); + aString += ApplyLreOrRleEmbedding( pLanguageTable->GetString( rCurrencyTable[0]->GetLanguage())); WSStringPtr pStr = new XubString(aString); rList.Insert( pStr,rList.Count()); @@ -1591,41 +1593,54 @@ void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubStri ++nStart; } - for(i=1;i<nCount;i++) - { - XubString _aString(rCurrencyTable[i]->GetSymbol()); - _aString += sal_Unicode(' '); - _aString += pLanguageTable->GetString(rCurrencyTable[i]->GetLanguage()); + CollatorWrapper aCollator( ::comphelper::getProcessServiceFactory()); + aCollator.loadDefaultCollator( Application::GetSettings().GetLocale(), 0); - pStr = new XubString(_aString); + const String aTwoSpace( RTL_CONSTASCII_USTRINGPARAM( " ")); + for(i=1;i<nCount;i++) + { + XubString aStr( ApplyLreOrRleEmbedding( rCurrencyTable[i]->GetBankSymbol())); + aStr += aTwoSpace; + aStr += ApplyLreOrRleEmbedding( rCurrencyTable[i]->GetSymbol()); + aStr += aTwoSpace; + aStr += ApplyLreOrRleEmbedding( pLanguageTable->GetString( rCurrencyTable[i]->GetLanguage())); + + pStr = new XubString(aStr); +#if 0 + fprintf( stderr, "currency entry: %s\n", ByteString( *pStr, RTL_TEXTENCODING_UTF8).GetBuffer()); +#endif for(j=nStart;j<rList.Count();j++) { const StringPtr pTestStr=rList[j]; - - if(*pTestStr>aString) break; + if (aCollator.compareString( *pStr, *pTestStr) < 0) + break; // insert before first greater than } rList.Insert( pStr,j); aCurCurrencyList.Insert(i,j); } + // Append ISO codes to symbol list. + // XXX If this is to be changed, various other places would had to be + // adapted that assume this order! sal_uInt16 nCont = rList.Count(); for(i=1;i<nCount;i++) { - sal_Bool bTest=sal_True; - pStr = new XubString(rCurrencyTable[i]->GetBankSymbol()); + bool bInsert = true; + pStr = new XubString( ApplyLreOrRleEmbedding( rCurrencyTable[i]->GetBankSymbol())); - for(j=nCont;j<rList.Count();j++) + for (j = nCont; j < rList.Count() && bInsert; ++j) { const StringPtr pTestStr=rList[j]; if(*pTestStr==*pStr) - bTest=sal_False; + bInsert = false; else - if(*pTestStr>*pStr) break; + if (aCollator.compareString( *pStr, *pTestStr) < 0) + break; // insert before first greater than } - if(bTest) + if(bInsert) { rList.Insert( pStr,j); aCurCurrencyList.Insert(i,j); diff --git a/svx/source/items/numitem.cxx b/svx/source/items/numitem.cxx index 18a9d18fb559..0a9b7786a476 100644 --- a/svx/source/items/numitem.cxx +++ b/svx/source/items/numitem.cxx @@ -71,14 +71,9 @@ using namespace ::com::sun::star::style; sal_Int32 SvxNumberType::nRefCount = 0; com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter> SvxNumberType::xFormatter = 0; -/* -----------------------------22.02.01 14:24-------------------------------- - - ---------------------------------------------------------------------------*/ -SvxNumberType::SvxNumberType(sal_Int16 nType) : - nNumType(nType), - bShowSymbol(sal_True) +void lcl_getFormatter(com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter>& _xFormatter) { - if(!xFormatter.is()) + if(!_xFormatter.is()) { try { @@ -87,12 +82,20 @@ SvxNumberType::SvxNumberType(sal_Int16 nType) : ::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) ); Reference<XDefaultNumberingProvider> xRet(xI, UNO_QUERY); DBG_ASSERT(xRet.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\""); - xFormatter = Reference<XNumberingFormatter> (xRet, UNO_QUERY); + _xFormatter = Reference<XNumberingFormatter> (xRet, UNO_QUERY); } catch(Exception& ) { } } +} +/* -----------------------------22.02.01 14:24-------------------------------- + + ---------------------------------------------------------------------------*/ +SvxNumberType::SvxNumberType(sal_Int16 nType) : + nNumType(nType), + bShowSymbol(sal_True) +{ nRefCount++; } /* -----------------------------22.02.01 14:31-------------------------------- @@ -126,6 +129,7 @@ String SvxNumberType::GetNumStr( ULONG nNo ) const * --------------------------------------------------*/ String SvxNumberType::GetNumStr( ULONG nNo, const Locale& rLocale ) const { + lcl_getFormatter(xFormatter); String aTmpStr; if(!xFormatter.is()) return aTmpStr; diff --git a/svx/source/items/paraitem.cxx b/svx/source/items/paraitem.cxx index 80af583638e8..d97ba065441d 100644 --- a/svx/source/items/paraitem.cxx +++ b/svx/source/items/paraitem.cxx @@ -889,7 +889,7 @@ SvxTabStop::SvxTabStop() { nTabPos = 0; eAdjustment = SVX_TAB_ADJUST_LEFT; - cDecimal = SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0); + m_cDecimal = cDfltDecimalChar; cFill = cDfltFillChar; } @@ -900,10 +900,15 @@ SvxTabStop::SvxTabStop( const long nPos, const SvxTabAdjust eAdjst, { nTabPos = nPos; eAdjustment = eAdjst; - cDecimal = ( cDfltDecimalChar == cDec ) ? SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0) : cDec; + m_cDecimal = cDec; cFill = cFil; } - +// ----------------------------------------------------------------------------- +void SvxTabStop::fillDecimal() const +{ + if ( cDfltDecimalChar == m_cDecimal ) + m_cDecimal = SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0); +} // ----------------------------------------------------------------------- XubString SvxTabStop::GetValueString() const @@ -918,7 +923,7 @@ XubString SvxTabStop::GetValueString() const aStr += cpDelim; aStr += sal_Unicode('['); aStr += XubString( ResId( RID_SVXITEMS_TAB_DECIMAL_CHAR, DIALOG_MGR() ) ); - aStr += cDecimal; + aStr += GetDecimal(); aStr += sal_Unicode(']'); aStr += cpDelim; aStr += cpDelim; 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/mnuctrls/clipboardctl.cxx b/svx/source/mnuctrls/clipboardctl.cxx index 82dc919bb729..3cd538e4c079 100644 --- a/svx/source/mnuctrls/clipboardctl.cxx +++ b/svx/source/mnuctrls/clipboardctl.cxx @@ -143,16 +143,6 @@ void SvxClipBoardControl::StateChanged( USHORT nSID, SfxItemState eState, const GetToolBox().SetItemBits( GetId(), GetToolBox().GetItemBits( GetId() ) & ~TIB_DROPDOWN ); GetToolBox().Invalidate( GetToolBox().GetItemRect( GetId() ) ); } - #ifdef UNIX - // #b6673979# enable some slots hardly, because UNIX clipboard does not notify all changes - // Can be removed if follow up task will be fixed directly within applications. - else - if ( SID_PASTE == nSID ) - { - bDisabled = false; - GetToolBox().EnableItem( GetId(), true ); - } - #endif else { // enable the item as a whole 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/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx index 5a8c149fa2bf..c9cfde91547a 100644 --- a/svx/source/msfilter/msdffimp.cxx +++ b/svx/source/msfilter/msdffimp.cxx @@ -1912,12 +1912,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co XGradientStyle eGrad = XGRAD_LINEAR; sal_Int32 nChgColors = 0; - if ( !nAngle ) - nChgColors ^= 1; - - if ( !nFocus ) - nChgColors ^= 1; - else if ( nFocus < 0 ) // Bei negativem Focus sind die Farben zu tauschen + if ( nFocus < 0 ) // Bei negativem Focus sind die Farben zu tauschen { nFocus =- nFocus; nChgColors ^= 1; @@ -1925,8 +1920,8 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co if( nFocus > 40 && nFocus < 60 ) { eGrad = XGRAD_AXIAL; // Besser gehts leider nicht - nChgColors ^= 1; } + USHORT nFocusX = (USHORT)nFocus; USHORT nFocusY = (USHORT)nFocus; @@ -3239,6 +3234,8 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const { // MapUnit eMap( rManager.GetModel()->GetScaleUnit() ); + sal_Bool bHasShadow = sal_False; + for ( void* pDummy = ((DffPropertyReader*)this)->First(); pDummy; pDummy = ((DffPropertyReader*)this)->Next() ) { UINT32 nRecType = GetCurKey(); @@ -3310,8 +3307,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const break; case DFF_Prop_fshadowObscured : { - sal_Bool bHasShadow = ( nContent & 2 ) != 0; - rSet.Put( SdrShadowItem( bHasShadow ) ); + bHasShadow = ( nContent & 2 ) != 0; if ( bHasShadow ) { if ( !IsProperty( DFF_Prop_shadowOffsetX ) ) @@ -3324,6 +3320,44 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const } } + if ( bHasShadow ) + { + // #160376# sj: activating shadow only if fill and or linestyle is used + // this is required because of the latest drawing layer core changes. + // Issue i104085 is related to this. + UINT32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash )); + if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( rObjData.eShapeType )) + nLineFlags &= ~0x08; + UINT32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest )); + if(!IsHardAttribute( DFF_Prop_fFilled ) && !IsCustomShapeFilledByDefault( rObjData.eShapeType )) + nFillFlags &= ~0x10; + if ( nFillFlags & 0x10 ) + { + MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid ); + switch( eMSO_FillType ) + { + case mso_fillSolid : + case mso_fillPattern : + case mso_fillTexture : + case mso_fillPicture : + case mso_fillShade : + case mso_fillShadeCenter : + case mso_fillShadeShape : + case mso_fillShadeScale : + case mso_fillShadeTitle : + break; + // case mso_fillBackground : + default: + nFillFlags &=~0x10; // no fillstyle used + break; + } + } + if ( ( ( nLineFlags & 0x08 ) == 0 ) && ( ( nFillFlags & 0x10 ) == 0 ) ) // if there is no fillstyle and linestyle + bHasShadow = sal_False; // we are turning shadow off. + + if ( bHasShadow ) + rSet.Put( SdrShadowItem( bHasShadow ) ); + } ApplyLineAttributes( rSet, rObjData.eShapeType ); // #i28269# ApplyFillAttributes( rIn, rSet, rObjData ); if ( rObjData.eShapeType != mso_sptNil ) @@ -3775,16 +3809,43 @@ FASTBOOL SvxMSDffManager::GetColorFromPalette( USHORT /* nNum */, Color& rColor return TRUE; } +// sj: the documentation is not complete, especially in ppt the normal rgb for text +// color is written as 0xfeRRGGBB, this can't be explained by the documentation, nearly +// every bit in the upper code is set -> so there seems to be a special handling for +// ppt text colors, i decided not to fix this in MSO_CLR_ToColor because of possible +// side effects, instead MSO_TEXT_CLR_ToColor is called for PPT text colors, to map +// the color code to something that behaves like the other standard color codes used by +// fill and line color +Color SvxMSDffManager::MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode ) const +{ + // Fuer Textfarben: Header ist 0xfeRRGGBB + if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 ) + nColorCode &= 0x00ffffff; + else + { + // for colorscheme colors the color index are the lower three bits of the upper byte + if ( ( nColorCode & 0xf8000000 ) == 0 ) // this must be a colorscheme index + { + nColorCode >>= 24; + nColorCode |= 0x8000000; + } + } + return MSO_CLR_ToColor( nColorCode ); +} Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nContentProperty ) const { Color aColor( mnDefaultColor ); // Fuer Textfarben: Header ist 0xfeRRGGBB - if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 ) - nColorCode &= 0x00ffffff; + if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 ) // sj: it needs to be checked if 0xfe is used in + nColorCode &= 0x00ffffff; // other cases than ppt text -> if not this code can be removed sal_uInt8 nUpper = (sal_uInt8)( nColorCode >> 24 ); + + // sj: below change from 0x1b to 0x19 was done because of i84812 (0x02 -> rgb color), + // now I have some problems to fix i104685 (there the color value is 0x02000000 whichs requires + // a 0x2 scheme color to be displayed properly), the color docu seems to be incomplete if( nUpper & 0x19 ) // if( nUpper & 0x1f ) { if( ( nUpper & 0x08 ) || ( ( nUpper & 0x10 ) == 0 ) ) @@ -4754,13 +4815,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 @@ -4955,6 +5016,16 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r ApplyAttributes( rSt, aSet, aObjData ); pRet->SetMergedItemSet(aSet); } + else if ( aObjData.eShapeType == mso_sptLine )
+ {
+ basegfx::B2DPolygon aPoly;
+ aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top()));
+ aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom()));
+ pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
+ pRet->SetModel( pSdrModel );
+ ApplyAttributes( rSt, aSet, aObjData );
+ pRet->SetMergedItemSet(aSet);
+ }
else { if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) ) 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/optgenrl.src b/svx/source/options/optgenrl.src index 52e031f1099f..cff6f8d4216c 100644 --- a/svx/source/options/optgenrl.src +++ b/svx/source/options/optgenrl.src @@ -74,6 +74,14 @@ TabPage RID_SFXPAGE_GENERAL Hide = TRUE; Text [ en-US ] = "Last Name/First name/Father's name/Initials"; }; + FixedText FT_NAME_EASTERN + { + Pos = MAP_APPFONT ( LEFT , FLINE ( 1 ) ) ; + Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ; + LeftLabel = TRUE ; + Hide = TRUE; + Text [ en-US ] = "Last/First ~name/Initials" ; + }; Edit ED_FATHERNAME { Border = TRUE ; 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/options/optsave.src b/svx/source/options/optsave.src index afa1c4b6d0c8..374f53ef618f 100644 --- a/svx/source/options/optsave.src +++ b/svx/source/options/optsave.src @@ -149,8 +149,9 @@ TabPage RID_SFXPAGE_SAVE DropDown = TRUE; StringList [ en-US ] = { - < "1.0/1.1 (OpenOffice.org 2.x)" ; 2 ; > ; - < "1.2 (recommended)" ; 3 ; > ; + < "1.0/1.1" ; 2 ; > ; + < "1.2" ; 4 ; > ; + < "1.2 Extended (recommended)"; 0x7fffffff ; > ; }; }; CheckBox BTN_NOPRETTYPRINTING @@ -219,7 +220,8 @@ TabPage RID_SFXPAGE_SAVE Pos = MAP_APPFONT ( 23 , 169 ) ; Size = MAP_APPFONT ( 239 , 8 ) ; Hide = TRUE; - Text [ en-US ] = "Not using ODF 1.2 may cause infomation to be lost."; + Text [ en-US ] = "Not using ODF 1.2 Extended may cause infomation to be lost."; + Text [ x-comment ] = "EN-US, the term 'extended' must not be translated."; }; Image IMG_ODF_WARNING { diff --git a/svx/source/outliner/outliner.cxx b/svx/source/outliner/outliner.cxx index 3da9e8dbecac..fc144cf4304f 100644 --- a/svx/source/outliner/outliner.cxx +++ b/svx/source/outliner/outliner.cxx @@ -1867,6 +1867,20 @@ IMPL_LINK( Outliner, EndMovingParagraphsHdl, MoveParagraphsInfo*, pInfos ) return 0; } +static bool isSameNumbering( const SvxNumberFormat& rN1, const SvxNumberFormat& rN2 ) +{ + if( rN1.GetNumberingType() != rN2.GetNumberingType() ) + return false; + + if( rN1.GetNumStr(1) != rN2.GetNumStr(1) ) + return false; + + if( (rN1.GetPrefix() != rN2.GetPrefix()) || (rN1.GetSuffix() != rN2.GetSuffix()) ) + return false; + + return true; +} + sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pParaFmt ) { sal_uInt16 nNumber = pParaFmt->GetStart() - 1; @@ -1879,8 +1893,8 @@ sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pPar pPara = pParaList->GetParagraph( nPara ); const sal_Int16 nDepth = pPara->GetDepth(); - // ignore paragraphs that are below our paragraph - if( nDepth > nParaDepth ) + // ignore paragraphs that are below our paragraph or have no numbering + if( (nDepth > nParaDepth) || (nDepth == -1) ) continue; // stop on paragraphs that are above our paragraph @@ -1888,8 +1902,13 @@ sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pPar break; const SvxNumberFormat* pFmt = GetNumberFormat( nPara ); - if( pFmt == 0 || (*pFmt != *pParaFmt) ) - break; // change in number format, stop here + + if( pFmt == 0 ) + continue; // ignore paragraphs without bullets + + // check if numbering is the same + if( !isSameNumbering( *pFmt, *pParaFmt ) ) + break; const SfxBoolItem& rBulletState = (const SfxBoolItem&) pEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ); diff --git a/svx/source/outliner/outlvw.cxx b/svx/source/outliner/outlvw.cxx index 098a4055ce0f..a69776df14e8 100644 --- a/svx/source/outliner/outlvw.cxx +++ b/svx/source/outliner/outlvw.cxx @@ -1010,6 +1010,14 @@ void OutlinerView::PasteSpecial() pOwner->bPasting = TRUE; pEditView->PasteSpecial(); + if ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT ) + { + const USHORT nParaCount = pOwner->pEditEngine->GetParagraphCount(); + + for( USHORT nPara = 0; nPara < nParaCount; nPara++ ) + pOwner->ImplSetLevelDependendStyleSheet( nPara ); + } + pEditView->SetEditEngineUpdateMode( TRUE ); pOwner->UndoActionEnd( OLUNDO_INSERT ); pEditView->ShowCursor( TRUE, TRUE ); diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index 33c958fa6268..ae6204d15bef 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -57,12 +57,15 @@ namespace drawinglayer sal_Int32 aTextUpperDistance, sal_Int32 aTextRightDistance, sal_Int32 aTextLowerDistance, + SdrTextHorzAdjust aSdrTextHorzAdjust, + SdrTextVertAdjust aSdrTextVertAdjust, bool bContour, bool bFitToSize, bool bHideContour, bool bBlink, bool bScroll, - bool bInEditMode) + bool bInEditMode, + bool bFixedCellHeight) : mpSdrText(&rSdrText), maOutlinerParaObject(rOutlinerParaObject), mpSdrFormTextAttribute(0), @@ -71,12 +74,15 @@ namespace drawinglayer maTextRightDistance(aTextRightDistance), maTextLowerDistance(aTextLowerDistance), maPropertiesVersion(0), + maSdrTextHorzAdjust(aSdrTextHorzAdjust), + maSdrTextVertAdjust(aSdrTextVertAdjust), mbContour(bContour), mbFitToSize(bFitToSize), mbHideContour(bHideContour), mbBlink(bBlink), mbScroll(bScroll), - mbInEditMode(bInEditMode) + mbInEditMode(bInEditMode), + mbFixedCellHeight(bFixedCellHeight) { if(XFT_NONE != eFormTextStyle) { @@ -108,12 +114,16 @@ namespace drawinglayer maTextUpperDistance(rCandidate.getTextUpperDistance()), maTextRightDistance(rCandidate.getTextRightDistance()), maTextLowerDistance(rCandidate.getTextLowerDistance()), + maPropertiesVersion(rCandidate.getPropertiesVersion()), + maSdrTextHorzAdjust(rCandidate.getSdrTextHorzAdjust()), + maSdrTextVertAdjust(rCandidate.getSdrTextVertAdjust()), mbContour(rCandidate.isContour()), mbFitToSize(rCandidate.isFitToSize()), mbHideContour(rCandidate.isHideContour()), mbBlink(rCandidate.isBlink()), mbScroll(rCandidate.isScroll()), - mbInEditMode(rCandidate.isInEditMode()) + mbInEditMode(rCandidate.isInEditMode()), + mbFixedCellHeight(rCandidate.isFixedCellHeight()) { if(rCandidate.getSdrFormTextAttribute()) { @@ -142,36 +152,52 @@ namespace drawinglayer maTextUpperDistance = rCandidate.getTextUpperDistance(); maTextRightDistance = rCandidate.getTextRightDistance(); maTextLowerDistance = rCandidate.getTextLowerDistance(); + maPropertiesVersion = rCandidate.getPropertiesVersion(); + + maSdrTextHorzAdjust = rCandidate.getSdrTextHorzAdjust(); + maSdrTextVertAdjust = rCandidate.getSdrTextVertAdjust(); + mbContour = rCandidate.isContour(); mbFitToSize = rCandidate.isFitToSize(); mbHideContour = rCandidate.isHideContour(); mbBlink = rCandidate.isBlink(); mbScroll = rCandidate.isScroll(); mbInEditMode = rCandidate.isInEditMode(); + mbFixedCellHeight = rCandidate.isFixedCellHeight(); return *this; } bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const { - return (getOutlinerParaObject() == rCandidate.getOutlinerParaObject() + return ( + // compares OPO and it's contents, but traditionally not the RedLining + // which is not seen as model, but as temporary information + getOutlinerParaObject() == rCandidate.getOutlinerParaObject() + // #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() + + && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust() + && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust() + && isContour() == rCandidate.isContour() && isFitToSize() == rCandidate.isFitToSize() && isHideContour() == rCandidate.isHideContour() && isBlink() == rCandidate.isBlink() && isScroll() == rCandidate.isScroll() - && isInEditMode() == rCandidate.isInEditMode()); + && isInEditMode() == rCandidate.isInEditMode() + && isFixedCellHeight() == rCandidate.isFixedCellHeight()); } void SdrTextAttribute::getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index b083a1014299..7527b177b3a4 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -305,6 +305,10 @@ namespace sdr pSdrText, *pOPO, aTextRangeTransform, + SDRTEXTHORZADJUST_LEFT, + SDRTEXTVERTADJUST_TOP, + false, + false, false, false, false); diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index 0f4716e2d513..5f632f60ab85 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -66,10 +66,11 @@ namespace sdr // no need to correct if no extra text range if(aTextRange != aObjectRange) { + const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation()); const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat()); // only correct when rotation and/or shear is used - if(rGeoStat.nShearWink || rGeoStat.nDrehWink) + if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation)) { // text range needs to be corrected by // aObjectRange.getCenter() - aRotObjectRange.getCenter() since it's @@ -93,6 +94,11 @@ namespace sdr aRotMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); } + if(!basegfx::fTools::equalZero(fExtraTextRotation)) + { + aRotMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180); + } + aRotMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY()); aRotObjectRange.transform(aRotMatrix); @@ -210,7 +216,11 @@ namespace sdr // create primitive const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrCustomShapePrimitive2D( - *pAttribute, xGroup, aTextBoxMatrix, bWordWrap)); + *pAttribute, + xGroup, + aTextBoxMatrix, + bWordWrap, + false)); // #SJ# New parameter to force to clipped BlockText for SC xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } 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/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/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx index 99710ca308c9..7bea25feeeed 100644 --- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx @@ -121,34 +121,18 @@ namespace sdr { namespace contact { //-------------------------------------------------------------------- ViewObjectContact& ViewContactOfUnoControl::CreateObjectSpecificViewObjectContact( ObjectContact& _rObjectContact ) { + // print or print preview requires special handling + const OutputDevice* pDevice = _rObjectContact.TryToGetOutputDevice(); + bool bPrintOrPreview = ( pDevice != NULL ) && ( pDevice->GetOutDevType() == OUTDEV_PRINTER ); + ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &_rObjectContact ); - if ( pPageViewContact ) - { - // special classes for special devices: - // - PDF export - ::vcl::PDFExtOutDevData* pPDFExport = PTR_CAST( ::vcl::PDFExtOutDevData, pPageViewContact->GetPageWindow().GetPaintWindow().GetOutputDevice().GetExtOutDevData() ); - if ( pPDFExport != NULL ) - return *new UnoControlPDFExportContact( *pPageViewContact, *this ); - - // - print preview - if ( pPageViewContact->GetPageWindow().GetPageView().GetView().IsPrintPreview() ) - return *new UnoControlPrintOrPreviewContact( *pPageViewContact, *this ); - - OutDevType eDeviceType = pPageViewContact->GetPageWindow().GetPaintWindow().GetOutputDevice().GetOutDevType(); - // - printing - if ( eDeviceType == OUTDEV_PRINTER ) - return *new UnoControlPrintOrPreviewContact( *pPageViewContact, *this ); - - // - any other virtual device - if ( eDeviceType == OUTDEV_VIRDEV ) - return *new UnoControlDefaultContact( *pPageViewContact, *this ); - - // - normal windows have special, design-mode dependent handling - if ( eDeviceType == OUTDEV_WINDOW ) - return *new UnoControlWindowContact( *pPageViewContact, *this ); - } + bPrintOrPreview |= ( pPageViewContact != NULL ) && pPageViewContact->GetPageWindow().GetPageView().GetView().IsPrintPreview(); + + if ( bPrintOrPreview ) + return *new UnoControlPrintOrPreviewContact( *pPageViewContact, *this ); - return *new UnoControlDefaultContact( _rObjectContact, *this ); + // all others are nowadays served by the same implementation + return *new ViewObjectContactOfUnoControl( _rObjectContact, *this ); } //-------------------------------------------------------------------- @@ -171,7 +155,7 @@ namespace sdr { namespace contact { aTransform.set(0, 2, aRange.getMinX()); aTransform.set(1, 2, aRange.getMinY()); - // create control primitive WITHOUT evtl. existing XControl; this would be done in + // create control primitive WITHOUT possibly existing XControl; this would be done in // the VOC in createPrimitive2DSequence() const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::ControlPrimitive2D( aTransform, xControlModel)); diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx index 902e8e7d8153..5e9ab788e392 100644 --- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx @@ -220,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(); } @@ -230,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() diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx index 6145e0acc301..635ae9c7fcc8 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx @@ -60,197 +60,176 @@ 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(); - sal_Int32 nState = -1; + // 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(); + sal_Int32 nState(-1); + + { + const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef(); + if ( xObjRef.is() ) + nState = xObjRef->getCurrentState(); + } + + 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) + { + if( !GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile() ) { - const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef(); - if ( xObjRef.is() ) - nState = xObjRef->getCurrentState(); + //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; } - 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 ) + if( !bDone ) + { + const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect()); + const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom()); + + // create object transform + basegfx::B2DHomMatrix aObjectTransform; + aObjectTransform.set(0, 0, aObjectRange.getWidth()); + aObjectTransform.set(1, 1, aObjectRange.getHeight()); + aObjectTransform.set(0, 2, aObjectRange.getMinX()); + aObjectTransform.set(1, 2, aObjectRange.getMinY()); + + if(bIsChart) { - if( !GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile() ) + //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()) { - bDone = true; - //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! + bDoChartPrettyPrinting = false; } - } - - if( !bDone ) - { - const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect()); - const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom()); - // create object transform - basegfx::B2DHomMatrix aObjectTransform; - aObjectTransform.set(0, 0, aObjectRange.getWidth()); - aObjectTransform.set(1, 1, aObjectRange.getHeight()); - aObjectTransform.set(0, 2, aObjectRange.getMinX()); - aObjectTransform.set(1, 2, aObjectRange.getMinY()); - - if(bIsChart) + // the original ChartPrettyPainter does not do it for VDEV + if(bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice()) { - //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()) + if(GetObjectContact().isOutputToPDFFile()) { - bDoChartPrettyPrinting = false; + // #i97982# + // For PDF files, allow PrettyPrinting } - - // the original ChartPrettyPainter does not do it for VDEV - if(bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice()) + else { - if(GetObjectContact().isOutputToPDFFile()) - { - // #i97982# - // For PDF files, allow PrettyPrinting - } - else - { - bDoChartPrettyPrinting = false; - } + bDoChartPrettyPrinting = false; } + } - // the chart model is needed. Check if it's available - if(bDoChartPrettyPrinting) - { - // get chart model - xChartModel = rSdrOle2.getXModel(); - - if(!xChartModel.is()) - { - bDoChartPrettyPrinting = false; - } - } + // the chart model is needed. Check if it's available + if(bDoChartPrettyPrinting) + { + // get chart model + xChartModel = rSdrOle2.getXModel(); - if(bDoChartPrettyPrinting) + if(!xChartModel.is()) { - // 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; + bDoChartPrettyPrinting = false; } } - if( !bDone ) + if(bDoChartPrettyPrinting) { - //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 + // 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(GetObjectContact().isDrawModeHighContrast()) + if( !bDone ) + { + //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()) { - // 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(); + const sal_Int64 nMiscStatus(xObjRef->getStatus(rSdrOle2.GetAspect())); - if(pOLEHighContrastGraphic) + // this hack (to change model data during PAINT argh(!)) should be reworked + if(!rSdrOle2.IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE)) { - // there is a graphic set, use it - xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(*pOLEHighContrastGraphic, rSdrOle2.IsEmptyPresObj()); + const_cast< SdrOle2Obj* >(&rSdrOle2)->SetResizeProtect(true); } - else - { - // no HighContrast graphic, use default empty OLE bitmap - const Bitmap aEmptyOLEBitmap(rSdrOle2.GetEmtyOLEReplacementBitmap()); - const Graphic aEmtyOLEGraphic(aEmptyOLEBitmap); - xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(aEmtyOLEGraphic, true); + SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView(); + if(pPageView && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE)) + { + // connect plugin object + pPageView->GetView().DoConnect(const_cast< SdrOle2Obj* >(&rSdrOle2)); } } - else - { - // call parent which will use the regular createViewIndependentPrimitive2DSequence - // at the corresponding VC - xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo); - } + }//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(bIsOutplaceActive) + if(bIsOutplaceActive) + { + // do not shade when printing or PDF exporting + if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile()) { - // 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); - } + // 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; + } + + return xRetval; } ViewObjectContactOfSdrOle2Obj::ViewObjectContactOfSdrOle2Obj(ObjectContact& rObjectContact, ViewContact& rViewContact) diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 92003865fde0..bbfe3eaf65ab 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -30,12 +30,18 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" + #include <svx/sdr/contact/viewobjectcontactofunocontrol.hxx> #include <svx/sdr/contact/viewcontactofunocontrol.hxx> #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> +#include <svx/svdouno.hxx> +#include <svx/svdpagv.hxx> +#include <svx/svdview.hxx> +#include <svx/sdrpagewindow.hxx> +#include "sdrpaintwindow.hxx" /** === begin UNO includes === **/ #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -53,23 +59,21 @@ #include <com/sun/star/container/XContainerListener.hpp> #include <com/sun/star/container/XContainer.hpp> /** === end UNO includes === **/ -#include <svx/svdouno.hxx> -#include <svx/svdpagv.hxx> -#include <svx/svdview.hxx> -#include <svx/sdrpagewindow.hxx> -#include "sdrpaintwindow.hxx" + #include <toolkit/helper/formpdfexport.hxx> #include <vcl/pdfextoutdevdata.hxx> #include <vcl/svapp.hxx> #include <vos/mutex.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/scopeguard.hxx> #include <cppuhelper/implbase4.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> - #include <basegfx/matrix/b2dhommatrix.hxx> #include <drawinglayer/primitive2d/controlprimitive2d.hxx> + #include <boost/shared_ptr.hpp> +#include <boost/bind.hpp> //........................................................................ namespace sdr { namespace contact { @@ -220,10 +224,17 @@ namespace sdr { namespace contact { void ControlHolder::setPosSize( const Rectangle& _rPosSize ) const { // no check whether we're valid, this is the responsibility of the caller - m_xControlWindow->setPosSize( - _rPosSize.Left(), _rPosSize.Top(), _rPosSize.GetWidth(), _rPosSize.GetHeight(), - POSSIZE - ); + + // don't call setPosSize when pos/size did not change + // #i104181# / 2009-08-18 / frank.schoenheit@sun.com + ::Rectangle aCurrentRect( getPosSize() ); + if ( aCurrentRect != _rPosSize ) + { + m_xControlWindow->setPosSize( + _rPosSize.Left(), _rPosSize.Top(), _rPosSize.GetWidth(), _rPosSize.GetHeight(), + POSSIZE + ); + } } //-------------------------------------------------------------------- @@ -391,7 +402,7 @@ namespace sdr { namespace contact { //= InvisibleControlViewAccess //==================================================================== /** is a ->IPageViewAccess implementation which can be used to create an invisble control for - an arbitrary device + an arbitrary window */ class InvisibleControlViewAccess : public IPageViewAccess { @@ -435,6 +446,47 @@ namespace sdr { namespace contact { } //==================================================================== + //= DummyPageViewAccess + //==================================================================== + /** is a ->IPageViewAccess implementation which can be used to create a control for an arbitrary + non-Window device + + The implementation will report the "PageView" as being in design mode, all layers to be visible, + and will not return any ControlContainer, so all control container related features (notifications etc) + are not available. + */ + class DummyPageViewAccess : public IPageViewAccess + { + public: + DummyPageViewAccess() + { + } + + 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 NULL; + } + + //-------------------------------------------------------------------- + bool DummyPageViewAccess::isLayerVisible( SdrLayerID /*_nLayerID*/ ) const + { + return true; + } + + //==================================================================== //= ViewObjectContactOfUnoControl_Impl //==================================================================== typedef ::cppu::WeakImplHelper4 < XWindowListener @@ -447,7 +499,10 @@ namespace sdr { namespace contact { { private: /// the instance whose IMPL we are - ViewObjectContactOfUnoControl* m_pAntiImpl; + ViewObjectContactOfUnoControl* m_pAntiImpl; + + /// are we currently inside impl_ensureControl_nothrow? + bool m_bCreatingControl; /** thread safety @@ -749,8 +804,9 @@ namespace sdr { namespace contact { This method cares for this, by retrieving the very original OutputDevice. */ - static const OutputDevice& imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact ); - const OutputDevice& imp_getPageViewDevice_nothrow() const; + static const OutputDevice& impl_getPageViewOutputDevice_nothrow( const ObjectContactOfPageView& _rObjectContact ); + + const OutputDevice& impl_getOutputDevice_throw() const; private: ViewObjectContactOfUnoControl_Impl(); // never implemented @@ -815,6 +871,13 @@ namespace sdr { namespace contact { static void getTransformation( const ViewContactOfUnoControl& _rVOC, ::basegfx::B2DHomMatrix& _out_Transformation ); private: + void impl_positionAndZoomControl( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const + { + if ( !_rViewInformation.getViewport().isEmpty() ) + m_pVOCImpl->positionAndZoomControl( _rViewInformation.getObjectToViewTransformation() ); + } + + 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 @@ -830,6 +893,7 @@ namespace sdr { namespace contact { //-------------------------------------------------------------------- ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl( ViewObjectContactOfUnoControl* _pAntiImpl ) :m_pAntiImpl( _pAntiImpl ) + ,m_bCreatingControl( false ) ,m_pOutputDeviceForWindow( NULL ) ,m_bControlIsVisible( false ) ,m_bIsDesignModeListening( false ) @@ -839,9 +903,15 @@ namespace sdr { namespace contact { DBG_CTOR( ViewObjectContactOfUnoControl_Impl, NULL ); DBG_ASSERT( m_pAntiImpl, "ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl: invalid AntiImpl!" ); - const OutputDevice& rPageViewDevice( imp_getPageViewDevice_nothrow() ); + const OutputDevice& rPageViewDevice( impl_getOutputDevice_throw() ); m_aZoomLevelNormalization = rPageViewDevice.GetInverseViewTransformation(); + #if OSL_DEBUG_LEVEL > 1 + ::basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + m_aZoomLevelNormalization.decompose( aScale, aTranslate, fRotate, fShearX ); + #endif + ::basegfx::B2DHomMatrix aScaleNormalization; MapMode aCurrentDeviceMapMode( rPageViewDevice.GetMapMode() ); aScaleNormalization.set( 0, 0, (double)aCurrentDeviceMapMode.GetScaleX() ); @@ -938,27 +1008,40 @@ namespace sdr { namespace contact { return false; ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &m_pAntiImpl->GetObjectContact() ); - DBG_ASSERT( pPageViewContact, "ViewObjectContactOfUnoControl_Impl::ensureControl: cannot create a control if I don't have a PageView!" ); - if ( !pPageViewContact ) - return false; + if ( pPageViewContact ) + { + SdrPageViewAccess aPVAccess( pPageViewContact->GetPageWindow().GetPageView() ); + return impl_ensureControl_nothrow( + aPVAccess, + impl_getPageViewOutputDevice_nothrow( *pPageViewContact ) + ); + } - SdrPageViewAccess aPVAccess( pPageViewContact->GetPageWindow().GetPageView() ); + DummyPageViewAccess aNoPageView; return impl_ensureControl_nothrow( - aPVAccess, - imp_getPageViewDevice_nothrow( *pPageViewContact ) + aNoPageView, + impl_getOutputDevice_throw() ); } //-------------------------------------------------------------------- - const OutputDevice& ViewObjectContactOfUnoControl_Impl::imp_getPageViewDevice_nothrow() const + const OutputDevice& ViewObjectContactOfUnoControl_Impl::impl_getOutputDevice_throw() const { ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &m_pAntiImpl->GetObjectContact() ); - ENSURE_OR_THROW( pPageViewContact, "need a ObjectContactOfPageView." ); - return imp_getPageViewDevice_nothrow( *pPageViewContact ); + if ( pPageViewContact ) + { + // do not use ObjectContact::TryToGetOutputDevice here, it would not care for the PageWindow's + // OriginalPaintWindow + return impl_getPageViewOutputDevice_nothrow( *pPageViewContact ); + } + + const OutputDevice* pDevice = m_pAntiImpl->GetObjectContact().TryToGetOutputDevice(); + ENSURE_OR_THROW( pDevice, "no output device -> no control" ); + return *pDevice; } //-------------------------------------------------------------------- - const OutputDevice& ViewObjectContactOfUnoControl_Impl::imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact ) + const OutputDevice& ViewObjectContactOfUnoControl_Impl::impl_getPageViewOutputDevice_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 @@ -971,9 +1054,36 @@ namespace sdr { namespace contact { return rPageWindow.GetPaintWindow().GetOutputDevice(); } + namespace + { + static void lcl_resetFlag( bool& rbFlag )
+ {
+ rbFlag = false;
+ }
+ } + //-------------------------------------------------------------------- bool ViewObjectContactOfUnoControl_Impl::impl_ensureControl_nothrow( IPageViewAccess& _rPageView, const OutputDevice& _rDevice ) { + if ( m_bCreatingControl ) + { + OSL_ENSURE( false, "ViewObjectContactOfUnoControl_Impl::impl_ensureControl_nothrow: reentrance is not really good here!" ); + // We once had a situation where this was called reentrantly, which lead to all kind of strange effects. All + // those affected the grid control, which is the only control so far which is visible in design mode (and + // not only in alive mode). + // Creating the control triggered an Window::Update on some of its child windows, which triggered a + // Paint on parent of the grid control (e.g. the SwEditWin), which triggered a reentrant call to this method, + // which it is not really prepared for. + // + // /me thinks that re-entrance should be caught on a higher level, i.e. the Drawing Layer should not allow + // reentrant paint requests. For the moment, until /me can discuss this with AW, catch it here. + // 2009-08-27 / #i104544# frank.schoenheit@sun.com + return false; + } + + m_bCreatingControl = true; + ::comphelper::ScopeGuard aGuard( ::boost::bind( lcl_resetFlag, ::boost::ref( m_bCreatingControl ) ) );
+
if ( m_aControl.is() ) { if ( m_pOutputDeviceForWindow == &_rDevice ) @@ -1480,18 +1590,28 @@ namespace sdr { namespace contact { //-------------------------------------------------------------------- ::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::get2DDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const { + #if OSL_DEBUG_LEVEL > 1 + ::basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + _rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX ); + #endif if ( m_pVOCImpl->hasControl() ) - m_pVOCImpl->positionAndZoomControl( _rViewInformation.getObjectToViewTransformation() ); + impl_positionAndZoomControl( _rViewInformation ); return BasePrimitive2D::get2DDecomposition( _rViewInformation ); } //-------------------------------------------------------------------- ::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::createLocalDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const { + #if OSL_DEBUG_LEVEL > 1 + ::basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + _rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX ); + #endif // 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() ); + impl_positionAndZoomControl( _rViewInformation ); // get needed data const ViewContactOfUnoControl& rViewContactOfUnoControl( m_pVOCImpl->getViewContact() ); @@ -1662,40 +1782,6 @@ namespace sdr { namespace contact { } //==================================================================== - //= UnoControlDefaultContact - //==================================================================== - DBG_NAME( UnoControlDefaultContact ) - //-------------------------------------------------------------------- - UnoControlDefaultContact::UnoControlDefaultContact( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact ) - :ViewObjectContactOfUnoControl( _rObjectContact, _rViewContact ) - { - DBG_CTOR( UnoControlDefaultContact, NULL ); - } - - //-------------------------------------------------------------------- - UnoControlDefaultContact::~UnoControlDefaultContact() - { - DBG_DTOR( UnoControlDefaultContact, NULL ); - } - - //==================================================================== - //= UnoControlWindowContact - //==================================================================== - DBG_NAME( UnoControlWindowContact ) - //-------------------------------------------------------------------- - UnoControlWindowContact::UnoControlWindowContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact ) - :ViewObjectContactOfUnoControl( _rObjectContact, _rViewContact ) - { - DBG_CTOR( UnoControlWindowContact, NULL ); - } - - //-------------------------------------------------------------------- - UnoControlWindowContact::~UnoControlWindowContact() - { - DBG_DTOR( UnoControlWindowContact, NULL ); - } - - //==================================================================== //= UnoControlPrintOrPreviewContact //==================================================================== DBG_NAME( UnoControlPrintOrPreviewContact ) @@ -1720,23 +1806,6 @@ namespace sdr { namespace contact { return ViewObjectContactOfUnoControl::createPrimitive2DSequence( rDisplayInfo ); } - //==================================================================== - //= UnoControlPDFExportContact - //==================================================================== - DBG_NAME( UnoControlPDFExportContact ) - //-------------------------------------------------------------------- - UnoControlPDFExportContact::UnoControlPDFExportContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact ) - :ViewObjectContactOfUnoControl( _rObjectContact, _rViewContact ) - { - DBG_CTOR( UnoControlPDFExportContact, NULL ); - } - - //-------------------------------------------------------------------- - UnoControlPDFExportContact::~UnoControlPDFExportContact() - { - DBG_DTOR( UnoControlPDFExportContact, NULL ); - } - //........................................................................ } } // namespace sdr::contact //........................................................................ diff --git a/svx/source/sdr/overlay/makefile.mk b/svx/source/sdr/overlay/makefile.mk index bb6489606283..d202992c090d 100644 --- a/svx/source/sdr/overlay/makefile.mk +++ b/svx/source/sdr/overlay/makefile.mk @@ -56,6 +56,7 @@ SLOFILES=\ $(SLO)$/overlaypolypolygon.obj \ $(SLO)$/overlayprimitive2dsequenceobject.obj \ $(SLO)$/overlayrollingrectangle.obj \ + $(SLO)$/overlayselection.obj \ $(SLO)$/overlaytools.obj \ $(SLO)$/overlaytriangle.obj diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index 2b664e816d42..3fedc40f37cf 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -39,6 +39,7 @@ #include <vcl/bitmap.hxx> #include <tools/stream.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <vcl/cursor.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -255,15 +256,21 @@ namespace sdr maBufferRememberedRangePixel.getMaxX(), maBufferRememberedRangePixel.getMaxY()); aBufferRememberedRangeLogic.transform(getOutputDevice().GetInverseViewTransformation()); + // prepare cursor handling const bool bTargetIsWindow(OUTDEV_WINDOW == rmOutputDevice.GetOutDevType()); - Cursor* pCursor = 0; + bool bCursorWasEnabled(false); - // #i75172# switch off VCL cursor during overlay refresh + // #i80730# switch off VCL cursor during overlay refresh if(bTargetIsWindow) { Window& rWindow = static_cast< Window& >(rmOutputDevice); - pCursor = rWindow.GetCursor(); - rWindow.SetCursor(0); + Cursor* pCursor = rWindow.GetCursor(); + + if(pCursor && pCursor->IsVisible()) + { + pCursor->Hide(); + bCursorWasEnabled = true; + } } if(DoRefreshWithPreRendering()) @@ -363,49 +370,19 @@ namespace sdr OverlayManager::ImpDrawMembers(aBufferRememberedRangeLogic, getOutputDevice()); } - // VCL hack for transparent child windows - // Problem is e.g. a radiobuttion form control in life mode. The used window - // is a transparence vcl childwindow. This flag only allows the parent window to - // paint into the child windows area, but there is no mechanism which takes - // care for a repaint of the child window. A transparent child window is NOT - // a window which always keeps it's content consistent over the parent, but it's - // more like just a paint flag for the parent. - // To get the update, the windows in question are updated manulally here. - if(bTargetIsWindow) + // #i80730# restore visibility of VCL cursor + if(bCursorWasEnabled) { Window& rWindow = static_cast< Window& >(rmOutputDevice); + Cursor* pCursor = rWindow.GetCursor(); - if(rWindow.IsChildTransparentModeEnabled() && rWindow.GetChildCount()) + if(pCursor) { - const Rectangle aRegionRectanglePixel( - maBufferRememberedRangePixel.getMinX(), maBufferRememberedRangePixel.getMinY(), - maBufferRememberedRangePixel.getMaxX(), maBufferRememberedRangePixel.getMaxY()); - - for(sal_uInt16 a(0); a < rWindow.GetChildCount(); a++) - { - Window* pCandidate = rWindow.GetChild(a); - - if(pCandidate && pCandidate->IsPaintTransparent()) - { - const Rectangle aCandidatePosSizePixel(pCandidate->GetPosPixel(), pCandidate->GetSizePixel()); - - if(aCandidatePosSizePixel.IsOver(aRegionRectanglePixel)) - { - pCandidate->Invalidate(INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN); - pCandidate->Update(); - } - } - } + // check if cursor still exists. It may have been deleted from someone + pCursor->Show(); } } - // #i75172# restore VCL cursor - if(bTargetIsWindow) - { - Window& rWindow = static_cast< Window& >(rmOutputDevice); - rWindow.SetCursor(pCursor); - } - // forget remembered Region maBufferRememberedRangePixel.reset(); } diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx index 4c05fbd48a23..5cddc3c63627 100644 --- a/svx/source/sdr/overlay/overlayobject.cxx +++ b/svx/source/sdr/overlay/overlayobject.cxx @@ -107,7 +107,7 @@ namespace sdr OSL_ENSURE(0 == getOverlayManager(), "OverlayObject is destructed which is still registered at OverlayManager (!)"); } - const drawinglayer::primitive2d::Primitive2DSequence& OverlayObject::getOverlayObjectPrimitive2DSequence() const + drawinglayer::primitive2d::Primitive2DSequence OverlayObject::getOverlayObjectPrimitive2DSequence() const { if(!getPrimitive2DSequence().hasElements()) { 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/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 277ee70f82ca..4e57166b4723 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -76,6 +76,7 @@ #include <drawinglayer/attribute/sdrattribute3d.hxx> #include <drawinglayer/attribute/sdrallattribute3d.hxx> #include <svx/rectenum.hxx> +#include <svx/sdtfchim.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -519,7 +520,7 @@ namespace drawinglayer } } - const SdrFitToSizeType eFit = rTextObj.GetFitToSize(); + const SdrFitToSizeType eFit(rTextObj.GetFitToSize()); const SdrTextAniKind eAniKind(rTextObj.GetTextAniKind()); pRetval = new attribute::SdrTextAttribute( @@ -530,12 +531,15 @@ namespace drawinglayer pUpper ? *pUpper : rTextObj.GetTextUpperDistance(), pRight ? *pRight : rTextObj.GetTextRightDistance(), pLower ? *pLower : rTextObj.GetTextLowerDistance(), + rTextObj.GetTextHorizontalAdjust(rSet), + rTextObj.GetTextVerticalAdjust(rSet), ((const SdrTextContourFrameItem&)rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(), (SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit), ((const XFormTextHideFormItem&)rSet.Get(XATTR_FORMTXTHIDEFORM)).GetValue(), SDRTEXTANI_BLINK == eAniKind, SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind, - bInEditMode); + bInEditMode, + ((const SdrTextFixedCellHeightItem&)rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); } return pRetval; diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx index 80067901483b..73d5689350c2 100644 --- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx @@ -50,62 +50,96 @@ 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, + 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 +152,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..a04021ae21ad 100644 --- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx @@ -72,21 +72,13 @@ namespace drawinglayer // add text if(getSdrLSTAttribute().getText()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(getUnitPolygon()), aEmptyMatrix, *getSdrLSTAttribute().getText(), getSdrLSTAttribute().getLine(), false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(getUnitPolygon()), aEmptyMatrix, *getSdrLSTAttribute().getText(), getSdrLSTAttribute().getLine(), false, false, false)); } // 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..e2dce7b551ed 100644 --- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx @@ -56,22 +56,19 @@ namespace drawinglayer { const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive( - basegfx::B2DPolyPolygon(aUnitOutline), getTextBox(), *getSdrSTAttribute().getText(), 0, false, getWordWrap())); + basegfx::B2DPolyPolygon(aUnitOutline), + getTextBox(), + *getSdrSTAttribute().getText(), + 0, + false, + getWordWrap(), + isForceTextClipToTextRange())); } // 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; @@ -81,12 +78,14 @@ namespace drawinglayer const attribute::SdrShadowTextAttribute& rSdrSTAttribute, const Primitive2DSequence& rSubPrimitives, const basegfx::B2DHomMatrix& rTextBox, - bool bWordWrap) + bool bWordWrap, + bool bForceTextClipToTextRange) : BasePrimitive2D(), maSdrSTAttribute(rSdrSTAttribute), maSubPrimitives(rSubPrimitives), maTextBox(rTextBox), - mbWordWrap(bWordWrap) + mbWordWrap(bWordWrap), + mbForceTextClipToTextRange(bForceTextClipToTextRange) { } @@ -99,7 +98,8 @@ namespace drawinglayer return (getSdrSTAttribute() == rCompare.getSdrSTAttribute() && getSubPrimitives() == rCompare.getSubPrimitives() && getTextBox() == rCompare.getTextBox() - && getWordWrap() == rCompare.getWordWrap()); + && getWordWrap() == rCompare.getWordWrap() + && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange()); } return false; diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 366b934b5473..cd426edfdd05 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,14 +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) + bool bWordWrap, + bool bClipOnBounds) { - ::basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform); + basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform); SdrTextPrimitive2D* pNew = 0; if(rText.isContour()) @@ -185,20 +186,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); @@ -225,7 +226,7 @@ namespace drawinglayer else if(rText.getSdrFormTextAttribute()) { // text on path, use scaled polygon - ::basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon); + basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon); aScaledPolyPolygon.transform(rObjectTransform); pNew = new SdrPathTextPrimitive2D( &rText.getSdrText(), @@ -237,29 +238,29 @@ namespace drawinglayer { // 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); @@ -282,7 +283,8 @@ namespace drawinglayer pNew = new SdrStretchTextPrimitive2D( &rText.getSdrText(), rText.getOutlinerParaObject(), - aAnchorTransform); + aAnchorTransform, + rText.isFixedCellHeight()); } else // text in range { @@ -291,9 +293,13 @@ namespace drawinglayer &rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform, + rText.getSdrTextHorzAdjust(), + rText.getSdrTextVertAdjust(), + rText.isFixedCellHeight(), rText.isScroll(), bCellText, - bWordWrap); + bWordWrap, + bClipOnBounds); } } @@ -331,16 +337,16 @@ namespace drawinglayer const bool bHorizontal(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection); // decompose to get separated values for the scroll box - ::basegfx::B2DVector aScale, aTranslate; + 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; + basegfx::B2DHomMatrix aSRT; aSRT.shearX(fShearX); aSRT.rotate(fRotate); aSRT.translate(aTranslate.getX(), aTranslate.getY()); - ::basegfx::B2DHomMatrix aISRT(aSRT); + basegfx::B2DHomMatrix aISRT(aSRT); aISRT.invert(); // bring the primitive back to scaled only and get scaled range, create new clone for this @@ -355,13 +361,13 @@ namespace drawinglayer geometry::ViewInformation2D aViewInformation2D(xViewParameters); // get range - const ::basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D)); + 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()); + basegfx::B2DHomMatrix aLeft, aRight; + basegfx::B2DPoint aClipTopLeft(0.0, 0.0); + basegfx::B2DPoint aClipBottomRight(aScale.getX(), aScale.getY()); if(bHorizontal) { @@ -410,10 +416,10 @@ namespace drawinglayer const Primitive2DSequence aContent(&xRefA, 1L); // scrolling needs an encapsulating clipping primitive - const ::basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight); - ::basegfx::B2DPolygon aClipPolygon(::basegfx::tools::createPolygonFromRect(aClipRange)); + const basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight); + basegfx::B2DPolygon aClipPolygon(basegfx::tools::createPolygonFromRect(aClipRange)); aClipPolygon.transform(aSRT); - return Primitive2DReference(new MaskPrimitive2D(::basegfx::B2DPolyPolygon(aClipPolygon), aContent)); + return Primitive2DReference(new MaskPrimitive2D(basegfx::B2DPolyPolygon(aClipPolygon), aContent)); } else { @@ -441,36 +447,43 @@ namespace drawinglayer } } - 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..4f7e2c768669 100644 --- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx @@ -94,22 +94,13 @@ namespace drawinglayer // 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, 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; @@ -200,22 +191,13 @@ namespace drawinglayer // 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, 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; diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx index f1f88684dc6c..63d050a775af 100644 --- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx @@ -104,22 +104,13 @@ namespace drawinglayer // 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, 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; diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index 8d66e8b34d14..f5445cefa5f6 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))) { @@ -129,14 +129,18 @@ namespace drawinglayer &pTextAttribute->getSdrText(), pTextAttribute->getOutlinerParaObject(), aTextMatrix, + SDRTEXTHORZADJUST_CENTER, + SDRTEXTVERTADJUST_CENTER, pTextAttribute->isScroll(), false, + false, + 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) { @@ -147,7 +151,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); @@ -157,7 +161,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(); @@ -169,7 +173,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(); @@ -189,8 +193,8 @@ namespace drawinglayer bArrowsOutside = true; } - MeasureTextPosition eHorizontal(meHorizontal); - MeasureTextPosition eVertical(meVertical); + MeasureTextPosition eHorizontal(getHorizontal()); + MeasureTextPosition eVertical(getVertical()); if(MEASURETEXTPOSITION_AUTOMATIC == eVertical) { @@ -237,7 +241,7 @@ namespace drawinglayer } // switch text above/below? - if(mbBelow || (bAutoUpsideDown && !mbTextRotation)) + if(getBelow() || (bAutoUpsideDown && !getTextRotation())) { if(MEASURETEXTPOSITION_NEGATIVE == eVertical) { @@ -249,9 +253,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) @@ -271,8 +275,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)); @@ -287,8 +291,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)); @@ -300,19 +304,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)); @@ -395,7 +399,7 @@ namespace drawinglayer } } - if(!maSdrLSTAttribute.getLine()) + if(!getSdrLSTAttribute().getLine()) { // embed line geometry to invisible line group const Primitive2DReference xHiddenLines(new HitTestPrimitive2D(aRetval)); @@ -408,7 +412,7 @@ namespace drawinglayer if(pBlockText) { // create transformation to text primitive end position - ::basegfx::B2DHomMatrix aChange; + basegfx::B2DHomMatrix aChange; // handle auto text rotation if(bAutoUpsideDown) @@ -432,18 +436,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; @@ -451,8 +446,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, @@ -486,19 +481,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..7c44311d3c5a 100644 --- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx @@ -110,22 +110,13 @@ namespace drawinglayer // always supported by the old paints, too 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, false)); } // 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..96da706fb66a 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, 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/sdrprimitivetools.cxx b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx index 6c665cbef4c9..25b39ebb07d5 100644 --- a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx +++ b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx @@ -37,6 +37,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/hittestprimitive2d.hxx> +#include <vcl/lazydelete.hxx> ////////////////////////////////////////////////////////////////////////////// // helper methods @@ -47,11 +48,11 @@ namespace drawinglayer { BitmapEx createDefaultCross_3x3(const basegfx::BColor& rBColor) { - static BitmapEx* pRetVal = NULL; + static vcl::DeleteOnDeinit< BitmapEx > aRetVal(0); static basegfx::BColor aColor; ::osl::Mutex m_mutex; - if(pRetVal == NULL || rBColor != aColor) + if(!aRetVal.get() || rBColor != aColor) { // copy values aColor = rBColor; @@ -81,23 +82,21 @@ namespace drawinglayer aContent.ReleaseAccess(pWContent); aMask.ReleaseAccess(pWMask); - if( pRetVal ) - delete pRetVal; - - pRetVal = new BitmapEx(aContent, aMask); + // create and exchange at aRetVal + delete aRetVal.set(new BitmapEx(aContent, aMask)); } - return *pRetVal; + return aRetVal.get() ? *aRetVal.get() : BitmapEx(); } BitmapEx createDefaultGluepoint_7x7(const basegfx::BColor& rBColorA, const basegfx::BColor& rBColorB) { - static BitmapEx* pRetVal = NULL; + static vcl::DeleteOnDeinit< BitmapEx > aRetVal(0); static basegfx::BColor aColorA; static basegfx::BColor aColorB; ::osl::Mutex m_mutex; - if(pRetVal == NULL || rBColorA != aColorA || rBColorB != aColorB) + if(!aRetVal.get() || rBColorA != aColorA || rBColorB != aColorB) { // copy values aColorA = rBColorA; @@ -171,13 +170,11 @@ namespace drawinglayer aContent.ReleaseAccess(pWContent); aMask.ReleaseAccess(pWMask); - if( pRetVal ) - delete pRetVal; - - pRetVal = new BitmapEx(aContent, aMask); + // create and exchange at aRetVal + delete aRetVal.set(new BitmapEx(aContent, aMask)); } - return *pRetVal; + return aRetVal.get() ? *aRetVal.get() : BitmapEx(); } // #i99123# diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx index 97aaf2735630..edb2837ef670 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, 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 0cad266f69d1..47e85894f37e 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -116,7 +116,6 @@ namespace drawinglayer mnLastPageNumber(0), mnLastPageCount(0), maLastTextBackgroundColor(), - mbLastSpellCheck(false), mbContainsPageField(false), mbContainsPageCountField(false), mbContainsOtherFields(false) @@ -137,7 +136,13 @@ namespace drawinglayer { const SdrTextPrimitive2D& rCompare = (SdrTextPrimitive2D&)rPrimitive; - return (getOutlinerParaObject() == rCompare.getOutlinerParaObject()); + return ( + + // compare OPO and content, but not WrongList + getOutlinerParaObject() == rCompare.getOutlinerParaObject() + + // also compare WrongList (not-persistent data, but visualized) + && getOutlinerParaObject().isWrongListEqual(rCompare.getOutlinerParaObject())); } return false; @@ -145,9 +150,6 @@ namespace drawinglayer Primitive2DSequence SdrTextPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { - const bool bCurrentSpellCheck(getSdrText() - ? getSdrText()->GetObject().impCheckSpellCheckForDecomposeTextPrimitive() - : false); uno::Reference< drawing::XDrawPage > xCurrentlyVisualizingPage; bool bCurrentlyVisualizingPageIsSet(false); Color aNewTextBackgroundColor; @@ -157,10 +159,10 @@ namespace drawinglayer if(getLocalDecomposition().hasElements()) { - bool bDoDelete(getLastSpellCheck() != bCurrentSpellCheck); + bool bDoDelete(false); // check visualized page - if(!bDoDelete && (mbContainsPageField || mbContainsPageCountField || mbContainsOtherFields)) + if(mbContainsPageField || mbContainsPageCountField || mbContainsOtherFields) { // get visualized page and remember xCurrentlyVisualizingPage = rViewInformation.getVisualizedPage(); @@ -236,7 +238,6 @@ namespace drawinglayer 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; @@ -258,15 +259,7 @@ namespace drawinglayer Primitive2DSequence SdrContourTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText() - ? getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation) - : false); - - if(getLastSpellCheck() != bCurrentSpellCheck) - { - // remember last spell check state; this is part of the decomposition source data definition - const_cast< SdrContourTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck); - } + getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation); return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval); } @@ -319,15 +312,7 @@ namespace drawinglayer Primitive2DSequence SdrPathTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText() - ? getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation) - : false); - - if(getLastSpellCheck() != bCurrentSpellCheck) - { - // remember last spell check state; this is part of the decomposition source data definition - const_cast< SdrPathTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck); - } + getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation); return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval); } @@ -383,15 +368,7 @@ namespace drawinglayer Primitive2DSequence SdrBlockTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText() - ? getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation) - : false); - - if(getLastSpellCheck() != bCurrentSpellCheck) - { - // remember last spell check state; this is part of the decomposition source data definition - const_cast< SdrBlockTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck); - } + getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation); return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval); } @@ -400,14 +377,22 @@ namespace drawinglayer const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObject, const basegfx::B2DHomMatrix& rTextRangeTransform, + SdrTextHorzAdjust aSdrTextHorzAdjust, + SdrTextVertAdjust aSdrTextVertAdjust, + bool bFixedCellHeight, bool bUnlimitedPage, bool bCellText, - bool bWordWrap) + bool bWordWrap, + bool bClipOnBounds) : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject), maTextRangeTransform(rTextRangeTransform), + maSdrTextHorzAdjust(aSdrTextHorzAdjust), + maSdrTextVertAdjust(aSdrTextVertAdjust), + mbFixedCellHeight(bFixedCellHeight), mbUnlimitedPage(bUnlimitedPage), mbCellText(bCellText), - mbWordWrap(bWordWrap) + mbWordWrap(bWordWrap), + mbClipOnBounds(bClipOnBounds) { } @@ -418,9 +403,13 @@ namespace drawinglayer const SdrBlockTextPrimitive2D& rCompare = (SdrBlockTextPrimitive2D&)rPrimitive; return (getTextRangeTransform() == rCompare.getTextRangeTransform() + && getSdrTextHorzAdjust() == rCompare.getSdrTextHorzAdjust() + && getSdrTextVertAdjust() == rCompare.getSdrTextVertAdjust() + && isFixedCellHeight() == rCompare.isFixedCellHeight() && getUnlimitedPage() == rCompare.getUnlimitedPage() && getCellText() == rCompare.getCellText() - && getWordWrap() == rCompare.getWordWrap()); + && getWordWrap() == rCompare.getWordWrap() + && getClipOnBounds() == rCompare.getClipOnBounds()); } return false; @@ -432,9 +421,13 @@ namespace drawinglayer getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform(), + getSdrTextHorzAdjust(), + getSdrTextVertAdjust(), + isFixedCellHeight(), getUnlimitedPage(), getCellText(), - getWordWrap()); + getWordWrap(), + getClipOnBounds()); } // provide unique ID @@ -452,15 +445,7 @@ namespace drawinglayer Primitive2DSequence SdrStretchTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText() - ? getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation) - : false); - - if(getLastSpellCheck() != bCurrentSpellCheck) - { - // remember last spell check state; this is part of the decomposition source data definition - const_cast< SdrStretchTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck); - } + getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation); return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval); } @@ -468,9 +453,11 @@ namespace drawinglayer SdrStretchTextPrimitive2D::SdrStretchTextPrimitive2D( const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObject, - const basegfx::B2DHomMatrix& rTextRangeTransform) + const basegfx::B2DHomMatrix& rTextRangeTransform, + bool bFixedCellHeight) : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject), - maTextRangeTransform(rTextRangeTransform) + maTextRangeTransform(rTextRangeTransform), + mbFixedCellHeight(bFixedCellHeight) { } @@ -480,7 +467,8 @@ namespace drawinglayer { const SdrStretchTextPrimitive2D& rCompare = (SdrStretchTextPrimitive2D&)rPrimitive; - return (getTextRangeTransform() == rCompare.getTextRangeTransform()); + return (getTextRangeTransform() == rCompare.getTextRangeTransform() + && isFixedCellHeight() == rCompare.isFixedCellHeight()); } return false; @@ -491,7 +479,8 @@ namespace drawinglayer return new SdrStretchTextPrimitive2D( getSdrText(), getOutlinerParaObject(), - rTransform * getTextRangeTransform()); + rTransform * getTextRangeTransform(), + isFixedCellHeight()); } // provide unique ID diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx index 2eafb7ba6290..76252d25dbd3 100644 --- a/svx/source/smarttags/SmartTagMgr.cxx +++ b/svx/source/smarttags/SmartTagMgr.cxx @@ -70,10 +70,7 @@ SmartTagMgr::SmartTagMgr( const rtl::OUString& rApplicationName ) maActionList(), maDisabledSmartTagTypes(), maSmartTagMap(), - mxBreakIter(), mxMSF( ::comphelper::getProcessServiceFactory() ), - mxContext(), - mxConfigurationSettings(), mbLabelTextWithSmartTags(true) { } @@ -93,10 +90,6 @@ void SmartTagMgr::Init( const rtl::OUString& rConfigurationGroupName ) if ( mxContext.is() ) { - // get the break iterator - mxBreakIter = Reference< i18n::XBreakIterator >( - mxMSF->createInstance( C2U( "com.sun.star.i18n.BreakIterator" ) ), UNO_QUERY); - PrepareConfiguration( rConfigurationGroupName ); ReadConfiguration( true, true ); RegisterListener(); @@ -104,6 +97,14 @@ void SmartTagMgr::Init( const rtl::OUString& rConfigurationGroupName ) } } } +void SmartTagMgr::CreateBreakIterator() const +{ + if ( !mxBreakIter.is() && mxMSF.is() && mxContext.is() ) + { + // get the break iterator + mxBreakIter.set(mxMSF->createInstance( C2U( "com.sun.star.i18n.BreakIterator" ) ), UNO_QUERY); + } +} /** Dispatches the recognize call to all installed smart tag recognizers */ @@ -129,10 +130,13 @@ void SmartTagMgr::Recognize( const rtl::OUString& rText, } if ( bCallRecognizer ) + { + CreateBreakIterator(); maRecognizerList[i]->recognize( rText, nStart, nLen, smarttags::SmartTagRecognizerMode_PARAGRAPH, rLocale, xMarkup, maApplicationName, xController, mxBreakIter ); + } } } diff --git a/svx/source/stbctrls/stbctrls.src b/svx/source/stbctrls/stbctrls.src index 2d9b875d6c2a..74c7c78bc897 100644 --- a/svx/source/stbctrls/stbctrls.src +++ b/svx/source/stbctrls/stbctrls.src @@ -1,4 +1,4 @@ -/************************************************************************* +/************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -87,6 +87,11 @@ String RID_SVXSTR_XMLSEC_NO_SIG Text [ en-US ] = "Digital Signature: The document is not signed."; }; +String RID_SVXSTR_XMLSEC_SIG_CERT_OK_PARTIAL_SIG +{ + Text [ en-US ] = "Digital Signature: The document signature and the certificate are OK, but not all parts of the document are signed."; +}; + // PopupMenu ------------------------------------------------------------- Menu RID_SVXMNU_ZOOM { diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx index a994df0900a6..890cde02e428 100644 --- a/svx/source/stbctrls/xmlsecctrl.cxx +++ b/svx/source/stbctrls/xmlsecctrl.cxx @@ -143,6 +143,9 @@ void XmlSecStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, con nResId = RID_SVXSTR_XMLSEC_SIG_NOT_OK; else if ( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED ) nResId = RID_SVXSTR_XMLSEC_SIG_OK_NO_VERIFY; + else if ( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_PARTIAL_OK ) + nResId = RID_SVXSTR_XMLSEC_SIG_CERT_OK_PARTIAL_SIG; + GetStatusBar().SetQuickHelpText( GetId(), SVX_RESSTR( nResId ) ); } @@ -192,7 +195,8 @@ void XmlSecStatusBarControl::Paint( const UserDrawEvent& rUsrEvt ) ++aRect.Top(); pDev->DrawImage( aRect.TopLeft(), mpImpl->maImageBroken ); } - else if( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED ) + else if( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED + || mpImpl->mnState == SIGNATURESTATE_SIGNATURES_PARTIAL_OK) { ++aRect.Top(); pDev->DrawImage( aRect.TopLeft(), mpImpl->maImageNotValidated ); diff --git a/svx/source/svdraw/makefile.mk b/svx/source/svdraw/makefile.mk index 28eeb84e29d1..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 \ @@ -96,7 +96,6 @@ SLOFILES=\ $(SLO)$/svdglev.obj \ $(SLO)$/svdglue.obj \ $(SLO)$/svdhlpln.obj \ - $(SLO)$/svdibrow.obj \ $(SLO)$/svditer.obj \ $(SLO)$/svdlayer.obj \ $(SLO)$/svdmark.obj \ @@ -106,18 +105,29 @@ SLOFILES=\ $(SLO)$/sdrpagewindow.obj \ $(SLO)$/sdrpaintwindow.obj \ $(SLO)$/svdpoev.obj \ - $(SLO)$/svdscrol.obj \ $(SLO)$/svdtrans.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/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 341ce6dd90c0..6773b8edf6f5 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -831,7 +831,11 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/) if(pCircObj && OBJ_CIRC != pCircObj->GetObjIdentifier()) { - bUseSolidDragging = false; + // #i103058# Allow SolidDragging with four points + if(aDragStat.GetPointAnz() < 4) + { + bUseSolidDragging = false; + } } } diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index e427e42d80ab..eb6412b20259 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1135,11 +1135,20 @@ void SdrDragObjOwn::createSdrDragEntries() void SdrDragObjOwn::TakeSdrDragComment(XubString& rStr) const { - const SdrObject* pObj = GetDragObj(); - - if(pObj) + // #i103058# get info string from the clone preferred, the original will + // not be changed. For security, use original as fallback + if(mpClone) { - rStr = pObj->getSpecialDragComment(DragStat()); + rStr = mpClone->getSpecialDragComment(DragStat()); + } + else + { + const SdrObject* pObj = GetDragObj(); + + if(pObj) + { + rStr = pObj->getSpecialDragComment(DragStat()); + } } } diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 69459b1bff35..8236ca1f19ac 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -282,7 +282,11 @@ BOOL SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl // #103894# Expand test for HDL_ANCHOR_TR BOOL bNotDraggable = (HDL_ANCHOR == eDragHdl || HDL_ANCHOR_TR == eDragHdl); - if(bDragHdl) + if(pHdl && (pHdl->GetKind() == HDL_SMARTTAG) && pForcedMeth ) + { + // just use the forced method for smart tags + } + else if(bDragHdl) { mpCurrentSdrDragMethod = new SdrDragMovHdl(*this); } diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index 8b893788363a..b95c13864776 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -937,7 +937,12 @@ void SdrEditView::ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrO const bool bUndo = IsUndoEnabled(); if( bUndo ) AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoReplaceObject(*pOldObj,*pNewObj)); + + if( IsObjMarked( pOldObj ) ) + MarkObj( pOldObj, &rPV, TRUE /*unmark!*/ ); + pOL->ReplaceObject(pNewObj,pOldObj->GetOrdNum()); + if( !bUndo ) SdrObject::Free( pOldObj ); diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index bd6bf457bdbf..6f4ee781dc37 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -82,14 +82,17 @@ using namespace ::com::sun::star; ******************************************************************************/ SdrGlobalData::SdrGlobalData() : + pSysLocale(NULL), + pCharClass(NULL), + pLocaleData(NULL), pOutliner(NULL), pDefaults(NULL), pResMgr(NULL), nExchangeFormat(0) { - pSysLocale = new SvtSysLocale; - pCharClass = pSysLocale->GetCharClassPtr(); - pLocaleData = pSysLocale->GetLocaleDataPtr(); + //pSysLocale = new SvtSysLocale; + //pCharClass = pSysLocale->GetCharClassPtr(); + //pLocaleData = pSysLocale->GetLocaleDataPtr(); svx::ExtrusionBar::RegisterInterface(); svx::FontworkBar::RegisterInterface(); @@ -103,7 +106,24 @@ SdrGlobalData::~SdrGlobalData() //! do NOT delete pCharClass and pLocaleData delete pSysLocale; } - +const SvtSysLocale* SdrGlobalData::GetSysLocale() +{ + if ( !pSysLocale ) + pSysLocale = new SvtSysLocale; + return pSysLocale; +} +const CharClass* SdrGlobalData::GetCharClass() +{ + if ( !pCharClass ) + pCharClass = GetSysLocale()->GetCharClassPtr(); + return pCharClass; +} +const LocaleDataWrapper* SdrGlobalData::GetLocaleData() +{ + if ( !pLocaleData ) + pLocaleData = GetSysLocale()->GetLocaleDataPtr(); + return pLocaleData; +} //////////////////////////////////////////////////////////////////////////////////////////////////// OLEObjCache::OLEObjCache() 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/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx index e12ed76d52ce..af38c34e0749 100644 --- a/svx/source/svdraw/svdfppt.cxx +++ b/svx/source/svdraw/svdfppt.cxx @@ -39,6 +39,11 @@ #include <sot/storinfo.hxx> #include <sot/stg.hxx> #include <com/sun/star/embed/Aspects.hpp> +#include <com/sun/star/office/XAnnotation.hpp> +#include <com/sun/star/office/XAnnotationAccess.hpp> +#include <com/sun/star/text/XText.hpp> +#include <com/sun/star/geometry/RealPoint2D.hpp> +#include <com/sun/star/util/DateTime.hpp> #include <unotools/streamwrap.hxx> @@ -120,6 +125,7 @@ #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/awt/Point.hpp> #include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <svx/writingmodeitem.hxx> #include <vcl/print.hxx> #include <svx/svxfont.hxx> @@ -2562,9 +2568,11 @@ sal_Bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStre sal_uInt32 nOldPos = rSt.Tell(); DffRecordHeader aProgTagsHd, aProgTagBinaryDataHd; - rSourceHd.SeekToContent( rSt ); - if ( SeekToRec( rSt, PPT_PST_ProgTags, rSourceHd.GetRecEndFilePos(), &aProgTagsHd ) ) + sal_Bool bFound = rSourceHd.nRecType == PPT_PST_ProgTags; + if ( !bFound ) + bFound = SeekToRec( rSt, PPT_PST_ProgTags, rSourceHd.GetRecEndFilePos(), &aProgTagsHd ); + if ( bFound ) { while( SeekToRec( rSt, PPT_PST_ProgBinaryTag, aProgTagsHd.GetRecEndFilePos(), &aProgTagBinaryDataHd ) ) { @@ -2859,6 +2867,75 @@ SdrPage* SdrPowerPointImport::MakeBlancPage( sal_Bool bMaster ) const return pRet; } +void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage, DffRecordHeader& rComment10Hd ) +{ + rtl::OUString sAuthor; + rtl::OUString sText; + rtl::OUString sInitials; + + sal_Int32 nIndex = 0; + util::DateTime aDateTime; + sal_Int32 nPosX = 0; + sal_Int32 nPosY = 0; + + while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < rComment10Hd.GetRecEndFilePos() ) ) + { + DffRecordHeader aCommentHd; + rStCtrl >> aCommentHd; + switch( aCommentHd.nRecType ) + { + case PPT_PST_CString : + { + String aString; + SvxMSDffManager::MSDFFReadZString( rStCtrl, aString, aCommentHd.nRecLen, TRUE ); + switch ( aCommentHd.nRecInstance ) + { + case 0 : sAuthor = aString; break; + case 1 : sText = aString; break; + case 2 : sInitials = aString; break; + } + } + break; + + case PPT_PST_CommentAtom10 : + { + rStCtrl >> nIndex + >> aDateTime.Year + >> aDateTime.Month + >> aDateTime.Day // DayOfWeek + >> aDateTime.Day + >> aDateTime.Hours + >> aDateTime.Minutes + >> aDateTime.Seconds + >> aDateTime.HundredthSeconds + >> nPosX + >> nPosY; + + aDateTime.HundredthSeconds /= 10; + } + break; + } + aCommentHd.SeekToEndOfRecord( rStCtrl ); + } + Point aPosition( nPosX, nPosY ); + rMan.Scale( aPosition ); + + try + { + uno::Reference< office::XAnnotationAccess > xAnnotationAccess( pPage->getUnoPage(), UNO_QUERY_THROW ); + uno::Reference< office::XAnnotation > xAnnotation( xAnnotationAccess->createAndInsertAnnotation() ); + xAnnotation->setPosition( geometry::RealPoint2D( aPosition.X() / 100.0, aPosition.Y() / 100.0 ) ); + xAnnotation->setAuthor( sAuthor ); + xAnnotation->setDateTime( aDateTime ); + uno::Reference< text::XText > xText( xAnnotation->getTextRange() ); + xText->setString( sText ); + } + catch( uno::Exception& ) + { + + } +} + // be sure not to import masterpages with this method // be sure not to import masterpages with this method @@ -2895,6 +2972,21 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* } break; + case PPT_PST_ProgTags : + { + DffRecordHeader aContentDataHd; + if ( SeekToContentOfProgTag( 10, rStCtrl, aHd, aContentDataHd ) ) + { + DffRecordHeader aComment10Hd; + while( ( rStCtrl.GetError() == 0 ) && SeekToRec( rStCtrl, PPT_PST_Comment10, aContentDataHd.GetRecEndFilePos(), &aComment10Hd ) ) + { + ImportComment10( *this, rStCtrl, pRet, aComment10Hd ); + aComment10Hd.SeekToEndOfRecord( rStCtrl ); + } + } + } + break; + case PPT_PST_PPDrawing : { DffRecordHeader aPPDrawHd; @@ -3819,21 +3911,20 @@ BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletOfs, nBulletOfs, nDestinationInstance ); if ( nIsBullet ) - { rNumberFormat.SetNumberingType( SVX_NUM_CHAR_SPECIAL ); - UINT32 nFontHeight = 24; - PPTPortionObj* pPtr = pParaObj->First(); - if ( pPtr ) - pPtr->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance ); + UINT32 nFontHeight = 24; + PPTPortionObj* pPtr = pParaObj->First(); + if ( pPtr ) + pPtr->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance ); + if ( nIsBullet ) nHardCount += ImplGetExtNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth, pParaObj->mnInstance, nDestinationInstance, rStartNumbering, nFontHeight, pParaObj ); - if ( rNumberFormat.GetNumberingType() != SVX_NUM_BITMAP ) - pParaObj->UpdateBulletRelSize( nBulletHeight ); - if ( nHardCount ) - ImplGetNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth ); - } + if ( rNumberFormat.GetNumberingType() != SVX_NUM_BITMAP ) + pParaObj->UpdateBulletRelSize( nBulletHeight ); + if ( nHardCount ) + ImplGetNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth ); if ( nHardCount ) { @@ -3847,7 +3938,6 @@ BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx case SVX_NUM_CHARS_UPPER_LETTER_N : case SVX_NUM_CHARS_LOWER_LETTER_N : { - PPTPortionObj* pPtr = pParaObj->First(); if ( pPtr ) { sal_uInt32 nFont; @@ -3882,7 +3972,7 @@ void PPTNumberFormatCreator::ImplGetNumberFormat( SdrPowerPointImport& rManager, aFont.SetFamily( pAtom->eFamily ); aFont.SetPitch( pAtom->ePitch ); } - Color aCol( rManager.MSO_CLR_ToColor( nBulletColor ) ); + Color aCol( rManager.MSO_TEXT_CLR_ToColor( nBulletColor ) ); aFont.SetColor( aCol ); sal_uInt16 nBuChar = (sal_uInt16)nBulletChar; @@ -5566,11 +5656,6 @@ BOOL PPTPortionObj::GetAttrib( UINT32 nAttr, UINT32& nRetValue, UINT32 nDestinat if ( nRetValue != nTmp ) bIsHardAttribute = 1; } - if ( nRetValue && ( nDestinationInstance == TSS_TYPE_TEXT_IN_SHAPE ) ) - { - nRetValue = 0; // no inheritance for standard textobjects - bIsHardAttribute = 1; // this attribute must be hard formatted - } } break; case PPT_CharAttr_Font : @@ -5801,14 +5886,14 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, U { if ( GetAttrib( PPT_CharAttr_FontColor, nVal, nDestinationInstance ) ) // Textfarbe (4Byte-Arg) { - Color aCol( rManager.MSO_CLR_ToColor( nVal ) ); + Color aCol( rManager.MSO_TEXT_CLR_ToColor( nVal ) ); rSet.Put( SvxColorItem( aCol, EE_CHAR_COLOR ) ); if ( nDestinationInstance == 0xffffffff ) mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ mnDepth ].mnFontColorInStyleSheet = aCol; } else if ( nVal & 0x0f000000 ) // this is not a hard attribute, but maybe the page has a different colerscheme, { // so that in this case we must use a hard color attribute - Color aCol( rManager.MSO_CLR_ToColor( nVal ) ); + Color aCol( rManager.MSO_TEXT_CLR_ToColor( nVal ) ); Color& aColorInSheet = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ mnDepth ].mnFontColorInStyleSheet; if ( aColorInSheet != aCol ) rSet.Put( SvxColorItem( aCol, EE_CHAR_COLOR ) ); @@ -6215,10 +6300,10 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& if ( pRule ) { pRule->SetLevel( pParaSet->mnDepth, aNumberFormat ); - if ( nDestinationInstance == 0xffffffff ) + sal_uInt16 i, n; + for ( i = 0; i < pRule->GetLevelCount(); i++ ) { - sal_uInt16 i, n; - for ( i = 0; i < pRule->GetLevelCount(); i++ ) + if ( i != pParaSet->mnDepth ) { n = i > 4 ? 4 : i; @@ -6230,7 +6315,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& nColor = rParaLevel.mnBulletColor; else nColor = rCharLevel.mnFontColor; - aNumberFormat2.SetBulletColor( rManager.MSO_CLR_ToColor( nColor ) ); + aNumberFormat2.SetBulletColor( rManager.MSO_TEXT_CLR_ToColor( nColor ) ); pRule->SetLevel( i, aNumberFormat2 ); } } @@ -7429,6 +7514,15 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell ) xPropSet->setPropertyValue( sLeftBorder, Any( nLeftDist ) ); xPropSet->setPropertyValue( sBottomBorder, Any( nLowerDist ) ); + static const rtl::OUString sTextVerticalAdjust( RTL_CONSTASCII_USTRINGPARAM( "TextVerticalAdjust" ) ); + const SdrTextVertAdjust eTextVertAdjust(((const SdrTextVertAdjustItem&)pObj->GetMergedItem(SDRATTR_TEXT_VERTADJUST)).GetValue()); + drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP ); + if ( eTextVertAdjust == SDRTEXTVERTADJUST_CENTER ) + eVA = drawing::TextVerticalAdjust_CENTER; + else if ( eTextVertAdjust == SDRTEXTVERTADJUST_BOTTOM ) + eVA = drawing::TextVerticalAdjust_BOTTOM; + xPropSet->setPropertyValue( sTextVerticalAdjust, Any( eVA ) ); + SfxItemSet aSet( pObj->GetMergedItemSet() ); XFillStyle eFillStyle(((XFillStyleItem&)pObj->GetMergedItem( XATTR_FILLSTYLE )).GetValue()); ::com::sun::star::drawing::FillStyle eFS( com::sun::star::drawing::FillStyle_NONE ); @@ -7517,8 +7611,8 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl { Color aLineColor( ((XLineColorItem&)pLine->GetMergedItem( XATTR_LINECOLOR )).GetColorValue() ); aBorderLine.Color = aLineColor.GetColor(); - aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() ); - aBorderLine.InnerLineWidth = 0; + aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4 ); + aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4 ); aBorderLine.LineDistance = 0; } break; @@ -7601,6 +7695,11 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab CreateTableRows( xColumnRowRange->getRows(), aRows, pGroup->GetSnapRect().Bottom() ); CreateTableColumns( xColumnRowRange->getColumns(), aColumns, pGroup->GetSnapRect().Right() ); + sal_Int32 nCellCount = aRows.size() * aColumns.size(); + sal_Int32 *pMergedCellIndexTable = new sal_Int32[ nCellCount ]; + for ( sal_Int32 i = 0; i < nCellCount; i++ ) + pMergedCellIndexTable[ i ] = i; + aGroupIter.Reset(); while( aGroupIter.IsMore() ) { @@ -7621,7 +7720,16 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab ApplyCellAttributes( pObj, xCell ); if ( ( nRowCount > 1 ) || ( nColumnCount > 1 ) ) // cell merging + { MergeCells( xTable, nColumn, nRow, nColumnCount, nRowCount ); + for ( sal_Int32 nRowIter = 0; nRowIter < nRowCount; nRowIter++ ) + { + for ( sal_Int32 nColumnIter = 0; nColumnIter < nColumnCount; nColumnIter++ ) + { // now set the correct index for the merged cell + pMergedCellIndexTable[ ( ( nRow + nRowIter ) * aColumns.size() ) + nColumn + nColumnIter ] = nTableIndex; + } + } + } // applying text OutlinerParaObject* pParaObject = pObj->GetOutlinerParaObject(); @@ -7633,13 +7741,30 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab } } } - else + } + aGroupIter.Reset(); + while( aGroupIter.IsMore() ) + { + SdrObject* pObj( aGroupIter.Next() ); + if ( IsLine( pObj ) ) { std::vector< sal_Int32 > vPositions; // containing cell indexes + cell position GetLinePositions( pObj, aRows, aColumns, vPositions, pGroup->GetSnapRect() ); + + // correcting merged cell position + std::vector< sal_Int32 >::iterator aIter( vPositions.begin() ); + while( aIter != vPositions.end() ) + { + sal_Int32 nOldPosition = *aIter & 0xffff; + sal_Int32 nOldFlags = *aIter & 0xffff0000; + sal_Int32 nNewPosition = pMergedCellIndexTable[ nOldPosition ] | nOldFlags; + *aIter++ = nNewPosition; + } ApplyCellLineAttributes( pObj, xTable, vPositions, aColumns.size() ); } } + delete[] pMergedCellIndexTable; + // we are replacing the whole group object by a single table object, so // possibly connections to the group object have to be removed. if ( pSolverContainer ) diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 727e7f0bafcc..936c073f6e84 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -68,6 +68,7 @@ #include <sdrpaintwindow.hxx> #include <vcl/svapp.hxx> #include <svx/sdr/overlay/overlaypolypolygon.hxx> +#include <vcl/lazydelete.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// // #i15222# @@ -275,9 +276,23 @@ const BitmapEx& SdrHdlBitmapSet::GetBitmapEx(BitmapMarkerKind eKindOfMarker, UIN //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrHdlBitmapSet* SdrHdl::pSimpleSet = NULL; -SdrHdlBitmapSet* SdrHdl::pModernSet = NULL; -SdrHdlBitmapSet* SdrHdl::pHighContrastSet = NULL; +SdrHdlBitmapSet& getSimpleSet() +{ + static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aSimpleSet(new SdrHdlBitmapSet(SIP_SA_MARKERS)); + return *aSimpleSet.get(); +} + +SdrHdlBitmapSet& getModernSet() +{ + static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_MARKERS)); + return *aModernSet.get(); +} + +SdrHdlBitmapSet& getHighContrastSet() +{ + static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_MARKERS)); + return *aHighContrastSet.get(); +} //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -296,18 +311,6 @@ SdrHdl::SdrHdl(): bPlusHdl(FALSE), mbMoveOutside(false) { - if(!pSimpleSet) - pSimpleSet = new SdrHdlBitmapSet(SIP_SA_MARKERS); - DBG_ASSERT(pSimpleSet, "Could not construct SdrHdlBitmapSet()!"); - - if(!pModernSet) - pModernSet = new SdrHdlBitmapSet(SIP_SA_FINE_MARKERS); - DBG_ASSERT(pModernSet, "Could not construct SdrHdlBitmapSet()!"); - - // #101928# - if(!pHighContrastSet) - pHighContrastSet = new SdrHdlBitmapSet(SIP_SA_ACCESSIBILITY_MARKERS); - DBG_ASSERT(pHighContrastSet, "Could not construct SdrHdlBitmapSet()!"); } SdrHdl::SdrHdl(const Point& rPnt, SdrHdlKind eNewKind): @@ -326,18 +329,6 @@ SdrHdl::SdrHdl(const Point& rPnt, SdrHdlKind eNewKind): bPlusHdl(FALSE), mbMoveOutside(false) { - if(!pSimpleSet) - pSimpleSet = new SdrHdlBitmapSet(SIP_SA_MARKERS); - DBG_ASSERT(pSimpleSet, "Could not construct SdrHdlBitmapSet()!"); - - if(!pModernSet) - pModernSet = new SdrHdlBitmapSet(SIP_SA_FINE_MARKERS); - DBG_ASSERT(pModernSet, "Could not construct SdrHdlBitmapSet()!"); - - // #101928# - if(!pHighContrastSet) - pHighContrastSet = new SdrHdlBitmapSet(SIP_SA_ACCESSIBILITY_MARKERS); - DBG_ASSERT(pHighContrastSet, "Could not construct SdrHdlBitmapSet()!"); } SdrHdl::~SdrHdl() @@ -670,17 +661,17 @@ BitmapEx SdrHdl::ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, { if(bIsHighContrast) { - return pHighContrastSet->GetBitmapEx(eKindOfMarker, nInd); + return getHighContrastSet().GetBitmapEx(eKindOfMarker, nInd); } else { if(bFine) { - return pModernSet->GetBitmapEx(eKindOfMarker, nInd); + return getModernSet().GetBitmapEx(eKindOfMarker, nInd); } else { - return pSimpleSet->GetBitmapEx(eKindOfMarker, nInd); + return getSimpleSet().GetBitmapEx(eKindOfMarker, nInd); } } } 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 7273bb49889a..f80b14503914 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -208,6 +208,12 @@ void __EXPORT SdrMarkView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) bMarkedObjRectDirty=TRUE; bMarkedPointsRectsDirty=TRUE; } +/* removed for now since this breaks existing code who iterates over the mark list and sequentially replaces objects + if( eKind==HINT_OBJREMOVED && IsObjMarked( const_cast<SdrObject*>(pSdrHint->GetObject()) ) )
+ {
+ MarkObj( const_cast<SdrObject*>(pSdrHint->GetObject()), GetSdrPageView(), TRUE );
+ } +*/ } SdrSnapView::Notify(rBC,rHint); } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index e272a51a4a7a..7ba4aec3e565 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -129,6 +129,10 @@ #include "svx/shapepropertynotifier.hxx" #include <svx/sdrhittesthelper.hxx> +// --> OD 2009-07-10 #i73249# +#include <svx/svdundo.hxx> +// <-- + using namespace ::com::sun::star; // #104018# replace macros above with type-detecting methods @@ -759,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(); } @@ -784,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(); } @@ -809,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(); } @@ -2863,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 7d41191c99a9..102b5b1eb824 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -401,26 +401,35 @@ bool SdrCaptionObj::applySpecialDrag(SdrDragStat& rDrag) String SdrCaptionObj::getSpecialDragComment(const SdrDragStat& rDrag) const { - const SdrHdl* pHdl = rDrag.GetHdl(); + const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj()); - if(pHdl && 0 == pHdl->GetPolyNum()) + if(bCreateComment) { - return SdrRectObj::getSpecialDragComment(rDrag); + return String(); } else { - XubString aStr; + const SdrHdl* pHdl = rDrag.GetHdl(); - if(!pHdl) + if(pHdl && 0 == pHdl->GetPolyNum()) { - ImpTakeDescriptionStr(STR_DragCaptFram, aStr); + return SdrRectObj::getSpecialDragComment(rDrag); } else { - ImpTakeDescriptionStr(STR_DragCaptTail, aStr); - } + XubString aStr; + + if(!pHdl) + { + ImpTakeDescriptionStr(STR_DragCaptFram, aStr); + } + else + { + ImpTakeDescriptionStr(STR_DragCaptTail, aStr); + } - return aStr; + return aStr; + } } } diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 6af31224ee45..b3175566d561 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -589,23 +589,56 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag) String SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const { - const bool bWink(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj()); - if(bWink) + if(bCreateComment) { XubString aStr; - const sal_Int32 nWink(1 == rDrag.GetHdl()->GetPointNum() ? nStartWink : nEndWink); + ImpTakeDescriptionStr(STR_ViewCreateObj, aStr); + const sal_uInt32 nPntAnz(rDrag.GetPointAnz()); + + if(OBJ_CIRC != meCircleKind && nPntAnz > 2) + { + ImpCircUser* pU = (ImpCircUser*)rDrag.GetUser(); + sal_Int32 nWink; + + aStr.AppendAscii(" ("); + + if(3 == nPntAnz) + { + nWink = pU->nStart; + } + else + { + nWink = pU->nEnd; + } - ImpTakeDescriptionStr(STR_DragCircAngle, aStr); - aStr.AppendAscii(" ("); - aStr += GetWinkStr(nWink,FALSE); - aStr += sal_Unicode(')'); + aStr += GetWinkStr(nWink,FALSE); + aStr += sal_Unicode(')'); + } return aStr; } else { - return SdrTextObj::getSpecialDragComment(rDrag); + const bool bWink(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + + if(bWink) + { + XubString aStr; + const sal_Int32 nWink(1 == rDrag.GetHdl()->GetPointNum() ? nStartWink : nEndWink); + + ImpTakeDescriptionStr(STR_DragCircAngle, aStr); + aStr.AppendAscii(" ("); + aStr += GetWinkStr(nWink,FALSE); + aStr += sal_Unicode(')'); + + return aStr; + } + else + { + return SdrTextObj::getSpecialDragComment(rDrag); + } } } @@ -698,6 +731,14 @@ FASTBOOL SdrCircObj::MovCreate(SdrDragStat& rStat) SetBoundRectDirty(); bSnapRectDirty=TRUE; SetXPolyDirty(); + + // #i103058# push current angle settings to ItemSet to + // allow FullDrag visualisation + if(rStat.GetPointAnz() >= 4) + { + ImpSetCircInfoToAttr(); + } + return TRUE; } diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index abadbf094981..e55eeaae42b7 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -1920,11 +1920,21 @@ bool SdrEdgeObj::applySpecialDrag(SdrDragStat& rDragStat) return true; } -String SdrEdgeObj::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const +String SdrEdgeObj::getSpecialDragComment(const SdrDragStat& rDrag) const { - XubString aStr; - ImpTakeDescriptionStr(STR_DragEdgeTail,aStr); - return aStr; + const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj()); + + if(bCreateComment) + { + return String(); + } + else + { + XubString aStr; + ImpTakeDescriptionStr(STR_DragEdgeTail, aStr); + + return aStr; + } } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 01ef392e941a..a2b6991773e1 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -1867,6 +1867,14 @@ void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect) SdrRectObj::NbcSetSnapRect(rRect); if( pModel && !pModel->isLocked() ) ImpSetVisAreaSize(); + + if ( xObjRef.is() && IsChart() ) + { + //#i103460# charts do not necessaryly have an own size within ODF files, + //for this case they need to use the size settings from the surrounding frame, + //which is made available with this method as there is no other way + xObjRef.SetDefaultSizeForChart( Size( rRect.GetWidth(), rRect.GetHeight() ) ); + } } // ----------------------------------------------------------------------------- @@ -2208,14 +2216,7 @@ sal_Bool SdrOle2Obj::AddOwnLightClient() ////////////////////////////////////////////////////////////////////////////// -bool SdrOle2Obj::executeOldDoPaintPreparations(SdrPageView* /*pPageVew*/) const -{ - //#i101925# moved this stuff to method ViewObjectContactOfSdrOle2Obj::createPrimitive2DSequence and reorganized it further to avoid superfluous metafile creation for charts - //this method can be removed with the next incompatible build - return false; -} - -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 1e9c9b57c52d..f44efe3c5dfa 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -951,32 +951,86 @@ bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat& rDrag) String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag) const { - ImpSdrPathDragData* pDragData = mpSdrPathDragData; + XubString aStr; + const SdrHdl* pHdl = rDrag.GetHdl(); + const bool bCreateComment(rDrag.GetView() && &mrSdrPathObject == rDrag.GetView()->GetCreateObj()); - if(!pDragData) + if(bCreateComment && rDrag.GetUser()) { - // getSpecialDragComment is also used from create, so fallback to GetUser() - // when mpSdrPathDragData is not set - pDragData = (ImpSdrPathDragData*)rDrag.GetUser(); - } + // #i103058# re-add old creation comment mode + ImpPathCreateUser* pU = (ImpPathCreateUser*)rDrag.GetUser(); + const SdrObjKind eKindMerk(meObjectKind); + mrSdrPathObject.meKind = pU->eAktKind; + mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewCreateObj, aStr); + mrSdrPathObject.meKind = eKindMerk; - if(!pDragData) - { - DBG_ERROR("ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData ist ungueltig"); - return String(); - } + Point aPrev(rDrag.GetPrev()); + Point aNow(rDrag.GetNow()); - // Hier auch mal pDragData verwenden !!! - XubString aStr; + if(pU->bLine) + aNow = pU->aLineEnd; - const SdrHdl* pHdl = rDrag.GetHdl(); + aNow -= aPrev; + aStr.AppendAscii(" ("); - if(!mrSdrPathObject.GetModel() || !pHdl) + XubString aMetr; + + if(pU->bCircle) + { + mrSdrPathObject.GetModel()->TakeWinkStr(Abs(pU->nCircRelWink), aMetr); + aStr += aMetr; + aStr.AppendAscii(" r="); + mrSdrPathObject.GetModel()->TakeMetricStr(pU->nCircRadius, aMetr, TRUE); + aStr += aMetr; + } + + aStr.AppendAscii("dx="); + mrSdrPathObject.GetModel()->TakeMetricStr(aNow.X(), aMetr, TRUE); + aStr += aMetr; + + aStr.AppendAscii(" dy="); + mrSdrPathObject.GetModel()->TakeMetricStr(aNow.Y(), aMetr, TRUE); + aStr += aMetr; + + if(!IsFreeHand(meObjectKind)) + { + INT32 nLen(GetLen(aNow)); + aStr.AppendAscii(" l="); + mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, TRUE); + aStr += aMetr; + + INT32 nWink(GetAngle(aNow)); + aStr += sal_Unicode(' '); + mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr); + aStr += aMetr; + } + + aStr += sal_Unicode(')'); + } + else if(!mrSdrPathObject.GetModel() || !pHdl) { + // #i103058# fallback when no model and/or Handle, both needed + // for else-path mrSdrPathObject.ImpTakeDescriptionStr(STR_DragPathObj, aStr); } else { + // #i103058# standard for modification; model and handle needed + ImpSdrPathDragData* pDragData = mpSdrPathDragData; + + if(!pDragData) + { + // getSpecialDragComment is also used from create, so fallback to GetUser() + // when mpSdrPathDragData is not set + pDragData = (ImpSdrPathDragData*)rDrag.GetUser(); + } + + if(!pDragData) + { + DBG_ERROR("ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData ist ungueltig"); + return String(); + } + if(!pDragData->IsMultiPointDrag() && pDragData->bEliminate) { // Punkt von ... @@ -2150,12 +2204,26 @@ bool SdrPathObj::applySpecialDrag(SdrDragStat& rDrag) String SdrPathObj::getSpecialDragComment(const SdrDragStat& rDrag) const { String aRetval; - ImpPathForDragAndCreate aDragAndCreate(*((SdrPathObj*)this)); - bool bDidWork(aDragAndCreate.beginPathDrag((SdrDragStat&)rDrag)); - if(bDidWork) + if(mpDAC) { - aRetval = aDragAndCreate.getSpecialDragComment(rDrag); + // #i103058# also get a comment when in creation + const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj()); + + if(bCreateComment) + { + aRetval = mpDAC->getSpecialDragComment(rDrag); + } + } + else + { + ImpPathForDragAndCreate aDragAndCreate(*((SdrPathObj*)this)); + bool bDidWork(aDragAndCreate.beginPathDrag((SdrDragStat&)rDrag)); + + if(bDidWork) + { + aRetval = aDragAndCreate.getSpecialDragComment(rDrag); + } } return aRetval; diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index 837b75bcf849..7d69955ec441 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -419,33 +419,42 @@ bool SdrRectObj::applySpecialDrag(SdrDragStat& rDrag) String SdrRectObj::getSpecialDragComment(const SdrDragStat& rDrag) const { - const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj()); - if(bRad) + if(bCreateComment) { - Point aPt(rDrag.GetNow()); + return String(); + } + else + { + const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); - // -sin fuer Umkehrung - if(aGeo.nDrehWink) - RotatePoint(aPt, aRect.TopLeft(), -aGeo.nSin, aGeo.nCos); + if(bRad) + { + Point aPt(rDrag.GetNow()); - sal_Int32 nRad(aPt.X() - aRect.Left()); + // -sin fuer Umkehrung + if(aGeo.nDrehWink) + RotatePoint(aPt, aRect.TopLeft(), -aGeo.nSin, aGeo.nCos); - if(nRad < 0) - nRad = 0; + sal_Int32 nRad(aPt.X() - aRect.Left()); - XubString aStr; + if(nRad < 0) + nRad = 0; - ImpTakeDescriptionStr(STR_DragRectEckRad, aStr); - aStr.AppendAscii(" ("); - aStr += GetMetrStr(nRad); - aStr += sal_Unicode(')'); + XubString aStr; - return aStr; - } - else - { - return SdrTextObj::getSpecialDragComment(rDrag); + ImpTakeDescriptionStr(STR_DragRectEckRad, aStr); + aStr.AppendAscii(" ("); + aStr += GetMetrStr(nRad); + aStr += sal_Unicode(')'); + + return aStr; + } + else + { + return SdrTextObj::getSpecialDragComment(rDrag); + } } } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 76c29de8d480..e72b606f3b53 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -119,6 +119,12 @@ namespace // the visible area for contour text decomposition basegfx::B2DVector maScale; + // #SJ# ClipRange for BlockText decomposition; only text portions completely
+ // inside are to be accepted, so this is different from geometric clipping
+ // (which would allow e.g. upper parts of portions to remain). Only used for
+ // BlockText (see there)
+ basegfx::B2DRange maClipRange; + DECL_LINK(decomposeContourTextPrimitive, DrawPortionInfo* ); DECL_LINK(decomposeBlockTextPrimitive, DrawPortionInfo* ); DECL_LINK(decomposeStretchTextPrimitive, DrawPortionInfo* ); @@ -137,7 +143,14 @@ namespace public: impTextBreakupHandler(SdrOutliner& rOutliner) - : mrOutliner(rOutliner) + : maTextPortionPrimitives(), + maLinePrimitives(),
+ maParagraphPrimitives(),
+ mrOutliner(rOutliner),
+ maNewTransformA(),
+ maNewTransformB(),
+ maScale(),
+ maClipRange() { } @@ -153,10 +166,14 @@ namespace mrOutliner.SetDrawBulletHdl(Link()); } - void decomposeBlockTextPrimitive(const basegfx::B2DHomMatrix& rNewTransformA, const basegfx::B2DHomMatrix& rNewTransformB) + void decomposeBlockTextPrimitive( + const basegfx::B2DHomMatrix& rNewTransformA, + const basegfx::B2DHomMatrix& rNewTransformB, + const basegfx::B2DRange& rClipRange) { maNewTransformA = rNewTransformA; maNewTransformB = rNewTransformB; + maClipRange = rClipRange; mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decomposeBlockTextPrimitive)); mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeBlockBulletPrimitive)); mrOutliner.StripPortions(); @@ -198,30 +215,23 @@ namespace { if(rInfo.mrText.Len() && rInfo.mnTextLen) { - basegfx::B2DVector aSize; - drawinglayer::primitive2d::FontAttributes aFontAttributes(drawinglayer::primitive2d::getFontAttributesFromVclFont( - aSize, - rInfo.mrFont, - rInfo.IsRTL(), - false)); + basegfx::B2DVector aFontScaling; + drawinglayer::primitive2d::FontAttributes aFontAttributes( + drawinglayer::primitive2d::getFontAttributesFromVclFont( + aFontScaling, + rInfo.mrFont, + rInfo.IsRTL(), + false)); basegfx::B2DHomMatrix aNewTransform; - // #i100489# need extra scale factor for DXArray which collects all scalings - // which are needed to get the DXArray to unit coordinates - double fDXArrayScaleFactor(aSize.getX()); - // add font scale to new transform - aNewTransform.scale(aSize.getX(), aSize.getY()); + aNewTransform.scale(aFontScaling.getX(), aFontScaling.getY()); // look for proportional font scaling, evtl scale accordingly if(100 != rInfo.mrFont.GetPropr()) { const double fFactor(rInfo.mrFont.GetPropr() / 100.0); aNewTransform.scale(fFactor, fFactor); - - // #i100489# proportional font scaling influences the DXArray, - // add to factor - fDXArrayScaleFactor *= fFactor; } // apply font rotate @@ -254,7 +264,7 @@ namespace } const double fEscapement(nEsc / -100.0); - aNewTransform.translate(0.0, fEscapement * aSize.getY()); + aNewTransform.translate(0.0, fEscapement * aFontScaling.getY()); } // apply transformA @@ -273,13 +283,11 @@ namespace if(!bDisableTextArray && rInfo.mpDXArray && rInfo.mnTextLen) { - // #i100489# use fDXArrayScaleFactor here - const double fScaleFactor(basegfx::fTools::equalZero(fDXArrayScaleFactor) ? 1.0 : 1.0 / fDXArrayScaleFactor); aDXArray.reserve(rInfo.mnTextLen); for(xub_StrLen a(0); a < rInfo.mnTextLen; a++) { - aDXArray.push_back((double)rInfo.mpDXArray[a] * fScaleFactor); + aDXArray.push_back((double)rInfo.mpDXArray[a]); } } @@ -455,6 +463,17 @@ namespace fEnd = fTextWidth - fEnd; } + // need to take FontScaling out of values; it's already part of + // aNewTransform and would be double applied + const double fFontScaleX(aFontScaling.getX()); + + if(!basegfx::fTools::equal(fFontScaleX, 1.0) + && !basegfx::fTools::equalZero(fFontScaleX)) + { + fStart /= fFontScaleX; + fEnd /= fFontScaleX; + } + maTextPortionPrimitives.push_back(new drawinglayer::primitive2d::WrongSpellPrimitive2D( aNewTransform, fStart, @@ -588,6 +607,43 @@ namespace { if(pInfo) { + // #SJ# Is clipping wanted? This is text clipping; only accept a portion
+ // if it's completely in the range
+ if(!maClipRange.isEmpty())
+ {
+ // Test start position first; this allows to not get the text range at
+ // all if text is far outside
+ const basegfx::B2DPoint aStartPosition(pInfo->mrStartPos.X(), pInfo->mrStartPos.Y());
+
+ if(!maClipRange.isInside(aStartPosition))
+ {
+ return 0;
+ }
+
+ // Start position is inside. Get TextBoundRect and TopLeft next
+ drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ aTextLayouterDevice.setFont(pInfo->mrFont);
+
+ const basegfx::B2DRange aTextBoundRect(
+ aTextLayouterDevice.getTextBoundRect(
+ pInfo->mrText, pInfo->mnTextStart, pInfo->mnTextLen));
+ const basegfx::B2DPoint aTopLeft(aTextBoundRect.getMinimum() + aStartPosition);
+
+ if(!maClipRange.isInside(aTopLeft))
+ {
+ return 0;
+ }
+
+ // TopLeft is inside. Get BottomRight and check
+ const basegfx::B2DPoint aBottomRight(aTextBoundRect.getMaximum() + aStartPosition);
+
+ if(!maClipRange.isInside(aBottomRight))
+ {
+ return 0;
+ }
+
+ // all inside, clip was successful
+ }
impHandleDrawPortionInfo(*pInfo); } @@ -655,16 +711,7 @@ namespace ////////////////////////////////////////////////////////////////////////////// // primitive decompositions -bool SdrTextObj::impCheckSpellCheckForDecomposeTextPrimitive() const -{ - // #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( +void SdrTextObj::impDecomposeContourTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const @@ -716,10 +763,9 @@ bool SdrTextObj::impDecomposeContourTextPrimitive( rOutliner.setVisualizedPage(0); rTarget = aConverter.getPrimitive2DSequence(); - return false; } -bool SdrTextObj::impDecomposeBlockTextPrimitive( +void SdrTextObj::impDecomposeBlockTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const @@ -735,19 +781,15 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive( // prepare outliner const bool bIsCell(rSdrBlockTextPrimitive.getCellText()); - const SfxItemSet& rTextItemSet = rSdrBlockTextPrimitive.getSdrText() - ? rSdrBlockTextPrimitive.getSdrText()->GetItemSet() - : GetObjectItemSet(); SdrOutliner& rOutliner = ImpGetDrawOutliner(); - SdrTextVertAdjust eVAdj = GetTextVerticalAdjust(rTextItemSet); - SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust(rTextItemSet); + SdrTextHorzAdjust eHAdj = rSdrBlockTextPrimitive.getSdrTextHorzAdjust(); + SdrTextVertAdjust eVAdj = rSdrBlockTextPrimitive.getSdrTextVertAdjust(); const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord()); const Size aNullSize; // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage())); - - rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)rTextItemSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(rSdrBlockTextPrimitive.isFixedCellHeight()); rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_AUTOPAGESIZE); rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000)); @@ -758,24 +800,32 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive( const bool bVerticalWritintg(rSdrBlockTextPrimitive.getOutlinerParaObject().IsVertical()); const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight)); + // 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); + + // set minimal paper size hor/ver if needed + if(bHorizontalIsBlock) + { + rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0)); + } + else if(bVerticalIsBlock) + { + rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight)); + } + if(bIsCell) { // cell text is formated neither like a text object nor like a object // text, so use a special setup here - rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(aAnchorTextSize); rOutliner.SetPaperSize(aAnchorTextSize); - rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0)); - rOutliner.SetUpdateMode(TRUE); + rOutliner.SetUpdateMode(true); rOutliner.SetText(rSdrBlockTextPrimitive.getOutlinerParaObject()); - rOutliner.SetUpdateMode(TRUE); rOutliner.SetControlWord(nOriginalControlWord); } 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()) { @@ -801,16 +851,6 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive( rOutliner.SetMaxAutoPaperSize(aMaxAutoPaperSize); } - // set minimal paper size hor/ver if needed - if(bHorizontalIsBlock) - { - rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0)); - } - else if(bVerticalIsBlock) - { - rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight)); - } - rOutliner.SetPaperSize(aNullSize); rOutliner.SetUpdateMode(true); rOutliner.SetText(rSdrBlockTextPrimitive.getOutlinerParaObject()); @@ -889,7 +929,8 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive( // as the master shape we are working on. For vertical, use the top-right // corner const double fStartInX(bVerticalWritintg ? aAdjustTranslate.getX() + aOutlinerScale.getX() : aAdjustTranslate.getX()); - aNewTransformA.translate(fStartInX, aAdjustTranslate.getY()); + const basegfx::B2DTuple aAdjOffset(fStartInX, aAdjustTranslate.getY()); + aNewTransformA.translate(aAdjOffset.getX(), aAdjOffset.getY()); // mirroring. We are now in aAnchorTextRange sizes. When mirroring in X and Y, // move the null point which was top left to bottom right. @@ -903,19 +944,27 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive( aNewTransformB.rotate(fRotate); aNewTransformB.translate(aTranslate.getX(), aTranslate.getY()); + // #SJ# create ClipRange (if needed)
+ basegfx::B2DRange aClipRange;
+
+ if(rSdrBlockTextPrimitive.getClipOnBounds())
+ {
+ aClipRange.expand(-aAdjOffset);
+ aClipRange.expand(basegfx::B2DTuple(aAnchorTextSize.Width(), aAnchorTextSize.Height()) - aAdjOffset);
+ } + // now break up text primitives. impTextBreakupHandler aConverter(rOutliner); - aConverter.decomposeBlockTextPrimitive(aNewTransformA, aNewTransformB); + aConverter.decomposeBlockTextPrimitive(aNewTransformA, aNewTransformB, aClipRange); // cleanup outliner rOutliner.Clear(); rOutliner.setVisualizedPage(0); rTarget = aConverter.getPrimitive2DSequence(); - return false; } -bool SdrTextObj::impDecomposeStretchTextPrimitive( +void SdrTextObj::impDecomposeStretchTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const @@ -932,13 +981,10 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive( // prepare outliner SdrOutliner& rOutliner = ImpGetDrawOutliner(); const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord()); - const SfxItemSet& rTextItemSet = rSdrStretchTextPrimitive.getSdrText() - ? rSdrStretchTextPrimitive.getSdrText()->GetItemSet() - : GetObjectItemSet(); const Size aNullSize; rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE); - rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)rTextItemSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(rSdrStretchTextPrimitive.isFixedCellHeight()); rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000)); rOutliner.SetPaperSize(aNullSize); @@ -996,7 +1042,6 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive( rOutliner.setVisualizedPage(0); rTarget = aConverter.getPrimitive2DSequence(); - return false; } ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index f3bdeeb4811c..f6a30d40b3d5 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -365,12 +365,13 @@ namespace for(sal_uInt32 a(0L); a < rTextPortions.size() && fPolyStart < fPolyEnd; a++) { const impPathTextPortion* pCandidate = rTextPortions[a]; - basegfx::B2DVector aSize; - const drawinglayer::primitive2d::FontAttributes aCandidateFontAttributes(drawinglayer::primitive2d::getFontAttributesFromVclFont( - aSize, - pCandidate->getFont(), - pCandidate->isRTL(), - false)); + basegfx::B2DVector aFontScaling; + const drawinglayer::primitive2d::FontAttributes aCandidateFontAttributes( + drawinglayer::primitive2d::getFontAttributesFromVclFont( + aFontScaling, + pCandidate->getFont(), + pCandidate->isRTL(), + false)); if(pCandidate && pCandidate->getTextLength()) { @@ -397,7 +398,7 @@ namespace basegfx::B2DPoint aEndPos(aStartPos); // add font scaling - aNewTransformA.scale(aSize.getX(), aSize.getY()); + aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY()); // prepare scaling of text primitive if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) @@ -512,15 +513,16 @@ namespace pCandidate->getDoubleDXArray().begin() + nPortionIndex, pCandidate->getDoubleDXArray().begin() + nPortionIndex + nNextGlyphLen); - drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( - aNewTransformB * aNewShadowTransform * aNewTransformA, - pCandidate->getText(), - nPortionIndex, - nNextGlyphLen, - aNewDXArray, - aCandidateFontAttributes, - pCandidate->getLocale(), - aRGBShadowColor); + drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = + new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( + aNewTransformB * aNewShadowTransform * aNewTransformA, + pCandidate->getText(), + nPortionIndex, + nNextGlyphLen, + aNewDXArray, + aCandidateFontAttributes, + pCandidate->getLocale(), + aRGBShadowColor); mrShadowDecomposition.push_back(pNew); } @@ -536,15 +538,16 @@ namespace pCandidate->getDoubleDXArray().begin() + nPortionIndex, pCandidate->getDoubleDXArray().begin() + nPortionIndex + nNextGlyphLen); - drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( - aNewTransformB * aNewTransformA, - pCandidate->getText(), - nPortionIndex, - nNextGlyphLen, - aNewDXArray, - aCandidateFontAttributes, - pCandidate->getLocale(), - aRGBColor); + drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = + new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( + aNewTransformB * aNewTransformA, + pCandidate->getText(), + nPortionIndex, + nNextGlyphLen, + aNewDXArray, + aCandidateFontAttributes, + pCandidate->getLocale(), + aRGBColor); mrDecomposition.push_back(pNew); } @@ -671,7 +674,7 @@ namespace ////////////////////////////////////////////////////////////////////////////// // primitive decomposition -bool SdrTextObj::impDecomposePathTextPrimitive( +void SdrTextObj::impDecomposePathTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const @@ -789,8 +792,6 @@ bool SdrTextObj::impDecomposePathTextPrimitive( // concatenate all results drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aRetvalA); drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aRetvalB); - - return false; } ////////////////////////////////////////////////////////////////////////////// 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/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/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 23f3981228e1..b9a197ed89fb 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -697,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 417c72cf02b1..de90302586d0 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/svxlink/fileobj.cxx b/svx/source/svxlink/fileobj.cxx index f2628f181d31..d159c7f78abe 100644 --- a/svx/source/svxlink/fileobj.cxx +++ b/svx/source/svxlink/fileobj.cxx @@ -121,37 +121,6 @@ BOOL SvFileObject::GetData( ::com::sun::star::uno::Any & rData, // relativen Datei Links aufzuloesen!!!! Wird ueber den // LinkManager und damit von dessen Storage erledigt. rData <<= rtl::OUString( sFileNm ); - -/* -=========================================================================== -JP 28.02.96: noch eine Baustelle: - Idee: hier das Medium und die DocShell anlegen, Doc laden - und ueber OLE-SS (GetObj(...)) den Bereich als - PseudoObject erfragen. Dieses mit den Daten oder - dessen Daten verschicken. - -=========================================================================== - - SfxMedium aMed( aFileNm.GetFull(), STREAM_READ, TRUE ); - aMed.DownLoad(); // nur mal das Medium anfassen (DownLoaden) - - if( aMed.IsStorage() ) - pSvData->SetData( SvStorageRef( aMed.GetStorage() ), - TRANSFER_COPY ); - else - { - SvStream* pStream = aMed.GetInStream(); - if( !pStream ) - return FALSE; - - UINT32 nLen = pStream->Seek( STREAM_SEEK_TO_END ); - pStream->Seek( STREAM_SEEK_TO_BEGIN ); - - void* pData = SvMemAlloc( nLen ); - pStream->Read( pData, nLen ); - pSvData->SetData( pData, nLen, TRANSFER_MOVE ); - } -*/ } break; 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..42034f2bd0cb 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -278,19 +278,6 @@ namespace sdr void CellProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr) { TextProperties::SetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr ); - - if( bDontRemoveHardAttr && pNewStyleSheet ) - { - GetObjectItemSet(); - - const SfxItemSet& rStyleAttribs = pNewStyleSheet->GetItemSet(); - - for ( USHORT nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ ) - { - if ( rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON ) - mpItemSet->ClearItem( nWhich ); - } - } } } // end of namespace properties } // end of namespace sdr @@ -1757,5 +1744,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/cellcursor.cxx b/svx/source/table/cellcursor.cxx index 681546b9ebd9..f3b33a12f932 100644 --- a/svx/source/table/cellcursor.cxx +++ b/svx/source/table/cellcursor.cxx @@ -269,7 +269,9 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException) throw DisposedException(); SdrModel* pModel = mxTable->getSdrTableObj()->GetModel(); - if( pModel ) + const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled(); + + if( bUndo ) pModel->BegUndo( ImpGetResStr(STR_TABLE_MERGE) ); try @@ -283,8 +285,11 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException) DBG_ERROR("sdr::table::CellCursor::merge(), exception caught!"); } - if( pModel ) + if( bUndo ) pModel->EndUndo(); + + if( pModel ) + pModel->SetChanged(); } // ----------------------------------------------------------------------------- @@ -530,7 +535,8 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No throw DisposedException(); SdrModel* pModel = mxTable->getSdrTableObj()->GetModel(); - if( pModel ) + const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled(); + if( bUndo ) pModel->BegUndo( ImpGetResStr(STR_TABLE_SPLIT) ); try @@ -550,8 +556,11 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No throw NoSupportException(); } - if( pModel ) + if( bUndo ) pModel->EndUndo(); + + if( pModel ) + pModel->SetChanged(); } // ----------------------------------------------------------------------------- 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/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 3c6ec81cabdb..d7f64c852fc6 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++ ) { @@ -549,10 +568,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) if( bUndo ) mpModel->EndUndo(); - 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 +586,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++ ) { @@ -582,16 +599,10 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) } if( bUndo ) - { mpModel->EndUndo(); - mpModel->SetChanged(); - } - - if( mpModel ) - 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 +770,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: @@ -859,7 +870,8 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs ) pModel->AddUndo( new TableStyleUndo( *pTableObj ) ); } -/* + pTableObj->setTableStyle( xNewTableStyle ); + const sal_Int32 nRowCount = mxTable->getRowCount(); const sal_Int32 nColCount = mxTable->getColumnCount(); for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ ) @@ -869,9 +881,26 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs ) CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) ); if( xCell.is() ) { - if( bUndo ) - xCell->AddUndo(); - xCell->setAllPropertiesToDefault(); + SfxItemSet aSet( xCell->GetItemSet() ); + bool bChanges = false; + const SfxItemSet& rStyleAttribs = xCell->GetStyleSheet()->GetItemSet(); + + for ( USHORT nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ ) + { + if( (rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON) && (aSet.GetItemState( nWhich ) == SFX_ITEM_ON) ) + { + aSet.ClearItem( nWhich ); + bChanges = true; + } + } + + if( bChanges ) + { + if( bUndo ) + xCell->AddUndo(); + + xCell->SetMergedItemSetAndBroadcast( aSet, sal_True ); + } } } catch( Exception& e ) @@ -880,9 +909,6 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs ) DBG_ERROR( "svx::SvxTableController::SetTableStyle(), exception caught!" ); } } -*/ - - pTableObj->setTableStyle( xNewTableStyle ); if( bUndo ) pModel->EndUndo(); @@ -1047,9 +1073,6 @@ void SvxTableController::SplitMarkedCells() if( bUndo ) mpModel->EndUndo(); - - if( mpModel ) - mpModel->SetChanged(); } aEnd.mnRow += mxTable->getRowCount() - nRowCount; aEnd.mnCol += mxTable->getColumnCount() - nColCount; @@ -1490,7 +1513,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 ); 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/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index 5c1aca5a4542..2d19a9994c41 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -128,6 +128,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/tablemodel.cxx b/svx/source/table/tablemodel.cxx index ce79dad77b4c..34ef52f6d701 100644 --- a/svx/source/table/tablemodel.cxx +++ b/svx/source/table/tablemodel.cxx @@ -795,6 +795,9 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount ) if( bUndo ) pModel->EndUndo(); + if( pModel ) + pModel->SetChanged(); + } catch( Exception& ) { @@ -900,10 +903,10 @@ void TableModel::removeColumns( sal_Int32 nIndex, sal_Int32 nCount ) maRows[nRows]->removeColumns( nIndex, nCount ); if( bUndo ) - { pModel->EndUndo(); + + if( pModel ) pModel->SetChanged(); - } } catch( Exception& ) { @@ -970,6 +973,9 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount ) if( bUndo ) pModel->EndUndo(); + if( pModel ) + pModel->SetChanged(); + updateRows(); setModified(sal_True); } @@ -1056,10 +1062,10 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount ) remove_range<RowVector,RowVector::iterator>( maRows, nIndex, nCount ); if( bUndo ) - { pModel->EndUndo(); + + if( pModel ) pModel->SetChanged(); - } } catch( Exception& ) { diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index f740bf60258c..e53f41251ff2 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -123,7 +123,7 @@ namespace drawinglayer getTransform(), *getSdrFTAttribute().getText(), 0, - true, false)); + true, false, false)); } } @@ -687,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 098ddb6c31c0..5d1af9af2190 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -201,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 ); @@ -215,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" ) ); 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..c0e301f3792e 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() ) ); @@ -247,7 +252,10 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createTextField( { nId = ID_EXT_FILEFIELD; } - else if( aFieldType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("DocInfo.Title") ) ) + else if (aFieldType.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("docinfo.Title") ) || + aFieldType.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("DocInfo.Title") ) ) { nId = ID_FILEFIELD; } 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/unofield.cxx b/svx/source/unoedit/unofield.cxx index efb4226f9c12..6ff4c2aafe3e 100644 --- a/svx/source/unoedit/unofield.cxx +++ b/svx/source/unoedit/unofield.cxx @@ -1062,7 +1062,7 @@ OUString SAL_CALL SvxUnoTextField::getImplementationName() throw(uno::RuntimeExc return OUString(RTL_CONSTASCII_USTRINGPARAM("SvxUnoTextField")); } -static const sal_Char* pServiceNames[] = +static const sal_Char* pOldServiceNames[] = { "com.sun.star.text.TextField.DateTime", "com.sun.star.text.TextField.URL", @@ -1081,14 +1081,34 @@ static const sal_Char* pServiceNames[] = "com.sun.star.presentation.TextField.DateTime" }; +static const sal_Char* pNewServiceNames[] = +{ + "com.sun.star.text.textfield.DateTime", + "com.sun.star.text.textfield.URL", + "com.sun.star.text.textfield.PageNumber", + "com.sun.star.text.textfield.PageCount", + "com.sun.star.text.textfield.DateTime", + "com.sun.star.text.textfield.docinfo.Title", // SvxFileField is used for title + "com.sun.star.text.textfield.SheetName", + "com.sun.star.text.textfield.DateTime", + "com.sun.star.text.textfield.FileName", + "com.sun.star.text.textfield.Author", + "com.sun.star.text.textfield.Measure", + "com.sun.star.text.textfield.DateTime", + "com.sun.star.presentation.textfield.Header", + "com.sun.star.presentation.textfield.Footer", + "com.sun.star.presentation.textfield.DateTime" +}; + uno::Sequence< OUString > SAL_CALL SvxUnoTextField::getSupportedServiceNames() throw(uno::RuntimeException) { - uno::Sequence< OUString > aSeq( 3 ); + uno::Sequence< OUString > aSeq( 4 ); OUString* pServices = aSeq.getArray(); - pServices[0] = OUString::createFromAscii( pServiceNames[mnServiceId] ); - pServices[1] = OUString::createFromAscii( "com.sun.star.text.TextContent" ), - pServices[2] = OUString::createFromAscii( "com.sun.star.text.TextField" ); + pServices[0] = OUString::createFromAscii( pNewServiceNames[mnServiceId] ); + pServices[1] = OUString::createFromAscii( pOldServiceNames[mnServiceId] ); + pServices[2] = OUString::createFromAscii( "com.sun.star.text.TextContent" ), + pServices[3] = OUString::createFromAscii( "com.sun.star.text.TextField" ); return aSeq; } 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..c54f76d5f4dc 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(); @@ -480,7 +490,7 @@ sal_Bool SvxOutlinerForwarder::SetDepth( USHORT nPara, sal_Int16 nNewDepth ) { rOutliner.SetDepth( pPara, nNewDepth ); - const bool bOutlinerText = (pSdrObject->GetObjInventor() == SdrInventor) && (pSdrObject->GetObjIdentifier() == OBJ_OUTLINETEXT); + const bool bOutlinerText = pSdrObject && (pSdrObject->GetObjInventor() == SdrInventor) && (pSdrObject->GetObjIdentifier() == OBJ_OUTLINETEXT); if( bOutlinerText ) rOutliner.SetLevelDependendStyleSheet( nPara ); 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/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx index e6f7221623fd..ab9eb5aeb36d 100644 --- a/svx/source/xml/xmleohlp.cxx +++ b/svx/source/xml/xmleohlp.cxx @@ -326,11 +326,29 @@ sal_Bool SvXMLEmbeddedObjectHelper::ImplGetStorageNames( } else { - sal_Int32 nPathStart = 0; - if( 0 == aURLNoPar.compareToAscii( "./", 2 ) ) - nPathStart = 2; - if( _nPos >= nPathStart ) - rContainerStorageName = aURLNoPar.copy( nPathStart, _nPos-nPathStart); + //eliminate 'superfluous' slashes at start and end + //#i103076# load objects with all allowed xlink:href syntaxes + { + //eliminate './' at start + sal_Int32 nStart = 0; + sal_Int32 nCount = aURLNoPar.getLength(); + if( 0 == aURLNoPar.compareToAscii( "./", 2 ) ) + { + nStart = 2; + nCount -= 2; + } + + //eliminate '/' at end + sal_Int32 nEnd = aURLNoPar.lastIndexOf( '/' ); + if( nEnd == aURLNoPar.getLength()-1 && nEnd != (nStart-1) ) + nCount--; + + aURLNoPar = aURLNoPar.copy( nStart, nCount ); + } + + _nPos = aURLNoPar.lastIndexOf( '/' ); + if( _nPos >= 0 ) + rContainerStorageName = aURLNoPar.copy( 0, _nPos ); rObjectStorageName = aURLNoPar.copy( _nPos+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/xml/xmltxtexp.cxx b/svx/source/xml/xmltxtexp.cxx index 4f034b098db7..5db6cc809bce 100644 --- a/svx/source/xml/xmltxtexp.cxx +++ b/svx/source/xml/xmltxtexp.cxx @@ -247,7 +247,11 @@ uno::Reference< uno::XInterface > SAL_CALL SvxSimpleUnoModel::createInstance( co return uno::Reference< uno::XInterface >( SvxCreateNumRule( (SdrModel*)NULL ), uno::UNO_QUERY ); } - if( 0 == aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextField.DateTime") ) ) + if ( (0 == aServiceSpecifier.reverseCompareToAsciiL( + RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.textfield.DateTime"))) + || (0 == aServiceSpecifier.reverseCompareToAsciiL( + RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextField.DateTime"))) + ) { return (::cppu::OWeakObject * )new SvxUnoTextField( ID_EXT_DATEFIELD ); } diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index e211c98f6834..70e8af36c838 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -394,7 +394,7 @@ sal_Bool SvxXMLXTableImport::load( const OUString& rUrl, const uno::Reference< X if( aMedium.IsStorage() ) { - uno::Reference < embed::XStorage > xStorage( aMedium.GetStorage(), uno::UNO_QUERY_THROW ); + uno::Reference < embed::XStorage > xStorage( aMedium.GetStorage( sal_False ), uno::UNO_QUERY_THROW ); const String aContentStmName( RTL_CONSTASCII_USTRINGPARAM( "Content.xml" ) ); xIStm.set( xStorage->openStreamElement( aContentStmName, embed::ElementModes::READ ), uno::UNO_QUERY_THROW ); |