diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/swabstdlg.hxx | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/docnode/ndnotxt.cxx | 37 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/graphic/ndgrf.cxx | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/inc/viewimp.hxx | 9 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/layout/fly.cxx | 7 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/layout/paintfrm.cxx | 124 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/text/frmform.cxx | 33 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/text/widorp.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/undo/docundo.cxx | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/unocore/unoframe.cxx | 20 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/view/vdraw.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8num.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 12 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/ui/app/docsh2.cxx | 63 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbmgr.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 17 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 4 | ||||
-rw-r--r-- | sw/source/ui/inc/mailmrge.hxx | 6 | ||||
-rw-r--r-- | sw/source/ui/shells/grfsh.cxx | 15 |
19 files changed, 303 insertions, 94 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 2768cc50bc82..33cac190d5d1 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -164,6 +164,11 @@ public: virtual const ::rtl::OUString& GetSaveFilter() const = 0; virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const = 0; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const = 0; + virtual bool IsSaveIndividualDocs() const = 0; + virtual bool IsGenerateFromDataBase() const = 0; + virtual String GetColumnName() const = 0; + virtual String GetPath() const = 0; + }; class AbstractMailMergeCreateFromDlg : public VclAbstractDialog //add for SwMailMergeCreateFromDlg { diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx index 6ad9605a18f2..4210c78d81bc 100644..100755 --- a/sw/source/core/docnode/ndnotxt.cxx +++ b/sw/source/core/docnode/ndnotxt.cxx @@ -136,6 +136,30 @@ const PolyPolygon *SwNoTxtNode::HasContour() const const MapMode aContourMap( bPixelGrf ? MAP_PIXEL : MAP_100TH_MM ); if( bPixelGrf ? !bPixelContour : aGrfMap != aContourMap ) { + // --> OD #i102238# + double nGrfDPIx = 0.0; + double nGrfDPIy = 0.0; + { + if ( !bPixelGrf && bPixelContour ) + { + const Size aGrfPixelSize( GetGraphic().GetSizePixel() ); + const Size aGrfPrefMapModeSize( GetGraphic().GetPrefSize() ); + if ( aGrfMap.GetMapUnit() == MAP_INCH ) + { + nGrfDPIx = aGrfPixelSize.Width() / ( (double)aGrfMap.GetScaleX() * aGrfPrefMapModeSize.Width() ); + nGrfDPIy = aGrfPixelSize.Height() / ( (double)aGrfMap.GetScaleY() * aGrfPrefMapModeSize.Height() ); + } + else + { + const Size aGrf1000thInchSize = + OutputDevice::LogicToLogic( aGrfPrefMapModeSize, + aGrfMap, MAP_1000TH_INCH ); + nGrfDPIx = 1000.0 * aGrfPixelSize.Width() / aGrf1000thInchSize.Width(); + nGrfDPIy = 1000.0 * aGrfPixelSize.Height() / aGrf1000thInchSize.Height(); + } + } + } + // <-- ASSERT( !bPixelGrf || aGrfMap == aContourMap, "scale factor for pixel unsupported" ); OutputDevice* pOutDev = @@ -153,7 +177,16 @@ const PolyPolygon *SwNoTxtNode::HasContour() const rPoly[i] = pOutDev->LogicToPixel( rPoly[i], aContourMap ); else if( bPixelContour ) + { rPoly[i] = pOutDev->PixelToLogic( rPoly[i], aGrfMap ); + // --> OD #i102238# + if ( nGrfDPIx != 0 && nGrfDPIy != 0 ) + { + rPoly[i] = Point( rPoly[i].X() * pOutDev->ImplGetDPIX() / nGrfDPIx, + rPoly[i].Y() * pOutDev->ImplGetDPIY() / nGrfDPIy ); + } + // <-- + } else rPoly[i] = OutputDevice::LogicToLogic( rPoly[i], aContourMap, @@ -203,7 +236,9 @@ sal_Bool SwNoTxtNode::GetContourAPI( PolyPolygon &rContour ) const sal_uInt16 nPolyCount = rContour.Count(); for( sal_uInt16 j=0; j<nPolyCount; j++ ) { - Polygon& rPoly = (*pContour)[j]; + // --> OD #i102238# - use the right <PolyPolygon> instance + Polygon& rPoly = rContour[j]; + // <-- sal_uInt16 nCount = rPoly.GetSize(); for( sal_uInt16 i=0 ; i<nCount; i++ ) diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index a66f0b708d80..e1c795039fa1 100644..100755 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -1183,7 +1183,10 @@ void SwGrfNode::ApplyInputStream( void SwGrfNode::UpdateLinkWithInputStream() { - if ( IsLinkedFile() ) + // --> OD #i85105# + // do not work on link, if a <SwapIn> has been triggered. + if ( !bInSwapIn && IsLinkedFile() ) + // <-- { GetLink()->setStreamToLoadFrom( mxInputStream, mbIsStreamReadOnly ); GetLink()->Update(); diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index 3959a815eaa2..eb0af505138f 100644..100755 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -59,6 +59,11 @@ class SwPrintData; class SwPagePreviewLayout; struct PrevwPage; class SwTxtFrm; +// --> OD #i76669# +namespace sdr { namespace contact { + class ViewObjectContactRedirector; +} } +// <-- class SwViewImp { @@ -215,11 +220,13 @@ public: // direction at the outliner of the draw view for painting layers <hell> // and <heaven>. // OD 25.06.2003 #108784# - correct type of 1st parameter + // OD #i76669# - added parameter <pRedirector> void PaintLayer( const SdrLayerID _nLayerID, SwPrintData const*const pPrintData, const SwRect& _rRect, const Color* _pPageBackgrdColor = 0, - const bool _bIsPageRightToLeft = false ) const; + const bool _bIsPageRightToLeft = false, + sdr::contact::ViewObjectContactRedirector* pRedirector = 0 ) const; //wird als Link an die DrawEngine uebergeben, entscheidet was wie //gepaintet wird oder nicht. diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 44264004cf07..de9a10a8c894 100644..100755 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -870,11 +870,10 @@ void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) UpdateObjInSortedList(); } // <-- + // --> OD #i87645# - reset flags for the layout process (only if something has been invalidated) + ResetLayoutProcessBools(); + // <-- } - - // --> OD 2005-07-18 #i51474# - reset flags for the layout process - ResetLayoutProcessBools(); - // <-- } void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 3a7b31e101fa..072cccd84187 100644..100755 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -86,6 +86,13 @@ #include <svx/svdogrp.hxx> #include <sortedobjs.hxx> #include <EnhancedPDFExportHelper.hxx> +// <-- +// --> OD #i76669# +#include <svx/sdr/contact/viewobjectcontactredirector.hxx> +#include <svx/sdr/contact/viewobjectcontact.hxx> +#include <svx/sdr/contact/viewcontact.hxx> +// <-- + #include <ndole.hxx> #include <svtools/chartprettypainter.hxx> #include <PostItMgr.hxx> @@ -2696,6 +2703,46 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori ) // FUNCTIONS USED FOR COLLAPSING TABLE BORDER LINES END // +// --> OD #i76669# +namespace +{ + class SwViewObjectContactRedirector : public ::sdr::contact::ViewObjectContactRedirector + { + private: + const ViewShell& mrViewShell; + + public: + SwViewObjectContactRedirector( const ViewShell& rSh ) + : mrViewShell( rSh ) + {}; + + virtual ~SwViewObjectContactRedirector() + {} + + virtual drawinglayer::primitive2d::Primitive2DSequence createRedirectedPrimitive2DSequence( + const sdr::contact::ViewObjectContact& rOriginal, + const sdr::contact::DisplayInfo& rDisplayInfo) + { + sal_Bool bPaint( sal_True ); + + SdrObject* pObj = rOriginal.GetViewContact().TryToGetSdrObject(); + if ( pObj ) + { + bPaint = SwFlyFrm::IsPaint( pObj, &mrViewShell ); + } + + if ( !bPaint ) + { + return drawinglayer::primitive2d::Primitive2DSequence(); + } + + return sdr::contact::ViewObjectContactRedirector::createRedirectedPrimitive2DSequence( + rOriginal, rDisplayInfo ); + } + }; + +} // end of anonymous namespace +// <-- /************************************************************************* |* @@ -2717,7 +2764,7 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori ) void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const { - ASSERT( Lower() && Lower()->IsPageFrm(), "Lower der Root keine Seite." ); + ASSERT( Lower() && Lower()->IsPageFrm(), "Lower der Root keine Seite." ); PROTOCOL( this, PROT_FILE_INIT, 0, 0) @@ -2756,8 +2803,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const // --> OD 2008-10-07 #i92745# // Extend check on certain states of the 'current' <ViewShell> instance to // all existing <ViewShell> instances. -// if ( !pSh->IsInEndAction() && !pSh->IsPaintInProgress() && -// (!pSh->Imp()->IsAction() || !pSh->Imp()->GetLayAction().IsActionInProgress() ) ) bool bPerformLayoutAction( true ); { ViewShell* pTmpViewShell = pSh; @@ -2812,10 +2857,11 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const // #i68597# const bool bGridPainting(pSh->GetWin() && pSh->Imp()->HasDrawView() && pSh->Imp()->GetDrawView()->IsGridVisible()); - // --> OD 2008-05-16 #i84659# -// while ( pPage && !::IsShortCut( aRect, pPage->Frm() ) ) - while ( pPage ) + // --> OD #i76669# + SwViewObjectContactRedirector aSwRedirector( *pSh ); // <-- + + while ( pPage ) { const bool bPaintRightShadow = !bBookMode || (pPage == Lower()) || (!bLTR && !pPage->OnRightPage()) || (bLTR && pPage->OnRightPage()); const bool bRightSidebar = pPage->SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT; @@ -2826,12 +2872,10 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const SwPageFrm::GetBorderAndShadowBoundRect( pPage->Frm(), pSh, aPaintRect, bRightSidebar ); if ( aRect.IsOver( aPaintRect ) ) - // <-- { if ( pSh->GetWin() ) { pSubsLines = new SwSubsRects; - // OD 18.11.2002 #99672# - create array for special sub-lines pSpecSubsLines = new SwSubsRects; } @@ -2842,15 +2886,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const // marks), if painting on a window and the paint is trigger by an // end action. The inefficient and simple enlargement of the // paint area is replaced by this invalidation. - // if ( bExtraData ) - // { - // //Ja, das ist grob, aber wie macht man es besser? - // SWRECTFN( pPage ) - // (aPaintRect.*fnRect->fnSetLeftAndWidth)( - // (pPage->Frm().*fnRect->fnGetLeft)(), - // (pPage->Frm().*fnRect->fnGetWidth)() ); - // aPaintRect._Intersection( pSh->VisArea() ); - // } if ( bExtraData && pSh->GetWin() && pSh->IsInEndAction() ) { @@ -2911,32 +2946,31 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const if ( pSh->Imp()->HasDrawView() ) { pLines->LockLines( sal_True ); - // OD 29.08.2002 #102450# - add 3rd parameter - // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess(); - pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), pPrintData, aPaintRect, - &aPageBackgrdColor, (pPage->IsRightToLeft() ? true : false) ); + pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), + pPrintData, + aPaintRect, + &aPageBackgrdColor, + (pPage->IsRightToLeft() ? true : false), + &aSwRedirector ); pLines->PaintLines( pSh->GetOut() ); pLines->LockLines( sal_False ); } if( pSh->GetWin() ) { - // OD 18.11.2002 #99672# - collect sub-lines + // collect sub-lines pPage->RefreshSubsidiary( aPaintRect ); - // OD 18.11.2002 #99672# - paint special sub-lines + // paint special sub-lines pSpecSubsLines->PaintSubsidiary( pSh->GetOut(), NULL ); } pPage->Paint( aPaintRect ); - // OD 20.12.2002 #94627# - no paint of page border and shadow, if - // writer is in place mode. + // no paint of page border and shadow, if writer is in place mode. if( pSh->GetWin() && pSh->GetDoc()->GetDocShell() && !pSh->GetDoc()->GetDocShell()->IsInPlaceActive() ) { - // OD 12.02.2003 #i9719#, #105645# - use new method - // <SwPageFrm::PaintBorderAndShadow(..)>. SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bPaintRightShadow, bRightSidebar ); SwPageFrm::PaintNotesSidebar( pPage->Frm(), pSh, pPage->GetPhyPageNum(), bRightSidebar); } @@ -2947,9 +2981,12 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const { /// OD 29.08.2002 #102450# - add 3rd parameter // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. - pSh->Imp()->PaintLayer( pSh->GetDoc()->GetHeavenId(), pPrintData, aPaintRect, + pSh->Imp()->PaintLayer( pSh->GetDoc()->GetHeavenId(), + pPrintData, + aPaintRect, &aPageBackgrdColor, - (pPage->IsRightToLeft() ? true : false) ); + (pPage->IsRightToLeft() ? true : false), + &aSwRedirector ); } if ( bExtraData ) @@ -6413,21 +6450,20 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const SwRect aRetouchePart( rRetouche ); if ( aRetouchePart.HasArea() ) { - // OD 30.08.2002 #102450# - // determine background color of page for <PaintLayer> method - // calls, painting <hell> or <heaven> const Color aPageBackgrdColor = pPage->GetDrawBackgrdColor(); - // OD 29.08.2002 #102450# - // add 3rd parameter to <PaintLayer> method calls - // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess(); + // --> OD #i76669# + SwViewObjectContactRedirector aSwRedirector( *pSh ); + // <-- pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), 0, aRetouchePart, &aPageBackgrdColor, - (pPage->IsRightToLeft() ? true : false) ); + (pPage->IsRightToLeft() ? true : false), + &aSwRedirector ); pSh->Imp()->PaintLayer( pIDDMA->GetHeavenId(), 0, aRetouchePart, &aPageBackgrdColor, - (pPage->IsRightToLeft() ? true : false) ); + (pPage->IsRightToLeft() ? true : false), + &aSwRedirector ); } SetRetouche(); @@ -6668,22 +6704,22 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap ) // OD 09.12.2002 #103045# - determine page, fly frame is on const SwPageFrm* pFlyPage = pFly->FindPageFrm(); - // OD 30.08.2002 #102450# - // determine color of page, the fly frame is on, for <PaintLayer> method - // calls, painting <hell> or <heaven> const Color aPageBackgrdColor = pFlyPage->GetDrawBackgrdColor(); - // OD 30.08.2002 #102450# - add 3rd parameter - // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess(); + // --> OD #i76669# + SwViewObjectContactRedirector aSwRedirector( *pSh ); + // <-- pImp->PaintLayer( pIDDMA->GetHellId(), 0, aOut, &aPageBackgrdColor, - (pFlyPage->IsRightToLeft() ? true : false) ); + (pFlyPage->IsRightToLeft() ? true : false), + &aSwRedirector ); pLines->PaintLines( &aDev ); if ( pFly->IsFlyInCntFrm() ) pFly->Paint( aOut ); pLines->PaintLines( &aDev ); /// OD 30.08.2002 #102450# - add 3rd parameter pImp->PaintLayer( pIDDMA->GetHeavenId(), 0, aOut, &aPageBackgrdColor, - (pFlyPage->IsRightToLeft() ? true : false) ); + (pFlyPage->IsRightToLeft() ? true : false), + &aSwRedirector ); pLines->PaintLines( &aDev ); DELETEZ( pLines ); pFlyOnlyDraw = 0; diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 0649678c901c..fbb65f5b7c53 100644..100755 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -1048,8 +1048,21 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine, !rFrmBreak.IsInside( rLine ) ) : rFrmBreak.IsBreakNow( rLine ) ) ) ) ? 1 : 0; + // --> OD #i84870# + // no split of text frame, which only contains a as-character anchored object + const bool bOnlyContainsAsCharAnchoredObj = + !IsFollow() && nStrLen == 1 && + GetDrawObjs() && GetDrawObjs()->Count() == 1 && + (*GetDrawObjs())[0]->GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AS_CHAR; + if ( nNew && bOnlyContainsAsCharAnchoredObj ) + { + nNew = 0; + } + // <-- if ( nNew ) + { SplitFrm( nEnd ); + } const SwFrm *pBodyFrm = (const SwFrm*)(FindBodyFrm()); @@ -1104,8 +1117,7 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine, // the numbering and must stay. if ( GetFollow()->GetOfst() != nEnd || GetFollow()->IsFieldFollow() || - ( nStrLen == 0 && GetTxtNode()->GetNumRule()) - ) + ( nStrLen == 0 && GetTxtNode()->GetNumRule() ) ) { nNew |= 3; } @@ -1116,8 +1128,11 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine, { // OD 21.03.2003 #108121# - Only split frame, if the frame contains // content or contains no content, but has a numbering. - if ( nStrLen > 0 || - ( nStrLen == 0 && GetTxtNode()->GetNumRule()) + // OD #i84870# - no split, if text frame only contains one + // as-character anchored object. + if ( !bOnlyContainsAsCharAnchoredObj && + ( nStrLen > 0 || + ( nStrLen == 0 && GetTxtNode()->GetNumRule() ) ) ) { SplitFrm( nEnd ); @@ -1138,7 +1153,15 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine, const SwTwips nDocPrtTop = Frm().Top() + Prt().Top(); const SwTwips nOldHeight = Prt().SSize().Height(); - const SwTwips nChg = rLine.CalcBottomLine() - nDocPrtTop - nOldHeight; + SwTwips nChg = rLine.CalcBottomLine() - nDocPrtTop - nOldHeight; + // --> OD #i84870# - no shrink of text frame, if it only contains one + // as-character anchored object. + if ( nChg < 0 && + bOnlyContainsAsCharAnchoredObj ) + { + nChg = 0; + } + // <-- // Vertical Formatting: // The (rotated) repaint rectangle's x coordinate referes to the frame. diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index f0fe98e44987..e1f8630b0e81 100644..100755 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -150,10 +150,23 @@ sal_Bool SwTxtFrmBreak::IsInside( SwTxtMargin &rLine ) const // Der Frm besitzt eine Hoehe, mit der er auf die Seite passt. SwTwips nHeight = (*fnRect->fnYDiff)( (pFrm->GetUpper()->*fnRect->fnGetPrtBottom)(), nOrigin ); - // Wenn sich alles innerhalb des bestehenden Frames abspielt, // ist das Ergebnis sal_True; bFit = nHeight >= nLineHeight; + + // --> OD #i103292# + if ( !bFit ) + { + if ( rLine.GetNext() && + pFrm->IsInTab() && !pFrm->GetFollow() && !pFrm->GetIndNext() ) + { + // add additional space taken as lower space as last content in a table + // for all text lines except the last one. + nHeight += pFrm->CalcAddLowerSpaceAsLastInTableCell(); + bFit = nHeight >= nLineHeight; + } + } + // <-- if( !bFit ) { // Die LineHeight sprengt die aktuelle Frm-Hoehe. diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx index 2e91da080c7c..79eb610a84e6 100644 --- a/sw/source/core/undo/docundo.cxx +++ b/sw/source/core/undo/docundo.cxx @@ -47,6 +47,7 @@ #include <undo.hrc> #include <editsh.hxx> #include <unobaseclass.hxx> +#include <limits> #include <limits> diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 14ffb5c2442d..3d55ac7d8a30 100644..100755 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1566,8 +1566,24 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) if(pIdx) { SwNodeIndex aIdx(*pIdx, 1); - SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); - Size aActSize = ((SwGrfNode*)pNoTxt)->GetTwipSize(); + // --> OD #i85105# +// SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); +// Size aActSize = ((SwGrfNode*)pNoTxt)->GetTwipSize(); + Size aActSize; + { + SwGrfNode* pGrfNode = dynamic_cast<SwGrfNode*>(aIdx.GetNode().GetNoTxtNode()); + if ( pGrfNode ) + { + aActSize = pGrfNode->GetTwipSize(); + if ( aActSize.Width() == 0 && aActSize.Height() == 0 && + pGrfNode->IsLinkedFile() ) + { + pGrfNode->SwapIn( sal_True ); + aActSize = pGrfNode->GetTwipSize(); + } + } + } + // <-- awt::Size aTmp; aTmp.Width = TWIP_TO_MM100(aActSize.Width()); aTmp.Height = TWIP_TO_MM100(aActSize.Height()); diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index 994841e6787f..4f40189c18c7 100644..100755 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -182,7 +182,8 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID, SwPrintData const*const pPrintData, const SwRect& , const Color* _pPageBackgrdColor, - const bool _bIsPageRightToLeft ) const + const bool _bIsPageRightToLeft, + sdr::contact::ViewObjectContactRedirector* pRedirector ) const { if ( HasDrawView() ) { @@ -232,7 +233,7 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID, SdrView &rSdrView = const_cast< SdrView & >(GetPageView()->GetView()); rSdrView.setHideDraw( !pPrintData->IsPrintDraw() ); } - GetPageView()->DrawLayer(_nLayerID, pOutDev); + GetPageView()->DrawLayer( _nLayerID, pOutDev, pRedirector ); pOutDev->Pop(); // OD 29.08.2002 #102450# diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index e8cb9a755087..57371f8cbdf3 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -231,8 +231,15 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/, sal_uInt8 nAlign; switch ( eAdjust ) { - case SVX_ADJUST_CENTER: nAlign = 1; break; - default: nAlign = 0; break; + case SVX_ADJUST_CENTER: + nAlign = 1; + break; + case SVX_ADJUST_RIGHT: + nAlign = 2; + break; + default: + nAlign = 0; + break; } *m_rWW8Export.pTableStrm << nAlign; diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index bcf4e1efbc9a..d4e5121168b6 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -2192,7 +2192,7 @@ void WW8FormulaControl::FormulaRead(SwWw8ControlType nWhich, nType=1; } fUnknown = nHeaderByte & 0x3; - fDropdownIndex = (nHeaderByte & 0xFC) >> 2; + fDropdownIndex = (nHeaderByte & 0x7C) >> 2; *pDataStream >> nField; fToolTip = nField & 0x01; fNoMark = (nField & 0x02)>>1; @@ -2485,7 +2485,15 @@ sal_Bool WW8FormulaListBox::Import(const uno::Reference < aTmp <<= aListSource; xPropSet->setPropertyValue(C2U("StringItemList"), aTmp ); - aTmp <<= aListSource[0]; + if (fDropdownIndex < nLen) + { + aTmp <<= aListSource[fDropdownIndex]; + } + else + { + aTmp <<= aListSource[0]; + } + xPropSet->setPropertyValue(C2U("DefaultText"), aTmp ); rSz = rRdr.MiserableDropDownFormHack(maListEntries[0], xPropSet); diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index eac710d34efd..068ea736db3e 100644..100755 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -835,7 +835,11 @@ void SwDocShell::Execute(SfxRequest& rReq) const SfxFilter* pFlt = aIter.First(); while( pFlt ) { - if( pFlt && pFlt->IsAllowedAsTemplate() ) + // --> OD #i117339# +// if( pFlt && pFlt->IsAllowedAsTemplate() ) + if( pFlt && pFlt->IsAllowedAsTemplate() && + ( pFlt->GetUserData().EqualsAscii("CXML") || + pFlt->GetUserData().EqualsAscii("CXMLV") ) ) { const String sWild = ((WildCard&)pFlt->GetWildcard()).GetWildCard(); xFltMgr->appendFilter( pFlt->GetUIName(), sWild ); @@ -1772,10 +1776,6 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, INetURLObject aURLObj( rURL ); String sURL( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) ); - SwRead pRead = 0; - SwReader* pReader = 0; - SwPaM* pPam = 0; - // Filter bestimmen: // const SfxFilter* pFlt = SwIoSystem::GetFileFilter( rURL, aEmptyStr ); String sFactory(String::CreateFromAscii(SwDocShell::Factory().GetShortName())); @@ -1791,10 +1791,41 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, SfxFilterMatcher aWebMatcher( sWebFactory ); aWebMatcher.DetectFilter( aMed, &pFlt, sal_False, sal_False ); } - if( aMed.IsStorage() ) + // --> OD #i117339# - trigger import only for own formats +// if( aMed.IsStorage() ) + bool bImport( false ); + { + if ( aMed.IsStorage() ) + { + // As <SfxMedium.GetFilter().IsOwnFormat() resp. IsOwnTemplateFormat() + // does not work correct (e.g., MS Word 2007 XML Template), + // use workaround provided by MAV. + uno::Reference< embed::XStorage > xStorage = aMed.GetStorage(); + if ( xStorage.is() ) + { + // use <try-catch> on retrieving <MediaType> in order to check, + // if the storage is one of our own ones. + try + { + uno::Reference< beans::XPropertySet > xProps( xStorage, uno::UNO_QUERY_THROW ); + const ::rtl::OUString aMediaTypePropName( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); + xProps->getPropertyValue( aMediaTypePropName ); + bImport = true; + } + catch( const uno::Exception& ) + { + bImport = false; + } + } + } + } + if ( bImport ) + // <-- { DBG_ASSERT((pFlt ? pFlt->GetVersion() : 0) >= SOFFICE_FILEFORMAT_60, "which file version?"); - pRead = ReadXML; + SwRead pRead = ReadXML; + SwReader* pReader = 0; + SwPaM* pPam = 0; // the SW3IO - Reader need the pam/wrtshell, because only then he // insert the styles! if( bUnoCall ) @@ -1804,19 +1835,10 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, pReader = new SwReader( aMed, rURL, *pPam ); } else + { pReader = new SwReader( aMed, rURL, *pWrtShell->GetCrsr() ); - } - else if( pFlt ) - { -// if( pFlt->GetUserData().EqualsAscii( FILTER_SWG ) || -// pFlt->GetUserData().EqualsAscii( FILTER_SWGV )) -// pRead = ReadSwg; - pReader = new SwReader( aMed, rURL, pDoc ); - } + } - ASSERT( pRead, "no reader found" ); - if( pRead ) - { pRead->GetReaderOpt().SetTxtFmts( rOpt.IsTxtFmts() ); pRead->GetReaderOpt().SetFrmFmts( rOpt.IsFrmFmts() ); pRead->GetReaderOpt().SetPageDescs( rOpt.IsPageDescs() ); @@ -1834,9 +1856,10 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, nErr = pReader->Read( *pRead ); pWrtShell->EndAllAction(); } + delete pPam; + delete pReader; } - delete pPam; - delete pReader; + return nErr; } diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 13645f395d04..fc17b6093cba 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -2598,7 +2598,13 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, SwMergeDescriptor aMergeDesc( pImpl->pMergeDialog->GetMergeType(), pView->GetWrtShell(), aDescriptor ); aMergeDesc.sSaveToFilter = pImpl->pMergeDialog->GetSaveFilter(); - aMergeDesc.bCreateSingleFile= true; + aMergeDesc.bCreateSingleFile = !pImpl->pMergeDialog->IsSaveIndividualDocs(); + if( !aMergeDesc.bCreateSingleFile && pImpl->pMergeDialog->IsGenerateFromDataBase() ) + { + aMergeDesc.sAddressFromColumn = pImpl->pMergeDialog->GetColumnName(); + aMergeDesc.sSubject = pImpl->pMergeDialog->GetPath(); + } + MergeNew(aMergeDesc); pWorkDoc->SetNewDBMgr( pWorkDBMgr ); diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 5610365e3167..19db1f67c44b 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -526,6 +526,23 @@ uno::Reference< sdbc::XResultSet> AbstractMailMergeDlg_Impl::GetResultSet() cons { return pDlg->GetResultSet(); } +bool AbstractMailMergeDlg_Impl::IsSaveIndividualDocs() const +{ + return pDlg->IsSaveIndividualDocs(); +} +bool AbstractMailMergeDlg_Impl::IsGenerateFromDataBase() const +{ + return pDlg->IsGenerateFromDataBase(); +} +String AbstractMailMergeDlg_Impl::GetColumnName() const +{ + return pDlg->GetColumnName(); +} +String AbstractMailMergeDlg_Impl::GetPath() const +{ + return pDlg->GetPath(); +} + // AbstractMailMergeDlg_Impl end // AbstractMailMergeCreateFromDlg_Impl begin sal_Bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() const diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 5ffd7fcd74ad..4c970c58aca7 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -332,6 +332,10 @@ class AbstractMailMergeDlg_Impl : public AbstractMailMergeDlg virtual const ::rtl::OUString& GetSaveFilter() const; virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const ; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const; + virtual bool IsSaveIndividualDocs() const; + virtual bool IsGenerateFromDataBase() const; + virtual String GetColumnName() const; + virtual String GetPath() const; }; //for SwMailMergeDlg end //for SwMailMergeCreateFromDlg begin diff --git a/sw/source/ui/inc/mailmrge.hxx b/sw/source/ui/inc/mailmrge.hxx index 43534f76a3da..c541832462ec 100644 --- a/sw/source/ui/inc/mailmrge.hxx +++ b/sw/source/ui/inc/mailmrge.hxx @@ -156,6 +156,12 @@ public: ~SwMailMergeDlg(); inline sal_uInt16 GetMergeType() { return nMergeType; } + + bool IsSaveIndividualDocs() const { return aSaveIndividualRB.IsChecked(); } + bool IsGenerateFromDataBase() const { return aGenerateFromDataBaseCB.IsChecked(); } + String GetColumnName() const { return aColumnLB.GetSelectEntry();} + String GetPath() const { return aPathED.GetText();} + const ::rtl::OUString& GetSaveFilter() const {return m_sSaveFilter;} inline const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const { return m_aSelection; } ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const; diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 4b94089ded3d..ba6704981b70 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -519,6 +519,9 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) rSh.GetCurAttr( aCoreSet ); sal_Bool bParentCntProt = 0 != rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ); sal_Bool bIsGrfCntnt = CNT_GRF == GetShell().GetCntType(); +// const GraphicObject* pGrfObj = ( bIsGrfCntnt ? rSh.GetGraphicObj() : NULL ); +// sal_Bool bIsRenderGraphicGrfCntnt = ( pGrfObj && pGrfObj->IsRenderGraphic() ); + // --> OD 2006-11-03 #i59688# // sal_Bool bSwappedOut = rSh.IsGrfSwapOut( sal_True ); // sal_Bool bBitmapType = !bSwappedOut && GRAPHIC_BITMAP == rSh.GetGraphicType(); @@ -613,11 +616,11 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) if( !bParentCntProt ) { // --> OD 2005-02-09 #119353# - robust - const GraphicObject* pGrfObj = rSh.GetGraphicObj(); - if ( pGrfObj ) + const GraphicObject* pGrafObj = rSh.GetGraphicObj(); + if ( pGrafObj ) { - if( pGrfObj->IsAnimated() || - GRAPHIC_GDIMETAFILE == pGrfObj->GetType() ) + if( pGrafObj->IsAnimated() || + GRAPHIC_GDIMETAFILE == pGrafObj->GetType() ) bDisable = sal_True; else rSet.Put( SfxUInt16Item( nWhich, ((SwTransparencyGrf&) @@ -701,7 +704,3 @@ SwGrfShell::SwGrfShell(SwView &_rView) : SetName(String::CreateFromAscii("Graphic")); SetHelpId(SW_GRFSHELL); } - - - - |