core.git: Branch 'distro/collabora/co-23.05' - desktop/source include/sfx2 sfx2/source
desktop/source/lib/init.cxx|3 ++- include/sfx2/lokhelper.hxx |2 ++ sfx2/source/view/frmload.cxx | 30 ++ sfx2/source/view/lokhelper.cxx | 15 +++ 4 files changed, 49 insertions(+), 1 deletion(-) New commits: commit 1d7ee6942f1f1ccdb8aeb253c1cf8ce0c5f63421 Author: Henry Castro AuthorDate: Tue Feb 20 16:09:13 2024 -0400 Commit: Caolán McNamara CommitDate: Fri Mar 22 10:29:55 2024 +0100 lok: add property descriptor "Theme" Add option to load the document with a "theme" property name. Format: "document:theme_name" Signed-off-by: Henry Castro Change-Id: Iaef3d2e8962af526496e5cc95021fa94dca17939 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163671 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 9288a67c2181..323d0751cb6d 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2784,7 +2784,8 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, comphelper::makePropertyValue("InteractionHandler", xInteraction), comphelper::makePropertyValue("MacroExecutionMode", nMacroExecMode), comphelper::makePropertyValue("AsTemplate", false), -comphelper::makePropertyValue("Silent", !aBatch.isEmpty()) +comphelper::makePropertyValue("Silent", !aBatch.isEmpty()), +comphelper::makePropertyValue("Theme", extractParameter(aOptions, u"Theme")) }; /* TODO diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index e8904d013f75..35ed5109f5c0 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -131,6 +131,8 @@ public: static LOKDeviceFormFactor getDeviceFormFactor(); /// Set the device form factor that should be used for a new view. static void setDeviceFormFactor(std::u16string_view rDeviceFormFactor); +/// Get the document type +static OUString getDocumentType(const OUString& sDocumentService); /// Set timezone of the given view. /// @isSet true to use @rTimezone, even if it's empty. Otherwise, no timezone. diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index f03b08fe5886..e4acd00ffa37 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ #include #include +#include #include #include #include @@ -57,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -708,6 +711,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA const OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", OUString() ); xModel.set( m_aContext->getServiceManager()->createInstanceWithContext(sServiceName, m_aContext), UNO_QUERY_THROW ); + // load resp. init it const Reference< XLoadable > xLoadable( xModel, UNO_QUERY_THROW ); if ( bInitNewModel ) @@ -766,6 +770,32 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA } bLoadSuccess = true; + +const OUString sThemes = aDescriptor.getOrDefault("Theme", OUString()); +if (comphelper::LibreOfficeKit::isActive() && !sThemes.isEmpty()) +{ +const OUString sServiceName = aDescriptor.getOrDefault("DocumentService", OUString()); +OUString sTheme, sType, sName; +sal_Int32 nTheme = 0, nIndex = 0; +do +{ +sTheme = sThemes.getToken(0, ';', nTheme); +sType = sTheme.getToken(0, ':', nIndex); +sName = sTheme.getToken(0, ':', nIndex); +if (sType == SfxLokHelper::getDocumentType(sServiceName)) +{ +svtools::EditableColorConfig aConfig; +if (aConfig.GetCurrentSchemeName() != sName) +{ +aConfig.LoadScheme(sName); +break; +} +} +nIndex = 0; + +} +while ( nTheme >= 0 ); +} } catch ( Exception& ) { diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index e6fc7e8c7114..b22d1e488283 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -388,6 +388,21 @@ void SfxLokHelper::setDeviceFormFactor(std::u16string_view rDeviceFormFactor) g_deviceFormFactor = LOKDeviceFormFactor::UNKNOWN;
core.git: Branch 'distro/collabora/co-23.05' - svx/source
svx/source/tbxctrls/tbcontrl.cxx | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) New commits: commit f77857a5166e9dc730ab7bcec0b059f9c2e97a78 Author: Henry Castro AuthorDate: Wed Feb 28 15:59:40 2024 -0400 Commit: Henry Castro CommitDate: Mon Mar 4 13:13:05 2024 +0100 svx: fix default locale language string 1) Open a spreadsheet 2) Format a cell with a currency. Example USD $ English (USA) 3) Open the sidebar if it's not opened already 4) Click in the currency dropdown 5) Observe: there is $ (Default) Expected result: USD $ English (USA) Default Signed-off-by: Henry Castro Change-Id: Idf7f4174557e59cb6f5ffd65c25572322a5794ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164109 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164350 diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index c359ab24088f..a034b466762f 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -4147,12 +4147,19 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols(std::vector& rList, { rCurrencyList.clear(); +static const OUStringLiteral aTwoSpace(u" "); const NfCurrencyTable& rCurrencyTable = SvNumberFormatter::GetTheCurrencyTable(); sal_uInt16 nCount = rCurrencyTable.size(); sal_uInt16 nStart = 1; -OUString aString( ApplyLreOrRleEmbedding( rCurrencyTable[0].GetSymbol() ) + " " ); +LanguageTag eLangTag = Application::GetSettings().GetLanguageTag(); +OUString aString(ApplyLreOrRleEmbedding(rCurrencyTable[0].GetBankSymbol())); +aString += aTwoSpace; +aString += ApplyLreOrRleEmbedding(rCurrencyTable[0].GetSymbol()); +aString += aTwoSpace; +aString += ApplyLreOrRleEmbedding(SvtLanguageTable::GetLanguageString(eLangTag.getLanguageType())); +aString += aTwoSpace; aString += ApplyLreOrRleEmbedding(SvtLanguageTable::GetLanguageString(rCurrencyTable[0].GetLanguage())); rList.push_back( aString ); @@ -4166,9 +4173,7 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols(std::vector& rList, } CollatorWrapper aCollator( ::comphelper::getProcessComponentContext() ); -aCollator.loadDefaultCollator( Application::GetSettings().GetLanguageTag().getLocale(), 0 ); - -static const OUStringLiteral aTwoSpace(u" "); +aCollator.loadDefaultCollator(eLangTag.getLocale(), 0); for( sal_uInt16 i = 1; i < nCount; ++i ) {
core.git: svx/source
svx/source/tbxctrls/tbcontrl.cxx | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) New commits: commit c6d9cc16dbb5fe0d05ce8ca9c4c18b989596e928 Author: Henry Castro AuthorDate: Wed Feb 28 15:59:40 2024 -0400 Commit: Caolán McNamara CommitDate: Thu Feb 29 21:40:54 2024 +0100 svx: fix default locale language string 1) Open a spreadsheet 2) Format a cell with a currency. Example USD $ English (USA) 3) Open the sidebar if it's not opened already 4) Click in the currency dropdown 5) Observe: there is $ (Default) Expected result: USD $ English (USA) Default Signed-off-by: Henry Castro Change-Id: Idf7f4174557e59cb6f5ffd65c25572322a5794ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164123 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index a07a1b752d5d..4a366730b76d 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -4124,12 +4124,19 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols(std::vector& rList, { rCurrencyList.clear(); +constexpr OUString aTwoSpace = u" "_ustr; const NfCurrencyTable& rCurrencyTable = SvNumberFormatter::GetTheCurrencyTable(); sal_uInt16 nCount = rCurrencyTable.size(); sal_uInt16 nStart = 1; -OUString aString( ApplyLreOrRleEmbedding( rCurrencyTable[0].GetSymbol() ) + " " ); +LanguageTag eLangTag = Application::GetSettings().GetLanguageTag(); +OUString aString(ApplyLreOrRleEmbedding(rCurrencyTable[0].GetBankSymbol())); +aString += aTwoSpace; +aString += ApplyLreOrRleEmbedding(rCurrencyTable[0].GetSymbol()); +aString += aTwoSpace; +aString += ApplyLreOrRleEmbedding(SvtLanguageTable::GetLanguageString(eLangTag.getLanguageType())); +aString += aTwoSpace; aString += ApplyLreOrRleEmbedding(SvtLanguageTable::GetLanguageString(rCurrencyTable[0].GetLanguage())); rList.push_back( aString ); @@ -4143,9 +4150,7 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols(std::vector& rList, } CollatorWrapper aCollator( ::comphelper::getProcessComponentContext() ); -aCollator.loadDefaultCollator( Application::GetSettings().GetLanguageTag().getLocale(), 0 ); - -static constexpr OUString aTwoSpace(u" "_ustr); +aCollator.loadDefaultCollator(eLangTag.getLocale(), 0); for( sal_uInt16 i = 1; i < nCount; ++i ) {
core.git: Branch 'distro/collabora/co-24.04' - svx/source
svx/source/tbxctrls/tbcontrl.cxx | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) New commits: commit 6566304e4d6ea8fe45c08678d455db77edd14009 Author: Henry Castro AuthorDate: Wed Feb 28 15:59:40 2024 -0400 Commit: Caolán McNamara CommitDate: Thu Feb 29 18:43:06 2024 +0100 svx: fix default locale language string 1) Open a spreadsheet 2) Format a cell with a currency. Example USD $ English (USA) 3) Open the sidebar if it's not opened already 4) Click in the currency dropdown 5) Observe: there is $ (Default) Expected result: USD $ English (USA) Default Signed-off-by: Henry Castro Change-Id: Idf7f4174557e59cb6f5ffd65c25572322a5794ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164109 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index d3f89aad706c..e4c2c68ff93d 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -4124,12 +4124,19 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols(std::vector& rList, { rCurrencyList.clear(); +constexpr OUString aTwoSpace = u" "_ustr; const NfCurrencyTable& rCurrencyTable = SvNumberFormatter::GetTheCurrencyTable(); sal_uInt16 nCount = rCurrencyTable.size(); sal_uInt16 nStart = 1; -OUString aString( ApplyLreOrRleEmbedding( rCurrencyTable[0].GetSymbol() ) + " " ); +LanguageTag eLangTag = Application::GetSettings().GetLanguageTag(); +OUString aString(ApplyLreOrRleEmbedding(rCurrencyTable[0].GetBankSymbol())); +aString += aTwoSpace; +aString += ApplyLreOrRleEmbedding(rCurrencyTable[0].GetSymbol()); +aString += aTwoSpace; +aString += ApplyLreOrRleEmbedding(SvtLanguageTable::GetLanguageString(eLangTag.getLanguageType())); +aString += aTwoSpace; aString += ApplyLreOrRleEmbedding(SvtLanguageTable::GetLanguageString(rCurrencyTable[0].GetLanguage())); rList.push_back( aString ); @@ -4143,9 +4150,7 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols(std::vector& rList, } CollatorWrapper aCollator( ::comphelper::getProcessComponentContext() ); -aCollator.loadDefaultCollator( Application::GetSettings().GetLanguageTag().getLocale(), 0 ); - -static constexpr OUString aTwoSpace(u" "_ustr); +aCollator.loadDefaultCollator(eLangTag.getLocale(), 0); for( sal_uInt16 i = 1; i < nCount; ++i ) {
core.git: Branch 'distro/collabora/co-23.05' - sfx2/source
sfx2/source/doc/sfxbasemodel.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 74d22a7dad84f4abff1819764b8c407d89bb0985 Author: Henry Castro AuthorDate: Fri Feb 23 14:13:22 2024 -0400 Commit: Andras Timar CommitDate: Mon Feb 26 11:48:18 2024 +0100 lok: fix export pdf error When autosave is triggered and for some reason fails, the callback LOK_CALLBACK_EXPORT_FILE message is sent to client. - wsd-1210529-1210690 2024-02-23 16:49:50.381079 +1030 [ docbroker_001 ] TRC Triggering an autosave by timer| wsd/DocumentBroker.cpp:499 wsd-1210529-1210690 2024-02-23 16:49:50.381083 +1030 [ docbroker_001 ] TRC autoSave(): forceful? false, dontSaveIfUnmodified: true| wsd/DocumentBroker.cpp:2329 wsd-1210529-1210690 2024-02-23 16:49:50.381087 +1030 [ docbroker_001 ] TRC Checking to autosave [https%3A%2F%2Flocalhost%3A9980%2Fwopi%2Ffiles%2Fhome%2Fvalaki%2Fprojects%2Fconlinenext%2Ftest%2Fdata%2Fhello-world.ods] using session [072]| wsd/DocumentBroker.cpp:2365 --- wsd-1210529-1210690 2024-02-23 1kit-1210581-1210547 2024-02-23 16:50:14.250861 +1030 [ kitbroker_001 ] TRC Document::ViewCallback [4] [LOK_CALLBACK_EXPORT_FILE] [ERROR].| kit/Kit.cpp:1102 kit-1210581-1210547 2024-02-23 16:50:14.250880 +1030 [ kitbroker_001 ] TRC Document::ViewCallback end.| kit/Kit.cpp:1211 Signed-off-by: Henry Castro Change-Id: I6961d562bad8aa77bf479bafcaa8bd758dae259a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163857 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index ab05b4604084..34776cdd95ea 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3239,7 +3239,9 @@ void SfxBaseModel::impl_store( const OUString& sURL SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SfxEventHintId::SaveToDocFailed : SfxEventHintId::SaveAsDocFailed, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOCFAILED : GlobalEventId::SAVEASDOCFAILED), m_pData->m_pObjectShell.get() ) ); -if ( comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() ) +if ( comphelper::LibreOfficeKit::isActive() && + aFilterName.indexOf("pdf_Export") > 0 && + SfxViewShell::Current() ) SfxViewShell::Current()->libreOfficeKitViewCallback( LOK_CALLBACK_EXPORT_FILE, "ERROR" ); std::stringstream aErrCode;
core.git: Branch 'libreoffice-7-6-5' - sc/source
sc/source/core/data/table4.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 721c55f84684185fa8e4000f13dd46f12560fd09 Author: Henry Castro AuthorDate: Mon Feb 5 12:29:40 2024 -0400 Commit: Christian Lohmaier CommitDate: Thu Feb 15 21:34:43 2024 +0100 tdf#158440: do not extend transparent color Avoid to extend the area of transparent colors. Signed-off-by: Henry Castro Change-Id: Ie492e6fea2c3d8b785cfbb96fe7cfc31d87b9996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163030 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit c44e12ddb952c78dd08aba1774863554d7ecc7fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163023 Tested-by: Jenkins (cherry picked from commit 5a609bc2dc1d1b4c1b9215d9ac8f5f1ba0939569) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163028 Reviewed-by: Xisco Fauli Tested-by: Christian Lohmaier Reviewed-by: Christian Lohmaier diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 3ec8dc5aeab7..a9637584f7df 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1314,7 +1314,7 @@ void ScTable::GetBackColorArea(SCCOL& rStartCol, SCROW& /*rStartRow*/, const ScPatternAttr* pPattern = ColumnData(nCol).GetPattern(rEndRow + 1); const SvxBrushItem* pBackground = >GetItem(ATTR_BACKGROUND); if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty() || -pBackground != pDefBackground) +(pBackground->GetColor() != COL_TRANSPARENT && pBackground != pDefBackground)) { bExtend = true; break;
core.git: Branch 'libreoffice-24-2' - sc/source
sc/source/core/data/table4.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d2ba2fa1123a07a9853124218342cc83c5176491 Author: Henry Castro AuthorDate: Mon Feb 5 12:29:40 2024 -0400 Commit: Caolán McNamara CommitDate: Thu Feb 8 17:10:53 2024 +0100 tdf#158440: do not extend transparent color Avoid to extend the area of transparent colors. Signed-off-by: Henry Castro Change-Id: Ie492e6fea2c3d8b785cfbb96fe7cfc31d87b9996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163030 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit c44e12ddb952c78dd08aba1774863554d7ecc7fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163024 Tested-by: Jenkins diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 62b9dbb9e006..f8a03dd4c7ec 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1314,7 +1314,7 @@ void ScTable::GetBackColorArea(SCCOL& rStartCol, SCROW& /*rStartRow*/, const ScPatternAttr* pPattern = ColumnData(nCol).GetPattern(rEndRow + 1); const SvxBrushItem* pBackground = >GetItem(ATTR_BACKGROUND); if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty() || -pBackground != pDefBackground) +(pBackground->GetColor() != COL_TRANSPARENT && pBackground != pDefBackground)) { bExtend = true; break;
core.git: sc/source
sc/source/core/data/table4.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 43451b31969db882cd6c36054f43915ffbd8f252 Author: Henry Castro AuthorDate: Mon Feb 5 12:29:40 2024 -0400 Commit: Caolán McNamara CommitDate: Wed Feb 7 20:27:54 2024 +0100 tdf#158440: do not extend transparent color Avoid to extend the area of transparent colors. Signed-off-by: Henry Castro Change-Id: Ie492e6fea2c3d8b785cfbb96fe7cfc31d87b9996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163021 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 5bd4a6ea3ea7..438608dc8492 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1314,7 +1314,7 @@ void ScTable::GetBackColorArea(SCCOL& rStartCol, SCROW& /*rStartRow*/, const ScPatternAttr* pPattern = GetColumnData(nCol).GetPattern(rEndRow + 1); const SvxBrushItem* pBackground = >GetItem(ATTR_BACKGROUND); if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty() || -pBackground != pDefBackground) +(pBackground->GetColor() != COL_TRANSPARENT && pBackground != pDefBackground)) { bExtend = true; break;
core.git: Branch 'libreoffice-7-6' - sc/source
sc/source/core/data/table4.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5a609bc2dc1d1b4c1b9215d9ac8f5f1ba0939569 Author: Henry Castro AuthorDate: Mon Feb 5 12:29:40 2024 -0400 Commit: Henry Castro CommitDate: Wed Feb 7 16:49:22 2024 +0100 tdf#158440: do not extend transparent color Avoid to extend the area of transparent colors. Signed-off-by: Henry Castro Change-Id: Ie492e6fea2c3d8b785cfbb96fe7cfc31d87b9996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163030 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit c44e12ddb952c78dd08aba1774863554d7ecc7fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163023 Tested-by: Jenkins diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 3ec8dc5aeab7..a9637584f7df 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1314,7 +1314,7 @@ void ScTable::GetBackColorArea(SCCOL& rStartCol, SCROW& /*rStartRow*/, const ScPatternAttr* pPattern = ColumnData(nCol).GetPattern(rEndRow + 1); const SvxBrushItem* pBackground = >GetItem(ATTR_BACKGROUND); if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty() || -pBackground != pDefBackground) +(pBackground->GetColor() != COL_TRANSPARENT && pBackground != pDefBackground)) { bExtend = true; break;
core.git: Branch 'distro/collabora/co-24.04' - sc/source
sc/source/core/data/table4.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 716a4da9ec2645515f6f956384b724ab0f9fbe5d Author: Henry Castro AuthorDate: Mon Feb 5 12:29:40 2024 -0400 Commit: Caolán McNamara CommitDate: Wed Feb 7 12:09:14 2024 +0100 tdf#158440: do not extend transparent color Avoid to extend the area of transparent colors. Signed-off-by: Henry Castro Change-Id: Ie492e6fea2c3d8b785cfbb96fe7cfc31d87b9996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163022 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 62b9dbb9e006..f8a03dd4c7ec 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1314,7 +1314,7 @@ void ScTable::GetBackColorArea(SCCOL& rStartCol, SCROW& /*rStartRow*/, const ScPatternAttr* pPattern = ColumnData(nCol).GetPattern(rEndRow + 1); const SvxBrushItem* pBackground = >GetItem(ATTR_BACKGROUND); if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty() || -pBackground != pDefBackground) +(pBackground->GetColor() != COL_TRANSPARENT && pBackground != pDefBackground)) { bExtend = true; break;
core.git: Branch 'distro/collabora/co-23.05' - sc/source
sc/source/core/data/table4.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ee745444c6f88df8978b228c177670b1e358da67 Author: Henry Castro AuthorDate: Mon Feb 5 12:29:40 2024 -0400 Commit: Caolán McNamara CommitDate: Wed Feb 7 11:44:29 2024 +0100 tdf#158440: do not extend transparent color Avoid to extend the area of transparent colors. Signed-off-by: Henry Castro Change-Id: Ie492e6fea2c3d8b785cfbb96fe7cfc31d87b9996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163030 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 3ec8dc5aeab7..a9637584f7df 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1314,7 +1314,7 @@ void ScTable::GetBackColorArea(SCCOL& rStartCol, SCROW& /*rStartRow*/, const ScPatternAttr* pPattern = ColumnData(nCol).GetPattern(rEndRow + 1); const SvxBrushItem* pBackground = >GetItem(ATTR_BACKGROUND); if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty() || -pBackground != pDefBackground) +(pBackground->GetColor() != COL_TRANSPARENT && pBackground != pDefBackground)) { bExtend = true; break;
core.git: framework/source sc/source
framework/source/uielement/langselectionstatusbarcontroller.cxx |5 - sc/source/ui/docshell/docsh4.cxx| 45 ++ 2 files changed, 33 insertions(+), 17 deletions(-) New commits: commit 64e1a5916367644ad3883a24ab1630d1340603b3 Author: Henry Castro AuthorDate: Wed Jan 17 16:25:41 2024 -0400 Commit: Henry Castro CommitDate: Fri Jan 26 19:41:14 2024 +0100 tdf#127856: fix setting "None" in cell format language Change-Id: I94dc0b1e7f0a52e8fb6da1f9b80456cec696a727 Signed-off-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162244 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx index 2d56c4186883..f5730ae7ee54 100644 --- a/framework/source/uielement/langselectionstatusbarcontroller.cxx +++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx @@ -190,7 +190,10 @@ void LangSelectionStatusbarController::LangMenu( } else { -xPopupMenu->insertItem( MID_LANG_DEF_NONE, FwkResId(STR_LANGSTATUS_NONE), 0, MID_LANG_DEF_NONE ); +if (bCalc) +xPopupMenu->insertItem( MID_LANG_SEL_NONE, FwkResId(STR_LANGSTATUS_NONE), 0, MID_LANG_SEL_NONE ); +else +xPopupMenu->insertItem( MID_LANG_DEF_NONE, FwkResId(STR_LANGSTATUS_NONE), 0, MID_LANG_DEF_NONE ); if ( sNone == m_aCurLang ) xPopupMenu->checkItem( MID_LANG_DEF_NONE, true ); xPopupMenu->insertItem( MID_LANG_DEF_RESET, FwkResId(STR_RESET_TO_DEFAULT_LANGUAGE), 0, MID_LANG_DEF_RESET ); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 82b874391f38..34e69724742c 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1301,28 +1301,41 @@ void ScDocShell::Execute( SfxRequest& rReq ) if (bSelection) { ScTabViewShell* pViewShell = GetBestViewShell(); -const LanguageType nLangType = SvtLanguageTable::GetLanguageType(aLangText); -const SvtScriptType nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType); - if (pViewShell) { const ScPatternAttr* pSelAttrs = pViewShell->GetSelectionPattern(); if (pSelAttrs) { const SfxItemSet& rOldSet = pSelAttrs->GetItemSet(); +SfxItemPool* pItemPool = rOldSet.GetPool(); auto pNewSet = std::make_shared(rOldSet); -if (nScriptType == SvtScriptType::LATIN) -pNewSet->Put(SvxLanguageItem(nLangType, - rOldSet.GetPool()->GetWhich(SID_ATTR_CHAR_LANGUAGE))); -if (nScriptType == SvtScriptType::COMPLEX) -pNewSet->Put(SvxLanguageItem(nLangType, - rOldSet.GetPool()->GetWhich(SID_ATTR_CHAR_CTL_LANGUAGE))); -if (nScriptType == SvtScriptType::ASIAN) -pNewSet->Put(SvxLanguageItem(nLangType, - rOldSet.GetPool()->GetWhich(SID_ATTR_CHAR_CJK_LANGUAGE))); - +if (aLangText == "LANGUAGE_NONE") +{ +pNewSet->Put(SvxLanguageItem(LANGUAGE_NONE, + pItemPool->GetWhich(SID_ATTR_CHAR_LANGUAGE))); +pNewSet->Put(SvxLanguageItem(LANGUAGE_NONE, + pItemPool->GetWhich(SID_ATTR_CHAR_CJK_LANGUAGE))); +pNewSet->Put(SvxLanguageItem(LANGUAGE_NONE, + pItemPool->GetWhich(SID_ATTR_CHAR_CTL_LANGUAGE))); +} +else +{ +const LanguageType nLangType = SvtLanguageTable::GetLanguageType(aLangText); +const SvtScriptType nScriptType = + SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType); +if (nScriptType == SvtScriptType::LATIN) +pNewSet->Put(SvxLanguageItem(nLangType, + pItemPool->GetWhich(SID_ATTR_CHAR_LANGUAGE))); +if (nScriptType == SvtScrip
core.git: framework/source sc/source
framework/source/uielement/langselectionstatusbarcontroller.cxx |5 sc/source/ui/docshell/docsh4.cxx| 11 -- 2 files changed, 6 insertions(+), 10 deletions(-) New commits: commit 966f075a332b38a2689dad317d5d3c3fa61a1efb Author: Henry Castro AuthorDate: Wed Jan 24 09:51:17 2024 -0400 Commit: Henry Castro CommitDate: Fri Jan 26 19:40:54 2024 +0100 tdf#34142: update status language after the cell format language change Change-Id: Ieb97515cee469a54c5b28ac4477c9d0d78e2974c Signed-off-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162243 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx index 169583a76fcd..2d56c4186883 100644 --- a/framework/source/uielement/langselectionstatusbarcontroller.cxx +++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx @@ -244,10 +244,7 @@ void LangSelectionStatusbarController::LangMenu( } else if (nId == MID_LANG_DEF_MORE) { -if (bCalc) -aBuff.append( ".uno:FormatCellDialog" ); -else -aBuff.append( ".uno:LanguageStatus?Language:string=*" ); +aBuff.append( ".uno:LanguageStatus?Language:string=*" ); } else if (MID_LANG_PARA_1 <= nId && nId <= MID_LANG_PARA_9) { diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 813d86785a7a..82b874391f38 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1252,12 +1252,11 @@ void ScDocShell::Execute( SfxRequest& rReq ) sal_Int32 nPos = 0; if ( aLangText == "*" ) { -SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); -ScTabViewShell* pSh = GetBestViewShell(); -ScopedVclPtr pDlg(pFact->CreateVclDialog(pSh ? pSh->GetDialogParent() : nullptr, SID_LANGUAGE_OPTIONS)); -pDlg->Execute(); - -rDoc.GetLanguage( eLang, eCjk, eCtl ); +if (ScTabViewShell* pSh = GetBestViewShell()) +{ +pSh->ExecuteCellFormatDlg(rReq, "font"); +pBindings->Invalidate(SID_LANGUAGE_STATUS); +} } else if ( (nPos = aLangText.indexOf(aDocLangPrefix)) != -1 ) {
core.git: sc/source
sc/source/ui/docshell/docsh4.cxx | 51 +++ sc/source/ui/view/tabview3.cxx |2 + 2 files changed, 49 insertions(+), 4 deletions(-) New commits: commit b8bc9518d523cff59e238f1eefc4ce7e7c844196 Author: Henry Castro AuthorDate: Mon Jan 15 13:50:41 2024 -0400 Commit: Henry Castro CommitDate: Fri Jan 26 19:40:36 2024 +0100 tdf#34142: fix cell language status Now the status bar will show the current cell language instead of the document language. Change-Id: I8b6d17b37e7c7bd69abd949a901499613f100649 Signed-off-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162123 Reviewed-by: Caolán McNamara Tested-by: Jenkins diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 9396b59518fe..813d86785a7a 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2207,16 +2207,59 @@ void ScDocShell::GetState( SfxItemSet ) case SID_LANGUAGE_STATUS: { -LanguageType eLatin, eCjk, eCtl; +OUString sLanguage; +sal_uInt16 nLangWhich = 0; +LanguageType eLatin = LANGUAGE_DONTKNOW, eCjk = LANGUAGE_DONTKNOW, +eCtl = LANGUAGE_DONTKNOW; + +if (comphelper::LibreOfficeKit::isActive()) +{ +GetDocument().GetLanguage( eLatin, eCjk, eCtl ); +sLanguage = SvtLanguageTable::GetLanguageString(eLatin); -GetDocument().GetLanguage( eLatin, eCjk, eCtl ); -OUString sLanguage = SvtLanguageTable::GetLanguageString(eLatin); -if (comphelper::LibreOfficeKit::isActive()) { if (eLatin == LANGUAGE_NONE) sLanguage += ";-"; else sLanguage += ";" + LanguageTag(eLatin).getBcp47(false); } +else if (ScTabViewShell* pViewShell = GetBestViewShell()) +{ +ScMarkData aMark = pViewShell->GetViewData().GetMarkData(); +SCCOL nCol = pViewShell->GetViewData().GetCurX(); +SCROW nRow = pViewShell->GetViewData().GetCurY(); +SCTAB nTab = pViewShell->GetViewData().GetTabNo(); + +aMark.SetMarkArea(ScRange(nCol, nRow, nTab)); +const ScPatternAttr* pSelAttrs = GetDocument().GetSelectionPattern(aMark); +if (pSelAttrs) +{ +const SfxItemSet& rItemSet = pSelAttrs->GetItemSet(); +nLangWhich = rItemSet.GetPool()->GetWhich(SID_ATTR_CHAR_LANGUAGE); +if (SfxItemState::SET == rItemSet.GetItemState(nLangWhich)) +eLatin = static_cast(rItemSet.Get(nLangWhich)).GetLanguage(); + +nLangWhich = rItemSet.GetPool()->GetWhich(SID_ATTR_CHAR_CJK_LANGUAGE); +if (SfxItemState::SET == rItemSet.GetItemState(nLangWhich)) +eCjk = static_cast(rItemSet.Get(nLangWhich)).GetLanguage(); + +nLangWhich = rItemSet.GetPool()->GetWhich(SID_ATTR_CHAR_CTL_LANGUAGE); +if (SfxItemState::SET == rItemSet.GetItemState(nLangWhich)) +eCtl = static_cast(rItemSet.Get(nLangWhich)).GetLanguage(); + +if (eLatin != LANGUAGE_NONE && eLatin != LANGUAGE_DONTKNOW) +sLanguage = SvtLanguageTable::GetLanguageString(eLatin); +if (eCjk != LANGUAGE_NONE && eCjk != LANGUAGE_DONTKNOW) +sLanguage = SvtLanguageTable::GetLanguageString(eCjk); +if (eCtl != LANGUAGE_NONE && eCtl != LANGUAGE_DONTKNOW) +sLanguage = SvtLanguageTable::GetLanguageString(eCtl); + +if (sLanguage.isEmpty()) +{ +GetDocument().GetLanguage(eLatin, eCjk, eCtl); +sLanguage = SvtLanguageTable::GetLanguageString(eLatin); +} +} +} rSet.Put(SfxStringItem(nWhich, sLanguage)); } break; diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index fe78ab3e8385..7de940ce24a9 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -621,6 +621,8 @@ void ScTabView::SelectionChanged(bool bFromPaste) rBindings.Invalida
core.git: framework/source sc/source
framework/source/uielement/langselectionstatusbarcontroller.cxx |2 sc/source/ui/docshell/docsh4.cxx| 30 +- 2 files changed, 30 insertions(+), 2 deletions(-) New commits: commit fbbad70b9437aa2e96f004c530f2d552715cf810 Author: Henry Castro AuthorDate: Wed Dec 27 11:12:16 2023 -0400 Commit: Caolán McNamara CommitDate: Fri Jan 5 18:14:26 2024 +0100 tdf#127856: fix cell selection language Clicking the language in the popup Calc's status bar, it will change the cell range selection language property. Signed-off-by: Henry Castro Change-Id: I1cc218da44eff0a4d3acee7b089e54aaad474379 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161371 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx index f913688526db..169583a76fcd 100644 --- a/framework/source/uielement/langselectionstatusbarcontroller.cxx +++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx @@ -212,7 +212,7 @@ void LangSelectionStatusbarController::LangMenu( if (MID_LANG_SEL_1 <= nId && nId <= MID_LANG_SEL_9) { -if (bWriter) +if (bWriter || bCalc) aBuff.append( ".uno:LanguageStatus?Language:string=Current_" ); else aBuff.append( ".uno:LanguageStatus?Language:string=Default_" ); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 08a37c9e1b62..3e316ce9420f 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1290,7 +1290,35 @@ void ScDocShell::Execute( SfxRequest& rReq ) aLangText = aLangText.replaceAt( nPos, aParagraphLangPrefix.getLength(), u"" ); } -if (bSelection || bParagraph) +if (bSelection) +{ +ScTabViewShell* pViewShell = GetBestViewShell(); +const LanguageType nLangType = SvtLanguageTable::GetLanguageType(aLangText); +const SvtScriptType nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType); + +if (pViewShell) +{ +const ScPatternAttr* pSelAttrs = pViewShell->GetSelectionPattern(); +if (pSelAttrs) +{ +const SfxItemSet& rOldSet = pSelAttrs->GetItemSet(); +auto pNewSet = std::make_shared(rOldSet); + +if (nScriptType == SvtScriptType::LATIN) +pNewSet->Put(SvxLanguageItem(nLangType, + rOldSet.GetPool()->GetWhich(SID_ATTR_CHAR_LANGUAGE))); +if (nScriptType == SvtScriptType::COMPLEX) +pNewSet->Put(SvxLanguageItem(nLangType, + rOldSet.GetPool()->GetWhich(SID_ATTR_CHAR_CJK_LANGUAGE))); +if (nScriptType == SvtScriptType::ASIAN) +pNewSet->Put(SvxLanguageItem(nLangType, + rOldSet.GetPool()->GetWhich(SID_ATTR_CHAR_CTL_LANGUAGE))); + +pViewShell->ApplyAttributes(*pNewSet, rOldSet); +} +} +} +else if (bParagraph) { ScViewData* pViewData = GetViewData(); if (!pViewData)
core.git: Branch 'distro/collabora/co-23.05' - oox/source sd/qa sd/source
oox/source/ppt/presentationfragmenthandler.cxx |7 - sd/qa/unit/export-tests-ooxml2.cxx |6 - sd/qa/unit/export-tests-ooxml3.cxx |4 sd/source/filter/eppt/epptooxml.hxx|4 sd/source/filter/eppt/pptx-epptooxml.cxx | 128 + sd/source/ui/inc/unopage.hxx |1 sd/source/ui/unoidl/unopage.cxx| 13 -- 7 files changed, 17 insertions(+), 146 deletions(-) New commits: commit 6c6ed62a98ee180236b60047f21c4584a323c931 Author: Henry Castro AuthorDate: Sun Dec 10 10:44:23 2023 -0400 Commit: Henry Castro CommitDate: Mon Dec 11 15:54:51 2023 +0100 tdf#158513: Revert "tdf#155512: sd: filter: eppt: add "SlideLayout" This reverts commit c8d8d3bffec73e965ca3b9b30c4d74515e2d0d4e. https://bugs.documentfoundation.org/show_bug.cgi?id=158513 1. Open example PPTX in Impress 2. Save from Impress. 3. Open just saved version in Impress again. 4. Observe how the background is gone. Unit test adjustment: SdOOXMLExportTest2::testAccentColor() Now all slide masters are imported, so when saves and reload same document, the reference theme has changed. Change-Id: I9cdcb585b1143c2c76feea10fee71d6b83f698df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160569 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 91824210e239..1586a8a26174 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -212,11 +212,11 @@ void PresentationFragmentHandler::importMasterSlide(const ReferencegetFragmentPathFromRelation(rEntry.second); + if (!rEntry.second.maType.endsWith("relationships/slideLayout")) continue; -aLayoutFragmentPath = xMasterRelations->getFragmentPathFromRelation(rEntry.second); - sal_Int32 nIndex; if( rFilter.getMasterPages().empty() ) { @@ -271,9 +271,6 @@ void PresentationFragmentHandler::importMasterSlide(const ReferencecreateBackground( rFilter ); pMasterPersistPtr->createXShapes( rFilter ); -uno::Reference< beans::XPropertySet > xSet(pMasterPersistPtr->getPage(), uno::UNO_QUERY_THROW); -xSet->setPropertyValue("SlideLayout", Any(pMasterPersistPtr->getLayoutFromValueToken())); - oox::drawingml::ThemePtr pTheme = pMasterPersistPtr->getTheme(); if (pTheme) { diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 47efaea2fe55..9d572a8ee10c 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -1462,7 +1462,7 @@ void SdOOXMLExportTest2::testTdf106867() "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/" "p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/" "p:cBhvr/p:tgtEl/p:spTgt", -"spid", "42"); +"spid", "455"); } void SdOOXMLExportTest2::testTdf112280() @@ -1841,7 +1841,7 @@ void SdOOXMLExportTest2::testAccentColor() xmlDocUniquePtr pXmlDocTheme1 = parseExport("ppt/theme/theme1.xml"); assertXPath(pXmlDocTheme1, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "70ad47"); -xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml"); +xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme24.xml"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "deb340"); @@ -1858,7 +1858,7 @@ void SdOOXMLExportTest2::testThemeColors() createSdImpressDoc("pptx/tdf84205.pptx"); save("Impress Office Open XML"); -xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme1.xml"); +xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "44546a"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent3/a:srgbClr", "val", diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index 0c9ab10203e0..dd0945bd4c40 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -288,6 +288,10 @@ void SdOOXMLExportTest3::testTdf114848() xmlDocUniquePtr pXmlDocTheme1 = parseExport("ppt/theme/theme1.xml"); assertXPath(pXmlDocTheme1, &
core.git: Changes to 'refs/tags/mimo-7.3.7.2.M8'
Tag 'mimo-7.3.7.2.M8' created by Aron Budea at 2023-12-11 00:21 + mimo-7.3.7.2.M8 Changes since mimo-7.3.7.2.M7-30: --- 0 files changed ---
core.git: Branch 'distro/mimo/mimo-7-3' - 4 commits - chart2/source sc/inc sc/source
chart2/source/controller/dialogs/DialogModel.cxx |2 sc/inc/column.hxx|2 sc/inc/dbdata.hxx|1 sc/inc/document.hxx |7 + sc/inc/table.hxx |3 sc/source/core/data/column3.cxx | 83 +++ sc/source/core/data/document.cxx |7 + sc/source/core/data/table3.cxx |6 + sc/source/core/data/table4.cxx | 34 + sc/source/core/tool/dbdata.cxx | 17 sc/source/ui/view/gridwin.cxx|1 sc/source/ui/view/tabvwshc.cxx |1 12 files changed, 153 insertions(+), 11 deletions(-) New commits: commit 55179934c0fb48e43ef16172e85b2d7af360fee4 Author: Henry Castro AuthorDate: Thu Nov 23 11:49:15 2023 -0400 Commit: Aron Budea CommitDate: Sat Dec 9 21:30:04 2023 +1030 sc: fix back color filter entries The function "GetFilterEntries" iterates only that contains cell data value entries, the background color filter feature requires to iterate background color attribute which is not stored in multi type vector cells. Signed-off-by: Henry Castro Change-Id: I372db48d2399f62712f642eefdbfea8885b09f58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159864 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit 826eae46095b2184554565bab1792e96964a720f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159905 Tested-by: Jenkins (cherry picked from commit 8b2369236dea7d6863c2df3d4ce5e356c9c8010c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160038 (cherry picked from commit 6b1d35b9af28e9f54306112203fa98961cd3e567) diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index b8e348d00e70..2f22ada03caa 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -544,6 +544,8 @@ public: sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow, ScFilterEntries& rFilterEntries, bool bFiltering ); +void GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries ); + bool GetDataEntries( SCROW nRow, std::set& rStrings) const; void UpdateInsertTabAbs(SCTAB nNewPos); diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 69a32eaad433..ebec09e581ef 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2720,6 +2720,66 @@ void ScColumn::GetFilterEntries( sc::ParseAll(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc, aFunc); } +void ScColumn::GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries) +{ +Color aBackColor; +bool bCondBackColor = false; +ScAddress aCell(GetCol(), 0, GetTab()); +ScConditionalFormat* pCondFormat = nullptr; + +const SfxItemSet* pCondSet = nullptr; +const SvxBrushItem* pBrush = nullptr; +const ScPatternAttr* pPattern = nullptr; +const ScColorScaleFormat* pColFormat = nullptr; + +if (!GetDoc().ValidRow(nRow1) || !GetDoc().ValidRow(nRow2)) +return; + +while (nRow1 <= nRow2) +{ +aCell.SetRow(nRow1); +pPattern = GetDoc().GetPattern(aCell.Col(), aCell.Row(), aCell.Tab()); +if (pPattern) +{ +if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty()) +{ +pCondSet = GetDoc().GetCondResult(GetCol(), nRow1, GetTab()); +pBrush = >GetItem(ATTR_BACKGROUND, pCondSet); +aBackColor = pBrush->GetColor(); +bCondBackColor = true; +} +} + +pCondFormat = GetDoc().GetCondFormat(aCell.Col(), aCell.Row(), aCell.Tab()); +if (pCondFormat) +{ +for (size_t nFormat = 0; nFormat < pCondFormat->size(); nFormat++) +{ +auto aEntry = pCondFormat->GetEntry(nFormat); +if (aEntry->GetType() == ScFormatEntry::Type::Colorscale) +{ +pColFormat = static_cast(aEntry); +std::optional oColor = pColFormat->GetColor(aCell); +if (oColor) +{ +aBackColor = *oColor; +bCondBackColor = true; +} +} +} +} + +if (!bCondBackColor) +{ +pBrush = GetDoc().GetAttr(aCell, ATTR_BACKGROUND); +aBackColor = pBrush->GetColor(); +} + +rFilterEntries.addBackgroundColor(aBackColor); +nRow1++; +} +} + namespace { /** diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index efcc910dc696..e4b13f8ad17f 100644 --- a/sc/source/core/dat
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/globstr.hrc |1 + sc/source/ui/view/viewfunc.cxx |5 + 2 files changed, 6 insertions(+) New commits: commit fd11b63244f784b336690d9096cd3f820cdbb9ee Author: Henry Castro AuthorDate: Mon Dec 4 10:33:01 2023 -0400 Commit: Caolán McNamara CommitDate: Tue Dec 5 12:59:14 2023 +0100 sc: show a message dialog if insert cells fail Use case, go to the max row and insert a row. Signed-off-by: Henry Castro Change-Id: I930d7724b9c94e10e9207ec749b7249d2fee0e39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160314 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit eccbe3bb4ed6f0bed4e7fbacfaf50762c93f9464) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160183 Tested-by: Jenkins diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index e8e45fc01b2e..8b07dc508edd 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -566,6 +566,7 @@ #define STR_UNDO_EDIT_SPARKLINE NC_("STR_UNDO_EDIT_SPARKLINE", "Edit Sparkline") #define STR_UNDO_THEME_CHANGE NC_("STR_UNDO_THEME_CHANGE", "Theme Change") #define STR_UNDO_THEME_COLOR_CHANGE NC_("STR_UNDO_THEME_COLOR_CHANGE", "Theme Color Change") +#define STR_ERR_INSERT_CELLSNC_("STR_ERR_INSERT_CELLS", "Failed to insert cells") #endif diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 98d2a1ebbe42..0b8b0865f0fc 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1786,6 +1786,11 @@ bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste ) true /* bGroups */, GetViewData().GetTabNo()); } } +else +{ +ErrorMessage(STR_ERR_INSERT_CELLS); +} + OUString aStartAddress = aRange.aStart.GetColRowString(); OUString aEndAddress = aRange.aEnd.GetColRowString(); collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}}, "INSERT_CELLS");
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/inc sc/source
sc/inc/globstr.hrc |1 + sc/source/ui/view/viewfunc.cxx |5 + 2 files changed, 6 insertions(+) New commits: commit eccbe3bb4ed6f0bed4e7fbacfaf50762c93f9464 Author: Henry Castro AuthorDate: Mon Dec 4 10:33:01 2023 -0400 Commit: Caolán McNamara CommitDate: Mon Dec 4 20:05:58 2023 +0100 sc: show a message dialog if insert cells fail Use case, go to the max row and insert a row. Signed-off-by: Henry Castro Change-Id: I930d7724b9c94e10e9207ec749b7249d2fee0e39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160314 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index f4afbb7de320..aff27e3608dd 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -550,6 +550,7 @@ #define STR_UNDO_EDIT_SPARKLINE NC_("STR_UNDO_EDIT_SPARKLINE", "Edit Sparkline") #define STR_UNDO_THEME_CHANGE NC_("STR_UNDO_THEME_CHANGE", "Theme Change") #define STR_UNDO_THEME_COLOR_CHANGE NC_("STR_UNDO_THEME_COLOR_CHANGE", "Theme Color Change") +#define STR_ERR_INSERT_CELLSNC_("STR_ERR_INSERT_CELLS", "Failed to insert cells") #endif diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 13eb71acef52..15076f04a958 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1776,6 +1776,11 @@ bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste ) true /* bGroups */, GetViewData().GetTabNo()); } } +else +{ +ErrorMessage(STR_ERR_INSERT_CELLS); +} + OUString aStartAddress = aRange.aStart.GetColRowString(); OUString aEndAddress = aRange.aEnd.GetColRowString(); collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}}, "INSERT_CELLS");
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 2 commits - sc/qa sw/CppunitTest_sw_core_layout.mk sw/qa sw/source
sc/qa/unit/subsequent_filters_test2.cxx| 38 +++ sw/CppunitTest_sw_core_layout.mk |1 sw/qa/core/layout/data/floattable-negative-height.docx |binary sw/qa/core/layout/fly.cxx | 91 + sw/source/core/layout/fly.cxx | 14 ++ 5 files changed, 142 insertions(+), 2 deletions(-) New commits: commit 87beab25f798006d1aaaeba06e2ec2cc9ed03eed Author: Henry Castro AuthorDate: Fri Nov 24 10:00:54 2023 -0400 Commit: Xisco Fauli CommitDate: Thu Nov 30 10:23:25 2023 +0100 sc: qa: add unit test "testBackColorFilter" Change-Id: Icdccd6778d1157bb31f38b510a58562a640bdeae Signed-off-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159929 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160089 Tested-by: Jenkins (cherry picked from commit 3275f57221904426e5c136f5596a83050f8585a4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160043 Reviewed-by: Xisco Fauli diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx index a0a4a92d299b..099a6be86fb7 100644 --- a/sc/qa/unit/subsequent_filters_test2.cxx +++ b/sc/qa/unit/subsequent_filters_test2.cxx @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include @@ -39,6 +41,7 @@ #include #include #include +#include #include #include @@ -1613,6 +1616,41 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testSingleLine) testCells(pDoc); } +CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testBackColorFilter) +{ +Color aBackColor1(0xc99c00); +Color aBackColor2(0x0369a3); + +createScDoc(); +ScDocument* pDoc = getScDoc(); + +ScPatternAttr aPattern1(pDoc->GetPool()); +aPattern1.GetItemSet().Put(SvxBrushItem(aBackColor1, ATTR_BACKGROUND)); + +ScPatternAttr aPattern2(pDoc->GetPool()); +aPattern2.GetItemSet().Put(SvxBrushItem(aBackColor2, ATTR_BACKGROUND)); + +// Apply the pattern to cell A1:A2 +pDoc->ApplyPatternAreaTab(0, 0, 0, 1, 0, aPattern1); + +// Apply the pattern to cell A3:A5 +pDoc->ApplyPatternAreaTab(0, 2, 0, 4, 0, aPattern2); + +{ +ScRefCellValue aCell; +aCell.assign(*pDoc, ScAddress(0, 0, 0)); +CPPUNIT_ASSERT_MESSAGE("Cell A1 should be empty.", aCell.isEmpty()); +aCell.assign(*pDoc, ScAddress(0, 2, 0)); +CPPUNIT_ASSERT_MESSAGE("Cell A3 should be empty.", aCell.isEmpty()); +} + +{ +ScFilterEntries aFilterEntries; +pDoc->GetFilterEntriesArea(0, 0, 4, 0, true, aFilterEntries); +CPPUNIT_ASSERT_EQUAL(size_t(2), aFilterEntries.getBackgroundColors().size()); +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit d9c85df89513d63263c6e852ad68ec780dbce0c2 Author: Miklos Vajna AuthorDate: Wed Nov 29 08:35:35 2023 +0100 Commit: Xisco Fauli CommitDate: Thu Nov 30 10:23:15 2023 +0100 tdf#158341 sw floattable: fix layout loop when fly is below the body frame Regression from commit 25b8fdd3b939a221ba00ca37fbf89adaf893aab7 (sw floattable: maintain the invariant that fly height is at least MINFLY, 2023-09-28), the document started to layout-loop on load. What happens is we have a fly frame where the bottom of the body frame is above both the top and bottom of the fly. We used to make sure these flys don't "flip" (with a negative height) and ensure that their height is still MINFLY. But that causes a new problem, because the layout will try to make sure they fit, but they can't have enough space. Fix the problem by improving the correction of the fly height, so in case even the top is below the deadline, then we set the height to 0 and explicitly mark the frame as clipped. That keeps the unwanted warnings about violated invariants fixed and fixes the layout loop. The test just ensures that all pages but the last one has a single multi-page floating table, chained over several pages. Change-Id: Ibac0a465839a59abe5ae49809c0d76c955aa39b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160061 Reviewed-by: Miklos Vajna Tested-by: Jenkins (cherry picked from commit ce2fc5eb29b4e252993b549dee002fa8948c8386) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160034 Reviewed-by: Xisco Fauli diff --git a/sw/CppunitTest_sw_core_layout.mk b/sw/CppunitTest_sw_core_layout.mk index 94ef1f05bfce..1c2c3ae744b2 100644 --- a/sw/CppunitTest_sw_core_layout.mk +++ b/sw/CppunitTest_sw_core_layout.mk @@ -14,6 +14,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,sw_core_layout)) $(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_layout)) $(eval $(call gb_CppunitTest_add_exception_objects,sw_core_layout, \ +sw/qa/core/
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/inc sc/source
sc/inc/column.hxx |2 + sc/source/core/data/column3.cxx | 60 sc/source/core/data/table3.cxx |6 3 files changed, 68 insertions(+) New commits: commit 300a09f4ebae1c1e08645f5d0112137d25223f37 Author: Henry Castro AuthorDate: Thu Nov 23 11:49:15 2023 -0400 Commit: Xisco Fauli CommitDate: Thu Nov 30 09:24:20 2023 +0100 sc: fix back color filter entries The function "GetFilterEntries" iterates only that contains cell data value entries, the background color filter feature requires to iterate background color attribute which is not stored in multi type vector cells. Signed-off-by: Henry Castro Change-Id: I372db48d2399f62712f642eefdbfea8885b09f58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159864 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit 826eae46095b2184554565bab1792e96964a720f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159905 Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160110 diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 4b64537e1705..128fec4aa982 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -599,6 +599,8 @@ public: sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow, ScFilterEntries& rFilterEntries, bool bFiltering, bool bFilteredRow ); +void GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries ); + bool GetDataEntries( SCROW nRow, std::set& rStrings) const; void UpdateInsertTabAbs(SCTAB nNewPos); diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 054e334edb06..a0b0c639a003 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2701,6 +2701,66 @@ void ScColumn::GetFilterEntries( sc::ParseAll(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc, aFunc); } +void ScColumn::GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries) +{ +Color aBackColor; +bool bCondBackColor = false; +ScAddress aCell(GetCol(), 0, GetTab()); +ScConditionalFormat* pCondFormat = nullptr; + +const SfxItemSet* pCondSet = nullptr; +const SvxBrushItem* pBrush = nullptr; +const ScPatternAttr* pPattern = nullptr; +const ScColorScaleFormat* pColFormat = nullptr; + +if (!GetDoc().ValidRow(nRow1) || !GetDoc().ValidRow(nRow2)) +return; + +while (nRow1 <= nRow2) +{ +aCell.SetRow(nRow1); +pPattern = GetDoc().GetPattern(aCell.Col(), aCell.Row(), aCell.Tab()); +if (pPattern) +{ +if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty()) +{ +pCondSet = GetDoc().GetCondResult(GetCol(), nRow1, GetTab()); +pBrush = >GetItem(ATTR_BACKGROUND, pCondSet); +aBackColor = pBrush->GetColor(); +bCondBackColor = true; +} +} + +pCondFormat = GetDoc().GetCondFormat(aCell.Col(), aCell.Row(), aCell.Tab()); +if (pCondFormat) +{ +for (size_t nFormat = 0; nFormat < pCondFormat->size(); nFormat++) +{ +auto aEntry = pCondFormat->GetEntry(nFormat); +if (aEntry->GetType() == ScFormatEntry::Type::Colorscale) +{ +pColFormat = static_cast(aEntry); +std::optional oColor = pColFormat->GetColor(aCell); +if (oColor) +{ +aBackColor = *oColor; +bCondBackColor = true; +} +} +} +} + +if (!bCondBackColor) +{ +pBrush = GetDoc().GetAttr(aCell, ATTR_BACKGROUND); +aBackColor = pBrush->GetColor(); +} + +rFilterEntries.addBackgroundColor(aBackColor); +nRow1++; +} +} + namespace { /** diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index f0a55b478c0c..dafa38e24d46 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -3018,6 +3018,12 @@ void ScTable::GetFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, ScFilterEn sc::ColumnBlockConstPosition aBlockPos; aCol[nCol].InitBlockPosition(aBlockPos); aCol[nCol].GetFilterEntries(aBlockPos, nRow1, nRow2, rFilterEntries, bFiltering, false /*bFilteredRow*/); + +SCROW nLastRow = aBlockPos.miCellPos->position; +if (nLastRow < nRow2) +{ +aCol[nCol].GetBackColorFilterEntries(nLastRow, nRow2, rFilterEntries); +} } void ScTable::GetFilteredFilterEntries(
[Libreoffice-commits] core.git: Branch 'distro/mimo/mimo-7-5' - sc/inc sc/source
sc/inc/column.hxx |2 + sc/source/core/data/column3.cxx | 60 sc/source/core/data/table3.cxx |6 3 files changed, 68 insertions(+) New commits: commit 6b1d35b9af28e9f54306112203fa98961cd3e567 Author: Henry Castro AuthorDate: Thu Nov 23 11:49:15 2023 -0400 Commit: Henry Castro CommitDate: Wed Nov 29 20:57:08 2023 +0100 sc: fix back color filter entries The function "GetFilterEntries" iterates only that contains cell data value entries, the background color filter feature requires to iterate background color attribute which is not stored in multi type vector cells. Signed-off-by: Henry Castro Change-Id: I372db48d2399f62712f642eefdbfea8885b09f58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159864 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit 826eae46095b2184554565bab1792e96964a720f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159905 Tested-by: Jenkins (cherry picked from commit 8b2369236dea7d6863c2df3d4ce5e356c9c8010c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160038 diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 87d3dc730a9f..9fb3e9557bb0 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -598,6 +598,8 @@ public: sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow, ScFilterEntries& rFilterEntries, bool bFiltering, bool bFilteredRow ); +void GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries ); + bool GetDataEntries( SCROW nRow, std::set& rStrings) const; void UpdateInsertTabAbs(SCTAB nNewPos); diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index ca16c49d8de8..2ef0f9aee3df 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2753,6 +2753,66 @@ void ScColumn::GetFilterEntries( sc::ParseAll(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc, aFunc); } +void ScColumn::GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries) +{ +Color aBackColor; +bool bCondBackColor = false; +ScAddress aCell(GetCol(), 0, GetTab()); +ScConditionalFormat* pCondFormat = nullptr; + +const SfxItemSet* pCondSet = nullptr; +const SvxBrushItem* pBrush = nullptr; +const ScPatternAttr* pPattern = nullptr; +const ScColorScaleFormat* pColFormat = nullptr; + +if (!GetDoc().ValidRow(nRow1) || !GetDoc().ValidRow(nRow2)) +return; + +while (nRow1 <= nRow2) +{ +aCell.SetRow(nRow1); +pPattern = GetDoc().GetPattern(aCell.Col(), aCell.Row(), aCell.Tab()); +if (pPattern) +{ +if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty()) +{ +pCondSet = GetDoc().GetCondResult(GetCol(), nRow1, GetTab()); +pBrush = >GetItem(ATTR_BACKGROUND, pCondSet); +aBackColor = pBrush->GetColor(); +bCondBackColor = true; +} +} + +pCondFormat = GetDoc().GetCondFormat(aCell.Col(), aCell.Row(), aCell.Tab()); +if (pCondFormat) +{ +for (size_t nFormat = 0; nFormat < pCondFormat->size(); nFormat++) +{ +auto aEntry = pCondFormat->GetEntry(nFormat); +if (aEntry->GetType() == ScFormatEntry::Type::Colorscale) +{ +pColFormat = static_cast(aEntry); +std::optional oColor = pColFormat->GetColor(aCell); +if (oColor) +{ +aBackColor = *oColor; +bCondBackColor = true; +} +} +} +} + +if (!bCondBackColor) +{ +pBrush = GetDoc().GetAttr(aCell, ATTR_BACKGROUND); +aBackColor = pBrush->GetColor(); +} + +rFilterEntries.addBackgroundColor(aBackColor); +nRow1++; +} +} + namespace { /** diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index bdf16a69aad4..77b66ec0b750 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2963,6 +2963,12 @@ void ScTable::GetFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, ScFilterEn sc::ColumnBlockConstPosition aBlockPos; aCol[nCol].InitBlockPosition(aBlockPos); aCol[nCol].GetFilterEntries(aBlockPos, nRow1, nRow2, rFilterEntries, bFiltering, false /*bFilteredRow*/); + +SCROW nLastRow = aBlockPos.miCellPos->position; +if (nLastRow < nRow2) +{ +aCol[nCol].GetBackColorFilterEntries(nLastRow, nRow2, rFilterEntries); +} } void ScTable::GetFilteredFilterEntries(
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/inc sc/source
sc/inc/dbdata.hxx|1 + sc/inc/document.hxx |7 +++ sc/inc/table.hxx |3 +++ sc/source/core/data/document.cxx |7 +++ sc/source/core/data/table4.cxx | 34 ++ sc/source/core/tool/dbdata.cxx | 17 + sc/source/ui/view/gridwin.cxx|1 + sc/source/ui/view/tabvwshc.cxx |1 + 8 files changed, 71 insertions(+) New commits: commit 644ad239a22f438b300f1dd7fbf602e920075316 Author: Henry Castro AuthorDate: Mon Nov 6 07:18:48 2023 -0400 Commit: Henry Castro CommitDate: Wed Nov 29 20:55:50 2023 +0100 sc: extend backcolor area If the filter background color is selected, the automatic selection area should include, the attribute of background cell color too. Signed-off-by: Henry Castro Change-Id: I341c602247e7f71e3c9665e1b594177d8f5553b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158991 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-by: Tomaž Vajngerl (cherry picked from commit 768433f07873eb608837630f85e7e1b375239fca) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159238 Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160109 diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index 482c55bc6aa4..df235ec52619 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -221,6 +221,7 @@ public: SCCOL nDx, SCROW nDy, SCTAB nDz); void ExtendDataArea(const ScDocument& rDoc); +void ExtendBackColorArea(const ScDocument& rDoc); void CalcSaveFilteredCount(SCSIZE nNonFilteredRowCount); void GetFilterSelCount(SCSIZE& nSelected, SCSIZE& nTotal); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 8c999aef1d34..072db744c01b 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1507,6 +1507,13 @@ public: SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const; +/** + * Return the extended area containing at least all contiguous cells + * having background color. + */ +SC_DLLPUBLIC void GetBackColorArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, +SCCOL& rEndCol, SCROW& rEndRow ) const; + /** * Returns true if there is a non-empty subrange in the range given as input. * In that case it also modifies rRange to largest subrange that does not diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 780d122ce47e..7604787a4f77 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -634,6 +634,9 @@ public: voidGetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const; +voidGetBackColorArea( SCCOL& rStartCol, SCROW& rStartRow, + SCCOL& rEndCol, SCROW& rEndRow ) const; + boolGetDataAreaSubrange( ScRange& rRange ) const; boolShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rStartRow, diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 6bcfc230b25b..6ddae7a04057 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1101,6 +1101,13 @@ void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, maTabs[nTab]->GetDataArea( rStartCol, rStartRow, rEndCol, rEndRow, bIncludeOld, bOnlyDown ); } +void ScDocument::GetBackColorArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, + SCCOL& rEndCol, SCROW& rEndRow ) const +{ +if (ValidTab(nTab) && nTab < static_cast (maTabs.size()) && maTabs[nTab]) +maTabs[nTab]->GetBackColorArea( rStartCol, rStartRow, rEndCol, rEndRow ); +} + bool ScDocument::GetDataAreaSubrange(ScRange& rRange) const { SCTAB nTab = rRange.aStart.Tab(); diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 9c6852990efe..3ec8dc5aeab7 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1293,6 +1294,39 @@ void ScTable::FillSparkline(bool bVertical, SCCOLROW nFixed, } } +void ScTable::GetBackColorArea(SCCOL& rStartCol, SCROW& /*rStartRow*/, + SCCOL& rEndCol, SCROW& rEndRow ) const +{ +bool bExtend; +const SvxBrushItem* pDefBackground = ()->GetDefaultItem(ATTR_BACKGROUND); + +rStartCol = std::min(rStartCol, aCol.size() - 1); +rEndCol = std::min(rEndCol, aCo
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/subsequent_filters_test2.cxx | 38 1 file changed, 38 insertions(+) New commits: commit 3275f57221904426e5c136f5596a83050f8585a4 Author: Henry Castro AuthorDate: Fri Nov 24 10:00:54 2023 -0400 Commit: Henry Castro CommitDate: Wed Nov 29 20:54:34 2023 +0100 sc: qa: add unit test "testBackColorFilter" Change-Id: Icdccd6778d1157bb31f38b510a58562a640bdeae Signed-off-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159929 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160089 Tested-by: Jenkins diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx index 790ab5c99057..22339c010e8f 100644 --- a/sc/qa/unit/subsequent_filters_test2.cxx +++ b/sc/qa/unit/subsequent_filters_test2.cxx @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include @@ -39,6 +41,7 @@ #include #include #include +#include #include #include @@ -1626,6 +1629,41 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testSingleLine) testCells(pDoc); } +CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testBackColorFilter) +{ +Color aBackColor1(0xc99c00); +Color aBackColor2(0x0369a3); + +createScDoc(); +ScDocument* pDoc = getScDoc(); + +ScPatternAttr aPattern1(pDoc->GetPool()); +aPattern1.GetItemSet().Put(SvxBrushItem(aBackColor1, ATTR_BACKGROUND)); + +ScPatternAttr aPattern2(pDoc->GetPool()); +aPattern2.GetItemSet().Put(SvxBrushItem(aBackColor2, ATTR_BACKGROUND)); + +// Apply the pattern to cell A1:A2 +pDoc->ApplyPatternAreaTab(0, 0, 0, 1, 0, aPattern1); + +// Apply the pattern to cell A3:A5 +pDoc->ApplyPatternAreaTab(0, 2, 0, 4, 0, aPattern2); + +{ +ScRefCellValue aCell; +aCell.assign(*pDoc, ScAddress(0, 0, 0)); +CPPUNIT_ASSERT_MESSAGE("Cell A1 should be empty.", aCell.isEmpty()); +aCell.assign(*pDoc, ScAddress(0, 2, 0)); +CPPUNIT_ASSERT_MESSAGE("Cell A3 should be empty.", aCell.isEmpty()); +} + +{ +ScFilterEntries aFilterEntries; +pDoc->GetFilterEntriesArea(0, 0, 4, 0, true, aFilterEntries); +CPPUNIT_ASSERT_EQUAL(size_t(2), aFilterEntries.getBackgroundColors().size()); +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/column.hxx |2 + sc/source/core/data/column3.cxx | 60 sc/source/core/data/table3.cxx |6 3 files changed, 68 insertions(+) New commits: commit 8b2369236dea7d6863c2df3d4ce5e356c9c8010c Author: Henry Castro AuthorDate: Thu Nov 23 11:49:15 2023 -0400 Commit: Henry Castro CommitDate: Wed Nov 29 12:05:25 2023 +0100 sc: fix back color filter entries The function "GetFilterEntries" iterates only that contains cell data value entries, the background color filter feature requires to iterate background color attribute which is not stored in multi type vector cells. Signed-off-by: Henry Castro Change-Id: I372db48d2399f62712f642eefdbfea8885b09f58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159864 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit 826eae46095b2184554565bab1792e96964a720f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159905 Tested-by: Jenkins diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 26ef79da2e6d..cefd03fd388e 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -599,6 +599,8 @@ public: sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow, ScFilterEntries& rFilterEntries, bool bFiltering, bool bFilteredRow ); +void GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries ); + bool GetDataEntries( SCROW nRow, std::set& rStrings) const; void UpdateInsertTabAbs(SCTAB nNewPos); diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 054e334edb06..a0b0c639a003 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2701,6 +2701,66 @@ void ScColumn::GetFilterEntries( sc::ParseAll(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc, aFunc); } +void ScColumn::GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries) +{ +Color aBackColor; +bool bCondBackColor = false; +ScAddress aCell(GetCol(), 0, GetTab()); +ScConditionalFormat* pCondFormat = nullptr; + +const SfxItemSet* pCondSet = nullptr; +const SvxBrushItem* pBrush = nullptr; +const ScPatternAttr* pPattern = nullptr; +const ScColorScaleFormat* pColFormat = nullptr; + +if (!GetDoc().ValidRow(nRow1) || !GetDoc().ValidRow(nRow2)) +return; + +while (nRow1 <= nRow2) +{ +aCell.SetRow(nRow1); +pPattern = GetDoc().GetPattern(aCell.Col(), aCell.Row(), aCell.Tab()); +if (pPattern) +{ +if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty()) +{ +pCondSet = GetDoc().GetCondResult(GetCol(), nRow1, GetTab()); +pBrush = >GetItem(ATTR_BACKGROUND, pCondSet); +aBackColor = pBrush->GetColor(); +bCondBackColor = true; +} +} + +pCondFormat = GetDoc().GetCondFormat(aCell.Col(), aCell.Row(), aCell.Tab()); +if (pCondFormat) +{ +for (size_t nFormat = 0; nFormat < pCondFormat->size(); nFormat++) +{ +auto aEntry = pCondFormat->GetEntry(nFormat); +if (aEntry->GetType() == ScFormatEntry::Type::Colorscale) +{ +pColFormat = static_cast(aEntry); +std::optional oColor = pColFormat->GetColor(aCell); +if (oColor) +{ +aBackColor = *oColor; +bCondBackColor = true; +} +} +} +} + +if (!bCondBackColor) +{ +pBrush = GetDoc().GetAttr(aCell, ATTR_BACKGROUND); +aBackColor = pBrush->GetColor(); +} + +rFilterEntries.addBackgroundColor(aBackColor); +nRow1++; +} +} + namespace { /** diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 71cf80bcef38..359cc5dcc4f5 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -3018,6 +3018,12 @@ void ScTable::GetFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, ScFilterEn sc::ColumnBlockConstPosition aBlockPos; aCol[nCol].InitBlockPosition(aBlockPos); aCol[nCol].GetFilterEntries(aBlockPos, nRow1, nRow2, rFilterEntries, bFiltering, false /*bFilteredRow*/); + +SCROW nLastRow = aBlockPos.miCellPos->position; +if (nLastRow < nRow2) +{ +aCol[nCol].GetBackColorFilterEntries(nLastRow, nRow2, rFilterEntries); +} } void ScTable::GetFilteredFilterEntries(
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - sc/inc sc/qa sc/source
sc/inc/column.hxx |2 + sc/qa/unit/subsequent_filters_test2.cxx | 39 sc/source/core/data/column3.cxx | 60 sc/source/core/data/table3.cxx |6 +++ 4 files changed, 107 insertions(+) New commits: commit 94d14f1f7aec4931dadee3520ce6b5d99d3d333f Author: Henry Castro AuthorDate: Fri Nov 24 10:00:54 2023 -0400 Commit: Henry Castro CommitDate: Mon Nov 27 13:53:03 2023 +0100 sc: qa: add unit test "testBackColorFilter" Signed-off-by: Henry Castro Change-Id: Icdccd6778d1157bb31f38b510a58562a640bdeae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159929 Tested-by: Jenkins CollaboraOffice diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx index dc2c76ef2fb3..4a58bc35d7ca 100644 --- a/sc/qa/unit/subsequent_filters_test2.cxx +++ b/sc/qa/unit/subsequent_filters_test2.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ #include #include #include +#include #include #include @@ -198,6 +200,7 @@ public: void testSingleLine(); void testNamedTableRef(); void testRowImportCellStyleIssue(); +void testBackColorFilter(); CPPUNIT_TEST_SUITE(ScFiltersTest2); @@ -322,6 +325,7 @@ public: CPPUNIT_TEST(testSingleLine); CPPUNIT_TEST(testNamedTableRef); CPPUNIT_TEST(testRowImportCellStyleIssue); +CPPUNIT_TEST(testBackColorFilter); CPPUNIT_TEST_SUITE_END(); }; @@ -3131,6 +3135,41 @@ void ScFiltersTest2::testRowImportCellStyleIssue() } } +void ScFiltersTest2::testBackColorFilter() +{ +Color aBackColor1(0xc99c00); +Color aBackColor2(0x0369a3); + +createScDoc(); +ScDocument* pDoc = getScDoc(); + +ScPatternAttr aPattern1(pDoc->GetPool()); +aPattern1.GetItemSet().Put(SvxBrushItem(aBackColor1, ATTR_BACKGROUND)); + +ScPatternAttr aPattern2(pDoc->GetPool()); +aPattern2.GetItemSet().Put(SvxBrushItem(aBackColor2, ATTR_BACKGROUND)); + +// Apply the pattern to cell A1:A2 +pDoc->ApplyPatternAreaTab(0, 0, 0, 1, 0, aPattern1); + +// Apply the pattern to cell A3:A5 +pDoc->ApplyPatternAreaTab(0, 2, 0, 4, 0, aPattern2); + +{ +ScRefCellValue aCell; +aCell.assign(*pDoc, ScAddress(0, 0, 0)); +CPPUNIT_ASSERT_MESSAGE("Cell A1 should be empty.", aCell.isEmpty()); +aCell.assign(*pDoc, ScAddress(0, 2, 0)); +CPPUNIT_ASSERT_MESSAGE("Cell A3 should be empty.", aCell.isEmpty()); +} + +{ +ScFilterEntries aFilterEntries; +pDoc->GetFilterEntriesArea(0, 0, 4, 0, true, aFilterEntries); +CPPUNIT_ASSERT_EQUAL(size_t(2), aFilterEntries.getBackgroundColors().size()); +} +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest2); CPPUNIT_PLUGIN_IMPLEMENT(); commit 826eae46095b2184554565bab1792e96964a720f Author: Henry Castro AuthorDate: Thu Nov 23 11:49:15 2023 -0400 Commit: Henry Castro CommitDate: Mon Nov 27 13:52:49 2023 +0100 sc: fix back color filter entries The function "GetFilterEntries" iterates only that contains cell data value entries, the background color filter feature requires to iterate background color attribute which is not stored in multi type vector cells. Signed-off-by: Henry Castro Change-Id: I372db48d2399f62712f642eefdbfea8885b09f58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159864 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index cbdf82edecbc..7a2bbc30ade9 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -598,6 +598,8 @@ public: sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow, ScFilterEntries& rFilterEntries, bool bFiltering, bool bFilteredRow ); +void GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries ); + bool GetDataEntries( SCROW nRow, std::set& rStrings) const; void UpdateInsertTabAbs(SCTAB nNewPos); diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index ca16c49d8de8..2ef0f9aee3df 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2753,6 +2753,66 @@ void ScColumn::GetFilterEntries( sc::ParseAll(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc, aFunc); } +void ScColumn::GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries) +{ +Color aBackColor; +bool bCondBackColor = false; +ScAddress aCell(GetCol(), 0, GetTab()); +ScConditionalFormat* pCondFormat = nullptr; + +const SfxItemSet* pCondSet = nullptr; +const SvxBrushItem* pBrush = nullptr; +const ScPatternAttr* pPattern = nullptr; +const ScColorScaleFormat* pColFormat
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sd/source
sd/source/ui/app/sddll.cxx | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) New commits: commit b9645ac5b97c0c61514cfe484f770626e61d58a0 Author: Henry Castro AuthorDate: Wed Feb 15 11:25:19 2023 -0400 Commit: Henry Castro CommitDate: Mon Nov 27 12:08:20 2023 +0100 sd: lok: only register supported views The Presentation ViewShells: SlideSorter, Outline, Presentation They are not supported in tiled rendering case, so switch to default view. Signed-off-by: Henry Castro Change-Id: I33b255e0ca530734af6490d14fe48a2512272afc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147095 Reviewed-by: Andras Timar Tested-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152900 Tested-by: Jenkins (cherry picked from commit 5b35703d11089975d625fede2605ce3bc449b294) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159895 diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index c195869b790e..b4734310a39b 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -91,12 +91,24 @@ void SdDLL::RegisterFactorys() { ::sd::ImpressViewShellBase::RegisterFactory ( ::sd::IMPRESS_FACTORY_ID); -::sd::SlideSorterViewShellBase::RegisterFactory ( -::sd::SLIDE_SORTER_FACTORY_ID); -::sd::OutlineViewShellBase::RegisterFactory ( -::sd::OUTLINE_FACTORY_ID); -::sd::PresentationViewShellBase::RegisterFactory ( -::sd::PRESENTATION_FACTORY_ID); +if (comphelper::LibreOfficeKit::isActive()) +{ +::sd::ImpressViewShellBase::RegisterFactory ( +::sd::SLIDE_SORTER_FACTORY_ID); +::sd::ImpressViewShellBase::RegisterFactory ( +::sd::OUTLINE_FACTORY_ID); +::sd::ImpressViewShellBase::RegisterFactory ( +::sd::PRESENTATION_FACTORY_ID); +} +else +{ +::sd::SlideSorterViewShellBase::RegisterFactory ( +::sd::SLIDE_SORTER_FACTORY_ID); +::sd::OutlineViewShellBase::RegisterFactory ( +::sd::OUTLINE_FACTORY_ID); +::sd::PresentationViewShellBase::RegisterFactory ( +::sd::PRESENTATION_FACTORY_ID); +} } if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw()) {
[Libreoffice-commits] core.git: Branch 'distro/mimo/mimo-7-5' - sc/inc sc/source
sc/inc/dbdata.hxx|1 + sc/inc/document.hxx |7 +++ sc/inc/table.hxx |3 +++ sc/source/core/data/document.cxx |7 +++ sc/source/core/data/table4.cxx | 34 ++ sc/source/core/tool/dbdata.cxx | 17 + sc/source/ui/view/gridwin.cxx|1 + sc/source/ui/view/tabvwshc.cxx |1 + 8 files changed, 71 insertions(+) New commits: commit 64a4011951f54f8b86205798b968b20b532ea703 Author: Henry Castro AuthorDate: Mon Nov 6 07:18:48 2023 -0400 Commit: Henry Castro CommitDate: Tue Nov 14 16:59:24 2023 +0100 sc: extend backcolor area If the filter background color is selected, the automatic selection area should include, the attribute of background cell color too. Signed-off-by: Henry Castro Change-Id: I341c602247e7f71e3c9665e1b594177d8f5553b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158991 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-by: Tomaž Vajngerl (cherry picked from commit 768433f07873eb608837630f85e7e1b375239fca) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159238 Tested-by: Jenkins (cherry picked from commit 4abe6c83e76f825319e8b2a0c0b8b8e92177da65) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159249 diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index 482c55bc6aa4..df235ec52619 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -221,6 +221,7 @@ public: SCCOL nDx, SCROW nDy, SCTAB nDz); void ExtendDataArea(const ScDocument& rDoc); +void ExtendBackColorArea(const ScDocument& rDoc); void CalcSaveFilteredCount(SCSIZE nNonFilteredRowCount); void GetFilterSelCount(SCSIZE& nSelected, SCSIZE& nTotal); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 97b47ee94d00..aeb277ec4f3a 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1506,6 +1506,13 @@ public: SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const; +/** + * Return the extended area containing at least all contiguous cells + * having background color. + */ +SC_DLLPUBLIC void GetBackColorArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, +SCCOL& rEndCol, SCROW& rEndRow ) const; + /** * Returns true if there is a non-empty subrange in the range given as input. * In that case it also modifies rRange to largest subrange that does not diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 3367af129c19..4f7407809115 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -627,6 +627,9 @@ public: voidGetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const; +voidGetBackColorArea( SCCOL& rStartCol, SCROW& rStartRow, + SCCOL& rEndCol, SCROW& rEndRow ) const; + boolGetDataAreaSubrange( ScRange& rRange ) const; boolShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rStartRow, diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 79ce684d87be..e80d56203351 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1104,6 +1104,13 @@ void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, maTabs[nTab]->GetDataArea( rStartCol, rStartRow, rEndCol, rEndRow, bIncludeOld, bOnlyDown ); } +void ScDocument::GetBackColorArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, + SCCOL& rEndCol, SCROW& rEndRow ) const +{ +if (ValidTab(nTab) && nTab < static_cast (maTabs.size()) && maTabs[nTab]) +maTabs[nTab]->GetBackColorArea( rStartCol, rStartRow, rEndCol, rEndRow ); +} + bool ScDocument::GetDataAreaSubrange(ScRange& rRange) const { SCTAB nTab = rRange.aStart.Tab(); diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 9c6852990efe..3ec8dc5aeab7 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1293,6 +1294,39 @@ void ScTable::FillSparkline(bool bVertical, SCCOLROW nFixed, } } +void ScTable::GetBackColorArea(SCCOL& rStartCol, SCROW& /*rStartRow*/, + SCCOL& rEndCol, SCROW& rEndRow ) const +{ +bool bExtend; +const SvxBrushItem* pDefBackground = ()->GetDefaultItem(ATTR_BACKGROUND); + +rStartCol = std::min(rSta
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/dbdata.hxx|1 + sc/inc/document.hxx |7 +++ sc/inc/table.hxx |3 +++ sc/source/core/data/document.cxx |7 +++ sc/source/core/data/table4.cxx | 34 ++ sc/source/core/tool/dbdata.cxx | 17 + sc/source/ui/view/gridwin.cxx|1 + sc/source/ui/view/tabvwshc.cxx |1 + 8 files changed, 71 insertions(+) New commits: commit 4abe6c83e76f825319e8b2a0c0b8b8e92177da65 Author: Henry Castro AuthorDate: Mon Nov 6 07:18:48 2023 -0400 Commit: Caolán McNamara CommitDate: Sat Nov 11 20:27:29 2023 +0100 sc: extend backcolor area If the filter background color is selected, the automatic selection area should include, the attribute of background cell color too. Signed-off-by: Henry Castro Change-Id: I341c602247e7f71e3c9665e1b594177d8f5553b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158991 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-by: Tomaž Vajngerl (cherry picked from commit 768433f07873eb608837630f85e7e1b375239fca) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159238 Tested-by: Jenkins diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index 482c55bc6aa4..df235ec52619 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -221,6 +221,7 @@ public: SCCOL nDx, SCROW nDy, SCTAB nDz); void ExtendDataArea(const ScDocument& rDoc); +void ExtendBackColorArea(const ScDocument& rDoc); void CalcSaveFilteredCount(SCSIZE nNonFilteredRowCount); void GetFilterSelCount(SCSIZE& nSelected, SCSIZE& nTotal); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 1cff7a3ce4e4..11b65e9262c0 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1512,6 +1512,13 @@ public: SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const; +/** + * Return the extended area containing at least all contiguous cells + * having background color. + */ +SC_DLLPUBLIC void GetBackColorArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, +SCCOL& rEndCol, SCROW& rEndRow ) const; + /** * Returns true if there is a non-empty subrange in the range given as input. * In that case it also modifies rRange to largest subrange that does not diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 68b4c614c68b..8907bde5a150 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -641,6 +641,9 @@ public: voidGetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const; +voidGetBackColorArea( SCCOL& rStartCol, SCROW& rStartRow, + SCCOL& rEndCol, SCROW& rEndRow ) const; + boolGetDataAreaSubrange( ScRange& rRange ) const; boolShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rStartRow, diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 6225e92781b9..0b4ae5ca0da8 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1081,6 +1081,13 @@ void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, pTable->GetDataArea( rStartCol, rStartRow, rEndCol, rEndRow, bIncludeOld, bOnlyDown ); } +void ScDocument::GetBackColorArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, + SCCOL& rEndCol, SCROW& rEndRow ) const +{ +if (ValidTab(nTab) && nTab < static_cast (maTabs.size()) && maTabs[nTab]) +maTabs[nTab]->GetBackColorArea( rStartCol, rStartRow, rEndCol, rEndRow ); +} + bool ScDocument::GetDataAreaSubrange(ScRange& rRange) const { SCTAB nTab = rRange.aStart.Tab(); diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index d8a4cf584132..62b9dbb9e006 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1293,6 +1294,39 @@ void ScTable::FillSparkline(bool bVertical, SCCOLROW nFixed, } } +void ScTable::GetBackColorArea(SCCOL& rStartCol, SCROW& /*rStartRow*/, + SCCOL& rEndCol, SCROW& rEndRow ) const +{ +bool bExtend; +const SvxBrushItem* pDefBackground = ()->GetDefaultItem(ATTR_BACKGROUND); + +rStartCol = std::min(rStartCol, aCol.size() - 1); +rEndCol = std::min(rEndCol, aCol.size() - 1); + +do +{ +bExtend = false; + +if (rEndRow < rDocument.MaxRo
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/inc sc/source
sc/inc/dbdata.hxx|1 + sc/inc/document.hxx |7 +++ sc/inc/table.hxx |3 +++ sc/source/core/data/document.cxx |7 +++ sc/source/core/data/table4.cxx | 34 ++ sc/source/core/tool/dbdata.cxx | 17 + sc/source/ui/view/gridwin.cxx|1 + sc/source/ui/view/tabvwshc.cxx |1 + 8 files changed, 71 insertions(+) New commits: commit 768433f07873eb608837630f85e7e1b375239fca Author: Henry Castro AuthorDate: Mon Nov 6 07:18:48 2023 -0400 Commit: Tomaž Vajngerl CommitDate: Tue Nov 7 11:23:34 2023 +0100 sc: extend backcolor area If the filter background color is selected, the automatic selection area should include, the attribute of background cell color too. Signed-off-by: Henry Castro Change-Id: I341c602247e7f71e3c9665e1b594177d8f5553b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158991 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-by: Tomaž Vajngerl diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index 482c55bc6aa4..df235ec52619 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -221,6 +221,7 @@ public: SCCOL nDx, SCROW nDy, SCTAB nDz); void ExtendDataArea(const ScDocument& rDoc); +void ExtendBackColorArea(const ScDocument& rDoc); void CalcSaveFilteredCount(SCSIZE nNonFilteredRowCount); void GetFilterSelCount(SCSIZE& nSelected, SCSIZE& nTotal); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 9717c809aa31..8b91cbf49b0e 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1510,6 +1510,13 @@ public: SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const; +/** + * Return the extended area containing at least all contiguous cells + * having background color. + */ +SC_DLLPUBLIC void GetBackColorArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, +SCCOL& rEndCol, SCROW& rEndRow ) const; + /** * Returns true if there is a non-empty subrange in the range given as input. * In that case it also modifies rRange to largest subrange that does not diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 3367af129c19..4f7407809115 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -627,6 +627,9 @@ public: voidGetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const; +voidGetBackColorArea( SCCOL& rStartCol, SCROW& rStartRow, + SCCOL& rEndCol, SCROW& rEndRow ) const; + boolGetDataAreaSubrange( ScRange& rRange ) const; boolShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rStartRow, diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 4721bfeba70a..fceaec1bb386 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1104,6 +1104,13 @@ void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, maTabs[nTab]->GetDataArea( rStartCol, rStartRow, rEndCol, rEndRow, bIncludeOld, bOnlyDown ); } +void ScDocument::GetBackColorArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, + SCCOL& rEndCol, SCROW& rEndRow ) const +{ +if (ValidTab(nTab) && nTab < static_cast (maTabs.size()) && maTabs[nTab]) +maTabs[nTab]->GetBackColorArea( rStartCol, rStartRow, rEndCol, rEndRow ); +} + bool ScDocument::GetDataAreaSubrange(ScRange& rRange) const { SCTAB nTab = rRange.aStart.Tab(); diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 9c6852990efe..3ec8dc5aeab7 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1293,6 +1294,39 @@ void ScTable::FillSparkline(bool bVertical, SCCOLROW nFixed, } } +void ScTable::GetBackColorArea(SCCOL& rStartCol, SCROW& /*rStartRow*/, + SCCOL& rEndCol, SCROW& rEndRow ) const +{ +bool bExtend; +const SvxBrushItem* pDefBackground = ()->GetDefaultItem(ATTR_BACKGROUND); + +rStartCol = std::min(rStartCol, aCol.size() - 1); +rEndCol = std::min(rEndCol, aCol.size() - 1); + +do +{ +bExtend = false; + +if (rEndRow < rDocument.MaxRow()) +{ +for (SCCOL nCol = rStartCol; nCol <= rEndCol; ++nCol) +{ +const ScPatternAttr* pPatter
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sd/qa
sd/qa/unit/data/pptx/master-slides.pptx |binary sd/qa/unit/import-tests2.cxx| 10 ++ 2 files changed, 10 insertions(+) New commits: commit 41097d6168de85c183be1c8a014c7e85de624060 Author: Henry Castro AuthorDate: Mon Oct 9 10:29:40 2023 -0400 Commit: Xisco Fauli CommitDate: Thu Nov 2 09:29:25 2023 +0100 tdf#155512: sd: qa: unit: add unit test "testMasterSlides" . Signed-off-by: Henry Castro Change-Id: I6117b384fdad215e6c04b6e74df22fe9daa6a526 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157705 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158739 Tested-by: Jenkins (cherry picked from commit 32e6ef3834a0f96d7830719950de52c99aae0263) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158701 Reviewed-by: Xisco Fauli Tested-by: Xisco Fauli diff --git a/sd/qa/unit/data/pptx/master-slides.pptx b/sd/qa/unit/data/pptx/master-slides.pptx new file mode 100644 index ..3494d33254ab Binary files /dev/null and b/sd/qa/unit/data/pptx/master-slides.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 44eacbf1da05..da6572b8af5a 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -1972,6 +1972,16 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf153012) CPPUNIT_ASSERT_EQUAL(Color(0xd9d9d9), aFillColor); } +CPPUNIT_TEST_FIXTURE(SdImportTest2, testMasterSlides) +{ +createSdImpressDoc("pptx/master-slides.pptx"); +uno::Reference xMasterPagesSupplier(mxComponent, + uno::UNO_QUERY_THROW); +uno::Reference xMasterPages(xMasterPagesSupplier->getMasterPages()); +CPPUNIT_ASSERT(xMasterPages.is()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(7), xMasterPages->getCount()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/oox oox/source
include/oox/ppt/presentationfragmenthandler.hxx |8 ++-- oox/source/ppt/presentationfragmenthandler.cxx | 42 2 files changed, 26 insertions(+), 24 deletions(-) New commits: commit 9925d34afafc714d9c9c26f295fb7f88493c071d Author: Henry Castro AuthorDate: Mon Oct 9 07:34:02 2023 -0400 Commit: Henry Castro CommitDate: Wed Nov 1 14:08:22 2023 +0100 tdf#155512: oox: ppt: fix import master slides, follow up Import all master slides. Signed-off-by: Henry Castro Change-Id: Ieac68bacf15c75e4c23ec692aadcb16033cdd092 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157701 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158716 Tested-by: Jenkins (cherry picked from commit b835bcfad2290c37c60d2fab0f276ab57aef56c1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158697 diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 29204b282bdb..20fc521ae8c5 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -52,10 +52,10 @@ private: void importSlide( const ::oox::core::FragmentHandlerRef& rSlideFragmentHandler, const oox::ppt::SlidePersistPtr& rPersist ); void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes); -oox::ppt::SlidePersistPtr importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, -::oox::ppt::PowerPointImport& rFilter, -std::u16string_view rLayoutFragmentPath, -std::u16string_view rMasterFragmentPath); +void importMasterSlides(); +void importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, + ::oox::ppt::PowerPointImport& rFilter, + const OUString& rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); void importCustomSlideShow(std::vector& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector& rSlidePersist); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index dab9648cb025..b7730ef32faf 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -215,18 +215,16 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector& } } -SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const Reference& xModel, - PowerPointImport& rFilter, - std::u16string_view rLayoutFragmentPath, - std::u16string_view rMasterFragmentPath) +void PresentationFragmentHandler::importMasterSlide(const Reference& xModel, +PowerPointImport& rFilter, +const OUString& rMasterFragmentPath) { OUString aLayoutFragmentPath; -OUString aMasterFragmentPath(rMasterFragmentPath); -SlidePersistPtr pMasterPersistPtr, pMasterPtr; +SlidePersistPtr pMasterPersistPtr; Reference< drawing::XDrawPage > xMasterPage; Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); -RelationsRef xMasterRelations = rFilter.importRelations( aMasterFragmentPath ); +RelationsRef xMasterRelations = rFilter.importRelations( rMasterFragmentPath ); for (const auto& rEntry : *xMasterRelations) { @@ -252,7 +250,7 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencesetLayoutPath( aLayoutFragmentPath ); rFilter.getMasterPages().push_back( pMasterPersistPtr ); rFilter.setActualSlidePersist( pMasterPersistPtr ); -FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) ); +FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, rMasterFragmentPath, pMasterPersistPtr, Master ) ); // set the correct theme OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( u"theme" ); @@ -297,14 +295,7 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferenceaddTh
[Libreoffice-commits] core.git: sd/qa
sd/qa/unit/data/pptx/master-slides.pptx |binary sd/qa/unit/import-tests2.cxx| 10 ++ 2 files changed, 10 insertions(+) New commits: commit 32e6ef3834a0f96d7830719950de52c99aae0263 Author: Henry Castro AuthorDate: Mon Oct 9 10:29:40 2023 -0400 Commit: Henry Castro CommitDate: Wed Nov 1 14:08:04 2023 +0100 tdf#155512: sd: qa: unit: add unit test "testMasterSlides" Signed-off-by: Henry Castro Change-Id: I6117b384fdad215e6c04b6e74df22fe9daa6a526 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157705 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158739 Tested-by: Jenkins diff --git a/sd/qa/unit/data/pptx/master-slides.pptx b/sd/qa/unit/data/pptx/master-slides.pptx new file mode 100644 index ..3494d33254ab Binary files /dev/null and b/sd/qa/unit/data/pptx/master-slides.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 44eacbf1da05..da6572b8af5a 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -1972,6 +1972,16 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf153012) CPPUNIT_ASSERT_EQUAL(Color(0xd9d9d9), aFillColor); } +CPPUNIT_TEST_FIXTURE(SdImportTest2, testMasterSlides) +{ +createSdImpressDoc("pptx/master-slides.pptx"); +uno::Reference xMasterPagesSupplier(mxComponent, + uno::UNO_QUERY_THROW); +uno::Reference xMasterPages(xMasterPagesSupplier->getMasterPages()); +CPPUNIT_ASSERT(xMasterPages.is()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(7), xMasterPages->getCount()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: include/oox oox/source
include/oox/ppt/presentationfragmenthandler.hxx |8 ++-- oox/source/ppt/presentationfragmenthandler.cxx | 42 2 files changed, 26 insertions(+), 24 deletions(-) New commits: commit f2ae8b934aaac7c444e8493ed5e8189c6ce63328 Author: Henry Castro AuthorDate: Mon Oct 9 07:34:02 2023 -0400 Commit: Henry Castro CommitDate: Tue Oct 31 21:09:19 2023 +0100 tdf#155512: oox: ppt: fix import master slides, follow up Import all master slides. Signed-off-by: Henry Castro Change-Id: Ieac68bacf15c75e4c23ec692aadcb16033cdd092 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157701 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158716 Tested-by: Jenkins diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 29204b282bdb..20fc521ae8c5 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -52,10 +52,10 @@ private: void importSlide( const ::oox::core::FragmentHandlerRef& rSlideFragmentHandler, const oox::ppt::SlidePersistPtr& rPersist ); void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes); -oox::ppt::SlidePersistPtr importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, -::oox::ppt::PowerPointImport& rFilter, -std::u16string_view rLayoutFragmentPath, -std::u16string_view rMasterFragmentPath); +void importMasterSlides(); +void importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, + ::oox::ppt::PowerPointImport& rFilter, + const OUString& rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); void importCustomSlideShow(std::vector& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector& rSlidePersist); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index edb523161c9e..2e0f48bbae98 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -215,18 +215,16 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector& } } -SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const Reference& xModel, - PowerPointImport& rFilter, - std::u16string_view rLayoutFragmentPath, - std::u16string_view rMasterFragmentPath) +void PresentationFragmentHandler::importMasterSlide(const Reference& xModel, +PowerPointImport& rFilter, +const OUString& rMasterFragmentPath) { OUString aLayoutFragmentPath; -OUString aMasterFragmentPath(rMasterFragmentPath); -SlidePersistPtr pMasterPersistPtr, pMasterPtr; +SlidePersistPtr pMasterPersistPtr; Reference< drawing::XDrawPage > xMasterPage; Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); -RelationsRef xMasterRelations = rFilter.importRelations( aMasterFragmentPath ); +RelationsRef xMasterRelations = rFilter.importRelations( rMasterFragmentPath ); for (const auto& rEntry : *xMasterRelations) { @@ -252,7 +250,7 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencesetLayoutPath( aLayoutFragmentPath ); rFilter.getMasterPages().push_back( pMasterPersistPtr ); rFilter.setActualSlidePersist( pMasterPersistPtr ); -FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) ); +FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, rMasterFragmentPath, pMasterPersistPtr, Master ) ); // set the correct theme OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( u"theme" ); @@ -297,14 +295,7 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferenceaddTheme(pMasterPersistPtr->getPage()); } - -if (pMasterPersistPtr->getLayoutPath() == rLayoutFragmentPath) -{ -
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - oox/source sd/qa sd/source
oox/source/ppt/presentationfragmenthandler.cxx |6 + sd/qa/unit/export-tests-ooxml2.cxx |6 - sd/qa/unit/export-tests-ooxml3.cxx |4 sd/source/filter/eppt/epptooxml.hxx|4 sd/source/filter/eppt/pptx-epptooxml.cxx | 128 +++-- sd/source/ui/inc/unopage.hxx |1 sd/source/ui/unoidl/unopage.cxx| 13 ++ 7 files changed, 147 insertions(+), 15 deletions(-) New commits: commit a1b3d8d6e90923f2cd03a556afd09edc2d084475 Author: Henry Castro AuthorDate: Tue Oct 17 07:42:52 2023 -0400 Commit: Henry Castro CommitDate: Tue Oct 31 15:56:19 2023 +0100 tdf#155512: sd: filter: eppt: add "SlideLayout" property to Slide Master If it is importing all Slide Master from pptx file, unfortunately it breaks the exporting to pptx due to save and reload unit test failures According to the documentation http://officeopenxml.com/prSlideLayout.php, so the file pptx has a relationship Slide -> Slide Layout -> Slide Master The Slide Layout is a template an unique to be reused with Slide Master, so exporting requires to compare the templates due to LibreOffice relation Slide -> Slide Master Adjust unit test values: SdOOXMLExportTest2::testTdf106867 revert adcde78935fb8ca2b93322aa3a558d0b3ccdbfad SdOOXMLExportTest2::testTdf112280 revert adcde78935fb8ca2b93322aa3a558d0b3ccdbfad SdOOXMLExportTest2::testThemeColors and SdOOXMLExportTest3::testTdf114848 The file tdf84205.pptx does not contain theme2.xml, and save and reload it does not caintain theme2.xml too fix "An uncaught exception of type com.sun.star.container.NoSuchElementException" Signed-off-by: Henry Castro Change-Id: I622e9d5d68c406ff520387f3903808613d1cd3d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158084 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158676 Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158717 diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 09c39902a66a..dab9648cb025 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -230,6 +230,9 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencegetFragmentPathFromRelation(rEntry.second); sal_Int32 nIndex; @@ -286,6 +289,9 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencecreateBackground( rFilter ); pMasterPersistPtr->createXShapes( rFilter ); +uno::Reference< beans::XPropertySet > xSet(pMasterPersistPtr->getPage(), uno::UNO_QUERY_THROW); +xSet->setPropertyValue("SlideLayout", Any(pMasterPersistPtr->getLayoutFromValueToken())); + oox::drawingml::ThemePtr pTheme = pMasterPersistPtr->getTheme(); if (pTheme) { diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 754ee0d3035e..ed6568d0bc1f 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -1313,7 +1313,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106867) "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/" "p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/" "p:cBhvr/p:tgtEl/p:spTgt", -"spid", "491"); +"spid", "42"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112280) @@ -1694,7 +1694,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testAccentColor) "70ad47"); xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", -"70ad47"); +"deb340"); // Without the accompanying fix in place, this test would have failed with: // - Expected: Motyw pakietu Office @@ -1709,7 +1709,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testThemeColors) createSdImpressDoc("pptx/tdf84205.pptx"); save("Impress Office Open XML"); -xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml"); +xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme1.xml"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "44546a"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent3/a
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/test sc/qa test/source
include/test/unoapi_test.hxx |3 +++ sc/qa/unit/subsequent_export_test2.cxx | 10 -- test/source/unoapi_test.cxx| 18 ++ 3 files changed, 29 insertions(+), 2 deletions(-) New commits: commit 3068163565e8e07bea6ab38a972ae99a47232feb Author: Henry Castro AuthorDate: Thu Sep 21 07:11:13 2023 -0400 Commit: Henry Castro CommitDate: Tue Oct 31 12:13:59 2023 +0100 sc: qa: add loadWithParams and SaveWithParams Add option to load and save with optional parameters. Signed-off-by: Henry Castro Change-Id: I2d735443da11634d072742f1bf6f38f90bced2c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157141 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157569 Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158527 diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index e329168dfe7b..4ba209c44d39 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -36,12 +36,15 @@ public: OUString createFileURL(std::u16string_view aFileBase); OUString createFilePath(std::u16string_view aFileBase); void load(const OUString& rURL, const char* pPassword = nullptr); +void loadWithParams(const OUString& rURL, +const css::uno::Sequence& rParams); OUString loadFromURL(std::u16string_view aFileBase, const char* pPassword = nullptr); css::uno::Any executeMacro(const OUString& rScriptURL, const css::uno::Sequence& rParams = {}); void save(const OUString& rFilter, const char* pPassword = nullptr); +void saveWithParams(const css::uno::Sequence& rParams); void saveAndReload(const OUString& rFilter, const char* pPassword = nullptr); std::unique_ptr parsePDFExport(const OString& rPassword = OString()); diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 403bffc3112f..91309d9e5491 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -698,10 +699,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testHyperlinkTargetFrameODS) CPPUNIT_TEST_FIXTURE(ScExportTest2, testOpenDocumentAsReadOnly) { -createScDoc("xlsx/open-as-read-only.xlsx"); +uno::Sequence aParams = { comphelper::makePropertyValue("Silent", true) }; + +loadWithParams(createFileURL(u"xlsx/open-as-read-only.xlsx"), aParams); ScDocShell* pDocSh = getScDocShell(); CPPUNIT_ASSERT(pDocSh->IsSecurityOptOpenReadOnly()); -saveAndReload("Calc Office Open XML"); + +saveWithParams(uno::Sequence()); +loadWithParams(maTempFile.GetURL(), aParams); + pDocSh = getScDocShell(); CPPUNIT_ASSERT(pDocSh->IsSecurityOptOpenReadOnly()); } diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index 5c689bfe5354..464f374201bd 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -121,6 +121,18 @@ void UnoApiTest::load(OUString const& rURL, const char* pPassword) } } +void UnoApiTest::loadWithParams(OUString const& rURL, +const uno::Sequence& rParams) +{ +if (mxComponent.is()) +{ +mxComponent->dispose(); +mxComponent.clear(); +} + +mxComponent = loadFromDesktop(rURL, OUString(), rParams); +} + OUString UnoApiTest::loadFromURL(std::u16string_view aFileBase, const char* pPassword) { OUString aFileName = createFileURL(aFileBase); @@ -203,6 +215,12 @@ void UnoApiTest::save(const OUString& rFilter, const char* pPassword) } } +void UnoApiTest::saveWithParams(const uno::Sequence& rParams) +{ +css::uno::Reference xStorable(mxComponent, css::uno::UNO_QUERY_THROW); +xStorable->storeToURL(maTempFile.GetURL(), rParams); +} + void UnoApiTest::saveAndReload(const OUString& rFilter, const char* pPassword) { save(rFilter, pPassword);
[Libreoffice-commits] core.git: oox/source sd/qa sd/source
oox/source/ppt/presentationfragmenthandler.cxx |6 + sd/qa/unit/export-tests-ooxml2.cxx |6 - sd/qa/unit/export-tests-ooxml3.cxx |4 sd/source/filter/eppt/epptooxml.hxx|4 sd/source/filter/eppt/pptx-epptooxml.cxx | 128 +++-- sd/source/ui/inc/unopage.hxx |1 sd/source/ui/unoidl/unopage.cxx| 13 ++ 7 files changed, 147 insertions(+), 15 deletions(-) New commits: commit d590f094ccd28ca449eff91692c2178058d5c621 Author: Henry Castro AuthorDate: Tue Oct 17 07:42:52 2023 -0400 Commit: Henry Castro CommitDate: Tue Oct 31 12:01:43 2023 +0100 tdf#155512: sd: filter: eppt: add "SlideLayout" property to Slide Master If it is importing all Slide Master from pptx file, unfortunately it breaks the exporting to pptx due to save and reload unit test failures According to the documentation http://officeopenxml.com/prSlideLayout.php, so the file pptx has a relationship Slide -> Slide Layout -> Slide Master The Slide Layout is a template an unique to be reused with Slide Master, so exporting requires to compare the templates due to LibreOffice relation Slide -> Slide Master Adjust unit test values: SdOOXMLExportTest2::testTdf106867 revert adcde78935fb8ca2b93322aa3a558d0b3ccdbfad SdOOXMLExportTest2::testTdf112280 revert adcde78935fb8ca2b93322aa3a558d0b3ccdbfad SdOOXMLExportTest2::testThemeColors and SdOOXMLExportTest3::testTdf114848 The file tdf84205.pptx does not contain theme2.xml, and save and reload it does not caintain theme2.xml too fix "An uncaught exception of type com.sun.star.container.NoSuchElementException" Signed-off-by: Henry Castro Change-Id: I622e9d5d68c406ff520387f3903808613d1cd3d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158084 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158676 Tested-by: Jenkins diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 8c5fbf261414..edb523161c9e 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -230,6 +230,9 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencegetFragmentPathFromRelation(rEntry.second); sal_Int32 nIndex; @@ -286,6 +289,9 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencecreateBackground( rFilter ); pMasterPersistPtr->createXShapes( rFilter ); +uno::Reference< beans::XPropertySet > xSet(pMasterPersistPtr->getPage(), uno::UNO_QUERY_THROW); +xSet->setPropertyValue("SlideLayout", Any(pMasterPersistPtr->getLayoutFromValueToken())); + oox::drawingml::ThemePtr pTheme = pMasterPersistPtr->getTheme(); if (pTheme) { diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 625c04953006..30301c6e4c16 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -1313,7 +1313,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106867) "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/" "p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/" "p:cBhvr/p:tgtEl/p:spTgt", -"spid", "491"); +"spid", "42"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112280) @@ -1694,7 +1694,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testAccentColor) "70ad47"); xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", -"70ad47"); +"deb340"); // Without the accompanying fix in place, this test would have failed with: // - Expected: Motyw pakietu Office @@ -1709,7 +1709,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testThemeColors) createSdImpressDoc("pptx/tdf84205.pptx"); save("Impress Office Open XML"); -xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml"); +xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme1.xml"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "44546a"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent3/a:srgbClr", "val", diff --git a/sd/qa/unit/export-tests-
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 3 commits - include/oox oox/source sd/qa sd/source
include/oox/ppt/presentationfragmenthandler.hxx |8 - oox/source/ppt/presentationfragmenthandler.cxx | 43 sd/qa/unit/data/pptx/master-slides.pptx |binary sd/qa/unit/export-tests-ooxml2.cxx |6 - sd/qa/unit/export-tests-ooxml3.cxx |4 sd/qa/unit/import-tests2.cxx| 12 ++ sd/source/filter/eppt/epptooxml.hxx |4 sd/source/filter/eppt/pptx-epptooxml.cxx| 128 ++-- sd/source/ui/inc/unopage.hxx|1 sd/source/ui/unoidl/unopage.cxx | 13 ++ 10 files changed, 183 insertions(+), 36 deletions(-) New commits: commit 3ef576f21213c6c5c63e84b04853a1a8a85fe74f Author: Henry Castro AuthorDate: Mon Oct 9 10:29:40 2023 -0400 Commit: Caolán McNamara CommitDate: Sun Oct 29 21:47:25 2023 +0100 tdf#155512: sd: qa: unit: add unit test "testMasterSlides" Signed-off-by: Henry Castro Change-Id: I6117b384fdad215e6c04b6e74df22fe9daa6a526 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157705 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sd/qa/unit/data/pptx/master-slides.pptx b/sd/qa/unit/data/pptx/master-slides.pptx new file mode 100644 index ..3494d33254ab Binary files /dev/null and b/sd/qa/unit/data/pptx/master-slides.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 102d7e2dfa99..c72bd133fb7b 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -149,6 +149,7 @@ public: void testOverflowBehaviorClip(); void testShapeMasterText(); void testIndentDuplication(); +void testMasterSlides(); CPPUNIT_TEST_SUITE(SdImportTest2); @@ -231,6 +232,7 @@ public: CPPUNIT_TEST(testOverflowBehaviorClip); CPPUNIT_TEST(testShapeMasterText); CPPUNIT_TEST(testIndentDuplication); +CPPUNIT_TEST(testMasterSlides); CPPUNIT_TEST_SUITE_END(); }; @@ -2084,6 +2086,16 @@ void SdImportTest2::testIndentDuplication() CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nIndent2); } +void SdImportTest2::testMasterSlides() +{ +createSdImpressDoc("pptx/master-slides.pptx"); +uno::Reference xMasterPagesSupplier(mxComponent, + uno::UNO_QUERY_THROW); +uno::Reference xMasterPages(xMasterPagesSupplier->getMasterPages()); +CPPUNIT_ASSERT(xMasterPages.is()); +CPPUNIT_ASSERT_EQUAL(7, xMasterPages->getCount()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); commit d23176dc22ab3ef7291757aca779f80f0cf0576b Author: Henry Castro AuthorDate: Mon Oct 9 07:34:02 2023 -0400 Commit: Caolán McNamara CommitDate: Sun Oct 29 21:47:19 2023 +0100 tdf#155512: oox: ppt: fix import master slides, follow up Import all master slides. Signed-off-by: Henry Castro Change-Id: Ieac68bacf15c75e4c23ec692aadcb16033cdd092 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157701 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 4685ea2d8316..20fc521ae8c5 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -52,10 +52,10 @@ private: void importSlide( const ::oox::core::FragmentHandlerRef& rSlideFragmentHandler, const oox::ppt::SlidePersistPtr& rPersist ); void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes); -oox::ppt::SlidePersistPtr importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, -::oox::ppt::PowerPointImport& rFilter, -const OUString& rLayoutFragmentPath, -const OUString& rMasterFragmentPath); +void importMasterSlides(); +void importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, + ::oox::ppt::PowerPointImport& rFilter, + const OUString& rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); void importCustomSlideShow(std::vector& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector& rSlidePersist); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 80fb6c6689a7..91824210e239 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -199,13 +199,12 @@ void Pr
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - connectivity/source
connectivity/source/parse/sqliterator.cxx |4 1 file changed, 4 insertions(+) New commits: commit 442d1b22fd74a6be623e52e7236d8b15210b4885 Author: Henry Castro AuthorDate: Wed Aug 30 10:25:51 2023 -0400 Commit: Michael Stahl CommitDate: Wed Oct 25 11:08:28 2023 +0200 connectiviy: fix to detect column data type if Base SQL query: SELECT COUNT("test"."id") from Test If changed to Spanish UI, detect the column type from a neutral context parser. Signed-off-by: Henry Castro Change-Id: I1faa8ff8417a0fc4996b289bd2ce0baad52fc00c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156298 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156425 Tested-by: Jenkins (cherry picked from commit 6896c46567c571a7ae6eb60268de962e3d4ae8bb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158275 Reviewed-by: Michael Stahl diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 1a205953f7aa..683391f66f6a 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -2109,7 +2109,11 @@ sal_Int32 OSQLParseTreeIterator::getFunctionReturnType(const OSQLParseNode* _pNo nType = DataType::DOUBLE; } else +{ nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, _rParser.getContext() ); +if (nType == DataType::SQLNULL) +nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, m_rParser.getNeutral() ); +} } return nType;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 2 commits - connectivity/source dbaccess/source include/connectivity include/svx svx/source
connectivity/source/parse/sqlnode.cxx |5 - dbaccess/source/core/api/SingleSelectQueryComposer.cxx |2 +- dbaccess/source/core/inc/SingleSelectQueryComposer.hxx |1 + include/connectivity/sqlparse.hxx | 10 +++--- include/svx/ParseContext.hxx | 11 +-- svx/source/form/ParseContext.cxx | 16 6 files changed, 38 insertions(+), 7 deletions(-) New commits: commit 8f705a714b57ef3a8086fd8750cf271616e051a8 Author: Henry Castro AuthorDate: Wed Aug 30 10:23:31 2023 -0400 Commit: Michael Stahl CommitDate: Wed Oct 25 11:08:18 2023 +0200 connectivity: add neutral context parser Signed-off-by: Henry Castro Change-Id: I12b0fe811d141873aaa64af5b6c457051c3356b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156297 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156424 Tested-by: Jenkins (cherry picked from commit ae951137fae8afca65f695a5ca789ee1b9811629) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158274 Reviewed-by: Michael Stahl diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 052b6b15cb05..b523e370a7a1 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1305,8 +1305,11 @@ std::unique_ptr OSQLParser::predicateTree(OUString& rErrorMessage } -OSQLParser::OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext, const IParseContext* _pContext) +OSQLParser::OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext, + const IParseContext* _pContext, + const IParseContext* _pNeutral) :m_pContext(_pContext) +,m_pNeutral(_pNeutral) ,m_pData( new OSQLParser_Data ) ,m_nFormatKey(0) ,m_nDateFormatKey(0) diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 4e37188e7231..895657475f25 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -217,7 +217,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc const Reference& _rContext ) :OSubComponent(m_aMutex,_xConnection) ,OPropertyContainer(m_aBHelper) -,m_aSqlParser( _rContext, _aParseContext ) +,m_aSqlParser( _rContext, _aParseContext, _aNeutralContext ) ,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aElementaryParts( size_t(SQLPartCount) ) diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx index a0edfd195a69..fdde2d451d17 100644 --- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx +++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx @@ -76,6 +76,7 @@ namespace dbaccess typedef std::function TGetParseNode; ::svxform::OSystemParseContext m_aParseContext; +::svxform::ONeutralParseContext m_aNeutralContext; ::connectivity::OSQLParser m_aSqlParser; ::connectivity::OSQLParseTreeIterator m_aSqlIterator; // the iterator for the complete statement ::connectivity::OSQLParseTreeIterator m_aAdditiveIterator;// the iterator for the "additive statement" (means without the clauses of the elementary statement) diff --git a/include/connectivity/sqlparse.hxx b/include/connectivity/sqlparse.hxx index c3314c470c6b..1bcfd272ad86 100644 --- a/include/connectivity/sqlparse.hxx +++ b/include/connectivity/sqlparse.hxx @@ -123,7 +123,8 @@ namespace connectivity static sal_Int32s_nRefCount; // information on the current parse action -const IParseContext*m_pContext; +const IParseContext* m_pContext; +const IParseContext* m_pNeutral; std::unique_ptr m_pParseTree; // result from parsing ::std::unique_ptr< OSQLParser_Data > m_pData; @@ -155,7 +156,9 @@ namespace connectivity public: // if NULL, a default context will be used // the context must live as long as the parser -OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext, const IParseContext* _pContext = nullptr); +OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext, + const IParseContext* _pContext = nullptr, + const IParseContext* _pNeutral = nullptr); ~OSQLParser(); // Parsing an SQLS
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - connectivity/source
connectivity/source/parse/sqlnode.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit dc0d4b6292901d783b4678fddca0d821e927e4d4 Author: Henry Castro AuthorDate: Wed Aug 30 10:09:05 2023 -0400 Commit: Michael Stahl CommitDate: Wed Oct 25 11:03:27 2023 +0200 connectivity: fix return column type "DataType::SQLNULL" The Base SQL query: SELECT COUNT( "Test"."id" ) FROM "Test" And the UI language is set to Spanish, the function "getFunctionReturnType" returns misleading column type. Signed-off-by: Henry Castro Change-Id: I2b57d1dfc005711374d7ae0de66b412f4f551d89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156295 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156422 Tested-by: Jenkins (cherry picked from commit 50f36b75cee6591a00102c6e9fa71ba91df5bbd8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158272 Reviewed-by: Michael Stahl diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 4f213bf4f902..052b6b15cb05 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -2494,7 +2494,7 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, const SQLParseNodeParamet sal_Int32 OSQLParser::getFunctionReturnType(std::u16string_view _sFunctionName, const IParseContext* pContext) { -sal_Int32 nType = DataType::VARCHAR; +sal_Int32 nType = DataType::SQLNULL; OString sFunctionName(OUStringToOString(_sFunctionName,RTL_TEXTENCODING_UTF8)); if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ASCII,pContext))) nType = DataType::INTEGER;
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/source
sc/source/ui/view/output2.cxx | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) New commits: commit c9319cdfa269ff3e043f012731406bf3fd4e1810 Author: Henry Castro AuthorDate: Wed Oct 11 08:59:59 2023 -0400 Commit: Henry Castro CommitDate: Wed Oct 18 18:17:51 2023 +0200 sc: ui: fix cell bidi layout strings The default constructor OutputDevice set the layout text to "vcl::text::ComplexTextLayoutFlags::BiDiRtl" for all strings, however the each cell string can be mixed LTR and RTL. Set the defaults to auto detect the correct text layout mode. . Signed-off-by: Henry Castro Change-Id: I0c451e8014fd13490db4213adca3d83ea4572819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157831 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit f63e02b99691a0d8c8addba2518ecdf6b4319c52) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157952 diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 302f2db07a01..e944eb0e0a08 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1521,14 +1521,22 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co { bool bOrigIsInLayoutStrings = mpDoc->IsInLayoutStrings(); mpDoc->SetLayoutStrings(true); -comphelper::ScopeGuard g([this, bOrigIsInLayoutStrings] { -mpDoc->SetLayoutStrings(bOrigIsInLayoutStrings); -}); OSL_ENSURE( mpDev == mpRefDevice || mpDev->GetMapMode().GetMapUnit() == mpRefDevice->GetMapMode().GetMapUnit(), "LayoutStrings: different MapUnits ?!?!" ); +vcl::text::ComplexTextLayoutFlags eTextLayout = mpDev->GetLayoutMode(); +comphelper::ScopeGuard g([this, bOrigIsInLayoutStrings, eTextLayout] { +mpDoc->SetLayoutStrings(bOrigIsInLayoutStrings); + +if (mpDev->GetLayoutMode() != eTextLayout) +mpDev->SetLayoutMode(eTextLayout); +}); + +if (mpDev->GetLayoutMode() != vcl::text::ComplexTextLayoutFlags::Default) +mpDev->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default); + sc::IdleSwitch aIdleSwitch(*mpDoc, false); // Try to limit interpreting to only visible cells. Calling e.g. IsValue()
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/output2.cxx | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) New commits: commit f96819f1358fb55b6e19ddc864f0376693e9feba Author: Henry Castro AuthorDate: Wed Oct 11 08:59:59 2023 -0400 Commit: Caolán McNamara CommitDate: Fri Oct 13 11:27:59 2023 +0200 sc: ui: fix cell bidi layout strings The default constructor OutputDevice can set the layout text to "vcl::text::ComplexTextLayoutFlags::BiDiRtl" for all strings if the UI locale is a RTL locale, however each cell string can be mixed LTR and RTL. Set the defaults to auto detect the correct text layout mode. Signed-off-by: Henry Castro Change-Id: I0c451e8014fd13490db4213adca3d83ea4572819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157880 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 20956ccad844..0cb886a87dc6 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1482,14 +1482,22 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic) { bool bOrigIsInLayoutStrings = mpDoc->IsInLayoutStrings(); mpDoc->SetLayoutStrings(true); -comphelper::ScopeGuard g([this, bOrigIsInLayoutStrings] { -mpDoc->SetLayoutStrings(bOrigIsInLayoutStrings); -}); OSL_ENSURE( mpDev == mpRefDevice || mpDev->GetMapMode().GetMapUnit() == mpRefDevice->GetMapMode().GetMapUnit(), "LayoutStrings: different MapUnits ?!?!" ); +vcl::text::ComplexTextLayoutFlags eTextLayout = mpDev->GetLayoutMode(); +comphelper::ScopeGuard g([this, bOrigIsInLayoutStrings, eTextLayout] { +mpDoc->SetLayoutStrings(bOrigIsInLayoutStrings); + +if (mpDev->GetLayoutMode() != eTextLayout) +mpDev->SetLayoutMode(eTextLayout); +}); + +if (mpDev->GetLayoutMode() != vcl::text::ComplexTextLayoutFlags::Default) +mpDev->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default); + sc::IdleSwitch aIdleSwitch(*mpDoc, false); // Try to limit interpreting to only visible cells. Calling e.g. IsValue()
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/xmloff offapi/com schema/libreoffice sc/source sw/inc sw/qa sw/source writerfilter/source xmloff/inc xmloff/sou
include/xmloff/xmltoken.hxx |1 offapi/com/sun/star/text/ReferenceFieldSource.idl |5 sc/source/ui/view/output2.cxx | 14 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng | 23 sw/inc/fldref.hrc |1 sw/inc/reffld.hxx | 28 sw/qa/extras/ooxmlexport/ooxmlexport.cxx|2 sw/qa/extras/uiwriter/uiwriter7.cxx | 15 sw/source/core/access/accpara.cxx |3 sw/source/core/crsr/crstrvl.cxx | 10 sw/source/core/fields/reffld.cxx| 497 +--- sw/source/core/text/txtfld.cxx | 15 sw/source/core/unocore/unofield.cxx |2 sw/source/filter/ww8/wrtww8.hxx |3 sw/source/filter/ww8/ww8atr.cxx | 87 +- sw/source/filter/ww8/ww8par5.cxx| 15 sw/source/ui/fldui/fldref.cxx | 70 + sw/source/ui/fldui/fldref.hxx |1 sw/source/uibase/docvw/edtwin2.cxx |2 sw/source/uibase/fldui/fldmgr.cxx | 16 sw/source/uibase/utlui/content.cxx |2 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 55 + writerfilter/source/dmapper/FieldTypes.hxx |5 xmloff/inc/txtflde.hxx |1 xmloff/source/core/xmltoken.cxx |1 xmloff/source/text/txtflde.cxx | 32 xmloff/source/text/txtfldi.cxx |5 xmloff/source/token/tokens.txt |1 28 files changed, 753 insertions(+), 159 deletions(-) New commits: commit f63e02b99691a0d8c8addba2518ecdf6b4319c52 Author: Henry Castro AuthorDate: Wed Oct 11 08:59:59 2023 -0400 Commit: Caolán McNamara CommitDate: Fri Oct 13 09:48:29 2023 +0200 sc: ui: fix cell bidi layout strings The default constructor OutputDevice set the layout text to "vcl::text::ComplexTextLayoutFlags::BiDiRtl" for all strings, however the each cell string can be mixed LTR and RTL. Set the defaults to auto detect the correct text layout mode. Signed-off-by: Henry Castro Change-Id: I0c451e8014fd13490db4213adca3d83ea4572819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157831 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index d8dfb064e605..8543f2f517c7 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1481,14 +1481,22 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co { bool bOrigIsInLayoutStrings = mpDoc->IsInLayoutStrings(); mpDoc->SetLayoutStrings(true); -comphelper::ScopeGuard g([this, bOrigIsInLayoutStrings] { -mpDoc->SetLayoutStrings(bOrigIsInLayoutStrings); -}); OSL_ENSURE( mpDev == mpRefDevice || mpDev->GetMapMode().GetMapUnit() == mpRefDevice->GetMapMode().GetMapUnit(), "LayoutStrings: different MapUnits ?!?!" ); +vcl::text::ComplexTextLayoutFlags eTextLayout = mpDev->GetLayoutMode(); +comphelper::ScopeGuard g([this, bOrigIsInLayoutStrings, eTextLayout] { +mpDoc->SetLayoutStrings(bOrigIsInLayoutStrings); + +if (mpDev->GetLayoutMode() != eTextLayout) +mpDev->SetLayoutMode(eTextLayout); +}); + +if (mpDev->GetLayoutMode() != vcl::text::ComplexTextLayoutFlags::Default) +mpDev->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default); + sc::IdleSwitch aIdleSwitch(*mpDoc, false); // Try to limit interpreting to only visible cells. Calling e.g. IsValue() commit ffa1798661dab15435190972a98e6277ced05f4e Author: Skyler Grey AuthorDate: Thu Sep 14 08:48:16 2023 + Commit: Miklos Vajna CommitDate: Fri Oct 13 09:16:13 2023 +0200 tdf#86790: Add support for a word-style styleref STYLEREF is a field type in Word which changes its content based on nearby paragraphs. For example, upon creating a styleref referencing "Heading 1" you will see the text of the nearest "Heading 1"-styled paragraph that is above the field. This patch implements STYLEREF in Writer as a cross-reference. By using "insert>cross-reference>styles" you'll be presented with a list of styles. Selecting one and clicking "insert" will create a field which has text from the "most relevant" instance of the style. To find the
[Libreoffice-commits] core.git: uui/inc
uui/inc/strings.hrc |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 55c7c0667b00a2841819ce961284e3e47ea96fce Author: Henry Castro AuthorDate: Wed Sep 27 13:13:21 2023 -0400 Commit: Caolán McNamara CommitDate: Wed Oct 11 09:53:35 2023 +0200 sfx2: fix typo Signed-off-by: Henry Castro Change-Id: I73e4890c024a2ab74ea3d4141c63304c167ba4c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157337 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157751 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/uui/inc/strings.hrc b/uui/inc/strings.hrc index b6daff517f51..c78beb9efaba 100644 --- a/uui/inc/strings.hrc +++ b/uui/inc/strings.hrc @@ -78,6 +78,6 @@ #define STR_RELOADEDITABLE_TITLE NC_("STR_RELOADEDITABLE_TITLE", "Document is now editable") #define STR_RELOADEDITABLE_MSG NC_("STR_RELOADEDITABLE_MSG", "Document file '$(ARG1)' is now editable \n\nReload this document for editing?") #define STR_RELOADEDITABLE_BTN NC_("STR_RELOADEDITABLE_BTN", "~Reload") -#define STR_LOADREADONLY_MSGNC_("STR_LOADREADONLY_MSG", "The author would like you to open '$(ARG1)' as read-only unless you need to make changes. Open as read-only?.") +#define STR_LOADREADONLY_MSGNC_("STR_LOADREADONLY_MSG", "The author would like you to open '$(ARG1)' as read-only unless you need to make changes. Open as read-only?") /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: sc/source
sc/source/ui/inc/gridwin.hxx |2 ++ sc/source/ui/view/gridwin.cxx | 22 +- 2 files changed, 23 insertions(+), 1 deletion(-) New commits: commit 2709d6bcf248a072abdc6e219466727f52dc159b Author: Henry Castro AuthorDate: Wed Aug 2 16:54:12 2023 -0400 Commit: Caolán McNamara CommitDate: Wed Oct 11 09:29:46 2023 +0200 lok: sc: fire "hyperlink clicked" event The client side has changed the behaviour when the HYPERLINK formula is clicked, usually in desktop is fired with Ctrl + Mouse Click, now it is fired with Mouse Click. Signed-off-by: Henry Castro Change-Id: I08d41170714588d9ee84475991757d8be9b01f07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155270 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155352 (cherry picked from commit 5279aff5588941e1e131a703059e8148713d24ef) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157726 Tested-by: Jenkins diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index deb3264c7759..8334e5fd0d51 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -510,6 +510,8 @@ protected: void ImpDestroyOverlayObjects(); private: +SCCOL m_nDownPosX; +SCROW m_nDownPosY; #ifdef DBG_UTIL void dumpCellProperties(); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 56a7cc00f436..7ae933b1cf65 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -400,7 +400,9 @@ ScGridWindow::ScGridWindow( vcl::Window* pParent, ScViewData& rData, ScSplitPos bIsInPaint( false ), bNeedsRepaint( false ), bAutoMarkVisible( false ), -bListValButton( false ) +bListValButton( false ), +m_nDownPosX( -1 ), +m_nDownPosY( -1 ) { set_id("grid_window"); switch(eWhich) @@ -2045,6 +2047,8 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta SCROW nPosY; mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY ); SCTAB nTab = mrViewData.GetTabNo(); +m_nDownPosX = nPosX; +m_nDownPosY = nPosY; // FIXME: this is to limit the number of rows handled in the Online // to 1000; this will be removed again when the performance @@ -2695,6 +2699,22 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) } mrViewData.GetViewShell()->SelectionChanged(); +if (bIsTiledRendering && !bRefMode && !bDouble) +{ +OUString aName, aUrl, aTarget; +ScTabViewShell* pViewShell = mrViewData.GetViewShell(); +if (pViewShell && nPosX == m_nDownPosX && nPosY == m_nDownPosY +&& GetEditUrl(aPos, , , )) +{ +OString aMsg(aUrl.toUtf8() + " coordinates: " + + pViewShell->GetViewData().describeCellCursorAt(nPosX, nPosY) + ", " + + OString::number(aPos.X() / pViewShell->GetViewData().GetPPTX())); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aMsg); +} +} + +m_nDownPosX = m_nDownPosY = -1; + return; }
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) New commits: commit fa834e64e927efca00c9c47edfee58f0714c4fd4 Author: Henry Castro AuthorDate: Mon Sep 25 16:23:20 2023 -0400 Commit: Caolán McNamara CommitDate: Tue Oct 10 09:30:46 2023 +0200 lok: fix getting SID_DOC_READONLY slot property Unfortunately, the property is not always set when import XLSX documents. Signed-off-by: Henry Castro Change-Id: If501734704174b92b3589b61a019ba973592c331 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157259 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157736 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 52ca105d09b9..a2399b125b94 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5982,18 +5982,9 @@ static char* getDocReadOnly(LibreOfficeKitDocument* pThis) if (!pObjectShell) return nullptr; -SfxMedium* pMedium = pObjectShell->GetMedium(); -if (!pMedium) -return nullptr; - -bool bDocReadOnly = false; -if (const SfxBoolItem* pReadOnlyItem = -pMedium->GetItemSet().GetItem(SID_DOC_READONLY, false)) -bDocReadOnly = pReadOnlyItem->GetValue(); - boost::property_tree::ptree aTree; aTree.put("commandName", ".uno:ReadOnly"); -aTree.put("success", bDocReadOnly); +aTree.put("success", pObjectShell->IsLoadReadonly()); std::stringstream aStream; boost::property_tree::write_json(aStream, aTree);
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 44 +++- 1 file changed, 43 insertions(+), 1 deletion(-) New commits: commit 4dade552c67a36f83cb419f90369722dc913d9fe Author: Henry Castro AuthorDate: Fri Sep 8 14:23:33 2023 -0400 Commit: Henry Castro CommitDate: Mon Oct 9 21:32:49 2023 +0200 lok: add getter function to read "ReadOnly" flag Signed-off-by: Henry Castro Change-Id: Id9d2bc638d0f48cb33764b07fb8976b97117a621 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156621 Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157733 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d0c3e5fe939b..52ca105d09b9 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5968,6 +5968,44 @@ static void doc_resetSelection(LibreOfficeKitDocument* pThis) pDoc->resetSelection(); } +static char* getDocReadOnly(LibreOfficeKitDocument* pThis) +{ +LibLODocument_Impl* pDocument = static_cast(pThis); +if (!pDocument) +return nullptr; + +SfxBaseModel* pBaseModel = dynamic_cast(pDocument->mxComponent.get()); +if (!pBaseModel) +return nullptr; + +SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell(); +if (!pObjectShell) +return nullptr; + +SfxMedium* pMedium = pObjectShell->GetMedium(); +if (!pMedium) +return nullptr; + +bool bDocReadOnly = false; +if (const SfxBoolItem* pReadOnlyItem = +pMedium->GetItemSet().GetItem(SID_DOC_READONLY, false)) +bDocReadOnly = pReadOnlyItem->GetValue(); + +boost::property_tree::ptree aTree; +aTree.put("commandName", ".uno:ReadOnly"); +aTree.put("success", bDocReadOnly); + +std::stringstream aStream; +boost::property_tree::write_json(aStream, aTree); +char* pJson = static_cast(malloc(aStream.str().size() + 1)); +if (!pJson) +return nullptr; + +strcpy(pJson, aStream.str().c_str()); +pJson[aStream.str().size()] = '\0'; +return pJson; +} + static char* getLanguages(LibreOfficeKitDocument* pThis, const char* pCommand) { css::uno::Sequence< css::lang::Locale > aLocales; @@ -6345,7 +6383,11 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo return nullptr; } -if (!strcmp(pCommand, ".uno:LanguageStatus")) +if (!strcmp(pCommand, ".uno:ReadOnly")) +{ +return getDocReadOnly(pThis); +} +else if (!strcmp(pCommand, ".uno:LanguageStatus")) { return getLanguages(pThis, pCommand); }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/objmisc.cxx | 49 1 file changed, 49 insertions(+) New commits: commit 0855520cced8662ba0a8cfdaccbe55a812b13c60 Author: Henry Castro AuthorDate: Wed Sep 6 10:30:27 2023 -0400 Commit: Henry Castro CommitDate: Mon Oct 9 19:52:30 2023 +0200 sfx2: invoke handler "LoadReadOnlyRequest" It will ask the user if open the Excel documents "read only" Signed-off-by: Henry Castro Change-Id: I909fb39709198e02496f8c522f477c077fb875e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156624 Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157730 Tested-by: Jenkins diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 69d0ac4b3bea..123d234734f7 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -77,6 +77,7 @@ #include #include #include +#include #include #include @@ -1098,6 +1099,54 @@ void SfxObjectShell::FinishedLoading( SfxLoadedFlags nFlags ) bHasName = true; // the document is loaded, so the name should already available GetTitle( SFX_TITLE_DETECT ); InitOwnModel_Impl(); + +if (IsLoadReadonly()) +{ +OUString aFilterName; +if (const SfxStringItem* pFilterNameItem = +pMedium->GetItemSet().GetItem(SID_FILTER_NAME, false)) +aFilterName = pFilterNameItem->GetValue(); + +OUString aFileName; +if (const SfxStringItem* pFileNameItem = +pMedium->GetItemSet().GetItem(SID_FILE_NAME, false)) +{ +const INetURLObject aURL(pFileNameItem->GetValue()); +aFileName = aURL.getBase(INetURLObject::LAST_SEGMENT, true, + INetURLObject::DecodeMechanism::WithCharset); +} + +bool bSilent = false; +if (const SfxBoolItem* pSilentNameItem = +pMedium->GetItemSet().GetItem(SID_SILENT, false)) +bSilent = pSilentNameItem->GetValue(); + +if (!bSilent && aFilterName.indexOf("Excel") != -1) +{ +Reference xHandler(pMedium->GetInteractionHandler()); +if (xHandler.is()) +{ +beans::NamedValue aLoadReadOnlyRequest; +aLoadReadOnlyRequest.Name = "LoadReadOnlyRequest"; +aLoadReadOnlyRequest.Value <<= aFileName; + +Any aRequest(aLoadReadOnlyRequest); +rtl::Reference xRequest += new ucbhelper::SimpleInteractionRequest(aRequest, + ContinuationFlags::Approve | + ContinuationFlags::Disapprove); + +xHandler->handle(xRequest); + +if (xRequest->getResponse() == ContinuationFlags::Disapprove) +{ +SetSecurityOptOpenReadOnly(false); + pMedium->GetItemSet().Put(SfxBoolItem(SID_DOC_READONLY, false)); +} +} +} +} + pImpl->nFlagsInProgress &= ~SfxLoadedFlags::MAINDOCUMENT; }
[Libreoffice-commits] core.git: desktop/source uui/source
desktop/source/lib/lokinteractionhandler.cxx | 24 desktop/source/lib/lokinteractionhandler.hxx |2 ++ uui/source/iahndl-errorhandler.cxx |1 - 3 files changed, 26 insertions(+), 1 deletion(-) New commits: commit 447d6af45b3c454bb858bc904f50e500aaaefc60 Author: Henry Castro AuthorDate: Wed Sep 6 10:28:59 2023 -0400 Commit: Henry Castro CommitDate: Mon Oct 9 16:32:35 2023 +0200 lok: implement "handleLoadReadOnlyRequest" Is used for interaction handle to query user decision regarding to open the document read only. Signed-off-by: Henry Castro Change-Id: Ia945eae7b1627d57d6211ae92a784d50313c2627 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156623 Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157703 Tested-by: Jenkins diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx index 6df4fe2d98e5..a05091cedf5e 100644 --- a/desktop/source/lib/lokinteractionhandler.cxx +++ b/desktop/source/lib/lokinteractionhandler.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -368,6 +369,26 @@ bool LOKInteractionHandler::handlePackageReparationRequest(const uno::Reference< return false; } +bool LOKInteractionHandler::handleLoadReadOnlyRequest(const uno::Reference& xRequest) +{ +uno::Any const request(xRequest->getRequest()); + +OUString aFileName; +beans::NamedValue aLoadReadOnlyRequest; +if ((request >>= aLoadReadOnlyRequest) && +aLoadReadOnlyRequest.Name == "LoadReadOnlyRequest" && +(aLoadReadOnlyRequest.Value >>= aFileName)) +{ +auto xInteraction(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), nullptr)); + +if (xInteraction.is()) +xInteraction->handleInteractionRequest(xRequest); + +return true; +} +return false; +} + bool LOKInteractionHandler::handleFilterOptionsRequest(const uno::Reference& xRequest) { document::FilterOptionsRequest aFilterOptionsRequest; @@ -410,6 +431,9 @@ sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest( if (handlePackageReparationRequest(xRequest)) return true; +if (handleLoadReadOnlyRequest(xRequest)) +return true; + // TODO: perform more interactions 'for real' like the above selectApproved(rContinuations); diff --git a/desktop/source/lib/lokinteractionhandler.hxx b/desktop/source/lib/lokinteractionhandler.hxx index fc2bf12b48cc..c3641db0762f 100644 --- a/desktop/source/lib/lokinteractionhandler.hxx +++ b/desktop/source/lib/lokinteractionhandler.hxx @@ -79,6 +79,8 @@ private: static bool handleFilterOptionsRequest(const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& Request); static bool handlePackageReparationRequest(const css::uno::Reference& xRequest); +static bool handleLoadReadOnlyRequest(const css::uno::Reference& xRequest); + public: void SetPassword(char const* pPassword); diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index c89e66b93c35..e4be8a713911 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -94,7 +94,6 @@ executeErrorDialog( break; } - switch (nButtonMask) { case MessageBoxStyle::NONE:
[Libreoffice-commits] core.git: uui/inc uui/source
uui/inc/strings.hrc|1 uui/source/iahndl-errorhandler.cxx | 39 + uui/source/iahndl.cxx | 11 ++ uui/source/iahndl.hxx |5 4 files changed, 56 insertions(+) New commits: commit 7fee80fdf4625af4bb8c4273e2cab7bf8b9b46df Author: Henry Castro AuthorDate: Wed Sep 6 10:27:12 2023 -0400 Commit: Henry Castro CommitDate: Mon Oct 9 13:42:45 2023 +0200 uui: implement "handleLoadReadOnlyRequest" Is used for interaction handle to query user decision regarding to open the document read only. Signed-off-by: Henry Castro Change-Id: Ia6792ca540b5c62f4c9de8a5793ef45de3740484 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156622 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157660 Tested-by: Jenkins diff --git a/uui/inc/strings.hrc b/uui/inc/strings.hrc index 98bd94ef8484..b6daff517f51 100644 --- a/uui/inc/strings.hrc +++ b/uui/inc/strings.hrc @@ -78,5 +78,6 @@ #define STR_RELOADEDITABLE_TITLE NC_("STR_RELOADEDITABLE_TITLE", "Document is now editable") #define STR_RELOADEDITABLE_MSG NC_("STR_RELOADEDITABLE_MSG", "Document file '$(ARG1)' is now editable \n\nReload this document for editing?") #define STR_RELOADEDITABLE_BTN NC_("STR_RELOADEDITABLE_BTN", "~Reload") +#define STR_LOADREADONLY_MSGNC_("STR_LOADREADONLY_MSG", "The author would like you to open '$(ARG1)' as read-only unless you need to make changes. Open as read-only?.") /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index 74e3253c5220..c89e66b93c35 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -33,6 +33,7 @@ #include #include +#include #include "getcontinuations.hxx" #include "iahndl.hxx" @@ -290,4 +291,42 @@ UUIInteractionHelper::handleErrorHandlerRequest( } } +void +UUIInteractionHelper::handleLoadReadOnlyRequest( +const OUString& sDocumentURL, +uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & +rContinuations) +{ +std::locale aLocale(Translate::Create("uui")); +std::vector aArguments = { sDocumentURL }; +uno::Reference xRetry; +uno::Reference xAbort; +uno::Reference xApprove; +uno::Reference xDisapprove; +uno::Reference xParent = getParentXWindow(); +OUString aMessage(Translate::get(STR_LOADREADONLY_MSG, aLocale)); + +aMessage = replaceMessageWithArguments(aMessage, aArguments); +getContinuations(rContinuations, , , , ); + +std::unique_ptr xBox( +Application::CreateMessageDialog(Application::GetFrameWeld(xParent), + VclMessageType::Question, + VclButtonsType::YesNo, + aMessage, + GetpApp())); + +if (xBox->run() == RET_YES) +{ +if (xApprove.is()) +xApprove->select(); +} +else +{ +if (xDisapprove.is()) +xDisapprove->select(); +} +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 3eed5811f202..bc6f12742b47 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -810,6 +810,17 @@ UUIInteractionHelper::handleRequest_impl( return true; } +OUString aFileName; +beans::NamedValue aLoadReadOnlyRequest; +if ((aAnyRequest >>= aLoadReadOnlyRequest) && +aLoadReadOnlyRequest.Name == "LoadReadOnlyRequest" && +(aLoadReadOnlyRequest.Value >>= aFileName)) +{ +handleLoadReadOnlyRequest(aFileName, + rRequest->getContinuations()); +return true; +} + // Last chance: interaction handlers registered in the configuration diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 78d283d6bf0e..cf468f57dbcf 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -238,6 +238,11 @@ private: const OUString & instructions, const OUString & url, css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations ); + +void +handleLoadReadOnlyRequest( +const OUString& sDocumentURL, +css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations); }; class ErrorResource
[Libreoffice-commits] core.git: sc/qa
sc/qa/uitest/calc_tests7/save_readonly_with_password.py |6 +++--- sc/qa/uitest/calc_tests8/tdf147086.py |3 ++- sc/qa/uitest/calc_tests9/tdf115933.py |3 ++- sc/qa/uitest/calc_tests9/tdf118938.py |3 ++- sc/qa/uitest/calc_tests9/tdf144996.py |6 +++--- 5 files changed, 12 insertions(+), 9 deletions(-) New commits: commit 8e3f6b9fd6915a20c8c9f5195e5ac5a7e085920a Author: Henry Castro AuthorDate: Mon Sep 18 17:05:56 2023 -0400 Commit: Henry Castro CommitDate: Fri Oct 6 17:37:18 2023 +0200 uitest: add "Silent" property parameter add option to not popup the read-only dialog when load and excel file. Signed-off-by: Henry Castro Change-Id: I5e0ac06e3e872f156f6150f4b8bead61e7986c25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157036 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157641 Tested-by: Jenkins diff --git a/sc/qa/uitest/calc_tests7/save_readonly_with_password.py b/sc/qa/uitest/calc_tests7/save_readonly_with_password.py index 311293815398..c7d2f829e32c 100644 --- a/sc/qa/uitest/calc_tests7/save_readonly_with_password.py +++ b/sc/qa/uitest/calc_tests7/save_readonly_with_password.py @@ -8,6 +8,7 @@ # from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues +from com.sun.star.beans import PropertyValue from org.libreoffice.unotest import systemPathToFileUrl from uitest.uihelper.common import select_by_text from tempfile import TemporaryDirectory @@ -46,8 +47,7 @@ class save_readonly_with_password(UITestCase): with self.ui_test.execute_dialog_through_action(xOk, "CLICK", close_button="save"): pass -with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document: - +with self.ui_test.load_file(systemPathToFileUrl(xFilePath), [PropertyValue(Name="Silent", Value=True)]) as document: self.assertTrue(document.isReadonly()) with self.ui_test.execute_dialog_through_command(".uno:EditDoc") as xDialog: @@ -80,7 +80,7 @@ class save_readonly_with_password(UITestCase): xConfirmPassword = xPasswordDialog.getChild("confirmropassEntry") xConfirmPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"})) -with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document: +with self.ui_test.load_file(systemPathToFileUrl(xFilePath), [PropertyValue(Name="Silent", Value=True)]) as document: self.assertTrue(document.isReadonly()) diff --git a/sc/qa/uitest/calc_tests8/tdf147086.py b/sc/qa/uitest/calc_tests8/tdf147086.py index 906f79075b59..1be3d6adb276 100755 --- a/sc/qa/uitest/calc_tests8/tdf147086.py +++ b/sc/qa/uitest/calc_tests8/tdf147086.py @@ -8,6 +8,7 @@ # from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues +from com.sun.star.beans import PropertyValue from org.libreoffice.unotest import systemPathToFileUrl from uitest.uihelper.common import select_by_text from tempfile import TemporaryDirectory @@ -44,7 +45,7 @@ class tdf147086(UITestCase): with self.ui_test.execute_dialog_through_action(xOk, "CLICK", close_button="save"): pass -with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document: +with self.ui_test.load_file(systemPathToFileUrl(xFilePath), [PropertyValue(Name="Silent", Value=True)]) as document: self.assertTrue(document.isReadonly()) diff --git a/sc/qa/uitest/calc_tests9/tdf115933.py b/sc/qa/uitest/calc_tests9/tdf115933.py index 0fe7fec06758..128b80652e47 100644 --- a/sc/qa/uitest/calc_tests9/tdf115933.py +++ b/sc/qa/uitest/calc_tests9/tdf115933.py @@ -8,6 +8,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import get_url_for_data_file +from com.sun.star.beans import PropertyValue from libreoffice.uno.propertyvalue import mkPropertyValues #Bug 115933 - XLSX password protected with algorithmName, hashValue, saltValue and spinCount @@ -15,7 +16,7 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class tdf115933(UITestCase): def test_tdf115933(self): -with self.ui_test.load_file(get_url_for_data_file("tdf115933.xlsx")): +with self.ui_test.load_file(get_url_for_data_file("tdf115933.xlsx"), [PropertyValue(Name="Silent", Value=True)]): #The document was created in Excel. calcDoc = self.xUITest.getTopFocusWindow() gridwin = calcDoc.getChild("grid_window") diff --git a/sc/qa/uites
[Libreoffice-commits] core.git: include/test sc/qa test/source
include/test/unoapi_test.hxx |3 +++ sc/qa/unit/subsequent_export_test2.cxx | 10 -- test/source/unoapi_test.cxx| 18 ++ 3 files changed, 29 insertions(+), 2 deletions(-) New commits: commit df9f94a1b37d26b74d981dc4514255c46477c8ac Author: Henry Castro AuthorDate: Thu Sep 21 07:11:13 2023 -0400 Commit: Henry Castro CommitDate: Fri Oct 6 15:27:35 2023 +0200 sc: qa: add loadWithParams and SaveWithParams Add option to load and save with optional parameters. Signed-off-by: Henry Castro Change-Id: I2d735443da11634d072742f1bf6f38f90bced2c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157141 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157569 Tested-by: Jenkins diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index e329168dfe7b..4ba209c44d39 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -36,12 +36,15 @@ public: OUString createFileURL(std::u16string_view aFileBase); OUString createFilePath(std::u16string_view aFileBase); void load(const OUString& rURL, const char* pPassword = nullptr); +void loadWithParams(const OUString& rURL, +const css::uno::Sequence& rParams); OUString loadFromURL(std::u16string_view aFileBase, const char* pPassword = nullptr); css::uno::Any executeMacro(const OUString& rScriptURL, const css::uno::Sequence& rParams = {}); void save(const OUString& rFilter, const char* pPassword = nullptr); +void saveWithParams(const css::uno::Sequence& rParams); void saveAndReload(const OUString& rFilter, const char* pPassword = nullptr); std::unique_ptr parsePDFExport(const OString& rPassword = OString()); diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 403bffc3112f..91309d9e5491 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -698,10 +699,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testHyperlinkTargetFrameODS) CPPUNIT_TEST_FIXTURE(ScExportTest2, testOpenDocumentAsReadOnly) { -createScDoc("xlsx/open-as-read-only.xlsx"); +uno::Sequence aParams = { comphelper::makePropertyValue("Silent", true) }; + +loadWithParams(createFileURL(u"xlsx/open-as-read-only.xlsx"), aParams); ScDocShell* pDocSh = getScDocShell(); CPPUNIT_ASSERT(pDocSh->IsSecurityOptOpenReadOnly()); -saveAndReload("Calc Office Open XML"); + +saveWithParams(uno::Sequence()); +loadWithParams(maTempFile.GetURL(), aParams); + pDocSh = getScDocShell(); CPPUNIT_ASSERT(pDocSh->IsSecurityOptOpenReadOnly()); } diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index 5c689bfe5354..464f374201bd 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -121,6 +121,18 @@ void UnoApiTest::load(OUString const& rURL, const char* pPassword) } } +void UnoApiTest::loadWithParams(OUString const& rURL, +const uno::Sequence& rParams) +{ +if (mxComponent.is()) +{ +mxComponent->dispose(); +mxComponent.clear(); +} + +mxComponent = loadFromDesktop(rURL, OUString(), rParams); +} + OUString UnoApiTest::loadFromURL(std::u16string_view aFileBase, const char* pPassword) { OUString aFileName = createFileURL(aFileBase); @@ -203,6 +215,12 @@ void UnoApiTest::save(const OUString& rFilter, const char* pPassword) } } +void UnoApiTest::saveWithParams(const uno::Sequence& rParams) +{ +css::uno::Reference xStorable(mxComponent, css::uno::UNO_QUERY_THROW); +xStorable->storeToURL(maTempFile.GetURL(), rParams); +} + void UnoApiTest::saveAndReload(const OUString& rFilter, const char* pPassword) { save(rFilter, pPassword);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/oox oox/source sd/qa
include/oox/ppt/presentationfragmenthandler.hxx |4 oox/source/ppt/presentationfragmenthandler.cxx | 121 +--- sd/qa/unit/export-tests-ooxml2.cxx |4 3 files changed, 71 insertions(+), 58 deletions(-) New commits: commit 1b871b635c7f368d46a0cff96c059a4d53b257d6 Author: Henry Castro AuthorDate: Thu Sep 28 15:01:43 2023 -0400 Commit: Henry Castro CommitDate: Thu Oct 5 12:59:42 2023 +0200 tdf#155512: oox: ppt: fix import master slides Import all master slides according to the relationship with slide layouts. Adjust unit test values: SdOOXMLExportTest2::testTdf106867 I do not know why those values change since importing embedded video source code was not touched SdOOXMLExportTest2::testAccentColor The accent6 is a constant value. Signed-off-by: Henry Castro Change-Id: Ic7c70d2c4ce30a7f2d2d1cf22604f1119a66f5f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157387 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit 08ed103d734ebf65202dc097c7bb0990573f8fd1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157532 Tested-by: Jenkins (cherry picked from commit adcde78935fb8ca2b93322aa3a558d0b3ccdbfad) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157546 diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 4685ea2d8316..29204b282bdb 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -54,8 +54,8 @@ private: void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes); oox::ppt::SlidePersistPtr importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, ::oox::ppt::PowerPointImport& rFilter, -const OUString& rLayoutFragmentPath, -const OUString& rMasterFragmentPath); +std::u16string_view rLayoutFragmentPath, +std::u16string_view rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); void importCustomSlideShow(std::vector& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector& rSlidePersist); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 8dd0af1345df..09c39902a66a 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -217,75 +217,88 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector& SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const Reference& xModel, PowerPointImport& rFilter, - const OUString& rLayoutFragmentPath, - const OUString& rMasterFragmentPath) + std::u16string_view rLayoutFragmentPath, + std::u16string_view rMasterFragmentPath) { -SlidePersistPtr pMasterPersistPtr; +OUString aLayoutFragmentPath; +OUString aMasterFragmentPath(rMasterFragmentPath); +SlidePersistPtr pMasterPersistPtr, pMasterPtr; Reference< drawing::XDrawPage > xMasterPage; Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); +RelationsRef xMasterRelations = rFilter.importRelations( aMasterFragmentPath ); -sal_Int32 nIndex; -if( rFilter.getMasterPages().empty() ) +for (const auto& rEntry : *xMasterRelations) { -nIndex = 0; -xMasterPages->getByIndex( nIndex ) >>= xMasterPage; -} -else -{ -nIndex = xMasterPages->getCount(); -xMasterPage = xMasterPages->insertNewByIndex( nIndex ); -} +aLayoutFragmentPath = xMasterRelations->getFragmentPathFromRelation(rEntry.second); -pMasterPersistPtr = std::make_shared( rFilter, true, false, xMasterPage, - std::make_shared( Master, "com.sun.star.drawing.GroupShape" ), mpTextListStyle ); -pMasterPersistPtr->setLayoutPath( rLayoutFragmentPath ); -rFilter.getMasterPages().push_back( pMasterPersistPtr ); -rFilter.se
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/oox oox/source
include/oox/ppt/presentationfragmenthandler.hxx |6 + oox/source/ppt/presentationfragmenthandler.cxx | 137 2 files changed, 80 insertions(+), 63 deletions(-) New commits: commit 89d6b13b8fa4edf5d1df79dded799c531c656652 Author: Henry Castro AuthorDate: Thu Sep 28 14:23:55 2023 -0400 Commit: Henry Castro CommitDate: Wed Oct 4 21:07:37 2023 +0200 tdf#155512: oox: ppt: abstraction "importMasterSlide" Signed-off-by: Henry Castro Change-Id: Icfe8e3abbada7f728b2ad1f8e300a688f51d8f75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157386 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit 84ac58c37fffa0c8b6d55c70009515d013ad65b4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157468 Tested-by: Jenkins (cherry picked from commit 9fabd7c11989c2a89c5bb238e6cb52b0a6678851) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157543 diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 7ac929ec555b..4685ea2d8316 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -38,6 +38,8 @@ namespace oox::core { class XmlFilterBase; } namespace oox::ppt { +class PowerPointImport; + class PresentationFragmentHandler final : public ::oox::core::FragmentHandler2 { public: @@ -50,6 +52,10 @@ private: void importSlide( const ::oox::core::FragmentHandlerRef& rSlideFragmentHandler, const oox::ppt::SlidePersistPtr& rPersist ); void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes); +oox::ppt::SlidePersistPtr importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, +::oox::ppt::PowerPointImport& rFilter, +const OUString& rLayoutFragmentPath, +const OUString& rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); void importCustomSlideShow(std::vector& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector& rSlidePersist); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index cc972b80a8b0..8dd0af1345df 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -215,6 +215,79 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector& } } +SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const Reference& xModel, + PowerPointImport& rFilter, + const OUString& rLayoutFragmentPath, + const OUString& rMasterFragmentPath) +{ +SlidePersistPtr pMasterPersistPtr; +Reference< drawing::XDrawPage > xMasterPage; +Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); +Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); + +sal_Int32 nIndex; +if( rFilter.getMasterPages().empty() ) +{ +nIndex = 0; +xMasterPages->getByIndex( nIndex ) >>= xMasterPage; +} +else +{ +nIndex = xMasterPages->getCount(); +xMasterPage = xMasterPages->insertNewByIndex( nIndex ); +} + +pMasterPersistPtr = std::make_shared( rFilter, true, false, xMasterPage, + std::make_shared( Master, "com.sun.star.drawing.GroupShape" ), mpTextListStyle ); +pMasterPersistPtr->setLayoutPath( rLayoutFragmentPath ); +rFilter.getMasterPages().push_back( pMasterPersistPtr ); +rFilter.setActualSlidePersist( pMasterPersistPtr ); +FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, rMasterFragmentPath, pMasterPersistPtr, Master ) ); + +// set the correct theme +OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( u"theme" ); +if( !aThemeFragmentPath.isEmpty() ) +{ +std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() ); +std::map< OUString, oox::drawingml::ThemePtr >::iterator aIter2( rThemes.find( aThemeFragmentPath ) ); +if( aIter2 == rThemes.end() ) +{ +oox::drawingml::ThemePtr pThemePtr = std::make_shared(); +pMasterPersistPtr->setTheme( pThemePtr ); +Referenc
[Libreoffice-commits] core.git: include/oox oox/source sd/qa
include/oox/ppt/presentationfragmenthandler.hxx |4 oox/source/ppt/presentationfragmenthandler.cxx | 121 +--- sd/qa/unit/export-tests-ooxml2.cxx |4 3 files changed, 71 insertions(+), 58 deletions(-) New commits: commit adcde78935fb8ca2b93322aa3a558d0b3ccdbfad Author: Henry Castro AuthorDate: Thu Sep 28 15:01:43 2023 -0400 Commit: Henry Castro CommitDate: Wed Oct 4 21:07:14 2023 +0200 tdf#155512: oox: ppt: fix import master slides Import all master slides according to the relationship with slide layouts. Adjust unit test values: SdOOXMLExportTest2::testTdf106867 I do not know why those values change since importing embedded video source code was not touched SdOOXMLExportTest2::testAccentColor The accent6 is a constant value. Signed-off-by: Henry Castro Change-Id: Ic7c70d2c4ce30a7f2d2d1cf22604f1119a66f5f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157387 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit 08ed103d734ebf65202dc097c7bb0990573f8fd1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157532 Tested-by: Jenkins diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 4685ea2d8316..29204b282bdb 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -54,8 +54,8 @@ private: void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes); oox::ppt::SlidePersistPtr importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, ::oox::ppt::PowerPointImport& rFilter, -const OUString& rLayoutFragmentPath, -const OUString& rMasterFragmentPath); +std::u16string_view rLayoutFragmentPath, +std::u16string_view rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); void importCustomSlideShow(std::vector& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector& rSlidePersist); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 538d79df7f50..5dd00957b8b8 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -217,75 +217,88 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector& SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const Reference& xModel, PowerPointImport& rFilter, - const OUString& rLayoutFragmentPath, - const OUString& rMasterFragmentPath) + std::u16string_view rLayoutFragmentPath, + std::u16string_view rMasterFragmentPath) { -SlidePersistPtr pMasterPersistPtr; +OUString aLayoutFragmentPath; +OUString aMasterFragmentPath(rMasterFragmentPath); +SlidePersistPtr pMasterPersistPtr, pMasterPtr; Reference< drawing::XDrawPage > xMasterPage; Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); +RelationsRef xMasterRelations = rFilter.importRelations( aMasterFragmentPath ); -sal_Int32 nIndex; -if( rFilter.getMasterPages().empty() ) +for (const auto& rEntry : *xMasterRelations) { -nIndex = 0; -xMasterPages->getByIndex( nIndex ) >>= xMasterPage; -} -else -{ -nIndex = xMasterPages->getCount(); -xMasterPage = xMasterPages->insertNewByIndex( nIndex ); -} +aLayoutFragmentPath = xMasterRelations->getFragmentPathFromRelation(rEntry.second); -pMasterPersistPtr = std::make_shared( rFilter, true, false, xMasterPage, - std::make_shared( Master, "com.sun.star.drawing.GroupShape" ), mpTextListStyle ); -pMasterPersistPtr->setLayoutPath( rLayoutFragmentPath ); -rFilter.getMasterPages().push_back( pMasterPersistPtr ); -rFilter.setActualSlidePersist( pMasterPersistPtr ); -FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, rM
[Libreoffice-commits] core.git: uitest/uitest
uitest/uitest/test.py |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 3d665f4ee60d994257a29d5fc607d6c88593aed7 Author: Henry Castro AuthorDate: Wed Sep 20 07:44:43 2023 -0400 Commit: Henry Castro CommitDate: Wed Oct 4 19:46:13 2023 +0200 uitest: add load properties parameters Add the option to include the load properties when invoked load_file function. Signed-off-by: Henry Castro Change-Id: I27cb31e2470bc76bcc5b760661e50f00fc334d64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157102 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157567 Tested-by: Jenkins diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index 23ca7f39bc4e..d160b9564d0f 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -81,9 +81,9 @@ class UITest(object): return time.sleep(DEFAULT_SLEEP) -def load_component_from_url(self, url, eventName="OnLoad"): +def load_component_from_url(self, url, eventName="OnLoad", load_props=()): with EventListener(self._xContext, eventName) as event: -component = self.get_desktop().loadComponentFromURL(url, "_default", 0, tuple()) +component = self.get_desktop().loadComponentFromURL(url, "_default", 0, load_props) while True: if event.executed: frames = self.get_frames() @@ -94,9 +94,9 @@ class UITest(object): # Calls UITest.close_doc at exit @contextmanager -def load_file(self, url): +def load_file(self, url, load_props=()): try: -yield self.load_component_from_url(url) +yield self.load_component_from_url(url, "OnLoad", load_props) finally: self.close_doc()
[Libreoffice-commits] core.git: uitest/libreoffice
uitest/libreoffice/connection.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) New commits: commit 1058d5edc0b6bbaddea2af520d8b5c3e54ec7498 Author: Henry Castro AuthorDate: Thu Sep 21 07:55:26 2023 -0400 Commit: Henry Castro CommitDate: Wed Oct 4 17:46:52 2023 +0200 uitest: flush print messages Signed-off-by: Henry Castro Change-Id: I87098a438d476529aa25b6608408d07bbc98ce0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157145 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157557 Tested-by: Jenkins diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py index 101a5385fd4a..e3b76b4baf44 100644 --- a/uitest/libreoffice/connection.py +++ b/uitest/libreoffice/connection.py @@ -16,9 +16,9 @@ try: import pyuno import uno except ImportError: -print("pyuno not found: try to set PYTHONPATH and URE_BOOTSTRAP variables") -print("PYTHONPATH=/installation/opt/program") -print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc") +print("pyuno not found: try to set PYTHONPATH and URE_BOOTSTRAP variables", flush=True) +print("PYTHONPATH=/installation/opt/program", flush=True) +print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc", flush=True) raise def signal_handler(signal_num, frame): @@ -104,7 +104,7 @@ class OfficeConnection: xUnoResolver = xLocalContext.ServiceManager.createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver", xLocalContext) url = "uno:" + socket + ";urp;StarOffice.ComponentContext" -print("OfficeConnection: connecting to: " + url) +print("OfficeConnection: connecting to: " + url, flush=True) while True: if self.soffice and self.soffice.poll() is not None: raise Exception("soffice has stopped.") @@ -113,7 +113,7 @@ class OfficeConnection: xContext = xUnoResolver.resolve(url) return xContext except pyuno.getClass("com.sun.star.connection.NoConnectException"): -print("NoConnectException: sleeping...") +print("NoConnectException: sleeping...", flush=True) time.sleep(1) def tearDown(self): @@ -126,17 +126,17 @@ class OfficeConnection: if self.soffice: if self.xContext: try: -print("tearDown: calling terminate()...") +print("tearDown: calling terminate()...", flush=True) xMgr = self.xContext.ServiceManager xDesktop = xMgr.createInstanceWithContext( "com.sun.star.frame.Desktop", self.xContext) xDesktop.terminate() -print("...done") +print("...done", flush=True) except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"): -print("caught while TearDown:\n", traceback.format_exc()) +print("caught while TearDown:\n", traceback.format_exc(), flush=True) pass # ignore, also means disposed except pyuno.getClass("com.sun.star.lang.DisposedException"): -print("caught while TearDown:\n", traceback.format_exc()) +print("caught while TearDown:\n", traceback.format_exc(), flush=True) pass # ignore else: self.soffice.terminate()
[Libreoffice-commits] core.git: uitest/libreoffice
uitest/libreoffice/connection.py |7 +++ 1 file changed, 7 insertions(+) New commits: commit 0d21e1075f0288a007cb427ce508d6fbbf8503dd Author: Henry Castro AuthorDate: Thu Sep 21 07:40:36 2023 -0400 Commit: Henry Castro CommitDate: Wed Oct 4 15:51:10 2023 +0200 uitest: add signal_handler function install signal handler to analyze if the soffice bootstrap has some issues. Signed-off-by: Henry Castro Change-Id: I8b05b9c24bf531f4162554433180d80526cb2983 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157518 Tested-by: Jenkins diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py index 40c4757406ab..101a5385fd4a 100644 --- a/uitest/libreoffice/connection.py +++ b/uitest/libreoffice/connection.py @@ -10,6 +10,7 @@ import time import traceback import uuid import os +import signal try: import pyuno @@ -20,6 +21,9 @@ except ImportError: print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc") raise +def signal_handler(signal_num, frame): +signal_name = signal.Signals(signal_num).name +print(f'Signal handler called with signal {signal_name} ({signal_num})', flush=True) class OfficeConnection: def __init__(self, args): @@ -33,6 +37,9 @@ class OfficeConnection: If the connection method is path the instance will be created as a new subprocess. If the connection method is connect the instance tries to connect to an existing instance with the specified socket string """ +signal.signal(signal.SIGCHLD, signal_handler) +signal.signal(signal.SIGPIPE, signal_handler) + (method, sep, rest) = self.args["--soffice"].partition(":") if sep != ":": raise Exception("soffice parameter does not specify method")
[Libreoffice-commits] core.git: include/oox oox/source
include/oox/ppt/presentationfragmenthandler.hxx |6 + oox/source/ppt/presentationfragmenthandler.cxx | 137 2 files changed, 80 insertions(+), 63 deletions(-) New commits: commit 9fabd7c11989c2a89c5bb238e6cb52b0a6678851 Author: Henry Castro AuthorDate: Thu Sep 28 14:23:55 2023 -0400 Commit: Henry Castro CommitDate: Tue Oct 3 21:48:00 2023 +0200 tdf#155512: oox: ppt: abstraction "importMasterSlide" Signed-off-by: Henry Castro Change-Id: Icfe8e3abbada7f728b2ad1f8e300a688f51d8f75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157386 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit 84ac58c37fffa0c8b6d55c70009515d013ad65b4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157468 Tested-by: Jenkins diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 7ac929ec555b..4685ea2d8316 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -38,6 +38,8 @@ namespace oox::core { class XmlFilterBase; } namespace oox::ppt { +class PowerPointImport; + class PresentationFragmentHandler final : public ::oox::core::FragmentHandler2 { public: @@ -50,6 +52,10 @@ private: void importSlide( const ::oox::core::FragmentHandlerRef& rSlideFragmentHandler, const oox::ppt::SlidePersistPtr& rPersist ); void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes); +oox::ppt::SlidePersistPtr importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, +::oox::ppt::PowerPointImport& rFilter, +const OUString& rLayoutFragmentPath, +const OUString& rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); void importCustomSlideShow(std::vector& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector& rSlidePersist); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 9b52b92d97d0..538d79df7f50 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -215,6 +215,79 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector& } } +SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const Reference& xModel, + PowerPointImport& rFilter, + const OUString& rLayoutFragmentPath, + const OUString& rMasterFragmentPath) +{ +SlidePersistPtr pMasterPersistPtr; +Reference< drawing::XDrawPage > xMasterPage; +Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); +Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); + +sal_Int32 nIndex; +if( rFilter.getMasterPages().empty() ) +{ +nIndex = 0; +xMasterPages->getByIndex( nIndex ) >>= xMasterPage; +} +else +{ +nIndex = xMasterPages->getCount(); +xMasterPage = xMasterPages->insertNewByIndex( nIndex ); +} + +pMasterPersistPtr = std::make_shared( rFilter, true, false, xMasterPage, + std::make_shared( Master, "com.sun.star.drawing.GroupShape" ), mpTextListStyle ); +pMasterPersistPtr->setLayoutPath( rLayoutFragmentPath ); +rFilter.getMasterPages().push_back( pMasterPersistPtr ); +rFilter.setActualSlidePersist( pMasterPersistPtr ); +FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, rMasterFragmentPath, pMasterPersistPtr, Master ) ); + +// set the correct theme +OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( u"theme" ); +if( !aThemeFragmentPath.isEmpty() ) +{ +std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() ); +std::map< OUString, oox::drawingml::ThemePtr >::iterator aIter2( rThemes.find( aThemeFragmentPath ) ); +if( aIter2 == rThemes.end() ) +{ +oox::drawingml::ThemePtr pThemePtr = std::make_shared(); +pMasterPersistPtr->setTheme( pThemePtr ); +Reference xDoc= +rFilter.importFragment(aThemeFragmentPath); + +auto pTheme = std::make_shared(); +pT
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - oox/source sd/qa
oox/source/ppt/presentationfragmenthandler.cxx | 116 + sd/qa/unit/export-tests-ooxml2.cxx |4 2 files changed, 66 insertions(+), 54 deletions(-) New commits: commit 08ed103d734ebf65202dc097c7bb0990573f8fd1 Author: Henry Castro AuthorDate: Thu Sep 28 15:01:43 2023 -0400 Commit: Caolán McNamara CommitDate: Tue Oct 3 11:32:22 2023 +0200 tdf#155512: oox: ppt: fix import master slides Import all master slides according to the relationship with slide layouts. Adjust unit test values: SdOOXMLExportTest2::testTdf106867 I do not know why those values change since importing embedded video source code was not touched SdOOXMLExportTest2::testAccentColor The accent6 is a constant value. Signed-off-by: Henry Castro Change-Id: Ic7c70d2c4ce30a7f2d2d1cf22604f1119a66f5f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157387 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index a0f13c83ae05..0ab32be82a21 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -204,72 +204,84 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const Reference xMasterPage; Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); +RelationsRef xMasterRelations = rFilter.importRelations( rMasterFragmentPath ); -sal_Int32 nIndex; -if( rFilter.getMasterPages().empty() ) +for (const auto& rEntry : *xMasterRelations) { -nIndex = 0; -xMasterPages->getByIndex( nIndex ) >>= xMasterPage; -} -else -{ -nIndex = xMasterPages->getCount(); -xMasterPage = xMasterPages->insertNewByIndex( nIndex ); -} +aLayoutFragmentPath = xMasterRelations->getFragmentPathFromRelation(rEntry.second); -pMasterPersistPtr = std::make_shared( rFilter, true, false, xMasterPage, - std::make_shared( Master, "com.sun.star.drawing.GroupShape" ), mpTextListStyle ); -pMasterPersistPtr->setLayoutPath( rLayoutFragmentPath ); -rFilter.getMasterPages().push_back( pMasterPersistPtr ); -rFilter.setActualSlidePersist( pMasterPersistPtr ); -FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, rMasterFragmentPath, pMasterPersistPtr, Master ) ); - -// set the correct theme -OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( u"theme" ); -if( !aThemeFragmentPath.isEmpty() ) -{ -std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() ); -std::map< OUString, oox::drawingml::ThemePtr >::iterator aIter2( rThemes.find( aThemeFragmentPath ) ); -if( aIter2 == rThemes.end() ) +sal_Int32 nIndex; +if( rFilter.getMasterPages().empty() ) { -oox::drawingml::ThemePtr pThemePtr = std::make_shared(); -pMasterPersistPtr->setTheme( pThemePtr ); -Reference xDoc= -rFilter.importFragment(aThemeFragmentPath); - -auto pTheme = std::make_shared(); -pThemePtr->setTheme(pTheme); - -rFilter.importFragment( -new ThemeFragmentHandler(rFilter, aThemeFragmentPath, *pThemePtr, *pTheme), -Reference( -xDoc, -UNO_QUERY_THROW)); -rThemes[ aThemeFragmentPath ] = pThemePtr; -pThemePtr->setFragment(xDoc); -saveThemeToGrabBag(pThemePtr, nIndex + 1); +nIndex = 0; +xMasterPages->getByIndex( nIndex ) >>= xMasterPage; } else { -pMasterPersistPtr->setTheme( (*aIter2).second ); +nIndex = xMasterPages->getCount(); +xMasterPage = xMasterPages->insertNewByIndex( nIndex ); } -} -importSlide( xMasterFragmentHandler, pMasterPersistPtr ); -rFilter.importFragment( new LayoutFragmentHandler( rFilter, rLayoutFragmentPath, pMasterPersistPtr ) ); -pMasterPersistPtr->createBackground( rFilter ); -pMasterPersistPtr->createXShapes( rFilter ); -oox::drawingml::ThemePtr pTheme = pMasterPersistPtr->getTheme(); -if (pTheme) -{ -pTheme->addTheme(pMasterPersistPtr->getPage()); +pMasterPersistPtr = std::make_shared( rFilter, true, false, xMasterPage, + std::make_shared( Master, "com.sun.star.drawing.GroupShape" )
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/oox oox/source
include/oox/ppt/presentationfragmenthandler.hxx |6 + oox/source/ppt/presentationfragmenthandler.cxx | 137 2 files changed, 80 insertions(+), 63 deletions(-) New commits: commit 84ac58c37fffa0c8b6d55c70009515d013ad65b4 Author: Henry Castro AuthorDate: Thu Sep 28 14:23:55 2023 -0400 Commit: Caolán McNamara CommitDate: Tue Oct 3 11:28:41 2023 +0200 tdf#155512: oox: ppt: abstraction "importMasterSlide" Signed-off-by: Henry Castro Change-Id: Icfe8e3abbada7f728b2ad1f8e300a688f51d8f75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157386 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 7ac929ec555b..4685ea2d8316 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -38,6 +38,8 @@ namespace oox::core { class XmlFilterBase; } namespace oox::ppt { +class PowerPointImport; + class PresentationFragmentHandler final : public ::oox::core::FragmentHandler2 { public: @@ -50,6 +52,10 @@ private: void importSlide( const ::oox::core::FragmentHandlerRef& rSlideFragmentHandler, const oox::ppt::SlidePersistPtr& rPersist ); void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes); +oox::ppt::SlidePersistPtr importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, +::oox::ppt::PowerPointImport& rFilter, +const OUString& rLayoutFragmentPath, +const OUString& rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); void importCustomSlideShow(std::vector& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector& rSlidePersist); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 5f35dbdfdb1c..a0f13c83ae05 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -199,6 +199,79 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector& } } +SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const Reference& xModel, + PowerPointImport& rFilter, + const OUString& rLayoutFragmentPath, + const OUString& rMasterFragmentPath) +{ +SlidePersistPtr pMasterPersistPtr; +Reference< drawing::XDrawPage > xMasterPage; +Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); +Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); + +sal_Int32 nIndex; +if( rFilter.getMasterPages().empty() ) +{ +nIndex = 0; +xMasterPages->getByIndex( nIndex ) >>= xMasterPage; +} +else +{ +nIndex = xMasterPages->getCount(); +xMasterPage = xMasterPages->insertNewByIndex( nIndex ); +} + +pMasterPersistPtr = std::make_shared( rFilter, true, false, xMasterPage, + std::make_shared( Master, "com.sun.star.drawing.GroupShape" ), mpTextListStyle ); +pMasterPersistPtr->setLayoutPath( rLayoutFragmentPath ); +rFilter.getMasterPages().push_back( pMasterPersistPtr ); +rFilter.setActualSlidePersist( pMasterPersistPtr ); +FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, rMasterFragmentPath, pMasterPersistPtr, Master ) ); + +// set the correct theme +OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( u"theme" ); +if( !aThemeFragmentPath.isEmpty() ) +{ +std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() ); +std::map< OUString, oox::drawingml::ThemePtr >::iterator aIter2( rThemes.find( aThemeFragmentPath ) ); +if( aIter2 == rThemes.end() ) +{ +oox::drawingml::ThemePtr pThemePtr = std::make_shared(); +pMasterPersistPtr->setTheme( pThemePtr ); +Reference xDoc= +rFilter.importFragment(aThemeFragmentPath); + +auto pTheme = std::make_shared(); +pThemePtr->setTheme(pTheme); + +rFilter.importFragment( +new ThemeFragmentHandler(rFilter, aThemeFragmentPath, *pThemePtr,
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - uui/inc
uui/inc/strings.hrc |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6a6d72658b6070a2a07ae7a21a2d92e305f6bebe Author: Henry Castro AuthorDate: Wed Sep 27 13:13:21 2023 -0400 Commit: Henry Castro CommitDate: Wed Sep 27 19:19:45 2023 +0200 sfx2: fix typo Signed-off-by: Henry Castro Change-Id: I73e4890c024a2ab74ea3d4141c63304c167ba4c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157337 diff --git a/uui/inc/strings.hrc b/uui/inc/strings.hrc index b6daff517f51..c78beb9efaba 100644 --- a/uui/inc/strings.hrc +++ b/uui/inc/strings.hrc @@ -78,6 +78,6 @@ #define STR_RELOADEDITABLE_TITLE NC_("STR_RELOADEDITABLE_TITLE", "Document is now editable") #define STR_RELOADEDITABLE_MSG NC_("STR_RELOADEDITABLE_MSG", "Document file '$(ARG1)' is now editable \n\nReload this document for editing?") #define STR_RELOADEDITABLE_BTN NC_("STR_RELOADEDITABLE_BTN", "~Reload") -#define STR_LOADREADONLY_MSGNC_("STR_LOADREADONLY_MSG", "The author would like you to open '$(ARG1)' as read-only unless you need to make changes. Open as read-only?.") +#define STR_LOADREADONLY_MSGNC_("STR_LOADREADONLY_MSG", "The author would like you to open '$(ARG1)' as read-only unless you need to make changes. Open as read-only?") /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - desktop/source
desktop/source/lib/init.cxx | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) New commits: commit 8041a8e725bcd803c32eb08a9d2600a38a006d73 Author: Henry Castro AuthorDate: Mon Sep 25 16:23:20 2023 -0400 Commit: Caolán McNamara CommitDate: Wed Sep 27 16:11:50 2023 +0200 lok: fix getting SID_DOC_READONLY slot property Unfortunately, the property is not always set when import XLSX documents. Signed-off-by: Henry Castro Change-Id: If501734704174b92b3589b61a019ba973592c331 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157259 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 817062ad55fa..5ad95cfd1632 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5954,19 +5954,9 @@ static char* getDocReadOnly(LibreOfficeKitDocument* pThis) if (!pObjectShell) return nullptr; -SfxMedium* pMedium = pObjectShell->GetMedium(); -if (!pMedium) -return nullptr; - -bool bDocReadOnly = false; -if (const SfxBoolItem* pReadOnlyItem = -SfxItemSet::GetItem(pMedium->GetItemSet(), - SID_DOC_READONLY, false)) -bDocReadOnly = pReadOnlyItem->GetValue(); - boost::property_tree::ptree aTree; aTree.put("commandName", ".uno:ReadOnly"); -aTree.put("success", bDocReadOnly); +aTree.put("success", pObjectShell->IsLoadReadonly()); std::stringstream aStream; boost::property_tree::write_json(aStream, aTree);
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/qa sfx2/source
sc/qa/uitest/calc_tests7/save_readonly_with_password.py |5 +++-- sc/qa/uitest/calc_tests8/tdf147086.py |3 ++- sc/qa/uitest/calc_tests9/tdf115933.py |3 ++- sc/qa/uitest/calc_tests9/tdf118938.py |3 ++- sc/qa/uitest/calc_tests9/tdf144996.py |6 +++--- sfx2/source/doc/objmisc.cxx |8 +++- 6 files changed, 19 insertions(+), 9 deletions(-) New commits: commit 861028593d7351d5ae8a0b8840ef8018b467f5de Author: Henry Castro AuthorDate: Mon Sep 18 17:05:56 2023 -0400 Commit: Henry Castro CommitDate: Thu Sep 21 16:03:19 2023 +0200 uitest: add "Silent" property parameter add option to not popup the read-only dialog when load and excel file. Signed-off-by: Henry Castro Change-Id: I5e0ac06e3e872f156f6150f4b8bead61e7986c25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157036 Tested-by: Jenkins CollaboraOffice diff --git a/sc/qa/uitest/calc_tests7/save_readonly_with_password.py b/sc/qa/uitest/calc_tests7/save_readonly_with_password.py index 02f125e3008f..0e4e75785bea 100644 --- a/sc/qa/uitest/calc_tests7/save_readonly_with_password.py +++ b/sc/qa/uitest/calc_tests7/save_readonly_with_password.py @@ -8,6 +8,7 @@ # from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues +from com.sun.star.beans import PropertyValue from org.libreoffice.unotest import systemPathToFileUrl from uitest.uihelper.common import select_by_text from tempfile import TemporaryDirectory @@ -48,7 +49,7 @@ class save_readonly_with_password(UITestCase): self.ui_test.wait_until_file_is_available(xFilePath) -with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document: +with self.ui_test.load_file(systemPathToFileUrl(xFilePath), [PropertyValue(Name="Silent", Value=True)]) as document: self.assertTrue(document.isReadonly()) @@ -84,7 +85,7 @@ class save_readonly_with_password(UITestCase): self.ui_test.wait_until_file_is_available(xFilePath) -with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document: +with self.ui_test.load_file(systemPathToFileUrl(xFilePath), [PropertyValue(Name="Silent", Value=True)]) as document: self.assertTrue(document.isReadonly()) diff --git a/sc/qa/uitest/calc_tests8/tdf147086.py b/sc/qa/uitest/calc_tests8/tdf147086.py index f594edb696f6..4decfa3dd3b3 100755 --- a/sc/qa/uitest/calc_tests8/tdf147086.py +++ b/sc/qa/uitest/calc_tests8/tdf147086.py @@ -8,6 +8,7 @@ # from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues +from com.sun.star.beans import PropertyValue from org.libreoffice.unotest import systemPathToFileUrl from uitest.uihelper.common import select_by_text from tempfile import TemporaryDirectory @@ -46,7 +47,7 @@ class tdf147086(UITestCase): self.ui_test.wait_until_file_is_available(xFilePath) -with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document: +with self.ui_test.load_file(systemPathToFileUrl(xFilePath), [PropertyValue(Name="Silent", Value=True)]) as document: self.assertTrue(document.isReadonly()) diff --git a/sc/qa/uitest/calc_tests9/tdf115933.py b/sc/qa/uitest/calc_tests9/tdf115933.py index 0fe7fec06758..128b80652e47 100644 --- a/sc/qa/uitest/calc_tests9/tdf115933.py +++ b/sc/qa/uitest/calc_tests9/tdf115933.py @@ -8,6 +8,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import get_url_for_data_file +from com.sun.star.beans import PropertyValue from libreoffice.uno.propertyvalue import mkPropertyValues #Bug 115933 - XLSX password protected with algorithmName, hashValue, saltValue and spinCount @@ -15,7 +16,7 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class tdf115933(UITestCase): def test_tdf115933(self): -with self.ui_test.load_file(get_url_for_data_file("tdf115933.xlsx")): +with self.ui_test.load_file(get_url_for_data_file("tdf115933.xlsx"), [PropertyValue(Name="Silent", Value=True)]): #The document was created in Excel. calcDoc = self.xUITest.getTopFocusWindow() gridwin = calcDoc.getChild("grid_window") diff --git a/sc/qa/uitest/calc_tests9/tdf118938.py b/sc/qa/uitest/calc_tests9/tdf118938.py index eede90451e67..33f8cde75d82 100644 --- a/sc/qa/uitest/calc_tests9/tdf118938.py +++ b/sc/qa/uitest/calc_tests9/tdf118938.py @@ -9,6 +9,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_url_for_data_file from libreoffice.uno.propertyvalue import mkPropertyValues +from com.sun.star.beans import PropertyValue #Bug 118938 - FILESAVE to Microsoft Excel 2007-2013 XML (.xlsx) fi
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/test sc/qa test/source
include/test/unoapi_test.hxx |2 ++ sc/qa/unit/subsequent_export_test2.cxx | 10 -- test/source/unoapi_test.cxx| 18 ++ 3 files changed, 28 insertions(+), 2 deletions(-) New commits: commit 14cb4f5e1a053000c32854f5ef63a08a96683dc8 Author: Henry Castro AuthorDate: Thu Sep 21 07:11:13 2023 -0400 Commit: Henry Castro CommitDate: Thu Sep 21 16:02:58 2023 +0200 sc: qa: add loadWithParams and SaveWithParams Add option to load and save with optional parameters. Signed-off-by: Henry Castro Change-Id: I2d735443da11634d072742f1bf6f38f90bced2c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157141 diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index f228f70e21ca..b234a5093956 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -36,12 +36,14 @@ public: OUString createFileURL(std::u16string_view aFileBase); OUString createFilePath(std::u16string_view aFileBase); void load(const OUString& rURL, const char* pPassword = nullptr); +void loadWithParams(const OUString& rURL, const css::uno::Sequence& rParams); OUString loadFromURL(std::u16string_view aFileBase, const char* pPassword = nullptr); css::uno::Any executeMacro(const OUString& rScriptURL, const css::uno::Sequence& rParams = {}); void save(const OUString& rFilter, const char* pPassword = nullptr); +void saveWithParams(const css::uno::Sequence& rParams); void saveAndReload(const OUString& rFilter, const char* pPassword = nullptr); std::unique_ptr parsePDFExport(const OString& rPassword = OString()); diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 938fb3a4f00f..4e384336c344 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -983,10 +984,15 @@ void ScExportTest2::testHyperlinkTargetFrameODS() void ScExportTest2::testOpenDocumentAsReadOnly() { -createScDoc("xlsx/open-as-read-only.xlsx"); +uno::Sequence aParams = {comphelper::makePropertyValue("Silent", true) }; + + loadWithParams(createFileURL(OUString::createFromAscii("xlsx/open-as-read-only.xlsx")), aParams); ScDocShell* pDocSh = getScDocShell(); CPPUNIT_ASSERT(pDocSh->IsSecurityOptOpenReadOnly()); -saveAndReload("Calc Office Open XML"); + +saveWithParams(uno::Sequence()); +loadWithParams(maTempFile.GetURL(), aParams); + pDocSh = getScDocShell(); CPPUNIT_ASSERT(pDocSh->IsSecurityOptOpenReadOnly()); } diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index e8198876537a..7a155694aeb8 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -121,6 +121,18 @@ void UnoApiTest::load(OUString const& rURL, const char* pPassword) } } +void UnoApiTest::loadWithParams(OUString const& rURL, const uno::Sequence& rParams) +{ +if (mxComponent.is()) +{ +mxComponent->dispose(); +mxComponent.clear(); +} + +mxComponent += loadFromDesktop(rURL, OUString(), rParams); +} + OUString UnoApiTest::loadFromURL(std::u16string_view aFileBase, const char* pPassword) { OUString aFileName = createFileURL(aFileBase); @@ -200,6 +212,12 @@ void UnoApiTest::save(const OUString& rFilter, const char* pPassword) } } +void UnoApiTest::saveWithParams(const uno::Sequence& rParams) +{ +css::uno::Reference xStorable(mxComponent, css::uno::UNO_QUERY_THROW); +xStorable->storeToURL(maTempFile.GetURL(), rParams); +} + void UnoApiTest::saveAndReload(const OUString& rFilter, const char* pPassword) { save(rFilter, pPassword);
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - uitest/uitest
uitest/uitest/test.py |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 4233b6c9833fc42c73c5f99d998ec4ee95bebd5b Author: Henry Castro AuthorDate: Wed Sep 20 07:44:43 2023 -0400 Commit: Henry Castro CommitDate: Thu Sep 21 16:02:35 2023 +0200 uitest: add load properties parameters Add the option to include the load properties when invoked load_file function. Signed-off-by: Henry Castro Change-Id: I27cb31e2470bc76bcc5b760661e50f00fc334d64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157102 diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index c07667cd621a..1d3ec2c39449 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -88,9 +88,9 @@ class UITest(object): return time.sleep(DEFAULT_SLEEP) -def load_component_from_url(self, url, eventName="OnLoad"): +def load_component_from_url(self, url, eventName="OnLoad", load_props=()): with EventListener(self._xContext, eventName) as event: -component = self.get_desktop().loadComponentFromURL(url, "_default", 0, tuple()) +component = self.get_desktop().loadComponentFromURL(url, "_default", 0, load_props) while True: if event.executed: frames = self.get_frames() @@ -101,9 +101,9 @@ class UITest(object): # Calls UITest.close_doc at exit @contextmanager -def load_file(self, url): +def load_file(self, url, load_props=()): try: -yield self.load_component_from_url(url) +yield self.load_component_from_url(url, "OnLoad", load_props) finally: self.close_doc()
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - uitest/libreoffice
uitest/libreoffice/connection.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) New commits: commit 681152d8f6c84708f8e8b31a5a99d3485f36b9a7 Author: Henry Castro AuthorDate: Thu Sep 21 07:55:26 2023 -0400 Commit: Henry Castro CommitDate: Thu Sep 21 16:02:10 2023 +0200 uitest: flush print messages Signed-off-by: Henry Castro Change-Id: I87098a438d476529aa25b6608408d07bbc98ce0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157145 diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py index 101a5385fd4a..e3b76b4baf44 100644 --- a/uitest/libreoffice/connection.py +++ b/uitest/libreoffice/connection.py @@ -16,9 +16,9 @@ try: import pyuno import uno except ImportError: -print("pyuno not found: try to set PYTHONPATH and URE_BOOTSTRAP variables") -print("PYTHONPATH=/installation/opt/program") -print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc") +print("pyuno not found: try to set PYTHONPATH and URE_BOOTSTRAP variables", flush=True) +print("PYTHONPATH=/installation/opt/program", flush=True) +print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc", flush=True) raise def signal_handler(signal_num, frame): @@ -104,7 +104,7 @@ class OfficeConnection: xUnoResolver = xLocalContext.ServiceManager.createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver", xLocalContext) url = "uno:" + socket + ";urp;StarOffice.ComponentContext" -print("OfficeConnection: connecting to: " + url) +print("OfficeConnection: connecting to: " + url, flush=True) while True: if self.soffice and self.soffice.poll() is not None: raise Exception("soffice has stopped.") @@ -113,7 +113,7 @@ class OfficeConnection: xContext = xUnoResolver.resolve(url) return xContext except pyuno.getClass("com.sun.star.connection.NoConnectException"): -print("NoConnectException: sleeping...") +print("NoConnectException: sleeping...", flush=True) time.sleep(1) def tearDown(self): @@ -126,17 +126,17 @@ class OfficeConnection: if self.soffice: if self.xContext: try: -print("tearDown: calling terminate()...") +print("tearDown: calling terminate()...", flush=True) xMgr = self.xContext.ServiceManager xDesktop = xMgr.createInstanceWithContext( "com.sun.star.frame.Desktop", self.xContext) xDesktop.terminate() -print("...done") +print("...done", flush=True) except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"): -print("caught while TearDown:\n", traceback.format_exc()) +print("caught while TearDown:\n", traceback.format_exc(), flush=True) pass # ignore, also means disposed except pyuno.getClass("com.sun.star.lang.DisposedException"): -print("caught while TearDown:\n", traceback.format_exc()) +print("caught while TearDown:\n", traceback.format_exc(), flush=True) pass # ignore else: self.soffice.terminate()
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - uitest/libreoffice
uitest/libreoffice/connection.py |7 +++ 1 file changed, 7 insertions(+) New commits: commit c66683be225ee709095178489ad766d8b18c4040 Author: Henry Castro AuthorDate: Thu Sep 21 07:40:36 2023 -0400 Commit: Henry Castro CommitDate: Thu Sep 21 16:01:43 2023 +0200 uitest: add signal_handler function install signal handler to analyze if the soffice bootstrap has some issues. Signed-off-by: Henry Castro Change-Id: I8b05b9c24bf531f4162554433180d80526cb2983 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157144 diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py index 40c4757406ab..101a5385fd4a 100644 --- a/uitest/libreoffice/connection.py +++ b/uitest/libreoffice/connection.py @@ -10,6 +10,7 @@ import time import traceback import uuid import os +import signal try: import pyuno @@ -20,6 +21,9 @@ except ImportError: print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc") raise +def signal_handler(signal_num, frame): +signal_name = signal.Signals(signal_num).name +print(f'Signal handler called with signal {signal_name} ({signal_num})', flush=True) class OfficeConnection: def __init__(self, args): @@ -33,6 +37,9 @@ class OfficeConnection: If the connection method is path the instance will be created as a new subprocess. If the connection method is connect the instance tries to connect to an existing instance with the specified socket string """ +signal.signal(signal.SIGCHLD, signal_handler) +signal.signal(signal.SIGPIPE, signal_handler) + (method, sep, rest) = self.args["--soffice"].partition(":") if sep != ":": raise Exception("soffice parameter does not specify method")
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - desktop/source
desktop/source/lib/init.cxx | 45 +++- 1 file changed, 44 insertions(+), 1 deletion(-) New commits: commit 34a952418da0411f24d98dd5f422dc58d602bd7e Author: Henry Castro AuthorDate: Fri Sep 8 14:23:33 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 15 16:12:11 2023 +0200 lok: add getter function to read "ReadOnly" flag Signed-off-by: Henry Castro Change-Id: Id9d2bc638d0f48cb33764b07fb8976b97117a621 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156621 Reviewed-by: Ashod Nakashian diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index e4d212b067b1..817062ad55fa 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5940,6 +5940,45 @@ static void addLocale(boost::property_tree::ptree& rValues, css::lang::Locale co rValues.push_back(std::make_pair("", aChild)); } +static char* getDocReadOnly(LibreOfficeKitDocument* pThis) +{ +LibLODocument_Impl* pDocument = static_cast(pThis); +if (!pDocument) +return nullptr; + +SfxBaseModel* pBaseModel = dynamic_cast(pDocument->mxComponent.get()); +if (!pBaseModel) +return nullptr; + +SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell(); +if (!pObjectShell) +return nullptr; + +SfxMedium* pMedium = pObjectShell->GetMedium(); +if (!pMedium) +return nullptr; + +bool bDocReadOnly = false; +if (const SfxBoolItem* pReadOnlyItem = +SfxItemSet::GetItem(pMedium->GetItemSet(), + SID_DOC_READONLY, false)) +bDocReadOnly = pReadOnlyItem->GetValue(); + +boost::property_tree::ptree aTree; +aTree.put("commandName", ".uno:ReadOnly"); +aTree.put("success", bDocReadOnly); + +std::stringstream aStream; +boost::property_tree::write_json(aStream, aTree); +char* pJson = static_cast(malloc(aStream.str().size() + 1)); +if (!pJson) +return nullptr; + +strcpy(pJson, aStream.str().c_str()); +pJson[aStream.str().size()] = '\0'; +return pJson; +} + static char* getLanguages(const char* pCommand) { css::uno::Sequence< css::lang::Locale > aLocales; @@ -6311,7 +6350,11 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo return nullptr; } -if (!strcmp(pCommand, ".uno:LanguageStatus")) +if (!strcmp(pCommand, ".uno:ReadOnly")) +{ +return getDocReadOnly(pThis); +} +else if (!strcmp(pCommand, ".uno:LanguageStatus")) { return getLanguages(pCommand); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sfx2/source
sfx2/source/doc/objmisc.cxx | 46 1 file changed, 46 insertions(+) New commits: commit 61458a1b2221efc217778dcf3fb5764ed75f1474 Author: Henry Castro AuthorDate: Wed Sep 6 10:30:27 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 15 16:07:07 2023 +0200 sfx2: invoke handler "LoadReadOnlyRequest" It will ask the user if open the Excel documents "read only" Signed-off-by: Henry Castro Change-Id: I909fb39709198e02496f8c522f477c077fb875e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156624 Reviewed-by: Ashod Nakashian diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 6b86e2163ccb..57698b41f82e 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -77,6 +77,7 @@ #include #include #include +#include #include #include @@ -1093,6 +1094,51 @@ void SfxObjectShell::FinishedLoading( SfxLoadedFlags nFlags ) bHasName = true; // the document is loaded, so the name should already available GetTitle( SFX_TITLE_DETECT ); InitOwnModel_Impl(); + +if (IsLoadReadonly()) +{ +OUString aFilterName; +if (const SfxStringItem* pFilterNameItem = +SfxItemSet::GetItem(pMedium->GetItemSet(), + SID_FILTER_NAME, false)) +aFilterName = pFilterNameItem->GetValue(); + +OUString aFileName; +if (const SfxStringItem* pFileNameItem = +SfxItemSet::GetItem(pMedium->GetItemSet(), + SID_FILE_NAME, false)) +{ +const INetURLObject aURL( pFileNameItem->GetValue() ); +aFileName = aURL.getBase(INetURLObject::LAST_SEGMENT, true, + INetURLObject::DecodeMechanism::WithCharset); +} + +if (aFilterName.indexOf("Excel") != -1) +{ +Reference xHandler(pMedium->GetInteractionHandler()); +if (xHandler.is()) +{ +beans::NamedValue aLoadReadOnlyRequest; +aLoadReadOnlyRequest.Name = "LoadReadOnlyRequest"; +aLoadReadOnlyRequest.Value <<= aFileName; + +Any aRequest(aLoadReadOnlyRequest); +rtl::Reference xRequest += new ucbhelper::SimpleInteractionRequest(aRequest, + ContinuationFlags::Approve | + ContinuationFlags::Disapprove); + +xHandler->handle(xRequest); + +if (xRequest->getResponse() == ContinuationFlags::Disapprove) +{ +SetSecurityOptOpenReadOnly(false); + pMedium->GetItemSet()->Put(SfxBoolItem(SID_DOC_READONLY, false)); +} +} +} +} + pImpl->nFlagsInProgress &= ~SfxLoadedFlags::MAINDOCUMENT; }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - desktop/source uui/source
desktop/source/lib/lokinteractionhandler.cxx | 24 desktop/source/lib/lokinteractionhandler.hxx |2 ++ uui/source/iahndl-errorhandler.cxx |1 - 3 files changed, 26 insertions(+), 1 deletion(-) New commits: commit 7cbe8dda1c45ed770194e820c542b237c5b8aae0 Author: Henry Castro AuthorDate: Wed Sep 6 10:28:59 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 15 16:06:30 2023 +0200 lok: implement "handleLoadReadOnlyRequest" Is used for interaction handle to query user decision regarding to open the document read only. Signed-off-by: Henry Castro Change-Id: Ia945eae7b1627d57d6211ae92a784d50313c2627 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156623 Reviewed-by: Ashod Nakashian diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx index 09ee2aaa9f90..8495ac2c8179 100644 --- a/desktop/source/lib/lokinteractionhandler.cxx +++ b/desktop/source/lib/lokinteractionhandler.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -350,6 +351,26 @@ bool LOKInteractionHandler::handleMacroConfirmationRequest(const uno::Reference< return false; } +bool LOKInteractionHandler::handleLoadReadOnlyRequest(const uno::Reference& xRequest) +{ +uno::Any const request(xRequest->getRequest()); + +OUString aFileName; +beans::NamedValue aLoadReadOnlyRequest; +if ((request >>= aLoadReadOnlyRequest) && +aLoadReadOnlyRequest.Name == "LoadReadOnlyRequest" && +(aLoadReadOnlyRequest.Value >>= aFileName)) +{ +auto xInteraction(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), nullptr)); + +if (xInteraction.is()) +xInteraction->handleInteractionRequest(xRequest); + +return true; +} +return false; +} + bool LOKInteractionHandler::handleFilterOptionsRequest(const uno::Reference& xRequest) { document::FilterOptionsRequest aFilterOptionsRequest; @@ -389,6 +410,9 @@ sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest( if (handleMacroConfirmationRequest(xRequest)) return true; +if (handleLoadReadOnlyRequest(xRequest)) +return true; + // TODO: perform more interactions 'for real' like the above selectApproved(rContinuations); diff --git a/desktop/source/lib/lokinteractionhandler.hxx b/desktop/source/lib/lokinteractionhandler.hxx index 5c6c6f87de6d..f92b88cf11f9 100644 --- a/desktop/source/lib/lokinteractionhandler.hxx +++ b/desktop/source/lib/lokinteractionhandler.hxx @@ -78,6 +78,8 @@ private: static bool handleFilterOptionsRequest(const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& Request); +static bool handleLoadReadOnlyRequest(const css::uno::Reference& xRequest); + public: void SetPassword(char const* pPassword); diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index 5e758da9515c..765e7d077182 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -94,7 +94,6 @@ executeErrorDialog( break; } - switch (nButtonMask) { case MessageBoxStyle::NONE:
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - uui/inc uui/source
uui/inc/strings.hrc|1 uui/source/iahndl-errorhandler.cxx | 39 + uui/source/iahndl.cxx | 11 ++ uui/source/iahndl.hxx |5 4 files changed, 56 insertions(+) New commits: commit 81fa0ab10b9acabe9b7f8ce9a8d7b1c0765bfdfc Author: Henry Castro AuthorDate: Wed Sep 6 10:27:12 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 15 16:06:03 2023 +0200 uui: implement "handleLoadReadOnlyRequest" Is used for interaction handle to query user decision regarding to open the document read only. Signed-off-by: Henry Castro Change-Id: Ia6792ca540b5c62f4c9de8a5793ef45de3740484 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156622 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian diff --git a/uui/inc/strings.hrc b/uui/inc/strings.hrc index 98bd94ef8484..b6daff517f51 100644 --- a/uui/inc/strings.hrc +++ b/uui/inc/strings.hrc @@ -78,5 +78,6 @@ #define STR_RELOADEDITABLE_TITLE NC_("STR_RELOADEDITABLE_TITLE", "Document is now editable") #define STR_RELOADEDITABLE_MSG NC_("STR_RELOADEDITABLE_MSG", "Document file '$(ARG1)' is now editable \n\nReload this document for editing?") #define STR_RELOADEDITABLE_BTN NC_("STR_RELOADEDITABLE_BTN", "~Reload") +#define STR_LOADREADONLY_MSGNC_("STR_LOADREADONLY_MSG", "The author would like you to open '$(ARG1)' as read-only unless you need to make changes. Open as read-only?.") /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index c03d518108f3..5e758da9515c 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -33,6 +33,7 @@ #include #include +#include #include "getcontinuations.hxx" #include "iahndl.hxx" @@ -290,4 +291,42 @@ UUIInteractionHelper::handleErrorHandlerRequest( } } +void +UUIInteractionHelper::handleLoadReadOnlyRequest( +const OUString& sDocumentURL, +uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & +rContinuations) +{ +std::locale aLocale(Translate::Create("uui")); +std::vector aArguments = { sDocumentURL }; +uno::Reference xRetry; +uno::Reference xAbort; +uno::Reference xApprove; +uno::Reference xDisapprove; +uno::Reference xParent = getParentXWindow(); +OUString aMessage(Translate::get(STR_LOADREADONLY_MSG, aLocale)); + +aMessage = replaceMessageWithArguments(aMessage, aArguments); +getContinuations(rContinuations, , , , ); + +std::unique_ptr xBox( +Application::CreateMessageDialog(Application::GetFrameWeld(xParent), + VclMessageType::Question, + VclButtonsType::YesNo, + aMessage, + GetpApp())); + +if (xBox->run() == RET_YES) +{ +if (xApprove.is()) +xApprove->select(); +} +else +{ +if (xDisapprove.is()) +xDisapprove->select(); +} +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index ce5dfffa88db..7bd3fb7104d4 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -813,6 +813,17 @@ UUIInteractionHelper::handleRequest_impl( return true; } +OUString aFileName; +beans::NamedValue aLoadReadOnlyRequest; +if ((aAnyRequest >>= aLoadReadOnlyRequest) && +aLoadReadOnlyRequest.Name == "LoadReadOnlyRequest" && +(aLoadReadOnlyRequest.Value >>= aFileName)) +{ +handleLoadReadOnlyRequest(aFileName, + rRequest->getContinuations()); +return true; +} + // Last chance: interaction handlers registered in the configuration diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 78d283d6bf0e..cf468f57dbcf 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -238,6 +238,11 @@ private: const OUString & instructions, const OUString & url, css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations ); + +void +handleLoadReadOnlyRequest( +const OUString& sDocumentURL, +css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations); }; class ErrorResource
[Libreoffice-commits] core.git: Changes to 'refs/tags/mimo-7.3.7.2.M6'
Tag 'mimo-7.3.7.2.M6' created by Aron Budea at 2023-09-06 02:14 + mimo-7.3.7.2.M6 Changes since mimo-7.3.7.2.M5-10: --- 0 files changed ---
[Libreoffice-commits] core.git: Branch 'distro/mimo/mimo-7-2' - 4 commits - connectivity/source dbaccess/source include/connectivity include/svx svx/source
connectivity/source/parse/sqliterator.cxx |4 connectivity/source/parse/sqlnode.cxx |7 +-- dbaccess/source/core/api/SingleSelectQueryComposer.cxx |2 +- dbaccess/source/core/inc/SingleSelectQueryComposer.hxx |1 + include/connectivity/sqlparse.hxx | 10 +++--- include/svx/ParseContext.hxx | 11 +-- svx/source/form/ParseContext.cxx | 17 + 7 files changed, 44 insertions(+), 8 deletions(-) New commits: commit 17186d0da18c54b4ad9aea05a2643fb95a125a4f Author: Henry Castro AuthorDate: Wed Aug 30 10:25:51 2023 -0400 Commit: Aron Budea CommitDate: Sat Sep 2 02:09:09 2023 +0200 connectiviy: fix to detect column data type if Base SQL query: SELECT COUNT("test"."id") from Test If changed to Spanish UI, detect the column type from a neutral context parser. Signed-off-by: Henry Castro Change-Id: I1faa8ff8417a0fc4996b289bd2ce0baad52fc00c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156298 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit 0d579a1b8122eed6348ee4a512573277e2d5db77) (cherry picked from commit 29aeafb25efcba6c3dab3b7842f383fcb0eab700) diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 94df96d39628..7478300c4e3f 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -2101,7 +2101,11 @@ sal_Int32 OSQLParseTreeIterator::getFunctionReturnType(const OSQLParseNode* _pNo nType = DataType::DOUBLE; } else +{ nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, _rParser.getContext() ); +if (nType == DataType::SQLNULL) +nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, m_rParser.getNeutral() ); +} } return nType; commit 06e4d7d2ad6b9343603f33d740bf3b30432dc483 Author: Henry Castro AuthorDate: Wed Aug 30 10:23:31 2023 -0400 Commit: Aron Budea CommitDate: Sat Sep 2 02:08:59 2023 +0200 connectivity: add neutral context parser Signed-off-by: Henry Castro Change-Id: I12b0fe811d141873aaa64af5b6c457051c3356b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156297 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit 57379b62950d5730cdd0ec2b14eaf55370a3298e) (cherry picked from commit c22c356cc1b7c08313a46a8269f4f43eb76ecf75) diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 0321f827a8e7..7c8f1ea8da2b 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1316,8 +1316,11 @@ std::unique_ptr OSQLParser::predicateTree(OUString& rErrorMessage } -OSQLParser::OSQLParser(const css::uno::Reference< css::uno::XComponentContext >& rxContext, const IParseContext* _pContext) +OSQLParser::OSQLParser(const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const IParseContext* _pContext, + const IParseContext* _pNeutral) :m_pContext(_pContext) +,m_pNeutral(_pNeutral) ,m_pData( new OSQLParser_Data ) ,m_nFormatKey(0) ,m_nDateFormatKey(0) diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 2284f1db3e3f..31a78012f0f0 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -216,7 +216,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc const Reference& _rContext ) :OSubComponent(m_aMutex,_xConnection) ,OPropertyContainer(m_aBHelper) -,m_aSqlParser( _rContext, _aParseContext ) +,m_aSqlParser( _rContext, _aParseContext, _aNeutralContext ) ,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aElementaryParts( size_t(SQLPartCount) ) diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx index 356d00aafdb0..2366d3c39943 100644 --- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx +++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx @@ -76,6 +76,7 @@ namespace dbaccess typedef std::function TGetParseNode; ::svxform::OSystemParseContext m_aParseContext; +::svxform::ONeutralParseContext m_aNeutralContext; ::connectivity::OSQLParser m_aSqlParser; ::connectivity::OSQLParseTree
[Libreoffice-commits] core.git: Branch 'distro/mimo/mimo-7-3' - 4 commits - connectivity/source dbaccess/source include/connectivity include/svx svx/source
connectivity/source/parse/sqliterator.cxx |4 connectivity/source/parse/sqlnode.cxx |7 +-- dbaccess/source/core/api/SingleSelectQueryComposer.cxx |2 +- dbaccess/source/core/inc/SingleSelectQueryComposer.hxx |1 + include/connectivity/sqlparse.hxx | 10 +++--- include/svx/ParseContext.hxx | 11 +-- svx/source/form/ParseContext.cxx | 16 7 files changed, 43 insertions(+), 8 deletions(-) New commits: commit 29aeafb25efcba6c3dab3b7842f383fcb0eab700 Author: Henry Castro AuthorDate: Wed Aug 30 10:25:51 2023 -0400 Commit: Aron Budea CommitDate: Fri Sep 1 23:21:01 2023 +0200 connectiviy: fix to detect column data type if Base SQL query: SELECT COUNT("test"."id") from Test If changed to Spanish UI, detect the column type from a neutral context parser. Signed-off-by: Henry Castro Change-Id: I1faa8ff8417a0fc4996b289bd2ce0baad52fc00c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156298 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit 0d579a1b8122eed6348ee4a512573277e2d5db77) diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 662a000870b7..c9733477b2bf 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -2108,7 +2108,11 @@ sal_Int32 OSQLParseTreeIterator::getFunctionReturnType(const OSQLParseNode* _pNo nType = DataType::DOUBLE; } else +{ nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, _rParser.getContext() ); +if (nType == DataType::SQLNULL) +nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, m_rParser.getNeutral() ); +} } return nType; commit c22c356cc1b7c08313a46a8269f4f43eb76ecf75 Author: Henry Castro AuthorDate: Wed Aug 30 10:23:31 2023 -0400 Commit: Aron Budea CommitDate: Fri Sep 1 23:20:31 2023 +0200 connectivity: add neutral context parser Signed-off-by: Henry Castro Change-Id: I12b0fe811d141873aaa64af5b6c457051c3356b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156297 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit 57379b62950d5730cdd0ec2b14eaf55370a3298e) diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 947c1ef49580..e2b1daddde9e 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1316,8 +1316,11 @@ std::unique_ptr OSQLParser::predicateTree(OUString& rErrorMessage } -OSQLParser::OSQLParser(const css::uno::Reference< css::uno::XComponentContext >& rxContext, const IParseContext* _pContext) +OSQLParser::OSQLParser(const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const IParseContext* _pContext, + const IParseContext* _pNeutral) :m_pContext(_pContext) +,m_pNeutral(_pNeutral) ,m_pData( new OSQLParser_Data ) ,m_nFormatKey(0) ,m_nDateFormatKey(0) diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 401d2dcf4fb9..6af7d64c0af9 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -216,7 +216,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc const Reference& _rContext ) :OSubComponent(m_aMutex,_xConnection) ,OPropertyContainer(m_aBHelper) -,m_aSqlParser( _rContext, _aParseContext ) +,m_aSqlParser( _rContext, _aParseContext, _aNeutralContext ) ,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aElementaryParts( size_t(SQLPartCount) ) diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx index a0edfd195a69..fdde2d451d17 100644 --- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx +++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx @@ -76,6 +76,7 @@ namespace dbaccess typedef std::function TGetParseNode; ::svxform::OSystemParseContext m_aParseContext; +::svxform::ONeutralParseContext m_aNeutralContext; ::connectivity::OSQLParser m_aSqlParser; ::connectivity::OSQLParseTreeIterator m_aSqlIterator; // the iterator for the complete statement ::connectivity::OSQLParseTreeIterator m_aAdditiveIterat
[Libreoffice-commits] core.git: 2 commits - connectivity/source dbaccess/source include/connectivity
connectivity/source/parse/sqliterator.cxx |4 connectivity/source/parse/sqlnode.cxx |5 - dbaccess/source/core/api/SingleSelectQueryComposer.cxx |2 +- dbaccess/source/core/inc/SingleSelectQueryComposer.hxx |1 + include/connectivity/sqlparse.hxx | 10 +++--- 5 files changed, 17 insertions(+), 5 deletions(-) New commits: commit 6896c46567c571a7ae6eb60268de962e3d4ae8bb Author: Henry Castro AuthorDate: Wed Aug 30 10:25:51 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 1 21:39:57 2023 +0200 connectiviy: fix to detect column data type if Base SQL query: SELECT COUNT("test"."id") from Test If changed to Spanish UI, detect the column type from a neutral context parser. Signed-off-by: Henry Castro Change-Id: I1faa8ff8417a0fc4996b289bd2ce0baad52fc00c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156298 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156425 Tested-by: Jenkins diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 1a205953f7aa..683391f66f6a 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -2109,7 +2109,11 @@ sal_Int32 OSQLParseTreeIterator::getFunctionReturnType(const OSQLParseNode* _pNo nType = DataType::DOUBLE; } else +{ nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, _rParser.getContext() ); +if (nType == DataType::SQLNULL) +nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, m_rParser.getNeutral() ); +} } return nType; commit 3d910abdaa18bbd237834f412675ab25d90836bc Author: Henry Castro AuthorDate: Wed Aug 30 10:23:31 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 1 21:39:46 2023 +0200 connectivity: add neutral context parser Signed-off-by: Henry Castro Change-Id: I12b0fe811d141873aaa64af5b6c457051c3356b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156297 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156424 Tested-by: Jenkins diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 782a45bf760f..7e01770d386d 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1306,8 +1306,11 @@ std::unique_ptr OSQLParser::predicateTree(OUString& rErrorMessage } -OSQLParser::OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext, const IParseContext* _pContext) +OSQLParser::OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext, + const IParseContext* _pContext, + const IParseContext* _pNeutral) :m_pContext(_pContext) +,m_pNeutral(_pNeutral) ,m_pData( new OSQLParser_Data ) ,m_nFormatKey(0) ,m_nDateFormatKey(0) diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 4e37188e7231..895657475f25 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -217,7 +217,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc const Reference& _rContext ) :OSubComponent(m_aMutex,_xConnection) ,OPropertyContainer(m_aBHelper) -,m_aSqlParser( _rContext, _aParseContext ) +,m_aSqlParser( _rContext, _aParseContext, _aNeutralContext ) ,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aElementaryParts( size_t(SQLPartCount) ) diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx index a0edfd195a69..fdde2d451d17 100644 --- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx +++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx @@ -76,6 +76,7 @@ namespace dbaccess typedef std::function TGetParseNode; ::svxform::OSystemParseContext m_aParseContext; +::svxform::ONeutralParseContext m_aNeutralContext; ::connectivity::OSQLParser m_aSqlParser; ::connectivity::OSQLParseTreeIterator m_aSqlIterator; // the iterator for the complete statement ::connectivity::OSQLParseTreeIterator m_aAdditiveIterator;// the iterator for the "additive statement" (means without the clauses of the elementary statement) diff --git a/include/connectiv
[Libreoffice-commits] core.git: include/svx svx/source
include/svx/ParseContext.hxx | 11 +-- svx/source/form/ParseContext.cxx | 16 2 files changed, 25 insertions(+), 2 deletions(-) New commits: commit 47d77c822fb58f9617379969b078c8a6230767d6 Author: Henry Castro AuthorDate: Wed Aug 30 10:16:37 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 1 19:09:28 2023 +0200 svx: add class "ONeutralParseContext" If Base SQL query: SELECT COUNT("test"."id") FROM Test Then changed to Spanish interface, it is required to have a neutral keyword localized, the "COUNT" will fail to detect column type, because the keyword in Spanish is "RECUENTO" Signed-off-by: Henry Castro Change-Id: I191b9591ad796d0dd9509c0fb10b11c16f72e1ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156296 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156423 Tested-by: Jenkins diff --git a/include/svx/ParseContext.hxx b/include/svx/ParseContext.hxx index 4b8f451a8014..b5b8b7c84ea6 100644 --- a/include/svx/ParseContext.hxx +++ b/include/svx/ParseContext.hxx @@ -31,11 +31,12 @@ namespace svxform //= OSystemParseContext -class SAL_DLLPUBLIC_RTTI OSystemParseContext final : public ::connectivity::IParseContext +class SAL_DLLPUBLIC_RTTI OSystemParseContext : public ::connectivity::IParseContext { -private: +protected: ::std::vector< OUString > m_aLocalizedKeywords; +OSystemParseContext(bool bInit); public: SVXCORE_DLLPUBLIC OSystemParseContext(); @@ -57,6 +58,12 @@ namespace svxform }; +class SAL_DLLPUBLIC_RTTI ONeutralParseContext final : public OSystemParseContext +{ +public: +SVXCORE_DLLPUBLIC ONeutralParseContext(); +SVXCORE_DLLPUBLIC virtual ~ONeutralParseContext(); +}; //= OParseContextClient diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx index 63634179142e..d231bfb3cd52 100644 --- a/svx/source/form/ParseContext.cxx +++ b/svx/source/form/ParseContext.cxx @@ -41,6 +41,11 @@ OSystemParseContext::OSystemParseContext() m_aLocalizedKeywords.push_back(SvxResId(RID_RSC_SQL_INTERNATIONAL[i])); } +OSystemParseContext::OSystemParseContext(bool /*bInit*/) +: IParseContext() +{ +} + OSystemParseContext::~OSystemParseContext() { } @@ -140,6 +145,17 @@ IParseContext::InternationalKeyCode OSystemParseContext::getIntlKeyCode(const OS return InternationalKeyCode::None; } +ONeutralParseContext::ONeutralParseContext() +: OSystemParseContext(false) +{ +std::locale aLocale = Translate::Create("svx", LanguageTag("en-US")); +for (size_t i = 0; i < SAL_N_ELEMENTS(RID_RSC_SQL_INTERNATIONAL); ++i) + m_aLocalizedKeywords.push_back(Translate::get(RID_RSC_SQL_INTERNATIONAL[i], aLocale)); +} + +ONeutralParseContext::~ONeutralParseContext() +{ +} namespace {
[Libreoffice-commits] core.git: connectivity/source
connectivity/source/parse/sqlnode.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 50f36b75cee6591a00102c6e9fa71ba91df5bbd8 Author: Henry Castro AuthorDate: Wed Aug 30 10:09:05 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 1 19:09:12 2023 +0200 connectivity: fix return column type "DataType::SQLNULL" The Base SQL query: SELECT COUNT( "Test"."id" ) FROM "Test" And the UI language is set to Spanish, the function "getFunctionReturnType" returns misleading column type. Signed-off-by: Henry Castro Change-Id: I2b57d1dfc005711374d7ae0de66b412f4f551d89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156295 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156422 Tested-by: Jenkins diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 1153a216cffd..782a45bf760f 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -2493,7 +2493,7 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, const SQLParseNodeParamet sal_Int32 OSQLParser::getFunctionReturnType(std::u16string_view _sFunctionName, const IParseContext* pContext) { -sal_Int32 nType = DataType::VARCHAR; +sal_Int32 nType = DataType::SQLNULL; OString sFunctionName(OUStringToOString(_sFunctionName,RTL_TEXTENCODING_UTF8)); if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ASCII,pContext))) nType = DataType::INTEGER;
[Libreoffice-commits] core.git: sc/source
sc/source/ui/app/inputhdl.cxx |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit 964fe83ec0ce36dab611c7e1cf22af7c8cce5860 Author: Henry Castro AuthorDate: Thu Aug 10 15:14:18 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 1 18:10:16 2023 +0200 tdf#155799: lok: sc: fix extend reference mark In the tiled rendering case, the server sends a reference coordinates to client side, so extend the range end point reference if merged cells. Signed-off-by: Henry Castro Change-Id: Ie9611aea3f6645a6cf45514939ae6364afac0b1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155564 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156417 Tested-by: Jenkins diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 1267509d4e5f..4a728f54874d 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -494,10 +494,15 @@ ReferenceMark ScInputHandler::GetReferenceMark( const ScViewData& rViewData, ScD { SCCOL nCol1 = nX1, nCol2 = nX2; SCROW nRow1 = nY1, nRow2 = nY2; +ScDocument& rDoc = pDocSh->GetDocument(); + PutInOrder(nCol1, nCol2); PutInOrder(nRow1, nRow2); + if (nCol1 == nCol2 && nRow1 == nRow2) -pDocSh->GetDocument().ExtendMerge(nCol1, nRow1, nCol2, nRow2, nTab); +rDoc.ExtendMerge(nCol1, nRow1, nCol2, nRow2, nTab); +else if (rDoc.HasAttrib(nCol2, nRow2, nTab, HasAttrFlags::Merged)) +rDoc.ExtendMerge(nCol2, nRow2, nCol2, nRow2, nTab); Point aTopLeft = rViewData.GetPrintTwipsPos(nCol1, nRow1); Point aBottomRight = rViewData.GetPrintTwipsPos(nCol2 + 1, nRow2 + 1);
[Libreoffice-commits] core.git: 2 commits - sc/source
sc/source/filter/inc/rtfexp.hxx |5 ++ sc/source/filter/rtf/rtfexp.cxx | 75 2 files changed, 80 insertions(+) New commits: commit cb72f56977faccbda9490bc16ea3cbf7a22c01b0 Author: Henry Castro AuthorDate: Tue Jul 25 15:36:52 2023 -0400 Commit: Caolán McNamara CommitDate: Fri Sep 1 16:19:48 2023 +0200 sc: filter: rtf: add method "WriteFontTable" Write the font table while visiting column/row and get the unique index to reference it. "The \fonttbl control word introduces the font table group. Unique \fN control words define each font available in the document, and are used to reference that font throughout the document." Signed-off-by: Henry Castro Change-Id: I20c5d1128972f5ec9b9b2e246f466bdb173ef8a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154906 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156415 Tested-by: Jenkins diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx index 1c9f1bd7a4af..9d0b204540c7 100644 --- a/sc/source/filter/inc/rtfexp.hxx +++ b/sc/source/filter/inc/rtfexp.hxx @@ -28,12 +28,14 @@ class ScRTFExport : public ScExportBase { std::unique_ptr m_pCellX; // cumulative range in a table std::map m_pFontTable; +SvMemoryStream m_aFontStrm; SvMemoryStream m_aDocStrm; int AddFont( const SvxFontItem& rFontItem ); voidWriteTab( SCTAB nTab ); voidWriteRow( SCTAB nTab, SCROW nRow ); voidWriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol ); +voidWriteFontTable(const SvxFontItem& rFontItem, int nIndex); public: diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx index 8d38def244b3..7349aa698591 100644 --- a/sc/source/filter/rtf/rtfexp.cxx +++ b/sc/source/filter/rtf/rtfexp.cxx @@ -19,6 +19,9 @@ #include +#include +#include + #include #include #include @@ -60,6 +63,8 @@ void ScRTFExport::Write() rStrm.WriteChar( '{' ).WriteOString( OOO_STRING_SVTOOLS_RTF_RTF ); rStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_ANSI ).WriteOString( SAL_NEWLINE_STRING ); +m_aFontStrm.WriteChar( '{' ).WriteOString( OOO_STRING_SVTOOLS_RTF_FONTTBL ); + // Data for ( SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab(); nTab++ ) { @@ -68,6 +73,9 @@ void ScRTFExport::Write() WriteTab( nTab ); } +m_aFontStrm.WriteChar( '}' ); +m_aFontStrm.Seek(0); +rStrm.WriteStream(m_aFontStrm); m_aDocStrm.Seek(0); rStrm.WriteStream(m_aDocStrm); rStrm.WriteChar( '}' ).WriteOString( SAL_NEWLINE_STRING ); @@ -148,6 +156,51 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow ) m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_ROW ).WriteOString( SAL_NEWLINE_STRING ); } +void ScRTFExport::WriteFontTable(const SvxFontItem& rFontItem, int nIndex) +{ +m_aFontStrm.WriteChar( '{' ); +m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_F ); +m_aFontStrm.WriteOString( OString::number(nIndex) ); + +FontFamily eFamily = rFontItem.GetFamily(); +if (eFamily == FAMILY_DONTKNOW) +m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FNIL ); +else if (eFamily == FAMILY_DECORATIVE) +m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FDECOR ); +else if (eFamily == FAMILY_MODERN) +m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FMODERN ); +else if (eFamily == FAMILY_ROMAN) +m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FROMAN ); +else if (eFamily == FAMILY_SCRIPT) +m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FSCRIPT ); +else if (eFamily == FAMILY_SWISS) +m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FSWISS ); + +m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FPRQ ); + +sal_uInt16 nVal = 0; +FontPitch ePitch = rFontItem.GetPitch(); +if ( ePitch == PITCH_FIXED ) +nVal = 1; +else if ( ePitch == PITCH_VARIABLE ) +nVal = 2; +m_aFontStrm.WriteOString( OString::number(nVal) ); + +rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252; +rtl_TextEncoding eChrSet = rFontItem.GetCharSet(); +if (IsOpenSymbol(rFontItem.GetFamilyName())) +eChrSet = RTL_TEXTENCODING_UTF8; +else if( RTL_TEXTENCODING_DONTKNOW == eChrSet ) +eChrSet = osl_getThreadTextEncoding(); + +m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FCHARSET ); +m_aFontStrm.WriteOString( OString::number(rtl_getBestWindowsCharsetFromTextEncoding( eChrSet )) ); + +m_aFontStrm.WriteChar( ' ' ); +RTFOutFuncs::Out_String( m_aFontStrm, rFontItem.GetFamilyName(), eDestEnc ); +m_aFontStrm.WriteOString( ";}" ); +} + int ScRTFExport::AddFont(const SvxFontItem& rFontItem) { auto nRet = m_pFontTable.siz
[Libreoffice-commits] core.git: 2 commits - sc/source
sc/source/filter/inc/rtfexp.hxx |3 +- sc/source/filter/rtf/rtfexp.cxx | 58 2 files changed, 32 insertions(+), 29 deletions(-) New commits: commit 18e8c72d680b91da730dd8bb7c26c60b954ee074 Author: Henry Castro AuthorDate: Tue Jul 25 15:28:39 2023 -0400 Commit: Caolán McNamara CommitDate: Fri Sep 1 16:19:27 2023 +0200 sc: filter: rtf: prefix m_* private members Signed-off-by: Henry Castro Change-Id: If8389b6e63a90616131d0dd9fbb5a7b8b96ffe3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154904 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156413 Tested-by: Caolán McNamara diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx index 9a4fe43d9d02..14ee8ec023f7 100644 --- a/sc/source/filter/inc/rtfexp.hxx +++ b/sc/source/filter/inc/rtfexp.hxx @@ -25,7 +25,7 @@ class ScRTFExport : public ScExportBase { -std::unique_ptr pCellX; // cumulative range in a table +std::unique_ptr m_pCellX; // cumulative range in a table SvMemoryStream m_aDocStrm; voidWriteTab( SCTAB nTab ); diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx index 5cef70300617..99336e6f022c 100644 --- a/sc/source/filter/rtf/rtfexp.cxx +++ b/sc/source/filter/rtf/rtfexp.cxx @@ -46,7 +46,7 @@ void ScFormatFilterPluginImpl::ScExportRTF( SvStream& rStrm, ScDocument* pDoc, ScRTFExport::ScRTFExport( SvStream& rStrmP, ScDocument* pDocP, const ScRange& rRangeP ) : ScExportBase( rStrmP, pDocP, rRangeP ), -pCellX( new sal_uLong[ pDoc->MaxCol()+2 ] ) +m_pCellX( new sal_uLong[ pDoc->MaxCol()+2 ] ) { } @@ -77,12 +77,12 @@ void ScRTFExport::WriteTab( SCTAB nTab ) m_aDocStrm.WriteChar( '{' ).WriteOString( SAL_NEWLINE_STRING ); if ( pDoc->HasTable( nTab ) ) { -memset( [0], 0, (pDoc->MaxCol()+2) * sizeof(sal_uLong) ); +memset( _pCellX[0], 0, (pDoc->MaxCol()+2) * sizeof(sal_uLong) ); SCCOL nCol; SCCOL nEndCol = aRange.aEnd.Col(); for ( nCol = aRange.aStart.Col(); nCol <= nEndCol; nCol++ ) { -pCellX[nCol+1] = pCellX[nCol] + pDoc->GetColWidth( nCol, nTab ); +m_pCellX[nCol+1] = m_pCellX[nCol] + pDoc->GetColWidth( nCol, nTab ); } SCROW nEndRow = aRange.aEnd.Row(); @@ -128,7 +128,7 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow ) if ( pChar ) m_aDocStrm.WriteOString( pChar ); -m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELLX ).WriteOString( OString::number(pCellX[nCol+1]) ); +m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELLX ).WriteOString( OString::number(m_pCellX[nCol+1]) ); if ( (nCol & 0x0F) == 0x0F ) m_aDocStrm.WriteOString( SAL_NEWLINE_STRING ); // Do not let lines get too long } commit a0a3500c58ae5bcb8ffb4126c43227ba0544f8bf Author: Henry Castro AuthorDate: Tue Jul 25 15:18:10 2023 -0400 Commit: Caolán McNamara CommitDate: Fri Sep 1 16:19:12 2023 +0200 sc: filter: rtf: use a separate document stream "An RTF file has the following syntax: '{' '}' " In order to build the header: \rtf \deff? ? ? ? ? ? The font table should be created while visiting the column/rows. Signed-off-by: Henry Castro Change-Id: Id72a3c87acab6cfc7889cf81f7e83a0d73e378a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154903 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156412 Tested-by: Caolán McNamara diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx index 0d5e69f79d8e..9a4fe43d9d02 100644 --- a/sc/source/filter/inc/rtfexp.hxx +++ b/sc/source/filter/inc/rtfexp.hxx @@ -26,6 +26,7 @@ class ScRTFExport : public ScExportBase { std::unique_ptr pCellX; // cumulative range in a table +SvMemoryStream m_aDocStrm; voidWriteTab( SCTAB nTab ); voidWriteRow( SCTAB nTab, SCROW nRow ); diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx index 32549cbff377..5cef70300617 100644 --- a/sc/source/filter/rtf/rtfexp.cxx +++ b/sc/source/filter/rtf/rtfexp.cxx @@ -63,16 +63,18 @@ void ScRTFExport::Write() for ( SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab(); nTab++ ) { if ( nTab > aRange.aStart.Tab() ) -rStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_PAR ); +m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_PAR ); WriteTab( nTab ); } +m_aDocStrm.Seek(0); +rStrm.WriteStream(m_aDocStrm); rStrm.WriteChar( '}' ).WriteOString( SAL_NEWLINE_STRING ); } void ScR
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 4c2aa7e073d6ab9f063272011d2866addeeed526 Author: Henry Castro AuthorDate: Tue Aug 8 15:12:27 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 1 15:59:34 2023 +0200 lok: use constant keys enumeration Useful to better readability code. Signed-off-by: Henry Castro Change-Id: I335d010c3b1ddf3f8052b7ed6cb0f94ad20045f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155495 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156416 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 21c47eacdfc7..6db6f722bee6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4534,12 +4534,12 @@ static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned nLOKWi // backspace if (nLOKWindowId == 0) { -KeyEvent aEvt(8, 1283); +KeyEvent aEvt(8, KEY_BACKSPACE); for (int i = 0; i < nCharBefore; ++i) pWindow->KeyInput(aEvt); } else -SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 8, 1283, nCharBefore - 1); +SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 8, KEY_BACKSPACE, nCharBefore - 1); } if (nCharAfter > 0) @@ -4547,12 +4547,12 @@ static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned nLOKWi // delete (forward) if (nLOKWindowId == 0) { -KeyEvent aEvt(46, 1286); +KeyEvent aEvt(46, KEY_DELETE); for (int i = 0; i < nCharAfter; ++i) pWindow->KeyInput(aEvt); } else -SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 46, 1286, nCharAfter - 1); +SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 46, KEY_DELETE, nCharAfter - 1); } }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - connectivity/source
connectivity/source/parse/sqliterator.cxx |4 1 file changed, 4 insertions(+) New commits: commit 0d579a1b8122eed6348ee4a512573277e2d5db77 Author: Henry Castro AuthorDate: Wed Aug 30 10:25:51 2023 -0400 Commit: Caolán McNamara CommitDate: Thu Aug 31 18:15:31 2023 +0200 connectiviy: fix to detect column data type if Base SQL query: SELECT COUNT("test"."id") from Test If changed to Spanish UI, detect the column type from a neutral context parser. Signed-off-by: Henry Castro Change-Id: I1faa8ff8417a0fc4996b289bd2ce0baad52fc00c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156298 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 64ea48d0351a..3428fba569e1 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -2109,7 +2109,11 @@ sal_Int32 OSQLParseTreeIterator::getFunctionReturnType(const OSQLParseNode* _pNo nType = DataType::DOUBLE; } else +{ nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, _rParser.getContext() ); +if (nType == DataType::SQLNULL) +nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, m_rParser.getNeutral() ); +} } return nType;
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 3 commits - connectivity/source dbaccess/source include/connectivity include/svx svx/source
connectivity/source/parse/sqlnode.cxx |7 +-- dbaccess/source/core/api/SingleSelectQueryComposer.cxx |2 +- dbaccess/source/core/inc/SingleSelectQueryComposer.hxx |1 + include/connectivity/sqlparse.hxx | 10 +++--- include/svx/ParseContext.hxx | 11 +-- svx/source/form/ParseContext.cxx | 16 6 files changed, 39 insertions(+), 8 deletions(-) New commits: commit 57379b62950d5730cdd0ec2b14eaf55370a3298e Author: Henry Castro AuthorDate: Wed Aug 30 10:23:31 2023 -0400 Commit: Caolán McNamara CommitDate: Thu Aug 31 18:15:23 2023 +0200 connectivity: add neutral context parser Signed-off-by: Henry Castro Change-Id: I12b0fe811d141873aaa64af5b6c457051c3356b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156297 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 1cb631a80c78..e8e8b44f463b 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1305,8 +1305,11 @@ std::unique_ptr OSQLParser::predicateTree(OUString& rErrorMessage } -OSQLParser::OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext, const IParseContext* _pContext) +OSQLParser::OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext, + const IParseContext* _pContext, + const IParseContext* _pNeutral) :m_pContext(_pContext) +,m_pNeutral(_pNeutral) ,m_pData( new OSQLParser_Data ) ,m_nFormatKey(0) ,m_nDateFormatKey(0) diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 45d9a8ce6595..15667d7d170b 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -217,7 +217,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc const Reference& _rContext ) :OSubComponent(m_aMutex,_xConnection) ,OPropertyContainer(m_aBHelper) -,m_aSqlParser( _rContext, _aParseContext ) +,m_aSqlParser( _rContext, _aParseContext, _aNeutralContext ) ,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aElementaryParts( size_t(SQLPartCount) ) diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx index a0edfd195a69..fdde2d451d17 100644 --- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx +++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx @@ -76,6 +76,7 @@ namespace dbaccess typedef std::function TGetParseNode; ::svxform::OSystemParseContext m_aParseContext; +::svxform::ONeutralParseContext m_aNeutralContext; ::connectivity::OSQLParser m_aSqlParser; ::connectivity::OSQLParseTreeIterator m_aSqlIterator; // the iterator for the complete statement ::connectivity::OSQLParseTreeIterator m_aAdditiveIterator;// the iterator for the "additive statement" (means without the clauses of the elementary statement) diff --git a/include/connectivity/sqlparse.hxx b/include/connectivity/sqlparse.hxx index 7e55d41e339f..50c72f6ebcdc 100644 --- a/include/connectivity/sqlparse.hxx +++ b/include/connectivity/sqlparse.hxx @@ -124,7 +124,8 @@ namespace connectivity static sal_Int32s_nRefCount; // information on the current parse action -const IParseContext*m_pContext; +const IParseContext* m_pContext; +const IParseContext* m_pNeutral; std::unique_ptr m_pParseTree; // result from parsing ::std::unique_ptr< OSQLParser_Data > m_pData; @@ -156,7 +157,9 @@ namespace connectivity public: // if NULL, a default context will be used // the context must live as long as the parser -OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext, const IParseContext* _pContext = nullptr); +OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext, + const IParseContext* _pContext = nullptr, + const IParseContext* _pNeutral = nullptr); ~OSQLParser(); // Parsing an SQLStatement @@ -173,7 +176,8 @@ namespace connectivity bool bUseRealName = true); // Access to the context -const IParseContext& getContext() const {return *m_pContext;} +const IParseContext& getContext()
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - desktop/source
desktop/source/lib/init.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 86eb55db6378309097f0bcee201177694fefe018 Author: Henry Castro AuthorDate: Tue Aug 8 15:12:27 2023 -0400 Commit: Henry Castro CommitDate: Mon Aug 14 17:05:14 2023 +0200 lok: use constant keys enumeration Useful to better readability code. Signed-off-by: Henry Castro Change-Id: I335d010c3b1ddf3f8052b7ed6cb0f94ad20045f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155495 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155633 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 28ddbd384896..aa717dfe17cf 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4471,12 +4471,12 @@ static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned nLOKWi // backspace if (nLOKWindowId == 0) { -KeyEvent aEvt(8, 1283); +KeyEvent aEvt(8, KEY_BACKSPACE); for (int i = 0; i < nCharBefore; ++i) pWindow->KeyInput(aEvt); } else -SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 8, 1283, nCharBefore - 1); +SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 8, KEY_BACKSPACE, nCharBefore - 1); } if (nCharAfter > 0) @@ -4484,12 +4484,12 @@ static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned nLOKWi // delete (forward) if (nLOKWindowId == 0) { -KeyEvent aEvt(46, 1286); +KeyEvent aEvt(46, KEY_DELETE); for (int i = 0; i < nCharAfter; ++i) pWindow->KeyInput(aEvt); } else -SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 46, 1286, nCharAfter - 1); +SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 46, KEY_DELETE, nCharAfter - 1); } }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/qa
sc/qa/unit/uicalc/uicalc.cxx | 36 1 file changed, 36 insertions(+) New commits: commit 359651c3f4c4615b2fdc859fa6d63989dd5396b1 Author: Henry Castro AuthorDate: Tue Jul 18 15:22:08 2023 -0400 Commit: Henry Castro CommitDate: Mon Aug 14 16:24:58 2023 +0200 tdf#155799: sc: qa: add unit test "testMouseMergeRef" Change-Id: I2e46a014a3a66fe41b06a07a68c75e52ae5530f6 Signed-off-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155005 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155632 diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index ff8e84a03bff..d5973976441d 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -2068,6 +2068,42 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testKeyboardMergeRef) } } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testMouseMergeRef) +{ +mxComponent = loadFromDesktop("private:factory/scalc"); +SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(mxComponent); +CPPUNIT_ASSERT(pFoundShell); +ScDocShell* pDocSh = dynamic_cast(pFoundShell); +CPPUNIT_ASSERT(pDocSh); +ScModelObj* pModelObj = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pModelObj); +ScTabViewShell* pViewShell = pDocSh->GetBestViewShell(false); +CPPUNIT_ASSERT(pViewShell); + +goToCell("A1:A5"); +dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {}); +goToCell("A6:A10"); +dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {}); + +insertStringToCell(*pModelObj, "B1", "=", false); + +Point aA1 = pViewShell->GetViewData().GetPrintTwipsPos(0, 0); +Point aA6 = pViewShell->GetViewData().GetPrintTwipsPos(0, 5); +Point aA7 = pViewShell->GetViewData().GetPrintTwipsPos(0, 6); + +pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aA1.X() + 5, aA1.Y() + 5, 1, MOUSE_LEFT, 0); +pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEMOVE, aA6.X() + 5, aA6.Y() + 5, 1, MOUSE_LEFT, 0); +pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, aA7.X() + 5, aA7.Y() + 5, 1, MOUSE_LEFT, 0); +Scheduler::ProcessEventsToIdle(); + +CPPUNIT_ASSERT(pViewShell->IsRefInputMode()); +{ +const OUString* pInput = pViewShell->GetEditString(); +CPPUNIT_ASSERT(pInput); +CPPUNIT_ASSERT_EQUAL(OUString("=A1:A10"), *pInput); +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/qa
sc/qa/unit/uicalc/uicalc.cxx | 42 ++ 1 file changed, 42 insertions(+) New commits: commit 6dcf44872dd89ec2203766cc685e31f16cea8ce5 Author: Henry Castro AuthorDate: Tue Jul 18 15:21:02 2023 -0400 Commit: Henry Castro CommitDate: Mon Aug 14 15:44:25 2023 +0200 tdf#155799: sc: qa: add unit test "testKeyboardMergeRef" Change-Id: I4d80ad5d9e5fe2c131f9397ec59c6c16ef92c094 Signed-off-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155004 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155631 diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 6f1c490b90f4..ff8e84a03bff 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -2026,6 +2026,48 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf155796) CPPUNIT_ASSERT_EQUAL(OUString("Sheet1.A1:Sheet1.A3"), aMarkedAreaString); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testKeyboardMergeRef) +{ +mxComponent = loadFromDesktop("private:factory/scalc"); +SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(mxComponent); +CPPUNIT_ASSERT(pFoundShell); +ScDocShell* pDocSh = dynamic_cast(pFoundShell); +CPPUNIT_ASSERT(pDocSh); +ScModelObj* pModelObj = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pModelObj); +ScTabViewShell* pViewShell = pDocSh->GetBestViewShell(false); +CPPUNIT_ASSERT(pViewShell); + +goToCell("A1:A5"); +dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {}); +goToCell("A6:A10"); +dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {}); + +insertStringToCell(*pModelObj, "B1", "=", false); + +goToCell("A1"); + +pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN | KEY_SHIFT); +pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN | KEY_SHIFT); +Scheduler::ProcessEventsToIdle(); +CPPUNIT_ASSERT(pViewShell->IsRefInputMode()); +{ +const OUString* pInput = pViewShell->GetEditString(); +CPPUNIT_ASSERT(pInput); +CPPUNIT_ASSERT_EQUAL(OUString("=A1:A10"), *pInput); +} + +pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_UP | KEY_SHIFT); +pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_UP | KEY_SHIFT); +Scheduler::ProcessEventsToIdle(); +CPPUNIT_ASSERT(pViewShell->IsRefInputMode()); +{ +const OUString* pInput = pViewShell->GetEditString(); +CPPUNIT_ASSERT(pInput); +CPPUNIT_ASSERT_EQUAL(OUString("=A1:A5"), *pInput); +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/source
sc/source/ui/inc/tabvwsh.hxx |1 + sc/source/ui/view/tabvwsha.cxx |8 2 files changed, 9 insertions(+) New commits: commit 3089be0b87d02f363b97ccbb473d1798e202425c Author: Henry Castro AuthorDate: Tue Jul 18 15:18:41 2023 -0400 Commit: Henry Castro CommitDate: Mon Aug 14 15:43:52 2023 +0200 tdf#155799: sc: add getter function "GetEditString" Useful for QA test queries. .. Signed-off-by: Henry Castro Change-Id: Ibd3c902405f478032447b10286a788cd0769c855 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155001 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155630 diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 2aba65effefa..2db85dfa543e 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -237,6 +237,7 @@ public: const ScInputHandler* GetInputHandler() const { return mpInputHandler.get(); } ScInputHandler* GetInputHandler() { return mpInputHandler.get(); } +const OUString* GetEditString() const; voidUpdateInputHandler( bool bForce = false, bool bStopEditing = true ); voidUpdateInputHandlerCellAdjust( SvxCellHorJustify eJust ); boolTabKeyInput(const KeyEvent& rKEvt); diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 5ce345e97fea..f17a55237e4e 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -615,6 +615,14 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString }); } +const OUString* ScTabViewShell::GetEditString() const +{ +if (mpInputHandler) +return >GetEditString(); + +return nullptr; +} + bool ScTabViewShell::IsRefInputMode() const { ScModule* pScMod = SC_MOD();
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/tabview4.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit f2febdd756723a5835f98ca8cd749d51875f8bcc Author: Henry Castro AuthorDate: Fri Aug 11 09:11:09 2023 -0400 Commit: Henry Castro CommitDate: Sun Aug 13 16:38:38 2023 +0200 tdf#155799: sc: fix input formula reference If the start point reference mark is selected with mouse direction up, it should extend to show the correct input formula reference. Signed-off-by: Henry Castro Change-Id: I41f2ea52bf7de341eccadfba80e91fd76a6fd2de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155618 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins CollaboraOffice (cherry picked from commit f4f171506dc64a288344cb3c1eacc2c2d53283e8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155591 Tested-by: Jenkins diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index 442ef9a79654..a7de6bdf67d2 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -229,9 +229,13 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ ) ScRefType eType = aViewData.GetRefType(); if ( eType == SC_REFTYPE_REF ) { +if ((nStartX > nEndX || nStartY > nEndY) && +rDoc.HasAttrib(nStartX, nStartY, nTab, HasAttrFlags::Merged)) +rDoc.ExtendMerge( nStartX, nStartY, nStartX, nStartY, nTab ); + ScRange aRef( -aViewData.GetRefStartX(), aViewData.GetRefStartY(), aViewData.GetRefStartZ(), -aViewData.GetRefEndX(), aViewData.GetRefEndY(), aViewData.GetRefEndZ() ); +nStartX, nStartY, aViewData.GetRefStartZ(), +nEndX, nEndY, aViewData.GetRefEndZ() ); SC_MOD()->SetReference( aRef, rDoc, ); ShowRefTip(); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/source
sc/source/ui/view/tabview4.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit 48e03dfb8398fa7dc881f039f9d56b729e95ca8d Author: Henry Castro AuthorDate: Fri Aug 11 09:11:09 2023 -0400 Commit: Aron Budea CommitDate: Sat Aug 12 00:53:20 2023 +0200 tdf#155799: sc: fix input formula reference If the start point reference mark is selected with mouse direction up, it should extend to show the correct input formula reference. Signed-off-by: Henry Castro Change-Id: I41f2ea52bf7de341eccadfba80e91fd76a6fd2de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155618 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155593 Tested-by: Aron Budea Reviewed-by: Aron Budea diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index 3ed71a5ef931..9ff3d41ef4df 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -229,9 +229,13 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ ) ScRefType eType = aViewData.GetRefType(); if ( eType == SC_REFTYPE_REF ) { +if ((nStartX > nEndX || nStartY > nEndY) && +rDoc.HasAttrib(nStartX, nStartY, nTab, HasAttrFlags::Merged)) +rDoc.ExtendMerge( nStartX, nStartY, nStartX, nStartY, nTab ); + ScRange aRef( -aViewData.GetRefStartX(), aViewData.GetRefStartY(), aViewData.GetRefStartZ(), -aViewData.GetRefEndX(), aViewData.GetRefEndY(), aViewData.GetRefEndZ() ); +nStartX, nStartY, aViewData.GetRefStartZ(), +nEndX, nEndY, aViewData.GetRefEndZ() ); SC_MOD()->SetReference( aRef, rDoc, ); ShowRefTip(); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/source
sc/source/ui/view/tabview2.cxx | 20 1 file changed, 20 insertions(+) New commits: commit ee6d3d10ae7962d7eb6562e65abe9e1524a04e99 Author: Henry Castro AuthorDate: Tue Jul 18 15:09:18 2023 -0400 Commit: Henry Castro CommitDate: Fri Aug 11 19:18:02 2023 +0200 tdf#155799: sc: fix formula reference "key up" When the formula reference mode is active and it process the keyboard event UP, it should decrease -1 according the merge attribute row, col span. Signed-off-by: Henry Castro Change-Id: I278bcd9d52caeb09e4a47336af8c8e9b522397c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154999 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155628 diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index d9fa2cb3f3d5..6c7cdadd4d48 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -197,6 +197,8 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY, SCCOL nMovX, SCROW nMovY, SCTAB nRefTab, const ScDocument& rDoc) { +SCCOL nOldX = rNewX; +SCROW nOldY = rNewY; bool bSelectLocked = true; bool bSelectUnlocked = true; const ScTableProtection* pTabProtection = rDoc.GetTabProtection(nRefTab); @@ -223,6 +225,15 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY, } if (isCellQualified(, nTempX, rNewY, nRefTab, bSelectLocked, bSelectUnlocked)) rNewX = nTempX; + +if (nMovX < 0 && rNewX > 0) +{ +const ScMergeAttr* pMergeAttr = rDoc.GetAttr(rNewX, rNewY, nRefTab, ATTR_MERGE); +if (pMergeAttr && pMergeAttr->IsMerged() && +nOldX >= rNewX && +nOldX <= rNewX + pMergeAttr->GetRowMerge() - 1) +rNewX = rNewX - 1; +} } if (nMovY) @@ -239,6 +250,15 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY, } if (isCellQualified(, rNewX, nTempY, nRefTab, bSelectLocked, bSelectUnlocked)) rNewY = nTempY; + +if (nMovY < 0 && rNewY > 0) +{ +const ScMergeAttr* pMergeAttr = rDoc.GetAttr(rNewX, rNewY, nRefTab, ATTR_MERGE); +if (pMergeAttr && pMergeAttr->IsMerged() && +nOldY >= rNewY && +nOldY <= rNewY + pMergeAttr->GetRowMerge() - 1) +rNewY = rNewY - 1; +} } rDoc.SkipOverlapped(rNewX, rNewY, nRefTab);
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source
sc/source/ui/view/tabview4.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit eee7a3c165aaa60e70d0bab9ab29fab71078abbe Author: Henry Castro AuthorDate: Fri Aug 11 09:11:09 2023 -0400 Commit: Henry Castro CommitDate: Fri Aug 11 16:21:54 2023 +0200 tdf#155799: sc: fix input formula reference If the start point reference mark is selected with mouse direction up, it should extend to show the correct input formula reference. Signed-off-by: Henry Castro Change-Id: I41f2ea52bf7de341eccadfba80e91fd76a6fd2de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155618 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins CollaboraOffice diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index 442ef9a79654..a7de6bdf67d2 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -229,9 +229,13 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ ) ScRefType eType = aViewData.GetRefType(); if ( eType == SC_REFTYPE_REF ) { +if ((nStartX > nEndX || nStartY > nEndY) && +rDoc.HasAttrib(nStartX, nStartY, nTab, HasAttrFlags::Merged)) +rDoc.ExtendMerge( nStartX, nStartY, nStartX, nStartY, nTab ); + ScRange aRef( -aViewData.GetRefStartX(), aViewData.GetRefStartY(), aViewData.GetRefStartZ(), -aViewData.GetRefEndX(), aViewData.GetRefEndY(), aViewData.GetRefEndZ() ); +nStartX, nStartY, aViewData.GetRefStartZ(), +nEndX, nEndY, aViewData.GetRefEndZ() ); SC_MOD()->SetReference( aRef, rDoc, ); ShowRefTip(); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/source
sc/source/ui/view/tabview2.cxx | 97 + 1 file changed, 52 insertions(+), 45 deletions(-) New commits: commit 9b15ae4336203ed67f5ef735396873ce940b4eef Author: Henry Castro AuthorDate: Mon Jul 17 09:41:55 2023 -0400 Commit: Aron Budea CommitDate: Fri Aug 11 16:14:00 2023 +0200 tdf#155799: sc: abstraction "moveRefByCell" ... Change-Id: Ib00e3cddcd4a5dc4ef3d74d3939cdf278f2cb44d Signed-off-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154998 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155565 Tested-by: Aron Budea Reviewed-by: Aron Budea diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 6e5ee8527d54..d9fa2cb3f3d5 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -193,6 +193,57 @@ bool checkBoundary(const ScDocument* pDoc, SCCOL& rCol, SCROW& rRow) return bGood; } +void moveRefByCell(SCCOL& rNewX, SCROW& rNewY, + SCCOL nMovX, SCROW nMovY, SCTAB nRefTab, + const ScDocument& rDoc) +{ +bool bSelectLocked = true; +bool bSelectUnlocked = true; +const ScTableProtection* pTabProtection = rDoc.GetTabProtection(nRefTab); +if (pTabProtection && pTabProtection->isProtected()) +{ +bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); +bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); +} + +moveCursorByProtRule(rNewX, rNewY, nMovX, nMovY, nRefTab, ); +checkBoundary(, rNewX, rNewY); + +if (nMovX) +{ +SCCOL nTempX = rNewX; +while (rDoc.IsHorOverlapped(nTempX, rNewY, nRefTab)) +{ +if (nMovX > 0) +++nTempX; +else +--nTempX; +if (!checkBoundary(, nTempX, rNewY)) +break; +} +if (isCellQualified(, nTempX, rNewY, nRefTab, bSelectLocked, bSelectUnlocked)) +rNewX = nTempX; +} + +if (nMovY) +{ +SCROW nTempY = rNewY; +while (rDoc.IsVerOverlapped(rNewX, nTempY, nRefTab)) +{ +if (nMovY > 0) +++nTempY; +else +--nTempY; +if (!checkBoundary(, rNewX, nTempY)) +break; +} +if (isCellQualified(, rNewX, nTempY, nRefTab, bSelectLocked, bSelectUnlocked)) +rNewY = nTempY; +} + +rDoc.SkipOverlapped(rNewX, rNewY, nRefTab); +} + void moveCursorByMergedCell(SCCOL& rCol, SCROW& rRow, SCCOL nMovX, SCROW nMovY, SCCOL nStartX, SCROW nStartY, SCTAB nTab, const ScDocument* pDoc) { @@ -952,51 +1003,7 @@ void ScTabView::ExpandBlock(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode) SCROW nNewY = aViewData.GetRefEndY(); SCTAB nRefTab = aViewData.GetRefEndZ(); -bool bSelectLocked = true; -bool bSelectUnlocked = true; -const ScTableProtection* pTabProtection = rDoc.GetTabProtection(nRefTab); -if (pTabProtection && pTabProtection->isProtected()) -{ -bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); -bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); -} - -moveCursorByProtRule(nNewX, nNewY, nMovX, nMovY, nRefTab, ); -checkBoundary(, nNewX, nNewY); - -if (nMovX) -{ -SCCOL nTempX = nNewX; -while (rDoc.IsHorOverlapped(nTempX, nNewY, nRefTab)) -{ -if (nMovX > 0) -++nTempX; -else ---nTempX; -if (!checkBoundary(, nTempX, nNewY)) -break; -} -if (isCellQualified(, nTempX, nNewY, nRefTab, bSelectLocked, bSelectUnlocked)) -nNewX = nTempX; -} - -if (nMovY) -{ -SCROW nTempY = nNewY; -while (rDoc.IsVerOverlapped(nNewX, nTempY, nRefTab)) -{ -if (nMovY > 0) -++nTempY; -else ---nTempY; -if (!checkBoundary(, nNewX, nTempY)) -break; -} -if (isCellQualified(, nNewX, nTempY, nRefTab, bSelectLocked, bSelectUnlocked)) -nNewY = nTempY; -} - -rDoc.SkipOverlapped(nNewX, nNewY, nRefTab); +moveRefByCell(nNewX, nNewY, nMovX, nMovY, nRefTab, rDoc); UpdateRef(nNewX, nNewY, nRefTab); SCCOL nTargetCol = nNewX; SCROW nTargetRow = nNewY;
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/source
sc/source/ui/app/inputhdl.cxx |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit c5779b506a701ff21d2d738439a8e4976e18833c Author: Henry Castro AuthorDate: Thu Aug 10 15:14:18 2023 -0400 Commit: Aron Budea CommitDate: Fri Aug 11 16:13:00 2023 +0200 tdf#155799: lok: sc: fix extend reference mark In the tiled rendering case, the server sends a reference coordinates to client side, so extend the range end point reference if merged cells. Signed-off-by: Henry Castro Change-Id: Ie9611aea3f6645a6cf45514939ae6364afac0b1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155564 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl (cherry picked from commit edbf070a6bb6aacfb277140457cf21036b5239e9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155590 Tested-by: Aron Budea Reviewed-by: Aron Budea diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 66eb92dd2efa..30e7c4482e1c 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -484,10 +484,15 @@ ReferenceMark ScInputHandler::GetReferenceMark( const ScViewData& rViewData, ScD { SCCOL nCol1 = nX1, nCol2 = nX2; SCROW nRow1 = nY1, nRow2 = nY2; +ScDocument& rDoc = pDocSh->GetDocument(); + PutInOrder(nCol1, nCol2); PutInOrder(nRow1, nRow2); + if (nCol1 == nCol2 && nRow1 == nRow2) -pDocSh->GetDocument().ExtendMerge(nCol1, nRow1, nCol2, nRow2, nTab); +rDoc.ExtendMerge(nCol1, nRow1, nCol2, nRow2, nTab); +else if (rDoc.HasAttrib(nCol2, nRow2, nTab, HasAttrFlags::Merged)) +rDoc.ExtendMerge(nCol2, nRow2, nCol2, nRow2, nTab); Point aTopLeft = rViewData.GetPrintTwipsPos(nCol1, nRow1); Point aBottomRight = rViewData.GetPrintTwipsPos(nCol2 + 1, nRow2 + 1);
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source
sc/source/ui/app/inputhdl.cxx |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit edbf070a6bb6aacfb277140457cf21036b5239e9 Author: Henry Castro AuthorDate: Thu Aug 10 15:14:18 2023 -0400 Commit: Tomaž Vajngerl CommitDate: Fri Aug 11 08:49:43 2023 +0200 tdf#155799: lok: sc: fix extend reference mark In the tiled rendering case, the server sends a reference coordinates to client side, so extend the range end point reference if merged cells. Signed-off-by: Henry Castro Change-Id: Ie9611aea3f6645a6cf45514939ae6364afac0b1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155564 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 6b7cc1935578..b90b1b100be4 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -494,10 +494,15 @@ ReferenceMark ScInputHandler::GetReferenceMark( const ScViewData& rViewData, ScD { SCCOL nCol1 = nX1, nCol2 = nX2; SCROW nRow1 = nY1, nRow2 = nY2; +ScDocument& rDoc = pDocSh->GetDocument(); + PutInOrder(nCol1, nCol2); PutInOrder(nRow1, nRow2); + if (nCol1 == nCol2 && nRow1 == nRow2) -pDocSh->GetDocument().ExtendMerge(nCol1, nRow1, nCol2, nRow2, nTab); +rDoc.ExtendMerge(nCol1, nRow1, nCol2, nRow2, nTab); +else if (rDoc.HasAttrib(nCol2, nRow2, nTab, HasAttrFlags::Merged)) +rDoc.ExtendMerge(nCol2, nRow2, nCol2, nRow2, nTab); Point aTopLeft = rViewData.GetPrintTwipsPos(nCol1, nRow1); Point aBottomRight = rViewData.GetPrintTwipsPos(nCol2 + 1, nRow2 + 1);
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/output.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit e4e080086e76a0bedd7ce62dc610889dc5c86401 Author: Henry Castro AuthorDate: Wed Aug 9 16:48:42 2023 -0400 Commit: Henry Castro CommitDate: Thu Aug 10 21:32:27 2023 +0200 tdf#155799: sc: fix paint the reference mark If a reference mark is initiated with the first click, the initial range points are the same and extended if merged cells, but if the user drag more cells the Range end has to extend if merged cells Signed-off-by: Henry Castro Change-Id: Ife7c4514a9303226b73bff61bd0df689f81af42f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155533 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl (cherry picked from commit ebd1a4d6fc3f9ba533a29fa54acf7b3b41c398d5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155483 Tested-by: Jenkins diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index ae7a33bfdf49..f3b4b3ca9be2 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -2011,6 +2011,8 @@ void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY, if ( nRefStartX == nRefEndX && nRefStartY == nRefEndY ) mpDoc->ExtendMerge( nRefStartX, nRefStartY, nRefEndX, nRefEndY, nTab ); +else if (mpDoc->HasAttrib(nRefEndX, nRefEndY, nTab, HasAttrFlags::Merged)) +mpDoc->ExtendMerge(nRefEndX, nRefEndY, nRefEndX, nRefEndY, nTab); if ( !(nRefStartX <= nVisX2 && nRefEndX >= nVisX1 && nRefStartY <= nVisY2 && nRefEndY >= nVisY1) )
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/source
sc/source/ui/view/output.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 35f64398806d6361d427a38446fd3da70eff4915 Author: Henry Castro AuthorDate: Wed Aug 9 16:48:42 2023 -0400 Commit: Aron Budea CommitDate: Thu Aug 10 16:52:08 2023 +0200 tdf#155799: sc: fix paint the reference mark If a reference mark is initiated with the first click, the initial range points are the same and extended if merged cells, but if the user drag more cells the Range end has to extend if merged cells Signed-off-by: Henry Castro Change-Id: Ife7c4514a9303226b73bff61bd0df689f81af42f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155533 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl (cherry picked from commit ebd1a4d6fc3f9ba533a29fa54acf7b3b41c398d5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155485 Tested-by: Aron Budea Reviewed-by: Aron Budea diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index d2a65bac6df0..085708bafa67 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -2019,6 +2019,8 @@ void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY, if ( nRefStartX == nRefEndX && nRefStartY == nRefEndY ) mpDoc->ExtendMerge( nRefStartX, nRefStartY, nRefEndX, nRefEndY, nTab ); +else if (mpDoc->HasAttrib(nRefEndX, nRefEndY, nTab, HasAttrFlags::Merged)) +mpDoc->ExtendMerge(nRefEndX, nRefEndY, nRefEndX, nRefEndY, nTab); if ( !(nRefStartX <= nVisX2 && nRefEndX >= nVisX1 && nRefStartY <= nVisY2 && nRefEndY >= nVisY1) )
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/source
sc/source/ui/view/tabview4.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit db19cb262534c051cf4342055b50332d21e06aa8 Author: Henry Castro AuthorDate: Tue Jul 18 15:15:41 2023 -0400 Commit: Aron Budea CommitDate: Thu Aug 10 16:51:31 2023 +0200 tdf#155799: sc: fix "UpdateRef"" to update extended merged cells Extend the merged cell if the current has the attribute "Merged". ... Signed-off-by: Henry Castro Change-Id: Ia2d5983d89b8661abb683d10d4de8bd0c5adea7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154993 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153406 Tested-by: Aron Budea Reviewed-by: Aron Budea diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index 5238947a88f3..3ed71a5ef931 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -213,6 +213,9 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ ) rDoc.ExtendMerge( nStartX, nStartY, nEndX, nEndY, nTab ); ScUpdateRect aRect( nStartX, nStartY, nEndX, nEndY ); +if (rDoc.HasAttrib(nCurX, nCurY, nCurZ, HasAttrFlags::Merged)) +rDoc.ExtendMerge(nStartX, nStartY, nCurX, nCurY, nCurZ); + aViewData.SetRefEnd( nCurX, nCurY, nCurZ ); nStartX = aViewData.GetRefStartX();