summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2008-11-20 14:55:36 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2008-11-20 14:55:36 +0000
commit9fc97737a2ccc06fe075234396e41269acfbad07 (patch)
tree8fec32b2761b475cb93a88f26588fdd1933675ce /svx
parent1c20d7b53d202a3400358b4248eb3c8ee49c8013 (diff)
CWS-TOOLING: integrate CWS impress163_DEV300
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/outliner.hxx5
-rw-r--r--svx/source/accessibility/AccessibleContextBase.cxx20
-rw-r--r--svx/source/outliner/outlvw.cxx33
-rw-r--r--svx/source/table/cell.cxx2
-rw-r--r--svx/source/table/tablecolumn.hxx3
-rw-r--r--svx/source/table/tablemodel.cxx46
-rw-r--r--svx/source/table/tablemodel.hxx5
-rw-r--r--svx/source/xml/xmlxtimp.cxx57
8 files changed, 145 insertions, 26 deletions
diff --git a/svx/inc/svx/outliner.hxx b/svx/inc/svx/outliner.hxx
index d8b53c19b11a..961070751160 100644
--- a/svx/inc/svx/outliner.hxx
+++ b/svx/inc/svx/outliner.hxx
@@ -396,6 +396,11 @@ public:
*/
void ToggleBullets();
+ /** enables numbering for the selected paragraphs that are not enabled and ignore all selected
+ paragraphs that already have numbering enabled.
+ */
+ void EnableBullets();
+
BOOL IsCursorAtWrongSpelledWord( BOOL bMarkIfWrong = FALSE );
BOOL IsWrongSpelledWordAtPos( const Point& rPosPixel, BOOL bMarkIfWrong = FALSE );
void SpellIgnoreWord();
diff --git a/svx/source/accessibility/AccessibleContextBase.cxx b/svx/source/accessibility/AccessibleContextBase.cxx
index 03f1a0470975..17f163c48baf 100644
--- a/svx/source/accessibility/AccessibleContextBase.cxx
+++ b/svx/source/accessibility/AccessibleContextBase.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AccessibleContextBase.cxx,v $
- * $Revision: 1.28 $
+ * $Revision: 1.28.144.1 $
*
* This file is part of OpenOffice.org.
*
@@ -662,13 +662,19 @@ void AccessibleContextBase::CommitChange (
const uno::Any& rNewValue,
const uno::Any& rOldValue)
{
- AccessibleEventObject aEvent (
- static_cast<XAccessibleContext*>(this),
- nEventId,
- rNewValue,
- rOldValue);
+ // Do not call FireEvent and do not even create the event object when no
+ // listener has been registered yet. Creating the event object can
+ // otherwise lead to a crash. See issue 93419 for details.
+ if (mnClientId != 0)
+ {
+ AccessibleEventObject aEvent (
+ static_cast<XAccessibleContext*>(this),
+ nEventId,
+ rNewValue,
+ rOldValue);
- FireEvent (aEvent);
+ FireEvent (aEvent);
+ }
}
diff --git a/svx/source/outliner/outlvw.cxx b/svx/source/outliner/outlvw.cxx
index 4c181f1f59f7..dd7f46d0f3d7 100644
--- a/svx/source/outliner/outlvw.cxx
+++ b/svx/source/outliner/outlvw.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: outlvw.cxx,v $
- * $Revision: 1.34 $
+ * $Revision: 1.34.150.2 $
*
* This file is part of OpenOffice.org.
*
@@ -1201,6 +1201,37 @@ void OutlinerView::ToggleBullets()
pOwner->UndoActionEnd( OLUNDO_DEPTH );
}
+void OutlinerView::EnableBullets()
+{
+ pOwner->UndoActionStart( OLUNDO_DEPTH );
+
+ ESelection aSel( pEditView->GetSelection() );
+ aSel.Adjust();
+
+ const bool bUpdate = pOwner->pEditEngine->GetUpdateMode();
+ pOwner->pEditEngine->SetUpdateMode( FALSE );
+
+ for ( USHORT nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
+ {
+ Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
+ DBG_ASSERT(pPara, "OutlinerView::ToggleBullets(), illegal selection?");
+
+ if( pPara && (pOwner->GetDepth(nPara) == -1) )
+ {
+ pOwner->SetDepth( pPara, 0 );
+ }
+ }
+
+ USHORT nParaCount = (USHORT) (pOwner->pParaList->GetParagraphCount()-1);
+ pOwner->ImplCheckParagraphs( aSel.nStartPara, nParaCount );
+ pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nParaCount, 0 ) );
+
+ pOwner->pEditEngine->SetUpdateMode( bUpdate );
+
+ pOwner->UndoActionEnd( OLUNDO_DEPTH );
+}
+
+
void OutlinerView::RemoveAttribsKeepLanguages( BOOL bRemoveParaAttribs )
{
RemoveAttribs( bRemoveParaAttribs, 0, TRUE /*keep language attribs*/ );
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index db8edff8ea4f..fc19bf50ea1c 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -677,6 +677,7 @@ SdrTextHorzAdjust Cell::GetTextHorizontalAdjust() const
void Cell::SetOutlinerParaObject( OutlinerParaObject* pTextObject )
{
SdrText::SetOutlinerParaObject( pTextObject );
+ maSelection.nStartPara = 0xffff;
}
// -----------------------------------------------------------------------------
@@ -1679,6 +1680,7 @@ Reference< XTextRange > SAL_CALL Cell::getEnd( ) throw (RuntimeException)
OUString SAL_CALL Cell::getString( ) throw (RuntimeException)
{
+ maSelection.nStartPara = 0xffff;
return SvxUnoTextBase::getString();
}
diff --git a/svx/source/table/tablecolumn.hxx b/svx/source/table/tablecolumn.hxx
index b450122fb11e..b065c9e3e75d 100644
--- a/svx/source/table/tablecolumn.hxx
+++ b/svx/source/table/tablecolumn.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: tablecolumn.hxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.3.264.1 $
*
* This file is part of OpenOffice.org.
*
@@ -51,6 +51,7 @@ typedef ::cppu::ImplInheritanceHelper2< ::comphelper::FastPropertySet, ::com::su
class TableColumn : public TableColumnBase
{
friend class TableColumnUndo;
+ friend class TableModel;
public:
TableColumn( const TableModelRef& xTableModel, sal_Int32 nColumn );
virtual ~TableColumn();
diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx
index 2dd01bfca632..a28d2291363b 100644
--- a/svx/source/table/tablemodel.cxx
+++ b/svx/source/table/tablemodel.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: tablemodel.cxx,v $
- * $Revision: 1.4 $
+ * $Revision: 1.4.264.2 $
*
* This file is part of OpenOffice.org.
*
@@ -248,6 +248,7 @@ void TableModel::UndoInsertRows( sal_Int32 nIndex, sal_Int32 nCount )
// remove the rows
remove_range<RowVector,RowVector::iterator>( maRows, nIndex, nCount );
+ updateRows();
setModified(sal_True);
}
@@ -264,6 +265,7 @@ void TableModel::UndoRemoveRows( sal_Int32 nIndex, RowVector& aRows )
for( sal_Int32 nOffset = 0; nOffset < nCount; ++nOffset )
maRows[nIndex+nOffset] = aRows[nOffset];
+ updateRows();
setModified(sal_True);
}
@@ -278,6 +280,8 @@ void TableModel::UndoInsertColumns( sal_Int32 nIndex, sal_Int32 nCount )
sal_Int32 nRows = getRowCountImpl();
while( nRows-- )
maRows[nRows]->removeColumns( nIndex, nCount );
+
+ updateColumns();
setModified(sal_True);
}
@@ -301,6 +305,8 @@ void TableModel::UndoRemoveColumns( sal_Int32 nIndex, ColumnVector& aCols, CellV
sal_Int32 nRows = getRowCountImpl();
for( sal_Int32 nRow = 0; nRow < nRows; ++nRow )
maRows[nRow]->insertColumns( nIndex, nCount, &aIter );
+
+ updateColumns();
setModified(sal_True);
}
@@ -802,6 +808,7 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount )
{
DBG_ERROR("sdr::table::TableModel::insertColumns(), exception caught!");
}
+ updateColumns();
setModified(sal_True);
}
}
@@ -905,6 +912,7 @@ void TableModel::removeColumns( sal_Int32 nIndex, sal_Int32 nCount )
DBG_ERROR("sdr::table::TableModel::removeColumns(), exception caught!");
}
+ updateColumns();
setModified(sal_True);
}
}
@@ -915,6 +923,8 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
{
if( nCount && mpTableObj )
{
+ SdrModel* pModel = mpTableObj->GetModel();
+ bool bBegUndo = false;
try
{
TableModelNotifyGuard aGuard( this );
@@ -930,13 +940,13 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
aNewRows[nOffset] = xNewRow;
}
- SdrModel* pModel = mpTableObj->GetModel();
if( pModel && mpTableObj->IsInserted() )
{
pModel->BegUndo( ImpGetResStr(STR_TABLE_INSROW) );
pModel->AddUndo( pModel->GetSdrUndoFactory().CreateUndoGeoObject(*mpTableObj) );
TableModelRef xThis( this );
pModel->AddUndo( new InsertRowUndo( xThis, nIndex, aNewRows ) );
+ bBegUndo = true;
}
// check if cells merge over new columns
@@ -967,14 +977,15 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
}
}
}
-
- if( pModel )
- pModel->EndUndo();
}
catch( Exception& )
{
DBG_ERROR("sdr::table::TableModel::insertRows(), exception caught!");
}
+ if( pModel && bBegUndo )
+ pModel->EndUndo();
+
+ updateRows();
setModified(sal_True);
}
}
@@ -1063,6 +1074,7 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount )
DBG_ERROR("sdr::table::TableModel::removeRows(), exception caught!");
}
+ updateRows();
setModified(sal_True);
}
}
@@ -1178,4 +1190,28 @@ void TableModel::optimize()
// -----------------------------------------------------------------------------
+void TableModel::updateRows()
+{
+ sal_Int32 nRow = 0;
+ RowVector::iterator iter = maRows.begin();
+ while( iter != maRows.end() )
+ {
+ (*iter++)->mnRow = nRow++;
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void TableModel::updateColumns()
+{
+ sal_Int32 nColumn = 0;
+ ColumnVector::iterator iter = maColumns.begin();
+ while( iter != maColumns.end() )
+ {
+ (*iter++)->mnColumn = nColumn++;
+ }
+}
+
+// -----------------------------------------------------------------------------
+
} }
diff --git a/svx/source/table/tablemodel.hxx b/svx/source/table/tablemodel.hxx
index caf8f8912269..73e188dd3f5c 100644
--- a/svx/source/table/tablemodel.hxx
+++ b/svx/source/table/tablemodel.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: tablemodel.hxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.3.264.1 $
*
* This file is part of OpenOffice.org.
*
@@ -176,6 +176,9 @@ private:
TableRowRef getRow( sal_Int32 nRow ) const throw (::com::sun::star::lang::IndexOutOfBoundsException);
TableColumnRef getColumn( sal_Int32 nColumn ) const throw (::com::sun::star::lang::IndexOutOfBoundsException);
+ void updateRows();
+ void updateColumns();
+
RowVector maRows;
ColumnVector maColumns;
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx
index 704980a48c8b..e211c98f6834 100644
--- a/svx/source/xml/xmlxtimp.cxx
+++ b/svx/source/xml/xmlxtimp.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xmlxtimp.cxx,v $
- * $Revision: 1.17 $
+ * $Revision: 1.17.264.1 $
*
* This file is part of OpenOffice.org.
*
@@ -260,8 +260,15 @@ void SvxXMLTableImportContext::importMarker( USHORT nPrfx, const OUString& rLoca
(void)nPrfx;
(void)rLocalName;
- XMLMarkerStyleImport aMarkerStyle( GetImport() );
- aMarkerStyle.importXML( xAttrList, rAny, rName );
+ try
+ {
+ XMLMarkerStyleImport aMarkerStyle( GetImport() );
+ aMarkerStyle.importXML( xAttrList, rAny, rName );
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SvxXMLTableImportContext::importMarker(), exception caught!");
+ }
}
void SvxXMLTableImportContext::importDash( USHORT nPrfx, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList, Any& rAny, OUString& rName )
@@ -269,8 +276,15 @@ void SvxXMLTableImportContext::importDash( USHORT nPrfx, const OUString& rLocalN
(void)nPrfx;
(void)rLocalName;
- XMLDashStyleImport aDashStyle( GetImport() );
- aDashStyle.importXML( xAttrList, rAny, rName );
+ try
+ {
+ XMLDashStyleImport aDashStyle( GetImport() );
+ aDashStyle.importXML( xAttrList, rAny, rName );
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SvxXMLTableImportContext::importDash(), exception caught!");
+ }
}
void SvxXMLTableImportContext::importHatch( USHORT nPrfx, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList, Any& rAny, OUString& rName )
@@ -278,8 +292,15 @@ void SvxXMLTableImportContext::importHatch( USHORT nPrfx, const OUString& rLocal
(void)nPrfx;
(void)rLocalName;
- XMLHatchStyleImport aHatchStyle( GetImport() );
- aHatchStyle.importXML( xAttrList, rAny, rName );
+ try
+ {
+ XMLHatchStyleImport aHatchStyle( GetImport() );
+ aHatchStyle.importXML( xAttrList, rAny, rName );
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SvxXMLTableImportContext::importHatch(), exception caught!");
+ }
}
void SvxXMLTableImportContext::importGradient( USHORT nPrfx, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList, Any& rAny, OUString& rName )
@@ -287,8 +308,15 @@ void SvxXMLTableImportContext::importGradient( USHORT nPrfx, const OUString& rLo
(void)nPrfx;
(void)rLocalName;
- XMLGradientStyleImport aGradientStyle( GetImport() );
- aGradientStyle.importXML( xAttrList, rAny, rName );
+ try
+ {
+ XMLGradientStyleImport aGradientStyle( GetImport() );
+ aGradientStyle.importXML( xAttrList, rAny, rName );
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SvxXMLTableImportContext::importGradient(), exception caught!");
+ }
}
void SvxXMLTableImportContext::importBitmap( USHORT nPrfx, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList, Any& rAny, OUString& rName )
@@ -296,8 +324,15 @@ void SvxXMLTableImportContext::importBitmap( USHORT nPrfx, const OUString& rLoca
(void)nPrfx;
(void)rLocalName;
- XMLImageStyle aImageStyle;
- aImageStyle.importXML( xAttrList, rAny, rName, GetImport() );
+ try
+ {
+ XMLImageStyle aImageStyle;
+ aImageStyle.importXML( xAttrList, rAny, rName, GetImport() );
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SvxXMLTableImportContext::importBitmap(), exception caught!");
+ }
}
///////////////////////////////////////////////////////////////////////