diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-06-15 17:48:17 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-06-15 18:03:20 +0200 |
commit | 42e41ea6d6ec40977cc339af529b2306840d31cb (patch) | |
tree | 6cc0d842d20e96ea37c39a4d7ff40472467f8935 /writerfilter | |
parent | fdo#46757 Word/character count incorrect with record changes enabled (diff) | |
download | core-42e41ea6d6ec40977cc339af529b2306840d31cb.tar.gz core-42e41ea6d6ec40977cc339af529b2306840d31cb.zip |
move DTTM2DateTime and DateTimeToOString to msfilter to avoid copy&paste
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 190b1bd4b0a0..699b42b2bbd7 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -150,47 +150,9 @@ static void lcl_putBorderProperty(std::stack<RTFParserState>& aStates, Id nId, R pAttributes->set(nId, pValue); } -// NEEDSWORK: DocxAttributeOutput's impl_AppendTwoDigits does the same. -static void lcl_AppendTwoDigits(OStringBuffer &rBuffer, sal_Int32 nNum) -{ - if ( nNum < 0 || nNum > 99 ) - { - rBuffer.append( "00" ); - return; - } - - if ( nNum < 10 ) - rBuffer.append( '0' ); - - rBuffer.append( nNum ); -} - -// NEEDSWORK: sw::ms::DTTM2DateTime and DocxAttributeOutput's -// impl_DateTimeToOString could be combined to do the same. static OString lcl_DTTM22OString(long lDTTM) { - sal_uInt16 lMin = (sal_uInt16)(lDTTM & 0x0000003F); - lDTTM >>= 6; - sal_uInt16 lHour= (sal_uInt16)(lDTTM & 0x0000001F); - lDTTM >>= 5; - sal_uInt16 lDay = (sal_uInt16)(lDTTM & 0x0000001F); - lDTTM >>= 5; - sal_uInt16 lMon = (sal_uInt16)(lDTTM & 0x0000000F); - lDTTM >>= 4; - sal_uInt16 lYear= (sal_uInt16)(lDTTM & 0x000001FF) + 1900; - - OStringBuffer aBuf; - aBuf.append(sal_Int32(lYear)); - aBuf.append('-'); - lcl_AppendTwoDigits(aBuf, lMon); - aBuf.append('-'); - lcl_AppendTwoDigits(aBuf, lDay); - aBuf.append('T'); - lcl_AppendTwoDigits(aBuf, lHour); - aBuf.append(':'); - lcl_AppendTwoDigits(aBuf, lMin); - aBuf.append(":00Z"); - return aBuf.makeStringAndClear(); + return msfilter::util::DateTimeToOString(msfilter::util::DTTM2DateTime(lDTTM)); } static writerfilter::Reference<Properties>::Pointer_t lcl_getBookmarkProperties(int nPos, OUString& rString) |