Kaydet (Commit) 92fb379e authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

CWS-TOOLING: integrate CWS sw34bf05

......@@ -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
{
......
......@@ -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++ )
......
......@@ -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();
......
......@@ -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.
......
......@@ -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,
......
This diff is collapsed.
......@@ -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.
......
......@@ -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.
......
......@@ -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());
......
......@@ -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#
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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 );
......
......@@ -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
......
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment