View Issue Details

IDProjectCategoryView StatusLast Update
0000970ScribusStory Editor / Text Framespublic2005-07-05 09:30
Reporterlouisdesjardins Assigned Tofschmid  
PriorityhighSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.3 
Fixed in Version1.3.0cvs 
Summary0000970: Being able to de-hyphenate text
DescriptionOnce a text have been hyphenated through the Extra>Hyphenate Text command or else if “Check During Typing“ option is checked, it is not possible to de-hyphenate the text. (I should add, easily!*)
Additional Information*Actually, there is a way to de-hyphenate but I wouldn't recommend doing that unless you really and desperately need the text to be de-hyphenated : deselect the “Automatic“ option in the Hyphenator Settings menu and then go to Extra>Hyphenate Text and systematically “Skip“ any suggestion Scribus will make. At the end of the process, your text will not be hyphenated anymore!
TagsNo tags attached.
Patch

Relationships

child of 0003828 acknowledged Metabug: Hyphenation 

Activities

TomK32

2005-02-18 16:23

reporter   ~0003738

it's a patch for latest CVS.

For testing I used Lorem Ipsum. Hyphenated, saved, dehyphenated and saved as different file. Diff showed no difference at all which must means that it works lossless.

2005-02-18 16:29

 

dehyphenator.tar (10,240 bytes)

2005-04-05 06:45

 

dehypenator.patch (2,596 bytes)   
Index: scribus.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.cpp,v
retrieving revision 1.228.2.243
diff -r1.228.2.243 scribus.cpp
> 	scrActions.insert("extrasDeHyphenateText", new ScrAction(tr("&Dehyphenate Text"), QKeySequence(), this, "extrasDeHyphenateText"));
1380a1385
> 	connect( scrActions["extrasDeHyphenateText"], SIGNAL(activated()) , this, SLOT(doDeHyphenate()) );
1629a1635,1636
> 	scrMenuMgr->addMenuSeparator("View");
1652c1659,1660
< 	scrMenuMgr->addMenuItem(scrActions["extrasGenerateTableOfContents"], "Extras");
---
> 	scrMenuMgr->addMenuItem(scrActions["extrasDeHyphenateText"], "Extras");
> 	scrMenuMgr->addMenuItem(scrActions["extrasGenerateTableOfContents"], "Extras");        
9943a9958,9970
> void ScribusApp::doDeHyphenate()
> {
> 	if (HaveDoc)
> 	{
> 		if (view->SelItem.count() != 0)
> 		{
> 			PageItem *b = view->SelItem.at(0);
> 			if (doc->docHyphenator->Language != b->Language)
> 				doc->docHyphenator->slotNewDict(b->Language);
> 			doc->docHyphenator->slotDeHyphenate(b);
> 		}
> 	}
> }
Index: scribus.h
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.h,v
retrieving revision 1.60.2.75
diff -r1.60.2.75 scribus.h
261a262
> 	void doDeHyphenate();
Index: hyphenator.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/hyphenator.cpp,v
retrieving revision 1.15.2.6
diff -r1.15.2.6 hyphenator.cpp
204a205
> 
362a364,393
> 
> /*!
> \fn void Hyphenator::slotDeHyphenate(PageItem* it)
>  \brief Remove all Hyphenations from the whole text frame or its selected parts.
>  \date 2005-04-05
>  \author Thomas R. Koll, <tomk32@tomk32.de>, http://verlag.tomk32.de
>  \param it references \see PageItem - text frame.
>  \retval None
>  */
> void Hyphenator::slotDeHyphenate(PageItem* it)
> {
>     uint c;
>     if ( it->HasSel )
>     {
>         for (c=0; c < it->Ptext.count(); c++ ) {
>             if (it->Ptext.at(c)->cselect)
>                 it->Ptext.at(c)->cstyle &= 127;
>         }
>     }
>     else
>     {
>         for (c=0; c < it->Ptext.count(); c++ )
>             it->Ptext.at(c)->cstyle &= 127;
>     }
>         qApp->setOverrideCursor(QCursor(ArrowCursor), true);
>         doc->DoDrawing = true;
>         it->OwnPage->RefreshItem(it);
> 
> }
> 
Index: hyphenator.h
===================================================================
RCS file: /cvs/Scribus/scribus/hyphenator.h,v
retrieving revision 1.6
diff -r1.6 hyphenator.h
49a50
> 	void slotDeHyphenate(PageItem *it);
dehypenator.patch (2,596 bytes)   

