[Libreoffice-commits] .: 2 commits - sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Jul 5 01:35:34 PDT 2011


 sw/source/core/docnode/ndcopy.cxx |   21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 9a2ea84314277a16e1819dddd440c288f25afe87
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Fri Jul 1 18:23:07 2011 +0200

    copied the IFieldMark::GetParameters too

diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 0ad5349..dc6723f 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -203,6 +203,14 @@ namespace
                 const ::sw::mark::IFieldmark* const pOldFieldmark = dynamic_cast< const ::sw::mark::IFieldmark* >(pMark);
                 pNewFieldmark->SetFieldname(pOldFieldmark->GetFieldname());
                 pNewFieldmark->SetFieldHelptext(pOldFieldmark->GetFieldHelptext());
+                ::sw::mark::IFieldmark::parameter_map_t* pNewParams = pNewFieldmark->GetParameters();
+                const ::sw::mark::IFieldmark::parameter_map_t* pOldParams = pOldFieldmark->GetParameters();
+                ::sw::mark::IFieldmark::parameter_map_t::const_iterator pIt = pOldParams->begin();
+                while ( pIt != pOldParams->end() )
+                {
+                    pNewParams->insert( *pIt );
+                    pIt++;
+                }
             }
 
             ::sfx2::Metadatable const*const pMetadatable(
commit 8d2a9aefbfe0bb18463d83e0eac887cff066c5c6
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jul 1 16:35:39 2011 +0200

    Copy fieldmark properties when copying/pasting, fdo#38374.

diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 57b5b18..0ad5349 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -186,14 +186,25 @@ namespace
             // Explicitly try to get exactly the same name as in the source
             // because NavigatorReminders, DdeBookmarks etc. ignore the proposed name
             pDestDoc->getIDocumentMarkAccess()->renameMark(pNewMark, pMark->GetName());
+
+            // copying additional attributes for bookmarks or fieldmarks
             ::sw::mark::IBookmark* const pNewBookmark =
                 dynamic_cast< ::sw::mark::IBookmark* const >(pNewMark);
-            if(pNewBookmark) /* copying additional attributes for bookmarks */
+            if(pNewBookmark)
             {
                 const ::sw::mark::IBookmark* const pOldBookmark = dynamic_cast< const ::sw::mark::IBookmark* >(pMark);
                 pNewBookmark->SetKeyCode(pOldBookmark->GetKeyCode());
                 pNewBookmark->SetShortName(pOldBookmark->GetShortName());
             }
+            ::sw::mark::IFieldmark* const pNewFieldmark =
+                dynamic_cast< ::sw::mark::IFieldmark* const >(pNewMark);
+            if(pNewFieldmark)
+            {
+                const ::sw::mark::IFieldmark* const pOldFieldmark = dynamic_cast< const ::sw::mark::IFieldmark* >(pMark);
+                pNewFieldmark->SetFieldname(pOldFieldmark->GetFieldname());
+                pNewFieldmark->SetFieldHelptext(pOldFieldmark->GetFieldHelptext());
+            }
+
             ::sfx2::Metadatable const*const pMetadatable(
                     dynamic_cast< ::sfx2::Metadatable const* >(pMark));
             ::sfx2::Metadatable      *const pNewMetadatable(


More information about the Libreoffice-commits mailing list