Hello,
when I set the property 'ScaleToPages' to 1, '0' will be returned ... seams that setting 'ScaleToPages' has no effect?!
The output of my code at the cmd-line is:
default ScaleToPages = 0
changed ScaleToPages = 0
I would expect:
default ScaleToPages = 0
changed ScaleToPages = 1
My code reads and outputs the default value of 'ScaleToPages' first, then it is set to 1 and
read again:
Reference< XSpreadsheetDocument > xSpreadsheetDoc ...
Reference< XStyleFamiliesSupplier > xFamiliesSupplier{ xSpreadsheetDoc, UNO_QUERY_THROW };
Reference< XStyleLoader2 > xTargetStyleLoader{ xFamiliesSupplier->getStyleFamilies(), UNO_QUERY_THROW };
Sequence< PropertyValue > aOptions = xTargetStyleLoader->getStyleLoaderOptions();
xTargetStyleLoader->loadStylesFromDocument( xComponent, aOptions);
Reference< XNameAccess > xFamilies{ xFamiliesSupplier->getStyleFamilies(), UNO_QUERY_THROW };
Reference< XNameContainer > xFamily{ xFamilies->getByName("PageStyles"), UNO_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; // 'x' should be 1
What I'm missing?
best regards,
Oliver