diff options
42 files changed, 1145 insertions, 209 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 1fab6f1d15d4..6ae8e73cfb8d 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -1258,6 +1258,10 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr #define FN_IID_COLRIGHT (FN_FRAME + 17) #define FN_SET_FRM_ALT_NAME (FN_FRAME + 18) +// --> OD 2009-07-13 #i73249# +#define FN_UNO_TITLE (FN_FRAME + 19) +#define FN_UNO_DESCRIPTION (FN_FRAME + 20) +// <-- //Member-Ids fuer Fill/SetVariable an Items diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 9784f43dfe94..faa2d226b672 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1091,7 +1091,12 @@ public: sal_Bool SetFrmFmtToFly( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFmt, SfxItemSet* pSet = 0, sal_Bool bKeepOrient = sal_False ); - + // --> OD 2009-07-20 #i73249# + void SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt, + const String& sNewTitle ); + void SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt, + const String& sNewDescription ); + // <-- /** Footnotes */ diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 83b0e5242a9e..a3c7b7489dd1 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -622,9 +622,9 @@ public: const Graphic* pGraphic = 0, const GraphicObject* pGrafObj = 0 ); - // alternativen Text einer Grafik/OLe-Objectes abfragen/setzen - const String& GetAlternateText() const; - void SetAlternateText( const String& rTxt ); +// // alternativen Text einer Grafik/OLe-Objectes abfragen/setzen +// const String& GetAlternateText() const; +// void SetAlternateText( const String& rTxt ); //eindeutige Identifikation des Objektes (fuer ImageMapDlg) void *GetIMapInventor() const; diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index 8697ee2833d1..e75d4baec8d0 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -353,6 +353,13 @@ public: const Graphic *GetGrfAtPos( const Point &rDocPos, String &rName, BOOL &rbLink ) const; + // --> OD 2009-07-13 #i73249# + const String GetObjTitle() const; + void SetObjTitle( const String& rTitle ); + const String GetObjDescription() const; + void SetObjDescription( const String& rDescription ); + // <-- + //SS fuer Rahmen -------------------------------------------- BOOL IsFrmSelected() const; diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index 608ac7ac7174..a86b1c6689a0 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -176,6 +176,15 @@ public: virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; + // --> OD 2009-07-14 #i73249# + const String GetObjTitle() const; + void SetObjTitle( const String& rTitle, + bool bBroadcast = false ); + const String GetObjDescription() const; + void SetObjDescription( const String& rDescription, + bool bBroadcast = false ); + // <-- + /** SwFlyFrmFmt::IsBackgroundTransparent - for #99657# OD 22.08.2002 - overloading virtual method and its default implementation, diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 9e847064eaaf..325638b5df00 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -337,7 +337,8 @@ RES_MSG_BEGIN = RES_FMT_END, RES_GRAPHIC_SWAPIN, RES_FIELD_DELETED, RES_NAME_CHANGED, - RES_ALT_TEXT_CHANGED, + RES_TITLE_CHANGED, + RES_DESCRIPTION_CHANGED, RES_UNOCURSOR_LEAVES_SECTION, RES_LINKED_GRAPHIC_STREAM_ARRIVED, RES_MSG_END diff --git a/sw/inc/ndnotxt.hxx b/sw/inc/ndnotxt.hxx index 3ae3ae88c8b6..7150e1319c30 100644 --- a/sw/inc/ndnotxt.hxx +++ b/sw/inc/ndnotxt.hxx @@ -43,7 +43,7 @@ class SW_DLLPUBLIC SwNoTxtNode : public SwCntntNode friend class SwNodes; friend class SwNoTxtFrm; - String aAlternateText; // alternativer Text (HTML) +// String aAlternateText; // alternativer Text (HTML) PolyPolygon *pContour; // Polygon fuer Konturumlauf BOOL bAutomaticContour : 1; // automatic contour polygon, not manipulated @@ -75,9 +75,16 @@ public: virtual BOOL SavePersistentData(); virtual BOOL RestorePersistentData(); - // alternativen Text abfragen/setzen - const String& GetAlternateText() const { return aAlternateText; } - void SetAlternateText( const String& rTxt, sal_Bool bBroadcast=sal_False ); + const String GetTitle() const; + void SetTitle( const String& rTitle, + bool bBroadcast = false ); + const String GetDescription() const; + void SetDescription( const String& rDescription, + bool bBroadcast = false ); + +// const String GetAlternateText() const; +// void SetAlternateText( const String& rTxt, +// sal_Bool bBroadcast=sal_False ); void SetContour( const PolyPolygon *pPoly, BOOL bAutomatic = FALSE ); diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx index 3c5fdec1e739..ce997cc3f43d 100644 --- a/sw/inc/swundo.hxx +++ b/sw/inc/swundo.hxx @@ -156,7 +156,11 @@ enum SwUndoId UNDO_ROW_DELETE, // 109 UNDO_RENAME_PAGEDESC, // 110 UNDO_NUMDOWN, // 111 - UNDO_STD_END= UNDO_NUMDOWN, + // --> OD 2009-07-16 #i73249# + UNDO_FLYFRMFMT_TITLE, // 112 + UNDO_FLYFRMFMT_DESCRIPTION, // 113 + // <-- + UNDO_STD_END= UNDO_FLYFRMFMT_DESCRIPTION, // UI undo ID's... UNDO_UI_REPLACE = UNDO_STD_END + 1, diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 16cb57764515..c9f4d1d01265 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -804,7 +804,10 @@ enum SwPropNameIds /* 0734 */ UNO_NAME_CHAR_OVERLINE_COLOR, /* 0735 */ UNO_NAME_CHAR_OVERLINE_HAS_COLOR, /* 0736 */ UNO_NAME_OUTLINE_LEVEL, //#outline level,add<-zhaojianwei outlinelevel -/* 0737 */ SW_PROPNAME_END +// --> OD 2009-07-13 #i73249# +/* 0737 */ UNO_NAME_DESCRIPTION, +// <-- +/* 0738 */ SW_PROPNAME_END }; diff --git a/sw/sdi/_frmsh.sdi b/sw/sdi/_frmsh.sdi index a355bdb76b55..8081d8e04378 100644 --- a/sw/sdi/_frmsh.sdi +++ b/sw/sdi/_frmsh.sdi @@ -251,6 +251,14 @@ interface BaseTextFrame [ ExecMethod = Execute ; ] + // --> OD 2009-07-08 #i73249# + FN_TITLE_DESCRIPTION_SHAPE + [ + ExecMethod = Execute ; + StateMethod = GetState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] + // <-- /***************************************************** diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx index e89e74c9dbcf..4bb7c73362aa 100644 --- a/sw/source/core/access/accnotextframe.cxx +++ b/sw/source/core/access/accnotextframe.cxx @@ -42,6 +42,9 @@ #include <ndnotxt.hxx> #include <flyfrm.hxx> #include <cntfrm.hxx> +// --> OD 2009-07-14 #i73249# +#include <hints.hxx> +// <-- #include "accnotextframe.hxx" using namespace ::com::sun::star; @@ -67,13 +70,25 @@ SwAccessibleNoTextFrame::SwAccessibleNoTextFrame( sal_Int16 nInitRole, const SwFlyFrm* pFlyFrm ) : SwAccessibleFrameBase( pInitMap, nInitRole, pFlyFrm ), - aDepend( this, const_cast < SwNoTxtNode * >( GetNoTxtNode() ) ) + aDepend( this, const_cast < SwNoTxtNode * >( GetNoTxtNode() ) ), + msTitle(), + msDesc() { - const SwNoTxtNode *pNd = GetNoTxtNode(); + const SwNoTxtNode* pNd = GetNoTxtNode(); + // --> OD 2009-07-14 #i73249# + // consider new attributes Title and Description if( pNd ) - sDesc = OUString( pNd->GetAlternateText() ); - if( !sDesc.getLength() ) - sDesc = GetName(); + { + msTitle = pNd->GetTitle(); + + msDesc = pNd->GetDescription(); + if ( msDesc.getLength() == 0 && + msTitle != GetName() ) + { + msDesc = msTitle; + } + } + // <-- } SwAccessibleNoTextFrame::~SwAccessibleNoTextFrame() @@ -82,36 +97,70 @@ SwAccessibleNoTextFrame::~SwAccessibleNoTextFrame() void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) { - SwAccessibleFrameBase::Modify( pOld, pNew ); + const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; + // --> OD 2009-07-14 #i73249# + // suppress handling of RES_NAME_CHANGED in case that attribute Title is + // used as the accessible name. + if ( nWhich != RES_NAME_CHANGED || + msTitle.getLength() == 0 ) + { + SwAccessibleFrameBase::Modify( pOld, pNew ); + } - sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; const SwNoTxtNode *pNd = GetNoTxtNode(); ASSERT( pNd == aDepend.GetRegisteredIn(), "invalid frame" ); switch( nWhich ) { - case RES_NAME_CHANGED: - if( pNd->GetAlternateText().Len() ) - break; - case RES_ALT_TEXT_CHANGED: - if( pNd && GetFrm() ) + // --> OD 2009-07-14 #i73249# + case RES_TITLE_CHANGED: { - OUString sOldDesc( sDesc ); - - const String& rDesc = pNd->GetAlternateText(); - sDesc = rDesc; - if( !sDesc.getLength() ) - sDesc = GetName(); - - if( sDesc != sOldDesc ) + const String& sOldTitle( + dynamic_cast<SwStringMsgPoolItem*>(pOld)->GetString() ); + const String& sNewTitle( + dynamic_cast<SwStringMsgPoolItem*>(pNew)->GetString() ); + if ( sOldTitle == sNewTitle ) { - AccessibleEventObject aEvent; - aEvent.EventId = AccessibleEventId::DESCRIPTION_CHANGED; - aEvent.OldValue <<= sOldDesc; - aEvent.NewValue <<= sDesc; - FireAccessibleEvent( aEvent ); + break; + } + msTitle = sNewTitle; + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::NAME_CHANGED; + aEvent.OldValue <<= OUString( sOldTitle ); + aEvent.NewValue <<= msTitle; + FireAccessibleEvent( aEvent ); + + if ( pNd->GetDescription().Len() != 0 ) + { + break; + } + } + // intentional no break here + case RES_DESCRIPTION_CHANGED: + { + if ( pNd && GetFrm() ) + { + const OUString sOldDesc( msDesc ); + + const String& rDesc = pNd->GetDescription(); + msDesc = rDesc; + if ( msDesc.getLength() == 0 && + msTitle != GetName() ) + { + msDesc = msTitle; + } + + if ( msDesc != sOldDesc ) + { + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::DESCRIPTION_CHANGED; + aEvent.OldValue <<= sOldDesc; + aEvent.NewValue <<= msDesc; + FireAccessibleEvent( aEvent ); + } } } break; + // <-- /* case RES_OBJECTDYING: if( aDepend.GetRegisteredIn() == @@ -138,6 +187,23 @@ void SwAccessibleNoTextFrame::Dispose( sal_Bool bRecursive ) SwAccessibleFrameBase::Dispose( bRecursive ); } +// --> OD 2009-07-14 #i73249# +OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleName (void) + throw (uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + + CHECK_FOR_DEFUNC( XAccessibleContext ) + + if ( msTitle.getLength() != 0 ) + { + return msTitle; + } + + return SwAccessibleFrameBase::getAccessibleName(); +} +// <-- + OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleDescription (void) throw (uno::RuntimeException) { @@ -145,7 +211,7 @@ OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleDescription (void) CHECK_FOR_DEFUNC( XAccessibleContext ) - return sDesc; + return msDesc; } diff --git a/sw/source/core/access/accnotextframe.hxx b/sw/source/core/access/accnotextframe.hxx index 25e4b402c4b2..d96c510266ae 100644 --- a/sw/source/core/access/accnotextframe.hxx +++ b/sw/source/core/access/accnotextframe.hxx @@ -39,7 +39,10 @@ class SwAccessibleNoTextFrame : public SwAccessibleFrameBase, public ::com::sun::star::accessibility::XAccessibleImage { SwDepend aDepend; - ::rtl::OUString sDesc; + // --> OD 2009-07-14 #i73249# + ::rtl::OUString msTitle; + // <-- + ::rtl::OUString msDesc; protected: @@ -57,6 +60,13 @@ public: //===== XAccessibleContext ============================================== + // --> OD 2009-07-14 #i73249# + /// Return the object's current name. + virtual ::rtl::OUString SAL_CALL + getAccessibleName (void) + throw (::com::sun::star::uno::RuntimeException); + // <-- + /// Return this object's description. virtual ::rtl::OUString SAL_CALL getAccessibleDescription (void) diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx index 2ac42327a73e..d91a9ef514f1 100644 --- a/sw/source/core/access/acctextframe.cxx +++ b/sw/source/core/access/acctextframe.cxx @@ -46,6 +46,9 @@ #include <flyfrm.hxx> #include <accmap.hxx> #include <unotools/accessiblerelationsethelper.hxx> +// --> OD 2009-07-14 #i73249# +#include <hints.hxx> +// <-- #include "acctextframe.hxx" using namespace ::com::sun::star; @@ -61,8 +64,23 @@ const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleTex SwAccessibleTextFrame::SwAccessibleTextFrame( SwAccessibleMap* pInitMap, const SwFlyFrm* pFlyFrm ) : - SwAccessibleFrameBase( pInitMap, AccessibleRole::TEXT_FRAME, pFlyFrm ) + SwAccessibleFrameBase( pInitMap, AccessibleRole::TEXT_FRAME, pFlyFrm ), + msTitle(), + msDesc() { + if ( pFlyFrm ) + { + const SwFlyFrmFmt* pFlyFrmFmt = + dynamic_cast<const SwFlyFrmFmt*>( pFlyFrm->GetFmt() ); + msTitle = pFlyFrmFmt->GetObjTitle(); + + msDesc = pFlyFrmFmt->GetObjDescription(); + if ( msDesc.getLength() == 0 && + msTitle != GetName() ) + { + msDesc = msTitle; + } + } } SwAccessibleTextFrame::~SwAccessibleTextFrame() @@ -71,32 +89,92 @@ SwAccessibleTextFrame::~SwAccessibleTextFrame() void SwAccessibleTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) { - sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; + const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; + // --> OD 2009-07-14 #i73249# + // suppress handling of RES_NAME_CHANGED in case that attribute Title is + // used as the accessible name. + if ( nWhich != RES_NAME_CHANGED || + msTitle.getLength() == 0 ) + { + SwAccessibleFrameBase::Modify( pOld, pNew ); + } + const SwFlyFrm *pFlyFrm = static_cast< const SwFlyFrm * >( GetFrm() ); switch( nWhich ) { - case RES_NAME_CHANGED: - if( pFlyFrm ) + // --> OD 2009-07-14 #i73249# + case RES_TITLE_CHANGED: { - OUString sOldDesc( GetName() ); - SwAccessibleFrameBase::Modify( pOld, pNew ); - - if( sOldDesc != GetName() ) + const String& sOldTitle( + dynamic_cast<SwStringMsgPoolItem*>(pOld)->GetString() ); + const String& sNewTitle( + dynamic_cast<SwStringMsgPoolItem*>(pNew)->GetString() ); + if ( sOldTitle == sNewTitle ) { - AccessibleEventObject aEvent; - aEvent.EventId = AccessibleEventId::DESCRIPTION_CHANGED; - aEvent.OldValue <<= sOldDesc; - aEvent.NewValue <<= GetName(); - FireAccessibleEvent( aEvent ); + break; + } + msTitle = sNewTitle; + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::NAME_CHANGED; + aEvent.OldValue <<= OUString( sOldTitle ); + aEvent.NewValue <<= msTitle; + FireAccessibleEvent( aEvent ); + + const SwFlyFrmFmt* pFlyFrmFmt = + dynamic_cast<const SwFlyFrmFmt*>( pFlyFrm->GetFmt() ); + if ( pFlyFrmFmt->GetObjDescription().Len() != 0 ) + { + break; + } + } + // intentional no break here + case RES_DESCRIPTION_CHANGED: + { + if ( pFlyFrm ) + { + const OUString sOldDesc( msDesc ); + + const SwFlyFrmFmt* pFlyFrmFmt = + dynamic_cast<const SwFlyFrmFmt*>( pFlyFrm->GetFmt() ); + const String& rDesc = pFlyFrmFmt->GetObjDescription(); + msDesc = rDesc; + if ( msDesc.getLength() == 0 && + msTitle != GetName() ) + { + msDesc = msTitle; + } + + if ( msDesc != sOldDesc ) + { + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::DESCRIPTION_CHANGED; + aEvent.OldValue <<= sOldDesc; + aEvent.NewValue <<= msDesc; + FireAccessibleEvent( aEvent ); + } } } break; - default: - SwAccessibleFrameBase::Modify( pOld, pNew ); - break; + // <-- } } +// --> OD 2009-07-14 #i73249# +OUString SAL_CALL SwAccessibleTextFrame::getAccessibleName (void) + throw (uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + + CHECK_FOR_DEFUNC( XAccessibleContext ) + + if ( msTitle.getLength() != 0 ) + { + return msTitle; + } + + return SwAccessibleFrameBase::getAccessibleName(); +} +// <-- OUString SAL_CALL SwAccessibleTextFrame::getAccessibleDescription (void) throw (uno::RuntimeException) { @@ -104,7 +182,7 @@ OUString SAL_CALL SwAccessibleTextFrame::getAccessibleDescription (void) CHECK_FOR_DEFUNC( XAccessibleContext ) - return GetName(); + return msDesc; } diff --git a/sw/source/core/access/acctextframe.hxx b/sw/source/core/access/acctextframe.hxx index 8fed22488b9b..f306b25f2478 100644 --- a/sw/source/core/access/acctextframe.hxx +++ b/sw/source/core/access/acctextframe.hxx @@ -39,6 +39,11 @@ namespace com { namespace star { class SwAccessibleTextFrame : public SwAccessibleFrameBase { +private: + // --> OD 2009-07-14 #i73249# + ::rtl::OUString msTitle; + ::rtl::OUString msDesc; + // <-- protected: @@ -53,6 +58,12 @@ public: //===== XAccessibleContext ============================================== + // --> OD 2009-07-14 #i73249# + /// Return the object's current name. + virtual ::rtl::OUString SAL_CALL + getAccessibleName (void) + throw (::com::sun::star::uno::RuntimeException); + // <-- /// Return this object's description. virtual ::rtl::OUString SAL_CALL getAccessibleDescription (void) diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index cd0e3e4f93bf..d838b277bdf5 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -535,11 +535,11 @@ namespace sw { namespace mark } void MarkManager::deleteMarks( - const SwNodeIndex& rStt, - const SwNodeIndex& rEnd, - ::std::vector<SaveBookmark>* pSaveBkmk, - const SwIndex* pSttIdx, - const SwIndex* pEndIdx) + const SwNodeIndex& rStt, + const SwNodeIndex& rEnd, + ::std::vector<SaveBookmark>* pSaveBkmk, + const SwIndex* pSttIdx, + const SwIndex* pEndIdx ) { vector<const_iterator_t> vMarksToDelete; bool isSortingNeeded = false; @@ -574,12 +574,29 @@ namespace sw { namespace mark isPosInRange = true, isOtherPosInRange = true; } - if(isPosInRange && isOtherPosInRange) + if(isPosInRange && (isOtherPosInRange || !pMark->IsExpanded())) { // completely in range - if(pSaveBkmk) - pSaveBkmk->push_back(SaveBookmark(true, true, *pMark, rStt, pSttIdx)); - vMarksToDelete.push_back(ppMark); + + // --> OD 2009-08-07 #i92125# + bool bKeepCrossRefBkmk( false ); + { + if ( rStt == rEnd && + ( IDocumentMarkAccess::GetType(*pMark) == + IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK || + IDocumentMarkAccess::GetType(*pMark) == + IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK ) ) + { + bKeepCrossRefBkmk = true; + } + } + if ( !bKeepCrossRefBkmk ) + { + if(pSaveBkmk) + pSaveBkmk->push_back(SaveBookmark(true, true, *pMark, rStt, pSttIdx)); + vMarksToDelete.push_back(ppMark); + } + // <-- } else if(isPosInRange ^ isOtherPosInRange) { @@ -596,13 +613,24 @@ namespace sw { namespace mark rEnd, isPosInRange ? pMark->GetOtherMarkPos() : pMark->GetMarkPos()); - if(isPosInRange) - pMark->SetMarkPos(*pNewPos); - else - pMark->SetOtherMarkPos(*pNewPos); + // --> OD 2009-08-06 #i92125# + // no move of position for cross-reference bookmarks, + // if move occurs inside a certain node + if ( ( IDocumentMarkAccess::GetType(*pMark) != + IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK && + IDocumentMarkAccess::GetType(*pMark) != + IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK ) || + pMark->GetMarkPos().nNode != pNewPos->nNode ) + { + if(isPosInRange) + pMark->SetMarkPos(*pNewPos); + else + pMark->SetOtherMarkPos(*pNewPos); - // illegal selection? collapse the mark and restore sorting later - isSortingNeeded |= lcl_FixCorrectedMark(isPosInRange, isOtherPosInRange, pMark); + // illegal selection? collapse the mark and restore sorting later + isSortingNeeded |= lcl_FixCorrectedMark(isPosInRange, isOtherPosInRange, pMark); + } + // <-- } } @@ -613,7 +641,9 @@ namespace sw { namespace mark for(vector<const_iterator_t>::reverse_iterator pppMark = vMarksToDelete.rbegin(); pppMark != vMarksToDelete.rend(); pppMark++) + { deleteMark(*pppMark); + } if(isSortingNeeded) sortMarks(); #if FALSE diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 8bee61c1da37..184fd08a4afc 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -68,6 +68,10 @@ #include <fmtcnct.hxx> #include <dflyobj.hxx> +// --> OD 2009-07-20 #i73249# +#include <undoflystrattr.hxx> +// <-- + extern USHORT GetHtmlMode( const SwDocShell* ); @@ -469,6 +473,61 @@ BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet ) return aTmpSet.Count() || MAKEFRMS == nMakeFrms; } +// --> OD 2009-07-20 #i73249# +void SwDoc::SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt, + const String& sNewTitle ) +{ + if ( rFlyFrmFmt.GetObjTitle() == sNewTitle ) + { + return; + } + + const bool bFormerIsNoDrawUndoObj( IsNoDrawUndoObj() ); + SetNoDrawUndoObj( true ); + + if ( DoesUndo() ) + { + ClearRedo(); + AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt, + UNDO_FLYFRMFMT_TITLE, + rFlyFrmFmt.GetObjTitle(), + sNewTitle ) ); + } + + rFlyFrmFmt.SetObjTitle( sNewTitle, true ); + + SetNoDrawUndoObj( bFormerIsNoDrawUndoObj ); + + SetModified(); +} + +void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt, + const String& sNewDescription ) +{ + if ( rFlyFrmFmt.GetObjDescription() == sNewDescription ) + { + return; + } + + const bool bFormerIsNoDrawUndoObj( IsNoDrawUndoObj() ); + SetNoDrawUndoObj( true ); + + if ( DoesUndo() ) + { + ClearRedo(); + AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt, + UNDO_FLYFRMFMT_DESCRIPTION, + rFlyFrmFmt.GetObjDescription(), + sNewDescription ) ); + } + + rFlyFrmFmt.SetObjDescription( sNewDescription, true ); + + SetNoDrawUndoObj( bFormerIsNoDrawUndoObj ); + + SetModified(); +} +// <-- /*************************************************************************** * Methode : BOOL SwDoc::SetFrmFmtToFly( SwFlyFrm&, SwFrmFmt& ) diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 5b4831017fdf..301dd08fa560 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -281,7 +281,7 @@ void SwNoTxtFrm::Paint( const SwRect &rRect ) const if ( pSh->GetWin() && !pSh->IsPreView() ) { const SwNoTxtNode* pNd = GetNode()->GetNoTxtNode(); - String aTxt( pNd->GetAlternateText() ); + String aTxt( pNd->GetTitle() ); if ( !aTxt.Len() && pNd->IsGrfNode() ) GetRealURL( *(SwGrfNode*)pNd, aTxt ); if( !aTxt.Len() ) @@ -906,7 +906,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons pGrfNd->TriggerAsyncRetrieveInputStream(); // <-- } - String aTxt( pGrfNd->GetAlternateText() ); + String aTxt( pGrfNd->GetTitle() ); if ( !aTxt.Len() ) GetRealURL( *pGrfNd, aTxt ); ::lcl_PaintReplacement( aAlignedGrfArea, aTxt, *pShell, this, FALSE ); @@ -971,7 +971,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons ((SwNoTxtFrm*)this)->nWeight = -1; String aText; if ( !nResId && - !(aText = pGrfNd->GetAlternateText()).Len() && + !(aText = pGrfNd->GetTitle()).Len() && (!GetRealURL( *pGrfNd, aText ) || !aText.Len())) { nResId = STR_COMCORE_READERROR; diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx index fe15b7fabbfa..817fa3c257aa 100644 --- a/sw/source/core/docnode/ndnotxt.cxx +++ b/sw/source/core/docnode/ndnotxt.cxx @@ -48,6 +48,10 @@ #include <istyleaccess.hxx> #include <SwStyleNameMapper.hxx> +// --> OD 2009-07-13 #i73249# +#include <frmfmt.hxx> +// <-- + SwNoTxtNode::SwNoTxtNode( const SwNodeIndex & rWhere, const BYTE nNdType, SwGrfFmtColl *pGrfColl, @@ -250,19 +254,57 @@ Graphic SwNoTxtNode::GetGraphic() const return aRet; } +// --> OD 2009-07-14 #i73249# +void SwNoTxtNode::SetTitle( const String& rTitle, bool bBroadcast ) +{ + // Title attribute of <SdrObject> replaces own AlternateText attribute + SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(GetFlyFmt()); + ASSERT( pFlyFmt, + "<SwNoTxtNode::SetTitle(..)> - missing <SwFlyFrmFmt> instance" ); + if ( !pFlyFmt ) + { + return; + } -void SwNoTxtNode::SetAlternateText( const String& rTxt, sal_Bool bBroadcast ) + pFlyFmt->SetObjTitle( rTitle, bBroadcast ); +} + +const String SwNoTxtNode::GetTitle() const { - if( bBroadcast ) + const SwFlyFrmFmt* pFlyFmt = dynamic_cast<const SwFlyFrmFmt*>(GetFlyFmt()); + ASSERT( pFlyFmt, + "<SwNoTxtNode::GetTitle(..)> - missing <SwFlyFrmFmt> instance" ); + if ( !pFlyFmt ) { - SwStringMsgPoolItem aOld( RES_ALT_TEXT_CHANGED, aAlternateText ); - SwStringMsgPoolItem aNew( RES_ALT_TEXT_CHANGED, rTxt ); - aAlternateText = rTxt; - Modify( &aOld, &aNew ); + return aEmptyStr; } - else + + return pFlyFmt->GetObjTitle(); +} + +void SwNoTxtNode::SetDescription( const String& rDescription, bool bBroadcast ) +{ + SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(GetFlyFmt()); + ASSERT( pFlyFmt, + "<SwNoTxtNode::SetDescription(..)> - missing <SwFlyFrmFmt> instance" ); + if ( !pFlyFmt ) { - aAlternateText = rTxt; + return; } + + pFlyFmt->SetObjDescription( rDescription, bBroadcast ); } +const String SwNoTxtNode::GetDescription() const +{ + const SwFlyFrmFmt* pFlyFmt = dynamic_cast<const SwFlyFrmFmt*>(GetFlyFmt()); + ASSERT( pFlyFmt, + "<SwNoTxtNode::GetDescription(..)> - missing <SwFlyFrmFmt> instance" ); + if ( !pFlyFmt ) + { + return aEmptyStr; + } + + return pFlyFmt->GetObjDescription(); +} +// <-- diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 0035a8880ba9..4553038f3abb 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -383,27 +383,27 @@ void SwEditShell::GetGrfNms( String* pGrfName, String* pFltName, // alternativen Text abfragen/setzen -const String& SwEditShell::GetAlternateText() const -{ - SwPaM* pCrsr = GetCrsr(); - const SwNoTxtNode* pNd; - if( !pCrsr->HasMark() && 0 != ( pNd = pCrsr->GetNode()->GetNoTxtNode()) ) - return pNd->GetAlternateText(); - - return aEmptyStr; -} - - -void SwEditShell::SetAlternateText( const String& rTxt ) -{ - SwPaM* pCrsr = GetCrsr(); - SwNoTxtNode* pNd; - if( !pCrsr->HasMark() && 0 != ( pNd = pCrsr->GetNode()->GetNoTxtNode()) ) - { - pNd->SetAlternateText( rTxt, sal_True ); - GetDoc()->SetModified(); - } -} +//const String& SwEditShell::GetAlternateText() const +//{ +// SwPaM* pCrsr = GetCrsr(); +// const SwNoTxtNode* pNd; +// if( !pCrsr->HasMark() && 0 != ( pNd = pCrsr->GetNode()->GetNoTxtNode()) ) +// return pNd->GetAlternateText(); + +// return aEmptyStr; +//} + + +//void SwEditShell::SetAlternateText( const String& rTxt ) +//{ +// SwPaM* pCrsr = GetCrsr(); +// SwNoTxtNode* pNd; +// if( !pCrsr->HasMark() && 0 != ( pNd = pCrsr->GetNode()->GetNoTxtNode()) ) +// { +// pNd->SetAlternateText( rTxt, sal_True ); +// GetDoc()->SetModified(); +// } +//} const PolyPolygon *SwEditShell::GetGraphicPolygon() const diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index b6cc1bf56fad..1b18dc178dae 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -2068,3 +2068,99 @@ void SwFEShell::GetConnectableFrmFmts(SwFrmFmt & rFmt, EndAction(); } + +// --> OD 2009-07-13 #i73249# +const String SwFEShell::GetObjTitle() const +{ + String aTitle; + + if ( Imp()->HasDrawView() ) + { + const SdrMarkList *pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList(); + if ( pMrkList->GetMarkCount() == 1 ) + { + const SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj(); + const SwFrmFmt* pFmt = FindFrmFmt( pObj ); + if ( pFmt->Which() == RES_FLYFRMFMT ) + { + aTitle = dynamic_cast<const SwFlyFrmFmt*>(pFmt)->GetObjTitle(); + } + else + { + aTitle = pObj->GetTitle(); + } + } + } + + return aTitle; +} + +void SwFEShell::SetObjTitle( const String& rTitle ) +{ + if ( Imp()->HasDrawView() ) + { + const SdrMarkList *pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList(); + if ( pMrkList->GetMarkCount() == 1 ) + { + SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj(); + SwFrmFmt* pFmt = FindFrmFmt( pObj ); + if ( pFmt->Which() == RES_FLYFRMFMT ) + { + GetDoc()->SetFlyFrmTitle( *(dynamic_cast<SwFlyFrmFmt*>(pFmt)), + rTitle ); + } + else + { + pObj->SetTitle( rTitle ); + } + } + } +} + +const String SwFEShell::GetObjDescription() const +{ + String aDescription; + + if ( Imp()->HasDrawView() ) + { + const SdrMarkList *pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList(); + if ( pMrkList->GetMarkCount() == 1 ) + { + const SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj(); + const SwFrmFmt* pFmt = FindFrmFmt( pObj ); + if ( pFmt->Which() == RES_FLYFRMFMT ) + { + aDescription = dynamic_cast<const SwFlyFrmFmt*>(pFmt)->GetObjDescription(); + } + else + { + aDescription = pObj->GetDescription(); + } + } + } + + return aDescription; +} + +void SwFEShell::SetObjDescription( const String& rDescription ) +{ + if ( Imp()->HasDrawView() ) + { + const SdrMarkList *pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList(); + if ( pMrkList->GetMarkCount() == 1 ) + { + SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj(); + SwFrmFmt* pFmt = FindFrmFmt( pObj ); + if ( pFmt->Which() == RES_FLYFRMFMT ) + { + GetDoc()->SetFlyFrmDescription( *(dynamic_cast<SwFlyFrmFmt*>(pFmt)), + rDescription ); + } + else + { + pObj->SetDescription( rDescription ); + } + } + } +} +// <-- diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 47c9af2d5028..55fbb54bd718 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -956,7 +956,8 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const SwGrfNode* pGrfNd = pDoc->GetNodes().MakeGrfNode( rIdx, sFile, sFilter, &aTmpGrf, pColl, (SwAttrSet*)GetpSwAttrSet() ); - pGrfNd->SetAlternateText( GetAlternateText() ); + pGrfNd->SetTitle( GetTitle() ); + pGrfNd->SetDescription( GetDescription() ); pGrfNd->SetContour( HasContour(), HasAutomaticContour() ); return pGrfNd; } diff --git a/sw/source/core/inc/undoflystrattr.hxx b/sw/source/core/inc/undoflystrattr.hxx new file mode 100644 index 000000000000..86bffc64bdb1 --- /dev/null +++ b/sw/source/core/inc/undoflystrattr.hxx @@ -0,0 +1,60 @@ +/************************************************************************* + * + * 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: SwUndoPageDesc.hxx,v $ + * $Revision: 1.7 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _UNDO_FLY_STR_ATTR_HXX +#define _UNDO_FLY_STR_ATTR_HXX + +#include <undobj.hxx> +#include <swundo.hxx> + +class SwFlyFrmFmt; +class String; + +class SwUndoFlyStrAttr : public SwUndo +{ + public: + SwUndoFlyStrAttr( SwFlyFrmFmt& rFlyFrmFmt, + const SwUndoId eUndoId, + const String& sOldStr, + const String& sNewStr ); + virtual ~SwUndoFlyStrAttr(); + + virtual void Undo( SwUndoIter & rIt ); + virtual void Redo( SwUndoIter & rIt ); + virtual void Repeat( SwUndoIter & rIt ); + + virtual SwRewriter GetRewriter() const; + + private: + SwFlyFrmFmt& mrFlyFrmFmt; + const String msOldStr; + const String msNewStr; +}; + +#endif // _UNDO_FLY_STR_ATTR_HXX diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 9279a169b0a5..7601f4ae370d 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2880,6 +2880,80 @@ sal_Bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const return sal_True; } +// --> OD 2009-07-14 #i73249# +void SwFlyFrmFmt::SetObjTitle( const String& rTitle, bool bBroadcast ) +{ + SdrObject* pMasterObject = FindSdrObject(); + ASSERT( pMasterObject, + "<SwNoTxtNode::SetObjTitle(..)> - missing <SdrObject> instance" ); + if ( !pMasterObject ) + { + return; + } + + if( bBroadcast ) + { + SwStringMsgPoolItem aOld( RES_TITLE_CHANGED, pMasterObject->GetTitle() ); + SwStringMsgPoolItem aNew( RES_TITLE_CHANGED, rTitle ); + pMasterObject->SetTitle( rTitle ); + Modify( &aOld, &aNew ); + } + else + { + pMasterObject->SetTitle( rTitle ); + } +} + +const String SwFlyFrmFmt::GetObjTitle() const +{ + const SdrObject* pMasterObject = FindSdrObject(); + ASSERT( pMasterObject, + "<SwFlyFrmFmt::GetObjTitle(..)> - missing <SdrObject> instance" ); + if ( !pMasterObject ) + { + return aEmptyStr; + } + + return pMasterObject->GetTitle(); +} + +void SwFlyFrmFmt::SetObjDescription( const String& rDescription, bool bBroadcast ) +{ + SdrObject* pMasterObject = FindSdrObject(); + ASSERT( pMasterObject, + "<SwFlyFrmFmt::SetDescription(..)> - missing <SdrObject> instance" ); + if ( !pMasterObject ) + { + return; + } + + if( bBroadcast ) + { + SwStringMsgPoolItem aOld( RES_DESCRIPTION_CHANGED, pMasterObject->GetDescription() ); + SwStringMsgPoolItem aNew( RES_DESCRIPTION_CHANGED, rDescription ); + pMasterObject->SetDescription( rDescription ); + Modify( &aOld, &aNew ); + } + else + { + pMasterObject->SetDescription( rDescription ); + } +} + +const String SwFlyFrmFmt::GetObjDescription() const +{ + const SdrObject* pMasterObject = FindSdrObject(); + ASSERT( pMasterObject, + "<SwNoTxtNode::GetDescription(..)> - missing <SdrObject> instance" ); + if ( !pMasterObject ) + { + return aEmptyStr; + } + + return pMasterObject->GetDescription(); +} +// <-- + /** SwFlyFrmFmt::IsBackgroundTransparent - for #99657# OD 22.08.2002 - overloading virtual method and its default implementation, diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index c6afe50b5826..50abb4e9c7c7 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -467,7 +467,8 @@ SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const (SwAttrSet*)GetpSwAttrSet() ); pOLENd->SetChartTblName( GetChartTblName() ); - pOLENd->SetAlternateText( GetAlternateText() ); + pOLENd->SetTitle( GetTitle() ); + pOLENd->SetDescription( GetDescription() ); pOLENd->SetContour( HasContour(), HasAutomaticContour() ); pOLENd->SetAspect( GetAspect() ); // the replacement image must be already copied diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 614678d34978..1784ad946e41 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -698,7 +698,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) const SwNoTxtFrm* pNoTxtFrm = static_cast<const SwNoTxtFrm*>(pFly->Lower()); const SwNoTxtNode* pNoTxtNode = static_cast<const SwNoTxtNode*>(pNoTxtFrm->GetNode()); - const String aAlternateTxt( pNoTxtNode->GetAlternateText() ); + const String aAlternateTxt( pNoTxtNode->GetTitle() ); mpPDFExtOutDevData->SetAlternateText( aAlternateTxt ); } } diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 555ff8e39171..0a06f88bc371 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -718,40 +718,49 @@ String SwTOXPara::GetURL() const { const SwTxtNode * pTxtNd = static_cast<const SwTxtNode *>(pNd); - //if( MAXLEVEL >= pTxtNd->GetTxtColl()->GetOutlineLevel()) //#outline level,zhaojianwei - if ( pTxtNd->GetAttrOutlineLevel() > 0) //<-end,zhaojianwei - { - aTxt = '#'; - const SwNumRule * pRule = pTxtNd->GetNumRule(); - if( pRule ) - { - // dann noch die rel. Nummer davor setzen - const USHORT nCurrLevel = static_cast<USHORT>(pTxtNd->GetActualListLevel()); - if(nCurrLevel <= MAXLEVEL) - { - // --> OD 2005-11-02 #i51089 - TUNING# - if ( pTxtNd->GetNum() ) - { - SwNumberTree::tNumberVector aNumVector = - pTxtNd->GetNumberVector(); - - for( USHORT n = 0; n <= nCurrLevel; ++n ) - { - int nNum = aNumVector[ n ]; - nNum -= ( pRule->Get( n ).GetStart() - 1 ); - ( aTxt += String::CreateFromInt32( nNum )) += '.'; - } - } - else - { - ASSERT( false, - "<SwTOXPara::GetURL()> - text node with numbering rule, but without number. This is a serious defect -> inform OD" ); - } - } - } - aTxt += pTxtNd->GetExpandTxt(); - ( aTxt += cMarkSeperator ).AppendAscii( pMarkToOutline ); - } + // --> OD 2009-08-05 #i103265# +// //if( MAXLEVEL >= pTxtNd->GetTxtColl()->GetOutlineLevel()) //#outline level,zhaojianwei +// if ( pTxtNd->GetAttrOutlineLevel() > 0) //<-end,zhaojianwei +// { +// aTxt = '#'; +// const SwNumRule * pRule = pTxtNd->GetNumRule(); +// if( pRule ) +// { +// // dann noch die rel. Nummer davor setzen +// const USHORT nCurrLevel = static_cast<USHORT>(pTxtNd->GetActualListLevel()); +// if(nCurrLevel <= MAXLEVEL) +// { +// // --> OD 2005-11-02 #i51089 - TUNING# +// if ( pTxtNd->GetNum() ) +// { +// SwNumberTree::tNumberVector aNumVector = +// pTxtNd->GetNumberVector(); + +// for( USHORT n = 0; n <= nCurrLevel; ++n ) +// { +// int nNum = aNumVector[ n ]; +// nNum -= ( pRule->Get( n ).GetStart() - 1 ); +// ( aTxt += String::CreateFromInt32( nNum )) += '.'; +// } +// } +// else +// { +// ASSERT( false, +// "<SwTOXPara::GetURL()> - text node with numbering rule, but without number. This is a serious defect -> inform OD" ); +// } +// } +// } +// aTxt += pTxtNd->GetExpandTxt(); +// ( aTxt += cMarkSeperator ).AppendAscii( pMarkToOutline ); +// } + SwDoc* pDoc = const_cast<SwDoc*>( pTxtNd->GetDoc() ); + ::sw::mark::IMark const * const pMark = pDoc->getIDocumentMarkAccess()->getMarkForTxtNode( + *(pTxtNd), + IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK); + aTxt = '#'; + const String aMarkName( pMark->GetName() ); + aTxt += aMarkName; + // <-- } break; @@ -943,4 +952,3 @@ BOOL SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase) } return bRet; } - diff --git a/sw/source/core/undo/makefile.mk b/sw/source/core/undo/makefile.mk index 12665cf26daa..4c7a332eec74 100644 --- a/sw/source/core/undo/makefile.mk +++ b/sw/source/core/undo/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -68,6 +68,7 @@ SLOFILES = \ $(SLO)$/undel.obj \ $(SLO)$/undobj.obj \ $(SLO)$/undobj1.obj \ + $(SLO)$/undoflystrattr.obj \ $(SLO)$/undraw.obj \ $(SLO)$/unfmco.obj \ $(SLO)$/unins.obj \ diff --git a/sw/source/core/undo/undo.hrc b/sw/source/core/undo/undo.hrc index afd06130c042..87e49ec0d377 100644 --- a/sw/source/core/undo/undo.hrc +++ b/sw/source/core/undo/undo.hrc @@ -153,9 +153,11 @@ #define STR_UNDO_ROW_DELETE (CORE_REPEAT_END +64) #define STR_UNDO_PAGEDESC_RENAME (CORE_REPEAT_END +65) #define STR_NUMDOWN (CORE_REPEAT_END +66) +#define STR_UNDO_FLYFRMFMT_TITLE (CORE_REPEAT_END +67) +#define STR_UNDO_FLYFRMFMT_DESCRITPTION (CORE_REPEAT_END +68) // !!!!!! umsetzen !!!!!!!!!!! umsetzen !!!!!!!!!!! umsetzen !!!! -#define CORE_UNDO_END STR_NUMDOWN// !!!! umsetzen !!! +#define CORE_UNDO_END STR_UNDO_FLYFRMFMT_DESCRITPTION// !!!! umsetzen !!! // UI-Undo Klammerungen #define UI_UNDO_BEGIN (CORE_UNDO_END + 1) diff --git a/sw/source/core/undo/undo.src b/sw/source/core/undo/undo.src index 6d184240e5fc..6437d9f60306 100644 --- a/sw/source/core/undo/undo.src +++ b/sw/source/core/undo/undo.src @@ -650,3 +650,11 @@ String STR_PARAGRAPH_UNDO { Text[ en-US ] = "paragraph"; }; +String STR_UNDO_FLYFRMFMT_TITLE +{ + Text[ en-US ] = "Change object title of $1"; +}; +String STR_UNDO_FLYFRMFMT_DESCRITPTION +{ + Text[ en-US ] = "Change object description of $1"; +}; diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index ae9535ced2f7..d84b12ba5bda 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -734,28 +734,43 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, } else { - bool bMaybe = false; - if( *pStt <= pBkmk->GetMarkPos() && pBkmk->GetMarkPos() <= *pEnd ) + // --> OD 2009-08-06 #i92125# + bool bKeepCrossRefBkmk( false ); { - if( pBkmk->GetMarkPos() == *pEnd || - ( *pStt == pBkmk->GetMarkPos() && pBkmk->IsExpanded() ) ) - bMaybe = true; - else - bSavePos = true; + if ( rMark.nNode == rPoint.nNode && + ( IDocumentMarkAccess::GetType(*pBkmk) == + IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK || + IDocumentMarkAccess::GetType(*pBkmk) == + IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK ) ) + { + bKeepCrossRefBkmk = true; + } } - if( pBkmk->IsExpanded() && - *pStt <= pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() <= *pEnd ) + if ( !bKeepCrossRefBkmk ) { - if( bSavePos || bSaveOtherPos || - ( pBkmk->GetOtherMarkPos() < *pEnd && pBkmk->GetOtherMarkPos() > *pStt ) ) + bool bMaybe = false; + if ( *pStt <= pBkmk->GetMarkPos() && pBkmk->GetMarkPos() <= *pEnd ) { - if( bMaybe ) + if( pBkmk->GetMarkPos() == *pEnd || + ( *pStt == pBkmk->GetMarkPos() && pBkmk->IsExpanded() ) ) + bMaybe = true; + else bSavePos = true; - bSaveOtherPos = true; + } + if( pBkmk->IsExpanded() && + *pStt <= pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() <= *pEnd ) + { + if( bSavePos || bSaveOtherPos || + ( pBkmk->GetOtherMarkPos() < *pEnd && pBkmk->GetOtherMarkPos() > *pStt ) ) + { + if( bMaybe ) + bSavePos = true; + bSaveOtherPos = true; + } } } - // delete cross-reference bookmark at <pStt>, if only part of - // <pEnd> text node content is deleted. + // <-- + // --> OD 2007-10-17 #i81002# const bool bDifferentTxtNodesAtMarkAndPoint( rMark.nNode != rPoint.nNode && @@ -765,6 +780,8 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, if( !bSavePos && !bSaveOtherPos && bDifferentTxtNodesAtMarkAndPoint && dynamic_cast< const ::sw::mark::CrossRefBookmark* >(pBkmk)) { + // delete cross-reference bookmark at <pStt>, if only part of + // <pEnd> text node content is deleted. if( pStt->nNode == pBkmk->GetMarkPos().nNode && pEnd->nContent.GetIndex() != pEnd->nNode.GetNode().GetTxtNode()->Len() ) diff --git a/sw/source/core/undo/undoflystrattr.cxx b/sw/source/core/undo/undoflystrattr.cxx new file mode 100644 index 000000000000..767f300a53b0 --- /dev/null +++ b/sw/source/core/undo/undoflystrattr.cxx @@ -0,0 +1,107 @@ +/************************************************************************* + * + * 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: SwUndoPageDesc.cxx,v $ + * $Revision: 1.12 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sw.hxx" + +#include <undoflystrattr.hxx> +#include <frmfmt.hxx> + +SwUndoFlyStrAttr::SwUndoFlyStrAttr( SwFlyFrmFmt& rFlyFrmFmt, + const SwUndoId eUndoId, + const String& sOldStr, + const String& sNewStr ) + : SwUndo( eUndoId ), + mrFlyFrmFmt( rFlyFrmFmt ), + msOldStr( sOldStr ), + msNewStr( sNewStr ) +{ + ASSERT( eUndoId == UNDO_FLYFRMFMT_TITLE || + eUndoId == UNDO_FLYFRMFMT_DESCRIPTION, + "<SwUndoFlyStrAttr::SwUndoFlyStrAttr(..)> - unexpected undo id --> Undo will not work" ); +} + +SwUndoFlyStrAttr::~SwUndoFlyStrAttr() +{ +} + +void SwUndoFlyStrAttr::Undo( SwUndoIter& ) +{ + switch ( GetId() ) + { + case UNDO_FLYFRMFMT_TITLE: + { + mrFlyFrmFmt.SetObjTitle( msOldStr, true ); + } + break; + case UNDO_FLYFRMFMT_DESCRIPTION: + { + mrFlyFrmFmt.SetObjDescription( msOldStr, true ); + } + break; + default: + { + } + } +} + +void SwUndoFlyStrAttr::Redo( SwUndoIter& ) +{ + switch ( GetId() ) + { + case UNDO_FLYFRMFMT_TITLE: + { + mrFlyFrmFmt.SetObjTitle( msNewStr, true ); + } + break; + case UNDO_FLYFRMFMT_DESCRIPTION: + { + mrFlyFrmFmt.SetObjDescription( msNewStr, true ); + } + break; + default: + { + } + } +} + +void SwUndoFlyStrAttr::Repeat( SwUndoIter& ) +{ + // no repeat +} + +SwRewriter SwUndoFlyStrAttr::GetRewriter() const +{ + SwRewriter aResult; + + aResult.AddRule( UNDO_ARG1, mrFlyFrmFmt.GetName() ); + + return aResult; +} diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 8d754eca0879..7237cb59ed02 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1082,18 +1082,48 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: } } } - else if( FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID && eType != FLYCNTTYPE_FRM ) + // --> OD 2009-07-13 #i73249# + // Attribute AlternativeText was never published. + // Now it has been replaced by Attribute Title - valid for all <SwXFrame> instances +// else if( FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID && eType != FLYCNTTYPE_FRM ) +// { +// const :: SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); +// if(pIdx) +// { +// SwNodeIndex aIdx(*pIdx, 1); +// SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); +// OUString uTemp; +// aValue >>= uTemp; +// pNoTxt->SetAlternateText(uTemp); +// } +// } + // New attribute Title + else if( FN_UNO_TITLE == pEntry->nWID ) { - const :: SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); - if(pIdx) - { - SwNodeIndex aIdx(*pIdx, 1); - SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); - OUString uTemp; - aValue >>= uTemp; - pNoTxt->SetAlternateText(uTemp); - } + SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt); + ASSERT( pFmt, + "unexpected type of <pFmt> --> crash" ); + OUString uTemp; + aValue >>= uTemp; + const String sTitle(uTemp); + // assure that <SdrObject> instance exists. + GetOrCreateSdrObject( pFlyFmt ); + pFlyFmt->GetDoc()->SetFlyFrmTitle( *(pFlyFmt), sTitle ); } + // New attribute Description + else if( FN_UNO_DESCRIPTION == pEntry->nWID ) + { + SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt); + ASSERT( pFmt, + "unexpected type of <pFmt> --> crash" ); + OUString uTemp; + aValue >>= uTemp; + const String sDescription(uTemp); + // assure that <SdrObject> instance exists. + GetOrCreateSdrObject( pFlyFmt ); + pFlyFmt->GetDoc()->SetFlyFrmDescription( *(pFlyFmt), sDescription ); + } + // <-- else if(FN_UNO_FRAME_STYLE_NAME == pEntry->nWID) { SwFrmFmt *pFrmFmt = lcl_GetFrmFmt( aValue, pFmt->GetDoc() ); @@ -1562,17 +1592,40 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) { aAny <<= OUString(SwStyleNameMapper::GetProgName(pFmt->DerivedFrom()->GetName(), nsSwGetPoolIdFromName::GET_POOLID_FRMFMT ) ); } - else if(eType != FLYCNTTYPE_FRM && - FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID) + // --> OD 2009-07-13 #i73249# + // Attribute AlternativeText was never published. + // Now it has been replaced by Attribute Title - valid for all <SwXFrame> instances +// else if(eType != FLYCNTTYPE_FRM && +// FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID) +// { +// const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); +// if(pIdx) +// { +// SwNodeIndex aIdx(*pIdx, 1); +// SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); +// aAny <<= OUString(pNoTxt->GetAlternateText()); +// } +// } + else if( FN_UNO_TITLE == pEntry->nWID ) { - const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); - if(pIdx) - { - SwNodeIndex aIdx(*pIdx, 1); - SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); - aAny <<= OUString(pNoTxt->GetAlternateText()); - } + SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt); + ASSERT( pFmt, + "unexpected type of <pFmt> --> crash" ); + // assure that <SdrObject> instance exists. + GetOrCreateSdrObject( pFlyFmt ); + aAny <<= OUString(pFlyFmt->GetObjTitle()); } + // New attribute Description + else if( FN_UNO_DESCRIPTION == pEntry->nWID ) + { + SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt); + ASSERT( pFmt, + "unexpected type of <pFmt> --> crash" ); + // assure that <SdrObject> instance exists. + GetOrCreateSdrObject( pFlyFmt ); + aAny <<= OUString(pFlyFmt->GetObjDescription()); + } + // <-- else if(eType == FLYCNTTYPE_GRF && (rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_ACTUAL_SIZE)))) { @@ -1828,16 +1881,40 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) } } } - else if( eType != FLYCNTTYPE_FRM && FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID ) + // --> OD 2009-07-13 #i73249# + // Attribute AlternativeText was never published. + // Now it has been replaced by Attribute Title - valid for all <SwXFrame> instances +// else if( eType != FLYCNTTYPE_FRM && FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID ) +// { +// const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); +// if(pIdx) +// { +// SwNodeIndex aIdx(*pIdx, 1); +// SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); +// pNoTxt->SetAlternateText(aEmptyStr); +// } +// } + // New attribute Title + else if( FN_UNO_TITLE == pEntry->nWID ) { - const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); - if(pIdx) - { - SwNodeIndex aIdx(*pIdx, 1); - SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); - pNoTxt->SetAlternateText(aEmptyStr); - } + SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt); + ASSERT( pFmt, + "unexpected type of <pFmt> --> crash" ); + // assure that <SdrObject> instance exists. + GetOrCreateSdrObject( pFlyFmt ); + pFlyFmt->GetDoc()->SetFlyFrmTitle( *(pFlyFmt), aEmptyStr ); } + // New attribute Description + else if( FN_UNO_DESCRIPTION == pEntry->nWID ) + { + SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt); + ASSERT( pFmt, + "unexpected type of <pFmt> --> crash" ); + // assure that <SdrObject> instance exists. + GetOrCreateSdrObject( pFlyFmt ); + pFlyFmt->GetDoc()->SetFlyFrmDescription( *(pFlyFmt), aEmptyStr ); + } + // <-- else { SwDoc* pDoc = pFmt->GetDoc(); @@ -2194,9 +2271,9 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan const ::uno::Any* pAutoContour; if(pProps->GetProperty(FN_UNO_IS_AUTOMATIC_CONTOUR, 0, pAutoContour)) setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_IS_AUTOMATIC_CONTOUR)), *pAutoContour); - const ::uno::Any* pAltText; - if(pProps->GetProperty(FN_UNO_ALTERNATIVE_TEXT, 0, pAltText)) - setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ALTERNATIVE_TEXT)), *pAltText); +// const ::uno::Any* pAltText; +// if(pProps->GetProperty(FN_UNO_ALTERNATIVE_TEXT, 0, pAltText)) +// setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ALTERNATIVE_TEXT)), *pAltText); } else { @@ -2305,6 +2382,20 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan const ::uno::Any* pReplacement; if( pProps->GetProperty(FN_UNO_REPLACEMENT_GRAPHIC, 0, pReplacement) ) setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_GRAPHIC)), *pReplacement); + // --> OD 2009-07-13 #i73249# + // new attribute Title + const ::uno::Any* pTitle; + if ( pProps->GetProperty(FN_UNO_TITLE, 0, pTitle) ) + { + setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_TITLE)), *pTitle); + } + // new attribute Description + const ::uno::Any* pDescription; + if ( pProps->GetProperty(FN_UNO_DESCRIPTION, 0, pDescription) ) + { + setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_DESCRIPTION)), *pDescription); + } + // <-- } else throw lang::IllegalArgumentException(); diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 74b794bd9308..3730da041f90 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -309,6 +309,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() // OD 18.09.2003 #i18732# - add property // OD 2004-05-05 #i28701# - add property 'WrapInfluenceOnObjPos' +// OD 2009-07-13 #i73249# - add properties 'Title' and 'Description' #define COMMON_FRAME_PROPERTIES \ { SW_PROP_NMID(UNO_NAME_ANCHOR_PAGE_NO), RES_ANCHOR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, MID_ANCHOR_PAGENUM }, \ { SW_PROP_NMID(UNO_NAME_ANCHOR_TYPE), RES_ANCHOR, CPPU_E2T(CPPUTYPE_TXTCNTANCHOR), PROPERTY_NONE, MID_ANCHOR_ANCHORTYPE}, \ @@ -369,6 +370,8 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { SW_PROP_NMID(UNO_NAME_Z_ORDER), FN_UNO_Z_ORDER, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, 0}, \ { SW_PROP_NMID(UNO_NAME_IS_FOLLOWING_TEXT_FLOW), RES_FOLLOW_TEXT_FLOW, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, \ { SW_PROP_NMID(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, MID_WRAP_INFLUENCE}, \ + { SW_PROP_NMID(UNO_NAME_TITLE), FN_UNO_TITLE, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, \ + { SW_PROP_NMID(UNO_NAME_DESCRIPTION), FN_UNO_DESCRIPTION, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, \ { SW_PROP_NMID(UNO_NAME_LAYOUT_SIZE), WID_LAYOUT_SIZE, CPPU_E2T(CPPUTYPE_AWTSIZE), PropertyAttribute::MAYBEVOID | PropertyAttribute::READONLY, 0 }, @@ -1123,7 +1126,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { SW_PROP_NMID(UNO_NAME_GRAPHIC_FILTER), FN_UNO_GRAPHIC_FILTER, CPPU_E2T(CPPUTYPE_OUSTRING), 0, 0 }, { SW_PROP_NMID(UNO_NAME_GRAPHIC), FN_UNO_GRAPHIC, CPPU_E2T(CPPUTYPE_REFXGRAPHIC), 0, 0 }, { SW_PROP_NMID(UNO_NAME_ACTUAL_SIZE), FN_UNO_ACTUAL_SIZE, CPPU_E2T(CPPUTYPE_AWTSIZE), PropertyAttribute::READONLY, CONVERT_TWIPS}, - { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), FN_UNO_ALTERNATIVE_TEXT,CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE , 0 }, +// { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), FN_UNO_ALTERNATIVE_TEXT,CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE , 0 }, { SW_PROP_NMID(UNO_NAME_CONTOUR_POLY_POLYGON), FN_PARAM_COUNTOUR_PP, CPPU_E2T(CPPUTYPE_PNTSEQSEQ), PropertyAttribute::MAYBEVOID, 0 }, { SW_PROP_NMID(UNO_NAME_IS_PIXEL_CONTOUR), FN_UNO_IS_PIXEL_CONTOUR, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0 }, { SW_PROP_NMID(UNO_NAME_IS_AUTOMATIC_CONTOUR), FN_UNO_IS_AUTOMATIC_CONTOUR , CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0 }, @@ -1158,7 +1161,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { SW_PROP_NMID(UNO_NAME_GRAPHIC_URL), FN_UNO_REPLACEMENT_GRAPHIC_URL, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0 }, { SW_PROP_NMID(UNO_NAME_GRAPHIC), FN_UNO_REPLACEMENT_GRAPHIC, CPPU_E2T(CPPUTYPE_REFXGRAPHIC), PropertyAttribute::MAYBEVOID, 0 }, { SW_PROP_NMID(UNO_NAME_COMPONENT),FN_UNO_COMPONENT, CPPU_E2T(CPPUTYPE_REFCOMPONENT), PropertyAttribute::READONLY, 0}, - { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), FN_UNO_ALTERNATIVE_TEXT,CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE , 0 }, +// { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), FN_UNO_ALTERNATIVE_TEXT,CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE , 0 }, {0,0,0,0,0,0} }; aMapEntriesArr[nPropertyId] = aEmbeddedPropertyMap_Impl; diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx index 262adba59ddf..7b58a4120de7 100644 --- a/sw/source/core/unocore/unoprnms.cxx +++ b/sw/source/core/unocore/unoprnms.cxx @@ -778,7 +778,8 @@ const SwPropNameTab aPropNameTab = { /* 0733 CHAR_OVERLINE */ {MAP_CHAR_LEN("CharOverline")}, /* 0734 CHAR_OVERLINE_COLOR */ {MAP_CHAR_LEN("CharOverlineColor")}, /* 0735 CHAR_OVERLINE_HAS_COLOR */ {MAP_CHAR_LEN("CharOverlineHasColor")}, -/* 0736 UNO_NAME_OUTLINE_LEVEL */ {MAP_CHAR_LEN("OutlineLevel")}//#outline level,add<-zhaojianwei Outlinelevel +/* 0736 UNO_NAME_OUTLINE_LEVEL */ {MAP_CHAR_LEN("OutlineLevel")},//#outline level,add<-zhaojianwei Outlinelevel +/* 0737 UNO_NAME_DESCRIPTION */ {MAP_CHAR_LEN("Description")} }; const SwPropNameLen& SwGetPropName( USHORT nId ) diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index e79016c96364..92f9e1adb3d5 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -1640,7 +1640,7 @@ static Writer& OutHTML_FrmFmtGrfNode( Writer& rWrt, const SwFrmFmt& rFrmFmt, ULONG nFrmFlags = bInCntnr ? HTML_FRMOPTS_IMG_CNTNR : HTML_FRMOPTS_IMG; if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) && !bInCntnr ) nFrmFlags |= HTML_FRMOPTS_IMG_CSS1; - OutHTML_Image( rWrt, rFrmFmt, aGrfNm, pGrfNd->GetAlternateText(), + OutHTML_Image( rWrt, rFrmFmt, aGrfNm, pGrfNd->GetTitle(), pGrfNd->GetTwipSize(), nFrmFlags, pMarkToGraphic ); return rWrt; diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 48faa240cf7f..904648f75bd2 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -743,7 +743,7 @@ IMAGE_SETEVENT: } if( sAltNm.Len() ) - pGrfNd->SetAlternateText( sAltNm ); + pGrfNd->SetTitle( sAltNm ); if( bSetTwipSize ) pGrfNd->SetTwipSize( aGrfSz ); diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 9dbcc420ebfd..21e409c48530 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -491,7 +491,7 @@ void SwHTMLParser::InsertEmbed() SwNoTxtNode *pNoTxtNd = pDoc->GetNodes()[ pFlyFmt->GetCntnt().GetCntntIdx() ->GetIndex()+1 ]->GetNoTxtNode(); - pNoTxtNd->SetAlternateText( aAlt ); + pNoTxtNd->SetTitle( aAlt ); // Ggf Frames anlegen und auto-geb. Rahmen registrieren if( !bHidden ) @@ -665,7 +665,7 @@ void SwHTMLParser::EndObject() SwNoTxtNode *pNoTxtNd = pDoc->GetNodes()[ pFlyFmt->GetCntnt().GetCntntIdx() ->GetIndex()+1 ]->GetNoTxtNode(); - pNoTxtNd->SetAlternateText( pAppletImpl->GetAltText() ); + pNoTxtNd->SetTitle( pAppletImpl->GetAltText() ); // Ggf Frames anlegen und auto-geb. Rahmen registrieren RegisterFlyFrm( pFlyFmt ); @@ -798,7 +798,7 @@ void SwHTMLParser::EndApplet() SwNoTxtNode *pNoTxtNd = pDoc->GetNodes()[ pFlyFmt->GetCntnt().GetCntntIdx() ->GetIndex()+1 ]->GetNoTxtNode(); - pNoTxtNd->SetAlternateText( pAppletImpl->GetAltText() ); + pNoTxtNd->SetTitle( pAppletImpl->GetAltText() ); // Ggf Frames anlegen und auto-geb. Rahmen registrieren RegisterFlyFrm( pFlyFmt ); @@ -975,7 +975,7 @@ void SwHTMLParser::InsertFloatingFrame() SwNoTxtNode *pNoTxtNd = pDoc->GetNodes()[ pFlyFmt->GetCntnt().GetCntntIdx() ->GetIndex()+1 ]->GetNoTxtNode(); - pNoTxtNd->SetAlternateText( aAlt ); + pNoTxtNd->SetTitle( aAlt ); // Ggf Frames anlegen und auto-geb. Rahmen registrieren RegisterFlyFrm( pFlyFmt ); @@ -1254,7 +1254,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt, // ALT, WIDTH, HEIGHT, HSPACE, VSPACE, ALIGN if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) && !bHiddenEmbed ) nFrmOpts |= HTML_FRMOPTS_OLE_CSS1; - rHTMLWrt.OutFrmFmtOptions( rFrmFmt, pOLENd->GetAlternateText(), + rHTMLWrt.OutFrmFmtOptions( rFrmFmt, pOLENd->GetTitle(), aEndTags, nFrmOpts ); if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) && !bHiddenEmbed ) rHTMLWrt.OutCSS1_FrmFmtOptions( rFrmFmt, nFrmOpts ); @@ -1398,7 +1398,7 @@ Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const SwFrmFmt& rFrmFmt, ULONG nFlags = bInCntnr ? HTML_FRMOPTS_GENIMG_CNTNR : HTML_FRMOPTS_GENIMG; OutHTML_Image( rWrt, rFrmFmt, aGrfNm, - pOLENd->GetAlternateText(), pOLENd->GetTwipSize(), + pOLENd->GetTitle(), pOLENd->GetTwipSize(), nFlags, pMarkToOLE ); } diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index 8de1d5b92201..018ca0c0b5bb 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -464,8 +464,6 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( aAny = rPropSet->getPropertyValue( sFrameStyleName ); aAny >>= sStyle; } - // svg:desc - exportAlternativeText( rPropSet, rPropSetInfo ); const XMLPropertyState *aStates[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; switch( nType ) @@ -766,6 +764,8 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( // Lastly the stuff common to each of Applet/Plugin/Floating Frame exportEvents( rPropSet ); - exportAlternativeText( rPropSet, rPropSetInfo ); + // --> OD 2009-07-22 #i73249# + exportTitleAndDescription( rPropSet, rPropSetInfo ); + // <-- exportContour( rPropSet, rPropSetInfo ); } diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src index e13d2418cc58..b0884997dbd9 100644 --- a/sw/source/ui/app/mn.src +++ b/sw/source/ui/app/mn.src @@ -956,6 +956,10 @@ Menu MN_GRF_POPUPMENU { MN_ALIGN_FRAME MN_MOUSE_FRAME_WITH_CONTOUR + // --> OD 2009-07-14 #i73249# + SEPARATOR ; + MN_TITLE_DESCRIPTION_SHAPE + // <-- SEPARATOR ; MenuItem { @@ -989,6 +993,10 @@ Menu MN_OLE_POPUPMENU { MN_ALIGN_FRAME MN_MOUSE_FRAME_WITH_CONTOUR + // --> OD 2009-07-14 #i73249# + SEPARATOR ; + MN_TITLE_DESCRIPTION_SHAPE + // <-- SEPARATOR ; MenuItem { @@ -1013,6 +1021,10 @@ Menu MN_FRM_POPUPMENU { MN_ALIGN_FRAME MN_MOUSE_FRAME_WITHOUT_CONTOUR + // --> OD 2009-07-07 #i73249# + SEPARATOR ; + MN_TITLE_DESCRIPTION_SHAPE + // <-- SEPARATOR ; MN_FRM MN_FRM_CAPTION_ITEM diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx index bf60c53372b2..13f832acfccf 100644 --- a/sw/source/ui/docvw/edtwin2.cxx +++ b/sw/source/ui/docvw/edtwin2.cxx @@ -94,6 +94,11 @@ #include <PostItMgr.hxx> #include <fmtfld.hxx> +// --> OD 2009-08-18 #i104300# +#include <IDocumentMarkAccess.hxx> +#include <ndtxt.hxx> +// <-- + /*-------------------------------------------------------------------- Beschreibung: KeyEvents --------------------------------------------------------------------*/ @@ -205,6 +210,38 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) sSuffix.EqualsAscii( pMarkToOLE )) sTxt = sTxt.Copy( 0, nFound - 1); } + // --> OD 2009-08-18 #i104300# + // special handling if target is a cross-reference bookmark + { + String sTmpSearchStr = sTxt.Copy( 1, sTxt.Len() ); + IDocumentMarkAccess* const pMarkAccess = + rSh.getIDocumentMarkAccess(); + IDocumentMarkAccess::const_iterator_t ppBkmk = + pMarkAccess->findBookmark( sTmpSearchStr ); + if ( ppBkmk != pMarkAccess->getBookmarksEnd() && + IDocumentMarkAccess::GetType( *(ppBkmk->get()) ) + == IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK ) + { + SwTxtNode* pTxtNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTxtNode(); + if ( pTxtNode ) + { + sTxt = pTxtNode->GetExpandTxt( 0, pTxtNode->Len(), true, true ); + + if( sTxt.Len() ) + { + sTxt.EraseAllChars( 0xad ); + for( sal_Unicode* p = sTxt.GetBufferAccess(); *p; ++p ) + { + if( *p < 0x20 ) + *p = 0x20; + else if(*p == 0x2011) + *p = '-'; + } + } + } + } + } + // <-- // --> OD 2007-07-26 #i80029# BOOL bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); if ( !bExecHyperlinks ) diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx index 3f61bab9a20e..f7957a66077a 100644 --- a/sw/source/ui/shells/frmsh.cxx +++ b/sw/source/ui/shells/frmsh.cxx @@ -50,6 +50,10 @@ #include <sfx2/request.hxx> #include <sfx2/objface.hxx> #include <svx/hlnkitem.hxx> +// --> OD 2009-07-07 #i73249# +#include <svx/svdview.hxx> +#include <vcl/msgbox.hxx> +// <-- #include <fmturl.hxx> @@ -82,6 +86,9 @@ #include <shells.hrc> #include "swabstdlg.hxx" #include "misc.hrc" +// --> OD 2009-07-14 #i73249# +#include <svx/dialogs.hrc> +// <-- using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -414,8 +421,13 @@ void SwFrameShell::Execute(SfxRequest &rReq) } aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell()))); aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName())); - if(nSel & nsSelectionType::SEL_OLE) - aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + if( nSel & nsSelectionType::SEL_OLE ) + { + // --> OD 2009-07-13 #i73249# +// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) ); + // <-- + } const SwRect &rPg = rSh.GetAnyCurRect(RECT_PAGE); SwFmtFrmSize aFrmSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height()); @@ -472,7 +484,10 @@ void SwFrameShell::Execute(SfxRequest &rReq) } if (SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_ALT_NAME, TRUE, &pItem)) { - rSh.SetAlternateText(((const SfxStringItem*)pItem)->GetValue()); + // --> OD 2009-07-13 #i73249# +// rSh.SetAlternateText(((const SfxStringItem*)pItem)->GetValue()); + rSh.SetObjTitle(((const SfxStringItem*)pItem)->GetValue()); + // <-- } // Vorlagen-AutoUpdate SwFrmFmt* pFmt = rSh.GetCurFrmFmt(); @@ -587,6 +602,40 @@ void SwFrameShell::Execute(SfxRequest &rReq) rReq.SetReturnValue(SfxBoolItem(nSlot, bMirror)); } break; + // --> OD 2009-07-14 #i73249# + case FN_TITLE_DESCRIPTION_SHAPE: + { + bUpdateMgr = FALSE; + SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList(); + if ( pSdrView && + pSdrView->GetMarkedObjectCount() == 1 ) + { + String aDescription(rSh.GetObjDescription()); + String aTitle(rSh.GetObjTitle()); + + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "Dialogdiet fail!"); + AbstractSvxObjectTitleDescDialog* pDlg = + pFact->CreateSvxObjectTitleDescDialog( NULL, + aTitle, + aDescription, + RID_SVXDLG_OBJECT_TITLE_DESC ); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); + + if ( pDlg->Execute() == RET_OK ) + { + pDlg->GetDescription(aDescription); + pDlg->GetTitle(aTitle); + + rSh.SetObjDescription(aDescription); + rSh.SetObjTitle(aTitle); + } + + delete pDlg; + } + } + break; + // <-- default: ASSERT( !this, "falscher Dispatcher" ); return; @@ -822,6 +871,20 @@ void SwFrameShell::GetState(SfxItemSet& rSet) rSet.DisableItem( nWhich ); } break; + // --> OD 2009-07-07 #i73249# + case FN_TITLE_DESCRIPTION_SHAPE: + { + SwWrtShell &rWrtSh = GetShell(); + SdrView* pSdrView = rWrtSh.GetDrawViewWithValidMarkList(); + if ( !pSdrView || + pSdrView->GetMarkedObjectCount() != 1 ) + { + rSet.DisableItem( nWhich ); + } + + } + break; + // <-- default: /* do nothing */; break; diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 62a3af2f6f28..7203d9c91ebb 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -154,8 +154,13 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put( aFrmSize ); aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName())); - if(nSlot == FN_FORMAT_GRAFIC_DLG) - aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + if ( nSlot == FN_FORMAT_GRAFIC_DLG ) + { + // --> OD 2009-07-13 #i73249# +// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) ); + // <-- + } pRect = &rSh.GetAnyCurRect(RECT_PAGE_PRT); aFrmSize.SetWidth( pRect->Width() ); @@ -324,10 +329,15 @@ void SwGrfShell::Execute(SfxRequest &rReq) sFilterNm, 0 ); } } - if( SFX_ITEM_SET == pSet->GetItemState( + if ( SFX_ITEM_SET == pSet->GetItemState( FN_SET_FRM_ALT_NAME, TRUE, &pItem )) - rSh.SetAlternateText( - ((const SfxStringItem*)pItem)->GetValue() ); + { + // --> OD 2009-07-13 #i73249# +// rSh.SetAlternateText( +// ((const SfxStringItem*)pItem)->GetValue() ); + rSh.SetObjTitle( ((const SfxStringItem*)pItem)->GetValue() ); + // <-- + } SfxItemSet aGrfSet( rSh.GetAttrPool(), RES_GRFATR_BEGIN, RES_GRFATR_END-1 ); |