[Libreoffice-commits] core.git: sw/source
Jim Raykowski
raykowj at gmail.com
Thu Mar 15 17:01:07 UTC 2018
sw/source/ui/table/tautofmt.cxx | 21 +++++++--------------
sw/source/uibase/shells/basesh.cxx | 7 ++-----
2 files changed, 9 insertions(+), 19 deletions(-)
New commits:
commit eeb4a2ec37bf88b26a9f243cc5682e96c9e35df6
Author: Jim Raykowski <raykowj at gmail.com>
Date: Tue Mar 13 19:04:44 2018 -0800
tdf#115573 Revert: tdf#107555 Apply 'Default Style' table style
...to newly inserted tables
Revert due to tables with autoformat style not able to persist direct
formatting.
Change-Id: Ic33033235b9f5bfba15ec74fa88e94da2dc21b69
Reviewed-on: https://gerrit.libreoffice.org/51253
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index d66969e539cb..97034075c537 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -154,16 +154,6 @@ void SwAutoFormatDlg::UpdateChecks( const SwTableAutoFormat& rFormat, bool bEnab
m_xBtnAlignment->set_active(rFormat.IsJustify());
}
-static void lcl_SetProperties( SwTableAutoFormat* pTableAutoFormat, bool bVal )
-{
- pTableAutoFormat->SetFont( bVal );
- pTableAutoFormat->SetJustify( bVal );
- pTableAutoFormat->SetFrame( bVal );
- pTableAutoFormat->SetBackground( bVal );
- pTableAutoFormat->SetValueFormat( bVal );
- pTableAutoFormat->SetWidthHeight( bVal );
-}
-
SwTableAutoFormat* SwAutoFormatDlg::FillAutoFormatOfIndex() const
{
if( 255 != m_nIndex )
@@ -171,9 +161,7 @@ SwTableAutoFormat* SwAutoFormatDlg::FillAutoFormatOfIndex() const
return new SwTableAutoFormat( (*m_xTableTable)[ m_nIndex ] );
}
- SwTableAutoFormat* pRet = new SwTableAutoFormat( SwViewShell::GetShellRes()->aStrNone );
- lcl_SetProperties(pRet, false);
- return pRet;
+ return nullptr;
}
// Handler:
@@ -384,7 +372,12 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, SelFormatHdl, weld::TreeView&, void)
m_nIndex = 255;
SwTableAutoFormat aTmp( SwViewShell::GetShellRes()->aStrNone );
- lcl_SetProperties( &aTmp, false );
+ aTmp.SetFont( false );
+ aTmp.SetJustify( false );
+ aTmp.SetFrame( false );
+ aTmp.SetBackground( false );
+ aTmp.SetValueFormat( false );
+ aTmp.SetWidthHeight( false );
if (nOldIdx != m_nIndex)
m_xWndPreview->NotifyChange(aTmp);
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index ef2d61b7c73a..30898e79fcb6 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -109,7 +109,6 @@
#include <SwStyleNameMapper.hxx>
#include <poolfmt.hxx>
-#include <shellres.hxx>
FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END;
@@ -2689,7 +2688,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
{
// record before shell change
_rRequest.AppendItem( SfxStringItem( FN_INSERT_TABLE, aTableName ) );
- if ( !aAutoName.isEmpty() && aAutoName != SwViewShell::GetShellRes()->aStrNone )
+ if ( !aAutoName.isEmpty() )
_rRequest.AppendItem( SfxStringItem( FN_PARAM_2, aAutoName ) );
_rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_COLUMN, nCols ) );
_rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_ROW, nRows ) );
@@ -2709,9 +2708,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
if( !aTableName.isEmpty() && !rSh.GetTableStyle( aTableName ) )
rSh.GetTableFormat()->SetName( aTableName );
- if( pTAFormat == nullptr )
- rSh.SetTableStyle( SwStyleNameMapper::GetUIName( RES_POOLTABSTYLE_DEFAULT, OUString() ) );
- else
+ if( pTAFormat != nullptr && aAutoName != SwStyleNameMapper::GetUIName( RES_POOLTABSTYLE_DEFAULT, OUString() ) )
rSh.SetTableStyle( aAutoName );
rSh.EndAllAction();
More information about the Libreoffice-commits
mailing list