summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-08-27 07:57:34 +0000
committerRüdiger Timm <rt@openoffice.org>2008-08-27 07:57:34 +0000
commitd17a2dc30bd2acc0ef0a269a65ff00300763b532 (patch)
treef2d052e0cfe0abd528ff7a48583391b2e3924b16 /xmloff
parentb6914fce813101c8be141c29877544bc10543a3f (diff)
INTEGRATION: CWS sw30bf13_DEV300 (1.2.60); FILE MERGED
2008/08/15 14:04:37 od 1.2.60.1: #i92811# - import of lists: -- assure that the first list with a certain list style uses the internal list style's default list id as its list id - export of lists: -- correct export of property text::continue-numbering
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/txtlists.cxx74
1 files changed, 71 insertions, 3 deletions
diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx
index 722eff69687f..04db36bd896b 100644
--- a/xmloff/source/text/txtlists.cxx
+++ b/xmloff/source/text/txtlists.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: txtlists.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -36,10 +36,17 @@
#include <tools/date.hxx>
#include <tools/time.hxx>
+// --> OD 2008-08-15 #i92811#
+#include "XMLTextListBlockContext.hxx"
+// <--
+
XMLTextListsHelper::XMLTextListsHelper()
: mpProcessedLists( 0 ),
msLastProcessedListId(),
msListStyleOfLastProcessedList(),
+ // --> OD 2008-08-15 #i92811#
+ mpMapListIdToListStyleDefaultListId( 0 ),
+ // <--
mpContinuingLists( 0 ),
mpListStack( 0 )
{
@@ -52,6 +59,13 @@ XMLTextListsHelper::~XMLTextListsHelper()
mpProcessedLists->clear();
delete mpProcessedLists;
}
+ // --> OD 2008-08-15 #i92811#
+ if ( mpMapListIdToListStyleDefaultListId )
+ {
+ mpMapListIdToListStyleDefaultListId->clear();
+ delete mpMapListIdToListStyleDefaultListId;
+ }
+ // <--
if ( mpContinuingLists )
{
mpContinuingLists->clear();
@@ -64,14 +78,16 @@ XMLTextListsHelper::~XMLTextListsHelper()
}
}
+// --> OD 2008-08-15 #i92811# - handling for parameter <sListStyleDefaultListId>
void XMLTextListsHelper::KeepListAsProcessed( ::rtl::OUString sListId,
::rtl::OUString sListStyleName,
- ::rtl::OUString sContinueListId )
+ ::rtl::OUString sContinueListId,
+ ::rtl::OUString sListStyleDefaultListId )
{
if ( IsListProcessed( sListId ) )
{
DBG_ASSERT( false,
- "<XMLTextListsHelper::AddList(..)> - list id already added" );
+ "<XMLTextListsHelper::KeepListAsProcessed(..)> - list id already added" );
return;
}
@@ -86,6 +102,25 @@ void XMLTextListsHelper::KeepListAsProcessed( ::rtl::OUString sListId,
msLastProcessedListId = sListId;
msListStyleOfLastProcessedList = sListStyleName;
+
+ // --> OD 2008-08-15 #i92811#
+ if ( sListStyleDefaultListId.getLength() != 0 )
+ {
+ if ( mpMapListIdToListStyleDefaultListId == 0 )
+ {
+ mpMapListIdToListStyleDefaultListId = new tMapForLists();
+ }
+
+ if ( mpMapListIdToListStyleDefaultListId->find( sListStyleName ) ==
+ mpMapListIdToListStyleDefaultListId->end() )
+ {
+ ::std::pair< ::rtl::OUString, ::rtl::OUString >
+ aListIdMapData( sListId, sListStyleDefaultListId );
+ (*mpMapListIdToListStyleDefaultListId)[ sListStyleName ] =
+ aListIdMapData;
+ }
+ }
+ // <--
}
sal_Bool XMLTextListsHelper::IsListProcessed( const ::rtl::OUString sListId ) const
@@ -165,6 +200,39 @@ const ::rtl::OUString& XMLTextListsHelper::GetListStyleOfLastProcessedList() con
return sNewListId;
}
+// --> OD 2008-08-15 #i92811#
+// provide list id for a certain list block for import
+::rtl::OUString XMLTextListsHelper::GetListIdForListBlock( XMLTextListBlockContext& rListBlock )
+{
+ ::rtl::OUString sListBlockListId( rListBlock.GetContinueListId() );
+ if ( sListBlockListId.getLength() == 0 )
+ {
+ sListBlockListId = rListBlock.GetListId();
+ }
+
+ if ( mpMapListIdToListStyleDefaultListId != 0 )
+ {
+ if ( sListBlockListId.getLength() != 0 )
+ {
+ const ::rtl::OUString sListStyleName =
+ GetListStyleOfProcessedList( sListBlockListId );
+
+ tMapForLists::const_iterator aIter =
+ mpMapListIdToListStyleDefaultListId->find( sListStyleName );
+ if ( aIter != mpMapListIdToListStyleDefaultListId->end() )
+ {
+ if ( (*aIter).second.first == sListBlockListId )
+ {
+ sListBlockListId = (*aIter).second.second;
+ }
+ }
+ }
+ }
+
+ return sListBlockListId;
+}
+// <--
+
void XMLTextListsHelper::StoreLastContinuingList( ::rtl::OUString sListId,
::rtl::OUString sContinuingListId )
{