Kaydet (Commit) 44c90b3d authored tarafından Rob Snelders's avatar Rob Snelders Kaydeden (comit) Caolán McNamara

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/7832Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst c828e3cc
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
DECL_LINK( EndDropHdl, void * ); DECL_LINK( EndDropHdl, void * );
DECL_LINK( PaintingFirstLineHdl, PaintFirstLineInfo* ); 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); sal_Bool PrepareClose(sal_Bool bUI = sal_True);
...@@ -188,6 +188,8 @@ private: ...@@ -188,6 +188,8 @@ private:
sal_Bool mbFirstPaint; sal_Bool mbFirstPaint;
sal_uLong mnPaperWidth;
SfxProgress* mpProgress; SfxProgress* mpProgress;
/** stores the last used document color. /** stores the last used document color.
......
...@@ -299,7 +299,8 @@ void OutlineViewShell::ArrangeGUIElements () ...@@ -299,7 +299,8 @@ void OutlineViewShell::ArrangeGUIElements ()
Rectangle aText = Rectangle(Point(0,0), Rectangle aText = Rectangle(Point(0,0),
Size(pOlView->GetPaperWidth(), Size(pOlView->GetPaperWidth(),
pOlView->GetOutliner()->GetTextHeight())); pOlView->GetOutliner()->GetTextHeight()));
aText.Bottom() += aWin.GetHeight(); if (aWin.GetHeight() > aText.Bottom())
aText.Bottom() = aWin.GetHeight();
if (!aWin.IsEmpty()) // not when opening if (!aWin.IsEmpty()) // not when opening
{ {
......
...@@ -73,9 +73,6 @@ using namespace ::com::sun::star::frame; ...@@ -73,9 +73,6 @@ using namespace ::com::sun::star::frame;
namespace sd { namespace sd {
// width: DIN A4, two margins at 1 cm each
#define OUTLINE_PAPERWIDTH 19000
// a progress bar gets displayed when more than // a progress bar gets displayed when more than
// PROCESS_WITH_PROGRESS_THRESHOLD pages are concerned // PROCESS_WITH_PROGRESS_THRESHOLD pages are concerned
#define PROCESS_WITH_PROGRESS_THRESHOLD 5 #define PROCESS_WITH_PROGRESS_THRESHOLD 5
...@@ -90,9 +87,9 @@ struct SdParaAndPos ...@@ -90,9 +87,9 @@ struct SdParaAndPos
TYPEINIT1( OutlineView, ::sd::View ); TYPEINIT1( OutlineView, ::sd::View );
OutlineView::OutlineView( DrawDocShell& rDocSh, ::Window* pWindow, OutlineViewShell& rOutlineViewSh) OutlineView::OutlineView( DrawDocShell& rDocSh, ::Window* pWindow, OutlineViewShell& rOutlineViewShell)
: ::sd::View(*rDocSh.GetDoc(), pWindow, &rOutlineViewSh) : ::sd::View(*rDocSh.GetDoc(), pWindow, &rOutlineViewShell)
, mrOutlineViewShell(rOutlineViewSh) , mrOutlineViewShell(rOutlineViewShell)
, mrOutliner(*mrDoc.GetOutliner(sal_True)) , mrOutliner(*mrDoc.GetOutliner(sal_True))
, mnPagesToProcess(0) , mnPagesToProcess(0)
, mnPagesProcessed(0) , mnPagesProcessed(0)
...@@ -109,8 +106,9 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, ::Window* pWindow, OutlineViewSh ...@@ -109,8 +106,9 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, ::Window* pWindow, OutlineViewSh
bInitOutliner = sal_True; bInitOutliner = sal_True;
mrOutliner.Init( OUTLINERMODE_OUTLINEVIEW ); mrOutliner.Init( OUTLINERMODE_OUTLINEVIEW );
mrOutliner.SetRefDevice( SD_MOD()->GetRefDevice( rDocSh ) ); mrOutliner.SetRefDevice( SD_MOD()->GetRefDevice( rDocSh ) );
sal_uLong nWidth = OUTLINE_PAPERWIDTH; //viewsize without the width of the image and number in front
mrOutliner.SetPaperSize(Size(nWidth, 400000000)); mnPaperWidth = (mrOutlineViewShell.GetActiveWindow()->GetViewSize().Width() - 4000);
mrOutliner.SetPaperSize(Size(mnPaperWidth, 400000000));
} }
// insert View into Outliner // insert View into Outliner
...@@ -798,16 +796,16 @@ IMPL_LINK_NOARG(OutlineView, StatusEventHdl) ...@@ -798,16 +796,16 @@ IMPL_LINK_NOARG(OutlineView, StatusEventHdl)
::sd::Window* pWin = mrOutlineViewShell.GetActiveWindow(); ::sd::Window* pWin = mrOutlineViewShell.GetActiveWindow();
OutlinerView* pOutlinerView = GetViewByWindow(pWin); OutlinerView* pOutlinerView = GetViewByWindow(pWin);
Rectangle aVis = pOutlinerView->GetVisArea(); Rectangle aVis = pOutlinerView->GetVisArea();
sal_uLong nWidth = OUTLINE_PAPERWIDTH;
Rectangle aText = Rectangle(Point(0,0), Rectangle aText = Rectangle(Point(0,0),
Size(nWidth, Size(mnPaperWidth,
mrOutliner.GetTextHeight())); mrOutliner.GetTextHeight()));
Rectangle aWin(Point(0,0), pWin->GetOutputSizePixel()); Rectangle aWin(Point(0,0), pWin->GetOutputSizePixel());
aWin = pWin->PixelToLogic(aWin); aWin = pWin->PixelToLogic(aWin);
if (!aVis.IsEmpty()) // not when opening 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(), mrOutlineViewShell.InitWindows(Point(0,0), aText.GetSize(),
Point(aVis.TopLeft())); Point(aVis.TopLeft()));
...@@ -1044,6 +1042,11 @@ SdrTextObj* OutlineView::CreateOutlineTextObject(SdPage* pPage) ...@@ -1044,6 +1042,11 @@ SdrTextObj* OutlineView::CreateOutlineTextObject(SdPage* pPage)
return GetOutlineTextObject(pPage); return GetOutlineTextObject(pPage);
} }
sal_uLong OutlineView::GetPaperWidth()
{
return mnPaperWidth;
}
/** updates draw model with all changes from outliner model */ /** updates draw model with all changes from outliner model */
sal_Bool OutlineView::PrepareClose(sal_Bool) sal_Bool OutlineView::PrepareClose(sal_Bool)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment