summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-09-07 15:38:19 +0000
committerOliver Bolte <obo@openoffice.org>2009-09-07 15:38:19 +0000
commit47ba649c43ed59963c33b6786b7dde30864e298e (patch)
tree826cc232bbb0e06c95199c4aca28a0da36d7344b /xmloff
parent9fc697a9453d8334a9d923c70ec30ef23fd16e16 (diff)
CWS-TOOLING: integrate CWS calcsheetdata
2009-08-13 16:18:48 +0200 nn r274950 : #i102616# shared/remote files, better handling of formula results 2009-08-12 11:17:30 +0200 nn r274884 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274622 (milestone: DEV300:m54) 2009-08-12 10:30:47 +0200 nn r274881 : #i102616# some clean-up 2009-08-11 19:01:18 +0200 nn r274876 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-11 19:00:49 +0200 nn r274875 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-10 19:12:04 +0200 nn r274835 : #i102616# detective, notes, encoding, error handling 2009-08-07 11:18:46 +0200 nn r274751 : #i102616# use new method SvXMLAutoStylePoolP::AddNamed 2009-08-07 11:18:15 +0200 nn r274750 : #i102616# new method SvXMLAutoStylePoolP::AddNamed 2009-08-06 18:02:42 +0200 nn r274740 : #i102616# modification: shapes, notes, pending row heights; skip sheets in export iterator 2009-08-05 18:41:59 +0200 nn r274694 : #i102616# handle text styles in notes 2009-08-03 18:55:59 +0200 nn r274594 : #i102616# handle text styles in cells 2009-07-31 19:00:06 +0200 nn r274548 : #i102616# handle styles for notes 2009-07-28 16:46:20 +0200 nn r274414 : missed a conflict 2009-07-28 14:01:56 +0200 nn r274404 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274203 (milestone: DEV300:m53) 2009-07-23 18:28:47 +0200 nn r274278 : #i102616# handle table styles 2009-07-22 15:40:24 +0200 nn r274244 : #i102616# handle row styles 2009-07-21 20:09:37 +0200 nn r274211 : #i102616# handle column styles 2009-07-16 13:00:18 +0200 nn r274043 : #i102616# invalidate all stream positions when inserting/deleting sheets 2009-07-15 17:41:15 +0200 nn r274021 : #i102616# don't collect cell styles twice for copied sheets 2009-07-14 18:36:11 +0200 nn r273985 : #i102616# allow to query stream position, clear buffer 2009-07-14 18:32:10 +0200 nn r273984 : #i102616# allow to specify a name for an autostyle 2009-07-09 22:01:23 +0200 nn r273870 : #i102616# copy stream for unchanged sheets 2009-07-08 18:11:42 +0200 nn r273844 : #i102616# store stream positions of sheets 2009-06-24 19:08:18 +0200 nn r273363 : #i102616# detect changed sheets since loading 2009-06-09 15:53:32 +0200 nn r272774 : #i102616# store automatic cell style information after loading
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/xmloff/nmspmap.hxx5
-rw-r--r--xmloff/inc/xmloff/xmlaustp.hxx4
-rw-r--r--xmloff/source/style/impastp3.cxx40
-rw-r--r--xmloff/source/style/impastp4.cxx41
-rw-r--r--xmloff/source/style/impastpl.hxx8
-rw-r--r--xmloff/source/style/xmlaustp.cxx7
6 files changed, 105 insertions, 0 deletions
diff --git a/xmloff/inc/xmloff/nmspmap.hxx b/xmloff/inc/xmloff/nmspmap.hxx
index baa8eb635a..9c221bc200 100644
--- a/xmloff/inc/xmloff/nmspmap.hxx
+++ b/xmloff/inc/xmloff/nmspmap.hxx
@@ -152,6 +152,11 @@ public:
sal_uInt16 GetFirstKey() const;
sal_uInt16 GetNextKey( sal_uInt16 nOldKey ) const;
+ /* Give access to all namespace definitions, including multiple entries
+ for the same key (needed for saving sheets separately in Calc).
+ This might be replaced by a better interface later. */
+ const NameSpaceHash& GetAllEntries() const { return aNameHash; }
+
static sal_Bool NormalizeOasisURN( ::rtl::OUString& rName );
static sal_Bool NormalizeW3URI( ::rtl::OUString& rName );
static sal_Bool NormalizeURI( ::rtl::OUString& rName );
diff --git a/xmloff/inc/xmloff/xmlaustp.hxx b/xmloff/inc/xmloff/xmlaustp.hxx
index 0593199828..36bb8e8b58 100644
--- a/xmloff/inc/xmloff/xmlaustp.hxx
+++ b/xmloff/inc/xmloff/xmlaustp.hxx
@@ -112,6 +112,10 @@ public:
sal_Bool Add( ::rtl::OUString& rName, sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties );
sal_Bool Add( ::rtl::OUString& rName, sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties );
+ /// Add an item set with a pre-defined name (needed for saving sheets separately in Calc).
+ sal_Bool AddNamed( const ::rtl::OUString& rName, sal_Int32 nFamily, const ::rtl::OUString& rParent,
+ const ::std::vector< XMLPropertyState >& rProperties );
+
/// Find an item set's name.
::rtl::OUString Find( sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties ) const;
::rtl::OUString Find( sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) const;
diff --git a/xmloff/source/style/impastp3.cxx b/xmloff/source/style/impastp3.cxx
index 87338c43fd..e6c8b8fb82 100644
--- a/xmloff/source/style/impastp3.cxx
+++ b/xmloff/source/style/impastp3.cxx
@@ -98,6 +98,46 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
///////////////////////////////////////////////////////////////////////////////
//
+// Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) with a given name.
+// If the name exists already, nothing is done. If a style with a different name and
+// the same properties exists, a new one is added (like with bDontSeek).
+//
+
+sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName )
+{
+ sal_Bool bAdded = sal_False;
+ sal_uInt32 i = 0;
+ sal_Int32 nProperties = rProperties.size();
+ sal_uInt32 nCount = maPropertiesList.Count();
+
+ for( i = 0; i < nCount; i++ )
+ {
+ SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i );
+ if( nProperties > (sal_Int32)pIS->GetProperties().size() )
+ {
+ continue;
+ }
+ else if( nProperties < (sal_Int32)pIS->GetProperties().size() )
+ {
+ break;
+ }
+ }
+
+ if( !pFamilyData->mpNameList->Seek_Entry( &rName, 0 ) )
+ {
+ SvXMLAutoStylePoolPropertiesP_Impl* pProperties =
+ new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties );
+ // ignore the generated name
+ pProperties->SetName( rName );
+ maPropertiesList.Insert( pProperties, i );
+ bAdded = sal_True;
+ }
+
+ return bAdded;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//
// Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list
//
diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx
index bd25f22321..daec835a1f 100644
--- a/xmloff/source/style/impastp4.cxx
+++ b/xmloff/source/style/impastp4.cxx
@@ -235,6 +235,47 @@ sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily,
return bRet;
}
+sal_Bool SvXMLAutoStylePoolP_Impl::AddNamed(const OUString& rName, sal_Int32 nFamily,
+ const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties )
+{
+ // get family and parent the same way as in Add()
+ sal_Bool bRet(sal_False);
+ ULONG nPos;
+
+ XMLFamilyData_Impl *pFamily = 0;
+ XMLFamilyData_Impl aTemporary( nFamily );
+ if( maFamilyList.Seek_Entry( &aTemporary, &nPos ) )
+ {
+ pFamily = maFamilyList.GetObject( nPos );
+ }
+
+ DBG_ASSERT( pFamily, "SvXMLAutoStylePool_Impl::Add: unknown family" );
+ if( pFamily )
+ {
+ SvXMLAutoStylePoolParentP_Impl aTmp( rParent );
+ SvXMLAutoStylePoolParentP_Impl *pParent = 0;
+
+ SvXMLAutoStylePoolParentsP_Impl *pParents = pFamily->mpParentList;
+ if( pParents->Seek_Entry( &aTmp, &nPos ) )
+ {
+ pParent = pParents->GetObject( nPos );
+ }
+ else
+ {
+ pParent = new SvXMLAutoStylePoolParentP_Impl( rParent );
+ pParents->Insert( pParent );
+ }
+
+ if( pParent->AddNamed( pFamily, rProperties, rName ) )
+ {
+ pFamily->mnCount++;
+ bRet = sal_True;
+ }
+ }
+
+ return bRet;
+}
+
OUString SvXMLAutoStylePoolP_Impl::AddToCache( sal_Int32 nFamily,
const OUString& rParent )
{
diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx
index f9fd80ca65..64aca01b6a 100644
--- a/xmloff/source/style/impastpl.hxx
+++ b/xmloff/source/style/impastpl.hxx
@@ -124,6 +124,8 @@ public:
const ::rtl::OUString& GetName() const { return msName; }
const ::std::vector< XMLPropertyState >& GetProperties() const { return maProperties; }
sal_uInt32 GetPos() const { return mnPos; }
+
+ void SetName( const ::rtl::OUString& rNew ) { msName = rNew; }
};
typedef SvXMLAutoStylePoolPropertiesP_Impl *SvXMLAutoStylePoolPropertiesPPtr;
@@ -150,6 +152,8 @@ public:
sal_Bool Add( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, ::rtl::OUString& rName, bool bDontSeek = false );
+ sal_Bool AddNamed( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, const ::rtl::OUString& rName );
+
::rtl::OUString Find( const XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties ) const;
const ::rtl::OUString& GetParent() const { return msParent; }
@@ -197,6 +201,10 @@ public:
const ::std::vector< XMLPropertyState >& rProperties,
sal_Bool bCache = sal_False,
bool bDontSeek = false );
+ sal_Bool AddNamed( const ::rtl::OUString& rName, sal_Int32 nFamily,
+ const ::rtl::OUString& rParent,
+ const ::std::vector< XMLPropertyState >& rProperties );
+
::rtl::OUString AddToCache( sal_Int32 nFamily,
const ::rtl::OUString& rParent );
::rtl::OUString Find( sal_Int32 nFamily, const ::rtl::OUString& rParent,
diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx
index 1d5204aca5..4ed59fd092 100644
--- a/xmloff/source/style/xmlaustp.cxx
+++ b/xmloff/source/style/xmlaustp.cxx
@@ -381,6 +381,13 @@ sal_Bool SvXMLAutoStylePoolP::Add(OUString& rName, sal_Int32 nFamily, const OUSt
return pImpl->Add(rName, nFamily, rParent, rProperties);
}
+sal_Bool SvXMLAutoStylePoolP::AddNamed( const OUString& rName, sal_Int32 nFamily, const OUString& rParent,
+ const ::std::vector< XMLPropertyState >& rProperties )
+
+{
+ return pImpl->AddNamed(rName, nFamily, rParent, rProperties);
+}
+
OUString SvXMLAutoStylePoolP::AddAndCache( sal_Int32 nFamily,
const vector< XMLPropertyState >& rProperties )
{