[Libreoffice-commits] core.git: 3 commits - sc/source svtools/source sw/source

2015-01-13 Thread Eike Rathke
 sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx |5 +
 svtools/source/contnr/contentenumeration.cxx   |5 +
 sw/source/core/fields/docufld.cxx  |4 +---
 3 files changed, 3 insertions(+), 11 deletions(-)

New commits:
commit 1e2bf2e0bd0c8078870055d5a4fd0a81ffcc5029
Author: Eike Rathke er...@redhat.com
Date:   Tue Jan 13 17:16:56 2015 +0100

remove superfluous Date and Time temporaries

Change-Id: I7a64027eb58c86ccf9d1b4968c287f0f861f2ec2

diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index 4e0355f..f112a44 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -931,9 +931,7 @@ OUString SwDocInfoFieldType::Expand( sal_uInt16 nSub, 
sal_uInt32 nFormat,
 {
 OUString aName( xDocProps-getAuthor() );
 util::DateTime uDT( xDocProps-getCreationDate() );
-Date aD(uDT);
-tools::Time aT(uDT);
-DateTime aDate(aD,aT);
+DateTime aDate(uDT);
 if( nSub == DI_CREATE )
 ;   // das wars schon!!
 else if( nSub == DI_CHANGE )
commit 35fa188305600fa950a07e4b6c4f6a77a42d32d6
Author: Eike Rathke er...@redhat.com
Date:   Tue Jan 13 16:59:30 2015 +0100

eliminate unnecessary macro

Change-Id: I0dceccbe1275298b43f50296da075ae95694d39a

diff --git a/svtools/source/contnr/contentenumeration.cxx 
b/svtools/source/contnr/contentenumeration.cxx
index b601bf5..2c8e296 100644
--- a/svtools/source/contnr/contentenumeration.cxx
+++ b/svtools/source/contnr/contentenumeration.cxx
@@ -50,9 +50,6 @@ namespace svt
 #define ROW_IS_FLOPPY   11
 #define ROW_IS_COMPACTDISC  12
 
-#define CONVERT_DATETIME( aUnoDT, aToolsDT ) \
-aToolsDT = ::DateTime( aUnoDT );
-
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::Sequence;
 using ::com::sun::star::uno::Exception;
@@ -260,7 +257,7 @@ namespace svt
 
 if ( bContainsDate )
 {
-CONVERT_DATETIME( aDT, pData-maModDate );
+pData-maModDate = ::DateTime( aDT );
 }
 
 if ( pData-mbIsFolder )
commit a38e1be92c50ce6feba41402201f09605fedaa5a
Author: Eike Rathke er...@redhat.com
Date:   Tue Jan 13 16:30:44 2015 +0100

use DateTime instead of separate Date and Time

Change-Id: I82cccaabbcf481367e55c52682d0ff765b4a8671

diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx 
b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index a85ec22..3703f62 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -433,10 +433,7 @@ void ScXMLChangeTrackingImportHelper::EndChangeAction()
 
 void ScXMLChangeTrackingImportHelper::ConvertInfo(const ScMyActionInfo aInfo, 
OUString rUser, DateTime aDateTime)
 {
-Date aDate(aInfo.aDateTime);
-tools::Time aTime(aInfo.aDateTime);
-aDateTime.SetDate( aDate.GetDate() );
-aDateTime.SetTime( aTime.GetTime() );
+aDateTime = DateTime( aInfo.aDateTime);
 
 // old files didn't store nanoseconds, enable again
 if ( aInfo.aDateTime.NanoSeconds )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 3 commits - sc/source svtools/source

2014-04-01 Thread Caolán McNamara
 sc/source/filter/oox/drawingmanager.cxx |   14 +++---
 sc/source/ui/view/tabvwsh4.cxx  |3 -
 svtools/source/svhtml/parhtml.cxx   |   68 ++--
 3 files changed, 38 insertions(+), 47 deletions(-)

New commits:
commit 9a0e6204bba686945a1ab249b741d703ed3e84a6
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Apr 1 13:38:37 2014 +0100

coverity#735505 Logically dead code

Change-Id: I7e7abf9192ee34c9f1c2080268751503aae90e55

diff --git a/svtools/source/svhtml/parhtml.cxx 
b/svtools/source/svhtml/parhtml.cxx
index f54c741..93e8c2d 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -562,59 +562,51 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
 break;
 }
 
+assert(cChar != 0);
+
 // 1 == Non Breaking Space
 // 2 == SoftHyphen
 
-if( cChar  3U )
+if (cChar == 1 || cChar == 2)
 {
 if( '' == cBreak )
 {
 // When reading the content of a tag we have
 // to change it to ' ' or '-'
-switch( cChar )
-{
-case 1U: cChar = ' '; break;
-case 2U: cChar = '-'; break;
-default:
-DBG_ASSERT( cChar==1U,
-\0x00 should be handled already! );
-break;
-}
+if( 1U == cChar )
+cChar = ' ';
+else //2U
+cChar = '-';
 }
 else
 {
 // If not scanning a tag return token
 aToken += sTmpBuffer.makeStringAndClear();
-if( cChar )
+
+if( !aToken.isEmpty() )
 {
-if( !aToken.isEmpty() )
-{
-// restart with character
-nNextCh = '';
-DBG_ASSERT( rInput.Tell()-nStreamPos ==
-
(sal_uLong)(nPos+1)*GetCharSize(),
-Wrong stream position );
-DBG_ASSERT( nlLinePos-nLinePos ==
-(sal_uLong)(nPos+1),
-Wrong line position );
-rInput.Seek( nStreamPos );
-nlLinePos = nLinePos;
-ClearTxtConvContext();
-return HTML_TEXTTOKEN;
-}
-
-// Hack: _GetNextChar shall not read the
-// next character
-if( ';' != nNextCh )
-aToken +=  ;
-if( 1U == cChar )
-return HTML_NONBREAKSPACE;
-if( 2U == cChar )
-return HTML_SOFTHYPH;
+// restart with character
+nNextCh = '';
+DBG_ASSERT( rInput.Tell()-nStreamPos ==
+
(sal_uLong)(nPos+1)*GetCharSize(),
+Wrong stream position );
+DBG_ASSERT( nlLinePos-nLinePos ==
+(sal_uLong)(nPos+1),
+Wrong line position );
+rInput.Seek( nStreamPos );
+nlLinePos = nLinePos;
+ClearTxtConvContext();
+return HTML_TEXTTOKEN;
 }
-aToken += ;
-aToken += sEntityBuffer.makeStringAndClear();
-break;
+
+// Hack: _GetNextChar shall not read the
+// next character
+if( ';' !=