diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-12-03 20:52:12 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-12-06 12:43:00 +0100 |
commit | 4c00e8fb10437fcaefe8635ef390b78376938d15 (patch) | |
tree | fd001904cf7640a13bd4a3ef3521f1c2db93fa4b /sd/source/ui/unoidl/UnoDocumentSettings.cxx | |
parent | 30d6787b98131fce5a280f005b75e9d496f21573 (diff) |
Add image preffered DPI document setting, use it in Writer, Impress
This adds a "image preferred DPI" document setting, which is used
as a suggestion of the DPI that an image should have in the
document. This is currently used when the image is inserted into
the document (Writer, Impress/Draw) to resize it to the preferred
DPI value.
Change-Id: I3ee9d409257e3c6aa2ead05144ecbba7b3b916f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126334
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd/source/ui/unoidl/UnoDocumentSettings.cxx')
-rw-r--r-- | sd/source/ui/unoidl/UnoDocumentSettings.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index ec168b7e42d6..2515ea32eecc 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -148,6 +148,7 @@ enum SdDocumentSettingsPropertyHandles ,HANDLE_SLIDESPERHANDOUT, HANDLE_HANDOUTHORIZONTAL, HANDLE_EMBED_FONTS, HANDLE_EMBED_USED_FONTS, HANDLE_EMBED_LATIN_SCRIPT_FONTS, HANDLE_EMBED_ASIAN_SCRIPT_FONTS, HANDLE_EMBED_COMPLEX_SCRIPT_FONTS, + HANDLE_IMAGE_PREFERRED_DPI }; } @@ -218,6 +219,7 @@ enum SdDocumentSettingsPropertyHandles { OUString("EmbedLatinScriptFonts"), HANDLE_EMBED_LATIN_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0, 0 }, { OUString("EmbedAsianScriptFonts"), HANDLE_EMBED_ASIAN_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0, 0 }, { OUString("EmbedComplexScriptFonts"), HANDLE_EMBED_COMPLEX_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0, 0 }, + { OUString("ImagePreferredDPI"), HANDLE_IMAGE_PREFERRED_DPI, cppu::UnoType<sal_Int32>::get(), 0, 0 }, { OUString(), 0, css::uno::Type(), 0, 0 } }; @@ -1032,6 +1034,18 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries, } break; + case HANDLE_IMAGE_PREFERRED_DPI: + { + if (pValues->has<sal_Int32>()) + { + auto nNewValue = pValues->get<sal_Int32>(); + bChanged = (pDoc->getImagePreferredDPI() != nNewValue); + pDoc->setImagePreferredDPI(nNewValue); + bOk = true; + } + } + break; + default: throw UnknownPropertyException( OUString::number((*ppEntries)->mnHandle), static_cast<cppu::OWeakObject*>(this)); } @@ -1306,6 +1320,12 @@ DocumentSettings::_getPropertyValues( } break; + case HANDLE_IMAGE_PREFERRED_DPI: + { + *pValue <<= pDoc->getImagePreferredDPI(); + } + break; + default: throw UnknownPropertyException( OUString::number((*ppEntries)->mnHandle), static_cast<cppu::OWeakObject*>(this)); } |