diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-07-28 17:06:33 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-07-28 17:06:33 +0000 |
commit | 64113199a48a5def583228d971b1227417e58d86 (patch) | |
tree | f11188fd1bb92438d523ab48dc0dc12e603b0b4a /svx/source | |
parent | 29da2639353762a64673d6ae5b32a36045caa7d3 (diff) |
CWS-TOOLING: integrate CWS aw076_DEV300
2009-07-16 15:59:57 +0200 aw r274058 : #i103454# added grow possibility for block text in the 'other' direction
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 8d27914422ae..76c29de8d480 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -773,17 +773,40 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive( } else { + // check if block text is used (only one of them can be true) + const bool bHorizontalIsBlock(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg); + const bool bVerticalIsBlock(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg); + if((rSdrBlockTextPrimitive.getWordWrap() || IsTextFrame()) && !rSdrBlockTextPrimitive.getUnlimitedPage()) { - rOutliner.SetMaxAutoPaperSize(aAnchorTextSize); + // #i103454# maximal paper size hor/ver needs to be limited to text + // frame size. If it's block text, still allow the 'other' direction + // to grow to get a correct real text size when using GetPaperSize(). + // When just using aAnchorTextSize as maximum, GetPaperSize() + // would just return aAnchorTextSize again: this means, the wanted + // 'measurement' of the real size of block text would not work + Size aMaxAutoPaperSize(aAnchorTextSize); + + if(bHorizontalIsBlock) + { + // allow to grow vertical for horizontal blocks + aMaxAutoPaperSize.setHeight(1000000); + } + else if(bVerticalIsBlock) + { + // allow to grow horizontal for vertical blocks + aMaxAutoPaperSize.setWidth(1000000); + } + + rOutliner.SetMaxAutoPaperSize(aMaxAutoPaperSize); } - if(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg) + // set minimal paper size hor/ver if needed + if(bHorizontalIsBlock) { rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0)); } - - if(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg) + else if(bVerticalIsBlock) { rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight)); } |