[Libreoffice-commits] core.git: extensions/source solenv/clang-format

2023-04-05 Thread Jani Saranpää (via logerrit)
 extensions/source/propctrlr/fontdialog.cxx  |  168 
 extensions/source/propctrlr/fontitemids.hxx |   48 
 solenv/clang-format/excludelist |1 
 3 files changed, 98 insertions(+), 119 deletions(-)

New commits:
commit cccfc2e705b3708854dc2de8bcc602fa45fdb5a8
Author: Jani Saranpää 
AuthorDate: Wed Mar 29 21:43:23 2023 +0300
Commit: Stephan Bergmann 
CommitDate: Wed Apr 5 13:35:05 2023 +0200

tdf#145614 Convert #define to enum in propctrlr/fontitemids.hxx

- Removed fontitemids.hxx and moved new enum definition inside cxx file to
optimize compiling.
- Removed non-existing fontitemids.hxx from clang format excludelist.

Change-Id: I67e782821d65241264de0926e445a58dc7307ba7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149736
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/extensions/source/propctrlr/fontdialog.cxx 
b/extensions/source/propctrlr/fontdialog.cxx
index 997986e0f536..6abc01866943 100644
--- a/extensions/source/propctrlr/fontdialog.cxx
+++ b/extensions/source/propctrlr/fontdialog.cxx
@@ -32,7 +32,6 @@
 #include 
 #include 
 #include "formstrings.hxx"
-#include "fontitemids.hxx"
 #include 
 #include 
 #include 
@@ -69,6 +68,35 @@ namespace pcr
 
 namespace {
 
+enum FontItemIds: sal_uInt16
+{
+CFID_FONT = 1,
+CFID_HEIGHT =   2,
+CFID_WEIGHT =   3,
+CFID_POSTURE =  4,
+CFID_LANGUAGE = 5,
+CFID_UNDERLINE =6,
+CFID_STRIKEOUT =7,
+CFID_WORDLINEMODE = 8,
+CFID_CHARCOLOR =9,
+CFID_RELIEF =   10,
+CFID_EMPHASIS = 11,
+
+CFID_CJK_FONT = 12,
+CFID_CJK_HEIGHT =   13,
+CFID_CJK_WEIGHT =   14,
+CFID_CJK_POSTURE =  15,
+CFID_CJK_LANGUAGE = 16,
+CFID_CASEMAP =  17,
+CFID_CONTOUR =  18,
+CFID_SHADOWED = 19,
+
+CFID_FONTLIST = 20,
+
+CFID_FIRST_ITEM_ID =CFID_FONT,
+CFID_LAST_ITEM_ID = CFID_FONTLIST
+};
+
 class OFontPropertyExtractor
 {
 protected:
@@ -216,32 +244,32 @@ namespace pcr
 sal_Int32 nColor32  = 
aPropExtractor.getInt32FontProperty(PROPERTY_TEXTCOLOR, 0);
 
 // build SfxItems with the values
-SvxFontItem aFontItem(static_cast(nFontFamily), 
aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, CFID_FONT);
+SvxFontItem aFontItem(static_cast(nFontFamily), 
aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, 
FontItemIds::CFID_FONT);
 
 nFontHeight = static_cast(o3tl::convert(nFontHeight, 
o3tl::Length::pt, o3tl::Length::twip));
 
-SvxFontHeightItem 
aSvxFontHeightItem(static_cast(nFontHeight),100,CFID_HEIGHT);
+SvxFontHeightItem 
aSvxFontHeightItem(static_cast(nFontHeight),100,FontItemIds::CFID_HEIGHT);
 
 FontWeight  
eWeight=vcl::unohelper::ConvertFontWeight(nFontWeight);
 FontItalic  
eItalic=vcl::unohelper::ConvertFontSlant(nFontSlant);
 FontLineStyle
eUnderline=static_cast(nFontLineStyle);
 FontStrikeout   
eStrikeout=static_cast(nFontStrikeout);
 
-SvxWeightItem   aWeightItem(eWeight,CFID_WEIGHT);
-SvxPostureItem  aPostureItem(eItalic,CFID_POSTURE);
+SvxWeightItem   aWeightItem(eWeight,FontItemIds::CFID_WEIGHT);
+SvxPostureItem  
aPostureItem(eItalic,FontItemIds::CFID_POSTURE);
 
-SvxCrossedOutItem   aCrossedOutItem(eStrikeout,CFID_STRIKEOUT);
-SvxWordLineModeItem aWordLineModeItem(bWordLineMode, 
CFID_WORDLINEMODE);
+SvxCrossedOutItem   
aCrossedOutItem(eStrikeout,FontItemIds::CFID_STRIKEOUT);
+SvxWordLineModeItem aWordLineModeItem(bWordLineMode, 
FontItemIds::CFID_WORDLINEMODE);
 
-SvxUnderlineItemaUnderlineItem(eUnderline,CFID_UNDERLINE);
+SvxUnderlineItem
aUnderlineItem(eUnderline,FontItemIds::CFID_UNDERLINE);
 aUnderlineItem.SetColor(Color(ColorTransparency, nTextLineColor));
 
-SvxColorItem aSvxColorItem(Color(ColorTransparency, 
nColor32),CFID_CHARCOLOR);
-SvxLanguageItem 
aLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), 
CFID_LANGUAGE);
+SvxColorItem aSvxColorItem(Color(ColorTransparency, 
nColor32),FontItemIds::CFID_CHARCOLOR);
+SvxLanguageItem 
aLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), 
FontItemIds::CFID_LANGUAGE);
 
 // the 2 CJK props