TomK32

2005-04-05 06:46

reporter   ~0004075

dehypenator.patch is for cvs1.3

2005-04-26 02:51

 

dehyphenator.patch (2,433 bytes)   
Index: actionmanager.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/actionmanager.cpp,v
retrieving revision 1.1.2.2
diff -r1.1.2.2 actionmanager.cpp
477a478
> 	scrActions->insert("extrasDeHyphenateText", new ScrAction(tr("&Dehyphenate Text"), QKeySequence(), ScApp, "extrasDeHyphenateText"));
Index: hyphenator.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/hyphenator.cpp,v
retrieving revision 1.15.2.9
diff -r1.15.2.9 hyphenator.cpp
374a375,409
> 
> /*!
> \fn void Hyphenator::slotDeHyphenate(PageItem* it)
>  \brief Remove all Hyphenations from the whole text frame or its selected parts.
>  \date 2005-04-05
>  \author Thomas R. Koll, <tomk32@tomk32.de>
>  \param it references \see PageItem - text frame.
>  \retval None
>  */
> void Hyphenator::slotDeHyphenate(PageItem* it)
> {
>   doc->DoDrawing = false;
>   uint c;
>   if ( it->HasSel )
>     {
>       for (c=0; c < it->itemText.count(); c++ ) {
> 	if (it->itemText.at(c)->cselect)
> 	  it->itemText.at(c)->cstyle &= 127;
>       }
>     }
>   else
>     {
>       // go to first frame
>       while (it->BackBox)
> 	it = it->BackBox; 
>       do {
> 	for (c=0; c < it->itemText.count(); c++ )
> 	  it->itemText.at(c)->cstyle &= 127;
>       } while (it->NextBox);
>     }
>   qApp->setOverrideCursor(QCursor(ArrowCursor), true);
>   doc->DoDrawing = true;
> 
> }
> 
Index: hyphenator.h
===================================================================
RCS file: /cvs/Scribus/scribus/hyphenator.h,v
retrieving revision 1.6
diff -r1.6 hyphenator.h
49a50
> 	void slotDeHyphenate(PageItem *it);
Index: scribus.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.cpp,v
retrieving revision 1.228.2.274
diff -r1.228.2.274 scribus.cpp
1243a1244
> 	scrMenuMgr->addMenuItem(scrActions["extrasDeHyphenateText"], "Extras");
9615a9617,9630
> void ScribusApp::doDeHyphenate()
> {
>         if (HaveDoc)
>         {
>                 if (view->SelItem.count() != 0)
>                 {
>                         PageItem *b = view->SelItem.at(0);
>                         if (doc->docHyphenator->Language != b->Language)
>                                 doc->docHyphenator->slotNewDict(b->Language);
>                         doc->docHyphenator->slotDeHyphenate(b);
>                 }
>         }
> }
> 
dehyphenator.patch (2,433 bytes)   

ringerc

2005-04-26 07:46

reporter   ~0004414

Reminder sent to: fschmid

Any opinion on this?

It needs tweaks so the menu item is only active when a text item is selected, but it seems fairly low impact, and does solve a real user problem.

I've had a couple of people ask if it'd work with 1.2.2cvs too, so it's evidently a real issue for some folks.

louisdesjardins

2005-04-26 10:32

developer   ~0004417

Ideally, the ability to hyphenate/dehyphenate should be an option in the stylesheet definition.

Case:
You need *body text hyphenated.
You don't want *titles, *lead paragraphs, *subtitles to be hyphenated.
For *each, you want to set a stylesheet.

Can't include hyphenation at the moment in the style definition.
When it will be available, you'll want to be able to change your mind and decide for example that subtitles will be hyphenated.

