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
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
- [libreoffice-users] setting property value 'ScaleToPages' at a spreadsheet with no effect? · Oliver Kowalke
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.