/mysqlc/

ro/cib/libreoffice-5-1 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/colorchoicecontext.cxx
AgeCommit message (Collapse)Author
2023-08-15ComplexColor various clean-up and (trivial) refactoringsTomaž Vajngerl
Don't allow access to member variables of ComplexColor and makes them private. Needs a lot of changes. Change "scheme" to "theme" to be more consistent. In LO we usually call the "theme color" what is usually refered to as "scheme color" in OOXML, where it is sometimes refered to as "scheme" and other times as theme color. Remove ThemeColor class which was replaced with CmplexColor some time ago. Remove un-needed includes and un-needed components. Use isValidThemeColor in many places where we check that the ComplexColor is of "Theme" type and that ThemeColorType is set to a valid value. Change-Id: I325595fa65b8e56a4707e9d22acc6330aac28961 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155359 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-17oox, writerfilter, xmloff: use frozen data structures for static dataTomaž Vajngerl
Change-Id: I4a53fa57f52900104d249c84cde36c9d3b9e1300 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153175 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-01docmodel: extract ColorDefinition into own file and renameTomaž Vajngerl
ColorDefinition is renamed into ComplexColor. Change-Id: I81c2d97e6b7bf9de4ce703c02b6db40636b04961 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151224 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-12oox: add model::PatternFill and import pattern fill elementsTomaž Vajngerl
Change-Id: I49ef33fd81509599f4081e6a913b05dae1e4a642 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147953 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-11Avoid UB converting from double to sal_Int16Stephan Bergmann
...e.g. during CppunitTest_sd_import_tests, > /oox/source/drawingml/colorchoicecontext.cxx:280:78: runtime error: 35000 is outside the range of representable values of type 'short' > #0 0x7f3b8abf6278 in oox::drawingml::ColorValueContext::onCreateContext(int, oox::AttributeList const&) /oox/source/drawingml/colorchoicecontext.cxx:280:78 > #1 0x7f3b8abf6534 in non-virtual thunk to oox::drawingml::ColorValueContext::onCreateContext(int, oox::AttributeList const&) /oox/source/drawingml/colorchoicecontext.cxx > #2 0x7f3b8a94baff in oox::core::ContextHandler2Helper::implCreateChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) /oox/source/core/contexthandler2.cxx:100:34 > #3 0x7f3b8a94eabb in oox::core::ContextHandler2::createFastChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) /oox/source/core/contexthandler2.cxx:204:12 > #4 0x7f3b8a950484 in non-virtual thunk to oox::core::ContextHandler2::createFastChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) /oox/source/core/contexthandler2.cxx > #5 0x7f3b43e81c45 in DOM::CElement::fastSaxify(DOM::Context&) /unoxml/source/dom/element.cxx:164:67 > #6 0x7f3b43e8299e in DOM::CElement::fastSaxify(DOM::Context&) /unoxml/source/dom/element.cxx:181:20 > #7 0x7f3b43e8299e in DOM::CElement::fastSaxify(DOM::Context&) /unoxml/source/dom/element.cxx:181:20 > #8 0x7f3b43e8299e in DOM::CElement::fastSaxify(DOM::Context&) /unoxml/source/dom/element.cxx:181:20 > #9 0x7f3b43e8299e in DOM::CElement::fastSaxify(DOM::Context&) /unoxml/source/dom/element.cxx:181:20 > #10 0x7f3b43e8299e in DOM::CElement::fastSaxify(DOM::Context&) /unoxml/source/dom/element.cxx:181:20 > #11 0x7f3b43e8299e in DOM::CElement::fastSaxify(DOM::Context&) /unoxml/source/dom/element.cxx:181:20 > #12 0x7f3b43e8299e in DOM::CElement::fastSaxify(DOM::Context&) /unoxml/source/dom/element.cxx:181:20 > #13 0x7f3b43e8299e in DOM::CElement::fastSaxify(DOM::Context&) /unoxml/source/dom/element.cxx:181:20 > #14 0x7f3b43df8a50 in DOM::CDocument::fastSaxify(DOM::Context&) /unoxml/source/dom/document.cxx:289:20 > #15 0x7f3b43e117af in DOM::CDocument::fastSerialize(com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastDocumentHandler> const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastTokenHandler> const&, com::sun::star::uno::Sequence<com::sun::star::beans::StringPair> const&, com::sun::star::uno::Sequence<com::sun::star::beans::Pair<rtl::OUString, int> > const&) /unoxml/source/dom/document.cxx:1023:9 > #16 0x7f3b8aa55f81 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastSAXSerializable> const&) /oox/source/core/xmlfilterbase.cxx:470:23 > #17 0x7f3b8bd30d0f in oox::ppt::PresentationFragmentHandler::importSlide(unsigned int, bool, bool) /oox/source/ppt/presentationfragmenthandler.cxx:357:41 > #18 0x7f3b8bd3cd16 in oox::ppt::PresentationFragmentHandler::finalizeImport() /oox/source/ppt/presentationfragmenthandler.cxx:543:17 > #19 0x7f3b8a9f79ae in oox::core::FragmentHandler2::endDocument() /oox/source/core/fragmenthandler2.cxx:53:5 > #20 0x7f3b548344f0 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:897:36 > #21 0x7f3b54855150 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1469:13 > #22 0x7f3b8a97ff11 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) /oox/source/core/fastparser.cxx:121:15 > #23 0x7f3b8a9806a8 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5 > #24 0x7f3b8aa548a4 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:412:21 > #25 0x7f3b8aa531fd in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) /oox/source/core/xmlfilterbase.cxx:342:12 > #26 0x7f3b8bcbaf54 in oox::ppt::PowerPointImport::importDocument() /oox/source/ppt/pptimport.cxx:109:17 > #27 0x7f3b8a99493c in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /oox/source/core/filterbase.cxx:488:49 > #28 0x7f3b8bcbe067 in oox::ppt::PowerPointImport::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /oox/source/ppt/pptimport.cxx:192:24 > #29 0x7f3b7a89c1c6 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sfx2/source/doc/objstor.cxx:2272:34 > #30 0x7f3b82834e18 in sd::DrawDocShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sd/source/ui/docshell/docshel4.cxx:429:39 > #31 0x7f3b7a85bd64 in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:739:23 > #32 0x7f3b7aa63c10 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1940:36 > #33 0x7f3b7b1c142c in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) /sfx2/source/view/frmload.cxx:720:28 > #34 0x7f3b4ff0f5fb in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1176:37 > #35 0x7f3b4ff059fb in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:412:20 > #36 0x7f3b4fefd8bc in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) /framework/source/loadenv/loadenv.cxx:308:5 > #37 0x7f3b4fef8c50 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/loadenv/loadenv.cxx:168:14 > #38 0x7f3b4ffc334d in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx:593:16 > #39 0x7f3b4ffc3576 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx > #40 0x7f3b5feedd95 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:71:62 > #41 0x7f3b75b0aef9 in UnoApiTest::load(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:115:11 > #42 0x7f3b75b0baf4 in UnoApiTest::loadFromURL(std::basic_string_view<char16_t, std::char_traits<char16_t> >, char const*) /test/source/unoapi_test.cxx:127:5 > #43 0x7f3b95d2f402 in SdModelTestBase::createSdImpressDoc(char const*, char const*) /sd/qa/unit/sdmodeltestbase.hxx:54:13 > #44 0x7f3b95d025c8 in testBnc584721_1::TestBody() /sd/qa/unit/import-tests.cxx:1281:5 (<https://ci.libreoffice.org/job/lo_ubsan/2741/>). Presumably it was just a typo that f707834e8538c0a183716b26ebdf04381482ca6d "oox: write color transforms to model::ColorDefinition" used 10.0 rather than 10 as divisor. Change-Id: I42de6daaa6db86bf4444243ec2c9173d6d514b02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150216 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-09oox: write color transforms to model::ColorDefinitionTomaž Vajngerl
Change-Id: I438c10b5181ffd20f2aa041479da2df62a92b156 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147952 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-22oox: introduce FormatScheme - use in Theme importTomaž Vajngerl
Introduces model::FormatScheme as an member of model::Theme, which is used in the theme import. As an first step it imports FillStyleList, but only SolidFill and NoFill. Change-Id: I14a75782ebabcf7ff69b0872752d411183653a47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147573 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-02use more getStringDefaultedNoel Grandin
rather than repeatedly constructing an empty OUString parameter Change-Id: I9ed2826f260f1f551c77e03b26f13a98e277f42f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137685 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-27replace oox::OptValue with std::optionalNoel Grandin
Change-Id: I16e7179b2851640b4d73665685dcc1e84042ddaf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-22replace oox::OptValue::useNoel Grandin
with emplace and operator* as a step towards converting it to std::optional Change-Id: I3fca397c7dcfe200962e2b81a423322e29787f20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136215 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-21rename oox::OptValue::has() to has_valueNoel Grandin
as a step towards converting it to std::optional Change-Id: I9b2201c29827fcddae3b46480065c90b2907e6cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136210 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-22smartart import: handle multiple <a:schemeClr> in <dgm:fillClrLst>Miklos Vajna
The TODO in the ColorFragmentHandler ctor was right: we only handled the last <a:schemeClr> child, but there can be multiple one. Use them based on the index of a shape in a <dgm:forEach> loop. Move the TODO to the only place which still assumes a single color in the color list. Change-Id: I1c5c4f82e621f1110ef06b0490ff79f82f60f214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94697 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-01-31new loplugin:namespaceindentationNoel Grandin
check indentation of braces in namespace decls, and the comments that often appear with them. This is my penance for messing up the indentation with clang-tidy-modernize-namespaces. As such I have limited it to new-style namespaces for now, and the check is off by default. Change-Id: I4db7f10a81c79bc0eece8f8e3ee564da8bc7f168 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15clang-tidy modernize-concat-nested-namespace in ooxNoel Grandin
Change-Id: I9877be75e1f7dcefdf7172d05dfbb0a63d06ced1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86803 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin
which seem to have snuck back in since the great rounds of removals. Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1 Reviewed-on: https://gerrit.libreoffice.org/62229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: ooxStephan Bergmann
Change-Id: I9f1cc9940f5b31370394f789ebfaddfd6d30ca61
2017-07-31loplugin:constparams in ooxNoel Grandin
Change-Id: I43984b4ece82da39ca61a91fa14e4660298509dd Reviewed-on: https://gerrit.libreoffice.org/40581 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-05-10tdf#42949: clean up includes in include/oox/helper with iwyuJorenz Paragas
...and fix the many compiler errors that occurred as a result. Change-Id: I497c326272b2f02737ca3765720d6815b735423b Reviewed-on: https://gerrit.libreoffice.org/24735 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-04-18clean-up: unused using declarations and includesJochen Nitschke
Searched source for using declarations. Checked if those symbols reappear in the source file, even in comments or dead code but not in #include statements. If they don't reappear, remove the declaration. Remove includes whose symbol got removed. Change-Id: Ibb77163f63c1120070e9518e3dc0a78c6c59fab0 Reviewed-on: https://gerrit.libreoffice.org/24148 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-02cleanup: remove unused Reference.h(xx) includesJochen Nitschke
and unused using-declarations from Reference.h Change-Id: I297a7ae6044fa329d245ecf08fd5c4cb930f5b19 Reviewed-on: https://gerrit.libreoffice.org/23735 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>