diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-07-22 11:48:15 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-07-22 15:07:41 +0200 |
commit | d1099ec6220e098b9d7e263c9b7f873997ea9e30 (patch) | |
tree | d9c9a2185ef5a42c4a2b0a1205a8851f58458529 /sd/qa | |
parent | d1de326b0b2a1208969e36f19010fdd8ee2a4fb7 (diff) |
tdf#124708: sd_uiimpress: Add unittest
Change-Id: I31544dfbec9cfb60fbf8ef2e5859e9c7f3efb1a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119365
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/tdf143412.svg | 10 | ||||
-rw-r--r-- | sd/qa/unit/uiimpress.cxx | 41 |
2 files changed, 51 insertions, 0 deletions
diff --git a/sd/qa/unit/data/tdf143412.svg b/sd/qa/unit/data/tdf143412.svg new file mode 100644 index 000000000000..147830f83cc7 --- /dev/null +++ b/sd/qa/unit/data/tdf143412.svg @@ -0,0 +1,10 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- This file was generated by dvisvgm 2.8.1 --> +<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='22.752105pt' height='7.85056pt' viewBox='76.712329 56.956413 22.752105 7.85056'> +<defs/> +<g id='page1'> +<path d='M80.039851 59.755915C80.099626 59.496887 80.328767 58.580324 81.026152 58.580324C81.075965 58.580324 81.315068 58.580324 81.524284 58.709838C81.24533 58.759651 81.046077 59.008717 81.046077 59.247821C81.046077 59.407223 81.155666 59.596513 81.424658 59.596513C81.643836 59.596513 81.96264 59.417186 81.96264 59.01868C81.96264 58.500623 81.374844 58.361146 81.036115 58.361146C80.458281 58.361146 80.109589 58.889166 79.990037 59.118306C79.740971 58.460772 79.202989 58.361146 78.914072 58.361146C77.877958 58.361146 77.310087 59.646326 77.310087 59.895392C77.310087 59.995019 77.409714 59.995019 77.429639 59.995019C77.50934 59.995019 77.539228 59.975093 77.559153 59.88543C77.897883 58.82939 78.555417 58.580324 78.894147 58.580324C79.083437 58.580324 79.43213 58.669988 79.43213 59.247821C79.43213 59.556663 79.262765 60.224159 78.894147 61.618929C78.734745 62.236613 78.386052 62.655044 77.947696 62.655044C77.88792 62.655044 77.65878 62.655044 77.449564 62.525529C77.69863 62.475716 77.917808 62.266501 77.917808 61.987547C77.917808 61.718555 77.69863 61.638854 77.549191 61.638854C77.250311 61.638854 77.001245 61.897883 77.001245 62.216687C77.001245 62.674969 77.499377 62.874222 77.937733 62.874222C78.595268 62.874222 78.953923 62.176837 78.983811 62.117061C79.103362 62.485679 79.462017 62.874222 80.059776 62.874222C81.085928 62.874222 81.653798 61.589041 81.653798 61.339975C81.653798 61.240349 81.564134 61.240349 81.534247 61.240349C81.444583 61.240349 81.424658 61.280199 81.404732 61.349938C81.075965 62.41594 80.398506 62.655044 80.079701 62.655044C79.691158 62.655044 79.531756 62.336239 79.531756 61.997509C79.531756 61.778331 79.591532 61.559153 79.701121 61.120797L80.039851 59.755915Z'/> +<path d='M88.694847 60.473225H91.474423C91.6139 60.473225 91.80319 60.473225 91.80319 60.273973S91.6139 60.07472 91.474423 60.07472H88.694847V57.285181C88.694847 57.145704 88.694847 56.956413 88.495594 56.956413S88.296341 57.145704 88.296341 57.285181V60.07472H85.506802C85.367325 60.07472 85.178035 60.07472 85.178035 60.273973S85.367325 60.473225 85.506802 60.473225H88.296341V63.262765C88.296341 63.402242 88.296341 63.591532 88.495594 63.591532S88.694847 63.402242 88.694847 63.262765V60.473225Z'/> +<path d='M99.424583 58.968867C99.464434 58.82939 99.464434 58.809465 99.464434 58.739726C99.464434 58.560399 99.324957 58.470735 99.175517 58.470735C99.075891 58.470735 98.916489 58.530511 98.826825 58.67995C98.8069 58.729763 98.727199 59.038605 98.687348 59.217933C98.61761 59.476961 98.547871 59.745953 98.488095 60.014944L98.039776 61.808219C97.999926 61.957659 97.571532 62.655044 96.913998 62.655044C96.405903 62.655044 96.296314 62.216687 96.296314 61.84807C96.296314 61.389788 96.465679 60.772105 96.804409 59.895392C96.963811 59.486924 97.003662 59.377335 97.003662 59.178082C97.003662 58.729763 96.684857 58.361146 96.186725 58.361146C95.240275 58.361146 94.871657 59.805729 94.871657 59.895392C94.871657 59.995019 94.971283 59.995019 94.991209 59.995019C95.090835 59.995019 95.100798 59.975093 95.150611 59.815691C95.419602 58.879203 95.818108 58.580324 96.156837 58.580324C96.236539 58.580324 96.405903 58.580324 96.405903 58.899128C96.405903 59.148194 96.306277 59.407223 96.236539 59.596513C95.838033 60.652553 95.658705 61.220423 95.658705 61.688667C95.658705 62.575342 96.286352 62.874222 96.874148 62.874222C97.262691 62.874222 97.60142 62.704857 97.880374 62.425903C97.75086 62.94396 97.631308 63.43213 97.232803 63.960149C96.973774 64.298879 96.595194 64.587796 96.136912 64.587796C95.997435 64.587796 95.549116 64.557908 95.379752 64.169365C95.539154 64.169365 95.668668 64.169365 95.808145 64.049813C95.907771 63.960149 96.007398 63.830635 96.007398 63.641345C96.007398 63.332503 95.738407 63.292653 95.63878 63.292653C95.409639 63.292653 95.080872 63.452055 95.080872 63.940224C95.080872 64.438356 95.519229 64.806974 96.136912 64.806974C97.163064 64.806974 98.189216 63.900374 98.46817 62.774595L99.424583 58.968867Z'/> +</g> +</svg>
\ No newline at end of file diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index 444677fdda41..f4fa936f7bde 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -269,6 +269,47 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf124708) CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(16), pActualPage->GetObjCount()); } +CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf143412) +{ + mxComponent = loadFromDesktop("private:factory/simpress", + "com.sun.star.presentation.PresentationDocument"); + + CPPUNIT_ASSERT(mxComponent.is()); + + auto pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get()); + sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); + + SdPage* pActualPage = pViewShell->GetActualPage(); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), pActualPage->GetObjCount()); + + OUString aImageURL = m_directories.getURLFromSrc(u"sd/qa/unit/data/tdf143412.svg"); + uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence({ + { "FileName", uno::makeAny(aImageURL) }, + })); + dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs); + + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pActualPage->GetObjCount()); + + // Without the fix in place, this test would have crashed + // Check that converting an image to the different options doesn't crash + + dispatchCommand(mxComponent, ".uno:ChangeBezier", {}); + + dispatchCommand(mxComponent, ".uno:ChangePolygon", {}); + + dispatchCommand(mxComponent, ".uno:convert_to_contour", {}); + + dispatchCommand(mxComponent, ".uno:ConvertInto3D", {}); + + dispatchCommand(mxComponent, ".uno:ConvertInto3DLatheFast", {}); + + dispatchCommand(mxComponent, ".uno:ConvertIntoBitmap", {}); + + dispatchCommand(mxComponent, ".uno:ConvertIntoMetaFile", {}); + + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pActualPage->GetObjCount()); +} + CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf139996) { mxComponent = loadFromDesktop("private:factory/simpress", |