summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-03-17 07:56:20 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-03-30 04:34:14 +0200
commitf104581dd1c3daf8e0ccd5c027259f12792cd26e (patch)
treed2126a39d29763effa1f8a6936e2eccb86482a97
parent8a5482912b5091ede68b823e4e29cfb2f74c6315 (diff)
fix a few places around range for conditional format API
Change-Id: I544314004e32465248a1ec228dddcf84052d7d2d
-rw-r--r--sc/source/ui/unoobj/condformatuno.cxx21
1 files changed, 20 insertions, 1 deletions
diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx
index 8ceee90db1b0..7113129dc5f3 100644
--- a/sc/source/ui/unoobj/condformatuno.cxx
+++ b/sc/source/ui/unoobj/condformatuno.cxx
@@ -16,6 +16,7 @@
#include "miscuno.hxx"
#include "cellsuno.hxx"
+#include "convuno.hxx"
#include <vcl/svapp.hxx>
#include <rtl/ustring.hxx>
@@ -341,7 +342,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCondFormatObj::getPropertySet
}
void SAL_CALL ScCondFormatObj::setPropertyValue(
- const OUString& aPropertyName, const uno::Any& /*aValue*/ )
+ const OUString& aPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException, std::exception)
@@ -359,6 +360,23 @@ void SAL_CALL ScCondFormatObj::setPropertyValue(
throw lang::IllegalArgumentException();
break;
case CondFormat_Range:
+ {
+ uno::Reference<sheet::XSheetCellRanges> xRange;
+ if (aValue >>= xRange)
+ {
+ ScConditionalFormat* pFormat = getCoreObject();
+ uno::Sequence<table::CellRangeAddress> aRanges =
+ xRange->getRangeAddresses();
+ ScRangeList aTargetRange;
+ for (size_t i = 0, n = aRanges.getLength(); i < n; ++i)
+ {
+ ScRange aRange;
+ ScUnoConversion::FillScRange(aRange, aRanges[i]);
+ aTargetRange.Join(aRange);
+ }
+ pFormat->SetRange(aTargetRange);
+ }
+ }
break;
default:
SAL_WARN("sc", "unknown property");
@@ -387,6 +405,7 @@ uno::Any SAL_CALL ScCondFormatObj::getPropertyValue( const OUString& aPropertyNa
const ScRangeList& rRange = getCoreObject()->GetRange();
uno::Reference<sheet::XSheetCellRanges> xRange;
xRange.set(new ScCellRangesObj(mpDocShell, rRange));
+ aAny <<= xRange;
}
break;
default: