This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new bf1b25cd88 Cleanup
bf1b25cd88 is described below
commit bf1b25cd889b02ff0f0810153811f35fe632c3fe
Author: mseidel <[email protected]>
AuthorDate: Sat Nov 15 15:18:22 2025 +0100
Cleanup
(cherry picked from commit a4bc93b07728844d9952f8a7879d86d0f8968835)
---
main/sw/source/ui/table/chartins.cxx | 364 +++++++++++++++++------------------
main/sw/source/ui/table/chartins.hrc | 24 ++-
main/sw/source/ui/table/colwd.cxx | 22 +--
main/sw/source/ui/table/colwd.hrc | 13 +-
main/sw/source/ui/table/convert.cxx | 196 ++++++++++---------
main/sw/source/ui/table/convert.hrc | 25 ++-
6 files changed, 315 insertions(+), 329 deletions(-)
diff --git a/main/sw/source/ui/table/chartins.cxx
b/main/sw/source/ui/table/chartins.cxx
index 5640f71964..1b4b0cf8ce 100644
--- a/main/sw/source/ui/table/chartins.cxx
+++ b/main/sw/source/ui/table/chartins.cxx
@@ -19,12 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <sfx2/viewfrm.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/dispatch.hxx>
@@ -70,202 +67,199 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using ::rtl::OUString;
-
-
Point SwGetChartDialogPos( const Window *pParentWin, const Size& rDialogSize,
const Rectangle& rLogicChart )
{
- // !! positioning code according to spepc; similar to Calc fuins2.cxx
-
- Point aRet;
-
- DBG_ASSERT( pParentWin, "Window not found" );
- if (pParentWin)
- {
- Rectangle aObjPixel = pParentWin->LogicToPixel( rLogicChart,
pParentWin->GetMapMode() );
- Rectangle aObjAbs( pParentWin->OutputToAbsoluteScreenPixel(
aObjPixel.TopLeft() ),
- pParentWin->OutputToAbsoluteScreenPixel(
aObjPixel.BottomRight() ) );
-
- Rectangle aDesktop = pParentWin->GetDesktopRectPixel();
- Size aSpace = pParentWin->LogicToPixel( Size( 8, 12 ), MAP_APPFONT );
-
- sal_Bool bLayoutRTL =
::GetActiveView()->GetWrtShell().IsTableRightToLeft();
- bool bCenterHor = false;
-
- if ( aDesktop.Bottom() - aObjAbs.Bottom() >= rDialogSize.Height() +
aSpace.Height() )
- {
- // first preference: below the chart
- aRet.Y() = aObjAbs.Bottom() + aSpace.Height();
- bCenterHor = true;
- }
- else if ( aObjAbs.Top() - aDesktop.Top() >= rDialogSize.Height() +
aSpace.Height() )
- {
- // second preference: above the chart
- aRet.Y() = aObjAbs.Top() - rDialogSize.Height() - aSpace.Height();
- bCenterHor = true;
- }
- else
- {
- bool bFitLeft = ( aObjAbs.Left() - aDesktop.Left() >=
rDialogSize.Width() + aSpace.Width() );
- bool bFitRight = ( aDesktop.Right() - aObjAbs.Right() >=
rDialogSize.Width() + aSpace.Width() );
-
- if ( bFitLeft || bFitRight )
- {
- // if both fit, prefer right in RTL mode, left otherwise
- bool bPutRight = bFitRight && ( bLayoutRTL || !bFitLeft );
- if ( bPutRight )
- aRet.X() = aObjAbs.Right() + aSpace.Width();
- else
- aRet.X() = aObjAbs.Left() - rDialogSize.Width() -
aSpace.Width();
-
- // center vertically
- aRet.Y() = aObjAbs.Top() + ( aObjAbs.GetHeight() -
rDialogSize.Height() ) / 2;
- }
- else
- {
- // doesn't fit on any edge - put at the bottom of the screen
- aRet.Y() = aDesktop.Bottom() - rDialogSize.Height();
- bCenterHor = true;
- }
- }
- if ( bCenterHor )
- aRet.X() = aObjAbs.Left() + ( aObjAbs.GetWidth() -
rDialogSize.Width() ) / 2;
-
- // limit to screen (centering might lead to invalid positions)
- if ( aRet.X() + rDialogSize.Width() - 1 > aDesktop.Right() )
- aRet.X() = aDesktop.Right() - rDialogSize.Width() + 1;
- if ( aRet.X() < aDesktop.Left() )
- aRet.X() = aDesktop.Left();
- if ( aRet.Y() + rDialogSize.Height() - 1 > aDesktop.Bottom() )
- aRet.Y() = aDesktop.Bottom() - rDialogSize.Height() + 1;
- if ( aRet.Y() < aDesktop.Top() )
- aRet.Y() = aDesktop.Top();
- }
-
- return aRet;
+ // !! positioning code according to specs; similar to Calc fuins2.cxx
+
+ Point aRet;
+
+ DBG_ASSERT( pParentWin, "Window not found" );
+ if (pParentWin)
+ {
+ Rectangle aObjPixel = pParentWin->LogicToPixel( rLogicChart,
pParentWin->GetMapMode() );
+ Rectangle aObjAbs( pParentWin->OutputToAbsoluteScreenPixel(
aObjPixel.TopLeft() ),
+
pParentWin->OutputToAbsoluteScreenPixel( aObjPixel.BottomRight() ) );
+
+ Rectangle aDesktop = pParentWin->GetDesktopRectPixel();
+ Size aSpace = pParentWin->LogicToPixel( Size( 8, 12 ),
MAP_APPFONT );
+
+ sal_Bool bLayoutRTL =
::GetActiveView()->GetWrtShell().IsTableRightToLeft();
+ bool bCenterHor = false;
+
+ if ( aDesktop.Bottom() - aObjAbs.Bottom() >=
rDialogSize.Height() + aSpace.Height() )
+ {
+ // first preference: below the chart
+ aRet.Y() = aObjAbs.Bottom() + aSpace.Height();
+ bCenterHor = true;
+ }
+ else if ( aObjAbs.Top() - aDesktop.Top() >=
rDialogSize.Height() + aSpace.Height() )
+ {
+ // second preference: above the chart
+ aRet.Y() = aObjAbs.Top() - rDialogSize.Height() -
aSpace.Height();
+ bCenterHor = true;
+ }
+ else
+ {
+ bool bFitLeft = ( aObjAbs.Left() - aDesktop.Left() >=
rDialogSize.Width() + aSpace.Width() );
+ bool bFitRight = ( aDesktop.Right() - aObjAbs.Right()
>= rDialogSize.Width() + aSpace.Width() );
+
+ if ( bFitLeft || bFitRight )
+ {
+ // if both fit, prefer right in RTL mode, left
otherwise
+ bool bPutRight = bFitRight && ( bLayoutRTL ||
!bFitLeft );
+ if ( bPutRight )
+ aRet.X() = aObjAbs.Right() +
aSpace.Width();
+ else
+ aRet.X() = aObjAbs.Left() -
rDialogSize.Width() - aSpace.Width();
+
+ // center vertically
+ aRet.Y() = aObjAbs.Top() + (
aObjAbs.GetHeight() - rDialogSize.Height() ) / 2;
+ }
+ else
+ {
+ // doesn't fit on any edge - put at the bottom
of the screen
+ aRet.Y() = aDesktop.Bottom() -
rDialogSize.Height();
+ bCenterHor = true;
+ }
+ }
+ if ( bCenterHor )
+ aRet.X() = aObjAbs.Left() + ( aObjAbs.GetWidth() -
rDialogSize.Width() ) / 2;
+
+ // limit to screen (centering might lead to invalid positions)
+ if ( aRet.X() + rDialogSize.Width() - 1 > aDesktop.Right() )
+ aRet.X() = aDesktop.Right() - rDialogSize.Width() + 1;
+ if ( aRet.X() < aDesktop.Left() )
+ aRet.X() = aDesktop.Left();
+ if ( aRet.Y() + rDialogSize.Height() - 1 > aDesktop.Bottom() )
+ aRet.Y() = aDesktop.Bottom() - rDialogSize.Height() + 1;
+ if ( aRet.Y() < aDesktop.Top() )
+ aRet.Y() = aDesktop.Top();
+ }
+
+ return aRet;
}
/*------------------------------------------------------------------------
- Beschreibung:
+ Description:
------------------------------------------------------------------------*/
-
void SwInsertChart(Window* pParent, SfxBindings* pBindings )
{
(void) pParent;
(void) pBindings;
- SwView *pView = ::GetActiveView();
+ SwView *pView = ::GetActiveView();
- // get range string of marked data
- SwWrtShell &rWrtShell = pView->GetWrtShell();
- uno::Reference< chart2::data::XDataProvider > xDataProvider;
- uno::Reference< frame::XModel > xChartModel;
- OUString aRangeString;
+ // get range string of marked data
+ SwWrtShell &rWrtShell = pView->GetWrtShell();
+ uno::Reference< chart2::data::XDataProvider > xDataProvider;
+ uno::Reference< frame::XModel > xChartModel;
+ OUString aRangeString;
if( rWrtShell.IsCrsrInTbl())
- {
- if (!rWrtShell.IsTableMode())
- {
- // select whole table
- rWrtShell.GetView().GetViewFrame()->GetDispatcher()->
- Execute(FN_TABLE_SELECT_ALL, SFX_CALLMODE_SYNCHRON);
- }
- if( ! rWrtShell.IsTblComplexForChart())
- {
- SwFrmFmt* pTblFmt = rWrtShell.GetTableFmt();
- String aCurrentTblName = pTblFmt->GetName();
-// String aText( String::CreateFromAscii("<.>") ); // was used
for UI
-// aText.Insert( rWrtShell.GetBoxNms(), 2);
-// aText.Insert( aCurrentTblName, 1 );
- aRangeString = aCurrentTblName;
- aRangeString += OUString::valueOf( sal_Unicode('.') );
- aRangeString += rWrtShell.GetBoxNms();
-
- // get table data provider
- xDataProvider.set(
pView->GetDocShell()->getIDocumentChartDataProviderAccess()->GetChartDataProvider(
true ) );
- }
- }
-
- SwFlyFrmFmt *pFlyFrmFmt = 0;
- xChartModel.set( SwTableFUNC( &rWrtShell, sal_False ).InsertChart(
xDataProvider, (sal_True == xDataProvider.is()), aRangeString, &pFlyFrmFmt ));
-
- //open wizard
- //@todo get context from writer if that has one
- uno::Reference< uno::XComponentContext > xContext(
- ::cppu::defaultBootstrap_InitialComponentContext() );
- if( xContext.is() && xChartModel.is() && xDataProvider.is())
- {
- uno::Reference< lang::XMultiComponentFactory > xMCF(
xContext->getServiceManager() );
- if(xMCF.is())
- {
- uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
- xMCF->createInstanceWithContext(
- C2U("com.sun.star.comp.chart2.WizardDialog")
- , xContext), uno::UNO_QUERY);
- uno::Reference< lang::XInitialization > xInit( xDialog,
uno::UNO_QUERY );
- if( xInit.is() )
- {
- uno::Reference< awt::XWindow > xDialogParentWindow(0);
- // initialize dialog
- uno::Sequence<uno::Any> aSeq(2);
- uno::Any* pArray = aSeq.getArray();
- beans::PropertyValue aParam1;
- aParam1.Name = C2U("ParentWindow");
- aParam1.Value <<= uno::makeAny(xDialogParentWindow);
- beans::PropertyValue aParam2;
- aParam2.Name = C2U("ChartModel");
- aParam2.Value <<= uno::makeAny(xChartModel);
- pArray[0] <<= uno::makeAny(aParam1);
- pArray[1] <<= uno::makeAny(aParam2);
- xInit->initialize( aSeq );
-
- // try to set the dialog's position so it doesn't hide the
chart
- uno::Reference < beans::XPropertySet > xDialogProps( xDialog,
uno::UNO_QUERY );
- if ( xDialogProps.is() )
- {
- try
- {
- //get dialog size:
- awt::Size aDialogAWTSize;
- if( xDialogProps->getPropertyValue(
::rtl::OUString::createFromAscii("Size") )
- >>= aDialogAWTSize )
- {
- Size aDialogSize( aDialogAWTSize.Width,
aDialogAWTSize.Height );
- if ( aDialogSize.Width() > 0 &&
aDialogSize.Height() > 0 )
- {
- //calculate and set new position
- SwRect aSwRect;
- if (pFlyFrmFmt)
- aSwRect =
pFlyFrmFmt->GetAnchoredObj()->GetObjRectWithSpaces();
- Rectangle aRect( aSwRect.SVRect() );
- Point aDialogPos = SwGetChartDialogPos(
&rWrtShell.GetView().GetEditWin(), aDialogSize, aRect );
- xDialogProps->setPropertyValue(
::rtl::OUString::createFromAscii("Position"),
- uno::makeAny(
awt::Point(aDialogPos.getX(),aDialogPos.getY()) ) );
- }
- }
- }
- catch( uno::Exception& )
- {
- DBG_ERROR( "Chart wizard couldn't be positioned
automatically\n" );
- }
- }
-
- sal_Int16 nDialogRet = xDialog->execute();
- if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL
)
- {
+ {
+ if (!rWrtShell.IsTableMode())
+ {
+ // select whole table
+ rWrtShell.GetView().GetViewFrame()->GetDispatcher()->
+ Execute(FN_TABLE_SELECT_ALL,
SFX_CALLMODE_SYNCHRON);
+ }
+ if( ! rWrtShell.IsTblComplexForChart())
+ {
+ SwFrmFmt* pTblFmt = rWrtShell.GetTableFmt();
+ String aCurrentTblName = pTblFmt->GetName();
+// String aText( String::CreateFromAscii("<.>") ); // was
used for UI
+// aText.Insert( rWrtShell.GetBoxNms(), 2);
+// aText.Insert( aCurrentTblName, 1 );
+ aRangeString = aCurrentTblName;
+ aRangeString += OUString::valueOf( sal_Unicode('.') );
+ aRangeString += rWrtShell.GetBoxNms();
+
+ // get table data provider
+ xDataProvider.set(
pView->GetDocShell()->getIDocumentChartDataProviderAccess()->GetChartDataProvider(
true ) );
+ }
+ }
+
+ SwFlyFrmFmt *pFlyFrmFmt = 0;
+ xChartModel.set( SwTableFUNC( &rWrtShell, sal_False ).InsertChart(
xDataProvider, (sal_True == xDataProvider.is()), aRangeString, &pFlyFrmFmt ));
+
+ // open wizard
+ // TODO: get context from Writer if that has one
+ uno::Reference< uno::XComponentContext > xContext(
+ ::cppu::defaultBootstrap_InitialComponentContext() );
+ if( xContext.is() && xChartModel.is() && xDataProvider.is())
+ {
+ uno::Reference< lang::XMultiComponentFactory > xMCF(
xContext->getServiceManager() );
+ if(xMCF.is())
+ {
+ uno::Reference< ui::dialogs::XExecutableDialog >
xDialog(
+ xMCF->createInstanceWithContext(
+
C2U("com.sun.star.comp.chart2.WizardDialog")
+ , xContext), uno::UNO_QUERY);
+ uno::Reference< lang::XInitialization > xInit( xDialog,
uno::UNO_QUERY );
+ if( xInit.is() )
+ {
+ uno::Reference< awt::XWindow >
xDialogParentWindow(0);
+ // initialize dialog
+ uno::Sequence<uno::Any> aSeq(2);
+ uno::Any* pArray = aSeq.getArray();
+ beans::PropertyValue aParam1;
+ aParam1.Name = C2U("ParentWindow");
+ aParam1.Value <<=
uno::makeAny(xDialogParentWindow);
+ beans::PropertyValue aParam2;
+ aParam2.Name = C2U("ChartModel");
+ aParam2.Value <<= uno::makeAny(xChartModel);
+ pArray[0] <<= uno::makeAny(aParam1);
+ pArray[1] <<= uno::makeAny(aParam2);
+ xInit->initialize( aSeq );
+
+ // try to set the dialog's position so it
doesn't hide the chart
+ uno::Reference < beans::XPropertySet >
xDialogProps( xDialog, uno::UNO_QUERY );
+ if ( xDialogProps.is() )
+ {
+ try
+ {
+ // get dialog size:
+ awt::Size aDialogAWTSize;
+ if(
xDialogProps->getPropertyValue( ::rtl::OUString::createFromAscii("Size") )
+ >>= aDialogAWTSize )
+ {
+ Size aDialogSize(
aDialogAWTSize.Width, aDialogAWTSize.Height );
+ if (
aDialogSize.Width() > 0 && aDialogSize.Height() > 0 )
+ {
+ // calculate
and set new position
+ SwRect aSwRect;
+ if (pFlyFrmFmt)
+ aSwRect
= pFlyFrmFmt->GetAnchoredObj()->GetObjRectWithSpaces();
+ Rectangle
aRect( aSwRect.SVRect() );
+ Point
aDialogPos = SwGetChartDialogPos( &rWrtShell.GetView().GetEditWin(),
aDialogSize, aRect );
+
xDialogProps->setPropertyValue( ::rtl::OUString::createFromAscii("Position"),
+
uno::makeAny( awt::Point(aDialogPos.getX(),aDialogPos.getY()) ) );
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {
+ DBG_ERROR( "Chart wizard
couldn't be positioned automatically\n" );
+ }
+ }
+
+ sal_Int16 nDialogRet = xDialog->execute();
+ if( nDialogRet ==
ui::dialogs::ExecutableDialogResults::CANCEL )
+ {
rWrtShell.Undo();
- rWrtShell.GetIDocumentUndoRedo().ClearRedo();
- }
- else
- {
- DBG_ASSERT( nDialogRet ==
ui::dialogs::ExecutableDialogResults::OK,
- "dialog execution failed" );
- }
- }
- uno::Reference< lang::XComponent > xComponent( xDialog,
uno::UNO_QUERY );
- if( xComponent.is())
- xComponent->dispose();
- }
- }
+
rWrtShell.GetIDocumentUndoRedo().ClearRedo();
+ }
+ else
+ {
+ DBG_ASSERT( nDialogRet ==
ui::dialogs::ExecutableDialogResults::OK,
+ "dialog execution failed" );
+ }
+ }
+ uno::Reference< lang::XComponent > xComponent( xDialog,
uno::UNO_QUERY );
+ if( xComponent.is())
+ xComponent->dispose();
+ }
+ }
}
@@ -275,3 +269,5 @@ void __EXPORT AutoEdit::KeyInput( const KeyEvent& rEvt )
if( nCode != KEY_SPACE )
Edit::KeyInput( rEvt );
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/table/chartins.hrc
b/main/sw/source/ui/table/chartins.hrc
index 3d3b2e1c7f..67a830693b 100644
--- a/main/sw/source/ui/table/chartins.hrc
+++ b/main/sw/source/ui/table/chartins.hrc
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#ifndef _CHARTINS_HRC
#define _CHARTINS_HRC
@@ -28,16 +26,16 @@
#include "table.hrc"
#define ED_RANGE 1
-#define FT_RANGE 2
-#define BT_NEXT 3
-#define BT_FINISH 4
-#define BT_HELP 5
-#define BT_CANCEL 6
-#define CB_FIRST_ROW 7
-#define CB_FIRST_COL 8
-#define BT_PREV 9
-#define FL_HLINE 10
-#define FT_TEXT 11
-#define FL_1 12
+#define FT_RANGE 2
+#define BT_NEXT 3
+#define BT_FINISH 4
+#define BT_HELP 5
+#define BT_CANCEL 6
+#define CB_FIRST_ROW 7
+#define CB_FIRST_COL 8
+#define BT_PREV 9
+#define FL_HLINE 10
+#define FT_TEXT 11
+#define FL_1 12
#endif
diff --git a/main/sw/source/ui/table/colwd.cxx
b/main/sw/source/ui/table/colwd.cxx
index ddedd0dc62..cbb1bec300 100644
--- a/main/sw/source/ui/table/colwd.cxx
+++ b/main/sw/source/ui/table/colwd.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -28,7 +26,6 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
#include <sfx2/dispatch.hxx>
#include <svx/dlgutil.hxx>
#include <colwd.hxx>
@@ -56,7 +53,6 @@
#include <table.hrc>
#endif
-
IMPL_LINK_INLINE_START( SwTableWidthDlg, LoseFocusHdl, Edit *, EMPTYARG )
{
sal_uInt16 nId = (sal_uInt16)aColEdit.GetValue()-1;
@@ -68,15 +64,14 @@ IMPL_LINK_INLINE_START( SwTableWidthDlg, LoseFocusHdl, Edit
*, EMPTYARG )
IMPL_LINK_INLINE_END( SwTableWidthDlg, LoseFocusHdl, Edit *, EMPTYARG )
-
SwTableWidthDlg::SwTableWidthDlg(Window *pParent, SwTableFUNC &rTableFnc ) :
SvxStandardDialog( pParent, SW_RES(DLG_COL_WIDTH) ),
- aWidthFL(this, SW_RES(FL_WIDTH)),
+ aWidthFL(this, SW_RES(FL_WIDTH)),
aColFT(this, SW_RES(FT_COL)),
aColEdit(this, SW_RES(ED_COL)),
- aWidthFT(this, SW_RES(FT_WIDTH)),
+ aWidthFT(this, SW_RES(FT_WIDTH)),
aWidthEdit(this, SW_RES(ED_WIDTH)),
aOKBtn(this, SW_RES(BT_OK)),
aCancelBtn(this, SW_RES(BT_CANCEL)),
@@ -86,8 +81,8 @@ SwTableWidthDlg::SwTableWidthDlg(Window *pParent, SwTableFUNC
&rTableFnc ) :
FreeResource();
sal_Bool bIsWeb = rTableFnc.GetShell()
- ? static_cast< sal_Bool >(0 != PTR_CAST( SwWebDocShell,
- rTableFnc.GetShell()->GetView().GetDocShell()) )
+ ? static_cast< sal_Bool >(0 !=
PTR_CAST( SwWebDocShell,
+
rTableFnc.GetShell()->GetView().GetDocShell()) )
: sal_False;
FieldUnit eFieldUnit = SW_MOD()->GetUsrPref( bIsWeb )->GetMetric();
::SetFieldUnit(aWidthEdit, eFieldUnit );
@@ -105,11 +100,12 @@ SwTableWidthDlg::SwTableWidthDlg(Window *pParent,
SwTableFUNC &rTableFnc ) :
}
-
void SwTableWidthDlg::Apply()
{
rFnc.InitTabCols();
- rFnc.SetColWidth(
- static_cast< sal_uInt16 >(aColEdit.GetValue() - 1),
- static_cast< sal_uInt16
>(aWidthEdit.Denormalize(aWidthEdit.GetValue(FUNIT_TWIP))));
+ rFnc.SetColWidth(
+ static_cast< sal_uInt16 >(aColEdit.GetValue() - 1),
+ static_cast< sal_uInt16
>(aWidthEdit.Denormalize(aWidthEdit.GetValue(FUNIT_TWIP))));
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/table/colwd.hrc
b/main/sw/source/ui/table/colwd.hrc
index e1d1989f18..0e215b98f8 100644
--- a/main/sw/source/ui/table/colwd.hrc
+++ b/main/sw/source/ui/table/colwd.hrc
@@ -19,13 +19,12 @@
*
*************************************************************/
-
-#define FT_COL 1
-#define ED_COL 2
+#define FT_COL 1
+#define ED_COL 2
#define FT_WIDTH 3
#define ED_WIDTH 4
-#define FL_WIDTH 5
+#define FL_WIDTH 5
-#define BT_OK 100
-#define BT_CANCEL 101
-#define BT_HELP 102
+#define BT_OK 100
+#define BT_CANCEL 101
+#define BT_HELP 102
diff --git a/main/sw/source/ui/table/convert.cxx
b/main/sw/source/ui/table/convert.cxx
index 9ff204b208..35bfa3b2d0 100644
--- a/main/sw/source/ui/table/convert.cxx
+++ b/main/sw/source/ui/table/convert.cxx
@@ -19,17 +19,13 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#ifdef SW_DLLIMPLEMENTATION
#undef SW_DLLIMPLEMENTATION
#endif
-
#include <vcl/msgbox.hxx>
#include <svl/stritem.hxx>
#include <sfx2/viewfrm.hxx>
@@ -53,56 +49,56 @@ namespace swui
SwAbstractDialogFactory * GetFactory();
}
-//keep the state of the buttons on runtime
+// keep the state of the buttons on runtime
static int nSaveButtonState = -1; // 0: tab, 1: semicolon, 2: paragraph, 3:
other, -1: not yet used
static sal_Bool bIsKeepColumn = sal_True;
static sal_Unicode uOther = ',';
-void SwConvertTableDlg::GetValues( sal_Unicode& rDelim,
-
SwInsertTableOptions& rInsTblOpts,
-
SwTableAutoFmt *& prTAFmt )
+void SwConvertTableDlg::GetValues( sal_Unicode& rDelim,
+
SwInsertTableOptions& rInsTblOpts,
+
SwTableAutoFmt *& prTAFmt )
{
if( aTabBtn.IsChecked() )
- {
- //0x0b mustn't be set when re-converting table into text
- bIsKeepColumn = !aKeepColumn.IsVisible() || aKeepColumn.IsChecked();
- rDelim = bIsKeepColumn ? 0x09 : 0x0b;
- nSaveButtonState = 0;
- }
+ {
+ // 0x0b mustn't be set when re-converting table into text
+ bIsKeepColumn = !aKeepColumn.IsVisible() ||
aKeepColumn.IsChecked();
+ rDelim = bIsKeepColumn ? 0x09 : 0x0b;
+ nSaveButtonState = 0;
+ }
else if( aSemiBtn.IsChecked() )
- {
+ {
rDelim = ';';
- nSaveButtonState = 1;
- }
- else if( aOtherBtn.IsChecked() && aOtherEd.GetText().Len() )
- {
- uOther = aOtherEd.GetText().GetChar( 0 );
- rDelim = uOther;
- nSaveButtonState = 3;
- }
+ nSaveButtonState = 1;
+ }
+ else if( aOtherBtn.IsChecked() && aOtherEd.GetText().Len() )
+ {
+ uOther = aOtherEd.GetText().GetChar( 0 );
+ rDelim = uOther;
+ nSaveButtonState = 3;
+ }
else
- {
- nSaveButtonState = 2;
- rDelim = cParaDelim;
- if(aOtherBtn.IsChecked())
- {
- nSaveButtonState = 3;
- uOther = 0;
- }
- }
+ {
+ nSaveButtonState = 2;
+ rDelim = cParaDelim;
+ if(aOtherBtn.IsChecked())
+ {
+ nSaveButtonState = 3;
+ uOther = 0;
+ }
+ }
sal_uInt16 nInsMode = 0;
if (aBorderCB.IsChecked())
- nInsMode |= tabopts::DEFAULT_BORDER;
+ nInsMode |= tabopts::DEFAULT_BORDER;
if (aHeaderCB.IsChecked())
- nInsMode |= tabopts::HEADLINE;
+ nInsMode |= tabopts::HEADLINE;
if (aRepeatHeaderCB.IsEnabled() && aRepeatHeaderCB.IsChecked())
- rInsTblOpts.mnRowsToRepeat = sal_uInt16( aRepeatHeaderNF.GetValue() );
+ rInsTblOpts.mnRowsToRepeat = sal_uInt16(
aRepeatHeaderNF.GetValue() );
else
rInsTblOpts.mnRowsToRepeat = 0;
if (!aDontSplitCB.IsChecked())
- nInsMode |= tabopts::SPLIT_LAYOUT;
+ nInsMode |= tabopts::SPLIT_LAYOUT;
if( pTAutoFmt )
prTAFmt = new SwTableAutoFmt( *pTAutoFmt );
@@ -117,27 +113,27 @@ SwConvertTableDlg::SwConvertTableDlg( SwView& rView, bool
bToTable )
#ifdef MSC
#pragma warning (disable : 4355)
#endif
- aTabBtn (this, SW_RES(CB_TAB)),
+ aTabBtn (this, SW_RES(CB_TAB)),
aSemiBtn (this, SW_RES(CB_SEMI)),
aParaBtn (this, SW_RES(CB_PARA)),
- aOtherBtn (this, SW_RES(RB_OTHER)),
- aOtherEd (this, SW_RES(ED_OTHER)),
- aKeepColumn (this, SW_RES(CB_KEEPCOLUMN)),
- aDelimFL (this, SW_RES(FL_DELIM)),
+ aOtherBtn (this, SW_RES(RB_OTHER)),
+ aOtherEd (this, SW_RES(ED_OTHER)),
+ aKeepColumn (this, SW_RES(CB_KEEPCOLUMN)),
+ aDelimFL (this, SW_RES(FL_DELIM)),
- aHeaderCB (this, SW_RES(CB_HEADER)),
+ aHeaderCB (this, SW_RES(CB_HEADER)),
aRepeatHeaderCB (this, SW_RES(CB_REPEAT_HEADER)),
- aRepeatHeaderFT (this, SW_RES(FT_REPEAT_HEADER)),
- aRepeatHeaderBeforeFT (this),
- aRepeatHeaderNF (this, SW_RES(NF_REPEAT_HEADER)),
- aRepeatHeaderAfterFT (this),
- aRepeatHeaderCombo (this, SW_RES(WIN_REPEAT_HEADER), aRepeatHeaderNF,
aRepeatHeaderBeforeFT, aRepeatHeaderAfterFT),
+ aRepeatHeaderFT (this, SW_RES(FT_REPEAT_HEADER)),
+ aRepeatHeaderBeforeFT (this),
+ aRepeatHeaderNF (this, SW_RES(NF_REPEAT_HEADER)),
+ aRepeatHeaderAfterFT (this),
+ aRepeatHeaderCombo (this, SW_RES(WIN_REPEAT_HEADER),
aRepeatHeaderNF, aRepeatHeaderBeforeFT, aRepeatHeaderAfterFT),
- aOptionsFL (this, SW_RES(FL_OPTIONS)),
+ aOptionsFL (this, SW_RES(FL_OPTIONS)),
aDontSplitCB (this, SW_RES(CB_DONT_SPLIT)),
aBorderCB (this, SW_RES(CB_BORDER)),
- aAutoFmtBtn(this,SW_RES(BT_AUTOFORMAT)),
+ aAutoFmtBtn(this,SW_RES(BT_AUTOFORMAT)),
aOkBtn(this,SW_RES(BT_OK)),
aCancelBtn(this,SW_RES(BT_CANCEL)),
@@ -145,54 +141,54 @@ SwConvertTableDlg::SwConvertTableDlg( SwView& rView, bool
bToTable )
#ifdef MSC
#pragma warning (default : 4355)
#endif
- sConvertTextTable(SW_RES(STR_CONVERT_TEXT_TABLE)),
+ sConvertTextTable(SW_RES(STR_CONVERT_TEXT_TABLE)),
pTAutoFmt( 0 ),
- pShell( &rView.GetWrtShell() )
+ pShell( &rView.GetWrtShell() )
{
aOtherEd.SetAccessibleName(String(SW_RES(STR_SYMBOL)));
aOtherEd.SetAccessibleRelationLabeledBy(&aOtherBtn);
FreeResource();
- if(nSaveButtonState > -1)
- {
- switch (nSaveButtonState)
- {
- case 0:
- aTabBtn.Check();
- aKeepColumn.Check(bIsKeepColumn);
- break;
- case 1: aSemiBtn.Check();break;
- case 2: aParaBtn.Check();break;
- case 3:
- aOtherBtn.Check();
- if(uOther)
- aOtherEd.SetText(uOther);
- break;
- }
-
- }
- if( bToTable )
+ if(nSaveButtonState > -1)
+ {
+ switch (nSaveButtonState)
+ {
+ case 0:
+ aTabBtn.Check();
+ aKeepColumn.Check(bIsKeepColumn);
+ break;
+ case 1: aSemiBtn.Check();break;
+ case 2: aParaBtn.Check();break;
+ case 3:
+ aOtherBtn.Check();
+ if(uOther)
+ aOtherEd.SetText(uOther);
+ break;
+ }
+
+ }
+ if( bToTable )
{
SetText( sConvertTextTable );
aAutoFmtBtn.SetClickHdl(LINK(this, SwConvertTableDlg,
AutoFmtHdl));
aAutoFmtBtn.Show();
aKeepColumn.Show();
aKeepColumn.Enable( aTabBtn.IsChecked() );
- aRepeatHeaderCombo.Arrange( aRepeatHeaderFT );
+ aRepeatHeaderCombo.Arrange( aRepeatHeaderFT );
}
else
{
- //Einfuege-Optionen verstecken
- aHeaderCB .Show(sal_False);
- aRepeatHeaderCB .Show(sal_False);
- aDontSplitCB .Show(sal_False);
- aBorderCB .Show(sal_False);
- aOptionsFL .Show(sal_False);
- aRepeatHeaderCombo.Show(sal_False);
-
- //Groesse anpassen
- Size aSize(GetSizePixel());
- aSize.Height() = 8 + aHelpBtn.GetSizePixel().Height() +
aHelpBtn.GetPosPixel().Y();
- SetOutputSizePixel(aSize);
+ // Einfüge-Optionen verstecken
+ aHeaderCB .Show(sal_False);
+ aRepeatHeaderCB .Show(sal_False);
+ aDontSplitCB .Show(sal_False);
+ aBorderCB .Show(sal_False);
+ aOptionsFL .Show(sal_False);
+ aRepeatHeaderCombo .Show(sal_False);
+
+ // Größe anpassen
+ Size aSize(GetSizePixel());
+ aSize.Height() = 8 + aHelpBtn.GetSizePixel().Height() +
aHelpBtn.GetPosPixel().Y();
+ SetOutputSizePixel(aSize);
}
aKeepColumn.SaveValue();
@@ -210,10 +206,10 @@ SwConvertTableDlg::SwConvertTableDlg( SwView& rView, bool
bToTable )
SwInsertTableOptions aInsOpts = pModOpt->GetInsTblFlags(bHTMLMode);
sal_uInt16 nInsTblFlags = aInsOpts.mnInsMode;
- aHeaderCB.Check( 0 != (nInsTblFlags & tabopts::HEADLINE) );
- aRepeatHeaderCB.Check(aInsOpts.mnRowsToRepeat > 0);
- aDontSplitCB.Check( 0 == (nInsTblFlags & tabopts::SPLIT_LAYOUT));
- aBorderCB.Check( 0!= (nInsTblFlags & tabopts::DEFAULT_BORDER) );
+ aHeaderCB.Check( 0 != (nInsTblFlags & tabopts::HEADLINE) );
+ aRepeatHeaderCB.Check(aInsOpts.mnRowsToRepeat > 0);
+ aDontSplitCB.Check( 0 == (nInsTblFlags & tabopts::SPLIT_LAYOUT));
+ aBorderCB.Check( 0!= (nInsTblFlags & tabopts::DEFAULT_BORDER) );
aHeaderCB.SetClickHdl(LINK(this, SwConvertTableDlg, CheckBoxHdl));
aRepeatHeaderCB.SetClickHdl(LINK(this, SwConvertTableDlg,
ReapeatHeaderCheckBoxHdl));
@@ -228,14 +224,14 @@ SwConvertTableDlg:: ~SwConvertTableDlg()
IMPL_LINK( SwConvertTableDlg, AutoFmtHdl, PushButton*, pButton )
{
- SwAbstractDialogFactory* pFact = swui::GetFactory();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
-
- AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton,
pShell, DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
- if( RET_OK == pDlg->Execute())
- pDlg->FillAutoFmtOfIndex( pTAutoFmt );
- delete pDlg;
+ SwAbstractDialogFactory* pFact = swui::GetFactory();
+ DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+
+ AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton,
pShell, DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt);
+ DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ if( RET_OK == pDlg->Execute())
+ pDlg->FillAutoFmtOfIndex( pTAutoFmt );
+ delete pDlg;
return 0;
}
@@ -268,10 +264,12 @@ IMPL_LINK(SwConvertTableDlg, CheckBoxHdl, CheckBox*,
EMPTYARG)
IMPL_LINK(SwConvertTableDlg, ReapeatHeaderCheckBoxHdl, void*, EMPTYARG)
{
- sal_Bool bEnable = aHeaderCB.IsChecked() && aRepeatHeaderCB.IsChecked();
- aRepeatHeaderBeforeFT.Enable(bEnable);
- aRepeatHeaderAfterFT.Enable(bEnable);
- aRepeatHeaderNF.Enable(bEnable);
+ sal_Bool bEnable = aHeaderCB.IsChecked() && aRepeatHeaderCB.IsChecked();
+ aRepeatHeaderBeforeFT.Enable(bEnable);
+ aRepeatHeaderAfterFT.Enable(bEnable);
+ aRepeatHeaderNF.Enable(bEnable);
return 0;
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/table/convert.hrc
b/main/sw/source/ui/table/convert.hrc
index d6110290ed..1726ac32e1 100644
--- a/main/sw/source/ui/table/convert.hrc
+++ b/main/sw/source/ui/table/convert.hrc
@@ -19,32 +19,31 @@
*
*************************************************************/
-
#define CB_TAB 1
#define CB_SEMI 3
#define CB_PARA 4
-#define FL_DELIM 5
+#define FL_DELIM 5
#define RB_OTHER 6
#define ED_OTHER 7
#define CB_KEEPCOLUMN 8
-#define STR_CONVERT_TEXT_TABLE 9
+#define STR_CONVERT_TEXT_TABLE 9
#define CB_HEADER 13
#define CB_REPEAT_HEADER 14
-#define CB_DONT_SPLIT 15
+#define CB_DONT_SPLIT 15
#define CB_BORDER 16
-#define FL_OPTIONS 17
+#define FL_OPTIONS 17
#define FT_REPEAT_HEADER 18
#define NF_REPEAT_HEADER 19
-//Table Row Header for ACC Supporting 2010.02.22
-#define FT_EXPLAIN_REPEAT_HEADER 20
-#define CB_LABEL 21
+// Table Row Header for ACC Supporting 2010.02.22
+#define FT_EXPLAIN_REPEAT_HEADER 20
+#define CB_LABEL 21
#define NF_REPEAT_LABEL 22
#define FT_REPEAT_LABEL 23
-//End table_row_header
+// End table_row_header
-#define BT_OK 100
-#define BT_CANCEL 101
+#define BT_OK 100
+#define BT_CANCEL 101
#define BT_AUTOFORMAT 102
-#define BT_HELP 103
-#define WIN_REPEAT_HEADER 104
+#define BT_HELP 103
+#define WIN_REPEAT_HEADER 104
#define STR_SYMBOL 105