summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-17 21:41:22 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-17 23:57:22 +0100
commita8406aa3e0225989d57b185958b0c43b1304ec4a (patch)
treeb7eb04befeff6d535a186335aef0a1789b59afc4
parent5c0e79f821260f0b72f35af74bb47f7ff91d5954 (diff)
fix the month date formats, related fdo#58340
Change-Id: If9f716fd2d2f5a8488451121067ee068673b3b7a
-rw-r--r--sc/source/core/data/conditio.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index e02f89e22fb2..2b4fa0c49c56 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1705,7 +1705,12 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
}
break;
case condformat::LASTMONTH:
- if( rActDate.GetYear() == aCellDate.GetYear() )
+ if( rActDate.GetMonth() == 1 )
+ {
+ if( aCellDate.GetMonth() == 12 && rActDate.GetYear() == aCellDate.GetYear() + 1 )
+ return true;
+ }
+ else if( rActDate.GetYear() == aCellDate.GetYear() )
{
if( rActDate.GetMonth() == aCellDate.GetMonth() + 1)
return true;
@@ -1719,7 +1724,12 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
}
break;
case condformat::NEXTMONTH:
- if( rActDate.GetYear() == aCellDate.GetYear() )
+ if( rActDate.GetMonth() == 12 )
+ {
+ if( aCellDate.GetMonth() == 1 && rActDate.GetYear() == aCellDate.GetYear() - 1 )
+ return true;
+ }
+ else if( rActDate.GetYear() == aCellDate.GetYear() )
{
if( rActDate.GetMonth() == aCellDate.GetMonth() - 1)
return true;