diff options
Diffstat (limited to 'lib/kotext')
-rw-r--r-- | lib/kotext/CMakeLists.txt | 57 | ||||
-rw-r--r-- | lib/kotext/KoAutoFormat.cpp | 10 | ||||
-rw-r--r-- | lib/kotext/KoAutoFormatDia.cpp | 2 | ||||
-rw-r--r-- | lib/kotext/kohyphen/CMakeLists.txt | 41 | ||||
-rw-r--r-- | lib/kotext/kohyphen/hyphdicts/CMakeLists.txt | 18 | ||||
-rw-r--r-- | lib/kotext/kohyphen/kohyphentest.cpp | 12 |
6 files changed, 131 insertions, 9 deletions
diff --git a/lib/kotext/CMakeLists.txt b/lib/kotext/CMakeLists.txt new file mode 100644 index 000000000..afc0688c9 --- /dev/null +++ b/lib/kotext/CMakeLists.txt @@ -0,0 +1,57 @@ +############################################################################### +# Trinity KOffice # +# --------------- # +# This file is licensed under the terms of GNU GPL v3 or later. # +# Improvements and feedback are welcome. # +############################################################################### + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib/store + ${CMAKE_SOURCE_DIR}/lib/kofficecore + ${CMAKE_SOURCE_DIR}/lib/kofficeui + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + +### Libraries ################################################################# +tde_add_library(kotext SHARED AUTOMOC + SOURCES + KoComplexText.cpp KoRichText.cpp + KoTextZoomHandler.cpp KoBorder.cpp + KoTextFormat.cpp KoParagCounter.cpp KoStyleCollection.cpp KoTextCommand.cpp + KoTextParag.cpp KoTextDocument.cpp KoTextFormatter.cpp KoParagLayout.cpp + KoTextObject.cpp KoTextView.cpp KoAutoFormat.cpp KoAutoFormatDia.cpp + KoParagDia.cpp KoVariable.cpp KoCustomVariablesDia.cpp + KoChangeCaseDia.cpp KoStyleManager.cpp KoSearchDia.cpp + timedateformatwidget.ui TimeFormatWidget.cpp DateFormatWidget.cpp + kofonttabbase.ui KoFontTab.cpp KoTextBookmark.cpp + kohighlightingtabbase.ui KoHighlightingTab.cpp + kodecorationtabbase.ui KoDecorationTab.cpp + kolayouttabbase.ui KoLayoutTab.cpp kolanguagetabbase.ui KoLanguageTab.cpp + KoFontDiaPreview.cpp KoCompletionDia.cpp KoCompletionBase.ui + KoTextViewIface.skel KoTextViewIface.cpp KoFontDia.cpp KoBgSpellCheck.cpp + KoCommentDia.cpp KoSpell.cpp KoCreateStyleDia.cpp KoTextCustomItem.cpp + KoImportStyleDia.cpp KoTextIterator.cpp KoOasisContext.cpp KoListStyleStack.cpp + KoUserStyle.cpp KoUserStyleCollection.cpp KoParagStyle.cpp KoParagDecorationTab.ui + LINK kofficeui-shared kohyphen-static tdespell2-shared tdeutils-shared + DESTINATION ${LIB_INSTALL_DIR} +) + +add_subdirectory(kohyphen) + +### Headers ################################################################### +# install( +# FILES +# KoTextZoomHandler.h KoTextFormat.h KoParagCounter.h KoStyleCollection.h +# KoTextDocument.h KoBgSpellCheck.h KoCommentDia.h KoCreateStyleDia.h +# DESTINATION ${INCLUDE_INSTALL_DIR}/KOffice +# ) + +# kate: indent-width 2; replace-tabs true;
\ No newline at end of file diff --git a/lib/kotext/KoAutoFormat.cpp b/lib/kotext/KoAutoFormat.cpp index 3306798d1..46d601208 100644 --- a/lib/kotext/KoAutoFormat.cpp +++ b/lib/kotext/KoAutoFormat.cpp @@ -335,7 +335,7 @@ void KoAutoFormat::readConfig(bool force) if( beginDoubleQuote.isEmpty()) { if( m_typographicDefaultDoubleQuotes.begin.isNull()) - m_typographicDoubleQuotes.begin = TQChar(''); + m_typographicDoubleQuotes.begin = TQChar('�'); else m_typographicDoubleQuotes.begin = m_typographicDefaultDoubleQuotes.begin; } @@ -345,7 +345,7 @@ void KoAutoFormat::readConfig(bool force) if( endDoubleQuote.isEmpty() ) { if( m_typographicDefaultDoubleQuotes.end.isNull()) - m_typographicDoubleQuotes.end = TQChar(''); + m_typographicDoubleQuotes.end = TQChar('�'); else m_typographicDoubleQuotes.end = m_typographicDefaultDoubleQuotes.end; } @@ -1654,11 +1654,11 @@ KCommand * KoAutoFormat::doAutoReplaceNumber( KoTextCursor* textEditCursor, KoTe textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor ); TQString replacement; if( word == TQString("1/2") ) - replacement=TQString(""); + replacement=TQString("�"); else if (word == TQString("1/4") ) - replacement=TQString(""); + replacement=TQString("�"); else if (word == TQString("3/4") ) - replacement=TQString(""); + replacement=TQString("�"); TQString cmdName = i18n("Autocorrect for Fraction"); KCommand *cmd =txtObj->replaceSelectionCommand( textEditCursor, replacement, cmdName, diff --git a/lib/kotext/KoAutoFormatDia.cpp b/lib/kotext/KoAutoFormatDia.cpp index 248415023..1383bec54 100644 --- a/lib/kotext/KoAutoFormatDia.cpp +++ b/lib/kotext/KoAutoFormatDia.cpp @@ -286,7 +286,7 @@ void KoAutoFormatDia::setupTab1() cbAutoReplaceNumber=new TQCheckBox( tab1 ); cbAutoReplaceNumber->setText( i18n( "We add the 1/2 char at the %1", "Re&place 1/2... with %1..." ) - .arg( TQString( "" ) ) ); + .arg( TQString( "�" ) ) ); TQWhatsThis::add( cbAutoReplaceNumber, i18n( "Most standard fraction notations will be converted when available" ) ); diff --git a/lib/kotext/kohyphen/CMakeLists.txt b/lib/kotext/kohyphen/CMakeLists.txt new file mode 100644 index 000000000..a9718a46c --- /dev/null +++ b/lib/kotext/kohyphen/CMakeLists.txt @@ -0,0 +1,41 @@ +############################################################################### +# Trinity KOffice # +# --------------- # +# This file is licensed under the terms of GNU GPL v3 or later. # +# Improvements and feedback are welcome. # +############################################################################### + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib/kofficecore + ${CMAKE_SOURCE_DIR}/lib/kofficeui + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + +### Libraries ################################################################# +tde_add_library(kohyphen STATIC_PIC AUTOMOC + SOURCES hnjalloc.c hyphen.c kohyphen.cpp + LINK tdecore-shared +) + +### Programs ################################################################## +if (BUILD_TESTS) + tde_add_executable(kohyphentest AUTOMOC + SOURCES kohyphentest.cpp + LINK + tdecore-shared tdeui-shared tdefx-shared tdeio-shared + tdetexteditor kohyphen-static + ) +endif() + +### Data ###################################################################### +add_subdirectory(hyphdicts) + +# kate: indent-width 2; replace-tabs true;
\ No newline at end of file diff --git a/lib/kotext/kohyphen/hyphdicts/CMakeLists.txt b/lib/kotext/kohyphen/hyphdicts/CMakeLists.txt new file mode 100644 index 000000000..95f8bb963 --- /dev/null +++ b/lib/kotext/kohyphen/hyphdicts/CMakeLists.txt @@ -0,0 +1,18 @@ +############################################################################### +# Trinity KOffice # +# --------------- # +# This file is licensed under the terms of GNU GPL v3 or later. # +# Improvements and feedback are welcome. # +############################################################################### + +### Data ###################################################################### +install( + FILES + dicts.xml + hyph_cs.dic hyph_en.dic hyph_hu.dic hyph_uk.dic hyph_da.dic hyph_de.dic + hyph_en_CA.dic hyph_es.dic hyph_fr.dic hyph_it.dic hyph_nl.dic hyph_pt_BR.dic + hyph_pt.dic hyph_pt_PT.dic hyph_ru.dic hyph_sk.dic hyph_sv.dic hyph_sl.dic + DESTINATION ${DATA_INSTALL_DIR}/koffice/hyphdicts +) + +# kate: indent-width 2; replace-tabs true;
\ No newline at end of file diff --git a/lib/kotext/kohyphen/kohyphentest.cpp b/lib/kotext/kohyphen/kohyphentest.cpp index 0f083631e..5a0d3ac0e 100644 --- a/lib/kotext/kohyphen/kohyphentest.cpp +++ b/lib/kotext/kohyphen/kohyphentest.cpp @@ -6,6 +6,7 @@ #include <tqstringlist.h> #include <tdeapplication.h> +#include <tdecmdlineargs.h> #include "kohyphen.h" #include <kdebug.h> @@ -40,7 +41,8 @@ void check_hyphenation( const TQStringList& tests, const TQStringList& results, int main (int argc, char ** argv) { - TDEApplication app(argc, argv, "KoHyphenator test"); + TDECmdLineArgs::init(argc, argv, "kohyphentest", "KoHyphenator test", 0, 0, true); + TDEApplication app; try { hypher = KoHyphenator::self(); @@ -54,8 +56,12 @@ int main (int argc, char ** argv) TQStringList::ConstIterator it, itres; //testing Czech language, this text is in UTF-8! - TQStringList cs_tests = TQStringList() << "Žluťoučký" << "kůň" << "úpěl" << - "ďábelské" << "ódy"; + TQStringList cs_tests; + cs_tests << TQString::fromLocal8Bit("Žluťoučký") + << TQString::fromLocal8Bit("kůň") + << TQString::fromLocal8Bit("úpěl") + << TQString::fromLocal8Bit("ďábelské") + << TQString::fromLocal8Bit("ódy"); for ( it = cs_tests.begin(); it != cs_tests.end() ; ++it ) kdDebug() << (*it) << " hyphenates like this: " << hypher->hyphenate((*it), "cs") << endl; |