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-18 00:12:51 +0100
commitc03d0664cfd060c0f9d706d574c15a396fb67a04 (patch)
treee00fc0165c7aa464aeec21b7fc7f9ca6eb863bce
parentfe0c61908011f3fee724d6466cd33e82b1c2944a (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 7a2fc99bbe48..e4d3d75ac804 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;