diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-08-28 19:47:53 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-08-28 19:48:57 +0200 |
commit | efc7e271384b161dcfbea0f97a3e3efc41823f16 (patch) | |
tree | b9a1744e7fed1d0a4c267a1baba9f41859f36234 /sc | |
parent | 7a8040665f40fbcb4fa58c036aa066f061abd9ba (diff) |
hopefully a working version for databar ext guid creation
Change-Id: Ide7261955168dc13b47b29705e22eb2c3154d24e
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 27 | ||||
-rw-r--r-- | sc/source/filter/inc/xecontent.hxx | 1 |
2 files changed, 26 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index ffdaa3fdc923..905073eadf09 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -54,6 +54,7 @@ #include "xehelper.hxx" #include "xestyle.hxx" #include "xename.hxx" +#include <rtl/uuid.h> using namespace ::oox; @@ -1080,6 +1081,25 @@ void XclExpColorScale::SaveXml( XclExpXmlStream& rStrm ) // OOXTODO: XML_extLst } +namespace { + +rtl::OString createGuidStringFromInt(sal_uInt8 nGuid[16]) +{ + rtl::OStringBuffer aBuffer; + aBuffer.append('{'); + for(size_t i = 0; i < 16; ++i) + { + aBuffer.append(static_cast<sal_Int32>(nGuid[i]), 16); + if(i == 3|| i == 5 || i == 7 || i == 9 ) + aBuffer.append('-'); + } + aBuffer.append('}'); + rtl::OString aString = aBuffer.makeStringAndClear(); + return aString.toAsciiUpperCase(); +} + +} + XclExpDataBar::XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, sal_Int32 nPriority, XclExtLstRef xExtLst ): XclExpRecord(), XclExpRoot( rRoot ), @@ -1101,7 +1121,10 @@ XclExpDataBar::XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rF xExtLst->AddRecord( XclExpExtRef(new XclExpExtCondFormat( *xExtLst.get() )) ); pParent = xExtLst->GetItem( XclExpExtDataBarType ); } - static_cast<XclExpExtCondFormat*>(xExtLst->GetItem( XclExpExtDataBarType ).get())->AddRecord( XclExpExtConditionalFormattingRef(new XclExpExtConditionalFormatting( *pParent, rFormat, aAddr, rtl::OString("{64A12B6B-50E9-436E-8939-DBE15E5BE1DC}") )) ); + sal_uInt8 nGuid[16]; + rtl_createUuid(nGuid, NULL, true); + maGuid = createGuidStringFromInt(nGuid); + static_cast<XclExpExtCondFormat*>(xExtLst->GetItem( XclExpExtDataBarType ).get())->AddRecord( XclExpExtConditionalFormattingRef(new XclExpExtConditionalFormatting( *pParent, rFormat, aAddr, maGuid) )); } } @@ -1130,7 +1153,7 @@ void XclExpDataBar::SaveXml( XclExpXmlStream& rStrm ) FSEND ); rWorksheet->startElementNS( XML_x14, XML_id, FSEND ); - rWorksheet->write( "{64A12B6B-50E9-436E-8939-DBE15E5BE1DC}" ); + rWorksheet->write( maGuid.getStr() ); rWorksheet->endElementNS( XML_x14, XML_id ); rWorksheet->endElement( XML_ext ); diff --git a/sc/source/filter/inc/xecontent.hxx b/sc/source/filter/inc/xecontent.hxx index c6388de0e66b..668641b06877 100644 --- a/sc/source/filter/inc/xecontent.hxx +++ b/sc/source/filter/inc/xecontent.hxx @@ -274,6 +274,7 @@ private: const ScDataBarFormat& mrFormat; sal_Int32 mnPriority; + rtl::OString maGuid; }; // ---------------------------------------------------------------------------- |