Sorry the initial report for this was not very explicit. This explains better my view on this issue.

And, to add to what Craig says, yes, it's a real issue!

ringerc

2005-06-30 13:09

reporter   ~0005270

Reminder sent to: fschmid

Franz, do you think we should apply this - at least to 1.2.2cvs or 1.2.3cvs? Users do need some way to de hyphenate text, and this'll do until we can get some improved text handling in with the new file format.

2005-07-01 09:46

 

dehyph_122cvs.diff (5,534 bytes)   
? Document-1.pdf
? doc/en/tutorials/short-words/Makefile
? doc/en/tutorials/short-words/Makefile.in
? plugins/gettext/odtim/.deps
? plugins/gettext/odtim/.libs
? plugins/gettext/odtim/Makefile
? plugins/gettext/odtim/Makefile.in
? plugins/gettext/odtim/contentreader.lo
? plugins/gettext/odtim/libodtimplugin.la
? plugins/gettext/odtim/odtdia.lo
? plugins/gettext/odtim/odtdia.moc
? plugins/gettext/odtim/odtim.lo
? plugins/gettext/odtim/stylereader.lo
? plugins/scriptplugin/editmacrodialog.cpp
? plugins/scriptplugin/editmacrodialog.h
? plugins/scriptplugin/managemacrosdialog.cpp
? plugins/scriptplugin/managemacrosdialog.h
? plugins/scriptplugin/samples/Makefile
? plugins/scriptplugin/samples/Makefile.in
? plugins/scriptplugin/scripts/Makefile
? plugins/scriptplugin/scripts/Makefile.in
Index: hyphenator.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/hyphenator.cpp,v
retrieving revision 1.19
diff -u -r1.19 hyphenator.cpp
--- hyphenator.cpp	18 Apr 2005 21:23:04 -0000	1.19
+++ hyphenator.cpp	1 Jul 2005 11:45:53 -0000
@@ -369,3 +369,31 @@
 	doc->DoDrawing = true;
 	nb1->OwnPage->RefreshItem(nb1);
 }
+
+/*!
+  \fn void Hyphenator::slotDeHyphenate(PageItem* it)
+  \brief Remove all Hyphenations from the whole text frame or its selected parts.
+  \date 2005-01-18
+  \author Thomas R. Koll, <tomk32@tomk32.de>
+  \param it references \see PageItem - text frame.
+  \retval None
+  */
+void Hyphenator::slotDeHyphenate(PageItem* it)
+{
+	uint c;
+	if ( it->HasSel )
+	{
+		for (c=0; c < it->Ptext.count(); c++ ) {
+			if (it->Ptext.at(c)->cselect)
+				it->Ptext.at(c)->cstyle &= 127;
+		}
+	}
+	else
+	{
+		for (c=0; c < it->Ptext.count(); c++ )
+			it->Ptext.at(c)->cstyle &= 127;
+	}
+	qApp->setOverrideCursor(QCursor(ArrowCursor), true);
+	doc->DoDrawing = true;
+	it->OwnPage->RefreshItem(it);
+}
Index: hyphenator.h
===================================================================
RCS file: /cvs/Scribus/scribus/hyphenator.h,v
retrieving revision 1.6
diff -u -r1.6 hyphenator.h
--- hyphenator.h	10 Apr 2004 10:08:59 -0000	1.6
+++ hyphenator.h	1 Jul 2005 11:45:53 -0000
@@ -47,5 +47,6 @@
 	void slotNewSettings(int Wordlen, bool Autom, bool ACheck, int Num);
 	void slotHyphenateWord(PageItem* it, QString text, int firstC);
 	void slotHyphenate(PageItem *it);
+	void slotDeHyphenate(PageItem *it);
 };
 #endif
