summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/outlview.cxx
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 /sd/source/ui/view/outlview.cxx
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>
Diffstat (limited to 'sd/source/ui/view/outlview.cxx')
-rw-r--r--sd/source/ui/view/outlview.cxx27
1 files changed, 15 insertions, 12 deletions
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)
{