[Libreoffice-commits] core.git: editeng/source include/editeng include/oox oox/qa oox/source

2021-11-24 Thread Miklos Vajna (via logerrit)
 editeng/source/items/textitem.cxx|   22 +++---
 include/editeng/colritem.hxx |4 +++-
 include/editeng/memberids.h  |1 +
 include/editeng/unoprnms.hxx |1 +
 include/editeng/unotext.hxx  |1 +
 include/oox/drawingml/color.hxx  |1 +
 oox/qa/unit/drawingml.cxx|8 
 oox/source/drawingml/color.cxx   |   16 
 oox/source/drawingml/textcharacterproperties.cxx |1 +
 oox/source/token/properties.txt  |1 +
 10 files changed, 52 insertions(+), 4 deletions(-)

New commits:
commit a557a1c4ac0b73668452f80169870bdfb204aeb6
Author: Miklos Vajna 
AuthorDate: Wed Nov 24 08:22:47 2021 +0100
Commit: Miklos Vajna 
CommitDate: Wed Nov 24 09:33:30 2021 +0100

PPTX import: implement native handling of a color's luminance offset

This was already handled in oox/ at import-time: this adds it to the doc
model, including UNO API and PPTX import.

This is a dependency PPTX export and UI, and also the last transform
which is easy to generate from the PowerPoint UI and we didn't import to
the doc model.

Change-Id: Ica4e738d8dc8e0409160ceab941a82f2475ddc68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125749
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 73ce5c3fd1f1..32c269480c5a 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1358,7 +1358,8 @@ SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
 mColor( COL_BLACK ),
 maThemeIndex(-1),
 maTintShade(0),
-mnLumMod(1)
+mnLumMod(1),
+mnLumOff(0)
 {
 }
 
@@ -1367,7 +1368,8 @@ SvxColorItem::SvxColorItem( const Color& rCol, const 
sal_uInt16 nId ) :
 mColor( rCol ),
 maThemeIndex(-1),
 maTintShade(0),
-mnLumMod(1)
+mnLumMod(1),
+mnLumOff(0)
 {
 }
 
@@ -1383,7 +1385,8 @@ bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) 
const
 return mColor == rColorItem.mColor &&
maThemeIndex == rColorItem.maThemeIndex &&
maTintShade == rColorItem.maTintShade &&
-   mnLumMod == rColorItem.mnLumMod;
+   mnLumMod == rColorItem.mnLumMod &&
+   mnLumOff == rColorItem.mnLumOff;
 }
 
 bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
@@ -1417,6 +1420,11 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 rVal <<= mnLumMod;
 break;
 }
+case MID_COLOR_LUM_OFF:
+{
+rVal <<= mnLumOff;
+break;
+}
 default:
 {
 rVal <<= mColor;
@@ -1471,6 +1479,14 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 mnLumMod = nLumMod;
 }
 break;
+case MID_COLOR_LUM_OFF:
+{
+sal_Int16 nLumOff = -1;
+if (!(rVal >>= nLumOff))
+return false;
+mnLumOff = nLumOff;
+}
+break;
 default:
 {
 return rVal >>= mColor;
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
index 103c887fbdb6..cd223d2777bc 100644
--- a/include/editeng/colritem.hxx
+++ b/include/editeng/colritem.hxx
@@ -33,8 +33,10 @@ private:
 Color mColor;
 sal_Int16 maThemeIndex;
 sal_Int16 maTintShade;
-/// Luminance Modulation: 100th percentage, defaults to 1.
+/// Luminance Modulation: 100th percentage, defaults to 100%.
 sal_Int16 mnLumMod;
+/// Luminance Offset: 100th percentage, defaults to 0%.
+sal_Int16 mnLumOff;
 
 public:
 static SfxPoolItem* CreateDefault();
diff --git a/include/editeng/memberids.h b/include/editeng/memberids.h
index 117c9e2873e1..1b50ab467229 100644
--- a/include/editeng/memberids.h
+++ b/include/editeng/memberids.h
@@ -184,6 +184,7 @@
 #define MID_COLOR_THEME_INDEX   4
 #define MID_COLOR_TINT_OR_SHADE 5
 #define MID_COLOR_LUM_MOD   6
+#define MID_COLOR_LUM_OFF   7
 
 
 #endif
diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index e980acb9c8ec..f09afa09d487 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -330,6 +330,7 @@
 #define UNO_NAME_EDIT_CHAR_COLOR_THEME  "CharColorTheme"
 #define UNO_NAME_EDIT_CHAR_COLOR_TINT_OR_SHADE  "CharColorTintOrShade"
 #define UNO_NAME_EDIT_CHAR_COLOR_LUM_MOD"CharColorLumMod"
+#define UNO_NAME_EDIT_CHAR_COLOR_LUM_OFF"CharColorLumOff"
 #define UNO_NAME_EDIT_CHAR_TRANSPARENCE "CharTransparence"
 #define UNO_NAME_EDIT_CHAR_CROSSEDOUT   "CharCrossedOut"
 #define UNO_NAME_EDIT_CHAR_STRIKEOUT"CharStrikeout"
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 0b38

[Libreoffice-commits] core.git: editeng/source include/editeng include/oox oox/qa oox/source

2021-11-23 Thread Miklos Vajna (via logerrit)
 editeng/source/items/textitem.cxx|   22 +++---
 include/editeng/colritem.hxx |2 ++
 include/editeng/memberids.h  |1 +
 include/editeng/unoprnms.hxx |1 +
 include/editeng/unotext.hxx  |1 +
 include/oox/drawingml/color.hxx  |1 +
 oox/qa/unit/data/theme.pptx  |binary
 oox/qa/unit/drawingml.cxx|7 +++
 oox/source/drawingml/color.cxx   |   17 +
 oox/source/drawingml/textcharacterproperties.cxx |1 +
 oox/source/token/properties.txt  |1 +
 11 files changed, 51 insertions(+), 3 deletions(-)

New commits:
commit ed662bcc20804e8b8d5946904f1b577a825f09de
Author: Miklos Vajna 
AuthorDate: Tue Nov 23 08:11:22 2021 +0100
Commit: Miklos Vajna 
CommitDate: Tue Nov 23 09:07:42 2021 +0100

PPTX import: implement native handling of a color's luminance modulation

This was already handled in oox/ at import-time: this adds it to the doc
model, including UNO API and PPTX import.

This is a dependency PPTX export and UI.

Change-Id: I5d875b53d715beb10c13ef616d06cf958d43f70f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125684
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 02f8d6a9be4e..73ce5c3fd1f1 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1357,7 +1357,8 @@ SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
 SfxPoolItem(nId),
 mColor( COL_BLACK ),
 maThemeIndex(-1),
-maTintShade(0)
+maTintShade(0),
+mnLumMod(1)
 {
 }
 
@@ -1365,7 +1366,8 @@ SvxColorItem::SvxColorItem( const Color& rCol, const 
sal_uInt16 nId ) :
 SfxPoolItem( nId ),
 mColor( rCol ),
 maThemeIndex(-1),
-maTintShade(0)
+maTintShade(0),
+mnLumMod(1)
 {
 }
 
@@ -1380,7 +1382,8 @@ bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) 
const
 
 return mColor == rColorItem.mColor &&