Index: scribus.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.cpp,v
retrieving revision 1.288
diff -u -r1.288 scribus.cpp
--- scribus.cpp	24 Jun 2005 16:31:46 -0000	1.288
+++ scribus.cpp	1 Jul 2005 11:45:55 -0000
@@ -834,6 +834,9 @@
 	hyph = extraMenu->insertItem( tr("&Hyphenate Text"), this, SLOT(doHyphenate()));
 	extraMenu->setItemEnabled(hyph, 0);
 	SetKeyEntry(50, tr("Hyphenate Text"), hyph, 0);
+	dehyph = extraMenu->insertItem( tr("&Deyphenate Text"), this, SLOT(doDeHyphenate()));
+	extraMenu->setItemEnabled(dehyph, 0);
+	SetKeyEntry(50, tr("Dehyphenate Text"), hyph, 0);
 
 	settingsMenu = new QPopupMenu();
 	tip = settingsMenu->insertItem( tr("Toolti&ps"), this, SLOT(ToggleTips()));
@@ -2701,6 +2704,7 @@
 		editMenu->setItemEnabled(edid4, 0);
 		editMenu->setItemEnabled(Sear, 0);
 		extraMenu->setItemEnabled(hyph, 0);
+		extraMenu->setItemEnabled(dehyph, 0);
 		StilMenu->clear();
 		WerkTools->KetteAus->setEnabled(false);
 		WerkTools->KetteEin->setEnabled(false);
@@ -2719,6 +2723,7 @@
 		editMenu->setItemEnabled(edid4, 0);
 		editMenu->setItemEnabled(Sear, 0);
 		extraMenu->setItemEnabled(hyph, 0);
+		extraMenu->setItemEnabled(dehyph, 0);
 		menuBar()->setItemEnabled(Stm, 1);
 		menuBar()->setItemEnabled(Obm, 1);
 		if ((b->isTableItem) && (b->isSingleSel))
@@ -2838,6 +2843,7 @@
 		editMenu->setItemEnabled(edid4, 0);
 		editMenu->setItemEnabled(Sear, 0);
 		extraMenu->setItemEnabled(hyph, 0);
+		extraMenu->setItemEnabled(dehyph, 0);
 		menuBar()->setItemEnabled(Stm, 1);
 		menuBar()->setItemEnabled(Obm, 1);
 		ObjMenu->setItemEnabled(ShapeM, 0);
@@ -2882,6 +2888,7 @@
 		editMenu->setItemEnabled(edid4, 0);
 		editMenu->setItemEnabled(Sear, 0);
 		extraMenu->setItemEnabled(hyph, 0);
+		extraMenu->setItemEnabled(dehyph, 0);
 		menuBar()->setItemEnabled(Stm, 1);
 		menuBar()->setItemEnabled(Obm, 1);
 		StilMenu->clear();
@@ -3886,6 +3893,7 @@
 		editMenu->setItemEnabled(edid6a, 0);
 		editMenu->setItemEnabled(Sear, 0);
 		extraMenu->setItemEnabled(hyph, 0);
+		extraMenu->setItemEnabled(dehyph, 0);
 		menuBar()->setItemEnabled(ViMen, 0);
 		menuBar()->setItemEnabled(WinMen, 0);
 		viewMenu->setItemChecked(uGuide, false);
@@ -8983,6 +8991,21 @@
 			doc->Trenner->slotHyphenate(b);
 			slotDocCh();
 		}
+		extraMenu->setItemEnabled(dehyph, 1);
+	}
+}
+
+void ScribusApp::doDeHyphenate()
+{
+    PageItem *b;
+    if (HaveDoc)
+    {
+        if (doc->ActPage->SelItem.count() != 0)
+		{
+			b = doc->ActPage->SelItem.at(0);
+			doc->Trenner->slotDeHyphenate(b);
+			slotDocCh();
+		}
 	}
 }
 
Index: scribus.h
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.h,v
retrieving revision 1.67
diff -u -r1.67 scribus.h
--- scribus.h	1 Jun 2005 23:14:04 -0000	1.67
+++ scribus.h	1 Jul 2005 11:45:55 -0000
@@ -246,6 +246,7 @@
 	void CanUndo();
 	void configHyphenator();
 	void doHyphenate();
