Hello,
when I set the property 'ScaleToPages' to 1, I get still '0' returned.
The output on the cmd-line is:
default ScaleToPages = 0
changed ScaleToPages = 0
I would expect:
default ScaleToPages = 0
changed ScaleToPages = 1
My code reads first the default value of ScaleToPages', sets it to 1 and
re-reads its value:
Reference< XSpreadsheetDocument > xSpreadsheetDoc ...
Reference< XStyleFamiliesSupplier > xFamiliesSupplier{ xSpreadsheetDoc,
UN
O_QUERY_THROW };
Reference< XStyleLoader2 > xTargetStyleLoader{
xFamiliesSupplier->getStyle
Families(), UNO_QUERY_THROW };
Sequence< PropertyValue > aOptions =
xTargetStyleLoader->getStyleLoaderOpt
ions();
xTargetStyleLoader->loadStylesFromDocument( xComponent, aOptions);
Reference< XNameAccess > xFamilies{
xFamiliesSupplier->getStyleFamilies(),
UNO_QUERY_THROW };
Reference< XNameContainer > xFamily{
xFamilies->getByName("PageStyles"), U
NO_QUERY_THROW };
Reference< XStyle > xStyle{ xFamily->getByName("Default"),
UNO_QUERY_THROW
};
Reference< XPropertySet > xStyleProps{ xStyle, UNO_QUERY_THROW };
OUString propName = "ScaleToPages";
sal_Int32 x = -1;
assert( xStyleProps->getPropertyValue( propName) >>= x);
std::cout << "default ScaleToPages = " << x << std::endl;
x = 1;
Any X;
X <<= x;
xStyleProps->setPropertyValue( propName, X);
x = -1;
assert( xStyleProps->getPropertyValue( propName) >>= x);
std::cout << "changed ScaleToPages = " << x << std::endl;
What I'm missing?
best regards,
Oliver