diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/Library_msword.mk | 5 | ||||
-rw-r--r-- | sw/Library_sw.mk | 3 | ||||
-rw-r--r-- | sw/inc/fldbas.hxx | 2 | ||||
-rw-r--r-- | sw/prj/build.lst | 1 | ||||
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 18 | ||||
-rw-r--r-- | sw/source/filter/ww8/WW8TableInfo.cxx | 542 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 28 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 27 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddinf.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/shells/navsh.cxx | 2 | ||||
-rwxr-xr-x | sw/source/ui/uiview/viewling.cxx | 129 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewtab.cxx | 1 |
18 files changed, 62 insertions, 728 deletions
diff --git a/sw/Library_msword.mk b/sw/Library_msword.mk index 0ad6f6a8f6..703b0ebd88 100644 --- a/sw/Library_msword.mk +++ b/sw/Library_msword.mk @@ -57,6 +57,8 @@ $(eval $(call gb_Library_add_linked_libs,msword,\ i18nutil \ icuuc \ msfilter \ + oox \ + sax \ sal \ sfx \ sot \ @@ -80,6 +82,9 @@ $(eval $(call gb_Library_add_exception_objects,msword,\ sw/source/filter/rtf/rtfnum \ sw/source/filter/rtf/rtftbl \ sw/source/filter/rtf/swparrtf \ + sw/source/filter/ww8/docxattributeoutput \ + sw/source/filter/ww8/docxexport \ + sw/source/filter/ww8/docxexportfilter \ sw/source/filter/ww8/rtfattributeoutput \ sw/source/filter/ww8/rtfexport \ sw/source/filter/ww8/rtfexportfilter \ diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk index 76a5cf961b..5b18eaa4b9 100644 --- a/sw/Library_sw.mk +++ b/sw/Library_sw.mk @@ -586,6 +586,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\ sw/source/ui/docvw/edtwin \ sw/source/ui/docvw/edtwin2 \ sw/source/ui/docvw/edtwin3 \ + sw/source/ui/docvw/extedit \ sw/source/ui/docvw/frmsidebarwincontainer \ sw/source/ui/docvw/romenu \ sw/source/ui/docvw/srcedtw \ @@ -636,6 +637,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\ sw/source/ui/shells/langhelper \ sw/source/ui/shells/listsh \ sw/source/ui/shells/mediash \ + sw/source/ui/shells/navsh \ sw/source/ui/shells/olesh \ sw/source/ui/shells/slotadd \ sw/source/ui/shells/tabsh \ @@ -718,6 +720,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\ sw/source/ui/web/wview \ sw/source/ui/wrtsh/delete \ sw/source/ui/wrtsh/move \ + sw/source/ui/wrtsh/navmgr \ sw/source/ui/wrtsh/select \ sw/source/ui/wrtsh/wrtsh1 \ sw/source/ui/wrtsh/wrtsh2 \ diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index 444988abce..4c30eba6b0 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -336,6 +336,8 @@ public: virtual String GetFieldName() const; + virtual String GetCntnt(BOOL bName = FALSE) const; + SwField * CopyField() const; // ResId diff --git a/sw/prj/build.lst b/sw/prj/build.lst index 6c7ae58a42..57f18b7657 100644 --- a/sw/prj/build.lst +++ b/sw/prj/build.lst @@ -3,5 +3,4 @@ sw sw\prj nmake - all sw_prj NULL sw sw\qa\complex\accessibility nmake - all sw_qa_complex_accessibility NULL sw sw\qa\complex\checkColor nmake - all sw_qa_complex_checkColor NULL sw sw\qa\unoapi nmake - all sw_qa_unoapi NULL -sw sw\qa\unoapi nmake - all sw_qa_unoapi NULL sw sw\qa\core nmake - all sw_qa_cppunit sw_util NULL diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index a89ffde301..dcf2077575 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -276,6 +276,24 @@ String SwField::GetFieldName() const return sRet; } +String SwField::GetCntnt( BOOL bName ) const +{ + String sRet; + if( bName ) + { + USHORT nTypeId = GetTypeId(); + if( RES_DATETIMEFLD == GetTyp()->Which() ) + nTypeId = static_cast<USHORT>(GetSubType() & DATEFLD ? TYP_DATEFLD : TYP_TIMEFLD); + + sRet = SwFieldType::GetTypeStr( nTypeId ); + if( IsFixed() ) + ( sRet += ' ' ) += ViewShell::GetShellRes()->aFixedStr; + } + else + sRet = Expand(); + return sRet; +} + /*-------------------------------------------------------------------- Beschreibung: Parameter setzen auslesen --------------------------------------------------------------------*/ diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 9ff2839cc6..82a6df5693 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -1435,548 +1435,6 @@ RowSpansPtr WW8TableCellGrid::getRowSpansOfRow return pResult; } -bool WW8TableNodeInfo::operator < (const WW8TableNodeInfo & rInfo) const -{ - bool bRet = false; - - if (rInfo.mpNode != NULL) - { - if (mpNode == NULL) - { - bRet = true; - } - else - { - if (mpNode->GetIndex() < rInfo.mpNode->GetIndex()) - bRet = true; - } - } - - return bRet; -} - -bool CellInfo::operator < (const CellInfo & aCellInfo) const -{ - bool aRet = false; - - if (top() < aCellInfo.top()) - aRet = true; - else if (top() == aCellInfo.top()) - { - if (left() < aCellInfo.left()) - aRet = true; - else if (left() == aCellInfo.left()) - { - if (width() < aCellInfo.width()) - aRet = true; - else if (width() == aCellInfo.width()) - { - if (height() < aCellInfo.height()) - aRet = true; - else if (height() == aCellInfo.height()) - { - if (aCellInfo.getTableNodeInfo() != NULL) - { - if (m_pNodeInfo == NULL) - aRet = true; - else - { - aRet = *m_pNodeInfo < *aCellInfo.getTableNodeInfo(); - } - } - } - } - } - } - - return aRet; -} - -::std::string CellInfo::toString() const -{ - static char sBuffer[256]; - - snprintf(sBuffer, sizeof(sBuffer), - "<cellinfo left=\"%ld\"" - " right=\"%ld\"" - " top=\"%ld\"" - " bottom=\"%ld\"" - " node=\"%p\"/>", - left(), - right(), - top(), - bottom(), - m_pNodeInfo); - - return sBuffer; -} - -WW8TableNodeInfo * WW8TableInfo::reorderByLayout(const SwTable * pTable) -{ - WW8TableNodeInfo * pPrev = NULL; - WW8TableCellGrid::Pointer_t pCellGrid = getCellGridForTable(pTable); - -#ifdef DEBUG - ::std::clog << pCellGrid->toString() << ::std::endl; -#endif - - pCellGrid->addShadowCells(); - pPrev = pCellGrid->connectCells(); - - return pPrev; -} - -WW8TableCellGrid::WW8TableCellGrid() -{ -} - -WW8TableCellGrid::~WW8TableCellGrid() -{ -} - -WW8TableCellGridRow::Pointer_t WW8TableCellGrid::getRow(long nTop, bool bCreate) -{ - WW8TableCellGridRow::Pointer_t pResult; - - RowTops_t::iterator aIt = m_aRowTops.find(nTop); - - if (aIt == m_aRowTops.end()) - { - if (bCreate) - { - pResult = WW8TableCellGridRow::Pointer_t(new WW8TableCellGridRow); - m_aRows[nTop] = pResult; - m_aRowTops.insert(nTop); - } - } - else - pResult = m_aRows[nTop]; - - return pResult; -} - -WW8TableCellGrid::RowTops_t::const_iterator WW8TableCellGrid::getRowTopsBegin() const -{ - return m_aRowTops.begin(); -} - -WW8TableCellGrid::RowTops_t::const_iterator WW8TableCellGrid::getRowTopsEnd() const -{ - return m_aRowTops.end(); -} - -CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsBegin(long nTop) -{ - return getRow(nTop)->begin(); -} - -CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsEnd(long nTop) -{ - return getRow(nTop)->end(); -} - -void WW8TableCellGrid::insert(const SwRect & rRect, - WW8TableNodeInfo * pNodeInfo, - unsigned long * pFmtFrmWidth) -{ - CellInfo aCellInfo(rRect, pNodeInfo); - - if (pFmtFrmWidth != NULL) - aCellInfo.setFmtFrmWidth(*pFmtFrmWidth); - - WW8TableCellGridRow::Pointer_t pRow = getRow(rRect.Top()); - pRow->insert(aCellInfo); -} - -void WW8TableCellGrid::addShadowCells() -{ -#ifdef DEBUG - ::std::clog << "<addShadowCells>" << ::std::endl; -#endif - - RowTops_t::const_iterator aTopsIt = getRowTopsBegin(); - - while (aTopsIt != getRowTopsEnd()) - { -#ifdef DEBUG - long nTop = *aTopsIt; - (void) nTop; -#endif - CellInfoMultiSet::const_iterator aCellIt = getCellsBegin(*aTopsIt); - CellInfoMultiSet::const_iterator aCellEndIt = getCellsEnd(*aTopsIt); - - RowSpansPtr pRowSpans(new RowSpans); - - bool bBeginningOfCell = true; - bool bVertMerge = false; - SwRect aRect = aCellIt->getRect(); - long nRowSpan = 1; - while (aCellIt != aCellEndIt) - { - WW8TableNodeInfo * pNodeInfo = aCellIt->getTableNodeInfo(); - - if (bBeginningOfCell) - { - RowTops_t::const_iterator aRowSpanIt(aTopsIt); - aRowSpanIt++; - - if (aRowSpanIt != getRowTopsEnd() && - *aRowSpanIt < aCellIt->bottom()) - { - aRect.Top(*aRowSpanIt); - unsigned long nFmtFrmWidth = aCellIt->getFmtFrmWidth(); - insert(aRect, NULL, &nFmtFrmWidth); - - bVertMerge = true; - } - else - bVertMerge = false; - - nRowSpan = 1; - while (aRowSpanIt != getRowTopsEnd() && - *aRowSpanIt < aCellIt->bottom()) - { - aRowSpanIt++; - nRowSpan++; - } - - if (pNodeInfo != NULL) - pRowSpans->push_back(nRowSpan); - else - pRowSpans->push_back(-nRowSpan); - } - - if (pNodeInfo != NULL) - { - pNodeInfo->setVertMerge(bVertMerge); - } - - aCellIt++; - - bBeginningOfCell = (aRect.Left() != aCellIt->left()); - aRect = aCellIt->getRect(); - } - - WW8TableCellGridRow::Pointer_t pRow = getRow(*aTopsIt); - if (pRow.get() != NULL) - pRow->setRowSpans(pRowSpans); - - aTopsIt++; - } -#ifdef DEBUG - ::std::clog << "</addShadowCells>" << ::std::endl; -#endif -} - -WW8TableNodeInfo * WW8TableCellGrid::connectCells() -{ - RowTops_t::const_iterator aTopsIt = getRowTopsBegin(); - sal_uInt32 nRow = 0; - WW8TableNodeInfo * pLastNodeInfo = NULL; - - while (aTopsIt != getRowTopsEnd()) - { - CellInfoMultiSet::const_iterator aCellIt = getCellsBegin(*aTopsIt); - CellInfoMultiSet::const_iterator aCellEndIt = getCellsEnd(*aTopsIt); - GridColsPtr pWidths(new Widths); - TableBoxVectorPtr pTableBoxes(new TableBoxVector); - - sal_uInt32 nShadows = 0; - sal_uInt32 nCell = 0; - bool bBeginningOfCell = true; - WW8TableNodeInfo * pEndOfCellInfo = NULL; - sal_uInt32 nDepthInCell = 0; - while (aCellIt != aCellEndIt) - { - long nCellX = aCellIt->left(); - WW8TableNodeInfo * pNodeInfo = aCellIt->getTableNodeInfo(); - if (pNodeInfo != NULL) - { - const SwNode * pNode = pNodeInfo->getNode(); - - if (pNode->IsStartNode()) - { - nDepthInCell++; - pEndOfCellInfo = NULL; - } - - if (nDepthInCell == 1 && pNode->IsTxtNode()) - pEndOfCellInfo = pNodeInfo; - - pNodeInfo->setShadowsBefore(nShadows); - pNodeInfo->setCell(nCell); - pNodeInfo->setRow(nRow); - if (pLastNodeInfo != NULL) - { - pLastNodeInfo->setNext(pNodeInfo); - pLastNodeInfo->setNextNode(pNode); - } - pLastNodeInfo = pNodeInfo; - nShadows = 0; - - if (pNode->IsEndNode()) - { - nDepthInCell--; - - if (nDepthInCell == 0 && pEndOfCellInfo == NULL) - pEndOfCellInfo = pNodeInfo; - } - } - else - { - nShadows++; - } - - if (bBeginningOfCell) - { - pWidths->push_back(aCellIt->getFmtFrmWidth()); - - if (pNodeInfo != NULL) - pTableBoxes->push_back(pNodeInfo->getTableBox()); - else - pTableBoxes->push_back(NULL); - } - - aCellIt++; - bBeginningOfCell = false; - - if (aCellIt != aCellEndIt && aCellIt->left() != nCellX) - { - nCell++; - bBeginningOfCell = true; - - if (pEndOfCellInfo != NULL) - { - pEndOfCellInfo->setEndOfCell(true); - } - - pEndOfCellInfo = NULL; - } - } - - pLastNodeInfo->setShadowsAfter(nShadows); - - if (pEndOfCellInfo == NULL) - { - pEndOfCellInfo = pLastNodeInfo; - } - - pEndOfCellInfo->setEndOfCell(true); - pLastNodeInfo->setEndOfLine(true); - - WW8TableCellGridRow::Pointer_t pRow(getRow(*aTopsIt)); - pRow->setTableBoxVector(pTableBoxes); - pRow->setWidths(pWidths); - - nShadows = 0; - - aTopsIt++; - nRow++; - } - - return pLastNodeInfo; -} - -string WW8TableCellGrid::toString() -{ - string sResult = "<WW8TableCellGrid>"; - - RowTops_t::const_iterator aTopsIt = getRowTopsBegin(); - static char sBuffer[1024]; - while (aTopsIt != getRowTopsEnd()) - { - sprintf(sBuffer, "<row y=\"%ld\">", *aTopsIt); - sResult += sBuffer; - - CellInfoMultiSet::const_iterator aCellIt = getCellsBegin(*aTopsIt); - CellInfoMultiSet::const_iterator aCellsEnd = getCellsEnd(*aTopsIt); - - while (aCellIt != aCellsEnd) - { - snprintf(sBuffer, sizeof(sBuffer), "<cellInfo top=\"%ld\" bottom=\"%ld\" left=\"%ld\" right=\"%ld\">", - aCellIt->top(), aCellIt->bottom(), aCellIt->left(), aCellIt->right()); - sResult += sBuffer; - - WW8TableNodeInfo * pInfo = aCellIt->getTableNodeInfo(); - if (pInfo != NULL) - sResult += pInfo->toString(); - else - sResult += "<shadow/>\n"; - - sResult += "</cellInfo>\n"; - aCellIt++; - } - - WW8TableCellGridRow::Pointer_t pRow = getRow(*aTopsIt); - WidthsPtr pWidths = pRow->getWidths(); - if (pWidths != NULL) - { - sResult += "<widths>"; - - Widths::const_iterator aItEnd = pWidths->end(); - for (Widths::const_iterator aIt = pWidths->begin(); - aIt != aItEnd; - aIt++) - { - if (aIt != pWidths->begin()) - sResult += ", "; - - snprintf(sBuffer, sizeof(sBuffer), "%" SAL_PRIxUINT32 "", *aIt); - sResult += sBuffer; - } - - sResult += "</widths>"; - } - - RowSpansPtr pRowSpans = pRow->getRowSpans(); - if (pRowSpans.get() != NULL) - { - sResult += "<rowspans>"; - - RowSpans::const_iterator aItEnd = pRowSpans->end(); - for (RowSpans::const_iterator aIt = pRowSpans->begin(); - aIt != aItEnd; - aIt++) - { - if (aIt != pRowSpans->begin()) - sResult += ", "; - - snprintf(sBuffer, sizeof(sBuffer), "%" SAL_PRIxUINT32 "", *aIt); - sResult += sBuffer; - } - - sResult += "</rowspans>"; - } - - sResult += "</row>\n"; - aTopsIt++; - } - - sResult += "</WW8TableCellGrid>\n"; - - return sResult; -} - -TableBoxVectorPtr WW8TableCellGrid::getTableBoxesOfRow -(WW8TableNodeInfoInner * pNodeInfoInner) -{ - TableBoxVectorPtr pResult; - WW8TableCellGridRow::Pointer_t pRow = - getRow(pNodeInfoInner->getRect().Top(), false); - - if (pRow.get() != NULL) - { - pResult = pRow->getTableBoxVector(); - } - - return pResult; -} - -WidthsPtr WW8TableCellGrid::getWidthsOfRow -(WW8TableNodeInfoInner * pNodeInfoInner) -{ - GridColsPtr pResult; - - WW8TableCellGridRow::Pointer_t pRow = - getRow(pNodeInfoInner->getRect().Top(), false); - - if (pRow.get() != NULL) - { - pResult = pRow->getWidths(); - } - - return pResult; -} - -RowSpansPtr WW8TableCellGrid::getRowSpansOfRow -(WW8TableNodeInfoInner * pNodeInfoInner) -{ - RowSpansPtr pResult; - - WW8TableCellGridRow::Pointer_t pRow = - getRow(pNodeInfoInner->getRect().Top(), false); - - if (pRow.get() != NULL) - { - pResult = pRow->getRowSpans(); - } - - return pResult; -} - -WW8TableCellGridRow::WW8TableCellGridRow() -: m_pCellInfos(new CellInfoMultiSet) -{ -} - -WW8TableCellGridRow::~WW8TableCellGridRow() -{ -} - -void WW8TableCellGridRow::insert(const CellInfo & rCellInfo) -{ - m_pCellInfos->insert(rCellInfo); - -#ifdef DEBUG - ::std::clog << "<gridRowInsert>" - << rCellInfo.toString() - << "</gridRowInsert>" - << ::std::endl; -#endif -} - -CellInfoMultiSet::const_iterator WW8TableCellGridRow::begin() const -{ - return m_pCellInfos->begin(); -} - -CellInfoMultiSet::const_iterator WW8TableCellGridRow::end() const -{ - return m_pCellInfos->end(); -} - -void WW8TableCellGridRow::setTableBoxVector(TableBoxVectorPtr pTableBoxVector) -{ - m_pTableBoxVector = pTableBoxVector; -} - -void WW8TableCellGridRow::setWidths(WidthsPtr pWidths) -{ - m_pWidths = pWidths; -} - -void WW8TableCellGridRow::setRowSpans(RowSpansPtr pRowSpans) -{ - m_pRowSpans = pRowSpans; -} - -TableBoxVectorPtr WW8TableCellGridRow::getTableBoxVector() const -{ - return m_pTableBoxVector; -} - -WidthsPtr WW8TableCellGridRow::getWidths() const -{ - return m_pWidths; -} - -RowSpansPtr WW8TableCellGridRow::getRowSpans() const -{ - return m_pRowSpans; -} - -CellInfo::CellInfo(const SwRect & aRect, WW8TableNodeInfo * pNodeInfo) -: m_aRect(aRect), m_pNodeInfo(pNodeInfo), m_nFmtFrmWidth(0) -{ - if (pNodeInfo != NULL) - { - const SwTableBox * pBox = pNodeInfo->getTableBox(); - const SwFrmFmt * pFrmFmt = pBox->GetFrmFmt(); - const SwFmtFrmSize & rSize = pFrmFmt->GetFrmSize(); - - m_nFmtFrmWidth = rSize.GetWidth(); - } -} WW8TableCellGridRow::WW8TableCellGridRow() : m_pCellInfos(new CellInfoMultiSet) diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 9d5767fc61..079fa78443 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -179,6 +179,7 @@ static OString OutTBLBorderLine(RtfExport &rExport, const SvxBorderLine* pLine, if( DEF_LINE_WIDTH_0 == pLine->GetOutWidth() ) aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRHAIR); + else if ( 255 >= pLine->GetOutWidth() ) // That value comes from RTF specs { switch ( pLine->GetStyle( ) ) { @@ -3417,8 +3418,6 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const S //Get original size in twips Size aSize(sw::util::GetSwappedInSize(rGrfNode)); Size aRendered(aSize); - aRendered.Width() = rSize.Width(); - aRendered.Height() = rSize.Height(); if (pFlyFrmFmt) { const SwFmtFrmSize& rS = pFlyFrmFmt->GetFrmSize(); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index efcbe47934..e104de0c10 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -529,10 +529,10 @@ void RtfExport::ExportDocument_Impl() // protected section in the document. { const SfxItemPool& rPool = pDoc->GetAttrPool(); - USHORT nMaxItem = rPool.GetItemCount(RES_PROTECT); + USHORT nMaxItem = rPool.GetItemCount2(RES_PROTECT); for( USHORT n = 0; n < nMaxItem; ++n ) { - const SvxProtectItem* pProtect = (const SvxProtectItem*)rPool.GetItem(RES_PROTECT, n); + const SvxProtectItem* pProtect = (const SvxProtectItem*)rPool.GetItem2(RES_PROTECT, n); if (pProtect && pProtect->IsCntntProtected()) { Strm() << OOO_STRING_SVTOOLS_RTF_FORMPROT; @@ -1028,30 +1028,30 @@ void RtfExport::OutColorTable() if( 0 != ( pCol = (const SvxColorItem*)rPool.GetPoolDefaultItem( RES_CHRATR_COLOR ) )) InsColor( pCol->GetValue() ); - nMaxItem = rPool.GetItemCount(RES_CHRATR_COLOR); + nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR); for( n = 0; n < nMaxItem; ++n ) { - if( 0 != (pCol = (const SvxColorItem*)rPool.GetItem( + if( 0 != (pCol = (const SvxColorItem*)rPool.GetItem2( RES_CHRATR_COLOR, n ) ) ) InsColor( pCol->GetValue() ); } const SvxUnderlineItem* pUnder = (const SvxUnderlineItem*)GetDfltAttr( RES_CHRATR_UNDERLINE ); InsColor( pUnder->GetColor() ); - nMaxItem = rPool.GetItemCount(RES_CHRATR_UNDERLINE); + nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE); for( n = 0; n < nMaxItem;n++) { - if( 0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem( RES_CHRATR_UNDERLINE, n ) ) ) + if( 0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem2( RES_CHRATR_UNDERLINE, n ) ) ) InsColor( pUnder->GetColor() ); } const SvxOverlineItem* pOver = (const SvxOverlineItem*)GetDfltAttr( RES_CHRATR_OVERLINE ); InsColor( pOver->GetColor() ); - nMaxItem = rPool.GetItemCount(RES_CHRATR_OVERLINE); + nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE); for( n = 0; n < nMaxItem;n++) { - if( 0 != (pOver = (const SvxOverlineItem*)rPool.GetItem( RES_CHRATR_OVERLINE, n ) ) ) + if( 0 != (pOver = (const SvxOverlineItem*)rPool.GetItem2( RES_CHRATR_OVERLINE, n ) ) ) InsColor( pOver->GetColor() ); } @@ -1071,9 +1071,9 @@ void RtfExport::OutColorTable() { InsColor( pBkgrd->GetColor() ); } - nMaxItem = rPool.GetItemCount( *pIds ); + nMaxItem = rPool.GetItemCount2( *pIds ); for( n = 0; n < nMaxItem; ++n ) - if( 0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem( + if( 0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem2( *pIds , n ) )) { InsColor( pBkgrd->GetColor() ); @@ -1090,9 +1090,9 @@ void RtfExport::OutColorTable() { InsColor( pShadow->GetColor() ); } - nMaxItem = rPool.GetItemCount(RES_SHADOW); + nMaxItem = rPool.GetItemCount2(RES_SHADOW); for( n = 0; n < nMaxItem; ++n ) - if( 0 != (pShadow = (const SvxShadowItem*)rPool.GetItem( + if( 0 != (pShadow = (const SvxShadowItem*)rPool.GetItem2( RES_SHADOW, n ) ) ) { InsColor( pShadow->GetColor() ); @@ -1105,9 +1105,9 @@ void RtfExport::OutColorTable() if( 0 != ( pBox = (const SvxBoxItem*)rPool.GetPoolDefaultItem( RES_BOX ) )) InsColorLine( *pBox ); - nMaxItem = rPool.GetItemCount(RES_BOX); + nMaxItem = rPool.GetItemCount2(RES_BOX); for( n = 0; n < nMaxItem; ++n ) - if( 0 != (pBox = (const SvxBoxItem*)rPool.GetItem( RES_BOX, n ) )) + if( 0 != (pBox = (const SvxBoxItem*)rPool.GetItem2( RES_BOX, n ) )) InsColorLine( *pBox ); } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index ff74b84c35..39d15e4646 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1883,8 +1883,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition ); OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDEND??" ); - OutputField( NULL, ww::eFORMTEXT, String(), WRITEFIELD_CLOSE ); - if ( pFieldmark ) + ww::eField eFieldId = lcl_getFieldId( pFieldmark ); + if ( pFieldmark->GetFieldname().equalsAscii( ODF_UNHANDLED ) ) { IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) ); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 7899f512af..5e94ec3896 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -732,17 +732,6 @@ void wwFont::WriteRtf( const RtfAttributeOutput* rAttrOutput ) const rAttrOutput->EndFont(); } -void wwFont::WriteRtf( const RtfAttributeOutput* rAttrOutput ) const -{ - rAttrOutput->FontFamilyType( meFamily, *this ); - rAttrOutput->FontPitchType( mePitch ); - rAttrOutput->FontCharset( sw::ms::rtl_TextEncodingToWinCharset( meChrSet ) ); - rAttrOutput->StartFont( msFamilyNm ); - if ( mbAlt ) - rAttrOutput->FontAlternateName( msAltNm ); - rAttrOutput->EndFont(); -} - bool operator<(const wwFont &r1, const wwFont &r2) { int nRet = memcmp(r1.maWW8_FFN, r2.maWW8_FFN, sizeof(r1.maWW8_FFN)); @@ -877,22 +866,6 @@ void wwFontHelper::WriteFontTable(SvStream *pTableStream, WW8Fib& rFib) } } -void wwFontHelper::WriteFontTable( const DocxAttributeOutput& rAttrOutput ) -{ - ::std::vector<const wwFont *> aFontList( AsVector() ); - - ::std::for_each( aFontList.begin(), aFontList.end(), - ::std::bind2nd( ::std::mem_fun( &wwFont::WriteDocx ), &rAttrOutput ) ); -} - -void wwFontHelper::WriteFontTable( const RtfAttributeOutput& rAttrOutput ) -{ - ::std::vector<const wwFont *> aFontList( AsVector() ); - - ::std::for_each( aFontList.begin(), aFontList.end(), - ::std::bind2nd( ::std::mem_fun( &wwFont::WriteRtf ), &rAttrOutput ) ); -} - void wwFontHelper::WriteFontTable( const RtfAttributeOutput& rAttrOutput ) { ::std::vector<const wwFont *> aFontList( AsVector() ); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 51bf652392..dc346bdc1c 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3632,20 +3632,6 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) } } - std::vector< ::rtl::OUString > aListItems; - if (type==2) - { - aFldHeader[5] |= 0x80; // ffhaslistbox - const ::sw::mark::IFieldmark::parameter_map_t* const pParameters = rFieldmark.GetParameters(); - ::sw::mark::IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)); - if(pListEntries != pParameters->end()) - { - uno::Sequence< ::rtl::OUString > vListEntries; - pListEntries->second >>= vListEntries; - copy(::comphelper::stl_begin(vListEntries), ::comphelper::stl_end(vListEntries), back_inserter(aListItems)); - } - } - const ::rtl::OUString ffdeftext; const ::rtl::OUString ffformat; const ::rtl::OUString ffhelptext; diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 6ced2e734e..165279419c 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1422,6 +1422,7 @@ public: rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; } }; +#if 0 /// Used to export formatted text associated to drawings. class MSWord_SdrAttrIter : public MSWordAttrIter { @@ -1463,7 +1464,7 @@ public: rtl_TextEncoding GetNextCharSet() const; rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; } }; - +#endif // Die Klasse SwWW8AttrIter ist eine Hilfe zum Aufbauen der Fkp.chpx. // Dabei werden nur Zeichen-Attribute beachtet; Absatz-Attribute brauchen // diese Behandlung nicht. diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index ff3ae7fb77..6ed8225f68 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -62,6 +62,7 @@ #include <editeng/brshitem.hxx> #include <svx/rectenum.hxx> #include <editeng/opaqitem.hxx> +#include <editeng/shaditem.hxx> #include <editeng/boxitem.hxx> #include <editeng/outliner.hxx> // #79453# #include <editeng/frmdiritem.hxx> diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 648f9f865f..0db0be394b 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -1962,7 +1962,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : default: ; } - aSprmIter++; + aSprmIter.advance(); } if( !nLoop ) diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index 77dfdb4798..a485e1f2c2 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -48,14 +48,9 @@ #include <fldui.hrc> -#ifndef _FLDTDLG_HRC #include <fldtdlg.hrc> -#endif -#ifndef _FLDDINF_HXX #include <flddinf.hxx> -#endif #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/util/Time.hpp> diff --git a/sw/source/ui/shells/navsh.cxx b/sw/source/ui/shells/navsh.cxx index 055f8165bc..f4855ffede 100644 --- a/sw/source/ui/shells/navsh.cxx +++ b/sw/source/ui/shells/navsh.cxx @@ -33,7 +33,7 @@ #include "cmdid.h" #include <svx/svdview.hxx> -#include <svx/srchitem.hxx> +#include <svl/srchitem.hxx> #include <svl/eitem.hxx> #include <svl/whiter.hxx> #include <svx/svdopath.hxx> diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx index b05ca41d8e..1ff2555926 100755 --- a/sw/source/ui/uiview/viewling.cxx +++ b/sw/source/ui/uiview/viewling.cxx @@ -844,120 +844,6 @@ sal_Bool SwView::ExecSmartTagPopup( const Point& rPt ) return bRet; } -class SwFieldDialog : public Dialog -{ -private: - SwFieldListBox aListBox; - Edit aText; - int selection; - - DECL_LINK( MyListBoxHandler, ListBox * ); - -public: - SwFieldDialog(Window* parent, IFieldmark *fieldBM) : Dialog(parent, WB_BORDER | WB_SYSTEMWINDOW | WB_NOSHADOW ), aListBox(this), aText(this, WB_RIGHT | WB_READONLY), selection(-1) { - - assert(fieldBM!=NULL); - if (fieldBM!=NULL) { - const IFieldmark::parameter_map_t* const pParameters = fieldBM->GetParameters(); - IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)); - if(pListEntries != pParameters->end()) - { - Sequence< ::rtl::OUString> vListEntries; - pListEntries->second >>= vListEntries; - for( ::rtl::OUString* pCurrent = vListEntries.getArray(); - pCurrent != vListEntries.getArray() + vListEntries.getLength(); - ++pCurrent) - { - aListBox.InsertEntry(*pCurrent); - } - } - } - Size lbSize=aListBox.GetOptimalSize(WINDOWSIZE_PREFERRED); - lbSize.Width()+=50; - lbSize.Height()+=20; - aListBox.SetSizePixel(lbSize); - aListBox.SetSelectHdl( LINK( this, SwFieldDialog, MyListBoxHandler ) ); - aListBox.Show(); - aText.SetText(rtl::OUString::createFromAscii("Cancel")); - Size tSize=aText.GetOptimalSize(WINDOWSIZE_PREFERRED); - aText.SetSizePixel(Size(lbSize.Width(), tSize.Height())); - aText.SetPosPixel(Point(0, lbSize.Height())); - aText.Show(); - SetSizePixel(Size(lbSize.Width(), lbSize.Height()+tSize.Height())); -// SetSizePixel(Size(200, 200)); - } - - int getSelection() { - return selection; - } -protected: - /* - virtual void LoseFocus() { - printf("lose focus!!\n"); - Dialog::LoseFocus(); - printf("close:\n"); - EndDialog(8); - } - */ - - virtual long PreNotify( NotifyEvent& rNEvt ) { - if (rNEvt.GetType() == EVENT_LOSEFOCUS && aListBox.GetImplWin()==rNEvt.GetWindow()) { - EndDialog(8); - return 1; - } - if (rNEvt.GetType() == EVENT_KEYINPUT) { -// printf("PreNotify::KEYINPUT\n"); - } - return Dialog::PreNotify(rNEvt); - } -}; - -IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox ) -{ -// printf("### DROP DOWN SELECT... IsTravelSelect=%i\n", pBox->IsTravelSelect()); - if (pBox->IsTravelSelect()) { - return 0; - } else { - this->selection=pBox->GetSelectEntryPos(); - EndDialog(9); //@TODO have meaningfull returns... - return 1; - } -} - - -BOOL SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM ) -{ - sal_Bool bRet = sal_False; - const sal_Bool bOldViewLock = pWrtShell->IsViewLocked(); - pWrtShell->LockView( sal_True ); - pWrtShell->Push(); - - bRet=sal_True; - const Point aPixPos = GetEditWin().LogicToPixel( rPt ); - - SwFieldDialog aFldDlg(pEditWin, fieldBM); - aFldDlg.SetPosPixel(pEditWin->OutputToScreenPixel(aPixPos)); - - /*short ret=*/aFldDlg.Execute(); - sal_Int32 selection=aFldDlg.getSelection(); - if (selection>=0) { - (*fieldBM->GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT)] = makeAny(selection); - } - - pWrtShell->Pop( sal_False ); - pWrtShell->LockView( bOldViewLock ); - - return bRet; -} - -class SwFieldPopup : public PopupMenu -{ -public: - SwFieldPopup() { - InsertItem(1, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hello"))); - } -}; - class SwFieldListBox : public ListBox { public: @@ -994,7 +880,7 @@ public: assert(fieldBM!=NULL); if (fieldBM!=NULL) { const IFieldmark::parameter_map_t* const pParameters = fieldBM->GetParameters(); - IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_LISTENTRY))); + IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)); if(pListEntries != pParameters->end()) { Sequence< ::rtl::OUString> vListEntries; @@ -1013,7 +899,7 @@ public: aListBox.SetSizePixel(lbSize); aListBox.SetSelectHdl( LINK( this, SwFieldDialog, MyListBoxHandler ) ); aListBox.Show(); - aText.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Cancel"))); + aText.SetText(rtl::OUString::createFromAscii("Cancel")); Size tSize=aText.GetOptimalSize(WINDOWSIZE_PREFERRED); aText.SetSizePixel(Size(lbSize.Width(), tSize.Height())); aText.SetPosPixel(Point(0, lbSize.Height())); @@ -1049,6 +935,7 @@ IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox ) } } + BOOL SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM ) { sal_Bool bRet = sal_False; @@ -1065,7 +952,7 @@ BOOL SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM ) /*short ret=*/aFldDlg.Execute(); sal_Int32 selection=aFldDlg.getSelection(); if (selection>=0) { - (*fieldBM->GetParameters())[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_RESULT))] = makeAny(selection); + (*fieldBM->GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT)] = makeAny(selection); } pWrtShell->Pop( sal_False ); @@ -1074,4 +961,12 @@ BOOL SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM ) return bRet; } +class SwFieldPopup : public PopupMenu +{ +public: + SwFieldPopup() { + InsertItem(1, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hello"))); + } +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx index 31a62cf16f..2033b0f925 100644 --- a/sw/source/ui/uiview/viewtab.cxx +++ b/sw/source/ui/uiview/viewtab.cxx @@ -1262,7 +1262,6 @@ void SwView::StateTabWin(SfxItemSet& rSet) if( ( (SID_RULER_BORDERS_VERTICAL == nWhich) && ((bHasTable && !bTableVertical) || (!bVerticalWriting && !bFrmSelection && !bHasTable ) || (bFrmSelection && !bFrameHasVerticalColumns)) ) || - ( bFrmSelection && !bFrameHasVerticalColumns))) || ((SID_RULER_BORDERS == nWhich) && ((bHasTable && bTableVertical) || (bVerticalWriting && !bFrmSelection&& !bHasTable) || bFrameHasVerticalColumns))) |