+	void doDeHyphenate();
 	void slotTest();
 	void slotTest2();
 	void PutScrap(QString t);
@@ -576,6 +577,7 @@
 	int LockOb;
 	int exmn;
 	int hyph;
+	int dehyph;
 	int ORaise;
 	int OLower;
 	int OBack;
dehyph_122cvs.diff (5,534 bytes)   

ringerc

2005-07-01 09:48

reporter   ~0005308

I want to merge this for 1.2.2 as well - I think that's much more important than for 1.3 (where we'll fix it properly) anyway.

The current patch doesn't quite work right, however. The "dehyphenate" menu item is note always enabled when a text item is selected, hyphenated or unhyphenated.

Tom32k, if you can fix that and provide a diff in `diff -u' format that applies cleanly to 1.2.2cvs I'll merge your patch.

fschmid

2005-07-01 10:55

developer   ~0005312

Craig, it's not a good idea to apply this patch to the 1.2.2 branch yet, as it will break the string freeze we're in. And the patch here in the Bug is not correct, the code i've put into 1.3.0 is much better.

ringerc

2005-07-01 11:02

reporter   ~0005313

OK. That makes sense. Unfortunate, but yes especially given the freeze I have to agree. Up to you then - if you like I can try to adapt your 1.3 patch and drop it in after the 1.2.2 release. I do think it's important - we get enough questions on IRC about it to indicate it's causing people real problems.

plinnell

2005-07-03 19:00

viewer   ~0005372

bumping to 1.2.3

ringerc

2005-07-05 03:14

reporter   ~0005389

Closing this again. I don't have time to try to port the patch nor the knowledge to be sure it's correct.

Issue History

Date Modified Username Field Change
2004-08-14 20:40 louisdesjardins New Issue
2005-02-18 16:23 TomK32 Note Added: 0003738
2005-02-18 16:29 TomK32 File Added: dehyphenator.tar
2005-04-05 06:45 TomK32 File Added: dehypenator.patch
2005-04-05 06:46 TomK32 Note Added: 0004075
2005-04-26 02:51 TomK32 File Added: dehyphenator.patch
2005-04-26 07:46 ringerc Note Added: 0004414
2005-04-26 07:47 ringerc Status new => acknowledged
2005-04-26 10:32 louisdesjardins Note Added: 0004417
2005-06-30 13:09 ringerc Note Added: 0005270
2005-06-30 13:12 ringerc Priority normal => high
2005-06-30 13:12 ringerc OS Mandrake =>
2005-06-30 13:12 ringerc OS Version 10 =>
2005-06-30 13:12 ringerc Platform Linux =>
2005-06-30 13:12 ringerc Product Version 1.2CVS => 1.2.2cvs
2005-06-30 19:57 fschmid Status acknowledged => resolved
2005-06-30 19:57 fschmid Fixed in Version => 1.3.0cvs
2005-06-30 19:57 fschmid Resolution open => fixed
2005-06-30 19:57 fschmid Assigned To => fschmid
2005-07-01 09:46 ringerc File Added: dehyph_122cvs.diff
2005-07-01 09:46 ringerc Status resolved => assigned
2005-07-01 09:46 ringerc Assigned To fschmid => ringerc
2005-07-01 09:48 ringerc Note Added: 0005308
2005-07-01 10:55 fschmid Note Added: 0005312
2005-07-01 11:02 ringerc Note Added: 0005313
2005-07-03 19:00 plinnell Note Added: 0005372
2005-07-03 19:00 plinnell Product Version 1.2.2cvs => 1.2.3
2005-07-05 03:14 ringerc Status assigned => resolved
2005-07-05 03:14 ringerc Note Added: 0005389
2005-07-05 03:15 ringerc Assigned To ringerc => fschmid
2005-07-05 09:30 cbradney Status resolved => closed
2006-05-16 22:10 christoph_s Relationship added child of 0003828
2015-09-17 20:08 Kunda Category Story Editor / Text Frames => Story Ed/Txt Frames
2015-09-17 20:12 Kunda Category Story Ed/Txt Frames => Story Editor / Text Frames