callcatcher: more ww1 removal fallout
quite pleasing Change-Id: I3eaf711e8d5a42358922c16bfc82d0e32d0bc44b
This commit is contained in:
@@ -22,14 +22,6 @@ namespace sc {
|
|||||||
class SC_DLLPUBLIC NumFmtUtil
|
class SC_DLLPUBLIC NumFmtUtil
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
|
||||||
* Return whether or not given number format is a 'General' number format.
|
|
||||||
*/
|
|
||||||
static bool isGeneral( sal_uLong nFormat );
|
|
||||||
|
|
||||||
static bool isGeneral( const ScPatternAttr& rPat );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the attribute pattern has a number format that only produces
|
* Check if the attribute pattern has a number format that only produces
|
||||||
* latin script output.
|
* latin script output.
|
||||||
|
@@ -29,22 +29,6 @@
|
|||||||
|
|
||||||
namespace sc {
|
namespace sc {
|
||||||
|
|
||||||
bool NumFmtUtil::isGeneral( sal_uLong nFormat )
|
|
||||||
{
|
|
||||||
return (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NumFmtUtil::isGeneral( const ScPatternAttr& rPat )
|
|
||||||
{
|
|
||||||
const SfxPoolItem* pItem = NULL;
|
|
||||||
if (!rPat.GetItemSet().HasItem(ATTR_VALUE_FORMAT, &pItem))
|
|
||||||
// Assume it's 'General' when the number format is not explicitly set.
|
|
||||||
return true;
|
|
||||||
|
|
||||||
sal_uInt32 nNumFmt = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
|
|
||||||
return isGeneral(nNumFmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NumFmtUtil::isLatinScript( const ScPatternAttr& rPat, ScDocument& rDoc )
|
bool NumFmtUtil::isLatinScript( const ScPatternAttr& rPat, ScDocument& rDoc )
|
||||||
{
|
{
|
||||||
SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
|
SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
|
||||||
|
@@ -276,16 +276,6 @@ ScDocument* XclRoot::GetDocPtr() const
|
|||||||
return &mrData.mrDoc;
|
return &mrData.mrDoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScDocumentImport& XclRoot::GetDocImport()
|
|
||||||
{
|
|
||||||
return mrData.maDocImport;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ScDocumentImport& XclRoot::GetDocImport() const
|
|
||||||
{
|
|
||||||
return mrData.maDocImport;
|
|
||||||
}
|
|
||||||
|
|
||||||
SfxObjectShell* XclRoot::GetDocShell() const
|
SfxObjectShell* XclRoot::GetDocShell() const
|
||||||
{
|
{
|
||||||
return GetDoc().GetDocumentShell();
|
return GetDoc().GetDocumentShell();
|
||||||
|
@@ -208,9 +208,6 @@ public:
|
|||||||
/** Returns pointer to the destination document (import) or source document (export). */
|
/** Returns pointer to the destination document (import) or source document (export). */
|
||||||
ScDocument* GetDocPtr() const;
|
ScDocument* GetDocPtr() const;
|
||||||
|
|
||||||
ScDocumentImport& GetDocImport();
|
|
||||||
const ScDocumentImport& GetDocImport() const;
|
|
||||||
|
|
||||||
/** Returns the object shell of the Calc document. May be 0 (i.e. import from clipboard). */
|
/** Returns the object shell of the Calc document. May be 0 (i.e. import from clipboard). */
|
||||||
SfxObjectShell* GetDocShell() const;
|
SfxObjectShell* GetDocShell() const;
|
||||||
/** Returns the object model of the Calc document. */
|
/** Returns the object model of the Calc document. */
|
||||||
|
@@ -971,549 +971,6 @@ SfxPoolItem* SwFltTOX::Clone(SfxItemPool*) const
|
|||||||
return new SwFltTOX(*this);
|
return new SwFltTOX(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ SwFltOutBase& SwFltOutDoc::operator << (const SfxPoolItem& rItem)
|
|
||||||
{
|
|
||||||
rStack.NewAttr(*pPaM->GetPoint(), rItem);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
const SfxPoolItem& SwFltOutDoc::GetAttr(sal_uInt16 nWhich)
|
|
||||||
{
|
|
||||||
return *rStack.GetFmtAttr(*pPaM->GetPoint(), nWhich);
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetNodeOrStyAttr fetches attributes for toggle and modify attributes:
|
|
||||||
// For format definitions, the current style with parents is
|
|
||||||
// consulted, otherwise the node with parents.
|
|
||||||
// The stack is never used.
|
|
||||||
const SfxPoolItem& SwFltOutDoc::GetNodeOrStyAttr(sal_uInt16 nWhich)
|
|
||||||
{
|
|
||||||
SwCntntNode * pNd = pPaM->GetPoint()->nNode.GetNode().GetCntntNode();
|
|
||||||
if (pNd) // ContentNode: Attribute with Parent
|
|
||||||
return pNd->GetAttr(nWhich);
|
|
||||||
else // no ContentNode, take the default attribute
|
|
||||||
return GetDoc().GetAttrPool().GetDefaultItem(nWhich);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tables
|
|
||||||
SwFltOutBase::~SwFltOutBase()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
SwFltOutBase::SwFltOutBase(SwDoc& rDocu)
|
|
||||||
: rDoc(rDocu), eFlyAnchor(FLY_AT_PARA), bFlyAbsPos(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
const SfxPoolItem& SwFltOutBase::GetCellAttr(sal_uInt16 nWhich)
|
|
||||||
{
|
|
||||||
OSL_FAIL("GetCellAttr outside of normal text");
|
|
||||||
return GetDoc().GetAttrPool().GetDefaultItem(nWhich);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SwFltOutBase::BeginTable()
|
|
||||||
{
|
|
||||||
OSL_FAIL("BeginTable outside of normal text");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::NextTableCell()
|
|
||||||
{
|
|
||||||
OSL_FAIL("NextTableCell outside of normal text");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::NextTableRow()
|
|
||||||
{
|
|
||||||
OSL_FAIL("NextTableRow outside of normal text");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::SetTableWidth(SwTwips /*nW*/)
|
|
||||||
{
|
|
||||||
OSL_FAIL("SetTableWidth outside of normal text");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::SetTableOrient(sal_Int16 /*eOri*/)
|
|
||||||
{
|
|
||||||
OSL_FAIL("SetTableOrient outside of normal text");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::SetCellWidth(SwTwips /*nWidth*/, sal_uInt16 /*nCell*/)
|
|
||||||
{
|
|
||||||
OSL_FAIL("SetCellWidth outside of normal text");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::SetCellHeight(SwTwips /*nH*/)
|
|
||||||
{
|
|
||||||
OSL_FAIL("SetCellHeight outside of normal text");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::SetCellBorder(const SvxBoxItem& /*rFmtBox*/, sal_uInt16 /*nCell*/)
|
|
||||||
{
|
|
||||||
OSL_FAIL("SetCellBorder outside of normal text");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::SetCellSpace(sal_uInt16 /*nSp*/)
|
|
||||||
{
|
|
||||||
OSL_FAIL("SetCellSpace outside of normal text");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::DeleteCell(sal_uInt16 /*nCell*/)
|
|
||||||
{
|
|
||||||
OSL_FAIL("DeleteCell outside of normal text");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::EndTable()
|
|
||||||
{
|
|
||||||
OSL_FAIL("EndTable outside of normal text");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*virtual*/ bool SwFltOutDoc::IsInTable()
|
|
||||||
{
|
|
||||||
return pTable != 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool SwFltOutDoc::BeginTable()
|
|
||||||
{
|
|
||||||
if(bReadNoTbl)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (pTable){
|
|
||||||
OSL_FAIL("BeginTable in Table");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Close all attributes, because otherwise
|
|
||||||
// attributes extending into Flys might be created
|
|
||||||
rStack.SetAttr( *pPaM->GetPoint(), 0, false );
|
|
||||||
rEndStack.SetAttr( *pPaM->GetPoint(), 0, false );
|
|
||||||
|
|
||||||
// create table:
|
|
||||||
OSL_ENSURE(pTabSavedPos == NULL, "SwFltOutDoc");
|
|
||||||
pTabSavedPos = new SwPosition(*pPaM->GetPoint());
|
|
||||||
pTable = GetDoc().InsertTable(
|
|
||||||
SwInsertTableOptions( tabopts::HEADLINE_NO_BORDER, 1 ),
|
|
||||||
*pTabSavedPos, 1, 1, text::HoriOrientation::LEFT, 0, 0, false, false ); // TODO MULTIHEADER
|
|
||||||
nTableWidth = 0;
|
|
||||||
((SwTable*)pTable)->LockModify(); // Don't adjust anything automatically!
|
|
||||||
// set pam in 1st table cell
|
|
||||||
usTableX =
|
|
||||||
usTableY = 0;
|
|
||||||
SeekCell(usTableY, usTableX, true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
SwTableBox* SwFltOutDoc::GetBox(sal_uInt16 ny, sal_uInt16 nx /*= USHRT_MAX */)
|
|
||||||
{
|
|
||||||
if(!pTable){
|
|
||||||
OSL_ENSURE(pTable, "GetBox without table");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if( nx == USHRT_MAX ) // current cell
|
|
||||||
nx = usTableX;
|
|
||||||
|
|
||||||
// get structs to table cells
|
|
||||||
const SwTableLines* pTableLines = &pTable->GetTabLines();
|
|
||||||
if(!pTableLines){
|
|
||||||
OSL_FAIL("SwFltOutDoc:GetBox:pTableLines");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if( ny >= pTableLines->size() ){ // emergency break
|
|
||||||
OSL_FAIL( "SwFltOutDoc:GetBox:ny >= Count()");
|
|
||||||
ny = pTableLines->size() - 1;
|
|
||||||
}
|
|
||||||
SwTableLine* pTableLine = (*pTableLines)[ny];
|
|
||||||
if(!pTableLine){
|
|
||||||
OSL_FAIL("SwFltOutDoc:GetBox:pTableLine");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
SwTableBoxes* pTableBoxes = &pTableLine->GetTabBoxes();
|
|
||||||
if(!pTableBoxes){
|
|
||||||
OSL_FAIL("SwFltOutDoc:GetBox:pTableBoxes");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if( nx >= pTableBoxes->size() ){ // emergency break
|
|
||||||
OSL_FAIL("SwFltOutDoc:GetBox:nx >= Count()");
|
|
||||||
nx = pTableBoxes->size() - 1;
|
|
||||||
}
|
|
||||||
SwTableBox* pTableBox = (*pTableBoxes)[nx];
|
|
||||||
|
|
||||||
OSL_ENSURE(pTableBox != 0, "SwFltOutDoc:GetBox:pTableBox");
|
|
||||||
return pTableBox;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::NextTableCell()
|
|
||||||
{
|
|
||||||
if(!pTable){
|
|
||||||
OSL_ENSURE(pTable, "NextTableCell without table");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const SwTableLines* pTableLines = &pTable->GetTabLines();
|
|
||||||
SwTableLine* pTableLine = (*pTableLines)[usTableY];
|
|
||||||
SwTableBoxes* pTableBoxes = &pTableLine->GetTabBoxes();
|
|
||||||
SwTableBox* pTableBox = (*pTableBoxes)[usTableX];
|
|
||||||
OSL_ENSURE(pTableBox != 0, "SwFltOutDoc:NextTableCell:pTableBox");
|
|
||||||
if(!pTableBox)
|
|
||||||
return;
|
|
||||||
//#pragma message(__FILE__ "(?) : Sw's const problem")
|
|
||||||
// insert cells:
|
|
||||||
if (++usTableX >= pTableBoxes->size())
|
|
||||||
GetDoc().GetNodes().InsBoxen(
|
|
||||||
GetDoc().IsIdxInTbl(pPaM->GetPoint()->nNode),
|
|
||||||
pTableLine,
|
|
||||||
(SwTableBoxFmt*)pTableBox->GetFrmFmt(),
|
|
||||||
GetDoc().getIDocumentStylePoolAccess().GetTxtCollFromPool(RES_POOLCOLL_STANDARD, false ),
|
|
||||||
0,
|
|
||||||
pTableBoxes->size());
|
|
||||||
SeekCell(usTableY, usTableX, true);
|
|
||||||
pTableBox = (*pTableBoxes)[usTableX];
|
|
||||||
OSL_ENSURE(pTableBox != 0, "SwFltOutDoc:pTableBox");
|
|
||||||
if(pTableBox)
|
|
||||||
(*pTableBoxes)[usTableX]->ClaimFrmFmt();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::NextTableRow()
|
|
||||||
{
|
|
||||||
SwTableBox* pTableBox = GetBox(usTableY, 0);
|
|
||||||
if (pTableBox)
|
|
||||||
{
|
|
||||||
// duplicate row:
|
|
||||||
SwSelBoxes aSelBoxes;
|
|
||||||
aSelBoxes.insert( pTableBox );
|
|
||||||
GetDoc().InsertRow(aSelBoxes);
|
|
||||||
usTableX = 0;
|
|
||||||
SeekCell(++usTableY, usTableX, true);
|
|
||||||
GetDoc().SetTxtFmtColl(*pPaM,
|
|
||||||
GetDoc().getIDocumentStylePoolAccess().GetTxtCollFromPool(RES_POOLCOLL_STANDARD, false ));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::SetTableWidth(SwTwips nSwWidth)
|
|
||||||
{
|
|
||||||
if(!pTable){
|
|
||||||
OSL_ENSURE(pTable, "SetTableWidth without table");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OSL_ENSURE( nSwWidth > MINLAY, "Table width <= MINLAY" );
|
|
||||||
if( nSwWidth != nTableWidth ){
|
|
||||||
if( nTableWidth ) // don't set the first time
|
|
||||||
SplitTable();
|
|
||||||
pTable->GetFrmFmt()->SetFmtAttr( SwFmtFrmSize(ATT_VAR_SIZE, nSwWidth));
|
|
||||||
nTableWidth = nSwWidth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::SetTableOrient(sal_Int16 eOri)
|
|
||||||
{
|
|
||||||
if(!pTable){
|
|
||||||
OSL_ENSURE(pTable, "SetTableOrient without table");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
pTable->GetFrmFmt()->SetFmtAttr( SwFmtHoriOrient( 0, eOri ));
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::SetCellWidth(SwTwips nWidth, sal_uInt16 nCell /* = USHRT_MAX */ )
|
|
||||||
{
|
|
||||||
if(!pTable){
|
|
||||||
OSL_ENSURE(pTable, "SetCellWidth without table");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OSL_ENSURE( nWidth > MINLAY, "Table cell width <= MINLAY" );
|
|
||||||
if (nWidth < MINLAY)
|
|
||||||
nWidth = MINLAY;
|
|
||||||
|
|
||||||
SwTableBox* pTableBox = GetBox(usTableY, nCell);
|
|
||||||
if(pTableBox && pTableBox->GetFrmFmt() ){
|
|
||||||
SwFmtFrmSize aFmtFrmSize(ATT_FIX_SIZE);
|
|
||||||
aFmtFrmSize.SetWidth(nWidth);
|
|
||||||
pTableBox->GetFrmFmt()->SetFmtAttr(aFmtFrmSize);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::SetCellHeight(SwTwips nHeight)
|
|
||||||
{
|
|
||||||
if(!pTable){
|
|
||||||
OSL_ENSURE(pTable, "SetCellHeight without table");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const SwTableLines* pTableLines = &pTable->GetTabLines();
|
|
||||||
SwTableLine* pTableLine = (*pTableLines)[usTableY];
|
|
||||||
SwFmtFrmSize aFmtFrmSize(ATT_MIN_SIZE, 0, 0);
|
|
||||||
if (nHeight < MINLAY)
|
|
||||||
nHeight = MINLAY;
|
|
||||||
aFmtFrmSize.SetHeight(nHeight);
|
|
||||||
pTableLine->GetFrmFmt()->SetFmtAttr(aFmtFrmSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
const SfxPoolItem& SwFltOutDoc::GetCellAttr(sal_uInt16 nWhich)
|
|
||||||
{
|
|
||||||
if (!pTable){
|
|
||||||
OSL_ENSURE(pTable, "GetCellAttr without table");
|
|
||||||
return GetDoc().GetAttrPool().GetDefaultItem(nWhich);
|
|
||||||
}
|
|
||||||
|
|
||||||
SwTableBox* pTableBox = GetBox(usTableY, usTableX);
|
|
||||||
if(!pTableBox)
|
|
||||||
return GetDoc().GetAttrPool().GetDefaultItem(nWhich);
|
|
||||||
return pTableBox->GetFrmFmt()->GetFmtAttr( nWhich );
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::SetCellBorder(const SvxBoxItem& rFmtBox,
|
|
||||||
sal_uInt16 nCell /* = USHRT_MAX */ )
|
|
||||||
{
|
|
||||||
SwTableBox* pTableBox = GetBox(usTableY, nCell);
|
|
||||||
if(pTableBox)
|
|
||||||
pTableBox->GetFrmFmt()->SetFmtAttr(rFmtBox);
|
|
||||||
}
|
|
||||||
|
|
||||||
// not activated!
|
|
||||||
void SwFltOutDoc::SetCellSpace(sal_uInt16 nDist)
|
|
||||||
{
|
|
||||||
if(!pTable){
|
|
||||||
OSL_ENSURE(pTable, "SetCellSpace without table");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SwTableBox* pTableBox = GetBox(usTableY, usTableX);
|
|
||||||
if(!pTableBox)
|
|
||||||
return;
|
|
||||||
|
|
||||||
SvxBoxItem aFmtBox( *((SvxBoxItem*)
|
|
||||||
&pTableBox->GetFrmFmt()->GetFmtAttr( RES_BOX )));
|
|
||||||
|
|
||||||
// I don't get it, sven: if (!nDist) nDist = 18; // ca. 0.03 cm
|
|
||||||
if (nDist > 42) // max. 0.7 mm
|
|
||||||
nDist = 42;
|
|
||||||
else
|
|
||||||
if (nDist < MIN_BORDER_DIST)
|
|
||||||
nDist = MIN_BORDER_DIST;
|
|
||||||
aFmtBox.SetDistance(nDist);
|
|
||||||
pTableBox->GetFrmFmt()->SetFmtAttr(aFmtBox);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::DeleteCell(sal_uInt16 nCell /* = USHRT_MAX */)
|
|
||||||
{
|
|
||||||
SwTableBox* pTableBox = GetBox(usTableY, nCell);
|
|
||||||
if( pTableBox )
|
|
||||||
{
|
|
||||||
SwSelBoxes aSelBoxes;
|
|
||||||
aSelBoxes.insert( pTableBox );
|
|
||||||
GetDoc().DeleteRowCol(aSelBoxes);
|
|
||||||
usTableX--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::SplitTable()
|
|
||||||
{
|
|
||||||
if(!pTable)
|
|
||||||
{
|
|
||||||
OSL_ENSURE(pTable, "SplitTable without table");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SwTableBox* pAktBox = GetBox(usTableY, usTableX);
|
|
||||||
SwTableBox* pSplitBox = GetBox(usTableY - 1, 0);
|
|
||||||
GetDoc().GetNodes().SplitTable(SwNodeIndex(*pSplitBox->GetSttNd()), false);
|
|
||||||
pTable = &pAktBox->GetSttNd()->FindTableNode()->GetTable();
|
|
||||||
usTableY = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::EndTable()
|
|
||||||
{
|
|
||||||
if (!pTable){
|
|
||||||
OSL_ENSURE(pTable, "EndTable without table");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Close all attributes, because otherwise
|
|
||||||
// attributes extending into Flys might be created
|
|
||||||
rStack.SetAttr( *pPaM->GetPoint(), 0, false );
|
|
||||||
rEndStack.SetAttr( *pPaM->GetPoint(), 0, false );
|
|
||||||
|
|
||||||
if (GetDoc().getIDocumentLayoutAccess().GetCurrentViewShell()){
|
|
||||||
SwTableNode* pTableNode = GetDoc().IsIdxInTbl(
|
|
||||||
pPaM->GetPoint()->nNode);
|
|
||||||
pTableNode->DelFrms();
|
|
||||||
pTableNode->MakeFrms(&pPaM->GetPoint()->nNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
*pPaM->GetPoint() = *pTabSavedPos; // restore Cursor
|
|
||||||
delete pTabSavedPos;
|
|
||||||
pTabSavedPos = 0;
|
|
||||||
((SwTable*)pTable)->UnlockModify(); // Test, doesn't help against assert
|
|
||||||
pTable = 0;
|
|
||||||
nTableWidth = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SwFltOutDoc::SeekCell(short nRow, short nCol, bool bPam)
|
|
||||||
{
|
|
||||||
// get structs to table cells
|
|
||||||
const SwTableLines* pTableLines = &pTable->GetTabLines();
|
|
||||||
SwTableLine* pTableLine = (*pTableLines)[usTableY];
|
|
||||||
SwTableBoxes* pTableBoxes = &pTableLine->GetTabBoxes();
|
|
||||||
SwTableBox* pTableBox = (*pTableBoxes)[usTableX];
|
|
||||||
|
|
||||||
if ((sal_uInt16)nRow >= pTableLines->size())
|
|
||||||
{
|
|
||||||
OSL_ENSURE((sal_uInt16)nRow >= pTableLines->size(), "SwFltOutDoc");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
pTableLine = (*pTableLines)[nRow];
|
|
||||||
pTableBoxes = &pTableLine->GetTabBoxes();
|
|
||||||
if (nCol >= (short)pTableBoxes->size())
|
|
||||||
return false;
|
|
||||||
pTableBox = (*pTableBoxes)[nCol];
|
|
||||||
if( !pTableBox->GetSttNd() )
|
|
||||||
{
|
|
||||||
OSL_ENSURE(pTableBox->GetSttNd(), "SwFltOutDoc");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(bPam)
|
|
||||||
{
|
|
||||||
pPaM->GetPoint()->nNode = pTableBox->GetSttIdx() + 1;
|
|
||||||
pPaM->GetPoint()->nContent.Assign(pPaM->GetCntntNode(), 0);
|
|
||||||
GetDoc().SetTxtFmtColl(*pPaM,
|
|
||||||
GetDoc().getIDocumentStylePoolAccess().GetTxtCollFromPool(RES_POOLCOLL_STANDARD, false ));
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Flys in SwFltOutBase
|
|
||||||
SfxItemSet* SwFltOutBase::NewFlyDefaults()
|
|
||||||
{
|
|
||||||
// Set required default values ( except when they will be explicitly set
|
|
||||||
// later )
|
|
||||||
SfxItemSet* p = new SfxItemSet( GetDoc().GetAttrPool(),
|
|
||||||
RES_FRMATR_BEGIN, RES_FRMATR_END-1 );
|
|
||||||
SwFmtFrmSize aSz( ATT_VAR_SIZE, MINFLY, MINFLY );
|
|
||||||
// Default: width 100% ( = PMW:Auto )
|
|
||||||
aSz.SetWidthPercent( 100 ); // Height: Auto
|
|
||||||
p->Put( aSz );
|
|
||||||
p->Put( SwFmtHoriOrient( 0, text::HoriOrientation::NONE, text::RelOrientation::FRAME ));
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SwFltOutBase::BeginFly( RndStdIds eAnchor /*= FLY_AT_PARA*/,
|
|
||||||
bool bAbsolutePos /*= sal_False*/,
|
|
||||||
const SfxItemSet* pMoreAttrs /*= 0*/)
|
|
||||||
{
|
|
||||||
(void) pMoreAttrs; // unused in non-debug
|
|
||||||
OSL_ENSURE(!pMoreAttrs, "SwFltOutBase:BeginFly with pMoreAttrs" );
|
|
||||||
eFlyAnchor = eAnchor;
|
|
||||||
bFlyAbsPos = bAbsolutePos; // nonsense, actually
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*virtual*/ void SwFltOutBase::SetFlyAnchor( RndStdIds eAnchor )
|
|
||||||
{
|
|
||||||
if( !IsInFly() ){
|
|
||||||
OSL_FAIL( "SetFlyAnchor() without Fly" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ( eAnchor == FLY_AS_CHAR ){
|
|
||||||
OSL_FAIL( "SetFlyAnchor( FLY_AS_CHAR ) not implemented" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SwFmtAnchor& rAnchor = (SwFmtAnchor&)GetFlyFrmAttr( RES_ANCHOR );
|
|
||||||
rAnchor.SetType( eAnchor );
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutBase::EndFly()
|
|
||||||
{
|
|
||||||
if( bFlyAbsPos ){
|
|
||||||
// here, the absolute positions on the Fly need to be transformed to
|
|
||||||
// writer coordinates
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Flys in SwFltDoc
|
|
||||||
/* virtual */ bool SwFltOutDoc::IsInFly()
|
|
||||||
{
|
|
||||||
return pFly != 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
SwFrmFmt* SwFltOutDoc::MakeFly( RndStdIds eAnchor, SfxItemSet* pSet )
|
|
||||||
{
|
|
||||||
pFly = (SwFlyFrmFmt*)GetDoc().MakeFlySection( eAnchor, pPaM->GetPoint(),
|
|
||||||
pSet );
|
|
||||||
return pFly;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SwFltOutDoc::BeginFly( RndStdIds eAnchor,
|
|
||||||
bool bAbsolutePos ,
|
|
||||||
const SfxItemSet* pMoreAttrs)
|
|
||||||
|
|
||||||
{
|
|
||||||
SwFltOutBase::BeginFly( eAnchor, bAbsolutePos, 0 );
|
|
||||||
SfxItemSet* pSet = NewFlyDefaults();
|
|
||||||
|
|
||||||
// Close all attributes, because otherwise attributes extending into Flys might
|
|
||||||
// be created
|
|
||||||
rStack.SetAttr( *pPaM->GetPoint(), 0, false );
|
|
||||||
rEndStack.SetAttr( *pPaM->GetPoint(), 0, false );
|
|
||||||
|
|
||||||
// create Fly:
|
|
||||||
OSL_ENSURE(pFlySavedPos == NULL, "BeginFly in Fly"); // recursive doesn't work yet
|
|
||||||
pFlySavedPos = new SwPosition(*pPaM->GetPoint());
|
|
||||||
|
|
||||||
SwFmtAnchor aAnchor( eAnchor, 1 );
|
|
||||||
|
|
||||||
// If the style contained Fly attributes, use them as defaults now
|
|
||||||
if (pMoreAttrs)
|
|
||||||
pSet->Put(*pMoreAttrs);
|
|
||||||
|
|
||||||
// this NOT for page-dependent Fly with page NUMBER !
|
|
||||||
aAnchor.SetAnchor(pPaM->GetPoint()); // surprisingly, doesn't require
|
|
||||||
// the stack
|
|
||||||
|
|
||||||
pSet->Put( aAnchor );
|
|
||||||
SwFrmFmt* pF = MakeFly( eAnchor, pSet );
|
|
||||||
delete pSet;
|
|
||||||
|
|
||||||
// set pam in Fly
|
|
||||||
const SwFmtCntnt& rCntnt = pF->GetCntnt();
|
|
||||||
OSL_ENSURE( rCntnt.GetCntntIdx(), "No prepared content." );
|
|
||||||
pPaM->GetPoint()->nNode = rCntnt.GetCntntIdx()->GetIndex() + 1;
|
|
||||||
SwCntntNode *pNode = pPaM->GetCntntNode();
|
|
||||||
pPaM->GetPoint()->nContent.Assign( pNode, 0 );
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*virtual*/ void SwFltOutDoc::SetFlyFrmAttr(const SfxPoolItem& rAttr)
|
|
||||||
{
|
|
||||||
if (pFly){
|
|
||||||
pFly->SetFmtAttr( rAttr );
|
|
||||||
}else{
|
|
||||||
OSL_ENSURE(pFly, "SetFlyAttr without Doc-Fly");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*virtual*/ const SfxPoolItem& SwFltOutDoc::GetFlyFrmAttr(sal_uInt16 nWhich)
|
|
||||||
{
|
|
||||||
if (pFly){
|
|
||||||
return pFly->GetFmtAttr( nWhich );
|
|
||||||
}else{
|
|
||||||
OSL_ENSURE(pFly, "GetFlyAttr without Fly");
|
|
||||||
return GetDoc().GetAttrPool().GetDefaultItem(nWhich);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwFltOutDoc::EndFly()
|
|
||||||
{
|
|
||||||
if( pTable ){
|
|
||||||
OSL_FAIL( "SwFltOutDoc::EndFly() in Table" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Close all attributes, because otherwise
|
|
||||||
// attributes extending into Flys might be created
|
|
||||||
rStack.SetAttr( *pPaM->GetPoint(), 0, false );
|
|
||||||
rEndStack.SetAttr( *pPaM->GetPoint(), 0, false );
|
|
||||||
|
|
||||||
*pPaM->GetPoint() = *pFlySavedPos; // restore Cursor
|
|
||||||
delete pFlySavedPos;
|
|
||||||
pFlySavedPos = 0;
|
|
||||||
SwFltOutBase::EndFly();
|
|
||||||
pFly = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpdatePageDescs needs to be called at end of parsing to make Writer actually
|
// UpdatePageDescs needs to be called at end of parsing to make Writer actually
|
||||||
// accept Pagedescs contents
|
// accept Pagedescs contents
|
||||||
void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset)
|
void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset)
|
||||||
|
@@ -327,123 +327,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// hier beginnen die fuer ww1-filter neu erstellten klassen. diese
|
|
||||||
// sollen eine simple oberflaeche fuer die komplexen strukturen des
|
|
||||||
// writers speziell fuer filter sein. soll etwas in den writer gegeben
|
|
||||||
// werden, soll ein << reichen. hierfuer sind neue typen erzeugt
|
|
||||||
// worden. ausserdem soll moeglich sein das objekt nach vielen
|
|
||||||
// zustaenden der momentanen formatierung zu fragen, sodasz diese der
|
|
||||||
// filter nicht selbst verwalten musz.
|
|
||||||
|
|
||||||
// den anfang macht eine vorlagen-oberklasse, die einfachen umgang mit
|
|
||||||
// formatvorlagen ermoeglicht:
|
|
||||||
|
|
||||||
class SwFltOutBase
|
|
||||||
{
|
|
||||||
SwDoc& rDoc;
|
|
||||||
protected:
|
|
||||||
RndStdIds eFlyAnchor;
|
|
||||||
bool bFlyAbsPos;
|
|
||||||
|
|
||||||
SwDoc& GetDoc() { return rDoc; }
|
|
||||||
SfxItemSet* NewFlyDefaults();
|
|
||||||
SwFltOutBase(SwDoc& rDocu);
|
|
||||||
virtual ~SwFltOutBase();
|
|
||||||
public:
|
|
||||||
virtual SwFltOutBase& operator << (const SfxPoolItem& rItem) = 0;
|
|
||||||
|
|
||||||
virtual const SfxPoolItem& GetAttr(sal_uInt16 nWhich) = 0;
|
|
||||||
virtual const SfxPoolItem& GetNodeOrStyAttr(sal_uInt16 nWhich) = 0;
|
|
||||||
|
|
||||||
virtual const SfxPoolItem& GetCellAttr(sal_uInt16 nWhich);
|
|
||||||
virtual bool BeginTable();
|
|
||||||
virtual void NextTableCell();
|
|
||||||
virtual void NextTableRow();
|
|
||||||
virtual void SetTableWidth(SwTwips nW);
|
|
||||||
virtual void SetTableOrient(sal_Int16 eOri);
|
|
||||||
virtual void SetCellWidth(SwTwips nWidth, sal_uInt16 nCell);
|
|
||||||
virtual void SetCellHeight(SwTwips nH);
|
|
||||||
virtual void SetCellBorder(const SvxBoxItem& rFmtBox, sal_uInt16 nCell);
|
|
||||||
virtual void SetCellSpace(sal_uInt16 nSp);
|
|
||||||
virtual void DeleteCell(sal_uInt16 nCell);
|
|
||||||
virtual void EndTable();
|
|
||||||
|
|
||||||
virtual bool IsInFly() = 0;
|
|
||||||
virtual void SetFlyFrmAttr(const SfxPoolItem& rAttr) = 0;
|
|
||||||
virtual const SfxPoolItem& GetFlyFrmAttr(sal_uInt16 nWhich) = 0;
|
|
||||||
virtual bool BeginFly( RndStdIds eAnchor, bool bAbsolutePos,
|
|
||||||
const SfxItemSet* pMoreAttrs = 0 );
|
|
||||||
virtual void SetFlyAnchor( RndStdIds eAnchor );
|
|
||||||
virtual void EndFly();
|
|
||||||
};
|
|
||||||
|
|
||||||
class SwFltOutDoc : public SwFltOutBase
|
|
||||||
{
|
|
||||||
SwFltControlStack& rStack;
|
|
||||||
SwFltEndStack& rEndStack;
|
|
||||||
SwPaM* pPaM;
|
|
||||||
SwFrmFmt* pFly;
|
|
||||||
// table items:
|
|
||||||
const SwTable* pTable;
|
|
||||||
SwPosition* pTabSavedPos; // set when in table
|
|
||||||
SwPosition* pFlySavedPos; // set when in fly
|
|
||||||
SwTwips nTableWidth;
|
|
||||||
sal_uInt16 usTableX;
|
|
||||||
sal_uInt16 usTableY;
|
|
||||||
bool bReadNoTbl; // Keine Tabellen
|
|
||||||
|
|
||||||
SwTableBox* GetBox(sal_uInt16 ny, sal_uInt16 nx = USHRT_MAX);
|
|
||||||
bool SeekCell( short nRow, short nCol, bool bPam );
|
|
||||||
void SplitTable();
|
|
||||||
public:
|
|
||||||
SwFltOutDoc(SwDoc& rDocu, SwPaM* pP, SwFltControlStack& rStk,
|
|
||||||
SwFltEndStack& rEStk)
|
|
||||||
: SwFltOutBase(rDocu)
|
|
||||||
, rStack(rStk)
|
|
||||||
, rEndStack(rEStk)
|
|
||||||
, pPaM(pP)
|
|
||||||
, pFly(0)
|
|
||||||
, pTable(0)
|
|
||||||
, pTabSavedPos(0)
|
|
||||||
, pFlySavedPos(0)
|
|
||||||
, nTableWidth(0)
|
|
||||||
, usTableX(0)
|
|
||||||
, usTableY(0)
|
|
||||||
, bReadNoTbl(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetReadNoTable() { bReadNoTbl = true; }
|
|
||||||
bool IsTableWidthSet() const { return 0 != nTableWidth; }
|
|
||||||
|
|
||||||
virtual SwFltOutBase& operator << (const SfxPoolItem& rItem) SAL_OVERRIDE;
|
|
||||||
|
|
||||||
virtual const SfxPoolItem& GetAttr(sal_uInt16 nWhich) SAL_OVERRIDE;
|
|
||||||
virtual const SfxPoolItem& GetNodeOrStyAttr(sal_uInt16 nWhich) SAL_OVERRIDE;
|
|
||||||
|
|
||||||
bool IsInTable();
|
|
||||||
virtual const SfxPoolItem& GetCellAttr(sal_uInt16 nWhich) SAL_OVERRIDE;
|
|
||||||
virtual bool BeginTable() SAL_OVERRIDE;
|
|
||||||
virtual void NextTableCell() SAL_OVERRIDE;
|
|
||||||
virtual void NextTableRow() SAL_OVERRIDE;
|
|
||||||
virtual void SetTableWidth(SwTwips nW) SAL_OVERRIDE;
|
|
||||||
virtual void SetTableOrient(sal_Int16 eOri) SAL_OVERRIDE;
|
|
||||||
virtual void SetCellWidth(SwTwips nWidth, sal_uInt16 nCell) SAL_OVERRIDE;
|
|
||||||
virtual void SetCellHeight(SwTwips nH) SAL_OVERRIDE;
|
|
||||||
virtual void SetCellBorder(const SvxBoxItem& rFmtBox, sal_uInt16 nCell) SAL_OVERRIDE;
|
|
||||||
virtual void SetCellSpace(sal_uInt16 nSp) SAL_OVERRIDE;
|
|
||||||
virtual void DeleteCell(sal_uInt16 nCell) SAL_OVERRIDE;
|
|
||||||
virtual void EndTable() SAL_OVERRIDE;
|
|
||||||
|
|
||||||
SwFrmFmt* MakeFly( RndStdIds eAnchor, SfxItemSet* pSet );
|
|
||||||
virtual bool IsInFly() SAL_OVERRIDE;
|
|
||||||
virtual void SetFlyFrmAttr(const SfxPoolItem& rAttr) SAL_OVERRIDE;
|
|
||||||
virtual const SfxPoolItem& GetFlyFrmAttr(sal_uInt16 nWhich) SAL_OVERRIDE;
|
|
||||||
virtual bool BeginFly( RndStdIds eAnchor, bool bAbsolutePos,
|
|
||||||
const SfxItemSet* pMoreAttrs = 0 ) SAL_OVERRIDE;
|
|
||||||
virtual void EndFly() SAL_OVERRIDE;
|
|
||||||
};
|
|
||||||
|
|
||||||
SW_DLLPUBLIC void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset);
|
SW_DLLPUBLIC void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -26,8 +26,6 @@ ScFormulaCellGroup::scheduleCompilation()
|
|||||||
ScRawToken::Clone() const
|
ScRawToken::Clone() const
|
||||||
ScRawToken::Delete()
|
ScRawToken::Delete()
|
||||||
ScTabView::DrawMarkRect(Rectangle const&)
|
ScTabView::DrawMarkRect(Rectangle const&)
|
||||||
ScTable::AttachFormulaCells(sc::StartListeningContext&, short, int, short, int)
|
|
||||||
ScTable::DetachFormulaCells(sc::EndListeningContext&, short, int, short, int)
|
|
||||||
ScTable::MarkSubTotalCells(sc::ColumnSpanSet&, short, int, short, int, bool) const
|
ScTable::MarkSubTotalCells(sc::ColumnSpanSet&, short, int, short, int, bool) const
|
||||||
ScVbaFormat<ooo::vba::excel::XStyle>::getAddIndent()
|
ScVbaFormat<ooo::vba::excel::XStyle>::getAddIndent()
|
||||||
ScVbaFormat<ooo::vba::excel::XStyle>::setAddIndent(com::sun::star::uno::Any const&)
|
ScVbaFormat<ooo::vba::excel::XStyle>::setAddIndent(com::sun::star::uno::Any const&)
|
||||||
@@ -204,3 +202,4 @@ sfx2::SvBaseLink::SvBaseLink(rtl::OUString const&, unsigned short, sfx2::SvLinkS
|
|||||||
std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, (anonymous namespace)::TemplateId>, std::_Select1st<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> > >::_Rb_tree(std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, (anonymous namespace)::TemplateId>, std::_Select1st<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> > >&&)
|
std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, (anonymous namespace)::TemplateId>, std::_Select1st<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> > >::_Rb_tree(std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, (anonymous namespace)::TemplateId>, std::_Select1st<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> > >&&)
|
||||||
std::__cxx1998::vector<rtl::Reference<oox::xls::(anonymous namespace)::WorkerThread>, std::allocator<rtl::Reference<oox::xls::(anonymous namespace)::WorkerThread> > >::reserve(unsigned long)
|
std::__cxx1998::vector<rtl::Reference<oox::xls::(anonymous namespace)::WorkerThread>, std::allocator<rtl::Reference<oox::xls::(anonymous namespace)::WorkerThread> > >::reserve(unsigned long)
|
||||||
vcl::MapChar(vcl::_TrueTypeFont*, unsigned short, bool)
|
vcl::MapChar(vcl::_TrueTypeFont*, unsigned short, bool)
|
||||||
|
writerfilter::TagLogger::propertySet(boost::shared_ptr<writerfilter::Reference<writerfilter::Properties> >, boost::shared_ptr<writerfilter::IdToString>)
|
||||||
|
Reference in New Issue
Block a user