-SvxCharReliefItem 
aFontReliefItem(static_cast(nFontRelief), CFID_RELIEF);
-SvxEmphasisMarkItem 
aEmphasisMarkitem(static_cast(nFontEmphasisMark), 
CFID_EMPHASIS);
+SvxCharReliefItem 

[Libreoffice-commits] core.git: embeddedobj/source

2023-03-23 Thread Jani Saranpää (via logerrit)
 embeddedobj/source/msole/oleembed.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 6dfa9c7c0db91a71f3787226636864161d5367ca
Author: Jani Saranpää 
AuthorDate: Wed Mar 22 23:50:16 2023 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Thu Mar 23 06:33:24 2023 +

tdf#42982 Improve UNO API error reporting

Change-Id: If8c8e96c2d8365f10a191868e76e75d6fc7c5db9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149357
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/embeddedobj/source/msole/oleembed.cxx 
b/embeddedobj/source/msole/oleembed.cxx
index d06969925109..2bc6cdb6066b 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -217,7 +217,7 @@ uno::Reference< embed::XStorage > 
OleEmbeddedObject::CreateTemporarySubstorage(
 if ( !xResult.is() )
 {
 o_aStorageName.clear();
-throw uno::RuntimeException();
+throw uno::RuntimeException("Failed to create temporary storage for 
OLE embed object");
 }
 
 return xResult;
@@ -238,7 +238,7 @@ OUString OleEmbeddedObject::MoveToTemporarySubstream()
 }
 
 if ( aResult.isEmpty() )
-throw uno::RuntimeException();
+throw uno::RuntimeException("Failed to rename temporary storage for 
OLE embed object");
 
 return aResult;
 }
@@ -326,7 +326,7 @@ bool OleEmbeddedObject::TryToConvertToOOo( const 
uno::Reference< io::XStream >&
 aEmbedFactory = aConfigHelper.GetFactoryNameByMediaType( 
aMediaType );
 
 if ( aEmbedFactory.isEmpty() )
-throw uno::RuntimeException();
+throw uno::RuntimeException("Failed to get OLE embedded 
object factory");
 
 uno::Reference< uno::XInterface > xFact = 
m_xContext->getServiceManager()->createInstanceWithContext( aEmbedFactory, 
m_xContext );
 
@@ -858,7 +858,7 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
 
 try {
 if ( !m_pOleComponent )
-throw uno::RuntimeException();
+throw uno::RuntimeException("Null reference to OLE component");
 
 //  the STAMPIT related solution =
 m_aVerbExecutionController.StartControlExecution();