From afb18ac0628c54fdffc1ee5b55db6110c20872cd Mon Sep 17 00:00:00 2001 From: RMZeroFour Date: Tue, 26 Mar 2024 21:41:59 +0530 Subject: [PATCH] tdf#50998 tdf#87892 Add sinusoid shape In response to #50998 (as well as #87892 indirectly), regarding adding sinusoidal and coil-like shapes to the shape gallery in LibreOffice, this commit adds a sinusoid shape to the gallery. The shape is still incomplete for release, at least lacking icons for the sidebar. Further details posted on the Bugzilla thread for issue #50998. PS-2: Removed the previously added flag shape. PS-4: Moved sinusoid to the end in a new subgroup. Change-Id: Ie0f6e3948b6dce98dc2b4f87289cfd37f2d16911 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165353 Tested-by: Jenkins Reviewed-by: Regina Henschel Reviewed-by: Heiko Tietze --- chart2/uiconfig/toolbar/basicshapes.xml | 2 + .../colibre/cmd/32/basicshapes.sinusoid.png | Bin 0 -> 1253 bytes .../colibre/cmd/lc_basicshapes.sinusoid.png | Bin 0 -> 910 bytes .../colibre/cmd/sc_basicshapes.sinusoid.png | Bin 0 -> 571 bytes .../cmd/32/basicshapes.sinusoid.png | Bin 0 -> 778 bytes .../cmd/lc_basicshapes.sinusoid.png | Bin 0 -> 553 bytes .../cmd/sc_basicshapes.sinusoid.png | Bin 0 -> 367 bytes .../cmd/32/basicshapes.sinusoid.svg | 3 + .../cmd/32/basicshapes.sinusoid.svg | 3 + include/svx/msdffdef.hxx | 1 + .../openoffice/Office/UI/GenericCommands.xcu | 8 +++ oox/source/export/shapes.cxx | 5 +- .../uiconfig/dbreport/toolbar/basicshapes.xml | 2 + sc/uiconfig/scalc/toolbar/basicshapes.xml | 2 + sd/uiconfig/sdraw/toolbar/basicshapes.xml | 2 + sd/uiconfig/simpress/toolbar/basicshapes.xml | 2 + .../EnhancedCustomShapeGeometry.cxx | 57 ++++++++++++++++++ .../EnhancedCustomShapeTypeNames.cxx | 6 +- svx/source/sidebar/shapes/ShapesUtil.cxx | 3 +- sw/uiconfig/sglobal/toolbar/basicshapes.xml | 2 + sw/uiconfig/sweb/toolbar/basicshapes.xml | 2 + sw/uiconfig/swform/toolbar/basicshapes.xml | 2 + sw/uiconfig/swreport/toolbar/basicshapes.xml | 2 + sw/uiconfig/swriter/toolbar/basicshapes.xml | 2 + sw/uiconfig/swxform/toolbar/basicshapes.xml | 2 + 25 files changed, 103 insertions(+), 5 deletions(-) create mode 100644 icon-themes/colibre/cmd/32/basicshapes.sinusoid.png create mode 100644 icon-themes/colibre/cmd/lc_basicshapes.sinusoid.png create mode 100644 icon-themes/colibre/cmd/sc_basicshapes.sinusoid.png create mode 100644 icon-themes/colibre_dark/cmd/32/basicshapes.sinusoid.png create mode 100644 icon-themes/colibre_dark/cmd/lc_basicshapes.sinusoid.png create mode 100644 icon-themes/colibre_dark/cmd/sc_basicshapes.sinusoid.png create mode 100644 icon-themes/colibre_dark_svg/cmd/32/basicshapes.sinusoid.svg create mode 100644 icon-themes/colibre_svg/cmd/32/basicshapes.sinusoid.svg diff --git a/chart2/uiconfig/toolbar/basicshapes.xml b/chart2/uiconfig/toolbar/basicshapes.xml index 148245f66672..a0debaab8fd5 100644 --- a/chart2/uiconfig/toolbar/basicshapes.xml +++ b/chart2/uiconfig/toolbar/basicshapes.xml @@ -45,4 +45,6 @@ + + diff --git a/icon-themes/colibre/cmd/32/basicshapes.sinusoid.png b/icon-themes/colibre/cmd/32/basicshapes.sinusoid.png new file mode 100644 index 0000000000000000000000000000000000000000..9e418857c3b53b2b7ea8b86113e1c13a56ca8ccb GIT binary patch literal 1253 zcmVpF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H11ae74 zK~z|U&6izBTW1)@pObh_Voaj0D3nIFt4yf2ou0;%FFhv4uZg>`im2EjWsJh+CbZrR z2Gec5+KpRTVYD!H!}w7rOjd1;7>&xbUR2a*hO(Kqvq()%az2xHR}N>RoqC3Q;Jy0) z|L6R8-{;9%57_PbUn&%e z4~mM46e}w}W^r*bz%VT3@p$}_5g>$OE{dYc%gRc&1Az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9H`oN#ivL;^<)*W^HZ7Z1MR+0fNDhsk5`wTVLORh{fVZ+xeoROBZCa+*BO@;$L0$ zykra*9Ub+NWZ-LhdPX9jpLD0Nuuup901`u4^P)(6N zU}9n-qN}SHd;0Xr+uy%`|E{X4-sR=x#ZI&VIy&0r{QUg%T!L@5w?n+5X`4VM-qoX5-xVVJe%a^b2FfcGMtXj3| z@1sYLE-EXlsN31ui4rv6|NmdQ3=IDz-@SXg4<_;G(fuhrJiG#Oax!?m!NkD8z`(}F z{o(ZK(@hT^JlX`4*uH(w@!Pj=-IA1)azxe;9v+^Wo}Tv9%F0TYfq{X6g@J*AVb`u* zw;321+R#mZ`t<2(ZEbBIb8~aylP6EUWnf@n5D^jdR8Ua*dh6Eh>u?v~0{8CS=;!9< z;?mI2C}Ch=U~qJFWRaGZ)p-2)@xA@~_x~Yi!2bQmZrs0r|E7|Xg14iiBZsuKM7pY~ zs>18nFIS_40Y32P(ZlHm28POtiV7R_^$l~+ojZ5q?_Y)mFnLB|GE+)Q@*+1kH}6M} z9(_J{?sUeoWvh0OWB>yL1A~Qyh3cO_f8L)tbLI`QIMD{+0suT_vl@?IreXj9002ov JPDHLkV1kFD9diHx literal 0 HcmV?d00001 diff --git a/icon-themes/colibre_dark/cmd/32/basicshapes.sinusoid.png b/icon-themes/colibre_dark/cmd/32/basicshapes.sinusoid.png new file mode 100644 index 0000000000000000000000000000000000000000..66f701ba1dc9c8f6ac84cb8c53714500c331fac1 GIT binary patch literal 778 zcmV+l1NHogP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10+&fd zK~z|U&6it@pOG;}au_a*vvGkDBBqonLmA2;lHx)n7o>5)g>b)o{x#XQy=Kp})->Mw+k36|`}TU*_kV|f7pU|kdiChj z{|5oRJ7F^umvN`hw5PUxVo>q1*}&usKeFw>R9!FdPXgc?u|-AKtW6&xC!h7W&wkN z8lW%m7+3`?0R{nEx+4cl)emYv^^H0qgWI5QGz((K*ur8^9Tw!^uj!_?|6*>5F^_8J4Th$?HZoydK z2hbXQZ_J_j5%3w93S0&jCka5dfEhp&VV~~;KV$qFfaSnhU|E_1rU4&;rIC<0vO0GA%r(O0W;AA6amA4JA}mT2nT^r(c1ABlOTZ(sXNup>ajew_th%(x>}vd zB@s}i-p*)Bg)w#|YFkt_ZR)^$ji|G@0h9p+z!PA8jNL-u8X>=)18tdP+$`uUjuNWn z3$O@Sk;A3|s0Ye{U%;-v*o3{j(lDm`N82zmiysg*tAXlMb$Y%=)K%PwKBp7r#MUf+ zEupQCkFJ~l`GtfLK&?^h{Buqi6WuQ|9BO8(ht=J={L>IntiDj^7|QZ$R1y2tdUbTP zJwv-o0P1SB(QrPfH4LkJhCy{&-4o}VmVg5FMD)hJ)k)D7Y*U-<;NX(93^P#()B+QM z3&3Px9HC9WjB`p;Ks)9F6~HS({eSPsxH|-N2|fPbu*U`b20{J(BUCz7eEi(%YqV$nyD!?UP>K{`+w@0>&esqZ=PSB%{k|PzxVv_xu@F^5!$KFwyxd+ zuo=g(yd8k^xQJDlz^3^GY%lB@*5Nd+V@V}KMC3Le5nCgo77+sxF%}U+5pk(WZcEE6 zSdB&4jS<|(54^{|Dpho3ZF&wfIE#M##9CazBxW&M29Q_Kk2m;OEDrCmumB8}+I|LD zAhl#49%p&Ca8RnCrz&6rUSk((S>6Qp;}MQj1@z$yHsWoT_Z?sH9EYm{zDd969-0lP zhf;Nmv9w9N3$O43N9)eKi~gl<+{P1p!gvqLwGRfiwg5)G$M9H#IuO#E_`a$W1CNqe=ZVhjV)-T95-#^fphxQuChmRffNH?Rl4<^#|vox`j&yH4PYbO+|B rDxj{N(rkJvUDUtyzkrr%`>Wy)&Ghq=okpwj00000NkvXXu0mjfYKHbI literal 0 HcmV?d00001 diff --git a/icon-themes/colibre_dark/cmd/sc_basicshapes.sinusoid.png b/icon-themes/colibre_dark/cmd/sc_basicshapes.sinusoid.png new file mode 100644 index 0000000000000000000000000000000000000000..c3f64f3b0d872be42b88f2421849c6c91643553a GIT binary patch literal 367 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GWKsI|KQu30@}wbuoWo9q(DmGlZ@-4E8NY-_HNp1hc2(jgu`<&R1p zQ7<0v=xY*tSI{N8CNy`UpIy@xe9U@T%KJyAHM4gdO%6P0Fz3XxP4Z>Tnra_nLkxIgecHR!%0Bi?|Kk+& zQ2$MWSo90lhZA#xm7^7;ZwS3}{untgCe*QSTTb-eMVt8!I{aa(|8KEO(a(z&7!C}c Lu6{1-oD!M + + diff --git a/icon-themes/colibre_svg/cmd/32/basicshapes.sinusoid.svg b/icon-themes/colibre_svg/cmd/32/basicshapes.sinusoid.svg new file mode 100644 index 000000000000..4567c9b427d2 --- /dev/null +++ b/icon-themes/colibre_svg/cmd/32/basicshapes.sinusoid.svg @@ -0,0 +1,3 @@ + + + diff --git a/include/svx/msdffdef.hxx b/include/svx/msdffdef.hxx index 373974e67b31..de3b2e8c6c26 100644 --- a/include/svx/msdffdef.hxx +++ b/include/svx/msdffdef.hxx @@ -478,6 +478,7 @@ enum MSO_SPT: sal_Int32 { mso_sptTextBox = 202, //for pptx shape which doesn't exist in ppt mso_sptTearDrop = 203, + mso_sptSinusoid = 204, mso_sptMax = 0x0FFF, mso_sptNil = mso_sptMax }; diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 5b438e01ffe1..c8ba600372b4 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -391,6 +391,14 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 1 + + + Sinusoid + + + 1 + + Cylinder diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 4151c61798f2..25f4aa83a65b 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -621,12 +621,13 @@ constexpr frozen::set constDenySet( u"flowchart-display" }); -constexpr frozen::set constAllowSet( +constexpr frozen::set constAllowSet( { u"heart", u"puzzle", u"col-60da8460", - u"col-502ad400" + u"col-502ad400", + u"sinusoid" }); } // end anonymous namespace diff --git a/reportdesign/uiconfig/dbreport/toolbar/basicshapes.xml b/reportdesign/uiconfig/dbreport/toolbar/basicshapes.xml index 4bd60977eb41..ee50dd9255a3 100644 --- a/reportdesign/uiconfig/dbreport/toolbar/basicshapes.xml +++ b/reportdesign/uiconfig/dbreport/toolbar/basicshapes.xml @@ -43,4 +43,6 @@ + + \ No newline at end of file diff --git a/sc/uiconfig/scalc/toolbar/basicshapes.xml b/sc/uiconfig/scalc/toolbar/basicshapes.xml index 148245f66672..a0debaab8fd5 100644 --- a/sc/uiconfig/scalc/toolbar/basicshapes.xml +++ b/sc/uiconfig/scalc/toolbar/basicshapes.xml @@ -45,4 +45,6 @@ + + diff --git a/sd/uiconfig/sdraw/toolbar/basicshapes.xml b/sd/uiconfig/sdraw/toolbar/basicshapes.xml index 148245f66672..a0debaab8fd5 100644 --- a/sd/uiconfig/sdraw/toolbar/basicshapes.xml +++ b/sd/uiconfig/sdraw/toolbar/basicshapes.xml @@ -45,4 +45,6 @@ + + diff --git a/sd/uiconfig/simpress/toolbar/basicshapes.xml b/sd/uiconfig/simpress/toolbar/basicshapes.xml index 148245f66672..a0debaab8fd5 100644 --- a/sd/uiconfig/simpress/toolbar/basicshapes.xml +++ b/sd/uiconfig/simpress/toolbar/basicshapes.xml @@ -45,4 +45,6 @@ + + diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index 7db0ff931ac4..026eac620416 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -8352,6 +8352,62 @@ const mso_CustomShape msoTearDrop = std::span(mso_sptTearDropHandle), }; +///////////////////////////// sinusoid +const SvxMSDffVertPair mso_sptSinusoidVert[] = +{ + // calculations courtesy of section 6.3.2 of + // https://documentation.libreoffice.org/assets/Uploads/Documentation/en/Tutorials/CustomShapes7/Custom-Shape-Tutorial.pdf#page=52 + + // taking K = (3pi/2 - 3pi^2/8 - 1/2) + // transforming points to viewbox of size 21600 x 21600 + + // Start point + { 0, 10800 }, // (0, 0) + // First Bezier + { 1757, 5278 }, // (K, K) + { 3437, 0 }, // (1, 1) + { 5400, 0 }, // (pi/2, 1) + // Second Bezier + { 7362, 0 }, // (pi - 1, 1) + { 9042, 5278 }, // (pi - K, K) + { 10800, 10800 }, // (pi, 0) + // Third Bezier + { 12557, 16321 }, // (pi + K, -K) + { 14237, 21600 }, // (pi + 1, -1) + { 16200, 21600 }, // (3pi/2, -1) + // Fourth Bezier + { 18162, 21600 }, // (2pi - 1, -1) + { 19842, 16321 }, // (2pi - K, -K) + { 21600, 10800 } // (2pi, 0) +}; + +const sal_uInt16 mso_sptSinusoidSegm[] = +{ + 0x4000, 0x2004, 0x8000 +}; + +const SvxMSDffVertPair mso_sptSinusoidGluePoints[] = +{ + { 0, 10800 }, // x = 0.00 + { 5400, 0 }, // x = 0.25 + { 10800, 10800 }, // x = 0.50 + { 16200, 21600 }, // x = 0.75 + { 21600, 10800 } // x = 1.00 +}; + +const mso_CustomShape msoSinusoid = +{ + std::span(mso_sptSinusoidVert), // vertices + const_cast(mso_sptSinusoidSegm), sizeof(mso_sptSinusoidSegm) >> 1, // segments, count + std::span(), // calculations (none) + nullptr, // default values (none) + std::span(), // text area (default) + 21600, 21600, // viewbox w, h (default) + MIN_INT32, MIN_INT32, // stretch x, y (unset) + std::span(mso_sptSinusoidGluePoints), // glue points + std::span(), // handles (none) +}; + const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType ) { @@ -8481,6 +8537,7 @@ const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType ) case mso_sptCloudCallout : pCustomShape = &msoCloudCallout; break; case mso_sptWave : pCustomShape = &msoWave; break; case mso_sptDoubleWave : pCustomShape = &msoDoubleWave; break; + case mso_sptSinusoid : pCustomShape = &msoSinusoid; break; // callout case mso_sptCallout1 : pCustomShape = &msoCallout1; break; diff --git a/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx b/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx index 472e5f265753..cafea3164a16 100644 --- a/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx @@ -236,7 +236,8 @@ const NameTypeTable pNameTypeTableArray[] = { "mso-spt201", mso_sptHostControl }, { "mso-spt202", mso_sptTextBox }, { "teardrop", mso_sptTearDrop }, - { "ooxml-rect", mso_sptRectangle } + { "ooxml-rect", mso_sptRectangle }, + { "sinusoid", mso_sptSinusoid } }; // gallery: quadrat @@ -518,7 +519,8 @@ const ACCNameTypeTable pACCNameTypeTableArray[] = { "mso-spt202", mso_sptTextBox },*/ { "frame", "Frame" }, { "col-60da8460", "Octagon Bevel" }, - { "col-502ad400", "Diamond Bevel" } + { "col-502ad400", "Diamond Bevel" }, + { "sinusoid", "Sinusoid" } }; typedef std::unordered_map TypeACCNameHashMap; diff --git a/svx/source/sidebar/shapes/ShapesUtil.cxx b/svx/source/sidebar/shapes/ShapesUtil.cxx index ffd1acb62926..02ac744b6d42 100644 --- a/svx/source/sidebar/shapes/ShapesUtil.cxx +++ b/svx/source/sidebar/shapes/ShapesUtil.cxx @@ -87,7 +87,8 @@ SvxShapeCommandsMap::SvxShapeCommandsMap() {20, ".uno:BasicShapes.cube"}, {21, ".uno:BasicShapes.paper"}, {22, ".uno:BasicShapes.frame"}, - {23, ".uno:BasicShapes.ring"} + {23, ".uno:BasicShapes.ring"}, + {24, ".uno:SymbolShapes.sinusoid"} }; mpSymbolShapes = decltype(mpSymbolShapes){ diff --git a/sw/uiconfig/sglobal/toolbar/basicshapes.xml b/sw/uiconfig/sglobal/toolbar/basicshapes.xml index 148245f66672..a0debaab8fd5 100644 --- a/sw/uiconfig/sglobal/toolbar/basicshapes.xml +++ b/sw/uiconfig/sglobal/toolbar/basicshapes.xml @@ -45,4 +45,6 @@ + + diff --git a/sw/uiconfig/sweb/toolbar/basicshapes.xml b/sw/uiconfig/sweb/toolbar/basicshapes.xml index 148245f66672..a0debaab8fd5 100644 --- a/sw/uiconfig/sweb/toolbar/basicshapes.xml +++ b/sw/uiconfig/sweb/toolbar/basicshapes.xml @@ -45,4 +45,6 @@ + + diff --git a/sw/uiconfig/swform/toolbar/basicshapes.xml b/sw/uiconfig/swform/toolbar/basicshapes.xml index 148245f66672..a0debaab8fd5 100644 --- a/sw/uiconfig/swform/toolbar/basicshapes.xml +++ b/sw/uiconfig/swform/toolbar/basicshapes.xml @@ -45,4 +45,6 @@ + + diff --git a/sw/uiconfig/swreport/toolbar/basicshapes.xml b/sw/uiconfig/swreport/toolbar/basicshapes.xml index 5b7194408b0b..7b583dff6d93 100644 --- a/sw/uiconfig/swreport/toolbar/basicshapes.xml +++ b/sw/uiconfig/swreport/toolbar/basicshapes.xml @@ -43,4 +43,6 @@ + + \ No newline at end of file diff --git a/sw/uiconfig/swriter/toolbar/basicshapes.xml b/sw/uiconfig/swriter/toolbar/basicshapes.xml index 148245f66672..a0debaab8fd5 100644 --- a/sw/uiconfig/swriter/toolbar/basicshapes.xml +++ b/sw/uiconfig/swriter/toolbar/basicshapes.xml @@ -45,4 +45,6 @@ + + diff --git a/sw/uiconfig/swxform/toolbar/basicshapes.xml b/sw/uiconfig/swxform/toolbar/basicshapes.xml index 148245f66672..a0debaab8fd5 100644 --- a/sw/uiconfig/swxform/toolbar/basicshapes.xml +++ b/sw/uiconfig/swxform/toolbar/basicshapes.xml @@ -45,4 +45,6 @@ + +