maThemeIndex == rColorItem.maThemeIndex &&
-   maTintShade == rColorItem.maTintShade;
+   maTintShade == rColorItem.maTintShade &&
+   mnLumMod == rColorItem.mnLumMod;
 }
 
 bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
@@ -1409,6 +1412,11 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 rVal <<= maTintShade;
 break;
 }
+case MID_COLOR_LUM_MOD:
+{
+rVal <<= mnLumMod;
+break;
+}
 default:
 {
 rVal <<= mColor;
@@ -1455,6 +1463,14 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 maTintShade = nTintShade;
 }
 break;
+case MID_COLOR_LUM_MOD:
+{
+sal_Int16 nLumMod = -1;
+if (!(rVal >>= nLumMod))
+return false;
+mnLumMod = nLumMod;
+}
+break;
 default:
 {
 return rVal >>= mColor;
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
index ce51be7f3e30..103c887fbdb6 100644
--- a/include/editeng/colritem.hxx
+++ b/include/editeng/colritem.hxx
@@ -33,6 +33,8 @@ private:
 Color mColor;
 sal_Int16 maThemeIndex;
 sal_Int16 maTintShade;
+/// Luminance Modulation: 100th percentage, defaults to 1.
+sal_Int16 mnLumMod;
 
 public:
 static SfxPoolItem* CreateDefault();
diff --git a/include/editeng/memberids.h b/include/editeng/memberids.h
index c6d781da568a..117c9e2873e1 100644
--- a/include/editeng/memberids.h
+++ b/include/editeng/memberids.h
@@ -183,6 +183,7 @@
 //#define MID_GRAPHIC_TRANSPARENT 3 // used, but already defined above
 #define MID_COLOR_THEME_INDEX   4
 #define MID_COLOR_TINT_OR_SHADE 5
+#define MID_COLOR_LUM_MOD   6
 
 
 #endif
diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index 91273845fbd2..e980acb9c8ec 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -329,6 +329,7 @@
 #define UNO_NAME_EDIT_CHAR_COLOR"CharColor"
 #define UNO_NAME_EDIT_CHAR_COLOR_THEME  "CharColorTheme"
 #define UNO_NAME_EDIT_CHAR_COLOR_TINT_OR_SHADE  "CharColorTintOrShade"
+#define UNO_NAME_EDIT_CHAR_COLOR_LUM_MOD"CharColorLumMod"
 #define UNO_NAME_EDIT_CHAR_TRANSPARENCE "CharTransparence"
 #define UNO_NAME_EDIT_CHAR_CROSSEDOUT   "CharCrossedOut"
 #define UNO_NAME_EDIT_CHAR_STRIKEOUT"CharStrikeout"
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index c9c4b9580f72..0b38565f179f 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -89,6 +89,7 @@ struct SfxItemPropertyMapEntry;
 { u"" UNO_NAME_EDIT_CHAR_TRANSPARENCE,EE_CHAR_COLOR,