summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Snelders <programming@ertai.nl>2014-02-03 19:53:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-02-27 06:27:54 -0600
commit44c90b3d754faa3a0622423f4839194c85e219fa (patch)
tree586cefbf8c1f9c231c4e407e7601b27b335fd1c5
parentc828e3cc409077a1916911b8abf1d7b8dbb2078a (diff)
Improve usability of the outline
If you had data in the outline and would scroll to the bottom then it would be an empty view at the bottom. The width of the outline was defined as a fixed with twice. Once in the outlnvsh and one (even smaller) in the outlview. I have changed the with of the outlview to take the with of the outlnvsh. Change-Id: I1376a135acd92dbe8966b29ccb075e6b74412a8c Reviewed-on: https://gerrit.libreoffice.org/7832 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/source/ui/inc/OutlineView.hxx4
-rw-r--r--sd/source/ui/view/outlnvsh.cxx3
-rw-r--r--sd/source/ui/view/outlview.cxx27
3 files changed, 20 insertions, 14 deletions
diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx
index 056c8f706297..bc813795121d 100644
--- a/sd/source/ui/inc/OutlineView.hxx
+++ b/sd/source/ui/inc/OutlineView.hxx
@@ -111,7 +111,7 @@ public:
DECL_LINK( EndDropHdl, void * );
DECL_LINK( PaintingFirstLineHdl, PaintFirstLineInfo* );
- sal_uLong GetPaperWidth() const { return 2*21000; } // DIN A4 Breite
+ sal_uLong GetPaperWidth();
sal_Bool PrepareClose(sal_Bool bUI = sal_True);
@@ -188,6 +188,8 @@ private:
sal_Bool mbFirstPaint;
+ sal_uLong mnPaperWidth;
+
SfxProgress* mpProgress;
/** stores the last used document color.
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index b44e1df27f43..6e833dfbaaf3 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -299,7 +299,8 @@ void OutlineViewShell::ArrangeGUIElements ()
Rectangle aText = Rectangle(Point(0,0),
Size(pOlView->GetPaperWidth(),
pOlView->GetOutliner()->GetTextHeight()));
- aText.Bottom() += aWin.GetHeight();
+ if (aWin.GetHeight() > aText.Bottom())
+ aText.Bottom() = aWin.GetHeight();
if (!aWin.IsEmpty()) // not when opening
{
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 7ddf67d7aba7..0288c165678b 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -73,9 +73,6 @@ using namespace ::com::sun::star::frame;
namespace sd {
-// width: DIN A4, two margins at 1 cm each
-#define OUTLINE_PAPERWIDTH 19000
-
// a progress bar gets displayed when more than
// PROCESS_WITH_PROGRESS_THRESHOLD pages are concerned
#define PROCESS_WITH_PROGRESS_THRESHOLD 5
@@ -90,9 +87,9 @@ struct SdParaAndPos
TYPEINIT1( OutlineView, ::sd::View );
-OutlineView::OutlineView( DrawDocShell& rDocSh, ::Window* pWindow, OutlineViewShell& rOutlineViewSh)
-: ::sd::View(*rDocSh.GetDoc(), pWindow, &rOutlineViewSh)
-, mrOutlineViewShell(rOutlineViewSh)
+OutlineView::OutlineView( DrawDocShell& rDocSh, ::Window* pWindow, OutlineViewShell& rOutlineViewShell)
+: ::sd::View(*rDocSh.GetDoc(), pWindow, &rOutlineViewShell)
+, mrOutlineViewShell(rOutlineViewShell)
, mrOutliner(*mrDoc.GetOutliner(sal_True))
, mnPagesToProcess(0)
, mnPagesProcessed(0)
@@ -109,8 +106,9 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, ::Window* pWindow, OutlineViewSh
bInitOutliner = sal_True;
mrOutliner.Init( OUTLINERMODE_OUTLINEVIEW );
mrOutliner.SetRefDevice( SD_MOD()->GetRefDevice( rDocSh ) );
- sal_uLong nWidth = OUTLINE_PAPERWIDTH;
- mrOutliner.SetPaperSize(Size(nWidth, 400000000));
+ //viewsize without the width of the image and number in front
+ mnPaperWidth = (mrOutlineViewShell.GetActiveWindow()->GetViewSize().Width() - 4000);
+ mrOutliner.SetPaperSize(Size(mnPaperWidth, 400000000));
}
// insert View into Outliner
@@ -798,16 +796,16 @@ IMPL_LINK_NOARG(OutlineView, StatusEventHdl)
::sd::Window* pWin = mrOutlineViewShell.GetActiveWindow();
OutlinerView* pOutlinerView = GetViewByWindow(pWin);
Rectangle aVis = pOutlinerView->GetVisArea();
- sal_uLong nWidth = OUTLINE_PAPERWIDTH;
Rectangle aText = Rectangle(Point(0,0),
- Size(nWidth,
- mrOutliner.GetTextHeight()));
+ Size(mnPaperWidth,
+ mrOutliner.GetTextHeight()));
Rectangle aWin(Point(0,0), pWin->GetOutputSizePixel());
aWin = pWin->PixelToLogic(aWin);
if (!aVis.IsEmpty()) // not when opening
{
- aText.Bottom() += aWin.GetHeight();
+ if (aWin.GetHeight() > aText.Bottom())
+ aText.Bottom() = aWin.GetHeight();
mrOutlineViewShell.InitWindows(Point(0,0), aText.GetSize(),
Point(aVis.TopLeft()));
@@ -1044,6 +1042,11 @@ SdrTextObj* OutlineView::CreateOutlineTextObject(SdPage* pPage)
return GetOutlineTextObject(pPage);
}
+sal_uLong OutlineView::GetPaperWidth()
+{
+ return mnPaperWidth;
+}
+
/** updates draw model with all changes from outliner model */
sal_Bool OutlineView::PrepareClose(sal_Bool)
{