summaryrefslogtreecommitdiff
path: root/svx/source/dialog/svxruler.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/dialog/svxruler.cxx')
-rw-r--r--svx/source/dialog/svxruler.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 94ccd8cfc576..7eed4e891f07 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -514,7 +514,9 @@ void SvxRuler::UpdateFrame()
lLogicNullOffset = mxColumnItem.get() ? mxColumnItem->GetLeft(): mxLRSpaceItem->GetLeft();
if(bAppSetNullOffset)
+ {
lAppNullOffset += lLogicNullOffset - nOld;
+ }
if(!bAppSetNullOffset || lAppNullOffset == LONG_MAX)
{
@@ -547,7 +549,9 @@ void SvxRuler::UpdateFrame()
lLogicNullOffset = mxColumnItem.get() ? mxColumnItem->GetLeft() : mxULSpaceItem->GetUpper();
if(bAppSetNullOffset)
+ {
lAppNullOffset += lLogicNullOffset - nOld;
+ }
if(!bAppSetNullOffset || lAppNullOffset == LONG_MAX)
{
@@ -1034,6 +1038,8 @@ void SvxRuler::Update(const SvxPagePosSizeItem *pItem) // new value of page attr
void SvxRuler::SetDefTabDist(long inDefTabDist) // New distance for DefaultTabs in App-Metrics
{
+ if (lAppNullOffset == LONG_MAX)
+ UpdateFrame(); // hack: try to get lAppNullOffset initialized
/* New distance is set for DefaultTabs */
lDefTabDist = inDefTabDist;
UpdateTabs();
@@ -2058,7 +2064,9 @@ void SvxRuler::ApplyMargins()
}
if(bAppSetNullOffset)
+ {
lAppNullOffset += lLogicNullOffset - lOldNull;
+ }
long nRight;
if(mxRulerImpl->lMaxRightLogic != -1
@@ -2092,7 +2100,9 @@ void SvxRuler::ApplyMargins()
ConvertVPosLogic(GetFrameLeft()) -
lAppNullOffset, mxULSpaceItem->GetUpper()));
if(bAppSetNullOffset)
+ {
lAppNullOffset += lLogicNullOffset - lOldNull;
+ }
mxULSpaceItem->SetLower(
PixelVAdjust(
std::max((long)0, mxPagePosItem->GetHeight() -
@@ -2350,7 +2360,7 @@ void SvxRuler::ApplyBorders()
#endif // DEBUGLIN
SfxBoolItem aFlag(SID_RULER_ACT_LINE_ONLY,
- nDragType & DRAG_OBJECT_ACTLINE_ONLY ? sal_True : sal_False);
+ (nDragType & DRAG_OBJECT_ACTLINE_ONLY) != 0);
sal_uInt16 nColId = mxRulerImpl->bIsTableRows ? (bHorz ? SID_RULER_ROWS : SID_RULER_ROWS_VERTICAL) :
(bHorz ? SID_RULER_BORDERS : SID_RULER_BORDERS_VERTICAL);
@@ -2628,7 +2638,7 @@ void SvxRuler::Click()
bool SvxRuler::CalcLimits ( long& nMax1, // minimum value to be set
long& nMax2, // minimum value to be set
- bool ) const
+ bool )
{
/*
Default implementation of the virtual function; the application can be
@@ -3023,7 +3033,7 @@ void SvxRuler::CalcMinMax()
{
if(mxObjectItem->HasLimits())
{
- if(CalcLimits(nMaxLeft, nMaxRight, nIdx & 1? sal_False : sal_True))
+ if(CalcLimits(nMaxLeft, nMaxRight, (nIdx & 1) == 0))
{
nMaxLeft = ConvertPosPixel(nMaxLeft);
nMaxRight = ConvertPosPixel(nMaxRight);