Re: Remove from mailing list
On 9/4/23 08:38, Shubham Jain wrote: Hi admin, Request you to kindly remove me from the mailing list. Regards Shubham Jain Please follow the instructions at the bottom of https://lists.freedesktop.org/mailman/listinfo/libreoffice -- Stéphane Guillou Quality Assurance Analyst | The Document Foundation Email: stephane.guil...@libreoffice.org Mobile (France): +33 7 79 67 18 72 Matrix: @stragu:matrix.org Fediverse: @str...@mastodon.indie.host Web: https://stragu.gitlab.io/
New Defects reported by Coverity Scan for LibreOffice
Hi, Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan. 1 new defect(s) introduced to LibreOffice found with Coverity Scan. 1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan. New defect(s) Reported-by: Coverity Scan Showing 1 of 1 defect(s) ** CID 1524699: Uninitialized variables (UNINIT) /vcl/unx/generic/gdi/cairotextrender.cxx: 214 in makeCacheId(const GenericSalLayout &)() *** CID 1524699: Uninitialized variables (UNINIT) /vcl/unx/generic/gdi/cairotextrender.cxx: 214 in makeCacheId(const GenericSalLayout &)() 208 FT_Face aFace = rFont.GetFtFace(); 209 CairoFontsCache::CacheId aId; 210 aId.maFace = aFace; 211 aId.mpOptions = rFont.GetFontOptions(); 212 aId.mbEmbolden = rInstance.NeedsArtificialBold(); 213 >>> CID 1524699: Uninitialized variables (UNINIT) >>> Using uninitialized value "aId". Field "aId.mbVerticalMetrics" is >>> uninitialized. 214 return aId; 215 } 216 217 void CairoTextRender::DrawTextLayout(const GenericSalLayout& rLayout, const SalGraphics& rGraphics) 218 { 219 const LogicalFontInstance& rInstance = rLayout.GetFont(); To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3Du1Hy_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJikD5l4lGuyVajiDdFNs477-2FnR1-2FFgbD8F2FhcWZBhtxOs5VSI1MwuzKCoSBRK6AQAPlCAjOzciVCNgOb2rWl-2FkNThVhM7yR0TZLTRfH9IPD47VNnyooHW4GlDBhbnf6UUtDwEJ-2BdrnGKRNcvE-2FSssUNNbTt63B-2FaSq-2BseLK3drUA-3D
[Libreoffice-commits] core.git: oox/source sw/qa
oox/source/drawingml/colorchoicecontext.cxx | 56 + sw/qa/core/theme/ThemeTest.cxx | 163 2 files changed, 197 insertions(+), 22 deletions(-) New commits: commit f707834e8538c0a183716b26ebdf04381482ca6d Author: Tomaž Vajngerl AuthorDate: Mon Feb 27 21:20:49 2023 +0900 Commit: Tomaž Vajngerl CommitDate: Sun Apr 9 15:39:29 2023 +0200 oox: write color transforms to model::ColorDefinition Change-Id: I438c10b5181ffd20f2aa041479da2df62a92b156 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147952 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/oox/source/drawingml/colorchoicecontext.cxx b/oox/source/drawingml/colorchoicecontext.cxx index 3d559299f4c2..927ff41de9c0 100644 --- a/oox/source/drawingml/colorchoicecontext.cxx +++ b/oox/source/drawingml/colorchoicecontext.cxx @@ -30,7 +30,7 @@ namespace oox::drawingml { namespace { -std::unordered_map constSystemColorMap = +const std::unordered_map constSystemColorMap = { { XML_scrollBar, model::SystemColorType::ScrollBar }, { XML_background, model::SystemColorType::Background }, @@ -63,6 +63,39 @@ std::unordered_map constSystemColorMap = { XML_menuHighlight, model::SystemColorType::MenuHighlight }, { XML_menuBar, model::SystemColorType::MenuBar } }; + +const std::unordered_map constTransformTypeMap = +{ +{ XML_alpha, model::TransformationType::Alpha }, +{ XML_alphaMod, model::TransformationType::AlphaMod }, +{ XML_alphaOff, model::TransformationType::AlphaOff }, +{ XML_blue, model::TransformationType::Blue }, +{ XML_blueMod, model::TransformationType::BlueMod }, +{ XML_blueOff, model::TransformationType::BlueOff }, +{ XML_hue, model::TransformationType::Hue }, +{ XML_hueMod, model::TransformationType::HueMod}, +{ XML_hueOff, model::TransformationType::HueOff }, +{ XML_lum, model::TransformationType::Lum }, +{ XML_lumMod, model::TransformationType::LumMod }, +{ XML_lumOff, model::TransformationType::LumOff }, +{ XML_green, model::TransformationType::Green }, +{ XML_greenMod, model::TransformationType::GreenMod }, +{ XML_greenOff, model::TransformationType::GreenOff }, +{ XML_red, model::TransformationType::Red }, +{ XML_redMod, model::TransformationType::RedMod }, +{ XML_redOff, model::TransformationType::RedOff }, +{ XML_sat, model::TransformationType::Sat }, +{ XML_satMod, model::TransformationType::SatMod }, +{ XML_satOff, model::TransformationType::SatMod }, +{ XML_shade, model::TransformationType::Shade }, +{ XML_tint, model::TransformationType::Tint }, +{ XML_comp, model::TransformationType::Comp }, +{ XML_gamma, model::TransformationType::Gamma }, +{ XML_gray, model::TransformationType::Gray }, +{ XML_inv, model::TransformationType::Inv }, +{ XML_invGamma, model::TransformationType::InvGamma } +}; + } ColorValueContext::ColorValueContext(ContextHandler2Helper const & rParent, Color& rColor, model::ColorDefinition* pColorDefinition) @@ -168,6 +201,7 @@ void ColorValueContext::onStartElement( const AttributeList& rAttribs ) mrColor.setPrstClr(nToken); if (mpColorDefinition) { +// TODO - just converted to RGB for now ::Color nRgbValue = Color::getDmlPresetColor(nToken, API_RGB_TRANSPARENT); mpColorDefinition->mnComponent1 = nRgbValue.GetRed(); mpColorDefinition->mnComponent2 = nRgbValue.GetGreen(); @@ -227,6 +261,26 @@ void ColorValueContext::onStartElement( const AttributeList& rAttribs ) mrColor.addTransformation( nElement ); break; } + +if (mpColorDefinition) +{ +auto aIterator = constTransformTypeMap.find(getBaseToken(nElement)); +if (aIterator != constTransformTypeMap.end()) +{ +auto const& aPair = *aIterator; +model::TransformationType eType = aPair.second; + +OUString aValueString = rAttribs.getStringDefaulted(XML_val); +sal_Int32 nValue = 0; +if (aValueString.endsWith("%")) +nValue = aValueString.toDouble() * PER_PERCENT; +else +nValue = rAttribs.getInteger(XML_val, 0); + +mpColorDefinition->maTransformations.push_back({eType, sal_Int16(nValue / 10.0)}); +} +} + return nullptr; } diff --git a/sw/qa/core/theme/ThemeTest.cxx b/sw/qa/core/theme/ThemeTest.cxx index c94b195eef0e..f9270663a5bb 100644 --- a/sw/qa/core/theme/ThemeTest.cxx +++ b/sw/qa/core/theme/ThemeTest.cxx @@ -87,54 +87,175 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testDrawPageThemeExistsDOCX) CPPUNIT_ASSERT_EQUAL(size_t(3), rFormatScheme.getFillStyleList().size()); CPPUNIT_ASSERT_EQUAL(size_t(3), rFormatScheme.getBackgroundFillStyleList().size()); +// Fill style 1 { model::FillStyle const& rFillStyle = rFormatSch
[Libreoffice-commits] core.git: connectivity/source dbaccess/source include/connectivity svx/source ucb/source writerfilter/source xmlhelp/source xmlsecurity/source
connectivity/source/commontools/dbcharset.cxx |6 +-- dbaccess/source/ui/control/charsetlistbox.cxx |2 - dbaccess/source/ui/dlg/DbAdminImpl.cxx |3 - dbaccess/source/ui/inc/charsetlistbox.hxx |2 - dbaccess/source/ui/inc/charsets.hxx |2 - dbaccess/source/ui/misc/charsets.cxx|2 - include/connectivity/dbcharset.hxx |2 - svx/source/form/fmtextcontrolshell.cxx |2 - ucb/source/ucp/webdav-curl/DateTimeHelper.cxx | 16 +- ucb/source/ucp/webdav-curl/DateTimeHelper.hxx |6 +-- writerfilter/source/dmapper/util.cxx|2 - xmlhelp/source/cxxhelp/provider/databases.cxx |6 +-- xmlhelp/source/cxxhelp/provider/databases.hxx |2 - xmlhelp/source/cxxhelp/provider/urlparameter.cxx|4 +- xmlhelp/source/cxxhelp/test/searchdemo.cxx |2 - xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx |2 - 16 files changed, 30 insertions(+), 31 deletions(-) New commits: commit 3fbadf2801f4c13f086d76a3ed566180cc0693dc Author: Noel Grandin AuthorDate: Fri Apr 7 17:53:00 2023 +0200 Commit: Noel Grandin CommitDate: Sun Apr 9 16:28:13 2023 +0200 use more OUStringToOString which makes it easier to pass around string_view in a few places. Change-Id: Icbbb7f56494986582f1c3272404775bd98031240 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150129 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/connectivity/source/commontools/dbcharset.cxx b/connectivity/source/commontools/dbcharset.cxx index 9e0b9ac2dd07..381afa606e08 100644 --- a/connectivity/source/commontools/dbcharset.cxx +++ b/connectivity/source/commontools/dbcharset.cxx @@ -93,15 +93,15 @@ namespace dbtools } -OCharsetMap::CharsetIteratorOCharsetMap::findIanaName(const OUString& _rIanaName) const +OCharsetMap::CharsetIterator OCharsetMap::findIanaName(std::u16string_view _rIanaName) const { ensureConstructed( ); rtl_TextEncoding eEncoding = RTL_TEXTENCODING_DONTKNOW; -if ( !_rIanaName.isEmpty() ) +if ( !_rIanaName.empty() ) { // byte string conversion -OString sMimeByteString( _rIanaName.getStr(), _rIanaName.getLength(), RTL_TEXTENCODING_ASCII_US ); +OString sMimeByteString = OUStringToOString( _rIanaName, RTL_TEXTENCODING_ASCII_US ); // look up eEncoding = rtl_getTextEncodingFromMimeCharset( sMimeByteString.getStr() ); diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx index 8915b65c9455..e6090ccfd84d 100644 --- a/dbaccess/source/ui/control/charsetlistbox.cxx +++ b/dbaccess/source/ui/control/charsetlistbox.cxx @@ -34,7 +34,7 @@ namespace dbaui } } -void CharSetListBox::SelectEntryByIanaName( const OUString& _rIanaName ) +void CharSetListBox::SelectEntryByIanaName( std::u16string_view _rIanaName ) { OCharsetDisplay::const_iterator aFind = m_aCharSets.findIanaName( _rIanaName ); if (aFind == m_aCharSets.end()) diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 2f60d21a9101..97210e843b00 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -860,8 +860,7 @@ OString ODbDataSourceAdministrationHelper::translatePropertyId( sal_Int32 _nId ) aString = indirectPos->second; } -OString aReturn( aString.getStr(), aString.getLength(), RTL_TEXTENCODING_ASCII_US ); -return aReturn; +return OUStringToOString( aString, RTL_TEXTENCODING_ASCII_US ); } template static bool checkItemType(const SfxPoolItem* pItem){ return dynamic_cast(pItem) != nullptr;} diff --git a/dbaccess/source/ui/inc/charsetlistbox.hxx b/dbaccess/source/ui/inc/charsetlistbox.hxx index aedfb6ec50a4..2b91bbb5389f 100644 --- a/dbaccess/source/ui/inc/charsetlistbox.hxx +++ b/dbaccess/source/ui/inc/charsetlistbox.hxx @@ -32,7 +32,7 @@ namespace dbaui public: CharSetListBox(std::unique_ptr xControl); -voidSelectEntryByIanaName( const OUString& _rIanaName ); +voidSelectEntryByIanaName( std::u16string_view _rIanaName ); boolStoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId ); weld::ComboBox* get_widget() { return m_xControl.get(); } diff --git a/dbaccess/source/ui/inc/charsets.hxx b/dbaccess/source/ui/inc/charsets.hxx index 4d4454e010d1..49977bd56262 100644 --- a/dbaccess/source/ui/inc/charsets.hxx +++ b/dbaccess/source/ui/inc/charsets.hxx @@ -43,7 +43,7 @@ namespace dbaui // various find operations
[Libreoffice-commits] core.git: 2 commits - oox/source vcl/unx
oox/source/drawingml/fillproperties.cxx |1 + vcl/unx/generic/gdi/cairotextrender.cxx |2 +- 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit ac8c1acbd1d908f506618c05d02c7cbebefa5077 Author: Caolán McNamara AuthorDate: Sun Apr 9 12:48:48 2023 +0100 Commit: Caolán McNamara CommitDate: Sun Apr 9 17:41:46 2023 +0200 cid#1524676 try to convince coverity of the error of its ways Change-Id: I098636732a3f704c9743cce93d7ba248455c9212 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150168 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 34a0db6dc940..cc69e04f6359 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -486,6 +486,7 @@ void FillProperties::pushToPropMap(ShapePropertyMap& rPropMap, const GraphicHelp { // use awt::Gradient2, prepare ColorStops awt::Gradient2 aGradient; +assert(aGradient.ColorStops.get() && "cid#1524676 aGradient.ColorStops._pSequence won't be null here"); basegfx::ColorStops aColorStops; basegfx::ColorStops aTransparencyStops; bool bContainsTransparency(false); commit f0210c8f18956b9ff2c1a76661bc5190b1cf9061 Author: Caolán McNamara AuthorDate: Sun Apr 9 12:28:03 2023 +0100 Commit: Caolán McNamara CommitDate: Sun Apr 9 17:41:39 2023 +0200 cid#1524699 silence Uninitialized scalar variable Change-Id: I32fc2570e8553be356e5c5c059b92791f5e9106a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150164 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index ae75cbc26abb..e7689c1028e1 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -210,6 +210,7 @@ static CairoFontsCache::CacheId makeCacheId(const GenericSalLayout& rLayout) aId.maFace = aFace; aId.mpOptions = rFont.GetFontOptions(); aId.mbEmbolden = rInstance.NeedsArtificialBold(); +aId.mbVerticalMetrics = false; return aId; } @@ -335,7 +336,6 @@ void CairoTextRender::DrawTextLayout(const GenericSalLayout& rLayout, const SalG rFSD.maTargetName == "OpenSymbol" && !glyph_extrarotation.back() && !rLayout.GetOrientation()) { CairoFontsCache::CacheId aId = makeCacheId(rLayout); -aId.mbVerticalMetrics = false; ApplyFont(cr, aId, nWidth, nHeight, 0, rLayout); cairo_text_extents_t stretched_extents;
[Libreoffice-commits] core.git: 2 commits - xmloff/source xmlscript/source
xmloff/source/core/fasttokenhandler.cxx | 10 ++ xmlscript/source/xmldlg_imexp/xmldlg_export.cxx |8 +++- 2 files changed, 9 insertions(+), 9 deletions(-) New commits: commit bcf9c4dc32eccd33234511ccf3c2281bee3b0e60 Author: Noel Grandin AuthorDate: Sun Apr 9 13:30:58 2023 +0200 Commit: Noel Grandin CommitDate: Sun Apr 9 18:16:31 2023 +0200 elide temporary OString in TokenMap::TokenMap Change-Id: I6c5ae545d559f408a1ffd5f0132ab0c9a52de4dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150166 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/core/fasttokenhandler.cxx b/xmloff/source/core/fasttokenhandler.cxx index 9efdf8f15d5e..5a9c9e6dcdda 100644 --- a/xmloff/source/core/fasttokenhandler.cxx +++ b/xmloff/source/core/fasttokenhandler.cxx @@ -55,10 +55,12 @@ TokenMap::TokenMap() : int i = 0; for( auto& rTokenName : maTokenNamesUtf8 ) { -OString aUtf8Token( *ppcTokenName ); -rTokenName = uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( -aUtf8Token.getStr() ), aUtf8Token.getLength() ); -maTokenNames[i++] = OUString( aUtf8Token.getStr(), aUtf8Token.getLength(), RTL_TEXTENCODING_UTF8 ); +const char* pStr = *ppcTokenName; +int nStrLen = strlen(pStr); +rTokenName = uno::Sequence< sal_Int8 >( +reinterpret_cast< const sal_Int8* >( pStr ), nStrLen ); +maTokenNames[i++] = OUString( pStr, +nStrLen, RTL_TEXTENCODING_UTF8 ); ++ppcTokenName; } } commit 7b3c45b710adcd6723167741e677695a265c5e98 Author: Noel Grandin AuthorDate: Sun Apr 9 13:30:31 2023 +0200 Commit: Noel Grandin CommitDate: Sun Apr 9 18:16:21 2023 +0200 elide temporaries in readEvents Change-Id: I4e2967f314113f78c0c054cb11fa39cf4749545b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150165 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index 080b585a0cd5..7b781c4914e3 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -1174,15 +1174,13 @@ void ElementDescriptor::readEvents() if (descr.AddListenerParam.isEmpty()) { // detection of event-name -OString listenerType( OUStringToOString( descr.ListenerType, RTL_TEXTENCODING_ASCII_US ) ); -OString eventMethod( OUStringToOString( descr.EventMethod, RTL_TEXTENCODING_ASCII_US ) ); StringTriple const * p = g_pEventTranslations; while (p->first) { -if (0 == ::rtl_str_compare( p->second, eventMethod.getStr() ) && -0 == ::rtl_str_compare( p->first, listenerType.getStr() )) +if (descr.EventMethod.equalsAscii(p->second) && +descr.ListenerType.equalsAscii(p->first)) { -aEventName = OUString( p->third, ::rtl_str_getLength( p->third ), RTL_TEXTENCODING_ASCII_US ); +aEventName = OStringToOUString( p->third, RTL_TEXTENCODING_ASCII_US ); break; } ++p;
[Libreoffice-commits] core.git: sal/osl svx/source vcl/unx xmlhelp/source
sal/osl/w32/file_url.cxx |6 -- svx/source/form/formcontroller.cxx |2 +- vcl/unx/gtk3/gtkframe.cxx|4 ++-- xmlhelp/source/cxxhelp/provider/urlparameter.hxx |2 +- 4 files changed, 8 insertions(+), 6 deletions(-) New commits: commit d7910847fba1694c83dc57a1f27b8eaabb2a7d85 Author: Noel Grandin AuthorDate: Sun Apr 9 13:32:12 2023 +0200 Commit: Noel Grandin CommitDate: Sun Apr 9 19:27:44 2023 +0200 use more OStringToOUString both because it is more obvious to read, and it takes a string_view, which is handy Change-Id: Ic201cfa0434446f51436d23c33d3f1a919ed65be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150167 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx index 8c525042ddef..a14f8d4b9b39 100644 --- a/sal/osl/w32/file_url.cxx +++ b/sal/osl/w32/file_url.cxx @@ -502,8 +502,10 @@ static std::optional osl_decodeURL_(const OString& sUTF8) } } -return bValidEncoded ? OUString(aBuffer.getStr(), aBuffer.getLength(), RTL_TEXTENCODING_UTF8) - : std::optional(); +if (!bValidEncoded) +return std::nullopt; + +return OStringToOUString(aBuffer, RTL_TEXTENCODING_UTF8); } static OUString osl_encodeURL_(std::u16string_view sURL) diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index b1063a46df2f..bf5306bc71c5 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -3082,7 +3082,7 @@ void FormController::setFilter(::std::vector& rFieldInfos) { OString aVal = m_pParser->getContext().getIntlKeywordAscii(IParseContext::InternationalKeyCode::And); OUString aCompText = aRow[rFieldInfo.xText] + " " + - OUString(aVal.getStr(),aVal.getLength(),RTL_TEXTENCODING_ASCII_US) + " " + +OStringToOUString(aVal, RTL_TEXTENCODING_ASCII_US) + " " + ::comphelper::getString(rRefValue.Value); aRow[rFieldInfo.xText] = aCompText; } diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index 824af112fa5d..1b1a1c0595b0 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -2713,7 +2713,7 @@ OUString GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode ) KeyCodeToGdkKey(nKeyCode, &nGtkKeyCode, &nGtkModifiers ); gchar* pName = gtk_accelerator_get_label(nGtkKeyCode, nGtkModifiers); -OUString aRet(pName, rtl_str_getLength(pName), RTL_TEXTENCODING_UTF8); +OUString aRet = OStringToOUString(pName, strlen(pName), RTL_TEXTENCODING_UTF8); g_free(pName); return aRet; } @@ -4859,7 +4859,7 @@ public: OUString aStr; gchar *pText = reinterpret_cast(gtk_selection_data_get_text(m_pData)); if (pText) -aStr = OUString(pText, rtl_str_getLength(pText), RTL_TEXTENCODING_UTF8); +aStr = OStringToOUString(pText, strlen(pText), RTL_TEXTENCODING_UTF8); g_free(pText); aRet <<= aStr.replaceAll("\r\n", "\n"); } diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx index 0a555607129c..850cb8591900 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx @@ -91,7 +91,7 @@ namespace chelp { //running into a later problem with strings >= 255 const char* pTitle = m_ptr + 3 + m_ptr[0] + static_cast(m_ptr[ 1+ static_cast(m_ptr[0]) ]); -return OUString(pTitle, rtl_str_getLength(pTitle), RTL_TEXTENCODING_UTF8); +return OStringToOUString(pTitle, strlen(pTitle), RTL_TEXTENCODING_UTF8); }
[Libreoffice-commits] core.git: sc/source
sc/source/core/data/postit.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 1e79befa61a08de7a1ddaccb6c435dbb8015c063 Author: Maxim Monastirsky AuthorDate: Sun Apr 9 00:23:46 2023 +0300 Commit: Maxim Monastirsky CommitDate: Sun Apr 9 20:44:15 2023 +0200 sc drawstyles: Use display name to find comment styles Change-Id: I3f56fd4bdb914da336927385e6c0ca76f1c871ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150163 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 6da509043c12..74bd5a22adbd 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -923,7 +924,7 @@ ScPostIt* ScNoteUtil::CreateNoteFromObjectData( ScCaptionInitData& rInitData = *aNoteData.mxInitData; rInitData.moItemSet.emplace(std::move(rItemSet)); rInitData.mxOutlinerObj = rOutlinerObj; -rInitData.maStyleName = rStyleName; +rInitData.maStyleName = ScStyleNameConversion::ProgrammaticToDisplayName(rStyleName, SfxStyleFamily::Frame); // convert absolute caption position to relative position rInitData.mbDefaultPosSize = rCaptionRect.IsEmpty();
[Libreoffice-commits] core.git: compilerplugins/clang connectivity/source dbaccess/source desktop/source editeng/source fpicker/source l10ntools/source oox/source sc/source sdext/source sd/source sfx2
compilerplugins/clang/test/unnecessarygetstr.cxx| 55 +++ compilerplugins/clang/unnecessarygetstr.cxx | 122 connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx |3 dbaccess/source/ui/misc/TokenWriter.cxx |4 desktop/source/lib/init.cxx |4 editeng/source/editeng/editview.cxx |4 editeng/source/editeng/impedit.cxx |6 fpicker/source/office/commonpicker.cxx |2 l10ntools/source/localize.cxx |2 oox/source/core/relationshandler.cxx| 12 + sc/source/core/data/documen3.cxx|4 sc/source/core/tool/prnsave.cxx |2 sc/source/filter/html/htmlexp.cxx | 16 +- sc/source/filter/orcus/xmlcontext.cxx |6 sc/source/ui/app/inputhdl.cxx | 10 - sc/source/ui/unoobj/docuno.cxx |2 sc/source/ui/view/cellsh3.cxx |2 sc/source/ui/view/formatsh.cxx |2 sc/source/ui/view/gridwin.cxx | 22 +- sc/source/ui/view/tabcont.cxx |2 sc/source/ui/view/tabvwshc.cxx |4 sc/source/ui/view/viewfun2.cxx |4 sd/source/ui/func/fusel.cxx |2 sd/source/ui/remotecontrol/Communicator.cxx |2 sd/source/ui/unoidl/unomodel.cxx|2 sd/source/ui/view/Outliner.cxx | 14 - sd/source/ui/view/drviews1.cxx |2 sdext/source/pdfimport/filterdet.cxx|4 sdext/source/pdfimport/wrapper/wrapper.cxx |4 sfx2/source/appl/openuriexternally.cxx |2 sfx2/source/appl/sfxhelp.cxx|4 sfx2/source/control/unoctitm.cxx|2 sfx2/source/doc/guisaveas.cxx |3 sfx2/source/view/ipclient.cxx |2 sfx2/source/view/lokhelper.cxx | 22 +- solenv/CompilerTest_compilerplugins_clang.mk|1 starmath/source/view.cxx|4 svx/source/svdraw/svdedtv1.cxx |2 svx/source/svdraw/svdmrkv.cxx |2 svx/source/table/tablecontroller.cxx|4 sw/qa/extras/layout/layout3.cxx |4 sw/source/core/crsr/bookmark.cxx|6 sw/source/core/crsr/crsrsh.cxx |4 sw/source/core/crsr/viscrs.cxx |4 sw/source/filter/html/wrthtml.cxx |2 sw/source/uibase/app/apphdl.cxx |2 sw/source/uibase/shells/tabsh.cxx |4 sw/source/uibase/uiview/view2.cxx | 10 - sw/source/uibase/uiview/viewsrch.cxx| 10 - sw/source/uibase/uiview/viewstat.cxx|4 sw/source/uibase/wrtsh/wrtsh2.cxx |2 test/source/helper/transferable.cxx |2 test/source/lokcallback.cxx |4 tools/source/xml/XmlWriter.cxx |2 ucb/source/ucp/ftp/ftpurl.cxx |6 vcl/jsdialog/jsdialogbuilder.cxx|2 vcl/source/control/edit.cxx |5 vcl/source/window/DocWindow.cxx |3 xmlhelp/source/cxxhelp/provider/urlparameter.cxx| 13 - 59 files changed, 314 insertions(+), 143 deletions(-) New commits: commit eaf071397a1ff30536616f2ed76051f77fd38ed6 Author: Noel Grandin AuthorDate: Fri Apr 7 10:02:18 2023 +0200 Commit: Noel Grandin CommitDate: Sun Apr 9 20:51:44 2023 +0200 new loplugin:unnecessarygetstr which prevents constructing unnecessary temporaries via getStr() Change-Id: I9ca70893a10e954b5ee0e6ad6098660ee24c2bef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150170 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/compilerplugins/clang/test/unnecessarygetstr.cxx b/compilerplugins/clang/test/unnecessarygetstr.cxx new file mode 100644 index ..68175872a4ea --- /dev/null +++ b/compilerplugins/clang/test/unnecessarygetstr.cxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sfx2/source
sfx2/source/doc/docfile.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 4300ea07cfa664a1de9509cb9cd83c7ae46afe87 Author: Jaume Pujantell AuthorDate: Wed Mar 29 14:32:55 2023 +0200 Commit: Adolfo Jayme Barrientos CommitDate: Sun Apr 9 22:58:40 2023 +0200 tdf#149064 ensure interaction handler is present when transfering with webDAV Change-Id: I7a31f708e6fe01f07c7187aacd4657b5c6156c82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149722 Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit 50848b06ea58a147f5b89f057880266518ce79e7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149697 Reviewed-by: Xisco Fauli (cherry picked from commit 439d8466c10473d1f3859ffa6c87fef6209e93eb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150141 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 63966fb3c6ab..fafe05d150b4 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2318,7 +2318,8 @@ void SfxMedium::Transfer_Impl() // a special case, an interaction handler should be used for // authentication in case it is available Reference< css::ucb::XCommandEnvironment > xComEnv; -Reference< css::task::XInteractionHandler > xInteractionHandler = GetInteractionHandler(); +bool bForceInteractionHandler = GetURLObject().isAnyKnownWebDAVScheme(); +Reference< css::task::XInteractionHandler > xInteractionHandler = GetInteractionHandler(bForceInteractionHandler); if (xInteractionHandler.is()) xComEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< css::ucb::XProgressHandler >() );
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/fldbas.hxx|5 sw/inc/usrfld.hxx|4 ++- sw/source/core/fields/fldbas.cxx | 37 sw/source/core/fields/usrfld.cxx |7 +- sw/source/ui/fldui/fldvar.cxx| 44 --- 5 files changed, 79 insertions(+), 18 deletions(-) New commits: commit 185cf4496d8750c9e4905c4e384252b01b85d130 Author: Eike Rathke AuthorDate: Sun Apr 9 14:47:41 2023 +0200 Commit: Eike Rathke CommitDate: Mon Apr 10 00:56:42 2023 +0200 Resolves: tdf#154217 Edit date+time User Field and Set Variable ... instead of the raw numeric value. Change-Id: I256cb4fde1e4ea6b0580b3208c5d4948e2573448 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150169 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index 5768d822d853..8ece6e214da1 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -442,6 +442,8 @@ public: OUStringExpandValue(const double& rVal, sal_uInt32 nFormat, LanguageType nLng) const; OUStringDoubleToString(const double &rVal, LanguageType eLng) const; OUStringDoubleToString(const double &rVal, sal_uInt32 nFormat) const; +/// Query input or formatted value for dialog. +OUStringGetInputOrDateTime( const OUString& rInput, const double& rVal, sal_uInt32 nFormat ) const; }; class SW_DLLPUBLIC SwValueField : public SwField @@ -489,6 +491,9 @@ public: voidSetExpandedFormula(const OUString& rStr); OUStringGetExpandedFormula() const; + +/// Query formula or formatted value for dialog. +OUStringGetInputOrDateTime() const; }; #endif // INCLUDED_SW_INC_FLDBAS_HXX diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx index faedb80671a8..28d582c4c5ac 100644 --- a/sw/inc/usrfld.hxx +++ b/sw/inc/usrfld.hxx @@ -52,9 +52,11 @@ public: OUStringExpand(sal_uInt32 nFormat, sal_uInt16 nSubType, LanguageType nLng); -OUStringGetContent( sal_uInt32 nFormat = 0 ); +OUStringGetContent( sal_uInt32 nFormat = 0 ) const; void SetContent( const OUString& rStr, sal_uInt32 nFormat = 0 ); +OUStringGetInputOrDateTime( sal_uInt32 nFormat ) const; + inline bool IsValid() const; double GetValue(SwCalc& rCalc);// Recalculate member nValue. diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 2f816d208938..f511c047b183 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -648,6 +649,22 @@ OUString SwValueFieldType::DoubleToString( const double &rVal, pFormatter->GetNumDecimalSep()[0], true ); } +OUString SwValueFieldType::GetInputOrDateTime( const OUString& rInput, const double& rVal, sal_uInt32 nFormat ) const +{ +if (nFormat && nFormat != SAL_MAX_UINT32 && UseFormat()) +{ +SvNumberFormatter* pFormatter = m_pDoc->GetNumberFormatter(); +const SvNumberformat* pEntry = pFormatter->GetEntry(nFormat); +if (pEntry && (pEntry->GetType() & SvNumFormatType::DATETIME)) +{ +OUString aEdit; +pFormatter->GetInputLineString( rVal, nFormat, aEdit); +return aEdit; +} +} +return rInput; +} + SwValueField::SwValueField( SwValueFieldType* pFieldType, sal_uInt32 nFormat, LanguageType nLng, const double fVal ) : SwField(pFieldType, nFormat, nLng) @@ -861,6 +878,26 @@ OUString SwFormulaField::GetExpandedFormula() const return GetFormula(); } +OUString SwFormulaField::GetInputOrDateTime() const +{ +// GetFormula() leads to problems with date formats because only the +// number string without formatting is returned (additionally that may or +// may not use a localized decimal separator due to the convoluted handling +// of "formula"). It must be used for expressions though because otherwise +// with GetPar2() only the value calculated by SwCalc would be displayed +// (instead of test2 = test + 1). +// Force a formatted edit value for date+time formats, assuming they are +// not editable calculated expressions if the formula doesn't contain +// arithmetic operators or assignment. + +const OUString aFormula( GetFormula()); + +if (comphelper::string::indexOfAny( aFormula, u"=+-*/", 0) == -1) +return static_cast(GetTyp())->GetInputOrDateTime( aFormula, GetValue(), GetFormat()); + +return aFormula; +} + OUString SwField::GetDescription() const { return SwResId(STR_FIELD); diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx index 4f84b8b7bcbb..b24123c552d3 100644 --- a/sw/so
[Libreoffice-commits] core.git: 2 commits - include/editeng include/svx oox/inc oox/source svx/qa svx/source
include/editeng/unoprnms.hxx |1 include/svx/svddef.hxx |3 - include/svx/unoshprp.hxx |1 oox/inc/drawingml/textbodyproperties.hxx |2 oox/source/drawingml/shape.cxx |5 -- oox/source/drawingml/textbodypropertiescontext.cxx | 14 ++ oox/source/export/drawingml.cxx|5 ++ oox/source/token/properties.txt|1 svx/qa/unit/data/clip-vertical-overflow.pptx |binary svx/qa/unit/svdraw.cxx | 44 + svx/source/svdraw/svdattr.cxx |1 svx/source/svdraw/svdotextdecomposition.cxx| 14 -- 12 files changed, 80 insertions(+), 11 deletions(-) New commits: commit 60bce1af8aab2115d603781193bb659b35d1aedb Author: Sarper Akdemir AuthorDate: Thu Apr 6 13:01:02 2023 +0300 Commit: Tomaž Vajngerl CommitDate: Mon Apr 10 08:52:51 2023 +0200 pptx import/export: consider TextClipVerticalOverflow for vertOverflow Also adds a unit test that tests TextClipVerticalOverflow on 4 different scenarios. Change-Id: I6232935765641c796046d90fe2207d67ae4b3eb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150107 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/oox/inc/drawingml/textbodyproperties.hxx b/oox/inc/drawingml/textbodyproperties.hxx index 1daa5d592a30..d935f940638d 100644 --- a/oox/inc/drawingml/textbodyproperties.hxx +++ b/oox/inc/drawingml/textbodyproperties.hxx @@ -51,7 +51,7 @@ struct TextBodyProperties /// Normal autofit: font scale (default: 100%). sal_Int32 mnFontScale = 10; OUString msHorzOverflow; -OUString msVertOverflow; +std::optional< sal_Int32 > moVertOverflow{}; std::array, 4> maTextDistanceValues; diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index fbd3e79c5a6e..69f3bf5a4d60 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1792,9 +1792,8 @@ Reference< XShape > const & Shape::createAndInsert( auto sHorzOverflow = getTextBody()->getTextProperties().msHorzOverflow; if (!sHorzOverflow.isEmpty()) putPropertyToGrabBag("horzOverflow", uno::Any(getTextBody()->getTextProperties().msHorzOverflow)); -auto nVertOverflow = getTextBody()->getTextProperties().msVertOverflow; -if (!nVertOverflow.isEmpty()) -putPropertyToGrabBag("vertOverflow", uno::Any(getTextBody()->getTextProperties().msVertOverflow)); +if (XML_ellipsis == getTextBody()->getTextProperties().moVertOverflow) +putPropertyToGrabBag("vertOverflow", uno::Any(OUString{"ellipsis"})); } // Note that the script oox/source/drawingml/customshapes/generatePresetsData.pl looks diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 47ef04797c93..46576c069c8e 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -83,7 +83,19 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper cons // ST_TextHorzOverflowType mrTextBodyProp.msHorzOverflow = rAttribs.getStringDefaulted(XML_horzOverflow); // ST_TextVertOverflowType -mrTextBodyProp.msVertOverflow = rAttribs.getStringDefaulted(XML_vertOverflow); +if( rAttribs.hasAttribute(XML_vertOverflow) ) +{ +mrTextBodyProp.moVertOverflow = rAttribs.getToken(XML_vertOverflow); +switch( mrTextBodyProp.moVertOverflow.value_or(XML_overflow) ) +{ +case XML_ellipsis: +case XML_clip: + mrTextBodyProp.maPropertyMap.setProperty(PROP_TextClipVerticalOverflow, true); +break; +default: +break; +} +} // ST_TextColumnCount if (const sal_Int32 nColumns = rAttribs.getInteger(XML_numCol, 0); nColumns > 0) diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 59d67393bed5..270d961d6d5a 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3868,6 +3868,11 @@ void DrawingML::WriteText(const Reference& rXIface, bool bBodyPr, bo } } +if (!sVertOverflow && GetProperty(rXPropSet, "TextClipVerticalOverflow") && mAny.get()) +{ +sVertOverflow = "clip"; +} + mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr, XML_numCol, sax_fastparser::UseIf(OString::number(nCols), nCols > 0), XML_spcCol, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nColSpacing)), nCols > 0 && nColSpacing >= 0), diff --git a/oox