From 3807946b5515e943169da907866c93b52a2b3f19 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 31 May 2015 15:17:19 +0200 Subject: tdf#91726: AutoFormat: Crash when using an existing name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a test to check if name already exists Change-Id: Ie23de04c0b747f58ab61a6e498bf212bf38b346a Reviewed-on: https://gerrit.libreoffice.org/16000 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sc/source/ui/miscdlgs/scuiautofmt.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index 773169d21ef6..fb9a60190da2 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -233,7 +233,7 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl) { aFormatName = pDlg->GetInputString(); - if ( !aFormatName.isEmpty() && !aFormatName.equals(aStrStandard) ) + if ( !aFormatName.isEmpty() && !aFormatName.equals(aStrStandard) && pFormat->find(aFormatName) == pFormat->end() ) { ScAutoFormatData* pNewData = new ScAutoFormatData( *pSelFmtData ); -- cgit v1.2.3