diff options
author | obo <obo@openoffice.org> | 2010-06-15 07:24:20 +0200 |
---|---|---|
committer | obo <obo@openoffice.org> | 2010-06-15 07:24:20 +0200 |
commit | 6093b32cbee907c6cc959b64f4e6f0bf0de8fc89 (patch) | |
tree | 94551d8e3db4b36950c7efd45d21ed4177a69c45 /svx | |
parent | c016baa4c425bb48cb626ae27e2fb6ed3dd023de (diff) | |
parent | e5ca3aca239fb7a95044e69f29294664ac60c8ec (diff) |
CWS-TOOLING: integrate CWS os140
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/svxruler.cxx | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 00c1edaa7f04..7705a2dd08df 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -1214,9 +1214,7 @@ void SvxRuler::UpdateTabs() long nRightFrameMargin = GetRightFrameMargin(); //#i24363# tab stops relative to indent - const long nParaItemTxtLeft = pRuler_Imp->bIsTabsRelativeToIndent ? - pParaItem->GetTxtLeft() : - 0; + const long nParaItemTxtLeft = pParaItem->GetTxtLeft(); const long lParaIndent = nLeftFrameMargin + nParaItemTxtLeft; @@ -1253,7 +1251,7 @@ void SvxRuler::UpdateTabs() const SvxTabStop *pTab = &(*pTabStopItem)[j]; pTabs[nTabCount+TAB_GAP].nPos = ConvertHPosPixel( - lParaIndent + pTab->GetTabPos() + lAppNullOffset); + (pRuler_Imp->bIsTabsRelativeToIndent ? lParaIndent : 0 ) + pTab->GetTabPos() + lAppNullOffset); if(bRTL) { pTabs[nTabCount+TAB_GAP].nPos = lParaIndentPix + lRightPixMargin - pTabs[nTabCount+TAB_GAP].nPos; @@ -1286,13 +1284,37 @@ void SvxRuler::UpdateTabs() { for(j = 0; j < nDefTabBuf; ++j) { - pTabs[nTabCount + TAB_GAP].nPos = + if( j == 0 ) + { + //set the first default tab stop + if(pRuler_Imp->bIsTabsRelativeToIndent) + { + pTabs[nTabCount + TAB_GAP].nPos = + (pTabs[nTabCount].nPos + nDefTabDist); + pTabs[nTabCount + TAB_GAP].nPos -= + ((pTabs[nTabCount + TAB_GAP].nPos - lParaIndentPix) + % nDefTabDist ); + } + else + { + if( pTabs[nTabCount].nPos < 0 ) + { + pTabs[nTabCount + TAB_GAP].nPos = ( pTabs[nTabCount].nPos / nDefTabDist ) * nDefTabDist; + } + else + { + pTabs[nTabCount + TAB_GAP].nPos = ( pTabs[nTabCount].nPos / nDefTabDist + 1 ) * nDefTabDist; + } + } + + } + else + { + //simply add the default distance to the last position + pTabs[nTabCount + TAB_GAP].nPos = pTabs[nTabCount].nPos + nDefTabDist; + } - if(j == 0 ) - pTabs[nTabCount + TAB_GAP].nPos -= - ((pTabs[nTabCount + TAB_GAP].nPos - lParaIndentPix) - % nDefTabDist ); if(pTabs[nTabCount+TAB_GAP].nPos >= lRightIndent) break; pTabs[nTabCount + TAB_GAP].nStyle = RULER_TAB_DEFAULT; |