summaryrefslogtreecommitdiff
path: root/sw/source/uibase/docvw
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/docvw')
-rw-r--r--sw/source/uibase/docvw/OverlayRanges.hxx1
-rw-r--r--sw/source/uibase/docvw/ShadowOverlayObject.hxx4
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.cxx4
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx37
4 files changed, 24 insertions, 22 deletions
diff --git a/sw/source/uibase/docvw/OverlayRanges.hxx b/sw/source/uibase/docvw/OverlayRanges.hxx
index f8ea5694b128..8deecac241fd 100644
--- a/sw/source/uibase/docvw/OverlayRanges.hxx
+++ b/sw/source/uibase/docvw/OverlayRanges.hxx
@@ -23,6 +23,7 @@
#include <svx/sdr/overlay/overlayobject.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <memory>
#include <vector>
#include <memory>
diff --git a/sw/source/uibase/docvw/ShadowOverlayObject.hxx b/sw/source/uibase/docvw/ShadowOverlayObject.hxx
index 4b333cf4c06f..506b801d0991 100644
--- a/sw/source/uibase/docvw/ShadowOverlayObject.hxx
+++ b/sw/source/uibase/docvw/ShadowOverlayObject.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_DOCVW_SHADOWOVERLAYOBJECT_HXX
#define INCLUDED_SW_SOURCE_UIBASE_DOCVW_SHADOWOVERLAYOBJECT_HXX
+#include <sal/config.h>
+
+#include <memory>
+
#include <svx/sdr/overlay/overlayobject.hxx>
#include <memory>
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index bdbb0e2804e4..62387bc03330 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -270,9 +270,7 @@ void SidebarTextControl::KeyInput( const KeyEvent& rKeyEvt )
}
else
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/inforeadonlydialog.ui"));
- std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("InfoReadonlyDialog"));
- xQuery->run();
+ mrDocView.GetWrtShell().InfoReadOnlyDialog();
}
}
if (bDone)
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 20f5761f1361..28a672963e83 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -163,6 +163,9 @@
#include <sfx2/event.hxx>
#include <memory>
+#include "../../core/crsr/callnk.hxx"
+
+
using namespace sw::mark;
using namespace ::com::sun::star;
@@ -1838,9 +1841,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
}
else if (!rSh.IsCursorInParagraphMetadataField())
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/inforeadonlydialog.ui"));
- std::unique_ptr<weld::MessageDialog> xInfo(xBuilder->weld_message_dialog("InfoReadonlyDialog"));
- xInfo->run();
+ rSh.InfoReadOnlyDialog();
eKeyState = SwKeyState::End;
}
break;
@@ -1993,9 +1994,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
}
else if (!rSh.IsCursorInParagraphMetadataField())
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/inforeadonlydialog.ui"));
- std::unique_ptr<weld::MessageDialog> xInfo(xBuilder->weld_message_dialog("InfoReadonlyDialog"));
- xInfo->run();
+ rSh.InfoReadOnlyDialog();
eKeyState = SwKeyState::End;
}
break;
@@ -3700,7 +3699,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
// select content of Input Field, but exclude CH_TXT_ATR_INPUTFIELDSTART
// and CH_TXT_ATR_INPUTFIELDEND
rSh.SttSelect();
- rSh.SelectText( aFieldAtPos.pFndTextAttr->GetStart() + 1,
+ rSh.SelectTextModel( aFieldAtPos.pFndTextAttr->GetStart() + 1,
*(aFieldAtPos.pFndTextAttr->End()) - 1 );
}
// don't reset here any longer so that, in case through MouseMove
@@ -3730,8 +3729,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
// select content of Input Field, but exclude CH_TXT_ATR_INPUTFIELDSTART
// and CH_TXT_ATR_INPUTFIELDEND
rSh.SttSelect();
- rSh.SelectText( aFieldAtPos.pFndTextAttr->GetStart() + 1,
- *(aFieldAtPos.pFndTextAttr->End()) - 1 );
+ rSh.SelectTextModel( aFieldAtPos.pFndTextAttr->GetStart() + 1,
+ *(aFieldAtPos.pFndTextAttr->End()) - 1 );
}
}
@@ -6287,8 +6286,7 @@ OUString SwEditWin::GetSurroundingText() const
rSh.GetSelectedText( sReturn, ParaBreakType::ToOnlyCR );
else if( !rSh.HasSelection() )
{
- SwPosition *pPos = rSh.GetCursor()->GetPoint();
- const sal_Int32 nPos = pPos->nContent.GetIndex();
+ rSh.Push();
// get the sentence around the cursor
rSh.HideCursor();
@@ -6297,8 +6295,7 @@ OUString SwEditWin::GetSurroundingText() const
rSh.GoEndSentence();
rSh.GetSelectedText( sReturn, ParaBreakType::ToOnlyCR );
- pPos->nContent = nPos;
- rSh.ClearMark();
+ rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
rSh.HideCursor();
}
@@ -6318,18 +6315,20 @@ Selection SwEditWin::GetSurroundingTextSelection() const
{
// Return the position of the visible cursor in the sentence
// around the visible cursor.
- SwPosition *pPos = rSh.GetCursor()->GetPoint();
- const sal_Int32 nPos = pPos->nContent.GetIndex();
+ TextFrameIndex const nPos(rSh.GetCursorPointAsViewIndex());
+
+ // store shell state *before* Push
+ ::std::unique_ptr<SwCallLink> pLink(::std::make_unique<SwCallLink>(rSh));
+ rSh.Push();
rSh.HideCursor();
rSh.GoStartSentence();
- const sal_Int32 nStartPos = rSh.GetCursor()->GetPoint()->nContent.GetIndex();
+ TextFrameIndex const nStartPos(rSh.GetCursorPointAsViewIndex());
- pPos->nContent = nPos;
- rSh.ClearMark();
+ rSh.Pop(SwCursorShell::PopMode::DeleteCurrent, ::std::move(pLink));
rSh.ShowCursor();
- return Selection( nPos - nStartPos, nPos - nStartPos );
+ return Selection(sal_Int32(nPos - nStartPos), sal_Int32(nPos - nStartPos));
}
}