summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/doc/notxtfrm.cxx54
-rw-r--r--sw/source/core/layout/paintfrm.cxx19
2 files changed, 66 insertions, 7 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index e939b7ddec05..5b4831017fdf 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -799,6 +799,34 @@ void SwNoTxtFrm::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
}
+void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, OutputDevice* pOut )
+{
+ if(!pOut)
+ return;
+ Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() );
+ Rectangle aNewPxRect( aPxRect );
+ while( aNewPxRect.Left() < aPxRect.Left() )
+ {
+ rAlignedGrfArea.Left( rAlignedGrfArea.Left()+1 );
+ aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
+ }
+ while( aNewPxRect.Top() < aPxRect.Top() )
+ {
+ rAlignedGrfArea.Top( rAlignedGrfArea.Top()+1 );
+ aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
+ }
+ while( aNewPxRect.Bottom() > aPxRect.Bottom() )
+ {
+ rAlignedGrfArea.Bottom( rAlignedGrfArea.Bottom()-1 );
+ aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
+ }
+ while( aNewPxRect.Right() > aPxRect.Right() )
+ {
+ rAlignedGrfArea.Right( rAlignedGrfArea.Right()-1 );
+ aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
+ }
+}
+
// Ausgabe der Grafik. Hier wird entweder eine QuickDraw-Bmp oder
// eine Grafik vorausgesetzt. Ist nichts davon vorhanden, wird
// eine Ersatzdarstellung ausgegeben.
@@ -816,15 +844,30 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
const BOOL bPrn = pOut == rNoTNd.getIDocumentDeviceAccess()->getPrinter( false ) ||
pOut->GetConnectMetaFile();
+ const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() );
+
/// OD 25.09.2002 #99739# - calculate aligned rectangle from parameter <rGrfArea>.
/// Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
/// the following code.
SwRect aAlignedGrfArea = rGrfArea;
::SwAlignRect( aAlignedGrfArea, pShell );
- /// OD 25.09.2002 #99739#
- /// Because for drawing a graphic left-top-corner and size coordinations are
- /// used, these coordinations have to be determined on pixel level.
- ::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
+
+ if( !bIsChart )
+ {
+ /// OD 25.09.2002 #99739#
+ /// Because for drawing a graphic left-top-corner and size coordinations are
+ /// used, these coordinations have to be determined on pixel level.
+ ::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
+ }
+ else //if( bIsChart )
+ {
+ //#i78025# charts own borders are not completely visible
+ //the above pixel correction is not correct - at least not for charts
+ //so a different pixel correction is choosen here
+ //this might be a good idea for all other OLE objects also,
+ //but as I cannot oversee the consequences I fix it only for charts for now
+ lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
+ }
if( pGrfNd )
{
@@ -946,9 +989,8 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
if( bForceSwap )
pGrfNd->SwapOut();
}
- else if( pOLENd
+ else if( bIsChart
//charts must be painted resolution dependent!! #i82893#, #i75867#
- && ChartPrettyPainter::IsChart(pOLENd->GetOLEObj().GetObject())
&& ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( pOut )
&& svt::EmbeddedObjectRef::TryRunningState( pOLENd->GetOLEObj().GetOleRef() )
&& ChartPrettyPainter::DoPrettyPaintChart( uno::Reference< frame::XModel >(
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index dececa60560e..7dcbc4ef80a9 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -112,6 +112,9 @@
#include <EnhancedPDFExportHelper.hxx>
// <--
+#include <ndole.hxx>
+#include <svtools/chartprettypainter.hxx>
+
#include <PostItMgr.hxx>
#include <tools/color.hxx>
#define COL_NOTES_SIDEPANE RGB_COLORDATA(230,230,230)
@@ -3512,6 +3515,19 @@ void SwFlyFrm::Paint( const SwRect& rRect ) const
const SwNoTxtFrm *pNoTxt = Lower() && Lower()->IsNoTxtFrm()
? (SwNoTxtFrm*)Lower() : 0;
+ bool bIsChart = false; //#i102950# don't paint additional borders for charts
+ //check whether we have a chart
+ if(pNoTxt)
+ {
+ const SwNoTxtNode* pNoTNd = dynamic_cast<const SwNoTxtNode*>(pNoTxt->GetNode());
+ if( pNoTNd )
+ {
+ SwOLENode* pOLENd = const_cast<SwOLENode*>(pNoTNd->GetOLENode());
+ if( pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() ) )
+ bIsChart = true;
+ }
+ }
+
{
bool bContour = GetFmt()->GetSurround().IsContour();
PolyPolygon aPoly;
@@ -3641,7 +3657,8 @@ void SwFlyFrm::Paint( const SwRect& rRect ) const
// OD 19.12.2002 #106318# - fly frame will paint it's subsidiary lines and
// the subsidiary lines of its lowers on its own, due to overlapping with
// other fly frames or other objects.
- if( pGlobalShell->GetWin() )
+ if( pGlobalShell->GetWin()
+ && !bIsChart ) //#i102950# don't paint additional borders for charts
{
bool bSubsLineRectsCreated;
if ( pSubsLines )