diff options
350 files changed, 7325 insertions, 3052 deletions
diff --git a/.gitreview b/.gitreview index 49c7692c842a..439ba496a4e1 100644 --- a/.gitreview +++ b/.gitreview @@ -3,5 +3,4 @@ host=gerrit.libreoffice.org port=29418 project=core defaultremote=logerrit -defaultbranch=libreoffice-24-8-4 - +defaultbranch=feature/cib_contract49d diff --git a/android/source/res/values-cs/strings.xml b/android/source/res/values-cs/strings.xml index 246e9e85d3d4..f01dccb4f72a 100644 --- a/android/source/res/values-cs/strings.xml +++ b/android/source/res/values-cs/strings.xml @@ -116,4 +116,18 @@ <string name="current_uno_command">Aktuální příkaz UNO</string> <string name="action_rename_slide">Přejmenovat snímek</string> <string name="action_copy">Kopírovat</string> + <string name="alert_copy_svg_slide_show_to_clipboard_dismiss">OK</string> + <string name="message_save_incomplete">Ukládání nedokončeno. Byly v dokumentu nějaké změny?</string> + <string name="action_underline">Podtržené</string> + <string name="unable_to_go_further">Nelze jít dále.</string> + <string name="action_bold">Tučné</string> + <string name="browser_app_name">Prohlížeč LibreOffice</string> + <string name="menu_search">Hledat</string> + <string name="app_about_name"><b>LibreOffice Viewer „Beta“</b></string> + <string name="action_strikeout">Přeškrtnuté</string> + <string name="search_not_found">Klíčové slovo nenalezeno</string> + <string name="menu_preferences">Předvolby</string> + <string name="directory_not_saved">Adresář nebyl uložen.</string> + <string name="action_italic">Kurzíva</string> + <string name="alert_copy_svg_slide_show_to_clipboard">Vaše zařízení s Androidem nepodporuje v aplikacích prezentace ve formátu SVG. Prezentace byla zkopírována do schránky. Stiskněte tlačítko Domů, otevřete moderní webový prohlížeč a vložte obsah schránky do adresního řádku.</string> </resources>
\ No newline at end of file diff --git a/android/source/res/values-cy/strings.xml b/android/source/res/values-cy/strings.xml index 1e9183bb2c32..9eea72f38eb3 100644 --- a/android/source/res/values-cy/strings.xml +++ b/android/source/res/values-cy/strings.xml @@ -116,4 +116,18 @@ <string name="UNO_commands_string_type_hint">Math</string> <string name="alert_cancel">Diddymu</string> <string name="unable_to_save">Methu cadw i ffeil</string> + <string name="app_about_name"><b>Darllenydd LibreOffice \'Beta\'</b></string> + <string name="browser_app_name">Porwr LibreOffice</string> + <string name="menu_search">Chwilio</string> + <string name="search_not_found">Heb ganfod yr allweddair</string> + <string name="menu_preferences">Dewisiadau</string> + <string name="action_bold">Trwm</string> + <string name="action_underline">Tanlinellu</string> + <string name="action_italic">Italig</string> + <string name="action_strikeout">Taro Allan</string> + <string name="message_save_incomplete">Cadw yn anghyflawn. A fu newidiadau?</string> + <string name="alert_copy_svg_slide_show_to_clipboard">Nid yw eich dyfais Android yn cefnogi sioe sleidiau svg o fewn ap. Rydym wedi copïo dolen y sioe sleidiau i\'r clipfwrdd. Pwyswch y botwm cartref, agor porwr gwe fodern, gludo i\'r bar cyfeiriad a mynd.</string> + <string name="alert_copy_svg_slide_show_to_clipboard_dismiss">Iawn</string> + <string name="unable_to_go_further">Methu mynd ymhellach.</string> + <string name="directory_not_saved">Heb gadw\'r cyfeiriadur.</string> </resources>
\ No newline at end of file diff --git a/android/source/res/values-de/strings.xml b/android/source/res/values-de/strings.xml index 7ebc8c9662ab..24cd64953f4c 100644 --- a/android/source/res/values-de/strings.xml +++ b/android/source/res/values-de/strings.xml @@ -137,4 +137,18 @@ <string name="create_file">Neue Datei erstellen</string> <string name="search_find_next">Nächste suchen</string> <string name="search_find_previous">Vorherige suchen</string> + <string name="alert_copy_svg_slide_show_to_clipboard_dismiss">OK</string> + <string name="message_save_incomplete">Speichern unvollständig. Gab es Änderungen?</string> + <string name="action_underline">Unterstrichen</string> + <string name="unable_to_go_further">Kann nicht weiter gehen.</string> + <string name="action_bold">Fett</string> + <string name="browser_app_name">LibreOffice Browser</string> + <string name="menu_search">Suchen</string> + <string name="app_about_name"><b>LibreOffice Viewer \'Beta\'</b></string> + <string name="action_strikeout">Durchgestrichen</string> + <string name="search_not_found">Suchbegriff nicht gefunden</string> + <string name="menu_preferences">Einstellungen</string> + <string name="directory_not_saved">Verzeichnis nicht gespeichert.</string> + <string name="action_italic">Kursiv</string> + <string name="alert_copy_svg_slide_show_to_clipboard">Ihr Android-Gerät unterstützt keine In-App-SVG-Präsentation. Wir haben den Link zur Präsentation in die Zwischenablage kopiert. Drücken Sie den Home-Button, öffnen Sie einen modernen Web-Browser, fügen Sie in die Adressleiste ein und los.</string> </resources>
\ No newline at end of file diff --git a/android/source/res/values-nl/strings.xml b/android/source/res/values-nl/strings.xml index 0ca5f2cbbe96..1ab5845a8ba6 100644 --- a/android/source/res/values-nl/strings.xml +++ b/android/source/res/values-nl/strings.xml @@ -116,4 +116,18 @@ <string name="part_name_changed">De naam voor de sectie is gewijzigd.</string> <string name="page">Pagina</string> <string name="font_color">Tekstkleur</string> + <string name="alert_copy_svg_slide_show_to_clipboard_dismiss">OK</string> + <string name="message_save_incomplete">Opslaan onvolledig. Waren er veranderingen?</string> + <string name="action_underline">Onderstrepen</string> + <string name="unable_to_go_further">Kan niet verder te gaan.</string> + <string name="action_bold">Vet</string> + <string name="browser_app_name">LibreOffice Browser</string> + <string name="menu_search">Zoeken</string> + <string name="app_about_name"><b>LibreOffice Viewer \'Beta\'</b></string> + <string name="action_strikeout">Doorhalen</string> + <string name="search_not_found">Sleutelwoord niet gevonden</string> + <string name="menu_preferences">Voorkeuren</string> + <string name="directory_not_saved">Map is niet opgeslagen</string> + <string name="action_italic">Cursief</string> + <string name="alert_copy_svg_slide_show_to_clipboard">Uw Android-apparaat ondersteunt geen in-app SVG-diavoorstelling. We hebben de link naar de diavoorstelling naar het klembord gekopieerd. Druk op de knop Start, open een moderne webbrowser, plak deze in de adresbalk en ga.</string> </resources>
\ No newline at end of file diff --git a/android/source/res/values-pt-rBR/strings.xml b/android/source/res/values-pt-rBR/strings.xml index f0e73cf5d6f9..33e59983a6ec 100644 --- a/android/source/res/values-pt-rBR/strings.xml +++ b/android/source/res/values-pt-rBR/strings.xml @@ -116,4 +116,18 @@ <string name="pdf_export_finished">Exportação em PDF terminada</string> <string name="unable_to_save">Não foi possível salvar o arquivo</string> <string name="action_rename_slide">Renomear slide</string> + <string name="alert_copy_svg_slide_show_to_clipboard_dismiss">OK</string> + <string name="message_save_incomplete">Gravação incompleta. Houve mudanças?</string> + <string name="action_underline">Sublinhado</string> + <string name="unable_to_go_further">Não foi possível ir mais longe.</string> + <string name="action_bold">Negrito</string> + <string name="browser_app_name">Navegador LibreOffice</string> + <string name="menu_search">Pesquisar</string> + <string name="app_about_name"><b>LibreOffice Viewer \'Beta\'</b></string> + <string name="action_strikeout">Tachado</string> + <string name="search_not_found">Palavra-chave não encontrada</string> + <string name="menu_preferences">Preferências</string> + <string name="directory_not_saved">Diretório não salvo.</string> + <string name="action_italic">Itálico</string> + <string name="alert_copy_svg_slide_show_to_clipboard">Seu dispositivo Android não permite apresentações em SVG dentro da aplicação. O link foi copiado para a área de transferência. Abra um navegador internet moderno, cole o endereço na barra de endereços e navegue.</string> </resources>
\ No newline at end of file diff --git a/android/source/res/values-tr/strings.xml b/android/source/res/values-tr/strings.xml index ff633eb0320e..cbdca2874d00 100644 --- a/android/source/res/values-tr/strings.xml +++ b/android/source/res/values-tr/strings.xml @@ -137,4 +137,16 @@ <string name="unable_to_save">Dosya kaydedilemiyor</string> <string name="message_saving_failed">Belge kaydedilemedi.</string> <string name="select_file_to_open">Açılacak dosyayı seçin</string> + <string name="alert_copy_svg_slide_show_to_clipboard_dismiss">Tamam</string> + <string name="message_save_incomplete">Kayıt tamamlanmadı. Değişiklik yapıldı mı?</string> + <string name="action_underline">Altı çizgili</string> + <string name="unable_to_go_further">Daha fazla ilerlenemiyor.</string> + <string name="action_bold">Kalın</string> + <string name="browser_app_name">LibreOffice Tarayıcı</string> + <string name="app_about_name"><b>LibreOffice Görüntüleyici \'Beta\'</b></string> + <string name="action_strikeout">Üzeri çizgili</string> + <string name="menu_preferences">Seçenekler</string> + <string name="directory_not_saved">Dizin kaydedilmedi.</string> + <string name="action_italic">Yana yatık</string> + <string name="alert_copy_svg_slide_show_to_clipboard">Cihazınız uygulama içi slayt gösterisini desteklemiyor. Sunumu panoya kopyaladık. Lütfen ev tuşuna basıp modern bir tarayıcı açıp arama çubuğuna yapıştırın ve sunumu görüntüleyin.</string> </resources>
\ No newline at end of file diff --git a/android/source/res/values-zh-rTW/strings.xml b/android/source/res/values-zh-rTW/strings.xml index e32772133bd8..10f878d68bdb 100644 --- a/android/source/res/values-zh-rTW/strings.xml +++ b/android/source/res/values-zh-rTW/strings.xml @@ -116,4 +116,18 @@ <string name="pref_experimental_editing_summary">啟用實驗性編輯模式。使用風險自負。</string> <string name="calc_optimal_length_default_text">輸入額外長度(以 100th/mm 為單位)</string> <string name="action_presentation">投影片放映</string> + <string name="alert_copy_svg_slide_show_to_clipboard_dismiss">確定</string> + <string name="message_save_incomplete">儲存未完成。有任何變動嗎?</string> + <string name="action_underline">底線</string> + <string name="unable_to_go_further">無法更進一步。</string> + <string name="action_bold">粗體</string> + <string name="browser_app_name">LibreOffice 瀏覽器</string> + <string name="menu_search">搜尋</string> + <string name="app_about_name"><b>LibreOffice Viewer「測試版」</b></string> + <string name="action_strikeout">刪除線</string> + <string name="search_not_found">找不到關鍵字</string> + <string name="menu_preferences">偏好設定</string> + <string name="directory_not_saved">目錄未儲存。</string> + <string name="action_italic">義式斜體</string> + <string name="alert_copy_svg_slide_show_to_clipboard">您的 Android 裝置不支援應用程式內 svg 投影片放映。我們已將投影片放映的連結複製到剪貼簿。請按下主畫面按鈕,開啟現代網路瀏覽器,貼上到網址列並瀏覽。</string> </resources>
\ No newline at end of file diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx index bc8e65409130..bfbacd95a90c 100644 --- a/chart2/source/controller/main/ChartController_TextEdit.cxx +++ b/chart2/source/controller/main/ChartController_TextEdit.cxx @@ -271,8 +271,7 @@ void ChartController::executeDispatch_InsertSpecialCharacter() pOutlinerView->InsertText(aString, true); ESelection aSel = pOutlinerView->GetSelection(); - aSel.nStartPara = aSel.nEndPara; - aSel.nStartPos = aSel.nEndPos; + aSel.CollapseToEnd(); pOutlinerView->SetSelection(aSel); // show changes diff --git a/compilerplugins/clang/test/writeonlyvars.cxx b/compilerplugins/clang/test/writeonlyvars.cxx index 0fc141f62dd2..fc521fa7d417 100644 --- a/compilerplugins/clang/test/writeonlyvars.cxx +++ b/compilerplugins/clang/test/writeonlyvars.cxx @@ -24,6 +24,7 @@ #if defined LIBO_USE_SOURCE_LOCATION // expected-error@o3tl/runtimetooustring.hxx:* {{read s [loplugin:writeonlyvars]}} // expected-error@o3tl/runtimetooustring.hxx:* {{write s [loplugin:writeonlyvars]}} +// expected-error@o3tl/safeint.hxx:* {{read res [loplugin:writeonlyvars]}} #if !defined NDEBUG // expected-error@o3tl/runtimetooustring.hxx:* {{read ok [loplugin:writeonlyvars]}} #endif diff --git a/connectivity/source/drivers/dbase/DIndexIter.cxx b/connectivity/source/drivers/dbase/DIndexIter.cxx index 37e28a073f4c..5420d044d5c6 100644 --- a/connectivity/source/drivers/dbase/DIndexIter.cxx +++ b/connectivity/source/drivers/dbase/DIndexIter.cxx @@ -262,7 +262,8 @@ ONDXKey* OIndexIterator::GetNextKey() sal_uInt16 nPos = pParentPage->Search(pPage); if (nPos != pParentPage->Count() - 1) { // page found - pPage = (*pParentPage)[nPos + 1].GetChild(m_xIndex.get(), pParentPage); + pPage = (*pParentPage)[o3tl::sanitizing_inc(nPos)].GetChild(m_xIndex.get(), + pParentPage); break; } } diff --git a/cui/inc/pch/precompiled_cui.hxx b/cui/inc/pch/precompiled_cui.hxx index 3655744b08fa..cd1fdfaacf30 100644 --- a/cui/inc/pch/precompiled_cui.hxx +++ b/cui/inc/pch/precompiled_cui.hxx @@ -298,6 +298,7 @@ #include <drawinglayer/primitive2d/Primitive2DContainer.hxx> #include <drawinglayer/primitive2d/Primitive2DVisitor.hxx> #include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <editeng/ESelection.hxx> #include <editeng/editdata.hxx> #include <editeng/editengdllapi.h> #include <editeng/editstat.hxx> diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index a0c9819f0485..be2f66b059f4 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -1354,7 +1354,7 @@ bool SentenceEditWindow_Impl::KeyInput(const KeyEvent& rKeyEvt) std::vector<EECharAttrib> aAttribList; m_xEditEngine->GetCharAttribs(0, aAttribList); - auto nCursor = aCurrentSelection.nStartPos; + auto nCursor = aCurrentSelection.start.nIndex; const EECharAttrib* pBackAttr = FindCharAttrib(nCursor, EE_CHAR_BKGCOLOR, aAttribList); const EECharAttrib* pErrorAttr = FindCharAttrib(nCursor, EE_CHAR_GRABBAG, aAttribList); const EECharAttrib* pBackAttrLeft = nullptr; @@ -1365,21 +1365,21 @@ bool SentenceEditWindow_Impl::KeyInput(const KeyEvent& rKeyEvt) if (bHasRange) { if (pBackAttr && - pBackAttr->nStart == aCurrentSelection.nStartPos && - pBackAttr->nEnd == aCurrentSelection.nEndPos) + pBackAttr->nStart == aCurrentSelection.start.nIndex && + pBackAttr->nEnd == aCurrentSelection.end.nIndex) { nSelectionType = FULL; } else if (pErrorAttr && - pErrorAttr->nStart <= aCurrentSelection.nStartPos && - pErrorAttr->nEnd >= aCurrentSelection.nEndPos) + pErrorAttr->nStart <= aCurrentSelection.start.nIndex && + pErrorAttr->nEnd >= aCurrentSelection.end.nIndex) { nSelectionType = INSIDE_YES; } else { nSelectionType = bHasField||bHasError ? BRACE : OUTSIDE_NO; - while (nCursor < aCurrentSelection.nEndPos) + while (nCursor < aCurrentSelection.end.nIndex) { ++nCursor; const EECharAttrib* pIntBackAttr = FindCharAttrib(nCursor, EE_CHAR_BKGCOLOR, aAttribList); @@ -1400,8 +1400,8 @@ bool SentenceEditWindow_Impl::KeyInput(const KeyEvent& rKeyEvt) const EECharAttrib* pCurAttr = pBackAttr ? pBackAttr : pErrorAttr; if (pCurAttr) { - nSelectionType = pCurAttr->nStart == aCurrentSelection.nStartPos ? - LEFT_NO : pCurAttr->nEnd == aCurrentSelection.nEndPos ? RIGHT_NO : INSIDE_NO; + nSelectionType = pCurAttr->nStart == aCurrentSelection.start.nIndex ? + LEFT_NO : pCurAttr->nEnd == aCurrentSelection.end.nIndex ? RIGHT_NO : INSIDE_NO; } else nSelectionType = OUTSIDE_NO; @@ -1751,7 +1751,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError, const css void SentenceEditWindow_Impl::MoveErrorMarkTo(sal_Int32 nStart, sal_Int32 nEnd, bool bGrammarError) { - ESelection aAll(0, 0, 0, EE_TEXTPOS_ALL); + ESelection aAll(m_xEditEngine->NormalizeESelection(ESelection::All())); m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_COLOR); m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT); m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT_CJK); @@ -1773,7 +1773,7 @@ void SentenceEditWindow_Impl::MoveErrorMarkTo(sal_Int32 nStart, sal_Int32 nEnd, // unless (tdf#133958) the selection already overlaps this range ESelection aCurrentSelection = m_xEditView->GetSelection(); aCurrentSelection.Adjust(); - bool bCurrentSelectionInRange = nStart <= aCurrentSelection.nEndPos && aCurrentSelection.nStartPos <= nEnd; + bool bCurrentSelectionInRange = nStart <= aCurrentSelection.end.nIndex && aCurrentSelection.start.nIndex <= nEnd; if (!bCurrentSelectionInRange) { m_xEditView->SetSelection(ESelection(0, nStart)); @@ -2164,7 +2164,7 @@ void SentenceEditWindow_Impl::SetUndoEditMode(bool bSet) pWidget->set_sensitive(false); //remove error marks - ESelection aAll(0, 0, 0, EE_TEXTPOS_ALL); + ESelection aAll(m_xEditEngine->NormalizeESelection(ESelection::All())); m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_COLOR); m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT); m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT_CJK); diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx index d90b6b938f7f..acfc0d2a1433 100644 --- a/cui/source/inc/numpages.hxx +++ b/cui/source/inc/numpages.hxx @@ -99,6 +99,8 @@ class SvxBulletPickTabPage final : public SfxTabPage std::unique_ptr<weld::Button> m_xBtChangeBullet; std::unique_ptr<SvxNumValueSet> m_xExamplesVS; std::unique_ptr<weld::CustomWeld> m_xExamplesVSWin; + css::uno::Sequence<OUString> m_aBulletSymbols; + css::uno::Sequence<OUString> m_aBulletSymbolsFonts; DECL_LINK(NumSelectHdl_Impl, ValueSet*, void); DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 27d3d8f243e8..d531e0a59d68 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -475,11 +475,7 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog(weld::Window* pParent, bool fromExten , bNeedsRestart(false) , eRestartReason(svtools::RESTART_REASON_NONE) { - Size aSize(xTreeLB->get_approximate_digit_width() * 82, xTreeLB->get_height_rows(30)); -#if HAVE_FEATURE_GPGME - // tdf#115015: make enough space for crypto settings (approx. 14 text edits + padding) - aSize.setHeight((weld::GetMinimumEditHeight() + 6) * 14); -#endif + Size aSize(xTreeLB->get_approximate_digit_width() * 100, xTreeLB->get_height_rows(30)); xTabBox->set_size_request(aSize.Width(), aSize.Height()); xTreeLB->set_size_request(xTreeLB->get_approximate_digit_width() * 35, aSize.Height()); diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index c0495541ca61..6a838d001772 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -335,6 +335,8 @@ SvxBulletPickTabPage::SvxBulletPickTabPage(weld::Container* pPage, weld::DialogC m_xExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl)); m_xExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl)); m_xBtChangeBullet->connect_clicked(LINK(this, SvxBulletPickTabPage, ClickAddChangeHdl_Impl)); + m_aBulletSymbols = officecfg::Office::Common::BulletsNumbering::DefaultBullets::get(); + m_aBulletSymbolsFonts = officecfg::Office::Common::BulletsNumbering::DefaultBulletsFonts::get(); } SvxBulletPickTabPage::~SvxBulletPickTabPage() @@ -394,6 +396,14 @@ void SvxBulletPickTabPage::ActivatePage(const SfxItemSet& rSet) DeactivateRC SvxBulletPickTabPage::DeactivatePage(SfxItemSet *_pSet) { + if (IsCancelMode()) + { + // Dialog cancelled, restore previous bullets + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::BulletsNumbering::DefaultBullets::set(m_aBulletSymbols, batch); + officecfg::Office::Common::BulletsNumbering::DefaultBulletsFonts::set(m_aBulletSymbolsFonts, batch); + batch->commit(); + } if(_pSet) FillItemSet(_pSet); return DeactivateRC::LeavePage; @@ -432,10 +442,9 @@ IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, void) bPreset = false; bModified = true; sal_uInt16 nIndex = m_xExamplesVS->GetSelectedItemId() - 1; - sal_Unicode cChar = officecfg::Office::Common::BulletsNumbering::DefaultBullets::get()[nIndex].toChar(); + sal_Unicode cChar = m_aBulletSymbols[nIndex].toChar(); vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont(); - rActBulletFont.SetFamilyName( - officecfg::Office::Common::BulletsNumbering::DefaultBulletsFonts::get()[nIndex]); + rActBulletFont.SetFamilyName(m_aBulletSymbolsFonts[nIndex]); sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) @@ -516,15 +525,13 @@ IMPL_LINK_NOARG(SvxBulletPickTabPage, ClickAddChangeHdl_Impl, weld::Button&, voi _nMask <<= 1; } - css::uno::Sequence<OUString> aBulletSymbols(officecfg::Office::Common::BulletsNumbering::DefaultBullets::get()); - css::uno::Sequence<OUString> aBulletSymbolsFonts(officecfg::Office::Common::BulletsNumbering::DefaultBulletsFonts::get()); - css::uno::Sequence<OUString> aBulletSymbolsList(aBulletSymbols.size()); - css::uno::Sequence<OUString> aBulletSymbolsFontsList(aBulletSymbolsFonts.size()); + css::uno::Sequence<OUString> aBulletSymbolsList(m_aBulletSymbols.size()); + css::uno::Sequence<OUString> aBulletSymbolsFontsList(m_aBulletSymbolsFonts.size()); auto aBulletSymbolsListRange = asNonConstRange(aBulletSymbolsList); auto aBulletSymbolsFontsListRange = asNonConstRange(aBulletSymbolsFontsList); sal_uInt16 nIndex = m_xExamplesVS->GetSelectedItemId() - 1; - for (size_t i = 0; i < aBulletSymbols.size(); ++i) + for (size_t i = 0; i < m_aBulletSymbols.size(); ++i) { if (i == nIndex) { @@ -533,8 +540,8 @@ IMPL_LINK_NOARG(SvxBulletPickTabPage, ClickAddChangeHdl_Impl, weld::Button&, voi } else { - aBulletSymbolsListRange[i] = aBulletSymbols[i]; - aBulletSymbolsFontsListRange[i] = aBulletSymbolsFonts[i]; + aBulletSymbolsListRange[i] = m_aBulletSymbols[i]; + aBulletSymbolsFontsListRange[i] = m_aBulletSymbolsFonts[i]; } } diff --git a/dbaccess/source/ui/app/DocumentInfoPreview.cxx b/dbaccess/source/ui/app/DocumentInfoPreview.cxx index ed7f9f862c97..6eb547bb8f72 100644 --- a/dbaccess/source/ui/app/DocumentInfoPreview.cxx +++ b/dbaccess/source/ui/app/DocumentInfoPreview.cxx @@ -103,28 +103,18 @@ void ODocumentInfoPreview::fill( } } - m_xEditView->SetSelection(ESelection(0, 0, 0, 0)); -} - -namespace -{ - ESelection InsertAtEnd(const EditEngine& rEditEngine) - { - const sal_uInt32 nPara = rEditEngine.GetParagraphCount() -1; - sal_Int32 nLastLen = rEditEngine.GetText(nPara).getLength(); - return ESelection(nPara, nLastLen, nPara, nLastLen); - } + m_xEditView->SetSelection(ESelection(0, 0)); } void ODocumentInfoPreview::insertEntry( std::u16string_view title, OUString const & value) { if (!m_xEditEngine->GetText().isEmpty()) { - m_xEditEngine->QuickInsertText(u"\n\n"_ustr, InsertAtEnd(*m_xEditEngine)); + m_xEditEngine->QuickInsertText(u"\n\n"_ustr, ESelection::AtEnd()); } OUString caption(OUString::Concat(title) + ":\n"); - m_xEditEngine->QuickInsertText(caption, InsertAtEnd(*m_xEditEngine)); + m_xEditEngine->QuickInsertText(caption, ESelection::AtEnd()); SfxItemSet aSet(m_xEditEngine->GetEmptyItemSet()); aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT)); @@ -133,7 +123,7 @@ void ODocumentInfoPreview::insertEntry( int nCaptionPara = m_xEditEngine->GetParagraphCount() - 2; m_xEditEngine->QuickSetAttribs(aSet, ESelection(nCaptionPara, 0, nCaptionPara, caption.getLength() - 1)); - m_xEditEngine->QuickInsertText(value, InsertAtEnd(*m_xEditEngine)); + m_xEditEngine->QuickInsertText(value, ESelection::AtEnd()); } void ODocumentInfoPreview::insertNonempty(tools::Long id, OUString const & value) diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index b616f1303ac8..70aa8b23aff2 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -203,7 +203,7 @@ void SQLEditView::UpdateData() { OUString aLine( rEditEngine.GetText( nLine ) ); - ESelection aAllLine(nLine, 0, nLine, EE_TEXTPOS_ALL); + ESelection aAllLine(nLine, 0, nLine, EE_TEXTPOS_MAX); rEditEngine.RemoveAttribs(aAllLine, false, EE_CHAR_COLOR); rEditEngine.RemoveAttribs(aAllLine, false, EE_CHAR_WEIGHT); rEditEngine.RemoveAttribs(aAllLine, false, EE_CHAR_WEIGHT_CJK); @@ -234,8 +234,8 @@ void SQLEditView::UpdateData() void SQLEditView::DoBracketHilight(sal_uInt16 nKey) { ESelection aCurrentPos = m_xEditView->GetSelection(); - sal_Int32 nStartPos = aCurrentPos.nStartPos; - const sal_uInt32 nStartPara = aCurrentPos.nStartPara; + sal_Int32 nStartPos = aCurrentPos.start.nIndex; + const sal_uInt32 nStartPara = aCurrentPos.start.nPara; sal_uInt16 nCount = 0; int nChar = -1; @@ -294,7 +294,7 @@ void SQLEditView::DoBracketHilight(sal_uInt16 nKey) aSet.Put(SvxWeightItem(WEIGHT_ULTRABOLD, EE_CHAR_WEIGHT_CTL)); m_xEditEngine->QuickSetAttribs(aSet, ESelection(nPara, i, nPara, i + 1)); - m_xEditEngine->QuickSetAttribs(aSet, ESelection(nStartPara, nStartPos, nStartPara, nStartPos)); + m_xEditEngine->QuickSetAttribs(aSet, ESelection(nStartPara, nStartPos)); return; } else @@ -415,11 +415,9 @@ bool SQLEditView::Command(const CommandEvent& rCEvt) pEditView->DeleteSelected(); else if (sCommand == "selectall") { - sal_Int32 nPar = m_xEditEngine->GetParagraphCount(); - if (nPar) + if (m_xEditEngine->GetParagraphCount()) { - sal_Int32 nLen = m_xEditEngine->GetTextLen(nPar - 1); - pEditView->SetSelection(ESelection(0, 0, nPar - 1, nLen)); + pEditView->SetSelection(ESelection::All()); } } else if (sCommand == "specialchar") diff --git a/dictionaries b/dictionaries -Subproject c2fa5d1c0f1af4d90d589f1977b4fcb298b2b43 +Subproject fe28e9bfbb6ae4c38683dde4b9d6ae87cbe56a3 diff --git a/editeng/inc/outleeng.hxx b/editeng/inc/outleeng.hxx index 36194c3d0f6f..79495bb07899 100644 --- a/editeng/inc/outleeng.hxx +++ b/editeng/inc/outleeng.hxx @@ -77,6 +77,8 @@ public: virtual tools::Rectangle GetBulletArea( sal_Int32 nPara ) override; + sal_Int16 GetDepth( sal_Int32 nPara ) const; + /// @returns state of the SdrCompatibilityFlag std::optional<bool> GetCompatFlag(SdrCompatibilityFlag eFlag) const; diff --git a/editeng/qa/unit/ESelectionTest.cxx b/editeng/qa/unit/ESelectionTest.cxx index 27b9256b29d7..264a0aa2c7ac 100644 --- a/editeng/qa/unit/ESelectionTest.cxx +++ b/editeng/qa/unit/ESelectionTest.cxx @@ -20,42 +20,42 @@ CPPUNIT_TEST_FIXTURE(ESelectionTest, testConstruction) { { ESelection aNewSelection; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aNewSelection.nStartPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aNewSelection.nStartPos); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aNewSelection.nEndPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aNewSelection.nEndPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aNewSelection.start.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aNewSelection.start.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aNewSelection.end.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aNewSelection.end.nIndex); } { ESelection aNewSelection(1, 2, 3, 4); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aNewSelection.nStartPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aNewSelection.nStartPos); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aNewSelection.nEndPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aNewSelection.nEndPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aNewSelection.start.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aNewSelection.start.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aNewSelection.end.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aNewSelection.end.nIndex); } { ESelection aNewSelection = { 1, 2, 3, 4 }; - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aNewSelection.nStartPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aNewSelection.nStartPos); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aNewSelection.nEndPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aNewSelection.nEndPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aNewSelection.start.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aNewSelection.start.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aNewSelection.end.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aNewSelection.end.nIndex); } { ESelection aNewSelection{ 1, 2, 3, 4 }; - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aNewSelection.nStartPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aNewSelection.nStartPos); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aNewSelection.nEndPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aNewSelection.nEndPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aNewSelection.start.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aNewSelection.start.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aNewSelection.end.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aNewSelection.end.nIndex); } { ESelection aNewSelection(1, 2); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aNewSelection.nStartPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aNewSelection.nStartPos); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aNewSelection.nEndPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aNewSelection.nEndPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aNewSelection.start.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aNewSelection.start.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aNewSelection.end.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aNewSelection.end.nIndex); } } @@ -98,15 +98,6 @@ CPPUNIT_TEST_FIXTURE(ESelectionTest, testEquals) CPPUNIT_ASSERT_EQUAL(aSelection1, aSelection2); } -CPPUNIT_TEST_FIXTURE(ESelectionTest, testIsZero) -{ - ESelection aEmpty; - CPPUNIT_ASSERT_EQUAL(true, aEmpty.IsZero()); - - CPPUNIT_ASSERT_EQUAL(false, ESelection(1, 2, 1, 2).IsZero()); - CPPUNIT_ASSERT_EQUAL(true, ESelection(0, 0, 0, 0).IsZero()); -} - CPPUNIT_TEST_FIXTURE(ESelectionTest, testLess) { // Both equal diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index 3987dbe89a66..b1d39267b6fb 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -38,12 +38,13 @@ #include <com/sun/star/text/textfield/Type.hpp> #include <memory> +#include <vector> #include <editeng/outliner.hxx> using namespace com::sun::star; -namespace { - +namespace +{ class Test : public test::BootstrapFixture { public: @@ -87,6 +88,12 @@ public: /// Test Paste using an HTML fragment void testHTMLFragmentPaste(); + /// Test Paste using an RTF + void testRTFPaste(); + + /// Test Paste preference HTML/ + void testRTFHTMLPaste(); + /// Test Copy/Paste with selective selection over multiple paragraphs void testMultiParaSelCopyPaste(); @@ -127,7 +134,7 @@ public: void testTdf151748StaleKashidaArray(); void testTdf162803StaleKashidaArray(); - DECL_STATIC_LINK( Test, CalcFieldValueHdl, EditFieldInfo*, void ); + DECL_STATIC_LINK(Test, CalcFieldValueHdl, EditFieldInfo*, void); CPPUNIT_TEST_SUITE(Test); #if HAVE_MORE_FONTS @@ -140,6 +147,8 @@ public: CPPUNIT_TEST(testCopyPaste); CPPUNIT_TEST(testHTMLPaste); CPPUNIT_TEST(testHTMLFragmentPaste); + CPPUNIT_TEST(testRTFPaste); + CPPUNIT_TEST(testRTFHTMLPaste); CPPUNIT_TEST(testMultiParaSelCopyPaste); CPPUNIT_TEST(testTabsCopyPaste); CPPUNIT_TEST(testHyperlinkSearch); @@ -171,12 +180,12 @@ void Test::testLineSpacing() // Create EditEngine's instance EditEngine aEditEngine(mpItemPool.get()); - if(aEditEngine.GetRefDevice()->GetDPIY() != 96 + if (aEditEngine.GetRefDevice()->GetDPIY() != 96 || aEditEngine.GetRefDevice()->GetDPIScaleFactor() != 1.0) return; // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // Initially no text should be there CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); @@ -195,8 +204,7 @@ void Test::testLineSpacing() // Select all paragraphs ESelection aSelection(0, 0, 0, aTextLen); - auto doTest = [&](sal_uInt16 nSpace, sal_uInt16 nExpMaxAscent, sal_uInt32 nExpLineHeight) - { + auto doTest = [&](sal_uInt16 nSpace, sal_uInt16 nExpMaxAscent, sal_uInt32 nExpLineHeight) { std::unique_ptr<SfxItemSet> pSet(new SfxItemSet(aEditEngine.GetEmptyItemSet())); SvxLineSpacingItem aLineSpacing(LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL); aLineSpacing.SetPropLineSpace(nSpace); @@ -253,7 +261,7 @@ void Test::testConstruction() bool includes(const uno::Sequence<OUString>& rSeq, std::u16string_view rVal) { - for (OUString const & s : rSeq) + for (OUString const& s : rSeq) if (s == rVal) return true; @@ -304,7 +312,8 @@ void Test::testUnoTextFields() { // FILE - rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::DOCINFO_TITLE)); + rtl::Reference<SvxUnoTextField> xField( + new SvxUnoTextField(text::textfield::Type::DOCINFO_TITLE)); uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames(); bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.docinfo.Title"); CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood); @@ -320,7 +329,8 @@ void Test::testUnoTextFields() { // EXTENDED TIME - rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::EXTENDED_TIME)); + rtl::Reference<SvxUnoTextField> xField( + new SvxUnoTextField(text::textfield::Type::EXTENDED_TIME)); uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames(); bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.DateTime"); CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood); @@ -328,7 +338,8 @@ void Test::testUnoTextFields() { // EXTENDED FILE - rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::EXTENDED_FILE)); + rtl::Reference<SvxUnoTextField> xField( + new SvxUnoTextField(text::textfield::Type::EXTENDED_FILE)); uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames(); bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.FileName"); CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood); @@ -352,7 +363,8 @@ void Test::testUnoTextFields() { // PRESENTATION HEADER - rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::PRESENTATION_HEADER)); + rtl::Reference<SvxUnoTextField> xField( + new SvxUnoTextField(text::textfield::Type::PRESENTATION_HEADER)); uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames(); bool bGood = includes(aSvcs, u"com.sun.star.presentation.textfield.Header"); CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood); @@ -360,7 +372,8 @@ void Test::testUnoTextFields() { // PRESENTATION FOOTER - rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::PRESENTATION_FOOTER)); + rtl::Reference<SvxUnoTextField> xField( + new SvxUnoTextField(text::textfield::Type::PRESENTATION_FOOTER)); uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames(); bool bGood = includes(aSvcs, u"com.sun.star.presentation.textfield.Footer"); CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood); @@ -368,7 +381,8 @@ void Test::testUnoTextFields() { // PRESENTATION DATE TIME - rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::PRESENTATION_DATE_TIME)); + rtl::Reference<SvxUnoTextField> xField( + new SvxUnoTextField(text::textfield::Type::PRESENTATION_DATE_TIME)); uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames(); bool bGood = includes(aSvcs, u"com.sun.star.presentation.textfield.DateTime"); CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood); @@ -379,46 +393,44 @@ class TestAutoCorrDoc : public SvxAutoCorrDoc { public: /// just like the real thing, this dummy modifies the rText parameter :( - TestAutoCorrDoc(OUString &rText, LanguageType eLang) + TestAutoCorrDoc(OUString& rText, LanguageType eLang) : m_rText(rText) , m_eLang(eLang) { } - OUString const& getResult() const - { - return m_rText; - } + OUString const& getResult() const { return m_rText; } + private: - OUString & m_rText; + OUString& m_rText; LanguageType m_eLang; - virtual bool Delete( sal_Int32 nStt, sal_Int32 nEnd ) override + virtual bool Delete(sal_Int32 nStt, sal_Int32 nEnd) override { //fprintf(stderr, "TestAutoCorrDoc::Delete\n"); - m_rText = m_rText.replaceAt(nStt, nEnd-nStt, u""); + m_rText = m_rText.replaceAt(nStt, nEnd - nStt, u""); return true; } - virtual bool Insert( sal_Int32 nPos, const OUString& rTxt ) override + virtual bool Insert(sal_Int32 nPos, const OUString& rTxt) override { //fprintf(stderr, "TestAutoCorrDoc::Insert\n"); m_rText = m_rText.replaceAt(nPos, 0, rTxt); return true; } - virtual bool Replace( sal_Int32 nPos, const OUString& rTxt ) override + virtual bool Replace(sal_Int32 nPos, const OUString& rTxt) override { //fprintf(stderr, "TestAutoCorrDoc::Replace\n"); - return ReplaceRange( nPos, rTxt.getLength(), rTxt ); + return ReplaceRange(nPos, rTxt.getLength(), rTxt); } - virtual bool ReplaceRange( sal_Int32 nPos, sal_Int32 nLen, const OUString& rTxt ) override + virtual bool ReplaceRange(sal_Int32 nPos, sal_Int32 nLen, const OUString& rTxt) override { //fprintf(stderr, "TestAutoCorrDoc::ReplaceRange %d %d %s\n", nPos, nLen, OUStringToOString(rTxt, RTL_TEXTENCODING_UTF8).getStr()); m_rText = m_rText.replaceAt(nPos, nLen, rTxt); return true; } - virtual void SetAttr( sal_Int32, sal_Int32, sal_uInt16, SfxPoolItem& ) override + virtual void SetAttr(sal_Int32, sal_Int32, sal_uInt16, SfxPoolItem&) override { //fprintf(stderr, "TestAutoCorrDoc::SetAttr\n"); } - virtual bool SetINetAttr( sal_Int32, sal_Int32, const OUString& ) override + virtual bool SetINetAttr(sal_Int32, sal_Int32, const OUString&) override { //fprintf(stderr, "TestAutoCorrDoc::SetINetAttr\n"); return true; @@ -428,30 +440,29 @@ private: //fprintf(stderr, "TestAutoCorrDoc::GetPrevPara\n"); return nullptr; } - virtual bool ChgAutoCorrWord( sal_Int32& rSttPos, - sal_Int32 nEndPos, SvxAutoCorrect& rACorrect, - OUString* pPara ) override + virtual bool ChgAutoCorrWord(sal_Int32& rSttPos, sal_Int32 nEndPos, SvxAutoCorrect& rACorrect, + OUString* pPara) override { //fprintf(stderr, "TestAutoCorrDoc::ChgAutoCorrWord\n"); if (m_rText.isEmpty()) return false; - LanguageTag aLanguageTag( m_eLang); - const SvxAutocorrWord* pFnd = rACorrect.SearchWordsInList( - m_rText, rSttPos, nEndPos, *this, aLanguageTag); + LanguageTag aLanguageTag(m_eLang); + const SvxAutocorrWord* pFnd + = rACorrect.SearchWordsInList(m_rText, rSttPos, nEndPos, *this, aLanguageTag); if (pFnd && pFnd->IsTextOnly()) { m_rText = m_rText.replaceAt(rSttPos, nEndPos, pFnd->GetLong()); - if( pPara ) + if (pPara) pPara->clear(); // =&pCurNode->GetString(); return true; } return false; } - virtual bool TransliterateRTLWord( sal_Int32& /*rSttPos*/, - sal_Int32 /*nEndPos*/, bool /*bApply*/ ) override + virtual bool TransliterateRTLWord(sal_Int32& /*rSttPos*/, sal_Int32 /*nEndPos*/, + bool /*bApply*/) override { return false; } @@ -535,10 +546,9 @@ void Test::testAutocorrect() CPPUNIT_ASSERT_EQUAL_MESSAGE("autocorrect", OUString(sExpected), aFoo.getResult()); } - } -IMPL_STATIC_LINK( Test, CalcFieldValueHdl, EditFieldInfo*, pInfo, void ) +IMPL_STATIC_LINK(Test, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) { if (!pInfo) return; @@ -549,18 +559,18 @@ IMPL_STATIC_LINK( Test, CalcFieldValueHdl, EditFieldInfo*, pInfo, void ) { // URLField OUString aURL = pURLField->GetURL(); - switch ( pURLField->GetFormat() ) + switch (pURLField->GetFormat()) { case SvxURLFormat::AppDefault: case SvxURLFormat::Repr: { - pInfo->SetRepresentation( pURLField->GetRepresentation() ); + pInfo->SetRepresentation(pURLField->GetRepresentation()); } break; case SvxURLFormat::Url: { - pInfo->SetRepresentation( aURL ); + pInfo->SetRepresentation(aURL); } break; } @@ -576,17 +586,17 @@ void Test::testHyperlinkCopyPaste() { // Create Outliner instance Outliner aOutliner(mpItemPool.get(), OutlinerMode::TextObject); - aOutliner.SetCalcFieldValueHdl( LINK( nullptr, Test, CalcFieldValueHdl ) ); + aOutliner.SetCalcFieldValueHdl(LINK(nullptr, Test, CalcFieldValueHdl)); // Create EditEngine's instance - EditEngine& aEditEngine = const_cast<EditEngine&> (aOutliner.GetEditEngine()); + EditEngine& aEditEngine = const_cast<EditEngine&>(aOutliner.GetEditEngine()); // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // New instance must be empty - no initial text - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetParaAsString(sal_Int32(0))); // Get corresponding Field Item for inserting URLs in text // URL 1 @@ -604,26 +614,26 @@ void Test::testHyperlinkCopyPaste() OUString aParaText = u"sampletextfortestingfeaturefields"_ustr; // Positions Ref .............*13....*20.......... sal_Int32 aTextLen = aParaText.getLength(); - aEditEngine.SetText( aParaText ); + aEditEngine.SetText(aParaText); // Assert changes - CPPUNIT_ASSERT_EQUAL( aTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( aParaText, rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(aParaText, rDoc.GetParaAsString(sal_Int32(0))); // Insert URL 1 - ContentNode *pNode = rDoc.GetObject(0); - EditSelection aSel1( EditPaM(pNode, 13), EditPaM(pNode, 13) ); - aEditEngine.InsertField( aSel1, aField1 ); + ContentNode* pNode = rDoc.GetObject(0); + EditSelection aSel1(EditPaM(pNode, 13), EditPaM(pNode, 13)); + aEditEngine.InsertField(aSel1, aField1); // Assert Field Count - CPPUNIT_ASSERT_EQUAL( sal_uInt16(1), aEditEngine.GetFieldCount(0) ); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), aEditEngine.GetFieldCount(0)); // Insert URL 2 - EditSelection aSel2( EditPaM(pNode, 20 + 1), EditPaM(pNode, 20 + 1) ); - aEditEngine.InsertField( aSel2, aField2 ); + EditSelection aSel2(EditPaM(pNode, 20 + 1), EditPaM(pNode, 20 + 1)); + aEditEngine.InsertField(aSel2, aField2); // Assert Field Count - CPPUNIT_ASSERT_EQUAL( sal_uInt16(2), aEditEngine.GetFieldCount(0) ); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), aEditEngine.GetFieldCount(0)); // Assert URL Fields and text before copy // Check text @@ -631,36 +641,40 @@ void Test::testHyperlinkCopyPaste() CPPUNIT_ASSERT_EQUAL( u"sampletextforuser@example.comtestingexample@domain.comfeaturefields"_ustr, rDoc.GetParaAsString(sal_Int32(0)) ); // Check Field 1 - EFieldInfo aURLFieldInfo1 = aEditEngine.GetFieldInfo( sal_Int32(0), sal_uInt16(0) ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(13), aURLFieldInfo1.aPosition.nIndex ); - CPPUNIT_ASSERT_EQUAL( sal_uInt16(EE_FEATURE_FIELD), aURLFieldInfo1.pFieldItem->Which() ); - SvxURLField* pURLField1 = dynamic_cast<SvxURLField*> ( const_cast<SvxFieldData*> (aURLFieldInfo1.pFieldItem->GetField()) ); + EFieldInfo aURLFieldInfo1 = aEditEngine.GetFieldInfo(sal_Int32(0), sal_uInt16(0)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(13), aURLFieldInfo1.aPosition.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(EE_FEATURE_FIELD), aURLFieldInfo1.pFieldItem->Which()); + SvxURLField* pURLField1 = dynamic_cast<SvxURLField*>( + const_cast<SvxFieldData*>(aURLFieldInfo1.pFieldItem->GetField())); CPPUNIT_ASSERT(pURLField1); - CPPUNIT_ASSERT_EQUAL( aURL1, pURLField1->GetURL() ); - CPPUNIT_ASSERT_EQUAL( aRepres1, pURLField1->GetRepresentation() ); + CPPUNIT_ASSERT_EQUAL(aURL1, pURLField1->GetURL()); + CPPUNIT_ASSERT_EQUAL(aRepres1, pURLField1->GetRepresentation()); // Check Field 2 - EFieldInfo aURLFieldInfo2 = aEditEngine.GetFieldInfo( sal_Int32(0), sal_uInt16(1) ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(21), aURLFieldInfo2.aPosition.nIndex ); - CPPUNIT_ASSERT_EQUAL( sal_uInt16(EE_FEATURE_FIELD), aURLFieldInfo2.pFieldItem->Which() ); - SvxURLField* pURLField2 = dynamic_cast<SvxURLField*> ( const_cast<SvxFieldData*> (aURLFieldInfo2.pFieldItem->GetField()) ); + EFieldInfo aURLFieldInfo2 = aEditEngine.GetFieldInfo(sal_Int32(0), sal_uInt16(1)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(21), aURLFieldInfo2.aPosition.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(EE_FEATURE_FIELD), aURLFieldInfo2.pFieldItem->Which()); + SvxURLField* pURLField2 = dynamic_cast<SvxURLField*>( + const_cast<SvxFieldData*>(aURLFieldInfo2.pFieldItem->GetField())); CPPUNIT_ASSERT(pURLField2); - CPPUNIT_ASSERT_EQUAL( aURL2, pURLField2->GetURL() ); - CPPUNIT_ASSERT_EQUAL( aRepres2, pURLField2->GetRepresentation() ); + CPPUNIT_ASSERT_EQUAL(aURL2, pURLField2->GetURL()); + CPPUNIT_ASSERT_EQUAL(aRepres2, pURLField2->GetRepresentation()); // Copy text using legacy format - uno::Reference< datatransfer::XTransferable > xData = aEditEngine.CreateTransferable( ESelection(0,10,0,21) ); + uno::Reference<datatransfer::XTransferable> xData + = aEditEngine.CreateTransferable(ESelection(0, 10, 0, 21)); // Paste text at the end - aEditEngine.InsertText( xData, OUString(), rDoc.GetEndPaM(), true ); + aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); // Assert Changes ACP, ACP: after Copy/Paste // Check the fields count - CPPUNIT_ASSERT_EQUAL( sal_uInt16(3), aEditEngine.GetFieldCount(0) ); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), aEditEngine.GetFieldCount(0)); // Check the updated text length - CPPUNIT_ASSERT_EQUAL( aTextLen + 10 + aRepres1.getLength()*2 + aRepres2.getLength(), rDoc.GetTextLen() ); + CPPUNIT_ASSERT_EQUAL(aTextLen + 10 + aRepres1.getLength() * 2 + aRepres2.getLength(), + rDoc.GetTextLen()); // Check the updated text contents CPPUNIT_ASSERT_EQUAL( u"sampletextforuser@example.comtestingexample@domain.comfeaturefieldsforuser@example.comtesting"_ustr, rDoc.GetParaAsString(sal_Int32(0)) ); @@ -668,118 +682,142 @@ void Test::testHyperlinkCopyPaste() // Check the Fields and their values // Field 1 - EFieldInfo aACPURLFieldInfo1 = aEditEngine.GetFieldInfo( sal_Int32(0), sal_uInt16(0) ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(13), aACPURLFieldInfo1.aPosition.nIndex ); - CPPUNIT_ASSERT_EQUAL( sal_uInt16(EE_FEATURE_FIELD), aACPURLFieldInfo1.pFieldItem->Which() ); - SvxURLField* pACPURLField1 = dynamic_cast<SvxURLField*> ( const_cast<SvxFieldData*> (aACPURLFieldInfo1.pFieldItem->GetField()) ); + EFieldInfo aACPURLFieldInfo1 = aEditEngine.GetFieldInfo(sal_Int32(0), sal_uInt16(0)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(13), aACPURLFieldInfo1.aPosition.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(EE_FEATURE_FIELD), aACPURLFieldInfo1.pFieldItem->Which()); + SvxURLField* pACPURLField1 = dynamic_cast<SvxURLField*>( + const_cast<SvxFieldData*>(aACPURLFieldInfo1.pFieldItem->GetField())); CPPUNIT_ASSERT(pACPURLField1); - CPPUNIT_ASSERT_EQUAL( aURL1, pACPURLField1->GetURL() ); - CPPUNIT_ASSERT_EQUAL( aRepres1, pACPURLField1->GetRepresentation() ); + CPPUNIT_ASSERT_EQUAL(aURL1, pACPURLField1->GetURL()); + CPPUNIT_ASSERT_EQUAL(aRepres1, pACPURLField1->GetRepresentation()); // Field 2 - EFieldInfo aACPURLFieldInfo2 = aEditEngine.GetFieldInfo( sal_Int32(0), sal_uInt16(1) ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(21), aACPURLFieldInfo2.aPosition.nIndex ); - CPPUNIT_ASSERT_EQUAL( sal_uInt16(EE_FEATURE_FIELD), aACPURLFieldInfo2.pFieldItem->Which() ); - SvxURLField* pACPURLField2 = dynamic_cast<SvxURLField*> ( const_cast<SvxFieldData*> (aACPURLFieldInfo2.pFieldItem->GetField()) ); + EFieldInfo aACPURLFieldInfo2 = aEditEngine.GetFieldInfo(sal_Int32(0), sal_uInt16(1)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(21), aACPURLFieldInfo2.aPosition.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(EE_FEATURE_FIELD), aACPURLFieldInfo2.pFieldItem->Which()); + SvxURLField* pACPURLField2 = dynamic_cast<SvxURLField*>( + const_cast<SvxFieldData*>(aACPURLFieldInfo2.pFieldItem->GetField())); CPPUNIT_ASSERT(pACPURLField2); - CPPUNIT_ASSERT_EQUAL( aURL2, pACPURLField2->GetURL() ); - CPPUNIT_ASSERT_EQUAL( aRepres2, pACPURLField2->GetRepresentation() ) ; + CPPUNIT_ASSERT_EQUAL(aURL2, pACPURLField2->GetURL()); + CPPUNIT_ASSERT_EQUAL(aRepres2, pACPURLField2->GetRepresentation()); // Field 3 - EFieldInfo aACPURLFieldInfo3 = aEditEngine.GetFieldInfo( sal_Int32(0), sal_uInt16(2) ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(38), aACPURLFieldInfo3.aPosition.nIndex ); - CPPUNIT_ASSERT_EQUAL( sal_uInt16(EE_FEATURE_FIELD), aACPURLFieldInfo3.pFieldItem->Which() ); - SvxURLField* pACPURLField3 = dynamic_cast<SvxURLField*> ( const_cast<SvxFieldData*> (aACPURLFieldInfo3.pFieldItem->GetField()) ); + EFieldInfo aACPURLFieldInfo3 = aEditEngine.GetFieldInfo(sal_Int32(0), sal_uInt16(2)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(38), aACPURLFieldInfo3.aPosition.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(EE_FEATURE_FIELD), aACPURLFieldInfo3.pFieldItem->Which()); + SvxURLField* pACPURLField3 = dynamic_cast<SvxURLField*>( + const_cast<SvxFieldData*>(aACPURLFieldInfo3.pFieldItem->GetField())); CPPUNIT_ASSERT(pACPURLField3); - CPPUNIT_ASSERT_EQUAL( aURL1, pACPURLField3->GetURL() ); - CPPUNIT_ASSERT_EQUAL( aRepres1, pACPURLField3->GetRepresentation() ); + CPPUNIT_ASSERT_EQUAL(aURL1, pACPURLField3->GetURL()); + CPPUNIT_ASSERT_EQUAL(aRepres1, pACPURLField3->GetRepresentation()); } void Test::testCopyPaste() { // Create EditEngine's instance - EditEngine aEditEngine( mpItemPool.get() ); + EditEngine aEditEngine(mpItemPool.get()); // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // Initially no text should be there - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetParaAsString(sal_Int32(0))); // Set initial text OUString aText = u"This is custom initial text"_ustr; sal_Int32 aTextLen = aText.getLength(); - aEditEngine.SetText( aText ); + aEditEngine.SetText(aText); // Assert changes - CPPUNIT_ASSERT_EQUAL( aTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( aText, rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(aText, rDoc.GetParaAsString(sal_Int32(0))); // Copy initial text using legacy format - uno::Reference< datatransfer::XTransferable > xData = aEditEngine.CreateTransferable( ESelection(0,0,0,aTextLen) ); + uno::Reference<datatransfer::XTransferable> xData + = aEditEngine.CreateTransferable(ESelection(0, 0, 0, aTextLen)); // Paste text at the end - aEditEngine.InsertText( xData, OUString(), rDoc.GetEndPaM(), true ); + aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); // Assert changes - CPPUNIT_ASSERT_EQUAL( aTextLen + aTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(aText + aText), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen + aTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(aText + aText), rDoc.GetParaAsString(sal_Int32(0))); } /// XTransferable implementation that provides simple HTML content. -class TestHTMLTransferable : public cppu::WeakImplHelper<datatransfer::XTransferable> +class TestTransferable : public cppu::WeakImplHelper<datatransfer::XTransferable> { - OString m_aHTML; + std::vector<OString> m_aContent; + std::vector<OUString> m_aMimeType; + public: - TestHTMLTransferable(const OString& rHTML); + TestTransferable(std::vector<OString>& rContent, std::vector<OUString>& rMimeType); uno::Any SAL_CALL getTransferData(const datatransfer::DataFlavor& rFlavor) override; uno::Sequence<datatransfer::DataFlavor> SAL_CALL getTransferDataFlavors() override; sal_Bool SAL_CALL isDataFlavorSupported(const datatransfer::DataFlavor& rFlavor) override; }; -TestHTMLTransferable::TestHTMLTransferable(const OString& rHTML) - : m_aHTML(rHTML) +TestTransferable::TestTransferable(std::vector<OString>& rContent, std::vector<OUString>& rMimeType) + : m_aContent(rContent) + , m_aMimeType(rMimeType) { + CPPUNIT_ASSERT_EQUAL(m_aContent.size(), m_aMimeType.size()); } -uno::Any TestHTMLTransferable::getTransferData(const datatransfer::DataFlavor& rFlavor) +uno::Any TestTransferable::getTransferData(const datatransfer::DataFlavor& rFlavor) { - if (rFlavor.MimeType != "text/html") + for (size_t nType = 0; nType < m_aMimeType.size(); ++nType) { - return {}; + if (rFlavor.MimeType == m_aMimeType[nType]) + { + uno::Any aRet; + SvMemoryStream aStream; + aStream.WriteOString(m_aContent[nType]); + aRet <<= uno::Sequence<sal_Int8>(static_cast<const sal_Int8*>(aStream.GetData()), + aStream.GetSize()); + return aRet; + } } - - uno::Any aRet; - SvMemoryStream aStream; - aStream.WriteOString(m_aHTML); - aRet <<= uno::Sequence<sal_Int8>(static_cast<const sal_Int8*>(aStream.GetData()), aStream.GetSize()); - return aRet; + return {}; } -uno::Sequence<datatransfer::DataFlavor> TestHTMLTransferable::getTransferDataFlavors() +uno::Sequence<datatransfer::DataFlavor> TestTransferable::getTransferDataFlavors() { - datatransfer::DataFlavor aFlavor; - aFlavor.DataType = cppu::UnoType<uno::Sequence<sal_Int8>>::get(); - aFlavor.MimeType = "text/html"; - aFlavor.HumanPresentableName = aFlavor.MimeType; - return { aFlavor }; + std::vector<datatransfer::DataFlavor> aFlavourVac; + for (size_t nType = 0; nType < m_aMimeType.size(); ++nType) + { + datatransfer::DataFlavor aFlavor; + aFlavor.DataType = cppu::UnoType<uno::Sequence<sal_Int8>>::get(); + aFlavor.MimeType = m_aMimeType[nType]; + aFlavor.HumanPresentableName = aFlavor.MimeType; + aFlavourVac.push_back(aFlavor); + } + uno::Sequence<datatransfer::DataFlavor> aFlavors(aFlavourVac.data(), m_aMimeType.size()); + return aFlavors; } -sal_Bool TestHTMLTransferable::isDataFlavorSupported(const datatransfer::DataFlavor& rFlavor) +sal_Bool TestTransferable::isDataFlavorSupported(const datatransfer::DataFlavor& rFlavor) { - return rFlavor.MimeType == "text/html" - && rFlavor.DataType == cppu::UnoType<uno::Sequence<sal_Int8>>::get(); + for (size_t nType = 0; nType < m_aMimeType.size(); ++nType) + { + if (rFlavor.MimeType == m_aMimeType[nType] + && rFlavor.DataType == cppu::UnoType<uno::Sequence<sal_Int8>>::get()) + return true; + } + return false; } void Test::testHTMLPaste() { // Given an empty editeng document: EditEngine aEditEngine(mpItemPool.get()); - EditDoc &rDoc = aEditEngine.GetEditDoc(); - OString aHTML("<!DOCTYPE html>\n<html><body>test</body></html>"_ostr); - uno::Reference< datatransfer::XTransferable > xData(new TestHTMLTransferable(aHTML)); + EditDoc& rDoc = aEditEngine.GetEditDoc(); + //OString aHTML("<!DOCTYPE html>\n<html><body>test</body></html>"_ostr); + std::vector<OString> aContent({ "<!DOCTYPE html>\n<html><body>test</body></html>"_ostr }); + std::vector<OUString> aMime({ "text/html" }); + uno::Reference<datatransfer::XTransferable> xData(new TestTransferable(aContent, aMime)); // When trying to paste HTML: aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); @@ -795,9 +833,11 @@ void Test::testHTMLFragmentPaste() { // Given an empty editeng document: EditEngine aEditEngine(mpItemPool.get()); - EditDoc &rDoc = aEditEngine.GetEditDoc(); - OString aHTML("a<b>b</b>c"_ostr); - uno::Reference< datatransfer::XTransferable > xData(new TestHTMLTransferable(aHTML)); + EditDoc& rDoc = aEditEngine.GetEditDoc(); + std::vector<OString> aContent({ "a<b>b</b>c"_ostr }); + std::vector<OUString> aMime({ "text/html" }); + + uno::Reference<datatransfer::XTransferable> xData(new TestTransferable(aContent, aMime)); // When trying to paste an HTML fragment: aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); @@ -810,17 +850,71 @@ void Test::testHTMLFragmentPaste() CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, rDoc.GetParaAsString(static_cast<sal_Int32>(0))); } +void Test::testRTFPaste() +{ + // Given an empty editeng document: + EditEngine aEditEngine(mpItemPool.get()); + EditDoc& rDoc = aEditEngine.GetEditDoc(); + std::vector<OString> aContent( + { "{\\rtf1\\adeflang1025\\ansi{\\ul www.libreoffice.org}}"_ostr }); + std::vector<OUString> aMime({ "text/richtext" }); + uno::Reference<datatransfer::XTransferable> xData(new TestTransferable(aContent, aMime)); + + // When trying to paste HTML: + aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); + + // Then make sure the text gets pasted: + // Without the accompanying fix in place, this test would have failed with: + // - Expected: www.libreoffice.org + // - Actual : + // i.e. RTF and plain text paste worked, but not HTML. + CPPUNIT_ASSERT_EQUAL(OUString("www.libreoffice.org"), + rDoc.GetParaAsString(static_cast<sal_Int32>(0))); +} + +void Test::testRTFHTMLPaste() +{ + // Given an empty editeng document: + EditEngine aEditEngine(mpItemPool.get()); + EditDoc& rDoc = aEditEngine.GetEditDoc(); + std::vector<OString> aContent( + { "{\\rtf1\\adeflang1025\\ansi{\\ul www.libreoffice.org}}"_ostr, + "Version:1.0\nStartHTML:0000000121\n" + "EndHTML:0000000596\n" + "StartFragment:0000000519\n" + "EndFragment:0000000579\n" + "<!DOCTYPE html><html><head><meta http-equiv=\"content-type\" content=\"text/html; " + "charset=utf-8\"/>" + "<title></title><meta name=\"generator\" content=\"LibreOffice 7.4.5.1 (Windows)\"/>" + "<style type=\"text/css\">@page { size: 21cm 29.7cm; margin: 2cm }" + "p{ line-height: 115%; margin-bottom: 0.25cm; background: transparent }</style>" + "</head><body lang=\"de-DE\" link=\"#000080\" vlink=\"#800000\" dir=\"ltr\">" + "<p style=\"line-height: 100%; margin-bottom: 0cm\">abc</p></body></html>"_ostr }); + std::vector<OUString> aMime( + { "text/richtext", + "application/x-openoffice-html-simple;windows_formatname=\"HTML Format\"" }); + uno::Reference<datatransfer::XTransferable> xData(new TestTransferable(aContent, aMime)); + + // When trying to paste HTML: + aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); + + // Then make sure the text gets pasted: + // expected "abc" + // wrong: www.libreoffice.org + // i.e. HTML is preferred over HTML. + CPPUNIT_ASSERT_EQUAL(OUString("abc"), rDoc.GetParaAsString(static_cast<sal_Int32>(0))); +} void Test::testMultiParaSelCopyPaste() { // Create EditEngine's instance - EditEngine aEditEngine( mpItemPool.get() ); + EditEngine aEditEngine(mpItemPool.get()); // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // Initially no text should be there - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetParaAsString(sal_Int32(0))); // Insert initial text OUString aFirstPara = u"This is first paragraph"_ustr; @@ -835,16 +929,17 @@ void Test::testMultiParaSelCopyPaste() sal_Int32 aCopyTextLen = aCopyText.getLength(); // Assert changes - CPPUNIT_ASSERT_EQUAL( aTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( aFirstPara, rDoc.GetParaAsString(sal_Int32(0)) ); - CPPUNIT_ASSERT_EQUAL( aSecondPara, rDoc.GetParaAsString(sal_Int32(1)) ); - CPPUNIT_ASSERT_EQUAL( aThirdPara, rDoc.GetParaAsString(sal_Int32(2)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(aFirstPara, rDoc.GetParaAsString(sal_Int32(0))); + CPPUNIT_ASSERT_EQUAL(aSecondPara, rDoc.GetParaAsString(sal_Int32(1))); + CPPUNIT_ASSERT_EQUAL(aThirdPara, rDoc.GetParaAsString(sal_Int32(2))); // Copy initial text using legacy format - uno::Reference< datatransfer::XTransferable > xData = aEditEngine.CreateTransferable( ESelection(0,8,1,14) ); + uno::Reference<datatransfer::XTransferable> xData + = aEditEngine.CreateTransferable(ESelection(0, 8, 1, 14)); // Paste text at the end - aEditEngine.InsertText( xData, OUString(), rDoc.GetEndPaM(), true ); + aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); // Assert changes OUString aThirdParaAfterCopyPaste = aThirdPara + "first paragraph"; @@ -858,50 +953,51 @@ void Test::testMultiParaSelCopyPaste() void Test::testTabsCopyPaste() { // Create EditEngine's instance - EditEngine aEditEngine( mpItemPool.get() ); + EditEngine aEditEngine(mpItemPool.get()); // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // New instance must be empty - no initial text - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetParaAsString(sal_Int32(0))); // Get corresponding Item for inserting tabs in the text - SfxVoidItem aTab( EE_FEATURE_TAB ); + SfxVoidItem aTab(EE_FEATURE_TAB); // Insert initial text OUString aParaText = u"sampletextfortestingtab"_ustr; // Positions Ref ......*6...............*23 sal_Int32 aTextLen = aParaText.getLength(); - aEditEngine.SetText( aParaText ); + aEditEngine.SetText(aParaText); // Assert changes - CPPUNIT_ASSERT_EQUAL( aTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( aParaText, rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(aParaText, rDoc.GetParaAsString(sal_Int32(0))); // Insert tab 1 at desired position - ContentNode *pNode = rDoc.GetObject(0); - EditSelection aSel1( EditPaM(pNode, 6), EditPaM(pNode, 6) ); - aEditEngine.InsertFeature( aSel1, aTab ); + ContentNode* pNode = rDoc.GetObject(0); + EditSelection aSel1(EditPaM(pNode, 6), EditPaM(pNode, 6)); + aEditEngine.InsertFeature(aSel1, aTab); // Assert changes CPPUNIT_ASSERT_EQUAL( aTextLen + 1, rDoc.GetTextLen() ); CPPUNIT_ASSERT_EQUAL( u"sample\ttextfortestingtab"_ustr, rDoc.GetParaAsString(sal_Int32(0)) ); // Insert tab 2 at desired position - EditSelection aSel2( EditPaM(pNode, 23+1), EditPaM(pNode, 23+1) ); - aEditEngine.InsertFeature( aSel2, aTab ); + EditSelection aSel2(EditPaM(pNode, 23 + 1), EditPaM(pNode, 23 + 1)); + aEditEngine.InsertFeature(aSel2, aTab); // Assert changes CPPUNIT_ASSERT_EQUAL( aTextLen + 2, rDoc.GetTextLen() ); CPPUNIT_ASSERT_EQUAL( u"sample\ttextfortestingtab\t"_ustr, rDoc.GetParaAsString(sal_Int32(0)) ); // Copy text using legacy format - uno::Reference< datatransfer::XTransferable > xData = aEditEngine.CreateTransferable( ESelection(0,6,0,aTextLen+2) ); + uno::Reference<datatransfer::XTransferable> xData + = aEditEngine.CreateTransferable(ESelection(0, 6, 0, aTextLen + 2)); // Paste text at the end - aEditEngine.InsertText( xData, OUString(), rDoc.GetEndPaM(), true ); + aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); // Assert changes CPPUNIT_ASSERT_EQUAL( aTextLen + aTextLen - 6 + 4, rDoc.GetTextLen() ); @@ -911,9 +1007,14 @@ void Test::testTabsCopyPaste() class UrlEditEngine : public EditEngine { public: - explicit UrlEditEngine(SfxItemPool *pPool) : EditEngine(pPool) {} + explicit UrlEditEngine(SfxItemPool* pPool) + : EditEngine(pPool) + { + } - virtual OUString CalcFieldValue( const SvxFieldItem&, sal_Int32, sal_Int32, std::optional<Color>&, std::optional<Color>&, std::optional<FontLineStyle>& ) override + virtual OUString CalcFieldValue(const SvxFieldItem&, sal_Int32, sal_Int32, + std::optional<Color>&, std::optional<Color>&, + std::optional<FontLineStyle>&) override { return u"jim@bob.com"_ustr; // a sophisticated view of value: } @@ -924,14 +1025,14 @@ public: void Test::testHyperlinkSearch() { UrlEditEngine aEngine(mpItemPool.get()); - EditDoc &rDoc = aEngine.GetEditDoc(); + EditDoc& rDoc = aEngine.GetEditDoc(); OUString aSampleText = u"Please write email to . if you find a fish(not a dog)."_ustr; aEngine.SetText(aSampleText); CPPUNIT_ASSERT_EQUAL_MESSAGE("set text", aSampleText, rDoc.GetParaAsString(sal_Int32(0))); - ContentNode *pNode = rDoc.GetObject(0); + ContentNode* pNode = rDoc.GetObject(0); EditSelection aSel(EditPaM(pNode, 22), EditPaM(pNode, 22)); SvxURLField aURLField(u"mailto:///jim@bob.com"_ustr, u"jim@bob.com"_ustr, SvxURLFormat::Repr); @@ -945,37 +1046,33 @@ void Test::testHyperlinkSearch() CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong length", aContent.getLength(), rDoc.GetTextLen()); // Check expansion and positioning re-work - CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong length", aContent.getLength(), - pNode->GetExpandedLen()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong length", aContent.getLength(), pNode->GetExpandedLen()); for (sal_Int32 n = 0; n < aContent.getLength(); n++) { sal_Int32 nStart = n, nEnd = n; - pNode->UnExpandPositions(nStart,nEnd); + pNode->UnExpandPositions(nStart, nEnd); CPPUNIT_ASSERT_MESSAGE("out of bound start", nStart < pNode->Len()); CPPUNIT_ASSERT_MESSAGE("out of bound end", nEnd <= pNode->Len()); } - static const struct { + static const struct + { sal_Int32 mnStart, mnEnd; sal_Int32 mnNewStart, mnNewEnd; - } aTrickyOnes[] = { - { 0, 1, /* -> */ 0, 1 }, - { 21, 25, /* -> */ 21, 23 }, // the field is really just one char - { 25, 27, /* -> */ 22, 23 }, - { 50, 56, /* -> */ 40, 46 } - }; + } aTrickyOnes[] = { { 0, 1, /* -> */ 0, 1 }, + { 21, 25, /* -> */ 21, 23 }, // the field is really just one char + { 25, 27, /* -> */ 22, 23 }, + { 50, 56, /* -> */ 40, 46 } }; for (size_t n = 0; n < SAL_N_ELEMENTS(aTrickyOnes); n++) { sal_Int32 nStart = aTrickyOnes[n].mnStart; sal_Int32 nEnd = aTrickyOnes[n].mnEnd; - pNode->UnExpandPositions(nStart,nEnd); - - CPPUNIT_ASSERT_EQUAL_MESSAGE( - OString("in row " + OString::number(n)).getStr(), - aTrickyOnes[n].mnNewStart, nStart); - CPPUNIT_ASSERT_EQUAL_MESSAGE( - OString("in row " + OString::number(n)).getStr(), - aTrickyOnes[n].mnNewEnd, nEnd); + pNode->UnExpandPositions(nStart, nEnd); + + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("in row " + OString::number(n)).getStr(), + aTrickyOnes[n].mnNewStart, nStart); + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("in row " + OString::number(n)).getStr(), + aTrickyOnes[n].mnNewEnd, nEnd); } SvxSearchItem aItem(1); //SID_SEARCH_ITEM); @@ -989,38 +1086,38 @@ void Test::testHyperlinkSearch() bool hasBold(const editeng::Section& rSecAttr) { - return std::any_of(rSecAttr.maAttributes.begin(), rSecAttr.maAttributes.end(), - [](const SfxPoolItem* p) { + return std::any_of( + rSecAttr.maAttributes.begin(), rSecAttr.maAttributes.end(), [](const SfxPoolItem* p) { return p->Which() == EE_CHAR_WEIGHT - && static_cast<const SvxWeightItem*>(p)->GetWeight() == WEIGHT_BOLD; + && static_cast<const SvxWeightItem*>(p)->GetWeight() == WEIGHT_BOLD; }); } bool hasItalic(const editeng::Section& rSecAttr) { - return std::any_of(rSecAttr.maAttributes.begin(), rSecAttr.maAttributes.end(), - [](const SfxPoolItem* p) { + return std::any_of( + rSecAttr.maAttributes.begin(), rSecAttr.maAttributes.end(), [](const SfxPoolItem* p) { return p->Which() == EE_CHAR_ITALIC - && static_cast<const SvxPostureItem*>(p)->GetPosture() == ITALIC_NORMAL; + && static_cast<const SvxPostureItem*>(p)->GetPosture() == ITALIC_NORMAL; }); } void Test::testBoldItalicCopyPaste() { // Create EditEngine's instance - EditEngine aEditEngine( mpItemPool.get() ); + EditEngine aEditEngine(mpItemPool.get()); // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // New instance must be empty - no initial text - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetParaAsString(sal_Int32(0))); // Get corresponding ItemSet for inserting Bold/Italic text - std::unique_ptr<SfxItemSet> pSet( new SfxItemSet(aEditEngine.GetEmptyItemSet()) ); - SvxWeightItem aBold( WEIGHT_BOLD, EE_CHAR_WEIGHT ); - SvxPostureItem aItalic( ITALIC_NORMAL, EE_CHAR_ITALIC ); + std::unique_ptr<SfxItemSet> pSet(new SfxItemSet(aEditEngine.GetEmptyItemSet())); + SvxWeightItem aBold(WEIGHT_BOLD, EE_CHAR_WEIGHT); + SvxPostureItem aItalic(ITALIC_NORMAL, EE_CHAR_ITALIC); // Insert initial text OUString aParaText = u"boldeditengineitalic"_ustr; @@ -1028,268 +1125,272 @@ void Test::testBoldItalicCopyPaste() // Bold Ref ..[ BOLD ]...... // Italic Ref ........[ ITALIC ].. sal_Int32 aTextLen = aParaText.getLength(); - aEditEngine.SetText( aParaText ); + aEditEngine.SetText(aParaText); // Assert changes - text insertion - CPPUNIT_ASSERT_EQUAL( aTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( aParaText, rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(aParaText, rDoc.GetParaAsString(sal_Int32(0))); // Apply Bold to appropriate selection pSet->Put(aBold); - CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(1), pSet->Count() ); - aEditEngine.QuickSetAttribs( *pSet, ESelection(0,2,0,14) ); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), pSet->Count()); + aEditEngine.QuickSetAttribs(*pSet, ESelection(0, 2, 0, 14)); // Assert changes - std::unique_ptr<EditTextObject> pEditText1( aEditEngine.CreateTextObject() ); + std::unique_ptr<EditTextObject> pEditText1(aEditEngine.CreateTextObject()); std::vector<editeng::Section> aAttrs1; - pEditText1->GetAllSections( aAttrs1 ); + pEditText1->GetAllSections(aAttrs1); // There should be 3 sections - woBold - wBold - woBold (w - with, wo - without) - CPPUNIT_ASSERT_EQUAL( size_t(3), aAttrs1.size() ); + CPPUNIT_ASSERT_EQUAL(size_t(3), aAttrs1.size()); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[0].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[0].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs1[0].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[0].maAttributes.size()) ); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[0].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[0].mnStart)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs1[0].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[0].maAttributes.size())); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[1].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs1[1].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs1[1].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs1[1].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs1[1]) ); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[1].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs1[1].mnStart)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs1[1].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs1[1].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs1[1])); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[2].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs1[2].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 20, static_cast<int>(aAttrs1[2].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[2].maAttributes.size()) ); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[2].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs1[2].mnStart)); + CPPUNIT_ASSERT_EQUAL(20, static_cast<int>(aAttrs1[2].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[2].maAttributes.size())); // Apply Italic to appropriate selection - pSet.reset( new SfxItemSet(aEditEngine.GetEmptyItemSet()) ); + pSet.reset(new SfxItemSet(aEditEngine.GetEmptyItemSet())); pSet->Put(aItalic); - CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(1), pSet->Count() ); - aEditEngine.QuickSetAttribs( *pSet, ESelection(0,8,0,18) ); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), pSet->Count()); + aEditEngine.QuickSetAttribs(*pSet, ESelection(0, 8, 0, 18)); // Assert changes - std::unique_ptr<EditTextObject> pEditText2( aEditEngine.CreateTextObject() ); + std::unique_ptr<EditTextObject> pEditText2(aEditEngine.CreateTextObject()); std::vector<editeng::Section> aAttrs2; - pEditText2->GetAllSections( aAttrs2 ); + pEditText2->GetAllSections(aAttrs2); // There should be 5 sections - woBold&woItalic - wBold&woItalic - wBold&wItalic - woBold&wItalic - woBold&woItalic (w - with, wo - without) - CPPUNIT_ASSERT_EQUAL( size_t(5), aAttrs2.size() ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[0].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[0].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs2[0].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[0].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[1].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs2[1].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 8, static_cast<int>(aAttrs2[1].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[1].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs2[1]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[2].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 8, static_cast<int>(aAttrs2[2].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs2[2].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs2[2].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasBold(aAttrs2[2]) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasItalic(aAttrs2[2]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[3].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs2[3].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs2[3].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[3].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be italic.", hasItalic(aAttrs2[3]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[4].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs2[4].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 20, static_cast<int>(aAttrs2[4].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[4].maAttributes.size()) ); + CPPUNIT_ASSERT_EQUAL(size_t(5), aAttrs2.size()); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[0].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[0].mnStart)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs2[0].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[0].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[1].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs2[1].mnStart)); + CPPUNIT_ASSERT_EQUAL(8, static_cast<int>(aAttrs2[1].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[1].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs2[1])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[2].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(8, static_cast<int>(aAttrs2[2].mnStart)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs2[2].mnEnd)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs2[2].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasBold(aAttrs2[2])); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasItalic(aAttrs2[2])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[3].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs2[3].mnStart)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs2[3].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[3].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be italic.", hasItalic(aAttrs2[3])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[4].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs2[4].mnStart)); + CPPUNIT_ASSERT_EQUAL(20, static_cast<int>(aAttrs2[4].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[4].maAttributes.size())); // Copy text using legacy format - uno::Reference< datatransfer::XTransferable > xData = aEditEngine.CreateTransferable( ESelection(0,1,0,aTextLen-1) ); + uno::Reference<datatransfer::XTransferable> xData + = aEditEngine.CreateTransferable(ESelection(0, 1, 0, aTextLen - 1)); // Paste text at the end - aEditEngine.InsertText( xData, OUString(), rDoc.GetEndPaM(), true ); + aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); // Assert changes - CPPUNIT_ASSERT_EQUAL( aTextLen + aTextLen - 2, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(aParaText + "oldeditengineitali" ), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen + aTextLen - 2, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(aParaText + "oldeditengineitali"), + rDoc.GetParaAsString(sal_Int32(0))); // Check updated text for appropriate Bold/Italics - std::unique_ptr<EditTextObject> pEditText3( aEditEngine.CreateTextObject() ); + std::unique_ptr<EditTextObject> pEditText3(aEditEngine.CreateTextObject()); std::vector<editeng::Section> aAttrs3; - pEditText3->GetAllSections( aAttrs3 ); + pEditText3->GetAllSections(aAttrs3); // There should be 9 sections - woBold&woItalic - wBold&woItalic - wBold&wItalic - woBold&wItalic - woBold&woItalic - wBold&woItalic // - wBold&wItalic - woBold&wItalic - woBold&woItalic(w - with, wo - without) - CPPUNIT_ASSERT_EQUAL( size_t(9), aAttrs3.size() ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[0].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[0].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[0].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[0].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[1].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[1].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 8, static_cast<int>(aAttrs3[1].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[1].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs3[1]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[2].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 8, static_cast<int>(aAttrs3[2].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs3[2].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[2].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasBold(aAttrs3[2]) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasItalic(aAttrs3[2]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[3].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs3[3].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs3[3].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[3].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be italic.", hasItalic(aAttrs3[3]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[4].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs3[4].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 21, static_cast<int>(aAttrs3[4].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[4].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[5].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 21, static_cast<int>(aAttrs3[5].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 27, static_cast<int>(aAttrs3[5].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[5].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs3[5]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[6].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 27, static_cast<int>(aAttrs3[6].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 33, static_cast<int>(aAttrs3[6].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[6].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasBold(aAttrs3[6]) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasItalic(aAttrs3[6]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[7].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 33, static_cast<int>(aAttrs3[7].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 37, static_cast<int>(aAttrs3[7].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[7].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be italic.", hasItalic(aAttrs3[7]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[8].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 37, static_cast<int>(aAttrs3[8].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 38, static_cast<int>(aAttrs3[8].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[8].maAttributes.size()) ); + CPPUNIT_ASSERT_EQUAL(size_t(9), aAttrs3.size()); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[0].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[0].mnStart)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[0].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[0].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[1].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[1].mnStart)); + CPPUNIT_ASSERT_EQUAL(8, static_cast<int>(aAttrs3[1].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[1].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs3[1])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[2].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(8, static_cast<int>(aAttrs3[2].mnStart)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs3[2].mnEnd)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[2].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasBold(aAttrs3[2])); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasItalic(aAttrs3[2])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[3].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs3[3].mnStart)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs3[3].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[3].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be italic.", hasItalic(aAttrs3[3])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[4].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs3[4].mnStart)); + CPPUNIT_ASSERT_EQUAL(21, static_cast<int>(aAttrs3[4].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[4].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[5].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(21, static_cast<int>(aAttrs3[5].mnStart)); + CPPUNIT_ASSERT_EQUAL(27, static_cast<int>(aAttrs3[5].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[5].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs3[5])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[6].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(27, static_cast<int>(aAttrs3[6].mnStart)); + CPPUNIT_ASSERT_EQUAL(33, static_cast<int>(aAttrs3[6].mnEnd)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[6].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasBold(aAttrs3[6])); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasItalic(aAttrs3[6])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[7].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(33, static_cast<int>(aAttrs3[7].mnStart)); + CPPUNIT_ASSERT_EQUAL(37, static_cast<int>(aAttrs3[7].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[7].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be italic.", hasItalic(aAttrs3[7])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[8].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(37, static_cast<int>(aAttrs3[8].mnStart)); + CPPUNIT_ASSERT_EQUAL(38, static_cast<int>(aAttrs3[8].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[8].maAttributes.size())); } // Auxiliary function to test Underline text Copy/Paste using Legacy Format bool hasUnderline(const editeng::Section& rSecAttr) { - return std::any_of(rSecAttr.maAttributes.begin(), rSecAttr.maAttributes.end(), - [](const SfxPoolItem* p) { + return std::any_of( + rSecAttr.maAttributes.begin(), rSecAttr.maAttributes.end(), [](const SfxPoolItem* p) { return p->Which() == EE_CHAR_UNDERLINE - && static_cast<const SvxUnderlineItem*>(p)->GetLineStyle() == LINESTYLE_SINGLE; + && static_cast<const SvxUnderlineItem*>(p)->GetLineStyle() == LINESTYLE_SINGLE; }); } void Test::testUnderlineCopyPaste() { // Create EditEngine's instance - EditEngine aEditEngine( mpItemPool.get() ); + EditEngine aEditEngine(mpItemPool.get()); // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // New instance must be empty - no initial text - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetParaAsString(sal_Int32(0))); // Get corresponding ItemSet for inserting Underline text - std::unique_ptr<SfxItemSet> pSet( new SfxItemSet(aEditEngine.GetEmptyItemSet()) ); - SvxUnderlineItem aULine( LINESTYLE_SINGLE, EE_CHAR_UNDERLINE ); + std::unique_ptr<SfxItemSet> pSet(new SfxItemSet(aEditEngine.GetEmptyItemSet())); + SvxUnderlineItem aULine(LINESTYLE_SINGLE, EE_CHAR_UNDERLINE); // Insert initial text OUString aParaText = u"sampletextforunderline"_ustr; // Positions Ref ......*6.........*17.. // Underline Ref ......[UNDERLINE ].... sal_Int32 aTextLen = aParaText.getLength(); - aEditEngine.SetText( aParaText ); + aEditEngine.SetText(aParaText); // Apply Underline style - pSet->Put( aULine ); - CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(1), pSet->Count() ); - aEditEngine.QuickSetAttribs( *pSet, ESelection(0,6,0,18) ); + pSet->Put(aULine); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), pSet->Count()); + aEditEngine.QuickSetAttribs(*pSet, ESelection(0, 6, 0, 18)); // Assert changes - std::unique_ptr<EditTextObject> pEditText1( aEditEngine.CreateTextObject() ); + std::unique_ptr<EditTextObject> pEditText1(aEditEngine.CreateTextObject()); std::vector<editeng::Section> aAttrs1; - pEditText1->GetAllSections( aAttrs1 ); + pEditText1->GetAllSections(aAttrs1); // There should be 3 sections - woUnderline - wUnderline - woUnderline (w - with, wo - without) - CPPUNIT_ASSERT_EQUAL( size_t(3), aAttrs1.size() ); + CPPUNIT_ASSERT_EQUAL(size_t(3), aAttrs1.size()); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[0].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[0].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 6, static_cast<int>(aAttrs1[0].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[0].maAttributes.size()) ); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[0].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[0].mnStart)); + CPPUNIT_ASSERT_EQUAL(6, static_cast<int>(aAttrs1[0].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[0].maAttributes.size())); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[1].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 6, static_cast<int>(aAttrs1[1].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs1[1].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs1[1].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be underlined.", hasUnderline(aAttrs1[1]) ); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[1].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(6, static_cast<int>(aAttrs1[1].mnStart)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs1[1].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs1[1].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be underlined.", hasUnderline(aAttrs1[1])); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[2].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs1[2].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 22, static_cast<int>(aAttrs1[2].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[2].maAttributes.size()) ); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[2].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs1[2].mnStart)); + CPPUNIT_ASSERT_EQUAL(22, static_cast<int>(aAttrs1[2].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[2].maAttributes.size())); // Copy text using legacy format - uno::Reference< datatransfer::XTransferable > xData = aEditEngine.CreateTransferable( ESelection(0,6,0,aTextLen-4) ); + uno::Reference<datatransfer::XTransferable> xData + = aEditEngine.CreateTransferable(ESelection(0, 6, 0, aTextLen - 4)); // Paste text at the end - aEditEngine.InsertText( xData, OUString(), rDoc.GetEndPaM(), true ); + aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); // Assert changes - CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(aTextLen + strlen("textforunder")), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(aParaText + "textforunder" ), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(aTextLen + strlen("textforunder")), + rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(aParaText + "textforunder"), rDoc.GetParaAsString(sal_Int32(0))); // Check updated text for appropriate Underline - std::unique_ptr<EditTextObject> pEditText2( aEditEngine.CreateTextObject() ); + std::unique_ptr<EditTextObject> pEditText2(aEditEngine.CreateTextObject()); std::vector<editeng::Section> aAttrs2; - pEditText2->GetAllSections( aAttrs2 ); + pEditText2->GetAllSections(aAttrs2); // There should be 4 sections - woUnderline - wUnderline - woUnderline - wUnderline (w - with, wo - without) - CPPUNIT_ASSERT_EQUAL( size_t(4), aAttrs2.size() ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[0].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[0].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 6, static_cast<int>(aAttrs2[0].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[0].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[1].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 6, static_cast<int>(aAttrs2[1].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs2[1].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[1].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be underlined.", hasUnderline(aAttrs2[1]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[2].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs2[2].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 22, static_cast<int>(aAttrs2[2].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[2].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[3].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 22, static_cast<int>(aAttrs2[3].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 34, static_cast<int>(aAttrs2[3].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[3].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be underlined.", hasUnderline(aAttrs2[3]) ); + CPPUNIT_ASSERT_EQUAL(size_t(4), aAttrs2.size()); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[0].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[0].mnStart)); + CPPUNIT_ASSERT_EQUAL(6, static_cast<int>(aAttrs2[0].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[0].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[1].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(6, static_cast<int>(aAttrs2[1].mnStart)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs2[1].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[1].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be underlined.", hasUnderline(aAttrs2[1])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[2].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs2[2].mnStart)); + CPPUNIT_ASSERT_EQUAL(22, static_cast<int>(aAttrs2[2].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[2].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[3].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(22, static_cast<int>(aAttrs2[3].mnStart)); + CPPUNIT_ASSERT_EQUAL(34, static_cast<int>(aAttrs2[3].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[3].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be underlined.", hasUnderline(aAttrs2[3])); } void Test::testMultiParaCopyPaste() { // Create EditEngine's instance - EditEngine aEditEngine( mpItemPool.get() ); + EditEngine aEditEngine(mpItemPool.get()); // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // Initially no text should be there - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetParaAsString(sal_Int32(0))); // Insert initial text OUString aFirstPara = u"This is first paragraph"_ustr; @@ -1297,46 +1398,47 @@ void Test::testMultiParaCopyPaste() OUString aThirdPara = u"This is third paragraph"_ustr; OUString aText = aFirstPara + "\n" + aSecondPara + "\n" + aThirdPara; sal_Int32 aTextLen = aFirstPara.getLength() + aSecondPara.getLength() + aThirdPara.getLength(); - aEditEngine.SetText( aText ); + aEditEngine.SetText(aText); sal_Int32 aCopyTextLen = aFirstPara.getLength() + aSecondPara.getLength(); // Assert changes - CPPUNIT_ASSERT_EQUAL( aTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( aFirstPara, rDoc.GetParaAsString(sal_Int32(0)) ); - CPPUNIT_ASSERT_EQUAL( aSecondPara, rDoc.GetParaAsString(sal_Int32(1)) ); - CPPUNIT_ASSERT_EQUAL( aThirdPara, rDoc.GetParaAsString(sal_Int32(2)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(aFirstPara, rDoc.GetParaAsString(sal_Int32(0))); + CPPUNIT_ASSERT_EQUAL(aSecondPara, rDoc.GetParaAsString(sal_Int32(1))); + CPPUNIT_ASSERT_EQUAL(aThirdPara, rDoc.GetParaAsString(sal_Int32(2))); // Copy initial text using legacy format - uno::Reference< datatransfer::XTransferable > xData = aEditEngine.CreateTransferable( ESelection(0,0,1,aSecondPara.getLength()) ); + uno::Reference<datatransfer::XTransferable> xData + = aEditEngine.CreateTransferable(ESelection(0, 0, 1, aSecondPara.getLength())); // Paste text at the end - aEditEngine.InsertText( xData, OUString(), rDoc.GetEndPaM(), true ); + aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); // Assert changes OUString aThirdParaAfterCopyPaste = aThirdPara + aFirstPara; - CPPUNIT_ASSERT_EQUAL( aTextLen + aCopyTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( aFirstPara, rDoc.GetParaAsString(sal_Int32(0)) ); - CPPUNIT_ASSERT_EQUAL( aSecondPara, rDoc.GetParaAsString(sal_Int32(1)) ); - CPPUNIT_ASSERT_EQUAL( aThirdParaAfterCopyPaste, rDoc.GetParaAsString(sal_Int32(2)) ); - CPPUNIT_ASSERT_EQUAL( aSecondPara, rDoc.GetParaAsString(sal_Int32(3)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen + aCopyTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(aFirstPara, rDoc.GetParaAsString(sal_Int32(0))); + CPPUNIT_ASSERT_EQUAL(aSecondPara, rDoc.GetParaAsString(sal_Int32(1))); + CPPUNIT_ASSERT_EQUAL(aThirdParaAfterCopyPaste, rDoc.GetParaAsString(sal_Int32(2))); + CPPUNIT_ASSERT_EQUAL(aSecondPara, rDoc.GetParaAsString(sal_Int32(3))); } void Test::testParaBoldItalicCopyPaste() { // Create EditEngine's instance - EditEngine aEditEngine( mpItemPool.get() ); + EditEngine aEditEngine(mpItemPool.get()); // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // Initially no text should be there - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetParaAsString(sal_Int32(0))); // Get corresponding ItemSet for inserting Bold/Italic text - std::unique_ptr<SfxItemSet> pSet( new SfxItemSet(aEditEngine.GetEmptyItemSet()) ); - SvxWeightItem aBold( WEIGHT_BOLD, EE_CHAR_WEIGHT ); - SvxPostureItem aItalic( ITALIC_NORMAL, EE_CHAR_ITALIC ); + std::unique_ptr<SfxItemSet> pSet(new SfxItemSet(aEditEngine.GetEmptyItemSet())); + SvxWeightItem aBold(WEIGHT_BOLD, EE_CHAR_WEIGHT); + SvxPostureItem aItalic(ITALIC_NORMAL, EE_CHAR_ITALIC); // Insert initial text OUString aFirstPara = u"This is first paragraph"_ustr; @@ -1357,132 +1459,133 @@ void Test::testParaBoldItalicCopyPaste() sal_Int32 aCopyTextLen = aCopyText.getLength(); // Assert changes - text insertion - CPPUNIT_ASSERT_EQUAL( aTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( aFirstPara, rDoc.GetParaAsString(sal_Int32(0)) ); - CPPUNIT_ASSERT_EQUAL( aSecondPara, rDoc.GetParaAsString(sal_Int32(1)) ); - CPPUNIT_ASSERT_EQUAL( aThirdPara, rDoc.GetParaAsString(sal_Int32(2)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(aFirstPara, rDoc.GetParaAsString(sal_Int32(0))); + CPPUNIT_ASSERT_EQUAL(aSecondPara, rDoc.GetParaAsString(sal_Int32(1))); + CPPUNIT_ASSERT_EQUAL(aThirdPara, rDoc.GetParaAsString(sal_Int32(2))); // Apply Bold to appropriate selections pSet->Put(aBold); - CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(1), pSet->Count() ); - aEditEngine.QuickSetAttribs( *pSet, ESelection(0,5,0,18) ); - aEditEngine.QuickSetAttribs( *pSet, ESelection(1,5,1,19) ); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), pSet->Count()); + aEditEngine.QuickSetAttribs(*pSet, ESelection(0, 5, 0, 18)); + aEditEngine.QuickSetAttribs(*pSet, ESelection(1, 5, 1, 19)); // Assert changes - std::unique_ptr<EditTextObject> pEditText1( aEditEngine.CreateTextObject() ); + std::unique_ptr<EditTextObject> pEditText1(aEditEngine.CreateTextObject()); std::vector<editeng::Section> aAttrs1; - pEditText1->GetAllSections( aAttrs1 ); + pEditText1->GetAllSections(aAttrs1); // There should be 7 sections - woB - wB - woB -woB -wB -woB -woB (w - with, wo - without, B - Bold, I - Italic) - CPPUNIT_ASSERT_EQUAL( size_t(7), aAttrs1.size() ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[0].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[0].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs1[0].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[0].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[1].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs1[1].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs1[1].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs1[1].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs1[1]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[2].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs1[2].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 23, static_cast<int>(aAttrs1[2].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[2].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs1[3].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[3].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs1[3].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[3].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs1[4].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs1[4].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 19, static_cast<int>(aAttrs1[4].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs1[4].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs1[4]) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs1[5].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 19, static_cast<int>(aAttrs1[5].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 24, static_cast<int>(aAttrs1[5].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[5].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs1[6].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[6].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 23, static_cast<int>(aAttrs1[6].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs1[6].maAttributes.size()) ); + CPPUNIT_ASSERT_EQUAL(size_t(7), aAttrs1.size()); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[0].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[0].mnStart)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs1[0].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[0].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[1].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs1[1].mnStart)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs1[1].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs1[1].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs1[1])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[2].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs1[2].mnStart)); + CPPUNIT_ASSERT_EQUAL(23, static_cast<int>(aAttrs1[2].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[2].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs1[3].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[3].mnStart)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs1[3].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[3].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs1[4].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs1[4].mnStart)); + CPPUNIT_ASSERT_EQUAL(19, static_cast<int>(aAttrs1[4].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs1[4].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs1[4])); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs1[5].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(19, static_cast<int>(aAttrs1[5].mnStart)); + CPPUNIT_ASSERT_EQUAL(24, static_cast<int>(aAttrs1[5].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[5].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs1[6].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[6].mnStart)); + CPPUNIT_ASSERT_EQUAL(23, static_cast<int>(aAttrs1[6].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs1[6].maAttributes.size())); // Apply Italic to appropriate selection - pSet.reset( new SfxItemSet(aEditEngine.GetEmptyItemSet()) ); + pSet.reset(new SfxItemSet(aEditEngine.GetEmptyItemSet())); pSet->Put(aItalic); - CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(1), pSet->Count() ); - aEditEngine.QuickSetAttribs( *pSet, ESelection(0,14,1,9) ); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), pSet->Count()); + aEditEngine.QuickSetAttribs(*pSet, ESelection(0, 14, 1, 9)); // Assert changes - std::unique_ptr<EditTextObject> pEditText2( aEditEngine.CreateTextObject() ); + std::unique_ptr<EditTextObject> pEditText2(aEditEngine.CreateTextObject()); std::vector<editeng::Section> aAttrs2; - pEditText2->GetAllSections( aAttrs2 ); + pEditText2->GetAllSections(aAttrs2); // There should be 9 sections - woB&woI - wB&woI - wB&wI -woB&wI - woB&wI - wB&wI - wB&woI - woB&woI - woB&woI (w - with, wo - without, B - Bold, I - Italic) - CPPUNIT_ASSERT_EQUAL( size_t(9), aAttrs2.size() ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[0].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[0].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs2[0].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[0].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[1].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs2[1].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs2[1].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[1].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs2[1]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[2].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs2[2].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs2[2].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs2[2].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasBold(aAttrs2[2]) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasItalic(aAttrs2[2]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[3].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs2[3].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 23, static_cast<int>(aAttrs2[3].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[3].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be italic.", hasItalic(aAttrs2[3]) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[4].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[4].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs2[4].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[4].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be italic.", hasItalic(aAttrs2[4]) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[5].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs2[5].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 9, static_cast<int>(aAttrs2[5].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs2[5].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasBold(aAttrs2[5]) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasItalic(aAttrs2[5]) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[6].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 9, static_cast<int>(aAttrs2[6].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 19, static_cast<int>(aAttrs2[6].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[6].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs2[6]) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs2[7].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 19, static_cast<int>(aAttrs2[7].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 24, static_cast<int>(aAttrs2[7].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[7].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs2[8].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[8].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 23, static_cast<int>(aAttrs2[8].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs2[8].maAttributes.size()) ); + CPPUNIT_ASSERT_EQUAL(size_t(9), aAttrs2.size()); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[0].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[0].mnStart)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs2[0].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[0].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[1].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs2[1].mnStart)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs2[1].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[1].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs2[1])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[2].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs2[2].mnStart)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs2[2].mnEnd)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs2[2].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasBold(aAttrs2[2])); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasItalic(aAttrs2[2])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[3].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs2[3].mnStart)); + CPPUNIT_ASSERT_EQUAL(23, static_cast<int>(aAttrs2[3].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[3].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be italic.", hasItalic(aAttrs2[3])); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[4].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[4].mnStart)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs2[4].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[4].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be italic.", hasItalic(aAttrs2[4])); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[5].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs2[5].mnStart)); + CPPUNIT_ASSERT_EQUAL(9, static_cast<int>(aAttrs2[5].mnEnd)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs2[5].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasBold(aAttrs2[5])); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasItalic(aAttrs2[5])); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[6].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(9, static_cast<int>(aAttrs2[6].mnStart)); + CPPUNIT_ASSERT_EQUAL(19, static_cast<int>(aAttrs2[6].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[6].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs2[6])); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs2[7].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(19, static_cast<int>(aAttrs2[7].mnStart)); + CPPUNIT_ASSERT_EQUAL(24, static_cast<int>(aAttrs2[7].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[7].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs2[8].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[8].mnStart)); + CPPUNIT_ASSERT_EQUAL(23, static_cast<int>(aAttrs2[8].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs2[8].maAttributes.size())); // Copy text using legacy format - uno::Reference< datatransfer::XTransferable > xData = aEditEngine.CreateTransferable( ESelection(0,8,1,14) ); + uno::Reference<datatransfer::XTransferable> xData + = aEditEngine.CreateTransferable(ESelection(0, 8, 1, 14)); // Paste text at the end - aEditEngine.InsertText( xData, OUString(), rDoc.GetEndPaM(), true ); + aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true); // Assert changes OUString aThirdParaAfterCopyPaste = aThirdPara + "first paragraph"; @@ -1493,116 +1596,116 @@ void Test::testParaBoldItalicCopyPaste() CPPUNIT_ASSERT_EQUAL( u"This is second"_ustr, rDoc.GetParaAsString(sal_Int32(3)) ); // Check updated text for appropriate Bold/Italics - std::unique_ptr<EditTextObject> pEditText3( aEditEngine.CreateTextObject() ); + std::unique_ptr<EditTextObject> pEditText3(aEditEngine.CreateTextObject()); std::vector<editeng::Section> aAttrs3; - pEditText3->GetAllSections( aAttrs3 ); + pEditText3->GetAllSections(aAttrs3); // There should be 15 sections - woB&woI - wB&woI - wB&wI -woB&wI - woB&wI - wB&wI - wB&woI - woB&woI - woB&woI // - wB&woI - wB&wI - woB&wI - -woB&wI - wB&wI - wB&woI (w - with, wo - without, B - Bold, I - Italic) - CPPUNIT_ASSERT_EQUAL( size_t(15), aAttrs3.size() ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[0].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[0].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs3[0].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[0].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[1].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs3[1].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs3[1].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[1].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs3[1]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[2].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs3[2].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs3[2].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[2].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasBold(aAttrs3[2]) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasItalic(aAttrs3[2]) ); - - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[3].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 18, static_cast<int>(aAttrs3[3].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 23, static_cast<int>(aAttrs3[3].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[3].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be italic.", hasItalic(aAttrs3[3]) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[4].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[4].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs3[4].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[4].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be italic.", hasItalic(aAttrs3[4]) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[5].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs3[5].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 9, static_cast<int>(aAttrs3[5].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[5].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasBold(aAttrs3[5]) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasItalic(aAttrs3[5]) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[6].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 9, static_cast<int>(aAttrs3[6].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 19, static_cast<int>(aAttrs3[6].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[6].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs3[6]) ); - - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[7].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 19, static_cast<int>(aAttrs3[7].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 24, static_cast<int>(aAttrs3[7].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[7].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[8].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[8].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 23, static_cast<int>(aAttrs3[8].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[8].maAttributes.size()) ); - - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[9].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 23, static_cast<int>(aAttrs3[9].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 29, static_cast<int>(aAttrs3[9].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[9].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs3[9]) ); - - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[10].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 29, static_cast<int>(aAttrs3[10].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 33, static_cast<int>(aAttrs3[10].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[10].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasBold(aAttrs3[10]) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasItalic(aAttrs3[10]) ); - - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[11].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 33, static_cast<int>(aAttrs3[11].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 38, static_cast<int>(aAttrs3[11].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[11].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be italic.", hasItalic(aAttrs3[11]) ); - - CPPUNIT_ASSERT_EQUAL( 3, static_cast<int>(aAttrs3[12].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 0, static_cast<int>(aAttrs3[12].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs3[12].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[12].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be italic.", hasItalic(aAttrs3[12]) ); - - CPPUNIT_ASSERT_EQUAL( 3, static_cast<int>(aAttrs3[13].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 5, static_cast<int>(aAttrs3[13].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 9, static_cast<int>(aAttrs3[13].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aAttrs3[13].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasBold(aAttrs3[13]) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold and italic.", hasItalic(aAttrs3[13]) ); - - CPPUNIT_ASSERT_EQUAL( 3, static_cast<int>(aAttrs3[14].mnParagraph) ); - CPPUNIT_ASSERT_EQUAL( 9, static_cast<int>(aAttrs3[14].mnStart) ); - CPPUNIT_ASSERT_EQUAL( 14, static_cast<int>(aAttrs3[14].mnEnd) ); - CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(aAttrs3[14].maAttributes.size()) ); - CPPUNIT_ASSERT_MESSAGE( "This section must be bold.", hasBold(aAttrs3[14]) ); + CPPUNIT_ASSERT_EQUAL(size_t(15), aAttrs3.size()); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[0].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[0].mnStart)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs3[0].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[0].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[1].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs3[1].mnStart)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs3[1].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[1].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs3[1])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[2].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs3[2].mnStart)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs3[2].mnEnd)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[2].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasBold(aAttrs3[2])); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasItalic(aAttrs3[2])); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[3].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(18, static_cast<int>(aAttrs3[3].mnStart)); + CPPUNIT_ASSERT_EQUAL(23, static_cast<int>(aAttrs3[3].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[3].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be italic.", hasItalic(aAttrs3[3])); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[4].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[4].mnStart)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs3[4].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[4].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be italic.", hasItalic(aAttrs3[4])); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[5].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs3[5].mnStart)); + CPPUNIT_ASSERT_EQUAL(9, static_cast<int>(aAttrs3[5].mnEnd)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[5].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasBold(aAttrs3[5])); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasItalic(aAttrs3[5])); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[6].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(9, static_cast<int>(aAttrs3[6].mnStart)); + CPPUNIT_ASSERT_EQUAL(19, static_cast<int>(aAttrs3[6].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[6].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs3[6])); + + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[7].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(19, static_cast<int>(aAttrs3[7].mnStart)); + CPPUNIT_ASSERT_EQUAL(24, static_cast<int>(aAttrs3[7].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[7].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[8].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[8].mnStart)); + CPPUNIT_ASSERT_EQUAL(23, static_cast<int>(aAttrs3[8].mnEnd)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[8].maAttributes.size())); + + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[9].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(23, static_cast<int>(aAttrs3[9].mnStart)); + CPPUNIT_ASSERT_EQUAL(29, static_cast<int>(aAttrs3[9].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[9].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs3[9])); + + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[10].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(29, static_cast<int>(aAttrs3[10].mnStart)); + CPPUNIT_ASSERT_EQUAL(33, static_cast<int>(aAttrs3[10].mnEnd)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[10].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasBold(aAttrs3[10])); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasItalic(aAttrs3[10])); + + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[11].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(33, static_cast<int>(aAttrs3[11].mnStart)); + CPPUNIT_ASSERT_EQUAL(38, static_cast<int>(aAttrs3[11].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[11].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be italic.", hasItalic(aAttrs3[11])); + + CPPUNIT_ASSERT_EQUAL(3, static_cast<int>(aAttrs3[12].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs3[12].mnStart)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs3[12].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[12].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be italic.", hasItalic(aAttrs3[12])); + + CPPUNIT_ASSERT_EQUAL(3, static_cast<int>(aAttrs3[13].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(aAttrs3[13].mnStart)); + CPPUNIT_ASSERT_EQUAL(9, static_cast<int>(aAttrs3[13].mnEnd)); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(aAttrs3[13].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasBold(aAttrs3[13])); + CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasItalic(aAttrs3[13])); + + CPPUNIT_ASSERT_EQUAL(3, static_cast<int>(aAttrs3[14].mnParagraph)); + CPPUNIT_ASSERT_EQUAL(9, static_cast<int>(aAttrs3[14].mnStart)); + CPPUNIT_ASSERT_EQUAL(14, static_cast<int>(aAttrs3[14].mnEnd)); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aAttrs3[14].maAttributes.size())); + CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(aAttrs3[14])); } void Test::testParaStartCopyPaste() { // Create EditEngine's instance - EditEngine aEditEngine( mpItemPool.get() ); + EditEngine aEditEngine(mpItemPool.get()); // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // Initially no text should be there - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetParaAsString(sal_Int32(0))); // Insert initial text OUString aFirstPara = u"This is first paragraph"_ustr; @@ -1617,16 +1720,17 @@ void Test::testParaStartCopyPaste() sal_Int32 aCopyTextLen = aCopyText.getLength(); // Assert changes - CPPUNIT_ASSERT_EQUAL( aTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( aFirstPara, rDoc.GetParaAsString(sal_Int32(0)) ); - CPPUNIT_ASSERT_EQUAL( aSecondPara, rDoc.GetParaAsString(sal_Int32(1)) ); - CPPUNIT_ASSERT_EQUAL( aThirdPara, rDoc.GetParaAsString(sal_Int32(2)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(aFirstPara, rDoc.GetParaAsString(sal_Int32(0))); + CPPUNIT_ASSERT_EQUAL(aSecondPara, rDoc.GetParaAsString(sal_Int32(1))); + CPPUNIT_ASSERT_EQUAL(aThirdPara, rDoc.GetParaAsString(sal_Int32(2))); // Copy initial text using legacy format - uno::Reference< datatransfer::XTransferable > xData = aEditEngine.CreateTransferable( ESelection(0,8,1,14) ); + uno::Reference<datatransfer::XTransferable> xData + = aEditEngine.CreateTransferable(ESelection(0, 8, 1, 14)); // Paste text at the start - aEditEngine.InsertText( xData, OUString(), rDoc.GetStartPaM(), true ); + aEditEngine.InsertText(xData, OUString(), rDoc.GetStartPaM(), true); // Assert changes OUString aSecondParaAfterCopyPaste = "This is second" + aFirstPara; @@ -1648,20 +1752,24 @@ void Test::testSectionAttributes() { aEngine.SetText(u"aaabbbccc"_ustr); pSet->Put(aBold); - CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly one item.", static_cast<sal_uInt16>(1), pSet->Count()); - aEngine.QuickSetAttribs(*pSet, ESelection(0,0,0,6)); // 'aaabbb' - end point is not inclusive. + CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly one item.", + static_cast<sal_uInt16>(1), pSet->Count()); + aEngine.QuickSetAttribs(*pSet, + ESelection(0, 0, 0, 6)); // 'aaabbb' - end point is not inclusive. pSet.reset(new SfxItemSet(aEngine.GetEmptyItemSet())); pSet->Put(aItalic); - CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly one item.", static_cast<sal_uInt16>(1), pSet->Count()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly one item.", + static_cast<sal_uInt16>(1), pSet->Count()); - aEngine.QuickSetAttribs(*pSet, ESelection(0,3,0,9)); // 'bbbccc' + aEngine.QuickSetAttribs(*pSet, ESelection(0, 3, 0, 9)); // 'bbbccc' std::unique_ptr<EditTextObject> pEditText(aEngine.CreateTextObject()); CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText); std::vector<editeng::Section> aAttrs; pEditText->GetAllSections(aAttrs); // Now, we should have a total of 3 sections. - CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be 3 sections.", static_cast<size_t>(3), aAttrs.size()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be 3 sections.", static_cast<size_t>(3), + aAttrs.size()); // First section should be 0-3 of paragraph 0, and it should only have boldness applied. CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aAttrs[0].mnParagraph)); @@ -1697,10 +1805,11 @@ void Test::testSectionAttributes() // Apply boldness to paragraphs 1, 3, 5 only. Leave 2 and 4 unformatted. pSet.reset(new SfxItemSet(aEngine.GetEmptyItemSet())); pSet->Put(aBold); - CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly one item.", static_cast<sal_uInt16>(1), pSet->Count()); - aEngine.QuickSetAttribs(*pSet, ESelection(0,0,0,3)); - aEngine.QuickSetAttribs(*pSet, ESelection(2,0,2,3)); - aEngine.QuickSetAttribs(*pSet, ESelection(4,0,4,5)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly one item.", + static_cast<sal_uInt16>(1), pSet->Count()); + aEngine.QuickSetAttribs(*pSet, ESelection(0, 0, 0, 3)); + aEngine.QuickSetAttribs(*pSet, ESelection(2, 0, 2, 3)); + aEngine.QuickSetAttribs(*pSet, ESelection(4, 0, 4, 5)); std::unique_ptr<EditTextObject> pEditText(aEngine.CreateTextObject()); CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText); @@ -1739,7 +1848,6 @@ void Test::testSectionAttributes() CPPUNIT_ASSERT_MESSAGE("Attribute array should be empty.", aAttrs[3].maAttributes.empty()); } - { aEngine.Clear(); aEngine.SetText(u"one\ntwo"_ustr); @@ -1748,14 +1856,14 @@ void Test::testSectionAttributes() // embolden 2nd paragraph pSet.reset(new SfxItemSet(aEngine.GetEmptyItemSet())); pSet->Put(aBold); - aEngine.QuickSetAttribs(*pSet, ESelection(1,0,1,3)); + aEngine.QuickSetAttribs(*pSet, ESelection(1, 0, 1, 3)); // disboldify 1st paragraph SvxWeightItem aNotSoBold(WEIGHT_NORMAL, EE_CHAR_WEIGHT); pSet->Put(aNotSoBold); - aEngine.QuickSetAttribs(*pSet, ESelection(0,0,0,3)); + aEngine.QuickSetAttribs(*pSet, ESelection(0, 0, 0, 3)); // now delete & join the paragraphs - this is fdo#85496 scenario - aEngine.QuickDelete(ESelection(0,0,1,3)); + aEngine.QuickDelete(ESelection(0, 0, 1, 3)); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aEngine.GetParagraphCount()); std::unique_ptr<EditTextObject> pEditText(aEngine.CreateTextObject()); @@ -1773,7 +1881,7 @@ void Test::testSectionAttributes() { sal_uInt16 const nWhich(aAttrs[0].maAttributes[i]->Which()); CPPUNIT_ASSERT_MESSAGE("duplicate item in text portion attributes", - whiches.insert(nWhich).second); + whiches.insert(nWhich).second); } } } @@ -1781,14 +1889,14 @@ void Test::testSectionAttributes() void Test::testLargeParaCopyPaste() { // Create EditEngine's instance - EditEngine aEditEngine( mpItemPool.get() ); + EditEngine aEditEngine(mpItemPool.get()); // Get EditDoc for current EditEngine's instance - EditDoc &rDoc = aEditEngine.GetEditDoc(); + EditDoc& rDoc = aEditEngine.GetEditDoc(); // Initially no text should be there - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( OUString(), rDoc.GetParaAsString(sal_Int32(0)) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetParaAsString(sal_Int32(0))); // Insert initial text OUString aFirstPara = u"This is first paragraph"_ustr; @@ -1814,24 +1922,25 @@ void Test::testLargeParaCopyPaste() sal_Int32 aCopyTextLen = aCopyText.getLength(); // Assert changes - CPPUNIT_ASSERT_EQUAL( aTextLen, rDoc.GetTextLen() ); - CPPUNIT_ASSERT_EQUAL( aFirstPara, rDoc.GetParaAsString(sal_Int32(0)) ); - CPPUNIT_ASSERT_EQUAL( aSecondPara, rDoc.GetParaAsString(sal_Int32(1)) ); - CPPUNIT_ASSERT_EQUAL( aThirdPara, rDoc.GetParaAsString(sal_Int32(2)) ); - CPPUNIT_ASSERT_EQUAL( aFourthPara, rDoc.GetParaAsString(sal_Int32(3)) ); - CPPUNIT_ASSERT_EQUAL( aFifthPara, rDoc.GetParaAsString(sal_Int32(4)) ); - CPPUNIT_ASSERT_EQUAL( aSixthPara, rDoc.GetParaAsString(sal_Int32(5)) ); - CPPUNIT_ASSERT_EQUAL( aSeventhPara, rDoc.GetParaAsString(sal_Int32(6)) ); - CPPUNIT_ASSERT_EQUAL( aEighthPara, rDoc.GetParaAsString(sal_Int32(7)) ); - CPPUNIT_ASSERT_EQUAL( aNinthPara, rDoc.GetParaAsString(sal_Int32(8)) ); - CPPUNIT_ASSERT_EQUAL( aTenthPara, rDoc.GetParaAsString(sal_Int32(9)) ); + CPPUNIT_ASSERT_EQUAL(aTextLen, rDoc.GetTextLen()); + CPPUNIT_ASSERT_EQUAL(aFirstPara, rDoc.GetParaAsString(sal_Int32(0))); + CPPUNIT_ASSERT_EQUAL(aSecondPara, rDoc.GetParaAsString(sal_Int32(1))); + CPPUNIT_ASSERT_EQUAL(aThirdPara, rDoc.GetParaAsString(sal_Int32(2))); + CPPUNIT_ASSERT_EQUAL(aFourthPara, rDoc.GetParaAsString(sal_Int32(3))); + CPPUNIT_ASSERT_EQUAL(aFifthPara, rDoc.GetParaAsString(sal_Int32(4))); + CPPUNIT_ASSERT_EQUAL(aSixthPara, rDoc.GetParaAsString(sal_Int32(5))); + CPPUNIT_ASSERT_EQUAL(aSeventhPara, rDoc.GetParaAsString(sal_Int32(6))); + CPPUNIT_ASSERT_EQUAL(aEighthPara, rDoc.GetParaAsString(sal_Int32(7))); + CPPUNIT_ASSERT_EQUAL(aNinthPara, rDoc.GetParaAsString(sal_Int32(8))); + CPPUNIT_ASSERT_EQUAL(aTenthPara, rDoc.GetParaAsString(sal_Int32(9))); // Copy initial text using legacy format - uno::Reference< datatransfer::XTransferable > xData = aEditEngine.CreateTransferable( ESelection(5,8,7,14) ); + uno::Reference<datatransfer::XTransferable> xData + = aEditEngine.CreateTransferable(ESelection(5, 8, 7, 14)); // Paste text at the end of 4th Para ContentNode* pLastNode = rDoc.GetObject(3); - aEditEngine.InsertText( xData, OUString(), EditPaM( pLastNode, pLastNode->Len() ), true ); + aEditEngine.InsertText(xData, OUString(), EditPaM(pLastNode, pLastNode->Len()), true); // Assert changes OUString aFourthParaAfterCopyPaste = aFourthPara + "sixth paragraph"; @@ -1850,18 +1959,18 @@ void Test::testLargeParaCopyPaste() CPPUNIT_ASSERT_EQUAL( aTenthPara, rDoc.GetParaAsString(sal_Int32(11)) ); } -OUString lcl_translitTest(EditEngine& aEditEngine, const OUString& text, const ESelection& esel, const TransliterationFlags nType) +OUString lcl_translitTest(EditEngine& aEditEngine, const OUString& text, const ESelection& esel, + const TransliterationFlags nType) { aEditEngine.SetText(text); aEditEngine.TransliterateText(esel, nType); return aEditEngine.GetText(); } - void Test::testTransliterate() { // Create EditEngine's instance - EditEngine editEng( mpItemPool.get() ); + EditEngine editEng(mpItemPool.get()); OUString sText(u"one (two) three"_ustr); editEng.SetText(sText); @@ -1940,7 +2049,6 @@ void Test::testTransliterate() CPPUNIT_ASSERT_EQUAL(u"Mary Jones MEt joe Smith. Time Passed."_ustr, lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE)); CPPUNIT_ASSERT_EQUAL(u"Mary Jones met joe Smith. Time Passed."_ustr, lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE)); - /* Test behavior when there is a selection that crosses a word boundary: "nes met joe Sm" */ selStart = 7; selEnd = 21; @@ -1989,7 +2097,7 @@ void Test::testTdf147196() void Test::testTdf148148() { using TF = TransliterationFlags; - EditEngine editEng( mpItemPool.get() ); + EditEngine editEng(mpItemPool.get()); /* Test what happens when node contains text but selection does not contain any text */ int selStart = 0; @@ -2071,7 +2179,7 @@ void Test::testTdf148148() void Test::testSingleLine() { - EditEngine aEditEngine( mpItemPool.get() ); + EditEngine aEditEngine(mpItemPool.get()); aEditEngine.SetSingleLine(true); aEditEngine.SetText(u"Bolivian\nSanta Cruz de la Sierra"_ustr); @@ -2150,7 +2258,8 @@ void Test::testMoveParagraph() CPPUNIT_ASSERT_EQUAL(u"Paragraph 4"_ustr, aEditEngine.GetText(3)); CPPUNIT_ASSERT_EQUAL(u"Paragraph 5"_ustr, aEditEngine.GetText(4)); - aEditEngine.MoveParagraphs(Range(0, 0), 8); // Move paragraph 1 -> to before index 8 but 8 is out of bounds + aEditEngine.MoveParagraphs(Range(0, 0), + 8); // Move paragraph 1 -> to before index 8 but 8 is out of bounds CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aEditEngine.GetParagraphCount()); CPPUNIT_ASSERT_EQUAL(u"Paragraph 2"_ustr, aEditEngine.GetText(0)); @@ -2423,7 +2532,6 @@ void Test::testTdf162803StaleKashidaArray() } CPPUNIT_TEST_SUITE_REGISTRATION(Test); - } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index da13332d9ad4..ea42f1a70312 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -374,35 +374,35 @@ namespace accessibility if( !GetEditViewForwarder().GetSelection( aSelection ) ) return false; - if( aSelection.nStartPara < aSelection.nEndPara ) + if( aSelection.start.nPara < aSelection.end.nPara ) { - if( aSelection.nStartPara > nPara || - aSelection.nEndPara < nPara ) + if( aSelection.start.nPara > nPara || + aSelection.end.nPara < nPara ) return false; - if( nPara == aSelection.nStartPara ) - nStartPos = aSelection.nStartPos; + if( nPara == aSelection.start.nPara ) + nStartPos = aSelection.start.nIndex; else nStartPos = 0; - if( nPara == aSelection.nEndPara ) - nEndPos = aSelection.nEndPos; + if( nPara == aSelection.end.nPara ) + nEndPos = aSelection.end.nIndex; else nEndPos = GetTextLen(); } else { - if( aSelection.nStartPara < nPara || - aSelection.nEndPara > nPara ) + if( aSelection.start.nPara < nPara || + aSelection.end.nPara > nPara ) return false; - if( nPara == aSelection.nStartPara ) - nStartPos = aSelection.nStartPos; + if( nPara == aSelection.start.nPara ) + nStartPos = aSelection.start.nIndex; else nStartPos = GetTextLen(); - if( nPara == aSelection.nEndPara ) - nEndPos = aSelection.nEndPos; + if( nPara == aSelection.end.nPara ) + nEndPos = aSelection.end.nIndex; else nEndPos = 0; } @@ -984,7 +984,7 @@ namespace accessibility EBulletInfo aBulletInfo = rCacheTF.GetBulletInfo(GetParagraphIndex()); - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible && aBulletInfo.nType == SVX_NUM_BITMAP ) { @@ -1120,19 +1120,19 @@ namespace accessibility ESelection aSelection; if( GetEditViewForwarder().GetSelection( aSelection ) && - GetParagraphIndex() == aSelection.nEndPara ) + GetParagraphIndex() == aSelection.end.nPara ) { // caret is always nEndPara,nEndPos EBulletInfo aBulletInfo = GetTextForwarder().GetBulletInfo(GetParagraphIndex()); - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible && aBulletInfo.nType != SVX_NUM_BITMAP ) { sal_Int32 nBulletLen = aBulletInfo.aText.getLength(); - if( aSelection.nEndPos - nBulletLen >= 0 ) - return aSelection.nEndPos - nBulletLen; + if( aSelection.end.nIndex - nBulletLen >= 0 ) + return aSelection.end.nIndex - nBulletLen; } - return aSelection.nEndPos; + return aSelection.end.nIndex; } // not within this paragraph @@ -2046,7 +2046,7 @@ namespace accessibility //Because bullet may occupy one or more characters, the TextAdapter will include bullet to calculate the selection. Add offset to handle bullet sal_Int32 nBulletLen = 0; EBulletInfo aBulletInfo = GetTextForwarder().GetBulletInfo(GetParagraphIndex()); - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && aBulletInfo.bVisible ) + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible ) nBulletLen = aBulletInfo.aText.getLength(); // save current selection ESelection aOldSelection; @@ -2089,7 +2089,7 @@ namespace accessibility // Because bullet may occupy one or more characters, the TextAdapter will include bullet to calculate the selection. Add offset to handle bullet sal_Int32 nBulletLen = 0; EBulletInfo aBulletInfo = GetTextForwarder().GetBulletInfo(GetParagraphIndex()); - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && aBulletInfo.bVisible ) + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible ) nBulletLen = aBulletInfo.aText.getLength(); ESelection aSelection = MakeSelection (nStartIndex + nBulletLen, nEndIndex + nBulletLen); //if( !rCacheTF.IsEditable( MakeSelection(nStartIndex, nEndIndex) ) ) @@ -2126,7 +2126,7 @@ namespace accessibility // Because bullet may occupy one or more characters, the TextAdapter will include bullet to calculate the selection. Add offset to handle bullet sal_Int32 nBulletLen = 0; EBulletInfo aBulletInfo = GetTextForwarder().GetBulletInfo(GetParagraphIndex()); - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && aBulletInfo.bVisible ) + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible ) nBulletLen = aBulletInfo.aText.getLength(); if( !rCacheTF.IsEditable( MakeSelection(nIndex + nBulletLen) ) ) return false; // non-editable area selected @@ -2163,7 +2163,7 @@ namespace accessibility // Because bullet may occupy one or more characters, the TextAdapter will include bullet to calculate the selection. Add offset to handle bullet sal_Int32 nBulletLen = 0; EBulletInfo aBulletInfo = GetTextForwarder().GetBulletInfo(GetParagraphIndex()); - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && aBulletInfo.bVisible ) + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible ) nBulletLen = aBulletInfo.aText.getLength(); ESelection aSelection = MakeSelection (nStartIndex + nBulletLen, nEndIndex + nBulletLen); @@ -2204,7 +2204,7 @@ namespace accessibility // Because bullet may occupy one or more characters, the TextAdapter will include bullet to calculate the selection. Add offset to handle bullet sal_Int32 nBulletLen = 0; EBulletInfo aBulletInfo = GetTextForwarder().GetBulletInfo(GetParagraphIndex()); - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && aBulletInfo.bVisible ) + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible ) nBulletLen = aBulletInfo.aText.getLength(); if( !rCacheTF.IsEditable( MakeSelection(nIndex + nBulletLen) ) ) @@ -2244,7 +2244,7 @@ namespace accessibility // Because bullet may occupy one or more characters, the TextAdapter will include bullet to calculate the selection. Add offset to handle bullet sal_Int32 nBulletLen = 0; EBulletInfo aBulletInfo = GetTextForwarder().GetBulletInfo(GetParagraphIndex()); - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && aBulletInfo.bVisible ) + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible ) nBulletLen = aBulletInfo.aText.getLength(); ESelection aSelection = MakeSelection (nStartIndex + nBulletLen, nEndIndex + nBulletLen); diff --git a/editeng/source/accessibility/AccessibleImageBullet.cxx b/editeng/source/accessibility/AccessibleImageBullet.cxx index 5d07e71be0f9..5870e3300c95 100644 --- a/editeng/source/accessibility/AccessibleImageBullet.cxx +++ b/editeng/source/accessibility/AccessibleImageBullet.cxx @@ -231,7 +231,7 @@ namespace accessibility EBulletInfo aBulletInfo = rCacheTF.GetBulletInfo( GetParagraphIndex() ); tools::Rectangle aParentRect = rCacheTF.GetParaBounds( GetParagraphIndex() ); - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible && aBulletInfo.nType == SVX_NUM_BITMAP ) { diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx index 7d22150e1503..e318dc4eecba 100644 --- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx +++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx @@ -131,19 +131,19 @@ namespace accessibility AccessibleEditableTextPara& GetParagraph( sal_Int32 nPara ) const; sal_Int32 GetParagraphCount() const; - EPosition Index2Internal( sal_Int32 nFlatIndex ) const + EPaM Index2Internal( sal_Int32 nFlatIndex ) const { return ImpCalcInternal( nFlatIndex, false ); } - EPosition Range2Internal( sal_Int32 nFlatIndex ) const + EPaM Range2Internal( sal_Int32 nFlatIndex ) const { return ImpCalcInternal( nFlatIndex, true ); } - sal_Int32 Internal2Index( EPosition nEEIndex ) const; + sal_Int32 Internal2Index( EPaM nEEIndex ) const; void CorrectTextSegment( TextSegment& aTextSegment, int nPara ) const; @@ -158,7 +158,7 @@ namespace accessibility private: - EPosition ImpCalcInternal( sal_Int32 nFlatIndex, bool bExclusive ) const; + EPaM ImpCalcInternal( sal_Int32 nFlatIndex, bool bExclusive ) const; // our frontend class (the one implementing the actual // interface). That's not necessarily the one containing the impl @@ -233,7 +233,7 @@ namespace accessibility return mxTextParagraph->GetTextForwarder().GetParagraphCount(); } - sal_Int32 AccessibleStaticTextBase_Impl::Internal2Index( EPosition nEEIndex ) const + sal_Int32 AccessibleStaticTextBase_Impl::Internal2Index(EPaM nEEIndex) const { // XXX checks for overflow and returns maximum if so sal_Int32 aRes(0); @@ -268,7 +268,7 @@ namespace accessibility } } - EPosition AccessibleStaticTextBase_Impl::ImpCalcInternal( sal_Int32 nFlatIndex, bool bExclusive ) const + EPaM AccessibleStaticTextBase_Impl::ImpCalcInternal(sal_Int32 nFlatIndex, bool bExclusive) const { if( nFlatIndex < 0 ) @@ -288,7 +288,7 @@ namespace accessibility nFlatIndex - nCurrIndex + nCurrCount >= 0, "AccessibleStaticTextBase_Impl::Index2Internal: index value overflow"); - return EPosition(nCurrPara, nFlatIndex - nCurrIndex + nCurrCount); + return EPaM(nCurrPara, nFlatIndex - nCurrIndex + nCurrCount); } } @@ -300,7 +300,7 @@ namespace accessibility nFlatIndex - nCurrIndex + nCurrCount >= 0, "AccessibleStaticTextBase_Impl::Index2Internal: index value overflow"); - return EPosition(nCurrPara-1, nFlatIndex - nCurrIndex + nCurrCount); + return EPaM(nCurrPara - 1, nFlatIndex - nCurrIndex + nCurrCount); } // not found? Out of bounds @@ -507,7 +507,7 @@ namespace accessibility { SolarMutexGuard aGuard; - EPosition aPos( mpImpl->Index2Internal(nIndex) ); + EPaM aPos(mpImpl->Index2Internal(nIndex)); return mpImpl->GetParagraph( aPos.nPara ).getCharacter( aPos.nIndex ); } @@ -519,7 +519,7 @@ namespace accessibility //get the actual index without "\n" mpImpl->RemoveLineBreakCount( nIndex ); - EPosition aPos( mpImpl->Index2Internal(nIndex) ); + EPaM aPos(mpImpl->Index2Internal(nIndex)); return mpImpl->GetParagraph( aPos.nPara ).getCharacterAttributes( aPos.nIndex, aRequestedAttributes ); } @@ -530,7 +530,7 @@ namespace accessibility // #108900# Allow ranges for nIndex, as one-past-the-end // values are now legal, too. - EPosition aPos( mpImpl->Range2Internal(nIndex) ); + EPaM aPos(mpImpl->Range2Internal(nIndex)); // #i70916# Text in spread sheet cells return the wrong extents AccessibleEditableTextPara& rPara = mpImpl->GetParagraph( aPos.nPara ); @@ -575,7 +575,7 @@ namespace accessibility // #112814# Use correct index offset if ( ( nIndex = rPara.getIndexAtPoint( aPoint ) ) != -1 ) - return mpImpl->Internal2Index(EPosition(i, nIndex)); + return mpImpl->Internal2Index(EPaM(i, nIndex)); } return -1; @@ -627,8 +627,8 @@ namespace accessibility { SolarMutexGuard aGuard; - EPosition aStartIndex( mpImpl->Range2Internal(nStartIndex) ); - EPosition aEndIndex( mpImpl->Range2Internal(nEndIndex) ); + EPaM aStartIndex(mpImpl->Range2Internal(nStartIndex)); + EPaM aEndIndex(mpImpl->Range2Internal(nEndIndex)); return mpImpl->SetSelection( aStartIndex.nPara, aStartIndex.nIndex, aEndIndex.nPara, aEndIndex.nIndex ); @@ -682,8 +682,8 @@ namespace accessibility nEndIndex++; } OUStringBuffer aRes; - EPosition aStartIndex( mpImpl->Range2Internal(nStartIndex) ); - EPosition aEndIndex( mpImpl->Range2Internal(nEndIndex) ); + EPaM aStartIndex(mpImpl->Range2Internal(nStartIndex)); + EPaM aEndIndex(mpImpl->Range2Internal(nEndIndex)); // #102170# Special case: start and end paragraph are identical if( aStartIndex.nPara == aEndIndex.nPara ) @@ -733,7 +733,7 @@ namespace accessibility SolarMutexGuard aGuard; bool bLineBreak = mpImpl->RemoveLineBreakCount( nIndex ); - EPosition aPos( mpImpl->Range2Internal(nIndex) ); + EPaM aPos(mpImpl->Range2Internal(nIndex)); css::accessibility::TextSegment aResult; @@ -749,7 +749,7 @@ namespace accessibility aResult.SegmentText = mpImpl->GetParagraph( aPos.nPara ).getText(); // #112814# Adapt the start index with the paragraph offset - aResult.SegmentStart = mpImpl->Internal2Index( EPosition( aPos.nPara, 0 ) ); + aResult.SegmentStart = mpImpl->Internal2Index(EPaM(aPos.nPara, 0)); aResult.SegmentEnd = aResult.SegmentStart + aResult.SegmentText.getLength(); } else if ( AccessibleTextType::ATTRIBUTE_RUN == aTextType ) @@ -785,7 +785,7 @@ namespace accessibility sal_Int32 nOldIdx = nIndex; bool bLineBreak = mpImpl->RemoveLineBreakCount( nIndex ); - EPosition aPos( mpImpl->Range2Internal(nIndex) ); + EPaM aPos(mpImpl->Range2Internal(nIndex)); css::accessibility::TextSegment aResult; @@ -797,14 +797,14 @@ namespace accessibility aResult.SegmentText = mpImpl->GetParagraph( aPos.nPara ).getText(); // #112814# Adapt the start index with the paragraph offset - aResult.SegmentStart = mpImpl->Internal2Index( EPosition( aPos.nPara, 0 ) ); + aResult.SegmentStart = mpImpl->Internal2Index(EPaM(aPos.nPara, 0)); } else if( aPos.nPara > 0 ) { aResult.SegmentText = mpImpl->GetParagraph( aPos.nPara - 1 ).getText(); // #112814# Adapt the start index with the paragraph offset - aResult.SegmentStart = mpImpl->Internal2Index( EPosition( aPos.nPara - 1, 0 ) ); + aResult.SegmentStart = mpImpl->Internal2Index(EPaM(aPos.nPara - 1, 0)); } aResult.SegmentEnd = aResult.SegmentStart + aResult.SegmentText.getLength(); @@ -832,7 +832,7 @@ namespace accessibility sal_Int32 nTemp = nIndex+1; bool bLineBreak = mpImpl->RemoveLineBreakCount( nTemp ); mpImpl->RemoveLineBreakCount( nIndex ); - EPosition aPos( mpImpl->Range2Internal(nIndex) ); + EPaM aPos(mpImpl->Range2Internal(nIndex)); css::accessibility::TextSegment aResult; @@ -846,7 +846,7 @@ namespace accessibility aResult.SegmentText = mpImpl->GetParagraph( aPos.nPara + 1 ).getText(); // #112814# Adapt the start index with the paragraph offset - aResult.SegmentStart = mpImpl->Internal2Index( EPosition( aPos.nPara + 1, 0 ) ); + aResult.SegmentStart = mpImpl->Internal2Index(EPaM(aPos.nPara + 1, 0)); aResult.SegmentEnd = aResult.SegmentStart + aResult.SegmentText.getLength(); } } @@ -873,8 +873,8 @@ namespace accessibility if( nStartIndex > nEndIndex ) std::swap(nStartIndex, nEndIndex); - EPosition aStartIndex( mpImpl->Range2Internal(nStartIndex) ); - EPosition aEndIndex( mpImpl->Range2Internal(nEndIndex) ); + EPaM aStartIndex(mpImpl->Range2Internal(nStartIndex)); + EPaM aEndIndex(mpImpl->Range2Internal(nEndIndex)); return mpImpl->CopyText( aStartIndex.nPara, aStartIndex.nIndex, aEndIndex.nPara, aEndIndex.nIndex ); @@ -926,7 +926,7 @@ namespace accessibility SolarMutexGuard aGuard; - EPosition aPos( mpImpl->Index2Internal( nIndex ) ); + EPaM aPos(mpImpl->Index2Internal(nIndex)); AccessibleEditableTextPara& rPara = mpImpl->GetParagraph( aPos.nPara ); uno::Sequence< beans::PropertyValue > aDefAttrSeq = rPara.getDefaultAttributes( RequestedAttributes ); uno::Sequence< beans::PropertyValue > aRunAttrSeq = rPara.getRunAttributes( aPos.nIndex, RequestedAttributes ); diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index c49b988b2b6a..f5b0a3829008 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -482,7 +482,7 @@ void EditEngine::DumpData(const EditEngine* pEE, bool bInfoBox) fprintf( fp, "\n VisArea: nX=%" SAL_PRIdINT64 ", nY=%" SAL_PRIdINT64 ", dX=%" SAL_PRIdINT64 ", dY=%" SAL_PRIdINT64, sal_Int64(aR.Left()), sal_Int64(aR.Top()), sal_Int64(aR.GetSize().Width()), sal_Int64(aR.GetSize().Height()) ); ESelection aSel = pV->GetSelection(); - fprintf( fp, "\n Selection: Start=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ", End=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32, aSel.nStartPara, aSel.nStartPos, aSel.nEndPara, aSel.nEndPos ); + fprintf( fp, "\n Selection: Start=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ", End=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32, aSel.start.nPara, aSel.start.nIndex, aSel.end.nPara, aSel.end.nIndex ); } if ( pEE->GetActiveView() ) { diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 2a69d5d712b5..8546cb26e302 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -448,7 +448,7 @@ sal_Int32 FastGetPos(const Array& rArray, const Val* p, sal_Int32& rLastPos) } // XXX "not found" condition for sal_Int32 indexes - return EE_PARA_NOT_FOUND; + return EE_PARA_MAX; } } @@ -534,7 +534,7 @@ sal_Int32 ParaPortionList::FindParagraph(tools::Long nYOffset) const if ( nY > nYOffset ) return i <= SAL_MAX_INT32 ? static_cast<sal_Int32>(i) : SAL_MAX_INT32; } - return EE_PARA_NOT_FOUND; + return EE_PARA_MAX; } #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index ce9b182c0f54..058f522385a6 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -473,8 +473,7 @@ EEHorizontalTextDirection EditEngine::GetDefaultHorizontalTextDirection() const SvtScriptType EditEngine::GetScriptType( const ESelection& rSelection ) const { - EditSelection aSel(getImpl().CreateSel(rSelection)); - return getImpl().GetItemScriptType( aSel ); + return getImpl().GetItemScriptType(getImpl().CreateSel(rSelection)); } editeng::LanguageSpan EditEngine::GetLanguage(const EditPaM& rPaM) const @@ -492,7 +491,7 @@ editeng::LanguageSpan EditEngine::GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) void EditEngine::TransliterateText( const ESelection& rSelection, TransliterationFlags nTransliterationMode ) { - getImpl().TransliterateText(getImpl().CreateSel( rSelection ), nTransliterationMode); + TransliterateText(CreateSelection(rSelection), nTransliterationMode); } EditSelection EditEngine::TransliterateText(const EditSelection& rSelection, TransliterationFlags nTransliterationMode) @@ -619,11 +618,11 @@ sal_Int32 EditEngine::GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) return getImpl().GetLineNumberAtIndex(nPara, nIndex); } -sal_uInt32 EditEngine::GetLineHeight( sal_Int32 nParagraph ) +sal_uInt32 EditEngine::GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine ) { // If someone calls GetLineHeight() with an empty Engine. ensureDocumentFormatted(); - return getImpl().GetLineHeight( nParagraph, 0 ); + return getImpl().GetLineHeight( nParagraph, nLine ); } tools::Rectangle EditEngine::GetParaBounds( sal_Int32 nPara ) @@ -655,22 +654,19 @@ sal_uInt32 EditEngine::GetTextHeight( sal_Int32 nParagraph ) const return nHeight; } -OUString EditEngine::GetWord( sal_Int32 nPara, sal_Int32 nIndex ) +OUString EditEngine::GetWord(const EPaM& rPos) { - ESelection aESel( nPara, nIndex, nPara, nIndex ); - EditSelection aSel(getImpl().CreateSel(aESel)); - aSel = getImpl().SelectWord(aSel); - return getImpl().GetSelected(aSel); + EditSelection aSel(CreateSelection(ESelection(rPos))); + aSel = SelectWord(aSel); + return GetSelected(aSel); } ESelection EditEngine::GetWord( const ESelection& rSelection, sal_uInt16 nWordType ) const { // ImpEditEngine-Iteration-Methods should be const! - EditEngine* pNonConstEditEngine = const_cast<EditEngine*>(this); - - EditSelection aSel(pNonConstEditEngine->getImpl().CreateSel( rSelection ) ); - aSel = pNonConstEditEngine->getImpl().SelectWord( aSel, nWordType ); - return pNonConstEditEngine->getImpl().CreateESel( aSel ); + EditSelection aSel(getImpl().CreateSel(rSelection)); + aSel = getImpl().SelectWord(aSel, nWordType); + return CreateESelection(aSel); } void EditEngine::CheckIdleFormatter() @@ -935,6 +931,19 @@ EditSelection EditEngine::CreateSelection(const ESelection& rSel) return getImpl().CreateSel(rSel); } +ESelection EditEngine::NormalizeESelection(const ESelection& rSel) const +{ + return CreateESelection(getImpl().CreateNormalizedSel(rSel)); +} + +EPaM EditEngine::GetEnd() const +{ + auto para = GetEditDoc().Count(); + if (para) + --para; + return { para, GetTextLen(para) }; +} + const SfxItemSet& EditEngine::GetBaseParaAttribs(sal_Int32 nPara) const { return getImpl().GetParaAttribs(nPara); @@ -1501,8 +1510,7 @@ std::unique_ptr<EditTextObject> EditEngine::CreateTextObject() std::unique_ptr<EditTextObject> EditEngine::CreateTextObject( const ESelection& rESelection ) { - EditSelection aSel(getImpl().CreateSel(rESelection)); - return getImpl().CreateTextObject(aSel); + return getImpl().CreateTextObject(CreateSelection(rESelection)); } std::unique_ptr<EditTextObject> EditEngine::GetEmptyTextObject() @@ -1761,8 +1769,7 @@ void EditEngine::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLi SfxItemSet EditEngine::GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib ) { - EditSelection aSel(getImpl().ConvertSelection(rSel.nStartPara, rSel.nStartPos, rSel.nEndPara, rSel.nEndPos)); - return getImpl().GetAttribs(aSel, nOnlyHardAttrib); + return getImpl().GetAttribs(getImpl().CreateNormalizedSel(rSel), nOnlyHardAttrib); } SfxItemSet EditEngine::GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags ) const @@ -1777,8 +1784,7 @@ void EditEngine::RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAt EERemoveParaAttribsMode::RemoveCharItems; getImpl().UndoActionStart(EDITUNDO_RESETATTRIBS); - EditSelection aSel(getImpl().ConvertSelection(rSelection.nStartPara, rSelection.nStartPos, rSelection.nEndPara, rSelection.nEndPos)); - getImpl().RemoveCharAttribs(aSel, eMode, nWhich); + RemoveCharAttribs(getImpl().CreateNormalizedSel(rSelection), eMode, nWhich); getImpl().UndoActionEnd(); if (getImpl().IsUpdateLayout()) getImpl().FormatAndLayout(); @@ -2035,15 +2041,14 @@ SfxItemPool* EditEngine::GetEditTextObjectPool() const void EditEngine::QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) { - EditSelection aSel(getImpl().ConvertSelection(rSel.nStartPara, rSel.nStartPos, rSel.nEndPara, rSel.nEndPos)); - getImpl().SetAttribs(aSel, rSet); + getImpl().SetAttribs(getImpl().CreateNormalizedSel(rSel), rSet); } void EditEngine::QuickMarkInvalid( const ESelection& rSel ) { - DBG_ASSERT(rSel.nStartPara < getImpl().GetEditDoc().Count(), "MarkInvalid: Start out of Range!"); - DBG_ASSERT(rSel.nEndPara < getImpl().GetEditDoc().Count(), "MarkInvalid: End out of Range!"); - for (sal_Int32 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++) + DBG_ASSERT(rSel.start.nPara < getImpl().GetEditDoc().Count(), "MarkInvalid: Start out of Range!"); + DBG_ASSERT(rSel.end.nPara < getImpl().GetEditDoc().Count(), "MarkInvalid: End out of Range!"); + for (sal_Int32 nPara = rSel.start.nPara; nPara <= rSel.end.nPara; nPara++) { ParaPortion* pPortion = getImpl().GetParaPortions().SafeGetObject(nPara); if ( pPortion ) @@ -2053,14 +2058,12 @@ void EditEngine::QuickMarkInvalid( const ESelection& rSel ) void EditEngine::QuickInsertText(const OUString& rText, const ESelection& rSel) { - EditSelection aSel(getImpl().ConvertSelection(rSel.nStartPara, rSel.nStartPos, rSel.nEndPara, rSel.nEndPos)); - getImpl().ImpInsertText(aSel, rText); + getImpl().ImpInsertText(getImpl().CreateNormalizedSel(rSel), rText); } void EditEngine::QuickDelete( const ESelection& rSel ) { - EditSelection aSel(getImpl().ConvertSelection(rSel.nStartPara, rSel.nStartPos, rSel.nEndPara, rSel.nEndPos)); - getImpl().ImpDeleteSelection( aSel ); + getImpl().ImpDeleteSelection(getImpl().CreateNormalizedSel(rSel)); } void EditEngine::QuickMarkToBeRepainted( sal_Int32 nPara ) @@ -2072,15 +2075,12 @@ void EditEngine::QuickMarkToBeRepainted( sal_Int32 nPara ) void EditEngine::QuickInsertLineBreak( const ESelection& rSel ) { - EditSelection aSel(getImpl().ConvertSelection(rSel.nStartPara, rSel.nStartPos, rSel.nEndPara, rSel.nEndPos)); - getImpl().InsertLineBreak( aSel ); + getImpl().InsertLineBreak(getImpl().CreateNormalizedSel(rSel)); } void EditEngine::QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) { - - EditSelection aSel(getImpl().ConvertSelection(rSel.nStartPara, rSel.nStartPos, rSel.nEndPara, rSel.nEndPos)); - getImpl().ImpInsertFeature(aSel, rFld); + getImpl().ImpInsertFeature(getImpl().CreateNormalizedSel(rSel), rFld); } void EditEngine::QuickFormatDoc( bool bFull ) @@ -2368,20 +2368,16 @@ sal_Int32 EditEngine::FindParagraph( tools::Long nDocPosY ) return getImpl().GetParaPortions().FindParagraph(nDocPosY); } -EPosition EditEngine::FindDocPosition( const Point& rDocPos ) const +EPaM EditEngine::FindDocPosition(const Point& rDocPos) const { - EPosition aPos; // From the point of the API, this is const... EditPaM aPaM = getImpl().GetPaM(rDocPos, false); if ( aPaM.GetNode() ) - { - aPos.nPara = getImpl().maEditDoc.GetPos(aPaM.GetNode()); - aPos.nIndex = aPaM.GetIndex(); - } - return aPos; + return getImpl().CreateEPaM(aPaM); + return EPaM::NotFound(); } -tools::Rectangle EditEngine::GetCharacterBounds( const EPosition& rPos ) const +tools::Rectangle EditEngine::GetCharacterBounds(const EPaM& rPos) const { tools::Rectangle aBounds; ContentNode* pNode = getImpl().GetEditDoc().GetObject(rPos.nPara); @@ -2423,8 +2419,7 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_Int32 nPara ) uno::Reference<datatransfer::XTransferable> EditEngine::CreateTransferable(const ESelection& rSelection) { - EditSelection aSel(getImpl().CreateSel(rSelection)); - return getImpl().CreateTransferable(aSel); + return getImpl().CreateTransferable(CreateSelection(rSelection)); } diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 9b17e434e53d..6f7182f383af 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -382,10 +382,10 @@ ContentInfo* EditTextObjectImpl::CreateAndInsertContent() sal_Int32 EditTextObjectImpl::GetParagraphCount() const { size_t nSize = maContents.size(); - if (nSize > EE_PARA_MAX_COUNT) + if (nSize > EE_PARA_MAX) { SAL_WARN( "editeng", "EditTextObjectImpl::GetParagraphCount - overflow " << nSize); - return EE_PARA_MAX_COUNT; + return EE_PARA_MAX; } return static_cast<sal_Int32>(nSize); } diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index e6678e78f681..cdf10fafba81 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -524,9 +524,9 @@ void EditUndoSetAttribs::Undo() DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); EditEngine* pEE = GetEditEngine(); bool bFields = false; - for ( sal_Int32 nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ ) + for ( sal_Int32 nPara = aESel.start.nPara; nPara <= aESel.end.nPara; nPara++ ) { - const ContentAttribsInfo& rInf = *aPrevAttribs[nPara-aESel.nStartPara]; + const ContentAttribsInfo& rInf = *aPrevAttribs[nPara-aESel.start.nPara]; // first the paragraph attributes ... pEE->SetParaAttribsOnly(nPara, rInf.GetPrevParaAttribs()); diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 88de93b10060..16d07afa2165 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -274,7 +274,7 @@ void EditView::SetSelection( const ESelection& rESel ) if (nullptr != pNode) pNode->checkAndDeleteEmptyAttribs(); } - EditSelection aNewSelection(getImpEditEngine().ConvertSelection(rESel.nStartPara, rESel.nStartPos, rESel.nEndPara, rESel.nEndPos)); + EditSelection aNewSelection(getImpEditEngine().CreateNormalizedSel(rESel)); // If the selection is manipulated after a KeyInput: getEditEngine().CheckIdleFormatter(); @@ -309,15 +309,7 @@ void EditView::SetSelection( const ESelection& rESel ) ESelection EditView::GetSelection() const { - ESelection aSelection; - - aSelection.nStartPara = getEditEngine().GetEditDoc().GetPos( getImpl().GetEditSelection().Min().GetNode() ); - aSelection.nEndPara = getEditEngine().GetEditDoc().GetPos( getImpl().GetEditSelection().Max().GetNode() ); - - aSelection.nStartPos = getImpl().GetEditSelection().Min().GetIndex(); - aSelection.nEndPos = getImpl().GetEditSelection().Max().GetIndex(); - - return aSelection; + return getEditEngine().CreateESelection(getImpl().GetEditSelection()); } bool EditView::HasSelection() const @@ -727,7 +719,7 @@ void EditView::MoveParagraphs( Range aParagraphs, sal_Int32 nNewPos ) void EditView::MoveParagraphs( tools::Long nDiff ) { ESelection aSel = GetSelection(); - Range aRange( aSel.nStartPara, aSel.nEndPara ); + Range aRange( aSel.start.nPara, aSel.end.nPara ); aRange.Normalize(); tools::Long nDest = ( nDiff > 0 ? aRange.Max() : aRange.Min() ) + nDiff; if ( nDiff > 0 ) @@ -1219,8 +1211,8 @@ bool EditView::ExecuteSpellPopup(const Point& rPosPixel, const Link<SpellCallbac if (sId == "paralanguage") { ESelection aSel = GetSelection(); - aSel.nStartPos = 0; - aSel.nEndPos = EE_TEXTPOS_ALL; + aSel.start.nIndex = 0; + aSel.end.nIndex = EE_TEXTPOS_MAX; SetSelection( aSel ); } SetAttribs( aAttrs ); @@ -1420,19 +1412,19 @@ void EditView::SelectFieldAtCursor() // Make sure the whole field is selected // A field is represented by a dummy character - so it cannot be a selection larger than 1 ESelection aSel = GetSelection(); - if (aSel.nStartPos == aSel.nEndPos) // not yet selected + if (!aSel.HasRange()) // not yet selected { if (bIsBeforeCursor) { - assert (aSel.nStartPos); - --aSel.nStartPos; + assert (aSel.start.nIndex); + --aSel.start.nIndex; } else - aSel.nEndPos++; + aSel.end.nIndex++; SetSelection(aSel); } else - assert(std::abs(aSel.nStartPos - aSel.nEndPos) == 1); + assert(std::abs(aSel.start.nIndex - aSel.end.nIndex) == 1); } const SvxFieldData* EditView::GetFieldUnderMouseOrInSelectionOrAtCursor(bool bAlsoCheckBeforeCursor) const @@ -1528,7 +1520,7 @@ void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList ) if( aSel.HasRange() ) { - for( sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) + for( sal_Int32 nPara = aSel.start.nPara; nPara <= aSel.end.nPara; nPara++ ) { std::vector<sal_Int32> aPortions; rEditEngine.GetPortions( nPara, aPortions ); @@ -1536,8 +1528,8 @@ void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList ) if( aPortions.empty() ) aPortions.push_back( rEditEngine.GetTextLen(nPara) ); - const sal_Int32 nBeginPos = (nPara == aSel.nStartPara) ? aSel.nStartPos : 0; - const sal_Int32 nEndPos = (nPara == aSel.nEndPara) ? aSel.nEndPos : EE_TEXTPOS_ALL; + const sal_Int32 nBeginPos = (nPara == aSel.start.nPara) ? aSel.start.nIndex : 0; + const sal_Int32 nEndPos = (nPara == aSel.end.nPara) ? aSel.end.nIndex : EE_TEXTPOS_MAX; for ( size_t nPos = 0; nPos < aPortions.size(); ++nPos ) { @@ -1684,22 +1676,22 @@ Selection EditView::GetSurroundingTextSelection() const // Stop reconversion if the selected text includes a line break. if ( aStr.indexOf( 0x0A ) == -1 ) - return Selection( 0, aSelection.nEndPos - aSelection.nStartPos ); + return Selection(0, aSelection.end.nIndex - aSelection.start.nIndex); else return Selection( 0, 0 ); } else { - return Selection( aSelection.nStartPos, aSelection.nEndPos ); + return Selection(aSelection.start.nIndex, aSelection.end.nIndex); } } bool EditView::DeleteSurroundingText(const Selection& rRange) { ESelection aSel(GetSelection()); - aSel.nEndPara = aSel.nStartPara; - aSel.nStartPos = rRange.Min(); - aSel.nEndPos = rRange.Max(); + aSel.end.nPara = aSel.start.nPara; + aSel.start.nIndex = rRange.Min(); + aSel.end.nIndex = rRange.Max(); SetSelection(aSel); DeleteSelected(); return true; diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index b989755d8be4..ed38d849f3dd 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -695,7 +695,7 @@ LanguageType EdtAutoCorrDoc::GetLanguage( sal_Int32 nPos ) const void EdtAutoCorrDoc::ImplStartUndoAction() { sal_Int32 nPara = mpEditEngine->GetEditDoc().GetPos( pCurNode ); - ESelection aSel( nPara, nCursor, nPara, nCursor ); + ESelection aSel(nPara, nCursor); mpEditEngine->UndoActionStart( EDITUNDO_INSERT, aSel ); bUndoAction = true; bAllowUndoAction = false; diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 27ff1831fb62..7f20a639f9c7 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -519,7 +519,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, ContentNode* pEndNode = aTmpSel.Max().GetNode(); const sal_Int32 nStartPara = getEditEngine().GetEditDoc().GetPos(pStartNode); const sal_Int32 nEndPara = getEditEngine().GetEditDoc().GetPos(pEndNode); - if (nStartPara == EE_PARA_NOT_FOUND || nEndPara == EE_PARA_NOT_FOUND) + if (nStartPara == EE_PARA_MAX || nEndPara == EE_PARA_MAX) return; bool bStartHandleVisible = false; @@ -1146,7 +1146,7 @@ tools::Rectangle ImpEditView::GetEditCursor() const sal_Int32 nTextPortionStart = 0; sal_Int32 nPara = getEditEngine().GetEditDoc().GetPos( aPaM.GetNode() ); - if (nPara == EE_PARA_NOT_FOUND) // #i94322 + if (nPara == EE_PARA_MAX) // #i94322 return tools::Rectangle(); ParaPortion const& rParaPortion = getEditEngine().GetParaPortions().getRef(nPara); @@ -1194,7 +1194,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) sal_Int32 nTextPortionStart = 0; sal_Int32 nPara = getEditEngine().GetEditDoc().GetPos( aPaM.GetNode() ); - if (nPara == EE_PARA_NOT_FOUND) // #i94322 + if (nPara == EE_PARA_MAX) // #i94322 return; ParaPortion const& rParaPortion = getEditEngine().GetParaPortions().getRef(nPara); @@ -1878,7 +1878,7 @@ const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_Int32* pPara, bool ImpEditView::IsBulletArea( const Point& rPos, sal_Int32* pPara ) { if ( pPara ) - *pPara = EE_PARA_NOT_FOUND; + *pPara = EE_PARA_MAX; if( !GetOutputArea().Contains( rPos ) ) return false; @@ -2306,7 +2306,7 @@ void ImpEditView::dragGestureRecognized(const css::datatransfer::dnd::DragGestur aSz = GetOutputDevice().PixelToLogic( aSz ); mpDragAndDropInfo->nSensibleRange = static_cast<sal_uInt16>(aSz.Width()); mpDragAndDropInfo->nCursorWidth = static_cast<sal_uInt16>(aSz.Width()) / 2; - mpDragAndDropInfo->aBeginDragSel = getImpEditEngine().CreateESel( aCopySel ); + mpDragAndDropInfo->aBeginDragSel = getEditEngine().CreateESelection( aCopySel ); uno::Reference<datatransfer::XTransferable> xData = getEditEngine().CreateTransferable(aCopySel); @@ -2332,62 +2332,61 @@ void ImpEditView::dragDropEnd( const css::datatransfer::dnd::DragSourceDropEvent if (mpDragAndDropInfo->bStarterOfDD && mpDragAndDropInfo->bDroppedInMe ) { // DropPos: Where was it dropped, irrespective of length. - ESelection aDropPos(mpDragAndDropInfo->aDropSel.nStartPara, mpDragAndDropInfo->aDropSel.nStartPos, mpDragAndDropInfo->aDropSel.nStartPara, mpDragAndDropInfo->aDropSel.nStartPos ); + ESelection aDropPos(mpDragAndDropInfo->aDropSel.start); ESelection aToBeDelSel = mpDragAndDropInfo->aBeginDragSel; - ESelection aNewSel( mpDragAndDropInfo->aDropSel.nEndPara, mpDragAndDropInfo->aDropSel.nEndPos, - mpDragAndDropInfo->aDropSel.nEndPara, mpDragAndDropInfo->aDropSel.nEndPos ); + ESelection aNewSel(mpDragAndDropInfo->aDropSel.end); bool bBeforeSelection = aDropPos < mpDragAndDropInfo->aBeginDragSel; - sal_Int32 nParaDiff = mpDragAndDropInfo->aBeginDragSel.nEndPara - mpDragAndDropInfo->aBeginDragSel.nStartPara; + sal_Int32 nParaDiff = mpDragAndDropInfo->aBeginDragSel.end.nPara - mpDragAndDropInfo->aBeginDragSel.start.nPara; if ( bBeforeSelection ) { // Adjust aToBeDelSel. - DBG_ASSERT(mpDragAndDropInfo->aBeginDragSel.nStartPara >= mpDragAndDropInfo->aDropSel.nStartPara, "But not before? "); - aToBeDelSel.nStartPara = aToBeDelSel.nStartPara + nParaDiff; - aToBeDelSel.nEndPara = aToBeDelSel.nEndPara + nParaDiff; + DBG_ASSERT(mpDragAndDropInfo->aBeginDragSel.start.nPara >= mpDragAndDropInfo->aDropSel.start.nPara, "But not before? "); + aToBeDelSel.start.nPara = aToBeDelSel.start.nPara + nParaDiff; + aToBeDelSel.end.nPara = aToBeDelSel.end.nPara + nParaDiff; // To correct the character? - if ( aToBeDelSel.nStartPara == mpDragAndDropInfo->aDropSel.nEndPara ) + if ( aToBeDelSel.start.nPara == mpDragAndDropInfo->aDropSel.end.nPara ) { sal_uInt16 nMoreChars; - if (mpDragAndDropInfo->aDropSel.nStartPara == mpDragAndDropInfo->aDropSel.nEndPara ) - nMoreChars = mpDragAndDropInfo->aDropSel.nEndPos - mpDragAndDropInfo->aDropSel.nStartPos; + if (mpDragAndDropInfo->aDropSel.start.nPara == mpDragAndDropInfo->aDropSel.end.nPara ) + nMoreChars = mpDragAndDropInfo->aDropSel.end.nIndex - mpDragAndDropInfo->aDropSel.start.nIndex; else - nMoreChars = mpDragAndDropInfo->aDropSel.nEndPos; - aToBeDelSel.nStartPos = - aToBeDelSel.nStartPos + nMoreChars; - if ( aToBeDelSel.nStartPara == aToBeDelSel.nEndPara ) - aToBeDelSel.nEndPos = - aToBeDelSel.nEndPos + nMoreChars; + nMoreChars = mpDragAndDropInfo->aDropSel.end.nIndex; + aToBeDelSel.start.nIndex = + aToBeDelSel.start.nIndex + nMoreChars; + if ( aToBeDelSel.start.nPara == aToBeDelSel.end.nPara ) + aToBeDelSel.end.nIndex = + aToBeDelSel.end.nIndex + nMoreChars; } } else { // aToBeDelSel is ok, but the selection of the View // has to be adapted, if it was deleted before! - DBG_ASSERT(mpDragAndDropInfo->aBeginDragSel.nStartPara <= mpDragAndDropInfo->aDropSel.nStartPara, "But not before? "); - aNewSel.nStartPara = aNewSel.nStartPara - nParaDiff; - aNewSel.nEndPara = aNewSel.nEndPara - nParaDiff; + DBG_ASSERT(mpDragAndDropInfo->aBeginDragSel.start.nPara <= mpDragAndDropInfo->aDropSel.start.nPara, "But not before? "); + aNewSel.start.nPara = aNewSel.start.nPara - nParaDiff; + aNewSel.end.nPara = aNewSel.end.nPara - nParaDiff; // To correct the character? - if (mpDragAndDropInfo->aBeginDragSel.nEndPara == mpDragAndDropInfo->aDropSel.nStartPara ) + if (mpDragAndDropInfo->aBeginDragSel.end.nPara == mpDragAndDropInfo->aDropSel.start.nPara ) { sal_uInt16 nLessChars; - if (mpDragAndDropInfo->aBeginDragSel.nStartPara == mpDragAndDropInfo->aBeginDragSel.nEndPara ) - nLessChars = mpDragAndDropInfo->aBeginDragSel.nEndPos - mpDragAndDropInfo->aBeginDragSel.nStartPos; + if (mpDragAndDropInfo->aBeginDragSel.start.nPara == mpDragAndDropInfo->aBeginDragSel.end.nPara ) + nLessChars = mpDragAndDropInfo->aBeginDragSel.end.nIndex - mpDragAndDropInfo->aBeginDragSel.start.nIndex; else - nLessChars = mpDragAndDropInfo->aBeginDragSel.nEndPos; - aNewSel.nStartPos = aNewSel.nStartPos - nLessChars; - if ( aNewSel.nStartPara == aNewSel.nEndPara ) - aNewSel.nEndPos = aNewSel.nEndPos - nLessChars; + nLessChars = mpDragAndDropInfo->aBeginDragSel.end.nIndex; + aNewSel.start.nIndex = aNewSel.start.nIndex - nLessChars; + if ( aNewSel.start.nPara == aNewSel.end.nPara ) + aNewSel.end.nIndex = aNewSel.end.nIndex - nLessChars; } } DrawSelectionXOR(); - EditSelection aDelSel(getImpEditEngine().CreateSel(aToBeDelSel)); + EditSelection aDelSel(getEditEngine().CreateSelection(aToBeDelSel)); DBG_ASSERT( !aDelSel.DbgIsBuggy(getEditEngine().GetEditDoc()), "ToBeDel is buggy!"); getEditEngine().DeleteSelection(aDelSel); if ( !bBeforeSelection ) { - DBG_ASSERT(!getImpEditEngine().CreateSel(aNewSel).DbgIsBuggy(getEditEngine().GetEditDoc()), "Bad"); - SetEditSelection(getImpEditEngine().CreateSel(aNewSel)); + DBG_ASSERT(!getEditEngine().CreateSelection(aNewSel).DbgIsBuggy(getEditEngine().GetEditDoc()), "Bad"); + SetEditSelection(getEditEngine().CreateSelection(aNewSel)); } getImpEditEngine().FormatAndLayout(getImpEditEngine().GetActiveView()); DrawSelectionXOR(); @@ -2432,7 +2431,7 @@ void ImpEditView::drop( const css::datatransfer::dnd::DropTargetDropEvent& rDTDE if (mpDragAndDropInfo->bOutlinerMode) { bChanges = true; - GetEditViewPtr()->MoveParagraphs(Range(mpDragAndDropInfo->aBeginDragSel.nStartPara, mpDragAndDropInfo->aBeginDragSel.nEndPara ), mpDragAndDropInfo->nOutlinerDropDest); + GetEditViewPtr()->MoveParagraphs(Range(mpDragAndDropInfo->aBeginDragSel.start.nPara, mpDragAndDropInfo->aBeginDragSel.end.nPara ), mpDragAndDropInfo->nOutlinerDropDest); } else { @@ -2459,10 +2458,8 @@ void ImpEditView::drop( const css::datatransfer::dnd::DropTargetDropEvent& rDTDE if (mpDragAndDropInfo->bStarterOfDD) { // Only set if the same engine! - mpDragAndDropInfo->aDropSel.nStartPara = getEditEngine().GetEditDoc().GetPos( aPaM.GetNode() ); - mpDragAndDropInfo->aDropSel.nStartPos = aPaM.GetIndex(); - mpDragAndDropInfo->aDropSel.nEndPara = getEditEngine().GetEditDoc().GetPos( aNewSel.Max().GetNode() ); - mpDragAndDropInfo->aDropSel.nEndPos = aNewSel.Max().GetIndex(); + mpDragAndDropInfo->aDropSel.start = getImpEditEngine().CreateEPaM(aPaM); + mpDragAndDropInfo->aDropSel.end = getImpEditEngine().CreateEPaM(aNewSel.Max()); mpDragAndDropInfo->bDroppedInMe = true; } } @@ -2580,8 +2577,8 @@ void ImpEditView::dragOver(const css::datatransfer::dnd::DropTargetDragEvent& rD mpDragAndDropInfo->nOutlinerDropDest = nPara+1; } - if ((mpDragAndDropInfo->nOutlinerDropDest >= mpDragAndDropInfo->aBeginDragSel.nStartPara) && - (mpDragAndDropInfo->nOutlinerDropDest <= (mpDragAndDropInfo->aBeginDragSel.nEndPara + 1))) + if ((mpDragAndDropInfo->nOutlinerDropDest >= mpDragAndDropInfo->aBeginDragSel.start.nPara) && + (mpDragAndDropInfo->nOutlinerDropDest <= (mpDragAndDropInfo->aBeginDragSel.end.nPara + 1))) { bAccept = false; } @@ -2591,8 +2588,8 @@ void ImpEditView::dragOver(const css::datatransfer::dnd::DropTargetDragEvent& rD { // it must not be dropped into a selection EPaM aP = getImpEditEngine().CreateEPaM( aPaM ); - ESelection aDestSel( aP.nPara, aP.nIndex, aP.nPara, aP.nIndex); - ESelection aCurSel = getImpEditEngine().CreateESel( GetEditSelection() ); + ESelection aDestSel(aP); + ESelection aCurSel = getEditEngine().CreateESelection(GetEditSelection()); aCurSel.Adjust(); if ( !(aDestSel < aCurSel) && !(aDestSel > aCurSel) ) { diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 76d510830c8f..e1f2c3513df6 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -1102,8 +1102,7 @@ public: EPaM CreateEPaM( const EditPaM& rPaM ) const { - const ContentNode* pNode = rPaM.GetNode(); - return EPaM(maEditDoc.GetPos(pNode), rPaM.GetIndex()); + return EPaM(maEditDoc.GetPos(rPaM.GetNode()), rPaM.GetIndex()); } EditPaM CreateEditPaM( const EPaM& rEPaM ) @@ -1115,28 +1114,24 @@ public: ESelection CreateESel(const EditSelection& rSel) const { - const ContentNode* pStartNode = rSel.Min().GetNode(); - const ContentNode* pEndNode = rSel.Max().GetNode(); ESelection aESel; - aESel.nStartPara = maEditDoc.GetPos( pStartNode ); - aESel.nStartPos = rSel.Min().GetIndex(); - aESel.nEndPara = maEditDoc.GetPos( pEndNode ); - aESel.nEndPos = rSel.Max().GetIndex(); + aESel.start = CreateEPaM(rSel.Min()); + aESel.end = CreateEPaM(rSel.Max()); return aESel; } EditSelection CreateSel(const ESelection& rSel) { - DBG_ASSERT( rSel.nStartPara < maEditDoc.Count(), "CreateSel: invalid start paragraph" ); - DBG_ASSERT( rSel.nEndPara < maEditDoc.Count(), "CreateSel: invalid end paragraph" ); - EditSelection aSel; - aSel.Min().SetNode(maEditDoc.GetObject(rSel.nStartPara)); - aSel.Min().SetIndex( rSel.nStartPos ); - aSel.Max().SetNode(maEditDoc.GetObject(rSel.nEndPara)); - aSel.Max().SetIndex( rSel.nEndPos ); + DBG_ASSERT( rSel.start.nPara < maEditDoc.Count(), "CreateSel: invalid start paragraph" ); + DBG_ASSERT( rSel.end.nPara < maEditDoc.Count(), "CreateSel: invalid end paragraph" ); + EditSelection aSel(CreateEditPaM(rSel.start), CreateEditPaM(rSel.end)); DBG_ASSERT( !aSel.DbgIsBuggy( maEditDoc ), "CreateSel: incorrect selection!" ); return aSel; + } + EditSelection CreateNormalizedSel(const ESelection& rSel) + { + return ConvertSelection(rSel.start.nPara, rSel.start.nIndex, rSel.end.nPara, rSel.end.nIndex); } void SetStyleSheetPool( SfxStyleSheetPool* pSPool ); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 3e9240a92c96..d05648aa732d 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -75,6 +75,7 @@ #include <memory> #include <string_view> #include <fstream> +#include <outleeng.hxx> using namespace ::com::sun::star; @@ -249,7 +250,7 @@ void ImpEditEngine::InitDoc(bool bKeepParaAttribs) if ( IsCallParaInsertedOrDeleted() ) { - GetEditEnginePtr()->ParagraphDeleted( EE_PARA_ALL ); + GetEditEnginePtr()->ParagraphDeleted(EE_PARA_MAX); GetEditEnginePtr()->ParagraphInserted( 0 ); } @@ -515,14 +516,14 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) if( pView->HasSelection() ) { - aSelection.nEndPos = aSelection.nStartPos; - aSelection.nStartPos += pData->GetStart(); - aSelection.nEndPos += pData->GetEnd(); + aSelection.end.nIndex = aSelection.start.nIndex; + aSelection.start.nIndex += pData->GetStart(); + aSelection.end.nIndex += pData->GetEnd(); } else { - aSelection.nStartPos = pData->GetStart(); - aSelection.nEndPos = pData->GetEnd(); + aSelection.start.nIndex = pData->GetStart(); + aSelection.end.nIndex = pData->GetEnd(); } pView->SetSelection( aSelection ); } @@ -533,11 +534,11 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) ESelection aSelection = pView->GetSelection(); aSelection.Adjust(); - if ( aSelection.nStartPara != aSelection.nEndPara ) + if ( aSelection.start.nPara != aSelection.end.nPara ) { - sal_Int32 aParaLen = mpEditEngine->GetTextLen( aSelection.nStartPara ); - aSelection.nEndPara = aSelection.nStartPara; - aSelection.nEndPos = aParaLen; + sal_Int32 aParaLen = mpEditEngine->GetTextLen( aSelection.start.nPara ); + aSelection.end.nPara = aSelection.start.nPara; + aSelection.end.nIndex = aParaLen; pView->SetSelection( aSelection ); } } @@ -2226,7 +2227,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n // Determine the new location for paragraphs sal_Int32 nRealNewPos = pDestPortion ? GetParaPortions().GetPos( pDestPortion ) : GetParaPortions().Count(); - assert( nRealNewPos != EE_PARA_NOT_FOUND && "ImpMoveParagraphs: Invalid Position!" ); + assert(nRealNewPos != EE_PARA_MAX && "ImpMoveParagraphs: Invalid Position!"); // Add the paragraph portions and content nodes to a new position sal_Int32 i = 0; @@ -2276,8 +2277,8 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, bool bBackward ) { OSL_ENSURE( pLeft != pRight, "Join together the same paragraph ?" ); - OSL_ENSURE( maEditDoc.GetPos( pLeft ) != EE_PARA_NOT_FOUND, "Inserted node not found (1)" ); - OSL_ENSURE( maEditDoc.GetPos( pRight ) != EE_PARA_NOT_FOUND, "Inserted node not found (2)" ); + OSL_ENSURE(maEditDoc.GetPos(pLeft) != EE_PARA_MAX, "Inserted node not found (1)"); + OSL_ENSURE(maEditDoc.GetPos(pRight) != EE_PARA_MAX, "Inserted node not found (2)"); // #i120020# it is possible that left and right are *not* in the desired order (left/right) // so correct it. This correction is needed, else an invalid SfxLinkUndoAction will be @@ -2475,7 +2476,7 @@ EditPaM ImpEditEngine::ImpDeleteSelection(const EditSelection& rCurSel) sal_Int32 nStartNode = maEditDoc.GetPos( aStartPaM.GetNode() ); sal_Int32 nEndNode = maEditDoc.GetPos( aEndPaM.GetNode() ); - OSL_ENSURE( nEndNode != EE_PARA_NOT_FOUND, "Start > End ?!" ); + OSL_ENSURE( nEndNode != EE_PARA_MAX, "Start > End ?!" ); OSL_ENSURE( nStartNode <= nEndNode, "Start > End ?!" ); // Remove all nodes in between... @@ -2579,7 +2580,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, sal_Unicode c, ESelection aESel( CreateESel(aSel) ); EditSelection aFirstWordSel; EditSelection aSecondWordSel; - if (aESel.nEndPara == 0) // is this the first para? + if (aESel.end.nPara == 0) // is this the first para? { // select first word... // start by checking if para starts with word. @@ -2599,7 +2600,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, sal_Unicode c, EditPaM aRight2Word( WordRight( aFirstWordSel.Max() ) ); aSecondWordSel = SelectWord( EditSelection( aRight2Word ) ); } - bool bIsFirstWordInFirstPara = aESel.nEndPara == 0 && + bool bIsFirstWordInFirstPara = aESel.end.nPara == 0 && aFirstWordSel.Max().GetIndex() <= aSel.Max().GetIndex() && aSel.Max().GetIndex() <= aSecondWordSel.Min().GetIndex(); @@ -2935,10 +2936,10 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditSelection& rCurSel ) EditPaM ImpEditEngine::ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttribs ) { - if ( maEditDoc.Count() >= EE_PARA_MAX_COUNT ) + if (maEditDoc.Count() >= EE_PARA_MAX) { SAL_WARN( "editeng", "ImpEditEngine::ImpInsertParaBreak - can't process more than " - << EE_PARA_MAX_COUNT << " paragraphs!"); + << EE_PARA_MAX << " paragraphs!"); return rPaM; } @@ -3927,6 +3928,32 @@ EditSelection ImpEditEngine::PasteText( uno::Reference< datatransfer::XTransfera } } + if (!bDone) { + // HTML_SIMPLE + SotExchange::GetFormatDataFlavor(SotClipboardFormatId::HTML_SIMPLE, aFlavor); + bool bHtmlSupported = rxDataObj->isDataFlavorSupported(aFlavor); + if (bHtmlSupported && (SotClipboardFormatId::NONE == format || SotClipboardFormatId::HTML_SIMPLE == format)) { + MSE40HTMLClipFormatObj aMSE40HTMLClipFormatObj; + try + { + uno::Any aData = rxDataObj->getTransferData(aFlavor); + uno::Sequence< sal_Int8 > aSeq; + aData >>= aSeq; + { + SvMemoryStream aHtmlStream(aSeq.getArray(), aSeq.getLength(), StreamMode::READ); + SvStream* pHtmlStream = aMSE40HTMLClipFormatObj.IsValid(aHtmlStream); + if (pHtmlStream != nullptr) { + aNewSelection = Read(*pHtmlStream, rBaseURL, EETextFormat::Html, rPaM); + } + } + bDone = true; + } + catch (const css::uno::Exception&) + { + } + } + } + if ( !bDone ) { // RTF @@ -3958,31 +3985,6 @@ EditSelection ImpEditEngine::PasteText( uno::Reference< datatransfer::XTransfera } } } - if (!bDone) { - // HTML_SIMPLE - SotExchange::GetFormatDataFlavor(SotClipboardFormatId::HTML_SIMPLE, aFlavor); - bool bHtmlSupported = rxDataObj->isDataFlavorSupported(aFlavor); - if (bHtmlSupported && (SotClipboardFormatId::NONE == format || SotClipboardFormatId::HTML_SIMPLE == format)) { - MSE40HTMLClipFormatObj aMSE40HTMLClipFormatObj; - try - { - uno::Any aData = rxDataObj->getTransferData(aFlavor); - uno::Sequence< sal_Int8 > aSeq; - aData >>= aSeq; - { - SvMemoryStream aHtmlStream(aSeq.getArray(), aSeq.getLength(), StreamMode::READ); - SvStream* pHtmlStream = aMSE40HTMLClipFormatObj.IsValid(aHtmlStream); - if (pHtmlStream != nullptr) { - aNewSelection = Read(*pHtmlStream, rBaseURL, EETextFormat::Html, rPaM); - } - } - bDone = true; - } - catch (const css::uno::Exception&) - { - } - } - } if (!bDone) { @@ -4396,10 +4398,17 @@ bool ImpEditEngine::isInEmptyClusterAtTheEnd(ParaPortion& rPortion) return false; sal_Int32 nCurrent = rParagraphs.lastIndex(); + while (nCurrent > 0 && rParagraphs.getRef(nCurrent).IsEmpty()) { if (nCurrent == nPortion) - return true; + { + OutlinerEditEng* pOutlEditEng{ dynamic_cast<OutlinerEditEng*>(mpEditEngine)}; + if (pOutlEditEng) + return pOutlEditEng->GetDepth(nCurrent) < 0; + else + return true; + } nCurrent--; } return false; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index db3b63d6c99b..cd5360bf997e 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -4660,8 +4660,8 @@ const SvxNumberFormat* ImpEditEngine::GetNumberFormat( const ContentNode *pNode { // get index of paragraph sal_Int32 nPara = GetEditDoc().GetPos( pNode ); - DBG_ASSERT( nPara < EE_PARA_NOT_FOUND, "node not found in array" ); - if (nPara < EE_PARA_NOT_FOUND) + DBG_ASSERT( nPara < EE_PARA_MAX, "node not found in array" ); + if (nPara < EE_PARA_MAX) { // the called function may be overridden by an OutlinerEditEng // object to provide diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index c56a97f1c5c9..8cb962d054f3 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1529,7 +1529,7 @@ void ImpEditEngine::CreateSpellInfo( bool bMultipleDocs ) // (spelling in only a selection or not starting with the top requires // further changes elsewhere to work properly) mpSpellInfo->aSpellStart = EPaM(); - mpSpellInfo->aSpellTo = EPaM( EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND ); + mpSpellInfo->aSpellTo = EPaM(EE_PARA_MAX, EE_TEXTPOS_MAX); } @@ -1753,7 +1753,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, mpEditEngine->GetText(mpConvInfo->aConvContinue.nPara).isEmpty()) { sal_Int32 nPara = mpConvInfo->aConvContinue.nPara; - ESelection aESel( nPara, 0, nPara, 0 ); + ESelection aESel(nPara, 0); // see comment for below same function call SetLanguageAndFont( aESel, nTargetLang, EE_CHAR_LANGUAGE_CJK, diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index 3d4c03e1ddeb..9582c2b2e74b 100644 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -121,8 +121,7 @@ bool TextConvWrapper::ConvMore_impl() bool bMore = false; EditEngine& rEditEngine = m_pEditView->getEditEngine(); - ImpEditEngine& rImpEditEngine = m_pEditView->getImpEditEngine(); - ConvInfo* pConvInfo = rImpEditEngine.GetConvInfo(); + ConvInfo* pConvInfo = rEditEngine.getImpl().GetConvInfo(); if ( pConvInfo->bMultipleDoc ) { bMore = rEditEngine.ConvertNextDocument(); @@ -169,8 +168,7 @@ void TextConvWrapper::ConvStart_impl( SvxSpellArea eArea ) if (m_aConvSel.HasRange()) { // user selection: convert to end of selection - pConvInfo->aConvTo.nPara = m_aConvSel.nEndPara; - pConvInfo->aConvTo.nIndex = m_aConvSel.nEndPos; + pConvInfo->aConvTo = m_aConvSel.end; pConvInfo->bConvToEnd = false; } else @@ -248,10 +246,10 @@ void TextConvWrapper::SelectNewUnit_impl( return; ESelection aSelection = m_pEditView->GetSelection(); - DBG_ASSERT( aSelection.nStartPara == aSelection.nEndPara, + DBG_ASSERT( aSelection.start.nPara == aSelection.end.nPara, "paragraph mismatch in selection" ); - aSelection.nStartPos = (m_nLastPos + m_nUnitOffset + nUnitStart); - aSelection.nEndPos = (m_nLastPos + m_nUnitOffset + nUnitEnd); + aSelection.start.nIndex = (m_nLastPos + m_nUnitOffset + nUnitStart); + aSelection.end.nIndex = (m_nLastPos + m_nUnitOffset + nUnitEnd); m_pEditView->SetSelection( aSelection ); } @@ -269,11 +267,11 @@ void TextConvWrapper::GetNextPortion( m_nUnitOffset = 0; ESelection aSelection = m_pEditView->GetSelection(); - DBG_ASSERT( aSelection.nStartPara == aSelection.nEndPara, + DBG_ASSERT( aSelection.start.nPara == aSelection.end.nPara, "paragraph mismatch in selection" ); - DBG_ASSERT( aSelection.nStartPos <= aSelection.nEndPos, + DBG_ASSERT( aSelection.start.nIndex <= aSelection.end.nIndex, "start pos > end pos" ); - m_nLastPos = aSelection.nStartPos; + m_nLastPos = aSelection.start.nIndex; } @@ -336,15 +334,15 @@ void TextConvWrapper::ReplaceUnit( m_nUnitOffset = m_nUnitOffset + nUnitStart + aNewTxt.getLength(); // remember current original language for later use - ImpEditEngine& rImpEditEngine = m_pEditView->getImpEditEngine(); + EditEngine& rEditEngine = m_pEditView->getEditEngine(); ESelection aOldSel = m_pEditView->GetSelection(); //EditSelection aOldEditSel = pEditView->getImpl().GetEditSelection(); #ifdef DBG_UTIL - LanguageType nOldLang = rImpEditEngine.GetLanguage(rImpEditEngine.CreateSel( aOldSel ).Min() ).nLang; + LanguageType nOldLang = rEditEngine.GetLanguage(rEditEngine.CreateSelection( aOldSel ).Min() ).nLang; #endif - rImpEditEngine.UndoActionStart( EDITUNDO_INSERT ); + rEditEngine.UndoActionStart( EDITUNDO_INSERT ); // according to FT we should currently not bother about keeping // attributes in Hangul/Hanja conversion and leave that untouched. @@ -362,7 +360,7 @@ void TextConvWrapper::ReplaceUnit( "TextConvWrapper::ReplaceUnit : unexpected target language" ); ESelection aNewSel( aOldSel ); - aNewSel.nStartPos = aNewSel.nStartPos - aNewTxt.getLength(); + aNewSel.start.nIndex -= aNewTxt.getLength(); if (pNewUnitLanguage) { @@ -375,10 +373,10 @@ void TextConvWrapper::ReplaceUnit( } } - rImpEditEngine.UndoActionEnd(); + rEditEngine.UndoActionEnd(); // adjust ConvContinue / ConvTo if necessary - ConvInfo* pConvInfo = rImpEditEngine.GetConvInfo(); + ConvInfo* pConvInfo = rEditEngine.getImpl().GetConvInfo(); sal_Int32 nDelta = aNewTxt.getLength() - aOrigTxt.getLength(); if (nDelta != 0) { @@ -410,7 +408,7 @@ void TextConvWrapper::ChangeText( const OUString &rNewText, pESelection->Adjust(); // remember cursor start position for later setting of the cursor - const sal_Int32 nStartIndex = pESelection->nStartPos; + const sal_Int32 nStartIndex = pESelection->start.nIndex; const sal_Int32 nIndices = pOffsets->getLength(); const sal_Int32 *pIndices = pOffsets->getConstArray(); @@ -453,8 +451,8 @@ void TextConvWrapper::ChangeText( const OUString &rNewText, // set selection to sub string to be replaced in original text ESelection aSel( *pESelection ); sal_Int32 nChgInNodeStartIndex = nStartIndex + nCorrectionOffset + nChgPos; - aSel.nStartPos = nChgInNodeStartIndex; - aSel.nEndPos = nChgInNodeStartIndex + nChgLen; + aSel.start.nIndex = nChgInNodeStartIndex; + aSel.end.nIndex = nChgInNodeStartIndex + nChgLen; m_pEditView->SetSelection( aSel ); // replace selected sub string with the corresponding @@ -485,7 +483,7 @@ void TextConvWrapper::ChangeText( const OUString &rNewText, // set cursor to the end of the inserted text // (as it would happen after ChangeText_impl (Delete and Insert) // of the whole text in the 'else' branch below) - pESelection->nStartPos = pESelection->nEndPos = nStartIndex + nConvTextLen; + pESelection->start.nIndex = pESelection->end.nIndex = nStartIndex + nConvTextLen; } else { diff --git a/editeng/source/misc/urlfieldhelper.cxx b/editeng/source/misc/urlfieldhelper.cxx index 16303c064d50..7dafeb2c9628 100644 --- a/editeng/source/misc/urlfieldhelper.cxx +++ b/editeng/source/misc/urlfieldhelper.cxx @@ -30,12 +30,7 @@ bool URLFieldHelper::IsCursorAtURLField(const EditView& pEditView, bool bAlsoChe { // tdf#128666 Make sure only URL field (or nothing) is selected ESelection aSel = pEditView.GetSelection(); - auto nSelectedParas = aSel.nEndPara - aSel.nStartPara; - auto nSelectedChars = aSel.nEndPos - aSel.nStartPos; - bool bIsValidSelection - = nSelectedParas == 0 - && (nSelectedChars == 0 || nSelectedChars == 1 || nSelectedChars == -1); - if (!bIsValidSelection) + if (aSel.start.nPara != aSel.end.nPara || std::abs(aSel.end.nIndex - aSel.start.nIndex) > 1) return false; const SvxFieldData* pField diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx index 1136ef37b9e2..ff9e0e725299 100644 --- a/editeng/source/outliner/outleeng.cxx +++ b/editeng/source/outliner/outleeng.cxx @@ -200,4 +200,9 @@ void OutlinerEditEng::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) pOwner->UndoActionEnd(); } +sal_Int16 OutlinerEditEng::GetDepth(sal_Int32 nPara) const +{ + return pOwner->GetDepth(nPara); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index ccd07199a60f..305706f0eeef 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -158,9 +158,9 @@ OUString const & Outliner::GetWordDelimiters() const return pEditEngine->GetWordDelimiters(); } -OUString Outliner::GetWord( sal_Int32 nPara, sal_Int32 nIndex ) +OUString Outliner::GetWord(const EPaM& rPos) { - return pEditEngine->GetWord( nPara, nIndex ); + return pEditEngine->GetWord(rPos); } void Outliner::Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect ) @@ -308,7 +308,7 @@ bool Outliner::IsInUndo() const return pEditEngine->IsInUndo(); } -sal_uInt32 Outliner::GetLineCount( sal_Int32 nParagraph ) const +sal_Int32 Outliner::GetLineCount( sal_Int32 nParagraph ) const { return pEditEngine->GetLineCount( nParagraph ); } @@ -318,9 +318,9 @@ sal_Int32 Outliner::GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const return pEditEngine->GetLineLen( nParagraph, nLine ); } -sal_uInt32 Outliner::GetLineHeight( sal_Int32 nParagraph ) +sal_uInt32 Outliner::GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine ) { - return pEditEngine->GetLineHeight( nParagraph ); + return pEditEngine->GetLineHeight( nParagraph, nLine ); } void Outliner::RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich ) @@ -423,7 +423,7 @@ bool Outliner::IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder, bool* pbBu { Point aDocPos = GetDocPos( rPaperPos ); sal_Int32 nPara = pEditEngine->FindParagraph( aDocPos.Y() ); - if ( ( nPara != EE_PARA_NOT_FOUND ) && ImplHasNumberFormat( nPara ) ) + if ((nPara != EE_PARA_MAX) && ImplHasNumberFormat(nPara)) { tools::Rectangle aBulArea = ImpCalcBulletArea( nPara, true, true ); if ( aBulArea.Contains( rPaperPos ) ) diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 2eb127a7f430..808eca150b53 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -150,7 +150,7 @@ void Outliner::ParagraphInserted( sal_Int32 nPara ) void Outliner::ParagraphDeleted( sal_Int32 nPara ) { - if ( nBlockInsCallback || ( nPara == EE_PARA_ALL ) ) + if (nBlockInsCallback || (nPara == EE_PARA_MAX)) return; Paragraph* pPara = pParaList->GetParagraph( nPara ); @@ -606,7 +606,7 @@ void Outliner::AddText( const OutlinerParaObject& rPObj, bool bAppend ) else { nPara = pParaList->GetParagraphCount(); - pEditEngine->InsertParagraph( EE_PARA_APPEND, rPObj.GetTextObject(), bAppend ); + pEditEngine->InsertParagraph(EE_PARA_MAX, rPObj.GetTextObject(), bAppend); } bFirstParaIsEmpty = false; @@ -816,7 +816,7 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const vcl::Font aStdFont; if ( !pEditEngine->IsFlatMode() ) { - ESelection aSel( nPara, 0, nPara, 0 ); + ESelection aSel(nPara, 0); aStdFont = EditEngine::CreateFontFromItemSet( pEditEngine->GetAttribs( aSel ), pEditEngine->GetScriptType( aSel ) ); } else @@ -1471,7 +1471,7 @@ void Outliner::StyleSheetChanged( SfxStyleSheet const * pStyle ) ImplCalcBulletText( nPara, false, false ); // EditEngine formats changed paragraphs before calling this method, // so they are not reformatted now and use wrong bullet indent - pEditEngine->QuickMarkInvalid( ESelection( nPara, 0, nPara, 0 ) ); + pEditEngine->QuickMarkInvalid(ESelection(nPara, 0)); } } } @@ -2040,7 +2040,7 @@ std::optional<NonOverflowingText> Outliner::GetNonOverflowingText() const bool bItAllOverflew = nCount == 0 && nOverflowLine == 0; if ( bItAllOverflew ) { - ESelection aEmptySel(0,0,0,0); + ESelection aEmptySel; //EditTextObject *pTObj = pEditEngine->CreateTextObject(aEmptySel); bool const bLastParaInterrupted = true; // Last Para was interrupted since everything overflew return NonOverflowingText(aEmptySel, bLastParaInterrupted); diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx index e6dc6e691c6c..91f89a8e3e8c 100644 --- a/editeng/source/outliner/outlobj.cxx +++ b/editeng/source/outliner/outlobj.cxx @@ -166,10 +166,10 @@ TextRotation OutlinerParaObject::GetRotation() const sal_Int32 OutlinerParaObject::Count() const { size_t nSize = mpImpl->maParagraphDataVector.size(); - if (nSize > EE_PARA_MAX_COUNT) + if (nSize > o3tl::make_unsigned(EE_PARA_MAX)) { SAL_WARN( "editeng", "OutlinerParaObject::Count - overflow " << nSize); - return EE_PARA_MAX_COUNT; + return EE_PARA_MAX; } return static_cast<sal_Int32>(nSize); } diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 4bcd01905283..f3f780d3524d 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -123,12 +123,12 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, vcl::Window const * pFra { if( !bReadOnly && !bSelection && ( pOwner->GetOutlinerMode() != OutlinerMode::TextObject ) ) { - if( aSel.nEndPos == pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) ) + if (aSel.end.nIndex == pOwner->pEditEngine->GetTextLen(aSel.end.nPara)) { - Paragraph* pNext = pOwner->pParaList->GetParagraph( aSel.nEndPara+1 ); + Paragraph* pNext = pOwner->pParaList->GetParagraph(aSel.end.nPara + 1); if( pNext && pNext->HasFlag(ParaFlag::ISPAGE) ) { - if( !pOwner->ImpCanDeleteSelectedPages( this, aSel.nEndPara, 1 ) ) + if (!pOwner->ImpCanDeleteSelectedPages(this, aSel.end.nPara, 1)) return false; } } @@ -149,13 +149,13 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, vcl::Window const * pFra { if ( ( pOwner->GetOutlinerMode() != OutlinerMode::TextObject ) && ( pOwner->GetOutlinerMode() != OutlinerMode::TitleObject ) && - ( bSelection || !aSel.nStartPos ) ) + ( bSelection || !aSel.start.nIndex ) ) { Indent( aKeyCode.IsShift() ? -1 : +1 ); bKeyProcessed = true; } else if ( ( pOwner->GetOutlinerMode() == OutlinerMode::TextObject ) && - !bSelection && !aSel.nEndPos && pOwner->ImplHasNumberFormat( aSel.nEndPara ) ) + !bSelection && !aSel.end.nIndex && pOwner->ImplHasNumberFormat( aSel.end.nPara ) ) { Indent( aKeyCode.IsShift() ? -1 : +1 ); bKeyProcessed = true; @@ -165,15 +165,15 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, vcl::Window const * pFra break; case KEY_BACKSPACE: { - if( !bReadOnly && !bSelection && aSel.nEndPara && !aSel.nEndPos ) + if (!bReadOnly && !bSelection && aSel.end.nPara && !aSel.end.nIndex) { - Paragraph* pPara = pOwner->pParaList->GetParagraph( aSel.nEndPara ); - Paragraph* pPrev = pOwner->pParaList->GetParagraph( aSel.nEndPara-1 ); + Paragraph* pPara = pOwner->pParaList->GetParagraph(aSel.end.nPara); + Paragraph* pPrev = pOwner->pParaList->GetParagraph(aSel.end.nPara - 1); if( !pPrev->IsVisible() ) return true; if( !pPara->GetDepth() ) { - if(!pOwner->ImpCanDeleteSelectedPages(this, aSel.nEndPara , 1 ) ) + if (!pOwner->ImpCanDeleteSelectedPages(this, aSel.end.nPara, 1)) return true; } } @@ -185,26 +185,26 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, vcl::Window const * pFra { // Special treatment: hard return at the end of a paragraph, // which has collapsed subparagraphs. - Paragraph* pPara = pOwner->pParaList->GetParagraph( aSel.nEndPara ); + Paragraph* pPara = pOwner->pParaList->GetParagraph(aSel.end.nPara); if( !aKeyCode.IsShift() ) { // Don't let insert empty paragraph with numbering. Instead end numbering. if (pPara->GetDepth() > -1 && - pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) == 0) + pOwner->pEditEngine->GetTextLen( aSel.end.nPara ) == 0) { ToggleBullets(); return true; } // ImpGetCursor again??? if( !bSelection && - aSel.nEndPos == pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) ) + aSel.end.nIndex == pOwner->pEditEngine->GetTextLen( aSel.end.nPara ) ) { sal_Int32 nChildren = pOwner->pParaList->GetChildCount(pPara); if( nChildren && !pOwner->pParaList->HasVisibleChildren(pPara)) { pOwner->UndoActionStart( OLUNDO_INSERT ); - sal_Int32 nTemp = aSel.nEndPara; + sal_Int32 nTemp = aSel.end.nPara; nTemp += nChildren; nTemp++; // insert above next Non-Child SAL_WARN_IF( nTemp < 0, "editeng", "OutlinerView::PostKeyEvent - overflow"); @@ -212,7 +212,7 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, vcl::Window const * pFra { pOwner->Insert( OUString(),nTemp,pPara->GetDepth()); // Position the cursor - ESelection aTmpSel(nTemp,0,nTemp,0); + ESelection aTmpSel(nTemp, 0); pEditView->SetSelection( aTmpSel ); } pEditView->ShowCursor(); @@ -223,15 +223,15 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, vcl::Window const * pFra } if( !bKeyProcessed && !bSelection && !aKeyCode.IsShift() && aKeyCode.IsMod1() && - ( aSel.nEndPos == pOwner->pEditEngine->GetTextLen(aSel.nEndPara) ) ) + ( aSel.end.nIndex == pOwner->pEditEngine->GetTextLen(aSel.end.nPara) ) ) { pOwner->UndoActionStart( OLUNDO_INSERT ); - sal_Int32 nTemp = aSel.nEndPara; + sal_Int32 nTemp = aSel.end.nPara; nTemp++; pOwner->Insert( OUString(), nTemp, pPara->GetDepth()+1 ); // Position the cursor - ESelection aTmpSel(nTemp,0,nTemp,0); + ESelection aTmpSel(nTemp, 0); pEditView->SetSelection( aTmpSel ); pEditView->ShowCursor(); pOwner->UndoActionEnd(); @@ -248,7 +248,7 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, vcl::Window const * pFra sal_Int32 OutlinerView::ImpCheckMousePos(const Point& rPosPix, MouseTarget& reTarget) { - sal_Int32 nPara = EE_PARA_NOT_FOUND; + sal_Int32 nPara = EE_PARA_MAX; Point aMousePosWin = pEditView->GetOutputDevice().PixelToLogic( rPosPix ); if( !pEditView->GetOutputArea().Contains( aMousePosWin ) ) @@ -328,7 +328,7 @@ bool OutlinerView::MouseButtonDown( const MouseEvent& rMEvt ) if ( bHasChildren && pOwner->pParaList->HasVisibleChildren(pPara) ) nEndPara += pOwner->pParaList->GetChildCount( pPara ); // The selection is inverted, so that EditEngine does not scroll - ESelection aSel(nEndPara, EE_TEXTPOS_ALL, nPara, 0 ); + ESelection aSel(nEndPara, EE_TEXTPOS_MAX, nPara, 0); pEditView->SetSelection( aSel ); } else if( rMEvt.GetClicks() == 2 && bHasChildren ) @@ -338,10 +338,10 @@ bool OutlinerView::MouseButtonDown( const MouseEvent& rMEvt ) } // special case for outliner view in impress, check if double click hits the page icon for toggle - if( (nPara == EE_PARA_NOT_FOUND) && (pOwner->GetOutlinerMode() == OutlinerMode::OutlineView) && (eTarget == MouseTarget::Text) && (rMEvt.GetClicks() == 2) ) + if( (nPara == EE_PARA_MAX) && (pOwner->GetOutlinerMode() == OutlinerMode::OutlineView) && (eTarget == MouseTarget::Text) && (rMEvt.GetClicks() == 2) ) { ESelection aSel( pEditView->GetSelection() ); - nPara = aSel.nStartPara; + nPara = aSel.start.nPara; Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); if( (pPara && pOwner->pParaList->HasChildren(pPara)) && pPara->HasFlag(ParaFlag::ISPAGE) ) { @@ -375,7 +375,7 @@ void OutlinerView::ReleaseMouse() void OutlinerView::ImpToggleExpand( Paragraph const * pPara ) { sal_Int32 nPara = pOwner->pParaList->GetAbsPos( pPara ); - pEditView->SetSelection( ESelection( nPara, 0, nPara, 0 ) ); + pEditView->SetSelection(ESelection(nPara, 0)); ImplExpandOrCollaps( nPara, nPara, !pOwner->pParaList->HasVisibleChildren( pPara ) ); pEditView->ShowCursor(); } @@ -401,8 +401,8 @@ sal_Int16 OutlinerView::GetDepth() const { ESelection aESelection = GetSelection(); aESelection.Adjust(); - sal_Int16 nDepth = pOwner->GetDepth(aESelection.nStartPara); - for (sal_Int32 nPara = aESelection.nStartPara + 1; nPara <= aESelection.nEndPara; ++nPara) + sal_Int16 nDepth = pOwner->GetDepth(aESelection.start.nPara); + for (sal_Int32 nPara = aESelection.start.nPara + 1; nPara <= aESelection.end.nPara; ++nPara) { if (nDepth != pOwner->GetDepth(nPara)) return -2; @@ -440,7 +440,7 @@ void OutlinerView::SetAttribs( const SfxItemSet& rAttrs ) ParaRange OutlinerView::ImpGetSelectedParagraphs( bool bIncludeHiddenChildren ) { ESelection aSel = pEditView->GetSelection(); - ParaRange aParas( aSel.nStartPara, aSel.nEndPara ); + ParaRange aParas(aSel.start.nPara, aSel.end.nPara); aParas.Adjust(); // Record the invisible Children of the last Parents in the selection @@ -497,7 +497,7 @@ void OutlinerView::Indent( short nDiff ) pPara->SetFlag( ParaFlag::ISPAGE ); pOwner->DepthChangedHdl(pPara, nPrevFlags); - pOwner->pEditEngine->QuickMarkInvalid( ESelection( nPara, 0, nPara, 0 ) ); + pOwner->pEditEngine->QuickMarkInvalid(ESelection(nPara, 0)); if( bUndo ) pOwner->InsertUndo( std::make_unique<OutlinerUndoChangeParaFlags>( pOwner, nPara, nPrevFlags, pPara->nFlags ) ); @@ -566,7 +566,7 @@ void OutlinerView::Indent( short nDiff ) else { // Needs at least a repaint... - pOwner->pEditEngine->QuickMarkInvalid( ESelection( nPara, 0, nPara, 0 ) ); + pOwner->pEditEngine->QuickMarkInvalid(ESelection(nPara, 0)); } } @@ -790,8 +790,8 @@ sal_Int32 OutlinerView::ImpInitPaste( sal_Int32& rStart ) pOwner->bPasting = true; ESelection aSelection( pEditView->GetSelection() ); aSelection.Adjust(); - rStart = aSelection.nStartPara; - sal_Int32 nSize = aSelection.nEndPara - aSelection.nStartPara + 1; + rStart = aSelection.start.nPara; + sal_Int32 nSize = aSelection.end.nPara - aSelection.start.nPara + 1; return nSize; } @@ -814,11 +814,7 @@ bool OutlinerView::Command(const CommandEvent& rCEvt) void OutlinerView::SelectRange( sal_Int32 nFirst, sal_Int32 nCount ) { - sal_Int32 nLast = nFirst+nCount; - nCount = pOwner->pParaList->GetParagraphCount(); - if( nLast <= nCount ) - nLast = nCount - 1; - ESelection aSel( nFirst, 0, nLast, EE_TEXTPOS_ALL ); + ESelection aSel(nFirst, 0, nFirst + nCount, EE_TEXTPOS_MAX); pEditView->SetSelection( aSel ); } @@ -829,18 +825,18 @@ sal_Int32 OutlinerView::ImpCalcSelectedPages( bool bIncludeFirstSelected ) aSel.Adjust(); sal_Int32 nPages = 0; - sal_Int32 nFirstPage = EE_PARA_MAX_COUNT; - sal_Int32 nStartPara = aSel.nStartPara; + sal_Int32 nFirstPage = EE_PARA_MAX; + sal_Int32 nStartPara = aSel.start.nPara; if ( !bIncludeFirstSelected ) nStartPara++; // All paragraphs after StartPara will be deleted - for ( sal_Int32 nPara = nStartPara; nPara <= aSel.nEndPara; nPara++ ) + for (sal_Int32 nPara = nStartPara; nPara <= aSel.end.nPara; nPara++) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); assert(pPara && "ImpCalcSelectedPages: invalid Selection?"); if( pPara->HasFlag(ParaFlag::ISPAGE) ) { nPages++; - if( nFirstPage == EE_PARA_MAX_COUNT ) + if (nFirstPage == EE_PARA_MAX) nFirstPage = nPara; } } @@ -867,7 +863,7 @@ void OutlinerView::ToggleBullets() sal_Int16 nNewDepth = -2; const SvxNumRule* pDefaultBulletNumRule = nullptr; - for ( sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) + for (sal_Int32 nPara = aSel.start.nPara; nPara <= aSel.end.nPara; nPara++) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); DBG_ASSERT(pPara, "OutlinerView::ToggleBullets(), illegal selection?"); @@ -920,10 +916,10 @@ void OutlinerView::ToggleBullets() } const sal_Int32 nParaCount = pOwner->pParaList->GetParagraphCount(); - pOwner->ImplCheckParagraphs( aSel.nStartPara, nParaCount ); + pOwner->ImplCheckParagraphs(aSel.start.nPara, nParaCount); sal_Int32 nEndPara = (nParaCount > 0) ? nParaCount-1 : nParaCount; - pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nEndPara, 0 ) ); + pOwner->pEditEngine->QuickMarkInvalid(ESelection(aSel.start.nPara, 0, nEndPara, 0)); pOwner->pEditEngine->SetUpdateLayout( bUpdate ); @@ -943,7 +939,7 @@ void OutlinerView::ToggleBulletsNumbering( if ( bToggle ) { bToggleOn = false; - const sal_Int16 nBulletNumberingStatus( pOwner->GetBulletsNumberingStatus( aSel.nStartPara, aSel.nEndPara ) ); + const sal_Int16 nBulletNumberingStatus( pOwner->GetBulletsNumberingStatus( aSel.start.nPara, aSel.end.nPara ) ); if ( nBulletNumberingStatus != 0 && bHandleBullets ) { // not all paragraphs have bullets and method called to toggle bullets --> bullets on @@ -977,7 +973,7 @@ void OutlinerView::EnsureNumberingIsOn() const bool bUpdate = pOwner->pEditEngine->IsUpdateLayout(); pOwner->pEditEngine->SetUpdateLayout(false); - for (sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++) + for (sal_Int32 nPara = aSel.start.nPara; nPara <= aSel.end.nPara; nPara++) { Paragraph* pPara = pOwner->pParaList->GetParagraph(nPara); DBG_ASSERT(pPara, "OutlinerView::EnableBullets(), illegal selection?"); @@ -987,10 +983,10 @@ void OutlinerView::EnsureNumberingIsOn() } sal_Int32 nParaCount = pOwner->pParaList->GetParagraphCount(); - pOwner->ImplCheckParagraphs(aSel.nStartPara, nParaCount); + pOwner->ImplCheckParagraphs(aSel.start.nPara, nParaCount); const sal_Int32 nEndPara = (nParaCount > 0) ? nParaCount-1 : nParaCount; - pOwner->pEditEngine->QuickMarkInvalid(ESelection(aSel.nStartPara, 0, nEndPara, 0)); + pOwner->pEditEngine->QuickMarkInvalid(ESelection(aSel.start.nPara, 0, nEndPara, 0)); pOwner->pEditEngine->SetUpdateLayout(bUpdate); @@ -1017,8 +1013,8 @@ void OutlinerView::ApplyBulletsNumbering( { ESelection aSel( pEditView->GetSelection() ); aSel.Adjust(); - nStartPara = aSel.nStartPara; - nEndPara = aSel.nEndPara; + nStartPara = aSel.start.nPara; + nEndPara = aSel.end.nPara; } else { @@ -1135,8 +1131,8 @@ void OutlinerView::SwitchOffBulletsNumbering( { ESelection aSel( pEditView->GetSelection() ); aSel.Adjust(); - nStartPara = aSel.nStartPara; - nEndPara = aSel.nEndPara; + nStartPara = aSel.start.nPara; + nEndPara = aSel.end.nPara; } else { @@ -1193,7 +1189,7 @@ void OutlinerView::RemoveAttribs( bool bRemoveParaAttribs, bool bKeepLanguages ) // Loop through all paragraphs and set indentation and level ESelection aSel = pEditView->GetSelection(); aSel.Adjust(); - for ( sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) + for (sal_Int32 nPara = aSel.start.nPara; nPara <= aSel.end.nPara; nPara++) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); pOwner->ImplInitDepth( nPara, pPara->GetDepth(), false ); @@ -1412,8 +1408,8 @@ void OutlinerView::Read( SvStream& rInput, EETextFormat eFormat, SvKeyValueItera pEditView->Read( rInput, eFormat, pHTTPHeaderAttrs ); tools::Long nParaDiff = pEditView->getEditEngine().GetParagraphCount() - nOldParaCount; - sal_Int32 nChangesStart = aOldSel.nStartPara; - sal_Int32 nChangesEnd = nChangesStart + nParaDiff + (aOldSel.nEndPara-aOldSel.nStartPara); + sal_Int32 nChangesStart = aOldSel.start.nPara; + sal_Int32 nChangesEnd = nChangesStart + nParaDiff + (aOldSel.end.nPara-aOldSel.start.nPara); for ( sal_Int32 n = nChangesStart; n <= nChangesEnd; n++ ) { @@ -1503,7 +1499,7 @@ bool GetStatusValueForThesaurusFromContext( if (!isSingleScriptType(rEditEngine.GetScriptType(aTextSel))) return false; - LanguageType nLang = rEditEngine.GetLanguage( aTextSel.nStartPara, aTextSel.nStartPos ).nLang; + LanguageType nLang = rEditEngine.GetLanguage(aTextSel.start.nPara, aTextSel.start.nIndex).nLang; OUString aLangText( LanguageTag::convertToBcp47( nLang ) ); // set word and locale to look up as status value diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 0a17cd609100..b54706b9f059 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -126,9 +126,9 @@ bool NonOverflowingText::IsLastParaInterrupted() const std::optional<OutlinerParaObject> NonOverflowingText::RemoveOverflowingText(Outliner *pOutliner) const { pOutliner->QuickDelete(maContentSel); - SAL_INFO("editeng.chaining", "Deleting selection from (Para: " << maContentSel.nStartPara - << ", Pos: " << maContentSel.nStartPos << ") to (Para: " << maContentSel.nEndPara - << ", Pos: " << maContentSel.nEndPos << ")"); + SAL_INFO("editeng.chaining", "Deleting selection from (Para: " << maContentSel.start.nPara + << ", Pos: " << maContentSel.start.nIndex << ") to (Para: " << maContentSel.end.nPara + << ", Pos: " << maContentSel.end.nIndex << ")"); return pOutliner->CreateParaObject(); } @@ -137,7 +137,7 @@ ESelection NonOverflowingText::GetOverflowPointSel() const //return getLastPositionSel(mpContentTextObj); // return the starting point of the selection we are removing - return ESelection(maContentSel.nStartPara, maContentSel.nStartPos); //XXX + return ESelection(maContentSel.start); //XXX } // The equivalent of ToParaObject for OverflowingText. Here we are prepending the overflowing text to the old dest box's text diff --git a/editeng/source/outliner/paralist.cxx b/editeng/source/outliner/paralist.cxx index 5b9f21449854..d25a00b18207 100644 --- a/editeng/source/outliner/paralist.cxx +++ b/editeng/source/outliner/paralist.cxx @@ -97,15 +97,15 @@ void ParagraphList::Clear() void ParagraphList::Append( std::unique_ptr<Paragraph> pPara) { - SAL_WARN_IF( maEntries.size() >= EE_PARA_MAX_COUNT, "editeng", "ParagraphList::Append - overflow"); + SAL_WARN_IF( maEntries.size() >= EE_PARA_MAX, "editeng", "ParagraphList::Append - overflow"); maEntries.push_back(std::move(pPara)); } void ParagraphList::Insert( std::unique_ptr<Paragraph> pPara, sal_Int32 nAbsPos) { - SAL_WARN_IF( nAbsPos < 0 || (maEntries.size() < o3tl::make_unsigned(nAbsPos) && nAbsPos != EE_PARA_APPEND), + SAL_WARN_IF( nAbsPos < 0 || (maEntries.size() < o3tl::make_unsigned(nAbsPos) && nAbsPos != EE_PARA_MAX), "editeng", "ParagraphList::Insert - bad insert position " << nAbsPos); - SAL_WARN_IF( maEntries.size() >= EE_PARA_MAX_COUNT, "editeng", "ParagraphList::Insert - overflow"); + SAL_WARN_IF( maEntries.size() >= EE_PARA_MAX, "editeng", "ParagraphList::Insert - overflow"); if (nAbsPos < 0 || maEntries.size() <= o3tl::make_unsigned(nAbsPos)) Append( std::move(pPara) ); @@ -242,7 +242,7 @@ sal_Int32 ParagraphList::GetAbsPos( Paragraph const * pParent ) const ++pos; } - return EE_PARA_NOT_FOUND; + return EE_PARA_MAX; } void ParagraphList::dumpAsXml(xmlTextWriterPtr pWriter) const diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx index 2a1b1e2bd54f..4466b599488f 100644 --- a/editeng/source/uno/unoedhlp.cxx +++ b/editeng/source/uno/unoedhlp.cxx @@ -160,7 +160,7 @@ void SvxEditSourceHelper::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nE if ( !bInCell ) return; - EPosition aStartPos( nPara, nStartIndex ), aEndPos( nPara, nEndIndex ); + EPaM aStartPos(nPara, nStartIndex), aEndPos(nPara, nEndIndex); sal_Int32 nParaCount = rEE.GetParagraphCount(); sal_Int32 nCrrntParaLen = rEE.GetTextLen(nPara); //need to find closest index in front of nIndex in the previous paragraphs diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index 1877d068e0e0..ded8eb4e742d 100644 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -187,7 +187,7 @@ void SvxAccessibleTextIndex::SetEEIndex( sal_Int32 nEEIndex, const SvxTextForwar EBulletInfo aBulletInfo = rTF.GetBulletInfo( GetParagraph() ); // any text bullets? - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible && aBulletInfo.nType != SVX_NUM_BITMAP ) { @@ -235,7 +235,7 @@ void SvxAccessibleTextIndex::SetIndex( sal_Int32 nIndex, const SvxTextForwarder& EBulletInfo aBulletInfo = rTF.GetBulletInfo( GetParagraph() ); // any text bullets? - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible && aBulletInfo.nType != SVX_NUM_BITMAP ) { @@ -435,12 +435,11 @@ OUString SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *this ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *this ); // normalize selection - if( rSel.nStartPara > rSel.nEndPara || - (rSel.nStartPara == rSel.nEndPara && rSel.nStartPos > rSel.nEndPos) ) + if (!rSel.IsAdjusted()) { std::swap( aStartIndex, aEndIndex ); } @@ -499,8 +498,8 @@ SfxItemSet SvxAccessibleTextAdapter::GetAttribs( const ESelection& rSel, EditEng SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *this ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *this ); return mpTextForwarder->GetAttribs( MakeEESelection(aStartIndex, aEndIndex), nOnlyHardAttrib ); } @@ -551,8 +550,8 @@ SfxItemState SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, sal SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *this ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *this ); return mpTextForwarder->GetItemState( MakeEESelection(aStartIndex, aEndIndex), nWhich ); @@ -572,8 +571,8 @@ void SvxAccessibleTextAdapter::QuickInsertText( const OUString& rText, const ESe SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *this ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *this ); mpTextForwarder->QuickInsertText( rText, MakeEESelection(aStartIndex, aEndIndex) ); @@ -586,8 +585,8 @@ void SvxAccessibleTextAdapter::QuickInsertField( const SvxFieldItem& rFld, const SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *this ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *this ); mpTextForwarder->QuickInsertField( rFld, MakeEESelection(aStartIndex, aEndIndex) ); @@ -600,8 +599,8 @@ void SvxAccessibleTextAdapter::QuickSetAttribs( const SfxItemSet& rSet, const ES SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *this ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *this ); mpTextForwarder->QuickSetAttribs( rSet, MakeEESelection(aStartIndex, aEndIndex) ); @@ -614,8 +613,8 @@ void SvxAccessibleTextAdapter::QuickInsertLineBreak( const ESelection& rSel ) SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *this ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *this ); mpTextForwarder->QuickInsertLineBreak( MakeEESelection(aStartIndex, aEndIndex) ); } @@ -756,7 +755,7 @@ tools::Rectangle SvxAccessibleTextAdapter::GetParaBounds( sal_Int32 nPara ) cons EBulletInfo aBulletInfo = GetBulletInfo( nPara ); - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible && aBulletInfo.nType != SVX_NUM_BITMAP ) { @@ -803,7 +802,7 @@ bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, sal_Int32& EBulletInfo aBulletInfo = GetBulletInfo( nPara ); // any text bullets? - if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && + if( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible && aBulletInfo.nType != SVX_NUM_BITMAP ) { @@ -1004,8 +1003,8 @@ bool SvxAccessibleTextAdapter::Delete( const ESelection& rSel ) SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *this ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *this ); return mpTextForwarder->Delete( MakeEESelection(aStartIndex, aEndIndex ) ); } @@ -1017,8 +1016,8 @@ bool SvxAccessibleTextAdapter::InsertText( const OUString& rStr, const ESelectio SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *this ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *this ); return mpTextForwarder->InsertText( rStr, MakeEESelection(aStartIndex, aEndIndex) ); } @@ -1053,7 +1052,7 @@ bool SvxAccessibleTextAdapter::HaveImageBullet( sal_Int32 nPara ) const { EBulletInfo aBulletInfo = GetBulletInfo( nPara ); - return ( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && + return ( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible && aBulletInfo.nType == SVX_NUM_BITMAP ); } @@ -1062,7 +1061,7 @@ bool SvxAccessibleTextAdapter::HaveTextBullet( sal_Int32 nPara ) const { EBulletInfo aBulletInfo = GetBulletInfo( nPara ); - return ( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && + return ( aBulletInfo.nParagraph != EE_PARA_MAX && aBulletInfo.bVisible && aBulletInfo.nType != SVX_NUM_BITMAP ); } @@ -1072,12 +1071,11 @@ bool SvxAccessibleTextAdapter::IsEditable( const ESelection& rSel ) const SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *this ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *this ); // normalize selection - if( rSel.nStartPara > rSel.nEndPara || - (rSel.nStartPara == rSel.nEndPara && rSel.nStartPos > rSel.nEndPos) ) + if (!rSel.IsAdjusted()) { std::swap( aStartIndex, aEndIndex ); } @@ -1152,8 +1150,8 @@ bool SvxAccessibleTextEditViewAdapter::GetSelection( ESelection& rSel ) const SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetEEIndex( aSelection.nStartPara, aSelection.nStartPos, *mpTextForwarder ); - aEndIndex.SetEEIndex( aSelection.nEndPara, aSelection.nEndPos, *mpTextForwarder ); + aStartIndex.SetEEIndex( aSelection.start.nPara, aSelection.start.nIndex, *mpTextForwarder ); + aEndIndex.SetEEIndex( aSelection.end.nPara, aSelection.end.nIndex, *mpTextForwarder ); DBG_ASSERT(aStartIndex.GetIndex() >= 0 && aEndIndex.GetIndex() >= 0, @@ -1172,8 +1170,8 @@ bool SvxAccessibleTextEditViewAdapter::SetSelection( const ESelection& rSel ) SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *mpTextForwarder ); - aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *mpTextForwarder ); + aStartIndex.SetIndex( rSel.start.nPara, rSel.start.nIndex, *mpTextForwarder ); + aEndIndex.SetIndex( rSel.end.nPara, rSel.end.nIndex, *mpTextForwarder ); return mpViewForwarder->SetSelection( MakeEESelection(aStartIndex, aEndIndex) ); } diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx index 6d088245f142..1b56ad1859b0 100644 --- a/editeng/source/uno/unofored.cxx +++ b/editeng/source/uno/unofored.cxx @@ -63,7 +63,7 @@ OUString SvxEditEngineForwarder::GetText( const ESelection& rSel ) const SfxItemSet SvxEditEngineForwarder::GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib ) const { - if( rSel.nStartPara == rSel.nEndPara ) + if (rSel.start.nPara == rSel.end.nPara) { GetAttribsFlags nFlags = GetAttribsFlags::NONE; switch( nOnlyHardAttrib ) @@ -78,7 +78,7 @@ SfxItemSet SvxEditEngineForwarder::GetAttribs( const ESelection& rSel, EditEngin OSL_FAIL("unknown flags for SvxOutlinerForwarder::GetAttribs"); } - return rEditEngine.GetAttribs( rSel.nStartPara, rSel.nStartPos, rSel.nEndPos, nFlags ); + return rEditEngine.GetAttribs( rSel.start.nPara, rSel.start.nIndex, rSel.end.nIndex, nFlags ); } else { @@ -184,17 +184,17 @@ SfxItemState GetSvxEditEngineItemState( EditEngine const & rEditEngine, const ES SfxItemState eState = SfxItemState::DEFAULT; // check all paragraphs inside the selection - for( sal_Int32 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ ) + for (sal_Int32 nPara = rSel.start.nPara; nPara <= rSel.end.nPara; nPara++) { SfxItemState eParaState = SfxItemState::DEFAULT; // calculate start and endpos for this paragraph sal_Int32 nPos = 0; - if( rSel.nStartPara == nPara ) - nPos = rSel.nStartPos; + if (rSel.start.nPara == nPara) + nPos = rSel.start.nIndex; - sal_Int32 nEndPos = rSel.nEndPos; - if( rSel.nEndPara != nPara ) + sal_Int32 nEndPos = rSel.end.nIndex; + if (rSel.end.nPara != nPara) nEndPos = rEditEngine.GetTextLen( nPara ); @@ -318,7 +318,7 @@ tools::Rectangle SvxEditEngineForwarder::GetCharBounds( sal_Int32 nPara, sal_Int if( nIndex ) { // use last character, if possible - aLast = rEditEngine.GetCharacterBounds( EPosition(nPara, nIndex-1) ); + aLast = rEditEngine.GetCharacterBounds(EPaM(nPara, nIndex - 1)); // move at end of this last character, make one pixel wide aLast.Move( aLast.Right() - aLast.Left(), 0 ); @@ -344,7 +344,7 @@ tools::Rectangle SvxEditEngineForwarder::GetCharBounds( sal_Int32 nPara, sal_Int } else { - return SvxEditSourceHelper::EEToUserSpace( rEditEngine.GetCharacterBounds( EPosition(nPara, nIndex) ), + return SvxEditSourceHelper::EEToUserSpace( rEditEngine.GetCharacterBounds( EPaM(nPara, nIndex) ), aSize, bIsVertical ); } } @@ -396,7 +396,7 @@ bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPar aSize, rEditEngine.IsEffectivelyVertical() )); - EPosition aDocPos = rEditEngine.FindDocPosition( aEEPos ); + EPaM aDocPos = rEditEngine.FindDocPosition(aEEPos); nPara = aDocPos.nPara; nIndex = aDocPos.nIndex; @@ -408,11 +408,11 @@ bool SvxEditEngineForwarder::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, { ESelection aRes = rEditEngine.GetWord( ESelection(nPara, nIndex, nPara, nIndex), css::i18n::WordType::DICTIONARY_WORD ); - if( aRes.nStartPara == nPara && - aRes.nStartPara == aRes.nEndPara ) + if( aRes.start.nPara == nPara && + aRes.start.nPara == aRes.end.nPara ) { - nStart = aRes.nStartPos; - nEnd = aRes.nEndPos; + nStart = aRes.start.nIndex; + nEnd = aRes.end.nIndex; return true; } @@ -501,7 +501,7 @@ sal_Int32 SvxEditEngineForwarder::AppendTextPortion( sal_Int32 nPara, const OUSt if (0 <= nPara && nPara < nParaCount) { nLen = rEditEngine.GetTextLen( nPara ); - rEditEngine.QuickInsertText( rText, ESelection( nPara, nLen, nPara, nLen ) ); + rEditEngine.QuickInsertText(rText, ESelection(nPara, nLen)); } return nLen; diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx index 8772ff9a77fa..7b2f98b1ede0 100644 --- a/editeng/source/uno/unoforou.cxx +++ b/editeng/source/uno/unoforou.cxx @@ -69,7 +69,7 @@ OUString SvxOutlinerForwarder::GetText( const ESelection& rSel ) const static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib, EditEngine& rEditEngine ) { - if( rSel.nStartPara == rSel.nEndPara ) + if (rSel.start.nPara == rSel.end.nPara) { GetAttribsFlags nFlags = GetAttribsFlags::NONE; @@ -84,7 +84,7 @@ static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, EditE default: OSL_FAIL("unknown flags for SvxOutlinerForwarder::GetAttribs"); } - return rEditEngine.GetAttribs( rSel.nStartPara, rSel.nStartPos, rSel.nEndPos, nFlags ); + return rEditEngine.GetAttribs( rSel.start.nPara, rSel.start.nIndex, rSel.end.nIndex, nFlags ); } else { @@ -121,7 +121,7 @@ SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, EditEngineA maAttribCacheSelection = rSel; } - SfxStyleSheet* pStyle = rEditEngine.GetStyleSheet( rSel.nStartPara ); + SfxStyleSheet* pStyle = rEditEngine.GetStyleSheet(rSel.start.nPara); if( pStyle ) aSet.SetParent( &(pStyle->GetItemSet() ) ); @@ -304,7 +304,7 @@ tools::Rectangle SvxOutlinerForwarder::GetCharBounds( sal_Int32 nPara, sal_Int32 if( nIndex ) { // use last character, if possible - aLast = rOutliner.GetEditEngine().GetCharacterBounds( EPosition(nPara, nIndex-1) ); + aLast = rOutliner.GetEditEngine().GetCharacterBounds(EPaM(nPara, nIndex - 1)); // move at end of this last character, make one pixel wide aLast.Move( aLast.Right() - aLast.Left(), 0 ); @@ -330,7 +330,7 @@ tools::Rectangle SvxOutlinerForwarder::GetCharBounds( sal_Int32 nPara, sal_Int32 } else { - return SvxEditSourceHelper::EEToUserSpace( rOutliner.GetEditEngine().GetCharacterBounds( EPosition(nPara, nIndex) ), + return SvxEditSourceHelper::EEToUserSpace( rOutliner.GetEditEngine().GetCharacterBounds( EPaM(nPara, nIndex) ), aSize, bIsVertical ); } } @@ -361,7 +361,7 @@ bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, aSize, rOutliner.IsVertical() )); - EPosition aDocPos = rOutliner.GetEditEngine().FindDocPosition( aEEPos ); + EPaM aDocPos = rOutliner.GetEditEngine().FindDocPosition(aEEPos); nPara = aDocPos.nPara; nIndex = aDocPos.nIndex; @@ -371,13 +371,13 @@ bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, bool SvxOutlinerForwarder::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const { - ESelection aRes = rOutliner.GetEditEngine().GetWord( ESelection(nPara, nIndex, nPara, nIndex), css::i18n::WordType::DICTIONARY_WORD ); + ESelection aRes = rOutliner.GetEditEngine().GetWord( ESelection(nPara, nIndex), css::i18n::WordType::DICTIONARY_WORD ); - if( aRes.nStartPara == nPara && - aRes.nStartPara == aRes.nEndPara ) + if( aRes.start.nPara == nPara && + aRes.start.nPara == aRes.end.nPara ) { - nStart = aRes.nStartPos; - nEnd = aRes.nEndPos; + nStart = aRes.start.nIndex; + nEnd = aRes.end.nIndex; return true; } @@ -544,7 +544,7 @@ sal_Int32 SvxOutlinerForwarder::AppendTextPortion( sal_Int32 nPara, const OUStri if (0 <= nPara && nPara < nParaCount) { nLen = rEditEngine.GetTextLen( nPara ); - rEditEngine.QuickInsertText( rText, ESelection( nPara, nLen, nPara, nLen ) ); + rEditEngine.QuickInsertText(rText, ESelection(nPara, nLen)); } return nLen; diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 5ee01340f880..b9af24bae93c 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -60,10 +60,10 @@ namespace { ESelection toESelection(const text::TextRangeSelection& rSel) { ESelection aESel; - aESel.nStartPara = rSel.Start.Paragraph; - aESel.nStartPos = rSel.Start.PositionInParagraph; - aESel.nEndPara = rSel.End.Paragraph; - aESel.nEndPos = rSel.End.PositionInParagraph; + aESel.start.nPara = rSel.Start.Paragraph; + aESel.start.nIndex = rSel.Start.PositionInParagraph; + aESel.end.nPara = rSel.End.Paragraph; + aESel.end.nIndex = rSel.End.PositionInParagraph; return aESel; } @@ -151,7 +151,7 @@ void CheckSelection( struct ESelection& rSel, SvxTextForwarder const * pForwarde if( !pForwarder ) return; - if( rSel.nStartPara == EE_PARA_MAX_COUNT ) + if (rSel.start.nPara == EE_PARA_MAX) { ::GetSelection( rSel, pForwarder ); } @@ -161,35 +161,31 @@ void CheckSelection( struct ESelection& rSel, SvxTextForwarder const * pForwarde GetSelection( aMaxSelection, pForwarder ); // check start position - if( rSel.nStartPara < aMaxSelection.nStartPara ) + if (rSel.start.nPara < aMaxSelection.start.nPara) { - rSel.nStartPara = aMaxSelection.nStartPara; - rSel.nStartPos = aMaxSelection.nStartPos; + rSel.start = aMaxSelection.start; } - else if( rSel.nStartPara > aMaxSelection.nEndPara ) + else if (rSel.start.nPara > aMaxSelection.end.nPara) { - rSel.nStartPara = aMaxSelection.nEndPara; - rSel.nStartPos = aMaxSelection.nEndPos; + rSel.start = aMaxSelection.end; } - else if( rSel.nStartPos > pForwarder->GetTextLen( rSel.nStartPara ) ) + else if (rSel.start.nIndex > pForwarder->GetTextLen(rSel.start.nPara)) { - rSel.nStartPos = pForwarder->GetTextLen( rSel.nStartPara ); + rSel.start.nIndex = pForwarder->GetTextLen(rSel.start.nPara); } // check end position - if( rSel.nEndPara < aMaxSelection.nStartPara ) + if (rSel.end.nPara < aMaxSelection.start.nPara) { - rSel.nEndPara = aMaxSelection.nStartPara; - rSel.nEndPos = aMaxSelection.nStartPos; + rSel.end = aMaxSelection.start; } - else if( rSel.nEndPara > aMaxSelection.nEndPara ) + else if (rSel.end.nPara > aMaxSelection.end.nPara) { - rSel.nEndPara = aMaxSelection.nEndPara; - rSel.nEndPos = aMaxSelection.nEndPos; + rSel.end = aMaxSelection.end; } - else if( rSel.nEndPos > pForwarder->GetTextLen( rSel.nEndPara ) ) + else if (rSel.end.nIndex > pForwarder->GetTextLen(rSel.end.nPara)) { - rSel.nEndPos = pForwarder->GetTextLen( rSel.nEndPara ); + rSel.end.nIndex = pForwarder->GetTextLen(rSel.end.nPara); } } } @@ -270,7 +266,7 @@ void SvxUnoTextRangeBase::SetEditSource( SvxEditSource* pSource ) noexcept mpEditSource.reset( pSource ); - maSelection.nStartPara = EE_PARA_MAX_COUNT; + maSelection.start.nPara = EE_PARA_MAX; if( mpEditSource ) mpEditSource->addRange( this ); @@ -320,8 +316,7 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextRangeBase::getStart() xRange = pRange; ESelection aNewSel = maSelection; - aNewSel.nEndPara = aNewSel.nStartPara; - aNewSel.nEndPos = aNewSel.nStartPos; + aNewSel.CollapseToStart(); pRange->SetSelection( aNewSel ); } @@ -348,8 +343,7 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextRangeBase::getEnd() xRet = pNew; ESelection aNewSel = maSelection; - aNewSel.nStartPara = aNewSel.nEndPara; - aNewSel.nStartPos = aNewSel.nEndPos; + aNewSel.CollapseToEnd(); pNew->SetSelection( aNewSel ); } return xRet; @@ -439,8 +433,8 @@ void SvxUnoTextRangeBase::_setPropertyValue( const OUString& PropertyName, const if( nPara == -1 ) { - nPara = aSel.nStartPara; - nEndPara = aSel.nEndPara; + nPara = aSel.start.nPara; + nEndPara = aSel.end.nPara; } else { @@ -471,8 +465,8 @@ void SvxUnoTextRangeBase::_setPropertyValue( const OUString& PropertyName, const if( nPara == -1 ) { - nPara = aSel.nStartPara; - nEndPara = aSel.nEndPara; + nPara = aSel.start.nPara; + nEndPara = aSel.end.nPara; } else { @@ -539,7 +533,7 @@ bool SvxUnoTextRangeBase::SetPropertyValueHelper( const SfxItemPropertyMapEntry* if( aValue >>= nLevel ) { // #101004# Call interface method instead of unsafe cast - if(! pForwarder->SetDepth( pSelection->nStartPara, nLevel ) ) + if (!pForwarder->SetDepth(pSelection->start.nPara, nLevel)) throw lang::IllegalArgumentException(); // If valid, then not yet finished. Also needs to be added to paragraph props. @@ -556,7 +550,7 @@ bool SvxUnoTextRangeBase::SetPropertyValueHelper( const SfxItemPropertyMapEntry* sal_Int16 nStartValue = -1; if( aValue >>= nStartValue ) { - pForwarder->SetNumberingStartValue( pSelection->nStartPara, nStartValue ); + pForwarder->SetNumberingStartValue(pSelection->start.nPara, nStartValue); return true; } } @@ -570,7 +564,7 @@ bool SvxUnoTextRangeBase::SetPropertyValueHelper( const SfxItemPropertyMapEntry* bool bParaIsNumberingRestart = false; if( aValue >>= bParaIsNumberingRestart ) { - pForwarder->SetParaIsNumberingRestart( pSelection->nStartPara, bParaIsNumberingRestart ); + pForwarder->SetParaIsNumberingRestart( pSelection->start.nPara, bParaIsNumberingRestart ); return true; } } @@ -601,10 +595,10 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::getPropertyValue(const OUString& Property { const ESelection& rSel = GetSelection(); text::TextRangeSelection aSel; - aSel.Start.Paragraph = rSel.nStartPara; - aSel.Start.PositionInParagraph = rSel.nStartPos; - aSel.End.Paragraph = rSel.nEndPara; - aSel.End.PositionInParagraph = rSel.nEndPos; + aSel.Start.Paragraph = rSel.start.nPara; + aSel.Start.PositionInParagraph = rSel.start.nIndex; + aSel.End.Paragraph = rSel.end.nPara; + aSel.End.PositionInParagraph = rSel.end.nIndex; return uno::Any(aSel); } @@ -658,7 +652,7 @@ void SvxUnoTextRangeBase::getPropertyValue( const SfxItemPropertyMapEntry* pMap, std::optional<FontLineStyle> pFldLineStyle; SvxTextForwarder* pForwarder = mpEditSource->GetTextForwarder(); - OUString aPresentation( pForwarder->CalcFieldValue( SvxFieldItem(*pData, EE_FEATURE_FIELD), maSelection.nStartPara, maSelection.nStartPos, pTColor, pFColor, pFldLineStyle ) ); + OUString aPresentation( pForwarder->CalcFieldValue( SvxFieldItem(*pData, EE_FEATURE_FIELD), maSelection.start.nPara, maSelection.start.nIndex, pTColor, pFColor, pFldLineStyle ) ); uno::Reference< text::XTextField > xField( new SvxUnoTextField( xAnchor, aPresentation, pData ) ); rAny <<= xField; @@ -678,7 +672,7 @@ void SvxUnoTextRangeBase::getPropertyValue( const SfxItemPropertyMapEntry* pMap, case WID_PARASTYLENAME: { - rAny <<= GetEditSource()->GetTextForwarder()->GetStyleSheet(maSelection.nStartPara); + rAny <<= GetEditSource()->GetTextForwarder()->GetStyleSheet(maSelection.start.nPara); } break; @@ -720,7 +714,7 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet const & rSet, cons SvxTextForwarder* pForwarder = pEditSource? pEditSource->GetTextForwarder() : nullptr; if(pForwarder && pSelection) { - sal_Int16 nLevel = pForwarder->GetDepth( pSelection->nStartPara ); + sal_Int16 nLevel = pForwarder->GetDepth(pSelection->start.nPara); if( nLevel >= 0 ) aAny <<= nLevel; } @@ -730,14 +724,14 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet const & rSet, cons { SvxTextForwarder* pForwarder = pEditSource? pEditSource->GetTextForwarder() : nullptr; if(pForwarder && pSelection) - aAny <<= pForwarder->GetNumberingStartValue( pSelection->nStartPara ); + aAny <<= pForwarder->GetNumberingStartValue(pSelection->start.nPara); } break; case WID_PARAISNUMBERINGRESTART: { SvxTextForwarder* pForwarder = pEditSource? pEditSource->GetTextForwarder() : nullptr; if(pForwarder && pSelection) - aAny <<= pForwarder->IsParaIsNumberingRestart( pSelection->nStartPara ); + aAny <<= pForwarder->IsParaIsNumberingRestart(pSelection->start.nPara); } break; @@ -799,8 +793,8 @@ void SvxUnoTextRangeBase::_setPropertyValues( const uno::Sequence< OUString >& a if( nTempPara == -1 ) { - nTempPara = aSel.nStartPara; - nEndPara = aSel.nEndPara; + nTempPara = aSel.start.nPara; + nEndPara = aSel.end.nPara; } std::optional<SfxItemSet> pOldAttrSet; @@ -1287,11 +1281,11 @@ void SvxUnoTextRangeBase::_setPropertyToDefault(SvxTextForwarder* pForwarder, co } else if( pMap->nWID == WID_NUMBERINGSTARTVALUE ) { - pForwarder->SetNumberingStartValue( maSelection.nStartPara, -1 ); + pForwarder->SetNumberingStartValue(maSelection.start.nPara, -1); } else if( pMap->nWID == WID_PARAISNUMBERINGRESTART ) { - pForwarder->SetParaIsNumberingRestart( maSelection.nStartPara, false ); + pForwarder->SetParaIsNumberingRestart(maSelection.start.nPara, false); } else { @@ -1397,24 +1391,21 @@ void SvxUnoTextRangeBase::CollapseToStart() noexcept { CheckSelection( maSelection, mpEditSource.get() ); - maSelection.nEndPara = maSelection.nStartPara; - maSelection.nEndPos = maSelection.nStartPos; + maSelection.CollapseToStart(); } void SvxUnoTextRangeBase::CollapseToEnd() noexcept { CheckSelection( maSelection, mpEditSource.get() ); - maSelection.nStartPara = maSelection.nEndPara; - maSelection.nStartPos = maSelection.nEndPos; + maSelection.CollapseToEnd(); } bool SvxUnoTextRangeBase::IsCollapsed() noexcept { CheckSelection( maSelection, mpEditSource.get() ); - return ( maSelection.nStartPara == maSelection.nEndPara && - maSelection.nStartPos == maSelection.nEndPos ); + return !maSelection.HasRange(); } bool SvxUnoTextRangeBase::GoLeft(sal_Int32 nCount, bool Expand) noexcept @@ -1422,8 +1413,8 @@ bool SvxUnoTextRangeBase::GoLeft(sal_Int32 nCount, bool Expand) noexcept CheckSelection( maSelection, mpEditSource.get() ); // #75098# use end position, as in Writer (start is anchor, end is cursor) - sal_Int32 nNewPos = maSelection.nEndPos; - sal_Int32 nNewPar = maSelection.nEndPara; + sal_Int32 nNewPos = maSelection.end.nIndex; + sal_Int32 nNewPar = maSelection.end.nPara; bool bOk = true; SvxTextForwarder* pForwarder = nullptr; @@ -1445,8 +1436,8 @@ bool SvxUnoTextRangeBase::GoLeft(sal_Int32 nCount, bool Expand) noexcept if ( bOk ) { nNewPos = nNewPos - nCount; - maSelection.nStartPara = nNewPar; - maSelection.nStartPos = nNewPos; + maSelection.start.nPara = nNewPar; + maSelection.start.nIndex = nNewPos; } if (!Expand) @@ -1465,8 +1456,8 @@ bool SvxUnoTextRangeBase::GoRight(sal_Int32 nCount, bool Expand) noexcept CheckSelection( maSelection, pForwarder ); - sal_Int32 nNewPos = maSelection.nEndPos + nCount; - sal_Int32 nNewPar = maSelection.nEndPara; + sal_Int32 nNewPos = maSelection.end.nIndex + nCount; + sal_Int32 nNewPar = maSelection.end.nPara; bool bOk = true; sal_Int32 nParCount = pForwarder->GetParagraphCount(); @@ -1485,8 +1476,8 @@ bool SvxUnoTextRangeBase::GoRight(sal_Int32 nCount, bool Expand) noexcept if (bOk) { - maSelection.nEndPara = nNewPar; - maSelection.nEndPos = nNewPos; + maSelection.end.nPara = nNewPar; + maSelection.end.nIndex = nNewPos; } if (!Expand) @@ -1497,8 +1488,8 @@ bool SvxUnoTextRangeBase::GoRight(sal_Int32 nCount, bool Expand) noexcept void SvxUnoTextRangeBase::GotoStart(bool Expand) noexcept { - maSelection.nStartPara = 0; - maSelection.nStartPos = 0; + maSelection.start.nPara = 0; + maSelection.start.nIndex = 0; if (!Expand) CollapseToStart(); @@ -1516,8 +1507,8 @@ void SvxUnoTextRangeBase::GotoEnd(bool Expand) noexcept if (nPar) --nPar; - maSelection.nEndPara = nPar; - maSelection.nEndPos = pForwarder->GetTextLen( nPar ); + maSelection.end.nPara = nPar; + maSelection.end.nIndex = pForwarder->GetTextLen(nPar); if (!Expand) CollapseToEnd(); @@ -1553,17 +1544,7 @@ sal_Int16 SAL_CALL SvxUnoTextRangeBase::compareRegionStarts( const uno::Referenc const ESelection& r1 = pR1->maSelection; const ESelection& r2 = pR2->maSelection; - if( r1.nStartPara == r2.nStartPara ) - { - if( r1.nStartPos == r2.nStartPos ) - return 0; - else - return r1.nStartPos < r2.nStartPos ? 1 : -1; - } - else - { - return r1.nStartPara < r2.nStartPara ? 1 : -1; - } + return r1.start == r2.start ? 0 : r1.start < r2.start ? 1 : -1; } sal_Int16 SAL_CALL SvxUnoTextRangeBase::compareRegionEnds( const uno::Reference< text::XTextRange >& xR1, const uno::Reference< text::XTextRange >& xR2 ) @@ -1577,17 +1558,7 @@ sal_Int16 SAL_CALL SvxUnoTextRangeBase::compareRegionEnds( const uno::Reference< const ESelection& r1 = pR1->maSelection; const ESelection& r2 = pR2->maSelection; - if( r1.nEndPara == r2.nEndPara ) - { - if( r1.nEndPos == r2.nEndPos ) - return 0; - else - return r1.nEndPos < r2.nEndPos ? 1 : -1; - } - else - { - return r1.nEndPara < r2.nEndPara ? 1 : -1; - } + return r1.end == r2.end ? 0 : r1.end < r2.end ? 1 : -1; } SvxUnoTextRange::SvxUnoTextRange(const SvxUnoTextBase& rParent, bool bPortion /* = false */) @@ -1850,21 +1821,19 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< text { pForwarder->QuickInsertText( u""_ustr, aRange ); - aRange.nEndPos = aRange.nStartPos; - aRange.nEndPara = aRange.nStartPara; + aRange.CollapseToStart(); } else { - aRange.nStartPara = aRange.nEndPara; - aRange.nStartPos = aRange.nEndPos; + aRange.CollapseToEnd(); } pForwarder->QuickInsertLineBreak( aRange ); GetEditSource()->UpdateData(); - aRange.nEndPos += 1; + aRange.end.nIndex += 1; if( !bAbsorb ) - aRange.nStartPos += 1; + aRange.start.nIndex += 1; pRange->SetSelection( aRange ); } @@ -1878,19 +1847,18 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< text ESelection aRange = pRange->GetSelection(); // ESelection aOldSelection = aRange; - aRange.nStartPos = pForwarder->GetTextLen( aRange.nStartPara ); + aRange.start.nIndex = pForwarder->GetTextLen( aRange.start.nPara ); - aRange.nEndPara = aRange.nStartPara; - aRange.nEndPos = aRange.nStartPos; + aRange.CollapseToStart(); pRange->SetSelection( aRange ); static constexpr OUStringLiteral CR = u"\x0D"; pRange->setString( CR ); - aRange.nStartPos = 0; - aRange.nStartPara += 1; - aRange.nEndPos = 0; - aRange.nEndPara += 1; + aRange.start.nIndex = 0; + aRange.start.nPara += 1; + aRange.end.nIndex = 0; + aRange.end.nPara += 1; pRange->SetSelection( aRange ); @@ -1989,7 +1957,7 @@ uno::Reference< container::XEnumeration > SAL_CALL SvxUnoTextBase::createEnumera if (!GetEditSource()) return uno::Reference< container::XEnumeration >(); - if( maSelection == ESelection(0,0,0,0) || maSelection == ESelection(EE_PARA_MAX_COUNT,0,0,0) ) + if (maSelection == ESelection(0, 0, 0, 0) || maSelection == ESelection(EE_PARA_MAX, 0, 0, 0)) { ESelection aSelection; ::GetSelection( aSelection, GetEditSource()->GetTextForwarder() ); @@ -2108,7 +2076,7 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::finishParagraph( // set properties for the previously last paragraph sal_Int32 nPara = nParaCount - 1; - ESelection aSel( nPara, 0, nPara, 0 ); + ESelection aSel(nPara, 0); SfxItemSet aItemSet( *pTextForwarder->GetEmptyItemSetPtr() ); SvxPropertyValuesToItemSet( aItemSet, rCharAndParaProps, ImplGetSvxUnoOutlinerTextCursorSfxPropertySet(), pTextForwarder, nPara ); @@ -2151,7 +2119,7 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::insertTextPortion( SfxItemSet aItemSet( *pTextForwarder->GetEmptyItemSetPtr() ); SvxPropertyValuesToItemSet( aItemSet, rCharAndParaProps, - ImplGetSvxTextPortionSfxPropertySet(), pTextForwarder, aSelection.nStartPara ); + ImplGetSvxTextPortionSfxPropertySet(), pTextForwarder, aSelection.start.nPara ); pTextForwarder->QuickSetAttribs( aItemSet, aSelection); rtl::Reference<SvxUnoTextRange> pNewRange = new SvxUnoTextRange( *this ); xRet = pNewRange; diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index d56981cc5ece..520aa65c74bf 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -51,18 +51,18 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase return; const SvxTextForwarder* pTextForwarder = rText.GetEditSource()->GetTextForwarder(); - const sal_Int32 maxParaIndex = std::min( rSel.nEndPara + 1, pTextForwarder->GetParagraphCount() ); + const sal_Int32 maxParaIndex = std::min( rSel.end.nPara + 1, pTextForwarder->GetParagraphCount() ); - for( sal_Int32 currentPara = rSel.nStartPara; currentPara < maxParaIndex; currentPara++ ) + for (sal_Int32 currentPara = rSel.start.nPara; currentPara < maxParaIndex; currentPara++) { const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() ); rtl::Reference<SvxUnoTextContent> pContent; sal_Int32 nStartPos = 0; sal_Int32 nEndPos = pTextForwarder->GetTextLen( currentPara ); - if( currentPara == rSel.nStartPara ) - nStartPos = std::max(nStartPos, rSel.nStartPos); - if( currentPara == rSel.nEndPara ) - nEndPos = std::min(nEndPos, rSel.nEndPos); + if (currentPara == rSel.start.nPara) + nStartPos = std::max(nStartPos, rSel.start.nIndex); + if (currentPara == rSel.end.nPara) + nEndPos = std::min(nEndPos, rSel.end.nIndex); ESelection aCurrentParaSel( currentPara, nStartPos, currentPara, nEndPos ); for (auto const& elemRange : rRanges) { @@ -374,24 +374,24 @@ SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rPa if (rParentText.GetEditSource()) mpEditSource = rParentText.GetEditSource()->Clone(); - if( !(mpEditSource && mpEditSource->GetTextForwarder() && (nParagraph == rSel.nStartPara && nParagraph == rSel.nEndPara)) ) + if( !(mpEditSource && mpEditSource->GetTextForwarder() && (nParagraph == rSel.start.nPara && nParagraph == rSel.end.nPara)) ) return; std::vector<sal_Int32> aPortions; mpEditSource->GetTextForwarder()->GetPortions( nParagraph, aPortions ); for( size_t aPortionIndex = 0; aPortionIndex < aPortions.size(); aPortionIndex++ ) { - sal_uInt16 nStartPos = 0; + sal_Int32 nStartPos = 0; if ( aPortionIndex > 0 ) nStartPos = aPortions.at( aPortionIndex - 1 ); - if( nStartPos > rSel.nEndPos ) + if (nStartPos > rSel.end.nIndex) continue; - sal_uInt16 nEndPos = aPortions.at( aPortionIndex ); - if( nEndPos < rSel.nStartPos ) + sal_Int32 nEndPos = aPortions.at(aPortionIndex); + if (nEndPos < rSel.start.nIndex) continue; - nStartPos = std::max<int>(nStartPos, rSel.nStartPos); - nEndPos = std::min<sal_uInt16>(nEndPos, rSel.nEndPos); + nStartPos = std::max(nStartPos, rSel.start.nIndex); + nEndPos = std::min(nEndPos, rSel.end.nIndex); ESelection aSel( nParagraph, nStartPos, nParagraph, nEndPos ); const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() ); @@ -572,8 +572,7 @@ void SAL_CALL SvxUnoTextCursor::gotoRange( const uno::Reference< text::XTextRang if( bExpand ) { const ESelection& rOldSel = GetSelection(); - aNewSel.nStartPara = rOldSel.nStartPara; - aNewSel.nStartPos = rOldSel.nStartPos; + aNewSel.start = rOldSel.start; } SetSelection( aNewSel ); diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx index d3626e7de8e3..b1da4e460987 100644 --- a/editeng/source/xml/xmltxtimp.cxx +++ b/editeng/source/xml/xmltxtimp.cxx @@ -153,7 +153,7 @@ EditPaM SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection // Init return PaM. EditPaM aPaM( rEditEngine.CreateSelection( rSel ).Max()); - ESelection aSel(rSel.nStartPara+1, 0, rSel.nEndPara+1, 0); + ESelection aSel(rSel.start.nPara + 1, 0, rSel.end.nPara + 1, 0); uno::Reference<text::XText > xParent; rtl::Reference<SvxUnoText> pUnoText = new SvxUnoText( &aEditSource, &aSvxXMLTextImportComponentPropertySet, xParent ); pUnoText->SetSelection( aSel ); @@ -210,16 +210,16 @@ EditPaM SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection //remove the extra para breaks EditDoc& pDoc = rEditEngine.GetEditDoc(); - rEditEngine.ParaAttribsToCharAttribs( pDoc.GetObject( rSel.nEndPara ) ); - rEditEngine.ConnectParagraphs( pDoc.GetObject( rSel.nEndPara ), - pDoc.GetObject( rSel.nEndPara + 1 ), true ); - rEditEngine.ParaAttribsToCharAttribs( pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara - 2 ) ); - rEditEngine.ConnectParagraphs( pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara - 2 ), - pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara -1 ), true ); + rEditEngine.ParaAttribsToCharAttribs(pDoc.GetObject(rSel.end.nPara)); + rEditEngine.ConnectParagraphs(pDoc.GetObject(rSel.end.nPara), + pDoc.GetObject(rSel.end.nPara + 1), true); + rEditEngine.ParaAttribsToCharAttribs( pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.end.nPara - 2 ) ); + rEditEngine.ConnectParagraphs( pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.end.nPara - 2 ), + pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.end.nPara -1 ), true ); // The final join is to be returned. - aPaM = rEditEngine.ConnectParagraphs( pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara - 2 ), - pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara -1 ), true ); + aPaM = rEditEngine.ConnectParagraphs( pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.end.nPara - 2 ), + pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.end.nPara -1 ), true ); } catch( const uno::Exception& ) { diff --git a/external/libcmis/0001-Fix-boost-1.86-breakage.patch b/external/libcmis/0001-Fix-boost-1.86-breakage.patch new file mode 100644 index 000000000000..ef398dfcc98b --- /dev/null +++ b/external/libcmis/0001-Fix-boost-1.86-breakage.patch @@ -0,0 +1,47 @@ +From dfcb642a491f7ec2ae52e3e83d31bb6cdf3670c2 Mon Sep 17 00:00:00 2001 +From: David Seifert <soap@gentoo.org> +Date: Sat, 31 Aug 2024 12:39:39 +0200 +Subject: [PATCH] Fix boost 1.86 breakage + +The fix does not break building against <1.86 since we're now accessing the +object representation of the return value. + +Fixes #67 +--- + src/libcmis/xml-utils.cxx | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/src/libcmis/xml-utils.cxx b/src/libcmis/xml-utils.cxx +index e487d17..cdf088f 100644 +--- a/src/libcmis/xml-utils.cxx ++++ b/src/libcmis/xml-utils.cxx +@@ -531,16 +531,22 @@ namespace libcmis + boost::uuids::detail::sha1 sha1; + sha1.process_bytes( str.c_str(), str.size() ); + +- unsigned int digest[5]; ++ // on boost < 1.86.0, digest_type is typedef'd as unsigned int[5] ++ // on boost >= 1.86.0, digest_type is typedef'd as unsigned char[20] ++ boost::uuids::detail::sha1::digest_type digest; + sha1.get_digest( digest ); + ++ // by using a pointer to unsigned char, we can read the ++ // object representation of either typedef. ++ const unsigned char* ptr = reinterpret_cast<const unsigned char*>( digest ); ++ + stringstream out; +- // Setup writing mode. Every number must produce eight ++ // Setup writing mode. Every number must produce two + // hexadecimal digits, including possible leading 0s, or we get + // less than 40 digits as result. + out << hex << setfill('0') << right; +- for ( int i = 0; i < 5; ++i ) +- out << setw(8) << digest[i]; ++ for ( int i = 0; i < sizeof( digest ); ++ptr, ++i ) ++ out << setw(2) << static_cast<int>( *ptr ); + return out.str(); + } + +-- +2.45.1 + diff --git a/external/libcmis/UnpackedTarball_libcmis.mk b/external/libcmis/UnpackedTarball_libcmis.mk index d0b8e2b5c7bc..e47c7f81ef63 100644 --- a/external/libcmis/UnpackedTarball_libcmis.mk +++ b/external/libcmis/UnpackedTarball_libcmis.mk @@ -25,6 +25,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libcmis,\ external/libcmis/0001-cppcheck-operatorEqVarError-in-src-libcmis-http-sess.patch \ external/libcmis/0001-Take-into-account-m_CurlInitProtocolsFunction-in-cop.patch \ external/libcmis/initprotocols.patch.1 \ + external/libcmis/0001-Fix-boost-1.86-breakage.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 4089fcfba91d..a7f3e1f8a91c 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -3753,7 +3753,7 @@ void SvxMSDffManager::ReadObjText( const OUString& rText, SdrObject* pObj ) else ++nParaSize; } - ESelection aSelection( nParaIndex, 0, nParaIndex, 0 ); + ESelection aSelection(nParaIndex, 0); OUString aParagraph( pCurrent, nParaSize ); if ( !nParaIndex && aParagraph.isEmpty() ) // SJ: we are crashing if the first paragraph is empty ? aParagraph += " "; // otherwise these two lines can be removed. @@ -3761,9 +3761,9 @@ void SvxMSDffManager::ReadObjText( const OUString& rText, SdrObject* pObj ) rOutliner.SetParaAttribs( nParaIndex, rOutliner.GetEmptyItemSet() ); SfxItemSet aParagraphAttribs( rOutliner.GetEmptyItemSet() ); - if ( !aSelection.nStartPos ) + if (!aSelection.start.nIndex) aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, false ) ); - aSelection.nStartPos = 0; + aSelection.start.nIndex = 0; rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection ); nParaIndex++; } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index b4b1f6f76d28..9d92b15ea6b8 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -2290,7 +2290,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* sal_Int32 nParaIndex = pTextObj->GetCurrentIndex(); SfxStyleSheet* pS = ppStyleSheetAry ? ppStyleSheetAry[ pPara->mxParaSet->mnDepth ] : pSheet; - ESelection aSelection( nParaIndex, 0, nParaIndex, 0 ); + ESelection aSelection(nParaIndex, 0); rOutliner.Insert( OUString(), nParaIndex, pPara->mxParaSet->mnDepth ); rOutliner.QuickInsertText( OUString(pParaText.get(), nCurrentIndex), aSelection ); rOutliner.SetParaAttribs( nParaIndex, rOutliner.GetEmptyItemSet() ); @@ -2303,8 +2303,8 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* std::unique_ptr<SvxFieldItem> pFieldItem(pPortion->GetTextField()); if ( pFieldItem ) { - rOutliner.QuickInsertField( *pFieldItem, ESelection( nParaIndex, aSelection.nEndPos, nParaIndex, aSelection.nEndPos + 1 ) ); - aSelection.nEndPos++; + rOutliner.QuickInsertField( *pFieldItem, ESelection( nParaIndex, aSelection.end.nIndex, nParaIndex, aSelection.end.nIndex + 1 ) ); + aSelection.end.nIndex++; } else { @@ -2317,22 +2317,19 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* { nLen = pPtr - pF; if ( nLen ) - aSelection.nEndPos = - sal::static_int_cast< sal_uInt16 >( - aSelection.nEndPos + nLen ); + aSelection.end.nIndex += nLen; pF = pPtr + 1; - rOutliner.QuickInsertLineBreak( ESelection( nParaIndex, aSelection.nEndPos, nParaIndex, aSelection.nEndPos + 1 ) ); - aSelection.nEndPos++; + rOutliner.QuickInsertLineBreak( ESelection( nParaIndex, aSelection.end.nIndex, nParaIndex, aSelection.end.nIndex + 1 ) ); + aSelection.end.nIndex++; } } nLen = pPtr - pF; if ( nLen ) - aSelection.nEndPos = sal::static_int_cast< sal_uInt16 >( - aSelection.nEndPos + nLen ); + aSelection.end.nIndex += nLen; } pPortion->ApplyTo( aPortionAttribs, const_cast<SdrPowerPointImport&>(*this), nDestinationInstance, pTextObj ); rOutliner.QuickSetAttribs( aPortionAttribs, aSelection ); - aSelection.nStartPos = aSelection.nEndPos; + aSelection.start.nIndex = aSelection.end.nIndex; } std::optional< sal_Int16 > oStartNumbering; SfxItemSet aParagraphAttribs( rOutliner.GetEmptyItemSet() ); @@ -2345,11 +2342,11 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* else aParagraphAttribs.Put( SfxInt16Item(EE_PARA_OUTLLEVEL, pPara->mxParaSet->mnDepth)); - if ( !aSelection.nStartPos ) // in PPT empty paragraphs never gets a bullet + if (!aSelection.start.nIndex) // in PPT empty paragraphs never gets a bullet { aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, false ) ); } - aSelection.nStartPos = 0; + aSelection.start.nIndex = 0; rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection ); } } diff --git a/forms/source/richtext/specialdispatchers.cxx b/forms/source/richtext/specialdispatchers.cxx index b13d29aeeb98..d1f99d857259 100644 --- a/forms/source/richtext/specialdispatchers.cxx +++ b/forms/source/richtext/specialdispatchers.cxx @@ -63,12 +63,9 @@ namespace frm if ( !pEngine ) return; - sal_Int32 nParagraphs = pEngine->GetParagraphCount(); - if ( nParagraphs ) + if (pEngine->GetParagraphCount()) { - sal_Int32 nLastParaNumber = nParagraphs - 1; - sal_Int32 nParaLen = pEngine->GetTextLen( nLastParaNumber ); - getEditView()->SetSelection( ESelection( 0, 0, nLastParaNumber, nParaLen ) ); + getEditView()->SetSelection(ESelection::All()); } } diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 299b0fcd5ba4..f95dd85c32c9 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -159,7 +159,6 @@ css::uno::Reference< css::lang::XComponent > LoadEnv::loadComponentFromURL(const try { LoadEnv aEnv(xContext); - LoadEnvFeatures loadEnvFeatures = LoadEnvFeatures::WorkWithUI; // tdf#118238 Only disable UI interaction when loading as hidden if (comphelper::NamedValueCollection::get(lArgs, u"Hidden") == uno::Any(true) || Application::IsHeadlessModeEnabled()) @@ -1103,8 +1102,9 @@ bool LoadEnv::impl_loadContent() bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN, false); bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED, false); bool bPreview = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW, false); + bool bStartPres = m_lMediaDescriptor.contains("StartPresentation"); - if (!bHidden && !bMinimized && !bPreview) + if (!bHidden && !bMinimized && !bPreview && !bStartPres) { css::uno::Reference<css::task::XStatusIndicator> xProgress = m_lMediaDescriptor.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_STATUSINDICATOR, css::uno::Reference<css::task::XStatusIndicator>()); @@ -1596,6 +1596,8 @@ void LoadEnv::impl_reactForLoadingState() css::uno::Reference< css::awt::XWindow > xWindow = m_xTargetFrame->getContainerWindow(); bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN, false); bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED, false); + bool bStartPres = m_lMediaDescriptor.contains("StartPresentation"); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xWindow); if (bMinimized) @@ -1605,7 +1607,7 @@ void LoadEnv::impl_reactForLoadingState() if (pWindow && pWindow->IsSystemWindow()) static_cast<WorkWindow*>(pWindow.get())->Minimize(); } - else if (!bHidden) + else if (!bHidden && !bStartPres) { // show frame ... if it's not still visible ... // But do nothing if it's already visible! diff --git a/helpcontent2 b/helpcontent2 -Subproject 9c8a5225e1ee20c585378aab90462b8a5029c62 +Subproject 8a580a454831fe4662b9e0bac5bbd16dd889328 diff --git a/include/comphelper/errcode.hxx b/include/comphelper/errcode.hxx index 547be70a13dd..884a7785f300 100644 --- a/include/comphelper/errcode.hxx +++ b/include/comphelper/errcode.hxx @@ -137,8 +137,8 @@ public: } /// Return a string suitable for debug output, the same as the operator<< function - UNLESS_MERGELIBS(COMPHELPER_DLLPUBLIC) OUString toString() const; - + COMPHELPER_DLLPUBLIC OUString toString() const; + template <typename... Args> bool anyOf(Args... args) const { static_assert(sizeof...(args) > 0); diff --git a/include/editeng/EPaM.hxx b/include/editeng/EPaM.hxx index d474dfe18235..653adeafa6f9 100644 --- a/include/editeng/EPaM.hxx +++ b/include/editeng/EPaM.hxx @@ -19,25 +19,29 @@ #pragma once +#include <sal/config.h> + +#include <sal/types.h> + +inline constexpr sal_Int32 EE_PARA_MAX = SAL_MAX_INT32; +inline constexpr sal_Int32 EE_TEXTPOS_MAX = SAL_MAX_INT32; + struct EPaM { + static constexpr EPaM NotFound() { return { EE_PARA_MAX, EE_TEXTPOS_MAX }; } + sal_Int32 nPara = 0; sal_Int32 nIndex = 0; - EPaM() = default; + constexpr EPaM() = default; - EPaM(sal_Int32 _nParagraph, sal_Int32 _nIndex) + constexpr EPaM(sal_Int32 _nParagraph, sal_Int32 _nIndex) : nPara(_nParagraph) , nIndex(_nIndex) { } - bool operator==(const EPaM& rInstance) const - { - return nPara == rInstance.nPara && nIndex == rInstance.nIndex; - } - - bool operator!=(const EPaM& rSelection) const = default; + bool operator==(const EPaM&) const = default; bool operator<(const EPaM& rInstance) const { diff --git a/include/editeng/EPosition.hxx b/include/editeng/EPosition.hxx deleted file mode 100644 index ca6a3e13bee0..000000000000 --- a/include/editeng/EPosition.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#pragma once - -#define EE_INDEX_NOT_FOUND SAL_MAX_INT32 -#define EE_PARA_NOT_FOUND SAL_MAX_INT32 - -struct EPosition -{ - sal_Int32 nPara; - sal_Int32 nIndex; - - EPosition() - : nPara(EE_PARA_NOT_FOUND) - , nIndex(EE_INDEX_NOT_FOUND) - { - } - - EPosition(sal_Int32 nPara_, sal_Int32 nPos_) - : nPara(nPara_) - , nIndex(nPos_) - { - } -}; - -template <typename charT, typename traits> -inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& stream, - EPosition const& pos) -{ - return stream << "EPosition(" << pos.nPara << ',' << pos.nIndex << ")"; -} -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/ESelection.hxx b/include/editeng/ESelection.hxx index 7f5aa8e81cf6..c93b6df800e5 100644 --- a/include/editeng/ESelection.hxx +++ b/include/editeng/ESelection.hxx @@ -19,80 +19,74 @@ #pragma once +#include <sal/config.h> + +#include <editeng/EPaM.hxx> + +#include <cassert> +#include <utility> + struct ESelection { - sal_Int32 nStartPara = 0; - sal_Int32 nStartPos = 0; - sal_Int32 nEndPara = 0; - sal_Int32 nEndPos = 0; - - ESelection() = default; - - ESelection(sal_Int32 _nStartPara, sal_Int32 _nStartPos, sal_Int32 _nEndPara, sal_Int32 _nEndPos) - : nStartPara(_nStartPara) - , nStartPos(_nStartPos) - , nEndPara(_nEndPara) - , nEndPos(_nEndPos) - { - } + // Select all text + static constexpr ESelection All() { return { 0, 0, EE_PARA_MAX, EE_TEXTPOS_MAX }; } - ESelection(sal_Int32 nPara, sal_Int32 nPos) - : nStartPara(nPara) - , nStartPos(nPos) - , nEndPara(nPara) - , nEndPos(nPos) + // Set to end without selection + static constexpr ESelection AtEnd() { return { EE_PARA_MAX, EE_TEXTPOS_MAX }; } + + EPaM start; + EPaM end; + + constexpr ESelection() = default; + + constexpr ESelection(sal_Int32 _nStartPara, sal_Int32 _nStartPos, sal_Int32 _nEndPara, + sal_Int32 _nEndPos) + : start(_nStartPara, _nStartPos) + , end(_nEndPara, _nEndPos) { } - void Adjust() + constexpr ESelection(sal_Int32 nPara, sal_Int32 nPos) + : ESelection(nPara, nPos, nPara, nPos) { - if (nStartPara > nEndPara || (nStartPara == nEndPara && nStartPos > nEndPos)) - { - std::swap(nStartPara, nEndPara); - std::swap(nStartPos, nEndPos); - } } - bool operator==(const ESelection& rSelection) const + constexpr explicit ESelection(const EPaM& rPos) + : ESelection(rPos.nPara, rPos.nIndex) { - return nStartPara == rSelection.nStartPara && nStartPos == rSelection.nStartPos - && nEndPara == rSelection.nEndPara && nEndPos == rSelection.nEndPos; } - bool operator!=(const ESelection& rSelection) const = default; + bool IsAdjusted() const { return !(end < start); } - bool operator<(const ESelection& rSelection) const + void Adjust() { - // The selection must be adjusted. - // => Only check if end of 'this' < Start of rS - return nEndPara < rSelection.nStartPara - || (nEndPara == rSelection.nStartPara && nEndPos < rSelection.nStartPos - && operator!=(rSelection)); + if (!IsAdjusted()) + std::swap(start, end); } - bool operator>(const ESelection& rSelection) const + void CollapseToStart() { end = start; } + void CollapseToEnd() { start = end; } + + bool operator==(const ESelection&) const = default; + + bool operator<(const ESelection& rSelection) const { // The selection must be adjusted. + assert(IsAdjusted() && rSelection.IsAdjusted()); // => Only check if end of 'this' < Start of rS - return nStartPara > rSelection.nEndPara - || (nStartPara == rSelection.nEndPara && nStartPos > rSelection.nEndPos - && operator!=(rSelection)); - } - - bool IsZero() const - { - return nStartPara == 0 && nStartPos == 0 && nEndPara == 0 && nEndPos == 0; + return end < rSelection.start; } + bool operator>(const ESelection& rSelection) const { return rSelection < *this; } - bool HasRange() const { return nStartPara != nEndPara || nStartPos != nEndPos; } + bool HasRange() const { return start != end; } }; template <typename charT, typename traits> inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& stream, ESelection const& rSelection) { - return stream << "ESelection(" << rSelection.nStartPara << ',' << rSelection.nStartPos << "," - << rSelection.nEndPara << "," << rSelection.nEndPos << ")"; + return stream << "ESelection(" << rSelection.start.nPara << ',' << rSelection.start.nIndex + << "," << rSelection.end.nPara << "," << rSelection.end.nIndex << ")"; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx index 799b29bf5acb..065751759d24 100644 --- a/include/editeng/editdata.hxx +++ b/include/editeng/editdata.hxx @@ -25,7 +25,6 @@ #include <editeng/editengdllapi.h> #include <i18nlangtag/lang.h> #include <editeng/ESelection.hxx> -#include <editeng/EPosition.hxx> #include <memory> #include <ostream> @@ -89,7 +88,7 @@ struct EDITENG_DLLPUBLIC EFieldInfo { std::unique_ptr<SvxFieldItem> pFieldItem; OUString aCurrentText; - EPosition aPosition; + EPaM aPosition = EPaM::NotFound(); EFieldInfo(); EFieldInfo( const SvxFieldItem& rFieldItem, sal_Int32 nPara, sal_Int32 nPos ); @@ -235,13 +234,12 @@ struct EENotify { EENotifyType eNotificationType; - sal_Int32 nParagraph; // only valid in PARAGRAPHINSERTED/EE_NOTIFY_PARAGRAPHREMOVED + sal_Int32 nParagraph = EE_PARA_MAX; // only valid in PARAGRAPHINSERTED/EE_NOTIFY_PARAGRAPHREMOVED - sal_Int32 nParam1; - sal_Int32 nParam2; + sal_Int32 nParam1 = 0; + sal_Int32 nParam2 = 0; - EENotify( EENotifyType eType ) - { eNotificationType = eType; nParagraph = EE_PARA_NOT_FOUND; nParam1 = 0; nParam2 = 0; } + EENotify(EENotifyType eType) { eNotificationType = eType; } }; namespace editeng diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 02f0e78f2359..a1c3024bb3a7 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -295,14 +295,14 @@ public: sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const; void GetLineBoundaries( /*out*/sal_Int32& rStart, /*out*/sal_Int32& rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const; sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const; - SAL_DLLPRIVATE sal_uInt32 GetLineHeight( sal_Int32 nParagraph ); + SAL_DLLPRIVATE sal_uInt32 GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine = 0 ); SAL_DLLPRIVATE tools::Rectangle GetParaBounds( sal_Int32 nPara ); SAL_DLLPRIVATE ParagraphInfos GetParagraphInfos( sal_Int32 nPara ); SAL_DLLPRIVATE sal_Int32 FindParagraph( tools::Long nDocPosY ); - EPosition FindDocPosition( const Point& rDocPos ) const; - tools::Rectangle GetCharacterBounds( const EPosition& rPos ) const; + EPaM FindDocPosition( const Point& rDocPos ) const; + tools::Rectangle GetCharacterBounds( const EPaM& rPos ) const; - OUString GetWord(sal_Int32 nPara, sal_Int32 nIndex); + OUString GetWord(const EPaM& rPos); ESelection GetWord( const ESelection& rSelection, sal_uInt16 nWordType ) const; @@ -594,6 +594,8 @@ public: SAL_DLLPRIVATE ESelection CreateESelection(const EditSelection& rSel) const; SAL_DLLPRIVATE EditSelection CreateSelection(const ESelection& rSel); + ESelection NormalizeESelection(const ESelection& rSel) const; + EPaM GetEnd() const; SAL_DLLPRIVATE const SfxItemSet& GetBaseParaAttribs(sal_Int32 nPara) const; SAL_DLLPRIVATE void SetParaAttribsOnly(sal_Int32 nPara, const SfxItemSet& rSet); diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index cd3acaf9452d..5f326c801ad5 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -559,7 +559,7 @@ public: sal_uInt16 nType; // see SvxNumberType bool bVisible; - EBulletInfo() : nParagraph( EE_PARA_NOT_FOUND ), nType( 0 ), bVisible( false ) {} + EBulletInfo() : nParagraph( EE_PARA_MAX ), nType( 0 ), bVisible( false ) {} }; enum class OutlinerMode { @@ -698,7 +698,7 @@ public: OutlinerView* GetView( size_t nIndex ) const; size_t GetViewCount() const; - Paragraph* Insert( const OUString& rText, sal_Int32 nAbsPos = EE_PARA_APPEND, sal_Int16 nDepth = 0 ); + Paragraph* Insert( const OUString& rText, sal_Int32 nAbsPos = EE_PARA_MAX, sal_Int16 nDepth = 0 ); void SetText( const OutlinerParaObject& ); void AddText( const OutlinerParaObject&, bool bAppend = false ); void SetText( const OUString& rText, Paragraph* pParagraph ); @@ -706,7 +706,7 @@ public: void SetToEmptyText(); - std::optional<OutlinerParaObject> CreateParaObject( sal_Int32 nStartPara = 0, sal_Int32 nParaCount = EE_PARA_ALL ) const; + std::optional<OutlinerParaObject> CreateParaObject( sal_Int32 nStartPara = 0, sal_Int32 nParaCount = EE_PARA_MAX ) const; const SfxItemSet& GetEmptyItemSet() const; @@ -824,7 +824,7 @@ public: void SetWordDelimiters( const OUString& rDelimiters ); OUString const & GetWordDelimiters() const; - OUString GetWord( sal_Int32 nPara, sal_Int32 nIndex ); + OUString GetWord( const EPaM& rPos ); void StripPortions(); @@ -879,9 +879,9 @@ public: SAL_DLLPRIVATE const Link<Outliner*,void>& GetEndMovingHdl() const {return aEndMovingHdl;} SAL_DLLPRIVATE void SetEndMovingHdl( const Link<Outliner*,void>& rLink){aEndMovingHdl=rLink;} - sal_uInt32 GetLineCount( sal_Int32 nParagraph ) const; + sal_Int32 GetLineCount( sal_Int32 nParagraph ) const; sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const; - sal_uInt32 GetLineHeight( sal_Int32 nParagraph ); + sal_uInt32 GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine = 0 ); ErrCode Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr ); diff --git a/include/o3tl/safeint.hxx b/include/o3tl/safeint.hxx index a32c6beea142..80f8b45c4042 100644 --- a/include/o3tl/safeint.hxx +++ b/include/o3tl/safeint.hxx @@ -231,6 +231,42 @@ template<typename T> [[nodiscard]] inline T sanitizing_min(T a, T b) return std::min(a, b); } +// To sanitize in/de-crementing value where the result is known by the caller to be guaranteed to fit in +// the source type range without over/under-flow +[[nodiscard]] inline unsigned short sanitizing_inc(unsigned short value) +{ + int res = value + 1; + assert(res <= std::numeric_limits<unsigned short>::max() && + "nValue was supposed to be incrementable without overflow"); + return static_cast<unsigned short>(res); +} + +[[nodiscard]] inline unsigned short sanitizing_dec(unsigned short value) +{ + int res = value - 1; + assert(res >= 0 && + "nValue was supposed to be decrementable without underflow"); + return static_cast<unsigned short>(res); +} + +[[nodiscard]] inline short sanitizing_inc(short value) +{ + int res = value + 1; + assert(res >= std::numeric_limits<short>::min() && + res <= std::numeric_limits<short>::max() && + "nValue was supposed to be incrementable without overflow"); + return static_cast<short>(res); +} + +[[nodiscard]] inline short sanitizing_dec(short value) +{ + int res = value - 1; + assert(res >= std::numeric_limits<short>::min() && + res <= std::numeric_limits<short>::max() && + "nValue was supposed to be decrementable without underflow"); + return static_cast<short>(res); +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx index 64259c554caf..6348b539f689 100644 --- a/include/oox/vml/vmlshape.hxx +++ b/include/oox/vml/vmlshape.hxx @@ -145,6 +145,8 @@ public: OUString getGraphicPath() const; const Drawing& getDrawing() const { return mrDrawing; } + void setTextBox(bool bSet) {mbTextBox = bSet;} + bool isTextBox() const {return mbTextBox;} protected: /** Returns the coordinate system of this shape. */ @@ -159,6 +161,7 @@ protected: protected: Drawing& mrDrawing; ///< The VML drawing page that contains this shape. ShapeTypeModel maTypeModel; ///< The model structure containing shape type data. + bool mbTextBox; //will be set if the shape contains a text box }; diff --git a/include/oox/vml/vmlshapecontext.hxx b/include/oox/vml/vmlshapecontext.hxx index 8252e0e6ebe6..6f7a2eff7d5b 100644 --- a/include/oox/vml/vmlshapecontext.hxx +++ b/include/oox/vml/vmlshapecontext.hxx @@ -24,6 +24,7 @@ #include <oox/core/contexthandler2.hxx> #include <rtl/ustring.hxx> #include <sal/types.h> +//#include <oox/dllapi.h> #include <optional> @@ -79,7 +80,7 @@ private: }; -class ShapeContextBase : public ::oox::core::ContextHandler2 +class SAL_DLLPUBLIC_RTTI ShapeContextBase : public ::oox::core::ContextHandler2 { public: static ::oox::core::ContextHandlerRef @@ -94,7 +95,7 @@ protected: }; -class ShapeTypeContext : public ShapeContextBase +class SAL_DLLPUBLIC_RTTI ShapeTypeContext : public ShapeContextBase { public: explicit ShapeTypeContext( @@ -118,7 +119,7 @@ private: }; -class ShapeContext : public ShapeTypeContext +class SAL_DLLPUBLIC_RTTI ShapeContext : public ShapeTypeContext { public: explicit ShapeContext(::oox::core::ContextHandler2Helper const& rParent, @@ -127,6 +128,8 @@ public: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; + void OOX_DLLPUBLIC setWriterShape(); + private: /** Processes the 'points' attribute. */ void setPoints( std::u16string_view rPoints ); diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx index 6a207a573027..828054bc562d 100644 --- a/include/sfx2/tabdlg.hxx +++ b/include/sfx2/tabdlg.hxx @@ -107,6 +107,11 @@ protected: */ bool PrepareLeaveCurrentPage(); + /** Called before user cancels the dialog. + Calls DeactivatePage of all tab pages with IsCancelMode() set to true + */ + void PrepareCancel(); + /** save the position of the TabDialog and which tab page is the currently active one */ void SavePosAndId(); @@ -192,6 +197,7 @@ private: const SfxItemSet* mpSet; OUString maUserString; bool mbHasExchangeSupport; + bool mbCancel; std::unordered_map<OUString, css::uno::Any> maAdditionalProperties; std::unique_ptr<TabPageImpl> mpImpl; @@ -258,6 +264,9 @@ public: } virtual void FillUserData(); virtual bool IsReadOnly() const; + // Whether the user has canceled the dialog. Allows to restore settings, etc. + virtual bool IsCancelMode() { return mbCancel; } + virtual void SetCancelMode(bool bCancel) { mbCancel = bCancel; } virtual void PageCreated (const SfxAllItemSet& aSet); virtual void ChangesApplied(); static const SfxPoolItem* GetItem( const SfxItemSet& rSet, sal_uInt16 nSlot, bool bDeep = true ); diff --git a/include/svtools/DocumentToGraphicRenderer.hxx b/include/svtools/DocumentToGraphicRenderer.hxx index 75af9b048a2c..cdeb0dfb56c7 100644 --- a/include/svtools/DocumentToGraphicRenderer.hxx +++ b/include/svtools/DocumentToGraphicRenderer.hxx @@ -42,7 +42,7 @@ namespace com::sun::star { } } -class UNLESS_MERGELIBS_MORE(SVT_DLLPUBLIC) DocumentToGraphicRenderer +class SVT_DLLPUBLIC DocumentToGraphicRenderer { const css::uno::Reference<css::lang::XComponent>& mxDocument; diff --git a/include/svtools/popupmenucontrollerbase.hxx b/include/svtools/popupmenucontrollerbase.hxx index 8df5041a793d..6c7a48765e95 100644 --- a/include/svtools/popupmenucontrollerbase.hxx +++ b/include/svtools/popupmenucontrollerbase.hxx @@ -33,6 +33,7 @@ #include <comphelper/compbase.hxx> #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <toolkit/awt/vclxmenu.hxx> namespace com :: sun :: star :: frame { class XFrame; } namespace com :: sun :: star :: uno { class XComponentContext; } diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx index 4a25ae970d7e..3f3573466651 100644 --- a/include/svx/svdotable.hxx +++ b/include/svx/svdotable.hxx @@ -284,6 +284,8 @@ private: SVX_DLLPUBLIC void ExportAsRTF( SvStream& rStrm, SdrTableObj& rObj ); SVX_DLLPUBLIC void ImportAsRTF( SvStream& rStrm, SdrTableObj& rObj ); +SVX_DLLPUBLIC void ImportAsHTML( SvStream& rStrm, SdrTableObj& rObj ); + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index aeb99556f097..9ff8a3e67f8b 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -78,6 +78,7 @@ namespace sdr::table { class Cell; class SdrTableRtfExporter; class SdrTableRTFParser; + class SdrTableHTMLParser; } @@ -128,6 +129,7 @@ private: friend class sdr::table::Cell; friend class sdr::table::SdrTableRtfExporter; friend class sdr::table::SdrTableRTFParser; + friend class sdr::table::SdrTableHTMLParser; friend class TextChain; friend class TextChainFlow; friend class EditingTextChainFlow; diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index a1aacf8f0d90..19e4a9d7b989 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -417,6 +417,9 @@ public: bool isUIOptionEnabled( const OUString& rPropName ) const; SAL_DLLPRIVATE bool isUIChoiceEnabled( const OUString& rPropName, sal_Int32 nChoice ) const; + /// Defines which options in a UI element should be disabled or enabled. + void setUIChoicesDisabled(const OUString& rPropName, css::uno::Sequence<sal_Bool>& rChoicesDisabled); + /** MakeEnabled will change the property rPropName depends on to the value that makes rPropName enabled. If the dependency itself is also disabled, diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index f410ce69344a..e3b54f961206 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -1924,6 +1924,7 @@ namespace xmloff::token { XML_SUB_VIEW_SIZE, XML_SUFFIX, XML_SUM, + XML_SUMMARY_BELOW, XML_SWISS, XML_SYMBOL, XML_SYMBOL_HEIGHT, @@ -2090,6 +2091,7 @@ namespace xmloff::token { XML_UPRIGHT, XML_URL, XML_USE, + XML_USE_AUTOFILTER, XML_USE_CAPTION, XML_USE_CELL_PROTECTION, XML_USE_CHART_OBJECTS, @@ -2107,6 +2109,7 @@ namespace xmloff::token { XML_USE_OPTIMAL_COLUMN_WIDTH, XML_USE_OPTIMAL_ROW_HEIGHT, XML_USE_OTHER_OBJECTS, + XML_USE_PIVOT, XML_USE_SPREADSHEET_OBJECTS, XML_USE_STYLES, XML_USE_TABLES, diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index 90fb18c7ba67..b8c95f9d6eec 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -808,7 +808,7 @@ void LwpTableLayout::ParseTable() SAL_WARN("lwp", "truncating HeadingRow for fuzzing performance"); nEndHeadRow = nStartHeadRow + 128; } - nContentRow = ConvertHeadingRow(m_pXFTable,nStartHeadRow,nEndHeadRow+1); + nContentRow = ConvertHeadingRow(m_pXFTable, nStartHeadRow, o3tl::sanitizing_inc(nEndHeadRow)); } } diff --git a/offapi/com/sun/star/sheet/Spreadsheet.idl b/offapi/com/sun/star/sheet/Spreadsheet.idl index d1a1dfcd0f18..605055c7b4ec 100644 --- a/offapi/com/sun/star/sheet/Spreadsheet.idl +++ b/offapi/com/sun/star/sheet/Spreadsheet.idl @@ -169,6 +169,19 @@ service Spreadsheet /** specifies all conditional formats of that sheet */ [optional, property] com::sun::star::sheet::XConditionalFormats ConditionalFormats; + + /** specifies whether summary rows appear below detail in an outline, + when applying an outline. + + <p> When true a summary row is inserted below the detailed data being + summarized and a new outline level is established on that row.</p> + + <p> When false a summary row is inserted above the detailed data being + summarized and a new outline level is established on that row.</p> + + @since LibreOffice 25.2 + */ + [optional, property] boolean TotalsRowBelow; }; diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index 7303d1bacd00..b9f74d9724fa 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -763,6 +763,13 @@ </info> <value>true</value> </prop> + <prop oor:name="SelectRangeBeforeAll" oor:type="xs:boolean" oor:nillable="false"> + <info> + <desc>Disable to always select all</desc> + <label>Select range before all</label> + </info> + <value>true</value> + </prop> </group> <group oor:name="Grid"> <info> diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index 124e0a3dd931..b2d7d503b35b 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -901,6 +901,59 @@ <value>1</value> </prop> </group> + <group oor:name="Zoom"> + <info> + <desc>Contains zoom settings of the document view.</desc> + </info> + <prop oor:name="DefaultZoom" oor:type="xs:boolean" oor:nillable="false"> + <!-- UIHints: Tools - Options - Text document Contents - [Section] ´Zoom--> + <info> + <desc>Determines whether zoom settings previously selected are applied to new/loaded document view or predefined zoom values are applied</desc> + </info> + <value>true</value> + </prop> + <prop oor:name="ZoomType" oor:type="xs:int" oor:nillable="false"> + <!-- UIHints: Tools - Options - Text document Contents - [Section] ´Zoom--> + <info> + <desc>Contains predefined zoom type</desc> + </info> + <constraints> + <enumeration oor:value="0"> + <info> + <desc>PERCENT</desc> + </info> + </enumeration> + <enumeration oor:value="1"> + <info> + <desc>OPTIMAL</desc> + </info> + </enumeration> + <enumeration oor:value="2"> + <info> + <desc>WHOLEPAGE</desc> + </info> + </enumeration> + <enumeration oor:value="3"> + <info> + <desc>PAGEWIDTH</desc> + </info> + </enumeration> + <enumeration oor:value="4"> + <info> + <desc>PAGEWIDTH_NOBORDER</desc> + </info> + </enumeration> + </constraints> + <value>0</value> + </prop> + <prop oor:name="ZoomValue" oor:type="xs:int" oor:nillable="false"> + <!-- UIHints: Tools - Options - Text document Contents - [Section] ´Zoom--> + <info> + <desc>Contains predefined zoom value in percent.</desc> + </info> + <value>100</value> + </prop> + </group> <group oor:name="NonprintingCharacter"> <info> <desc>Contains settings for the visibility of various non-printing characters.</desc> diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 26caf62ef67e..66b18c056872 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -108,10 +108,10 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken { auto pShape = std::make_shared<PPTShape>( meShapeLocation, u"com.sun.star.drawing.CustomShape"_ustr ); bool bUseBgFill = rAttribs.getBool(XML_useBgFill, false); + pShape->getFillProperties().moUseBgFill = bUseBgFill; if (bUseBgFill) { pShape->getFillProperties().moFillType = XML_noFill; - pShape->getFillProperties().moUseBgFill = true; } pShape->setModelId(rAttribs.getStringDefaulted( XML_modelId )); return new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, pShape ); diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index fd78234fbd0e..60dd62d7c6cc 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -608,6 +608,7 @@ TopBorderComplexColor TopBorderDistance TopMargin TotalsRow +TotalsRowBelow Transformation TransitionDirection TransitionDuration diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 28393cf7d96d..254ed5423168 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -150,6 +150,7 @@ void ShapeTypeModel::assignUsed( const ShapeTypeModel& rSource ) ShapeType::ShapeType( Drawing& rDrawing ) : mrDrawing( rDrawing ) + , mbTextBox(false) { } @@ -853,6 +854,13 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes PropertySet(xShape).setAnyProperty(PROP_TextLowerDistance, Any(sal_Int32(getTextBox()->borderDistanceBottom))); xShape->setSize(aSize); } + + if (mbTextBox) + { + // similar to drawingml::Shape::createAndInsert(...) + PropertySet(xShape).setAnyProperty(PROP_TextBox, Any(true)); + } + } } diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index fb009020bf72..146bf2e017eb 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -548,7 +548,14 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const Attri if (mrShapeModel.mbInGroup) // FIXME: without this a text will be added into the group-shape instead of its // parent shape - dynamic_cast<SimpleShape&>(mrShape).setService(u"com.sun.star.drawing.TextShape"_ustr); + { + if (mrShape.isTextBox()) + dynamic_cast<SimpleShape&>(mrShape).setService( + u"com.sun.star.drawing.CustomShape"_ustr); + else + dynamic_cast<SimpleShape&>(mrShape).setService( + u"com.sun.star.drawing.TextShape"_ustr); + } else // FIXME: without this we does not handle some properties like shadow dynamic_cast<SimpleShape&>(mrShape).setService(u"com.sun.star.text.TextFrame"_ustr); @@ -591,6 +598,10 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const Attri // handle remaining stuff in base class return ShapeTypeContext::onCreateContext( nElement, rAttribs ); } +void ShapeContext::setWriterShape() +{ + mrShape.setTextBox(true); +} void ShapeContext::setPoints(std::u16string_view rPoints) { diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index c1164b064b17..532d71528e07 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -192,7 +192,7 @@ public: SC_DLLPUBLIC bool GetAdvancedQuerySource(ScRange& rSource) const; SC_DLLPUBLIC void SetAdvancedQuerySource(const ScRange* pSource); - void GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const; + SC_DLLPUBLIC void GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const; void SetSubTotalParam(const ScSubTotalParam& rSubTotalParam); void GetImportParam(ScImportParam& rImportParam) const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 15f1720142fb..4c41bb3bc1ab 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -865,6 +865,7 @@ public: SC_DLLPUBLIC bool HasPivotTable() const; SC_DLLPUBLIC ScDPCollection* GetDPCollection(); SC_DLLPUBLIC const ScDPCollection* GetDPCollection() const; + SC_DLLPUBLIC const ScDPObject* GetDPAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const; SC_DLLPUBLIC ScDPObject* GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const; SC_DLLPUBLIC ScDPObject* GetDPAtCursor(ScAddress const& rAddress) const { @@ -913,6 +914,8 @@ public: SC_DLLPUBLIC bool GetName( SCTAB nTab, OUString& rName ) const; SC_DLLPUBLIC bool GetCodeName( SCTAB nTab, OUString& rName ) const; SC_DLLPUBLIC bool SetCodeName( SCTAB nTab, const OUString& rName ); + SC_DLLPUBLIC bool GetTotalsRowBelow( SCTAB nTab ) const; + SC_DLLPUBLIC bool SetTotalsRowBelow( SCTAB nTab, bool bVal ); SC_DLLPUBLIC bool GetTable( const OUString& rName, SCTAB& rTab ) const; SC_DLLPUBLIC SCCOL MaxCol() const { return mxSheetLimits->mnMaxCol; } SC_DLLPUBLIC SCROW MaxRow() const { return mxSheetLimits->mnMaxRow; } @@ -969,8 +972,10 @@ public: SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark ) const; - bool IsEditActionAllowed( sc::ColRowEditAction eAction, SCTAB nTab, SCCOLROW nStart, SCCOLROW nEnd ) const; - bool IsEditActionAllowed( sc::ColRowEditAction eAction, const ScMarkData& rMark, SCCOLROW nStart, SCCOLROW nEnd ) const; + bool IsEditActionAllowed( sc::EditAction eAction, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow ) const; + bool IsEditActionAllowed( sc::EditAction eAction, const ScMarkData& rMark, SCCOL nStartCol, + SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const; SC_DLLPUBLIC bool GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix ); diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 1b512b6a7987..6bf605990957 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -424,7 +424,7 @@ enum ScDBObject namespace sc { -enum class ColRowEditAction +enum class EditAction { Unknown, InsertColumnsBefore, @@ -432,7 +432,8 @@ enum class ColRowEditAction InsertRowsBefore, InsertRowsAfter, DeleteColumns, - DeleteRows + DeleteRows, + UpdatePivotTable }; } diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 04bfae4f6f82..9a5409300f8c 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -270,6 +270,8 @@ #define STR_HIDE NC_("STR_HIDE", "Hide") #define STR_PRINT NC_("STR_PRINT", "Print") #define STR_INVALID_AFAREA NC_("STR_INVALID_AFAREA", "To apply an AutoFormat,\na table range of at least\n3 × 3 cells must be selected.") +#define STR_AUTOFORMAT_WAIT_WARNING_TITLE NC_("STR_AUTOFORMAT_WAIT_WARNING_TITLE", "") +#define STR_AUTOFORMAT_WAIT_WARNING NC_("STR_AUTOFORMAT_WAIT_WARNING", "Applying AutoFormat to the selected range (more than one million cells) may take a long time.\nDo you want to proceed?") #define STR_OPTIONAL NC_("STR_OPTIONAL", "(optional)") #define STR_REQUIRED NC_("STR_REQUIRED", "(required)") #define STR_NOTES NC_("STR_NOTES", "Comments") diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx index 922a1ebae748..407ee0d3ce09 100644 --- a/sc/inc/postit.hxx +++ b/sc/inc/postit.hxx @@ -113,7 +113,7 @@ public: SC_DLLPUBLIC void SetAuthor( const OUString& rAuthor ); /** Sets date and author from system settings. */ - void AutoStamp(); + void AutoStamp(bool bCreate = true); /** Returns the pointer to the current outliner object, or null. */ const OutlinerParaObject* GetOutlinerObject() const; @@ -179,13 +179,15 @@ class GenerateNoteCaption public: virtual void Generate(SdrCaptionObj& rCaptionObj) = 0; virtual OUString GetSimpleText() const = 0; + virtual OUString GetAuthorName() const = 0; virtual ~GenerateNoteCaption() {}; }; class SC_DLLPUBLIC ScNoteUtil { static ScPostIt* InsertNote(ScDocument& rDoc, const ScAddress& rPos, ScNoteData&& rNoteData, - bool bAlwaysCreateCaption, sal_uInt32 nPostItId); + bool bAlwaysCreateCaption, sal_uInt32 nPostItId, + bool bShouldAutoStamp = true); static ScNoteData CreateNoteData(ScDocument& rDoc, const ScAddress& rPos, const tools::Rectangle& rCaptionRect, bool bShown); diff --git a/sc/inc/subtotalparam.hxx b/sc/inc/subtotalparam.hxx index 8e36dad83987..3b379edb167d 100644 --- a/sc/inc/subtotalparam.hxx +++ b/sc/inc/subtotalparam.hxx @@ -24,6 +24,7 @@ struct SC_DLLPUBLIC ScSubTotalParam bool bPagebreak:1; ///< page break at change of group bool bCaseSens:1; bool bDoSort:1; ///< presort + bool bSummaryBelow:1; ///< Summary below or above (default: below) bool bAscending:1; ///< sort ascending bool bUserDef:1; ///< sort user defined bool bIncludePattern:1; ///< sort formats diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index ca43636e57b9..e8df1f774ccb 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -253,6 +253,7 @@ private: bool bActiveScenario:1; bool mbPageBreaksValid:1; bool mbForceBreaks:1; + bool mbTotalsRowBelow:1; /** this is touched from formula group threading context */ std::atomic<bool> bStreamValid; @@ -394,6 +395,9 @@ public: const OUString& GetCodeName() const { return aCodeName; } void SetCodeName( const OUString& rNewName ) { aCodeName = rNewName; } + bool GetTotalsRowBelow() const { return mbTotalsRowBelow; } + void SetTotalsRowBelow( bool bNewVal ) { mbTotalsRowBelow = bNewVal; } + const OUString& GetUpperName() const; const OUString& GetPageStyle() const { return aPageStyle; } @@ -405,7 +409,8 @@ public: const ScTableProtection* GetProtection() const; void GetUnprotectedCells( ScRangeList& rRangeList ) const; - bool IsEditActionAllowed( sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd ) const; + bool IsEditActionAllowed( sc::EditAction eAction, SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow ) const; Size GetPageSize() const; void SetPageSize( const Size& rSize ); @@ -724,7 +729,7 @@ public: void UpdateSelectionFunction( ScFunctionData& rData, const ScMarkData& rMark ); void AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - sal_uInt16 nFormatNo ); + sal_uInt16 nFormatNo, ScProgress* pProgress ); void GetAutoFormatData(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScAutoFormatData& rData); bool SearchAndReplace( const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark, diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 13bb2600f471..1ae418d69102 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -191,6 +191,7 @@ inline constexpr OUString SC_UNONAME_TABLAYOUT = u"TableLayout"_ustr; inline constexpr OUString SC_UNONAME_AUTOPRINT = u"AutomaticPrintArea"_ustr; inline constexpr OUString SC_UNONAME_TABCOLOR = u"TabColor"_ustr; inline constexpr OUString SC_UNONAME_CONDFORMAT = u"ConditionalFormats"_ustr; +inline constexpr OUString SC_UNONAME_TOTALBELOW = u"TotalsRowBelow"_ustr; inline constexpr OUString SC_UNONAME_VISFLAG = u"VisibleFlag"_ustr; diff --git a/sc/inc/unowids.hxx b/sc/inc/unowids.hxx index cd1d6baf6ab8..0f6d33f655f1 100644 --- a/sc/inc/unowids.hxx +++ b/sc/inc/unowids.hxx @@ -74,7 +74,8 @@ #define SC_WID_UNO_FORMATID ( SC_WID_UNO_START + 45 ) #define SC_WID_UNO_FORMRT2 ( SC_WID_UNO_START + 46 ) #define SC_WID_UNO_CELLCONTENTTYPE ( SC_WID_UNO_START + 47 ) -#define SC_WID_UNO_END ( SC_WID_UNO_START + 47 ) +#define SC_WID_UNO_TOTALBELOW ( SC_WID_UNO_START + 48 ) +#define SC_WID_UNO_END ( SC_WID_UNO_START + 48 ) inline bool IsScUnoWid( sal_uInt16 nWid ) { diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx index ec763d59b289..38787e7ac668 100644 --- a/sc/qa/extras/scpdfexport.cxx +++ b/sc/qa/extras/scpdfexport.cxx @@ -201,16 +201,11 @@ void ScPDFExportTest::exportToPDFWithUnoCommands(const OUString& rRange) void ScPDFExportTest::setFont(ScFieldEditEngine& rEE, sal_Int32 nStart, sal_Int32 nEnd, const OUString& rFontName) { - ESelection aSel; - aSel.nStartPara = aSel.nEndPara = 0; - aSel.nStartPos = nStart; - aSel.nEndPos = nEnd; - SfxItemSet aItemSet = rEE.GetEmptyItemSet(); SvxFontItem aItem(FAMILY_MODERN, rFontName, u""_ustr, PITCH_VARIABLE, RTL_TEXTENCODING_UTF8, EE_CHAR_FONTINFO); aItemSet.Put(aItem); - rEE.QuickSetAttribs(aItemSet, aSel); + rEE.QuickSetAttribs(aItemSet, ESelection(0, nStart, 0, nEnd)); } void ScPDFExportTest::testMediaShapeScreen_Tdf159094() diff --git a/sc/qa/uitest/calc_tests9/tdf115474.py b/sc/qa/uitest/calc_tests9/tdf115474.py new file mode 100644 index 000000000000..92ca5cc7b7e6 --- /dev/null +++ b/sc/qa/uitest/calc_tests9/tdf115474.py @@ -0,0 +1,29 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.common import select_by_text, select_pos +from libreoffice.calc.document import get_cell_by_position + +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf115474(UITestCase): + def test_tdf115474_Warning_Dialog(self): + with self.ui_test.create_doc_in_start_center("calc") as document: + gridwin = self.xUITest.getTopFocusWindow().getChild("grid_window") + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C1000000"})) + with self.ui_test.execute_dialog_through_command(".uno:AutoFormat", close_button="") as xDialog: + formatlb = xDialog.getChild("formatlb") + entry = formatlb.getChild("2") # pick Box list blue + entry.executeAction("SELECT", tuple()) + + xOKBtn = xDialog.getChild("ok") + with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="no"): + # no background color set, we've skipped autoformat! + self.assertEqual(get_cell_by_position(document, 0, 0, 0).CellBackColor, -1) diff --git a/sc/qa/uitest/data/tdf162262.ods b/sc/qa/uitest/data/tdf162262.ods Binary files differnew file mode 100644 index 000000000000..138348366298 --- /dev/null +++ b/sc/qa/uitest/data/tdf162262.ods diff --git a/sc/qa/uitest/sort/tdf162262.py b/sc/qa/uitest/sort/tdf162262.py new file mode 100644 index 000000000000..1ecce9d25186 --- /dev/null +++ b/sc/qa/uitest/sort/tdf162262.py @@ -0,0 +1,132 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from uitest.uihelper.common import select_by_text, select_pos +from uitest.uihelper.common import get_url_for_data_file +from uitest.uihelper.common import get_state_as_dict + +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues + + +class Subtotals(UITestCase): + + def test_tdf162262(self): + with self.ui_test.load_file(get_url_for_data_file("tdf162262.ods")) as calc_doc: + XcalcDoc = self.xUITest.getTopFocusWindow() + gridwin = XcalcDoc.getChild("grid_window") + # One group level + # Select cell range + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C15"})) + # Select from the menu bar Data + # Select option subtotal + # Subtotal dialog displays + with self.ui_test.execute_dialog_through_command(".uno:DataSubTotals") as xDialog: + # Select group by: Day + xGroupBy = xDialog.getChild("group_by1") + select_by_text(xGroupBy, "Day") + # Select 'Calculate subtotals for' -> Value 1 and Value 2 + xCheckListMenu = xDialog.getChild("grid1") + xTreeList = xCheckListMenu.getChild("columns1") + xFirstEntry = xTreeList.getChild("1") + xFirstEntry.executeAction("CLICK", tuple()) + xFirstEntry = xTreeList.getChild("2") + xFirstEntry.executeAction("CLICK", tuple()) + + # Select tab options + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "3") + # Unselect option Summary below -> false + xSummarybelow = xDialog.getChild("summarybelow") + xSummarybelow.executeAction("CLICK", tuple()) + self.assertEqual(get_state_as_dict(xSummarybelow)['Selected'], "false") + # apply with OK + + self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getString(), "Grand Sum") + self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getValue(), 105) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getValue(), 119) + + self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 2).getString(), "Friday Result") + self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getValue(), 19) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getValue(), 21) + + self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 20).getString(), "Wednesday Result") + self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 20).getValue(), 11) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 20).getValue(), 13) + + def test_tdf162262_multi(self): + with self.ui_test.load_file(get_url_for_data_file("tdf162262.ods")) as calc_doc: + XcalcDoc = self.xUITest.getTopFocusWindow() + gridwin = XcalcDoc.getChild("grid_window") + # Multi group level + # Select cell range + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C15"})) + # Select from the menu bar Data + # Select option subtotal + # Subtotal dialog displays + with self.ui_test.execute_dialog_through_command(".uno:DataSubTotals") as xDialog: + # Select group by 1: Day + xGroupBy = xDialog.getChild("group_by1") + select_by_text(xGroupBy, "Day") + # Select 'Calculate subtotals for' -> Value 1 + xCheckListMenu = xDialog.getChild("grid1") + xTreeList = xCheckListMenu.getChild("columns1") + # Select 1 column + xFirstEntry = xTreeList.getChild("1") + xFirstEntry.executeAction("CLICK", tuple()) + + # Select tab Group by 2 + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "1") + + # Select group by 2: Day + xGroupBy = xDialog.getChild("group_by2") + select_by_text(xGroupBy, "Day") + # Select 'Calculate subtotals for' -> Value 2 + xCheckListMenu = xDialog.getChild("grid2") + xTreeList = xCheckListMenu.getChild("columns2") + # Select second column + xFirstEntry = xTreeList.getChild("2") + xFirstEntry.executeAction("CLICK", tuple()) + + # Select tab options + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "3") + # Unselect option Summary below -> false + xSummarybelow = xDialog.getChild("summarybelow") + xSummarybelow.executeAction("CLICK", tuple()) + self.assertEqual(get_state_as_dict(xSummarybelow)['Selected'], "false") + # apply with OK + + self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getString(), "Grand Sum") + self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getValue(), 0) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getValue(), 119) + + self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 2).getString(), "Grand Sum") + self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getValue(), 105) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getValue(), 0) + + self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 3).getString(), "Friday Sum") + self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 3).getValue(), 0) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getValue(), 21) + + self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 4).getString(), "Friday Sum") + self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 4).getValue(), 19) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 4).getValue(), 0) + + self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 27).getString(), "Wednesday Sum") + self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 27).getValue(), 0) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 27).getValue(), 13) + + self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 28).getString(), "Wednesday Sum") + self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 28).getValue(), 11) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 28).getValue(), 0) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/unit/PivotTableFormatsImportExport.cxx b/sc/qa/unit/PivotTableFormatsImportExport.cxx index 22d56c0f11d6..437a25d5e7e6 100644 --- a/sc/qa/unit/PivotTableFormatsImportExport.cxx +++ b/sc/qa/unit/PivotTableFormatsImportExport.cxx @@ -57,6 +57,13 @@ Color getFontColor(ScDocument& rDoc, OUString const& rAddressString) return rItem.getColor(); } +bool getCellProtection(ScDocument& rDoc, OUString const& rAddressString) +{ + const ScPatternAttr* pPattern = rDoc.GetPattern(parseAddress(rDoc, rAddressString)); + const ScProtectionAttr& rItem = pPattern->GetItem(ATTR_PROTECTION); + return rItem.GetProtection(); +} + template <typename T> OUString checkNonEmptyAddresses(ScDocument& rDoc, T const& rArrayOfAddresses) { OUString aString; @@ -66,7 +73,8 @@ template <typename T> OUString checkNonEmptyAddresses(ScDocument& rDoc, T const& aAddress.Parse(rAddressString, rDoc); const ScPatternAttr* pPattern = rDoc.GetPattern(aAddress); if (pPattern->GetItem(ATTR_FONT_COLOR).getColor() != COL_BLACK - || pPattern->GetItem(ATTR_BACKGROUND).GetColor() != COL_TRANSPARENT) + || pPattern->GetItem(ATTR_BACKGROUND).GetColor() != COL_TRANSPARENT + || !pPattern->GetItem(ATTR_PROTECTION).GetProtection()) { aString += rAddressString + " "; } @@ -416,6 +424,31 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, assertTwoDataFieldColumns_WholeDataColumnSelected(*getScDoc()); } +static void assertFields_WithCellProtection(ScDocument& rDoc) +{ + CPPUNIT_ASSERT_EQUAL(false, getCellProtection(rDoc, u"F18"_ustr)); + CPPUNIT_ASSERT_EQUAL(false, getCellProtection(rDoc, u"F19"_ustr)); + CPPUNIT_ASSERT_EQUAL(false, getCellProtection(rDoc, u"F20"_ustr)); + CPPUNIT_ASSERT_EQUAL(false, getCellProtection(rDoc, u"G18"_ustr)); + CPPUNIT_ASSERT_EQUAL(false, getCellProtection(rDoc, u"G19"_ustr)); + CPPUNIT_ASSERT_EQUAL(false, getCellProtection(rDoc, u"G20"_ustr)); + + // Make sure the other cells have the font color or background set to default + std::vector<OUString> aEmptyAddresses{ + u"F15"_ustr, u"G15"_ustr, u"F16"_ustr, u"G16"_ustr, + u"F17"_ustr, u"G17"_ustr, u"G21"_ustr, u"F21"_ustr, + }; + CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); +} + +CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, Pivot_Table_with_Cell_Protection) +{ + createScDoc("xlsx/pivot-table/Pivot_Table_with_Cell_Protection.xlsx"); + assertFields_WithCellProtection(*getScDoc()); + saveAndReload(u"Calc Office Open XML"_ustr); + assertFields_WithCellProtection(*getScDoc()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/unit/data/ods/tdf162262_summarybelow.ods b/sc/qa/unit/data/ods/tdf162262_summarybelow.ods Binary files differnew file mode 100644 index 000000000000..bd2eeba48d01 --- /dev/null +++ b/sc/qa/unit/data/ods/tdf162262_summarybelow.ods diff --git a/sc/qa/unit/data/xlsx/pivot-table/Pivot_Table_with_Cell_Protection.xlsx b/sc/qa/unit/data/xlsx/pivot-table/Pivot_Table_with_Cell_Protection.xlsx Binary files differnew file mode 100644 index 000000000000..d7966a2d9e32 --- /dev/null +++ b/sc/qa/unit/data/xlsx/pivot-table/Pivot_Table_with_Cell_Protection.xlsx diff --git a/sc/qa/unit/data/xlsx/subtotal-above.xlsx b/sc/qa/unit/data/xlsx/subtotal-above.xlsx Binary files differnew file mode 100644 index 000000000000..b271dbab19be --- /dev/null +++ b/sc/qa/unit/data/xlsx/subtotal-above.xlsx diff --git a/sc/qa/unit/data/xlsx/tdfSheetProts.xlsx b/sc/qa/unit/data/xlsx/tdfSheetProts.xlsx Binary files differnew file mode 100644 index 000000000000..ffd9fe127840 --- /dev/null +++ b/sc/qa/unit/data/xlsx/tdfSheetProts.xlsx diff --git a/sc/qa/unit/subsequent_export_test.cxx b/sc/qa/unit/subsequent_export_test.cxx index a40fff442720..47734d3b5acd 100644 --- a/sc/qa/unit/subsequent_export_test.cxx +++ b/sc/qa/unit/subsequent_export_test.cxx @@ -1155,10 +1155,7 @@ namespace void setAttribute(ScFieldEditEngine& rEE, sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt16 nType, Color nColor = COL_BLACK) { - ESelection aSel; - aSel.nStartPara = aSel.nEndPara = nPara; - aSel.nStartPos = nStart; - aSel.nEndPos = nEnd; + ESelection aSel(nPara, nStart, nPara, nEnd); SfxItemSet aItemSet = rEE.GetEmptyItemSet(); switch (nType) @@ -1212,30 +1209,20 @@ void setAttribute(ScFieldEditEngine& rEE, sal_Int32 nPara, sal_Int32 nStart, sal void setFont(ScFieldEditEngine& rEE, sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, const OUString& rFontName) { - ESelection aSel; - aSel.nStartPara = aSel.nEndPara = nPara; - aSel.nStartPos = nStart; - aSel.nEndPos = nEnd; - SfxItemSet aItemSet = rEE.GetEmptyItemSet(); SvxFontItem aItem(FAMILY_MODERN, rFontName, u""_ustr, PITCH_VARIABLE, RTL_TEXTENCODING_UTF8, EE_CHAR_FONTINFO); aItemSet.Put(aItem); - rEE.QuickSetAttribs(aItemSet, aSel); + rEE.QuickSetAttribs(aItemSet, ESelection(nPara, nStart, nPara, nEnd)); } void setEscapement(ScFieldEditEngine& rEE, sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, short nEsc, sal_uInt8 nRelSize) { - ESelection aSel; - aSel.nStartPara = aSel.nEndPara = nPara; - aSel.nStartPos = nStart; - aSel.nEndPos = nEnd; - SfxItemSet aItemSet = rEE.GetEmptyItemSet(); SvxEscapementItem aItem(nEsc, nRelSize, EE_CHAR_ESCAPEMENT); aItemSet.Put(aItem); - rEE.QuickSetAttribs(aItemSet, aSel); + rEE.QuickSetAttribs(aItemSet, ESelection(nPara, nStart, nPara, nEnd)); } } @@ -1662,8 +1649,6 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS) setAttribute(*pEE, 0, 0, 4, EE_CHAR_WEIGHT); // Set the 'Italic' part italic. setAttribute(*pEE, 0, 9, 15, EE_CHAR_ITALIC); - ESelection aSel; - aSel.nStartPara = aSel.nEndPara = 0; // Set this edit text to cell B2. pDoc->SetEditText(ScAddress(1, 1, 0), pEE->CreateTextObject()); diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx index 8983756b6d41..dc5831f79e70 100644 --- a/sc/qa/unit/subsequent_export_test4.cxx +++ b/sc/qa/unit/subsequent_export_test4.cxx @@ -21,7 +21,11 @@ #include <postit.hxx> #include <validat.hxx> #include <scresid.hxx> +#include <dbdata.hxx> +#include <subtotalparam.hxx> #include <globstr.hrc> +#include <tabprotection.hxx> +#include <dpobject.hxx> #include <editeng/wghtitem.hxx> #include <editeng/postitem.hxx> @@ -380,6 +384,46 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf81470) assertXPath(pHeaders, "/x:headers/x:header[3]"_ostr, "userName"_ostr, u"Kohei Yoshida"_ustr); } +CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf162262) +{ + createScDoc("xlsx/subtotal-above.xlsx"); + + save(u"Calc Office Open XML"_ustr); + + xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); + CPPUNIT_ASSERT(pSheet); + + assertXPath(pSheet, "/x:worksheet/x:sheetPr/x:outlinePr", "summaryBelow", u"0"_ustr); +} + +CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf162262_summarybelow) +{ + createScDoc("ods/tdf162262_summarybelow.ods"); + + ScDocument* pDoc = getScDoc(); + ScDBCollection* pDBCollection = pDoc->GetDBCollection(); + CPPUNIT_ASSERT(pDBCollection); + { + const ScDBData* pDBData = pDBCollection->GetDBAtArea(0, 0, 0, 1, 13); + CPPUNIT_ASSERT(pDBData); + ScSubTotalParam aParam; + pDBData->GetSubTotalParam(aParam); + CPPUNIT_ASSERT(!aParam.bSummaryBelow); + } + + saveAndReload(u"calc8"_ustr); + pDoc = getScDoc(); + pDBCollection = pDoc->GetDBCollection(); + CPPUNIT_ASSERT(pDBCollection); + { + const ScDBData* pDBData = pDBCollection->GetDBAtArea(0, 0, 0, 1, 13); + CPPUNIT_ASSERT(pDBData); + ScSubTotalParam aParam; + pDBData->GetSubTotalParam(aParam); + CPPUNIT_ASSERT(!aParam.bSummaryBelow); + } +} + CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf122331) { createScDoc("ods/tdf122331.ods"); @@ -2012,6 +2056,56 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testNotesAuthor) pBatch->commit(); } +CPPUNIT_TEST_FIXTURE(ScExportTest4, testSheetProtections) +{ + auto verify = [this]() { + ScDocument* pDoc = getScDoc(); + + // 1. tab autofilter allowed, pivot tables not allowed + const ScTableProtection* pTab1Protect = pDoc->GetTabProtection(0); + CPPUNIT_ASSERT(pTab1Protect); + CPPUNIT_ASSERT(pTab1Protect->isOptionEnabled(ScTableProtection::AUTOFILTER)); + CPPUNIT_ASSERT(!pTab1Protect->isOptionEnabled(ScTableProtection::PIVOT_TABLES)); + + // 2. tab autofilter NOT allowed, pivot tables allowed + const ScTableProtection* pTab2Protect = pDoc->GetTabProtection(1); + CPPUNIT_ASSERT(pTab2Protect); + CPPUNIT_ASSERT(!pTab2Protect->isOptionEnabled(ScTableProtection::AUTOFILTER)); + CPPUNIT_ASSERT(pTab2Protect->isOptionEnabled(ScTableProtection::PIVOT_TABLES)); + + // check we have pivot table + ScDPObject* pDPObj1 = pDoc->GetDPAtCursor(0, 0, 1); + CPPUNIT_ASSERT(pDPObj1); + CPPUNIT_ASSERT(!pDPObj1->GetName().isEmpty()); + + // 3. tab autofilter NOT allowed, pivot tables not allowed + const ScTableProtection* pTab3Protect = pDoc->GetTabProtection(2); + CPPUNIT_ASSERT(pTab3Protect); + CPPUNIT_ASSERT(!pTab3Protect->isOptionEnabled(ScTableProtection::AUTOFILTER)); + CPPUNIT_ASSERT(!pTab3Protect->isOptionEnabled(ScTableProtection::PIVOT_TABLES)); + + // 4. tab autofilter allowed, pivot tables not allowed + const ScTableProtection* pTab4Protect = pDoc->GetTabProtection(3); + CPPUNIT_ASSERT(pTab4Protect); + CPPUNIT_ASSERT(pTab4Protect->isOptionEnabled(ScTableProtection::AUTOFILTER)); + CPPUNIT_ASSERT(!pTab4Protect->isOptionEnabled(ScTableProtection::PIVOT_TABLES)); + + // check we have pivot table + ScDPObject* pDPObj2 = pDoc->GetDPAtCursor(0, 0, 3); + CPPUNIT_ASSERT(pDPObj2); + CPPUNIT_ASSERT(!pDPObj2->GetName().isEmpty()); + }; + + createScDoc("xlsx/tdfSheetProts.xlsx"); + verify(); + + saveAndReload(u"Calc Office Open XML"_ustr); + verify(); + + saveAndReload(u"calc8"_ustr); + verify(); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index e8c2856f2d24..42e2c7192bda 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -179,17 +179,12 @@ CPPUNIT_TEST_FIXTURE(Test, testSharedStringPool) ScFieldEditEngine& rEE = m_pDoc->GetEditEngine(); rEE.SetTextCurrentDefaults(u"Andy and Bruce"_ustr); - ESelection aSel; - aSel.nStartPara = aSel.nEndPara = 0; - { // Set 'Andy' bold. SfxItemSet aItemSet = rEE.GetEmptyItemSet(); - aSel.nStartPos = 0; - aSel.nEndPos = 4; SvxWeightItem aWeight(WEIGHT_BOLD, EE_CHAR_WEIGHT); aItemSet.Put(aWeight); - rEE.QuickSetAttribs(aItemSet, aSel); + rEE.QuickSetAttribs(aItemSet, ESelection(0, 0, 0, 4)); } { @@ -197,9 +192,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSharedStringPool) SfxItemSet aItemSet = rEE.GetEmptyItemSet(); SvxPostureItem aItalic(ITALIC_NORMAL, EE_CHAR_ITALIC); aItemSet.Put(aItalic); - aSel.nStartPos = 9; - aSel.nEndPos = 14; - rEE.QuickSetAttribs(aItemSet, aSel); + rEE.QuickSetAttribs(aItemSet, ESelection(0, 9, 0, 14)); } m_pDoc->SetEditText(ScAddress(1,0,0), rEE.CreateTextObject()); // B1 diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx index 70ae86370afc..360ff275e54f 100644 --- a/sc/qa/unit/ucalc_pivottable.cxx +++ b/sc/qa/unit/ucalc_pivottable.cxx @@ -17,6 +17,7 @@ #include <stringutil.hxx> #include <dbdocfun.hxx> #include <generalfunction.hxx> +#include <tabprotection.hxx> #include <formula/errorcodes.hxx> #include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp> @@ -2115,6 +2116,32 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDocFunc) CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } + // Start: Test Pivot table with tab protection + ScTableProtection aProtect; + aProtect.setProtected(true); + m_pDoc->SetTabProtection(1, &aProtect); + + bSuccess = aFunc.RemovePivotTable(*pDPObject, false, true); + CPPUNIT_ASSERT_MESSAGE("Pivot table should not be allowed to remove.", !bSuccess); + + bSuccess = aFunc.UpdatePivotTable(*pDPObject, false, true); + CPPUNIT_ASSERT_MESSAGE("Pivot table should not be allowed to update.", !bSuccess); + + // Allow pivot table usage + aProtect.setOption(ScTableProtection::PIVOT_TABLES, true); + m_pDoc->SetTabProtection(1, &aProtect); + + bSuccess = aFunc.RemovePivotTable(*pDPObject, false, true); + CPPUNIT_ASSERT_MESSAGE("Pivot table should not be allowed to remove.", !bSuccess); + + bSuccess = aFunc.UpdatePivotTable(*pDPObject, false, true); + CPPUNIT_ASSERT_MESSAGE("Pivot table should be allowed to update.", bSuccess); + + aProtect.setProtected(false); + aProtect.setOption(ScTableProtection::PIVOT_TABLES, false); + m_pDoc->SetTabProtection(1, &aProtect); + // End: Test Pivot table with tab protection + // Remove this pivot table output. This should also clear the pivot cache // it was referencing. bSuccess = aFunc.RemovePivotTable(*pDPObject, false, true); diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 573a77cf4558..2227ef2a7997 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -2121,6 +2121,8 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf108654) ScDocument* pDoc = getScDoc(); dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); + // first .uno:SelectAll selects the range, second all (tdf#161641) + dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); dispatchCommand(mxComponent, u".uno:Copy"_ustr, {}); diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index db8a9972e43f..5ef071a13647 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -55,6 +55,8 @@ #include <inputopt.hxx> #include <chartlis.hxx> #include <sc.hrc> +#include <globstr.hrc> +#include <scresid.hxx> #include <hints.hxx> #include <dpobject.hxx> #include <drwlayer.hxx> @@ -70,7 +72,7 @@ #include <scopetools.hxx> #include <filterentries.hxx> #include <queryparam.hxx> - +#include <progress.hxx> #include <globalnames.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <comphelper/lok.hxx> @@ -377,6 +379,20 @@ const ScDPCollection* ScDocument::GetDPCollection() const return pDPCollection.get(); } +const ScDPObject* ScDocument::GetDPAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const +{ + if (!pDPCollection) + return nullptr; + + sal_uInt16 nCount = pDPCollection->GetCount(); + ScRange aRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab); + for (sal_uInt16 i = 0; i < nCount; i++) + if ((*pDPCollection)[i].GetOutRange() == aRange) + return &(*pDPCollection)[i]; + + return nullptr; +} + ScDPObject* ScDocument::GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const { if (!pDPCollection) @@ -1190,6 +1206,7 @@ OUString ScDocument::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SC void ScDocument::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_uInt16 nFormatNo, const ScMarkData& rMark ) { + ScProgress aProgress(GetDocumentShell(), ScResId(STR_UNDO_AUTOFORMAT), nEndCol - nStartCol + 1, true); PutInOrder( nStartCol, nEndCol ); PutInOrder( nStartRow, nEndRow ); SCTAB nMax = maTabs.size(); @@ -1198,7 +1215,7 @@ void ScDocument::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC if (rTab >= nMax) break; if (maTabs[rTab]) - maTabs[rTab]->AutoFormat( nStartCol, nStartRow, nEndCol, nEndRow, nFormatNo ); + maTabs[rTab]->AutoFormat( nStartCol, nStartRow, nEndCol, nEndRow, nFormatNo, &aProgress ); } } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index aa8d7dd9bd3d..7374e57c7dad 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -228,6 +228,25 @@ bool ScDocument::GetCodeName( SCTAB nTab, OUString& rName ) const return false; } +bool ScDocument::SetTotalsRowBelow( SCTAB nTab, bool bVal ) +{ + if (ScTable* pTable = FetchTable(nTab)) + { + pTable->SetTotalsRowBelow(bVal); + return true; + } + return false; +} + +bool ScDocument::GetTotalsRowBelow( SCTAB nTab ) const +{ + if (const ScTable* pTable = FetchTable(nTab)) + { + return pTable->GetTotalsRowBelow(); + } + return true; +} + bool ScDocument::GetTable( const OUString& rName, SCTAB& rTab ) const { static OUString aCacheName, aCacheUpperName; @@ -5278,7 +5297,7 @@ void ScDocument::GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab, if ( nCol > 0 ) { - const SvxBorderLine* pOther = GetEffItem( nCol-1, nRow, nTab, ATTR_BORDER )->GetRight(); + const SvxBorderLine* pOther = GetEffItem( o3tl::sanitizing_dec(nCol), nRow, nTab, ATTR_BORDER )->GetRight(); if ( ScHasPriority( pOther, pLeftLine ) ) pLeftLine = pOther; } @@ -5290,7 +5309,7 @@ void ScDocument::GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab, } if ( nCol < MaxCol() ) { - const SvxBorderLine* pOther = GetEffItem( nCol+1, nRow, nTab, ATTR_BORDER )->GetLeft(); + const SvxBorderLine* pOther = GetEffItem( o3tl::sanitizing_inc(nCol), nRow, nTab, ATTR_BORDER )->GetLeft(); if ( ScHasPriority( pOther, pRightLine ) ) pRightLine = pOther; } diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index a2d1ae67b919..1d4170565ca6 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -961,20 +961,21 @@ bool ScDocument::CopyAdjustRangeName( SCTAB& rSheet, sal_uInt16& rIndex, ScRange } bool ScDocument::IsEditActionAllowed( - sc::ColRowEditAction eAction, SCTAB nTab, SCCOLROW nStart, SCCOLROW nEnd ) const + sc::EditAction eAction, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const { const ScTable* pTab = FetchTable(nTab); if (!pTab) return false; - return pTab->IsEditActionAllowed(eAction, nStart, nEnd); + return pTab->IsEditActionAllowed(eAction, nStartCol, nStartRow, nEndCol, nEndRow); } bool ScDocument::IsEditActionAllowed( - sc::ColRowEditAction eAction, const ScMarkData& rMark, SCCOLROW nStart, SCCOLROW nEnd ) const + sc::EditAction eAction, const ScMarkData& rMark, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const { return std::all_of(rMark.begin(), rMark.end(), - [this, &eAction, &nStart, &nEnd](const SCTAB& rTab) { return IsEditActionAllowed(eAction, rTab, nStart, nEnd); }); + [this, &eAction, &nStartCol, &nStartRow, &nEndCol, &nEndRow](const SCTAB& rTab) + { return IsEditActionAllowed(eAction, rTab, nStartCol, nStartRow, nEndCol, nEndRow); }); } std::optional<sc::ColumnIterator> ScDocument::GetColumnIterator( SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2 ) const diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index c750a16af6d3..0448bcb12f83 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -488,10 +488,15 @@ void ScPostIt::SetAuthor( const OUString& rAuthor ) maNoteData.maAuthor = rAuthor; } -void ScPostIt::AutoStamp() +void ScPostIt::AutoStamp(bool bCreate) { - maNoteData.maDate = ScGlobal::getLocaleData().getDate( Date( Date::SYSTEM ) ) + " " + - ScGlobal::getLocaleData().getTime(DateTime(DateTime::SYSTEM), false); + if (bCreate) + { + maNoteData.maDate = ScGlobal::getLocaleData().getDate(Date(Date::SYSTEM)) + " " + + ScGlobal::getLocaleData().getTime(DateTime(DateTime::SYSTEM), false); + } + if (!maNoteData.maAuthor.isEmpty()) + return; const OUString aAuthor = SvtUserOptions().GetFullName(); maNoteData.maAuthor = !aAuthor.isEmpty() ? aAuthor : ScResId(STR_CHG_UNKNOWN_AUTHOR); } @@ -840,8 +845,7 @@ rtl::Reference<SdrCaptionObj> ScNoteUtil::CreateTempCaption( else { aBuffer.append(pNote->GetAuthor() - + ", " - + pNote->GetDate()); + + (!pNote->GetDate().isEmpty() ? ", " + pNote->GetDate() : OUString())); } pNoteCaption = pNote->GetOrCreateCaption( rPos ); } @@ -970,17 +974,19 @@ ScPostIt* ScNoteUtil::CreateNoteFromGenerator( // simple text now to supply any queries for that which don't require // creation of a full Caption rInitData.maSimpleText = rInitData.mxGenerator->GetSimpleText(); - - return InsertNote(rDoc, rPos, std::move(aNoteData), /*bAlwaysCreateCaption*/false, 0/*nPostItId*/); + aNoteData.maAuthor = rInitData.mxGenerator->GetAuthorName(); + return InsertNote(rDoc, rPos, std::move(aNoteData), /*bAlwaysCreateCaption*/ false, + 0 /*nPostItId*/, false /*bShouldAutoStamp*/); } ScPostIt* ScNoteUtil::InsertNote(ScDocument& rDoc, const ScAddress& rPos, ScNoteData&& rNoteData, - bool bAlwaysCreateCaption, sal_uInt32 nPostItId) + bool bAlwaysCreateCaption, sal_uInt32 nPostItId, + bool bShouldAutoStamp) { /* Create the note and insert it into the document. If the note is visible, the caption object will be created automatically. */ ScPostIt* pNote = new ScPostIt( rDoc, rPos, std::move(rNoteData), bAlwaysCreateCaption, nPostItId ); - pNote->AutoStamp(); + pNote->AutoStamp(bShouldAutoStamp); //insert takes ownership rDoc.SetNote(rPos, std::unique_ptr<ScPostIt>(pNote)); return pNote; diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 2f9ee31d5d14..f409ebf2ccdc 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -331,7 +331,7 @@ void ScStyleSheetPool::CreateStandardStyles() aStr = ScResId( STR_PAGE ) + " "; aEdEngine.SetTextCurrentDefaults( aStr ); nStrLen = aStr.getLength(); - aEdEngine.QuickInsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(0,nStrLen,0,nStrLen) ); + aEdEngine.QuickInsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(0,nStrLen) ); pTxtObj = aEdEngine.CreateTextObject(); aFooterItem.SetLeftArea ( *pEmptyTxtObj ); aFooterItem.SetCenterArea( *pTxtObj ); @@ -376,14 +376,14 @@ void ScStyleSheetPool::CreateStandardStyles() aStr = " ()"; aEdEngine.SetTextCurrentDefaults( aStr ); - aEdEngine.QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), ESelection(0,2,0,2) ); + aEdEngine.QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), ESelection(0,2) ); aEdEngine.QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), ESelection() ); pTxtObj = aEdEngine.CreateTextObject(); aHeaderItem.SetLeftArea( *pTxtObj ); aHeaderItem.SetCenterArea( *pEmptyTxtObj ); aStr = ", "; aEdEngine.SetTextCurrentDefaults( aStr ); - aEdEngine.QuickInsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD), ESelection(0,2,0,2) ); + aEdEngine.QuickInsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD), ESelection(0,2) ); aEdEngine.QuickInsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SvxDateType::Var), EE_FEATURE_FIELD), ESelection() ); pTxtObj = aEdEngine.CreateTextObject(); @@ -398,8 +398,8 @@ void ScStyleSheetPool::CreateStandardStyles() aStr += " / "; sal_Int32 nStrLen2 = aStr.getLength(); aEdEngine.SetTextCurrentDefaults( aStr ); - aEdEngine.QuickInsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), ESelection(0,nStrLen2,0,nStrLen2) ); - aEdEngine.QuickInsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(0,nStrLen,0,nStrLen) ); + aEdEngine.QuickInsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), ESelection(0,nStrLen2) ); + aEdEngine.QuickInsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(0,nStrLen) ); pTxtObj = aEdEngine.CreateTextObject(); aFooterItem.SetLeftArea ( *pEmptyTxtObj ); aFooterItem.SetCenterArea( *pTxtObj ); diff --git a/sc/source/core/data/subtotalparam.cxx b/sc/source/core/data/subtotalparam.cxx index e8f32954297c..6fd8e18c6b0e 100644 --- a/sc/source/core/data/subtotalparam.cxx +++ b/sc/source/core/data/subtotalparam.cxx @@ -26,7 +26,7 @@ ScSubTotalParam::ScSubTotalParam() ScSubTotalParam::ScSubTotalParam( const ScSubTotalParam& r ) : nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2),nUserIndex(r.nUserIndex), bRemoveOnly(r.bRemoveOnly),bReplace(r.bReplace),bPagebreak(r.bPagebreak),bCaseSens(r.bCaseSens), - bDoSort(r.bDoSort),bAscending(r.bAscending),bUserDef(r.bUserDef), + bDoSort(r.bDoSort), bSummaryBelow(r.bSummaryBelow), bAscending(r.bAscending), bUserDef(r.bUserDef), bIncludePattern(r.bIncludePattern) { for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++) @@ -59,7 +59,7 @@ void ScSubTotalParam::Clear() nRow1=nRow2 = 0; nUserIndex = 0; bPagebreak=bCaseSens=bUserDef=bIncludePattern=bRemoveOnly = false; - bAscending=bReplace=bDoSort = true; + bAscending=bReplace=bDoSort=bSummaryBelow = true; for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++) { @@ -90,6 +90,7 @@ ScSubTotalParam& ScSubTotalParam::operator=( const ScSubTotalParam& r ) bPagebreak = r.bPagebreak; bCaseSens = r.bCaseSens; bDoSort = r.bDoSort; + bSummaryBelow = r.bSummaryBelow; bAscending = r.bAscending; bUserDef = r.bUserDef; nUserIndex = r.nUserIndex; @@ -135,6 +136,7 @@ bool ScSubTotalParam::operator==( const ScSubTotalParam& rOther ) const && (bReplace == rOther.bReplace) && (bPagebreak == rOther.bPagebreak) && (bDoSort == rOther.bDoSort) + && (bSummaryBelow == rOther.bSummaryBelow) && (bCaseSens == rOther.bCaseSens) && (bAscending == rOther.bAscending) && (bUserDef == rOther.bUserDef) diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index f90c4a73e011..d6f910d9867d 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -282,6 +282,7 @@ ScTable::ScTable( ScDocument& rDoc, SCTAB nNewTab, const OUString& rNewName, bActiveScenario(false), mbPageBreaksValid(false), mbForceBreaks(false), + mbTotalsRowBelow(true), bStreamValid(false) { aDefaultColData.InitAttrArray(new ScAttrArray(static_cast<SCCOL>(-1), nNewTab, rDoc, nullptr)); diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 933b9a37930e..83a880bdaf3b 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -52,6 +52,7 @@ #include <compressedarray.hxx> #include <refdata.hxx> #include <docsh.hxx> +#include <dpobject.hxx> #include <scitems.hxx> #include <editeng/boxitem.hxx> @@ -432,15 +433,6 @@ void ScTable::DeleteArea( aCol[i].DeleteArea(nRow1, nRow2, nDelFlag, bBroadcast, pBroadcastSpans); } - // Do not set protected cell in a protected table - - if ( IsProtected() && (nDelFlag & InsertDeleteFlags::ATTRIB) ) - { - ScPatternAttr aPattern(rDocument.getCellAttributeHelper()); - aPattern.GetItemSet().Put( ScProtectionAttr( false ) ); - ApplyPatternArea( nCol1, nRow1, nCol2, nRow2, aPattern ); - } - if( nDelFlag & InsertDeleteFlags::ATTRIB ) mpCondFormatList->DeleteArea( nCol1, nRow1, nCol2, nRow2 ); } @@ -469,16 +461,6 @@ void ScTable::DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& rMa mpCondFormatList->DeleteArea( rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row() ); } - // Do not set protected cell in a protected sheet - - if ( IsProtected() && (nDelFlag & InsertDeleteFlags::ATTRIB) ) - { - SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aSet(*rDocument.GetPool()); - aSet.Put( ScProtectionAttr( false ) ); - ScItemPoolCache aCache(rDocument.getCellAttributeHelper(), aSet ); - ApplySelectionCache( aCache, rMark ); - } - // TODO: In the future we may want to check if the table has been // really modified before setting the stream invalid. SetStreamValid(false); @@ -769,15 +751,6 @@ void ScTable::CopyFromClip( pRowFlags->AndValue( j, ~CRFlags::ManualSize); } } - - // Do not set protected cell in a protected sheet - if (IsProtected() && (rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB)) - { - ScPatternAttr aPattern(rDocument.getCellAttributeHelper()); - aPattern.GetItemSet().Put( ScProtectionAttr( false ) ); - ApplyPatternArea( nCol1, nRow1, nCol2, nRow2, aPattern ); - } - // create deep copies for conditional formatting CopyConditionalFormat( nCol1, nRow1, nCol2, nRow2, nDx, nDy, pTable); } @@ -2709,8 +2682,7 @@ bool ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, if (!bIsEditable) { // An enhanced protection permission may override the attribute. - if (pTabProtection) - bIsEditable = pTabProtection->isBlockEditable( ScRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab)); + bIsEditable = pTabProtection->isBlockEditable( ScRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab)); } if (bIsEditable) { diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 86c709f711c4..fed72506c2a3 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2003,7 +2003,6 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) SCROW nStartRow = rParam.nRow1 + 1; // Header SCCOL nEndCol = rParam.nCol2; SCROW nEndRow = rParam.nRow2; // will change - sal_uInt16 i; // Remove empty rows at the end // so that all exceeding (rDocument.MaxRow()) can be found by InsertRow (#35180#) @@ -2013,11 +2012,13 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) sal_uInt16 nLevelCount = 0; // Number of levels bool bDoThis = true; - for (i=0; i<MAXSUBTOTAL && bDoThis; i++) + for (sal_uInt16 i = 0; i < MAXSUBTOTAL && bDoThis; ++i) + { if (rParam.bGroupActive[i]) - nLevelCount = i+1; + nLevelCount = o3tl::sanitizing_inc(i); else bDoThis = false; + } if (nLevelCount==0) // do nothing return true; @@ -2059,9 +2060,10 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) if (nResCount > 0) // otherwise only sort { - for (i=0; i<=aRowEntry.nGroupNo; i++) + SCROW nAboveRows = rParam.bSummaryBelow ? nStartRow : nStartRow + nLevel; + for (sal_uInt16 i = 0; i <= aRowEntry.nGroupNo; ++i) { - aSubString = GetString( nGroupCol[i], nStartRow ); + aSubString = GetString( nGroupCol[i], nAboveRows ); if ( bIgnoreCase ) aCompString[i] = ScGlobal::getCharClass().uppercase( aSubString ); else @@ -2069,8 +2071,8 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) } // aSubString stays on the last bool bBlockVis = false; // group visible? - aRowEntry.nSubStartRow = nStartRow; - for (SCROW nRow=nStartRow; nRow<=nEndRow+1 && bSpaceLeft; nRow++) + aRowEntry.nSubStartRow = nAboveRows; + for (SCROW nRow=nAboveRows; nRow<=nEndRow+1 && bSpaceLeft; nRow++) { bool bChanged; if (nRow>nEndRow) @@ -2079,7 +2081,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) { bChanged = false; OUString aString; - for (i=0; i<=aRowEntry.nGroupNo && !bChanged; i++) + for (sal_uInt16 i = 0; i <= aRowEntry.nGroupNo && !bChanged; ++i) { aString = GetString( nGroupCol[i], nRow ); if (bIgnoreCase) @@ -2098,9 +2100,21 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) } if ( bChanged ) { - aRowEntry.nDestRow = nRow; - aRowEntry.nFuncStart = aRowEntry.nSubStartRow; - aRowEntry.nFuncEnd = nRow-1; + if (rParam.bSummaryBelow) + { + aRowEntry.nDestRow = nRow; + aRowEntry.nFuncStart = aRowEntry.nSubStartRow; + aRowEntry.nFuncEnd = nRow - 1; + } + else + { + aRowEntry.nDestRow = aRowEntry.nSubStartRow; + aRowEntry.nFuncStart = aRowEntry.nSubStartRow + 1; + if (nRow != nEndRow + 1) + aRowEntry.nFuncEnd = nRow - nLevel; + else + aRowEntry.nFuncEnd = nRow; + } bSpaceLeft = rDocument.InsertRow( 0, nTab, rDocument.MaxCol(), nTab, aRowEntry.nDestRow, 1 ); @@ -2139,7 +2153,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) ++nRow; ++nEndRow; aRowEntry.nSubStartRow = nRow; - for (i=0; i<=aRowEntry.nGroupNo; i++) + for (sal_uInt16 i = 0; i <= aRowEntry.nGroupNo; ++i) { aSubString = GetString( nGroupCol[i], nRow ); if ( bIgnoreCase ) @@ -2156,17 +2170,27 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) if (!aRowVector.empty()) { - // generate global total - SCROW nGlobalStartRow = aRowVector[0].nSubStartRow; - SCROW nGlobalStartFunc = aRowVector[0].nFuncStart; SCROW nGlobalEndRow = 0; SCROW nGlobalEndFunc = 0; - for (const auto& rRowEntry : aRowVector) + for (auto& rRowEntry : aRowVector) { + if (!rParam.bSummaryBelow) + { + // if we have Global summary above, we need to shift summary rows down + rRowEntry.nDestRow = rRowEntry.nDestRow + nLevelCount; + rRowEntry.nFuncEnd = rRowEntry.nFuncEnd + nLevelCount; + rRowEntry.nFuncStart = rRowEntry.nFuncStart + nLevelCount - rRowEntry.nGroupNo; + rRowEntry.nSubStartRow = rRowEntry.nSubStartRow + nLevelCount; + } + nGlobalEndRow = (nGlobalEndRow < rRowEntry.nDestRow) ? rRowEntry.nDestRow : nGlobalEndRow; nGlobalEndFunc = (nGlobalEndFunc < rRowEntry.nFuncEnd) ? rRowEntry.nFuncEnd : nGlobalEndRow; } + // generate global total + SCROW nGlobalStartRow = aRowVector[0].nSubStartRow; + SCROW nGlobalStartFunc = aRowVector[0].nFuncStart; + for (sal_uInt16 nLevel = 0; nLevel<nLevelCount; nLevel++) { const sal_uInt16 nGroupNo = nLevelCount - nLevel - 1; @@ -2178,18 +2202,30 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) continue; } - // increment end row - nGlobalEndRow++; - - // add row entry for formula - aRowEntry.nGroupNo = nGroupNo; - aRowEntry.nSubStartRow = nGlobalStartRow; - aRowEntry.nFuncStart = nGlobalStartFunc; - aRowEntry.nDestRow = nGlobalEndRow; - aRowEntry.nFuncEnd = nGlobalEndFunc; - - // increment row - nGlobalEndFunc++; + if (rParam.bSummaryBelow) + { + // increment end row + nGlobalEndRow++; + + // add row entry for formula + aRowEntry.nGroupNo = nGroupNo; + aRowEntry.nSubStartRow = nGlobalStartRow; + aRowEntry.nFuncStart = nGlobalStartFunc; + aRowEntry.nDestRow = nGlobalEndRow; + aRowEntry.nFuncEnd = nGlobalEndFunc; + + // increment row + nGlobalEndFunc++; + } + else + { + // if we have Global summary we need to shift summary rows down + aRowEntry.nGroupNo = nGroupNo; + aRowEntry.nSubStartRow = nGlobalStartRow - nGroupNo - 1; + aRowEntry.nFuncStart = nGlobalStartFunc - nGroupNo - 1; + aRowEntry.nDestRow = nGlobalStartRow - nGroupNo - 1; + aRowEntry.nFuncEnd = nGlobalEndFunc; + } bSpaceLeft = rDocument.InsertRow(0, nTab, rDocument.MaxCol(), nTab, aRowEntry.nDestRow, 1); diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 63c595955220..157b0f01fac7 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -2684,7 +2684,7 @@ void ScTable::AutoFormatArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC } void ScTable::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - sal_uInt16 nFormatNo ) + sal_uInt16 nFormatNo, ScProgress* pProgress ) { if (!(ValidColRow(nStartCol, nStartRow) && ValidColRow(nEndCol, nEndRow))) return; @@ -2814,6 +2814,9 @@ void ScTable::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nIndex = 6; else nIndex = 5; + if (pProgress) + pProgress->SetStateOnPercent(nCol); + } // for nCol } // if not equal Column } // if not all equal diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx index f9e7a878c8e5..0ca5e5074010 100644 --- a/sc/source/core/data/table7.cxx +++ b/sc/source/core/data/table7.cxx @@ -339,8 +339,8 @@ void ScTable::SetNeedsListeningGroup( SCCOL nCol, SCROW nRow ) CreateColumnIfNotExists(nCol).SetNeedsListeningGroup(nRow); } -bool ScTable::IsEditActionAllowed( - sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd ) const +bool ScTable::IsEditActionAllowed( sc::EditAction eAction, SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow ) const { if (!IsProtected()) { @@ -349,20 +349,20 @@ bool ScTable::IsEditActionAllowed( switch (eAction) { - case sc::ColRowEditAction::InsertColumnsBefore: - case sc::ColRowEditAction::InsertColumnsAfter: - case sc::ColRowEditAction::DeleteColumns: + case sc::EditAction::InsertColumnsBefore: + case sc::EditAction::InsertColumnsAfter: + case sc::EditAction::DeleteColumns: { - nCol1 = nStart; - nCol2 = nEnd; + nCol1 = nStartCol; + nCol2 = nEndCol; break; } - case sc::ColRowEditAction::InsertRowsBefore: - case sc::ColRowEditAction::InsertRowsAfter: - case sc::ColRowEditAction::DeleteRows: + case sc::EditAction::InsertRowsBefore: + case sc::EditAction::InsertRowsAfter: + case sc::EditAction::DeleteRows: { - nRow1 = nStart; - nRow2 = nEnd; + nRow1 = nStartRow; + nRow2 = nEndRow; break; } default: @@ -381,37 +381,44 @@ bool ScTable::IsEditActionAllowed( switch (eAction) { - case sc::ColRowEditAction::InsertColumnsBefore: - case sc::ColRowEditAction::InsertColumnsAfter: + case sc::EditAction::InsertColumnsBefore: + case sc::EditAction::InsertColumnsAfter: { // TODO: improve the matrix range handling for the insert-before action. - if (HasBlockMatrixFragment(nStart, 0, nEnd, rDocument.MaxRow())) + if (HasBlockMatrixFragment(nStartCol, nStartRow, nEndCol, nEndRow)) return false; return pTabProtection->isOptionEnabled(ScTableProtection::INSERT_COLUMNS); } - case sc::ColRowEditAction::InsertRowsBefore: - case sc::ColRowEditAction::InsertRowsAfter: + case sc::EditAction::InsertRowsBefore: + case sc::EditAction::InsertRowsAfter: { // TODO: improve the matrix range handling for the insert-before action. - if (HasBlockMatrixFragment(0, nStart, rDocument.MaxCol(), nEnd)) + if (HasBlockMatrixFragment(nStartCol, nStartRow, nEndCol, nEndRow)) return false; return pTabProtection->isOptionEnabled(ScTableProtection::INSERT_ROWS); } - case sc::ColRowEditAction::DeleteColumns: + case sc::EditAction::DeleteColumns: { if (!pTabProtection->isOptionEnabled(ScTableProtection::DELETE_COLUMNS)) return false; - return !HasAttrib(nStart, 0, nEnd, rDocument.MaxRow(), HasAttrFlags::Protected); + return !HasAttrib(nStartCol, nStartRow, nEndCol, nEndRow, HasAttrFlags::Protected); } - case sc::ColRowEditAction::DeleteRows: + case sc::EditAction::DeleteRows: { if (!pTabProtection->isOptionEnabled(ScTableProtection::DELETE_ROWS)) return false; - return !HasAttrib(0, nStart, rDocument.MaxCol(), nEnd, HasAttrFlags::Protected); + return !HasAttrib(nStartCol, nStartRow, nEndCol, nEndRow, HasAttrFlags::Protected); + } + case sc::EditAction::UpdatePivotTable: + { + if (pTabProtection->isOptionEnabled(ScTableProtection::PIVOT_TABLES)) + return true; + + return !HasAttrib(nStartCol, nStartRow, nEndCol, nEndRow, HasAttrFlags::Protected); } default: ; diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 6737c947ea14..61a80870bdf1 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -147,8 +147,7 @@ std::unique_ptr<EditTextObject> ScEditUtil::CreateURLObjectFromURL( ScDocument& SvxURLField aUrlField( rURL, rText, SvxURLFormat::AppDefault); EditEngine& rEE = rDoc.GetEditEngine(); rEE.SetText( OUString() ); - rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), - ESelection( EE_PARA_MAX_COUNT, EE_TEXTPOS_MAX_COUNT ) ); + rEE.QuickInsertField(SvxFieldItem(aUrlField, EE_FEATURE_FIELD), ESelection::AtEnd()); return rEE.CreateTextObject(); } diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 9b2a29ff62ca..32ff0f7a753e 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -584,8 +584,9 @@ void ExcTable::FillAsTableXml() XclExtLstRef xExtLst = new XclExtLst( GetRoot() ); bool bFitToPages = xPageSett->GetPageData().mbFitToPages; + bool bSummaryBelow = GetRoot().GetDoc().GetTotalsRowBelow(mnScTab); Color aTabColor = GetRoot().GetDoc().GetTabBgColor(mnScTab); - Add(new XclExpXmlSheetPr(bFitToPages, mnScTab, aTabColor, &GetFilterManager())); + Add(new XclExpXmlSheetPr(bFitToPages, mnScTab, aTabColor, bSummaryBelow, &GetFilterManager())); // GUTS (count & size of outline icons) aRecList.AppendRecord( mxCellTable->CreateRecord( EXC_ID_GUTS ) ); diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 4e7301e3dece..f9e596142473 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -368,8 +368,8 @@ XclExpWsbool::XclExpWsbool( bool bFitToPages ) SetValue( GetValue() | EXC_WSBOOL_FITTOPAGE ); } -XclExpXmlSheetPr::XclExpXmlSheetPr( bool bFitToPages, SCTAB nScTab, const Color& rTabColor, XclExpFilterManager* pManager ) : - mnScTab(nScTab), mpManager(pManager), mbFitToPage(bFitToPages), maTabColor(rTabColor) {} +XclExpXmlSheetPr::XclExpXmlSheetPr( bool bFitToPages, SCTAB nScTab, const Color& rTabColor, bool bSummaryBelow, XclExpFilterManager* pManager ) : + mnScTab(nScTab), mpManager(pManager), mbFitToPage(bFitToPages), maTabColor(rTabColor), mbSummaryBelow(bSummaryBelow) {} void XclExpXmlSheetPr::SaveXml( XclExpXmlStream& rStrm ) { @@ -388,11 +388,13 @@ void XclExpXmlSheetPr::SaveXml( XclExpXmlStream& rStrm ) // Note : the order of child elements is significant. Don't change the order. - // OOXTODO: XML_outlinePr - if (maTabColor != COL_AUTO) rWorksheet->singleElement(XML_tabColor, XML_rgb, XclXmlUtils::ToOString(maTabColor)); + // OOXTODO: XML_outlinePr --> XML_applyStyles, XML_showOutlineSymbols, XML_summaryBelow, XML_summaryRight + if (!mbSummaryBelow) + rWorksheet->singleElement(XML_outlinePr, XML_summaryBelow, "0"); + rWorksheet->singleElement(XML_pageSetUpPr, // OOXTODO: XML_autoPageBreaks, XML_fitToPage, ToPsz(mbFitToPage)); diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 649219f89bdb..54c809e67f32 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -460,8 +460,8 @@ XclExpStringRef lclCreateFormattedString( // process all portions in the paragraph for( const auto& rPos : aPosList ) { - aSel.nEndPos = rPos; - OUString aXclPortionText = aParaText.copy( aSel.nStartPos, aSel.nEndPos - aSel.nStartPos ); + aSel.end.nIndex = rPos; + OUString aXclPortionText = aParaText.copy( aSel.start.nIndex, aSel.end.nIndex - aSel.start.nIndex ); aItemSet.ClearItem(); SfxItemSet aEditSet( rEE.GetAttribs( aSel ) ); @@ -472,7 +472,7 @@ XclExpStringRef lclCreateFormattedString( // process text fields bool bIsHyperlink = false; - if( aSel.nStartPos + 1 == aSel.nEndPos ) + if (aSel.start.nIndex + 1 == aSel.end.nIndex) { // test if the character is a text field if( const SvxFieldItem* pItem = aEditSet.GetItemIfSet( EE_FEATURE_FIELD, false ) ) @@ -523,7 +523,7 @@ XclExpStringRef lclCreateFormattedString( xString->AppendFormat( nXclPortionStart, nFontIdx ); } - aSel.nStartPos = aSel.nEndPos; + aSel.start.nIndex = aSel.end.nIndex; } // add trailing newline (important for correct character index calculation) @@ -729,8 +729,8 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico for( const auto& rPos : aPosList ) { - aSel.nEndPos = rPos; - if( aSel.nStartPos < aSel.nEndPos ) + aSel.end.nIndex = rPos; + if (aSel.start.nIndex < aSel.end.nIndex) { // --- font attributes --- @@ -827,7 +827,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico // --- text content or text fields --- const SvxFieldItem* pItem; - if( (aSel.nStartPos + 1 == aSel.nEndPos) && // fields are single characters + if( (aSel.start.nIndex + 1 == aSel.end.nIndex) && // fields are single characters (pItem = aEditSet.GetItemIfSet( EE_FEATURE_FIELD, false )) ) { if( const SvxFieldData* pFieldData = pItem->GetField() ) @@ -880,7 +880,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico } } - aSel.nStartPos = aSel.nEndPos; + aSel.start.nIndex = aSel.end.nIndex; } aText = ScGlobal::addToken( aText, aParaText, '\n' ); diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index ddccb1cd36f6..90f58aebc574 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -1241,25 +1241,28 @@ void XclExpXmlPivotTables::savePivotTableFormats(XclExpXmlStream& rStream, ScDPO pAttributeList->add(XML_fieldPosition, OString::number(*rFormat.oFieldPosition)); pPivotStream->startElement(XML_pivotArea, pAttributeList); } - pPivotStream->startElement(XML_references, XML_count, OString::number(rFormat.aSelections.size())); - for (sc::Selection const& rSelection : rFormat.getSelections()) + if (rFormat.aSelections.size()) { + pPivotStream->startElement(XML_references, XML_count, OString::number(rFormat.aSelections.size())); + for (sc::Selection const& rSelection : rFormat.getSelections()) { - auto pRefAttributeList = sax_fastparser::FastSerializerHelper::createAttrList(); - pRefAttributeList->add(XML_field, OString::number(sal_uInt32(rSelection.nField))); - pRefAttributeList->add(XML_count, "1"); - if (!rSelection.bSelected) // default is true - pRefAttributeList->add(XML_selected, "0"); - pPivotStream->startElement(XML_reference, pRefAttributeList); - } + { + auto pRefAttributeList = sax_fastparser::FastSerializerHelper::createAttrList(); + pRefAttributeList->add(XML_field, OString::number(sal_uInt32(rSelection.nField))); + pRefAttributeList->add(XML_count, "1"); + if (!rSelection.bSelected) // default is true + pRefAttributeList->add(XML_selected, "0"); + pPivotStream->startElement(XML_reference, pRefAttributeList); + } - for (sal_uInt32 nIndex : rSelection.nIndices) - { - pPivotStream->singleElement(XML_x, XML_v, OString::number(nIndex)); + for (sal_uInt32 nIndex : rSelection.nIndices) + { + pPivotStream->singleElement(XML_x, XML_v, OString::number(nIndex)); + } + pPivotStream->endElement(XML_reference); } - pPivotStream->endElement(XML_reference); + pPivotStream->endElement(XML_references); } - pPivotStream->endElement(XML_references); pPivotStream->endElement(XML_pivotArea); pPivotStream->endElement(XML_format); diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index a2862f7b6988..e926439e3f79 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -180,7 +180,7 @@ void lclInsertUrl( XclImpRoot& rRoot, const OUString& rUrl, SCCOL nScCol, SCROW { const EditTextObject* pEditObj = aCell.getEditText(); rEE.SetTextCurrentDefaults( *pEditObj ); - rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), ESelection( 0, 0, EE_PARA_ALL, 0 ) ); + rEE.QuickInsertField(SvxFieldItem(aUrlField, EE_FEATURE_FIELD), ESelection::All()); } else { @@ -190,7 +190,7 @@ void lclInsertUrl( XclImpRoot& rRoot, const OUString& rUrl, SCCOL nScCol, SCROW { SfxItemSet aItemSet( rEE.GetEmptyItemSet() ); pPattern->FillEditItemSet( &aItemSet ); - rEE.QuickSetAttribs( aItemSet, ESelection( 0, 0, EE_PARA_ALL, 0 ) ); + rEE.QuickSetAttribs(aItemSet, ESelection::All()); } } diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index 2f05d6722d7a..40dd4ba5901c 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -197,18 +197,17 @@ std::unique_ptr<EditTextObject> lclCreateTextObject( const XclImpRoot& rRoot, aNextRun.mnChar = 0xFFFF; // reset selection start to current position - aSelection.nStartPara = aSelection.nEndPara; - aSelection.nStartPos = aSelection.nEndPos; + aSelection.CollapseToEnd(); } // set end of selection to current position if( rString.GetText()[ nChar ] == '\n' ) { - ++aSelection.nEndPara; - aSelection.nEndPos = 0; + ++aSelection.end.nPara; + aSelection.end.nIndex = 0; } else - ++aSelection.nEndPos; + ++aSelection.end.nIndex; } // send items of last text portion to edit engine @@ -271,8 +270,6 @@ XclImpHFConverter::XclImpHFPortionInfo::XclImpHFPortionInfo() : mnHeight( 0 ), mnMaxLineHt( 0 ) { - maSel.nStartPara = maSel.nEndPara = 0; - maSel.nStartPos = maSel.nEndPos = 0; } XclImpHFConverter::XclImpHFConverter( const XclImpRoot& rRoot ) : @@ -524,14 +521,13 @@ void XclImpHFConverter::UpdateCurrMaxLineHeight() void XclImpHFConverter::SetAttribs() { ESelection& rSel = GetCurrSel(); - if( (rSel.nStartPara != rSel.nEndPara) || (rSel.nStartPos != rSel.nEndPos) ) + if (rSel.HasRange()) { SfxItemSet aItemSet( mrEE.GetEmptyItemSet() ); XclImpFont aFont( GetRoot(), *mxFontData ); aFont.FillToItemSet( aItemSet, XclFontItemType::HeaderFooter ); mrEE.QuickSetAttribs( aItemSet, rSel ); - rSel.nStartPara = rSel.nEndPara; - rSel.nStartPos = rSel.nEndPos; + rSel.CollapseToEnd(); } } @@ -552,8 +548,8 @@ void XclImpHFConverter::InsertText() { ESelection& rSel = GetCurrSel(); OUString sString(maCurrText.makeStringAndClear()); - mrEE.QuickInsertText( sString, ESelection( rSel.nEndPara, rSel.nEndPos, rSel.nEndPara, rSel.nEndPos ) ); - rSel.nEndPos = rSel.nEndPos + sString.getLength(); + mrEE.QuickInsertText(sString, ESelection(rSel.end)); + rSel.end.nIndex += sString.getLength(); UpdateCurrMaxLineHeight(); } } @@ -561,17 +557,17 @@ void XclImpHFConverter::InsertText() void XclImpHFConverter::InsertField( const SvxFieldItem& rFieldItem ) { ESelection& rSel = GetCurrSel(); - mrEE.QuickInsertField( rFieldItem, ESelection( rSel.nEndPara, rSel.nEndPos, rSel.nEndPara, rSel.nEndPos ) ); - ++rSel.nEndPos; + mrEE.QuickInsertField(rFieldItem, ESelection(rSel.end)); + ++rSel.end.nIndex; UpdateCurrMaxLineHeight(); } void XclImpHFConverter::InsertLineBreak() { ESelection& rSel = GetCurrSel(); - mrEE.QuickInsertText( OUString('\n'), ESelection( rSel.nEndPara, rSel.nEndPos, rSel.nEndPara, rSel.nEndPos ) ); - ++rSel.nEndPara; - rSel.nEndPos = 0; + mrEE.QuickInsertText(OUString('\n'), ESelection(rSel.end)); + ++rSel.end.nPara; + rSel.end.nIndex = 0; GetCurrInfo().mnHeight += GetMaxLineHeight( meCurrObj ); GetCurrInfo().mnMaxLineHt = 0; } diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 50b58bb9471e..a95c334e0d5d 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -404,22 +404,19 @@ void ScHTMLLayoutParser::NewActEntry( const ScEEParseEntry* pE ) { if ( !pE->aSel.HasRange() ) { // Completely empty, following text ends up in the same paragraph! - mxActEntry->aSel.nStartPara = pE->aSel.nEndPara; - mxActEntry->aSel.nStartPos = pE->aSel.nEndPos; + mxActEntry->aSel.start = pE->aSel.end; } } - mxActEntry->aSel.nEndPara = mxActEntry->aSel.nStartPara; - mxActEntry->aSel.nEndPos = mxActEntry->aSel.nStartPos; + mxActEntry->aSel.CollapseToStart(); } void ScHTMLLayoutParser::EntryEnd( ScEEParseEntry* pE, const ESelection& rSel ) { - if ( rSel.nEndPara >= pE->aSel.nStartPara ) + if (rSel.end.nPara >= pE->aSel.start.nPara) { - pE->aSel.nEndPara = rSel.nEndPara; - pE->aSel.nEndPos = rSel.nEndPos; + pE->aSel.end = rSel.end; } - else if ( rSel.nStartPara == pE->aSel.nStartPara - 1 && !pE->aSel.HasRange() ) + else if (rSel.start.nPara == pE->aSel.start.nPara - 1 && !pE->aSel.HasRange()) { // Did not attach a paragraph, but empty, do nothing } else @@ -958,20 +955,20 @@ void ScHTMLLayoutParser::CloseEntry( const HtmlImportInfo* pInfo ) nColMax = nColCnt; // Global MaxCol for ScEEParser GetDimensions! EntryEnd(mxActEntry.get(), pInfo->aSelection); ESelection& rSel = mxActEntry->aSel; - while ( rSel.nStartPara < rSel.nEndPara - && pEdit->GetTextLen( rSel.nStartPara ) == 0 ) + while ( rSel.start.nPara < rSel.end.nPara + && pEdit->GetTextLen( rSel.start.nPara ) == 0 ) { // Strip preceding empty paragraphs - rSel.nStartPara++; + rSel.start.nPara++; } - while ( rSel.nEndPos == 0 && rSel.nEndPara > rSel.nStartPara ) + while ( rSel.end.nIndex == 0 && rSel.end.nPara > rSel.start.nPara ) { // Strip successive empty paragraphs - rSel.nEndPara--; - rSel.nEndPos = pEdit->GetTextLen( rSel.nEndPara ); + rSel.end.nPara--; + rSel.end.nIndex = pEdit->GetTextLen( rSel.end.nPara ); } - if ( rSel.nStartPara > rSel.nEndPara ) + if ( rSel.start.nPara > rSel.end.nPara ) { // Gives GPF in CreateTextObject OSL_FAIL( "CloseEntry: EditEngine ESelection Start > End" ); - rSel.nEndPara = rSel.nStartPara; + rSel.end.nPara = rSel.start.nPara; } if ( rSel.HasRange() ) mxActEntry->aItemSet.Put( ScLineBreakCell(true) ); @@ -989,7 +986,7 @@ IMPL_LINK( ScHTMLLayoutParser, HTMLImportHdl, HtmlImportInfo&, rInfo, void ) case HtmlImportState::Start: break; case HtmlImportState::End: - if ( rInfo.aSelection.nEndPos ) + if (rInfo.aSelection.end.nIndex) { // If text remains: create paragraph, without calling CloseEntry(). if( bInCell ) // ...but only in opened table cells. @@ -1577,9 +1574,9 @@ void ScHTMLLayoutParser::AnchorOn( HtmlImportInfo* pInfo ) bool ScHTMLLayoutParser::IsAtBeginningOfText( const HtmlImportInfo* pInfo ) { ESelection& rSel = mxActEntry->aSel; - return rSel.nStartPara == rSel.nEndPara && - rSel.nStartPara <= pInfo->aSelection.nEndPara && - pEdit->GetTextLen( rSel.nStartPara ) == 0; + return rSel.start.nPara == rSel.end.nPara && + rSel.start.nPara <= pInfo->aSelection.end.nPara && + pEdit->GetTextLen( rSel.start.nPara ) == 0; } void ScHTMLLayoutParser::FontOn( HtmlImportInfo* pInfo ) @@ -1831,39 +1828,35 @@ bool ScHTMLEntry::HasContents() const void ScHTMLEntry::AdjustStart( const HtmlImportInfo& rInfo ) { // set start position - aSel.nStartPara = rInfo.aSelection.nStartPara; - aSel.nStartPos = rInfo.aSelection.nStartPos; + aSel.start = rInfo.aSelection.start; // adjust end position - if( (aSel.nEndPara < aSel.nStartPara) || ((aSel.nEndPara == aSel.nStartPara) && (aSel.nEndPos < aSel.nStartPos)) ) + if (!aSel.IsAdjusted()) { - aSel.nEndPara = aSel.nStartPara; - aSel.nEndPos = aSel.nStartPos; + aSel.CollapseToStart(); } } void ScHTMLEntry::AdjustEnd( const HtmlImportInfo& rInfo ) { - OSL_ENSURE( (aSel.nEndPara < rInfo.aSelection.nEndPara) || - ((aSel.nEndPara == rInfo.aSelection.nEndPara) && (aSel.nEndPos <= rInfo.aSelection.nEndPos)), + OSL_ENSURE( !(rInfo.aSelection.end < aSel.end), "ScHTMLQueryParser::AdjustEntryEnd - invalid end position" ); // set end position - aSel.nEndPara = rInfo.aSelection.nEndPara; - aSel.nEndPos = rInfo.aSelection.nEndPos; + aSel.end = rInfo.aSelection.end; } void ScHTMLEntry::Strip( const EditEngine& rEditEngine ) { // strip leading empty paragraphs - while( (aSel.nStartPara < aSel.nEndPara) && (rEditEngine.GetTextLen( aSel.nStartPara ) <= aSel.nStartPos) ) + while( (aSel.start.nPara < aSel.end.nPara) && (rEditEngine.GetTextLen( aSel.start.nPara ) <= aSel.start.nIndex) ) { - ++aSel.nStartPara; - aSel.nStartPos = 0; + ++aSel.start.nPara; + aSel.start.nIndex = 0; } // strip trailing empty paragraphs - while( (aSel.nStartPara < aSel.nEndPara) && (aSel.nEndPos == 0) ) + while( (aSel.start.nPara < aSel.end.nPara) && (aSel.end.nIndex == 0) ) { - --aSel.nEndPara; - aSel.nEndPos = rEditEngine.GetTextLen( aSel.nEndPara ); + --aSel.end.nPara; + aSel.end.nIndex = rEditEngine.GetTextLen( aSel.end.nPara ); } } diff --git a/sc/source/filter/inc/commentsbuffer.hxx b/sc/source/filter/inc/commentsbuffer.hxx index c30d6765d6f6..04baa15b0b7e 100644 --- a/sc/source/filter/inc/commentsbuffer.hxx +++ b/sc/source/filter/inc/commentsbuffer.hxx @@ -60,6 +60,8 @@ public: /** Finalizes the formatted string of the comment. */ void finalizeImport(); + OUString getAuthorName(); + private: CommentModel maModel; }; @@ -79,6 +81,8 @@ public: /** Finalizes the formatted string of all comments. */ void finalizeImport(); + std::vector<OUString> getAuthors() const; + private: typedef RefVector< Comment > CommentVector; diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx index c7ab0aa96bd2..629ddfd18b5a 100644 --- a/sc/source/filter/inc/excrecds.hxx +++ b/sc/source/filter/inc/excrecds.hxx @@ -304,7 +304,7 @@ class XclExpXmlSheetPr : public XclExpRecordBase { public: explicit XclExpXmlSheetPr( - bool bFitToPages, SCTAB nScTab, const Color& rTabColor, XclExpFilterManager* pManager ); + bool bFitToPages, SCTAB nScTab, const Color& rTabColor, bool bSummaryBelow, XclExpFilterManager* pManager ); virtual void SaveXml( XclExpXmlStream& rStrm ) override; @@ -313,6 +313,7 @@ private: XclExpFilterManager* mpManager; bool mbFitToPage; Color maTabColor; + bool mbSummaryBelow; }; class XclExpFiltermode : public XclExpEmptyRecord diff --git a/sc/source/filter/inc/stylesbuffer.hxx b/sc/source/filter/inc/stylesbuffer.hxx index ec6f5800cb66..95ec8b8806ff 100644 --- a/sc/source/filter/inc/stylesbuffer.hxx +++ b/sc/source/filter/inc/stylesbuffer.hxx @@ -357,11 +357,14 @@ bool operator==( const ApiProtectionData& rLeft, const ApiProtectionData& rRight class Protection : public WorkbookHelper { public: - explicit Protection( const WorkbookHelper& rHelper ); + explicit Protection( const WorkbookHelper& rHelper, bool bDxf ); /** Sets all attributes from the protection element. */ void importProtection( const AttributeList& rAttribs ); + /** Sets the protection attributes from the passed BIFF12 DXF record data. */ + void importDxfProtection( sal_Int32 nElement, SequenceInputStream& rStrm ); + /** Sets the protection attributes from the passed BIFF12 XF record data. */ void setBiff12Data( sal_uInt32 nFlags ); @@ -375,8 +378,11 @@ public: private: ProtectionModel maModel; /// Protection model data. ApiProtectionData maApiData; /// Protection data converted to API constants. + bool mbDxf; }; +typedef std::shared_ptr< Protection > ProtectionRef; + /** Contains XML attributes of a single border line. */ struct BorderLineModel { @@ -667,6 +673,8 @@ public: BorderRef const & createBorder( bool bAlwaysNew = true ); /** Creates a new empty fill object. */ FillRef const & createFill( bool bAlwaysNew = true ); + /** Creates a new empty protection object. */ + ProtectionRef const & createProtection( bool bAlwaysNew = true ); /** Inserts a new number format code. */ void importNumFmt( const AttributeList& rAttribs ); diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx index 25f76087876b..48550e740388 100644 --- a/sc/source/filter/oox/commentsbuffer.cxx +++ b/sc/source/filter/oox/commentsbuffer.cxx @@ -154,9 +154,11 @@ namespace css::uno::Sequence<OUString> maPropertyNames; /// import filter Caption object formatting property names css::uno::Sequence<css::uno::Any> maPropertyValues; /// import filter Caption object formatting property values std::shared_ptr<RichString> mxText; + OUString msAuthorName; - OOXGenerateNoteCaption(std::shared_ptr<RichString>& rText) + OOXGenerateNoteCaption(std::shared_ptr<RichString>& rText, const OUString& rAuthorName = "") : mxText(rText) + , msAuthorName(rAuthorName) { } @@ -182,6 +184,8 @@ namespace { return mxText->getStringContent(); } + + virtual OUString GetAuthorName() const override { return msAuthorName; } }; } @@ -199,7 +203,7 @@ void Comment::finalizeImport() rtl::Reference<ScAnnotationsObj> xAnnos = static_cast<ScAnnotationsObj*>(pAnnosSupp->getAnnotations().get()); ScDocShell* pDocShell = xAnnos->GetDocShell(); - auto xGenerator = std::make_unique<OOXGenerateNoteCaption>(maModel.mxText); + auto xGenerator = std::make_unique<OOXGenerateNoteCaption>(maModel.mxText, getAuthorName()); // Add shape formatting properties (autoFill, colHidden and rowHidden are dropped) // vvv TODO vvv TextFitToSize should be a drawing::TextFitToSizeType not bool @@ -276,6 +280,13 @@ void Comment::finalizeImport() } } +OUString Comment::getAuthorName() +{ + if (o3tl::make_unsigned(this->maModel.mnAuthorId) < getComments().getAuthors().size()) + return getComments().getAuthors()[this->maModel.mnAuthorId]; + return ""; +} + // private -------------------------------------------------------------------- CommentsBuffer::CommentsBuffer( const WorksheetHelper& rHelper ) : @@ -288,6 +299,8 @@ void CommentsBuffer::appendAuthor( const OUString& rAuthor ) maAuthors.push_back( rAuthor ); } +std::vector<OUString> CommentsBuffer::getAuthors() const { return maAuthors; } + CommentRef CommentsBuffer::createComment() { CommentRef xComment = std::make_shared<Comment>( *this ); diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx index b106a557e13d..f1e36eb67bc0 100644 --- a/sc/source/filter/oox/pivottablebuffer.cxx +++ b/sc/source/filter/oox/pivottablebuffer.cxx @@ -1355,7 +1355,10 @@ void PivotTable::finalizeImport() mpDPObject->PutInteropGrabBag(std::move(maInteropGrabBag)); // insert the DataPilot table into the sheet + ScDocument& rDoc = getDocImport().getDoc(); + rDoc.SetImportingXML(true); xDPTables->insertNewByName( maDefModel.maName, aPos, mxDPDescriptor ); + rDoc.SetImportingXML(false); } catch( Exception& ) { diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx index 06db87e3c733..6f2a75b5f721 100644 --- a/sc/source/filter/oox/richstring.cxx +++ b/sc/source/filter/oox/richstring.cxx @@ -108,8 +108,7 @@ void RichStringPortion::convert( const Reference< XText >& rxText, bool bReplace void RichStringPortion::convert( ScEditEngineDefaulter& rEE, ESelection& rSelection, const oox::xls::Font* pFont ) { - rSelection.nStartPos = rSelection.nEndPos; - rSelection.nStartPara = rSelection.nEndPara; + rSelection.CollapseToEnd(); SfxItemSet aItemSet( rEE.GetEmptyItemSet() ); const Font* pFontToUse = mxFont ? mxFont.get() : lclNeedsRichTextFormat( pFont ) ? pFont : nullptr; @@ -125,18 +124,18 @@ void RichStringPortion::convert( ScEditEngineDefaulter& rEE, ESelection& rSelect { nLastParaLoc = nSearchIndex; ++nParaOccurrence; - rSelection.nEndPos = 0; + rSelection.end.nIndex = 0; nSearchIndex = maText.indexOf( '\n', nSearchIndex + 1); } - rSelection.nEndPara += nParaOccurrence; + rSelection.end.nPara += nParaOccurrence; if ( nLastParaLoc != -1 ) { - rSelection.nEndPos = maText.getLength() - 1 - nLastParaLoc; + rSelection.end.nIndex = maText.getLength() - 1 - nLastParaLoc; } else { - rSelection.nEndPos = rSelection.nStartPos + maText.getLength(); + rSelection.end.nIndex = rSelection.start.nIndex + maText.getLength(); } rEE.QuickSetAttribs( aItemSet, rSelection ); } diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 5f64cf61addb..efdca05255e5 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -183,6 +183,8 @@ const sal_uInt16 BIFF12_DXF_FONT_HEIGHT = 36; const sal_uInt16 BIFF12_DXF_FONT_SCHEME = 37; const sal_uInt16 BIFF12_DXF_NUMFMT_CODE = 38; const sal_uInt16 BIFF12_DXF_NUMFMT_ID = 41; +const sal_uInt16 BIFF12_DXF_CELL_LOCKED = 43; +const sal_uInt16 BIFF12_DXF_CELL_HIDDEN = 44; // BIFF12 CELLSTYLE flags const sal_uInt16 BIFF12_CELLSTYLE_BUILTIN = 0x0001; @@ -1368,8 +1370,9 @@ bool operator==( const ApiProtectionData& rLeft, const ApiProtectionData& rRight (rLeft.maCellProt.IsPrintHidden == rRight.maCellProt.IsPrintHidden); } -Protection::Protection( const WorkbookHelper& rHelper ) : - WorkbookHelper( rHelper ) +Protection::Protection( const WorkbookHelper& rHelper, bool bDxf ) : + WorkbookHelper( rHelper ), + mbDxf( bDxf ) { } @@ -1379,6 +1382,23 @@ void Protection::importProtection( const AttributeList& rAttribs ) maModel.mbHidden = rAttribs.getBool( XML_hidden, false ); } +void Protection::importDxfProtection( sal_Int32 nElement, SequenceInputStream& rStrm ) +{ + SAL_WARN_IF( !mbDxf, "sc", "Protection::importDxfProtection - missing protection flag" ); + bool bFlag = rStrm.readuInt8() != 0; + switch( nElement ) + { + case XML_locked: + maModel.mbLocked = bFlag; + break; + case XML_hidden: + maModel.mbHidden = bFlag; + break; + default: + OSL_FAIL( "Protection::importDxfProtection - unexpected element identifier" ); + } +} + void Protection::setBiff12Data( sal_uInt32 nFlags ) { maModel.mbLocked = getFlag( nFlags, BIFF12_XF_LOCKED ); @@ -2005,7 +2025,7 @@ Xf::Xf( const WorkbookHelper& rHelper ) : WorkbookHelper( rHelper ), mnScNumFmt(0), maAlignment( rHelper ), - maProtection( rHelper ), + maProtection( rHelper, false ), meRotationRef( css::table::CellVertJustify2::STANDARD ), mpStyleSheet( nullptr ) { @@ -2341,6 +2361,13 @@ FillRef const & Dxf::createFill( bool bAlwaysNew ) return mxFill; } +ProtectionRef const & Dxf::createProtection( bool bAlwaysNew ) +{ + if ( bAlwaysNew || !mxProtection ) + mxProtection = std::make_shared<Protection>( *this, true ); + return mxProtection; +} + void Dxf::importNumFmt( const AttributeList& rAttribs ) { // don't propagate number formats defined in Dxf entries @@ -2391,6 +2418,8 @@ void Dxf::importDxf( SequenceInputStream& rStrm ) case BIFF12_DXF_FONT_SCHEME: createFont( false )->importDxfScheme( rStrm ); break; case BIFF12_DXF_NUMFMT_CODE: aFmtCode = BiffHelper::readString( rStrm, false ); break; case BIFF12_DXF_NUMFMT_ID: nNumFmtId = rStrm.readuInt16(); break; + case BIFF12_DXF_CELL_LOCKED: createProtection( false )->importDxfProtection( XML_locked, rStrm ); break; + case BIFF12_DXF_CELL_HIDDEN: createProtection( false )->importDxfProtection( XML_hidden, rStrm ); break; } rStrm.seek( nRecEnd ); } diff --git a/sc/source/filter/oox/stylesfragment.cxx b/sc/source/filter/oox/stylesfragment.cxx index de6312b9649c..1d20b98519ff 100644 --- a/sc/source/filter/oox/stylesfragment.cxx +++ b/sc/source/filter/oox/stylesfragment.cxx @@ -151,8 +151,8 @@ ContextHandlerRef DxfContext::onCreateContext( sal_Int32 nElement, const Attribu case XLS_TOKEN( numFmt ): mxDxf->importNumFmt( rAttribs ); break; #if 0 case XLS_TOKEN( alignment ): mxDxf->importAlignment( rAttribs ); break; - case XLS_TOKEN( protection ): mxDxf->importProtection( rAttribs ); break; #endif + case XLS_TOKEN( protection ): mxDxf->createProtection()->importProtection( rAttribs ); break; } break; @@ -163,6 +163,7 @@ ContextHandlerRef DxfContext::onCreateContext( sal_Int32 nElement, const Attribu case XLS_TOKEN( border ): return new BorderContext( *this, mxDxf->createBorder() ); case XLS_TOKEN( fill ): return new FillContext( *this, mxDxf->createFill() ); case XLS_TOKEN( numFmt ): mxDxf->importNumFmt( rAttribs ); break; + case XLS_TOKEN( protection ): mxDxf->createProtection()->importProtection( rAttribs ); break; } break; } diff --git a/sc/source/filter/oox/worksheetsettings.cxx b/sc/source/filter/oox/worksheetsettings.cxx index 988207aa9067..46d633044115 100644 --- a/sc/source/filter/oox/worksheetsettings.cxx +++ b/sc/source/filter/oox/worksheetsettings.cxx @@ -287,6 +287,12 @@ void WorksheetSettings::finalizeImport() ::Color nColor = maSheetSettings.maTabColor.getColor( getBaseFilter().getGraphicHelper() ); aPropSet.setProperty( PROP_TabColor, nColor ); } + + // Summary data below or above the contents + if ( !maSheetSettings.mbSummaryBelow ) + { + aPropSet.setProperty( PROP_TotalsRowBelow, false ); + } } } // namespace oox::xls diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 1f5ac13f358a..e4b5667643b5 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -1388,13 +1388,12 @@ void ScOrcusSharedStrings::set_segment_font_color( void ScOrcusSharedStrings::append_segment(std::string_view s) { - sal_Int32 nPos = mrEditEngine.GetText().getLength(); - ESelection aSel{0, nPos, 0, nPos}; // end of current text + ESelection aSel{ mrEditEngine.GetEnd() }; // end of current text OUString aStr = toOUString(s); mrEditEngine.QuickInsertText(aStr, aSel); - aSel.nEndPos += aStr.getLength(); // expand the selection over the current segment + aSel.end = mrEditEngine.GetEnd(); // expand the selection over the current segment maFormatSegments.emplace_back(aSel, maCurFormat); maCurFormat.ClearItem(); } diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index e6f1072f3fbe..356432b7a07c 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -109,7 +109,7 @@ namespace bool IsValidSel(const ScTabEditEngine& rEngine, const ESelection& rSel) { const auto nParaCount = rEngine.GetParagraphCount(); - return rSel.nStartPara < nParaCount && rSel.nEndPara < nParaCount; + return rSel.start.nPara < nParaCount && rSel.end.nPara < nParaCount; } } @@ -178,7 +178,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu aSet.ClearItem( EE_PARA_JUST ); // Test whether simple String without mixed attributes - bool bSimple = ( pE->aSel.nStartPara == pE->aSel.nEndPara ); + bool bSimple = (pE->aSel.start.nPara == pE->aSel.end.nPara); for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END && bSimple; nId++) { const SfxPoolItem* pItem = nullptr; @@ -356,7 +356,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu OUString aStr; if( pE->bEntirePara ) { - aStr = mpEngine->GetText( pE->aSel.nStartPara ); + aStr = mpEngine->GetText(pE->aSel.start.nPara); } else { @@ -661,8 +661,8 @@ ScEEParser::~ScEEParser() void ScEEParser::NewActEntry( const ScEEParseEntry* pE ) { // New free-flying mxActEntry mxActEntry = std::make_shared<ScEEParseEntry>(pPool.get()); - mxActEntry->aSel.nStartPara = (pE ? pE->aSel.nEndPara + 1 : 0); - mxActEntry->aSel.nStartPos = 0; + mxActEntry->aSel.start.nPara = (pE ? pE->aSel.end.nPara + 1 : 0); + mxActEntry->aSel.start.nIndex = 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx index c56b3f7d540e..3143ba36f52e 100644 --- a/sc/source/filter/rtf/rtfparse.cxx +++ b/sc/source/filter/rtf/rtfparse.cxx @@ -66,13 +66,11 @@ ErrCode ScRTFParser::Read( SvStream& rStream, const OUString& rBaseURL ) { auto& pE = maList.back(); if ( // Completely empty - ( pE->aSel.nStartPara == pE->aSel.nEndPara - && pE->aSel.nStartPos == pE->aSel.nEndPos - ) + ( !pE->aSel.HasRange() ) || // Empty paragraph - ( pE->aSel.nStartPara + 1 == pE->aSel.nEndPara - && pE->aSel.nStartPos == pEdit->GetTextLen( pE->aSel.nStartPara ) - && pE->aSel.nEndPos == 0 + ( pE->aSel.start.nPara + 1 == pE->aSel.end.nPara + && pE->aSel.start.nIndex == pEdit->GetTextLen( pE->aSel.start.nPara ) + && pE->aSel.end.nIndex == 0 ) ) { // Don't take over the last paragraph @@ -88,9 +86,9 @@ ErrCode ScRTFParser::Read( SvStream& rStream, const OUString& rBaseURL ) void ScRTFParser::EntryEnd( ScEEParseEntry* pE, const ESelection& aSel ) { // Paragraph -2 strips the attached empty paragraph - pE->aSel.nEndPara = aSel.nEndPara - 2; + pE->aSel.end.nPara = aSel.end.nPara - 2; // Although it's called nEndPos, the last one is position + 1 - pE->aSel.nEndPos = pEdit->GetTextLen( aSel.nEndPara - 1 ); + pE->aSel.end.nIndex = pEdit->GetTextLen(aSel.end.nPara - 1); } inline void ScRTFParser::NextRow() @@ -171,13 +169,13 @@ IMPL_LINK( ScRTFParser, RTFImportHdl, RtfImportInfo&, rInfo, void ) } break; case RtfImportState::End: - if ( rInfo.aSelection.nEndPos ) + if ( rInfo.aSelection.end.nIndex ) { // If still text: create last paragraph pActDefault = nullptr; rInfo.nToken = RTF_PAR; // EditEngine did not attach an empty paragraph anymore // which EntryEnd could strip - rInfo.aSelection.nEndPara++; + rInfo.aSelection.end.nPara++; ProcToken( &rInfo ); } break; @@ -352,7 +350,7 @@ void ScRTFParser::ProcToken( RtfImportInfo* pInfo ) } // Adjust selection of free-flying mxActEntry // Paragraph -1 due to separated text in EditEngine during parsing - mxActEntry->aSel.nStartPara = pInfo->aSelection.nEndPara - 1; + mxActEntry->aSel.start.nPara = pInfo->aSelection.end.nPara - 1; } pActDefault = nullptr; diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx index 89ebcc27373c..7c28d5c81125 100644 --- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx +++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx @@ -655,6 +655,9 @@ private: if (aParam.bCaseSens) mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CASE_SENSITIVE, XML_TRUE); + if (!aParam.bSummaryBelow) + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_SUMMARY_BELOW, XML_FALSE); + SvXMLElementExport aElemSTRs(mrExport, XML_NAMESPACE_TABLE, XML_SUBTOTAL_RULES, true, true); if (aParam.bDoSort) diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 045851b680ea..83a646c1f778 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -328,10 +328,9 @@ void ScXMLTableRowCellContext::PushParagraphField(std::unique_ptr<SvxFieldData> sal_Int32 nPos = maParagraph.getLength(); maParagraph.append('\1'); // Placeholder text for inserted field item. - rField.maSelection.nStartPara = mnCurParagraph; - rField.maSelection.nEndPara = mnCurParagraph; - rField.maSelection.nStartPos = nPos; - rField.maSelection.nEndPos = nPos+1; + rField.maSelection.start.nPara = rField.maSelection.end.nPara = mnCurParagraph; + rField.maSelection.start.nIndex = nPos; + rField.maSelection.end.nIndex = nPos+1; PushFormat(nPos, nPos+1, rStyleName); } @@ -370,9 +369,9 @@ void ScXMLTableRowCellContext::PushFormat(sal_Int32 nBegin, sal_Int32 nEnd, cons mbHasFormatRuns = true; maFormats.push_back(std::make_unique<ParaFormat>(*mpEditEngine)); ParaFormat& rFmt = *maFormats.back(); - rFmt.maSelection.nStartPara = rFmt.maSelection.nEndPara = mnCurParagraph; - rFmt.maSelection.nStartPos = nBegin; - rFmt.maSelection.nEndPos = nEnd; + rFmt.maSelection.start.nPara = rFmt.maSelection.end.nPara = mnCurParagraph; + rFmt.maSelection.start.nIndex = nBegin; + rFmt.maSelection.end.nIndex = nEnd; // Store the used text styles for export. ScSheetSaveData* pSheetData = rXMLImport.GetScModel()->GetSheetSaveData(); diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index 5708c74d2fa3..bfa6be8c898f 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -99,6 +99,7 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport, bSubTotalsBindFormatsToContent(false), bSubTotalsIsCaseSensitive(false), bSubTotalsInsertPageBreaks(false), + bSubTotalsSummaryBelow(true), bSubTotalsSortGroups(false), bSubTotalsEnabledUserList(false), bSubTotalsAscending(true), @@ -325,6 +326,7 @@ std::unique_ptr<ScDBData> ScXMLDatabaseRangeContext::ConvertToDBData(const OUStr aParam.bUserDef = bSubTotalsEnabledUserList; aParam.nUserIndex = nSubTotalsUserListIndex; aParam.bPagebreak = bSubTotalsInsertPageBreaks; + aParam.bSummaryBelow = bSubTotalsSummaryBelow; aParam.bCaseSens = bSubTotalsIsCaseSensitive; aParam.bDoSort = bSubTotalsSortGroups; aParam.bAscending = bSubTotalsAscending; @@ -634,6 +636,9 @@ ScXMLSubTotalRulesContext::ScXMLSubTotalRulesContext( ScXMLImport& rImport, case XML_ELEMENT( TABLE, XML_PAGE_BREAKS_ON_GROUP_CHANGE ): pDatabaseRangeContext->SetSubTotalsInsertPageBreaks(IsXMLToken(aIter, XML_TRUE)); break; + case XML_ELEMENT( LO_EXT, XML_SUMMARY_BELOW ): + pDatabaseRangeContext->SetSubTotalsSummaryBelow(IsXMLToken(aIter, XML_TRUE)); + break; } } } diff --git a/sc/source/filter/xml/xmldrani.hxx b/sc/source/filter/xml/xmldrani.hxx index a35074117c28..4f5b951751c1 100644 --- a/sc/source/filter/xml/xmldrani.hxx +++ b/sc/source/filter/xml/xmldrani.hxx @@ -76,6 +76,7 @@ class ScXMLDatabaseRangeContext : public ScXMLImportContext bool bSubTotalsBindFormatsToContent; bool bSubTotalsIsCaseSensitive; bool bSubTotalsInsertPageBreaks; + bool bSubTotalsSummaryBelow; bool bSubTotalsSortGroups; bool bSubTotalsEnabledUserList; bool bSubTotalsAscending; @@ -106,6 +107,7 @@ public: void SetSubTotalsBindFormatsToContent(const bool bTemp ) { bSubTotalsBindFormatsToContent = bTemp; } void SetSubTotalsIsCaseSensitive(const bool bTemp) { bSubTotalsIsCaseSensitive = bTemp; } void SetSubTotalsInsertPageBreaks(const bool bTemp) { bSubTotalsInsertPageBreaks = bTemp; } + void SetSubTotalsSummaryBelow(const bool bTemp) { bSubTotalsSummaryBelow = bTemp; } void SetSubTotalsEnabledUserList(const bool bTemp) { bSubTotalsEnabledUserList = bTemp; } void SetSubTotalsUserListIndex(const sal_Int16 nTemp) { nSubTotalsUserListIndex = nTemp; } void SetSubTotalsAscending(const bool bTemp) { bSubTotalsAscending = bTemp; } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 1df4db82e50c..89af13ff9df5 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2420,7 +2420,7 @@ void ScXMLExport::collectAutoStyles() SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); uno::Reference<container::XEnumerationAccess> xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xParaProp( - lcl_GetEnumerated( xCellText, rNoteParaEntry.maSelection.nStartPara ), uno::UNO_QUERY ); + lcl_GetEnumerated( xCellText, rNoteParaEntry.maSelection.start.nPara ), uno::UNO_QUERY ); if ( xParaProp.is() ) { std::vector<XMLPropertyState> aPropStates(xParaPropMapper->Filter(*this, xParaProp)); @@ -2925,6 +2925,11 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::Reference<sheet::XSpre if (pProtect->isOptionEnabled(ScTableProtection::DELETE_ROWS)) AddAttribute(XML_NAMESPACE_LO_EXT, XML_DELETE_ROWS, XML_TRUE); + if (pProtect->isOptionEnabled(ScTableProtection::AUTOFILTER)) + AddAttribute(XML_NAMESPACE_LO_EXT, XML_USE_AUTOFILTER, XML_TRUE); + if (pProtect->isOptionEnabled(ScTableProtection::PIVOT_TABLES)) + AddAttribute(XML_NAMESPACE_LO_EXT, XML_USE_PIVOT, XML_TRUE); + OUString aElemName = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_LO_EXT, GetXMLToken(XML_TABLE_PROTECTION)); diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index 7e5083f2a3c9..97c44d7ff5ad 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -49,7 +49,9 @@ ScXMLTabProtectionData::ScXMLTabProtectionData() : mbInsertColumns(false), mbInsertRows(false), mbDeleteColumns(false), - mbDeleteRows(false) + mbDeleteRows(false), + mbUseAutoFilter(false), + mbUsePivot(false) { } @@ -203,6 +205,8 @@ void ScMyTables::DeleteTable() aProtect.setOption(ScTableProtection::INSERT_ROWS, maProtectionData.mbInsertRows); aProtect.setOption(ScTableProtection::DELETE_COLUMNS, maProtectionData.mbDeleteColumns); aProtect.setOption(ScTableProtection::DELETE_ROWS, maProtectionData.mbDeleteRows); + aProtect.setOption(ScTableProtection::AUTOFILTER, maProtectionData.mbUseAutoFilter); + aProtect.setOption(ScTableProtection::PIVOT_TABLES, maProtectionData.mbUsePivot); rImport.GetDocument()->SetTabProtection(maCurrentCellPos.Tab(), &aProtect); } diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx index b0c6e7457224..0bf64092b1ee 100644 --- a/sc/source/filter/xml/xmlsubti.hxx +++ b/sc/source/filter/xml/xmlsubti.hxx @@ -42,6 +42,8 @@ struct ScXMLTabProtectionData bool mbInsertRows; bool mbDeleteColumns; bool mbDeleteRows; + bool mbUseAutoFilter; + bool mbUsePivot; ScXMLTabProtectionData(); }; diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index af4ba33d3c6f..5010c70b5e11 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -417,6 +417,8 @@ ScXMLTableProtectionContext::ScXMLTableProtectionContext( bool bInsertRows = false; bool bDeleteColumns = false; bool bDeleteRows = false; + bool bUseAutoFilter = false; + bool bUsePivot = false; if ( rAttrList.is() ) { @@ -447,6 +449,12 @@ ScXMLTableProtectionContext::ScXMLTableProtectionContext( case XML_ELEMENT( LO_EXT, XML_DELETE_ROWS ): bDeleteRows = IsXMLToken(aIter, XML_TRUE); break; + case XML_ELEMENT( LO_EXT, XML_USE_AUTOFILTER ): + bUseAutoFilter = IsXMLToken(aIter, XML_TRUE); + break; + case XML_ELEMENT( LO_EXT, XML_USE_PIVOT ): + bUsePivot = IsXMLToken(aIter, XML_TRUE); + break; default: XMLOFF_WARN_UNKNOWN("sc", aIter); } @@ -460,6 +468,8 @@ ScXMLTableProtectionContext::ScXMLTableProtectionContext( rProtectData.mbInsertRows = bInsertRows; rProtectData.mbDeleteColumns = bDeleteColumns; rProtectData.mbDeleteRows = bDeleteRows; + rProtectData.mbUseAutoFilter = bUseAutoFilter; + rProtectData.mbUsePivot = bUsePivot; } ScXMLTableProtectionContext::~ScXMLTableProtectionContext() diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 3f5dddadce5f..157564a79bed 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -347,12 +347,12 @@ static inline void incPos( const sal_Unicode c, sal_Int32& rPos, ESelection& rSe ++rPos; if (c == '\n') { - ++rSel.nEndPara; - rSel.nEndPos = 0; + ++rSel.end.nPara; + rSel.end.nIndex = 0; } else { - ++rSel.nEndPos; + ++rSel.end.nIndex; } } @@ -399,8 +399,7 @@ void ScInputHandler::InitRangeFinder( const OUString& rFormula ) } // Text between separators. We only consider within one line/paragraph. - aSel.nStartPara = aSel.nEndPara; - aSel.nStartPos = aSel.nEndPos; + aSel.CollapseToEnd(); nStart = nPos; handle_r1c1: { @@ -632,8 +631,7 @@ static void lcl_Replace( EditView* pView, const OUString& rNewStr, const ESelect ESelection aOldSel = pView->GetSelection(); if (aOldSel.HasRange()) - pView->SetSelection( ESelection( aOldSel.nEndPara, aOldSel.nEndPos, - aOldSel.nEndPara, aOldSel.nEndPos ) ); + pView->SetSelection(ESelection(aOldSel.end)); EditEngine& rEngine = pView->getEditEngine(); rEngine.QuickInsertText( rNewStr, rOldSel ); @@ -642,10 +640,7 @@ static void lcl_Replace( EditView* pView, const OUString& rNewStr, const ESelect // To do that we need to cancel the selection from above (before QuickInsertText) pView->InsertText( OUString() ); - const sal_Int32 nPara = rEngine.GetParagraphCount() - 1; - const sal_Int32 nLen = rEngine.GetTextLen(nPara); - ESelection aSel( nPara, nLen, nPara, nLen ); - pView->SetSelection( aSel ); // Set cursor to the end + pView->SetSelection(ESelection::AtEnd()); // Set cursor to the end } void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew ) @@ -669,8 +664,8 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew ) lcl_Replace( pTableView, aNewStr, rData.maSel ); // We are within one paragraph. - const sal_Int32 nDiff = aNewStr.getLength() - (rData.maSel.nEndPos - rData.maSel.nStartPos); - rData.maSel.nEndPos += nDiff; + const sal_Int32 nDiff = aNewStr.getLength() - (rData.maSel.end.nIndex - rData.maSel.start.nIndex); + rData.maSel.end.nIndex += nDiff; aSet.Put( SvxColorItem( nNewColor, EE_CHAR_COLOR ) ); mpEditEngine->QuickSetAttribs( aSet, rData.maSel ); @@ -688,11 +683,11 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew ) for (size_t i = nIndex + 1; i < nCount; ++i) { ScRangeFindData& rNext = pRangeFindList->GetObject( i ); - if (rNext.maSel.nStartPara != rData.maSel.nStartPara) + if (rNext.maSel.start.nPara != rData.maSel.start.nPara) break; - rNext.maSel.nStartPos += nDiff; - rNext.maSel.nEndPos += nDiff; + rNext.maSel.start.nIndex += nDiff; + rNext.maSel.end.nIndex += nDiff; } } @@ -1309,12 +1304,12 @@ void ScInputHandler::ShowTipCursor() ESelection aSel = pActiveView->GetSelection(); aSel.Adjust(); - if ( aParagraph.getLength() < aSel.nEndPos ) + if (aParagraph.getLength() < aSel.end.nIndex) return; - if ( aSel.nEndPos > 0 ) + if (aSel.end.nIndex > 0) { - OUString aSelText( aParagraph.copy( 0, aSel.nEndPos )); + OUString aSelText(aParagraph.copy(0, aSel.end.nIndex)); ShowArgumentsTip( aSelText ); } @@ -1558,21 +1553,21 @@ void ScInputHandler::UseFormulaData() // Due to differences between table and input cell (e.g clipboard with line breaks), // the selection may not be in line with the EditEngine anymore. // Just return without any indication as to why. - if ( aSel.nEndPos > aParagraph.getLength() ) + if (aSel.end.nIndex > aParagraph.getLength()) return; - if ( aParagraph.getLength() > aSel.nEndPos && - ( ScGlobal::getCharClass().isLetterNumeric( aParagraph, aSel.nEndPos ) || - aParagraph[ aSel.nEndPos ] == '_' || - aParagraph[ aSel.nEndPos ] == '.' || - aParagraph[ aSel.nEndPos ] == '$' ) ) + if ( aParagraph.getLength() > aSel.end.nIndex && + ( ScGlobal::getCharClass().isLetterNumeric( aParagraph, aSel.end.nIndex ) || + aParagraph[ aSel.end.nIndex ] == '_' || + aParagraph[ aSel.end.nIndex ] == '.' || + aParagraph[ aSel.end.nIndex ] == '$' ) ) return; // Is the cursor at the end of a word? - if ( aSel.nEndPos <= 0 ) + if (aSel.end.nIndex <= 0) return; - OUString aSelText( aParagraph.copy( 0, aSel.nEndPos )); + OUString aSelText(aParagraph.copy(0, aSel.end.nIndex)); OUString aText; if ( GetFuncName( aSelText, aText ) ) @@ -1646,38 +1641,38 @@ void completeFunction( EditView* pView, const OUString& rInsert, bool& rParInser if ( comphelper::LibreOfficeKit::isActive() ) { ESelection aSelRange = aSel; - --aSelRange.nStartPos; - --aSelRange.nEndPos; + --aSelRange.start.nIndex; + --aSelRange.end.nIndex; pView->SetSelection(aSelRange); pView->SelectCurrentWord(); if ( aOld == "=" ) { bNoInitialLetter = true; - aSelRange.nStartPos = 1; - aSelRange.nEndPos = 1; + aSelRange.start.nIndex = 1; + aSelRange.end.nIndex = 1; pView->SetSelection(aSelRange); } else if ( pView->GetSelected().startsWith("()") ) { bNoInitialLetter = true; - ++aSelRange.nStartPos; - ++aSelRange.nEndPos; + ++aSelRange.start.nIndex; + ++aSelRange.end.nIndex; pView->SetSelection(aSelRange); } } if(!bNoInitialLetter) { - const sal_Int32 nMinLen = std::max(aSel.nEndPos - aSel.nStartPos, sal_Int32(1)); + const sal_Int32 nMinLen = std::max(aSel.end.nIndex - aSel.start.nIndex, sal_Int32(1)); // Since transliteration service is used to test for match, the replaced string could be // longer than rInsert, so in order to find longest match before the cursor, test whole // string from start to current cursor position (don't limit to length of rInsert) // Disclaimer: I really don't know if a match longer than rInsert is actually possible, // so the above is based on assumptions how "transliteration" might possibly work. If - // it's in fact impossible, an optimization would be useful to limit aSel.nStartPos to - // std::max(sal_Int32(0), aSel.nEndPos - rInsert.getLength()). - aSel.nStartPos = 0; + // it's in fact impossible, an optimization would be useful to limit aSel.start.nPos to + // std::max(sal_Int32(0), aSel.end.nIndex - rInsert.getLength()). + aSel.start.nIndex = 0; pView->SetSelection(aSel); const OUString aAll = pView->GetSelected(); OUString aMatch; @@ -1688,7 +1683,7 @@ void completeFunction( EditView* pView, const OUString& rInsert, bool& rParInser aMatch = aTest; // Found => break the loop } - aSel.nStartPos = aSel.nEndPos - aMatch.getLength(); + aSel.start.nIndex = aSel.end.nIndex - aMatch.getLength(); pView->SetSelection(aSel); } @@ -1703,9 +1698,9 @@ void completeFunction( EditView* pView, const OUString& rInsert, bool& rParInser ESelection aWordSel = pView->GetSelection(); // aWordSel.EndPos points one behind string if word at end - if (aWordSel.nEndPos < aOld.getLength()) + if (aWordSel.end.nIndex < aOld.getLength()) { - sal_Unicode cNext = aOld[aWordSel.nEndPos]; + sal_Unicode cNext = aOld[aWordSel.end.nIndex]; if ( cNext == '(' ) { bDoParen = false; @@ -1719,8 +1714,8 @@ void completeFunction( EditView* pView, const OUString& rInsert, bool& rParInser if ( bDoParen ) // Put cursor between parentheses { aSel = pView->GetSelection(); - --aSel.nStartPos; - --aSel.nEndPos; + --aSel.start.nIndex; + --aSel.end.nIndex; pView->SetSelection(aSel); rParInserted = true; @@ -1814,14 +1809,14 @@ void ScTabViewShell::LOKSendFormulabarUpdate(EditView* pActiveView, OUString aSelection; if (pActiveView) { - aSelection = OUString::number(pActiveView->GetPosWithField(0, rSelection.nStartPos)) + ";" + - OUString::number(pActiveView->GetPosWithField(0, rSelection.nEndPos)) + ";" + - OUString::number(rSelection.nStartPara) + ";" + OUString::number(rSelection.nEndPara); + aSelection = OUString::number(pActiveView->GetPosWithField(0, rSelection.start.nIndex)) + ";" + + OUString::number(pActiveView->GetPosWithField(0, rSelection.end.nIndex)) + ";" + + OUString::number(rSelection.start.nPara) + ";" + OUString::number(rSelection.end.nPara); } else { - aSelection = OUString::number(rSelection.nStartPos) + ";" + OUString::number(rSelection.nEndPos) + ";" + - OUString::number(rSelection.nStartPara) + ";" + OUString::number(rSelection.nEndPara); + aSelection = OUString::number(rSelection.start.nIndex) + ";" + OUString::number(rSelection.end.nIndex) + ";" + + OUString::number(rSelection.start.nPara) + ";" + OUString::number(rSelection.end.nPara); } sal_uInt64 nCurrentShellId = reinterpret_cast<sal_uInt64>(this); @@ -1968,10 +1963,10 @@ void ScInputHandler::PasteManualTip() ESelection aSel = pActiveView->GetSelection(); aSel.Adjust(); - OSL_ENSURE( !aSel.nStartPara && !aSel.nEndPara, "Too many paragraphs in Formula" ); - if ( !aSel.nStartPos ) // Selection from the start? + OSL_ENSURE( !aSel.start.nPara && !aSel.end.nPara, "Too many paragraphs in Formula" ); + if ( !aSel.start.nIndex ) // Selection from the start? { - if ( aSel.nEndPos == mpEditEngine->GetTextLen(0) ) + if ( aSel.end.nIndex == mpEditEngine->GetTextLen(0) ) { // Everything selected -> skip quotation marks if ( aInsert[0] == '"' ) @@ -1980,11 +1975,11 @@ void ScInputHandler::PasteManualTip() if ( aInsert.endsWith("\"") ) aInsert = aInsert.copy( 0, nInsLen-1 ); } - else if ( aSel.nEndPos ) + else if ( aSel.end.nIndex ) { // Not everything selected -> do not overwrite equality sign //FIXME: Even double equality signs?? - aSel.nStartPos = 1; + aSel.start.nIndex = 1; if ( pTopView ) pTopView->SetSelection( aSel ); if ( pTableView ) @@ -2020,7 +2015,7 @@ bool ScInputHandler::CursorAtClosingPar() if ( pActiveView && !pActiveView->HasSelection() && bFormulaMode ) { ESelection aSel = pActiveView->GetSelection(); - sal_Int32 nPos = aSel.nStartPos; + sal_Int32 nPos = aSel.start.nIndex; OUString aFormula = mpEditEngine->GetText(0); if ( nPos < aFormula.getLength() && aFormula[nPos] == ')' ) return true; @@ -2037,8 +2032,8 @@ void ScInputHandler::SkipClosingPar() if (pActiveView) { ESelection aSel = pActiveView->GetSelection(); - ++aSel.nStartPos; - ++aSel.nEndPos; + ++aSel.start.nIndex; + ++aSel.end.nIndex; // this is in a formula (only one paragraph), so the selection // can be used directly for the TopView @@ -2087,11 +2082,11 @@ void ScInputHandler::UseColData() // When typing aSel.Adjust(); sal_Int32 nParCnt = mpEditEngine->GetParagraphCount(); - if ( aSel.nEndPara+1 != nParCnt ) + if (aSel.end.nPara + 1 != nParCnt) return; - sal_Int32 nParLen = mpEditEngine->GetTextLen( aSel.nEndPara ); - if ( aSel.nEndPos != nParLen ) + sal_Int32 nParLen = mpEditEngine->GetTextLen(aSel.end.nPara); + if (aSel.end.nIndex != nParLen) return; OUString aText = GetEditText(mpEditEngine.get()); @@ -2135,8 +2130,8 @@ void ScInputHandler::UseColData() // When typing // Selection must be "backwards", so the cursor stays behind the last // typed character - ESelection aSelection( aSel.nEndPara, aSel.nEndPos + aIns.getLength(), - aSel.nEndPara, aSel.nEndPos ); + ESelection aSelection( aSel.end.nPara, aSel.end.nIndex + aIns.getLength(), + aSel.end.nPara, aSel.end.nIndex ); // When editing in input line, apply to both edit views if ( pTableView ) @@ -2164,12 +2159,12 @@ void ScInputHandler::NextAutoEntry( bool bBack ) ESelection aSel = pActiveView->GetSelection(); aSel.Adjust(); sal_Int32 nParCnt = mpEditEngine->GetParagraphCount(); - if ( aSel.nEndPara+1 == nParCnt && aSel.nStartPara == aSel.nEndPara ) + if ( aSel.end.nPara+1 == nParCnt && aSel.start.nPara == aSel.end.nPara ) { OUString aText = GetEditText(mpEditEngine.get()); - sal_Int32 nSelLen = aSel.nEndPos - aSel.nStartPos; - sal_Int32 nParLen = mpEditEngine->GetTextLen( aSel.nEndPara ); - if ( aSel.nEndPos == nParLen && aText.getLength() == aAutoSearch.getLength() + nSelLen ) + sal_Int32 nSelLen = aSel.end.nIndex - aSel.start.nIndex; + sal_Int32 nParLen = mpEditEngine->GetTextLen( aSel.end.nPara ); + if ( aSel.end.nIndex == nParLen && aText.getLength() == aAutoSearch.getLength() + nSelLen ) { OUString aNew; ScTypedCaseStrSet::const_iterator itNew = @@ -2191,16 +2186,16 @@ void ScInputHandler::NextAutoEntry( bool bBack ) pTableView->DeleteSelected(); pTableView->InsertText( aIns ); pTableView->SetSelection( ESelection( - aSel.nEndPara, aSel.nStartPos + aIns.getLength(), - aSel.nEndPara, aSel.nStartPos ) ); + aSel.end.nPara, aSel.start.nIndex + aIns.getLength(), + aSel.end.nPara, aSel.start.nIndex ) ); } if ( pTopView ) { pTopView->DeleteSelected(); pTopView->InsertText( aIns ); pTopView->SetSelection( ESelection( - aSel.nEndPara, aSel.nStartPos + aIns.getLength(), - aSel.nEndPara, aSel.nStartPos ) ); + aSel.end.nPara, aSel.start.nIndex + aIns.getLength(), + aSel.end.nPara, aSel.start.nIndex ) ); } bInOwnChange = false; @@ -2226,11 +2221,11 @@ void ScInputHandler::UpdateParenthesis() if ( pTableView && !pTableView->HasSelection() ) // Selection is always at the bottom { ESelection aSel = pTableView->GetSelection(); - if (aSel.nStartPos) + if (aSel.start.nIndex) { // Examine character left to the cursor - sal_Int32 nPos = aSel.nStartPos - 1; - OUString aFormula = mpEditEngine->GetText(aSel.nStartPara); + sal_Int32 nPos = aSel.start.nIndex - 1; + OUString aFormula = mpEditEngine->GetText(aSel.start.nPara); sal_Unicode c = aFormula[nPos]; if ( c == '(' || c == ')' ) { @@ -2250,9 +2245,9 @@ void ScInputHandler::UpdateParenthesis() mpEditEngine->RemoveCharAttribs( i, EE_CHAR_WEIGHT ); } - ESelection aSelThis( aSel.nStartPara, nPos, aSel.nStartPara, nPos+1); + ESelection aSelThis(aSel.start.nPara, nPos, aSel.start.nPara, nPos + 1); mpEditEngine->QuickSetAttribs( aSet, aSelThis ); - ESelection aSelOther( aSel.nStartPara, nOther, aSel.nStartPara, nOther+1); + ESelection aSelOther(aSel.start.nPara, nOther, aSel.start.nPara, nOther + 1); mpEditEngine->QuickSetAttribs( aSet, aSelOther ); // Dummy InsertText for Update and Paint (selection is empty) @@ -2659,31 +2654,30 @@ void ScInputHandler::MergeLanguageAttributes( ScEditEngineDefaulter& rDestEngine static void lcl_SetTopSelection( EditView* pEditView, ESelection& rSel ) { - OSL_ENSURE( rSel.nStartPara==0 && rSel.nEndPara==0, "SetTopSelection: Para != 0" ); + OSL_ENSURE( rSel.start.nPara==0 && rSel.end.nPara==0, "SetTopSelection: Para != 0" ); EditEngine& rEngine = pEditView->getEditEngine(); sal_Int32 nCount = rEngine.GetParagraphCount(); if (nCount > 1) { - sal_Int32 nParLen = rEngine.GetTextLen(rSel.nStartPara); - while (rSel.nStartPos > nParLen && rSel.nStartPara+1 < nCount) + sal_Int32 nParLen = rEngine.GetTextLen(rSel.start.nPara); + while (rSel.start.nIndex > nParLen && rSel.start.nPara + 1 < nCount) { - rSel.nStartPos -= nParLen + 1; // Including space from line break - nParLen = rEngine.GetTextLen(++rSel.nStartPara); + rSel.start.nIndex -= nParLen + 1; // Including space from line break + nParLen = rEngine.GetTextLen(++rSel.start.nPara); } - nParLen = rEngine.GetTextLen(rSel.nEndPara); - while (rSel.nEndPos > nParLen && rSel.nEndPara+1 < nCount) + nParLen = rEngine.GetTextLen(rSel.end.nPara); + while (rSel.end.nIndex > nParLen && rSel.end.nPara + 1 < nCount) { - rSel.nEndPos -= nParLen + 1; // Including space from line break - nParLen = rEngine.GetTextLen(++rSel.nEndPara); + rSel.end.nIndex -= nParLen + 1; // Including space from line break + nParLen = rEngine.GetTextLen(++rSel.end.nPara); } } ESelection aSel = pEditView->GetSelection(); - if ( rSel.nStartPara != aSel.nStartPara || rSel.nEndPara != aSel.nEndPara - || rSel.nStartPos != aSel.nStartPos || rSel.nEndPos != aSel.nEndPos ) + if (rSel != aSel) pEditView->SetSelection( rSel ); } @@ -2817,7 +2811,7 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, bool bSetModified ) // Cursor before the end? aSel = pActiveView->GetSelection(); aSel.Adjust(); - bNeedGrow = ( aSel.nEndPos != mpEditEngine->GetTextLen(aSel.nEndPara) ); + bNeedGrow = (aSel.end.nIndex != mpEditEngine->GetTextLen(aSel.end.nPara)); } if (!bNeedGrow) { @@ -2944,8 +2938,7 @@ void ScInputHandler::RemoveSelection() return; ESelection aSel = pActiveView->GetSelection(); - aSel.nStartPara = aSel.nEndPara; - aSel.nStartPos = aSel.nEndPos; + aSel.CollapseToEnd(); if (pTableView) pTableView->SetSelection( aSel ); if (pTopView) @@ -3043,8 +3036,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode, const OUString* pInitText, S } else { - mpEditEngine->GetView(i)-> - SetSelection( ESelection( nPara, nLen, nPara, nLen ) ); + mpEditEngine->GetView(i)->SetSelection(ESelection(nPara, nLen)); } mpEditEngine->GetView(i)->ShowCursor(false); } @@ -3087,14 +3079,7 @@ static bool lcl_IsNumber(std::u16string_view aString) static void lcl_SelectionToEnd( EditView* pView ) { if ( pView ) - { - EditEngine& rEngine = pView->getEditEngine(); - sal_Int32 nParCnt = rEngine.GetParagraphCount(); - if ( nParCnt == 0 ) - nParCnt = 1; - ESelection aSel( nParCnt-1, rEngine.GetTextLen(nParCnt-1) ); // empty selection, cursor at the end - pView->SetSelection( aSel ); - } + pView->SetSelection(ESelection::AtEnd()); } void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInLOK ) @@ -3260,8 +3245,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL } } - ESelection aSel( 0, 0, nParCnt-1, mpEditEngine->GetTextLen(nParCnt-1) ); - SfxItemSet aOldAttribs = mpEditEngine->GetAttribs( aSel ); + SfxItemSet aOldAttribs = mpEditEngine->GetAttribs(ESelection::All()); const SfxPoolItem* pItem = nullptr; // Find common (cell) attributes before RemoveAdjust @@ -3612,7 +3596,7 @@ void ScInputHandler::SetReference( const ScRange& rRef, const ScDocument& rDoc ) EditView* pActiveView = pTopView ? pTopView : pTableView; ESelection aSel = pActiveView->GetSelection(); aSel.Adjust(); - if ( aSel.nStartPara == 0 && aSel.nStartPos == 0 ) + if (aSel.start.nPara == 0 && aSel.start.nIndex == 0) return; DataChanging(); // Cannot be new @@ -3621,7 +3605,7 @@ void ScInputHandler::SetReference( const ScRange& rRef, const ScDocument& rDoc ) if (pTableView) { ESelection aTabSel = pTableView->GetSelection(); - if (aTabSel.nStartPos > aTabSel.nEndPos && aTabSel.nStartPara == aTabSel.nEndPara) + if (aTabSel.start.nIndex > aTabSel.end.nIndex && aTabSel.start.nPara == aTabSel.end.nPara) { aTabSel.Adjust(); pTableView->SetSelection(aTabSel); @@ -3630,7 +3614,7 @@ void ScInputHandler::SetReference( const ScRange& rRef, const ScDocument& rDoc ) if (pTopView) { ESelection aTopSel = pTopView->GetSelection(); - if (aTopSel.nStartPos > aTopSel.nEndPos && aTopSel.nStartPara == aTopSel.nEndPara) + if (aTopSel.start.nIndex > aTopSel.end.nIndex && aTopSel.start.nPara == aTopSel.end.nPara) { aTopSel.Adjust(); pTopView->SetSelection(aTopSel); @@ -3716,8 +3700,8 @@ void ScInputHandler::InsertFunction( const OUString& rFuncName, bool bAddPar ) if (bAddPar) { ESelection aSel = pTableView->GetSelection(); - --aSel.nStartPos; - --aSel.nEndPos; + --aSel.start.nIndex; + --aSel.end.nIndex; pTableView->SetSelection(aSel); } } @@ -3727,8 +3711,8 @@ void ScInputHandler::InsertFunction( const OUString& rFuncName, bool bAddPar ) if (bAddPar) { ESelection aSel = pTopView->GetSelection(); - --aSel.nStartPos; - --aSel.nEndPos; + --aSel.start.nIndex; + --aSel.end.nIndex; pTopView->SetSelection(aSel); } } @@ -3756,12 +3740,12 @@ void ScInputHandler::ClearText() if (pTableView) { pTableView->getEditEngine().SetText( u""_ustr ); - pTableView->SetSelection( ESelection(0,0, 0,0) ); + pTableView->SetSelection(ESelection()); } if (pTopView) { pTopView->getEditEngine().SetText( u""_ustr ); - pTopView->SetSelection( ESelection(0,0, 0,0) ); + pTopView->SetSelection(ESelection()); } DataChanged(); @@ -4338,11 +4322,11 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState, ESelection aSel = pActiveView ? pActiveView->GetSelection() : ESelection(); // if we switched content completely - don't send huge numbers - if (aSel.nStartPara == EE_PARA_NOT_FOUND) - aSel.nStartPara = 0; + if (aSel.start.nPara == EE_PARA_MAX) + aSel.start.nPara = 0; - if (aSel.nEndPara == EE_PARA_NOT_FOUND) - aSel.nEndPara = 0; + if (aSel.end.nPara == EE_PARA_MAX) + aSel.end.nPara = 0; pActiveViewSh->LOKSendFormulabarUpdate(pActiveView, aString, aSel); // TODO: deprecated? @@ -4569,8 +4553,7 @@ bool ScInputHandler::GetTextAndFields( ScEditEngineDefaulter& rDestEngine ) if (mpEditEngine) { // Contains field? - sal_Int32 nParCnt = mpEditEngine->GetParagraphCount(); - SfxItemSet aSet = mpEditEngine->GetAttribs( ESelection(0,0,nParCnt,0) ); + SfxItemSet aSet = mpEditEngine->GetAttribs(ESelection::All()); SfxItemState eFieldState = aSet.GetItemState( EE_FEATURE_FIELD, false ); if ( eFieldState == SfxItemState::INVALID || eFieldState == SfxItemState::SET ) { @@ -4579,6 +4562,7 @@ bool ScInputHandler::GetTextAndFields( ScEditEngineDefaulter& rDestEngine ) rDestEngine.SetTextCurrentDefaults(*pObj); pObj.reset(); + sal_Int32 nParCnt = mpEditEngine->GetParagraphCount(); // Delete attributes for (sal_Int32 i=0; i<nParCnt; i++) rDestEngine.RemoveCharAttribs( i ); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index f9d638cddd39..afe7f3347aff 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -547,7 +547,7 @@ void ScInputWindow::SetFuncString( const OUString& rString, bool bDoEdit ) if ( nLen > 0 ) { nLen--; - pView->SetSelection( ESelection( 0, nLen, 0, nLen ) ); + pView->SetSelection(ESelection(0, nLen)); } pScMod->InputChanged(pView); @@ -675,10 +675,7 @@ void ScInputWindow::SwitchToTextWin() EditView* pView = mxTextWindow->GetEditView(); if (pView) { - sal_Int32 nPara = pView->getEditEngine().GetParagraphCount() ? ( pView->getEditEngine().GetParagraphCount() - 1 ) : 0; - sal_Int32 nLen = pView->getEditEngine().GetTextLen( nPara ); - ESelection aSel( nPara, nLen, nPara, nLen ); - pView->SetSelection( aSel ); // set cursor to end of text + pView->SetSelection(ESelection::AtEnd()); // set cursor to end of text } } } diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index c657f482da34..e0fcf640f756 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -447,6 +447,7 @@ ScTpSubTotalOptions::ScTpSubTotalOptions(weld::Container* pPage, weld::DialogCon , m_xBtnPagebreak(m_xBuilder->weld_check_button(u"pagebreak"_ustr)) , m_xBtnCase(m_xBuilder->weld_check_button(u"case"_ustr)) , m_xBtnSort(m_xBuilder->weld_check_button(u"sort"_ustr)) + , m_xBtnSummary(m_xBuilder->weld_check_button(u"summarybelow"_ustr)) , m_xFlSort(m_xBuilder->weld_label(u"label2"_ustr)) , m_xBtnAscending(m_xBuilder->weld_radio_button(u"ascending"_ustr)) , m_xBtnDescending(m_xBuilder->weld_radio_button(u"descending"_ustr)) @@ -490,6 +491,7 @@ void ScTpSubTotalOptions::Reset( const SfxItemSet* /* rArgSet */ ) m_xBtnCase->set_active( rSubTotalData.bCaseSens ); m_xBtnFormats->set_active( rSubTotalData.bIncludePattern ); m_xBtnSort->set_active( rSubTotalData.bDoSort ); + m_xBtnSummary->set_active( rSubTotalData.bSummaryBelow ); m_xBtnAscending->set_active( rSubTotalData.bAscending ); m_xBtnDescending->set_active( !rSubTotalData.bAscending ); @@ -524,6 +526,10 @@ bool ScTpSubTotalOptions::FillItemSet( SfxItemSet* rArgSet ) theSubTotalData.bCaseSens = m_xBtnCase->get_active(); theSubTotalData.bIncludePattern = m_xBtnFormats->get_active(); theSubTotalData.bDoSort = m_xBtnSort->get_active(); + + theSubTotalData.bSummaryBelow = m_xBtnSummary->get_active(); + pDoc->SetTotalsRowBelow(pViewData->GetTabNo(), theSubTotalData.bSummaryBelow); + theSubTotalData.bAscending = m_xBtnAscending->get_active(); theSubTotalData.bUserDef = m_xBtnUserDef->get_active(); theSubTotalData.nUserIndex = (m_xBtnUserDef->get_active()) diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index d3512500037a..dcbc13fef46e 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1213,7 +1213,8 @@ bool lcl_EmptyExcept( ScDocument& rDoc, const ScRange& rRange, const ScRange& rE return true; // nothing found - empty } -bool isEditable(ScDocShell& rDocShell, const ScRangeList& rRanges, bool bApi) +bool isEditable(ScDocShell& rDocShell, const ScRangeList& rRanges, bool bApi, + sc::EditAction eAction = sc::EditAction::Unknown) { ScDocument& rDoc = rDocShell.GetDocument(); if (!rDocShell.IsEditable() || rDoc.GetChangeTrack()) @@ -1228,7 +1229,7 @@ bool isEditable(ScDocShell& rDocShell, const ScRangeList& rRanges, bool bApi) for (size_t i = 0, n = rRanges.size(); i < n; ++i) { const ScRange & r = rRanges[i]; - ScEditableTester aTester(rDoc, r); + ScEditableTester aTester(rDoc, r, eAction); if (!aTester.IsEditable()) { if (!bApi) @@ -1249,7 +1250,8 @@ void createUndoDoc(ScDocumentUniquePtr& pUndoDoc, ScDocument& rDoc, const ScRang rDoc.CopyToDocument(rRange, InsertDeleteFlags::ALL, false, *pUndoDoc); } -bool checkNewOutputRange(ScDPObject& rDPObj, ScDocShell& rDocShell, ScRange& rNewOut, bool bApi) +bool checkNewOutputRange(ScDPObject& rDPObj, ScDocShell& rDocShell, ScRange& rNewOut, bool bApi, + sc::EditAction eAction = sc::EditAction::Unknown) { ScDocument& rDoc = rDocShell.GetDocument(); @@ -1279,14 +1281,17 @@ bool checkNewOutputRange(ScDPObject& rDPObj, ScDocShell& rDocShell, ScRange& rNe return false; } - ScEditableTester aTester(rDoc, rNewOut); - if (!aTester.IsEditable()) + if (!rDoc.IsImportingXML()) { - // destination area isn't editable - if (!bApi) - rDocShell.ErrorMessage(aTester.GetMessageId()); + ScEditableTester aTester(rDoc, rNewOut, eAction); + if (!aTester.IsEditable()) + { + // destination area isn't editable + if (!bApi) + rDocShell.ErrorMessage(aTester.GetMessageId()); - return false; + return false; + } } return true; @@ -1484,12 +1489,12 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool weld::WaitObject aWait(ScDocShell::GetActiveDialogParent()); // At least one cell in the output range should be editable. Check in advance. - if (!isEditable(rDocShell, ScRange(rDPObj.GetOutRange().aStart), bApi)) + ScDocument& rDoc = rDocShell.GetDocument(); + if (!rDoc.IsImportingXML() && !isEditable(rDocShell, ScRange(rDPObj.GetOutRange().aStart), bApi)) return false; ScDocumentUniquePtr pNewUndoDoc; - ScDocument& rDoc = rDocShell.GetDocument(); if (bRecord && !rDoc.IsUndoEnabled()) bRecord = false; @@ -1537,8 +1542,9 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool return false; } + if (!rDoc.IsImportingXML()) { - ScEditableTester aTester(rDoc, aNewOut); + ScEditableTester aTester(rDoc, aNewOut, sc::EditAction::Unknown); if (!aTester.IsEditable()) { // destination area isn't editable @@ -1594,7 +1600,7 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) ScDocShellModificator aModificator( rDocShell ); weld::WaitObject aWait( ScDocShell::GetActiveDialogParent() ); - if (!isEditable(rDocShell, rDPObj.GetOutRange(), bApi)) + if (!isEditable(rDocShell, rDPObj.GetOutRange(), bApi, sc::EditAction::UpdatePivotTable)) return false; ScDocumentUniquePtr pOldUndoDoc; @@ -1621,7 +1627,7 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) rDPObj.SetName( rDoc.GetDPCollection()->CreateNewName() ); ScRange aNewOut; - if (!checkNewOutputRange(rDPObj, rDocShell, aNewOut, bApi)) + if (!checkNewOutputRange(rDPObj, rDocShell, aNewOut, bApi, sc::EditAction::UpdatePivotTable)) { rDPObj = aUndoDPObj; return false; diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 61dc9d5603ae..68badddef3a0 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -117,6 +117,8 @@ using namespace com::sun::star; using ::std::vector; +#define AUTOFORMAT_WARN_SIZE 0x10ffffUL + void ScDocFunc::NotifyDrawUndo( std::unique_ptr<SdrUndoAction> pUndoAction) { // #i101118# if drawing layer collects the undo actions, add it there @@ -1902,19 +1904,19 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, { case INS_INSCOLS_BEFORE: aTester = ScEditableTester( - rDoc, sc::ColRowEditAction::InsertColumnsBefore, nMergeTestStartCol, nMergeTestEndCol, aMark); + rDoc, sc::EditAction::InsertColumnsBefore, nMergeTestStartCol, 0, nMergeTestEndCol, rDoc.MaxRow(), aMark); break; case INS_INSCOLS_AFTER: aTester = ScEditableTester( - rDoc, sc::ColRowEditAction::InsertColumnsAfter, nMergeTestStartCol, nMergeTestEndCol, aMark); + rDoc, sc::EditAction::InsertColumnsAfter, nMergeTestStartCol, 0, nMergeTestEndCol, rDoc.MaxRow(), aMark); break; case INS_INSROWS_BEFORE: aTester = ScEditableTester( - rDoc, sc::ColRowEditAction::InsertRowsBefore, nMergeTestStartRow, nMergeTestEndRow, aMark); + rDoc, sc::EditAction::InsertRowsBefore, 0, nMergeTestStartRow, rDoc.MaxCol(), nMergeTestEndRow, aMark); break; case INS_INSROWS_AFTER: aTester = ScEditableTester( - rDoc, sc::ColRowEditAction::InsertRowsAfter, nMergeTestStartRow, nMergeTestEndRow, aMark); + rDoc, sc::EditAction::InsertRowsAfter, 0, nMergeTestStartRow, rDoc.MaxCol(), nMergeTestEndRow, aMark); break; default: aTester = ScEditableTester( @@ -2404,11 +2406,11 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, { case DelCellCmd::Cols: aTester = ScEditableTester( - rDoc, sc::ColRowEditAction::DeleteColumns, nUndoStartCol, nUndoEndCol, aMark); + rDoc, sc::EditAction::DeleteColumns, nUndoStartCol, 0, nUndoEndCol, rDoc.MaxRow(), aMark); break; case DelCellCmd::Rows: aTester = ScEditableTester( - rDoc, sc::ColRowEditAction::DeleteRows, nUndoStartRow, nUndoEndRow, aMark); + rDoc, sc::EditAction::DeleteRows, 0, nUndoStartRow, rDoc.MaxCol(), nUndoEndRow, aMark); break; default: aTester = ScEditableTester( @@ -4256,6 +4258,15 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark, weld::WaitObject aWait( ScDocShell::GetActiveDialogParent() ); bool bSize = pAutoFormat->findByIndex(nFormatNo)->GetIncludeWidthHeight(); + if (sal_uInt64(nEndCol - nStartCol + 1) * sal_uInt64(nEndRow - nStartRow + 1) > AUTOFORMAT_WARN_SIZE) + { + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(ScDocShell::GetActiveDialogParent(), + VclMessageType::Warning, VclButtonsType::YesNo, + ScResId(STR_AUTOFORMAT_WAIT_WARNING))); + xQueryBox->set_default_response(RET_NO); + if (xQueryBox->run() != RET_YES) + return false; + } SCTAB nTabCount = rDoc.GetTableCount(); ScDocumentUniquePtr pUndoDoc; @@ -4876,7 +4887,7 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e //! Source range can be protected !!! //! but can't contain matrix fragments !!! - ScEditableTester aTester( rDoc, aDestArea ); + ScEditableTester aTester( rDoc, aDestArea, sc::EditAction::Unknown ); if ( !aTester.IsEditable() ) { if (!bApi) @@ -5729,7 +5740,7 @@ void ScDocFunc::ConvertFormulaToValue( const ScRange& rRange, bool bInteraction if (!rDoc.IsUndoEnabled()) bRecord = false; - ScEditableTester aTester(rDoc, rRange); + ScEditableTester aTester(rDoc, rRange, sc::EditAction::Unknown); if (!aTester.IsEditable()) { if (bInteraction) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index c1ee001cf393..39bf781c1c27 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1275,8 +1275,8 @@ void ScDocShell::Execute( SfxRequest& rReq ) { ESelection aSel = pEditView->GetSelection(); aOldSel = aSel; - aSel.nStartPos = 0; - aSel.nEndPos = EE_TEXTPOS_ALL; + aSel.start.nIndex = 0; + aSel.end.nIndex = EE_TEXTPOS_MAX; pEditView->SetSelection( aSel ); } diff --git a/sc/source/ui/docshell/editable.cxx b/sc/source/ui/docshell/editable.cxx index 86bbb9f2e004..357897470aa1 100644 --- a/sc/source/ui/docshell/editable.cxx +++ b/sc/source/ui/docshell/editable.cxx @@ -45,11 +45,14 @@ ScEditableTester::ScEditableTester( const ScDocument& rDoc, TestSelectedBlock( rDoc, nStartCol, nStartRow, nEndCol, nEndRow, rMark ); } -ScEditableTester::ScEditableTester( const ScDocument& rDoc, const ScRange& rRange ) : +ScEditableTester::ScEditableTester( const ScDocument& rDoc, const ScRange& rRange, sc::EditAction eAction ) : mbIsEditable(true), mbOnlyMatrix(true) { - TestRange( rDoc, rRange ); + if (eAction == sc::EditAction::Unknown) + TestRange(rDoc, rRange); + else + TestRangeForAction( rDoc, rRange, eAction ); } ScEditableTester::ScEditableTester( const ScDocument& rDoc, const ScMarkData& rMark ) : @@ -73,10 +76,11 @@ ScEditableTester::ScEditableTester( ScViewFunc* pView ) : } ScEditableTester::ScEditableTester( - const ScDocument& rDoc, sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd, const ScMarkData& rMark ) : + const ScDocument& rDoc, sc::EditAction eAction, SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark ) : ScEditableTester() { - TestBlockForAction(rDoc, eAction, nStart, nEnd, rMark); + TestBlockForAction(rDoc, eAction, nStartCol, nStartRow, nEndCol, nEndRow, rMark); } void ScEditableTester::TestBlock( const ScDocument& rDoc, SCTAB nTab, @@ -85,7 +89,7 @@ void ScEditableTester::TestBlock( const ScDocument& rDoc, SCTAB nTab, if (mbIsEditable || mbOnlyMatrix) { bool bThisMatrix; - if (!rDoc.IsBlockEditable( nTab, nStartCol, nStartRow, nEndCol, nEndRow, &bThisMatrix, bNoMatrixAtAll)) + if (!rDoc.IsBlockEditable( nTab, nStartCol, nStartRow, nEndCol, nEndRow, &bThisMatrix, bNoMatrixAtAll )) { mbIsEditable = false; if ( !bThisMatrix ) @@ -94,6 +98,15 @@ void ScEditableTester::TestBlock( const ScDocument& rDoc, SCTAB nTab, } } +void ScEditableTester::TestBlockForAction( const ScDocument& rDoc, SCTAB nTab, + SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sc::EditAction eAction ) +{ + if (mbIsEditable || mbOnlyMatrix) + { + mbIsEditable = rDoc.IsEditActionAllowed(eAction, nTab, nStartCol, nStartRow, nEndCol, nEndRow); + } +} + void ScEditableTester::TestSelectedBlock( const ScDocument& rDoc, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark ) @@ -108,7 +121,7 @@ void ScEditableTester::TestSelectedBlock( const ScDocument& rDoc, } } -void ScEditableTester::TestRange( const ScDocument& rDoc, const ScRange& rRange ) +void ScEditableTester::TestRange( const ScDocument& rDoc, const ScRange& rRange ) { SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); @@ -120,6 +133,18 @@ void ScEditableTester::TestRange( const ScDocument& rDoc, const ScRange& rRange TestBlock( rDoc, nTab, nStartCol, nStartRow, nEndCol, nEndRow, false ); } +void ScEditableTester::TestRangeForAction(const ScDocument& rDoc, const ScRange& rRange, sc::EditAction eAction) +{ + SCCOL nStartCol = rRange.aStart.Col(); + SCROW nStartRow = rRange.aStart.Row(); + SCTAB nStartTab = rRange.aStart.Tab(); + SCCOL nEndCol = rRange.aEnd.Col(); + SCROW nEndRow = rRange.aEnd.Row(); + SCTAB nEndTab = rRange.aEnd.Tab(); + for (SCTAB nTab = nStartTab; nTab <= nEndTab; nTab++) + TestBlockForAction(rDoc, nTab, nStartCol, nStartRow, nEndCol, nEndRow, eAction); +} + void ScEditableTester::TestSelection( const ScDocument& rDoc, const ScMarkData& rMark ) { if (mbIsEditable || mbOnlyMatrix) @@ -135,8 +160,8 @@ void ScEditableTester::TestSelection( const ScDocument& rDoc, const ScMarkData& } void ScEditableTester::TestBlockForAction( - const ScDocument& rDoc, sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd, - const ScMarkData& rMark ) + const ScDocument& rDoc, sc::EditAction eAction, SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark ) { mbOnlyMatrix = false; @@ -145,7 +170,7 @@ void ScEditableTester::TestBlockForAction( if (!mbIsEditable) return; - mbIsEditable = rDoc.IsEditActionAllowed(eAction, rTab, nStart, nEnd); + mbIsEditable = rDoc.IsEditActionAllowed(eAction, rTab, nStartCol, nStartRow, nEndCol, nEndRow); } } diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 9957e97bfbd0..96779edb0424 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -230,7 +230,7 @@ bool ScImportExport::StartPaste() { if ( !bAll ) { - ScEditableTester aTester( rDoc, aRange ); + ScEditableTester aTester( rDoc, aRange, sc::EditAction::Unknown ); if ( !aTester.IsEditable() ) { std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(ScDocShell::GetActiveDialogParent(), diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 6138b29120e4..3a1432a15cee 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -591,7 +591,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView ) ESelection aOldSel = rOutView.GetSelection(); ESelection aSel = aOldSel; aSel.Adjust(); - sal_Int32 nNewEnd = aSel.nEndPos; + sal_Int32 nNewEnd = aSel.end.nIndex; bool bUpdate = pOutliner->IsUpdateLayout(); bool bChanged = false; @@ -601,7 +601,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView ) sal_Int32 nParCount = pOutliner->GetParagraphCount(); for (sal_Int32 nPar=0; nPar<nParCount; nPar++) - if ( nPar >= aSel.nStartPara && nPar <= aSel.nEndPara ) + if (nPar >= aSel.start.nPara && nPar <= aSel.end.nPara) { std::vector<sal_Int32> aPortions; rEditEng.GetPortions( nPar, aPortions ); @@ -613,8 +613,8 @@ static void lcl_RemoveFields( OutlinerView& rOutView ) sal_Int32 nStart = nPos ? aPortions[ nPos - 1 ] : 0; // fields are single characters if ( nEnd == nStart+1 && - ( nPar > aSel.nStartPara || nStart >= aSel.nStartPos ) && - ( nPar < aSel.nEndPara || nEnd <= aSel.nEndPos ) ) + ( nPar > aSel.start.nPara || nStart >= aSel.start.nIndex ) && + ( nPar < aSel.end.nPara || nEnd <= aSel.end.nIndex ) ) { ESelection aFieldSel( nPar, nStart, nPar, nEnd ); SfxItemSet aSet = rEditEng.GetAttribs( aFieldSel ); @@ -634,7 +634,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView ) OUString aFieldText = rEditEng.GetText( aFieldSel ); pOutliner->QuickInsertText( aFieldText, aFieldSel ); - if ( nPar == aSel.nEndPara ) + if (nPar == aSel.end.nPara) { nNewEnd = nNewEnd + aFieldText.getLength(); --nNewEnd; @@ -651,9 +651,9 @@ static void lcl_RemoveFields( OutlinerView& rOutView ) } if ( aOldSel == aSel ) // aSel is adjusted - aOldSel.nEndPos = nNewEnd; + aOldSel.end.nIndex = nNewEnd; else - aOldSel.nStartPos = nNewEnd; // if aOldSel is backwards + aOldSel.start.nIndex = nNewEnd; // if aOldSel is backwards rOutView.SetSelection( aOldSel ); } diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index 9125e5f60b4a..3826e04fe474 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -612,8 +612,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel, } else if ( bCursorToEnd ) { - ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND); - pOLV->SetSelection(aNewSelection); + pOLV->SetSelection(ESelection::AtEnd()); } if ( pInitialKey ) diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 4e661f3b510c..62e7d8fe85c6 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -365,7 +365,7 @@ void ScFunctionWin::DoEnter() pHdl->InsertFunction(aString); pEdView->InsertText(aArgStr.makeStringAndClear(),true); ESelection aESel=pEdView->GetSelection(); - aESel.nEndPos = aESel.nStartPos + aFirstArgStr.getLength(); + aESel.end.nIndex = aESel.start.nIndex + aFirstArgStr.getLength(); pEdView->SetSelection(aESel); pHdl->DataChanged(); } diff --git a/sc/source/ui/inc/editable.hxx b/sc/source/ui/inc/editable.hxx index 1c229a1b11ef..c5deab9ae699 100644 --- a/sc/source/ui/inc/editable.hxx +++ b/sc/source/ui/inc/editable.hxx @@ -28,7 +28,7 @@ class ScMarkData; namespace sc { -enum class ColRowEditAction; +enum class EditAction; } @@ -54,7 +54,7 @@ public: const ScMarkData& rMark ); // calls TestRange - ScEditableTester( const ScDocument& rDoc, const ScRange& rRange ); + ScEditableTester( const ScDocument& rDoc, const ScRange& rRange, sc::EditAction eAction ); // calls TestSelection ScEditableTester( const ScDocument& rDoc, const ScMarkData& rMark ); @@ -62,24 +62,29 @@ public: // calls TestView ScEditableTester( ScViewFunc* pView ); - ScEditableTester( - const ScDocument& rDoc, sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd, - const ScMarkData& rMark ); + ScEditableTester( + const ScDocument& rDoc, sc::EditAction eAction, SCCOL nStartCol, + SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark ); // Several calls to the Test... methods check if *all* of the ranges // are editable. For several independent checks, Reset() has to be used. void TestBlock( const ScDocument& rDoc, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bNoMatrixAtAll = false ); + void TestBlockForAction( const ScDocument& rDoc, SCTAB nTab, + SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, + sc::EditAction eAction ); void TestSelectedBlock( const ScDocument& rDoc, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark ); void TestRange( const ScDocument& rDoc, const ScRange& rRange ); + void TestRangeForAction( const ScDocument& rDoc, const ScRange& rRange, + sc::EditAction eAction ); void TestSelection( const ScDocument& rDoc, const ScMarkData& rMark ); - void TestBlockForAction( - const ScDocument& rDoc, sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd, - const ScMarkData& rMark ); + void TestBlockForAction( + const ScDocument& rDoc, sc::EditAction eAction, SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark ); bool IsEditable() const { return mbIsEditable; } bool IsFormatEditable() const { return mbIsEditable || mbOnlyMatrix; } diff --git a/sc/source/ui/inc/protectiondlg.hxx b/sc/source/ui/inc/protectiondlg.hxx index e59fb3accf77..4ad633cbd6d5 100644 --- a/sc/source/ui/inc/protectiondlg.hxx +++ b/sc/source/ui/inc/protectiondlg.hxx @@ -45,6 +45,8 @@ private: OUString m_aInsertRows; OUString m_aDeleteColumns; OUString m_aDeleteRows; + OUString m_aAutoFilter; + OUString m_aPivot; std::unique_ptr<weld::CheckButton> m_xBtnProtect; std::unique_ptr<weld::Container> m_xPasswords; @@ -60,6 +62,8 @@ private: std::unique_ptr<weld::Label> m_xInsertRows; std::unique_ptr<weld::Label> m_xDeleteColumns; std::unique_ptr<weld::Label> m_xDeleteRows; + std::unique_ptr<weld::Label> m_xAutoFilter; + std::unique_ptr<weld::Label> m_xPivot; void InsertEntry(const OUString& rTxt); diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx index ecfa2ec18522..42eed5e4046e 100644 --- a/sc/source/ui/inc/tpsubt.hxx +++ b/sc/source/ui/inc/tpsubt.hxx @@ -135,6 +135,7 @@ private: std::unique_ptr<weld::CheckButton> m_xBtnPagebreak; std::unique_ptr<weld::CheckButton> m_xBtnCase; std::unique_ptr<weld::CheckButton> m_xBtnSort; + std::unique_ptr<weld::CheckButton> m_xBtnSummary; std::unique_ptr<weld::Label> m_xFlSort; std::unique_ptr<weld::RadioButton> m_xBtnAscending; std::unique_ptr<weld::RadioButton> m_xBtnDescending; diff --git a/sc/source/ui/miscdlgs/protectiondlg.cxx b/sc/source/ui/miscdlgs/protectiondlg.cxx index f96cc72c0346..041f50dfa0db 100644 --- a/sc/source/ui/miscdlgs/protectiondlg.cxx +++ b/sc/source/ui/miscdlgs/protectiondlg.cxx @@ -33,6 +33,8 @@ const std::vector<ScTableProtection::Option> aOptions = { ScTableProtection::INSERT_ROWS, ScTableProtection::DELETE_COLUMNS, ScTableProtection::DELETE_ROWS, + ScTableProtection::AUTOFILTER, + ScTableProtection::PIVOT_TABLES, }; } @@ -53,6 +55,8 @@ ScTableProtectionDlg::ScTableProtectionDlg(weld::Window* pParent) , m_xInsertRows(m_xBuilder->weld_label(u"insert-rows"_ustr)) , m_xDeleteColumns(m_xBuilder->weld_label(u"delete-columns"_ustr)) , m_xDeleteRows(m_xBuilder->weld_label(u"delete-rows"_ustr)) + , m_xAutoFilter(m_xBuilder->weld_label(u"useautofilter"_ustr)) + , m_xPivot(m_xBuilder->weld_label(u"usepivot"_ustr)) { m_aSelectLockedCells = m_xProtected->get_label(); m_aSelectUnlockedCells = m_xUnprotected->get_label(); @@ -60,6 +64,8 @@ ScTableProtectionDlg::ScTableProtectionDlg(weld::Window* pParent) m_aInsertRows = m_xInsertRows->get_label(); m_aDeleteColumns = m_xDeleteColumns->get_label(); m_aDeleteRows = m_xDeleteRows->get_label(); + m_aAutoFilter = m_xAutoFilter->get_label(); + m_aPivot = m_xPivot->get_label(); m_xOptionsListBox->enable_toggle_buttons(weld::ColumnToggleType::Check); @@ -114,6 +120,8 @@ void ScTableProtectionDlg::Init() InsertEntry(m_aInsertRows); InsertEntry(m_aDeleteColumns); InsertEntry(m_aDeleteRows); + InsertEntry(m_aAutoFilter); + InsertEntry(m_aPivot); m_xOptionsListBox->set_toggle(0, TRISTATE_TRUE); m_xOptionsListBox->set_toggle(1, TRISTATE_TRUE); diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index ecc7b1c0986e..19a6ea82b609 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -444,12 +444,12 @@ bool ScHFEditPage::IsPageEntry(EditEngine*pEngine, const EditTextObject* pTextOb if(aPosList.size() == 2) { OUString aPageEntry(m_xFtPage->get_label() + " "); - ESelection aSel(0,0,0,0); - aSel.nEndPos = aPageEntry.getLength(); + ESelection aSel; + aSel.end.nIndex = aPageEntry.getLength(); if(aPageEntry == pEngine->GetText(aSel)) { - aSel.nStartPos = aSel.nEndPos; - aSel.nEndPos++; + aSel.start.nIndex = aSel.end.nIndex; + aSel.end.nIndex++; std::unique_ptr< EditTextObject > pPageObj = pEngine->CreateTextObject(aSel); if(pPageObj && pPageObj->IsFieldObject() ) { @@ -534,14 +534,14 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) ESelection aSel(0,0,0,0); OUString aPageEntry( m_xFtPage->get_label() + " "); m_xWndCenter->GetEditEngine()->SetTextCurrentDefaults(aPageEntry); - aSel.nEndPos = aPageEntry.getLength(); - m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); - ++aSel.nEndPos; + aSel.end.nIndex = aPageEntry.getLength(); + m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.end)); + ++aSel.end.nIndex; OUString aPageOfEntry(" " + m_xFtOf->get_label() + " "); - m_xWndCenter->GetEditEngine()->QuickInsertText(aPageOfEntry,ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); - aSel.nEndPos = aSel.nEndPos + aPageOfEntry.getLength(); - m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); + m_xWndCenter->GetEditEngine()->QuickInsertText(aPageOfEntry,ESelection(aSel.end)); + aSel.end.nIndex += aPageOfEntry.getLength(); + m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), ESelection(aSel.end)); pTextObj = m_xWndCenter->GetEditEngine()->CreateTextObject(); m_xWndCenter->SetText(*pTextObj); if(!bTravelling) @@ -576,12 +576,12 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) ClearTextAreas(); ESelection aSel(0,0,0,0); m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem( SvxFileField(), EE_FEATURE_FIELD ), aSel ); - ++aSel.nEndPos; + ++aSel.end.nIndex; OUString aPageEntry(", " + m_xFtPage->get_label() + " "); - m_xWndCenter->GetEditEngine()->QuickInsertText(aPageEntry, ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); - aSel.nStartPos = aSel.nEndPos; - aSel.nEndPos = aSel.nEndPos + aPageEntry.getLength(); - m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); + m_xWndCenter->GetEditEngine()->QuickInsertText(aPageEntry, ESelection(aSel.end)); + aSel.start.nIndex = aSel.end.nIndex; + aSel.end.nIndex += aPageEntry.getLength(); + m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.end)); pTextObj = m_xWndCenter->GetEditEngine()->CreateTextObject(); m_xWndCenter->SetText(*pTextObj); if(!bTravelling) @@ -603,14 +603,14 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) ESelection aSel(0,0,0,0); OUString aPageEntry( m_xFtPage->get_label() + " " ); m_xWndCenter->GetEditEngine()->SetTextCurrentDefaults(aPageEntry); - aSel.nEndPos = aPageEntry.getLength(); - m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); - ++aSel.nEndPos; + aSel.end.nIndex = aPageEntry.getLength(); + m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.end)); + ++aSel.end.nIndex; OUString aCommaSpace(u", "_ustr); - m_xWndCenter->GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); - aSel.nEndPos = aSel.nEndPos + aCommaSpace.getLength(); - m_xWndCenter->GetEditEngine()->QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); + m_xWndCenter->GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.end)); + aSel.end.nIndex += aCommaSpace.getLength(); + m_xWndCenter->GetEditEngine()->QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), ESelection(aSel.end)); pTextObj = m_xWndCenter->GetEditEngine()->CreateTextObject(); m_xWndCenter->SetText(*pTextObj); if(!bTravelling) @@ -624,13 +624,13 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) ESelection aSel(0,0,0,0); OUString aPageEntry( m_xFtPage->get_label() + " " ); m_xWndCenter->GetEditEngine()->SetTextCurrentDefaults(aPageEntry); - aSel.nEndPos = aPageEntry.getLength(); - m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); - ++aSel.nEndPos; + aSel.end.nIndex = aPageEntry.getLength(); + m_xWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.end)); + ++aSel.end.nIndex; OUString aCommaSpace(u", "_ustr); - m_xWndCenter->GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); - aSel.nEndPos = aSel.nEndPos + aCommaSpace.getLength(); - m_xWndCenter->GetEditEngine()->QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); + m_xWndCenter->GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.end)); + aSel.end.nIndex += aCommaSpace.getLength(); + m_xWndCenter->GetEditEngine()->QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), ESelection(aSel.end)); pTextObj = m_xWndCenter->GetEditEngine()->CreateTextObject(); m_xWndCenter->SetText(*pTextObj); if(!bTravelling) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 4defe47400b2..a8202395f447 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -784,6 +784,7 @@ static const SfxItemPropertySet* lcl_GetSheetPropertySet() { SC_UNONAME_TABCOLOR, SC_WID_UNO_TABCOLOR, cppu::UnoType<sal_Int32>::get(), 0, 0 }, { SC_UNO_CODENAME, SC_WID_UNO_CODENAME, cppu::UnoType<OUString>::get(), 0, 0}, { SC_UNO_NAMEDRANGES, SC_WID_UNO_NAMES, cppu::UnoType<sheet::XNamedRanges>::get(), 0, 0 }, + { SC_UNONAME_TOTALBELOW, SC_WID_UNO_TOTALBELOW, cppu::UnoType<bool>::get(), 0, 0 }, }; static SfxItemPropertySet aSheetPropertySet( aSheetPropertyMap_Impl ); return &aSheetPropertySet; @@ -5997,8 +5998,7 @@ void SAL_CALL ScCellObj::insertTextContent( const uno::Reference<text::XTextRang { // do not replace -> append aSelection.Adjust(); - aSelection.nStartPara = aSelection.nEndPara; - aSelection.nStartPos = aSelection.nEndPos; + aSelection.CollapseToEnd(); } if (pCellField->GetFieldType() == text::textfield::Type::TABLE) @@ -6011,8 +6011,8 @@ void SAL_CALL ScCellObj::insertTextContent( const uno::Reference<text::XTextRang // new selection: a digit aSelection.Adjust(); - aSelection.nEndPara = aSelection.nStartPara; - aSelection.nEndPos = aSelection.nStartPos + 1; + aSelection.end.nPara = aSelection.start.nPara; + aSelection.end.nIndex = aSelection.start.nIndex + 1; uno::Reference<text::XTextRange> xParent(this); pCellField->InitDoc( xParent, std::make_unique<ScCellEditSource>(pDocSh, aCellPos), aSelection); @@ -6020,7 +6020,7 @@ void SAL_CALL ScCellObj::insertTextContent( const uno::Reference<text::XTextRang // for bAbsorb=FALSE, the new selection must be behind the inserted content // (the xml filter relies on this) if (!bAbsorb) - aSelection.nStartPos = aSelection.nEndPos; + aSelection.start.nIndex = aSelection.end.nIndex; pTextRange->SetSelection( aSelection ); @@ -8058,6 +8058,11 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry // how to set the format correctly } } + else if (pEntry->nWID == SC_WID_UNO_TOTALBELOW) + { + bool bTotalsRowBelow = ScUnoHelpFunctions::GetBoolFromAny(aValue); + rDoc.SetTotalsRowBelow(nTab, bTotalsRowBelow); + } else ScCellRangeObj::SetOnePropertyValue(pEntry, aValue); // base class, no Item WID } diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index e3359d02d0e4..b7a3ee55ec10 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -174,7 +174,7 @@ public: sal_uInt16 CountFields(); SvxFieldData* FindByIndex(sal_uInt16 nIndex); - SvxFieldData* FindByPos(sal_Int32 nPar, sal_Int32 nPos, sal_Int32 nType); + SvxFieldData* FindByPos(const EPaM& rPos, sal_Int32 nType); sal_Int32 GetFieldPar() const { return nFieldPar; } sal_Int32 GetFieldPos() const { return nFieldPos; } @@ -248,11 +248,11 @@ SvxFieldData* ScUnoEditEngine::FindByIndex(sal_uInt16 nIndex) return pFound.get(); } -SvxFieldData* ScUnoEditEngine::FindByPos(sal_Int32 nPar, sal_Int32 nPos, sal_Int32 nType) +SvxFieldData* ScUnoEditEngine::FindByPos(const EPaM& rPos, sal_Int32 nType) { eMode = SC_UNO_COLLECT_FINDPOS; - nFieldPar = nPar; - nFieldPos = nPos; + nFieldPar = rPos.nPara; + nFieldPos = rPos.nIndex; mnFieldType = nType; nFieldCount = 0; UpdateFields(); @@ -619,7 +619,7 @@ void ScEditFieldObj::setPropertyValueURL(const OUString& rName, const css::uno:: // don't care about the type (only URLs can be found in the cells) SvxFieldData* pField = aTempEngine.FindByPos( - aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED); + aSelection.start, text::textfield::Type::UNSPECIFIED); OSL_ENSURE(pField,"setPropertyValue: Field not found"); if (!pField) return; @@ -688,7 +688,7 @@ uno::Any ScEditFieldObj::getPropertyValueURL(const OUString& rName) // don't care about the type (only URLs can be found in the cells) const SvxFieldData* pField = aTempEngine.FindByPos( - aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED); + aSelection.start, text::textfield::Type::UNSPECIFIED); OSL_ENSURE(pField,"getPropertyValue: Field not found"); if (!pField) throw uno::RuntimeException(); @@ -738,7 +738,7 @@ void ScEditFieldObj::setPropertyValueFile(const OUString& rName, const uno::Any& ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine(); ScUnoEditEngine aTempEngine(pEditEngine); SvxFieldData* pField = aTempEngine.FindByPos( - aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::EXTENDED_FILE); + aSelection.start, text::textfield::Type::EXTENDED_FILE); OSL_ENSURE(pField, "setPropertyValueFile: Field not found"); if (pField) { @@ -769,7 +769,7 @@ uno::Any ScEditFieldObj::getPropertyValueFile(const OUString& rName) ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine(); ScUnoEditEngine aTempEngine(pEditEngine); pField = aTempEngine.FindByPos( - aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::EXTENDED_FILE); + aSelection.start, text::textfield::Type::EXTENDED_FILE); } else pField = &getData(); @@ -793,7 +793,7 @@ void ScEditFieldObj::setPropertyValueDateTime(const OUString& rName, const uno:: // Field already inserted. ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine(); ScUnoEditEngine aTempEngine(pEditEngine); - SvxFieldData* pField = aTempEngine.FindByPos(aSelection.nStartPara, aSelection.nStartPos, meType); + SvxFieldData* pField = aTempEngine.FindByPos(aSelection.start, meType); if (!pField) return; @@ -887,7 +887,7 @@ uno::Any ScEditFieldObj::getPropertyValueDateTime(const OUString& rName) // Field already inserted. ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine(); ScUnoEditEngine aTempEngine(pEditEngine); - SvxFieldData* pField = aTempEngine.FindByPos(aSelection.nStartPara, aSelection.nStartPos, meType); + SvxFieldData* pField = aTempEngine.FindByPos(aSelection.start, meType); if (!pField) throw uno::RuntimeException(); @@ -995,7 +995,7 @@ void ScEditFieldObj::setPropertyValueSheet(const OUString& rName, const uno::Any // don't care about the type (only URLs can be found in the cells) SvxFieldData* pField = aTempEngine.FindByPos( - aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED); + aSelection.start, text::textfield::Type::UNSPECIFIED); OSL_ENSURE(pField,"setPropertyValue: Field not found"); if (!pField) return; @@ -1090,8 +1090,7 @@ void ScEditFieldObj::DeleteField() pForwarder->QuickInsertText( OUString(), aSelection ); mpEditSource->UpdateData(); - aSelection.nEndPara = aSelection.nStartPara; - aSelection.nEndPos = aSelection.nStartPos; + aSelection.CollapseToStart(); //! Broadcast in order to adjust selection in other objects //! (also for other actions) @@ -1118,7 +1117,7 @@ OUString SAL_CALL ScEditFieldObj::getPresentation( sal_Bool bShowCommand ) // don't care about the type (only URLs can be found in the cells) const SvxFieldData* pField = aTempEngine.FindByPos( - aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED); + aSelection.start, text::textfield::Type::UNSPECIFIED); OSL_ENSURE(pField,"getPresentation: Field not found"); if (!pField) return OUString(); diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 10015a2f42f7..6a0cbd4f09eb 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -388,8 +388,7 @@ void SAL_CALL ScHeaderFooterTextObj::insertTextContent( { // don't replace -> append at end aSelection.Adjust(); - aSelection.nStartPara = aSelection.nEndPara; - aSelection.nStartPos = aSelection.nEndPos; + aSelection.CollapseToEnd(); } SvxFieldItem aItem(pHeaderField->CreateFieldItem()); @@ -400,8 +399,8 @@ void SAL_CALL ScHeaderFooterTextObj::insertTextContent( // new selection: a digit aSelection.Adjust(); - aSelection.nEndPara = aSelection.nStartPara; - aSelection.nEndPos = aSelection.nStartPos + 1; + aSelection.end.nPara = aSelection.start.nPara; + aSelection.end.nIndex = aSelection.start.nIndex + 1; uno::Reference<text::XTextRange> xTextRange; switch ( aTextData.GetPart() ) @@ -422,7 +421,7 @@ void SAL_CALL ScHeaderFooterTextObj::insertTextContent( // for bAbsorb=FALSE, the new selection must be behind the inserted content // (the xml filter relies on this) if (!bAbsorb) - aSelection.nStartPos = aSelection.nEndPos; + aSelection.start.nIndex = aSelection.end.nIndex; pTextRange->SetSelection( aSelection ); @@ -559,8 +558,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScCellTextCursor::getStart() rtl::Reference<ScCellTextCursor> pNew = new ScCellTextCursor( *this ); ESelection aNewSel(GetSelection()); - aNewSel.nEndPara = aNewSel.nStartPara; - aNewSel.nEndPos = aNewSel.nStartPos; + aNewSel.CollapseToStart(); pNew->SetSelection( aNewSel ); return static_cast<SvxUnoTextRangeBase*>(pNew.get()); @@ -575,8 +573,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScCellTextCursor::getEnd() rtl::Reference<ScCellTextCursor> pNew = new ScCellTextCursor( *this ); ESelection aNewSel(GetSelection()); - aNewSel.nStartPara = aNewSel.nEndPara; - aNewSel.nStartPos = aNewSel.nEndPos; + aNewSel.CollapseToEnd(); pNew->SetSelection( aNewSel ); return static_cast<SvxUnoTextRangeBase*>(pNew.get()); @@ -610,8 +607,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextCursor::getStart() rtl::Reference<ScHeaderFooterTextCursor> pNew = new ScHeaderFooterTextCursor( *this ); ESelection aNewSel(GetSelection()); - aNewSel.nEndPara = aNewSel.nStartPara; - aNewSel.nEndPos = aNewSel.nStartPos; + aNewSel.CollapseToStart(); pNew->SetSelection( aNewSel ); return static_cast<SvxUnoTextRangeBase*>(pNew.get()); @@ -626,8 +622,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextCursor::getEnd() rtl::Reference<ScHeaderFooterTextCursor> pNew = new ScHeaderFooterTextCursor( *this ); ESelection aNewSel(GetSelection()); - aNewSel.nStartPara = aNewSel.nEndPara; - aNewSel.nStartPos = aNewSel.nEndPos; + aNewSel.CollapseToEnd(); pNew->SetSelection( aNewSel ); return static_cast<SvxUnoTextRangeBase*>(pNew.get()); @@ -666,8 +661,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScDrawTextCursor::getStart() rtl::Reference<ScDrawTextCursor> pNew = new ScDrawTextCursor( *this ); ESelection aNewSel(GetSelection()); - aNewSel.nEndPara = aNewSel.nStartPara; - aNewSel.nEndPos = aNewSel.nStartPos; + aNewSel.CollapseToStart(); pNew->SetSelection( aNewSel ); return static_cast<SvxUnoTextRangeBase*>(pNew.get()); @@ -682,8 +676,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScDrawTextCursor::getEnd() rtl::Reference<ScDrawTextCursor> pNew = new ScDrawTextCursor( *this ); ESelection aNewSel(GetSelection()); - aNewSel.nStartPara = aNewSel.nEndPara; - aNewSel.nStartPos = aNewSel.nEndPos; + aNewSel.CollapseToEnd(); pNew->SetSelection( aNewSel ); return static_cast<SvxUnoTextRangeBase*>(pNew.get()); diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index ffffb61a5618..a5f855b5d226 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -255,15 +255,15 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case FID_INS_ROWS_BEFORE: // insert rows case FID_INS_ROWS_AFTER: { - sc::ColRowEditAction eAction = sc::ColRowEditAction::InsertRowsBefore; + sc::EditAction eAction = sc::EditAction::InsertRowsBefore; if (nWhich == FID_INS_ROWS_AFTER) - eAction = sc::ColRowEditAction::InsertRowsAfter; + eAction = sc::EditAction::InsertRowsAfter; bDisable = (!bSimpleArea) || GetViewData().SimpleColMarked(); if (!bEditable && nCol1 == 0 && nCol2 == rDoc.MaxCol()) { // See if row insertions are allowed. - bEditable = rDoc.IsEditActionAllowed(eAction, rMark, nRow1, nRow2); + bEditable = rDoc.IsEditActionAllowed(eAction, rMark, nCol1, nRow1, nCol2, nRow2); } break; } @@ -275,16 +275,16 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case FID_INS_COLUMNS_BEFORE: // insert columns case FID_INS_COLUMNS_AFTER: { - sc::ColRowEditAction eAction = sc::ColRowEditAction::InsertColumnsBefore; + sc::EditAction eAction = sc::EditAction::InsertColumnsBefore; if (nWhich == FID_INS_COLUMNS_AFTER) - eAction = sc::ColRowEditAction::InsertColumnsAfter; + eAction = sc::EditAction::InsertColumnsAfter; bDisable = (!bSimpleArea && eMarkType != SC_MARK_SIMPLE_FILTERED) || GetViewData().SimpleRowMarked(); if (!bEditable && nRow1 == 0 && nRow2 == rDoc.MaxRow()) { // See if row insertions are allowed. - bEditable = rDoc.IsEditActionAllowed(eAction, rMark, nCol1, nCol2); + bEditable = rDoc.IsEditActionAllowed(eAction, rMark, nCol1, nRow1, nCol2, nRow2); } break; } diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 50c5635a3b18..87e754700a50 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -3052,8 +3052,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if ( pEditView ) { ESelection aTextSel = pEditView->GetSelection(); - aTextSel.nStartPos = 0; - aTextSel.nEndPos = EE_TEXTPOS_ALL; + aTextSel.start.nIndex = 0; + aTextSel.end.nIndex = EE_TEXTPOS_MAX; pHdl->DataChanging(); pEditView->SetSelection(aTextSel); pEditView->InsertText(aFormula); @@ -3567,6 +3567,12 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq) } pDBData->GetSubTotalParam( aSubTotalParam ); + + ScDocument& rDoc = GetViewData().GetDocument(); + SCTAB nTab = GetViewData().GetTabNo(); + if (!rDoc.GetTotalsRowBelow(nTab)) + aSubTotalParam.bSummaryBelow = false; + aSubTotalParam.bRemoveOnly = false; if (bAnonymous) { diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 91f24d70a0fa..0151ec328314 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -1106,11 +1106,19 @@ void ScCellShell::GetDBState( SfxItemSet& rSet ) case SID_FILTER: case SID_SPECIAL_FILTER: { - ScRange aDummy; - ScMarkType eMarkType = GetViewData().GetSimpleArea( aDummy); - if (eMarkType != SC_MARK_SIMPLE && eMarkType != SC_MARK_SIMPLE_FILTERED) + const ScTableProtection* pTabProt = rDoc.GetTabProtection(nTab); + if (pTabProt && pTabProt->isProtected() && !pTabProt->isOptionEnabled(ScTableProtection::AUTOFILTER)) { - rSet.DisableItem( nWhich ); + rSet.DisableItem(nWhich); + } + else + { + ScRange aDummy; + ScMarkType eMarkType = GetViewData().GetSimpleArea(aDummy); + if (eMarkType != SC_MARK_SIMPLE && eMarkType != SC_MARK_SIMPLE_FILTERED) + { + rSet.DisableItem(nWhich); + } } } break; @@ -1129,6 +1137,17 @@ void ScCellShell::GetDBState( SfxItemSet& rSet ) { rSet.DisableItem( nWhich ); } + else + { + if (nWhich == SID_OPENDLG_PIVOTTABLE) + { + const ScTableProtection* pTabProt = rDoc.GetTabProtection(nTab); + if (pTabProt && pTabProt->isProtected() && !pTabProt->isOptionEnabled(ScTableProtection::PIVOT_TABLES)) + { + rSet.DisableItem(nWhich); + } + } + } } break; @@ -1164,29 +1183,37 @@ void ScCellShell::GetDBState( SfxItemSet& rSet ) case SID_AUTO_FILTER: case SID_AUTOFILTER_HIDE: { - if (!bAutoFilterTested) + const ScTableProtection* pTabProt = rDoc.GetTabProtection(nTab); + if (pTabProt && pTabProt->isProtected() && !pTabProt->isOptionEnabled(ScTableProtection::AUTOFILTER)) { - bAutoFilter = rDoc.HasAutoFilter( nPosX, nPosY, nTab ); - bAutoFilterTested = true; + rSet.DisableItem(nWhich); } - if ( nWhich == SID_AUTO_FILTER ) + else { - ScRange aDummy; - ScMarkType eMarkType = GetViewData().GetSimpleArea( aDummy); - if (eMarkType != SC_MARK_SIMPLE && eMarkType != SC_MARK_SIMPLE_FILTERED) + if (!bAutoFilterTested) { - rSet.DisableItem( nWhich ); + bAutoFilter = rDoc.HasAutoFilter(nPosX, nPosY, nTab); + bAutoFilterTested = true; } - else if (rDoc.GetDPAtBlock(aDummy)) + if (nWhich == SID_AUTO_FILTER) { - rSet.DisableItem( nWhich ); + ScRange aDummy; + ScMarkType eMarkType = GetViewData().GetSimpleArea(aDummy); + if (eMarkType != SC_MARK_SIMPLE && eMarkType != SC_MARK_SIMPLE_FILTERED) + { + rSet.DisableItem(nWhich); + } + else if (rDoc.GetDPAtBlock(aDummy)) + { + rSet.DisableItem(nWhich); + } + else + rSet.Put(SfxBoolItem(nWhich, bAutoFilter)); } else - rSet.Put( SfxBoolItem( nWhich, bAutoFilter ) ); + if (!bAutoFilter) + rSet.DisableItem(nWhich); } - else - if (!bAutoFilter) - rSet.DisableItem( nWhich ); } break; diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 6dba303ea028..20828c86a9d1 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -49,6 +49,7 @@ #include <comphelper/lok.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <inputwin.hxx> +#include <officecfg/Office/Calc.hxx> #include <memory> @@ -658,7 +659,31 @@ void ScCellShell::Execute( SfxRequest& rReq ) case SID_SELECTALL: { - pTabViewShell->SelectAll(); + SCTAB nTab = GetViewData().GetTabNo(); + SCCOL nStartCol = GetViewData().GetCurX(); + SCROW nStartRow = GetViewData().GetCurY(); + SCCOL nEndCol = nStartCol; + SCROW nEndRow = nStartRow; + bool bCanMark = false; + + ScMarkData& rMarkdata = GetViewData().GetMarkData(); + const bool bSelectFirst(officecfg::Office::Calc::Input::SelectRangeBeforeAll::get()); + + if (bSelectFirst && !rMarkdata.IsMarked()) + { + const ScDocument& rDoc = GetViewData().GetDocument(); + rDoc.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, true, false ); + bCanMark = nStartCol != nEndCol || nStartRow != nEndRow; + } + + if (bCanMark) + { + const ScRange aRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab); + pTabViewShell->MarkRange(aRange, false); + } + else + pTabViewShell->SelectAll(); + rReq.Done(); } break; diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 4f89028d4c16..8f4c162e474f 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -351,16 +351,16 @@ void ScEditShell::Execute( SfxRequest& rReq ) if( aSel.HasRange() ) sInput = pActiveView->GetSelected(); - if( aSel.nStartPos > aSel.nEndPos ) - aSel.nEndPos = aSel.nStartPos; + if (aSel.start.nIndex > aSel.end.nIndex) + aSel.end.nIndex = aSel.start.nIndex; //calculate a valid end-position by reading logical characters sal_Int32 nUtf16Pos=0; - while( (nUtf16Pos < sInput.getLength()) && (nUtf16Pos < aSel.nEndPos) ) + while ((nUtf16Pos < sInput.getLength()) && (nUtf16Pos < aSel.end.nIndex)) { sInput.iterateCodePoints(&nUtf16Pos); - if( nUtf16Pos > aSel.nEndPos ) - aSel.nEndPos = nUtf16Pos; + if (nUtf16Pos > aSel.end.nIndex) + aSel.end.nIndex = nUtf16Pos; } ToggleUnicodeCodepoint aToggle; @@ -369,7 +369,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) OUString sReplacement = aToggle.ReplacementString(); if( !sReplacement.isEmpty() ) { - aSel.nStartPos = aSel.nEndPos - aToggle.StringToReplace().getLength(); + aSel.start.nIndex = aSel.end.nIndex - aToggle.StringToReplace().getLength(); pTableView->SetSelection( aSel ); pTableView->InsertText(sReplacement, true); if( pTopView ) @@ -540,7 +540,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) ScDocument& rDoc = rViewData.GetDocument(); ScRefFinder aFinder(aText, rViewData.GetCurPos(), rDoc, rDoc.GetAddressConvention()); - aFinder.ToggleRel( aSel.nStartPos, aSel.nEndPos ); + aFinder.ToggleRel(aSel.start.nIndex, aSel.end.nIndex); if (aFinder.GetFound()) { const OUString& aNew = aFinder.GetText(); @@ -588,8 +588,8 @@ void ScEditShell::Execute( SfxRequest& rReq ) ESelection aSel = pTableView->GetSelection(); aSel.Adjust(); - aSel.nEndPara = aSel.nStartPara; - aSel.nEndPos = aSel.nStartPos + 1; + aSel.end.nPara = aSel.start.nPara; + aSel.end.nIndex = aSel.start.nIndex + 1; pTableView->SetSelection( aSel ); // insert new field @@ -605,8 +605,8 @@ void ScEditShell::Execute( SfxRequest& rReq ) if ( pTopView ) { aSel = pTopView->GetSelection(); - aSel.nEndPara = aSel.nStartPara; - aSel.nEndPos = aSel.nStartPos + 1; + aSel.end.nPara = aSel.start.nPara; + aSel.end.nIndex = aSel.start.nIndex + 1; pTopView->SetSelection( aSel ); pTopView->InsertField( aURLItem ); pTopView->SetSelection( aSel ); // select inserted field @@ -899,10 +899,10 @@ std::unique_ptr<const SvxFieldData> ScEditShell::GetFirstURLFieldFromCell() rEditEngine.GetPortions(nPara, aPosList); for (const auto& rPos : aPosList) { - aSel.nEndPos = rPos; + aSel.end.nIndex = rPos; SfxItemSet aEditSet(rEditEngine.GetAttribs(aSel)); - if (aSel.nStartPos + 1 == aSel.nEndPos) + if (aSel.start.nIndex + 1 == aSel.end.nIndex) { // test if the character is a text field if (const SvxFieldItem* pItem = aEditSet.GetItemIfSet(EE_FEATURE_FIELD, false)) @@ -914,7 +914,7 @@ std::unique_ptr<const SvxFieldData> ScEditShell::GetFirstURLFieldFromCell() } } } - aSel.nStartPos = aSel.nEndPos; + aSel.start.nIndex = aSel.end.nIndex; } } @@ -1300,7 +1300,7 @@ OUString ScEditShell::GetSelectionText( bool bWholeWord ) OUString aStrCurrentDelimiters = rEngine.GetWordDelimiters(); rEngine.SetWordDelimiters(u" .,;\"'"_ustr); - aStrSelection = rEngine.GetWord( aSel.nEndPara, aSel.nEndPos ); + aStrSelection = rEngine.GetWord(aSel.end); rEngine.SetWordDelimiters( aStrCurrentDelimiters ); } else diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 239b014cd5c9..7862d9b68d3d 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2071,9 +2071,20 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta SCROW nRealPosY; mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nRealPosX, nRealPosY, false );//the real row/col + bool bAutoFilterDisable = false; + bool bPivotDisable = false; + + if (rDoc.IsTabProtected(nTab)) + { + const ScTableProtection* pTabProtection = rDoc.GetTabProtection(nTab); + bAutoFilterDisable = pTabProtection && !pTabProtection->isOptionEnabled(ScTableProtection::AUTOFILTER);//autofilter + bPivotDisable = pTabProtection && !pTabProtection->isOptionEnabled(ScTableProtection::PIVOT_TABLES);//pivot + } + // show in the merged cells the filter of the first cell (nPosX instead of nRealPosX) const ScMergeFlagAttr* pRealPosAttr = rDoc.GetAttr(nPosX, nRealPosY, nTab, ATTR_MERGE_FLAG); - if( pRealPosAttr->HasAutoFilter() ) + + if (!bAutoFilterDisable && pRealPosAttr->HasAutoFilter()) { SC_MOD()->InputEnterHandler(); if (DoAutoFilterButton(nPosX, nRealPosY, rMEvt)) @@ -2081,7 +2092,7 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta } const ScMergeFlagAttr* pAttr = rDoc.GetAttr(nPosX, nPosY, nTab, ATTR_MERGE_FLAG); - if (pAttr->HasAutoFilter()) + if (!bAutoFilterDisable && pAttr->HasAutoFilter()) { if (DoAutoFilterButton(nPosX, nPosY, rMEvt)) { @@ -2090,7 +2101,8 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta } } - if (pAttr->HasPivotButton() || pAttr->HasPivotPopupButton() || pAttr->HasPivotMultiFieldPopupButton()) + if (!bPivotDisable && (pAttr->HasPivotButton() || pAttr->HasPivotPopupButton() || + pAttr->HasPivotMultiFieldPopupButton())) { DoPushPivotButton(nPosX, nPosY, rMEvt, pAttr->HasPivotButton(), pAttr->HasPivotPopupButton(), pAttr->HasPivotMultiFieldPopupButton()); @@ -2098,7 +2110,7 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta return; } - if (pAttr->HasPivotToggle()) + if (!bPivotDisable && pAttr->HasPivotToggle()) { DoPushPivotToggle(nPosX, nPosY, rMEvt); rState.mbActivatePart = false; @@ -3549,8 +3561,7 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCCOL nCellX, S aTextPos -= aOutputArea.TopLeft(); aTextPos += aVisArea.TopLeft(); // position in the edit document - EPosition aDocPosition = rEditEngine.FindDocPosition(aTextPos); - ESelection aCompare(aDocPosition.nPara, aDocPosition.nIndex); + ESelection aCompare(rEditEngine.FindDocPosition(aTextPos)); ESelection aSelection = pEditView->GetSelection(); aSelection.Adjust(); // needed for IsLess/IsGreater if ( aCompare < aSelection || aCompare > aSelection ) @@ -3598,8 +3609,7 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCCOL nCellX, S aTextPos -= aOutputArea.TopLeft(); aTextPos += aVisArea.TopLeft(); // position in the edit document - EPosition aDocPosition = rEditEngine.FindDocPosition(aTextPos); - ESelection aCompare(aDocPosition.nPara, aDocPosition.nIndex); + ESelection aCompare(rEditEngine.FindDocPosition(aTextPos)); ESelection aSelection = pOlView->GetSelection(); aSelection.Adjust(); // needed for IsLess/IsGreater if ( aCompare < aSelection || aCompare > aSelection ) diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx index 019e4da8f34e..40c6425a4025 100644 --- a/sc/source/ui/view/pivotsh.cxx +++ b/sc/source/ui/view/pivotsh.cxx @@ -128,6 +128,18 @@ void ScPivotShell::GetState( SfxItemSet& rSet ) ScDocShell* pDocSh = pViewShell->GetViewData().GetDocShell(); ScDocument& rDoc = pDocSh->GetDocument(); bool bDisable = pDocSh->IsReadOnly() || rDoc.GetChangeTrack(); + bool bFilterDisable = bDisable; + if (!bDisable) + { + SCCOL nTab = pViewShell->GetViewData().GetTabNo(); + const ScTableProtection* pTabProt = rDoc.GetTabProtection(nTab); + if (pTabProt && pTabProt->isProtected()) + { + bDisable = true; + if (!pTabProt->isOptionEnabled(ScTableProtection::PIVOT_TABLES)) + bFilterDisable = true; + } + } SfxWhichIter aIter(rSet); sal_uInt16 nWhich = aIter.FirstWhich(); @@ -148,7 +160,7 @@ void ScPivotShell::GetState( SfxItemSet& rSet ) case SID_DP_FILTER: { ScDPObject* pDPObj = GetCurrDPObject(); - if( bDisable || !pDPObj || !pDPObj->IsSheetData() ) + if( bFilterDisable || !pDPObj || !pDPObj->IsSheetData() ) rSet.DisableItem( nWhich ); } break; diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index 0a8b80fe2b68..cef708852d3f 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -151,11 +151,11 @@ void ScTabViewShell::InsertURL( const OUString& rName, const OUString& rURL, con static void lcl_SelectFieldAfterInsert( EditView& rView ) { ESelection aSel = rView.GetSelection(); - if ( aSel.nStartPos == aSel.nEndPos && aSel.nStartPos > 0 ) + if (aSel.start.nIndex == aSel.end.nIndex && aSel.start.nIndex > 0) { // Cursor is behind the inserted field -> extend selection to the left - --aSel.nStartPos; + --aSel.start.nIndex; rView.SetSelection( aSel ); } } diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 17677ee7ac61..026d90591208 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -728,11 +728,7 @@ void ScViewFunc::InsertBookmark( const OUString& rDescription, const OUString& r aEngine.SetText(aOld); } - sal_Int32 nPara = aEngine.GetParagraphCount(); - if (nPara) - --nPara; - sal_Int32 nTxtLen = aEngine.GetTextLen(nPara); - ESelection aInsSel( nPara, nTxtLen, nPara, nTxtLen ); + ESelection aInsSel(ESelection::AtEnd()); if ( bTryReplace && HasBookmarkAtCursor( nullptr ) ) { diff --git a/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui b/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui index 3f1e626d1b66..7a9ed18a0c9a 100644 --- a/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui +++ b/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui @@ -507,6 +507,7 @@ <object class="GtkBox" id="box3"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="orientation">vertical</property> <property name="spacing">6</property> diff --git a/sc/uiconfig/scalc/ui/protectsheetdlg.ui b/sc/uiconfig/scalc/ui/protectsheetdlg.ui index 83f1a1af012a..20835b596783 100644 --- a/sc/uiconfig/scalc/ui/protectsheetdlg.ui +++ b/sc/uiconfig/scalc/ui/protectsheetdlg.ui @@ -17,30 +17,30 @@ </columns> </object> <object class="GtkDialog" id="ProtectSheetDialog"> - <property name="can_focus">False</property> - <property name="border_width">6</property> + <property name="can-focus">False</property> + <property name="border-width">6</property> <property name="title" translatable="yes" context="protectsheetdlg|ProtectSheetDialog">Protect Sheet</property> <property name="modal">True</property> - <property name="default_width">0</property> - <property name="default_height">0</property> - <property name="type_hint">dialog</property> + <property name="default-width">0</property> + <property name="default-height">0</property> + <property name="type-hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">12</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> + <property name="can-focus">False</property> + <property name="layout-style">end</property> <child> <object class="GtkButton" id="ok"> <property name="label" translatable="yes" context="stock">_OK</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -53,8 +53,8 @@ <object class="GtkButton" id="cancel"> <property name="label" translatable="yes" context="stock">_Cancel</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -67,8 +67,8 @@ <object class="GtkButton" id="help"> <property name="label" translatable="yes" context="stock">_Help</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -82,14 +82,14 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="pack_type">end</property> + <property name="pack-type">end</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkBox" id="box1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="orientation">vertical</property> @@ -97,7 +97,7 @@ <child> <object class="GtkBox" id="box2"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="orientation">vertical</property> <property name="spacing">6</property> @@ -105,10 +105,10 @@ <object class="GtkCheckButton" id="protect"> <property name="label" translatable="yes" context="protectsheetdlg|protect">P_rotect this sheet and the contents of protected cells</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> </object> <packing> <property name="expand">False</property> @@ -120,33 +120,33 @@ <!-- n-columns=2 n-rows=3 --> <object class="GtkGrid" id="passwords"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> <child> <object class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="halign">end</property> <property name="label" translatable="yes" context="protectsheetdlg|label1">_Password:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">password1</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">password1</property> <property name="xalign">1</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkLabel" id="label2"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="halign">end</property> <property name="label" translatable="yes" context="protectsheetdlg|label2">_Confirm:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">password2</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">password2</property> <property name="xalign">1</property> </object> <packing> @@ -157,29 +157,29 @@ <child> <object class="GtkEntry" id="password1"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="visibility">False</property> - <property name="activates_default">True</property> - <property name="width_chars">24</property> + <property name="activates-default">True</property> + <property name="width-chars">24</property> <property name="truncate-multiline">True</property> - <property name="input_purpose">password</property> + <property name="input-purpose">password</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkEntry" id="password2"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="visibility">False</property> - <property name="activates_default">True</property> - <property name="width_chars">24</property> + <property name="activates-default">True</property> + <property name="width-chars">24</property> <property name="truncate-multiline">True</property> - <property name="input_purpose">password</property> + <property name="input-purpose">password</property> </object> <packing> <property name="left-attach">1</property> @@ -190,6 +190,11 @@ <object class="GtkLevelBar" id="passwordbar"> <property name="visible">True</property> <property name="can-focus">False</property> + <child internal-child="accessible"> + <object class="AtkObject" id="passwordbar-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="protectsheetdlg|extended_tip|passwordbar">Measure of password strength</property> + </object> + </child> </object> <packing> <property name="left-attach">1</property> @@ -216,7 +221,7 @@ <child> <object class="GtkBox" id="options"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="orientation">vertical</property> @@ -224,10 +229,10 @@ <child> <object class="GtkLabel" id="label4"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="protectsheetdlg|label4">Allow all users of this sheet to:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">checklist</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">checklist</property> <property name="xalign">0</property> </object> <packing> @@ -239,23 +244,23 @@ <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="hscrollbar_policy">never</property> - <property name="vscrollbar_policy">never</property> - <property name="shadow_type">in</property> + <property name="hscrollbar-policy">never</property> + <property name="vscrollbar-policy">never</property> + <property name="shadow-type">in</property> <child> <object class="GtkTreeView" id="checklist"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="model">liststore1</property> - <property name="headers_visible">False</property> - <property name="search_column">0</property> - <property name="show_expanders">False</property> + <property name="headers-visible">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="Macro Library List-selection2"/> </child> @@ -297,12 +302,12 @@ </child> <child> <object class="GtkBox" id="box4"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="homogeneous">True</property> <child> <object class="GtkLabel" id="protected"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="protectsheetdlg|protected">Select protected cells</property> </object> <packing> @@ -314,7 +319,7 @@ <child> <object class="GtkLabel" id="delete-columns"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="protectsheetdlg|delete-columns">Delete columns</property> </object> <packing> @@ -326,7 +331,7 @@ <child> <object class="GtkLabel" id="delete-rows"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="protectsheetdlg|delete-rows">Delete rows</property> </object> <packing> @@ -338,7 +343,7 @@ <child> <object class="GtkLabel" id="insert-columns"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="protectsheetdlg|insert-columns">Insert columns</property> </object> <packing> @@ -350,7 +355,7 @@ <child> <object class="GtkLabel" id="insert-rows"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="protectsheetdlg|insert-rows">Insert rows</property> </object> <packing> @@ -362,7 +367,7 @@ <child> <object class="GtkLabel" id="unprotected"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="protectsheetdlg|unprotected">Select unprotected cells</property> </object> <packing> @@ -371,6 +376,30 @@ <property name="position">1</property> </packing> </child> + <child> + <object class="GtkLabel" id="useautofilter"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="protectsheetdlg|delete-columns">Use AutoFilter</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">6</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="usepivot"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="protectsheetdlg|delete-columns">Use Pivot Table and Pivot Chart</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">7</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> @@ -399,9 +428,6 @@ <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> - <child type="titlebar"> - <placeholder/> - </child> <child internal-child="accessible"> <object class="AtkObject" id="ProtectSheetDialog-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="protectsheetdlg|extended_tip|ProtectSheetDialog">Protects the cells in the current sheet from being modified.</property> diff --git a/sc/uiconfig/scalc/ui/subtotaloptionspage.ui b/sc/uiconfig/scalc/ui/subtotaloptionspage.ui index d81fb987be61..0d1c54f510d0 100644 --- a/sc/uiconfig/scalc/ui/subtotaloptionspage.ui +++ b/sc/uiconfig/scalc/ui/subtotaloptionspage.ui @@ -1,39 +1,39 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.36.0 --> +<!-- Generated with glade 3.38.2 --> <interface domain="sc"> <requires lib="gtk+" version="3.20"/> <object class="GtkBox" id="SubTotalOptionsPage"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="border_width">6</property> + <property name="can-focus">False</property> + <property name="border-width">6</property> <property name="orientation">vertical</property> <property name="spacing">12</property> <child> <object class="GtkFrame" id="frame1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=1 n-rows=4 --> <object class="GtkGrid" id="grid1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="row_spacing">6</property> + <property name="can-focus">False</property> <property name="margin-start">12</property> <property name="margin-top">6</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row-spacing">6</property> <child> <object class="GtkCheckButton" id="pagebreak"> <property name="label" translatable="yes" context="subtotaloptionspage|pagebreak">_Page break between groups</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="hexpand">True</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> <child internal-child="accessible"> <object class="AtkObject" id="pagebreak-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="subtotaloptionspage|extended_tip|pagebreak">Inserts a new page after each group of subtotaled data.</property> @@ -41,19 +41,19 @@ </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkCheckButton" id="case"> <property name="label" translatable="yes" context="subtotaloptionspage|case">_Case sensitive</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="hexpand">True</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> <child internal-child="accessible"> <object class="AtkObject" id="case-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="subtotaloptionspage|extended_tip|case">Recalculates subtotals when you change the case of a data label.</property> @@ -61,19 +61,19 @@ </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkCheckButton" id="sort"> <property name="label" translatable="yes" context="subtotaloptionspage|sort">Pre-_sort area according to groups</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="hexpand">True</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> <child internal-child="accessible"> <object class="AtkObject" id="sort-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="subtotaloptionspage|extended_tip|sort">Sorts the area that you selected in the Group by box of the Group tabs according to the columns that you selected.</property> @@ -81,8 +81,28 @@ </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="left-attach">0</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="summarybelow"> + <property name="label" translatable="yes" context="subtotaloptionspage|sort">_Summary below data</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="hexpand">True</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="summarybelow-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="subtotaloptionspage|extended_tip|summarybelow">Decide if the subtotals below or above the data. Reposition subtotals when you change the summary below data options.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">3</property> </packing> </child> </object> @@ -90,7 +110,7 @@ <child type="label"> <object class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="subtotaloptionspage|label1">Groups</property> <attributes> <attribute name="weight" value="bold"/> @@ -107,31 +127,31 @@ <child> <object class="GtkFrame" id="frame2"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=1 n-rows=5 --> <object class="GtkGrid" id="grid2"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="row_spacing">6</property> + <property name="can-focus">False</property> <property name="margin-start">12</property> <property name="margin-top">6</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row-spacing">6</property> <child> <object class="GtkRadioButton" id="ascending"> <property name="label" translatable="yes" context="subtotaloptionspage|ascending">_Ascending</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="hexpand">True</property> - <property name="use_underline">True</property> + <property name="use-underline">True</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> <child internal-child="accessible"> <object class="AtkObject" id="ascending-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="subtotaloptionspage|extended_tip|ascending">Sorts beginning with the lowest value. You can define the sort rules on Data - Sort - Options.</property> @@ -139,19 +159,19 @@ </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkRadioButton" id="descending"> <property name="label" translatable="yes" context="subtotaloptionspage|descending">D_escending</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="hexpand">True</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> <property name="group">ascending</property> <child internal-child="accessible"> <object class="AtkObject" id="descending-atkobject"> @@ -160,19 +180,19 @@ </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkCheckButton" id="formats"> <property name="label" translatable="yes" context="subtotaloptionspage|formats">I_nclude formats</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="hexpand">True</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> <child internal-child="accessible"> <object class="AtkObject" id="formats-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="subtotaloptionspage|extended_tip|formats">Considers formatting attributes when sorting.</property> @@ -180,40 +200,40 @@ </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="left-attach">0</property> + <property name="top-attach">2</property> </packing> </child> <child> <object class="GtkCheckButton" id="btnuserdef"> <property name="label" translatable="yes" context="subtotaloptionspage|btnuserdef">C_ustom sort order</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="hexpand">True</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> <accessibility> <relation type="label-for" target="lbuserdef"/> </accessibility> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">3</property> + <property name="left-attach">0</property> + <property name="top-attach">3</property> </packing> </child> <child> <object class="GtkComboBoxText" id="lbuserdef"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="margin-start">12</property> <accessibility> <relation type="labelled-by" target="btnuserdef"/> </accessibility> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">4</property> + <property name="left-attach">0</property> + <property name="top-attach">4</property> </packing> </child> </object> @@ -221,7 +241,7 @@ <child type="label"> <object class="GtkLabel" id="label2"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="subtotaloptionspage|label2">Sort</property> <attributes> <attribute name="weight" value="bold"/> diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng index 4073fa6f1af2..c9d41d0778cd 100644 --- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng +++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng @@ -2727,6 +2727,15 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1. </rng:optional> </rng:define> + <!-- TODO no proposal, tdf#162262 --> + <rng:define name="table-subtotal-rules-attlist" combine="interleave"> + <rng:optional> + <rng:attribute name="loext:summary-below"> + <rng:ref name="boolean"/> + </rng:attribute> + </rng:optional> + </rng:define> + <!-- TODO no proposal, 9009663d --> <rng:define name="chart-chart-attlist" combine="interleave"> <rng:optional> @@ -2783,6 +2792,16 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1. <rng:ref name="boolean"/> </rng:attribute> </rng:optional> + <rng:optional> + <rng:attribute name="loext:use-autofilter"> + <rng:ref name="boolean"/> + </rng:attribute> + </rng:optional> + <rng:optional> + <rng:attribute name="loext:use-pivot"> + <rng:ref name="boolean"/> + </rng:attribute> + </rng:optional> </rng:element> </rng:define> <rng:define name="office-spreadsheet-attlist" combine="interleave"> diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx index b0cb6f105c46..9e5a2e040034 100644 --- a/sd/inc/sdpage.hxx +++ b/sd/inc/sdpage.hxx @@ -349,7 +349,7 @@ public: ::tools::Rectangle GetTitleRect() const; ::tools::Rectangle GetLayoutRect() const; - static void CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< ::tools::Rectangle >& rAreas ); + static void CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< ::tools::Rectangle >& rAreas, Orientation eOrient ); /** Set the "precious" flag to the given value. */ diff --git a/sd/qa/unit/TextFittingTest.cxx b/sd/qa/unit/TextFittingTest.cxx index 501c0c17d58a..42500862c4c9 100644 --- a/sd/qa/unit/TextFittingTest.cxx +++ b/sd/qa/unit/TextFittingTest.cxx @@ -90,17 +90,17 @@ CPPUNIT_TEST_FIXTURE(TextFittingTest, testTest) CPPUNIT_ASSERT_EQUAL(sal_Int32(6), rEditEngine.GetParagraphCount()); // Delete paragraph 6 - rEditView.SetSelection(ESelection(4, EE_TEXTPOS_MAX_COUNT, 5, EE_TEXTPOS_MAX_COUNT)); + rEditView.SetSelection(ESelection(4, EE_TEXTPOS_MAX, 5, EE_TEXTPOS_MAX)); rEditView.DeleteSelected(); CPPUNIT_ASSERT_EQUAL(sal_Int32(5), rEditEngine.GetParagraphCount()); // Delete paragraph 5 - rEditView.SetSelection(ESelection(3, EE_TEXTPOS_MAX_COUNT, 4, EE_TEXTPOS_MAX_COUNT)); + rEditView.SetSelection(ESelection(3, EE_TEXTPOS_MAX, 4, EE_TEXTPOS_MAX)); rEditView.DeleteSelected(); CPPUNIT_ASSERT_EQUAL(sal_Int32(4), rEditEngine.GetParagraphCount()); // Delete paragraph 4 - rEditView.SetSelection(ESelection(2, EE_TEXTPOS_MAX_COUNT, 3, EE_TEXTPOS_MAX_COUNT)); + rEditView.SetSelection(ESelection(2, EE_TEXTPOS_MAX, 3, EE_TEXTPOS_MAX)); rEditView.DeleteSelected(); CPPUNIT_ASSERT_EQUAL(sal_Int32(3), rEditEngine.GetParagraphCount()); diff --git a/sd/qa/unit/data/pptx/tdf158512.pptx b/sd/qa/unit/data/pptx/tdf158512.pptx Binary files differnew file mode 100644 index 000000000000..96494ddf656a --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf158512.pptx diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 9ee8c12bbea8..ec20d0c52946 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -2133,6 +2133,19 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf161430) CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, eXFS); } +CPPUNIT_TEST_FIXTURE(SdImportTest2, tdf158512) +{ + // First shape on first slide should have no fill to avoid hiding background + createSdImpressDoc("pptx/tdf158512.pptx"); + + const SdrPage* pPage = GetPage(1); + CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount()); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, + pPage->GetObj(0)->GetMergedItem(XATTR_FILLSTYLE).GetValue()); + CPPUNIT_ASSERT_EQUAL(false, + pPage->GetObj(0)->GetMergedItem(XATTR_FILLUSESLIDEBACKGROUND).GetValue()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 67e4ef2a1f4e..22b2d4881835 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -322,7 +322,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testPostKeyEvent) CPPUNIT_ASSERT(pView->GetTextEditObject()); EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView(); // Did we manage to enter a second character? - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), rEditView.GetSelection().nStartPos); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), rEditView.GetSelection().start.nIndex); ESelection aWordSelection(0, 0, 0, 2); // start para, start char, end para, end char. rEditView.SetSelection(aWordSelection); // Did we enter the expected character? @@ -345,7 +345,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testPostMouseEvent) CPPUNIT_ASSERT(pView->GetTextEditObject()); EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView(); // Did we manage to go after the first character? - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), rEditView.GetSelection().nStartPos); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), rEditView.GetSelection().start.nIndex); vcl::Cursor* pCursor = rEditView.GetCursor(); Point aPosition(pCursor->GetPos().getX(), pCursor->GetPos().getY() + pCursor->GetSize().Height() / 2); @@ -359,7 +359,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testPostMouseEvent) Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT(pView->GetTextEditObject()); // The new cursor position must be before the first word. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), rEditView.GetSelection().nStartPos); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), rEditView.GetSelection().start.nIndex); } CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSetTextSelection) @@ -2199,7 +2199,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testIMESupport) // the cursor should be at position 3rd EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView(); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), rEditView.GetSelection().nStartPos); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), rEditView.GetSelection().start.nIndex); ESelection aWordSelection(0, 0, 0, 3); // start para, start char, end para, end char. rEditView.SetSelection(aWordSelection); @@ -2723,7 +2723,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testPasteUndo) // - Actual : 4 // i.e. the cursor position after undo was at the end of the line, not at the start, as // expected. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aSelection.nStartPos); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aSelection.start.nIndex); } CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testShapeEditInMultipleViews) diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index 68a76636e4e4..ca064d19cff2 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -224,7 +224,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf111522) { &aInputString }); CPPUNIT_ASSERT(pView2->GetTextEditObject()); EditView& rEditView = pView2->GetTextEditOutlinerView()->GetEditView(); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), rEditView.GetSelection().nStartPos); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), rEditView.GetSelection().start.nIndex); pView2->SdrEndTextEdit(); // Without the accompanying fix in place, this test would have failed with an assertion failure // in SdrObjEditView::SdrEndTextEdit() as mpOldTextEditUndoManager was not nullptr. diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 5bd30a4fbeb9..b79ae78873e5 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -460,6 +460,9 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t else aTempAttr.Put( makeSdrTextMinFrameHeightItem( rRect.GetSize().Height() ) ); + if (eObjKind == PresObjKind::Notes) + aTempAttr.Put(makeSdrTextAutoGrowHeightItem(false)); + if (mbMaster) { // The size of presentation objects on the master page have to @@ -837,7 +840,9 @@ void SdPage::CreateTitleAndLayout(bool bInit, bool bCreate ) } std::vector< ::tools::Rectangle > aAreas; - CalculateHandoutAreas( static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()), pMasterPage->GetAutoLayout(), false, aAreas ); + CalculateHandoutAreas(static_cast<SdDrawDocument&>(getSdrModelFromSdrPage()), + pMasterPage->GetAutoLayout(), false, aAreas, + pMasterPage->GetOrientation()); const bool bSkip = pMasterPage->GetAutoLayout() == AUTOLAYOUT_HANDOUT3; std::vector< ::tools::Rectangle >::iterator iter( aAreas.begin() ); @@ -2010,10 +2015,10 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN } } } - else if ( eObjKind != SdrObjKind::TitleText && - eObjKind != SdrObjKind::OutlineText && - DynCastSdrTextObj( pObj.get() ) != nullptr && - pObj->GetOutlinerParaObject() ) + else if (eObjKind != SdrObjKind::TitleText + && eObjKind != SdrObjKind::OutlineText && mePageKind != PageKind::Notes + && DynCastSdrTextObj(pObj.get()) != nullptr + && pObj->GetOutlinerParaObject()) { /****************************************************** * normal text object: adjust text height @@ -2916,7 +2921,8 @@ bool SdPage::RestoreDefaultText( SdrObject* pObj ) return bRet; } -void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< ::tools::Rectangle >& rAreas ) +void SdPage::CalculateHandoutAreas(SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, + std::vector<::tools::Rectangle>& rAreas, Orientation eOrient) { SdPage& rHandoutMaster = *rModel.GetMasterSdPage( 0, PageKind::Handout ); @@ -2932,182 +2938,145 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, const sal_uInt16* pOffsets = aOffsets[0]; Size aArea = rHandoutMaster.GetSize(); - const bool bLandscape = aArea.Width() > aArea.Height(); + const bool bLandscape = aArea.Width() > aArea.Height() || eOrient == Orientation::Landscape; - if( eLayout == AUTOLAYOUT_NONE ) + if ((eOrient == Orientation::Landscape && aArea.Width() < aArea.Height()) + || (eOrient == Orientation::Portrait && aArea.Width() > aArea.Height())) { - // use layout from handout master - SdrObjListIter aShapeIter(&rHandoutMaster); + ::tools::Long nTmp = aArea.Width(); + aArea.setWidth(aArea.Height()); + aArea.setHeight(nTmp); + } - std::vector< ::tools::Rectangle > vSlidesAreas; - while ( aShapeIter.IsMore() ) - { - SdrPageObj* pPageObj = dynamic_cast<SdrPageObj*>( aShapeIter.Next() ); - // get slide rectangles - if (pPageObj) - vSlidesAreas.push_back( pPageObj->GetCurrentBoundRect() ); - } + if (eLayout == AUTOLAYOUT_NONE) + eLayout = rHandoutMaster.GetAutoLayout(); - if ( !bHorizontal || vSlidesAreas.size() < 4 ) - { // top to bottom, then right - rAreas.swap( vSlidesAreas ); - } - else - { // left to right, then down - switch ( vSlidesAreas.size() ) - { - case 4: - pOffsets = aOffsets[2]; - break; + const ::tools::Long nGapW = 1000; // gap is 1cm + const ::tools::Long nGapH = 1000; - default: - [[fallthrough]]; - case 6: - pOffsets = aOffsets[ bLandscape ? 3 : 1 ]; - break; + ::tools::Long nLeftBorder = rHandoutMaster.GetLeftBorder(); + ::tools::Long nRightBorder = rHandoutMaster.GetRightBorder(); + ::tools::Long nTopBorder = rHandoutMaster.GetUpperBorder(); + ::tools::Long nBottomBorder = rHandoutMaster.GetLowerBorder(); - case 9: - pOffsets = aOffsets[4]; - break; - } + const ::tools::Long nHeaderFooterHeight = static_cast< ::tools::Long >( (aArea.Height() - nTopBorder - nLeftBorder) * 0.05 ); - rAreas.resize( static_cast<size_t>(vSlidesAreas.size()) ); + nTopBorder += nHeaderFooterHeight; + nBottomBorder += nHeaderFooterHeight; - for( const ::tools::Rectangle& rRect : vSlidesAreas ) - { - rAreas[*pOffsets++] = rRect; - } - } - } - else - { - const ::tools::Long nGapW = 1000; // gap is 1cm - const ::tools::Long nGapH = 1000; + ::tools::Long nX = nGapW + nLeftBorder; + ::tools::Long nY = nGapH + nTopBorder; - ::tools::Long nLeftBorder = rHandoutMaster.GetLeftBorder(); - ::tools::Long nRightBorder = rHandoutMaster.GetRightBorder(); - ::tools::Long nTopBorder = rHandoutMaster.GetUpperBorder(); - ::tools::Long nBottomBorder = rHandoutMaster.GetLowerBorder(); + aArea.AdjustWidth( -(nGapW * 2 + nLeftBorder + nRightBorder) ); + aArea.AdjustHeight( -(nGapH * 2 + nTopBorder + nBottomBorder) ); - const ::tools::Long nHeaderFooterHeight = static_cast< ::tools::Long >( (aArea.Height() - nTopBorder - nLeftBorder) * 0.05 ); + sal_uInt16 nColCnt = 0, nRowCnt = 0; + switch ( eLayout ) + { + case AUTOLAYOUT_HANDOUT1: + nColCnt = 1; nRowCnt = 1; + break; - nTopBorder += nHeaderFooterHeight; - nBottomBorder += nHeaderFooterHeight; + case AUTOLAYOUT_HANDOUT2: + if( bLandscape ) + { + nColCnt = 2; nRowCnt = 1; + } + else + { + nColCnt = 1; nRowCnt = 2; + } + break; - ::tools::Long nX = nGapW + nLeftBorder; - ::tools::Long nY = nGapH + nTopBorder; + case AUTOLAYOUT_HANDOUT3: + if( bLandscape ) + { + nColCnt = 3; nRowCnt = 2; + } + else + { + nColCnt = 2; nRowCnt = 3; + } + pOffsets = aOffsets[ bLandscape ? 1 : 0 ]; + break; - aArea.AdjustWidth( -(nGapW * 2 + nLeftBorder + nRightBorder) ); - aArea.AdjustHeight( -(nGapH * 2 + nTopBorder + nBottomBorder) ); + case AUTOLAYOUT_HANDOUT4: + nColCnt = 2; nRowCnt = 2; + pOffsets = aOffsets[ bHorizontal ? 0 : 2 ]; + break; - sal_uInt16 nColCnt = 0, nRowCnt = 0; - switch ( eLayout ) - { - case AUTOLAYOUT_HANDOUT1: - nColCnt = 1; nRowCnt = 1; - break; + case AUTOLAYOUT_HANDOUT6: + if( bLandscape ) + { + nColCnt = 3; nRowCnt = 2; + } + else + { + nColCnt = 2; nRowCnt = 3; + } + if( !bHorizontal ) + pOffsets = aOffsets[ bLandscape ? 1 : 3 ]; + break; - case AUTOLAYOUT_HANDOUT2: - if( bLandscape ) - { - nColCnt = 2; nRowCnt = 1; - } - else - { - nColCnt = 1; nRowCnt = 2; - } - break; + default: + case AUTOLAYOUT_HANDOUT9: + nColCnt = 3; nRowCnt = 3; - case AUTOLAYOUT_HANDOUT3: - if( bLandscape ) - { - nColCnt = 3; nRowCnt = 2; - } - else - { - nColCnt = 2; nRowCnt = 3; - } - pOffsets = aOffsets[ bLandscape ? 1 : 0 ]; - break; + if( !bHorizontal ) + pOffsets = aOffsets[4]; + break; + } - case AUTOLAYOUT_HANDOUT4: - nColCnt = 2; nRowCnt = 2; - pOffsets = aOffsets[ bHorizontal ? 0 : 2 ]; - break; + rAreas.resize(static_cast<size_t>(nColCnt) * nRowCnt); - case AUTOLAYOUT_HANDOUT6: - if( bLandscape ) - { - nColCnt = 3; nRowCnt = 2; - } - else - { - nColCnt = 2; nRowCnt = 3; - } - if( !bHorizontal ) - pOffsets = aOffsets[ bLandscape ? 1 : 3 ]; - break; + Size aPartArea, aSize; + aPartArea.setWidth( (aArea.Width() - ((nColCnt-1) * nGapW) ) / nColCnt ); + aPartArea.setHeight( (aArea.Height() - ((nRowCnt-1) * nGapH) ) / nRowCnt ); - default: - case AUTOLAYOUT_HANDOUT9: - nColCnt = 3; nRowCnt = 3; + SdrPage* pFirstPage = rModel.GetMasterSdPage(0, PageKind::Standard); + if (pFirstPage && pFirstPage->GetWidth() && pFirstPage->GetHeight()) + { + // scale actual size into handout rect + double fScale = static_cast<double>(aPartArea.Width()) / static_cast<double>(pFirstPage->GetWidth()); - if( !bHorizontal ) - pOffsets = aOffsets[4]; - break; - } + aSize.setHeight( static_cast<::tools::Long>(fScale * pFirstPage->GetHeight() ) ); + if( aSize.Height() > aPartArea.Height() ) + { + fScale = static_cast<double>(aPartArea.Height()) / static_cast<double>(pFirstPage->GetHeight()); + aSize.setHeight( aPartArea.Height() ); + aSize.setWidth( static_cast<::tools::Long>(fScale * pFirstPage->GetWidth()) ); + } + else + { + aSize.setWidth( aPartArea.Width() ); + } - rAreas.resize(static_cast<size_t>(nColCnt) * nRowCnt); + nX += (aPartArea.Width() - aSize.Width()) / 2; + nY += (aPartArea.Height()- aSize.Height())/ 2; + } + else + { + aSize = aPartArea; + } - Size aPartArea, aSize; - aPartArea.setWidth( (aArea.Width() - ((nColCnt-1) * nGapW) ) / nColCnt ); - aPartArea.setHeight( (aArea.Height() - ((nRowCnt-1) * nGapH) ) / nRowCnt ); + Point aPos( nX, nY ); - SdrPage* pFirstPage = rModel.GetMasterSdPage(0, PageKind::Standard); - if (pFirstPage && pFirstPage->GetWidth() && pFirstPage->GetHeight()) - { - // scale actual size into handout rect - double fScale = static_cast<double>(aPartArea.Width()) / static_cast<double>(pFirstPage->GetWidth()); + const bool bRTL = rModel.GetDefaultWritingMode() == css::text::WritingMode_RL_TB; - aSize.setHeight( static_cast<::tools::Long>(fScale * pFirstPage->GetHeight() ) ); - if( aSize.Height() > aPartArea.Height() ) - { - fScale = static_cast<double>(aPartArea.Height()) / static_cast<double>(pFirstPage->GetHeight()); - aSize.setHeight( aPartArea.Height() ); - aSize.setWidth( static_cast<::tools::Long>(fScale * pFirstPage->GetWidth()) ); - } - else - { - aSize.setWidth( aPartArea.Width() ); - } + const ::tools::Long nOffsetX = (aPartArea.Width() + nGapW) * (bRTL ? -1 : 1); + const ::tools::Long nOffsetY = aPartArea.Height() + nGapH; + const ::tools::Long nStartX = bRTL ? nOffsetX*(1 - nColCnt) + nX : nX; - nX += (aPartArea.Width() - aSize.Width()) / 2; - nY += (aPartArea.Height()- aSize.Height())/ 2; - } - else + for(sal_uInt16 nRow = 0; nRow < nRowCnt; nRow++) + { + aPos.setX( nStartX ); + for(sal_uInt16 nCol = 0; nCol < nColCnt; nCol++) { - aSize = aPartArea; + rAreas[*pOffsets++] = ::tools::Rectangle(aPos, aSize); + aPos.AdjustX(nOffsetX ); } - Point aPos( nX, nY ); - - const bool bRTL = rModel.GetDefaultWritingMode() == css::text::WritingMode_RL_TB; - - const ::tools::Long nOffsetX = (aPartArea.Width() + nGapW) * (bRTL ? -1 : 1); - const ::tools::Long nOffsetY = aPartArea.Height() + nGapH; - const ::tools::Long nStartX = bRTL ? nOffsetX*(1 - nColCnt) + nX : nX; - - for(sal_uInt16 nRow = 0; nRow < nRowCnt; nRow++) - { - aPos.setX( nStartX ); - for(sal_uInt16 nCol = 0; nCol < nColCnt; nCol++) - { - rAreas[*pOffsets++] = ::tools::Rectangle(aPos, aSize); - aPos.AdjustX(nOffsetX ); - } - - aPos.AdjustY(nOffsetY ); - } + aPos.AdjustY(nOffsetY ); } } diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 22fb7eca3586..eccc2ce7d510 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -591,7 +591,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest const & rReq ) aStr += sQuote + "\"\n"; for( sal_Int32 nIdx = 0; nIdx >= 0; ) - aOutliner.Insert( aStr.getToken( 0, '\n', nIdx ), EE_PARA_APPEND, -1 ); + aOutliner.Insert(aStr.getToken(0, '\n', nIdx), EE_PARA_MAX, -1); if( aOutliner.GetParagraphCount() > 1 ) { @@ -599,8 +599,8 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest const & rReq ) aAnswerSet.Put(SvxPostureItem(ITALIC_NORMAL,EE_CHAR_ITALIC)); ESelection aSel; - aSel.nEndPara = aOutliner.GetParagraphCount()-2; - aSel.nEndPos = aOutliner.GetText( aOutliner.GetParagraph( aSel.nEndPara ) ).getLength(); + aSel.end.nPara = aOutliner.GetParagraphCount() - 2; + aSel.end.nIndex = aOutliner.GetText( aOutliner.GetParagraph( aSel.end.nPara ) ).getLength(); aOutliner.QuickSetAttribs( aAnswerSet, aSel ); } diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index ec9a2118eac1..939359f69c48 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -349,7 +349,7 @@ void AnnotationWindow::FillMenuButton() void AnnotationWindow::StartEdit() { - GetOutlinerView()->SetSelection(ESelection(EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT,EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT)); + GetOutlinerView()->SetSelection(ESelection::AtEnd()); GetOutlinerView()->ShowCursor(); } @@ -450,8 +450,7 @@ void AnnotationWindow::SetLanguage(const SvxLanguageItem &aNewItem) mpOutliner->SetModifyHdl( Link<LinkParamNone*,void>() ); ESelection aOld = GetOutlinerView()->GetSelection(); - ESelection aNewSelection( 0, 0, mpOutliner->GetParagraphCount()-1, EE_TEXTPOS_ALL ); - GetOutlinerView()->SetSelection( aNewSelection ); + GetOutlinerView()->SetSelection(ESelection::All()); SfxItemSet aEditAttr(GetOutlinerView()->GetAttribs()); aEditAttr.Put(aNewItem); GetOutlinerView()->SetAttribs( aEditAttr ); diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index a69e61f647dd..4f6cee32ce1b 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -570,7 +570,7 @@ bool HeaderFooterTabPage::GetOrSetDateTimeLanguage(LanguageType& rLanguage, bool if( pOPO ) pOutl->SetText( *pOPO ); - EPosition aDateFieldPosition; + EPaM aDateFieldPosition; bool bHasDateFieldItem = false; sal_Int32 nParaCount = pEdit->GetParagraphCount(); diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 4b1e790428f8..f13a5b385505 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -346,8 +346,8 @@ void DrawDocShell::Execute( SfxRequest& rReq ) { ESelection aSel = rEditView.GetSelection(); aOldSel = aSel; - aSel.nStartPos = 0; - aSel.nEndPos = EE_TEXTPOS_ALL; + aSel.start.nIndex = 0; + aSel.end.nIndex = EE_TEXTPOS_MAX; rEditView.SetSelection( aSel ); } diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 76562ed093ca..202d69fc0aad 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -285,13 +285,6 @@ bool DrawDocShell::Load( SfxMedium& rMedium ) mpDoc->SetStarDrawPreviewMode( true ); } - if (SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION)) - { - const sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue(); - bStartPresentation = nStartingSlide; - mpDoc->SetStartWithPresentation(nStartingSlide); - } - bRet = SfxObjectShell::Load( rMedium ); if (bRet) { @@ -335,6 +328,25 @@ bool DrawDocShell::Load( SfxMedium& rMedium ) SetError(ERRCODE_ABORT); } + if (SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION)) + { + sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue(); + if (nStartingSlide == 0) + { + OUString sStartPage = mpDoc->getPresentationSettings().maPresPage; + if (!sStartPage.isEmpty()) + { + bool bIsMasterPage = false; + sal_uInt16 nPageNumb = mpDoc->GetPageByName(sStartPage, bIsMasterPage); + nStartingSlide = (nPageNumb + 1) / 2; + } + else + nStartingSlide = 1; + } + bStartPresentation = nStartingSlide; + mpDoc->SetStartWithPresentation(nStartingSlide); + } + // tell SFX to change viewshell when in preview mode if( IsPreview() || bStartPresentation ) { @@ -435,16 +447,25 @@ bool DrawDocShell::ImportFrom(SfxMedium &rMedium, SfxItemSet& rSet = rMedium.GetItemSet(); if (SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION)) { - const sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue(); - if (nStartingSlide) + sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue(); + if (nStartingSlide == 0) { - mpDoc->SetStartWithPresentation(nStartingSlide); - - // tell SFX to change viewshell when in preview mode - if (IsPreview()) + OUString sStartPage = mpDoc->getPresentationSettings().maPresPage; + if (!sStartPage.isEmpty()) { - GetMedium()->GetItemSet().Put(SfxUInt16Item(SID_VIEW_ID, 1)); + bool bIsMasterPage = false; + sal_uInt16 nPageNumb = mpDoc->GetPageByName(sStartPage, bIsMasterPage); + nStartingSlide = (nPageNumb + 1) / 2; } + else + nStartingSlide = 1; + } + mpDoc->SetStartWithPresentation(nStartingSlide); + + // tell SFX to change viewshell when in preview mode + if (IsPreview()) + { + GetMedium()->GetItemSet().Put(SfxUInt16Item(SID_VIEW_ID, 1)); } } @@ -470,7 +491,19 @@ bool DrawDocShell::ConvertFrom( SfxMedium& rMedium ) if (SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION)) { - const sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue(); + sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue(); + if (nStartingSlide == 0) + { + OUString sStartPage = mpDoc->getPresentationSettings().maPresPage; + if (!sStartPage.isEmpty()) + { + bool bIsMasterPage = false; + sal_uInt16 nPageNumb = mpDoc->GetPageByName(sStartPage, bIsMasterPage); + nStartingSlide = (nPageNumb + 1) / 2; + } + else + nStartingSlide = 1; + } bStartPresentation = nStartingSlide; mpDoc->SetStartWithPresentation(nStartingSlide); } @@ -972,7 +1005,9 @@ void DrawDocShell::OpenBookmark( const OUString& rBookmarkURL ) { SfxStringItem aStrItem( SID_FILE_NAME, rBookmarkURL ); SfxStringItem aReferer( SID_REFERER, GetMedium()->GetName() ); - const SfxPoolItem* ppArgs[] = { &aStrItem, &aReferer, nullptr }; + SfxUInt16Item aPresentation( SID_DOC_STARTPRESENTATION ); + const SfxPoolItem* ppArgs[] = { &aStrItem, &aReferer, &aPresentation, nullptr }; + if (SfxViewFrame* pFrame = mpViewShell ? mpViewShell->GetViewFrame() : SfxViewFrame::Current()) pFrame->GetBindings().Execute( SID_OPENHYPERLINK, ppArgs ); } diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index a19e6ff51a3a..ba2e1d71cc50 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -138,8 +138,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark ) pOV->InsertText( aStr, true); ESelection aSel = pOV->GetSelection(); - aSel.nStartPara = aSel.nEndPara; - aSel.nStartPos = aSel.nEndPos; + aSel.CollapseToEnd(); pOV->SetSelection(aSel); rUndoMgr.LeaveListAction(); @@ -270,8 +269,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) pOV->SetAttribs(aSet); ESelection aSel = pOV->GetSelection(); - aSel.nStartPara = aSel.nEndPara; - aSel.nStartPos = aSel.nEndPos; + aSel.CollapseToEnd(); pOV->SetSelection(aSel); // do not go ahead with setting attributes of special characters diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 8b67b00424b1..45f67a5bdde7 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -473,8 +473,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) { Paragraph* pPara = aOutliner.GetParagraph( 0 ); sal_uLong nLen = aOutliner.GetText( pPara ).getLength(); - aOutliner.QuickDelete( ESelection( 0, nLen, 1, 0 ) ); - aOutliner.QuickInsertLineBreak( ESelection( 0, nLen, 0, nLen ) ); + aOutliner.QuickInsertLineBreak(ESelection(0, nLen, 1, 0)); } } } diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx index ac5d87636098..2640b9251f19 100644 --- a/sd/source/ui/func/fuparagr.cxx +++ b/sd/source/ui/func/fuparagr.cxx @@ -82,8 +82,8 @@ void FuParagraph::DoExecute( SfxRequest& rReq ) if( pOutlView && pOutliner ) { ESelection eSelection = pOutlView->GetSelection(); - aNewAttr.Put( SfxInt16Item( ATTR_NUMBER_NEWSTART_AT, pOutliner->GetNumberingStartValue( eSelection.nStartPara ) ) ); - aNewAttr.Put( SfxBoolItem( ATTR_NUMBER_NEWSTART, pOutliner->IsParaIsNumberingRestart( eSelection.nStartPara ) ) ); + aNewAttr.Put( SfxInt16Item( ATTR_NUMBER_NEWSTART_AT, pOutliner->GetNumberingStartValue( eSelection.start.nPara ) ) ); + aNewAttr.Put( SfxBoolItem( ATTR_NUMBER_NEWSTART, pOutliner->IsParaIsNumberingRestart( eSelection.start.nPara ) ) ); } SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); @@ -114,13 +114,13 @@ void FuParagraph::DoExecute( SfxRequest& rReq ) if( const SfxBoolItem* pItem = pArgs->GetItemIfSet( ATTR_NUMBER_NEWSTART, false ) ) { const bool bNewStart = pItem->GetValue(); - pOutliner->SetParaIsNumberingRestart( eSelection.nStartPara, bNewStart ); + pOutliner->SetParaIsNumberingRestart( eSelection.start.nPara, bNewStart ); } if( const SfxInt16Item* pItem = pArgs->GetItemIfSet( ATTR_NUMBER_NEWSTART_AT, false ) ) { const sal_Int16 nStartAt = pItem->GetValue(); - pOutliner->SetNumberingStartValue( eSelection.nStartPara, nStartAt ); + pOutliner->SetNumberingStartValue( eSelection.start.nPara, nStartAt ); } } diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 8693a535c731..799dc51c42aa 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -1098,9 +1098,8 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag) else { // Move cursor to end of text - ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND); if (pOLV != nullptr) - pOLV->SetSelection(aNewSelection); + pOLV->SetSelection(ESelection::AtEnd()); } } else @@ -1376,11 +1375,7 @@ void FuText::ChangeFontSize( bool bGrow, OutlinerView* pOLV, const FontList* pFo pOLV = pView->GetTextEditOutlinerView(); if( pOLV ) { - EditEngine& rEditEngine = pOLV->GetEditView().getEditEngine(); - ESelection aSel; - aSel.nEndPara = rEditEngine.GetParagraphCount() - 1; - aSel.nEndPos = rEditEngine.GetTextLen(aSel.nEndPara); - pOLV->SetSelection(aSel); + pOLV->SetSelection(ESelection::All()); ChangeFontSize( bGrow, pOLV, pFontList, pView ); } diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index 596816931c15..493756871998 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -176,6 +176,7 @@ public: const Point& rPos, const Size& rSize ); bool PasteRTFTable( SvStream& rOStm, SdrPage* pPage, SdrInsertFlags nPasteOptions ); + bool PasteHTMLTable( SvStream& rOStm, SdrPage* pPage, SdrInsertFlags nPasteOptions ); bool IsPresObjSelected(bool bOnPage = true, bool bOnMasterPage = true, bool bCheckPresObjListOnly = false, bool bCheckLayoutOnly = false) const; diff --git a/sd/source/ui/inc/tablefunction.hxx b/sd/source/ui/inc/tablefunction.hxx index fe32f16b51b6..68c037eb9318 100644 --- a/sd/source/ui/inc/tablefunction.hxx +++ b/sd/source/ui/inc/tablefunction.hxx @@ -27,6 +27,7 @@ namespace sd { void CreateTableFromRTF(SvStream& rStream, SdDrawDocument* pModel); +void CreateTableFromHTML(SvStream& rStream, SdDrawDocument* pModel); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx index 6f886c1becec..5670ffb1fd86 100644 --- a/sd/source/ui/table/tablefunction.cxx +++ b/sd/source/ui/table/tablefunction.cxx @@ -286,6 +286,32 @@ void CreateTableFromRTF( SvStream& rStream, SdDrawDocument* pModel ) sdr::table::ImportAsRTF( rStream, *pObj ); } +void CreateTableFromHTML(SvStream& rStream, SdDrawDocument* pModel) +{ + rStream.Seek( 0 ); + + if( !pModel ) + return; + + SdrPage* pPage = pModel->GetPage(0); + if( !pPage ) + return; + + Size aSize( 200, 200 ); + ::tools::Rectangle aRect (Point(), aSize); + rtl::Reference<sdr::table::SdrTableObj> pObj = new sdr::table::SdrTableObj( + *pModel, + aRect, + 1, + 1); + pObj->NbcSetStyleSheet( pModel->GetDefaultStyleSheet(), true ); + apply_table_style( pObj.get(), pModel, OUString() ); + + pPage->NbcInsertObject( pObj.get() ); + + sdr::table::ImportAsHTML( rStream, *pObj ); +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx index 6f93ed4c61c9..e1511a1391fd 100644 --- a/sd/source/ui/unoidl/unosrch.cxx +++ b/sd/source/ui/unoidl/unosrch.cxx @@ -461,14 +461,14 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( const uno:: ESelection aEndSel( GetSelection( xPortion->getEnd() ) ); // special case for empty portions with content or length one portions with content (fields) - if( (aStartSel.nStartPos == aEndSel.nStartPos) || ( (aStartSel.nStartPos == (aEndSel.nStartPos - 1)) && (nLen > 1) ) ) + if( (aStartSel.start.nIndex == aEndSel.start.nIndex) || ( (aStartSel.start.nIndex == (aEndSel.start.nIndex - 1)) && (nLen > 1) ) ) { for( sal_Int32 i = 0; i < nLen; i++ ) { if( ndbg < (nTextLen+2) ) { - *pPos++ = aStartSel.nStartPos; - *pPara++ = aStartSel.nStartPara; + *pPos++ = aStartSel.start.nIndex; + *pPara++ = aStartSel.start.nPara; ndbg += 1; } @@ -478,7 +478,7 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( const uno:: } } - nLastPos = aStartSel.nStartPos; + nLastPos = aStartSel.start.nIndex; } // normal case else @@ -487,8 +487,8 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( const uno:: { if( ndbg < (nTextLen+2) ) { - *pPos++ = aStartSel.nStartPos++; - *pPara++ = aStartSel.nStartPara; + *pPos++ = aStartSel.start.nIndex++; + *pPara++ = aStartSel.start.nPara; ndbg += 1; } @@ -498,10 +498,10 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( const uno:: } } - nLastPos = aStartSel.nStartPos - 1; - DBG_ASSERT( aEndSel.nStartPos == aStartSel.nStartPos, "Search is not working" ); + nLastPos = aStartSel.start.nIndex - 1; + DBG_ASSERT( aEndSel.start.nIndex == aStartSel.start.nIndex, "Search is not working" ); } - nLastPara = aStartSel.nStartPara; + nLastPara = aStartSel.start.nPara; } } } @@ -529,7 +529,7 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( const uno:: sal_Int32 nEndPos = 0; for( nStartPos = 0; nStartPos < nTextLen; nStartPos++ ) { - if( pConvertPara[nStartPos] == aSel.nStartPara && pConvertPos[nStartPos] == aSel.nStartPos ) + if( pConvertPara[nStartPos] == aSel.start.nPara && pConvertPos[nStartPos] == aSel.start.nIndex ) break; } diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 3b8c62994b76..83e612bf5587 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -43,7 +43,11 @@ #include <comphelper/sequence.hxx> #include <rtl/ustrbuf.hxx> #include <editeng/editstat.hxx> +#include <editeng/eeitem.hxx> #include <editeng/outlobj.hxx> +#include <editeng/ulspitem.hxx> +#include <svx/sdtfsitm.hxx> +#include <svx/sdooitm.hxx> #include <svx/svdetc.hxx> #include <svx/svditer.hxx> #include <svx/svdopage.hxx> @@ -75,6 +79,20 @@ namespace sd { namespace { + void lcl_AdjustPageSize(Size& rPageSize, const Size& rPrintPageSize) + { + bool bOrientationDiff = (rPageSize.Width() < rPageSize.Height() + && rPrintPageSize.Width() > rPrintPageSize.Height()) + || (rPageSize.Width() > rPageSize.Height() + && rPrintPageSize.Width() < rPrintPageSize.Height()); + if (bOrientationDiff) + { + ::tools::Long nTmp = rPageSize.Width(); + rPageSize.setWidth(rPageSize.Height()); + rPageSize.setHeight(nTmp); + } + } + /** Convenience class to extract values from the sequence of properties given to one of the XRenderable methods. */ @@ -781,6 +799,286 @@ namespace { const sal_uInt16 mnPageIndex; }; + /** The NotesPrinterPage is used for printing notes pages onto one or more printer pages + */ + class NotesPrinterPage : public PrinterPage + { + public: + NotesPrinterPage( + const sal_uInt16 nPageIndex, + const sal_Int32 nPageNumb, + const sal_Int32 nPageCount, + const bool bScaled, + const PageKind ePageKind, + const MapMode& rMapMode, + const bool bPrintMarkedOnly, + const OUString& rsPageString, + const Point& rPageStringOffset, + const DrawModeFlags nDrawMode, + const Orientation eOrientation, + const sal_uInt16 nPaperTray) + : PrinterPage(ePageKind, rMapMode, bPrintMarkedOnly, rsPageString, rPageStringOffset, + nDrawMode, eOrientation, nPaperTray), + mnPageIndex(nPageIndex), + mnPageNumb(nPageNumb), + mnPageCount(nPageCount), + mbScaled(bScaled) + { + } + + virtual void Print( + Printer& rPrinter, + SdDrawDocument& rDocument, + ViewShell&, + View* pView, + DrawView& rPrintView, + const SdrLayerIDSet& rVisibleLayers, + const SdrLayerIDSet& rPrintableLayers) const override + { + SdPage* pPageToPrint = rDocument.GetSdPage(mnPageIndex, mePageKind); + rPrinter.SetMapMode(maMap); + + // Clone the current page to create an independent instance for modifications. + // This ensures that changes made to pNotesPage do not affect the original page. + rtl::Reference<SdPage> pNotesPage + = static_cast<SdPage*>(pPageToPrint->CloneSdrPage(rDocument).get()); + + Size aPageSize; + if (mbScaled) + { + aPageSize = pNotesPage->GetSize(); + lcl_AdjustPageSize(aPageSize, rPrinter.GetPrintPageSize()); + } + else + aPageSize = rPrinter.GetPrintPageSize(); + + // Adjusts the objects on the notes page to fit the new page size. + ::tools::Rectangle aNewBorderRect(-1, -1, -1, -1); + pNotesPage->ScaleObjects(aPageSize, aNewBorderRect, true); + + SdrObject* pNotesObj = pNotesPage->GetPresObj(PresObjKind::Notes); + if (pNotesObj) + { + // new page(s) margins + sal_Int32 nLeft = aPageSize.Width() * 0.1; + sal_Int32 nRight = nLeft; + sal_Int32 nTop = aPageSize.Height() * 0.075; + sal_Int32 nBottom = nTop; + + Point aNotesPt = pNotesObj->GetRelativePos(); + Size aNotesSize = pNotesObj->GetLogicRect().GetSize(); + + Outliner* pOut = rDocument.GetInternalOutliner(); + const OutlinerMode nSaveOutlMode(pOut->GetOutlinerMode()); + const bool bSavedUpdateMode(pOut->IsUpdateLayout()); + pOut->SetPaperSize(aNotesSize); + pOut->SetUpdateLayout(true); + pOut->Clear(); + pOut->SetText(*pNotesObj->GetOutlinerParaObject()); + + bool bAutoGrow = pNotesObj->GetMergedItem(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); + + // If AutoGrowHeight property is enabled and the notes page has a lower border, + // use the lower border but if there is no lower border, use the bottom margin + // to determine the first page break position. + // If AutoGrow is not enabled, the notes object defines the first page break. + ::tools::Long nNotesPageBottom + = bAutoGrow ? (pNotesPage->GetLowerBorder() != 0) + ? aPageSize.Height() - pNotesPage->GetLowerBorder() + : aPageSize.Height() - nBottom + : aNotesPt.Y() + aNotesSize.Height(); + if (mbScaled) + { + sal_Int32 nTextHeight = aNotesPt.Y() + pOut->GetTextHeight(); + if (bAutoGrow && (nTextHeight > nNotesPageBottom)) + { + pNotesObj->SetMergedItem(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false)); + + ::tools::Long nObjW = aNotesSize.Width(); + ::tools::Long nObjH = aPageSize.Height() - aNotesPt.Y() - nBottom; + + pNotesObj->SetLogicRect(::tools::Rectangle(aNotesPt, Size(nObjW, nObjH))); + } + SdrTextFitToSizeTypeItem eFitToSize = drawing::TextFitToSizeType_AUTOFIT; + pNotesObj->SetMergedItem(eFitToSize); + } + else // original size + { + bool bExit = false; + sal_Int32 nPrevLineLen = 0; + sal_Int32 nPrevParaIdx = 0; + sal_uInt16 nActualPageNumb = 1; + sal_uInt16 nPrevParaLowerSpace = 0; + ::tools::Long nCurrentPosY = aNotesPt.Y(); + sal_Int32 nParaCount = pOut->GetParagraphCount(); + std::vector<std::pair<sal_Int32, sal_Int32>> aPageBreaks; + + for (sal_Int32 i = 0; i < nParaCount && !bExit; ++i) + { + sal_Int32 nActualLineLen = 0; + sal_Int32 nLineCount = pOut->GetLineCount(i); + + sal_uInt16 nLowerSpace = 0; + sal_uInt16 nUpperSpace = nPrevParaLowerSpace; + const SfxItemSet* pItemSet = &pOut->GetParaAttribs(i); + if(pItemSet->HasItem(EE_PARA_ULSPACE)) + { + nLowerSpace = pItemSet->Get(EE_PARA_ULSPACE).GetLower(); + nUpperSpace = (i != 0) ? pItemSet->Get(EE_PARA_ULSPACE).GetUpper() : 0; + if (nPrevParaLowerSpace > nUpperSpace) + nUpperSpace = nPrevParaLowerSpace; + } + + for (sal_Int32 j = 0; j < nLineCount; ++j) + { + nActualLineLen += pOut->GetLineLen(i, j); + sal_Int32 nLineHeight = pOut->GetLineHeight(i, j); + + if (nUpperSpace != 0 && (i > 0) && (j == 0)) + nLineHeight += nUpperSpace; + + sal_Int32 nNextPosY = nCurrentPosY + nLineHeight; + + if (nNextPosY > nNotesPageBottom) + { + // If the current or the next page matches the print page + // calculate and add a page break, since we only want to add + // a page break if the page is relevant. + if (mnPageNumb == nActualPageNumb + || mnPageNumb == nActualPageNumb + 1) + { + if (!aPageBreaks.empty()) + { + // determine the page break at the bottom of the page + // for pages that have both a previous and a following page + aPageBreaks.emplace_back( + nPrevParaIdx - aPageBreaks[0].first, nPrevLineLen); + } + else + { + if (mnPageNumb == 1 || (nLineCount > 1 && j != 0)) + { + // first page or multi-line paragraphs + aPageBreaks.emplace_back(nPrevParaIdx, nPrevLineLen); + } + else + { // single-line paragraphs + aPageBreaks.emplace_back(nPrevParaIdx + 1, 0); + } + } + + if (mnPageNumb == nActualPageNumb || mnPageNumb == mnPageCount) + { + bExit = true; + break; + } + } + + if (nUpperSpace > 0) + nLineHeight -= nUpperSpace; + + nNotesPageBottom = aPageSize.Height() - nBottom; + nCurrentPosY = nTop; + nActualPageNumb++; + nActualLineLen = 0; + } + nPrevParaIdx = i; + nPrevLineLen = nActualLineLen; + nCurrentPosY += nLineHeight; + } + nPrevParaLowerSpace = nLowerSpace; + } + + if (!aPageBreaks.empty()) + { + ESelection aE; + if (mnPageNumb == 1) + { + aE.start.nPara = aPageBreaks[0].first; + aE.start.nIndex = aPageBreaks[0].second; + aE.end.nPara = pOut->GetParagraphCount() - 1; + aE.end.nIndex = pOut->GetText(pOut->GetParagraph(aE.end.nPara)).getLength(); + pOut->QuickDelete(aE); + } + else + { + sal_Int16 nDepth = pOut->GetDepth(aPageBreaks[0].first); + SfxItemSet aItemSet = pOut->GetParaAttribs(aPageBreaks[0].first); + + aE.start.nPara = 0; + aE.start.nIndex = 0; + aE.end.nPara = aPageBreaks[0].first; + aE.end.nIndex = aPageBreaks[0].second; + pOut->QuickDelete(aE); + + Paragraph* pFirstPara = pOut->GetParagraph(0); + pOut->SetDepth(pFirstPara, nDepth); + pOut->SetParaAttribs(0, aItemSet); + + if (aPageBreaks.size() > 1) + { + aE.start.nPara = aPageBreaks[1].first; + aE.start.nIndex = aPageBreaks[1].second; + aE.end.nPara = pOut->GetParagraphCount() - 1; + aE.end.nIndex = pOut->GetText(pOut->GetParagraph(aE.end.nPara)).getLength(); + pOut->QuickDelete(aE); + } + } + } + pNotesObj->SetOutlinerParaObject(pOut->CreateParaObject()); + + Size aObjSize; + if (mnPageNumb != 1) // new page(s) + { + SdrObjListIter aShapeIter(pNotesPage.get()); + while (aShapeIter.IsMore()) + { + SdrObject* pObj = aShapeIter.Next(); + if (pObj && pObj->GetObjIdentifier() != SdrObjKind::Text) + pNotesPage->RemoveObject(pObj->GetOrdNum()); + } + + aNotesPt.setX(nLeft); + aNotesPt.setY(nTop); + ::tools::Long nWidth = aPageSize.Width() - nLeft - nRight; + aObjSize = Size(nWidth, pOut->GetTextHeight()); + } + else // first page + { + if (!bAutoGrow) + aObjSize = aNotesSize; + else + aObjSize = Size(aNotesSize.Width(), pOut->GetTextHeight()); + } + pNotesObj->SetLogicRect(::tools::Rectangle(aNotesPt, aObjSize)); + } + pOut->Clear(); + pOut->SetUpdateLayout(bSavedUpdateMode); + pOut->Init(nSaveOutlMode); + } + pNotesPage->SetSize(aPageSize); + + PrintPage( + rPrinter, + rPrintView, + *pNotesPage, + pView, + mbPrintMarkedOnly, + rVisibleLayers, + rPrintableLayers); + PrintMessage( + rPrinter, + msPageString, + maPageStringOffset); + } + + private: + const sal_uInt16 mnPageIndex; + const sal_Int32 mnPageNumb; + const sal_Int32 mnPageCount; + const bool mbScaled; + }; + /** Print one slide multiple times on a printer page so that the whole printer page is covered. */ @@ -964,6 +1262,21 @@ namespace { { SdPage& rHandoutPage (*rDocument.GetSdPage(0, PageKind::Handout)); + Size aPageSize(rHandoutPage.GetSize()); + Size aPrintPageSize = rPrinter.GetPrintPageSize(); + + if ((aPageSize.Width() < aPageSize.Height() + && aPrintPageSize.Width() > aPrintPageSize.Height()) + || (aPageSize.Width() > aPageSize.Height() + && aPrintPageSize.Width() < aPrintPageSize.Height())) + { + ::tools::Long nTmp = aPageSize.Width(); + aPageSize.setWidth(aPageSize.Height()); + aPageSize.setHeight(nTmp); + + rHandoutPage.SetSize(aPageSize); + } + Reference< css::beans::XPropertySet > xHandoutPage( rHandoutPage.getUnoPage(), UNO_QUERY ); static constexpr OUString sPageNumber( u"Number"_ustr ); @@ -1198,7 +1511,11 @@ public: : VclPtr< OutputDevice >(); mpPrinter = dynamic_cast<Printer*>(pOut.get()); Size aPageSizePixel = mpPrinter ? mpPrinter->GetPaperSizePixel() : Size(); - if( aPageSizePixel != maPrinterPageSizePixel ) + Size aPrintPageSize = mpPrinter ? mpPrinter->GetPrintPageSize() : Size(); + + lcl_AdjustPageSize(aPageSizePixel, aPrintPageSize); + + if (aPageSizePixel != maPrinterPageSizePixel) { bIsPaperChanged = true; maPrinterPageSizePixel = aPageSizePixel; @@ -1361,11 +1678,15 @@ private: { aPaperSize.setWidth(rInfo.mpPrinter->GetPaperSize().Width()); aPaperSize.setHeight(rInfo.mpPrinter->GetPaperSize().Height()); + + if (!mpOptions->IsBooklet()) + lcl_AdjustPageSize(aPaperSize, rInfo.mpPrinter->GetPrintPageSize()); } maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height()); - if (mpOptions->IsPrinterPreferred(pDocument->GetDocumentType())) + if (mpOptions->IsPrinterPreferred(pDocument->GetDocumentType()) + && ePageKind == PageKind::Standard && !mpOptions->IsBooklet()) { if( (rInfo.meOrientation == Orientation::Landscape && (aPaperSize.Width() < aPaperSize.Height())) @@ -1512,8 +1833,14 @@ private: const bool bDrawLines (eLayout == AUTOLAYOUT_HANDOUT3); + Size aHandoutPageSize = pHandout->GetSize(); + lcl_AdjustPageSize(aHandoutPageSize, mpPrinter->GetPrintPageSize()); + Orientation eOrient = aHandoutPageSize.Width() > aHandoutPageSize.Height() + ? Orientation::Landscape + : Orientation::Portrait; + std::vector< ::tools::Rectangle > aAreas; - SdPage::CalculateHandoutAreas( rModel, eLayout, bHandoutHorizontal, aAreas ); + SdPage::CalculateHandoutAreas( rModel, eLayout, bHandoutHorizontal, aAreas, eOrient ); std::vector< ::tools::Rectangle >::iterator iter( aAreas.begin() ); while( iter != aAreas.end() ) @@ -1756,28 +2083,18 @@ private: SdPage& rMaster (dynamic_cast<SdPage&>(rHandoutPage.TRG_GetMasterPage())); rInfo.meOrientation = rMaster.GetOrientation(); - const Size aPaperSize (rInfo.mpPrinter->GetPaperSize()); - if( (rInfo.meOrientation == Orientation::Landscape && - (aPaperSize.Width() < aPaperSize.Height())) - || - (rInfo.meOrientation == Orientation::Portrait && - (aPaperSize.Width() > aPaperSize.Height())) - ) - { - maPrintSize = awt::Size(aPaperSize.Height(), aPaperSize.Width()); - } - else - { - maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height()); - } + Size aPaperSize (rInfo.mpPrinter->GetPaperSize()); + lcl_AdjustPageSize(aPaperSize, rInfo.mpPrinter->GetPrintPageSize()); + maPrintSize = awt::Size(aPaperSize.Width(),aPaperSize.Height()); MapMode aMap (rInfo.maMap); const Point aPageOfs (rInfo.mpPrinter->GetPageOffset()); if ( bScalePage ) { - const Size aPageSize (rHandoutPage.GetSize()); - const Size aPrintSize (rInfo.mpPrinter->GetOutputSize()); + Size aPageSize (rHandoutPage.GetSize()); + Size aPrintSize (rInfo.mpPrinter->GetOutputSize()); + lcl_AdjustPageSize(aPageSize, aPrintSize); const double fHorz = static_cast<double>(aPrintSize.Width()) / aPageSize.Width(); const double fVert = static_cast<double>(aPrintSize.Height()) / aPageSize.Height(); @@ -1863,7 +2180,11 @@ private: if (pDocument->GetSdPageCount(ePageKind) == 0) return; SdPage* pRefPage = pDocument->GetSdPage(0, ePageKind); - rInfo.maPageSize = pRefPage->GetSize(); + + if (!mpOptions->IsPrinterPreferred(pDocument->GetDocumentType()) && mpOptions->IsNotes()) + rInfo.maPageSize = mpPrinter->GetPrintPageSize(); + else + rInfo.maPageSize = pRefPage->GetSize(); SetupPaperOrientation(ePageKind, rInfo); @@ -1898,19 +2219,22 @@ private: continue; MapMode aMap (rInfo.maMap); - // is it possible that the page size changed? - const Size aPageSize = pPage->GetSize(); + + Size aPageSize = pPage->GetSize(); if (mpOptions->IsPageSize()) { - const double fHorz (static_cast<double>(rInfo.maPrintSize.Width()) / aPageSize.Width()); - const double fVert (static_cast<double>(rInfo.maPrintSize.Height()) / aPageSize.Height()); + Size aPrintSize = rInfo.maPrintSize; + lcl_AdjustPageSize(aPageSize, aPrintSize); + + const double fHorz(static_cast<double>(aPrintSize.Width()) / aPageSize.Width()); + const double fVert(static_cast<double>(aPrintSize.Height()) / aPageSize.Height()); Fraction aFract; if (fHorz < fVert) - aFract = Fraction(rInfo.maPrintSize.Width(), aPageSize.Width()); + aFract = Fraction(aPrintSize.Width(), aPageSize.Width()); else - aFract = Fraction(rInfo.maPrintSize.Height(), aPageSize.Height()); + aFract = Fraction(aPrintSize.Height(), aPageSize.Height()); aMap.SetScaleX(aFract); aMap.SetScaleY(aFract); @@ -2136,17 +2460,135 @@ private: // if CutPage is set then do not move it, otherwise move the // scaled page to printable area - maPrinterPages.push_back( - std::make_shared<RegularPrinterPage>( - sal::static_int_cast<sal_uInt16>(nPageIndex), - ePageKind, - aMap, - rInfo.mbPrintMarkedOnly, - rInfo.msPageString, - aPageOffset, - rInfo.mnDrawMode, - rInfo.meOrientation, - nPaperBin)); + if (ePageKind == PageKind::Standard) + { + maPrinterPages.push_back( + std::make_shared<RegularPrinterPage>( + sal::static_int_cast<sal_uInt16>(nPageIndex), + ePageKind, + aMap, + rInfo.mbPrintMarkedOnly, + rInfo.msPageString, + aPageOffset, + rInfo.mnDrawMode, + rInfo.meOrientation, + nPaperBin)); + } + else if (SdPage* pPage = GetFilteredPage(nPageIndex, PageKind::Notes))// Notes + { + SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc(); + + // Clone the current page to create an independent instance. + // This ensures that changes made to pNotesPage do not affect the original page. + rtl::Reference<SdPage> pNotesPage + = static_cast<SdPage*>(pPage->CloneSdrPage(*pDocument).get()); + + Size aPageSize = bScalePage ? pNotesPage->GetSize() : rInfo.mpPrinter->GetPrintPageSize(); + // Adjusts the objects on the notes page to fit the new page size. + ::tools::Rectangle aNewBorderRect(-1, -1, -1, -1); + pNotesPage->ScaleObjects(aPageSize, aNewBorderRect, true); + + SdrObject* pNotesObj = pNotesPage->GetPresObj(PresObjKind::Notes); + if (pNotesObj && bCutPage) + { + // default margins + sal_Int32 nTopMargin = aPageSize.Height() * 0.075; + sal_Int32 nBottomMargin = nTopMargin; + + Size nNotesObjSize = pNotesObj->GetLogicRect().GetSize(); + + Outliner* pOut = pDocument->GetInternalOutliner(); + const OutlinerMode nSaveOutlMode(pOut->GetOutlinerMode()); + const bool bSavedUpdateMode(pOut->IsUpdateLayout()); + pOut->Init(OutlinerMode::OutlineView); + pOut->SetPaperSize(nNotesObjSize); + pOut->SetUpdateLayout(true); + pOut->Clear(); + pOut->SetText(*pNotesObj->GetOutlinerParaObject()); + + sal_Int32 nFirstPageBottomMargin = 0; + ::tools::Long nNotesHeight = nNotesObjSize.Height(); + bool bAutoGrow = pNotesObj->GetMergedItem(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); + if (bAutoGrow) + { + nNotesHeight += pNotesObj->GetRelativePos().Y(); + nFirstPageBottomMargin = (pNotesPage->GetLowerBorder() != 0) + ? pNotesPage->GetLowerBorder() + : nBottomMargin; + } + double nOverflowedTextHeight = 0; + ::tools::Long nFirstPageBottom = aPageSize.Height() - nFirstPageBottomMargin; + if (nNotesHeight > nFirstPageBottom) + { + // Calculate the height of the overflow text + // when the AutoGrowHeight property of the notes object is enabled + // and the height of the object exceeds the page height. + nOverflowedTextHeight = pNotesObj->GetRelativePos().Y() + + pOut->GetTextHeight() - nFirstPageBottom; + } + else + nOverflowedTextHeight = pOut->GetTextHeight() - nNotesObjSize.Height(); + + sal_Int32 nNotePageCount = 1; + double nNewPageHeight = aPageSize.Height() - nTopMargin - nBottomMargin; + if (nOverflowedTextHeight > 0) + { + nNotePageCount += std::ceil(nOverflowedTextHeight / nNewPageHeight); + } + + for (sal_Int32 i = 1; i <= nNotePageCount; i++) + { + // set page numbers + sal_Int32 nPageNumb = i; + OUString sPageNumb = rInfo.msPageString; + if (!sPageNumb.isEmpty() && nNotePageCount > 1) + { + OUString sTmp; + if (!rInfo.msTimeDate.isEmpty()) + { + sTmp += " "; + } + sTmp += SdResId(STR_PAGE_NAME) + " " + OUString::number(i); + sPageNumb += sTmp; + } + + maPrinterPages.push_back( + std::make_shared<NotesPrinterPage>( + sal::static_int_cast<sal_uInt16>(nPageIndex), + nPageNumb, + nNotePageCount, + bScalePage, + PageKind::Notes, + aMap, + rInfo.mbPrintMarkedOnly, + sPageNumb, + aPageOffset, + rInfo.mnDrawMode, + rInfo.meOrientation, + nPaperBin)); + } + pOut->Clear(); + pOut->SetUpdateLayout(bSavedUpdateMode); + pOut->Init(nSaveOutlMode); + } + else // scaled page + { + maPrinterPages.push_back( + std::make_shared<NotesPrinterPage>( + sal::static_int_cast<sal_uInt16>(nPageIndex), + sal_Int32(0), + sal_Int32(0), + bScalePage, + PageKind::Notes, + aMap, + rInfo.mbPrintMarkedOnly, + rInfo.msPageString, + aPageOffset, + rInfo.mnDrawMode, + rInfo.meOrientation, + nPaperBin)); + } + } } else { diff --git a/sd/source/ui/view/NotesPanelViewShell.cxx b/sd/source/ui/view/NotesPanelViewShell.cxx index 5a5c9ec1407b..ff5701e6add9 100644 --- a/sd/source/ui/view/NotesPanelViewShell.cxx +++ b/sd/source/ui/view/NotesPanelViewShell.cxx @@ -426,7 +426,7 @@ void NotesPanelViewShell::GetCtrlState(SfxItemSet& rSet) if (pFieldItem) { ESelection aSel = pOLV->GetSelection(); - if (abs(aSel.nEndPos - aSel.nStartPos) == 1) + if (abs(aSel.end.nIndex - aSel.start.nIndex) == 1) { const SvxFieldData* pField = pFieldItem->GetField(); if (auto pUrlField = dynamic_cast<const SvxURLField*>(pField)) @@ -531,7 +531,7 @@ void NotesPanelViewShell::GetAttrState(SfxItemSet& rSet) OutlinerView* pOV = mpNotesPanelView->GetOutlinerView(); ESelection aESel(pOV->GetSelection()); - if (aESel.nStartPara != aESel.nEndPara || aESel.nStartPos != aESel.nEndPos) + if (aESel.HasRange()) // spanned selection, i.e. StyleSheet and/or // attribution not necessarily unique rSet.DisableItem(nWhich); @@ -845,10 +845,10 @@ void NotesPanelViewShell::FuTemporaryModify(SfxRequest& rReq) EE_FEATURE_FIELD); ESelection aSel(pOutlinerView->GetSelection()); pOutlinerView->InsertField(aURLItem); - if (aSel.nStartPos <= aSel.nEndPos) - aSel.nEndPos = aSel.nStartPos + 1; + if (aSel.start.nIndex <= aSel.end.nIndex) + aSel.end.nIndex = aSel.start.nIndex + 1; else - aSel.nStartPos = aSel.nEndPos + 1; + aSel.start.nIndex = aSel.end.nIndex + 1; pOutlinerView->SetSelection(aSel); } @@ -1020,8 +1020,8 @@ void NotesPanelViewShell::FuTemporaryModify(SfxRequest& rReq) { // select field, so it gets deleted on Insert ESelection aSel = pOutlinerView->GetSelection(); - if (aSel.nStartPos == aSel.nEndPos) - aSel.nEndPos++; + if (aSel.start.nIndex == aSel.end.nIndex) + aSel.end.nIndex++; pOutlinerView->SetSelection(aSel); } @@ -1061,10 +1061,10 @@ void NotesPanelViewShell::FuTemporaryModify(SfxRequest& rReq) // select field, so it gets deleted on Insert ESelection aSel = pOutlinerView->GetSelection(); bool bSel = true; - if (aSel.nStartPos == aSel.nEndPos) + if (aSel.start.nIndex == aSel.end.nIndex) { bSel = false; - aSel.nEndPos++; + aSel.end.nIndex++; } pOutlinerView->SetSelection(aSel); @@ -1072,7 +1072,7 @@ void NotesPanelViewShell::FuTemporaryModify(SfxRequest& rReq) // reset selection to original state if (!bSel) - aSel.nEndPos--; + aSel.end.nIndex--; pOutlinerView->SetSelection(aSel); pField.reset(); diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 867daa748527..40687c452c47 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -560,13 +560,11 @@ void SdOutliner::Initialize (bool bDirectionIsForward) ESelection aSelection = getOutlinerView()->GetSelection (); if (mbDirectionIsForward) { - aSelection.nEndPara = aSelection.nStartPara; - aSelection.nEndPos = aSelection.nStartPos; + aSelection.CollapseToStart(); } else { - aSelection.nStartPara = aSelection.nEndPara; - aSelection.nStartPos = aSelection.nEndPos; + aSelection.CollapseToEnd(); } getOutlinerView()->SetSelection (aSelection); } @@ -1779,20 +1777,14 @@ void SdOutliner::EnterEditMode (bool bGrabFocus) ESelection SdOutliner::GetSearchStartPosition() const { + // The default constructor uses the beginning of the text as default. ESelection aPosition; - if (mbDirectionIsForward) - { - // The default constructor uses the beginning of the text as default. - aPosition = ESelection (); - } - else + if (!mbDirectionIsForward) { // Retrieve the position after the last character in the last // paragraph. sal_Int32 nParagraphCount = GetParagraphCount(); - if (nParagraphCount == 0) - aPosition = ESelection(); - else + if (nParagraphCount != 0) { sal_Int32 nLastParagraphLength = GetEditEngine().GetTextLen ( nParagraphCount-1); diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index d7e05a8d03c2..19d8614007d4 100644 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -194,7 +194,7 @@ private: SfxShell* mpTopShell; SfxShell* mpTopViewShell; - std::shared_ptr<ViewShell> mpOverridingShell; + std::weak_ptr<ViewShell> mpOverridingShell; void UpdateShellStack(); @@ -624,7 +624,7 @@ void ViewShellManager::Implementation::DeactivateSubShell ( std::shared_ptr<ViewShell> ViewShellManager::Implementation::GetOverridingShell() { - return mpOverridingShell; + return mpOverridingShell.lock(); } void ViewShellManager::Implementation::RemoveOverridingMainShell() diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 4bdc074a0574..3e800881960b 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -482,8 +482,8 @@ void TextObjectBar::GetAttrStateImpl(ViewShell* mpViewShell, ::sd::View* mpView, { ESelection aSel = pOLV->GetSelection(); aSel.Adjust(); - sal_Int32 nStartPara = aSel.nStartPara; - sal_Int32 nEndPara = aSel.nEndPara; + sal_Int32 nStartPara = aSel.start.nPara; + sal_Int32 nEndPara = aSel.end.nPara; if( !aSel.HasRange() ) { nStartPara = 0; diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 44a63a3634d1..e88f4c3d974e 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -131,8 +131,8 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR { ESelection aSel = pOLV->GetSelection(); aSel.Adjust(); - sal_Int32 nStartPara = aSel.nStartPara; - sal_Int32 nEndPara = aSel.nEndPara; + sal_Int32 nStartPara = aSel.start.nPara; + sal_Int32 nEndPara = aSel.end.nPara; if( !aSel.HasRange() ) { nStartPara = 0; @@ -188,8 +188,8 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR { ESelection aSel = pOLV->GetSelection(); aSel.Adjust(); - sal_Int32 nStartPara = aSel.nStartPara; - sal_Int32 nEndPara = aSel.nEndPara; + sal_Int32 nStartPara = aSel.start.nPara; + sal_Int32 nEndPara = aSel.end.nPara; if( !aSel.HasRange() ) { nStartPara = 0; @@ -436,8 +436,8 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR SvxNumRule aNewRule(pItem->GetNumRule()); ESelection aSel = pOLV->GetSelection(); aSel.Adjust(); - sal_Int32 nStartPara = aSel.nStartPara; - sal_Int32 nEndPara = aSel.nEndPara; + sal_Int32 nStartPara = aSel.start.nPara; + sal_Int32 nEndPara = aSel.end.nPara; for (sal_Int32 nPara = nStartPara; nPara <= nEndPara; ++nPara) { sal_uInt16 nLevel = pOL->GetDepth(nPara); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 92e18c868ad4..80c9aaae8b2b 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -409,7 +409,7 @@ private: for (svx::ClassificationResult const & rResult : rResults) { - ESelection aPosition(nParagraph, EE_TEXTPOS_MAX_COUNT, nParagraph, EE_TEXTPOS_MAX_COUNT); + ESelection aPosition(nParagraph, EE_TEXTPOS_MAX); switch (rResult.meType) { @@ -2346,13 +2346,13 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { //we are on the last paragraph aSel.Adjust(); - if (aSel.nEndPara == pOL->GetParagraphCount() - 1) + if (aSel.end.nPara == pOL->GetParagraphCount() - 1) { - sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara); + sal_uInt16 nDepth = pOL->GetDepth(aSel.end.nPara); //there exists a previous numbering level if (nDepth != sal_uInt16(-1) && nDepth > 0) { - Paragraph* pPara = pOL->GetParagraph(aSel.nEndPara); + Paragraph* pPara = pOL->GetParagraph(aSel.end.nPara); pOL->Remove(pPara, 1); } } @@ -2385,14 +2385,14 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { //we are on the last paragraph aSel.Adjust(); - if (aSel.nEndPara == pOL->GetParagraphCount() - 1) + if (aSel.end.nPara == pOL->GetParagraphCount() - 1) { - sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara); + sal_uInt16 nDepth = pOL->GetDepth(aSel.end.nPara); //there exists a previous numbering level if (nDepth < 8) { sal_uInt16 nNewDepth = nDepth+1; - pOL->Insert(SdResId(STR_PRESOBJ_MPOUTLINE_ARY[nNewDepth]), EE_PARA_APPEND, nNewDepth); + pOL->Insert(SdResId(STR_PRESOBJ_MPOUTLINE_ARY[nNewDepth]), EE_PARA_MAX, nNewDepth); } } } @@ -2490,8 +2490,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { // select field, then it will be deleted when inserting ESelection aSel = pOLV->GetSelection(); - if( aSel.nStartPos == aSel.nEndPos ) - aSel.nEndPos++; + if (aSel.start.nIndex == aSel.end.nIndex) + aSel.end.nIndex++; pOLV->SetSelection( aSel ); } @@ -2568,10 +2568,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { SvxFieldItem aFieldItem( *pField, EE_FEATURE_FIELD ); - if( aSel.nStartPos == aSel.nEndPos ) + if (aSel.start.nIndex == aSel.end.nIndex) { bSelectionWasModified = true; - aSel.nEndPos++; + aSel.end.nIndex++; pOLV->SetSelection( aSel ); } @@ -2597,7 +2597,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) // restore selection to original if(bSelectionWasModified) { - aSel.nEndPos--; + aSel.end.nIndex--; pOLV->SetSelection( aSel ); } } diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 83ffcc9be39b..c682991b6c3f 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -600,7 +600,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) if( pOLV->GetOutliner() ) { ESelection aSelection( pOLV->GetSelection() ); - eLanguage = pOLV->GetOutliner()->GetLanguage( aSelection.nStartPara, aSelection.nStartPos ); + eLanguage = pOLV->GetOutliner()->GetLanguage( aSelection.start.nPara, aSelection.start.nIndex ); } //fdo#44998 if the outliner has captured the mouse events release the lock @@ -624,10 +624,10 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) // select field, so that it will be deleted on insert ESelection aSel = pOLV->GetSelection(); bool bSel = true; - if( aSel.nStartPos == aSel.nEndPos ) + if (aSel.start.nIndex == aSel.end.nIndex) { bSel = false; - aSel.nEndPos++; + aSel.end.nIndex++; } pOLV->SetSelection( aSel ); @@ -635,7 +635,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) // reset selection back to original state if( !bSel ) - aSel.nEndPos--; + aSel.end.nIndex--; pOLV->SetSelection( aSel ); } } diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 5d6cd9d55aed..f51da4fda7de 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1530,9 +1530,9 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) { //and are on the last paragraph aSel.Adjust(); - if (aSel.nEndPara == pOL->GetParagraphCount() - 1) + if (aSel.end.nPara == pOL->GetParagraphCount() - 1) { - sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara); + sal_uInt16 nDepth = pOL->GetDepth(aSel.end.nPara); if (nDepth != sal_uInt16(-1)) { //there exists another numbering level that diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index f594fb1f7fcf..362be508e264 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -899,18 +899,18 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) { OUString sInput = pOLV->GetSurroundingText(); ESelection aSel( pOLV->GetSelection() ); - if( aSel.nStartPos > aSel.nEndPos ) - aSel.nEndPos = aSel.nStartPos; + if (aSel.start.nIndex > aSel.end.nIndex) + aSel.end.nIndex = aSel.start.nIndex; //calculate a valid end-position by reading logical characters sal_Int32 nUtf16Pos=0; - while( (nUtf16Pos < sInput.getLength()) && (nUtf16Pos < aSel.nEndPos) ) + while ((nUtf16Pos < sInput.getLength()) && (nUtf16Pos < aSel.end.nIndex)) { sInput.iterateCodePoints(&nUtf16Pos); //The mouse can set the cursor in the middle of a multi-unit character, // so reset to the proper end of the logical characters - if( nUtf16Pos > aSel.nEndPos ) - aSel.nEndPos = nUtf16Pos; + if (nUtf16Pos > aSel.end.nIndex) + aSel.end.nIndex = nUtf16Pos; } ToggleUnicodeCodepoint aToggle; @@ -921,7 +921,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) { OUString sStringToReplace = aToggle.StringToReplace(); mpDrawView->BegUndo(sStringToReplace +"->"+ sReplacement); - aSel.nStartPos = aSel.nEndPos - sStringToReplace.getLength(); + aSel.start.nIndex = aSel.end.nIndex - sStringToReplace.getLength(); pOLV->SetSelection( aSel ); pOLV->InsertText(sReplacement, true); mpDrawView->EndUndo(); @@ -1505,10 +1505,10 @@ void DrawViewShell::InsertURLField(const OUString& rURL, const OUString& rText, ESelection aSel( pOLV->GetSelection() ); SvxFieldItem aURLItem( SvxURLField( rURL, rText, SvxURLFormat::Repr ), EE_FEATURE_FIELD ); pOLV->InsertField( aURLItem ); - if ( aSel.nStartPos <= aSel.nEndPos ) - aSel.nEndPos = aSel.nStartPos + 1; + if (aSel.start.nIndex <= aSel.end.nIndex) + aSel.end.nIndex = aSel.start.nIndex + 1; else - aSel.nStartPos = aSel.nEndPos + 1; + aSel.start.nIndex = aSel.end.nIndex + 1; pOLV->SetSelection( aSel ); } else diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index 1c1577b7ab91..89c30c3990fc 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -796,7 +796,7 @@ OUString DrawViewShell::GetSelectionText(bool bCompleteWords) OUString aStrCurrentDelimiters = pOl->GetWordDelimiters(); pOl->SetWordDelimiters(u" .,;\"'"_ustr); - aStrSelection = pOl->GetWord( aSel.nEndPara, aSel.nEndPos ); + aStrSelection = pOl->GetWord(aSel.end); pOl->SetWordDelimiters( aStrCurrentDelimiters ); } else diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index 7cdbfa094f64..99935ec3ec57 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -359,10 +359,10 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) SvxURLFormat::Repr), EE_FEATURE_FIELD); ESelection aSel( pOutlinerView->GetSelection() ); pOutlinerView->InsertField(aURLItem); - if ( aSel.nStartPos <= aSel.nEndPos ) - aSel.nEndPos = aSel.nStartPos + 1; + if (aSel.start.nIndex <= aSel.end.nIndex) + aSel.end.nIndex = aSel.start.nIndex + 1; else - aSel.nStartPos = aSel.nEndPos + 1; + aSel.start.nIndex = aSel.end.nIndex + 1; pOutlinerView->SetSelection( aSel ); } @@ -534,8 +534,8 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) { // select field, so it gets deleted on Insert ESelection aSel = pOutlinerView->GetSelection(); - if( aSel.nStartPos == aSel.nEndPos ) - aSel.nEndPos++; + if (aSel.start.nIndex == aSel.end.nIndex) + aSel.end.nIndex++; pOutlinerView->SetSelection( aSel ); } @@ -572,10 +572,10 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) // select field, so it gets deleted on Insert ESelection aSel = pOutlinerView->GetSelection(); bool bSel = true; - if( aSel.nStartPos == aSel.nEndPos ) + if (aSel.start.nIndex == aSel.end.nIndex) { bSel = false; - aSel.nEndPos++; + aSel.end.nIndex++; } pOutlinerView->SetSelection( aSel ); @@ -583,7 +583,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) // reset selection to original state if( !bSel ) - aSel.nEndPos--; + aSel.end.nIndex--; pOutlinerView->SetSelection( aSel ); pField.reset(); diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 8fcd132ff3de..e6e66c77558d 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -355,7 +355,7 @@ void OutlineViewShell::GetCtrlState(SfxItemSet &rSet) if (pFieldItem) { ESelection aSel = pOLV->GetSelection(); - if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 ) + if (abs(aSel.end.nIndex - aSel.start.nIndex) == 1) { const SvxFieldData* pField = pFieldItem->GetField(); if ( auto pUrlField = dynamic_cast< const SvxURLField *>( pField ) ) @@ -1484,8 +1484,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) OutlinerView* pOV = pOlView->GetViewByWindow(pActWin); ESelection aESel(pOV->GetSelection()); - if (aESel.nStartPara != aESel.nEndPara || - aESel.nStartPos != aESel.nEndPos) + if (aESel.HasRange()) // spanned selection, i.e. StyleSheet and/or // attribution not necessarily unique rSet.DisableItem(nWhich); diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index b2f58cfcfffd..244e2b6819d2 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -302,8 +302,7 @@ void View::DoPaste (::sd::Window* pWindow) for( sal_Int32 nPara = nParaCount - 2; nPara >= 0; nPara-- ) { const sal_Int32 nParaLen = rEdit.GetTextLen( nPara ); - pOutliner->QuickDelete( ESelection( nPara, nParaLen, nPara+1, 0 ) ); - pOutliner->QuickInsertLineBreak( ESelection( nPara, nParaLen, nPara, nParaLen ) ); + pOutliner->QuickInsertLineBreak(ESelection(nPara, nParaLen, nPara + 1, 0)); } DBG_ASSERT( rEdit.GetParagraphCount() <= 1, "Titleobject contains hard line breaks" ); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 6a205211161d..4f7a52b0a9c3 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -1411,8 +1411,28 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if (std::unique_ptr<SvStream> xStm = aDataHelper.GetSotStorageStream( SotClipboardFormatId::HTML )) { xStm->Seek( 0 ); - // mba: clipboard always must contain absolute URLs (could be from alien source) - bReturn = SdrView::Paste( *xStm, EETextFormat::Html, maDropPos, pPage, nPasteOptions ); + + OStringBuffer aLine; + while (xStm->ReadLine(aLine)) + { + if (std::string_view(aLine).find( "<table>" ) != std::string_view::npos || + std::string_view(aLine).find( "<table " ) != std::string_view::npos) + { + bTable = true; + break; + } + } + + xStm->Seek( 0 ); + if (bTable) + { + bReturn = PasteHTMLTable(*xStm, pPage, nPasteOptions); + } + else + { + // mba: clipboard always must contain absolute URLs (could be from alien source) + bReturn = SdrView::Paste( *xStm, EETextFormat::Html, maDropPos, pPage, nPasteOptions ); + } } } @@ -1445,8 +1465,38 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if(!bReturn && !bLink) { + bool bIsHtmlSimple = CHECK_FORMAT_TRANS(SotClipboardFormatId::HTML_SIMPLE); + if (bIsHtmlSimple) + { + if (std::unique_ptr<SvStream> xStm = aDataHelper.GetSotStorageStream(SotClipboardFormatId::HTML_SIMPLE)) + { + xStm->Seek(0); + + OutlinerView* pOLV = GetTextEditOutlinerView(); + MSE40HTMLClipFormatObj aMSE40HTMLClipFormatObj; + SvStream* pHtmlStream = aMSE40HTMLClipFormatObj.IsValid(*xStm); + + if (pOLV) + { + ::tools::Rectangle aRect(pOLV->GetOutputArea()); + Point aPos(pOLV->GetWindow()->PixelToLogic(maDropPos)); + + if (aRect.Contains(aPos) || (!bDrag && IsTextEdit())) + { + // mba: clipboard always must contain absolute URLs (could be from alien source) + pOLV->Read(*pHtmlStream, EETextFormat::Html, mpDocSh->GetHeaderAttributes()); + bReturn = true; + } + } + + if (!bReturn) + // mba: clipboard always must contain absolute URLs (could be from alien source) + bReturn = SdrView::Paste(*pHtmlStream, EETextFormat::Html, maDropPos, pPage, nPasteOptions); + } + } + bool bIsRTF = CHECK_FORMAT_TRANS(SotClipboardFormatId::RTF); - if (bIsRTF || CHECK_FORMAT_TRANS(SotClipboardFormatId::RICHTEXT)) + if (!bReturn && (bIsRTF || CHECK_FORMAT_TRANS(SotClipboardFormatId::RICHTEXT))) { auto nFormatId = bIsRTF ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT; if (std::unique_ptr<SvStream> xStm = aDataHelper.GetSotStorageStream( nFormatId )) @@ -1481,35 +1531,6 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, } } - bool bIsHtmlSimple = CHECK_FORMAT_TRANS(SotClipboardFormatId::HTML_SIMPLE); - if (bIsHtmlSimple) - { - if (std::unique_ptr<SvStream> xStm = aDataHelper.GetSotStorageStream(SotClipboardFormatId::HTML_SIMPLE)) - { - xStm->Seek(0); - - OutlinerView* pOLV = GetTextEditOutlinerView(); - MSE40HTMLClipFormatObj aMSE40HTMLClipFormatObj; - SvStream* pHtmlStream = aMSE40HTMLClipFormatObj.IsValid(*xStm); - - if (pOLV) - { - ::tools::Rectangle aRect(pOLV->GetOutputArea()); - Point aPos(pOLV->GetWindow()->PixelToLogic(maDropPos)); - - if (aRect.Contains(aPos) || (!bDrag && IsTextEdit())) - { - // mba: clipboard always must contain absolute URLs (could be from alien source) - pOLV->Read(*pHtmlStream, EETextFormat::Html, mpDocSh->GetHeaderAttributes()); - bReturn = true; - } - } - - if (!bReturn) - // mba: clipboard always must contain absolute URLs (could be from alien source) - bReturn = SdrView::Paste(*pHtmlStream, EETextFormat::Html, maDropPos, pPage, nPasteOptions); - } - } } if(!bReturn && CHECK_FORMAT_TRANS(SotClipboardFormatId::FILE_LIST)) @@ -1601,6 +1622,22 @@ bool View::PasteRTFTable( SvStream& rStm, SdrPage* pPage, SdrInsertFlags nPasteO return bRet; } +bool View::PasteHTMLTable( SvStream& rStm, SdrPage* pPage, SdrInsertFlags nPasteOptions ) +{ + DrawDocShellRef xShell = new DrawDocShell(SfxObjectCreateMode::INTERNAL, false, DocumentType::Impress); + xShell->DoInitNew(); + + SdDrawDocument* pModel = xShell->GetDoc(); + pModel->GetItemPool().SetDefaultMetric(MapUnit::Map100thMM); + pModel->InsertPage(pModel->AllocPage(false).get()); + + CreateTableFromHTML(rStm, pModel); + bool bRet = Paste(*pModel, maDropPos, pPage, nPasteOptions); + + xShell->DoClose(); + + return bRet; +} } // end of namespace sd /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/uiconfig/sdraw/popupmenu/table.xml b/sd/uiconfig/sdraw/popupmenu/table.xml index 71ae6f2bd562..7ada41804675 100644 --- a/sd/uiconfig/sdraw/popupmenu/table.xml +++ b/sd/uiconfig/sdraw/popupmenu/table.xml @@ -49,6 +49,11 @@ <menu:menuitem menu:id=".uno:FontDialog"/> <menu:menuitem menu:id=".uno:ParagraphDialog"/> <menu:menuseparator/> + <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/> + <menu:menuitem menu:id=".uno:EditHyperlink"/> + <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/> + <menu:menuitem menu:id=".uno:RemoveHyperlink"/> + <menu:menuseparator/> <menu:menu menu:id=".uno:ObjectAlign"/> <menu:menu menu:id=".uno:ArrangeMenu"> <menu:menupopup> diff --git a/sd/uiconfig/simpress/popupmenu/table.xml b/sd/uiconfig/simpress/popupmenu/table.xml index 71ae6f2bd562..7ada41804675 100644 --- a/sd/uiconfig/simpress/popupmenu/table.xml +++ b/sd/uiconfig/simpress/popupmenu/table.xml @@ -49,6 +49,11 @@ <menu:menuitem menu:id=".uno:FontDialog"/> <menu:menuitem menu:id=".uno:ParagraphDialog"/> <menu:menuseparator/> + <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/> + <menu:menuitem menu:id=".uno:EditHyperlink"/> + <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/> + <menu:menuitem menu:id=".uno:RemoveHyperlink"/> + <menu:menuseparator/> <menu:menu menu:id=".uno:ObjectAlign"/> <menu:menu menu:id=".uno:ArrangeMenu"> <menu:menupopup> diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index c627056160c4..0564625ee8be 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -862,7 +862,21 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) pFilter = rMatcher.GetFilter4EA( aTypeName ); } - if (!pFilter || !lcl_isFilterNativelySupported(*pFilter)) + bool bStartPresentation = false; + if (pFilter) + { + const SfxUInt16Item* pSlide = rReq.GetArg<SfxUInt16Item>(SID_DOC_STARTPRESENTATION); + if (pSlide + && (pFilter->GetWildcard().Matches(u".pptx") + || pFilter->GetWildcard().Matches(u".ppt") + || pFilter->GetWildcard().Matches(u".ppsx") + || pFilter->GetWildcard().Matches(u".pps"))) + { + bStartPresentation = true; + } + } + + if (!pFilter || (!lcl_isFilterNativelySupported(*pFilter) && !bStartPresentation)) { // hyperlink does not link to own type => special handling (http, ftp) browser and (other external protocols) OS if ( aINetProtocol == INetProtocol::Mailto ) diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 7b8b939aa6cb..0ba9f00e2685 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -947,6 +947,12 @@ SfxPoolItemHolder SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem** if (!pShell) return SfxPoolItemHolder(); + if (!pShell) + return SfxPoolItemHolder(); + + if (!pShell) + return SfxPoolItemHolder(); + SfxItemPool &rPool = pShell->GetPool(); SfxRequest aReq( nId, nCallMode, rPool ); aReq.SetModifier( nModi ); diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index c8bda80385f0..f95baa42cedc 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -149,6 +149,7 @@ SfxTabPage::SfxTabPage(weld::Container* pPage, weld::DialogController* pControll : BuilderPage(pPage, pController, rUIXMLDescription, rID, isLOKMobilePhone()) , mpSet(rAttrSet) , mbHasExchangeSupport(false) + , mbCancel(false) , mpImpl(new TabPageImpl) { mpImpl->mpSfxDialogController = dynamic_cast<SfxOkDialogController*>(m_pDialogController); @@ -678,6 +679,19 @@ bool SfxTabDialogController::PrepareLeaveCurrentPage() return bEnd; } +void SfxTabDialogController::PrepareCancel() +{ + for (auto pDataObject : m_pImpl->aData) + { + if (!pDataObject->xTabPage) + continue; + + SfxTabPage* pPage = pDataObject->xTabPage.get(); + pPage->SetCancelMode(true); + pPage->DeactivatePage(nullptr); + } +} + const WhichRangesContainer & SfxTabDialogController::GetInputRanges(const SfxItemPool& rPool) /* [Description] diff --git a/starmath/inc/mathml/element.hxx b/starmath/inc/mathml/element.hxx index 90dc65439e62..439eb7cb1a85 100644 --- a/starmath/inc/mathml/element.hxx +++ b/starmath/inc/mathml/element.hxx @@ -129,14 +129,14 @@ public: // location in the source * It is used to do the visual <-> text correspondence. * @return line */ - sal_Int32 GetSourceCodeRow() const { return m_aESelection.nStartPara; } + sal_Int32 GetSourceCodeRow() const { return m_aESelection.start.nPara; } /** * Gets the column of the line in the text where the node is located. * It is used to do the visual <-> text correspondence. * @return column */ - sal_Int32 GetSourceCodeColumn() const { return m_aESelection.nStartPos; } + sal_Int32 GetSourceCodeColumn() const { return m_aESelection.start.nIndex; } public: // attributes /** diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index f59c23ea426f..9e0dbaf6e176 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -346,14 +346,14 @@ public: * It is used to do the visual <-> text correspondence. * @return line */ - sal_uInt16 GetRow() const { return sal::static_int_cast<sal_uInt16>(m_aESelection.nStartPara); } + sal_Int32 GetRow() const { return m_aESelection.start.nPara; } /** * Gets the column of the line in the text where the node is located. * It is used to do the visual <-> text correspondence. * @return column */ - sal_uInt16 GetColumn() const { return sal::static_int_cast<sal_uInt16>(m_aESelection.nStartPos); } + sal_Int32 GetColumn() const { return m_aESelection.start.nIndex; } /** * Gets the scale mode. diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx index 8dd6bc0b22ba..e5d6f150ec28 100644 --- a/starmath/qa/cppunit/test_starmath.cxx +++ b/starmath/qa/cppunit/test_starmath.cxx @@ -200,10 +200,10 @@ void Test::editMarker() // should be safe i.e. do nothing rEditWindow.SelNextMark(); aSelection = rEditWindow.GetSelection(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.nStartPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(19), aSelection.nStartPos); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.nEndPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(19), aSelection.nEndPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.start.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(19), aSelection.start.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.end.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(19), aSelection.end.nIndex); rEditWindow.SelPrevMark(); rEditWindow.Delete(); @@ -212,10 +212,10 @@ void Test::editMarker() // tdf#106116: should be safe i.e. do nothing rEditWindow.SelPrevMark(); aSelection = rEditWindow.GetSelection(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.nStartPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aSelection.nStartPos); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.nEndPara); - CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aSelection.nEndPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.start.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aSelection.start.nIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.end.nPara); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aSelection.end.nIndex); rEditWindow.Flush(); OUString sFinalText = rEditWindow.GetText(); diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index b76c982d568a..846eb848f7b6 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -1350,7 +1350,7 @@ void SmCursor::EndEdit(){ OUString formula; SmNodeToTextVisitor(mpTree, formula); mpDocShell->maText = formula; - mpDocShell->GetEditEngine().QuickInsertText( formula, ESelection( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL ) ); + mpDocShell->GetEditEngine().QuickInsertText(formula, ESelection::All()); mpDocShell->GetEditEngine().QuickFormatDoc(); } diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index d0f25259f3a6..fa32d165653a 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -50,14 +50,13 @@ void SmGetLeftSelectionPart(const ESelection &rSel, // returns paragraph number and position of the selections left part { // compare start and end of selection and use the one that comes first - if ( rSel.nStartPara < rSel.nEndPara - || (rSel.nStartPara == rSel.nEndPara && rSel.nStartPos < rSel.nEndPos) ) - { nPara = rSel.nStartPara; - nPos = rSel.nStartPos; + if (rSel.start < rSel.end) + { nPara = rSel.start.nPara; + nPos = rSel.start.nIndex; } else - { nPara = rSel.nEndPara; - nPos = rSel.nEndPos; + { nPara = rSel.end.nPara; + nPos = rSel.end.nIndex; } } @@ -321,24 +320,24 @@ bool SmEditTextWindow::KeyInput(const KeyEvent& rKEvt) autoClose = true; else if (selected.isEmpty() && !aSelection.HasRange()) { - selected = pEditView->getEditEngine().GetText(aSelection.nEndPara); + selected = pEditView->getEditEngine().GetText(aSelection.end.nPara); if (!selected.isEmpty()) { - sal_Int32 index = selected.indexOf("\n", aSelection.nEndPos); + sal_Int32 index = selected.indexOf("\n", aSelection.end.nIndex); if (index != -1) { - selected = selected.copy(index, sal_Int32(aSelection.nEndPos-index)); + selected = selected.copy(index, sal_Int32(aSelection.end.nIndex-index)); if (o3tl::trim(selected).empty()) autoClose = true; } else { sal_Int32 length = selected.getLength(); - if (aSelection.nEndPos == length) + if (aSelection.end.nIndex == length) autoClose = true; else { - selected = selected.copy(aSelection.nEndPos); + selected = selected.copy(aSelection.end.nIndex); if (o3tl::trim(selected).empty()) autoClose = true; } @@ -393,8 +392,8 @@ bool SmEditTextWindow::KeyInput(const KeyEvent& rKEvt) { pEditView->InsertText(sClose); // position it at center of brackets - aSelection.nStartPos += 2; - aSelection.nEndPos = aSelection.nStartPos; + aSelection.start.nIndex += 2; + aSelection.end.nIndex = aSelection.start.nIndex; pEditView->SetSelection(aSelection); } @@ -578,11 +577,11 @@ bool SmEditWindow::IsAllSelected() const if (!(nParaCnt - 1)) { sal_Int32 nTextLen = pEditEngine->GetText().getLength(); - bRes = !eSelection.nStartPos && (eSelection.nEndPos == nTextLen - 1); + bRes = !eSelection.start.nIndex && (eSelection.end.nIndex == nTextLen - 1); } else { - bRes = !eSelection.nStartPara && (eSelection.nEndPara == nParaCnt - 1); + bRes = !eSelection.start.nPara && (eSelection.end.nPara == nParaCnt - 1); } return bRes; } @@ -591,8 +590,7 @@ void SmEditWindow::SelectAll() { if (EditView* pEditView = GetEditView()) { - // ALL as last two parameters refers to the end of the text - pEditView->SetSelection( ESelection( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL ) ); + pEditView->SetSelection(ESelection::All()); } } @@ -600,8 +598,8 @@ void SmEditWindow::MarkError(const Point &rPos) { if (EditView* pEditView = GetEditView()) { - const sal_uInt16 nCol = sal::static_int_cast< sal_uInt16 >(rPos.X()); - const sal_uInt16 nRow = sal::static_int_cast< sal_uInt16 >(rPos.Y() - 1); + const sal_Int32 nCol = rPos.X(); + const sal_Int32 nRow = rPos.Y() - 1; pEditView->SetSelection(ESelection(nRow, nCol - 1, nRow, nCol)); GrabFocus(); @@ -626,22 +624,22 @@ void SmEditTextWindow::SelNextMark() return; ESelection eSelection = pEditView->GetSelection(); - sal_Int32 nPos = eSelection.nEndPos; + sal_Int32 nPos = eSelection.end.nIndex; sal_Int32 nCounts = pEditEngine->GetParagraphCount(); - while (eSelection.nEndPara < nCounts) + while (eSelection.end.nPara < nCounts) { - OUString aText = pEditEngine->GetText(eSelection.nEndPara); + OUString aText = pEditEngine->GetText(eSelection.end.nPara); nPos = aText.indexOf("<?>", nPos); if (nPos != -1) { pEditView->SetSelection(ESelection( - eSelection.nEndPara, nPos, eSelection.nEndPara, nPos + 3)); + eSelection.end.nPara, nPos, eSelection.end.nPara, nPos + 3)); break; } nPos = 0; - eSelection.nEndPara++; + eSelection.end.nPara++; } } @@ -655,8 +653,8 @@ void SmEditWindow::SelPrevMark() return; ESelection eSelection = pEditView->GetSelection(); - sal_Int32 nPara = eSelection.nStartPara; - sal_Int32 nMax = eSelection.nStartPos; + sal_Int32 nPara = eSelection.start.nPara; + sal_Int32 nMax = eSelection.start.nIndex; OUString aText(pEditEngine->GetText(nPara)); static constexpr OUStringLiteral aMark(u"<?>"); sal_Int32 nPos; @@ -783,10 +781,10 @@ void SmEditTextWindow::InsertText(const OUString& rText) sal_Int32 nStartIndex = 0; // get the start position (when we get a multi line formula) - for (sal_Int32 nParaPos = 0; nParaPos < aSelection.nStartPara; nParaPos++) + for (sal_Int32 nParaPos = 0; nParaPos < aSelection.start.nPara; nParaPos++) nStartIndex = aCurrentFormula.indexOf("\n", nStartIndex) + 1; - nStartIndex += aSelection.nStartPos; + nStartIndex += aSelection.start.nIndex; // TODO: unify this function with the InsertCommand: The do the same thing for different // callers @@ -798,23 +796,23 @@ void SmEditTextWindow::InsertText(const OUString& rText) string = string.replaceFirst("<?>", selected); // put a space before a new command if not in the beginning of a line - if (aSelection.nStartPos > 0 && aCurrentFormula[nStartIndex - 1] != ' ') + if (aSelection.start.nIndex > 0 && aCurrentFormula[nStartIndex - 1] != ' ') string = " " + string; pEditView->InsertText(string); // Remember start of the selection and move the cursor there afterwards. - aSelection.nEndPara = aSelection.nStartPara; + aSelection.end.nPara = aSelection.start.nPara; if (HasMark(string)) { - aSelection.nEndPos = aSelection.nStartPos; + aSelection.end.nIndex = aSelection.start.nIndex; pEditView->SetSelection(aSelection); SelNextMark(); } else { // set selection after inserted text - aSelection.nEndPos = aSelection.nStartPos + string.getLength(); - aSelection.nStartPos = aSelection.nEndPos; + aSelection.end.nIndex = aSelection.start.nIndex + string.getLength(); + aSelection.start.nIndex = aSelection.end.nIndex; pEditView->SetSelection(aSelection); } diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 49ef500c2059..b785662067a9 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -256,8 +256,8 @@ const SmNode * SmNode::FindTokenAt(sal_uInt16 nRow, sal_uInt16 nCol) const //! (there should be exactly one such node if any) { if ( IsVisible() - && nRow == GetSelection().nStartPara - && nCol >= GetSelection().nStartPos && nCol <= GetSelection().nEndPos ) + && nRow == GetSelection().start.nPara + && nCol >= GetSelection().start.nIndex && nCol <= GetSelection().end.nIndex ) return this; else { diff --git a/starmath/source/smediteng.cxx b/starmath/source/smediteng.cxx index ac3b09604438..c444a4c94812 100644 --- a/starmath/source/smediteng.cxx +++ b/starmath/source/smediteng.cxx @@ -101,9 +101,9 @@ void SmEditEngine::updateZoom() void SmEditEngine::updateAllESelection() { sal_Int32 paracount = GetParagraphCount(); - m_aAllSelection.nEndPara = paracount > 0 ? paracount - 1 : 0; - sal_Int32 textlength = GetTextLen(m_aAllSelection.nEndPara); - m_aAllSelection.nEndPos = textlength > 0 ? textlength : 0; + m_aAllSelection.end.nPara = paracount > 0 ? paracount - 1 : 0; + sal_Int32 textlength = GetTextLen(m_aAllSelection.end.nPara); + m_aAllSelection.end.nIndex = textlength > 0 ? textlength : 0; } void SmEditEngine::setSmItemPool(SfxItemPool* mpItemPool, const SvtLinguOptions& maLangOptions) diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 13bc165e3a54..3437a0b0ec69 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1764,16 +1764,16 @@ void SmViewShell::Execute(SfxRequest& rReq) const OUString sInput = pEditView->GetSurroundingText(); ESelection aSel( pWin->GetSelection() ); - if ( aSel.nStartPos > aSel.nEndPos ) - aSel.nEndPos = aSel.nStartPos; + if (aSel.start.nIndex > aSel.end.nIndex) + aSel.end.nIndex = aSel.start.nIndex; //calculate a valid end-position by reading logical characters sal_Int32 nUtf16Pos=0; - while( (nUtf16Pos < sInput.getLength()) && (nUtf16Pos < aSel.nEndPos) ) + while ((nUtf16Pos < sInput.getLength()) && (nUtf16Pos < aSel.end.nIndex)) { sInput.iterateCodePoints(&nUtf16Pos); - if( nUtf16Pos > aSel.nEndPos ) - aSel.nEndPos = nUtf16Pos; + if (nUtf16Pos > aSel.end.nIndex) + aSel.end.nIndex = nUtf16Pos; } ToggleUnicodeCodepoint aToggle; @@ -1784,7 +1784,7 @@ void SmViewShell::Execute(SfxRequest& rReq) { pEditView->SetSelection( aSel ); pEditEngine->UndoActionStart(EDITUNDO_REPLACEALL); - aSel.nStartPos = aSel.nEndPos - aToggle.StringToReplace().getLength(); + aSel.start.nIndex = aSel.end.nIndex - aToggle.StringToReplace().getLength(); pWin->SetSelection( aSel ); pEditView->InsertText( sReplacement, true ); pEditEngine->UndoActionEnd(); diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index 54ff74c9568b..75b20d54506d 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -263,6 +263,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/table/tabledesign \ svx/source/table/tablertfexporter \ svx/source/table/tablertfimporter \ + svx/source/table/tablehtmlimporter \ svx/source/tbxctrls/bulletsnumbering \ svx/source/tbxctrls/colrctrl \ svx/source/tbxctrls/SvxColorChildWindow \ diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index c486ab8ccd86..2f3e0c26505e 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -224,7 +224,7 @@ namespace accessibility }; AccessibleTextHelper_Impl::AccessibleTextHelper_Impl() : - maLastSelection( EE_PARA_NOT_FOUND,EE_INDEX_NOT_FOUND,EE_PARA_NOT_FOUND,EE_INDEX_NOT_FOUND ), + maLastSelection( ESelection::AtEnd() ), mnFirstVisibleChild( -1 ), mnLastVisibleChild( -2 ), mnStartIndex( 0 ), @@ -447,7 +447,7 @@ namespace accessibility // find the one with the cursor and get/set focus accordingly ESelection aSelection; if( GetEditViewForwarder().GetSelection( aSelection ) ) - SetChildFocus( aSelection.nEndPara, bHaveFocus ); + SetChildFocus(aSelection.end.nPara, bHaveFocus); } catch( const uno::Exception& ) {} } @@ -495,7 +495,7 @@ namespace accessibility if( GetEditViewForwarder().GetSelection( aSelection ) ) { if( maLastSelection != aSelection && - aSelection.nEndPara < maParaManager.GetNum() ) + aSelection.end.nPara < maParaManager.GetNum() ) { // #103998# Not that important, changed from assertion to trace if( mbThisHasFocus ) @@ -507,30 +507,30 @@ namespace accessibility // notify all affected paragraphs (TODO: may be suboptimal, // since some paragraphs might stay selected) - if( maLastSelection.nStartPara != EE_PARA_NOT_FOUND ) + if (maLastSelection.start.nPara != EE_PARA_MAX) { // Did the caret move from one paragraph to another? // #100530# no caret events if not focused. if( mbGroupHasFocus && - maLastSelection.nEndPara != aSelection.nEndPara ) + maLastSelection.end.nPara != aSelection.end.nPara ) { - if( maLastSelection.nEndPara < maParaManager.GetNum() ) + if (maLastSelection.end.nPara < maParaManager.GetNum()) { - maParaManager.FireEvent( ::std::min( maLastSelection.nEndPara, nMaxValidParaIndex ), - ::std::min( maLastSelection.nEndPara, nMaxValidParaIndex )+1, + maParaManager.FireEvent( ::std::min( maLastSelection.end.nPara, nMaxValidParaIndex ), + ::std::min( maLastSelection.end.nPara, nMaxValidParaIndex )+1, AccessibleEventId::CARET_CHANGED, uno::Any(static_cast<sal_Int32>(-1)), - uno::Any(maLastSelection.nEndPos) ); + uno::Any(maLastSelection.end.nIndex) ); } - ChangeChildFocus( aSelection.nEndPara ); + ChangeChildFocus(aSelection.end.nPara); SAL_INFO( "svx", "focus changed, Object: " << this - << ", Paragraph: " << aSelection.nEndPara + << ", Paragraph: " << aSelection.end.nPara << ", Last paragraph: " - << maLastSelection.nEndPara); + << maLastSelection.end.nPara); } } @@ -541,46 +541,46 @@ namespace accessibility // #i13705# The old cursor can only contain valid // values if it's the same paragraph! - if( maLastSelection.nStartPara != EE_PARA_NOT_FOUND && - maLastSelection.nEndPara == aSelection.nEndPara ) + if( maLastSelection.start.nPara != EE_PARA_MAX && + maLastSelection.end.nPara == aSelection.end.nPara ) { - aOldCursor <<= maLastSelection.nEndPos; + aOldCursor <<= maLastSelection.end.nIndex; } else { aOldCursor <<= static_cast<sal_Int32>(-1); } - maParaManager.FireEvent( aSelection.nEndPara, - aSelection.nEndPara+1, + maParaManager.FireEvent( aSelection.end.nPara, + aSelection.end.nPara+1, AccessibleEventId::CARET_CHANGED, - uno::Any(aSelection.nEndPos), + uno::Any(aSelection.end.nIndex), aOldCursor ); } SAL_INFO( "svx", "caret changed, Object: " << this << ", New pos: " - << aSelection.nEndPos << ", Old pos: " - << maLastSelection.nEndPos << ", New para: " - << aSelection.nEndPara << ", Old para: " - << maLastSelection.nEndPara); + << aSelection.end.nIndex << ", Old pos: " + << maLastSelection.end.nIndex << ", New para: " + << aSelection.end.nPara << ", Old para: " + << maLastSelection.end.nPara); // #108947# Sort new range before calling FireEvent ::std::pair<sal_Int32, sal_Int32> sortedSelection( - makeSortedPair(::std::min( aSelection.nStartPara, nMaxValidParaIndex ), - ::std::min( aSelection.nEndPara, nMaxValidParaIndex ) ) ); + makeSortedPair(::std::min( aSelection.start.nPara, nMaxValidParaIndex ), + ::std::min( aSelection.end.nPara, nMaxValidParaIndex ) ) ); // #108947# Sort last range before calling FireEvent ::std::pair<sal_Int32, sal_Int32> sortedLastSelection( - makeSortedPair(::std::min( maLastSelection.nStartPara, nMaxValidParaIndex ), - ::std::min( maLastSelection.nEndPara, nMaxValidParaIndex ) ) ); + makeSortedPair(::std::min( maLastSelection.start.nPara, nMaxValidParaIndex ), + ::std::min( maLastSelection.end.nPara, nMaxValidParaIndex ) ) ); // event TEXT_SELECTION_CHANGED has to be submitted. (#i27299#) const sal_Int16 nTextSelChgEventId = AccessibleEventId::TEXT_SELECTION_CHANGED; // #107037# notify selection change - if( maLastSelection.nStartPara == EE_PARA_NOT_FOUND ) + if (maLastSelection.start.nPara == EE_PARA_MAX) { // last selection is undefined // use method <ESelection::HasRange()> (#i27299#) @@ -624,11 +624,11 @@ namespace accessibility ESelection aTmpSel( aSelection ); aTmpSel.Adjust(); // first submit event for new and changed selection - sal_Int32 nPara = aTmpSel.nStartPara; - for ( ; nPara <= aTmpSel.nEndPara; ++nPara ) + sal_Int32 nPara = aTmpSel.start.nPara; + for ( ; nPara <= aTmpSel.end.nPara; ++nPara ) { - if ( nPara < aTmpLastSel.nStartPara || - nPara > aTmpLastSel.nEndPara ) + if ( nPara < aTmpLastSel.start.nPara || + nPara > aTmpLastSel.end.nPara ) { // new selection on paragraph <nPara> maParaManager.FireEvent( nPara, @@ -638,17 +638,17 @@ namespace accessibility { // check for changed selection on paragraph <nPara> const sal_Int32 nParaStartPos = - nPara == aTmpSel.nStartPara - ? aTmpSel.nStartPos : 0; + nPara == aTmpSel.start.nPara + ? aTmpSel.start.nIndex : 0; const sal_Int32 nParaEndPos = - nPara == aTmpSel.nEndPara - ? aTmpSel.nEndPos : -1; + nPara == aTmpSel.end.nPara + ? aTmpSel.end.nIndex : -1; const sal_Int32 nLastParaStartPos = - nPara == aTmpLastSel.nStartPara - ? aTmpLastSel.nStartPos : 0; + nPara == aTmpLastSel.start.nPara + ? aTmpLastSel.start.nIndex : 0; const sal_Int32 nLastParaEndPos = - nPara == aTmpLastSel.nEndPara - ? aTmpLastSel.nEndPos : -1; + nPara == aTmpLastSel.end.nPara + ? aTmpLastSel.end.nIndex : -1; if ( nParaStartPos != nLastParaStartPos || nParaEndPos != nLastParaEndPos ) { @@ -658,11 +658,11 @@ namespace accessibility } } // second submit event for 'old' selections - nPara = aTmpLastSel.nStartPara; - for ( ; nPara <= aTmpLastSel.nEndPara; ++nPara ) + nPara = aTmpLastSel.start.nPara; + for ( ; nPara <= aTmpLastSel.end.nPara; ++nPara ) { - if ( nPara < aTmpSel.nStartPara || - nPara > aTmpSel.nEndPara ) + if ( nPara < aTmpSel.start.nPara || + nPara > aTmpSel.end.nPara ) { maParaManager.FireEvent( nPara, nTextSelChgEventId ); @@ -964,7 +964,7 @@ namespace accessibility pTextHint->GetId() == SfxHintId::TextParaRemoved )) ) return; - if( pTextHint->GetValue() == EE_PARA_ALL ) + if (pTextHint->GetValue() == EE_PARA_MAX) { mnParasChanged = -1; } @@ -1152,13 +1152,12 @@ namespace accessibility // focused child now loses focus ESelection aSelection; if( GetEditViewForwarder().GetSelection( aSelection ) ) - SetChildFocus( aSelection.nEndPara, false ); + SetChildFocus(aSelection.end.nPara, false); // change children state maParaManager.SetActive( false ); - maLastSelection = ESelection( EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, - EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND); + maLastSelection = ESelection::AtEnd(); break; } default: @@ -1213,7 +1212,7 @@ namespace accessibility // #108900# Delegate change event to children AccessibleTextHelper_ChildrenTextChanged aNotifyChildrenFunctor; - if( nPara == EE_PARA_ALL ) + if (nPara == EE_PARA_MAX) { // #108900# Call every child ::std::for_each( maParaManager.begin(), maParaManager.end(), diff --git a/svx/source/annotation/TextAPI.cxx b/svx/source/annotation/TextAPI.cxx index cd13acd76d3b..d3891f7f5958 100644 --- a/svx/source/annotation/TextAPI.cxx +++ b/svx/source/annotation/TextAPI.cxx @@ -167,7 +167,7 @@ void TextApiObject::SetText(OutlinerParaObject const& rText) pModel->AddUndo(std::make_unique<UndoTextAPIChanged>(*pModel, this)); mpSource->SetText(rText); - maSelection.nStartPara = EE_PARA_MAX_COUNT; + maSelection.start.nPara = EE_PARA_MAX; } OUString TextApiObject::GetText() const { return mpSource->GetText(); } diff --git a/svx/source/dialog/ClassificationEditView.cxx b/svx/source/dialog/ClassificationEditView.cxx index fa4388017fcb..56ac009a30f8 100644 --- a/svx/source/dialog/ClassificationEditView.cxx +++ b/svx/source/dialog/ClassificationEditView.cxx @@ -58,7 +58,7 @@ void ClassificationEditView::InvertSelectionWeight() { ESelection aSelection = m_xEditView->GetSelection(); - for (sal_Int32 nParagraph = aSelection.nStartPara; nParagraph <= aSelection.nEndPara; ++nParagraph) + for (sal_Int32 nParagraph = aSelection.start.nPara; nParagraph <= aSelection.end.nPara; ++nParagraph) { FontWeight eFontWeight = WEIGHT_BOLD; diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index 0df0ffdc2549..8b7322b79d43 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -287,12 +287,9 @@ bool WeldEditView::KeyInput(const KeyEvent& rKEvt) { if (nKey == KEY_A) { - EditEngine* pEditEngine = GetEditEngine(); - sal_Int32 nPar = pEditEngine->GetParagraphCount(); - if (nPar) + if (GetEditEngine()->GetParagraphCount()) { - sal_Int32 nLen = pEditEngine->GetTextLen(nPar - 1); - pEditView->SetSelection(ESelection(0, 0, nPar - 1, nLen)); + pEditView->SetSelection(ESelection::All()); } return true; } @@ -955,7 +952,7 @@ SfxItemSet WeldTextForwarder::GetAttribs(const ESelection& rSel, { EditEngine* pEditEngine = m_rEditAcc.GetEditEngine(); assert(pEditEngine && "EditEngine missing"); - if (rSel.nStartPara == rSel.nEndPara) + if (rSel.start.nPara == rSel.end.nPara) { GetAttribsFlags nFlags = GetAttribsFlags::NONE; switch (nOnlyHardAttrib) @@ -970,7 +967,8 @@ SfxItemSet WeldTextForwarder::GetAttribs(const ESelection& rSel, SAL_WARN("svx", "unknown flags for WeldTextForwarder::GetAttribs"); } - return pEditEngine->GetAttribs(rSel.nStartPara, rSel.nStartPos, rSel.nEndPos, nFlags); + return pEditEngine->GetAttribs(rSel.start.nPara, rSel.start.nIndex, rSel.end.nIndex, + nFlags); } else { @@ -1102,17 +1100,17 @@ static SfxItemState GetSvxEditEngineItemState(EditEngine const& rEditEngine, con SfxItemState eState = SfxItemState::DEFAULT; // check all paragraphs inside the selection - for (sal_Int32 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++) + for (sal_Int32 nPara = rSel.start.nPara; nPara <= rSel.end.nPara; nPara++) { SfxItemState eParaState = SfxItemState::DEFAULT; // calculate start and endpos for this paragraph sal_Int32 nPos = 0; - if (rSel.nStartPara == nPara) - nPos = rSel.nStartPos; + if (rSel.start.nPara == nPara) + nPos = rSel.start.nIndex; - sal_Int32 nEndPos = rSel.nEndPos; - if (rSel.nEndPara != nPara) + sal_Int32 nEndPos = rSel.end.nIndex; + if (rSel.end.nPara != nPara) nEndPos = rEditEngine.GetTextLen(nPara); // get list of char attribs @@ -1238,14 +1236,14 @@ tools::Rectangle WeldTextForwarder::GetCharBounds(sal_Int32 nPara, sal_Int32 nIn if (nIndex >= pEditEngine->GetTextLen(nPara)) { if (nIndex) - aRect = pEditEngine->GetCharacterBounds(EPosition(nPara, nIndex - 1)); + aRect = pEditEngine->GetCharacterBounds(EPaM(nPara, nIndex - 1)); aRect.Move(aRect.Right() - aRect.Left(), 0); aRect.SetSize(Size(1, pEditEngine->GetTextHeight())); } else { - aRect = pEditEngine->GetCharacterBounds(EPosition(nPara, nIndex)); + aRect = pEditEngine->GetCharacterBounds(EPaM(nPara, nIndex)); } } return aRect; @@ -1286,7 +1284,7 @@ bool WeldTextForwarder::GetIndexAtPoint(const Point& rPos, sal_Int32& nPara, EditEngine* pEditEngine = m_rEditAcc.GetEditEngine(); if (pEditEngine) { - EPosition aDocPos = pEditEngine->FindDocPosition(rPos); + EPaM aDocPos = pEditEngine->FindDocPosition(rPos); nPara = aDocPos.nPara; nIndex = aDocPos.nIndex; bRes = true; @@ -1301,13 +1299,13 @@ bool WeldTextForwarder::GetWordIndices(sal_Int32 nPara, sal_Int32 nIndex, sal_In EditEngine* pEditEngine = m_rEditAcc.GetEditEngine(); if (pEditEngine) { - ESelection aRes = pEditEngine->GetWord(ESelection(nPara, nIndex, nPara, nIndex), - css::i18n::WordType::DICTIONARY_WORD); + ESelection aRes + = pEditEngine->GetWord(ESelection(nPara, nIndex), css::i18n::WordType::DICTIONARY_WORD); - if (aRes.nStartPara == nPara && aRes.nStartPara == aRes.nEndPara) + if (aRes.start.nPara == nPara && aRes.start.nPara == aRes.end.nPara) { - nStart = aRes.nStartPos; - nEnd = aRes.nEndPos; + nStart = aRes.start.nIndex; + nEnd = aRes.end.nIndex; bRes = true; } @@ -1439,7 +1437,7 @@ sal_Int32 WeldTextForwarder::AppendTextPortion(sal_Int32 nPara, const OUString& pEditEngine->QuickInsertText(rText, aSel); // set attributes for new appended text - nRes = aSel.nEndPos = pEditEngine->GetTextLen(nPara); + nRes = aSel.end.nIndex = pEditEngine->GetTextLen(nPara); pEditEngine->QuickSetAttribs(rSet, aSel); } return nRes; diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 6e80276c3aa6..cda1c9af2c71 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -489,7 +489,8 @@ bool GalleryTransferable::GetData( const datatransfer::DataFlavor& rFlavor, cons { bRet = SetGDIMetaFile( mpGraphicObject->GetGraphic().GetGDIMetaFile() ); } - else if( ( SotClipboardFormatId::BITMAP == nFormat ) && mpGraphicObject ) + else if( ( SotClipboardFormatId::BITMAP == nFormat || SotClipboardFormatId::PNG == nFormat) + && mpGraphicObject ) { bRet = SetBitmapEx( mpGraphicObject->GetGraphic().GetBitmapEx(), rFlavor ); } diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index 90c68df3fa2a..e734e3ef6e84 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -496,18 +496,18 @@ namespace sdr::properties { if(EE_FEATURE_FIELD == rAttrib.pAttr->Which()) { - aSel.nEndPos = rAttrib.nStart; + aSel.end.nIndex = rAttrib.nStart; - if(aSel.nStartPos != aSel.nEndPos) + if (aSel.start.nIndex != aSel.end.nIndex) pEditEngine->QuickSetAttribs(aColorSet, aSel); - aSel.nStartPos = rAttrib.nEnd; + aSel.start.nIndex = rAttrib.nEnd; } } - aSel.nEndPos = pEditEngine->GetTextLen(nPara); + aSel.end.nIndex = pEditEngine->GetTextLen(nPara); - if(aSel.nStartPos != aSel.nEndPos) + if (aSel.start.nIndex != aSel.end.nIndex) { pEditEngine->QuickSetAttribs( aColorSet, aSel ); } diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 6eea9d2a6292..0f6e4012ce59 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -2268,16 +2268,17 @@ bool SdrObjEditView::ImpIsTextEditAllSelected() const = mpTextEditOutliner->GetParagraph(nParaCnt > 1 ? nParaCnt - 1 : 0); ESelection aESel(mpTextEditOutlinerView->GetSelection()); - if (aESel.nStartPara == 0 && aESel.nStartPos == 0 && aESel.nEndPara == (nParaCnt - 1)) + if (aESel.start.nPara == 0 && aESel.start.nIndex == 0 + && aESel.end.nPara == (nParaCnt - 1)) { - if (mpTextEditOutliner->GetText(pLastPara).getLength() == aESel.nEndPos) + if (mpTextEditOutliner->GetText(pLastPara).getLength() == aESel.end.nIndex) bRet = true; } // in case the selection was done backwards - if (!bRet && aESel.nEndPara == 0 && aESel.nEndPos == 0 - && aESel.nStartPara == (nParaCnt - 1)) + if (!bRet && aESel.end.nPara == 0 && aESel.end.nIndex == 0 + && aESel.start.nPara == (nParaCnt - 1)) { - if (mpTextEditOutliner->GetText(pLastPara).getLength() == aESel.nStartPos) + if (mpTextEditOutliner->GetText(pLastPara).getLength() == aESel.start.nIndex) bRet = true; } } @@ -2812,11 +2813,11 @@ sal_uInt16 SdrObjEditView::GetSelectionLevel() const { //start and end position ESelection aSelect = mpTextEditOutlinerView->GetSelection(); - sal_uInt16 nStartPara = ::std::min(aSelect.nStartPara, aSelect.nEndPara); - sal_uInt16 nEndPara = ::std::max(aSelect.nStartPara, aSelect.nEndPara); + sal_Int32 nStartPara = ::std::min(aSelect.start.nPara, aSelect.end.nPara); + sal_Int32 nEndPara = ::std::max(aSelect.start.nPara, aSelect.end.nPara); //get level from each paragraph nLevel = 0; - for (sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++) + for (sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++) { sal_uInt16 nParaDepth = 1 << static_cast<sal_uInt16>(mpTextEditOutliner->GetDepth(nPara)); @@ -3085,7 +3086,7 @@ void SdrObjEditView::ApplyFormatPaintBrush(SfxItemSet& rFormatSet, sal_Int16 nDe ESelection aSel(pOLV->GetSelection()); bool fullParaSelection - = aSel.nEndPara != aSel.nStartPara || pOLV->GetEditView().IsSelectionFullPara(); + = aSel.end.nPara != aSel.start.nPara || pOLV->GetEditView().IsSelectionFullPara(); if (!aSel.HasRange()) pOLV->SetSelection(rEditEngine.GetWord(aSel, css::i18n::WordType::DICTIONARY_WORD)); const bool bRemoveParaAttribs = !bNoParagraphFormats && !fullParaSelection; @@ -3097,7 +3098,7 @@ void SdrObjEditView::ApplyFormatPaintBrush(SfxItemSet& rFormatSet, sal_Int16 nDe pOLV->SetAttribs(aPaintSet); if (!bNoParagraphFormats && nDepth > -2) { - for (sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; ++nPara) + for (sal_Int32 nPara = aSel.start.nPara; nPara <= aSel.end.nPara; ++nPara) pOLV->SetDepth(nPara, nDepth); } } diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 6e7e5c5a33e5..ff23cd4ec38e 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1237,9 +1237,9 @@ OUString SdrView::GetStatusText() else if (IsTextEdit() && mpTextEditOutlinerView != nullptr) { aStr=SvxResId(STR_ViewTextEdit); // "TextEdit - Row y, Column x"; ESelection aSel(mpTextEditOutlinerView->GetSelection()); - tools::Long nPar = aSel.nEndPara,nLin=0,nCol=aSel.nEndPos; - if (aSel.nEndPara>0) { - for (sal_Int32 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) { + tools::Long nPar = aSel.end.nPara, nLin = 0, nCol = aSel.end.nIndex; + if (aSel.end.nPara>0) { + for (sal_Int32 nParaNum=0; nParaNum<aSel.end.nPara; nParaNum++) { nLin += mpTextEditOutliner->GetLineCount(nParaNum); } } @@ -1247,11 +1247,11 @@ OUString SdrView::GetStatusText() // At the end of a line of any multi-line paragraph, we display the // position of the next line of the same paragraph, if there is one. sal_uInt16 nParaLine = 0; - sal_uInt32 nParaLineCount = mpTextEditOutliner->GetLineCount(aSel.nEndPara); + sal_Int32 nParaLineCount = mpTextEditOutliner->GetLineCount(aSel.end.nPara); bool bBrk = false; while (!bBrk) { - sal_uInt16 nLen = mpTextEditOutliner->GetLineLen(aSel.nEndPara, nParaLine); + sal_uInt16 nLen = mpTextEditOutliner->GetLineLen(aSel.end.nPara, nParaLine); bool bLastLine = (nParaLine == nParaLineCount - 1); if (nCol>nLen || (!bLastLine && nCol == nLen)) { @@ -1271,7 +1271,7 @@ OUString SdrView::GetStatusText() aStr = aStr.replaceFirst("%3", OUString::number(nCol + 1)); #ifdef DBG_UTIL - aStr += ", Level " + OUString::number(mpTextEditOutliner->GetDepth( aSel.nEndPara )); + aStr += ", Level " + OUString::number(mpTextEditOutliner->GetDepth( aSel.end.nPara )); #endif } @@ -1397,8 +1397,7 @@ void SdrView::UnmarkAll() { if (IsTextEdit()) { ESelection eSel=GetTextEditOutlinerView()->GetSelection(); - eSel.nStartPara=eSel.nEndPara; - eSel.nStartPos=eSel.nEndPos; + eSel.CollapseToEnd(); GetTextEditOutlinerView()->SetSelection(eSel); } else if (HasMarkedGluePoints()) UnmarkAllGluePoints(); else if (HasMarkedPoints()) UnmarkAllPoints(); // Marked, not Markable! diff --git a/svx/source/svdraw/textchaincursor.cxx b/svx/source/svdraw/textchaincursor.cxx index 51c4d1d8ef87..f9bb278f4272 100644 --- a/svx/source/svdraw/textchaincursor.cxx +++ b/svx/source/svdraw/textchaincursor.cxx @@ -78,7 +78,7 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent& rKEvt, sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); ESelection aCurSel = pOLV->GetSelection(); - ESelection aEndSelPrevBox(100000, 100000); + ESelection aEndSelPrevBox(ESelection::AtEnd()); sal_Int32 nLastPara = pOutl->GetParagraphCount()-1; OUString aLastParaText = pOutl->GetText(pOutl->GetParagraph(nLastPara)); @@ -144,8 +144,7 @@ void TextChainCursorManager::HandleCursorEventAfterChaining( // Move to end of prev box SdrTextObj *pPrevLink = mpTextObj->GetPrevLinkInChain(); - ESelection aEndSel(100000, 100000); - impChangeEditingTextObj(pPrevLink, aEndSel); + impChangeEditingTextObj(pPrevLink, ESelection::AtEnd()); return; } diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 9763ea5015cb..6e71faebb3cd 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -124,8 +124,8 @@ void TextChainFlow::impUpdateCursorInfo() ESelection aSelAtUFTime = GetTextChain()->GetPreChainingSel(GetLinkTarget()); // Might be an invalid selection if the cursor at UF time was before // the (possibly UF-induced) Overflowing point but we don't use it in that case - maPostChainingSel = ESelection(aSelAtUFTime.nStartPara-maOverflowPosSel.nStartPara, - aSelAtUFTime.nStartPos-maOverflowPosSel.nStartPos ); + maPostChainingSel = ESelection(aSelAtUFTime.start.nPara-maOverflowPosSel.start.nPara, + aSelAtUFTime.start.nIndex-maOverflowPosSel.start.nIndex ); } // XXX: It may not be necessary anymore to keep this method separated from EditingTextChainFlow::impBroadcastCursorInfo diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index c10c431e16bf..272e50a92cbe 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -760,7 +760,7 @@ void Cell::SetOutlinerParaObject( std::optional<OutlinerParaObject> pTextObject { bool bNullTextObject = !pTextObject; SdrText::SetOutlinerParaObject( std::move(pTextObject) ); - maSelection.nStartPara = EE_PARA_MAX_COUNT; + maSelection.start.nPara = EE_PARA_MAX; if( bNullTextObject ) ForceOutlinerParaObject( OutlinerMode::TextObject ); @@ -1682,7 +1682,7 @@ void SAL_CALL Cell::insertControlCharacter( const Reference< XTextRange >& xRang OUString SAL_CALL Cell::getString( ) { - maSelection.nStartPara = EE_PARA_MAX_COUNT; + maSelection.start.nPara = EE_PARA_MAX; return SvxUnoTextBase::getString(); } diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 85f5cb60169a..782f7ec4b5b8 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -298,7 +298,12 @@ bool SvxTableController::onMouseButtonDown(const MouseEvent& rMEvt, vcl::Window* } if( rMEvt.IsRight() && eHit != TableHitKind::NONE ) + { + OutlinerView* pOLV = mrView.GetTextEditOutlinerView(); + if( pOLV ) + pOLV->MouseButtonDown(rMEvt); return true; // right click will become context menu + } // for cell selection with the mouse remember our first hit if( mbLeftButtonDown ) @@ -2099,7 +2104,7 @@ void SvxTableController::EditCell(const CellPos& rPos, vcl::Window* pWindow, Tbl ((nAction == TblAction::GotoRightCell) && (eMode == WritingMode_RL_TB)); if( bLast ) - aNewSelection = ESelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND); + aNewSelection = ESelection::AtEnd(); } pOLV->SetSelection(aNewSelection); } diff --git a/svx/source/table/tablehtmlimporter.cxx b/svx/source/table/tablehtmlimporter.cxx new file mode 100644 index 000000000000..c2384466bb8b --- /dev/null +++ b/svx/source/table/tablehtmlimporter.cxx @@ -0,0 +1,509 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <memory> +#include <vector> + +#include <com/sun/star/table/XTable.hpp> +#include <com/sun/star/table/XMergeableCellRange.hpp> + +#include <tools/stream.hxx> +#include <tools/UnitConversion.hxx> + +#include <svx/svdetc.hxx> +#include <editeng/outlobj.hxx> + +#include <cell.hxx> +#include <svx/svdotable.hxx> +#include <svx/svdoutl.hxx> +#include <editeng/editeng.hxx> +#include <editeng/editdata.hxx> +#include <svx/svdmodel.hxx> +#include <editeng/editids.hrc> +#include <sal/log.hxx> +#include <tools/debug.hxx> +#include <comphelper/diagnose_ex.hxx> +#include <svtools/htmltokn.h> +#include <svtools/parhtml.hxx> + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::table; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::beans; + +namespace sdr::table +{ +namespace +{ +struct RowColSpan +{ + sal_Int32 mnRowSpan; + sal_Int32 mnColSpan; + explicit RowColSpan() + : mnRowSpan(1) + , mnColSpan(1) + { + } +}; + +struct HTMLCellDefault +{ + sal_Int32 mnRowSpan; + sal_Int32 mnColSpan; // MergeCell if >1, merged cells if 0 + sal_Int32 mnCellX; + + explicit HTMLCellDefault() + : mnRowSpan(1) + , mnColSpan(1) + , mnCellX(0) + { + } +}; +} + +typedef std::vector<std::shared_ptr<HTMLCellDefault>> HTMLCellDefaultVector; + +namespace +{ +struct HTMLCellInfo +{ + SfxItemSet maItemSet; + sal_Int32 mnStartPara; + sal_Int32 mnParaCount; + sal_Int32 mnCellX; + sal_Int32 mnRowSpan; + std::shared_ptr<HTMLCellInfo> mxVMergeCell; + + explicit HTMLCellInfo(SfxItemPool& rPool) + : maItemSet(rPool) + , mnStartPara(0) + , mnParaCount(0) + , mnCellX(0) + , mnRowSpan(1) + { + } +}; +} + +typedef std::shared_ptr<HTMLCellInfo> HTMLCellInfoPtr; +typedef std::vector<HTMLCellInfoPtr> HTMLColumnVector; + +typedef std::shared_ptr<HTMLColumnVector> HTMLColumnVectorPtr; + +class SdrTableHTMLParser +{ +public: + explicit SdrTableHTMLParser(SdrTableObj& rTableObj); + + void Read(SvStream& rStream); + + void ProcToken(HtmlImportInfo* pInfo); + + void NextRow(); + void NextColumn(); + void NewCellRow(); + + void InsertCell(sal_Int32 nStartPara, sal_Int32 nEndPara); + void InsertColumnEdge(sal_Int32 nEdge); + + void FillTable(); + + DECL_LINK(HTMLImportHdl, HtmlImportInfo&, void); + +private: + SdrTableObj& mrTableObj; + std::unique_ptr<SdrOutliner> mpOutliner; + SfxItemPool& mrItemPool; + + HTMLCellDefaultVector maDefaultList; + HTMLCellDefaultVector::iterator maDefaultIterator; + + HtmlTokenId mnLastToken; + bool mbNewDef; + + sal_Int32 mnCellStartPara; + + sal_Int32 mnRowCnt; + sal_Int32 mnLastEdge; + sal_Int32 mnVMergeIdx; + + std::vector<sal_Int32> maColumnEdges; + std::vector<sal_Int32>::iterator maLastEdge; + std::vector<HTMLColumnVectorPtr> maRows; + + std::unique_ptr<HTMLCellDefault> mpInsDefault; + HTMLCellDefault* mpActDefault; + sal_Int32 mnCellInRow; + + Reference<XTable> mxTable; + + HTMLColumnVectorPtr mxLastRow; + // Copy assignment is forbidden and not implemented. + SdrTableHTMLParser(const SdrTableHTMLParser&) = delete; + SdrTableHTMLParser& operator=(const SdrTableHTMLParser&) = delete; +}; + +SdrTableHTMLParser::SdrTableHTMLParser(SdrTableObj& rTableObj) + : mrTableObj(rTableObj) + , mpOutliner(SdrMakeOutliner(OutlinerMode::TextObject, rTableObj.getSdrModelFromSdrObject())) + , mrItemPool(rTableObj.getSdrModelFromSdrObject().GetItemPool()) + , mnLastToken(HtmlTokenId::NONE) + , mbNewDef(false) + , mnCellStartPara(0) + , mnRowCnt(0) + , mnLastEdge(0) + , mnVMergeIdx(0) + , mpActDefault(nullptr) + , mnCellInRow(-1) + , mxTable(rTableObj.getTable()) +{ + mpOutliner->SetUpdateLayout(true); + mpOutliner->SetStyleSheet(0, mrTableObj.GetStyleSheet()); + mpInsDefault.reset(new HTMLCellDefault()); +} + +void SdrTableHTMLParser::Read(SvStream& rStream) +{ + EditEngine& rEdit = const_cast<EditEngine&>(mpOutliner->GetEditEngine()); + + Link<HtmlImportInfo&, void> aOldLink(rEdit.GetHtmlImportHdl()); + rEdit.SetHtmlImportHdl(LINK(this, SdrTableHTMLParser, HTMLImportHdl)); + mpOutliner->Read(rStream, OUString(), EETextFormat::Html); + rEdit.SetHtmlImportHdl(aOldLink); + + FillTable(); +} + +IMPL_LINK(SdrTableHTMLParser, HTMLImportHdl, HtmlImportInfo&, rInfo, void) +{ + switch (rInfo.eState) + { + case HtmlImportState::NextToken: + ProcToken(&rInfo); + break; + case HtmlImportState::End: + if (rInfo.aSelection.end.nIndex) + { + mpActDefault = nullptr; + //TODO: ?? + // rInfo.nToken = RTF_PAR; + rInfo.aSelection.end.nPara++; + ProcToken(&rInfo); + } + break; + case HtmlImportState::SetAttr: + case HtmlImportState::InsertText: + case HtmlImportState::InsertPara: + break; + default: + SAL_WARN("svx.table", "unknown ImportInfo.eState"); + } +} + +void SdrTableHTMLParser::NextRow() +{ + mxLastRow = maRows.back(); + mnVMergeIdx = 0; + ++mnRowCnt; +} + +void SdrTableHTMLParser::InsertCell(sal_Int32 nStartPara, sal_Int32 nEndPara) +{ + HTMLCellInfoPtr xCellInfo = std::make_shared<HTMLCellInfo>(mrItemPool); + xCellInfo->mnStartPara = nStartPara; + xCellInfo->mnParaCount = nEndPara - nStartPara; + xCellInfo->mnCellX = mpActDefault->mnCellX; + xCellInfo->mnRowSpan = mpActDefault->mnRowSpan; + + if (mxLastRow != nullptr) + { + sal_Int32 nSize = mxLastRow->size(); + while (mnVMergeIdx < nSize && (*mxLastRow)[mnVMergeIdx]->mnCellX < xCellInfo->mnCellX) + ++mnVMergeIdx; + + if (xCellInfo->mnRowSpan == 0 && mnVMergeIdx < nSize) + { + HTMLCellInfoPtr xLastCell((*mxLastRow)[mnVMergeIdx]); + if (xLastCell->mnRowSpan) + xCellInfo->mxVMergeCell = xLastCell; + else + xCellInfo->mxVMergeCell = xLastCell->mxVMergeCell; + } + } + + if (!maRows.empty()) + { + HTMLColumnVectorPtr xColumn(maRows.back()); + if (xCellInfo->mxVMergeCell) + { + if (xColumn->empty() || xColumn->back()->mxVMergeCell != xCellInfo->mxVMergeCell) + xCellInfo->mxVMergeCell->mnRowSpan++; + } + + xColumn->push_back(xCellInfo); + } +} + +void SdrTableHTMLParser::InsertColumnEdge(sal_Int32 nEdge) +{ + auto aNextEdge = std::lower_bound(maLastEdge, maColumnEdges.end(), nEdge); + + if (aNextEdge == maColumnEdges.end() || nEdge != *aNextEdge) + { + maLastEdge = maColumnEdges.insert(aNextEdge, nEdge); + mnLastEdge = nEdge; + } +} + +void SdrTableHTMLParser::FillTable() +{ + try + { + sal_Int32 nColCount = mxTable->getColumnCount(); + Reference<XTableColumns> xCols(mxTable->getColumns(), UNO_SET_THROW); + sal_Int32 nColMax = maColumnEdges.size(); + if (nColCount < nColMax) + { + xCols->insertByIndex(nColCount, nColMax - nColCount); + nColCount = mxTable->getColumnCount(); + } + + static constexpr OUStringLiteral sWidth(u"Width"); + sal_Int32 nCol, nLastEdge = 0; + for (nCol = 0; nCol < nColCount; nCol++) + { + Reference<XPropertySet> xSet(xCols->getByIndex(nCol), UNO_QUERY_THROW); + sal_Int32 nWidth = maColumnEdges[nCol] - nLastEdge; + + xSet->setPropertyValue(sWidth, Any(nWidth)); + nLastEdge += nWidth; + } + + const sal_Int32 nRowCount = mxTable->getRowCount(); + if (nRowCount < mnRowCnt) + { + Reference<XTableRows> xRows(mxTable->getRows(), UNO_SET_THROW); + xRows->insertByIndex(nRowCount, mnRowCnt - nRowCount); + } + + for (sal_Int32 nRow = 0; nRow < static_cast<sal_Int32>(maRows.size()); nRow++) + { + HTMLColumnVectorPtr xColumn(maRows[nRow]); + nCol = 0; + auto aEdge = maColumnEdges.begin(); + for (sal_Int32 nIdx = 0; + nCol < nColMax && nIdx < static_cast<sal_Int32>(xColumn->size()); nIdx++) + { + HTMLCellInfoPtr xCellInfo((*xColumn)[nIdx]); + + CellRef xCell(dynamic_cast<Cell*>(mxTable->getCellByPosition(nCol, nRow).get())); + if (xCell.is() && xCellInfo) + { + const SfxPoolItem* pPoolItem = nullptr; + if (xCellInfo->maItemSet.GetItemState(SDRATTR_TABLE_BORDER, false, &pPoolItem) + == SfxItemState::SET) + xCell->SetMergedItem(*pPoolItem); + + std::optional<OutlinerParaObject> pTextObject(mpOutliner->CreateParaObject( + xCellInfo->mnStartPara, xCellInfo->mnParaCount)); + if (pTextObject) + { + SdrOutliner& rOutliner = mrTableObj.ImpGetDrawOutliner(); + rOutliner.SetUpdateLayout(true); + rOutliner.SetText(*pTextObject); + mrTableObj.NbcSetOutlinerParaObjectForText(rOutliner.CreateParaObject(), + xCell.get()); + } + + sal_Int32 nLastRow = nRow; + if (xCellInfo->mnRowSpan) + nLastRow += xCellInfo->mnRowSpan - 1; + + aEdge = std::lower_bound(aEdge, maColumnEdges.end(), xCellInfo->mnCellX); + sal_Int32 nLastCol = nCol; + if (aEdge != maColumnEdges.end()) + { + nLastCol = std::distance(maColumnEdges.begin(), aEdge); + ++aEdge; + } + + if (nLastCol > nCol || nLastRow > nRow) + { + Reference<XMergeableCellRange> xRange( + mxTable->createCursorByRange( + mxTable->getCellRangeByPosition(nCol, nRow, nLastCol, nLastRow)), + UNO_QUERY_THROW); + if (xRange->isMergeable()) + xRange->merge(); + } + nCol = nLastCol + 1; + } + } + } + + tools::Rectangle aRect(mrTableObj.GetSnapRect()); + aRect.SetRight(aRect.Left() + nLastEdge); + mrTableObj.NbcSetSnapRect(aRect); + } + catch (Exception&) + { + TOOLS_WARN_EXCEPTION("svx", ""); + } +} + +void SdrTableHTMLParser::NewCellRow() +{ + if (mbNewDef) + { + mbNewDef = false; + + maRows.push_back(std::make_shared<std::vector<std::shared_ptr<HTMLCellInfo>>>()); + } + maDefaultIterator = maDefaultList.begin(); + + NextColumn(); + + DBG_ASSERT(mpActDefault, "NewCellRow: pActDefault==0"); +} + +void SdrTableHTMLParser::NextColumn() +{ + if (maDefaultIterator != maDefaultList.end()) + mpActDefault = (*maDefaultIterator++).get(); + else + mpActDefault = nullptr; +} + +static RowColSpan lcl_GetRowColSpan(const HTMLOptions& options) +{ + RowColSpan aRowColSpan; + for (HTMLOptions::const_iterator optionIt = options.begin(); optionIt != options.end(); + ++optionIt) + { + if (optionIt->GetToken() == HtmlOptionId::COLSPAN) + { + aRowColSpan.mnColSpan = optionIt->GetNumber(); + } + else if (optionIt->GetToken() == HtmlOptionId::ROWSPAN) + { + aRowColSpan.mnRowSpan = optionIt->GetNumber(); + } + } + return aRowColSpan; +} + +//TODO: width is pixel - detect document pixel with to determine real width +static sal_Int32 lcl_GetWidth(const HTMLOptions& options) +{ + for (HTMLOptions::const_iterator optionIt = options.begin(); optionIt != options.end(); + ++optionIt) + { + if (optionIt->GetToken() == HtmlOptionId::WIDTH) + { + //const OUString& value = optionIt->GetString(); + //TODO: Which conversion is required? + return 1000; + } + } + return 1000; +} +void SdrTableHTMLParser::ProcToken(HtmlImportInfo* pInfo) +{ + HTMLParser* pHtmlParser = static_cast<HTMLParser*>(pInfo->pParser); + const HTMLOptions& options = pHtmlParser->GetOptions(); + switch (pInfo->nToken) + { + case HtmlTokenId::TABLE_ON: + maDefaultList.clear(); + mnLastToken = pInfo->nToken; + maLastEdge = maColumnEdges.begin(); + mnLastEdge = 0; + break; + case HtmlTokenId::TABLE_OFF: + break; + case HtmlTokenId::TABLEHEADER_ON: + case HtmlTokenId::TABLEDATA_ON: + { + ++mnCellInRow; + DBG_ASSERT(mpActDefault, "TABLEDATA_OFF: pActDefault==0"); + RowColSpan aRowColSpan = lcl_GetRowColSpan(options); + mpActDefault->mnColSpan = aRowColSpan.mnColSpan; + mpActDefault->mnRowSpan = aRowColSpan.mnRowSpan; + mnCellStartPara = pInfo->aSelection.start.nPara; + } + break; + case HtmlTokenId::TABLEDATA_OFF: + case HtmlTokenId::TABLEHEADER_OFF: + { + DBG_ASSERT(mpActDefault, "TABLEDATA_OFF: pActDefault==0"); + if (mbNewDef || !mpActDefault) + NewCellRow(); + if (!mpActDefault) + mpActDefault = mpInsDefault.get(); + if (mpActDefault->mnColSpan > 0) + { + mpActDefault->mnCellX = maColumnEdges[mnCellInRow + mpActDefault->mnColSpan - 1]; + InsertCell(mnCellStartPara, pInfo->aSelection.end.nPara); + } + NextColumn(); + mnLastToken = pInfo->nToken; + } + break; + case HtmlTokenId::TABLEROW_ON: + mbNewDef = true; + NewCellRow(); + mnLastToken = pInfo->nToken; + break; + case HtmlTokenId::TABLEROW_OFF: + { + NextRow(); + mnCellInRow = -1; + mnLastToken = pInfo->nToken; + } + break; + case HtmlTokenId::COL_ON: + { + std::shared_ptr<HTMLCellDefault> pDefault(mpInsDefault.release()); + maDefaultList.push_back(pDefault); + + const sal_Int32 nSize = lcl_GetWidth(options) + mnLastEdge; + if (nSize > mnLastEdge) + InsertColumnEdge(nSize); + + mpInsDefault.reset(new HTMLCellDefault()); + mnLastEdge = nSize; + mnLastToken = pInfo->nToken; + } + break; + case HtmlTokenId::COL_OFF: + break; + + default: + break; + } +} + +void ImportAsHTML(SvStream& rStream, SdrTableObj& rObj) +{ + SdrTableHTMLParser aParser(rObj); + aParser.Read(rStream); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index c2e3de7ab144..97c1a74d48fb 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -189,11 +189,11 @@ IMPL_LINK( SdrTableRTFParser, RTFImportHdl, RtfImportInfo&, rInfo, void ) } break; case RtfImportState::End: - if ( rInfo.aSelection.nEndPos ) + if ( rInfo.aSelection.end.nIndex ) { mpActDefault = nullptr; rInfo.nToken = RTF_PAR; - rInfo.aSelection.nEndPara++; + rInfo.aSelection.end.nPara++; ProcToken( &rInfo ); } break; @@ -219,7 +219,7 @@ void SdrTableRTFParser::InsertCell( RtfImportInfo const * pInfo ) RTFCellInfoPtr xCellInfo = std::make_shared<RTFCellInfo>(mrItemPool); xCellInfo->mnStartPara = mnStartPara; - xCellInfo->mnParaCount = pInfo->aSelection.nEndPara - 1 - mnStartPara; + xCellInfo->mnParaCount = pInfo->aSelection.end.nPara - 1 - mnStartPara; xCellInfo->mnCellX = mpActDefault->mnCellX; xCellInfo->mnRowSpan = mpActDefault->mnRowSpan; @@ -254,7 +254,7 @@ void SdrTableRTFParser::InsertCell( RtfImportInfo const * pInfo ) xColumn->push_back( xCellInfo ); } - mnStartPara = pInfo->aSelection.nEndPara - 1; + mnStartPara = pInfo->aSelection.end.nPara - 1; } void SdrTableRTFParser::InsertColumnEdge( sal_Int32 nEdge ) diff --git a/sw/Library_sw_writerfilter.mk b/sw/Library_sw_writerfilter.mk index c48e727a5b85..05d012845191 100644 --- a/sw/Library_sw_writerfilter.mk +++ b/sw/Library_sw_writerfilter.mk @@ -134,6 +134,7 @@ $(eval $(call gb_Library_add_exception_objects,sw_writerfilter,\ sw/source/writerfilter/ooxml/OOXMLParserState \ sw/source/writerfilter/ooxml/OOXMLPropertySet \ sw/source/writerfilter/ooxml/OOXMLStreamImpl \ + sw/source/writerfilter/ooxml/ShadowContext \ )) $(eval $(call gb_Library_add_generated_exception_objects,sw_writerfilter,\ diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index 9bf26880c01f..9c33b3bfd2c3 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -137,6 +137,10 @@ enum class DocumentSettingId USE_VARIABLE_WIDTH_NBSP, // overlap background shapes if anchored in body PAINT_HELL_OVER_HEADER_FOOTER, + // tdf#155229 calculate minimum row height including horizontal border width + MIN_ROW_HEIGHT_INCL_BORDER, + // tdf#161233 pictures with wrap polygon should not be clipped + NO_CLIPPING_WITH_WRAP_POLYGON, }; /** Provides access to settings of a document diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx index 04b7efa22141..ae0098058635 100644 --- a/sw/inc/IMark.hxx +++ b/sw/inc/IMark.hxx @@ -106,6 +106,7 @@ namespace sw::mark virtual OUString GetContent() const { return OUString(); } virtual void ReplaceContent(const OUString& /*sNewContent*/) {} + virtual bool HasDefaultContent() const = 0; private: IFieldmark(IFieldmark const &) = delete; IFieldmark &operator =(IFieldmark const&) = delete; diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 751fa43eb20c..f9fcff11575e 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -811,6 +811,7 @@ public: SW_DLLPUBLIC bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset = true, const bool bResetListAttrs = false, + const bool bResetAllCharAttrs = false, SwRootFrame const* pLayout = nullptr); SwTextFormatColl* FindTextFormatCollByName( const OUString& rName ) const { return mpTextFormatCollTable->FindFormatByName(rName); } diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 0de62a1d27de..0e9d8064901b 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -335,7 +335,9 @@ public: // #i62675# /// Add 2nd optional parameter <bResetListAttrs> - see also <SwDoc::SetTextFormatColl(..)> - SW_DLLPUBLIC void SetTextFormatColl(SwTextFormatColl*, const bool bResetListAttrs = false); + SW_DLLPUBLIC void SetTextFormatColl(SwTextFormatColl*, + const bool bResetListAttrs = false, + SetAttrMode nMode = SetAttrMode::DEFAULT); SW_DLLPUBLIC SwTextFormatColl *MakeTextFormatColl(const OUString &rFormatCollName, SwTextFormatColl *pDerivedFrom = nullptr); void FillByEx(SwTextFormatColl*); diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index c77e91a89371..1a8cd3801f61 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -828,6 +828,7 @@ public: void RemoveFromListRLHidden(); void RemoveFromListOrig(); bool IsInList() const; + bool IsInListFromStyle() const; bool IsFirstOfNumRule(SwRootFrame const& rLayout) const; diff --git a/sw/inc/pagepreviewlayout.hxx b/sw/inc/pagepreviewlayout.hxx index d2af5f846ea1..7a6bccc65555 100644 --- a/sw/inc/pagepreviewlayout.hxx +++ b/sw/inc/pagepreviewlayout.hxx @@ -296,6 +296,12 @@ public: mnSelectedPageNum = _nSelectedPageNum; } + /** get the maximal preview pages */ + sal_uInt16 GetMaxPreviewPages() const + { + return mnPages; + } + /** paint prepared preview @param _aOutRect diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index 2a528403f2a4..f692dc91a0b1 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -151,11 +151,13 @@ enum class SetAttrMode /// for Undo, translated to SwInsertFlags::NOHINTEXPAND NOHINTEXPAND = 0x0100, /// don't change the cursor position - NO_CURSOR_CHANGE = 0x0200 + NO_CURSOR_CHANGE = 0x0200, + // remove all char attributes and char styles when para/char styles are applied + REMOVE_ALL_ATTR = 0x0400 }; namespace o3tl { - template<> struct typed_flags<SetAttrMode> : is_typed_flags<SetAttrMode, 0x3ff> {}; + template<> struct typed_flags<SetAttrMode> : is_typed_flags<SetAttrMode, 0x7ff> {}; } namespace sw { diff --git a/sw/qa/core/layout/flycnt.cxx b/sw/qa/core/layout/flycnt.cxx index 397a67eb135b..3e9fcb981125 100644 --- a/sw/qa/core/layout/flycnt.cxx +++ b/sw/qa/core/layout/flycnt.cxx @@ -450,10 +450,10 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyWidow) SwFrame* pTab2 = pPage2Fly->GetLower(); SwFrame* pRow2 = pTab2->GetLower(); // Without the accompanying fix in place, this test would have failed with: - // - Expected: 1014 + // - Expected: 1029 // - Actual : 553 - // i.e. <w:trHeight w:val="1014"> from the file was ignored. - CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(1014), pRow2->getFrameArea().Height()); + // i.e. <w:trHeight w:val="1029"> from the file was ignored + CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(1029), pRow2->getFrameArea().Height()); SwFrame* pCell2 = pRow2->GetLower(); auto pText2 = dynamic_cast<SwTextFrame*>(pCell2->GetLower()); // And then similarly this was 1, not 2. diff --git a/sw/qa/extras/layout/data/tdf152839_firstrows.rtf b/sw/qa/extras/layout/data/tdf152839_firstrows.rtf new file mode 100644 index 000000000000..477b8166602b --- /dev/null +++ b/sw/qa/extras/layout/data/tdf152839_firstrows.rtf @@ -0,0 +1,253 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1031\deflangfe1041\themelang3079\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f48\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Segoe UI;}
+{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\f1354\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\f1355\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}
+{\f1357\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\f1358\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}
+{\f1359\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\f1360\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}
+{\f1361\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\f1362\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\f1694\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}
+{\f1695\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f1697\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f1698\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f1701\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
+{\f1702\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f1834\fbidi \fswiss\fcharset238\fprq2 Segoe UI CE;}{\f1835\fbidi \fswiss\fcharset204\fprq2 Segoe UI Cyr;}{\f1837\fbidi \fswiss\fcharset161\fprq2 Segoe UI Greek;}
+{\f1838\fbidi \fswiss\fcharset162\fprq2 Segoe UI Tur;}{\f1839\fbidi \fswiss\fcharset177\fprq2 Segoe UI (Hebrew);}{\f1840\fbidi \fswiss\fcharset178\fprq2 Segoe UI (Arabic);}{\f1841\fbidi \fswiss\fcharset186\fprq2 Segoe UI Baltic;}
+{\f1842\fbidi \fswiss\fcharset163\fprq2 Segoe UI (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}
+{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}
+{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}
+{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}
+{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}
+{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}
+{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}
+{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}
+{\fhimajor\f31528\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\fhimajor\f31529\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;}{\fhimajor\f31531\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;}
+{\fhimajor\f31532\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;}{\fhimajor\f31533\fbidi \fswiss\fcharset177\fprq2 Calibri Light (Hebrew);}{\fhimajor\f31534\fbidi \fswiss\fcharset178\fprq2 Calibri Light (Arabic);}
+{\fhimajor\f31535\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;}{\fhimajor\f31536\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}
+{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}
+{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}
+{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
+{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31573\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}
+{\fhiminor\f31574\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
+{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}
+{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}
+{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}
+{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}}{\colortbl;\red0\green0\blue0;
+\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;
+\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green0\blue0;\red0\green0\blue0;}{\*\defchp \fs22 }{\*\defpap \ql \li0\ri0\sa160\sl259\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0
+\fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\sb120\sa120\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs32\alang1025
+\ltrch\fcs0 \fs32\lang1031\langfe3079\cgrid\langnp1031\langfenp3079 \sbasedon0 \snext0 \slink15 \sqformat \styrsid12458106 heading 1;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa160\sl259\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1031\langfe1041\cgrid\langnp1031\langfenp1041 \snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive \rtlch\fcs1
+\ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 \'dcberschrift 1 Zchn;}{\s16\ql \li0\ri0\widctlpar\brdrt\brdrs\brdrw10\brsp20 \brdrl\brdrs\brdrw10\brsp80 \brdrb
+\brdrs\brdrw10\brsp20 \brdrr\brdrs\brdrw10\brsp80 \wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\cf6\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon0 \snext0
+BausteinName;}{\s17\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ai\af0\afs20\alang1025 \ltrch\fcs0 \i\fs20\cf10\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon0 \snext0 Kommentar;}{
+\s18\ql \li0\ri0\widctlpar\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon0 \snext18 \slink19 header;}{\*
+\cs19 \additive \rtlch\fcs1 \af0\afs26 \ltrch\fcs0 \fs26 \sbasedon10 \slink18 \slocked \ssemihidden Kopfzeile Zchn;}{\s20\ql \li0\ri0\widctlpar\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
+\af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon0 \snext20 \slink21 footer;}{\*\cs21 \additive \rtlch\fcs1 \af0\afs26 \ltrch\fcs0 \fs26 \sbasedon10 \slink20 \slocked \ssemihidden Fu\'dfzeile Zchn;}{
+\s22\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af48\afs18\alang1025 \ltrch\fcs0 \f48\fs18\lang3079\langfe3079\cgrid\langnp3079\langfenp3079
+\sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid477296 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \f48\fs18 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid477296 Sprechblasentext Zchn;}}{\*\rsidtbl \rsid25915
+\rsid141657\rsid162930\rsid337940\rsid468624\rsid477296\rsid538180\rsid734395\rsid882106\rsid1008931\rsid1116736\rsid1131385\rsid1186002\rsid1378358\rsid1457463\rsid1458675\rsid1463711\rsid1576598\rsid1643320\rsid1733725\rsid2233523\rsid2237796
+\rsid2239019\rsid2294971\rsid2363667\rsid2580829\rsid3020432\rsid3151009\rsid3230690\rsid3676125\rsid4327642\rsid4655589\rsid4939037\rsid5118193\rsid5398017\rsid5587896\rsid5841343\rsid5984835\rsid6555207\rsid6701627\rsid6712741\rsid6831792\rsid7089764
+\rsid7152567\rsid7290328\rsid7496291\rsid7549106\rsid7606353\rsid7810231\rsid7872350\rsid8015286\rsid8078336\rsid8148054\rsid8479968\rsid8534386\rsid8608751\rsid8983466\rsid9060380\rsid9242023\rsid9322053\rsid9402351\rsid9595908\rsid10161122\rsid10238746
+\rsid10242283\rsid10557518\rsid10896052\rsid10964931\rsid11037801\rsid11081007\rsid11094885\rsid11283431\rsid11344075\rsid11424229\rsid11499115\rsid11690788\rsid11871934\rsid11893049\rsid11947419\rsid12262926\rsid12458106\rsid12652382\rsid12928601
+\rsid12986890\rsid12999067\rsid13055997\rsid13110340\rsid13254002\rsid13255087\rsid13305316\rsid13334452\rsid13516935\rsid14315527\rsid14378587\rsid14563127\rsid14580302\rsid14632582\rsid14708412\rsid14823218\rsid14964844\rsid15622987\rsid15626663
+\rsid15745522\rsid16274659\rsid16606131}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\subject asdf}{\author Oliver Specht}{\operator Oliver Specht}
+{\creatim\yr2024\mo11\dy20\hr8\min57}{\revtim\yr2024\mo11\dy20\hr8\min57}{\printim\yr2022\mo10\dy11\hr12\min16}{\version2}{\edmins0}{\nofpages1}{\nofwords4}{\nofchars27}{\*\company BMLV}{\nofcharsws30}{\vern107}}{\*\userprops {\propname KPH_Enabled}
+\proptype30{\staticval 0}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw16840\paperh11907\margl1134\margr1418\margt567\margb567\gutter0\ltrsect
+\deftab709\widowctrl\ftnbj\aenddoc\hyphhotz425\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0
+\showxmlerrors0\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace130\dgvspace180\dghorigin1134\dgvorigin567\dghshow0\dgvshow0
+\jexpand\viewkind1\viewscale180\pgbrdrhead\pgbrdrfoot\nolnhtadjtbl\nojkernpunct\rsidroot4655589 \fet0{\*\wgrffmtfilter 013f}\ilfomacatclnup0{\*\template C:\\Users\\x2mf\\AppData\\Roaming\\Microsoft\\Templates\\kis.3.0.dot}
+{\*\docvar {DKE_SBGeschlecht}{[SBGeschlecht]}}{\*\docvar {KPH_Genehmiger}{[Genehmiger]}}{\*\docvar {KPH_Gesch\'e4ftszahl}{[Gesch\'e4ftszahl]}}{\*\docvar {KPH_Sachbearbeiter}{[Sachbearbeiter]}}{\*\docvar {KPH_SBeMail}{[SB_eMail]}}
+{\*\docvar {KPH_SBFax}{[SB_Fax]}}{\*\docvar {KPH_SBIFMIN}{SBIFMIN}}{\*\docvar {KPH_SBTelefon}{[SB_Telefon]}}{\*\ftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
+\af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid162930 \chftnsep
+\par }}{\*\ftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0
+\ltrch\fcs0 \insrsid162930 \chftnsepc
+\par }}{\*\aftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0
+\ltrch\fcs0 \insrsid162930 \chftnsep
+\par }}{\*\aftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0
+\ltrch\fcs0 \insrsid162930 \chftnsepc
+\par }}\ltrpar \sectd \ltrsect\lndscpsxn\binfsxn4\binsxn4\psz9\linex0\headery567\footery567\endnhere\sectlinegrid354\sectdefaultcl\sectrsid8078336\sftnbj {\headerl \ltrpar \pard\plain \ltrpar\s18\ql \li0\ri0\widctlpar
+\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6701627
+\par }}{\headerr \ltrpar \pard\plain \ltrpar\s18\ql \li0\ri0\widctlpar\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {
+\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6701627
+\par }}{\footerl \ltrpar \pard\plain \ltrpar\s20\ql \li0\ri0\widctlpar\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {
+\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6701627
+\par }}{\footerr \ltrpar \pard\plain \ltrpar\s20\ql \li0\ri0\widctlpar\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid6701627 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0
+\fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12458106\charrsid6701627
+\par }}{\headerf \ltrpar \pard\plain \ltrpar\s18\ql \li0\ri0\widctlpar\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {
+\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6701627
+\par }}{\footerf \ltrpar \pard\plain \ltrpar\s20\ql \li0\ri0\widctlpar\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {
+\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6701627
+\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}
+{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8
+\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri-1\widctlpar
+\tqr\tx14317\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin-1\lin0\itap0\pararsid12458106 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
+\v\fs18\insrsid11037801\charrsid5118193 \line }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \v\fs18\insrsid11283431\charrsid5118193 \line \line \line }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \v\fs18\cf1\insrsid5118193\charrsid5118193 \line }{\rtlch\fcs1 \ab\af0\afs2
+\ltrch\fcs0 \b\fs2\insrsid12458106\charrsid3020432
+\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts11\trgaph70\trleft-70\trkeep\trftsWidth3\trwWidth14240\trftsWidthB3\trftsWidthA3\trwWidthA11405\trpaddl70\trpaddr70\trpaddfl3\trpaddfr3\tblrsid1131385\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl
+\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth2835\clshdrawnil \cellx2765\pard \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\pararsid1458675 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
+\fs18\insrsid2237796 \cell }\pard \ltrpar\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid2237796 \trowd \irow0\irowband0\ltrrow
+\ts11\trgaph70\trleft-70\trkeep\trftsWidth3\trwWidth14240\trftsWidthB3\trftsWidthA3\trwWidthA11405\trpaddl70\trpaddr70\trpaddfl3\trpaddfr3\tblrsid1131385\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl
+\cltxlrtb\clftsWidth3\clwWidth2835\clshdrawnil \cellx2765\row \ltrrow}\trowd \irow1\irowband1\lastrow \ltrrow
+\ts11\trgaph70\trleft-70\trkeep\trftsWidth3\trwWidth14240\trftsWidthB3\trftsWidthA3\trpaddl70\trpaddr70\trpaddfl3\trpaddfr3\tblrsid13110340\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw45 \clbrdrl\brdrs\brdrw45 \clbrdrb\brdrs\brdrw45 \clbrdrr
+\brdrs\brdrw45 \cltxlrtb\clftsWidth3\clwWidth14240\clshdrawnil \cellx14170\pard \ltrpar\ql \li0\ri0\sb120\sa120\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\pararsid1458675 {\rtlch\fcs1 \af0\afs72 \ltrch\fcs0
+\fs72\lang1024\langfe1024\noproof\langnp1040\insrsid5587896 MUSTERMANN Max}{\rtlch\fcs1 \af0\afs72 \ltrch\fcs0 \fs72\lang1040\langfe3079\langnp1040\insrsid2237796\charrsid14823218 \cell }\pard \ltrpar\ql \li0\ri0\sa160\sl259\slmult1
+\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af0\afs72 \ltrch\fcs0 \fs72\lang1040\langfe3079\langnp1040\insrsid2237796\charrsid14823218 \trowd \irow1\irowband1\lastrow \ltrrow
+\ts11\trgaph70\trleft-70\trkeep\trftsWidth3\trwWidth14240\trftsWidthB3\trftsWidthA3\trpaddl70\trpaddr70\trpaddfl3\trpaddfr3\tblrsid13110340\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw45 \clbrdrl\brdrs\brdrw45 \clbrdrb\brdrs\brdrw45 \clbrdrr
+\brdrs\brdrw45 \cltxlrtb\clftsWidth3\clwWidth14240\clshdrawnil \cellx14170\row }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1131385 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
+\v\fs18\insrsid13255087\charrsid13255087 \line \line \line \line \line }{\rtlch\fcs1 \af0 \ltrch\fcs0 \v\lang1024\langfe1024\noproof\insrsid2237796\charrsid13255087
+\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
+9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
+5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
+b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
+0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
+a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
+c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
+0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
+a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
+6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
+4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
+4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100937e00e7ca060000891a0000160000007468656d652f7468656d652f
+7468656d65312e786d6cec595b8bdb46147e2ff43f08bd3bbe49be2cf1065bb69336bb49889d943cceda636bb2238dd18c776342a0244f7d2914d2d28706fad6
+87521a68a0a12ffd310b1bdaf447f4cc489667ec71f6420aa1640d8b34face996fce39face48ba7aed51449d239c70c2e2965bbe52721d1c8fd898c4d3967b6f
+d82f345c870b148f1165316eb90bccdd6bbb9f7e7215ed881047d801fb98efa0961b0a31db2916f9088611bfc26638866b13964448c069322d8e13740c7e235a
+ac944ab5628448ec3a318ac0ededc9848cb0bbbb74dba3e03b165c0e8c6832904ef126767c589608bee0014d9c23445b2ecc3066c743fc48b80e455cc085965b
+527f6e71f76a11ed6446546cb1d5ecfaea2fb3cb0cc687153567323dc827f53cdfabb573ff0a40c526ae57efd57ab5dc9f02a0d108569a72d17dfa9d66a7eb67
+580d941e5a7c77ebdd6ad9c06bfeab1b9cdbbefc1978054afd7b1bf87e3f80281a78054af1fe06def3ea95c033f00a94e26b1bf87aa9ddf5ea065e81424ae2c3
+0d74c9af5583e56a73c884d11b5678d3f7faf54ae67c85826ac8ab4b4e3161b1d8566b117ac8923e002490224162472c6678824650bf01a2e42021ce1e998650
+783314330ec3a54aa95faac27ff9f3d4918a08dac148b396bc8009df18927c1c3e4ac84cb4dccfc1abab414e5fbf3e79faeae4e9ef27cf9e9d3cfd359b5bb932
+ec6ea078aadbbdfde99b7f5e7ce9fcfddb8f6f9f7f9b4ebd8ee73afecd2f5fbdf9e3cf77b98715af4271faddcb37af5e9e7efff55f3f3fb7786f27e840870f49
+84b9730b1f3b7759040bb4f0c707c9c52c862122ba453b9e721423398bc57f4f8406fad6025164c175b019c7fb09488d0d787dfed0203c0893b920168f37c3c8
+00ee33463b2cb146e1a69c4b0bf3701e4fed9327731d7717a123dbdc018a8d2cf7e633d05862731984d8a07987a258a0298eb170e4357688b165750f0831e2ba
+4f4609e36c229c07c4e920620dc9901c18d5b432ba4122c8cbc24610f26dc466ffbed361d4b6ea2e3e3291706f206a213fc4d408e375341728b2b91ca288ea01
+df4322b4911c2c92918eeb7101999e62ca9cde18736eb3b99dc07ab5a4df0499b1a77d9f2e221399087268f3b98718d3915d761884289ad9b00312873af6337e
+08258a9c3b4cd8e0fbccbc43e439e401c55bd37d9f6023dd67abc13d50589dd2aa40e4957962c9e575cc8cfa1d2ce804612535d0000c5d8f487ca6c8afc9bbff
+dfc93b88e8e90f2f2c2b7a3f926e776ce4e38262de4e88f56ebab126e1db70ebc21db0644c3e7cddeea2797c07c3adb2d9bc3ecaf647d976fff7b2bded7e7eff
+62bdd267906eb96d4db7eb6af31e6dddbb4f08a503b1a0788fabed3b87ae34eec3a0b4534fac387f969b857028ef6498c0c04d13a46c9c84892f880807219ac1
+1ebfec4a27539eb99e7267c6386cfdd5b0d5b7c4d379b4cfc6e9236bb92c1f4f53f1e048acc64b7e3e0e8f1b2245d7eaabc7b0dcbd623b558fcb4b02d2f62224
+b4c94c12550b89fa725006493d9c43d02c24d4cade0b8ba6854543ba5fa66a830550cbb302db2607365b2dd7f7c0048ce0a90a513c96794a53bdccae4ae6fbcc
+f4b6601a15007b886505ac32dd945cb72e4fae2e2db57364da20a1959b49424546f5301ea231ceaa538e9e87c64573dd5ca5d4a02743a1e683d25ad1a837dec5
+e2b2b906bb756da0b1ae1434768e5b6eadea43c98cd0ace54ee0d11f0ea319d40e97db5d44a7f0e66c2492f486bf8cb2cc122eba888769c095e8a46a10118113
+8792a8e5cae5e769a0b1d210c5ad5c0141f860c93541563e3472907433c97832c123a1a75d1b91914e4f41e153adb05e55e697074b4b3687740fc2f1b17340e7
+c95d0425e6d7cb328063c2e10d50398de698c02bcd5cc856f5b7d69832d9d5df29aa1a4ac7119d8528eb28ba98a77025e5391d7596c7403bcbd60c01d5429235
+c283a96cb07a508d6e9a778d94c3d6ae7bb6918c9c269aab9e69a88aec9a7615336658b681b5585eaec96bac9621064dd33b7c2addeb92db5c6addda3e21ef12
+10f03c7e96ae7b8e86a0515b4d6650938c3765586a76366af68ee502cfa0769e26a1a97e6de9762d6e798fb04e078397eafc60b75eb5303459ee2b55a4d5570f
+fdf3043b7808e2d18517c1732ab84a257c7c48106c88066a4f92ca06dc228f44766bc091334f48cb7d5cf2db5e50f18342a9e1f70a5ed52b151a7ebb5a68fb7e
+b5dcf3cba56ea7f2041a8b08a3b29f7e71e9c36b28bac8bebba8f18d6f2fd1f24ddb95118b8a4c7d5b292ae2eadb4bb962f9f6e20ce52716d721203a8f6b957e
+b3daecd40acd6abb5ff0ba9d46a119d43a856e2da877fbddc06f34fb4f5ce74881bd7635f06abd46a1560e8282572b49fa8d66a1ee552a6dafde6ef4bcf6936c
+1b032b4fe5238b058457f1dafd170000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f7468656d652f5f72
+656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c08
+2e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd0
+8a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa
+4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c0200001300000000000000000000000000000000005b436f
+6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000000000300100005f72
+656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000190200007468656d652f746865
+6d652f7468656d654d616e616765722e786d6c504b01022d0014000600080000002100937e00e7ca060000891a00001600000000000000000000000000d60200
+007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027000000000000000000000000
+00d40900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000cf0a00000000}
+{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
+617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
+6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
+656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
+{\*\latentstyles\lsdstimax376\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;
+\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
+\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;
+\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 1;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 5;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 9;
+\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 1;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 2;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 3;
+\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 4;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 5;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 6;
+\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 7;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 8;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Indent;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 header;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footer;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index heading;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of figures;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope return;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation reference;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 line number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 page number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote text;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of authorities;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 macro;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 toa heading;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 3;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 3;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 3;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 5;\lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Closing;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Signature;\lsdsemihidden1 \lsdunhideused1 \lsdpriority1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 4;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Message Header;\lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Salutation;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Date;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Note Heading;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 3;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Block Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 FollowedHyperlink;\lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;
+\lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Document Map;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Plain Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 E-mail Signature;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Top of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Bottom of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal (Web);\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Acronym;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Cite;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Code;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Definition;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Keyboard;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Preformatted;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Sample;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Typewriter;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Variable;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation subject;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 No List;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 1;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Balloon Text;\lsdpriority39 \lsdlocked0 Table Grid;
+\lsdsemihidden1 \lsdlocked0 Placeholder Text;\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdpriority60 \lsdlocked0 Light Shading;\lsdpriority61 \lsdlocked0 Light List;\lsdpriority62 \lsdlocked0 Light Grid;
+\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdpriority65 \lsdlocked0 Medium List 1;\lsdpriority66 \lsdlocked0 Medium List 2;\lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdpriority68 \lsdlocked0 Medium Grid 2;
+\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List;\lsdpriority71 \lsdlocked0 Colorful Shading;\lsdpriority72 \lsdlocked0 Colorful List;\lsdpriority73 \lsdlocked0 Colorful Grid;\lsdpriority60 \lsdlocked0 Light Shading Accent 1;
+\lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;
+\lsdsemihidden1 \lsdlocked0 Revision;\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdpriority62 \lsdlocked0 Light Grid Accent 2;
+\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdpriority62 \lsdlocked0 Light Grid Accent 3;
+\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdpriority62 \lsdlocked0 Light Grid Accent 4;
+\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdpriority62 \lsdlocked0 Light Grid Accent 5;
+\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6;
+\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
+\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography;
+\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4;
+\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4;
+\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1;
+\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1;
+\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2;
+\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2;
+\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3;
+\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4;
+\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4;
+\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5;
+\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5;
+\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6;
+\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6;
+\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark;
+\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1;
+\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1;
+\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2;
+\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3;
+\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3;
+\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4;
+\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4;
+\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5;
+\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5;
+\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6;
+\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Unresolved Mention;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Link;}}{\*\datastore 01050000
+02000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
+d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000f058
+85d4213bdb01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
+000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000105000000000000}}
\ No newline at end of file diff --git a/sw/qa/extras/layout/data/tdf155229_row_height_at_least.docx b/sw/qa/extras/layout/data/tdf155229_row_height_at_least.docx Binary files differnew file mode 100644 index 000000000000..a42031a41f5b --- /dev/null +++ b/sw/qa/extras/layout/data/tdf155229_row_height_at_least.docx diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index 76193ed031fd..27d4e8cd3222 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -3720,6 +3720,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf146081) CPPUNIT_ASSERT_EQUAL(nTotalHeight, nHeight1 * 4); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf155229RowAtLeast) +{ + createSwDoc("tdf155229_row_height_at_least.docx"); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + sal_Int32 nTableHeight + = getXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[11]/infos/bounds"_ostr, "bottom"_ostr) + .toInt32(); + + // Without the fix, this was Actual : 14174 + CPPUNIT_ASSERT_EQUAL(sal_Int32(15494), nTableHeight); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf157829LTR) { // Verify that line breaking inside a bidi portion triggers underflow to previous bidi portions @@ -3873,6 +3886,17 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf163285) CPPUNIT_ASSERT(topText3.startsWith("pg_3")); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf152839_firstRows) +{ + createSwDoc("tdf152839_firstrows.rtf"); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + sal_Int32 nHeight + = getXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[2]/txt/infos/bounds", "height") + .toInt32(); + CPPUNIT_ASSERT_LESSEQUAL(sal_Int32(230), nHeight); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/ooxmlexport/data/tdf164065.docx b/sw/qa/extras/ooxmlexport/data/tdf164065.docx Binary files differnew file mode 100644 index 000000000000..b66a6cdb2da4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf164065.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index 41c3061fb8e7..f846a248022d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -16,6 +16,7 @@ #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/XDocumentIndex.hpp> #include <com/sun/star/text/XTextTable.hpp> +#include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/style/LineSpacing.hpp> #include <com/sun/star/style/LineSpacingMode.hpp> @@ -875,6 +876,20 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146269) } } +CPPUNIT_TEST_FIXTURE(Test, testTdf164065) +{ + loadAndSave("tdf164065.docx"); + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); + uno::Reference<table::XCellRange> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XText> xCell(xTable->getCellByPosition(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(u"a"_ustr, xCell->getString()); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/rtfexport/data/tdf161878.rtf b/sw/qa/extras/rtfexport/data/tdf161878.rtf new file mode 100755 index 000000000000..a669f477b7e0 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf161878.rtf @@ -0,0 +1,229 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang3079\deflangfe3079\themelang3079\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New{\*\falt Times New Roman};}{\f3\fbidi \froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol{\*\falt Times New Roman};}
+{\f10\fbidi \fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Mangal{\*\falt Times New Roman};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
+{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\f41\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\f42\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\f44\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\f45\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\f46\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\f47\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\f48\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\f49\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\f61\fbidi \fmodern\fcharset238\fprq1 Courier New CE{\*\falt Times New Roman};}{\f62\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr{\*\falt Times New Roman};}
+{\f64\fbidi \fmodern\fcharset161\fprq1 Courier New Greek{\*\falt Times New Roman};}{\f65\fbidi \fmodern\fcharset162\fprq1 Courier New Tur{\*\falt Times New Roman};}{\f66\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew){\*\falt Times New Roman};}
+{\f67\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic){\*\falt Times New Roman};}{\f68\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic{\*\falt Times New Roman};}
+{\f69\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese){\*\falt Times New Roman};}{\f381\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f382\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}
+{\f384\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f385\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f388\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f389\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}
+{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}
+{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}
+{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}
+{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}
+{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}
+{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}
+{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}
+{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}
+{\fhimajor\f31528\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\fhimajor\f31529\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;}{\fhimajor\f31531\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;}
+{\fhimajor\f31532\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;}{\fhimajor\f31533\fbidi \fswiss\fcharset177\fprq2 Calibri Light (Hebrew);}{\fhimajor\f31534\fbidi \fswiss\fcharset178\fprq2 Calibri Light (Arabic);}
+{\fhimajor\f31535\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;}{\fhimajor\f31536\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}
+{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}
+{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}
+{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
+{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31573\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}
+{\fhiminor\f31574\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
+{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}
+{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}
+{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}
+{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}}{\colortbl;\red0\green0\blue0;
+\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;
+\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red153\green0\blue0;}{\*\defchp \fs22 }{\*\defpap \ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }
+\noqfpromote {\stylesheet{\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079
+\snext0 \sqformat \spriority0 \styrsid9702153 Normal;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa160\sl259\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \snext11 \ssemihidden \sunhideused Normal Table;}{\s15\ql \li0\ri0\widctlpar
+\tx3402\tx6237\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs28\alang1025 \ltrch\fcs0 \fs28\lang1031\langfe3079\cgrid\langnp1031\langfenp3079 \sbasedon0 \snext15 \slink16 \styrsid9702153 Body Text;}{\*\cs16 \additive
+\rtlch\fcs1 \af0\afs26 \ltrch\fcs0 \fs26 \sbasedon10 \slink15 \slocked \ssemihidden Textk\'f6rper Zchn;}{\*\cs17 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \cf17 \sbasedon10 \styrsid9702153 t1;}{\s18\ql \li567\ri0\sa120\widctlpar
+\tx1985\tx5245\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin567\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1031\langfe3079\cgrid\langnp1031\langfenp3079 \sbasedon0 \snext18 \styrsid9702153 Anschrift;}{\*\ts19\tsrowd\trbrdrt
+\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
+\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
+\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon11 \snext19 \styrsid9702153 Table Grid;}{
+\s20\ql \li0\ri0\widctlpar\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079
+\sbasedon0 \snext20 \slink21 \styrsid4073588 header;}{\*\cs21 \additive \rtlch\fcs1 \af0\afs26 \ltrch\fcs0 \fs26 \sbasedon10 \slink20 \slocked \ssemihidden Kopfzeile Zchn;}{\s22\ql \li0\ri0\widctlpar
+\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon0 \snext22 \slink23 \styrsid4073588 footer;}{\*\cs23
+\additive \rtlch\fcs1 \af0\afs26 \ltrch\fcs0 \fs26 \sbasedon10 \slink22 \slocked \ssemihidden Fu\'dfzeile Zchn;}{\*\cs24 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \styrsid4073588 page number;}}{\*\listtable{\list\listtemplateid67567617\listsimple
+\listrestarthdn{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid57362157}
+{\list\listtemplateid-322418280\listhybrid\listrestarthdn{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}
+\f3\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0
+\fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160
+\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880
+\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3600
+\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320
+\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040
+\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760
+\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480
+\jclisttab\tx6480\lin6480 }{\listname ;}\listid64454043}{\list\listtemplateid-1072637736\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345
+\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li788\jclisttab\tx788\lin788 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347
+\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1508\jclisttab\tx1508\lin1508 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2228\jclisttab\tx2228\lin2228 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345
+\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2948\jclisttab\tx2948\lin2948 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347
+\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3668\jclisttab\tx3668\lin3668 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4388\jclisttab\tx4388\lin4388 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345
+\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5108\jclisttab\tx5108\lin5108 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347
+\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5828\jclisttab\tx5828\lin5828 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6548\jclisttab\tx6548\lin6548 }{\listname ;}\listid78601234}{\list\listtemplateid67567617\listsimple\listrestarthdn{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid259532448}{\list\listtemplateid67567617\listsimple\listrestarthdn{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid334236502}{\list\listtemplateid-1221033502
+\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0
+\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid342049731}{\list\listtemplateid456700398\listhybrid\listrestarthdn{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace0\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0
+\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
+\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
+\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
+\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid201785349
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid397555505}{\list\listtemplateid-1539556608\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0
+\levelspace68\levelindent0{\leveltext\leveltemplateid1777919490\'01\u-3988 ?;}{\levelnumbers;}\fs16\loch\af10\hich\af10\dbch\af0\fbias0\hres0\chhres0 \fi-360\li428\jclisttab\tx428\lin428 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1148\jclisttab\tx1148\lin1148 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li1868\jclisttab\tx1868\lin1868 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2588\jclisttab\tx2588\lin2588 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3308\jclisttab\tx3308\lin3308 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4028\jclisttab\tx4028\lin4028 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li4748\jclisttab\tx4748\lin4748 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5468\jclisttab\tx5468\lin5468 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6188\jclisttab\tx6188\lin6188 }{\listname ;}\listid559905662}{\list\listtemplateid67567617
+\listsimple\listrestarthdn{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname
+;}\listid571039764}{\list\listtemplateid176863268\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid585903656\'01\u-3988 ?;}{\levelnumbers;}
+\fs16\loch\af10\hich\af10\dbch\af0\fbias0\hres0\chhres0 \fi-360\li541\jclisttab\tx541\lin541 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785347
+\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1261\jclisttab\tx1261\lin1261 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785349
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li1981\jclisttab\tx1981\lin1981 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785345
+\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2701\jclisttab\tx2701\lin2701 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785347
+\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3421\jclisttab\tx3421\lin3421 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785349
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4141\jclisttab\tx4141\lin4141 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785345
+\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li4861\jclisttab\tx4861\lin4861 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785347
+\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5581\jclisttab\tx5581\lin5581 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785349
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6301\jclisttab\tx6301\lin6301 }{\listname ;}\listid632755922}{\list\listtemplateid-446683134\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
+\levelspace360\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
+\levelspace360\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
+\levelspace360\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
+\levelspace360\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
+\levelspace360\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
+\levelspace360\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
+\levelspace360\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
+\levelspace360\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid639850684}{\list\listtemplateid67567617\listsimple\listrestarthdn
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid768157600}
+{\list\listtemplateid67567617\listsimple\listrestarthdn{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li360
+\jclisttab\tx360\lin360 }{\listname ;}\listid983243959}{\list\listtemplateid532460330\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345
+\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li788\jclisttab\tx788\lin788 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347
+\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1508\jclisttab\tx1508\lin1508 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2228\jclisttab\tx2228\lin2228 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345
+\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2948\jclisttab\tx2948\lin2948 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347
+\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3668\jclisttab\tx3668\lin3668 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4388\jclisttab\tx4388\lin4388 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785345
+\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5108\jclisttab\tx5108\lin5108 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785347
+\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5828\jclisttab\tx5828\lin5828 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid201785349
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6548\jclisttab\tx6548\lin6548 }{\listname ;}\listid1054740754}{\list\listtemplateid-1539556608{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace68
+\levelindent0{\leveltext\'01\u-3988 ?;}{\levelnumbers;}\fs16\loch\af10\hich\af10\dbch\af0\fbias0\hres0\chhres0 \fi-360\li428\jclisttab\tx428\lin428 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1148\jclisttab\tx1148\lin1148 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
+\f10\fbias0\hres0\chhres0 \fi-360\li1868\jclisttab\tx1868\lin1868 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2588
+\jclisttab\tx2588\lin2588 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3308\jclisttab\tx3308\lin3308 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4028\jclisttab\tx4028\lin4028 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li4748\jclisttab\tx4748\lin4748 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0
+\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5468\jclisttab\tx5468\lin5468 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6188\jclisttab\tx6188\lin6188 }{\listname ;}\listid1122191900}{\list\listtemplateid1784469158{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0
+\levelindent0{\leveltext\'01\u-3988 ?;}{\levelnumbers;}\fs16\loch\af10\hich\af10\dbch\af0\fbias0\hres0\chhres0 \fi-360\li428\jclisttab\tx428\lin428 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1148\jclisttab\tx1148\lin1148 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
+\f10\fbias0\hres0\chhres0 \fi-360\li1868\jclisttab\tx1868\lin1868 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2588
+\jclisttab\tx2588\lin2588 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3308\jclisttab\tx3308\lin3308 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4028\jclisttab\tx4028\lin4028 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li4748\jclisttab\tx4748\lin4748 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0
+\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5468\jclisttab\tx5468\lin5468 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
+\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6188\jclisttab\tx6188\lin6188 }{\listname ;}\listid1629126586}{\list\listtemplateid68711450\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0
+\levelspace0\levelindent0{\leveltext\leveltemplateid1659278964\'01\u-3988 ?;}{\levelnumbers;}\fs16\loch\af10\hich\af10\dbch\af0\fbias0\hres0\chhres0 \fi-360\li541\jclisttab\tx541\lin541 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1261\jclisttab\tx1261\lin1261 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li1981\jclisttab\tx1981\lin1981 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2701\jclisttab\tx2701\lin2701 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3421\jclisttab\tx3421\lin3421 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4141\jclisttab\tx4141\lin4141 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785345\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li4861\jclisttab\tx4861\lin4861 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785347\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5581\jclisttab\tx5581\lin5581 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid201785349\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6301\jclisttab\tx6301\lin6301 }{\listname ;}\listid1658000691}{\list\listtemplateid-446683134
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0
+\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext
+\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'01o;}{\levelnumbers;}
+\f2\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320
+\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel
+\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1789886414}}{\*\listoverridetable{\listoverride\listid57362157
+\listoverridecount0\ls1}{\listoverride\listid768157600\listoverridecount0\ls2}{\listoverride\listid259532448\listoverridecount0\ls3}{\listoverride\listid334236502\listoverridecount0\ls4}{\listoverride\listid571039764\listoverridecount0\ls5}
+{\listoverride\listid983243959\listoverridecount0\ls6}{\listoverride\listid64454043\listoverridecount0\ls7}{\listoverride\listid397555505\listoverridecount0\ls8}{\listoverride\listid1054740754\listoverridecount0\ls9}{\listoverride\listid78601234
+\listoverridecount0\ls10}{\listoverride\listid342049731\listoverridecount0\ls11}{\listoverride\listid559905662\listoverridecount0\ls12}{\listoverride\listid1629126586\listoverridecount0\ls13}{\listoverride\listid1122191900\listoverridecount0\ls14}
+{\listoverride\listid639850684\listoverridecount0\ls15}{\listoverride\listid1789886414\listoverridecount0\ls16}{\listoverride\listid1658000691\listoverridecount0\ls17}{\listoverride\listid632755922\listoverridecount0\ls18}}{\*\rsidtbl \rsid13855\rsid19684
+\rsid72872\rsid75391\rsid95851\rsid141180\rsid142383\rsid159375\rsid468936\rsid485762\rsid609275\rsid789151\rsid817791\rsid875945\rsid880456\rsid931731\rsid933271\rsid995031\rsid1053200\rsid1246248\rsid1516451\rsid1523447\rsid1574037\rsid1586344
+\rsid1597812\rsid1600890\rsid1705386\rsid1726724\rsid1795914\rsid1920490\rsid1926647\rsid1927109\rsid2039770\rsid2104771\rsid2125861\rsid2248854\rsid2364651\rsid2446869\rsid2492288\rsid2506024\rsid2562227\rsid2577305\rsid2715624\rsid2844013\rsid2951564
+\rsid2953167\rsid3167611\rsid3174323\rsid3230448\rsid3231768\rsid3239968\rsid3279491\rsid3281241\rsid3367252\rsid3368798\rsid3735833\rsid3744614\rsid3748767\rsid3803319\rsid4005440\rsid4073588\rsid4084059\rsid4135785\rsid4222047\rsid4287624\rsid4329109
+\rsid4395516\rsid4404109\rsid4464373\rsid4537399\rsid4543299\rsid4545169\rsid4719506\rsid4721778\rsid4733816\rsid4745018\rsid4787628\rsid4795220\rsid4857395\rsid4877499\rsid4933904\rsid4945715\rsid5051251\rsid5113954\rsid5445085\rsid5506897\rsid5514354
+\rsid5524949\rsid5592566\rsid5658631\rsid5707700\rsid5970725\rsid5976653\rsid6056234\rsid6180146\rsid6250369\rsid6376522\rsid6500165\rsid6516673\rsid6635845\rsid6779884\rsid6975462\rsid6975959\rsid7152151\rsid7158525\rsid7164947\rsid7215136\rsid7233377
+\rsid7234789\rsid7411861\rsid7421333\rsid7489343\rsid7492014\rsid7602772\rsid7764160\rsid7887638\rsid7998036\rsid8027966\rsid8278579\rsid8408602\rsid8522994\rsid8534193\rsid8722154\rsid9066152\rsid9270855\rsid9371838\rsid9395530\rsid9455016\rsid9636938
+\rsid9647984\rsid9654353\rsid9702153\rsid9775276\rsid9792165\rsid9909722\rsid9927916\rsid9962844\rsid9976475\rsid9982957\rsid10159844\rsid10177050\rsid10247765\rsid10315394\rsid10321696\rsid10385335\rsid10492017\rsid10507512\rsid10617845\rsid10628648
+\rsid10635187\rsid10705086\rsid10759270\rsid10836498\rsid10953314\rsid11210748\rsid11220710\rsid11223591\rsid11272863\rsid11346618\rsid11429257\rsid11469795\rsid11479283\rsid11538388\rsid11550882\rsid11630717\rsid11930187\rsid11995316\rsid12075392
+\rsid12078492\rsid12200975\rsid12270025\rsid12406233\rsid12408560\rsid12545245\rsid12595060\rsid12595908\rsid12662516\rsid12734640\rsid12791691\rsid12804434\rsid12869304\rsid12913614\rsid13048482\rsid13118155\rsid13174688\rsid13203519\rsid13243603
+\rsid13331652\rsid13374885\rsid13390277\rsid13568205\rsid13573775\rsid13728428\rsid13792914\rsid13847925\rsid13855986\rsid13919860\rsid14033830\rsid14056342\rsid14113968\rsid14305938\rsid14307524\rsid14428152\rsid14578133\rsid14633216\rsid14700783
+\rsid14831227\rsid14900426\rsid15073295\rsid15170680\rsid15472998\rsid15474364\rsid15563078\rsid15612504\rsid15673789\rsid15688391\rsid15794819\rsid15931731\rsid15938371\rsid16023536\rsid16136937\rsid16139725\rsid16148250\rsid16347441\rsid16404408
+\rsid16416105\rsid16543851\rsid16598203\rsid16606492\rsid16661478}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator xmwd}{\creatim\yr2014\mo8\dy26\hr14\min3}
+{\revtim\yr2023\mo3\dy7\hr8\min1}{\printim\yr2023\mo1\dy23\hr14\min4}{\version8}{\edmins0}{\nofpages1}{\nofwords118}{\nofchars747}{\nofcharsws864}{\vern107}}{\*\userprops {\propname KPH_Enabled}\proptype30{\staticval 0}}{\*\xmlnstbl {\xmlns1 http://schema
+s.microsoft.com/office/word/2003/wordml}}\paperw11906\paperh16838\margl1134\margr1134\margt1134\margb1134\gutter0\ltrsect
+\deftab709\widowctrl\ftnbj\aenddoc\hyphhotz425\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0
+\showxmlerrors0\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1134\dgvorigin1134\dghshow1\dgvshow1
+\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct\asianbrkrule
+\rsidroot9702153\newtblstyruls\nogrowautofit \fet0{\*\wgrffmtfilter 013f}\ilfomacatclnup0{\*\ftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025
+\ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1926647 \chftnsep
+\par }}{\*\ftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0
+\ltrch\fcs0 \insrsid1926647 \chftnsepc
+\par }}{\*\aftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0
+\ltrch\fcs0 \insrsid1926647 \chftnsep
+\par }}{\*\aftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0
+\ltrch\fcs0 \insrsid1926647 \chftnsepc
+\par }}\ltrpar \sectd \ltrsect\psz9\pgnrestart\linex0\footery567\endnhere\sectlinegrid354\sectdefaultcl\sectrsid13855\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}
+{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}
+{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar
+\qj \fi-357\li538\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin538\itap0\pararsid3367252 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0\afs16 \ltrch\fcs0
+\fs16\insrsid7764160\charrsid11429257 {\field{\*\fldinst SYMBOL 108 \\f "Liberation Serif" \\s 8}{\fldrslt\f10\fs16}}}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\insrsid7764160\charrsid11469795 \tab }
+
+{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0
+\fs24\lang1024\langfe1024\noproof\insrsid7764160\charrsid11469795 IF }{\field{\*\fldinst {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\lang1024\langfe1024\noproof\insrsid7764160\charrsid11469795 REF person.}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0
+\cs17\fs24\cf17\insrsid7764160\charrsid11469795 GESCHLECHT}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\lang1024\langfe1024\noproof\insrsid7764160\charrsid11469795 \\* MERGEFORMAT }}{\fldrslt {\rtlch\fcs1 \ab\af0\afs24 \ltrch\fcs0
+\b\fs24\lang1024\langfe1024\noproof\langnp1031\insrsid13847925 Fehler! Verweisquelle konnte nicht gefunden werden.}}}\sectd \ltrsect\psz9\pgnrestart\linex0\footery567\endnhere\sectlinegrid354\sectdefaultcl\sectrsid13855\sftnbj {\rtlch\fcs1 \af0\afs24
+\ltrch\fcs0 \fs24\lang1024\langfe1024\noproof\insrsid8534193 ="}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\lang1024\langfe1024\noproof\insrsid1053200 W}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\lang1024\langfe1024\noproof\insrsid8534193 " "}{\rtlch\fcs1
+\af0\afs24 \ltrch\fcs0 \fs24\insrsid1053200\charrsid1053200 xxxxxx xxxxxx xxxxxxx xxxxxx xxxxx}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\lang1024\langfe1024\noproof\insrsid3367252
+\par }\pard \ltrpar\qj \fi-357\li538\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin538\itap0\pararsid5445085 {\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16\insrsid3367252\charrsid11429257 {\field{\*\fldinst SYMBOL 108 \\f "Liberation Serif"
+ \\s 8}{\fldrslt\f10\fs16}}}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\insrsid3367252\charrsid11469795 \tab }{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\insrsid1053200\charrsid1053200 }{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0
+\fs24\lang1024\langfe1024\noproof\insrsid7764160\charrsid11469795 """}}}
+\pard\plain \ltrpar\qj \fi-357\li538\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin538\itap0\pararsid5445085 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0
+\fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sectd \ltrsect\psz9\pgnrestart\linex0\footery567\endnhere\sectlinegrid354\sectdefaultcl\sectrsid13855\sftnbj {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\insrsid2104771\charrsid11469795 xxxxxxxxxxx}
+{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\insrsid13048482 , xxxxxxxxxxxxxxxx, xxxxxxxxxxxxx, xxxxxxxxxxx}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\lang1024\langfe1024\noproof\insrsid5707700\charrsid11469795
+\par }\pard \ltrpar\qj \li540\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin540\itap0\pararsid4545169 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \b\fs24\ul\insrsid4945715\charrsid2562227
+}{
+\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\lang1024\langfe1024\noproof\insrsid2104771\charrsid4733816
+\par }\pard \ltrpar\qj \fi-359\li540\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin540\itap0\pararsid4545169 {\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16\insrsid7764160\charrsid11429257
+\par
+\par }\pard \ltrpar\qj \fi-359\li540\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin540\itap0\pararsid4545169
+
+}
\ No newline at end of file diff --git a/sw/qa/extras/rtfexport/rtfexport8.cxx b/sw/qa/extras/rtfexport/rtfexport8.cxx index 1b4c585fca58..c2c546b42b3e 100644 --- a/sw/qa/extras/rtfexport/rtfexport8.cxx +++ b/sw/qa/extras/rtfexport/rtfexport8.cxx @@ -580,6 +580,23 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158982) verify(); } +CPPUNIT_TEST_FIXTURE(Test, testTdf161878) +{ + auto verify = [this]() { + //check that the IF field is a pos 2 + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XText> xText = xTextDocument->getText(); + uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor(); + uno::Reference<beans::XPropertySet> xPropSet(xCursor, uno::UNO_QUERY); + xCursor->goRight(2, false); + uno::Any xField = xPropSet->getPropertyValue("TextField"); + CPPUNIT_ASSERT(xField.hasValue()); + }; + createSwDoc("tdf161878.rtf"); + verify(); + saveAndReload(mpFilter); + verify(); +} } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/rtfimport/data/tdf152839.rtf b/sw/qa/extras/rtfimport/data/tdf152839.rtf new file mode 100644 index 000000000000..e95f72af0b78 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf152839.rtf @@ -0,0 +1,15 @@ +{\rtf1
+
+\trowd
+\clbrdrb\brdrs\brdrw100
+\cellx3000
+\pard\intbl A\cell\row
+
+\trowd
+
+\cellx3000
+\cellx6000
+\pard\intbl B\cell
+\pard\intbl C\cell
+\row
+}
diff --git a/sw/qa/extras/rtfimport/data/tdf160553.rtf b/sw/qa/extras/rtfimport/data/tdf160553.rtf new file mode 100755 index 000000000000..2e7b26db4e70 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf160553.rtf @@ -0,0 +1,20 @@ +{\rtf1
+
+
+\trowd \cellx6096\cellx9356
+\intbl 1\cell
+\intbl 2\cell
+\trowd \cellx6096\cellx9356
+\row
+\pard HELLO\par
+
+\sect\sectd
+
+\trowd \cellx6096\cellx9356
+\intbl 1\cell
+\intbl 2\cell
+\trowd \cellx6096\cellx9356
+\row
+\pard
+
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 93cab6b119b9..d7f8c88ed5f5 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1893,6 +1893,13 @@ CPPUNIT_TEST_FIXTURE(Test, test158044Tdf) } } +CPPUNIT_TEST_FIXTURE(Test, test160553Tdf) +{ + createSwDoc("tdf160553.rtf"); + // new section should create second page + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + CPPUNIT_TEST_FIXTURE(Test, test148544Tdf) { createSwDoc("tdf148544.rtf"); @@ -1931,6 +1938,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf163003) getProperty<sal_Int32>(getShape(1), u"VertOrientPosition"_ustr)); } +CPPUNIT_TEST_FIXTURE(Test, testTdf152839) +{ + createSwDoc("tdf152839.rtf"); + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), + uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xTable->getCellNames().getLength()); +} // tests should only be added to rtfIMPORT *if* they fail round-tripping in rtfEXPORT } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/uiwriter/data/tdf162326.odt b/sw/qa/extras/uiwriter/data/tdf162326.odt Binary files differnew file mode 100644 index 000000000000..9fb91e41896a --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf162326.odt diff --git a/sw/qa/extras/uiwriter/data/tdf162326_list.odt b/sw/qa/extras/uiwriter/data/tdf162326_list.odt Binary files differnew file mode 100755 index 000000000000..324ac884337c --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf162326_list.odt diff --git a/sw/qa/extras/uiwriter/data/tdf163340.odt b/sw/qa/extras/uiwriter/data/tdf163340.odt Binary files differnew file mode 100644 index 000000000000..cae622e5b5f3 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf163340.odt diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index 2f8d9b68ba2f..ec6e29db4061 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -14,6 +14,9 @@ #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <vcl/scheduler.hxx> + +#include <com/sun/star/awt/FontWeight.hpp> +#include <com/sun/star/awt/FontSlant.hpp> #include <com/sun/star/table/TableBorder2.hpp> #include <com/sun/star/text/XDocumentIndex.hpp> #include <com/sun/star/text/XTextFrame.hpp> @@ -46,7 +49,6 @@ #include <IDocumentLinksAdministration.hxx> #include <fmtinfmt.hxx> #include <rootfrm.hxx> - #include <svx/svdview.hxx> #include <svx/svdmark.hxx> @@ -677,6 +679,146 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf144752) CPPUNIT_ASSERT_EQUAL(u"Word"_ustr, pWrtShell->GetSelText()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf162326_Paragraph) +{ + createSwDoc("tdf162326.odt"); + SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); + CPPUNIT_ASSERT(pWrtShell); + + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, + getProperty<float>(getRun(getParagraph(1), 1), u"CharWeight"_ustr)); + CPPUNIT_ASSERT_EQUAL( + awt::FontSlant_ITALIC, + getProperty<awt::FontSlant>(getRun(getParagraph(2), 2), u"CharPosture"_ustr)); + CPPUNIT_ASSERT_EQUAL(short(1), + getProperty<short>(getRun(getParagraph(3), 2), u"CharUnderline"_ustr)); + + pWrtShell->Down(/*bSelect=*/true, 3); + + dispatchCommand(mxComponent, u".uno:StyleApply"_ustr, + { comphelper::makePropertyValue(u"FamilyName"_ustr, u"ParagraphStyles"_ustr), + comphelper::makePropertyValue(u"Style"_ustr, u"Footnote"_ustr), + comphelper::makePropertyValue(u"KeyModifier"_ustr, uno::Any(KEY_MOD1)) }); + + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, + getProperty<float>(getRun(getParagraph(1), 1), u"CharWeight"_ustr)); + CPPUNIT_ASSERT_THROW(getRun(getParagraph(2), 2), css::container::NoSuchElementException); + CPPUNIT_ASSERT_THROW(getRun(getParagraph(3), 2), css::container::NoSuchElementException); +} + +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf162326_Character) +{ + createSwDoc("tdf162326.odt"); + SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); + CPPUNIT_ASSERT(pWrtShell); + + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, + getProperty<float>(getRun(getParagraph(1), 1), u"CharWeight"_ustr)); + CPPUNIT_ASSERT_EQUAL( + awt::FontSlant_ITALIC, + getProperty<awt::FontSlant>(getRun(getParagraph(2), 2), u"CharPosture"_ustr)); + CPPUNIT_ASSERT_EQUAL(short(1), + getProperty<short>(getRun(getParagraph(3), 2), u"CharUnderline"_ustr)); + + pWrtShell->Down(/*bSelect=*/true, 3); + + //add Ctrl/MOD_1 + dispatchCommand(mxComponent, u".uno:StyleApply"_ustr, + { comphelper::makePropertyValue(u"FamilyName"_ustr, u"CharacterStyles"_ustr), + comphelper::makePropertyValue(u"Style"_ustr, u"Definition"_ustr), + comphelper::makePropertyValue(u"KeyModifier"_ustr, uno::Any(KEY_MOD1)) }); + + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, + getProperty<float>(getRun(getParagraph(1), 1), u"CharWeight"_ustr)); + CPPUNIT_ASSERT_THROW(getRun(getParagraph(2), 2), css::container::NoSuchElementException); + //last runs are not changed because the selection ends at the beginning of that paragraph + CPPUNIT_ASSERT_EQUAL(short(1), + getProperty<short>(getRun(getParagraph(3), 2), u"CharUnderline"_ustr)); +} + +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf162326_List) +{ + createSwDoc("tdf162326_list.odt"); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XParagraphCursor> xParaCursor(xTextDocument->getText()->createTextCursor(), + uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL(u"A)"_ustr, getProperty<OUString>(xParaCursor, u"ListLabelString"_ustr)); + + dispatchCommand(mxComponent, u".uno:StyleApply"_ustr, + { comphelper::makePropertyValue(u"FamilyName"_ustr, u"ParagraphStyles"_ustr), + comphelper::makePropertyValue(u"Style"_ustr, u"Footnote"_ustr) }); + + //hard list attribute unchanged + CPPUNIT_ASSERT_EQUAL(u"A)"_ustr, getProperty<OUString>(xParaCursor, u"ListLabelString"_ustr)); + + dispatchCommand(mxComponent, u".uno:StyleApply"_ustr, + { comphelper::makePropertyValue(u"FamilyName"_ustr, u"ParagraphStyles"_ustr), + comphelper::makePropertyValue(u"Style"_ustr, u"Footnote"_ustr), + comphelper::makePropertyValue(u"KeyModifier"_ustr, uno::Any(KEY_MOD1)) }); + + //list replaced by para style list setting + CPPUNIT_ASSERT_EQUAL(u"1."_ustr, getProperty<OUString>(xParaCursor, u"ListLabelString"_ustr)); +} + +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf163340) +{ + createSwDoc("tdf163340.odt"); + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XText> xText = xTextDocument->getText(); + uno::Reference<view::XSelectionSupplier> xSelSupplier(xModel->getCurrentController(), + uno::UNO_QUERY_THROW); + uno::Reference<text::XParagraphCursor> xParaCursor(xTextDocument->getText()->createTextCursor(), + uno::UNO_QUERY); + + for (int i = 0; i < 14; i++) + xParaCursor->gotoNextParagraph(false); + xParaCursor->gotoEndOfParagraph(true); + xSelSupplier->select(uno::Any(xParaCursor)); + + CPPUNIT_ASSERT_EQUAL(u"A."_ustr, getProperty<OUString>(xParaCursor, u"ListLabelString"_ustr)); + dispatchCommand(mxComponent, u".uno:Copy"_ustr, {}); + + xParaCursor = uno::Reference<text::XParagraphCursor>(xText->createTextCursor(), uno::UNO_QUERY); + for (int i = 0; i < 3; i++) + xParaCursor->gotoNextParagraph(false); + xParaCursor->gotoEndOfParagraph(true); + CPPUNIT_ASSERT_EQUAL(u"1."_ustr, getProperty<OUString>(xParaCursor, u"ListLabelString"_ustr)); + xSelSupplier->select(uno::Any(xParaCursor)); + dispatchCommand(mxComponent, u".uno:Paste"_ustr, {}); + CPPUNIT_ASSERT_EQUAL(u"A."_ustr, getProperty<OUString>(xParaCursor, u"ListLabelString"_ustr)); +} + +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf162326_Pargraph) +{ + createSwDoc("tdf162326.odt"); + SwXTextDocument* pDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pDoc); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + CPPUNIT_ASSERT(pWrtShell); + + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, + getProperty<float>(getRun(getParagraph(1), 1), u"CharWeight"_ustr)); + CPPUNIT_ASSERT_EQUAL( + awt::FontSlant_ITALIC, + getProperty<awt::FontSlant>(getRun(getParagraph(2), 2), u"CharPosture"_ustr)); + CPPUNIT_ASSERT_EQUAL(short(1), + getProperty<short>(getRun(getParagraph(3), 2), u"CharUnderline"_ustr)); + + pWrtShell->Down(/*bSelect=*/true, 3); + + dispatchCommand(mxComponent, u".uno:StyleApply"_ustr, + { comphelper::makePropertyValue(u"FamilyName"_ustr, u"ParagraphStyles"_ustr), + comphelper::makePropertyValue(u"Style"_ustr, u"Footnote"_ustr), + comphelper::makePropertyValue(u"KeyModifier"_ustr, uno::Any(KEY_MOD1)) }); + + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, + getProperty<float>(getRun(getParagraph(1), 1), u"CharWeight"_ustr)); + CPPUNIT_ASSERT_THROW(getRun(getParagraph(2), 2), css::container::NoSuchElementException); + CPPUNIT_ASSERT_THROW(getRun(getParagraph(3), 2), css::container::NoSuchElementException); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf162195) { // Given a document, which has some index entries in a hidden section diff --git a/sw/qa/extras/ww8import/data/tdf134902.docx b/sw/qa/extras/ww8import/data/tdf134902.docx Binary files differnew file mode 100644 index 000000000000..fc89611f65cd --- /dev/null +++ b/sw/qa/extras/ww8import/data/tdf134902.docx diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 0a82c320be1f..a7ea3c8a51a0 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -278,6 +278,28 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142003) CPPUNIT_ASSERT(xParagraph->getString().startsWith("Lorem ipsum , consectetur adipiscing elit.")); } +CPPUNIT_TEST_FIXTURE(Test, testTdf134902) +{ + createSwDoc("tdf134902.docx"); + CPPUNIT_ASSERT_EQUAL(4, getShapes()); + uno::Reference<drawing::XShape> xShape; + uno::Reference< beans::XPropertySet > XPropSet; + for (int i = 3; i<= getShapes(); i++) + { + xShape = getShape(i); + XPropSet.set( xShape, uno::UNO_QUERY_THROW ); + try + { + bool isVisible = true; + XPropSet->getPropertyValue(u"Visible"_ustr) >>= isVisible; + CPPUNIT_ASSERT(!isVisible); + } + catch (beans::UnknownPropertyException &) + { /* ignore */ } + } + +} + // tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT } // end of anonymous namespace diff --git a/sw/qa/uibase/uiview/data/tdf152839_formtext.rtf b/sw/qa/uibase/uiview/data/tdf152839_formtext.rtf new file mode 100644 index 000000000000..17b595a40fd6 --- /dev/null +++ b/sw/qa/uibase/uiview/data/tdf152839_formtext.rtf @@ -0,0 +1,257 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1031\deflangfe1041\themelang3079\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
+{\f48\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Segoe UI;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}
+{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
+{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\f1353\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}
+{\f1354\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\f1356\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\f1357\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\f1358\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\f1359\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\f1360\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\f1361\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\f1693\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f1694\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}
+{\f1696\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f1697\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f1700\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f1701\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}
+{\f1833\fbidi \fswiss\fcharset238\fprq2 Segoe UI CE;}{\f1834\fbidi \fswiss\fcharset204\fprq2 Segoe UI Cyr;}{\f1836\fbidi \fswiss\fcharset161\fprq2 Segoe UI Greek;}{\f1837\fbidi \fswiss\fcharset162\fprq2 Segoe UI Tur;}
+{\f1838\fbidi \fswiss\fcharset177\fprq2 Segoe UI (Hebrew);}{\f1839\fbidi \fswiss\fcharset178\fprq2 Segoe UI (Arabic);}{\f1840\fbidi \fswiss\fcharset186\fprq2 Segoe UI Baltic;}{\f1841\fbidi \fswiss\fcharset163\fprq2 Segoe UI (Vietnamese);}
+{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}
+{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}
+{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}
+{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}
+{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}
+{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}
+{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}
+{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}
+{\fhimajor\f31528\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\fhimajor\f31529\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;}{\fhimajor\f31531\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;}
+{\fhimajor\f31532\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;}{\fhimajor\f31533\fbidi \fswiss\fcharset177\fprq2 Calibri Light (Hebrew);}{\fhimajor\f31534\fbidi \fswiss\fcharset178\fprq2 Calibri Light (Arabic);}
+{\fhimajor\f31535\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;}{\fhimajor\f31536\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}
+{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}
+{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}
+{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}
+{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}
+{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}
+{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
+{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31573\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}
+{\fhiminor\f31574\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
+{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}
+{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};}
+{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};}
+{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}}{\colortbl;\red0\green0\blue0;
+\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;
+\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green0\blue0;\red0\green0\blue0;}{\*\defchp \fs22 }{\*\defpap \ql \li0\ri0\sa160\sl259\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0
+\fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\sb120\sa120\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs32\alang1025
+\ltrch\fcs0 \fs32\lang1031\langfe3079\cgrid\langnp1031\langfenp3079 \sbasedon0 \snext0 \slink15 \sqformat \styrsid12458106 heading 1;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa160\sl259\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1031\langfe1041\cgrid\langnp1031\langfenp1041 \snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive \rtlch\fcs1
+\ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 \'dcberschrift 1 Zchn;}{\s16\ql \li0\ri0\widctlpar\brdrt\brdrs\brdrw10\brsp20 \brdrl\brdrs\brdrw10\brsp80 \brdrb
+\brdrs\brdrw10\brsp20 \brdrr\brdrs\brdrw10\brsp80 \wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\cf6\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon0 \snext0
+BausteinName;}{\s17\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ai\af0\afs20\alang1025 \ltrch\fcs0 \i\fs20\cf10\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon0 \snext0 Kommentar;}{
+\s18\ql \li0\ri0\widctlpar\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon0 \snext18 \slink19 header;}{\*
+\cs19 \additive \rtlch\fcs1 \af0\afs26 \ltrch\fcs0 \fs26 \sbasedon10 \slink18 \slocked \ssemihidden Kopfzeile Zchn;}{\s20\ql \li0\ri0\widctlpar\tqc\tx4536\tqr\tx9072\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
+\af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 \sbasedon0 \snext20 \slink21 footer;}{\*\cs21 \additive \rtlch\fcs1 \af0\afs26 \ltrch\fcs0 \fs26 \sbasedon10 \slink20 \slocked \ssemihidden Fu\'dfzeile Zchn;}{
+\s22\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af48\afs18\alang1025 \ltrch\fcs0 \f48\fs18\lang3079\langfe3079\cgrid\langnp3079\langfenp3079
+\sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid477296 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \f48\fs18 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid477296 Sprechblasentext Zchn;}}{\*\rsidtbl \rsid25915
+\rsid141657\rsid337940\rsid468624\rsid477296\rsid538180\rsid734395\rsid882106\rsid1008931\rsid1116736\rsid1121750\rsid1131385\rsid1186002\rsid1378358\rsid1457463\rsid1458675\rsid1463711\rsid1576598\rsid1643320\rsid1733725\rsid2233523\rsid2237796
+\rsid2239019\rsid2294971\rsid2363667\rsid2427217\rsid2580829\rsid3020432\rsid3151009\rsid3230690\rsid3676125\rsid4327642\rsid4655589\rsid4939037\rsid5118193\rsid5127372\rsid5398017\rsid5587896\rsid5841343\rsid5984835\rsid6555207\rsid6712741\rsid6831792
+\rsid7089764\rsid7152567\rsid7290328\rsid7496291\rsid7549106\rsid7606353\rsid7810231\rsid7872350\rsid8015286\rsid8078336\rsid8148054\rsid8479968\rsid8534386\rsid8608751\rsid8983466\rsid9060380\rsid9242023\rsid9322053\rsid9402351\rsid9595908\rsid10161122
+\rsid10238746\rsid10242283\rsid10557518\rsid10896052\rsid10964931\rsid11037801\rsid11081007\rsid11094885\rsid11283431\rsid11344075\rsid11424229\rsid11499115\rsid11690788\rsid11871934\rsid11893049\rsid11947419\rsid12262926\rsid12458106\rsid12652382
+\rsid12928601\rsid12986890\rsid12999067\rsid13055997\rsid13110340\rsid13254002\rsid13255087\rsid13305316\rsid13334452\rsid13516935\rsid14315527\rsid14378587\rsid14563127\rsid14580302\rsid14632582\rsid14708412\rsid14823218\rsid14964844\rsid15013360
+\rsid15622987\rsid15626663\rsid15745522\rsid16274659\rsid16606131}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\subject asdf}{\author Oliver Specht}
+{\doccomm MIBIS Schriftverkehr}{\operator Oliver Specht}{\creatim\yr2024\mo11\dy11\hr8\min21}{\revtim\yr2024\mo11\dy11\hr8\min21}{\printim\yr2022\mo10\dy11\hr12\min16}{\version2}{\edmins0}{\nofpages1}{\nofwords9}{\nofchars59}{\*\company BMLV}
+{\nofcharsws67}{\vern107}}{\*\userprops {\propname KPH_Enabled}\proptype30{\staticval 0}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw16840\paperh11907\margl1134\margr1418\margt567\margb567\gutter0\ltrsect
+\deftab709\widowctrl\ftnbj\aenddoc\hyphhotz425\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0
+\showxmlerrors0\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace130\dgvspace180\dghorigin1134\dgvorigin567\dghshow0\dgvshow0
+\jexpand\viewkind1\viewscale180\pgbrdrhead\pgbrdrfoot\nolnhtadjtbl\nojkernpunct\rsidroot4655589 \fet0{\*\wgrffmtfilter 013f}\ilfomacatclnup0{\*\template C:\\Users\\x2mf\\AppData\\Roaming\\Microsoft\\Templates\\kis.3.0.dot}
+{\*\docvar {DKE_SBGeschlecht}{[SBGeschlecht]}}{\*\docvar {KPH_Genehmiger}{[Genehmiger]}}{\*\docvar {KPH_Gesch\'e4ftszahl}{[Gesch\'e4ftszahl]}}{\*\docvar {KPH_Sachbearbeiter}{[Sachbearbeiter]}}{\*\docvar {KPH_SBeMail}{[SB_eMail]}}
+{\*\docvar {KPH_SBFax}{[SB_Fax]}}{\*\docvar {KPH_SBIFMIN}{SBIFMIN}}{\*\docvar {KPH_SBTelefon}{[SB_Telefon]}}{\*\ftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
+\af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid5127372 \chftnsep
+\par }}{\*\ftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0
+\ltrch\fcs0 \insrsid5127372 \chftnsepc
+\par }}{\*\aftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0
+\ltrch\fcs0 \insrsid5127372 \chftnsep
+\par }}{\*\aftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0
+\ltrch\fcs0 \insrsid5127372 \chftnsepc
+\par }}\ltrpar \sectd \ltrsect\lndscpsxn\binfsxn4\binsxn4\psz9\linex0\headery567\footery567\endnhere\sectlinegrid354\sectdefaultcl\sectrsid8078336\sftnbj {\footerr \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar
+\tqc\tx7150\tqr\tx14300\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid14580302 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
+\fs18\lang1024\langfe1024\noproof\insrsid8015286\charrsid8015286 FWZD00}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\lang1024\langfe1024\noproof\insrsid12458106\charrsid8015286 \tab DVR}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
+\fs18\insrsid12458106\charrsid8015286 Nr }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid5587896 0000000}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid12458106\charrsid8015286 \tab
+\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}
+{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8
+\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri-1\widctlpar
+\tqr\tx14317\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin-1\lin0\itap0\pararsid12458106 \rtlch\fcs1 \af0\afs26\alang1025 \ltrch\fcs0 \fs26\lang3079\langfe3079\cgrid\langnp3079\langfenp3079 {\rtlch\fcs1 \ab\af0\afs2 \ltrch\fcs0
+\b\fs2\insrsid12458106\charrsid3020432
+\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts11\trgaph70\trleft-70\trkeep\trftsWidth3\trwWidth14240\trftsWidthB3\trftsWidthA3\trwWidthA11405\trpaddl70\trpaddr70\trpaddfl3\trpaddfr3\tblrsid1131385\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl
+\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth2835\clshdrawnil \cellx2765\pard \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\pararsid1458675 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
+\fs18\insrsid2237796 \cell }\pard \ltrpar\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid2237796 \trowd \irow0\irowband0\ltrrow
+\ts11\trgaph70\trleft-70\trkeep\trftsWidth3\trwWidth14240\trftsWidthB3\trftsWidthA3\trwWidthA11405\trpaddl70\trpaddr70\trpaddfl3\trpaddfr3\tblrsid1131385\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl
+\cltxlrtb\clftsWidth3\clwWidth2835\clshdrawnil \cellx2765\row \ltrrow}\trowd \irow1\irowband1\lastrow \ltrrow
+\ts11\trgaph70\trleft-70\trkeep\trftsWidth3\trwWidth14240\trftsWidthB3\trftsWidthA3\trpaddl70\trpaddr70\trpaddfl3\trpaddfr3\tblrsid1131385\tblind0\tblindtype3 \clvertalc\clbrdrt\brdrs\brdrw30 \clbrdrl\brdrs\brdrw30 \clbrdrb\brdrs\brdrw30 \clbrdrr
+\brdrs\brdrw30 \cltxlrtb\clftsWidth3\clwWidth4536\clshdrawnil \cellx4466\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth2835\clshdrawnil \cellx7301\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl
+\clbrdrb\brdrtbl \clbrdrr\brdrs\brdrw30 \cltxlrtb\clftsWidth3\clwWidth4399\clshdrawnil \cellx11700\clvertalc\clbrdrt\brdrs\brdrw30 \clbrdrl\brdrs\brdrw30 \clbrdrb\brdrs\brdrw30 \clbrdrr\brdrs\brdrw30 \cltxlrtb\clftsWidth3\clwWidth2470\clshdrawnil
+\cellx14170\pard \ltrpar\qc \li0\ri0\sb120\sa120\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\pararsid468624 {\field{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \fs42\insrsid16606131\charrsid16606131 FORMTEXT}{\rtlch\fcs1 \af0
+\ltrch\fcs0 \insrsid11947419 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \fs42\insrsid16606131\charrsid16606131 {\*\datafield 000000001400000005546578743100000000000000000000000000}{\*\formfield{\fftype0\fftypetxt0\ffhps20{\*\ffname Text1}}}}}{\fldrslt {\rtlch\fcs1
+\af0 \ltrch\fcs0 \fs42\lang1024\langfe1024\hich\af41\noproof\insrsid16606131\charrsid16606131 \loch\af0\dbch\af0\hich\f0 \u8194\'20\loch\af0\dbch\af0\hich\f0 \u8194\'20\loch\af0\dbch\af0\hich\f0 \u8194\'20\loch\af0\dbch\af0\hich\f0 \u8194\'20
+\loch\af0\dbch\af0\hich\f0 \u8194\'20}}}\sectd \ltrsect\lndscpsxn\binfsxn4\binsxn4\psz9\linex0\headery567\footery567\endnhere\sectlinegrid354\sectdefaultcl\sectrsid8078336\sftnbj {\rtlch\fcs1 \af0 \ltrch\fcs0 \b\fs32\insrsid1131385\charrsid16606131
+\cell }\pard \ltrpar\ql \li0\ri0\sb120\sa120\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\pararsid468624 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1131385 FU\tab (von-bis)\cell }\pard \ltrpar
+\qr \li0\ri0\sb120\sa120\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\pararsid468624 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1131385 Ablage am:\cell }\pard \ltrpar
+\ql \li0\ri0\sb120\sa120\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\pararsid468624 {\field{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \fs42\insrsid9060380\charrsid9060380 FORMTEXT}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11947419
+ }{\rtlch\fcs1 \af0 \ltrch\fcs0 \fs42\insrsid9060380\charrsid9060380 {\*\datafield 00000000140000000000000000000000000000000000}{\*\formfield{\fftype0\fftypetxt0\ffhps20}}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0
+\fs42\lang1024\langfe1024\hich\af41\noproof\insrsid9060380\charrsid9060380 \loch\af0\dbch\af0\hich\f0 \u8194\'20\loch\af0\dbch\af0\hich\f0 \u8194\'20\loch\af0\dbch\af0\hich\f0 \u8194\'20\loch\af0\dbch\af0\hich\f0 \u8194\'20\loch\af0\dbch\af0\hich\f0
+\u8194\'20}}}\sectd \ltrsect\lndscpsxn\binfsxn4\binsxn4\psz9\linex0\headery567\footery567\endnhere\sectlinegrid354\sectdefaultcl\sectrsid8078336\sftnbj {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1131385\charrsid9060380 \cell }\pard \ltrpar
+\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1131385 \trowd \irow1\irowband1\lastrow \ltrrow
+\ts11\trgaph70\trleft-70\trkeep\trftsWidth3\trwWidth14240\trftsWidthB3\trftsWidthA3\trpaddl70\trpaddr70\trpaddfl3\trpaddfr3\tblrsid1131385\tblind0\tblindtype3 \clvertalc\clbrdrt\brdrs\brdrw30 \clbrdrl\brdrs\brdrw30 \clbrdrb\brdrs\brdrw30 \clbrdrr
+\brdrs\brdrw30 \cltxlrtb\clftsWidth3\clwWidth4536\clshdrawnil \cellx4466\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth2835\clshdrawnil \cellx7301\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl
+\clbrdrb\brdrtbl \clbrdrr\brdrs\brdrw30 \cltxlrtb\clftsWidth3\clwWidth4399\clshdrawnil \cellx11700\clvertalc\clbrdrt\brdrs\brdrw30 \clbrdrl\brdrs\brdrw30 \clbrdrb\brdrs\brdrw30 \clbrdrr\brdrs\brdrw30 \cltxlrtb\clftsWidth3\clwWidth2470\clshdrawnil
+\cellx14170\row }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1131385 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \v\fs18\insrsid13255087\charrsid13255087 \line }{\rtlch\fcs1 \af0 \ltrch\fcs0
+\v\lang1024\langfe1024\noproof\insrsid2237796\charrsid13255087
+\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
+9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
+5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
+b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
+0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
+a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
+c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
+0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
+a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
+6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
+4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
+4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100937e00e7ca060000891a0000160000007468656d652f7468656d652f
+7468656d65312e786d6cec595b8bdb46147e2ff43f08bd3bbe49be2cf1065bb69336bb49889d943cceda636bb2238dd18c776342a0244f7d2914d2d28706fad6
+87521a68a0a12ffd310b1bdaf447f4cc489667ec71f6420aa1640d8b34face996fce39face48ba7aed51449d239c70c2e2965bbe52721d1c8fd898c4d3967b6f
+d82f345c870b148f1165316eb90bccdd6bbb9f7e7215ed881047d801fb98efa0961b0a31db2916f9088611bfc26638866b13964448c069322d8e13740c7e235a
+ac944ab5628448ec3a318ac0ededc9848cb0bbbb74dba3e03b165c0e8c6832904ef126767c589608bee0014d9c23445b2ecc3066c743fc48b80e455cc085965b
+527f6e71f76a11ed6446546cb1d5ecfaea2fb3cb0cc687153567323dc827f53cdfabb573ff0a40c526ae57efd57ab5dc9f02a0d108569a72d17dfa9d66a7eb67
+580d941e5a7c77ebdd6ad9c06bfeab1b9cdbbefc1978054afd7b1bf87e3f80281a78054af1fe06def3ea95c033f00a94e26b1bf87aa9ddf5ea065e81424ae2c3
+0d74c9af5583e56a73c884d11b5678d3f7faf54ae67c85826ac8ab4b4e3161b1d8566b117ac8923e002490224162472c6678824650bf01a2e42021ce1e998650
+783314330ec3a54aa95faac27ff9f3d4918a08dac148b396bc8009df18927c1c3e4ac84cb4dccfc1abab414e5fbf3e79faeae4e9ef27cf9e9d3cfd359b5bb932
+ec6ea078aadbbdfde99b7f5e7ce9fcfddb8f6f9f7f9b4ebd8ee73afecd2f5fbdf9e3cf77b98715af4271faddcb37af5e9e7efff55f3f3fb7786f27e840870f49
+84b9730b1f3b7759040bb4f0c707c9c52c862122ba453b9e721423398bc57f4f8406fad6025164c175b019c7fb09488d0d787dfed0203c0893b920168f37c3c8
+00ee33463b2cb146e1a69c4b0bf3701e4fed9327731d7717a123dbdc018a8d2cf7e633d05862731984d8a07987a258a0298eb170e4357688b165750f0831e2ba
+4f4609e36c229c07c4e920620dc9901c18d5b432ba4122c8cbc24610f26dc466ffbed361d4b6ea2e3e3291706f206a213fc4d408e375341728b2b91ca288ea01
+df4322b4911c2c92918eeb7101999e62ca9cde18736eb3b99dc07ab5a4df0499b1a77d9f2e221399087268f3b98718d3915d761884289ad9b00312873af6337e
+08258a9c3b4cd8e0fbccbc43e439e401c55bd37d9f6023dd67abc13d50589dd2aa40e4957962c9e575cc8cfa1d2ce804612535d0000c5d8f487ca6c8afc9bbff
+dfc93b88e8e90f2f2c2b7a3f926e776ce4e38262de4e88f56ebab126e1db70ebc21db0644c3e7cddeea2797c07c3adb2d9bc3ecaf647d976fff7b2bded7e7eff
+62bdd267906eb96d4db7eb6af31e6dddbb4f08a503b1a0788fabed3b87ae34eec3a0b4534fac387f969b857028ef6498c0c04d13a46c9c84892f880807219ac1
+1ebfec4a27539eb99e7267c6386cfdd5b0d5b7c4d379b4cfc6e9236bb92c1f4f53f1e048acc64b7e3e0e8f1b2245d7eaabc7b0dcbd623b558fcb4b02d2f62224
+b4c94c12550b89fa725006493d9c43d02c24d4cade0b8ba6854543ba5fa66a830550cbb302db2607365b2dd7f7c0048ce0a90a513c96794a53bdccae4ae6fbcc
+f4b6601a15007b886505ac32dd945cb72e4fae2e2db57364da20a1959b49424546f5301ea231ceaa538e9e87c64573dd5ca5d4a02743a1e683d25ad1a837dec5
+e2b2b906bb756da0b1ae1434768e5b6eadea43c98cd0ace54ee0d11f0ea319d40e97db5d44a7f0e66c2492f486bf8cb2cc122eba888769c095e8a46a10118113
+8792a8e5cae5e769a0b1d210c5ad5c0141f860c93541563e3472907433c97832c123a1a75d1b91914e4f41e153adb05e55e697074b4b3687740fc2f1b17340e7
+c95d0425e6d7cb328063c2e10d50398de698c02bcd5cc856f5b7d69832d9d5df29aa1a4ac7119d8528eb28ba98a77025e5391d7596c7403bcbd60c01d5429235
+c283a96cb07a508d6e9a778d94c3d6ae7bb6918c9c269aab9e69a88aec9a7615336658b681b5585eaec96bac9621064dd33b7c2addeb92db5c6addda3e21ef12
+10f03c7e96ae7b8e86a0515b4d6650938c3765586a76366af68ee502cfa0769e26a1a97e6de9762d6e798fb04e078397eafc60b75eb5303459ee2b55a4d5570f
+fdf3043b7808e2d18517c1732ab84a257c7c48106c88066a4f92ca06dc228f44766bc091334f48cb7d5cf2db5e50f18342a9e1f70a5ed52b151a7ebb5a68fb7e
+b5dcf3cba56ea7f2041a8b08a3b29f7e71e9c36b28bac8bebba8f18d6f2fd1f24ddb95118b8a4c7d5b292ae2eadb4bb962f9f6e20ce52716d721203a8f6b957e
+b3daecd40acd6abb5ff0ba9d46a119d43a856e2da877fbddc06f34fb4f5ce74881bd7635f06abd46a1560e8282572b49fa8d66a1ee552a6dafde6ef4bcf6936c
+1b032b4fe5238b058457f1dafd170000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f7468656d652f5f72
+656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c08
+2e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd0
+8a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa
+4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c0200001300000000000000000000000000000000005b436f
+6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000000000300100005f72
+656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000190200007468656d652f746865
+6d652f7468656d654d616e616765722e786d6c504b01022d0014000600080000002100937e00e7ca060000891a00001600000000000000000000000000d60200
+007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027000000000000000000000000
+00d40900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000cf0a00000000}
+{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
+617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
+6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
+656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
+{\*\latentstyles\lsdstimax376\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;
+\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
+\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;
+\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 1;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 5;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 9;
+\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 1;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 2;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 3;
+\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 4;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 5;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 6;
+\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 7;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 8;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Indent;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 header;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footer;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index heading;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of figures;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope return;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation reference;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 line number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 page number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote text;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of authorities;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 macro;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 toa heading;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 3;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 3;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 3;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 5;\lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Closing;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Signature;\lsdsemihidden1 \lsdunhideused1 \lsdpriority1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 4;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Message Header;\lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Salutation;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Date;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Note Heading;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 3;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Block Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 FollowedHyperlink;\lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;
+\lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Document Map;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Plain Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 E-mail Signature;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Top of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Bottom of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal (Web);\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Acronym;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Cite;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Code;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Definition;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Keyboard;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Preformatted;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Sample;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Typewriter;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Variable;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation subject;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 No List;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 1;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Balloon Text;\lsdpriority39 \lsdlocked0 Table Grid;
+\lsdsemihidden1 \lsdlocked0 Placeholder Text;\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdpriority60 \lsdlocked0 Light Shading;\lsdpriority61 \lsdlocked0 Light List;\lsdpriority62 \lsdlocked0 Light Grid;
+\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdpriority65 \lsdlocked0 Medium List 1;\lsdpriority66 \lsdlocked0 Medium List 2;\lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdpriority68 \lsdlocked0 Medium Grid 2;
+\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List;\lsdpriority71 \lsdlocked0 Colorful Shading;\lsdpriority72 \lsdlocked0 Colorful List;\lsdpriority73 \lsdlocked0 Colorful Grid;\lsdpriority60 \lsdlocked0 Light Shading Accent 1;
+\lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;
+\lsdsemihidden1 \lsdlocked0 Revision;\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdpriority62 \lsdlocked0 Light Grid Accent 2;
+\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdpriority62 \lsdlocked0 Light Grid Accent 3;
+\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdpriority62 \lsdlocked0 Light Grid Accent 4;
+\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdpriority62 \lsdlocked0 Light Grid Accent 5;
+\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6;
+\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;
+\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;
+\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
+\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography;
+\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4;
+\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4;
+\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1;
+\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1;
+\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2;
+\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2;
+\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3;
+\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4;
+\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4;
+\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5;
+\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5;
+\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6;
+\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6;
+\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark;
+\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1;
+\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1;
+\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2;
+\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3;
+\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3;
+\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4;
+\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4;
+\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5;
+\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5;
+\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6;
+\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention;
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Unresolved Mention;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Link;}}{\*\datastore 01050000
+02000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
+d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000003024
+bd5f0a34db01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
+000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000105000000000000}}
\ No newline at end of file diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx index ceae7d644c3f..0749a6e937a5 100644 --- a/sw/qa/uibase/uiview/uiview.cxx +++ b/sw/qa/uibase/uiview/uiview.cxx @@ -313,6 +313,17 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testPrintPreview) pView->SetFormShell(pFormShell); } +CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, TestTdf152839_Formtext) +{ + createSwDoc("tdf152839_formtext.rtf"); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + sal_Int32 nHeight + = getXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[2]/cell[1]/txt/infos/bounds", "height") + .toInt32(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(723), nHeight); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/uitest/options/optionsDialog.py b/sw/qa/uitest/options/optionsDialog.py index 790d30c9b7ed..48c1d5d5bc6c 100644 --- a/sw/qa/uitest/options/optionsDialog.py +++ b/sw/qa/uitest/options/optionsDialog.py @@ -7,6 +7,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict class optionsDialog(UITestCase): @@ -48,5 +49,34 @@ class optionsDialog(UITestCase): xApplyBtn.executeAction("CLICK", tuple()) + def test_tdf132274Text(self): + with self.ui_test.create_doc_in_start_center("writer"): + + with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialog: + xPages = xDialog.getChild("pages") + xWriterEntry = xPages.getChild('3') + xWriterEntry.executeAction("EXPAND", tuple()) + xContentEntry = xWriterEntry.getChild('1') + xContentEntry.executeAction("SELECT", tuple()) + xOptimal = xDialog.getChild("zoomoptimal") + self.assertEqual(get_state_as_dict(xOptimal)['Visible'], "true") + xApplyBtn = xDialog.getChild("apply") + + def test_tdf132274Web(self): + with self.ui_test.create_doc_in_start_center("writer"): + + with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialog: + xPages = xDialog.getChild("pages") + xWriterWebEntry = xPages.getChild('4') + xWriterWebEntry.executeAction("EXPAND", tuple()) + xContentWebEntry = xWriterWebEntry.getChild('1') + xContentWebEntry.executeAction("SELECT", tuple()) + try: + xOptimalWeb = xDialog.getChild("zoomoptimal") + raise RuntimeError("Zoom controls visible in Web dialog") + except Exception: + xApplyBtn = xDialog.getChild("apply") + + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py index e5ff843fa0f6..d0b78525c1c6 100644 --- a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py +++ b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py @@ -75,7 +75,7 @@ class formatBulletsNumbering(UITestCase): xindentatmf.executeAction("UP", tuple()) - with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog: + with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="ok") as xDialog: xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "4") xalignedatmf = xDialog.getChild("alignedatmf") @@ -100,7 +100,7 @@ class formatBulletsNumbering(UITestCase): select_by_text(xnumfollowedbylb, "Space") - with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog: + with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="ok") as xDialog: xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "4") xnumfollowedbylb = xDialog.getChild("numfollowedbylb") @@ -130,7 +130,7 @@ class formatBulletsNumbering(UITestCase): xallsame.executeAction("CLICK", tuple()) - with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog: + with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="ok") as xDialog: xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") xnumfmtlb = xDialog.getChild("numfmtlb") @@ -151,7 +151,7 @@ class formatBulletsNumbering(UITestCase): with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="user") as xDialog: pass - with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog: + with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="ok") as xDialog: xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") xnumfmtlb = xDialog.getChild("numfmtlb") @@ -185,7 +185,7 @@ class formatBulletsNumbering(UITestCase): xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) #TAB to move indent right - with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog: + with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="ok") as xDialog: xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "4") xindentatmf = xDialog.getChild("indentatmf") @@ -193,7 +193,7 @@ class formatBulletsNumbering(UITestCase): self.assertEqual(indentValue < indentValue2 , True) xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) - with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog: + with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="ok") as xDialog: xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "4") xindentatmf = xDialog.getChild("indentatmf") @@ -214,7 +214,7 @@ class formatBulletsNumbering(UITestCase): self.xUITest.executeCommand(".uno:DecrementSubLevels") - with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog: + with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="ok") as xDialog: xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "4") xindentatmf = xDialog.getChild("indentatmf") @@ -222,7 +222,7 @@ class formatBulletsNumbering(UITestCase): self.assertEqual(indentValue < indentValue2 , True) self.xUITest.executeCommand(".uno:IncrementLevel") - with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog: + with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="ok") as xDialog: xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "4") xindentatmf = xDialog.getChild("indentatmf") diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index 60aee0b19197..2e02b9298be6 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -672,6 +672,11 @@ namespace sw::mark } Invalidate(); } + bool TextFieldmark::HasDefaultContent() const + { + return GetContent() == vEnSpaces; + } + NonTextFieldmark::NonTextFieldmark(const SwPaM& rPaM) : Fieldmark(rPaM) @@ -704,6 +709,11 @@ namespace sw::mark } + bool NonTextFieldmark::HasDefaultContent() const + { + return false; + } + CheckboxFieldmark::CheckboxFieldmark(const SwPaM& rPaM, const OUString& rName) : NonTextFieldmark(rPaM) { @@ -1033,6 +1043,11 @@ namespace sw::mark "{\"action\": \"hide\", \"type\": \"drop-down\"}"_ostr); } + bool DropDownFieldmark::HasDefaultContent() const + { + return false; + } + DateFieldmark::DateFieldmark(const SwPaM& rPaM) : FieldmarkWithDropDownButton(rPaM) , m_pNumberFormatter(nullptr) @@ -1324,6 +1339,12 @@ namespace sw::mark (*pParameters)[ODF_FORMDATE_CURRENTDATE] <<= OUString(); } } + + bool DateFieldmark::HasDefaultContent() const + { + return false; + } + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx index 31a64aa3313f..2f633bd29186 100644 --- a/sw/source/core/crsr/findcoll.cxx +++ b/sw/source/core/crsr/findcoll.cxx @@ -60,7 +60,7 @@ int SwFindParaFormatColl::DoFind(SwPaM & rCursor, SwMoveFnCollection const & fnM else if( pReplColl ) { rCursor.GetDoc().SetTextFormatColl(rCursor, - const_cast<SwTextFormatColl*>(pReplColl), true, false, m_pLayout); + const_cast<SwTextFormatColl*>(pReplColl), true, false, false, m_pLayout); nRet = FIND_NO_RING; } return nRet; diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 8cd3ffd4a423..62c929f6f469 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -229,7 +229,6 @@ namespace } rChgPos.SetContent( nContentPos ); } - } namespace sw @@ -485,26 +484,28 @@ namespace } // #i86492# - bool lcl_ContainsOnlyParagraphsInList( const SwPaM& rPam ) + bool lcl_ShouldKeepSourceList( const SwPaM& rPam ) { - bool bRet = false; - const SwTextNode* pTextNd = rPam.Start()->GetNode().GetTextNode(); const SwTextNode* pEndTextNd = rPam.End()->GetNode().GetTextNode(); - if ( pTextNd && pTextNd->IsInList() && - pEndTextNd && pEndTextNd->IsInList() ) + bool bRet = pTextNd->IsInListFromStyle(); + //prefer list if it's a single paragraph with list from style + if (pTextNd == pEndTextNd && bRet) + return true; + + if (pTextNd && pTextNd->IsInList() && !pTextNd->IsInListFromStyle() && + pEndTextNd && pEndTextNd->IsInList() && !pEndTextNd->IsInListFromStyle()) { - bRet = true; + bRet = false; SwNodeIndex aIdx(rPam.Start()->GetNode()); - do { ++aIdx; pTextNd = aIdx.GetNode().GetTextNode(); - if ( !pTextNd || !pTextNd->IsInList() ) + if (!pTextNd || !pTextNd->IsInList() || pTextNd->IsInListFromStyle()) { - bRet = false; + bRet = true; break; } } while (pTextNd != pEndTextNd); @@ -3687,12 +3688,34 @@ bool DocumentContentOperationsManager::InsertPoolItem( SwRootFrame const*const pLayout, SwTextAttr **ppNewTextAttr) { + SwHistory* pHistory = nullptr; SwDataChanged aTmp( rRg ); std::unique_ptr<SwUndoAttr> pUndoAttr; if (m_rDoc.GetIDocumentUndoRedo().DoesUndo()) { m_rDoc.GetIDocumentUndoRedo().ClearRedo(); pUndoAttr.reset(new SwUndoAttr( rRg, rHt, nFlags )); + pHistory = &pUndoAttr->GetHistory(); + } + + if (nFlags & SetAttrMode::REMOVE_ALL_ATTR) + { + std::shared_ptr<const SfxItemSet> pDelSet = lcl_createDelSet(m_rDoc); + SwPosition aStart(*rRg.GetMark()->GetNode().GetContentNode(), rRg.GetMark()->GetContentIndex()); + SwPosition aEnd(*rRg.GetPoint()->GetNode().GetContentNode(), rRg.GetPoint()->GetContentIndex()); + sw::DocumentContentOperationsManager::ParaRstFormat aPara( + &aStart, &aEnd, pHistory, nullptr, nullptr /* //TODO: is layout required? m_rDoc.GetLayout()*/); + // aPara.pFormatColl = pPara->pFormatColl; + aPara.bReset = true; + // #i62675# + aPara.bResetListAttrs = true; + aPara.bResetAllCharAttrs = true; + aPara.pDelSet = pDelSet.get(); + m_rDoc.GetNodes().ForEach( + aStart.GetNode().GetIndex(), + aEnd.GetNode().GetIndex(), + ::sw::DocumentContentOperationsManager::lcl_RstTextAttr, + &aPara); } SfxItemSet aSet( m_rDoc.GetAttrPool(), rHt.Which(), rHt.Which() ); @@ -4205,6 +4228,44 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( } /* + create ItemSet to be used in ParaRstFormat +*/ +std::shared_ptr<SfxItemSet> DocumentContentOperationsManager::lcl_createDelSet(SwDoc& rDoc) +{ + std::shared_ptr<SfxItemSet> pDelSet(new SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END - 1, + RES_TXTATR_INETFMT, RES_TXTATR_UNKNOWN_CONTAINER, + RES_PARATR_BEGIN, RES_FRMATR_END - 1, + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1>(rDoc.GetAttrPool())); + o3tl::sorted_vector<sal_uInt16> aAttribs; + + constexpr std::pair<sal_uInt16, sal_uInt16> aResetableSetRange[] = { + // tdf#40496: we don't want to change writing direction, so exclude RES_FRAMEDIR: + { RES_TXTATR_CHARFMT,RES_TXTATR_CHARFMT }, + { RES_FRMATR_BEGIN, RES_FRAMEDIR - 1 }, + { RES_FRAMEDIR + 1, RES_FRMATR_END - 1 }, + { RES_CHRATR_BEGIN, RES_CHRATR_LANGUAGE - 1 }, + { RES_CHRATR_LANGUAGE + 1, RES_CHRATR_CJK_LANGUAGE - 1 }, + { RES_CHRATR_CJK_LANGUAGE + 1, RES_CHRATR_CTL_LANGUAGE - 1 }, + { RES_CHRATR_CTL_LANGUAGE + 1, RES_CHRATR_END - 1 }, + { RES_PARATR_BEGIN, RES_PARATR_END - 1 }, + { RES_PARATR_LIST_AUTOFMT, RES_PARATR_LIST_AUTOFMT }, + { RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER }, + { RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1 }, + }; + for (const auto& [nBegin, nEnd] : aResetableSetRange) + { + for (sal_uInt16 i = nBegin; i <= nEnd; ++i) + aAttribs.insert( i ); + } + for( auto it = aAttribs.rbegin(); it != aAttribs.rend(); ++it ) + { + if( POOLATTR_END > *it ) + pDelSet->Put( *GetDfltAttr( *it )); + } + return pDelSet; +} + +/* * Reset the text's hard formatting */ /** @params pArgs contains the document's ChrFormatTable @@ -4946,7 +5007,6 @@ static void lcl_PopNumruleState( // #i86492# - restore also <ListId> item if ( lcl_MarksWholeNode(rPam) ) return; - if (aNumRuleItemHolderIfSet) { pDestTextNd->SetAttr(*aNumRuleItemHolderIfSet); @@ -5138,10 +5198,12 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo // - source contains at least one paragraph which is not in a list // or // - source is a table + // - tdf#163340 overwrite list if source has a list + // - overwrite also if all source paragraphs have a list from a style + if ( pNumRuleToPropagate && ((pDestTextNd && !pDestTextNd->GetText().getLength() && - !pDestTextNd->IsInList() && - !lcl_ContainsOnlyParagraphsInList(rPam)) || + (!pDestTextNd->IsInList() || lcl_ShouldKeepSourceList(rPam) )) || rPam.GetBound().nNode.GetNode().GetNodeType() == SwNodeType::Table) ) { pNumRuleToPropagate = nullptr; diff --git a/sw/source/core/doc/DocumentDrawModelManager.cxx b/sw/source/core/doc/DocumentDrawModelManager.cxx index 0db1d576fc80..0a979183f5bd 100644 --- a/sw/source/core/doc/DocumentDrawModelManager.cxx +++ b/sw/source/core/doc/DocumentDrawModelManager.cxx @@ -348,9 +348,9 @@ bool DocumentDrawModelManager::Search(const SwPaM& rPaM, const SvxSearchItem& rS return false; OutlinerView* pOutlinerView = pSdrView->GetTextEditOutlinerView(); if (!rSearchItem.GetBackward()) - pOutlinerView->SetSelection(ESelection(0, 0, 0, 0)); + pOutlinerView->SetSelection(ESelection(0, 0)); else - pOutlinerView->SetSelection(ESelection(EE_PARA_MAX_COUNT, EE_TEXTPOS_MAX_COUNT, EE_PARA_MAX_COUNT, EE_TEXTPOS_MAX_COUNT)); + pOutlinerView->SetSelection(ESelection::AtEnd()); pOutlinerView->StartSearchAndReplace(rSearchItem); return true; } diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx index 2bbff10db856..8d7fa1d7ae05 100644 --- a/sw/source/core/doc/DocumentSettingManager.cxx +++ b/sw/source/core/doc/DocumentSettingManager.cxx @@ -108,7 +108,9 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc) mbNoNumberingShowFollowBy(false), mbDropCapPunctuation(true), mbUseVariableWidthNBSP(false), - mbPaintHellOverHeaderFooter(false) + mbPaintHellOverHeaderFooter(false), + mbMinRowHeightInclBorder(false), + mbNoClippingWithWrapPolygon(false) // COMPATIBILITY FLAGS END { @@ -271,6 +273,8 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const case DocumentSettingId::DROP_CAP_PUNCTUATION: return mbDropCapPunctuation; case DocumentSettingId::USE_VARIABLE_WIDTH_NBSP: return mbUseVariableWidthNBSP; case DocumentSettingId::PAINT_HELL_OVER_HEADER_FOOTER: return mbPaintHellOverHeaderFooter; + case DocumentSettingId::MIN_ROW_HEIGHT_INCL_BORDER: return mbMinRowHeightInclBorder; + case DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON: return mbNoClippingWithWrapPolygon; default: OSL_FAIL("Invalid setting id"); } @@ -501,6 +505,10 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo mbPaintHellOverHeaderFooter = value; break; + case DocumentSettingId::MIN_ROW_HEIGHT_INCL_BORDER: + mbMinRowHeightInclBorder = value; + break; + // COMPATIBILITY FLAGS END case DocumentSettingId::BROWSE_MODE: //can be used temporary (load/save) when no SwViewShell is available @@ -592,6 +600,9 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo case DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND: mbFootnoteInColumnToPageEnd = value; break; + case DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON: + mbNoClippingWithWrapPolygon = value; + break; default: OSL_FAIL("Invalid setting id"); } @@ -771,6 +782,7 @@ void sw::DocumentSettingManager::ReplaceCompatibilityOptions(const DocumentSetti mbFootnoteInColumnToPageEnd = rSource.mbFootnoteInColumnToPageEnd; mbDropCapPunctuation = rSource.mbDropCapPunctuation; mbUseVariableWidthNBSP = rSource.mbUseVariableWidthNBSP; + mbNoClippingWithWrapPolygon = rSource.mbNoClippingWithWrapPolygon; } sal_uInt32 sw::DocumentSettingManager::Getn32DummyCompatibilityOptions1() const @@ -1087,6 +1099,11 @@ void sw::DocumentSettingManager::dumpAsXml(xmlTextWriterPtr pWriter) const BAD_CAST(OString::boolean(mbPaintHellOverHeaderFooter).getStr())); (void)xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("mbMinRowHeightInclBorder")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), + BAD_CAST(OString::boolean(mbMinRowHeightInclBorder).getStr())); + (void)xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("mbContinuousEndnotes")); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(mbContinuousEndnotes).getStr())); @@ -1152,6 +1169,11 @@ void sw::DocumentSettingManager::dumpAsXml(xmlTextWriterPtr pWriter) const BAD_CAST(OString::boolean(mbDoNotMirrorRtlDrawObjs).getStr())); (void)xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("mbNoClippingWithWrapPolygon")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), + BAD_CAST(OString::boolean(mbNoClippingWithWrapPolygon).getStr())); + (void)xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterEndElement(pWriter); } diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 831ec8092ffe..abce04888365 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1024,12 +1024,28 @@ static bool lcl_SetTextFormatColl( SwNode* pNode, void* pArgs ) SwTextFormatColl* pFormat = pPara->pFormatColl; if ( pPara->bReset ) { + if (pCNd->IsTextNode() && pPara->bResetAllCharAttrs && pPara->pDelSet && pPara->pDelSet->Count()) + { + //TODO: copy to select the text node completely + SwPosition aStart(*pCNd, 0); + SwPosition aEnd(*pCNd, pCNd->GetTextNode()->GetText().getLength()); + sw::DocumentContentOperationsManager::ParaRstFormat aPara( + &aStart, &aEnd, pPara->pHistory, nullptr, pPara->pLayout); + aPara.pFormatColl = pPara->pFormatColl; + aPara.bReset = pPara->bReset; + // #i62675# + aPara.bResetListAttrs = pPara->bResetListAttrs; + aPara.bResetAllCharAttrs = pPara->bResetAllCharAttrs; + aPara.pDelSet = pPara->pDelSet; + sw::DocumentContentOperationsManager::lcl_RstTextAttr(pCNd, &aPara); + } + lcl_RstAttr(pCNd, pPara); // #i62675# check, if paragraph style has changed if ( pPara->bResetListAttrs && - pFormat != pCNd->GetFormatColl() && - pFormat->GetItemState( RES_PARATR_NUMRULE ) == SfxItemState::SET ) + (pPara->bResetAllCharAttrs || pFormat != pCNd->GetFormatColl()) + && pCNd->GetTextNode()->IsInList() ) { // Check, if the list style of the paragraph will change. bool bChangeOfListStyleAtParagraph( true ); @@ -1039,7 +1055,7 @@ static bool lcl_SetTextFormatColl( SwNode* pNode, void* pArgs ) if ( pNumRuleAtParagraph ) { const SwNumRuleItem& rNumRuleItemAtParagraphStyle = - pFormat->GetNumRule(); + rTNd.GetTextColl()->GetNumRule(); if ( rNumRuleItemAtParagraphStyle.GetValue() == pNumRuleAtParagraph->GetName() ) { @@ -1092,6 +1108,7 @@ bool SwDoc::SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset, const bool bResetListAttrs, + const bool bResetAllCharAttrs, SwRootFrame const*const pLayout) { SwDataChanged aTmp( rRg ); @@ -1108,12 +1125,20 @@ bool SwDoc::SetTextFormatColl(const SwPaM &rRg, GetIDocumentUndoRedo().AppendUndo(std::move(pUndo)); } + std::shared_ptr<SfxItemSet> pDelSet; sw::DocumentContentOperationsManager::ParaRstFormat aPara( pStt, pEnd, pHst, nullptr, pLayout); aPara.pFormatColl = pFormat; aPara.bReset = bReset; // #i62675# aPara.bResetListAttrs = bResetListAttrs; + aPara.bResetAllCharAttrs = bResetAllCharAttrs; + if (bResetAllCharAttrs) + { + o3tl::sorted_vector<sal_uInt16> aAttribs; + pDelSet = sw::DocumentContentOperationsManager::lcl_createDelSet(*this); + aPara.pDelSet = pDelSet.get(); + } GetNodes().ForEach( pStt->GetNodeIndex(), pEnd->GetNodeIndex()+1, lcl_SetTextFormatColl, &aPara ); diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index b4ff11be973f..e2b7405047ae 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -261,7 +261,10 @@ void SwNoTextFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect cons FindFlyFrame()->GetContour( aPoly, true ) ) { - rRenderContext.SetClipRegion(vcl::Region(aPoly)); + // don't clip if related compatibility flag is set + const IDocumentSettingAccess& rIDSA = pSh->GetDoc()->getIDocumentSettingAccess(); + if (!rIDSA.get(DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON)) + rRenderContext.SetClipRegion(vcl::Region(aPoly)); bClip = false; } diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 09dd83c5b22d..0342c761e5a4 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -2208,7 +2208,8 @@ void SwEditShell::ClassifyDocPerHighestParagraphClass() // #i62675# void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat, - const bool bResetListAttrs) + const bool bResetListAttrs, + SetAttrMode nMode) { SwTextFormatColl *pLocal = pFormat? pFormat: (*GetDoc()->GetTextFormatColls())[0]; StartAllAction(); @@ -2238,7 +2239,7 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat, } // Change the paragraph style to pLocal and remove all direct paragraph formatting. - GetDoc()->SetTextFormatColl(rPaM, pLocal, true, bResetListAttrs, GetLayout()); + GetDoc()->SetTextFormatColl(rPaM, pLocal, true, bResetListAttrs, !!(nMode & SetAttrMode::REMOVE_ALL_ATTR), GetLayout()); // If there are hints on the nodes which cover the whole node, then remove those, too. SwPaM aPaM(*rPaM.Start(), *rPaM.End()); diff --git a/sw/source/core/inc/DocumentContentOperationsManager.hxx b/sw/source/core/inc/DocumentContentOperationsManager.hxx index 3cb378f00069..62540462bb77 100644 --- a/sw/source/core/inc/DocumentContentOperationsManager.hxx +++ b/sw/source/core/inc/DocumentContentOperationsManager.hxx @@ -127,6 +127,7 @@ public: bool bReset; bool bResetListAttrs; // #i62575# bool bResetAll; + bool bResetAllCharAttrs; bool bInclRefToxMark; /// From the attributes included in the range, delete only the ones which have exactly same range. Don't delete the ones which are simply included in the range. bool bExactRange; @@ -144,13 +145,14 @@ public: , bReset(false) // #i62675# , bResetListAttrs(false) , bResetAll(true) + , bResetAllCharAttrs(false) , bInclRefToxMark(false) , bExactRange(false) { } }; static bool lcl_RstTextAttr( SwNode* pNd, void* pArgs ); //originally from docfmt.cxx - + static std::shared_ptr<SfxItemSet> lcl_createDelSet(SwDoc& rDoc); virtual ~DocumentContentOperationsManager() override; diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx index c1d08a15d068..94e142d8ff49 100644 --- a/sw/source/core/inc/DocumentSettingManager.hxx +++ b/sw/source/core/inc/DocumentSettingManager.hxx @@ -187,6 +187,8 @@ class DocumentSettingManager final : bool mbDropCapPunctuation; // tdf#150200, tdf#150438 bool mbUseVariableWidthNBSP : 1; // tdf#41652 bool mbPaintHellOverHeaderFooter : 1; // tdf#160198 + bool mbMinRowHeightInclBorder : 1; // tdf#155229 + bool mbNoClippingWithWrapPolygon : 1; // tdf#161233 public: diff --git a/sw/source/core/inc/bookmark.hxx b/sw/source/core/inc/bookmark.hxx index 8a3fc98f260c..29344910ec5a 100644 --- a/sw/source/core/inc/bookmark.hxx +++ b/sw/source/core/inc/bookmark.hxx @@ -246,6 +246,7 @@ namespace sw::mark { OUString GetContent() const override; void ReplaceContent(const OUString& sNewContent) override; + bool HasDefaultContent() const override; private: sw::DocumentContentOperationsManager* m_pDocumentContentOperationsManager; @@ -259,6 +260,8 @@ namespace sw::mark { NonTextFieldmark(const SwPaM& rPaM); void InitDoc(SwDoc& io_rDoc, sw::mark::InsertMode eMode, SwPosition const* pSepPos) override; void ReleaseDoc(SwDoc& rDoc) override; + + bool HasDefaultContent() const override; }; /// Fieldmark representing a checkbox form field. @@ -307,6 +310,7 @@ namespace sw::mark { void DelContent(sal_Int32 nDelIndex = -1) override; void ReplaceContent(const OUString* pText, sal_Int32* pIndex) override; void ReplaceContent(const OUString& sNewContent) override; + bool HasDefaultContent() const override; // This method should be called only by the portion so we can now the portion's painting area void SetPortionPaintArea(const SwRect& rPortionPaintArea); @@ -345,6 +349,7 @@ namespace sw::mark { std::pair<bool, double> GetCurrentDate() const override; void SetCurrentDate(double fDate) override; OUString GetDateInStandardDateFormat(double fDate) const override; + bool HasDefaultContent() const override; private: OUString GetDateInCurrentDateFormat(double fDate) const; diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 313f047ece98..7ffb15cdd2e7 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -443,7 +443,16 @@ void SwFlyFrame::InitDrawObj(SwFrame& rAnchorFrame) if (!rAnchorFrame.FindFooterOrHeader()) nHellId = rIDDMA.GetHeaderFooterHellId(); } + bool bNoClippingWithWrapPolygon = rIDSA.get(DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON); + if (bNoClippingWithWrapPolygon && isOpaque) + { + if (GetFrameFormat()->GetSurround().IsContour()) + { + GetVirtDrawObj()->SetLayer(nHellId); + return; + } + } GetVirtDrawObj()->SetLayer( isOpaque ? nHeavenId :nHellId ); } @@ -1050,10 +1059,11 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, { nHellId = rIDDMA.GetHeaderFooterHellId(); } - - const SdrLayerID nId = GetFormat()->GetOpaque().GetValue() ? - rIDDMA.GetHeavenId() : - nHellId; + bool bNoClippingWithWrapPolygon = rIDSA.get(DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON); + SdrLayerID nId = nHellId; + if (GetFormat()->GetOpaque().GetValue() && + !(bNoClippingWithWrapPolygon && GetFrameFormat()->GetSurround().IsContour())) + nId = rIDDMA.GetHeavenId(); GetVirtDrawObj()->SetLayer( nId ); if ( Lower() ) diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 857ed194efc3..cc8a8333b421 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -197,6 +197,8 @@ static bool lcl_InnerCalcLayout( SwFrame *pFrame, // cell height. static SwTwips lcl_CalcMinRowHeight( const SwRowFrame *pRow, const bool _bConsiderObjs ); +static sal_uInt16 lcl_GetTopSpace( const SwRowFrame& rRow ); + static SwTwips lcl_CalcTopAndBottomMargin( const SwLayoutFrame&, const SwBorderAttrs& ); static SwTwips lcl_calcHeightOfRowBeforeThisFrame(const SwRowFrame& rRow); @@ -4907,6 +4909,9 @@ static SwTwips lcl_CalcMinCellHeight( const SwLayoutFrame *_pCell, static SwTwips lcl_CalcMinRowHeight( const SwRowFrame* _pRow, const bool _bConsiderObjs ) { + //calc min height including width of horizontal border + const bool bMinRowHeightInclBorder = + _pRow->GetFormat()->GetDoc()->GetDocumentSettingManager().get(DocumentSettingId::MIN_ROW_HEIGHT_INCL_BORDER); SwTwips nHeight = 0; if ( !_pRow->IsRowSpanLine() ) { @@ -4948,6 +4953,11 @@ static SwTwips lcl_CalcMinRowHeight( const SwRowFrame* _pRow, { nHeight = rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*_pRow); } + if (bMinRowHeightInclBorder) + { + //get horizontal border(s) + nHeight += lcl_GetTopSpace(*_pRow); + } } } diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 06b7361550cf..6dd316ce7e46 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -891,7 +891,7 @@ void SwTextFormatter::CalcAscent( SwTextFormatInfo &rInf, SwLinePortion *pPor ) { pPor->SetHangingBaseline( rInf.GetHangingBaseline() ); pPor->SetAscent( rInf.GetAscent() ); - pPor->Height( rInf.GetTextHeight() ); + pPor->Height(rInf.GetTextHeight()); bCalc = true; } else @@ -1361,7 +1361,11 @@ SwTextPortion *SwTextFormatter::WhichTextPor( SwTextFormatInfo &rInf ) const if( !rInf.X() && !m_pCurr->GetNextPortion() && !m_pCurr->GetLen() && !GetFnt()->IsURL() ) pPor = m_pCurr; else + { pPor = new SwTextPortion; + if (pBM && pBM->GetFieldname() == ODF_FORMTEXT) + pPor->SetFieldmarkText(true); + } } } } diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 42ee5d051b5d..778f7e19b5e3 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -350,18 +350,23 @@ void SwLineLayout::CreateSpaceAdd( const tools::Long nInit ) // #i3952# Returns true if there are only blanks in [nStt, nEnd[ // Used to implement IgnoreTabsAndBlanksForLineCalculation compat flag -static bool lcl_HasOnlyBlanks(std::u16string_view rText, TextFrameIndex nStt, TextFrameIndex nEnd) +static bool lcl_HasOnlyBlanks(std::u16string_view rText, TextFrameIndex nStt, TextFrameIndex nEnd, + bool isFieldMarkPortion) { while ( nStt < nEnd ) { switch (rText[sal_Int32(nStt++)]) { case 0x0020: // SPACE - case 0x2002: // EN SPACE case 0x2003: // EM SPACE case 0x2005: // FOUR-PER-EM SPACE case 0x3000: // IDEOGRAPHIC SPACE continue; + case 0x2002: // EN SPACE : + if (isFieldMarkPortion) + return false; + else + continue; default: return false; } @@ -400,6 +405,12 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf ) bool bHasBlankPortion = false; bool bHasOnlyBlankPortions = true; + bool bHasTabPortions = false; + bool bHasNonBlankPortions = false; + SwTwips nTabPortionAscent = 0; + SwTwips nTabPortionHeight = 0; + SwTwips nSpacePortionAscent = 0; + SwTwips nSpacePortionHeight = 0; bool bHasFlyPortion = false; if( mpNextPortion ) @@ -452,15 +463,41 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf ) AddPrtWidth( pPos->Width() ); // #i3952# - if (bIgnoreBlanksAndTabsForLineHeightCalculation && !rInf.GetLineStart()) + if (bIgnoreBlanksAndTabsForLineHeightCalculation) { + bHasTabPortions |= pPos->InTabGrp(); + bool isSpacePortion = false; if ( pPos->InTabGrp() || pPos->IsHolePortion() || ( pPos->IsTextPortion() && - lcl_HasOnlyBlanks( rInf.GetText(), nPorSttIdx, nPorSttIdx + pPos->GetLen() ) ) ) + (isSpacePortion = lcl_HasOnlyBlanks( rInf.GetText(), nPorSttIdx, nPorSttIdx + pPos->GetLen(), + pPos->IsFieldmarkText() ) ) ) ) { pLast = pPos; + if (pPos->InTabGrp()) + { + if (nTabPortionAscent < pPos->GetAscent()) + { + nTabPortionAscent = pPos->GetAscent(); + } + if (nTabPortionHeight < pPos->Height()) + { + nTabPortionHeight = pPos->Height(); + } + } + else if (isSpacePortion) + { + if (nSpacePortionAscent < pPos->GetAscent()) + { + nSpacePortionAscent = pPos->GetAscent(); + } + if (nSpacePortionHeight < pPos->Height()) + { + nSpacePortionHeight = pPos->Height(); + } + bHasBlankPortion = true; + } + bTmpDummy &= !pPos->InTabGrp(); pPos = pPos->GetNextPortion(); - bHasBlankPortion = true; continue; } } @@ -479,6 +516,7 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf ) } bHasOnlyBlankPortions = false; + bHasNonBlankPortions = true; // We had an attribute change: Sum up/build maxima of length and mass @@ -648,20 +686,22 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf ) // #i3952# if ( bIgnoreBlanksAndTabsForLineHeightCalculation && - lcl_HasOnlyBlanks( rInf.GetText(), rInf.GetLineStart(), rInf.GetLineStart() + GetLen() ) ) + lcl_HasOnlyBlanks(rInf.GetText(), rInf.GetLineStart(), + rInf.GetLineStart() + GetLen(), + false)) { bHasBlankPortion = true; } else { bHasOnlyBlankPortions = false; - //bHasNonBlankPortions = true; + bHasNonBlankPortions = true; } } if (!rInf.IsNewLine() && TextFrameIndex(rInf.GetText().getLength()) <= rInf.GetIdx() - && bHasOnlyBlankPortions + && !bHasNonBlankPortions && rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get( DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH)) { @@ -671,6 +711,23 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf ) SetAscent(rInf.GetAscent()); Height(rInf.GetTextHeight()); } + else if (bIgnoreBlanksAndTabsForLineHeightCalculation && !bHasNonBlankPortions && + (bHasTabPortions || (bHasBlankPortion && (nSpacePortionAscent > 0 || nSpacePortionHeight > 0)))) + { + //Word increases line height if _only_ spaces and|or tabstops are in a line + if (bHasTabPortions) + { + mnAscent = nTabPortionAscent; + Height(nTabPortionHeight, true); + } + else if (bHasBlankPortion) + { + if( mnAscent < nSpacePortionAscent ) + mnAscent = nSpacePortionAscent; + if (Height() < nSpacePortionHeight) + Height(nSpacePortionHeight, true); + } + } // #i3952# Whitespace does not increase line height else if (bHasBlankPortion && bHasOnlyBlankPortions) { diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx index 845fcda08830..ec88383e73d1 100644 --- a/sw/source/core/text/porlin.cxx +++ b/sw/source/core/text/porlin.cxx @@ -68,7 +68,8 @@ SwLinePortion::SwLinePortion( ) : mnHangingBaseline( 0 ), mnWhichPor( PortionType::NONE ), m_bJoinBorderWithPrev(false), - m_bJoinBorderWithNext(false) + m_bJoinBorderWithNext(false), + m_bIsFieldmarkText(false) { } diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx index 9c9891101b23..56a9d7235c94 100644 --- a/sw/source/core/text/porlin.hxx +++ b/sw/source/core/text/porlin.hxx @@ -48,6 +48,7 @@ private: PortionType mnWhichPor; // Who's who? bool m_bJoinBorderWithPrev; bool m_bJoinBorderWithNext; + bool m_bIsFieldmarkText; SwTwips m_nExtraBlankWidth = 0; // width of spaces after the break SwTwips m_nExtraShrunkWidth = 0; // width of not shrunk line @@ -170,8 +171,10 @@ public: bool GetJoinBorderWithPrev() const { return m_bJoinBorderWithPrev; } bool GetJoinBorderWithNext() const { return m_bJoinBorderWithNext; } + bool IsFieldmarkText() const {return m_bIsFieldmarkText;} void SetJoinBorderWithPrev( const bool bJoinPrev ) { m_bJoinBorderWithPrev = bJoinPrev; } void SetJoinBorderWithNext( const bool bJoinNext ) { m_bJoinBorderWithNext = bJoinNext; } + void SetFieldmarkText(bool bSet) { m_bIsFieldmarkText = bSet; } virtual void dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText, TextFrameIndex& rOffset) const; diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index ab3a57e44778..92f0c8047bcb 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -4572,6 +4572,17 @@ bool SwTextNode::IsInList() const return GetNum() != nullptr && GetNum()->GetParent() != nullptr; } +bool SwTextNode::IsInListFromStyle() const +{ + if (IsInList()) + { + const SwFormatColl* pFormatColl = GetFormatColl(); + if (pFormatColl->GetItemState(RES_PARATR_NUMRULE, true) == SfxItemState::SET) + return true; + } + return false; + +} bool SwTextNode::IsFirstOfNumRule(SwRootFrame const& rLayout) const { bool bResult = false; diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index a1bfb0c0f3c1..c5ea7c8d7b53 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -381,7 +381,7 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess, * * @param nStt starting position * @param nLen length of the deletion - * @param nthat ??? + * @param nWhich ??? * @param pSet ??? * @param bInclRefToxMark ??? */ diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 85d1eee41ece..3b7de5a62821 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1379,9 +1379,13 @@ SdrObject *SwXFrame::GetOrCreateSdrObject(SwFlyFrameFormat &rFormat) const ::SwFormatSurround& rSurround = rFormat.GetSurround(); const IDocumentSettingAccess& rIDSA = pDoc->getIDocumentSettingAccess(); bool isPaintHellOverHF = rIDSA.get(DocumentSettingId::PAINT_HELL_OVER_HEADER_FOOTER); + bool bNoClippingWithWrapPolygon = rIDSA.get(DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON); - //TODO: HeaderFooterHellId only appropriate if object is anchored in body - pObject->SetLayer( + if (bNoClippingWithWrapPolygon && rSurround.IsContour()) + pObject->SetLayer(pDoc->getIDocumentDrawModelAccess().GetHellId()); + else + //TODO: HeaderFooterHellId only appropriate if object is anchored in body + pObject->SetLayer( ( css::text::WrapTextMode_THROUGH == rSurround.GetSurround() && !rFormat.GetOpaque().GetValue() ) ? isPaintHellOverHF diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index 95ae9cec3419..35bf15bdc48c 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -250,6 +250,7 @@ void SwPagePreviewLayout::ApplyNewZoomAtViewShell( sal_uInt8 _aNewZoom ) */ void SwPagePreviewLayout::ReInit() { + mbPrintEmptyPages = mrParentViewShell.getIDocumentDeviceAccess().getPrintData().IsPrintEmptyPages(); // check environment and parameters { bool bLayoutSettingsValid = mbLayoutInfoValid && mbLayoutSizesValid; @@ -388,6 +389,9 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum, mnPaintPhyStartPageNum = mnPages; mbNoPageVisible = true; } + + mnPaintPhyStartPageNum = ConvertRelativeToAbsolutePageNum( + mnPaintPhyStartPageNum ); } // set starting column and starting row mnPaintStartCol = nColOfProposed; diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 97420da84945..909a7802f7a9 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -607,8 +607,8 @@ public: bool IsValidSel(const EditEngine& rEngine, const ESelection& rSel) { const auto nParaCount = rEngine.GetParagraphCount(); - if (rSel.nStartPara < nParaCount && rSel.nEndPara < nParaCount) - return rSel.nStartPos >= 0 && rSel.nEndPos >= 0; + if (rSel.start.nPara < nParaCount && rSel.end.nPara < nParaCount) + return rSel.start.nIndex >= 0 && rSel.end.nIndex >= 0; return false; } } @@ -690,7 +690,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp, nTextStart - nStartCp)); sal_Int32 nParaCount = m_pDrawEditEngine->GetParagraphCount(); - bool bBadSelection = aReplaceSel.nStartPara >= nParaCount || aReplaceSel.nEndPara >= nParaCount; + bool bBadSelection = aReplaceSel.start.nPara >= nParaCount || aReplaceSel.end.nPara >= nParaCount; SAL_WARN_IF(bBadSelection, "sw.ww8", "editengine has different amount of text than expected"); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 7d0e6c4c0233..587fb1ad2872 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1883,6 +1883,9 @@ void SwWW8ImplReader::ImportDop() DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND, true); m_rDoc.getIDocumentSettingAccess().set( DocumentSettingId::EMPTY_DB_FIELD_HIDES_PARA, false); + // tdf#155229 calculate minimum row height including horizontal border width + m_rDoc.getIDocumentSettingAccess().set( + DocumentSettingId::MIN_ROW_HEIGHT_INCL_BORDER, true); // Import Default Tabs tools::Long nDefTabSiz = m_xWDop->dxaTab; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index db57bc5455ce..d30ca4eeb61e 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1,3 +1,4 @@ + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. @@ -122,6 +123,15 @@ SwContentOptPage::SwContentOptPage(weld::Container* pPage, weld::DialogControlle , m_xFieldHiddenImg(m_xBuilder->weld_widget("lockhiddentextfield")) , m_xFieldHiddenParaCB(m_xBuilder->weld_check_button("hiddenparafield")) , m_xFieldHiddenParaImg(m_xBuilder->weld_widget("lockhiddenparafield")) + , m_xZoomFrame(m_xBuilder->weld_frame("zoomframe")) + , m_xZoomLatestRB(m_xBuilder->weld_radio_button("zoomlatest")) + , m_xZoomPreferredRB(m_xBuilder->weld_radio_button("zoompreferred")) + , m_xZoomOptimalRB(m_xBuilder->weld_radio_button("zoomoptimal")) + , m_xZoomWidthAndHeightRB(m_xBuilder->weld_radio_button("zoomfitwandh")) + , m_xZoomWidthRB(m_xBuilder->weld_radio_button("zoomfitw")) + , m_xZoom100RB(m_xBuilder->weld_radio_button("zoom100pc")) + , m_xZoomCustomRB(m_xBuilder->weld_radio_button("zoomcustom")) + , m_xZoomValue(m_xBuilder->weld_metric_spin_button("zoomvalue", FieldUnit::PERCENT)) { m_xShowOutlineContentVisibilityButton->connect_toggled(LINK(this, SwContentOptPage, ShowOutlineContentVisibilityButtonHdl)); @@ -133,6 +143,29 @@ SwContentOptPage::SwContentOptPage(weld::Container* pPage, weld::DialogControlle m_xSettingsLabel->hide(); m_xMetricLabel->hide(); m_xMetricLB->hide(); + + Link<weld::Toggleable&, void> aZoomLatestLink = LINK(this, SwContentOptPage, ZoomLatestHdl); + m_xZoomLatestRB->connect_toggled(aZoomLatestLink); + m_xZoomPreferredRB->connect_toggled(aZoomLatestLink); + Link<weld::Toggleable&, void> aZoomLink = LINK(this, SwContentOptPage, ZoomHdl); + m_xZoomOptimalRB->connect_toggled(aZoomLink); + m_xZoomWidthAndHeightRB->connect_toggled(aZoomLink); + m_xZoomWidthRB->connect_toggled(aZoomLink); + m_xZoom100RB->connect_toggled(aZoomLink); + m_xZoomCustomRB->connect_toggled(aZoomLink); + m_xZoomValue->set_range(MINZOOM, MAXZOOM, FieldUnit::PERCENT); + } + else + { + m_xZoomFrame->hide(); + m_xZoomLatestRB->hide(); + m_xZoomPreferredRB->hide(); + m_xZoomOptimalRB->hide(); + m_xZoomWidthAndHeightRB->hide(); + m_xZoomWidthRB->hide(); + m_xZoom100RB->hide(); + m_xZoomCustomRB->hide(); + m_xZoomValue->hide(); } if(!SvtCJKOptions::IsVerticalTextEnabled() ) @@ -285,6 +318,26 @@ void SwContentOptPage::Reset(const SfxItemSet* rSet) m_xFieldHiddenParaCB->set_active( pElemAttr->m_bShowHiddenPara ); m_xFieldHiddenParaCB->set_sensitive(!bReadOnly); m_xFieldHiddenParaImg->set_visible(bReadOnly); + + if (!bWebOptionsPage) + { + m_xZoomLatestRB->set_active(pElemAttr->IsDefaultZoom()); + m_xZoomPreferredRB->set_active(!pElemAttr->IsDefaultZoom()); + switch (pElemAttr->GetDefaultZoomType()) + { + case SvxZoomType::OPTIMAL: m_xZoomOptimalRB->set_active(true); break; + case SvxZoomType::WHOLEPAGE: m_xZoomWidthAndHeightRB->set_active(true); break; + case SvxZoomType::PAGEWIDTH: m_xZoomWidthRB->set_active(true); break; + case SvxZoomType::PERCENT: + m_xZoom100RB->set_active(pElemAttr->GetDefaultZoomValue() == 100); + m_xZoomCustomRB->set_active(pElemAttr->GetDefaultZoomValue() != 100); + break; + default: + break; + } + m_xZoomValue->set_value(pElemAttr->GetDefaultZoomValue(), FieldUnit::PERCENT); + ZoomLatestHdl(*m_xZoomLatestRB); + } } bReadOnly = !bWebOptionsPage ? officecfg::Office::Writer::Layout::Window::HorizontalRulerUnit::isReadOnly() : @@ -366,6 +419,27 @@ bool SwContentOptPage::FillItemSet(SfxItemSet* rSet) aElem.m_bFieldHiddenText = m_xFieldHiddenCB->get_active(); aElem.m_bShowHiddenPara = m_xFieldHiddenParaCB->get_active(); + if (m_xZoomLatestRB->is_visible()) + { + aElem.SetDefaultZoom(m_xZoomLatestRB->get_active()); + if (m_xZoomOptimalRB->get_active()) + aElem.SetDefaultZoomType(SvxZoomType::OPTIMAL); + else if (m_xZoomWidthAndHeightRB->get_active()) + aElem.SetDefaultZoomType(SvxZoomType::WHOLEPAGE); + else if (m_xZoomWidthRB->get_active()) + aElem.SetDefaultZoomType(SvxZoomType::PAGEWIDTH); + else if (m_xZoom100RB->get_active()) + { + aElem.SetDefaultZoomType(SvxZoomType::PERCENT); + aElem.SetDefaultZoomValue(100); + } + else + { + aElem.SetDefaultZoomType(SvxZoomType::PERCENT); + aElem.SetDefaultZoomValue(m_xZoomValue->get_value(FieldUnit::PERCENT)); + } + } + bool bRet = !pOldAttr || aElem != *pOldAttr; if(bRet) bRet = nullptr != rSet->Put(aElem); @@ -408,6 +482,30 @@ IMPL_LINK(SwContentOptPage, ShowOutlineContentVisibilityButtonHdl, weld::Togglea m_xTreatSubOutlineLevelsAsContent->set_sensitive(rBox.get_active()); } +IMPL_LINK_NOARG(SwContentOptPage, ZoomLatestHdl, weld::Toggleable&, void) +{ + bool bZoomPreferred = m_xZoomPreferredRB->get_active(); + m_xZoomOptimalRB->set_sensitive(bZoomPreferred); + m_xZoomWidthAndHeightRB->set_sensitive(bZoomPreferred); + m_xZoomWidthRB->set_sensitive(bZoomPreferred); + m_xZoom100RB->set_sensitive(bZoomPreferred); + m_xZoomCustomRB->set_sensitive(bZoomPreferred); + m_xZoomValue->set_sensitive(bZoomPreferred); + ZoomHdl(*m_xZoomOptimalRB); +} +IMPL_LINK_NOARG(SwContentOptPage, ZoomHdl, weld::Toggleable&, void) +{ + if (m_xZoomCustomRB->get_active() && m_xZoomCustomRB->get_sensitive()) + { + m_xZoomValue->set_sensitive(true); + m_xZoomValue->grab_focus(); + } + else + { + m_xZoomValue->set_sensitive(false); + } +} + // TabPage Printer additional settings SwAddPrinterTabPage::SwAddPrinterTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreSet) diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index fcae51d43fc7..dede6b88fa4b 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -1138,7 +1138,7 @@ void AddressMultiLineEdit::SetText( const OUString& rStr ) const OUString sPara = m_xEditEngine->GetText( nPara ); if (!sPara.isEmpty() && !sPara.endsWith(" ")) { - ESelection aPaM(nPara, sPara.getLength(), nPara, sPara.getLength()); + ESelection aPaM(nPara, sPara.getLength()); m_xEditEngine->QuickInsertText(u" "_ustr, aPaM); } for(;;) @@ -1166,8 +1166,7 @@ void AddressMultiLineEdit::SetText( const OUString& rStr ) sal_Int32 nLastLen = m_xEditEngine->GetText(nParaCount - 1).getLength(); if(nLastLen) { - int nPara = nParaCount ? nParaCount - 1 : 0; - ESelection aPaM(nPara, nLastLen, nPara, nLastLen); + ESelection aPaM(nParaCount - 1, nLastLen); m_xEditEngine->QuickInsertText(u"\n \n "_ustr, aPaM); } } @@ -1180,13 +1179,13 @@ void AddressMultiLineEdit::InsertNewEntry( const OUString& rStr ) { // insert new entry after current selected one. ESelection aSelection = m_xEditView->GetSelection(); - const sal_uInt32 nPara = aSelection.nStartPara; + const sal_uInt32 nPara = aSelection.start.nPara; std::vector<EECharAttrib> aAttribList; m_xEditEngine->GetCharAttribs(nPara, aAttribList); - sal_Int32 nIndex = aSelection.nEndPara; - const EECharAttrib* pAttrib = FindCharAttrib(aSelection.nStartPos, aAttribList); + sal_Int32 nIndex = aSelection.end.nPara; + const EECharAttrib* pAttrib = FindCharAttrib(aSelection.start.nIndex, aAttribList); if(nullptr != pAttrib) nIndex = pAttrib->nEnd; InsertNewEntryAtPosition( rStr, nPara, nIndex ); @@ -1203,7 +1202,7 @@ void AddressMultiLineEdit::InsertNewEntry( const OUString& rStr ) void AddressMultiLineEdit::InsertNewEntryAtPosition( const OUString& rStr, sal_uLong nPara, sal_uInt16 nIndex ) { - ESelection aInsertPos(nPara, nIndex, nPara, nIndex); + ESelection aInsertPos(nPara, nIndex); m_xEditEngine->QuickInsertText(rStr, aInsertPos); //restore the attributes @@ -1219,14 +1218,14 @@ void AddressMultiLineEdit::RemoveCurrentEntry() ESelection aSelection = m_xEditView->GetSelection(); std::vector<EECharAttrib> aAttribList; - m_xEditEngine->GetCharAttribs(aSelection.nStartPara, aAttribList); + m_xEditEngine->GetCharAttribs(aSelection.start.nPara, aAttribList); - const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.nStartPos, aAttribList); + const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.start.nIndex, aAttribList); if(pBeginAttrib && - (pBeginAttrib->nStart <= aSelection.nStartPos - && pBeginAttrib->nEnd >= aSelection.nEndPos)) + (pBeginAttrib->nStart <= aSelection.start.nIndex + && pBeginAttrib->nEnd >= aSelection.end.nIndex)) { - const sal_uInt32 nPara = aSelection.nStartPara; + const sal_uInt32 nPara = aSelection.start.nPara; ESelection aEntrySel(nPara, pBeginAttrib->nStart, nPara, pBeginAttrib->nEnd); m_xEditEngine->QuickInsertText(OUString(), aEntrySel); //restore the attributes @@ -1240,16 +1239,16 @@ void AddressMultiLineEdit::MoveCurrentItem(MoveItemFlags nMove) ESelection aSelection = m_xEditView->GetSelection(); std::vector<EECharAttrib> aAttribList; - m_xEditEngine->GetCharAttribs(aSelection.nStartPara, aAttribList); + m_xEditEngine->GetCharAttribs(aSelection.start.nPara, aAttribList); - const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.nStartPos, aAttribList); + const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.start.nIndex, aAttribList); if(!pBeginAttrib || - pBeginAttrib->nStart > aSelection.nStartPos || - pBeginAttrib->nEnd < aSelection.nEndPos) + pBeginAttrib->nStart > aSelection.start.nIndex || + pBeginAttrib->nEnd < aSelection.end.nIndex) return; //current item has been found - sal_Int32 nPara = aSelection.nStartPara; + sal_Int32 nPara = aSelection.start.nPara; sal_Int32 nIndex = pBeginAttrib->nStart; ESelection aEntrySel(nPara, pBeginAttrib->nStart, nPara, pBeginAttrib->nEnd); const OUString sCurrentItem = m_xEditEngine->GetText(aEntrySel); @@ -1277,7 +1276,7 @@ void AddressMultiLineEdit::MoveCurrentItem(MoveItemFlags nMove) { //go right to find a successor or simple text ++nIndex; - const EECharAttrib* pEndAttrib = FindCharAttrib(aSelection.nStartPos, aAttribList); + const EECharAttrib* pEndAttrib = FindCharAttrib(aSelection.start.nIndex, aAttribList); if(pEndAttrib && pEndAttrib->nEnd >= nIndex) { nIndex = pEndAttrib->nEnd; @@ -1299,7 +1298,7 @@ void AddressMultiLineEdit::MoveCurrentItem(MoveItemFlags nMove) { auto nInsPara = nPara - 1; auto nInsPos = m_xEditEngine->GetTextLen( nPara - 1 ); - ESelection aTemp(nInsPara, nInsPos, nInsPara, nInsPos); + ESelection aTemp(nInsPara, nInsPos); m_xEditEngine->QuickInsertText(u"\n"_ustr, aTemp); } InsertNewEntryAtPosition( sCurrentItem, nPara, nIndex ); @@ -1320,18 +1319,18 @@ MoveItemFlags AddressMultiLineEdit::IsCurrentItemMoveable() const ESelection aSelection = m_xEditView->GetSelection(); std::vector<EECharAttrib> aAttribList; - m_xEditEngine->GetCharAttribs(aSelection.nStartPara, aAttribList); + m_xEditEngine->GetCharAttribs(aSelection.start.nPara, aAttribList); - const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.nStartPos, aAttribList); + const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.start.nIndex, aAttribList); if (pBeginAttrib && - (pBeginAttrib->nStart <= aSelection.nStartPos - && pBeginAttrib->nEnd >= aSelection.nEndPos)) + (pBeginAttrib->nStart <= aSelection.start.nIndex + && pBeginAttrib->nEnd >= aSelection.end.nIndex)) { if (pBeginAttrib->nStart) nRet |= MoveItemFlags::Left; //if there is an entry it can always be move to the right and down nRet |= MoveItemFlags::Right | MoveItemFlags::Down; - if (aSelection.nStartPara > 0) + if (aSelection.start.nPara > 0) nRet |= MoveItemFlags::Up; } return nRet; @@ -1342,12 +1341,12 @@ bool AddressMultiLineEdit::HasCurrentItem() const ESelection aSelection = m_xEditView->GetSelection(); std::vector<EECharAttrib> aAttribList; - m_xEditEngine->GetCharAttribs(aSelection.nStartPara, aAttribList); + m_xEditEngine->GetCharAttribs(aSelection.start.nPara, aAttribList); - const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.nStartPos, aAttribList); + const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.start.nIndex, aAttribList); return (pBeginAttrib && - (pBeginAttrib->nStart <= aSelection.nStartPos - && pBeginAttrib->nEnd >= aSelection.nEndPos)); + (pBeginAttrib->nStart <= aSelection.start.nIndex + && pBeginAttrib->nEnd >= aSelection.end.nIndex)); } OUString AddressMultiLineEdit::GetCurrentItem() const @@ -1355,14 +1354,14 @@ OUString AddressMultiLineEdit::GetCurrentItem() const ESelection aSelection = m_xEditView->GetSelection(); std::vector<EECharAttrib> aAttribList; - m_xEditEngine->GetCharAttribs(aSelection.nStartPara, aAttribList); + m_xEditEngine->GetCharAttribs(aSelection.start.nPara, aAttribList); - const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.nStartPos, aAttribList); + const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.start.nIndex, aAttribList); if (pBeginAttrib && - (pBeginAttrib->nStart <= aSelection.nStartPos - && pBeginAttrib->nEnd >= aSelection.nEndPos)) + (pBeginAttrib->nStart <= aSelection.start.nIndex + && pBeginAttrib->nEnd >= aSelection.end.nIndex)) { - const sal_uInt32 nPara = aSelection.nStartPara; + const sal_uInt32 nPara = aSelection.start.nPara; ESelection aEntrySel(nPara, pBeginAttrib->nStart, nPara, pBeginAttrib->nEnd); return m_xEditEngine->GetText( aEntrySel ); } @@ -1374,14 +1373,14 @@ void AddressMultiLineEdit::SelectCurrentItem() ESelection aSelection = m_xEditView->GetSelection(); std::vector<EECharAttrib> aAttribList; - m_xEditEngine->GetCharAttribs(aSelection.nStartPara, aAttribList); + m_xEditEngine->GetCharAttribs(aSelection.start.nPara, aAttribList); - const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.nStartPos, aAttribList); + const EECharAttrib* pBeginAttrib = FindCharAttrib(aSelection.start.nIndex, aAttribList); if (pBeginAttrib && - (pBeginAttrib->nStart <= aSelection.nStartPos - && pBeginAttrib->nEnd >= aSelection.nEndPos)) + (pBeginAttrib->nStart <= aSelection.start.nIndex + && pBeginAttrib->nEnd >= aSelection.end.nIndex)) { - const sal_uInt32 nPara = aSelection.nStartPara; + const sal_uInt32 nPara = aSelection.start.nPara; ESelection aEntrySel(nPara, pBeginAttrib->nStart, nPara, pBeginAttrib->nEnd); m_xEditView->SetSelection(aEntrySel); Invalidate(); @@ -1575,8 +1574,8 @@ bool AddressMultiLineEdit::SetCursorLogicPosition(const Point& rPosition) ESelection aSelection = m_xEditView->GetSelection(); std::vector<EECharAttrib> aAttribList; - m_xEditEngine->GetCharAttribs(aSelection.nStartPara, aAttribList); - return FindCharAttrib(aSelection.nStartPos, aAttribList) == nullptr; + m_xEditEngine->GetCharAttribs(aSelection.start.nPara, aAttribList); + return FindCharAttrib(aSelection.start.nIndex, aAttribList) == nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index f690623a2dfa..c9a04729f094 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -127,6 +127,9 @@ void SwFieldVarPage::Reset(const SfxItemSet* ) m_xTypeLB->set_size_request(nWidth, nHeight); m_xSelectionLB->set_size_request(nWidth, nHeight); m_xFormatLB->set_size_request(nWidth, nHeight/2); + auto size = m_xValueED->get_widget().get_size_request(); + m_xValueED->get_widget().set_size_request(size.getWidth(), + m_xValueED->get_widget().get_height_rows(5)); const SwField* pCurField = GetCurField(); assert(pCurField && "<SwFieldVarPage::Reset(..)> - <SwField> instance missing!"); nTypeId = pCurField->GetTypeId(); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 535dc298dd5a..17b8a3728974 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -2809,7 +2809,7 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) if(m_nLevel < MAXLEVEL || rForm.GetTOXType() == TOX_AUTHORITIES) { // #i21237# - SwFormTokens aPattern = m_pForm->GetPattern(m_nLevel + 1); + SwFormTokens aPattern = m_pForm->GetPattern(o3tl::sanitizing_inc(m_nLevel)); bool bLastWasText = false; //assure alternating text - code - text SwTOXWidget* pSetActiveControl = nullptr; diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 38763d825e29..4905a49eba55 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -870,6 +870,8 @@ SwSvxNumBulletTabDialog::SwSvxNumBulletTabDialog(weld::Window* pParent, weld::Button* pButton = GetUserButton(); pButton->connect_clicked(LINK(this, SwSvxNumBulletTabDialog, RemoveNumberingHdl)); pButton->set_sensitive(m_rWrtSh.GetNumRuleAtCurrCursorPos() != nullptr); + weld::Button& pCancelButton = GetCancelButton(); + pCancelButton.connect_clicked(LINK(this, SwSvxNumBulletTabDialog, CancelHdl)); AddTabPage(u"singlenum"_ustr, RID_SVXPAGE_PICK_SINGLE_NUM ); AddTabPage(u"bullets"_ustr, RID_SVXPAGE_PICK_BULLET ); AddTabPage(u"outlinenum"_ustr, RID_SVXPAGE_PICK_NUM ); @@ -946,4 +948,11 @@ IMPL_LINK_NOARG(SwSvxNumBulletTabDialog, RemoveNumberingHdl, weld::Button&, void m_xDialog->response(RET_USER); } +IMPL_LINK_NOARG(SwSvxNumBulletTabDialog, CancelHdl, weld::Button&, void) +{ + PrepareCancel(); + + m_xDialog->response(RET_CANCEL); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx index f21fc733c92a..74d650ccf341 100644 --- a/sw/source/uibase/app/appopt.cxx +++ b/sw/source/uibase/app/appopt.cxx @@ -107,13 +107,17 @@ std::optional<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId ) aRet(GetPool()); aRet.Put( SwDocDisplayItem( aViewOpt ) ); - aRet.Put( SwElemItem( aViewOpt ) ); + SwElemItem aElemItem( aViewOpt ); if( bTextDialog ) { aRet.Put( SwShadowCursorItem( aViewOpt )); aRet.Put( SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aViewOpt.IsCursorInProtectedArea())); aRet.Put(SwFmtAidsAutoComplItem(aViewOpt)); + aElemItem.SetDefaultZoom(pPref->IsDefaultZoom()); + aElemItem.SetDefaultZoomType(pPref->GetDefaultZoomType()); + aElemItem.SetDefaultZoomValue(pPref->GetDefaultZoomValue()); } + aRet.Put( aElemItem ); if( pAppView ) { @@ -263,6 +267,12 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) if( const SwElemItem* pElemItem = rSet.GetItemIfSet( FN_PARAM_ELEM, false ) ) { pElemItem->FillViewOptions( aViewOpt ); + if (bTextDialog) + { + pPref->SetDefaultZoom(pElemItem->IsDefaultZoom()); + pPref->SetDefaultZoomType(pElemItem->GetDefaultZoomType()); + pPref->SetDefaultZoomValue(pElemItem->GetDefaultZoomValue()); + } // Outline-folding options if (SwWrtShell* pWrtShell = GetActiveWrtShell()) @@ -369,6 +379,12 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) if (pOpt) { *pOpt = *pAddPrinterAttr; + SwPagePreview* pPagePreview = dynamic_cast<SwPagePreview*>( SfxViewShell::Current()); + if( pPagePreview !=nullptr ) + { + pPagePreview->GetViewShell()->getIDocumentDeviceAccess().setPrintData(*pOpt); + pPagePreview->PrintSettingsChanged(); + } } } diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 315a0a8dbeb1..da822b7edd36 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -1201,8 +1201,12 @@ SfxStyleFamily SwDocShell::ApplyStyles(const OUString &rName, SfxStyleFamily nFa case SfxStyleFamily::Char: { SwFormatCharFormat aFormat(pStyle->GetCharFormat()); - pSh->SetAttrItem( aFormat, (nMode & KEY_SHIFT) ? - SetAttrMode::DONTREPLACE : SetAttrMode::DEFAULT ); + SetAttrMode nFlags = (nMode & KEY_SHIFT) ? + SetAttrMode::DONTREPLACE : SetAttrMode::DEFAULT; + if (nMode & KEY_MOD1) + nFlags |= SetAttrMode::REMOVE_ALL_ATTR; + pSh->SetAttrItem( aFormat, nFlags ); + break; } case SfxStyleFamily::Para: @@ -1219,7 +1223,7 @@ SfxStyleFamily SwDocShell::ApplyStyles(const OUString &rName, SfxStyleFamily nFa // #i62675# // clear also list attributes at affected text nodes, if paragraph // style has the list style attribute set. - pSh->SetTextFormatColl( pStyle->GetCollection(), true ); + pSh->SetTextFormatColl( pStyle->GetCollection(), true, (nMode & KEY_MOD1) ? SetAttrMode::REMOVE_ALL_ATTR : SetAttrMode::DEFAULT); } break; } diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx index 4f4bcd780e31..e131eb8b0a58 100644 --- a/sw/source/uibase/app/swmodul1.cxx +++ b/sw/source/uibase/app/swmodul1.cxx @@ -99,7 +99,7 @@ static void lcl_SetUIPrefs(const SwViewOption &rPref, SwView* pView, SwViewShell pView->CreateTab(); else pView->KillTab(); - + pView->SetZoom(rPref.GetZoomType(), rPref.GetZoom(), true); pView->GetPostItMgr()->PrepareView(true); } diff --git a/sw/source/uibase/config/cfgitems.cxx b/sw/source/uibase/config/cfgitems.cxx index 5b16a148f845..0557fd90bca8 100644 --- a/sw/source/uibase/config/cfgitems.cxx +++ b/sw/source/uibase/config/cfgitems.cxx @@ -104,6 +104,9 @@ SwElemItem::SwElemItem() : m_bShowChangesInMargin = m_bFieldHiddenText = m_bShowHiddenPara = false; + m_bDefaultZoom = true; + m_eDefaultZoomType = SvxZoomType::PERCENT; + m_nDefaultZoomValue = 100; } SwElemItem::SwElemItem(const SwViewOption& rVOpt) : @@ -123,6 +126,9 @@ SwElemItem::SwElemItem(const SwViewOption& rVOpt) : m_bShowChangesInMargin = rVOpt.IsShowChangesInMargin(); m_bFieldHiddenText = rVOpt.IsShowHiddenField(); m_bShowHiddenPara = rVOpt.IsShowHiddenPara(); + m_bDefaultZoom = false; + m_eDefaultZoomType = rVOpt.GetZoomType(); + m_nDefaultZoomValue = rVOpt.GetZoom(); } SwElemItem* SwElemItem::Clone( SfxItemPool* ) const @@ -149,7 +155,10 @@ bool SwElemItem::operator==( const SfxPoolItem& rAttr ) const m_bTreatSubOutlineLevelsAsContent == rItem.m_bTreatSubOutlineLevelsAsContent && m_bShowChangesInMargin == rItem.m_bShowChangesInMargin && m_bFieldHiddenText == rItem.m_bFieldHiddenText && - m_bShowHiddenPara == rItem.m_bShowHiddenPara); + m_bShowHiddenPara == rItem.m_bShowHiddenPara && + m_bDefaultZoom == rItem.m_bDefaultZoom && + m_eDefaultZoomType == rItem.m_eDefaultZoomType && + m_nDefaultZoomValue == rItem.m_nDefaultZoomValue ); } void SwElemItem::FillViewOptions( SwViewOption& rVOpt) const @@ -169,6 +178,12 @@ void SwElemItem::FillViewOptions( SwViewOption& rVOpt) const rVOpt.SetShowChangesInMargin( m_bShowChangesInMargin ); rVOpt.SetShowHiddenField(m_bFieldHiddenText ); rVOpt.SetShowHiddenPara(m_bShowHiddenPara ); + if (!m_bDefaultZoom) + { + rVOpt.SetZoomType(m_eDefaultZoomType); + if (m_eDefaultZoomType == SvxZoomType::PERCENT) + rVOpt.SetZoom(m_nDefaultZoomValue); + } } // CTOR for empty Item diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index d4c1849820d5..ea59c279b37e 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -57,7 +57,10 @@ SwMasterUsrPref::SwMasterUsrPref(bool bWeb) : m_aCursorConfig(*this), m_pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : nullptr), m_aFmtAidsAutoComplConfig(*this), - m_bApplyCharUnit(false) + m_bApplyCharUnit(false), + m_bUseDefaultZoom(true), + m_nDefaultZoomValue(100), + m_eDefaultZoomType(SvxZoomType::PERCENT) { if (comphelper::IsFuzzing()) { @@ -87,6 +90,8 @@ SwMasterUsrPref::~SwMasterUsrPref() const auto g_UpdateLinkIndex = 17; const auto g_DefaultAnchor = 25; +const auto g_ZoomType = 27; +const auto g_ZoomValue = 28; Sequence<OUString> SwContentViewConfig::GetPropertyNames() const { @@ -117,12 +122,17 @@ Sequence<OUString> SwContentViewConfig::GetPropertyNames() const "Display/ShowOutlineContentVisibilityButton", // 22 "Display/TreatSubOutlineLevelsAsContent", // 23 "Display/ShowChangesInMargin", // 24 - "Display/DefaultAnchor" // 25 + "Display/DefaultAnchor", // 25 + "Zoom/DefaultZoom", // 26 + "Zoom/ZoomType", // 27 + "Zoom/ZoomValue" //28 }; #if defined(__GNUC__) && !defined(__clang__) // clang 8.0.0 says strcmp isn't constexpr static_assert(std::strcmp("Update/Link", aPropNames[g_UpdateLinkIndex]) == 0); static_assert(std::strcmp("Display/DefaultAnchor", aPropNames[g_DefaultAnchor]) == 0); + static_assert(std::strcmp("Zoom/ZoomType", aPropNames[g_ZoomType]) == 0); + static_assert(std::strcmp("Zoom/ZoomValue", aPropNames[g_ZoomValue]) == 0); #endif const int nCount = m_bWeb ? 12 : SAL_N_ELEMENTS(aPropNames); Sequence<OUString> aNames(nCount); @@ -190,8 +200,13 @@ void SwContentViewConfig::ImplCommit() case 23: bVal = m_rParent.IsTreatSubOutlineLevelsAsContent(); break;// "Display/TreatSubOutlineLevelsAsContent" case 24: bVal = m_rParent.IsShowChangesInMargin(); break;// "Display/ShowChangesInMargin" case 25: pValues[nProp] <<= m_rParent.GetDefaultAnchor(); break;// "Display/DefaultAnchor" + //TODO: Save zoom preferred, zoom type, zoom value + case 26: bVal = m_rParent.IsDefaultZoom(); break;// "Zoom/DefaultZoom" + case 27:pValues[nProp] <<= static_cast<sal_Int32>(m_rParent.GetDefaultZoomType()); break; // "Zoom/ZoomType" + case 28: pValues[nProp] <<= static_cast<sal_Int32>(m_rParent.GetDefaultZoomValue()); break; // "Zoom/ZoomValue" } - if ((nProp != g_UpdateLinkIndex) && (nProp != g_DefaultAnchor)) + if ((nProp != g_UpdateLinkIndex) && (nProp != g_DefaultAnchor) && + (nProp != g_ZoomType) && (nProp != g_ZoomValue)) pValues[nProp] <<= bVal; } PutProperties(aNames, aValues); @@ -209,7 +224,7 @@ void SwContentViewConfig::Load() { if(pValues[nProp].hasValue()) { - bool bSet = ((nProp != g_UpdateLinkIndex) && (nProp != g_DefaultAnchor)) + bool bSet = ((nProp != g_UpdateLinkIndex) && (nProp != g_DefaultAnchor) && (nProp != g_ZoomType)&& (nProp != g_ZoomValue)) && *o3tl::doAccess<bool>(pValues[nProp]); switch(nProp) { @@ -251,6 +266,21 @@ void SwContentViewConfig::Load() m_rParent.SetDefaultAnchor(nSet); } break; // "Display/DefaultAnchor" + case 26: m_rParent.SetDefaultZoom(bSet); break; // "Zoom/DefaultZoom" + case 27: + { + sal_Int32 nSet = 0; + pValues[nProp] >>= nSet; + m_rParent.SetDefaultZoomType(static_cast<SvxZoomType>(nSet), true); + } + break; //"Zoom/ZoomType", // 27 + case 28: + { + sal_Int32 nSet = 0; + pValues[nProp] >>= nSet; + m_rParent.SetDefaultZoomValue(static_cast<sal_uInt16>(nSet), true); + } + break; //"Zoom/ZoomValue" } } } diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx index 9f91675381b2..65c96385f0e6 100644 --- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx @@ -805,9 +805,7 @@ bool SwSpellDialogChildWindow::SpellDrawText_Impl(SwWrtShell& rSh, svx::SpellPor { OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); ESelection aCurrentSelection = pOLV->GetSelection(); - if(m_pSpellState->m_aStartDrawingSelection.nEndPara < aCurrentSelection.nEndPara || - (m_pSpellState->m_aStartDrawingSelection.nEndPara == aCurrentSelection.nEndPara && - m_pSpellState->m_aStartDrawingSelection.nEndPos < aCurrentSelection.nEndPos)) + if (m_pSpellState->m_aStartDrawingSelection.end < aCurrentSelection.end) { bRet = false; rPortions.clear(); diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index d30a160f31f8..6ea211ec1826 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -426,12 +426,12 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject const & rText) GetOutlinerView()->InsertText(u"..."_ustr); GetOutlinerView()->InsertText(u"\"\n"_ustr); - GetOutlinerView()->SetSelection(ESelection(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL)); + GetOutlinerView()->SetSelection(ESelection::All()); SfxItemSet aAnswerSet( mrView.GetDocShell()->GetPool() ); aAnswerSet.Put(SvxFontHeightItem(200,80,EE_CHAR_FONTHEIGHT)); aAnswerSet.Put(SvxPostureItem(ITALIC_NORMAL,EE_CHAR_ITALIC)); GetOutlinerView()->SetAttribs(aAnswerSet); - GetOutlinerView()->SetSelection(ESelection(EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT,EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT)); + GetOutlinerView()->SetSelection(ESelection::AtEnd()); //remove all attributes and reset our standard ones GetOutlinerView()->GetEditView().RemoveAttribsKeepLanguages(true); diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index debca6ca43a6..c4c6879070bd 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -1003,8 +1003,7 @@ void SwAnnotationWin::DeactivatePostIt() if (GetOutlinerView()->GetEditView().HasSelection()) { ESelection aSelection = GetOutlinerView()->GetEditView().GetSelection(); - aSelection.nEndPara = aSelection.nStartPara; - aSelection.nEndPos = aSelection.nStartPos; + aSelection.CollapseToStart(); GetOutlinerView()->GetEditView().SetSelection(aSelection); } diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 7731e97caf45..9b4ce2074969 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -2431,10 +2431,9 @@ sal_uInt16 SwPostItMgr::SearchReplace(const SwFormatField &pField, const i18nuti { ESelection aOldSelection = pWin->GetOutlinerView()->GetSelection(); if (bSrchForward) - pWin->GetOutlinerView()->SetSelection(ESelection(0,0,0,0)); + pWin->GetOutlinerView()->SetSelection(ESelection(0, 0)); else - pWin->GetOutlinerView()->SetSelection( - ESelection(EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT,EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT)); + pWin->GetOutlinerView()->SetSelection(ESelection::AtEnd()); SvxSearchItem aItem(SID_SEARCH_ITEM ); aItem.SetSearchOptions(rSearchOptions); aItem.SetBackward(!bSrchForward); diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 28339dde0d42..f60cfd1607a5 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -5105,6 +5105,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) rCheckboxFm.Invalidate(); rSh.InvalidateWindows( SwRect(m_rView.GetVisArea()) ); } + else if ( fieldBM->GetFieldname( ) == ODF_FORMTEXT && + aContentAtPos.aFnd.pFieldmark->HasDefaultContent() ) + { + rSh.GotoFieldmark( aContentAtPos.aFnd.pFieldmark ); + } + } } else if ( IsAttrAtPos::InetAttr == aContentAtPos.eContentAtPos ) @@ -6087,7 +6093,7 @@ void SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) { OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); ESelection aSelection = pOLV->GetSelection(); - if(!aSelection.IsZero()) + if(aSelection != ESelection()) { SdrOutliner* pOutliner = pSdrView->GetTextEditOutliner(); bool bVertical = pOutliner->IsVertical(); @@ -6106,8 +6112,7 @@ void SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) else aEEPos -= rOutputArea.TopLeft(); - EPosition aDocPosition = rEditEng.FindDocPosition(aEEPos); - ESelection aCompare(aDocPosition.nPara, aDocPosition.nIndex); + ESelection aCompare(rEditEng.FindDocPosition(aEEPos)); // make it a forward selection - otherwise the IsLess/IsGreater do not work :-( aSelection.Adjust(); if(!(aCompare < aSelection) && !(aCompare > aSelection)) diff --git a/sw/source/uibase/inc/cfgitems.hxx b/sw/source/uibase/inc/cfgitems.hxx index 26cd004cebb4..7b839bf9e028 100644 --- a/sw/source/uibase/inc/cfgitems.hxx +++ b/sw/source/uibase/inc/cfgitems.hxx @@ -24,6 +24,7 @@ #include <printdata.hxx> #include <cmdid.h> +#include <sfx2/zoomitem.hxx> class SwModule; #ifdef DBG_UTIL @@ -83,6 +84,9 @@ class SW_DLLPUBLIC SwElemItem final : public SfxPoolItem bool m_bShowChangesInMargin :1; bool m_bFieldHiddenText :1; bool m_bShowHiddenPara :1; + bool m_bDefaultZoom :1; + SvxZoomType m_eDefaultZoomType; + sal_uInt16 m_nDefaultZoomValue; friend class SwContentOptPage; @@ -95,6 +99,15 @@ public: void FillViewOptions( SwViewOption& rVOpt) const; + bool IsDefaultZoom() const {return m_bDefaultZoom; } + void SetDefaultZoom(bool bSet) { m_bDefaultZoom = bSet; } + + SvxZoomType GetDefaultZoomType() const { return m_eDefaultZoomType; } + void SetDefaultZoomType(SvxZoomType eType) { m_eDefaultZoomType = eType; } + + sal_uInt16 GetDefaultZoomValue() const { return m_nDefaultZoomValue;} + void SetDefaultZoomValue(sal_Int16 nValue){ m_nDefaultZoomValue = nValue; } + }; // OS 12.01.95 diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx index 9dfa2bf9ea4f..1799ad3296cc 100644 --- a/sw/source/uibase/inc/num.hxx +++ b/sw/source/uibase/inc/num.hxx @@ -124,6 +124,7 @@ class SwSvxNumBulletTabDialog final : public SfxTabDialogController virtual short Ok() override; virtual void PageCreated(const OUString& rPageId, SfxTabPage& rPage) override; DECL_LINK(RemoveNumberingHdl, weld::Button&, void); + DECL_LINK(CancelHdl, weld::Button&, void); std::unique_ptr<weld::ComboBox> m_xDummyCombo; diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index d162a707dd67..6279b8ed153f 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -75,8 +75,20 @@ class SwContentOptPage final : public SfxTabPage std::unique_ptr<weld::CheckButton> m_xFieldHiddenParaCB; std::unique_ptr<weld::Widget> m_xFieldHiddenParaImg; + std::unique_ptr<weld::Frame> m_xZoomFrame; + std::unique_ptr<weld::RadioButton> m_xZoomLatestRB; + std::unique_ptr<weld::RadioButton> m_xZoomPreferredRB; + std::unique_ptr<weld::RadioButton> m_xZoomOptimalRB; + std::unique_ptr<weld::RadioButton> m_xZoomWidthAndHeightRB; + std::unique_ptr<weld::RadioButton> m_xZoomWidthRB; + std::unique_ptr<weld::RadioButton> m_xZoom100RB; + std::unique_ptr<weld::RadioButton> m_xZoomCustomRB; + std::unique_ptr<weld::MetricSpinButton> m_xZoomValue; + DECL_LINK(VertRulerHdl, weld::Toggleable&, void); DECL_LINK(ShowOutlineContentVisibilityButtonHdl, weld::Toggleable&, void); + DECL_LINK(ZoomHdl, weld::Toggleable&, void); + DECL_LINK(ZoomLatestHdl, weld::Toggleable&, void); public: SwContentOptPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); virtual ~SwContentOptPage() override; diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx index e14ff5d419e7..b024f9e59fe5 100644 --- a/sw/source/uibase/inc/pview.hxx +++ b/sw/source/uibase/inc/pview.hxx @@ -152,6 +152,8 @@ public: bool SetBookPreviewMode( const bool _bBookPreview ); virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override; + + void ReInit(); }; /** @@ -289,6 +291,8 @@ public: */ void SetVScrollbarThumbPos( const sal_uInt16 _nNewThumbPos ); + void PrintSettingsChanged(); + SwPagePreview(SfxViewFrame& rFrame, SfxViewShell*); virtual ~SwPagePreview() override; }; diff --git a/sw/source/uibase/inc/usrpref.hxx b/sw/source/uibase/inc/usrpref.hxx index 24d9c6a7a34b..764f52a1d457 100644 --- a/sw/source/uibase/inc/usrpref.hxx +++ b/sw/source/uibase/inc/usrpref.hxx @@ -168,6 +168,12 @@ class SwMasterUsrPref : public SwViewOption SwFmtAidsAutoComplConfig m_aFmtAidsAutoComplConfig; bool m_bApplyCharUnit; // apply_char_unit + + // Scale + bool m_bUseDefaultZoom; + sal_uInt16 m_nDefaultZoomValue; // percent. + SvxZoomType m_eDefaultZoomType; + public: SwMasterUsrPref(bool bWeb); ~SwMasterUsrPref(); @@ -262,6 +268,28 @@ public: } } + bool IsDefaultZoom() const { return m_bUseDefaultZoom;} + void SetDefaultZoom( bool bSet, bool bNoModify = false ) + { + m_bUseDefaultZoom = bSet; + if(!bNoModify) + m_aContentConfig.SetModified(); + } + sal_uInt16 GetDefaultZoomValue() const { return m_nDefaultZoomValue; } + void SetDefaultZoomValue ( sal_uInt16 nValue, bool bNoModify = false ) + { + m_nDefaultZoomValue = nValue; + if(!bNoModify) + m_aContentConfig.SetModified(); + } + SvxZoomType GetDefaultZoomType() const { return m_eDefaultZoomType;} + void SetDefaultZoomType( SvxZoomType eType, bool bNoModify = false ) + { + m_eDefaultZoomType = eType; + if(!bNoModify) + m_aContentConfig.SetModified(); + } + sal_Int32 GetDefTabInMm100() const { return m_nDefTabInMm100;} void SetDefTabInMm100( sal_Int32 nSet, bool bNoModify = false ) { diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index a7e3afe845a0..3edb6f315e89 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -382,7 +382,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) { // Select the field so that it will be deleted during insert ESelection aSel = pOLV->GetSelection(); - aSel.nEndPos++; + aSel.end.nIndex++; pOLV->SetSelection(aSel); } if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED) @@ -1854,8 +1854,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) // Erase selection ESelection aSel(pOLV->GetSelection()); - aSel.nStartPara = aSel.nEndPara; - aSel.nStartPos = aSel.nEndPos; + aSel.CollapseToEnd(); pOLV->SetSelection(aSel); // Restore old font diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 30a6883bf307..43e3e09cdc1a 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -291,29 +291,24 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq) //#i42732# - notify the edit window that from now on we do not use the input language rTmpEditWin.SetUseInputLanguage( false ); - std::function<void(SwPosition* sp, const IDocumentMarkAccess* pMarksAccess)> - NoEmptyTextField = [](SwPosition* sp, const IDocumentMarkAccess* pMarksAccess) + // Test Fieldmark when empty reset the Placeholders + const IDocumentMarkAccess* pMarksAccess = rSh.GetDoc()->getIDocumentMarkAccess(); + for (SwPaM &rPaM : rSh.GetCursor()->GetRingContainer()) { + const SwPosition* sp = rPaM.Start(); // Legacy text/combo/checkbox: never return read-only when inside these form fields. sw::mark::IFieldmark* pA = pMarksAccess->getInnerFieldmarkFor(*sp); if (pA != nullptr) { - bool fm = IDocumentMarkAccess::GetType(*pA) == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK; - if ((pA->GetContent().getLength() == 0) && fm) + if ((IDocumentMarkAccess::GetType(*pA) == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK) && + (pA->GetContent().getLength() == 0) + ) { pA->ReplaceContent(vEnSpaces); - }; + rSh.GotoFieldmark(pA); + } } - }; - - const IDocumentMarkAccess* pMarksAccess = rSh.GetDoc()->getIDocumentMarkAccess(); - for (SwPaM& rPaM : rSh.GetCursor()->GetRingContainer()) - { - auto [pStt, pEnd] = rPaM.StartEnd(); // SwPosition* - NoEmptyTextField(pStt, pMarksAccess); - NoEmptyTextField(pEnd, pMarksAccess); } - } void SwBaseShell::ExecClpbrd(SfxRequest &rReq) diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index e3dff9857c0a..1f2142151dbb 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -477,7 +477,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) { // Select field so that it will be deleted during insert ESelection aSel = pOLV->GetSelection(); - aSel.nEndPos++; + aSel.end.nIndex++; pOLV->SetSelection(aSel); } pOLV->InsertField(SvxFieldItem(aField, EE_FEATURE_FIELD)); @@ -1071,7 +1071,7 @@ void SwDrawTextShell::ExecClpbrd(SfxRequest const &rReq) OutlinerView* pOLV = m_pSdrView->GetTextEditOutlinerView(); ESelection aSel(pOLV->GetSelection()); - const bool bCopy = (aSel.nStartPara != aSel.nEndPara) || (aSel.nStartPos != aSel.nEndPos); + const bool bCopy = aSel.HasRange(); sal_uInt16 nId = rReq.GetSlot(); switch( nId ) { @@ -1151,8 +1151,7 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet) OutlinerView* pOLV = m_pSdrView->GetTextEditOutlinerView(); ESelection aSel(pOLV->GetSelection()); - const bool bCopy = (aSel.nStartPara != aSel.nEndPara) || - (aSel.nStartPos != aSel.nEndPos); + const bool bCopy = aSel.HasRange(); TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( &GetView().GetEditWin() ) ); const bool bPaste = aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index fb5191131e5a..1975393f6813 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -780,8 +780,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) // Remove selection ESelection aSel(pOLV->GetSelection()); - aSel.nStartPara = aSel.nEndPara; - aSel.nStartPos = aSel.nEndPos; + aSel.CollapseToEnd(); pOLV->SetSelection(aSel); // Restore old font diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx index 3bcdd618d0e5..bb7d4d969668 100644 --- a/sw/source/uibase/shells/langhelper.cxx +++ b/sw/source/uibase/shells/langhelper.cxx @@ -512,11 +512,11 @@ namespace SwLangHelper // string for guessing language // get the full text of the paragraph that the end of selection is in - OUString aText = rEditEngine->GetText(rDocSelection.nEndPos); + OUString aText = rEditEngine->GetText(rDocSelection.end.nIndex); if (!aText.isEmpty()) { sal_Int32 nStt = 0; - sal_Int32 nEnd = rDocSelection.nEndPos; + sal_Int32 nEnd = rDocSelection.end.nIndex; // at most 100 chars to the left... nStt = nEnd > 100 ? nEnd - 100 : 0; // ... and 100 to the right of the cursor position @@ -529,7 +529,7 @@ namespace SwLangHelper void SelectPara( EditView &rEditView, const ESelection &rCurSel ) { - ESelection aParaSel( rCurSel.nStartPara, 0, rCurSel.nStartPara, EE_TEXTPOS_ALL ); + ESelection aParaSel(rCurSel.start.nPara, 0, rCurSel.start.nPara, EE_TEXTPOS_MAX); rEditView.SetSelection( aParaSel ); } diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 60d536bec43a..9e7646c1b295 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -579,6 +579,10 @@ void SwPagePreviewWin::DataChanged( const DataChangedEvent& rDCEvt ) } } +void SwPagePreviewWin::ReInit() +{ + mpPgPreviewLayout->ReInit(); +} /** help method to execute SfxRequest FN_PAGEUP and FN_PAGEDOWN */ void SwPagePreview::ExecPgUpAndPgDown( const bool _bPgUp, SfxRequest* _pReq ) @@ -1390,6 +1394,12 @@ void SwPagePreview::SetVisArea( const tools::Rectangle &rRect ) m_pViewWin->Invalidate(); } +void SwPagePreview::PrintSettingsChanged() +{ + m_pViewWin->ReInit(); + ChgPage( SwPagePreviewWin::MV_DOC_STT ); +} + IMPL_LINK(SwPagePreview, HoriScrollHdl, weld::Scrollbar&, rScrollbar, void) { ScrollHdl(rScrollbar, true); @@ -1445,16 +1455,17 @@ void SwPagePreview::EndScrollHdl(weld::Scrollbar& rScrollbar, bool bHori) { if ( Help::IsQuickHelpEnabled() ) Help::ShowQuickHelp(m_pVScrollbar, tools::Rectangle(), OUString()); - if ( GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow() ) + SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout(); + if (pPagePreviewLay->DoesPreviewLayoutRowsFitIntoWindow() ) { // Scroll how many pages ?? - const sal_uInt16 nThmbPos = o3tl::narrowing<sal_uInt16>(rScrollbar.adjustment_get_value()); + const sal_uInt16 nThmbPos = pPagePreviewLay->ConvertRelativeToAbsolutePageNum( + o3tl::narrowing<sal_uInt16>(rScrollbar.adjustment_get_value()) ); // adjust to new preview functionality if( nThmbPos != m_pViewWin->SelectedPage() ) { // consider case that page <nThmbPos> // is already visible - SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout(); if ( pPagePreviewLay->IsPageVisible( nThmbPos ) ) { pPagePreviewLay->MarkNewSelectedPage( nThmbPos ); @@ -1464,29 +1475,11 @@ void SwPagePreview::EndScrollHdl(weld::Scrollbar& rScrollbar, bool bHori) else { // consider whether layout columns - // fit or not. - if ( !pPagePreviewLay->DoesPreviewLayoutColsFitIntoWindow() ) - { - m_pViewWin->SetSttPage( nThmbPos ); - m_pViewWin->SetSelectedPage( nThmbPos ); - ChgPage( SwPagePreviewWin::MV_SCROLL, false ); - // update scrollbars - ScrollViewSzChg(); - } - else - { - // correct scroll amount - const sal_Int16 nPageDiff = nThmbPos - m_pViewWin->SelectedPage(); - const sal_uInt16 nVisPages = m_pViewWin->GetRow() * m_pViewWin->GetCol(); - sal_Int16 nWinPagesToScroll = nPageDiff / nVisPages; - if ( nPageDiff % nVisPages ) - { - // decrease/increase number of preview pages to scroll - nPageDiff < 0 ? --nWinPagesToScroll : ++nWinPagesToScroll; - } - m_pViewWin->SetSelectedPage( nThmbPos ); - m_pViewWin->Scroll( 0, pPagePreviewLay->GetWinPagesScrollAmount( nWinPagesToScroll ) ); - } + m_pViewWin->SetSttPage( nThmbPos ); + m_pViewWin->SetSelectedPage( nThmbPos ); + ChgPage( SwPagePreviewWin::MV_SCROLL, false ); + // update scrollbars + ScrollViewSzChg(); } // update accessibility GetViewShell()->ShowPreviewSelection( nThmbPos ); @@ -1570,23 +1563,25 @@ void SwPagePreview::ScrollViewSzChg() SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout(); if ( pPagePreviewLay->IsPageVisible( m_pViewWin->SelectedPage() ) ) { - m_pVScrollbar->SetThumbPos( m_pViewWin->SelectedPage() ); + m_pVScrollbar->SetThumbPos( + pPagePreviewLay->ConvertAbsoluteToRelativePageNum(m_pViewWin->SelectedPage()) ); } else { - m_pVScrollbar->SetThumbPos( m_pViewWin->GetSttPage() ); + m_pVScrollbar->SetThumbPos( + pPagePreviewLay->ConvertAbsoluteToRelativePageNum(m_pViewWin->GetSttPage()) ); } m_pVScrollbar->SetLineSize( m_pViewWin->GetCol() ); m_pVScrollbar->SetPageSize( nVisPages ); // calculate and set scrollbar range - Range aScrollbarRange( 1, mnPageCount ); + Range aScrollbarRange( 1, pPagePreviewLay->GetMaxPreviewPages() ); // increase range by one, because left-top-corner is left blank. ++aScrollbarRange.Max(); // increase range in order to access all pages aScrollbarRange.Max() += ( nVisPages - 1 ); m_pVScrollbar->SetRange( aScrollbarRange ); - bShowVScrollbar = nVisPages < mnPageCount; + bShowVScrollbar = nVisPages < pPagePreviewLay->GetMaxPreviewPages(); } else //vertical scrolling by pixel { diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 4b211bbf5bc6..3efa69a5447e 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -908,12 +908,17 @@ SwView::SwView(SfxViewFrame& _rFrame, SfxViewShell* pOldSh) aUsrPref.SetZoomType( SvxZoomType::PERCENT ); aUsrPref.SetZoom( 100 ); } - if (rDocSh.IsPreview()) + else if (rDocSh.IsPreview()) { aUsrPref.SetZoomType( SvxZoomType::WHOLEPAGE ); aUsrPref.SetViewLayoutBookMode( false ); aUsrPref.SetViewLayoutColumns( 1 ); } + else if (!pUsrPref->IsDefaultZoom()) + { + aUsrPref.SetZoomType(pUsrPref->GetDefaultZoomType()); + aUsrPref.SetZoom(pUsrPref->GetDefaultZoomValue()); + } m_pWrtShell.reset(new SwWrtShell(rDoc, m_pEditWin, *this, &aUsrPref)); // creating an SwView from a SwPagePreview needs to // add the SwViewShell to the ring of the other SwViewShell(s) @@ -1572,7 +1577,8 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > ( pVOpt->GetViewLayoutColumns() != nViewLayoutColumns || pVOpt->IsViewLayoutBookMode() != bViewLayoutBookMode ); const bool bSetViewSettings = bGotZoomType && bGotZoomFactor && - ( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom ); + ( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom ) && + SW_MOD()->GetUsrPref(pVOpt->getBrowseMode())->IsDefaultZoom(); // In case we have a 'fixed' view layout of 2 or more columns, // we have to apply the view options *before* starting the action. diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index b6bd92579188..68d4a21cc87d 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -585,7 +585,7 @@ bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin, } // editing should start at the end of text, spell checking at the beginning ... - ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND); + ESelection aNewSelection(ESelection::AtEnd()); if (bSetSelectionToStart) aNewSelection = ESelection(); if (pView) diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 547339ec694f..bcc2f9e6663e 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -163,7 +163,9 @@ enum SwDocumentSettingsPropertyHandles HANDLE_APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH, HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH, HANDLE_DO_NOT_MIRROR_RTL_DRAW_OBJS, - HANDLE_PAINT_HELL_OVER_HEADER_FOOTER + HANDLE_PAINT_HELL_OVER_HEADER_FOOTER, + HANDLE_MIN_ROW_HEIGHT_INCL_BORDER, + HANDLE_NO_CLIPPING_WITH_WRAP_POLYGON, }; } @@ -274,6 +276,8 @@ static rtl::Reference<MasterPropertySetInfo> lcl_createSettingsInfo() { u"ApplyParagraphMarkFormatToEmptyLineAtEndOfParagraph"_ustr, HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH, cppu::UnoType<bool >::get(), 0 }, { OUString("DoNotMirrorRtlDrawObjs"), HANDLE_DO_NOT_MIRROR_RTL_DRAW_OBJS, cppu::UnoType<bool>::get(), 0 }, { OUString("PaintHellOverHeaderFooter"), HANDLE_PAINT_HELL_OVER_HEADER_FOOTER, cppu::UnoType<bool>::get(), 0 }, + { OUString("MinRowHeightInclBorder"), HANDLE_MIN_ROW_HEIGHT_INCL_BORDER, cppu::UnoType<bool>::get(), 0 }, + { u"NoClippingWithWrapPolygon"_ustr, HANDLE_NO_CLIPPING_WITH_WRAP_POLYGON, cppu::UnoType<bool>::get(), 0 }, /* * As OS said, we don't have a view when we need to set this, so I have to @@ -1182,6 +1186,22 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf DocumentSettingId::PAINT_HELL_OVER_HEADER_FOOTER, bTmp); } break; + case HANDLE_MIN_ROW_HEIGHT_INCL_BORDER: + { + bool bTmp; + if (rValue >>= bTmp) + mpDoc->getIDocumentSettingAccess().set( + DocumentSettingId::MIN_ROW_HEIGHT_INCL_BORDER, bTmp); + } + break; + case HANDLE_NO_CLIPPING_WITH_WRAP_POLYGON: + bool bTmp; + if (rValue >>= bTmp) + { + mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON, + bTmp); + } + break; default: throw UnknownPropertyException(OUString::number(rInfo.mnHandle)); } @@ -1775,6 +1795,18 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf DocumentSettingId::PAINT_HELL_OVER_HEADER_FOOTER); } break; + case HANDLE_MIN_ROW_HEIGHT_INCL_BORDER: + { + rValue <<= mpDoc->getIDocumentSettingAccess().get( + DocumentSettingId::MIN_ROW_HEIGHT_INCL_BORDER); + } + break; + case HANDLE_NO_CLIPPING_WITH_WRAP_POLYGON: + { + rValue <<= mpDoc->getIDocumentSettingAccess().get( + DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON); + } + break; default: throw UnknownPropertyException(OUString::number(rInfo.mnHandle)); } diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index d7e668634851..721d07e5b023 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1584,11 +1584,6 @@ void SwWrtShell::NumOrBulletOn(bool bNum) // Append the character template at the numbering. SwCharFormat* pChrFormat; SwDocShell* pDocSh = GetView().GetDocShell(); - // #i63395# - // Only apply user defined default bullet font - const vcl::Font* pFnt = numfunc::IsDefBulletFontUserDefined() - ? &numfunc::GetDefBulletFont() - : nullptr; if (bNum) { @@ -1615,13 +1610,14 @@ void SwWrtShell::NumOrBulletOn(bool bNum) if (! bNum) { - // #i63395# - // Only apply user defined default bullet font - if ( pFnt ) - { - aFormat.SetBulletFont( pFnt ); - } - aFormat.SetBulletChar( numfunc::GetBulletChar(nLvl) ); + uno::Sequence<OUString> aBulletSymbols( + officecfg::Office::Common::BulletsNumbering::DefaultBullets::get()); + uno::Sequence<OUString> aBulletSymbolsFonts( + officecfg::Office::Common::BulletsNumbering::DefaultBulletsFonts::get()); + aFormat.SetBulletChar(aBulletSymbols[0].toChar()); + vcl::Font aFont; + aFont.SetFamilyName(aBulletSymbolsFonts[0]); + aFormat.SetBulletFont(&aFont); aFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL); // #i93908# clear suffix for bullet lists aFormat.SetListFormat(u""_ustr, u""_ustr, nLvl); diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx b/sw/source/writerfilter/dmapper/DomainMapper.cxx index 75d4fddeaeaf..dd01c1b0a06d 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx @@ -150,6 +150,11 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon //paint background frames after header/footer when anchored in body m_pImpl->SetDocumentSettingsProperty(u"PaintHellOverHeaderFooter"_ustr,uno::Any(true)); m_pImpl->SetDocumentSettingsProperty(u"EmptyDbFieldHidesPara"_ustr,uno::Any(false)); + m_pImpl->SetDocumentSettingsProperty(u"IgnoreTabsAndBlanksForLineCalculation"_ustr,uno::Any(true)); + // calculate table row height with 'atLeast' including horizontal border width + m_pImpl->SetDocumentSettingsProperty(u"MinRowHeightInclBorder"_ustr,uno::Any(true)); + // tdf#161233 pictures with wrap polygon should not be clipped + m_pImpl->SetDocumentSettingsProperty(u"NoClippingWithWrapPolygon"_ustr, uno::Any(true)); } // Initialize RDF metadata, to be able to add statements during the import. @@ -3439,7 +3444,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) } break; case NS_ooxml::LN_tblEnd: - m_pImpl->m_StreamStateStack.top().nTableDepth--; + if (m_pImpl->m_StreamStateStack.top().nTableDepth > 0) + m_pImpl->m_StreamStateStack.top().nTableDepth--; break; case NS_ooxml::LN_tcStart: m_pImpl->m_StreamStateStack.top().nTableCellDepth++; diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx index 1a366dff4d2c..9f27890a26e9 100644 --- a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx @@ -244,9 +244,9 @@ struct TableInfo css::beans::PropertyValues aTableProperties; std::vector< PropertyIds > aTablePropertyIds; - TableInfo() - : nLeftBorderDistance(DEF_BORDER_DIST) - , nRightBorderDistance(DEF_BORDER_DIST) + explicit TableInfo(bool bOOXMLImport) + : nLeftBorderDistance(bOOXMLImport ? DEF_BORDER_DIST : 0) + , nRightBorderDistance(bOOXMLImport ? DEF_BORDER_DIST : 0) , nTopBorderDistance(0) , nBottomBorderDistance(0) , nTblLook(0x4a0) @@ -390,7 +390,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo PropertyMapPtr pMergedProperties = pStyleSheet->GetMergedInheritedProperties(pStyleSheetTable); table::BorderLine2 aBorderLine; - TableInfo rStyleInfo; + TableInfo rStyleInfo(m_rDMapper_Impl.IsOOXMLImport()); if (lcl_extractTableBorderProperty(pMergedProperties, PROP_TOP_BORDER, rStyleInfo, aBorderLine)) { aGrabBag[u"TableStyleTopBorder"_ustr] <<= aBorderLine; @@ -1414,7 +1414,7 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel) // If we want to make this table a floating one. std::vector<beans::PropertyValue> aFrameProperties = comphelper::sequenceToContainer<std::vector<beans::PropertyValue> > (m_rDMapper_Impl.getTableManager().getCurrentTablePosition()); - TableInfo aTableInfo; + TableInfo aTableInfo(m_rDMapper_Impl.IsOOXMLImport()); aTableInfo.nNestLevel = nestedTableLevel; // non-floating tables need floating in footnotes and endnotes, because diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableManager.cxx b/sw/source/writerfilter/dmapper/DomainMapperTableManager.cxx index 81d470076d80..cd08d83a8985 100644 --- a/sw/source/writerfilter/dmapper/DomainMapperTableManager.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapperTableManager.cxx @@ -147,6 +147,10 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) pPropMap->setValue( TablePropertyMap::TABLE_WIDTH_TYPE, text::SizeType::FIX ); pPropMap->setValue( TablePropertyMap::TABLE_WIDTH, m_nTableWidth ); m_bTableSizeTypeInserted = true; + // add current row width to add 'hidden' before inserting the table + TablePropertyMapPtr pRowPropMap( new TablePropertyMap ); + pRowPropMap->setValue( TablePropertyMap::TABLE_WIDTH, m_nTableWidth ); + insertRowProps(pRowPropMap); } else if( sal::static_int_cast<Id>(pMeasureHandler->getUnit()) == NS_ooxml::LN_Value_ST_TblWidth_pct ) { diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx index 988ee222370c..9a2aeba14ffb 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx @@ -319,6 +319,7 @@ static bool IsFieldNestingAllowed(const FieldContextPtr& pOuter, const FieldCont case FIELD_REF: case FIELD_PAGE: case FIELD_NUMPAGES: + case FIELD_SYMBOL: { // LO does not currently know how to evaluate these as conditions or results return false; @@ -8252,37 +8253,54 @@ void DomainMapper_Impl::CloseFieldCommand() break; case FIELD_SYMBOL: { - uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend; + FieldContextPtr pOuter = GetParentFieldContext(m_aFieldStack); OUString sSymbol( sal_Unicode( sFirstParam.startsWithIgnoreAsciiCase("0x") ? o3tl::toUInt32(sFirstParam.subView(2),16) : sFirstParam.toUInt32() ) ); - OUString sFont; - bool bHasFont = lcl_FindInCommand( pContext->GetCommand(), 'f', sFont); - if ( bHasFont ) + if (!pOuter || IsFieldNestingAllowed(pOuter, m_aFieldStack.back())) { - sFont = sFont.trim(); - if (sFont.startsWith("\"")) - sFont = sFont.copy(1); - if (sFont.endsWith("\"")) - sFont = sFont.copy(0,sFont.getLength()-1); - } - - + uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend; + OUString sFont; + bool bHasFont = lcl_FindInCommand( pContext->GetCommand(), 'f', sFont); + if ( bHasFont ) + { + sFont = sFont.trim(); + if (sFont.startsWith("\"")) + sFont = sFont.copy(1); + if (sFont.endsWith("\"")) + sFont = sFont.copy(0,sFont.getLength()-1); + } - if (xTextAppend.is()) - { - uno::Reference< text::XText > xText = xTextAppend->getText(); - uno::Reference< text::XTextCursor > xCrsr = xText->createTextCursor(); - if (xCrsr.is()) + if (xTextAppend.is()) { - xCrsr->gotoEnd(false); - xText->insertString(xCrsr, sSymbol, true); - uno::Reference< beans::XPropertySet > xProp( xCrsr, uno::UNO_QUERY ); - xProp->setPropertyValue(getPropertyName(PROP_CHAR_FONT_CHAR_SET), uno::Any(awt::CharSet::SYMBOL)); - if(bHasFont) + uno::Reference< text::XText > xText = xTextAppend->getText(); + uno::Reference< text::XTextCursor > xCrsr = xText->createTextCursor(); + if (xCrsr.is()) { - uno::Any aVal( sFont ); - xProp->setPropertyValue(getPropertyName(PROP_CHAR_FONT_NAME), aVal); - xProp->setPropertyValue(getPropertyName(PROP_CHAR_FONT_NAME_ASIAN), aVal); - xProp->setPropertyValue(getPropertyName(PROP_CHAR_FONT_NAME_COMPLEX), aVal); + xCrsr->gotoEnd(false); + xText->insertString(xCrsr, sSymbol, true); + uno::Reference< beans::XPropertySet > xProp( xCrsr, uno::UNO_QUERY ); + xProp->setPropertyValue(getPropertyName(PROP_CHAR_FONT_CHAR_SET), uno::Any(awt::CharSet::SYMBOL)); + if(bHasFont) + { + uno::Any aVal( sFont ); + xProp->setPropertyValue(getPropertyName(PROP_CHAR_FONT_NAME), aVal); + xProp->setPropertyValue(getPropertyName(PROP_CHAR_FONT_NAME_ASIAN), aVal); + xProp->setPropertyValue(getPropertyName(PROP_CHAR_FONT_NAME_COMPLEX), aVal); + + } + PropertyMapPtr pCharTopContext = GetTopContextOfType(CONTEXT_CHARACTER); + if (pCharTopContext.is()) + { + uno::Sequence<beans::PropertyValue> aValues + = pCharTopContext->GetPropertyValues( + /*bCharGrabBag=*/!IsInComments()); + OUString sFontName = getPropertyName(PROP_CHAR_FONT_NAME); + for (const beans::PropertyValue& rProperty : aValues) + { + if (!bHasFont || !rProperty.Name.startsWith(sFontName)) + xProp->setPropertyValue(rProperty.Name, rProperty.Value); + } + + } } } diff --git a/sw/source/writerfilter/dmapper/TableManager.cxx b/sw/source/writerfilter/dmapper/TableManager.cxx index 6a0c70a39f52..43a48b3313de 100644 --- a/sw/source/writerfilter/dmapper/TableManager.cxx +++ b/sw/source/writerfilter/dmapper/TableManager.cxx @@ -23,7 +23,7 @@ #include "DomainMapperTableHandler.hxx" #include "DomainMapper_Impl.hxx" #include "util.hxx" - +#include <comphelper/sequence.hxx> #include <comphelper/diagnose_ex.hxx> using namespace com::sun::star; @@ -373,6 +373,62 @@ void TableManager::startParagraphGroup() mnTableDepthNew = 0; } +void TableManager::HandleSmallerRows() +{ + TableData::Pointer_t pTableData = mTableDataStack.back(); + unsigned int nRows = pTableData->getRowCount(); + sal_Int32 nMaxRowWidth = 0; + bool bIsDiffRowWidth = false; + for (unsigned int nRow = 0; nRow < nRows; ++nRow) + { + RowData::Pointer_t pRowData = pTableData->getRow(nRow); + sal_Int32 nRowWidth = 0; + const TablePropertyMapPtr pRowProps = pRowData->getProperties(); + if (pRowProps) + pRowProps->getValue(TablePropertyMap::TABLE_WIDTH, nRowWidth); + if (nRowWidth == 0) + return; + if (nRowWidth > nMaxRowWidth) + { + if (nMaxRowWidth > 0) + bIsDiffRowWidth = true; + nMaxRowWidth = nRowWidth; + } + } + // + if (bIsDiffRowWidth) + { + uno::Reference<text::XTextAppendAndConvert> xTextAppendAndConvert( + mpTableDataHandler->getDomainMapperImpl().GetTopTextAppend(), uno::UNO_QUERY); + + for (unsigned int nRow = 0; nRow < nRows; ++nRow) + { + RowData::Pointer_t pRowData = pTableData->getRow(nRow); + sal_Int32 nRowWidth = 0; + pRowData->getProperties()->getValue(TablePropertyMap::TABLE_WIDTH, nRowWidth); + if (nRowWidth < nMaxRowWidth) + { + uno::Reference<text::XTextRange> xTextRange + = pRowData->getCellEnd(pRowData->getCellCount() - 1); + std::vector<beans::PropertyValue> aProperties; + //TODO: is there a simpler way to create a new paragraph behind the current cell and get that range back? + uno::Reference<text::XTextRange> xNewCellTextRange + = xTextAppendAndConvert->finishParagraphInsert( + comphelper::containerToSequence(aProperties), xTextRange); + uno::Reference<text::XTextCursor> xNewCellTextCursor + = xTextAppendAndConvert->createTextCursorByRange(xNewCellTextRange); + xNewCellTextCursor->collapseToEnd(); + xNewCellTextCursor->goRight(1, false); + + TablePropertyMapPtr pCellPropMap(new TablePropertyMap); + pRowData->addCell(xNewCellTextCursor, pCellPropMap); + pRowData->endCell(xNewCellTextCursor); + pRowData->getProperties()->setValue(TablePropertyMap::TABLE_WIDTH, nMaxRowWidth); + } + } + } +} + void TableManager::resolveCurrentTable() { #ifdef DBG_UTIL @@ -383,6 +439,8 @@ void TableManager::resolveCurrentTable() { try { + // add cells to the rows that are smaller than the maximum width + HandleSmallerRows(); TableData::Pointer_t pTableData = mTableDataStack.back(); unsigned int nRows = pTableData->getRowCount(); diff --git a/sw/source/writerfilter/dmapper/TableManager.hxx b/sw/source/writerfilter/dmapper/TableManager.hxx index f98c992a3595..18baf49c5333 100644 --- a/sw/source/writerfilter/dmapper/TableManager.hxx +++ b/sw/source/writerfilter/dmapper/TableManager.hxx @@ -332,6 +332,11 @@ private: void endRow(); /** + * Handle rows smaller than the table width and add 'hidden' cells + */ + void HandleSmallerRows(); + + /** Resolve the current table to the TableDataHandler. */ void resolveCurrentTable(); diff --git a/sw/source/writerfilter/filter/WriterFilter.cxx b/sw/source/writerfilter/filter/WriterFilter.cxx index 41410cba0205..ae86d79caf04 100644 --- a/sw/source/writerfilter/filter/WriterFilter.cxx +++ b/sw/source/writerfilter/filter/WriterFilter.cxx @@ -336,6 +336,8 @@ void WriterFilter::setTargetDocument(const uno::Reference<lang::XComponent>& xDo xSettings->setPropertyValue("DoNotMirrorRtlDrawObjs", uno::Any(true)); xSettings->setPropertyValue("ContinuousEndnotes", uno::Any(true)); + // tdf#161233 pictures with wrap polygon should not be clipped + xSettings->setPropertyValue(u"NoClippingWithWrapPolygon"_ustr, uno::Any(true)); } void WriterFilter::setSourceDocument(const uno::Reference<lang::XComponent>& xDoc) diff --git a/sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx b/sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx index 84022cfbe9d9..c874fdd12744 100644 --- a/sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx +++ b/sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx @@ -25,6 +25,7 @@ #include <oox/mathml/imexport.hxx> #include <oox/token/namespaces.hxx> #include <oox/shape/ShapeFilterBase.hxx> +#include <oox/vml/vmlshapecontext.hxx> #include <sal/log.hxx> #include <comphelper/embeddedobjectcontainer.hxx> #include <comphelper/propertyvalue.hxx> @@ -41,6 +42,8 @@ #include <comphelper/sequenceashashmap.hxx> #include "OOXMLPropertySet.hxx" #include <dmapper/GraphicHelpers.hxx> +#include <unodraw.hxx> +#include "ShadowContext.hxx" const sal_Unicode uCR = 0xd; const sal_Unicode uFtnEdnRef = 0x2; @@ -1988,7 +1991,26 @@ OOXMLFastContextHandlerWrapper::OOXMLFastContextHandlerWrapper rtl::Reference<OOXMLFastContextHandlerShape> const & xShapeHandler) : OOXMLFastContextHandler(pParent), mxWrappedContext(xContext), - mxShapeHandler(xShapeHandler) + mxShapeHandler(xShapeHandler), + mbIsWriterFrameDetected(false), + mbIsReplayTextBox(false) +{ + setId(pParent->getId()); + setToken(pParent->getToken()); + setPropertySet(pParent->getPropertySet()); +} + +OOXMLFastContextHandlerWrapper::OOXMLFastContextHandlerWrapper(OOXMLFastContextHandler * pParent, + rtl::Reference<ShadowContext> const & xShadowContext, + uno::Reference<XFastContextHandler> const& xParentContext, + rtl::Reference<OOXMLFastContextHandlerShape> const & xShapeHandler) + : OOXMLFastContextHandler(pParent), + mxWrappedContext(xShadowContext), + mxShapeHandler(xShapeHandler), + mxShadowContext(xShadowContext), + mxReplayParentContext(xParentContext), + mbIsWriterFrameDetected(false), + mbIsReplayTextBox(false) { setId(pParent->getId()); setToken(pParent->getToken()); @@ -2016,6 +2038,114 @@ void SAL_CALL OOXMLFastContextHandlerWrapper::endUnknownElement mxWrappedContext->endUnknownElement(Namespace, Name); } +void SAL_CALL OOXMLFastContextHandlerWrapper::endFastElement(::sal_Int32 Element) +{ + OOXMLFastContextHandler::endFastElement(Element); + if (mxShadowContext.is()) + { + mxWrappedContext = mxReplayParentContext; + mbIsReplayTextBox = true; + mbIsWriterFrameDetected = mxShadowContext->isWriterFrame(); + sal_uInt16 nLevel = mxShadowContext->getElementLevel(); + if (!nLevel) + { + std::deque<CallData>& callDataDeque = mxShadowContext->getCallData(); + std::deque<uno::Reference<xml::sax::XFastContextHandler>> aLocalHandlers; + for (auto callDataIt = callDataDeque.begin(); callDataIt != callDataDeque.end(); ++callDataIt) + { + switch (callDataIt->getType()) + { + case Init: + { + sal_Int32 nElement = callDataIt->getElement(); + css::uno::Reference<css::xml::sax::XFastAttributeList> rAttribs + = callDataIt->getAttributes(); + if (mbIsWriterFrameDetected) + { + oox::vml::ShapeContext* pShapeContext = dynamic_cast<oox::vml::ShapeContext*>(mxWrappedContext.get()); + if (pShapeContext) + pShapeContext->setWriterShape(); + } + uno::Reference< xml::sax::XFastContextHandler > newWrapper = lcl_createFastChildContext(nElement, rAttribs); + static_cast<OOXMLFastContextHandlerWrapper*>(newWrapper.get())->mbIsWriterFrameDetected = mbIsWriterFrameDetected; + aLocalHandlers.push_back(newWrapper); + } + break; + case ElementAttr: + { + sal_Int32 nElement = callDataIt->getElement(); + css::uno::Reference<css::xml::sax::XFastAttributeList> rAttrs + = callDataIt->getAttributes(); + auto xHandler = aLocalHandlers.back(); + if (xHandler) + xHandler->startFastElement(nElement, rAttrs); + } + break; + case Char: + { + const ::rtl::OUString& chars = callDataIt->getChars(); + auto xHandler = aLocalHandlers.back(); + if (xHandler) + xHandler->characters(chars); + } + break; + case EndElementAttr: + { + sal_Int32 nElement = callDataIt->getElement(); + auto xHandler = aLocalHandlers.back(); + if (xHandler) + xHandler->endFastElement(nElement); + aLocalHandlers.pop_back(); + } + break; + case Unknown: + { + const ::rtl::OUString& rNameSpace = callDataIt->getUnknownNameSpace(); + const ::rtl::OUString& rElement = callDataIt->getUnknownElement(); + css::uno::Reference<css::xml::sax::XFastAttributeList> rAttrs + = callDataIt->getAttributes(); + auto xHandler = aLocalHandlers.back(); + if (xHandler) + xHandler->startUnknownElement(rNameSpace, rElement, rAttrs); + } + break; + case EndUnknown: + { + const ::rtl::OUString& rNameSpace = callDataIt->getUnknownNameSpace(); + const ::rtl::OUString& rElement = callDataIt->getUnknownElement(); + auto xHandler = aLocalHandlers.back(); + if (xHandler) + xHandler->endUnknownElement(rNameSpace, rElement); + aLocalHandlers.pop_back(); + } + break; + case ElementContext: + { + sal_Int32 nElement = callDataIt->getElement(); + css::uno::Reference<css::xml::sax::XFastAttributeList> rAttrs + = callDataIt->getAttributes(); + uno::Reference< xml::sax::XFastContextHandler > newContext = aLocalHandlers.back()->createFastChildContext(nElement, rAttrs); + if (nElement == Token_t(NMSP_vml | XML_textbox)) + static_cast<OOXMLFastContextHandlerWrapper*>(newContext.get())->mbIsWriterFrameDetected = mbIsWriterFrameDetected; + aLocalHandlers.push_back(newContext); + } + break; + case UnknownContext: + { + const ::rtl::OUString& rNameSpace = callDataIt->getUnknownNameSpace(); + const ::rtl::OUString& rElement = callDataIt->getUnknownElement(); + css::uno::Reference<css::xml::sax::XFastAttributeList> rAttrs + = callDataIt->getAttributes(); + uno::Reference< xml::sax::XFastContextHandler > newContext = aLocalHandlers.back()->createUnknownChildContext(rNameSpace, rElement, rAttrs); + aLocalHandlers.push_back(newContext); + } + break; + } + } + } + } +} + uno::Reference< xml::sax::XFastContextHandler > SAL_CALL OOXMLFastContextHandlerWrapper::createUnknownChildContext (const OUString & Namespace, @@ -2066,12 +2196,17 @@ void OOXMLFastContextHandlerWrapper::lcl_startFastElement { if (mxWrappedContext.is()) mxWrappedContext->startFastElement(Element, Attribs); - - if (mxShapeHandler->isDMLGroupShape() - && (Element == Token_t(NMSP_wps | XML_txbx) - || Element == Token_t(NMSP_wps | XML_linkedTxbx))) - { - mpStream->startTextBoxContent(); + if (!mxShadowContext.is()) + { + bool bInTokens = mMyTokens.find(Element) != mMyTokens.end(); + if ((mxShapeHandler->isDMLGroupShape() + && (Element == Token_t(NMSP_wps | XML_txbx) + || Element == Token_t(NMSP_wps | XML_linkedTxbx))) + //TODO: why check for bInTokens + || (!bInTokens && mbIsWriterFrameDetected && Element == Token_t(NMSP_vml | XML_textbox))) + { + mpStream->startTextBoxContent(); + } } } @@ -2081,11 +2216,16 @@ void OOXMLFastContextHandlerWrapper::lcl_endFastElement if (mxWrappedContext.is()) mxWrappedContext->endFastElement(Element); - if (mxShapeHandler->isDMLGroupShape() - && (Element == Token_t(NMSP_wps | XML_txbx) - || Element == Token_t(NMSP_wps | XML_linkedTxbx))) + if (!mxShadowContext.is()) { - mpStream->endTextBoxContent(); + bool bInTokens = mMyTokens.find(Element) != mMyTokens.end(); + if ((mxShapeHandler->isDMLGroupShape() + && (Element == Token_t(NMSP_wps | XML_txbx) + || Element == Token_t(NMSP_wps | XML_linkedTxbx))) + || (!bInTokens && mbIsWriterFrameDetected && Element == Token_t(NMSP_vml | XML_textbox))) + { + mpStream->endTextBoxContent(); + } } } @@ -2095,6 +2235,10 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext const uno::Reference< xml::sax::XFastAttributeList > & Attribs) { uno::Reference< xml::sax::XFastContextHandler > xResult; + if (mxShadowContext.is() && !mbIsReplayTextBox) + { + return mxShadowContext->createFastChildContext(Element, Attribs); + } bool bInNamespaces = mMyNamespaces.find(oox::getNamespace(Element)) != mMyNamespaces.end(); bool bInTokens = mMyTokens.find( Element ) != mMyTokens.end( ); @@ -2115,11 +2259,34 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext } else if (mxWrappedContext.is() && !bSkipImages) { - rtl::Reference<OOXMLFastContextHandlerWrapper> pWrapper = - new OOXMLFastContextHandlerWrapper - (this, mxWrappedContext->createFastChildContext(Element, Attribs), - mxShapeHandler); - pWrapper->mMyNamespaces = mMyNamespaces; + rtl::Reference<OOXMLFastContextHandlerWrapper> pWrapper; + if (Element == (NMSP_vml | XML_textbox) && !mbIsReplayTextBox) + { + //TODO: change handling of drawingml, currently Writer frame only + rtl::Reference<ShadowContext> xShadowContext + = new ShadowContext(Element, Attribs); + pWrapper = new OOXMLFastContextHandlerWrapper(this, xShadowContext, mxWrappedContext, mxShapeHandler); + pWrapper->mMyNamespaces = mMyNamespaces; + //don't send shape here + bInTokens = false; + } + else + { + pWrapper = + new OOXMLFastContextHandlerWrapper + (this, mxWrappedContext->createFastChildContext(Element, Attribs), + mxShapeHandler); + if (mbIsWriterFrameDetected) + { + pWrapper->addNamespace(NMSP_doc); + pWrapper->addNamespace(NMSP_vmlWord); + pWrapper->addNamespace(NMSP_vmlOffice); + } + else + { + pWrapper->mMyNamespaces = mMyNamespaces; + } + } pWrapper->mMyTokens = mMyTokens; pWrapper->setPropertySet(getPropertySet()); xResult.set(pWrapper); @@ -2258,7 +2425,6 @@ Token_t OOXMLFastContextHandlerWrapper::getToken() const return nResult; } - /* class OOXMLFastContextHandlerLinear */ diff --git a/sw/source/writerfilter/ooxml/OOXMLFastContextHandler.hxx b/sw/source/writerfilter/ooxml/OOXMLFastContextHandler.hxx index 4dfb05d91503..0202dbb0c473 100644 --- a/sw/source/writerfilter/ooxml/OOXMLFastContextHandler.hxx +++ b/sw/source/writerfilter/ooxml/OOXMLFastContextHandler.hxx @@ -27,6 +27,7 @@ #include <rtl/ref.hxx> #include "OOXMLParserState.hxx" #include "OOXMLPropertySet.hxx" +#include "ShadowContext.hxx" namespace writerfilter::ooxml { @@ -494,9 +495,14 @@ public: OOXMLFastContextHandlerWrapper(OOXMLFastContextHandler * pParent, css::uno::Reference<css::xml::sax::XFastContextHandler> const & xContext, rtl::Reference<OOXMLFastContextHandlerShape> const & xShapeHandler); + OOXMLFastContextHandlerWrapper(OOXMLFastContextHandler * pParent, + rtl::Reference<ShadowContext> const & xContext, + css::uno::Reference<css::xml::sax::XFastContextHandler> const & xParentContext, + rtl::Reference<OOXMLFastContextHandlerShape> const & xShapeHandler); virtual ~OOXMLFastContextHandlerWrapper() override; // css::xml::sax::XFastContextHandler: + virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) override; virtual void SAL_CALL startUnknownElement(const OUString & Namespace, const OUString & Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs) override; virtual void SAL_CALL endUnknownElement(const OUString & Namespace, const OUString & Name) override; @@ -532,12 +538,18 @@ protected: virtual void setToken(Token_t nToken) override; virtual Token_t getToken() const override; + bool isWriterFrameDetected() const { return mbIsWriterFrameDetected;} + private: css::uno::Reference<css::xml::sax::XFastContextHandler> mxWrappedContext; rtl::Reference<OOXMLFastContextHandlerShape> mxShapeHandler; std::set<Id> mMyNamespaces; std::set<Token_t> mMyTokens; OOXMLPropertySet::Pointer_t mpPropertySet; + rtl::Reference<ShadowContext> const mxShadowContext; + css::uno::Reference<css::xml::sax::XFastContextHandler> mxReplayParentContext; + bool mbIsWriterFrameDetected; + bool mbIsReplayTextBox; OOXMLFastContextHandler * getFastContextHandler() const; }; diff --git a/sw/source/writerfilter/ooxml/ShadowContext.cxx b/sw/source/writerfilter/ooxml/ShadowContext.cxx new file mode 100644 index 000000000000..d850092c9adc --- /dev/null +++ b/sw/source/writerfilter/ooxml/ShadowContext.cxx @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#include "ShadowContext.hxx" +#include <ooxml/resourceids.hxx> +#include <oox/token/namespaces.hxx> + +namespace writerfilter::ooxml +{ +using namespace ::com::sun::star; +using namespace oox; +using namespace ::com::sun::star::xml::sax; + +ShadowContext::ShadowContext(::sal_Int32 nElement, + const uno::Reference<XFastAttributeList>& rAttribs) + : m_nElementLevel(0) + , m_bImportAsWriterFrame(false) +{ + CallData callData(m_nElementLevel, nElement, rAttribs, CallDataType::Init); + m_aCallDataDeque.push_back(callData); +} +ShadowContext::~ShadowContext() {} + +void ShadowContext::startFastElement( + ::sal_Int32 nElement, + const ::css::uno::Reference<::css::xml::sax::XFastAttributeList>& rAttribs) +{ + ++m_nElementLevel; + CallData callData(m_nElementLevel, nElement, rAttribs, CallDataType::ElementAttr); + m_aCallDataDeque.push_back(callData); + if (nElement == (oox::NMSP_doc | oox::XML_tbl)) + { + m_bImportAsWriterFrame = true; + } +} + +void ShadowContext::startUnknownElement( + const ::rtl::OUString& rNamespace, const ::rtl::OUString& rElement, + const ::css::uno::Reference<::css::xml::sax::XFastAttributeList>& rAttribs) +{ + ++m_nElementLevel; + CallData callData(m_nElementLevel, rNamespace, rElement, rAttribs, CallDataType::Unknown); + m_aCallDataDeque.push_back(callData); +} +void ShadowContext::endFastElement(::sal_Int32 nElement) +{ + --m_nElementLevel; + CallData callData(m_nElementLevel, nElement); + m_aCallDataDeque.push_back(callData); +} +void ShadowContext::endUnknownElement(const ::rtl::OUString& rNamespace, + const ::rtl::OUString& rElement) +{ + --m_nElementLevel; + CallData callData(m_nElementLevel, rNamespace, rElement); + m_aCallDataDeque.push_back(callData); +} +::css::uno::Reference<::css::xml::sax::XFastContextHandler> ShadowContext::createFastChildContext( + ::sal_Int32 nElement, + const ::css::uno::Reference<::css::xml::sax::XFastAttributeList>& rAttribs) +{ + CallData callData(m_nElementLevel, nElement, rAttribs, CallDataType::ElementContext); + m_aCallDataDeque.push_back(callData); + return this; +} +::css::uno::Reference<::css::xml::sax::XFastContextHandler> +ShadowContext::createUnknownChildContext( + const ::rtl::OUString& rNamespace, const ::rtl::OUString& rElement, + const ::css::uno::Reference<::css::xml::sax::XFastAttributeList>& rAttribs) +{ + CallData callData(m_nElementLevel, rNamespace, rElement, rAttribs, + CallDataType::UnknownContext); + m_aCallDataDeque.push_back(callData); + return this; +} +void ShadowContext::characters(const ::rtl::OUString& aChars) +{ + CallData callData(m_nElementLevel, aChars); + m_aCallDataDeque.push_back(callData); +} +} //namespace diff --git a/sw/source/writerfilter/ooxml/ShadowContext.hxx b/sw/source/writerfilter/ooxml/ShadowContext.hxx new file mode 100644 index 000000000000..d7e389d10abd --- /dev/null +++ b/sw/source/writerfilter/ooxml/ShadowContext.hxx @@ -0,0 +1,156 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <cppuhelper/implbase.hxx> +#include <com/sun/star/xml/sax/XFastContextHandler.hpp> +#include <sax/fastattribs.hxx> +#include <oox/helper/attributelist.hxx> +#include <oox/core/contexthandler.hxx> +#include <queue> + +namespace writerfilter::ooxml +{ +enum CallDataType +{ + Init, + ElementAttr, + Char, + EndElementAttr, + Unknown, + EndUnknown, + ElementContext, + UnknownContext +}; + +class CallData +{ + sal_uInt32 m_nLevel; + CallDataType m_eType; + sal_Int32 m_nElement; + css::uno::Reference<css::xml::sax::XFastAttributeList> m_aAttributes; + + //char + ::rtl::OUString m_aChars; + + //unknwon + ::rtl::OUString m_sNameSpace; + ::rtl::OUString m_sElement; + +public: + //Start unknown element or context + CallData(sal_uInt32 nLevel, const ::rtl::OUString& rNameSpace, const ::rtl::OUString& rElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& rAttributes, + CallDataType eType) + : m_nLevel(nLevel) + , m_eType(eType) + , m_aAttributes(new sax_fastparser::FastAttributeList(rAttributes)) + , m_sNameSpace(rNameSpace) + , m_sElement(rElement) + { + } + + //end unknown element + CallData(sal_uInt32 nLevel, const ::rtl::OUString& rNameSpace, const ::rtl::OUString& rElement) + : m_nLevel(nLevel) + , m_eType(CallDataType::EndUnknown) + , m_sNameSpace(rNameSpace) + , m_sElement(rElement) + { + } + + // start fast element + CallData(sal_uInt32 nLevel, sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& rAttributes, + CallDataType eType) + : m_nLevel(nLevel) + , m_eType(eType) + , m_nElement(nElement) + , m_aAttributes(new sax_fastparser::FastAttributeList(rAttributes)) + { + } + + // end fast element + CallData(sal_uInt32 nLevel, sal_Int32 nElement) + : m_nLevel(nLevel) + , m_eType(CallDataType::EndElementAttr) + , m_nElement(nElement) + { + } + + //chars + CallData(sal_uInt32 nLevel, const ::rtl::OUString& rChars) + : m_nLevel(nLevel) + , m_eType(CallDataType::Char) + , m_aChars(rChars) + { + } + + CallData(CallData const&) = default; + + sal_uInt32 getLevel() const { return m_nLevel; } + CallDataType getType() const { return m_eType; } + sal_Int32 getElement() const { return m_nElement; } + const ::rtl::OUString& getChars() { return m_aChars; } + css::uno::Reference<css::xml::sax::XFastAttributeList> getAttributes() const + { + return m_aAttributes; + } + const ::rtl::OUString& getUnknownNameSpace() const { return m_sNameSpace; } + const ::rtl::OUString& getUnknownElement() const { return m_sElement; } +}; +class ShadowContext : public ::oox::core::ContextHandler_BASE +{ +public: + explicit ShadowContext(::sal_Int32 Element, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& rAttribs); + virtual ~ShadowContext() override; + + //XFastContextHandler + virtual void SAL_CALL startFastElement( + ::sal_Int32 Element, + const ::css::uno::Reference<::css::xml::sax::XFastAttributeList>& Attribs) override; + virtual void SAL_CALL startUnknownElement( + const ::rtl::OUString& Namespace, const ::rtl::OUString& Name, + const ::css::uno::Reference<::css::xml::sax::XFastAttributeList>& Attribs) override; + virtual void SAL_CALL endFastElement(::sal_Int32 Element) override; + virtual void SAL_CALL endUnknownElement(const ::rtl::OUString& Namespace, + const ::rtl::OUString& Name) override; + virtual ::css::uno::Reference<::css::xml::sax::XFastContextHandler> + SAL_CALL createFastChildContext( + ::sal_Int32 Element, + const ::css::uno::Reference<::css::xml::sax::XFastAttributeList>& Attribs) override; + virtual ::css::uno::Reference<::css::xml::sax::XFastContextHandler> + SAL_CALL createUnknownChildContext( + const ::rtl::OUString& Namespace, const ::rtl::OUString& Name, + const ::css::uno::Reference<::css::xml::sax::XFastAttributeList>& Attribs) override; + virtual void SAL_CALL characters(const ::rtl::OUString& aChars) override; + + sal_uInt16 getElementLevel() const { return m_nElementLevel; } + bool isWriterFrame() const { return m_bImportAsWriterFrame; } + + std::deque<CallData>& getCallData() { return m_aCallDataDeque; } + +private: + std::deque<CallData> m_aCallDataDeque; + sal_uInt16 m_nElementLevel; + bool m_bImportAsWriterFrame; +}; +} diff --git a/sw/source/writerfilter/rtftok/rtfdispatchsymbol.cxx b/sw/source/writerfilter/rtftok/rtfdispatchsymbol.cxx index 9f5a465b993e..203307dc9384 100644 --- a/sw/source/writerfilter/rtftok/rtfdispatchsymbol.cxx +++ b/sw/source/writerfilter/rtftok/rtfdispatchsymbol.cxx @@ -294,6 +294,45 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) } } } + //Overwrite font size attribute on fill cells + RTFValue::Pointer_t pFontSize; + RTFValue::Pointer_t pFontSizeCs; + int nCell = 1; + for (Buf_t& rTableBufferElement : m_aTableBufferStack.back()) + { + if (BUFFER_CELLEND == std::get<0>(rTableBufferElement)) + ++nCell; + else if (nCell == nCellCount - 1) + { + if (BUFFER_PROPS_CHAR == std::get<0>(rTableBufferElement)) + { + tools::SvRef<writerfilter::rtftok::RTFValue> xPropValue + = std::get<1>(rTableBufferElement); + RTFSprms& rElementSprms = xPropValue->getSprms(); + pFontSize = rElementSprms.find(NS_ooxml::LN_EG_RPrBase_sz); + pFontSizeCs = rElementSprms.find(NS_ooxml::LN_EG_RPrBase_szCs); + } + } + } + + nCell = 1; + for (Buf_t& rTableBufferElement : m_aTableBufferStack.back()) + { + if (BUFFER_CELLEND == std::get<0>(rTableBufferElement)) + ++nCell; + //Remove paragraph spacing on fill cells + if (nCell == nCellCount && BUFFER_PROPS == std::get<0>(rTableBufferElement)) + { + tools::SvRef<writerfilter::rtftok::RTFValue> xPropValue + = std::get<1>(rTableBufferElement); + RTFSprms& rElementSprms = xPropValue->getSprms(); + rElementSprms.erase(NS_ooxml::LN_CT_PPrBase_spacing); + if (pFontSize) + rElementSprms.set(NS_ooxml::LN_EG_RPrBase_sz, pFontSize); + if (pFontSizeCs) + rElementSprms.set(NS_ooxml::LN_EG_RPrBase_szCs, pFontSizeCs); + } + } m_aStates.top().setTableRowWidthAfter(0); } diff --git a/sw/uiconfig/swriter/ui/fldvarpage.ui b/sw/uiconfig/swriter/ui/fldvarpage.ui index 94782577de46..06394222e6cc 100644 --- a/sw/uiconfig/swriter/ui/fldvarpage.ui +++ b/sw/uiconfig/swriter/ui/fldvarpage.ui @@ -44,11 +44,10 @@ <column type="gchararray"/> </columns> </object> - <!-- n-columns=3 n-rows=2 --> + <!-- n-columns=3 n-rows=4 --> <object class="GtkGrid" id="FieldVarPage"> - <property name="width-request">600</property> - <property name="height-request">300</property> <property name="visible">True</property> + <property name="width-request">700</property> <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> @@ -57,7 +56,7 @@ <property name="column-spacing">12</property> <property name="column-homogeneous">True</property> <child> - <!-- n-columns=4 n-rows=2 --> + <!-- n-columns=4 n-rows=3 --> <object class="GtkGrid" id="gdNameValue"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -139,6 +138,7 @@ <property name="left-attach">1</property> <property name="top-attach">1</property> <property name="width">2</property> + <property name="height">2</property> </packing> </child> <child> @@ -191,17 +191,24 @@ </object> <packing> <property name="left-attach">3</property> - <property name="top-attach">1</property> + <property name="top-attach">2</property> </packing> </child> <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="left-attach">0</property> <property name="top-attach">1</property> <property name="width">3</property> + <property name="height">3</property> </packing> </child> <child> diff --git a/sw/uiconfig/swriter/ui/viewoptionspage.ui b/sw/uiconfig/swriter/ui/viewoptionspage.ui index 7d1ba0354c27..2a569341b676 100644 --- a/sw/uiconfig/swriter/ui/viewoptionspage.ui +++ b/sw/uiconfig/swriter/ui/viewoptionspage.ui @@ -1,7 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.38.2 --> +<!-- Generated with glade 3.40.0 --> <interface domain="sw"> <requires lib="gtk+" version="3.20"/> + <object class="GtkAdjustment" id="adjustment2"> + <property name="upper">100</property> + <property name="step-increment">1</property> + <property name="page-increment">10</property> + </object> <object class="GtkBox" id="ViewOptionsPage"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -459,6 +464,105 @@ <property name="position">3</property> </packing> </child> + <child> + <object class="GtkFrame" id="outlineframe"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> + <child> + <!-- n-columns=2 n-rows=2 --> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-start">12</property> + <property name="margin-top">6</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> + <child> + <object class="GtkCheckButton" id="outlinecontentvisibilitybutton"> + <property name="label" translatable="yes" context="viewoptionspage|outlinecontentvisibilitybutton">_Show outline-folding buttons</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="outlinecontentvisibilitybutton-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="viewoptionspage|extended_tip|outlinecontentvisibilitybutton">Displays outline folding buttons on the left of the outline headings.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="suboutlinelevelsascontent"> + <property name="label" translatable="yes" context="viewoptionspage|suboutlinelevelscontent">Include sub _levels</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="margin-start">12</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="suboutlinelevelsascontent-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="viewoptionspage|extended_tip|suboutlinelevelsascontent">Displays the folding buttons of the outline sub levels.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockoutlinecontentvisibility"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locksuboutlinelevels"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="outlinelabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="viewoptionspage|outlinelabel">Outline Folding</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> </object> <packing> <property name="left-attach">0</property> @@ -766,92 +870,217 @@ </packing> </child> <child> - <object class="GtkFrame" id="outlineframe"> + <placeholder/> + </child> + <child> + <object class="GtkFrame" id="zoomframe"> <property name="visible">True</property> <property name="can-focus">False</property> <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=2 n-rows=2 --> + <!-- n-columns=2 n-rows=7 --> <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> <property name="margin-start">12</property> <property name="margin-top">6</property> - <property name="row-spacing">6</property> + <property name="margin-bottom">43</property> + <property name="row-spacing">7</property> <property name="column-spacing">6</property> <child> - <object class="GtkCheckButton" id="outlinecontentvisibilitybutton"> - <property name="label" translatable="yes" context="viewoptionspage|outlinecontentvisibilitybutton">_Show outline-folding buttons</property> + <object class="GtkRadioButton" id="zoomlatest"> + <property name="label" translatable="yes" context="zoomdialog|zoomlatest">Use latest setting</property> <property name="visible">True</property> <property name="can-focus">True</property> <property name="receives-default">False</property> <property name="use-underline">True</property> + <property name="active">True</property> <property name="draw-indicator">True</property> <child internal-child="accessible"> - <object class="AtkObject" id="outlinecontentvisibilitybutton-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="viewoptionspage|extended_tip|outlinecontentvisibilitybutton">Displays outline folding buttons on the left of the outline headings.</property> + <object class="AtkObject" id="zoomlatest-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="zoomdialog|extended_tip|zoomlatest">Uses the zoom setting that has been applied manually.</property> </object> </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">0</property> <property name="top-attach">0</property> </packing> </child> <child> - <object class="GtkCheckButton" id="suboutlinelevelsascontent"> - <property name="label" translatable="yes" context="viewoptionspage|suboutlinelevelscontent">Include sub _levels</property> + <object class="GtkRadioButton" id="zoompreferred"> + <property name="label" translatable="yes" context="zoomdialog|zoompreferred">Use preferred values</property> <property name="visible">True</property> <property name="can-focus">True</property> <property name="receives-default">False</property> - <property name="margin-start">12</property> <property name="use-underline">True</property> + <property name="active">True</property> <property name="draw-indicator">True</property> + <property name="group">zoomlatest</property> <child internal-child="accessible"> - <object class="AtkObject" id="suboutlinelevelsascontent-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="viewoptionspage|extended_tip|suboutlinelevelsascontent">Displays the folding buttons of the outline sub levels.</property> + <object class="AtkObject" id="zoompreferred-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="zoomdialog|extended_tip|zoompreferred">Applies preferred zoom settings to documents.</property> </object> </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">0</property> <property name="top-attach">1</property> </packing> </child> <child> - <object class="GtkImage" id="lockoutlinecontentvisibility"> - <property name="can-focus">False</property> - <property name="no-show-all">True</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="icon-name">res/lock.png</property> + <object class="GtkRadioButton" id="zoomoptimal"> + <property name="label" translatable="yes" context="zoomdialog|zoomoptimal">Optimal</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="margin-start">12</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="zoomoptimal-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="zoomdialog|extended_tip|zoomoptimal">Resizes the display to fit the width of the text in the document at the moment the command is started.</property> + </object> + </child> </object> <packing> <property name="left-attach">0</property> - <property name="top-attach">0</property> + <property name="top-attach">2</property> </packing> </child> <child> - <object class="GtkImage" id="locksuboutlinelevels"> - <property name="can-focus">False</property> - <property name="no-show-all">True</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="icon-name">res/lock.png</property> + <object class="GtkRadioButton" id="zoomfitwandh"> + <property name="label" translatable="yes" context="zoomdialog|zoomfitwandh">Fit width and height</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="margin-start">12</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <property name="group">zoomoptimal</property> + <child internal-child="accessible"> + <object class="AtkObject" id="zoomfitwandh-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="zoomdialog|extended_tip|zoomfitwandh">Displays the entire page on your screen.</property> + </object> + </child> </object> <packing> <property name="left-attach">0</property> - <property name="top-attach">1</property> + <property name="top-attach">3</property> </packing> </child> + <child> + <object class="GtkRadioButton" id="zoomfitw"> + <property name="label" translatable="yes" context="zoomdialog|zoomfitw">Fit width</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="margin-start">12</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <property name="group">zoomoptimal</property> + <child internal-child="accessible"> + <object class="AtkObject" id="zoomfitw-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="zoomdialog|extended_tip|zoomfitw">Displays the complete width of the document page. The top and bottom edges of the page may not be visible.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">4</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="zoom100pc"> + <property name="label" translatable="yes" context="zoomdialog|zomm100pc">100%</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="margin-start">12</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <property name="group">zoomoptimal</property> + <child internal-child="accessible"> + <object class="AtkObject" id="zomm100pc-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="zoomdialog|extended_tip|zomm100pc">Displays the document at its actual size.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">5</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="zoomcustom"> + <property name="label" translatable="yes" context="zoomdialog|zoomcustom">Custom: </property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="margin-start">12</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <property name="group">zoomoptimal</property> + <accessibility> + <relation type="label-for" target="zoomvalue"/> + </accessibility> + <child internal-child="accessible"> + <object class="AtkObject" id="zoomcustom-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="zoomdialog|extended_tip|zoomcustom">Enter the zoom factor at which you want to display the document. Enter a percentage in the box.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">6</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="zoomvalue"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="adjustment">adjustment2</property> + <accessibility> + <relation type="labelled-by" target="zoomcustom"/> + </accessibility> + <child internal-child="accessible"> + <object class="AtkObject" id="zoomvalue-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|zoomvalue">Enter the zoom factor at which you want to display the document. Enter a percentage in the box.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">6</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> <child type="label"> - <object class="GtkLabel" id="outlinelabel"> + <object class="GtkLabel" id="zoomlabel"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes" context="viewoptionspage|outlinelabel">Outline Folding</property> + <property name="label" translatable="yes" context="viewoptionspage|outlinelabel">Zoom</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -861,7 +1090,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </object> diff --git a/translations b/translations -Subproject 1a1fadf75b3e727666013ec60e68e3967a185e1 +Subproject fac87e8a8528e92869ea9c35d7e7b75584dc224 diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx index fac11693cfa0..df9dbecb8a54 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -211,6 +211,8 @@ #include <cppuhelper/weak.hxx> #include <cppuhelper/weakagg.hxx> #include <cppuhelper/weakref.hxx> +#include <editeng/ESelection.hxx> +#include <editeng/editengdllapi.h> #include <font/FontSelectPattern.hxx> #include <font/PhysicalFontCollection.hxx> #include <font/PhysicalFontFace.hxx> diff --git a/vcl/qa/unx/generic/generic.cxx b/vcl/qa/unx/generic/generic.cxx index 8b79d99e510a..22176c28633c 100644 --- a/vcl/qa/unx/generic/generic.cxx +++ b/vcl/qa/unx/generic/generic.cxx @@ -30,32 +30,40 @@ public: : UnoApiTest(u"/vcl/qa/unx/generic/data/"_ustr) { } + static OUString GetFallbackFont(const vcl::Font& rFont) + { + Size aSize(0, 3840); + float fExactHeight = 3840; + bool bNonAntialias = false; + vcl::font::FontSelectPattern aPattern(rFont, rFont.GetFamilyName(), aSize, fExactHeight, + bNonAntialias); + aPattern.maTargetName = rFont.GetFamilyName(); + psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); + OUString aMissingCodes; + + rMgr.Substitute(aPattern, aMissingCodes); + + return aPattern.maSearchName; + } }; CPPUNIT_TEST_FIXTURE(Test, testFontFallbackSerif) { + OUString sResolvedSerif = GetFallbackFont(vcl::Font("serif", Size(12, 12))); + // Given a font select pattern with a font name we don't bundle and with a serif family: vcl::Font aFont; aFont.SetFamilyName("IBM Plex Serif"); aFont.SetFamily(FAMILY_ROMAN); - Size aSize(0, 3840); - float fExactHeight = 3840; - bool bNonAntialias = false; - vcl::font::FontSelectPattern aPattern(aFont, aFont.GetFamilyName(), aSize, fExactHeight, - bNonAntialias); - aPattern.maTargetName = aFont.GetFamilyName(); - psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); - OUString aMissingCodes; - - // When substituting that font: - rMgr.Substitute(aPattern, aMissingCodes); + + OUString sPlexFallback = GetFallbackFont(aFont); // Then make sure we get a serif fallback: // Without the accompanying fix in place, this test would have failed with: // - Expected: Noto Serif (or DejaVu Serif) // - Actual : Noto Kufi Arabic // i.e. we got a sans fallback for a serif pattern, which is clearly poor. - CPPUNIT_ASSERT(aPattern.maSearchName.endsWith(u"Serif")); + CPPUNIT_ASSERT_EQUAL(sResolvedSerif, sPlexFallback); } CPPUNIT_TEST_FIXTURE(Test, testFontFallbackCaching) diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 3b4fd7c9c8db..f1c5f93ad20a 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1316,6 +1316,15 @@ bool Printer::SetPaperSizeUser( const Size& rSize ) bNeedToChange = maJobSetup.ImplGetConstData().GetPaperFormat() != PAPER_USER && maJobSetup.ImplGetConstData().GetPaperFormat() != aPaper; + + if (!bNeedToChange) + { + Size aPaperSize = GetPaperSizePixel(); + bNeedToChange = (aPageSize.Width() < aPageSize.Height() + && aPaperSize.Width() > aPaperSize.Height()) + || (aPageSize.Width() > aPageSize.Height() + && aPaperSize.Width() < aPaperSize.Height()); + } } if(bNeedToChange) diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 1111c1e86143..baf2b221adf3 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1688,6 +1688,11 @@ bool PrinterController::isUIOptionEnabled( const OUString& i_rProperty ) const return bEnabled; } +void PrinterController::setUIChoicesDisabled(const OUString& rPropName, css::uno::Sequence<sal_Bool>& rChoicesDisabled) +{ + mpImplData->maChoiceDisableMap[rPropName] = std::move(rChoicesDisabled); +} + bool PrinterController::isUIChoiceEnabled( const OUString& i_rProperty, sal_Int32 i_nValue ) const { bool bEnabled = true; diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index cb48bd636251..aaa5ebdf47f0 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1905,6 +1905,7 @@ IMPL_LINK(PrintDialog, ToggleHdl, weld::Toggleable&, rButton, void) { mxOrientationBox->set_sensitive( true ); mxOrientationBox->set_active( ORIENTATION_AUTOMATIC ); + updatePageSize(mxOrientationBox->get_active()); enableNupControls( true ); updateNupFromPages(); } @@ -1986,6 +1987,7 @@ IMPL_LINK( PrintDialog, SelectHdl, weld::ComboBox&, rBox, void ) maPController->resetPrinterOptions( false ); updateOrientationBox(); + updatePageSize(mxOrientationBox->get_active()); // update text fields mxOKButton->set_label(maPrintText); @@ -2002,10 +2004,10 @@ IMPL_LINK( PrintDialog, SelectHdl, weld::ComboBox&, rBox, void ) setPaperSizes(); updateOrientationBox(); + updatePageSize(mxOrientationBox->get_active()); maUpdatePreviewIdle.Start(); } - updatePageSize(mxOrientationBox->get_active()); setupPaperSidesBox(); } else if ( &rBox == mxPaperSidesBox.get() ) @@ -2166,10 +2168,22 @@ IMPL_LINK( PrintDialog, UIOption_SelectHdl, weld::ComboBox&, i_rBox, void ) //n-up print, we will assume notes are in landscape unless we throw //away maFirstPageSize when we change page content type if (pVal->Name == "PageContentType") + { maFirstPageSize = Size(); + css::uno::Sequence<sal_Bool> aChoicesDisabled{ + false, // Original size + false, // Fit to printable page + (nVal == 2) /*Notes*/ ? true : false, // disable/enable Multiple sheets of paper + (nVal == 2) /*Notes*/ ? true : false // disable/enable Tile sheet of paper + }; + maPController->setUIChoicesDisabled(u"PageOptions"_ustr, aChoicesDisabled); + } + checkOptionalControlDependencies(); + updatePageSize(mxOrientationBox->get_active()); + // update preview and page settings maUpdatePreviewNoCacheIdle.Start(); } diff --git a/vcl/win/dtrans/ftransl.cxx b/vcl/win/dtrans/ftransl.cxx index 20056bba0ead..45dbb66696b8 100644 --- a/vcl/win/dtrans/ftransl.cxx +++ b/vcl/win/dtrans/ftransl.cxx @@ -338,6 +338,8 @@ const std::vector< FormatEntry > g_TranslTable { FormatEntry("image/bmp", "Windows Bitmap", nullptr, CF_INVALID, CPPUTYPE_DEFAULT), //SotClipboardFormatId::PNG FormatEntry("image/png", "PNG", nullptr, CF_INVALID, CPPUTYPE_DEFAULT), + //SotClipboardFormatId::SVG + FormatEntry("image/svg+xml", "image/svg+xml", nullptr, CF_INVALID, CPPUTYPE_DEFAULT), //SotClipboardFormatId::MATHML FormatEntry("application/mathml+xml", "MathML", nullptr, CF_INVALID, CPPUTYPE_DEFAULT), //SotClipboardFormatId::DUMMY3 diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 83c3a653b1ae..bd7badb82545 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -218,7 +218,7 @@ void WinSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout) const bool bVerticalScreenText = !mbPrinter && rLayout.GetFont().GetFontSelectPattern().mbVertical; const bool bRenderingModeNatural = rLayout.GetSubpixelPositioning(); - const bool bUseDWrite = bVerticalScreenText || bRenderingModeNatural; + const bool bUseDWrite = false; DrawTextLayout(rLayout, hDC, bUseDWrite, bRenderingModeNatural); ::SelectFont(hDC, hOrigFont); diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index c8885a695052..b500fbaf60ee 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -813,8 +813,8 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, } nScreenX = aRect.Left(); nScreenY = aRect.Top(); - nScreenDX = aRect.GetWidth(); - nScreenDY = aRect.GetHeight(); + nScreenDX = aRect.GetWidth() + 1; + nScreenDY = aRect.GetHeight() + 1; } catch( Exception& ) { diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 39ba7cc1b499..171c38c9ac45 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -1937,6 +1937,7 @@ namespace xmloff::token { TOKEN( "sub-view-size", XML_SUB_VIEW_SIZE ), TOKEN( "suffix", XML_SUFFIX ), TOKEN( "sum", XML_SUM ), + TOKEN( "summary-below", XML_SUMMARY_BELOW ), TOKEN( "swiss", XML_SWISS ), TOKEN( "symbol", XML_SYMBOL ), TOKEN( "symbol-height", XML_SYMBOL_HEIGHT ), @@ -2103,6 +2104,7 @@ namespace xmloff::token { TOKEN( "upright", XML_UPRIGHT ), TOKEN( "url", XML_URL ), TOKEN( "use", XML_USE ), + TOKEN( "use-autofilter", XML_USE_AUTOFILTER), TOKEN( "use-caption", XML_USE_CAPTION ), TOKEN( "use-cell-protection", XML_USE_CELL_PROTECTION ), TOKEN( "use-chart-objects", XML_USE_CHART_OBJECTS ), @@ -2120,6 +2122,7 @@ namespace xmloff::token { TOKEN( "use-optimal-column-width", XML_USE_OPTIMAL_COLUMN_WIDTH ), TOKEN( "use-optimal-row-height", XML_USE_OPTIMAL_ROW_HEIGHT ), TOKEN( "use-other-objects", XML_USE_OTHER_OBJECTS ), + TOKEN( "use-pivot", XML_USE_PIVOT), TOKEN( "use-spreadsheet-objects", XML_USE_SPREADSHEET_OBJECTS ), TOKEN( "use-styles", XML_USE_STYLES ), TOKEN( "use-tables", XML_USE_TABLES ), diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index 29aa2c055658..9bfe5dda2b8c 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -1837,6 +1837,7 @@ subtotal-rules sub-view-size suffix sum +summary-below swiss symbol symbol-height @@ -2003,6 +2004,7 @@ uplimit upright url use +use-autofilter use-caption use-cell-protection use-chart-objects @@ -2020,6 +2022,7 @@ use-objects use-optimal-column-width use-optimal-row-height use-other-objects +use-pivot use-spreadsheet-objects use-styles use-tables diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index 4d787529f9a8..f624aa52a31f 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -1360,137 +1360,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF) } } -/// Test if a macro signature from an OTT 1.0 is dropped for ODT 1.2 -CPPUNIT_TEST_FIXTURE(SigningTest, testDropMacroTemplateSignature) -{ - const OUString aURL(createFileURL(u"tdf42316.ott")); - const OUString sLoadMessage = "loading failed: " + aURL; - - // load the template as-is to validate signatures - mxComponent = loadFromDesktop( - aURL, OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - - // we are a template, and have a non-invalid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, - SignatureState::NOTVALIDATED, OUString()); - - // create new document from template - load(aURL); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); - - // we are somehow a template (?), and have just a valid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, - SignatureState::NOTVALIDATED, OUString()); - - // save as new ODT document - saveAndReload(u"writer8"_ustr); - - // the loaded document is a 1.2 ODT without any signatures - assertDocument(CPPUNIT_SOURCELINE(), u"writer8"_ustr, SignatureState::NOSIGNATURES, - SignatureState::NOSIGNATURES, ODFVER_013_TEXT); - - // load the template as-is to validate signatures - mxComponent->dispose(); - mxComponent = loadFromDesktop( - aURL, OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - - // we are a template, and have a non-invalid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, - SignatureState::NOTVALIDATED, OUString()); - - // save as new OTT template - save(u"writer8_template"_ustr); - - // load the template as-is to validate signatures - mxComponent->dispose(); - mxComponent - = loadFromDesktop(maTempFile.GetURL(), OUString(), - comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - - // the loaded document is a 1.2 OTT without any signatures - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, - SignatureState::NOSIGNATURES, ODFVER_013_TEXT); -} - -/// Test if a macro signature from a OTT 1.0 template is preserved for ODT 1.0 -CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature10) -{ - // set ODF version 1.0 / 1.1 as default - Resetter _([]() { - std::shared_ptr<comphelper::ConfigurationChanges> pBatch( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Save::ODF::DefaultVersion::set(3, pBatch); - return pBatch->commit(); - }); - std::shared_ptr<comphelper::ConfigurationChanges> pBatch( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Save::ODF::DefaultVersion::set(2, pBatch); - pBatch->commit(); - - const OUString aFormats[] = { u"writer8"_ustr, u"writer8_template"_ustr }; - - for (OUString const& sFormat : aFormats) - { - const OUString aURL(createFileURL(u"tdf42316.ott")); - const OUString sLoadMessage = "loading failed: " + aURL; - - // load the template as-is to validate signatures - mxComponent = loadFromDesktop( - aURL, OUString(), - comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - - // we are a template, and have a non-invalid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, - SignatureState::NOTVALIDATED, OUString()); - - // create new document from template - load(aURL); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); - - // we are somehow a template (?), and have just a valid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, - SignatureState::NOTVALIDATED, OUString()); - - // FIXME: Error: element "manifest:manifest" is missing "version" attribute - skipValidation(); - - if (sFormat == "writer8") - // save as new ODT document - saveAndReload(sFormat); - else - { - // save as new OTT template - save(u"writer8_template"_ustr); - - // load the saved OTT template as-is to validate signatures - mxComponent->dispose(); - mxComponent = loadFromDesktop( - maTempFile.GetURL(), OUString(), - comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - } - - assertDocument(CPPUNIT_SOURCELINE(), sFormat, SignatureState::NOSIGNATURES, - SignatureState::NOTVALIDATED, OUString()); - - save(u"writer8_template"_ustr); - - // load the template as-is to validate signatures - mxComponent->dispose(); - mxComponent = loadFromDesktop( - maTempFile.GetURL(), OUString(), - comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - - // the loaded document is a OTT with a non-invalid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, - SignatureState::NOTVALIDATED, OUString()); - - mxComponent->dispose(); - mxComponent.clear(); - } -} - #endif void SigningTest::registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx) |